aboutsummaryrefslogtreecommitdiff
path: root/src/Netizen.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2002-08-14 21:59:28 (GMT)
committerfluxgen <fluxgen>2002-08-14 21:59:28 (GMT)
commitab4fef4450d40364cd97f7ad2af227cb957014c3 (patch)
treef0eeb6b37751af76abc64d0bfe72dada28ab8429 /src/Netizen.cc
parent238526bd48a9318672f8e2c20e8a3b3dbf16927d (diff)
downloadfluxbox-ab4fef4450d40364cd97f7ad2af227cb957014c3.zip
fluxbox-ab4fef4450d40364cd97f7ad2af227cb957014c3.tar.bz2
change to singleton fbatoms
Diffstat (limited to 'src/Netizen.cc')
-rw-r--r--src/Netizen.cc58
1 files changed, 27 insertions, 31 deletions
diff --git a/src/Netizen.cc b/src/Netizen.cc
index 56bfe52..bfc32a0 100644
--- a/src/Netizen.cc
+++ b/src/Netizen.cc
@@ -19,8 +19,11 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// stupid macros needed to access some functions in version 2 of the GNU C 22#include "Netizen.hh"
23// library 23
24#include "Screen.hh"
25
26// use GNU extensions
24#ifndef _GNU_SOURCE 27#ifndef _GNU_SOURCE
25#define _GNU_SOURCE 28#define _GNU_SOURCE
26#endif // _GNU_SOURCE 29#endif // _GNU_SOURCE
@@ -29,92 +32,85 @@
29#include "../config.h" 32#include "../config.h"
30#endif // HAVE_CONFIG_H 33#endif // HAVE_CONFIG_H
31 34
32#include "Netizen.hh"
33
34
35Netizen::Netizen(BScreen *scr, Window win): 35Netizen::Netizen(BScreen *scr, Window win):
36screen(scr), 36screen(scr),
37basedisplay(scr->getBaseDisplay()), 37m_display(scr->getBaseDisplay()->getXDisplay()),
38window(win) { 38window(win) {
39 screen = scr;
40 basedisplay = screen->getBaseDisplay();
41 window = win; 39 window = win;
42 40
43 event.type = ClientMessage; 41 event.type = ClientMessage;
44 event.xclient.message_type = basedisplay->getFluxboxStructureMessagesAtom(); 42 event.xclient.message_type = FbAtoms::instance()->getFluxboxStructureMessagesAtom();
45 event.xclient.display = basedisplay->getXDisplay(); 43 event.xclient.display = m_display;
46 event.xclient.window = window; 44 event.xclient.window = window;
47 event.xclient.format = 32; 45 event.xclient.format = 32;
48 event.xclient.data.l[0] = basedisplay->getFluxboxNotifyStartupAtom(); 46 event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyStartupAtom();
49 event.xclient.data.l[1] = event.xclient.data.l[2] = 47 event.xclient.data.l[1] = event.xclient.data.l[2] =
50 event.xclient.data.l[3] = event.xclient.data.l[4] = 0l; 48 event.xclient.data.l[3] = event.xclient.data.l[4] = 0l;
51 49
52 XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); 50 XSendEvent(m_display, window, False, NoEventMask, &event);
53} 51}
54 52
55 53
56void Netizen::sendWorkspaceCount(void) { 54void Netizen::sendWorkspaceCount() {
57 55
58 event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWorkspaceCountAtom(); 56 event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWorkspaceCountAtom();
59 event.xclient.data.l[1] = screen->getCount(); 57 event.xclient.data.l[1] = screen->getCount();
60 58
61 XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); 59 XSendEvent(m_display, window, False, NoEventMask, &event);
62} 60}
63 61
64 62
65void Netizen::sendCurrentWorkspace(void) { 63void Netizen::sendCurrentWorkspace() {
66 64
67 event.xclient.data.l[0] = basedisplay->getFluxboxNotifyCurrentWorkspaceAtom(); 65 event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyCurrentWorkspaceAtom();
68 event.xclient.data.l[1] = screen->getCurrentWorkspaceID(); 66 event.xclient.data.l[1] = screen->getCurrentWorkspaceID();
69 67
70 XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); 68 XSendEvent(m_display, window, False, NoEventMask, &event);
71} 69}
72 70
73 71
74void Netizen::sendWindowFocus(Window w) { 72void Netizen::sendWindowFocus(Window w) {
75 event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWindowFocusAtom(); 73 event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWindowFocusAtom();
76 event.xclient.data.l[1] = w; 74 event.xclient.data.l[1] = w;
77 75
78 XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); 76 XSendEvent(m_display, window, False, NoEventMask, &event);
79} 77}
80 78
81 79
82void Netizen::sendWindowAdd(Window w, unsigned long p) { 80void Netizen::sendWindowAdd(Window w, unsigned long p) {
83 event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWindowAddAtom(); 81 event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWindowAddAtom();
84 event.xclient.data.l[1] = w; 82 event.xclient.data.l[1] = w;
85 event.xclient.data.l[2] = p; 83 event.xclient.data.l[2] = p;
86 84
87 XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); 85 XSendEvent(m_display, window, False, NoEventMask, &event);
88 86
89 event.xclient.data.l[2] = 0l; 87 event.xclient.data.l[2] = 0l;
90} 88}
91 89
92 90
93void Netizen::sendWindowDel(Window w) { 91void Netizen::sendWindowDel(Window w) {
94 event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWindowDelAtom(); 92 event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWindowDelAtom();
95 event.xclient.data.l[1] = w; 93 event.xclient.data.l[1] = w;
96 94
97 XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); 95 XSendEvent(m_display, window, False, NoEventMask, &event);
98} 96}
99 97
100 98
101void Netizen::sendWindowRaise(Window w) { 99void Netizen::sendWindowRaise(Window w) {
102 event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWindowRaiseAtom(); 100 event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWindowRaiseAtom();
103 event.xclient.data.l[1] = w; 101 event.xclient.data.l[1] = w;
104 102
105 XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); 103 XSendEvent(m_display, window, False, NoEventMask, &event);
106} 104}
107 105
108 106
109void Netizen::sendWindowLower(Window w) { 107void Netizen::sendWindowLower(Window w) {
110 event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWindowLowerAtom(); 108 event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWindowLowerAtom();
111 event.xclient.data.l[1] = w; 109 event.xclient.data.l[1] = w;
112 110
113 XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); 111 XSendEvent(m_display, window, False, NoEventMask, &event);
114} 112}
115 113
116
117void Netizen::sendConfigNotify(XEvent *e) { 114void Netizen::sendConfigNotify(XEvent *e) {
118 XSendEvent(basedisplay->getXDisplay(), window, False, 115 XSendEvent(m_display, window, False, StructureNotifyMask, e);
119 StructureNotifyMask, e);
120} 116}