diff options
Diffstat (limited to 'src/FbAtoms.cc')
-rw-r--r-- | src/FbAtoms.cc | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/src/FbAtoms.cc b/src/FbAtoms.cc new file mode 100644 index 0000000..b68a8bd --- /dev/null +++ b/src/FbAtoms.cc | |||
@@ -0,0 +1,93 @@ | |||
1 | // FbAtom.cc | ||
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.cc,v 1.5 2002/12/01 13:41:56 rathnor Exp $ | ||
23 | |||
24 | #include "FbAtoms.hh" | ||
25 | |||
26 | #include <string> | ||
27 | using namespace std; | ||
28 | |||
29 | FbAtoms *FbAtoms::s_singleton = 0; | ||
30 | |||
31 | FbAtoms::FbAtoms(Display *display):m_init(false) { | ||
32 | if (s_singleton != 0) | ||
33 | throw string("You can only create one instance of FbAtoms"); | ||
34 | |||
35 | if (display == 0) | ||
36 | throw string("Must supply FbAtoms with an valid display connection"); | ||
37 | |||
38 | s_singleton = this; | ||
39 | initAtoms(display); | ||
40 | } | ||
41 | |||
42 | FbAtoms::~FbAtoms() { | ||
43 | |||
44 | } | ||
45 | |||
46 | FbAtoms *FbAtoms::instance() { | ||
47 | assert(s_singleton); | ||
48 | return s_singleton; | ||
49 | } | ||
50 | |||
51 | void FbAtoms::initAtoms(Display *display) { | ||
52 | |||
53 | xa_wm_colormap_windows = | ||
54 | XInternAtom(display, "WM_COLORMAP_WINDOWS", False); | ||
55 | xa_wm_protocols = XInternAtom(display, "WM_PROTOCOLS", False); | ||
56 | xa_wm_state = XInternAtom(display, "WM_STATE", False); | ||
57 | xa_wm_change_state = XInternAtom(display, "WM_CHANGE_STATE", False); | ||
58 | xa_wm_delete_window = XInternAtom(display, "WM_DELETE_WINDOW", False); | ||
59 | xa_wm_take_focus = XInternAtom(display, "WM_TAKE_FOCUS", False); | ||
60 | motif_wm_hints = XInternAtom(display, "_MOTIF_WM_HINTS", False); | ||
61 | |||
62 | blackbox_hints = XInternAtom(display, "_BLACKBOX_HINTS", False); | ||
63 | blackbox_attributes = XInternAtom(display, "_BLACKBOX_ATTRIBUTES", False); | ||
64 | blackbox_change_attributes = | ||
65 | XInternAtom(display, "_BLACKBOX_CHANGE_ATTRIBUTES", False); | ||
66 | |||
67 | blackbox_structure_messages = | ||
68 | XInternAtom(display, "_BLACKBOX_STRUCTURE_MESSAGES", False); | ||
69 | blackbox_notify_startup = | ||
70 | XInternAtom(display, "_BLACKBOX_NOTIFY_STARTUP", False); | ||
71 | blackbox_notify_window_add = | ||
72 | XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_ADD", False); | ||
73 | blackbox_notify_window_del = | ||
74 | XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_DEL", False); | ||
75 | blackbox_notify_current_workspace = | ||
76 | XInternAtom(display, "_BLACKBOX_NOTIFY_CURRENT_WORKSPACE", False); | ||
77 | blackbox_notify_workspace_count = | ||
78 | XInternAtom(display, "_BLACKBOX_NOTIFY_WORKSPACE_COUNT", False); | ||
79 | blackbox_notify_window_focus = | ||
80 | XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_FOCUS", False); | ||
81 | blackbox_notify_window_raise = | ||
82 | XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_RAISE", False); | ||
83 | blackbox_notify_window_lower = | ||
84 | XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_LOWER", False); | ||
85 | |||
86 | blackbox_change_workspace = | ||
87 | XInternAtom(display, "_BLACKBOX_CHANGE_WORKSPACE", False); | ||
88 | blackbox_change_window_focus = | ||
89 | XInternAtom(display, "_BLACKBOX_CHANGE_WINDOW_FOCUS", False); | ||
90 | blackbox_cycle_window_focus = | ||
91 | XInternAtom(display, "_BLACKBOX_CYCLE_WINDOW_FOCUS", False); | ||
92 | |||
93 | } | ||