14 #ifndef X11GRAPHICSPIPE_H
15 #define X11GRAPHICSPIPE_H
27 #define XF86DGADirectMouse 0x0004
29 typedef struct _XcursorFile XcursorFile;
30 typedef struct _XcursorImage XcursorImage;
31 typedef struct _XcursorImages XcursorImages;
33 typedef unsigned short Rotation;
34 typedef unsigned short SizeID;
35 typedef unsigned long XRRModeFlags;
40 typedef struct _XRRScreenConfiguration XRRScreenConfiguration;
50 unsigned long dotClock;
51 unsigned int hSyncStart;
52 unsigned int hSyncEnd;
55 unsigned int vSyncStart;
56 unsigned int vSyncEnd;
59 unsigned int nameLength;
60 XRRModeFlags modeFlags;
77 unsigned int width, height;
88 typedef void (*pfn_XRRFreeCrtcInfo)(
XRRCrtcInfo *crtcInfo);
104 INLINE XIM
get_im()
const;
120 int &x,
int &y,
int &width,
int &height);
127 Atom _wm_delete_window;
129 Atom _net_wm_window_type;
130 Atom _net_wm_window_type_splash;
131 Atom _net_wm_window_type_fullscreen;
133 Atom _net_wm_state_fullscreen;
134 Atom _net_wm_state_above;
135 Atom _net_wm_state_below;
136 Atom _net_wm_state_add;
137 Atom _net_wm_state_remove;
138 Atom _net_wm_bypass_compositor;
141 typedef int (*pfn_XcursorGetDefaultSize)(X11_Display *);
142 typedef XcursorImages *(*pfn_XcursorXcFileLoadImages)(XcursorFile *, int);
143 typedef X11_Cursor (*pfn_XcursorImagesLoadCursor)(X11_Display *,
const XcursorImages *);
144 typedef void (*pfn_XcursorImagesDestroy)(XcursorImages *);
145 typedef XcursorImage *(*pfn_XcursorImageCreate)(int, int);
146 typedef X11_Cursor (*pfn_XcursorImageLoadCursor)(X11_Display *,
const XcursorImage *);
147 typedef void (*pfn_XcursorImageDestroy)(XcursorImage *);
150 pfn_XcursorXcFileLoadImages _XcursorXcFileLoadImages;
151 pfn_XcursorImagesLoadCursor _XcursorImagesLoadCursor;
152 pfn_XcursorImagesDestroy _XcursorImagesDestroy;
153 pfn_XcursorImageCreate _XcursorImageCreate;
154 pfn_XcursorImageLoadCursor _XcursorImageLoadCursor;
155 pfn_XcursorImageDestroy _XcursorImageDestroy;
157 typedef Bool (*pfn_XRRQueryExtension)(X11_Display *,
int*,
int*);
158 typedef Status (*pfn_XRRQueryVersion)(X11_Display *,
int*,
int*);
159 typedef XRRScreenSize *(*pfn_XRRSizes)(X11_Display*, int,
int*);
160 typedef short *(*pfn_XRRRates)(X11_Display*, int, int,
int*);
161 typedef XRRScreenConfiguration *(*pfn_XRRGetScreenInfo)(X11_Display*, X11_Window);
162 typedef SizeID (*pfn_XRRConfigCurrentConfiguration)(XRRScreenConfiguration*, Rotation*);
163 typedef Status (*pfn_XRRSetScreenConfig)(X11_Display*, XRRScreenConfiguration *,
164 Drawable, int, Rotation, Time);
167 pfn_XRRSizes _XRRSizes;
168 pfn_XRRRates _XRRRates;
169 pfn_XRRGetScreenInfo _XRRGetScreenInfo;
170 pfn_XRRConfigCurrentConfiguration _XRRConfigCurrentConfiguration;
171 pfn_XRRSetScreenConfig _XRRSetScreenConfig;
174 X11_Display *_display;
179 X11_Cursor _hidden_cursor;
181 typedef Bool (*pfn_XF86DGAQueryVersion)(X11_Display *,
int*,
int*);
182 typedef Status (*pfn_XF86DGADirectVideo)(X11_Display *, int, int);
183 pfn_XF86DGADirectVideo _XF86DGADirectVideo;
188 pfn_XRRGetScreenResources _XRRGetScreenResourcesCurrent;
189 pfn_XRRFreeScreenResources _XRRFreeScreenResources;
190 pfn_XRRGetCrtcInfo _XRRGetCrtcInfo;
191 pfn_XRRFreeCrtcInfo _XRRFreeCrtcInfo;
194 void make_hidden_cursor();
195 void release_hidden_cursor();
197 static void install_error_handlers();
198 static int error_handler(X11_Display *display, XErrorEvent *error);
199 static int io_error_handler(X11_Display *display);
201 typedef int ErrorHandlerFunc(X11_Display *, XErrorEvent *);
202 typedef int IOErrorHandlerFunc(X11_Display *);
203 static bool _error_handlers_installed;
204 static ErrorHandlerFunc *_prev_error_handler;
205 static IOErrorHandlerFunc *_prev_io_error_handler;
207 static bool _x_error_messages_enabled;
208 static int _x_error_count;
219 static void init_type() {
220 GraphicsPipe::init_type();
222 GraphicsPipe::get_class_type());
225 return get_class_type();
227 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
A container for the various kinds of properties we might ask to have on a graphics frameBuffer before...
An object to create GraphicsOutputs that share a particular 3-D API.
A lightweight reentrant mutex.
TypeHandle is the identifier used to differentiate C++ class types.
This graphics pipe represents the interface for creating graphics windows on an X-based client.
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().
X11_Display * get_display() const
Returns a pointer to the X display associated with the pipe: the display on which to create the windo...
std::unique_ptr< XRRScreenResources, pfn_XRRFreeScreenResources > get_screen_resources() const
Returns an XRRScreenResources object, or null if RandR 1.2 is not supported.
std::unique_ptr< XRRCrtcInfo, pfn_XRRFreeCrtcInfo > get_crtc_info(XRRScreenResources *res, RRCrtc crtc) const
Returns an XRRCrtcInfo object, or null if RandR 1.2 is not supported.
RRCrtc find_fullscreen_crtc(const LPoint2i &point, int &x, int &y, int &width, int &height)
Finds a CRTC for going fullscreen to, at the given origin.
int get_screen() const
Returns the X screen number associated with the pipe.
XIM get_im() const
Returns the input method opened for the pipe, or NULL if the input method could not be opened for som...
virtual PreferredWindowThread get_preferred_window_thread() const
Returns an indication of the thread in which this GraphicsPipe requires its window processing to be p...
bool supports_relative_mouse() const
Returns true if relative mouse mode is supported on this display.
bool enable_relative_mouse()
Enables relative mouse mode for this display.
static int disable_x_error_messages()
Globally disables the printing of error messages that are raised by the X11 system,...
static int get_x_error_count()
Returns the number of times an error indication has been raised by the X11 system since application s...
X11_Cursor get_hidden_cursor()
Returns an invisible Cursor suitable for assigning to windows that have the cursor_hidden property se...
void disable_relative_mouse()
Disables relative mouse mode for this display.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.