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