all repos — fluxbox @ b37a99672a432db58a9f011583ec5102761584d5

custom fork of the fluxbox windowmanager

indent
fluxgen fluxgen
commit

b37a99672a432db58a9f011583ec5102761584d5

parent

60c51badc43ada00872ad8e138aa818d45f30d4d

2 files changed, 58 insertions(+), 62 deletions(-)

jump to
M src/Netizen.ccsrc/Netizen.cc

@@ -13,7 +13,7 @@ // all copies or substantial portions of the Software.

// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER

@@ -21,43 +21,44 @@ // DEALINGS IN THE SOFTWARE.

// stupid macros needed to access some functions in version 2 of the GNU C // library -#ifndef _GNU_SOURCE -#define _GNU_SOURCE +#ifndef _GNU_SOURCE +#define _GNU_SOURCE #endif // _GNU_SOURCE -#ifdef HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H #include "../config.h" #endif // HAVE_CONFIG_H #include "Netizen.hh" -Netizen::Netizen(BScreen *scr, Window win) { - screen = scr; - basedisplay = screen->getBaseDisplay(); - window = win; +Netizen::Netizen(BScreen *scr, Window win): +screen(scr), +basedisplay(screen->getBaseDisplay()), +window(win) { + screen = scr; + basedisplay = screen->getBaseDisplay(); + window = win; - event.type = ClientMessage; - event.xclient.message_type = basedisplay->getFluxboxStructureMessagesAtom(); - event.xclient.display = basedisplay->getXDisplay(); - event.xclient.window = window; - event.xclient.format = 32; - event.xclient.data.l[0] = basedisplay->getFluxboxNotifyStartupAtom(); - event.xclient.data.l[1] = event.xclient.data.l[2] = - event.xclient.data.l[3] = event.xclient.data.l[4] = 0l; + event.type = ClientMessage; + event.xclient.message_type = basedisplay->getFluxboxStructureMessagesAtom(); + event.xclient.display = basedisplay->getXDisplay(); + event.xclient.window = window; + event.xclient.format = 32; + event.xclient.data.l[0] = basedisplay->getFluxboxNotifyStartupAtom(); + event.xclient.data.l[1] = event.xclient.data.l[2] = + event.xclient.data.l[3] = event.xclient.data.l[4] = 0l; - XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); + XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); } void Netizen::sendWorkspaceCount(void) { event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWorkspaceCountAtom(); - event.xclient.data.l[1] = screen->getCount(); + event.xclient.data.l[1] = screen->getCount(); - XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); - - + XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); }

@@ -67,54 +68,53 @@ event.xclient.data.l[0] = basedisplay->getFluxboxNotifyCurrentWorkspaceAtom();

event.xclient.data.l[1] = screen->getCurrentWorkspaceID(); XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); - } void Netizen::sendWindowFocus(Window w) { - event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWindowFocusAtom(); - event.xclient.data.l[1] = w; + event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWindowFocusAtom(); + event.xclient.data.l[1] = w; - XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); + XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); } void Netizen::sendWindowAdd(Window w, unsigned long p) { - event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWindowAddAtom(); - event.xclient.data.l[1] = w; - event.xclient.data.l[2] = p; + event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWindowAddAtom(); + event.xclient.data.l[1] = w; + event.xclient.data.l[2] = p; - XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); + XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); - event.xclient.data.l[2] = 0l; + event.xclient.data.l[2] = 0l; } void Netizen::sendWindowDel(Window w) { - event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWindowDelAtom(); - event.xclient.data.l[1] = w; + event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWindowDelAtom(); + event.xclient.data.l[1] = w; - XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); + XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); } void Netizen::sendWindowRaise(Window w) { - event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWindowRaiseAtom(); - event.xclient.data.l[1] = w; + event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWindowRaiseAtom(); + event.xclient.data.l[1] = w; - XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); + XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); } void Netizen::sendWindowLower(Window w) { - event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWindowLowerAtom(); - event.xclient.data.l[1] = w; + event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWindowLowerAtom(); + event.xclient.data.l[1] = w; - XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); + XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); } void Netizen::sendConfigNotify(XEvent *e) { - XSendEvent(basedisplay->getXDisplay(), window, False, - StructureNotifyMask, e); + XSendEvent(basedisplay->getXDisplay(), window, False, + StructureNotifyMask, e); }
M src/Netizen.hhsrc/Netizen.hh

@@ -13,14 +13,14 @@ // all copies or substantial portions of the Software.

// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -#ifndef _NETIZEN_HH_ -#define _NETIZEN_HH_ +#ifndef _NETIZEN_HH_ +#define _NETIZEN_HH_ // forward declaration class Netizen;

@@ -33,30 +33,26 @@

class Netizen { private: - BaseDisplay *basedisplay; - BScreen *screen; - Window window; - XEvent event; - - -protected: - + BScreen *screen; + BaseDisplay *basedisplay; + Window window; + XEvent event; public: - Netizen(BScreen *, Window); + Netizen(BScreen *, Window); - inline const Window &getWindowID(void) const { return window; } + inline const Window &getWindowID(void) const { return window; } - void sendWorkspaceCount(void); - void sendCurrentWorkspace(void); + void sendWorkspaceCount(void); + void sendCurrentWorkspace(void); - void sendWindowFocus(Window); - void sendWindowAdd(Window, unsigned long); - void sendWindowDel(Window); - void sendWindowRaise(Window); - void sendWindowLower(Window); + void sendWindowFocus(Window); + void sendWindowAdd(Window, unsigned long); + void sendWindowDel(Window); + void sendWindowRaise(Window); + void sendWindowLower(Window); - void sendConfigNotify(XEvent *); + void sendConfigNotify(XEvent *); };