]>
Dogcows Code - chaz/openbox/blob - otk/display.hh
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
17 //! The display instance for the library
18 extern Display
*display
;
20 //! Manages a single X11 display.
27 //! Does the display have the XKB extension?
29 //! Base for events for the XKB extension
32 //! Does the display have the Shape extension?
34 //! Base for events for the Shape extension
35 int _shape_event_basep
;
37 //! Does the display have the Xinerama extension?
39 //! Base for events for the Xinerama extension
40 int _xinerama_event_basep
;
42 //! A list of all possible combinations of keyboard lock masks
43 unsigned int _mask_list
[8];
45 //! The value of the mask for the NumLock modifier
46 unsigned int _num_lock_mask
;
48 //! The value of the mask for the ScrollLock modifier
49 unsigned int _scroll_lock_mask
;
51 //! The number of requested grabs on the display
54 //! A list of information for all screens on the display
55 ScreenInfo
** _screeninfo_list
;
57 //! A list of RenderControl objects, which are used for all graphics on a
59 RenderControl
** _rendercontrol_list
;
61 //! A cache for re-using GCs, used by the drawing objects
71 // Handles X errors on the display
73 Displays the error if compiled for debugging.
75 //int xerrorHandler(::Display *d, XErrorEvent *e);
78 //! Initializes the class, opens the X display
80 The DISPLAY environment variable is used to choose the display.
84 //! Destroys the class, closes the X display
87 //! Returns the GC cache for the application
88 inline GCCache
*gcCache() const { return _gccache
; }
90 //! Gets information on a specific screen
92 Returns a ScreenInfo class, which contains information for a screen on the
94 @param snum The screen number of the screen to retrieve info on
95 @return Info on the requested screen, in a ScreenInfo class
97 const ScreenInfo
* screenInfo(int snum
);
99 //! Find a ScreenInfo based on a root window
100 const ScreenInfo
* findScreen(Window root
);
102 //! Gets the RenderControl for a screen
103 const RenderControl
*renderControl(int snum
);
105 //! Returns if the display has the xkb extension available
106 inline bool xkb() const { return _xkb
; }
107 //! Returns the xkb extension's event base
108 inline int xkbEventBase() const { return _xkb_event_basep
; }
110 //! Returns if the display has the shape extension available
111 inline bool shape() const { return _shape
; }
112 //! Returns the shape extension's event base
113 inline int shapeEventBase() const { return _shape_event_basep
; }
114 //! Returns if the display has the xinerama extension available
115 inline bool xinerama() const { return _xinerama
; }
117 inline unsigned int numLockMask() const { return _num_lock_mask
; }
118 inline unsigned int scrollLockMask() const { return _scroll_lock_mask
; }
120 inline ::Display
* operator*() const { return _display
; }
122 //! Grabs the display
125 //! Ungrabs the display
131 void grabButton(unsigned int button
, unsigned int modifiers
,
132 Window grab_window
, bool owner_events
,
133 unsigned int event_mask
, int pointer_mode
,
134 int keyboard_mode
, Window confine_to
, Cursor cursor
,
135 bool allow_scroll_lock
) const;
136 void ungrabButton(unsigned int button
, unsigned int modifiers
,
137 Window grab_window
) const;
138 void grabKey(unsigned int keycode
, unsigned int modifiers
,
139 Window grab_window
, bool owner_events
,
140 int pointer_mode
, int keyboard_mode
,
141 bool allow_scroll_lock
) const;
142 void ungrabKey(unsigned int keycode
, unsigned int modifiers
,
143 Window grab_window
) const;
148 #endif // __display_hh
This page took 0.0411899999999999 seconds and 4 git commands to generate.