VideoTools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
gxvisual.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 gxvisual.h
19 ///
20 
21 #ifndef GX_VISUAL_H
22 #define GX_VISUAL_H
23 
24 #include "gdef.h"
25 #include "gxdef.h"
26 #include <list>
27 #include <string>
28 
29 namespace GX
30 {
31  class Visual ;
32  class Display ;
33 }
34 
35 /// \class GX::Visual
36 /// An Xlib XVisual wrapper.
37 ///
39 {
40 public:
41  typedef ::XVisualInfo Info ;
42 
43  static std::list<Info> infoList( Display & ) ;
44  ///< Returns a list of supported "visuals" for
45  ///< the default screen.
46 
47  explicit Visual( Display & ) ;
48  ///< Constructor for the display's default visual.
49 
50  Visual( Display & , const Info & ) ;
51  ///< Constructor.
52 
53  ~Visual() ;
54  ///< Destructor.
55 
56  ::Visual * x() ;
57  ///< Returns the X object.
58 
59  ::VisualID id() const ;
60  ///< Returns the id.
61 
62  int depth() const ;
63  ///< Returns the depth.
64 
65  int type() const ;
66  ///< Returns the type.
67 
68  std::string typeName() const ;
69  ///< Returns the type name.
70 
71 private:
72  void init( Display & , VisualID ) ;
73  static void check( bool ) ;
74  Visual( const Visual & ) ;
75  void operator=( const Visual & ) ;
76 
77 private:
78  ::XVisualInfo m_info ;
79 } ;
80 
81 #endif
Visual(Display &)
Constructor for the display's default visual.
Definition: gxvisual.cpp:28
int type() const
Returns the type.
Definition: gxvisual.cpp:98
An Xlib Display wrapper.
Definition: gxdisplay.h:38
std::string typeName() const
Returns the type name.
Definition: gxvisual.cpp:108
static std::list< Info > infoList(Display &)
Returns a list of supported "visuals" for the default screen.
Definition: gxvisual.cpp:66
int depth() const
Returns the depth.
Definition: gxvisual.cpp:103
~Visual()
Destructor.
Definition: gxvisual.cpp:57
An Xlib XVisual wrapper.
Definition: gxvisual.h:38
::VisualID id() const
Returns the id.
Definition: gxvisual.cpp:86
::Visual * x()
Returns the X object.
Definition: gxvisual.cpp:61