aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-03-18 15:28:25 (GMT)
committerfluxgen <fluxgen>2002-03-18 15:28:25 (GMT)
commitbcfcc6403a62a4ba2a0f7d1c4b1b3be9ee07251b (patch)
tree7b6f07b83940eb1c898a3b3406ab0520afce98e8 /src
parent0e0f5800e1cb21cf79bc85579b05dbc7d2fe9a93 (diff)
downloadfluxbox_pavel-bcfcc6403a62a4ba2a0f7d1c4b1b3be9ee07251b.zip
fluxbox_pavel-bcfcc6403a62a4ba2a0f7d1c4b1b3be9ee07251b.tar.bz2
moved Atoms into FbAtoms
Diffstat (limited to 'src')
-rw-r--r--src/BaseDisplay.cc97
-rw-r--r--src/BaseDisplay.hh245
2 files changed, 23 insertions, 319 deletions
diff --git a/src/BaseDisplay.cc b/src/BaseDisplay.cc
index fae87f6..9a24081 100644
--- a/src/BaseDisplay.cc
+++ b/src/BaseDisplay.cc
@@ -22,7 +22,7 @@
22// 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
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: BaseDisplay.cc,v 1.6 2002/02/11 10:57:23 fluxgen Exp $ 25// $Id: BaseDisplay.cc,v 1.7 2002/03/18 15:28:25 fluxgen Exp $
26 26
27// use some GNU extensions 27// use some GNU extensions
28#ifndef _GNU_SOURCE 28#ifndef _GNU_SOURCE
@@ -219,7 +219,7 @@ void bexec(const char *command, char* displaystring) {
219#endif // !__EMX__ 219#endif // !__EMX__
220 220
221 221
222BaseDisplay::BaseDisplay(char *app_name, char *dpy_name): 222BaseDisplay::BaseDisplay(char *app_name, char *dpy_name):FbAtoms(0),
223m_startup(true), m_shutdown(false), 223m_startup(true), m_shutdown(false),
224m_display_name(XDisplayName(dpy_name)), m_app_name(app_name), 224m_display_name(XDisplayName(dpy_name)), m_app_name(app_name),
225m_server_grabs(0) 225m_server_grabs(0)
@@ -280,6 +280,8 @@ m_server_grabs(0)
280 "as close-on-exec\n")); 280 "as close-on-exec\n"));
281 throw static_cast<int>(2); //throw error 2 281 throw static_cast<int>(2); //throw error 2
282 } 282 }
283 //initiate atoms
284 initAtoms(m_display);
283 285
284 number_of_screens = ScreenCount(m_display); 286 number_of_screens = ScreenCount(m_display);
285 287
@@ -289,97 +291,6 @@ m_server_grabs(0)
289#else // !SHAPE 291#else // !SHAPE
290 shape.extensions = False; 292 shape.extensions = False;
291#endif // SHAPE 293#endif // SHAPE
292//---------- setup atoms
293
294 xa_wm_colormap_windows =
295 XInternAtom(m_display, "WM_COLORMAP_WINDOWS", False);
296 xa_wm_protocols = XInternAtom(m_display, "WM_PROTOCOLS", False);
297 xa_wm_state = XInternAtom(m_display, "WM_STATE", False);
298 xa_wm_change_state = XInternAtom(m_display, "WM_CHANGE_STATE", False);
299 xa_wm_delete_window = XInternAtom(m_display, "WM_DELETE_WINDOW", False);
300 xa_wm_take_focus = XInternAtom(m_display, "WM_TAKE_FOCUS", False);
301 motif_wm_hints = XInternAtom(m_display, "_MOTIF_WM_HINTS", False);
302
303 blackbox_hints = XInternAtom(m_display, "_BLACKBOX_HINTS", False);
304 blackbox_attributes = XInternAtom(m_display, "_BLACKBOX_ATTRIBUTES", False);
305 blackbox_change_attributes =
306 XInternAtom(m_display, "_BLACKBOX_CHANGE_ATTRIBUTES", False);
307
308 blackbox_structure_messages =
309 XInternAtom(m_display, "_BLACKBOX_STRUCTURE_MESSAGES", False);
310 blackbox_notify_startup =
311 XInternAtom(m_display, "_BLACKBOX_NOTIFY_STARTUP", False);
312 blackbox_notify_window_add =
313 XInternAtom(m_display, "_BLACKBOX_NOTIFY_WINDOW_ADD", False);
314 blackbox_notify_window_del =
315 XInternAtom(m_display, "_BLACKBOX_NOTIFY_WINDOW_DEL", False);
316 blackbox_notify_current_workspace =
317 XInternAtom(m_display, "_BLACKBOX_NOTIFY_CURRENT_WORKSPACE", False);
318 blackbox_notify_workspace_count =
319 XInternAtom(m_display, "_BLACKBOX_NOTIFY_WORKSPACE_COUNT", False);
320 blackbox_notify_window_focus =
321 XInternAtom(m_display, "_BLACKBOX_NOTIFY_WINDOW_FOCUS", False);
322 blackbox_notify_window_raise =
323 XInternAtom(m_display, "_BLACKBOX_NOTIFY_WINDOW_RAISE", False);
324 blackbox_notify_window_lower =
325 XInternAtom(m_display, "_BLACKBOX_NOTIFY_WINDOW_LOWER", False);
326
327 blackbox_change_workspace =
328 XInternAtom(m_display, "_BLACKBOX_CHANGE_WORKSPACE", False);
329 blackbox_change_window_focus =
330 XInternAtom(m_display, "_BLACKBOX_CHANGE_WINDOW_FOCUS", False);
331 blackbox_cycle_window_focus =
332 XInternAtom(m_display, "_BLACKBOX_CYCLE_WINDOW_FOCUS", False);
333
334#ifdef NEWWMSPEC
335
336 net_supported = XInternAtom(m_display, "_NET_SUPPORTED", False);
337 net_client_list = XInternAtom(m_display, "_NET_CLIENT_LIST", False);
338 net_client_list_stacking = XInternAtom(m_display, "_NET_CLIENT_LIST_STACKING", False);
339 net_number_of_desktops = XInternAtom(m_display, "_NET_NUMBER_OF_DESKTOPS", False);
340 net_desktop_geometry = XInternAtom(m_display, "_NET_DESKTOP_GEOMETRY", False);
341 net_desktop_viewport = XInternAtom(m_display, "_NET_DESKTOP_VIEWPORT", False);
342 net_current_desktop = XInternAtom(m_display, "_NET_CURRENT_DESKTOP", False);
343 net_desktop_names = XInternAtom(m_display, "_NET_DESKTOP_NAMES", False);
344 net_active_window = XInternAtom(m_display, "_NET_ACTIVE_WINDOW", False);
345 net_workarea = XInternAtom(m_display, "_NET_WORKAREA", False);
346 net_supporting_wm_check = XInternAtom(m_display, "_NET_SUPPORTING_WM_CHECK", False);
347 net_virtual_roots = XInternAtom(m_display, "_NET_VIRTUAL_ROOTS", False);
348
349 net_close_window = XInternAtom(m_display, "_NET_CLOSE_WINDOW", False);
350 net_wm_moveresize = XInternAtom(m_display, "_NET_WM_MOVERESIZE", False);
351
352 net_properties = XInternAtom(m_display, "_NET_PROPERTIES", False);
353 net_wm_name = XInternAtom(m_display, "_NET_WM_NAME", False);
354 net_wm_desktop = XInternAtom(m_display, "_NET_WM_DESKTOP", False);
355 net_wm_window_type = XInternAtom(m_display, "_NET_WM_WINDOW_TYPE", False);
356 net_wm_state = XInternAtom(m_display, "_NET_WM_STATE", False);
357 net_wm_strut = XInternAtom(m_display, "_NET_WM_STRUT", False);
358 net_wm_icon_geometry = XInternAtom(m_display, "_NET_WM_ICON_GEOMETRY", False);
359 net_wm_icon = XInternAtom(m_display, "_NET_WM_ICON", False);
360 net_wm_pid = XInternAtom(m_display, "_NET_WM_PID", False);
361 net_wm_handled_icons = XInternAtom(m_display, "_NET_WM_HANDLED_ICONS", False);
362
363 net_wm_ping = XInternAtom(m_display, "_NET_WM_PING", False);
364
365#endif // NEWWMSPEC
366
367#ifdef GNOME
368
369 gnome_wm_win_layer = XInternAtom(m_display, "_WIN_LAYER", False);
370 gnome_wm_win_state = XInternAtom(m_display, "_WIN_STATE", False);
371 gnome_wm_win_hints = XInternAtom(m_display, "_WIN_HINTS", False);
372 gnome_wm_win_app_state = XInternAtom(m_display, "_WIN_APP_STATE", False);
373 gnome_wm_win_expanded_size = XInternAtom(m_display, "_WIN_EXPANDED_SIZE", False);
374 gnome_wm_win_icons = XInternAtom(m_display, "_WIN_ICONS", False);
375 gnome_wm_win_workspace = XInternAtom(m_display, "_WIN_WORKSPACE", False);
376 gnome_wm_win_workspace_count = XInternAtom(m_display, "_WIN_WORKSPACE_COUNT", False);
377 gnome_wm_win_workspace_names = XInternAtom(m_display, "_WIN_WORKSPACE_NAMES", False);
378 gnome_wm_win_client_list = XInternAtom(m_display, "_WIN_CLIENT_LIST", False);
379 gnome_wm_prot = XInternAtom(m_display, "_WIN_PROTOCOLS", False);
380 gnome_wm_supporting_wm_check = XInternAtom(m_display, "_WIN_SUPPORTING_WM_CHECK", False);
381
382#endif // GNOME
383 294
384 cursor.session = XCreateFontCursor(m_display, XC_left_ptr); 295 cursor.session = XCreateFontCursor(m_display, XC_left_ptr);
385 cursor.move = XCreateFontCursor(m_display, XC_fleur); 296 cursor.move = XCreateFontCursor(m_display, XC_fleur);
diff --git a/src/BaseDisplay.hh b/src/BaseDisplay.hh
index 89196a8..4aa7228 100644
--- a/src/BaseDisplay.hh
+++ b/src/BaseDisplay.hh
@@ -22,16 +22,15 @@
22// 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
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: BaseDisplay.hh,v 1.13 2002/02/20 22:39:14 fluxgen Exp $ 25// $Id: BaseDisplay.hh,v 1.14 2002/03/18 15:28:25 fluxgen Exp $
26 26
27#ifndef BASEDISPLAY_HH 27#ifndef BASEDISPLAY_HH
28#define BASEDISPLAY_HH 28#define BASEDISPLAY_HH
29 29
30#include "Timer.hh" 30#include "Timer.hh"
31#include "NotCopyable.hh" 31#include "NotCopyable.hh"
32 32#include "FbAtoms.hh"
33#include <X11/Xlib.h> 33#include <X11/Xlib.h>
34#include <X11/Xatom.h>
35 34
36#include <list> 35#include <list>
37#include <vector> 36#include <vector>
@@ -42,15 +41,9 @@ class ScreenInfo;
42#define PropBlackboxHintsElements (5) 41#define PropBlackboxHintsElements (5)
43#define PropBlackboxAttributesElements (8) 42#define PropBlackboxAttributesElements (8)
44 43
45#ifndef __EMX__ 44void bexec(const char *command, char* displaystring);
46void bexec(const char *, char *);
47#endif // !__EMX__
48
49 45
50template <typename Z> inline Z min(Z a, Z b) { return ((a < b) ? a : b); } 46class BaseDisplay:private NotCopyable, public FbAtoms
51template <typename Z> inline Z max(Z a, Z b) { return ((a > b) ? a : b); }
52
53class BaseDisplay:private NotCopyable
54{ 47{
55 48
56public: 49public:
@@ -81,172 +74,25 @@ public:
81 unsigned int premax_w, premax_h; 74 unsigned int premax_w, premax_h;
82 } BlackboxAttributes; 75 } BlackboxAttributes;
83 76
84#ifdef GNOME 77
85 inline Atom &getGnomeProtAtom() { return gnome_wm_prot; } 78 inline ScreenInfo *getScreenInfo(int s) { return screenInfoList[s]; }
86 inline Atom &getGnomeClientListAtom() { return gnome_wm_win_client_list; } 79
87 inline Atom &getGnomeSupportingWMCheckAtom() { return gnome_wm_supporting_wm_check; } 80 inline const Bool &hasShapeExtensions(void) const { return shape.extensions; }
88 inline Atom &getGnomeWorkspaceAtom() { return gnome_wm_win_workspace; } 81 inline const bool &doShutdown(void) const { return m_shutdown; }
89 inline Atom &getGnomeWorkspaceCountAtom() { return gnome_wm_win_workspace_count; } 82 inline const bool &isStartup(void) const { return m_startup; }
90 inline Atom &getGnomeWorkspaceNamesAtom() { return gnome_wm_win_workspace_names; } 83
91 inline Atom &getGnomeStateAtom() { return gnome_wm_win_state; } 84 inline const Cursor &getSessionCursor(void) const { return cursor.session; }
92 inline Atom &getGnomeHintsAtom() { return gnome_wm_win_hints; } 85 inline const Cursor &getMoveCursor(void) const { return cursor.move; }
93 inline Atom &getGnomeLayerAtom() { return gnome_wm_win_layer; } 86 inline const Cursor &getLowerLeftAngleCursor(void) const { return cursor.ll_angle; }
94#endif //GNOME 87 inline const Cursor &getLowerRightAngleCursor(void) const { return cursor.lr_angle; }
95
96 inline const Atom &getWMChangeStateAtom(void) const
97 { return xa_wm_change_state; }
98 inline const Atom &getWMStateAtom(void) const
99 { return xa_wm_state; }
100 inline const Atom &getWMDeleteAtom(void) const
101 { return xa_wm_delete_window; }
102 inline const Atom &getWMProtocolsAtom(void) const
103 { return xa_wm_protocols; }
104 inline const Atom &getWMTakeFocusAtom(void) const
105 { return xa_wm_take_focus; }
106 inline const Atom &getWMColormapAtom(void) const
107 { return xa_wm_colormap_windows; }
108 inline const Atom &getMotifWMHintsAtom(void) const
109 { return motif_wm_hints; }
110
111 // this atom is for normal app->WM hints about decorations, stacking,
112 // starting workspace etc...
113 inline const Atom &getFluxboxHintsAtom(void) const
114 { return blackbox_hints;}
115
116 // these atoms are for normal app->WM interaction beyond the scope of the
117 // ICCCM...
118 inline const Atom &getFluxboxAttributesAtom(void) const
119 { return blackbox_attributes; }
120 inline const Atom &getFluxboxChangeAttributesAtom(void) const
121 { return blackbox_change_attributes; }
122
123 // these atoms are for window->WM interaction, with more control and
124 // information on window "structure"... common examples are
125 // notifying apps when windows are raised/lowered... when the user changes
126 // workspaces... i.e. "pager talk"
127 inline const Atom &getFluxboxStructureMessagesAtom(void) const
128 { return blackbox_structure_messages; }
129
130 // *Notify* portions of the NETStructureMessages protocol
131 inline const Atom &getFluxboxNotifyStartupAtom(void) const
132 { return blackbox_notify_startup; }
133 inline const Atom &getFluxboxNotifyWindowAddAtom(void) const
134 { return blackbox_notify_window_add; }
135 inline const Atom &getFluxboxNotifyWindowDelAtom(void) const
136 { return blackbox_notify_window_del; }
137 inline const Atom &getFluxboxNotifyWindowFocusAtom(void) const
138 { return blackbox_notify_window_focus; }
139 inline const Atom &getFluxboxNotifyCurrentWorkspaceAtom(void) const
140 { return blackbox_notify_current_workspace; }
141 inline const Atom &getFluxboxNotifyWorkspaceCountAtom(void) const
142 { return blackbox_notify_workspace_count; }
143 inline const Atom &getFluxboxNotifyWindowRaiseAtom(void) const
144 { return blackbox_notify_window_raise; }
145 inline const Atom &getFluxboxNotifyWindowLowerAtom(void) const
146 { return blackbox_notify_window_lower; }
147
148 // atoms to change that request changes to the desktop environment during
149 // runtime... these messages can be sent by any client... as the sending
150 // client window id is not included in the ClientMessage event...
151 inline const Atom &getFluxboxChangeWorkspaceAtom(void) const
152 { return blackbox_change_workspace; }
153 inline const Atom &getFluxboxChangeWindowFocusAtom(void) const
154 { return blackbox_change_window_focus; }
155 inline const Atom &getFluxboxCycleWindowFocusAtom(void) const
156 { return blackbox_cycle_window_focus; }
157
158#ifdef NEWWMSPEC
159
160 // root window properties
161 inline const Atom &getNETSupportedAtom(void) const
162 { return net_supported; }
163 inline const Atom &getNETClientListAtom(void) const
164 { return net_client_list; }
165 inline const Atom &getNETClientListStackingAtom(void) const
166 { return net_client_list_stacking; }
167 inline const Atom &getNETNumberOfDesktopsAtom(void) const
168 { return net_number_of_desktops; }
169 inline const Atom &getNETDesktopGeometryAtom(void) const
170 { return net_desktop_geometry; }
171 inline const Atom &getNETDesktopViewportAtom(void) const
172 { return net_desktop_viewport; }
173 inline const Atom &getNETCurrentDesktopAtom(void) const
174 { return net_current_desktop; }
175 inline const Atom &getNETDesktopNamesAtom(void) const
176 { return net_desktop_names; }
177 inline const Atom &getNETActiveWindowAtom(void) const
178 { return net_active_window; }
179 inline const Atom &getNETWorkareaAtom(void) const
180 { return net_workarea; }
181 inline const Atom &getNETSupportingWMCheckAtom(void) const
182 { return net_supporting_wm_check; }
183 inline const Atom &getNETVirtualRootsAtom(void) const
184 { return net_virtual_roots; }
185
186 // root window messages
187 inline const Atom &getNETCloseWindowAtom(void) const
188 { return net_close_window; }
189 inline const Atom &getNETWMMoveResizeAtom(void) const
190 { return net_wm_moveresize; }
191
192 // application window properties
193 inline const Atom &getNETPropertiesAtom(void) const
194 { return net_properties; }
195 inline const Atom &getNETWMNameAtom(void) const
196 { return net_wm_name; }
197 inline const Atom &getNETWMDesktopAtom(void) const
198 { return net_wm_desktop; }
199 inline const Atom &getNETWMWindowTypeAtom(void) const
200 { return net_wm_window_type; }
201 inline const Atom &getNETWMStateAtom(void) const
202 { return net_wm_state; }
203 inline const Atom &getNETWMStrutAtom(void) const
204 { return net_wm_strut; }
205 inline const Atom &getNETWMIconGeometryAtom(void) const
206 { return net_wm_icon_geometry; }
207 inline const Atom &getNETWMIconAtom(void) const
208 { return net_wm_icon; }
209 inline const Atom &getNETWMPidAtom(void) const
210 { return net_wm_pid; }
211 inline const Atom &getNETWMHandledIconsAtom(void) const
212 { return net_wm_handled_icons; }
213
214 // application protocols
215 inline const Atom &getNETWMPingAtom(void) const
216 { return net_wm_ping; }
217
218#endif // NEWWMSPEC
219
220 inline ScreenInfo *getScreenInfo(int s)
221 { return (ScreenInfo *) screenInfoList[s]; }
222
223 inline const Bool &hasShapeExtensions(void) const
224 { return shape.extensions; }
225 inline const bool &doShutdown(void) const
226 { return m_shutdown; }
227 inline const bool &isStartup(void) const
228 { return m_startup; }
229
230 inline const Cursor &getSessionCursor(void) const
231 { return cursor.session; }
232 inline const Cursor &getMoveCursor(void) const
233 { return cursor.move; }
234 inline const Cursor &getLowerLeftAngleCursor(void) const
235 { return cursor.ll_angle; }
236 inline const Cursor &getLowerRightAngleCursor(void) const
237 { return cursor.lr_angle; }
238 88
239 inline Display *getXDisplay(void) { return m_display; } 89 inline Display *getXDisplay(void) { return m_display; }
240 90
241 inline const char *getXDisplayName(void) const 91 inline const char *getXDisplayName(void) const { return const_cast<const char *>(m_display_name); }
242 { return const_cast<const char *>(m_display_name); } 92 inline const char *getApplicationName(void) const { return const_cast<const char *>(m_app_name); }
243 inline const char *getApplicationName(void) const
244 { return const_cast<const char *>(m_app_name); }
245 93
246 inline const int &getNumberOfScreens(void) const 94 inline const int &getNumberOfScreens(void) const { return number_of_screens; }
247 { return number_of_screens; } 95 inline const int &getShapeEventBase(void) const { return shape.event_basep; }
248 inline const int &getShapeEventBase(void) const
249 { return shape.event_basep; }
250 96
251 inline void shutdown(void) { m_shutdown = true; } 97 inline void shutdown(void) { m_shutdown = true; }
252 inline void run(void) { m_startup = m_shutdown = false; } 98 inline void run(void) { m_startup = m_shutdown = false; }
@@ -284,59 +130,7 @@ private:
284 int event_basep, error_basep; 130 int event_basep, error_basep;
285 } shape; 131 } shape;
286 132
287 Atom xa_wm_colormap_windows, xa_wm_protocols, xa_wm_state,
288 xa_wm_delete_window, xa_wm_take_focus, xa_wm_change_state,
289 motif_wm_hints;
290
291 // NETAttributes
292 Atom blackbox_attributes, blackbox_change_attributes, blackbox_hints;
293
294 // NETStructureMessages
295 Atom blackbox_structure_messages, blackbox_notify_startup,
296 blackbox_notify_window_add, blackbox_notify_window_del,
297 blackbox_notify_window_focus, blackbox_notify_current_workspace,
298 blackbox_notify_workspace_count, blackbox_notify_window_raise,
299 blackbox_notify_window_lower;
300
301 // message_types for client -> wm messages
302 Atom blackbox_change_workspace, blackbox_change_window_focus,
303 blackbox_cycle_window_focus;
304
305#ifdef NEWWMSPEC
306
307 // root window properties
308 Atom net_supported, net_client_list, net_client_list_stacking,
309 net_number_of_desktops, net_desktop_geometry, net_desktop_viewport,
310 net_current_desktop, net_desktop_names, net_active_window, net_workarea,
311 net_supporting_wm_check, net_virtual_roots;
312
313 // root window messages
314 Atom net_close_window, net_wm_moveresize;
315
316 // application window properties
317 Atom net_properties, net_wm_name, net_wm_desktop, net_wm_window_type,
318 net_wm_state, net_wm_strut, net_wm_icon_geometry, net_wm_icon, net_wm_pid,
319 net_wm_handled_icons;
320 133
321
322 // application protocols
323 Atom net_wm_ping;
324
325#endif // NEWWMSPEC
326
327#ifdef GNOME
328// union {
329 Atom gnome_wm_win_layer, gnome_wm_win_state, gnome_wm_win_hints,
330 gnome_wm_win_app_state, gnome_wm_win_expanded_size,
331 gnome_wm_win_icons, gnome_wm_win_workspace,
332 gnome_wm_win_workspace_count, gnome_wm_win_workspace_names,
333 gnome_wm_win_client_list;
334// Atom gnome_atom_list[10];
335// };
336 Atom gnome_wm_prot;
337 Atom gnome_wm_supporting_wm_check;
338#endif // GNOME
339
340 134
341 bool m_startup, m_shutdown; 135 bool m_startup, m_shutdown;
342 Display *m_display; 136 Display *m_display;
@@ -354,7 +148,6 @@ protected:
354 148
355 virtual void process_event(XEvent *) = 0; 149 virtual void process_event(XEvent *) = 0;
356 150
357
358}; 151};
359 152
360 153