Panda3D
x11GraphicsPipe.I
1 // Filename: x11GraphicsPipe.I
2 // Created by: drose (30Oct00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 
16 ////////////////////////////////////////////////////////////////////
17 // Function: x11GraphicsPipe::get_display
18 // Access: Public
19 // Description: Returns a pointer to the X display associated with
20 // the pipe: the display on which to create the windows.
21 ////////////////////////////////////////////////////////////////////
22 INLINE X11_Display *x11GraphicsPipe::
23 get_display() const {
24  return _display;
25 }
26 
27 ////////////////////////////////////////////////////////////////////
28 // Function: x11GraphicsPipe::get_screen
29 // Access: Public
30 // Description: Returns the X screen number associated with the pipe.
31 ////////////////////////////////////////////////////////////////////
32 INLINE int x11GraphicsPipe::
33 get_screen() const {
34  return _screen;
35 }
36 
37 ////////////////////////////////////////////////////////////////////
38 // Function: x11GraphicsPipe::get_root
39 // Access: Public
40 // Description: Returns the handle to the root window on the pipe's
41 // display.
42 ////////////////////////////////////////////////////////////////////
43 INLINE X11_Window x11GraphicsPipe::
44 get_root() const {
45  return _root;
46 }
47 
48 ////////////////////////////////////////////////////////////////////
49 // Function: x11GraphicsPipe::get_im
50 // Access: Public
51 // Description: Returns the input method opened for the pipe, or NULL
52 // if the input method could not be opened for some
53 // reason.
54 ////////////////////////////////////////////////////////////////////
55 INLINE XIM x11GraphicsPipe::
56 get_im() const {
57  return _im;
58 }
59 
60 ////////////////////////////////////////////////////////////////////
61 // Function: x11GraphicsPipe::get_hidden_cursor
62 // Access: Public
63 // Description: Returns an invisible Cursor suitable for assigning to
64 // windows that have the cursor_hidden property set.
65 ////////////////////////////////////////////////////////////////////
66 INLINE X11_Cursor x11GraphicsPipe::
68  if (_hidden_cursor == None) {
69  make_hidden_cursor();
70  }
71  return _hidden_cursor;
72 }
73 
74 ////////////////////////////////////////////////////////////////////
75 // Function: x11GraphicsPipe::disable_x_error_messages
76 // Access: Public, Static
77 // Description: Globally disables the printing of error messages that
78 // are raised by the X11 system, for instance in order
79 // to test whether a particular X11 operation will
80 // succeed. Reenable error messages with a later call
81 // to enable_x_error_messages().
82 //
83 // The return value is the current value of
84 // get_x_error_count().
85 ////////////////////////////////////////////////////////////////////
86 INLINE int x11GraphicsPipe::
88  _x_error_messages_enabled = false;
89  return _x_error_count;
90 }
91 
92 ////////////////////////////////////////////////////////////////////
93 // Function: x11GraphicsPipe::enable_x_error_messages
94 // Access: Public, Static
95 // Description: Reenables the printing of error messages after a
96 // previous call to disable_x_error_messages().
97 //
98 // The return value is the current value of
99 // get_x_error_count().
100 ////////////////////////////////////////////////////////////////////
101 INLINE int x11GraphicsPipe::
103  _x_error_messages_enabled = true;
104  return _x_error_count;
105 }
106 
107 ////////////////////////////////////////////////////////////////////
108 // Function: x11GraphicsPipe::get_x_error_count
109 // Access: Public, Static
110 // Description: Returns the number of times an error indication has
111 // been raised by the X11 system since application
112 // start, including errors raised while error messages
113 // were disabled.
114 ////////////////////////////////////////////////////////////////////
115 INLINE int x11GraphicsPipe::
117  return _x_error_count;
118 }
XIM get_im() const
Returns the input method opened for the pipe, or NULL if the input method could not be opened for som...
static int disable_x_error_messages()
Globally disables the printing of error messages that are raised by the X11 system, for instance in order to test whether a particular X11 operation will succeed.
X11_Window get_root() const
Returns the handle to the root window on the pipe's display.
static int enable_x_error_messages()
Reenables the printing of error messages after a previous call to disable_x_error_messages().
int get_screen() const
Returns the X screen number associated with the pipe.
X11_Cursor get_hidden_cursor()
Returns an invisible Cursor suitable for assigning to windows that have the cursor_hidden property se...
X11_Display * get_display() const
Returns a pointer to the X display associated with the pipe: the display on which to create the windo...
static int get_x_error_count()
Returns the number of times an error indication has been raised by the X11 system since application s...