diff options
author | fluxgen <fluxgen> | 2002-03-18 15:23:08 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2002-03-18 15:23:08 (GMT) |
commit | 1e761e6b71e5ebb530633fce2a4cb0293e453fce (patch) | |
tree | 0f0cdc2ce122c90acbd84c1e45fa5132366e43a5 | |
parent | 87f58f891c02cc1f692248f96c27b518691d5011 (diff) | |
download | fluxbox_paul-1e761e6b71e5ebb530633fce2a4cb0293e453fce.zip fluxbox_paul-1e761e6b71e5ebb530633fce2a4cb0293e453fce.tar.bz2 |
first
-rw-r--r-- | src/FbAtoms.cc | 132 | ||||
-rw-r--r-- | src/FbAtoms.hh | 173 |
2 files changed, 305 insertions, 0 deletions
diff --git a/src/FbAtoms.cc b/src/FbAtoms.cc new file mode 100644 index 0000000..b8e1718 --- /dev/null +++ b/src/FbAtoms.cc | |||
@@ -0,0 +1,132 @@ | |||
1 | // BaseDisplay.hh for Fluxbox Window Manager | ||
2 | // Copyright (c) 2001 - 2002 Henrik Kinnunen (fluxgen@linuxmail.org) | ||
3 | // FbAtom.cc | ||
4 | // Copyright (c) 2002 Henrik Kinnunen (fluxgen@linuxmail.org) | ||
5 | // | ||
6 | // Permission is hereby granted, free of charge, to any person obtaining a | ||
7 | // copy of this software and associated documentation files (the "Software"), | ||
8 | // to deal in the Software without restriction, including without limitation | ||
9 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
10 | // and/or sell copies of the Software, and to permit persons to whom the | ||
11 | // Software is furnished to do so, subject to the following conditions: | ||
12 | // | ||
13 | // The above copyright notice and this permission notice shall be included in | ||
14 | // all copies or substantial portions of the Software. | ||
15 | // | ||
16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
19 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
22 | // DEALINGS IN THE SOFTWARE. | ||
23 | |||
24 | // $Id: FbAtoms.cc,v 1.1 2002/03/18 15:23:08 fluxgen Exp $ | ||
25 | |||
26 | #include "FbAtoms.hh" | ||
27 | |||
28 | FbAtoms::FbAtoms(Display *display):m_init(false) { | ||
29 | if (display) | ||
30 | initAtoms(display); | ||
31 | } | ||
32 | |||
33 | FbAtoms::~FbAtoms() { | ||
34 | |||
35 | } | ||
36 | |||
37 | void FbAtoms::initAtoms(Display *display) { | ||
38 | if (m_init) //already done init? | ||
39 | return; | ||
40 | else | ||
41 | m_init = true; | ||
42 | |||
43 | xa_wm_colormap_windows = | ||
44 | XInternAtom(display, "WM_COLORMAP_WINDOWS", False); | ||
45 | xa_wm_protocols = XInternAtom(display, "WM_PROTOCOLS", False); | ||
46 | xa_wm_state = XInternAtom(display, "WM_STATE", False); | ||
47 | xa_wm_change_state = XInternAtom(display, "WM_CHANGE_STATE", False); | ||
48 | xa_wm_delete_window = XInternAtom(display, "WM_DELETE_WINDOW", False); | ||
49 | xa_wm_take_focus = XInternAtom(display, "WM_TAKE_FOCUS", False); | ||
50 | motif_wm_hints = XInternAtom(display, "_MOTIF_WM_HINTS", False); | ||
51 | |||
52 | blackbox_hints = XInternAtom(display, "_BLACKBOX_HINTS", False); | ||
53 | blackbox_attributes = XInternAtom(display, "_BLACKBOX_ATTRIBUTES", False); | ||
54 | blackbox_change_attributes = | ||
55 | XInternAtom(display, "_BLACKBOX_CHANGE_ATTRIBUTES", False); | ||
56 | |||
57 | blackbox_structure_messages = | ||
58 | XInternAtom(display, "_BLACKBOX_STRUCTURE_MESSAGES", False); | ||
59 | blackbox_notify_startup = | ||
60 | XInternAtom(display, "_BLACKBOX_NOTIFY_STARTUP", False); | ||
61 | blackbox_notify_window_add = | ||
62 | XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_ADD", False); | ||
63 | blackbox_notify_window_del = | ||
64 | XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_DEL", False); | ||
65 | blackbox_notify_current_workspace = | ||
66 | XInternAtom(display, "_BLACKBOX_NOTIFY_CURRENT_WORKSPACE", False); | ||
67 | blackbox_notify_workspace_count = | ||
68 | XInternAtom(display, "_BLACKBOX_NOTIFY_WORKSPACE_COUNT", False); | ||
69 | blackbox_notify_window_focus = | ||
70 | XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_FOCUS", False); | ||
71 | blackbox_notify_window_raise = | ||
72 | XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_RAISE", False); | ||
73 | blackbox_notify_window_lower = | ||
74 | XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_LOWER", False); | ||
75 | |||
76 | blackbox_change_workspace = | ||
77 | XInternAtom(display, "_BLACKBOX_CHANGE_WORKSPACE", False); | ||
78 | blackbox_change_window_focus = | ||
79 | XInternAtom(display, "_BLACKBOX_CHANGE_WINDOW_FOCUS", False); | ||
80 | blackbox_cycle_window_focus = | ||
81 | XInternAtom(display, "_BLACKBOX_CYCLE_WINDOW_FOCUS", False); | ||
82 | |||
83 | #ifdef NEWWMSPEC | ||
84 | |||
85 | net_supported = XInternAtom(display, "_NET_SUPPORTED", False); | ||
86 | net_client_list = XInternAtom(display, "_NET_CLIENT_LIST", False); | ||
87 | net_client_list_stacking = XInternAtom(display, "_NET_CLIENT_LIST_STACKING", False); | ||
88 | net_number_of_desktops = XInternAtom(display, "_NET_NUMBER_OF_DESKTOPS", False); | ||
89 | net_desktop_geometry = XInternAtom(display, "_NET_DESKTOP_GEOMETRY", False); | ||
90 | net_desktop_viewport = XInternAtom(display, "_NET_DESKTOP_VIEWPORT", False); | ||
91 | net_current_desktop = XInternAtom(display, "_NET_CURRENT_DESKTOP", False); | ||
92 | net_desktop_names = XInternAtom(display, "_NET_DESKTOP_NAMES", False); | ||
93 | net_active_window = XInternAtom(display, "_NET_ACTIVE_WINDOW", False); | ||
94 | net_workarea = XInternAtom(display, "_NET_WORKAREA", False); | ||
95 | net_supporting_wm_check = XInternAtom(display, "_NET_SUPPORTING_WM_CHECK", False); | ||
96 | net_virtual_roots = XInternAtom(display, "_NET_VIRTUAL_ROOTS", False); | ||
97 | |||
98 | net_close_window = XInternAtom(display, "_NET_CLOSE_WINDOW", False); | ||
99 | net_wm_moveresize = XInternAtom(display, "_NET_WM_MOVERESIZE", False); | ||
100 | |||
101 | net_properties = XInternAtom(display, "_NET_PROPERTIES", False); | ||
102 | net_wm_name = XInternAtom(display, "_NET_WM_NAME", False); | ||
103 | net_wm_desktop = XInternAtom(display, "_NET_WM_DESKTOP", False); | ||
104 | net_wm_window_type = XInternAtom(display, "_NET_WM_WINDOW_TYPE", False); | ||
105 | net_wm_state = XInternAtom(display, "_NET_WM_STATE", False); | ||
106 | net_wm_strut = XInternAtom(display, "_NET_WM_STRUT", False); | ||
107 | net_wm_icon_geometry = XInternAtom(display, "_NET_WM_ICON_GEOMETRY", False); | ||
108 | net_wm_icon = XInternAtom(display, "_NET_WM_ICON", False); | ||
109 | net_wm_pid = XInternAtom(display, "_NET_WM_PID", False); | ||
110 | net_wm_handled_icons = XInternAtom(display, "_NET_WM_HANDLED_ICONS", False); | ||
111 | |||
112 | net_wm_ping = XInternAtom(display, "_NET_WM_PING", False); | ||
113 | |||
114 | #endif // NEWWMSPEC | ||
115 | |||
116 | #ifdef GNOME | ||
117 | |||
118 | gnome_wm_win_layer = XInternAtom(display, "_WIN_LAYER", False); | ||
119 | gnome_wm_win_state = XInternAtom(display, "_WIN_STATE", False); | ||
120 | gnome_wm_win_hints = XInternAtom(display, "_WIN_HINTS", False); | ||
121 | gnome_wm_win_app_state = XInternAtom(display, "_WIN_APP_STATE", False); | ||
122 | gnome_wm_win_expanded_size = XInternAtom(display, "_WIN_EXPANDED_SIZE", False); | ||
123 | gnome_wm_win_icons = XInternAtom(display, "_WIN_ICONS", False); | ||
124 | gnome_wm_win_workspace = XInternAtom(display, "_WIN_WORKSPACE", False); | ||
125 | gnome_wm_win_workspace_count = XInternAtom(display, "_WIN_WORKSPACE_COUNT", False); | ||
126 | gnome_wm_win_workspace_names = XInternAtom(display, "_WIN_WORKSPACE_NAMES", False); | ||
127 | gnome_wm_win_client_list = XInternAtom(display, "_WIN_CLIENT_LIST", False); | ||
128 | gnome_wm_prot = XInternAtom(display, "_WIN_PROTOCOLS", False); | ||
129 | gnome_wm_supporting_wm_check = XInternAtom(display, "_WIN_SUPPORTING_WM_CHECK", False); | ||
130 | |||
131 | #endif // GNOME | ||
132 | } | ||
diff --git a/src/FbAtoms.hh b/src/FbAtoms.hh new file mode 100644 index 0000000..a45376d --- /dev/null +++ b/src/FbAtoms.hh | |||
@@ -0,0 +1,173 @@ | |||
1 | // FbAtom.hh | ||
2 | // Copyright (c) 2002 Henrik Kinnunen (fluxgen@linuxmail.org) | ||
3 | // | ||
4 | // Permission is hereby granted, free of charge, to any person obtaining a | ||
5 | // copy of this software and associated documentation files (the "Software"), | ||
6 | // to deal in the Software without restriction, including without limitation | ||
7 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
8 | // and/or sell copies of the Software, and to permit persons to whom the | ||
9 | // Software is furnished to do so, subject to the following conditions: | ||
10 | // | ||
11 | // The above copyright notice and this permission notice shall be included in | ||
12 | // all copies or substantial portions of the Software. | ||
13 | // | ||
14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
15 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
16 | // 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 | ||
18 | // 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 | ||
20 | // DEALINGS IN THE SOFTWARE. | ||
21 | |||
22 | // $Id: FbAtoms.hh,v 1.1 2002/03/18 15:23:08 fluxgen Exp $ | ||
23 | #include <X11/Xlib.h> | ||
24 | #include <X11/Xatom.h> | ||
25 | class FbAtoms | ||
26 | { | ||
27 | public: | ||
28 | explicit FbAtoms(Display *display); | ||
29 | virtual ~FbAtoms(); | ||
30 | void initAtoms(Display *display); | ||
31 | #ifdef GNOME | ||
32 | inline Atom &getGnomeProtAtom() { return gnome_wm_prot; } | ||
33 | inline Atom &getGnomeClientListAtom() { return gnome_wm_win_client_list; } | ||
34 | inline Atom &getGnomeSupportingWMCheckAtom() { return gnome_wm_supporting_wm_check; } | ||
35 | inline Atom &getGnomeWorkspaceAtom() { return gnome_wm_win_workspace; } | ||
36 | inline Atom &getGnomeWorkspaceCountAtom() { return gnome_wm_win_workspace_count; } | ||
37 | inline Atom &getGnomeWorkspaceNamesAtom() { return gnome_wm_win_workspace_names; } | ||
38 | inline Atom &getGnomeStateAtom() { return gnome_wm_win_state; } | ||
39 | inline Atom &getGnomeHintsAtom() { return gnome_wm_win_hints; } | ||
40 | inline Atom &getGnomeLayerAtom() { return gnome_wm_win_layer; } | ||
41 | #endif //GNOME | ||
42 | |||
43 | inline const Atom &getWMChangeStateAtom(void) const { return xa_wm_change_state; } | ||
44 | inline const Atom &getWMStateAtom(void) const { return xa_wm_state; } | ||
45 | inline const Atom &getWMDeleteAtom(void) const { return xa_wm_delete_window; } | ||
46 | inline const Atom &getWMProtocolsAtom(void) const { return xa_wm_protocols; } | ||
47 | inline const Atom &getWMTakeFocusAtom(void) const { return xa_wm_take_focus; } | ||
48 | inline const Atom &getWMColormapAtom(void) const { return xa_wm_colormap_windows; } | ||
49 | inline const Atom &getMotifWMHintsAtom(void) const { return motif_wm_hints; } | ||
50 | |||
51 | // this atom is for normal app->WM hints about decorations, stacking, | ||
52 | // starting workspace etc... | ||
53 | inline const Atom &getFluxboxHintsAtom(void) const { return blackbox_hints;} | ||
54 | |||
55 | // these atoms are for normal app->WM interaction beyond the scope of the | ||
56 | // ICCCM... | ||
57 | inline const Atom &getFluxboxAttributesAtom(void) const { return blackbox_attributes; } | ||
58 | inline const Atom &getFluxboxChangeAttributesAtom(void) const { return blackbox_change_attributes; } | ||
59 | |||
60 | // these atoms are for window->WM interaction, with more control and | ||
61 | // information on window "structure"... common examples are | ||
62 | // notifying apps when windows are raised/lowered... when the user changes | ||
63 | // workspaces... i.e. "pager talk" | ||
64 | inline const Atom &getFluxboxStructureMessagesAtom(void) const{ return blackbox_structure_messages; } | ||
65 | |||
66 | // *Notify* portions of the NETStructureMessages protocol | ||
67 | inline const Atom &getFluxboxNotifyStartupAtom(void) const { return blackbox_notify_startup; } | ||
68 | inline const Atom &getFluxboxNotifyWindowAddAtom(void) const { return blackbox_notify_window_add; } | ||
69 | inline const Atom &getFluxboxNotifyWindowDelAtom(void) const { return blackbox_notify_window_del; } | ||
70 | inline const Atom &getFluxboxNotifyWindowFocusAtom(void) const { return blackbox_notify_window_focus; } | ||
71 | inline const Atom &getFluxboxNotifyCurrentWorkspaceAtom(void) const { return blackbox_notify_current_workspace; } | ||
72 | inline const Atom &getFluxboxNotifyWorkspaceCountAtom(void) const { return blackbox_notify_workspace_count; } | ||
73 | inline const Atom &getFluxboxNotifyWindowRaiseAtom(void) const { return blackbox_notify_window_raise; } | ||
74 | inline const Atom &getFluxboxNotifyWindowLowerAtom(void) const { return blackbox_notify_window_lower; } | ||
75 | |||
76 | // atoms to change that request changes to the desktop environment during | ||
77 | // runtime... these messages can be sent by any client... as the sending | ||
78 | // client window id is not included in the ClientMessage event... | ||
79 | inline const Atom &getFluxboxChangeWorkspaceAtom(void) const { return blackbox_change_workspace; } | ||
80 | inline const Atom &getFluxboxChangeWindowFocusAtom(void) const { return blackbox_change_window_focus; } | ||
81 | inline const Atom &getFluxboxCycleWindowFocusAtom(void) const { return blackbox_cycle_window_focus; } | ||
82 | |||
83 | #ifdef NEWWMSPEC | ||
84 | |||
85 | // root window properties | ||
86 | inline const Atom &getNETSupportedAtom(void) const { return net_supported; } | ||
87 | inline const Atom &getNETClientListAtom(void) const { return net_client_list; } | ||
88 | inline const Atom &getNETClientListStackingAtom(void) const { return net_client_list_stacking; } | ||
89 | inline const Atom &getNETNumberOfDesktopsAtom(void) const { return net_number_of_desktops; } | ||
90 | inline const Atom &getNETDesktopGeometryAtom(void) const { return net_desktop_geometry; } | ||
91 | inline const Atom &getNETDesktopViewportAtom(void) const { return net_desktop_viewport; } | ||
92 | inline const Atom &getNETCurrentDesktopAtom(void) const { return net_current_desktop; } | ||
93 | inline const Atom &getNETDesktopNamesAtom(void) const { return net_desktop_names; } | ||
94 | inline const Atom &getNETActiveWindowAtom(void) const { return net_active_window; } | ||
95 | inline const Atom &getNETWorkareaAtom(void) const { return net_workarea; } | ||
96 | inline const Atom &getNETSupportingWMCheckAtom(void) const { return net_supporting_wm_check; } | ||
97 | inline const Atom &getNETVirtualRootsAtom(void) const { return net_virtual_roots; } | ||
98 | |||
99 | // root window messages | ||
100 | inline const Atom &getNETCloseWindowAtom(void) const { return net_close_window; } | ||
101 | inline const Atom &getNETWMMoveResizeAtom(void) const { return net_wm_moveresize; } | ||
102 | |||
103 | // application window properties | ||
104 | inline const Atom &getNETPropertiesAtom(void) const { return net_properties; } | ||
105 | inline const Atom &getNETWMNameAtom(void) const { return net_wm_name; } | ||
106 | inline const Atom &getNETWMDesktopAtom(void) const { return net_wm_desktop; } | ||
107 | inline const Atom &getNETWMWindowTypeAtom(void) const { return net_wm_window_type; } | ||
108 | inline const Atom &getNETWMStateAtom(void) const { return net_wm_state; } | ||
109 | inline const Atom &getNETWMStrutAtom(void) const { return net_wm_strut; } | ||
110 | inline const Atom &getNETWMIconGeometryAtom(void) const { return net_wm_icon_geometry; } | ||
111 | inline const Atom &getNETWMIconAtom(void) const { return net_wm_icon; } | ||
112 | inline const Atom &getNETWMPidAtom(void) const { return net_wm_pid; } | ||
113 | inline const Atom &getNETWMHandledIconsAtom(void) const { return net_wm_handled_icons; } | ||
114 | |||
115 | // application protocols | ||
116 | inline const Atom &getNETWMPingAtom(void) const { return net_wm_ping; } | ||
117 | |||
118 | #endif // NEWWMSPEC | ||
119 | |||
120 | private: | ||
121 | // NETAttributes | ||
122 | Atom blackbox_attributes, blackbox_change_attributes, blackbox_hints; | ||
123 | |||
124 | // NETStructureMessages | ||
125 | Atom blackbox_structure_messages, blackbox_notify_startup, | ||
126 | blackbox_notify_window_add, blackbox_notify_window_del, | ||
127 | blackbox_notify_window_focus, blackbox_notify_current_workspace, | ||
128 | blackbox_notify_workspace_count, blackbox_notify_window_raise, | ||
129 | blackbox_notify_window_lower; | ||
130 | |||
131 | // message_types for client -> wm messages | ||
132 | Atom blackbox_change_workspace, blackbox_change_window_focus, | ||
133 | blackbox_cycle_window_focus; | ||
134 | |||
135 | #ifdef NEWWMSPEC | ||
136 | |||
137 | // root window properties | ||
138 | Atom net_supported, net_client_list, net_client_list_stacking, | ||
139 | net_number_of_desktops, net_desktop_geometry, net_desktop_viewport, | ||
140 | net_current_desktop, net_desktop_names, net_active_window, net_workarea, | ||
141 | net_supporting_wm_check, net_virtual_roots; | ||
142 | |||
143 | // root window messages | ||
144 | Atom net_close_window, net_wm_moveresize; | ||
145 | |||
146 | // application window properties | ||
147 | Atom net_properties, net_wm_name, net_wm_desktop, net_wm_window_type, | ||
148 | net_wm_state, net_wm_strut, net_wm_icon_geometry, net_wm_icon, net_wm_pid, | ||
149 | net_wm_handled_icons; | ||
150 | |||
151 | |||
152 | // application protocols | ||
153 | Atom net_wm_ping; | ||
154 | |||
155 | #endif // NEWWMSPEC | ||
156 | |||
157 | #ifdef GNOME | ||
158 | // union { | ||
159 | Atom gnome_wm_win_layer, gnome_wm_win_state, gnome_wm_win_hints, | ||
160 | gnome_wm_win_app_state, gnome_wm_win_expanded_size, | ||
161 | gnome_wm_win_icons, gnome_wm_win_workspace, | ||
162 | gnome_wm_win_workspace_count, gnome_wm_win_workspace_names, | ||
163 | gnome_wm_win_client_list; | ||
164 | // Atom gnome_atom_list[10]; | ||
165 | // }; | ||
166 | Atom gnome_wm_prot; | ||
167 | Atom gnome_wm_supporting_wm_check; | ||
168 | #endif // GNOME | ||
169 | Atom xa_wm_colormap_windows, xa_wm_protocols, xa_wm_state, | ||
170 | xa_wm_delete_window, xa_wm_take_focus, xa_wm_change_state, | ||
171 | motif_wm_hints; | ||
172 | bool m_init; | ||
173 | }; | ||