diff options
Diffstat (limited to 'src/BaseDisplay.hh')
-rw-r--r-- | src/BaseDisplay.hh | 446 |
1 files changed, 136 insertions, 310 deletions
diff --git a/src/BaseDisplay.hh b/src/BaseDisplay.hh index c25860e..173749c 100644 --- a/src/BaseDisplay.hh +++ b/src/BaseDisplay.hh | |||
@@ -1,3 +1,6 @@ | |||
1 | // BaseDisplay.hh for Fluxbox Window Manager | ||
2 | // Copyright (c) 2001 - 2002 Henrik Kinnunen (fluxgen@linuxmail.org) | ||
3 | // | ||
1 | // BaseDisplay.hh for Blackbox - an X11 Window manager | 4 | // BaseDisplay.hh for Blackbox - an X11 Window manager |
2 | // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) | 5 | // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) |
3 | // | 6 | // |
@@ -13,356 +16,179 @@ | |||
13 | // | 16 | // |
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
16 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
17 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | 20 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
18 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
21 | 24 | ||
22 | #ifndef _BASEDISPLAY_HH_ | 25 | // $Id: BaseDisplay.hh,v 1.21 2002/05/17 11:55:31 fluxgen Exp $ |
23 | #define _BASEDISPLAY_HH_ | 26 | |
27 | #ifndef BASEDISPLAY_HH | ||
28 | #define BASEDISPLAY_HH | ||
24 | 29 | ||
30 | #include "NotCopyable.hh" | ||
31 | #include "FbAtoms.hh" | ||
25 | #include <X11/Xlib.h> | 32 | #include <X11/Xlib.h> |
26 | #include <X11/Xatom.h> | 33 | |
34 | #ifdef XINERAMA | ||
35 | extern "C" { | ||
36 | #include <X11/extensions/Xinerama.h> | ||
37 | } | ||
38 | #endif // XINERAMA | ||
39 | |||
40 | #include <list> | ||
41 | #include <vector> | ||
27 | 42 | ||
28 | // forward declaration | 43 | // forward declaration |
29 | class BaseDisplay; | ||
30 | class ScreenInfo; | 44 | class ScreenInfo; |
31 | 45 | ||
32 | #include "LinkedList.hh" | 46 | #define PropBlackboxHintsElements (5) |
33 | #include "Timer.hh" | 47 | #define PropBlackboxAttributesElements (8) |
48 | |||
49 | void bexec(const char *command, char* displaystring); | ||
50 | |||
51 | class BaseDisplay:private NotCopyable, public FbAtoms | ||
52 | { | ||
34 | 53 | ||
35 | #define AttribShaded (1l << 0) | 54 | public: |
36 | #define AttribMaxHoriz (1l << 1) | 55 | BaseDisplay(char *, char * = 0); |
37 | #define AttribMaxVert (1l << 2) | 56 | virtual ~BaseDisplay(void); |
38 | #define AttribOmnipresent (1l << 3) | 57 | |
39 | #define AttribWorkspace (1l << 4) | 58 | enum Attrib { |
40 | #define AttribStack (1l << 5) | 59 | ATTRIB_SHADED = 0x01, |
41 | #define AttribDecoration (1l << 6) | 60 | ATTRIB_MAXHORIZ = 0x02, |
61 | ATTRIB_MAXVERT = 0x04, | ||
62 | ATTRIB_OMNIPRESENT = 0x08, | ||
63 | ATTRIB_WORKSPACE = 0x10, | ||
64 | ATTRIB_STACK = 0x20, | ||
65 | ATTRIB_DECORATION = 0x40 | ||
66 | }; | ||
67 | |||
68 | typedef struct _blackbox_hints { | ||
69 | unsigned long flags, attrib, workspace, stack; | ||
70 | int decoration; | ||
71 | } BlackboxHints; | ||
42 | 72 | ||
43 | #define StackTop (0) | 73 | typedef struct _blackbox_attributes { |
44 | #define StackNormal (1) | 74 | unsigned long flags, attrib, workspace, stack; |
45 | #define StackBottom (2) | 75 | int premax_x, premax_y; |
76 | unsigned int premax_w, premax_h; | ||
77 | } BlackboxAttributes; | ||
46 | 78 | ||
47 | #define DecorNone (0) | ||
48 | #define DecorNormal (1) | ||
49 | #define DecorTiny (2) | ||
50 | #define DecorTool (3) | ||
51 | 79 | ||
52 | typedef struct _blackbox_hints { | 80 | inline ScreenInfo *getScreenInfo(int s) { return screenInfoList[s]; } |
53 | unsigned long flags, attrib, workspace, stack, decoration; | ||
54 | } BlackboxHints; | ||
55 | 81 | ||
56 | typedef struct _blackbox_attributes { | 82 | inline bool hasShapeExtensions(void) const { return shape.extensions; } |
57 | unsigned long flags, attrib, workspace, stack; | 83 | inline bool doShutdown(void) const { return m_shutdown; } |
58 | int premax_x, premax_y; | 84 | inline bool isStartup(void) const { return m_startup; } |
59 | unsigned int premax_w, premax_h; | ||
60 | } BlackboxAttributes; | ||
61 | 85 | ||
62 | #define PropBlackboxHintsElements (5) | 86 | inline const Cursor &getSessionCursor(void) const { return cursor.session; } |
63 | #define PropBlackboxAttributesElements (8) | 87 | inline const Cursor &getMoveCursor(void) const { return cursor.move; } |
88 | inline const Cursor &getLowerLeftAngleCursor(void) const { return cursor.ll_angle; } | ||
89 | inline const Cursor &getLowerRightAngleCursor(void) const { return cursor.lr_angle; } | ||
64 | 90 | ||
65 | #ifndef __EMX__ | 91 | inline Display *getXDisplay(void) { return m_display; } |
66 | void bexec(const char *, char *); | ||
67 | #endif // !__EMX__ | ||
68 | 92 | ||
69 | char *bstrdup(const char *); | 93 | inline const char *getXDisplayName(void) const { return const_cast<const char *>(m_display_name); } |
70 | template <typename Z> inline Z min(Z a, Z b) { return ((a < b) ? a : b); } | 94 | inline const char *getApplicationName(void) const { return const_cast<const char *>(m_app_name); } |
71 | template <typename Z> inline Z max(Z a, Z b) { return ((a > b) ? a : b); } | ||
72 | 95 | ||
73 | class BaseDisplay { | 96 | inline int getNumberOfScreens(void) const { return number_of_screens; } |
97 | inline int getShapeEventBase(void) const { return shape.event_basep; } | ||
98 | |||
99 | inline void shutdown(void) { m_shutdown = true; } | ||
100 | inline void run(void) { m_startup = m_shutdown = false; } | ||
101 | |||
102 | bool validateWindow(Window); | ||
103 | |||
104 | void grab(void); | ||
105 | void ungrab(void); | ||
106 | void eventLoop(void); | ||
107 | |||
108 | // another pure virtual... this is used to handle signals that BaseDisplay | ||
109 | // doesn't understand itself | ||
110 | virtual Bool handleSignal(int) = 0; | ||
111 | |||
112 | class GrabGuard:private NotCopyable | ||
113 | { | ||
114 | public: | ||
115 | GrabGuard(BaseDisplay &bd):m_bd(bd) { } | ||
116 | ~GrabGuard() { m_bd.ungrab(); } | ||
117 | inline void grab() { m_bd.grab(); } | ||
118 | inline void ungrab() { m_bd.ungrab(); } | ||
119 | private: | ||
120 | BaseDisplay &m_bd; | ||
121 | }; | ||
74 | 122 | ||
75 | public: | ||
76 | BaseDisplay(char *, char * = 0); | ||
77 | virtual ~BaseDisplay(void); | ||
78 | |||
79 | #ifdef GNOME | ||
80 | inline Atom *getGnomeListAtoms() { return gnome_atom_list; } | ||
81 | inline Atom &getGnomeProtAtom() { return gnome_wm_prot; } | ||
82 | inline Atom &getGnomeClientListAtom() { return gnome_wm_win_client_list; } | ||
83 | inline Atom &getGnomeSupportingWMCheckAtom() { return gnome_wm_supporting_wm_check; } | ||
84 | inline Atom &getGnomeWorkspaceAtom() { return gnome_wm_win_workspace; } | ||
85 | inline Atom &getGnomeWorkspaceCountAtom() { return gnome_wm_win_workspace_count; } | ||
86 | inline Atom &getGnomeWorkspaceNamesAtom() { return gnome_wm_win_workspace_names; } | ||
87 | #endif //GNOME | ||
88 | |||
89 | inline const Atom &getWMChangeStateAtom(void) const | ||
90 | { return xa_wm_change_state; } | ||
91 | inline const Atom &getWMStateAtom(void) const | ||
92 | { return xa_wm_state; } | ||
93 | inline const Atom &getWMDeleteAtom(void) const | ||
94 | { return xa_wm_delete_window; } | ||
95 | inline const Atom &getWMProtocolsAtom(void) const | ||
96 | { return xa_wm_protocols; } | ||
97 | inline const Atom &getWMTakeFocusAtom(void) const | ||
98 | { return xa_wm_take_focus; } | ||
99 | inline const Atom &getWMColormapAtom(void) const | ||
100 | { return xa_wm_colormap_windows; } | ||
101 | inline const Atom &getMotifWMHintsAtom(void) const | ||
102 | { return motif_wm_hints; } | ||
103 | |||
104 | // this atom is for normal app->WM hints about decorations, stacking, | ||
105 | // starting workspace etc... | ||
106 | inline const Atom &getFluxboxHintsAtom(void) const | ||
107 | { return blackbox_hints;} | ||
108 | |||
109 | // these atoms are for normal app->WM interaction beyond the scope of the | ||
110 | // ICCCM... | ||
111 | inline const Atom &getFluxboxAttributesAtom(void) const | ||
112 | { return blackbox_attributes; } | ||
113 | inline const Atom &getFluxboxChangeAttributesAtom(void) const | ||
114 | { return blackbox_change_attributes; } | ||
115 | |||
116 | // these atoms are for window->WM interaction, with more control and | ||
117 | // information on window "structure"... common examples are | ||
118 | // notifying apps when windows are raised/lowered... when the user changes | ||
119 | // workspaces... i.e. "pager talk" | ||
120 | inline const Atom &getFluxboxStructureMessagesAtom(void) const | ||
121 | { return blackbox_structure_messages; } | ||
122 | |||
123 | // *Notify* portions of the NETStructureMessages protocol | ||
124 | inline const Atom &getFluxboxNotifyStartupAtom(void) const | ||
125 | { return blackbox_notify_startup; } | ||
126 | inline const Atom &getFluxboxNotifyWindowAddAtom(void) const | ||
127 | { return blackbox_notify_window_add; } | ||
128 | inline const Atom &getFluxboxNotifyWindowDelAtom(void) const | ||
129 | { return blackbox_notify_window_del; } | ||
130 | inline const Atom &getFluxboxNotifyWindowFocusAtom(void) const | ||
131 | { return blackbox_notify_window_focus; } | ||
132 | inline const Atom &getFluxboxNotifyCurrentWorkspaceAtom(void) const | ||
133 | { return blackbox_notify_current_workspace; } | ||
134 | inline const Atom &getFluxboxNotifyWorkspaceCountAtom(void) const | ||
135 | { return blackbox_notify_workspace_count; } | ||
136 | inline const Atom &getFluxboxNotifyWindowRaiseAtom(void) const | ||
137 | { return blackbox_notify_window_raise; } | ||
138 | inline const Atom &getFluxboxNotifyWindowLowerAtom(void) const | ||
139 | { return blackbox_notify_window_lower; } | ||
140 | |||
141 | // atoms to change that request changes to the desktop environment during | ||
142 | // runtime... these messages can be sent by any client... as the sending | ||
143 | // client window id is not included in the ClientMessage event... | ||
144 | inline const Atom &getFluxboxChangeWorkspaceAtom(void) const | ||
145 | { return blackbox_change_workspace; } | ||
146 | inline const Atom &getFluxboxChangeWindowFocusAtom(void) const | ||
147 | { return blackbox_change_window_focus; } | ||
148 | inline const Atom &getFluxboxCycleWindowFocusAtom(void) const | ||
149 | { return blackbox_cycle_window_focus; } | ||
150 | |||
151 | #ifdef NEWWMSPEC | ||
152 | |||
153 | // root window properties | ||
154 | inline const Atom &getNETSupportedAtom(void) const | ||
155 | { return net_supported; } | ||
156 | inline const Atom &getNETClientListAtom(void) const | ||
157 | { return net_client_list; } | ||
158 | inline const Atom &getNETClientListStackingAtom(void) const | ||
159 | { return net_client_list_stacking; } | ||
160 | inline const Atom &getNETNumberOfDesktopsAtom(void) const | ||
161 | { return net_number_of_desktops; } | ||
162 | inline const Atom &getNETDesktopGeometryAtom(void) const | ||
163 | { return net_desktop_geometry; } | ||
164 | inline const Atom &getNETDesktopViewportAtom(void) const | ||
165 | { return net_desktop_viewport; } | ||
166 | inline const Atom &getNETCurrentDesktopAtom(void) const | ||
167 | { return net_current_desktop; } | ||
168 | inline const Atom &getNETDesktopNamesAtom(void) const | ||
169 | { return net_desktop_names; } | ||
170 | inline const Atom &getNETActiveWindowAtom(void) const | ||
171 | { return net_active_window; } | ||
172 | inline const Atom &getNETWorkareaAtom(void) const | ||
173 | { return net_workarea; } | ||
174 | inline const Atom &getNETSupportingWMCheckAtom(void) const | ||
175 | { return net_supporting_wm_check; } | ||
176 | inline const Atom &getNETVirtualRootsAtom(void) const | ||
177 | { return net_virtual_roots; } | ||
178 | |||
179 | // root window messages | ||
180 | inline const Atom &getNETCloseWindowAtom(void) const | ||
181 | { return net_close_window; } | ||
182 | inline const Atom &getNETWMMoveResizeAtom(void) const | ||
183 | { return net_wm_moveresize; } | ||
184 | |||
185 | // application window properties | ||
186 | inline const Atom &getNETPropertiesAtom(void) const | ||
187 | { return net_properties; } | ||
188 | inline const Atom &getNETWMNameAtom(void) const | ||
189 | { return net_wm_name; } | ||
190 | inline const Atom &getNETWMDesktopAtom(void) const | ||
191 | { return net_wm_desktop; } | ||
192 | inline const Atom &getNETWMWindowTypeAtom(void) const | ||
193 | { return net_wm_window_type; } | ||
194 | inline const Atom &getNETWMStateAtom(void) const | ||
195 | { return net_wm_state; } | ||
196 | inline const Atom &getNETWMStrutAtom(void) const | ||
197 | { return net_wm_strut; } | ||
198 | inline const Atom &getNETWMIconGeometryAtom(void) const | ||
199 | { return net_wm_icon_geometry; } | ||
200 | inline const Atom &getNETWMIconAtom(void) const | ||
201 | { return net_wm_icon; } | ||
202 | inline const Atom &getNETWMPidAtom(void) const | ||
203 | { return net_wm_pid; } | ||
204 | inline const Atom &getNETWMHandledIconsAtom(void) const | ||
205 | { return net_wm_handled_icons; } | ||
206 | |||
207 | // application protocols | ||
208 | inline const Atom &getNETWMPingAtom(void) const | ||
209 | { return net_wm_ping; } | ||
210 | |||
211 | #endif // NEWWMSPEC | ||
212 | |||
213 | inline ScreenInfo *getScreenInfo(int s) | ||
214 | { return (ScreenInfo *) screenInfoList->find(s); } | ||
215 | |||
216 | inline const Bool &hasShapeExtensions(void) const | ||
217 | { return shape.extensions; } | ||
218 | inline const Bool &doShutdown(void) const | ||
219 | { return _shutdown; } | ||
220 | inline const Bool &isStartup(void) const | ||
221 | { return _startup; } | ||
222 | |||
223 | inline const Cursor &getSessionCursor(void) const | ||
224 | { return cursor.session; } | ||
225 | inline const Cursor &getMoveCursor(void) const | ||
226 | { return cursor.move; } | ||
227 | inline const Cursor &getLowerLeftAngleCursor(void) const | ||
228 | { return cursor.ll_angle; } | ||
229 | inline const Cursor &getLowerRightAngleCursor(void) const | ||
230 | { return cursor.lr_angle; } | ||
231 | |||
232 | inline Display *getXDisplay(void) { return display; } | ||
233 | |||
234 | inline const char *getXDisplayName(void) const | ||
235 | { return (const char *) display_name; } | ||
236 | inline const char *getApplicationName(void) const | ||
237 | { return (const char *) application_name; } | ||
238 | |||
239 | inline const int &getNumberOfScreens(void) const | ||
240 | { return number_of_screens; } | ||
241 | inline const int &getShapeEventBase(void) const | ||
242 | { return shape.event_basep; } | ||
243 | |||
244 | inline void shutdown(void) { _shutdown = True; } | ||
245 | inline void run(void) { _startup = _shutdown = False; } | ||
246 | |||
247 | const Bool validateWindow(Window); | ||
248 | |||
249 | void grab(void); | ||
250 | void ungrab(void); | ||
251 | void eventLoop(void); | ||
252 | void addTimer(BTimer *); | ||
253 | void removeTimer(BTimer *); | ||
254 | |||
255 | // another pure virtual... this is used to handle signals that BaseDisplay | ||
256 | // doesn't understand itself | ||
257 | virtual Bool handleSignal(int) = 0; | ||
258 | |||
259 | private: | 123 | private: |
260 | struct cursor { | 124 | struct cursor { |
261 | Cursor session, move, ll_angle, lr_angle; | 125 | Cursor session, move, ll_angle, lr_angle; |
262 | } cursor; | 126 | } cursor; |
263 | |||
264 | struct shape { | ||
265 | Bool extensions; | ||
266 | int event_basep, error_basep; | ||
267 | } shape; | ||
268 | |||
269 | Atom xa_wm_colormap_windows, xa_wm_protocols, xa_wm_state, | ||
270 | xa_wm_delete_window, xa_wm_take_focus, xa_wm_change_state, | ||
271 | motif_wm_hints; | ||
272 | |||
273 | // NETAttributes | ||
274 | Atom blackbox_attributes, blackbox_change_attributes, blackbox_hints; | ||
275 | |||
276 | // NETStructureMessages | ||
277 | Atom blackbox_structure_messages, blackbox_notify_startup, | ||
278 | blackbox_notify_window_add, blackbox_notify_window_del, | ||
279 | blackbox_notify_window_focus, blackbox_notify_current_workspace, | ||
280 | blackbox_notify_workspace_count, blackbox_notify_window_raise, | ||
281 | blackbox_notify_window_lower; | ||
282 | |||
283 | // message_types for client -> wm messages | ||
284 | Atom blackbox_change_workspace, blackbox_change_window_focus, | ||
285 | blackbox_cycle_window_focus; | ||
286 | |||
287 | #ifdef NEWWMSPEC | ||
288 | |||
289 | // root window properties | ||
290 | Atom net_supported, net_client_list, net_client_list_stacking, | ||
291 | net_number_of_desktops, net_desktop_geometry, net_desktop_viewport, | ||
292 | net_current_desktop, net_desktop_names, net_active_window, net_workarea, | ||
293 | net_supporting_wm_check, net_virtual_roots; | ||
294 | |||
295 | // root window messages | ||
296 | Atom net_close_window, net_wm_moveresize; | ||
297 | |||
298 | // application window properties | ||
299 | Atom net_properties, net_wm_name, net_wm_desktop, net_wm_window_type, | ||
300 | net_wm_state, net_wm_strut, net_wm_icon_geometry, net_wm_icon, net_wm_pid, | ||
301 | net_wm_handled_icons; | ||
302 | |||
303 | |||
304 | // application protocols | ||
305 | Atom net_wm_ping; | ||
306 | |||
307 | #endif // NEWWMSPEC | ||
308 | |||
309 | #ifdef GNOME | ||
310 | union { | ||
311 | Atom gnome_wm_win_layer, gnome_wm_win_state, gnome_wm_win_hints, | ||
312 | gnome_wm_win_app_state, gnome_wm_win_expanded_size, | ||
313 | gnome_wm_win_icons, gnome_wm_win_workspace, | ||
314 | gnome_wm_win_workspace_count, gnome_wm_win_workspace_names, | ||
315 | gnome_wm_win_client_list; | ||
316 | Atom gnome_atom_list[10]; | ||
317 | }; | ||
318 | Atom gnome_wm_prot; | ||
319 | Atom gnome_wm_supporting_wm_check; | ||
320 | #endif // GNOME | ||
321 | 127 | ||
128 | struct shape { | ||
129 | Bool extensions; | ||
130 | int event_basep, error_basep; | ||
131 | } shape; | ||
322 | 132 | ||
323 | Bool _startup, _shutdown; | 133 | bool m_startup, m_shutdown; |
324 | Display *display; | 134 | Display *m_display; |
325 | LinkedList<ScreenInfo> *screenInfoList; | ||
326 | LinkedList<BTimer> *timerList; | ||
327 | 135 | ||
328 | char *display_name, *application_name; | 136 | typedef std::vector<ScreenInfo *> ScreenInfoList; |
329 | int number_of_screens, server_grabs, colors_per_channel; | 137 | ScreenInfoList screenInfoList; |
330 | 138 | ||
331 | protected: | 139 | char *m_display_name, *m_app_name; |
332 | 140 | int number_of_screens, m_server_grabs, colors_per_channel; | |
333 | virtual void process_event(XEvent *) = 0; | ||
334 | 141 | ||
142 | protected: | ||
143 | virtual void process_event(XEvent *) = 0; | ||
335 | 144 | ||
336 | }; | 145 | }; |
337 | 146 | ||
338 | 147 | ||
339 | class ScreenInfo { | 148 | class ScreenInfo { |
340 | public: | 149 | public: |
341 | ScreenInfo(BaseDisplay *, int); | 150 | ScreenInfo(BaseDisplay *, int); |
342 | 151 | ~ScreenInfo(void); | |
343 | inline BaseDisplay *getBaseDisplay(void) { return basedisplay; } | ||
344 | 152 | ||
345 | inline Visual *getVisual(void) { return visual; } | 153 | inline BaseDisplay *getBaseDisplay(void) { return basedisplay; } |
346 | inline const Window &getRootWindow(void) const { return root_window; } | ||
347 | inline const Colormap &getColormap(void) const { return colormap; } | ||
348 | 154 | ||
349 | inline const int &getDepth(void) const { return depth; } | 155 | inline Visual *getVisual(void) { return visual; } |
350 | inline const int &getScreenNumber(void) const { return screen_number; } | 156 | inline const Window &getRootWindow(void) const { return root_window; } |
157 | inline const Colormap &getColormap(void) const { return colormap; } | ||
351 | 158 | ||
352 | inline const unsigned int &getWidth(void) const { return width; } | 159 | inline int getDepth(void) const { return depth; } |
353 | inline const unsigned int &getHeight(void) const { return height; } | 160 | inline int getScreenNumber(void) const { return screen_number; } |
354 | 161 | ||
355 | private: | 162 | inline unsigned int getWidth(void) const { return width; } |
356 | BaseDisplay *basedisplay; | 163 | inline unsigned int getHeight(void) const { return height; } |
357 | Visual *visual; | ||
358 | Window root_window; | ||
359 | Colormap colormap; | ||
360 | 164 | ||
361 | int depth, screen_number; | 165 | #ifdef XINERAMA |
362 | unsigned int width, height; | 166 | inline bool hasXinerama(void) const { return m_hasXinerama; } |
167 | inline int getNumHeads(void) const { return xineramaNumHeads; } | ||
168 | unsigned int getHead(int x, int y) const; | ||
169 | unsigned int getCurrHead(void) const; | ||
170 | unsigned int getHeadWidth(unsigned int head) const; | ||
171 | unsigned int getHeadHeight(unsigned int head) const; | ||
172 | int getHeadX(unsigned int head) const; | ||
173 | int getHeadY(unsigned int head) const; | ||
174 | #endif // XINERAMA | ||
363 | 175 | ||
176 | private: | ||
177 | BaseDisplay *basedisplay; | ||
178 | Visual *visual; | ||
179 | Window root_window; | ||
180 | Colormap colormap; | ||
181 | |||
182 | int depth, screen_number; | ||
183 | unsigned int width, height; | ||
184 | #ifdef XINERAMA | ||
185 | bool m_hasXinerama; | ||
186 | int xineramaMajor, xineramaMinor, xineramaNumHeads, xineramaLastHead; | ||
187 | XineramaScreenInfo *xineramaInfos; | ||
188 | #endif // XINERAMA | ||
364 | 189 | ||
365 | }; | 190 | }; |
366 | 191 | ||
367 | 192 | ||
368 | #endif // __BaseDisplay_hh | 193 | |
194 | #endif // BASEDISPLAY_HH | ||