aboutsummaryrefslogtreecommitdiff
path: root/src/BaseDisplay.hh
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/BaseDisplay.hh
parent0e0f5800e1cb21cf79bc85579b05dbc7d2fe9a93 (diff)
downloadfluxbox-bcfcc6403a62a4ba2a0f7d1c4b1b3be9ee07251b.zip
fluxbox-bcfcc6403a62a4ba2a0f7d1c4b1b3be9ee07251b.tar.bz2
moved Atoms into FbAtoms
Diffstat (limited to 'src/BaseDisplay.hh')
-rw-r--r--src/BaseDisplay.hh245
1 files changed, 19 insertions, 226 deletions
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