Replaced auto_temp_file with temp_file, which handles creation as well as deletion.
[videolink.git] / framebuffer.hpp
1 // Copyright 2005 Ben Hutchings <ben@decadentplace.org.uk>.
2 // See the file "COPYING" for licence details.
3
4 #ifndef INC_FRAMEBUFFER_HPP
5 #define INC_FRAMEBUFFER_HPP
6
7 #include <memory>
8 #include <string>
9
10 #include "auto_proc.hpp"
11 #include "temp_file.hpp"
12
13 // Run Xvfb with a frame buffer of the given dimensions.
14 class FrameBuffer
15 {
16 public:
17     FrameBuffer(int width, int height, int depth);
18     std::string get_x_authority() const;
19     std::string get_x_display() const;
20
21 private:
22     int display_num_;
23     std::auto_ptr<temp_file> auth_file_;
24     auto_kill_proc server_proc_;
25 };
26
27 #endif // !INC_FRAMEBUFFER_HPP