change to singleton fbatoms
This commit is contained in:
parent
238526bd48
commit
ab4fef4450
2 changed files with 41 additions and 48 deletions
|
@ -19,8 +19,11 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// stupid macros needed to access some functions in version 2 of the GNU C
|
#include "Netizen.hh"
|
||||||
// library
|
|
||||||
|
#include "Screen.hh"
|
||||||
|
|
||||||
|
// use GNU extensions
|
||||||
#ifndef _GNU_SOURCE
|
#ifndef _GNU_SOURCE
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#endif // _GNU_SOURCE
|
#endif // _GNU_SOURCE
|
||||||
|
@ -29,92 +32,85 @@
|
||||||
#include "../config.h"
|
#include "../config.h"
|
||||||
#endif // HAVE_CONFIG_H
|
#endif // HAVE_CONFIG_H
|
||||||
|
|
||||||
#include "Netizen.hh"
|
|
||||||
|
|
||||||
|
|
||||||
Netizen::Netizen(BScreen *scr, Window win):
|
Netizen::Netizen(BScreen *scr, Window win):
|
||||||
screen(scr),
|
screen(scr),
|
||||||
basedisplay(scr->getBaseDisplay()),
|
m_display(scr->getBaseDisplay()->getXDisplay()),
|
||||||
window(win) {
|
window(win) {
|
||||||
screen = scr;
|
|
||||||
basedisplay = screen->getBaseDisplay();
|
|
||||||
window = win;
|
window = win;
|
||||||
|
|
||||||
event.type = ClientMessage;
|
event.type = ClientMessage;
|
||||||
event.xclient.message_type = basedisplay->getFluxboxStructureMessagesAtom();
|
event.xclient.message_type = FbAtoms::instance()->getFluxboxStructureMessagesAtom();
|
||||||
event.xclient.display = basedisplay->getXDisplay();
|
event.xclient.display = m_display;
|
||||||
event.xclient.window = window;
|
event.xclient.window = window;
|
||||||
event.xclient.format = 32;
|
event.xclient.format = 32;
|
||||||
event.xclient.data.l[0] = basedisplay->getFluxboxNotifyStartupAtom();
|
event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyStartupAtom();
|
||||||
event.xclient.data.l[1] = event.xclient.data.l[2] =
|
event.xclient.data.l[1] = event.xclient.data.l[2] =
|
||||||
event.xclient.data.l[3] = event.xclient.data.l[4] = 0l;
|
event.xclient.data.l[3] = event.xclient.data.l[4] = 0l;
|
||||||
|
|
||||||
XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event);
|
XSendEvent(m_display, window, False, NoEventMask, &event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Netizen::sendWorkspaceCount(void) {
|
void Netizen::sendWorkspaceCount() {
|
||||||
|
|
||||||
event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWorkspaceCountAtom();
|
event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWorkspaceCountAtom();
|
||||||
event.xclient.data.l[1] = screen->getCount();
|
event.xclient.data.l[1] = screen->getCount();
|
||||||
|
|
||||||
XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event);
|
XSendEvent(m_display, window, False, NoEventMask, &event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Netizen::sendCurrentWorkspace(void) {
|
void Netizen::sendCurrentWorkspace() {
|
||||||
|
|
||||||
event.xclient.data.l[0] = basedisplay->getFluxboxNotifyCurrentWorkspaceAtom();
|
event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyCurrentWorkspaceAtom();
|
||||||
event.xclient.data.l[1] = screen->getCurrentWorkspaceID();
|
event.xclient.data.l[1] = screen->getCurrentWorkspaceID();
|
||||||
|
|
||||||
XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event);
|
XSendEvent(m_display, window, False, NoEventMask, &event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Netizen::sendWindowFocus(Window w) {
|
void Netizen::sendWindowFocus(Window w) {
|
||||||
event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWindowFocusAtom();
|
event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWindowFocusAtom();
|
||||||
event.xclient.data.l[1] = w;
|
event.xclient.data.l[1] = w;
|
||||||
|
|
||||||
XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event);
|
XSendEvent(m_display, window, False, NoEventMask, &event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Netizen::sendWindowAdd(Window w, unsigned long p) {
|
void Netizen::sendWindowAdd(Window w, unsigned long p) {
|
||||||
event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWindowAddAtom();
|
event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWindowAddAtom();
|
||||||
event.xclient.data.l[1] = w;
|
event.xclient.data.l[1] = w;
|
||||||
event.xclient.data.l[2] = p;
|
event.xclient.data.l[2] = p;
|
||||||
|
|
||||||
XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event);
|
XSendEvent(m_display, window, False, NoEventMask, &event);
|
||||||
|
|
||||||
event.xclient.data.l[2] = 0l;
|
event.xclient.data.l[2] = 0l;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Netizen::sendWindowDel(Window w) {
|
void Netizen::sendWindowDel(Window w) {
|
||||||
event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWindowDelAtom();
|
event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWindowDelAtom();
|
||||||
event.xclient.data.l[1] = w;
|
event.xclient.data.l[1] = w;
|
||||||
|
|
||||||
XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event);
|
XSendEvent(m_display, window, False, NoEventMask, &event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Netizen::sendWindowRaise(Window w) {
|
void Netizen::sendWindowRaise(Window w) {
|
||||||
event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWindowRaiseAtom();
|
event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWindowRaiseAtom();
|
||||||
event.xclient.data.l[1] = w;
|
event.xclient.data.l[1] = w;
|
||||||
|
|
||||||
XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event);
|
XSendEvent(m_display, window, False, NoEventMask, &event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Netizen::sendWindowLower(Window w) {
|
void Netizen::sendWindowLower(Window w) {
|
||||||
event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWindowLowerAtom();
|
event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWindowLowerAtom();
|
||||||
event.xclient.data.l[1] = w;
|
event.xclient.data.l[1] = w;
|
||||||
|
|
||||||
XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event);
|
XSendEvent(m_display, window, False, NoEventMask, &event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Netizen::sendConfigNotify(XEvent *e) {
|
void Netizen::sendConfigNotify(XEvent *e) {
|
||||||
XSendEvent(basedisplay->getXDisplay(), window, False,
|
XSendEvent(m_display, window, False, StructureNotifyMask, e);
|
||||||
StructureNotifyMask, e);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// Netizen.hh for Fluxbox
|
||||||
|
// Copyright (c) 2002 Henrik Kinnunen (fluxgen@linuxmail.org)
|
||||||
// Netizen.hh for Blackbox - An X11 Window Manager
|
// Netizen.hh for Blackbox - An X11 Window Manager
|
||||||
// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net)
|
// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net)
|
||||||
//
|
//
|
||||||
|
@ -22,34 +24,29 @@
|
||||||
#ifndef NETIZEN_HH
|
#ifndef NETIZEN_HH
|
||||||
#define NETIZEN_HH
|
#define NETIZEN_HH
|
||||||
|
|
||||||
// forward declaration
|
|
||||||
class Netizen;
|
|
||||||
|
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
|
|
||||||
#include "BaseDisplay.hh"
|
class BScreen;
|
||||||
#include "Screen.hh"
|
|
||||||
|
|
||||||
|
|
||||||
class Netizen {
|
class Netizen {
|
||||||
public:
|
public:
|
||||||
Netizen(BScreen *, Window);
|
Netizen(BScreen *scr, Window w);
|
||||||
|
|
||||||
inline const Window &getWindowID(void) const { return window; }
|
inline Window getWindowID() const { return window; }
|
||||||
|
|
||||||
void sendWorkspaceCount(void);
|
void sendWorkspaceCount();
|
||||||
void sendCurrentWorkspace(void);
|
void sendCurrentWorkspace();
|
||||||
|
|
||||||
void sendWindowFocus(Window);
|
void sendWindowFocus(Window w);
|
||||||
void sendWindowAdd(Window, unsigned long);
|
void sendWindowAdd(Window w, unsigned long p);
|
||||||
void sendWindowDel(Window);
|
void sendWindowDel(Window w);
|
||||||
void sendWindowRaise(Window);
|
void sendWindowRaise(Window w);
|
||||||
void sendWindowLower(Window);
|
void sendWindowLower(Window w);
|
||||||
|
|
||||||
void sendConfigNotify(XEvent *);
|
void sendConfigNotify(XEvent *xe);
|
||||||
private:
|
private:
|
||||||
BScreen *screen;
|
BScreen *screen;
|
||||||
BaseDisplay *basedisplay;
|
Display *m_display; ///< display connection
|
||||||
Window window;
|
Window window;
|
||||||
XEvent event;
|
XEvent event;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue