VideoTools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
gxdisplay.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2017 Graeme Walker
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 // ===
17 ///
18 /// \file gxdisplay.h
19 ///
20 
21 #ifndef GX_DISPLAY_H
22 #define GX_DISPLAY_H
23 
24 #include "gdef.h"
25 #include "gxdef.h"
26 #include "gxcontext.h"
27 #include <list>
28 
29 namespace GX
30 {
31  class Display ;
32  class Context ;
33 }
34 
35 /// \class GX::Display
36 /// An Xlib Display wrapper.
37 ///
39 {
40 public:
41 
42  struct PixmapFormat /// A summary of one item in an Xlib XPixmapFormatValues list.
43  {
44  int depth ;
45  int bits_per_pixel ;
46  int scanline_pad ;
47  } ;
48 
49  Display() ;
50  ///< Constructor.
51 
52  ~Display() ;
53  ///< Destructor.
54 
55  ::Display * x() ;
56  ///< Returns the X object.
57 
58  int fd() const ;
59  ///< Returns a select()able file descriptor.
60 
61  int depth() const ;
62  ///< Returns the color depth (in bits).
63 
64  int white() const ;
65  ///< Returns the white colour value.
66 
67  int black() const ;
68  ///< Returns the black colour value.
69 
70  int dx() const ;
71  ///< Returns the default screen's width.
72 
73  int dy() const ;
74  ///< Returns the default screen's height.
75 
76  ::Colormap defaultColourmap() ;
77  ///< Returns the default colour map of the default
78  ///< screen.
79 
81  ///< Returns the default graphics context
82  ///< for the default screen.
83 
84  std::list<PixmapFormat> pixmapFormats() const ;
85  ///< Returns a list of supported pixmap formats.
86 
87 private:
88  Display( const Display & ) ;
89  void operator=( const Display & ) ;
90 
91 private:
92  ::Display * m_display ;
93  int m_black ;
94  int m_white ;
95  int m_depth ;
96  int m_dx ;
97  int m_dy ;
98 } ;
99 
100 #endif
::Display * x()
Returns the X object.
Definition: gxdisplay.cpp:53
An Xlib Display wrapper.
Definition: gxdisplay.h:38
int fd() const
Returns a select()able file descriptor.
Definition: gxdisplay.cpp:58
std::list< PixmapFormat > pixmapFormats() const
Returns a list of supported pixmap formats.
Definition: gxdisplay.cpp:100
Context defaultContext()
Returns the default graphics context for the default screen.
Definition: gxdisplay.cpp:69
A summary of one item in an Xlib XPixmapFormatValues list.
Definition: gxdisplay.h:42
int dy() const
Returns the default screen's height.
Definition: gxdisplay.cpp:95
An Xlib GC wrapper.
Definition: gxcontext.h:37
::Colormap defaultColourmap()
Returns the default colour map of the default screen.
Definition: gxdisplay.cpp:63
int white() const
Returns the white colour value.
Definition: gxdisplay.cpp:75
int black() const
Returns the black colour value.
Definition: gxdisplay.cpp:80
int depth() const
Returns the color depth (in bits).
Definition: gxdisplay.cpp:85
Display()
Constructor.
Definition: gxdisplay.cpp:27
~Display()
Destructor.
Definition: gxdisplay.cpp:42
int dx() const
Returns the default screen's width.
Definition: gxdisplay.cpp:90