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