]> git.decadent.org.uk Git - videolink.git/blob - framebuffer.hpp
3e4987564382d22f1b1a30e8ab117eb580296624
[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_fd.hpp"
11 #include "auto_proc.hpp"
12 #include "temp_file.hpp"
13
14 // Run Xvfb with a frame buffer of the given dimensions.
15 class FrameBuffer
16 {
17 public:
18     FrameBuffer(int width, int height, int depth);
19     std::string get_x_authority() const;
20     std::string get_x_display() const;
21
22 private:
23     auto_fd tcp4_socket_, tcp6_socket_;
24     int display_num_;
25     std::auto_ptr<temp_file> auth_file_;
26     auto_kill_proc server_proc_;
27 };
28
29 #endif // !INC_FRAMEBUFFER_HPP