From b73411a95ffadf8d5c98429b49b08f86071b11dc Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Wed, 2 Jan 2008 22:44:16 +0100 Subject: moved seldom used code to where it is actually used, no need to include code into compilation when its not needed --- src/FbTk/FbWindow.hh | 23 ----------------------- src/ToolFactory.cc | 2 -- src/Window.cc | 28 ++++++++++++++++++++++++++-- 3 files changed, 26 insertions(+), 27 deletions(-) diff --git a/src/FbTk/FbWindow.hh b/src/FbTk/FbWindow.hh index f266ec3..b8de60e 100644 --- a/src/FbTk/FbWindow.hh +++ b/src/FbTk/FbWindow.hh @@ -244,29 +244,6 @@ private: bool operator == (Window win, const FbWindow &fbwin); -/// helper class for some STL routines -class ChangeProperty { -public: - ChangeProperty(Display *disp, Atom prop, int mode, - unsigned char *state, int num):m_disp(disp), - m_prop(prop), - m_state(state), - m_num(num), - m_mode(mode){ - - } - void operator () (FbTk::FbWindow *win) { - XChangeProperty(m_disp, win->window(), m_prop, m_prop, 32, m_mode, - m_state, m_num); - } -private: - Display *m_disp; - Atom m_prop; - unsigned char *m_state; - int m_num; - int m_mode; -}; - /// Interface class to render FbWindow foregrounds. class FbWindowRenderer { public: diff --git a/src/ToolFactory.cc b/src/ToolFactory.cc index 35bdf75..1a1d8d7 100644 --- a/src/ToolFactory.cc +++ b/src/ToolFactory.cc @@ -41,8 +41,6 @@ #include "Toolbar.hh" #include "fluxbox.hh" -#include "FbTk/FbWindow.hh" - #include namespace { diff --git a/src/Window.cc b/src/Window.cc index 8222c06..b05593c 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -234,6 +234,30 @@ private: WinClient &m_client; }; + +/// helper class for some STL routines +class ChangeProperty { +public: + ChangeProperty(Display *disp, Atom prop, int mode, + unsigned char *state, int num):m_disp(disp), + m_prop(prop), + m_state(state), + m_num(num), + m_mode(mode){ + + } + void operator () (FbTk::FbWindow *win) { + XChangeProperty(m_disp, win->window(), m_prop, m_prop, 32, m_mode, + m_state, m_num); + } +private: + Display *m_disp; + Atom m_prop; + unsigned char *m_state; + int m_num; + int m_mode; +}; + }; @@ -2012,7 +2036,7 @@ void FluxboxWindow::installColormap(bool install) { */ void FluxboxWindow::saveBlackboxAttribs() { for_each(m_clientlist.begin(), m_clientlist.end(), - FbTk::ChangeProperty( + ChangeProperty( display, FbAtoms::instance()->getFluxboxAttributesAtom(), PropModeReplace, @@ -2036,7 +2060,7 @@ void FluxboxWindow::setState(unsigned long new_state, bool setting_up) { state[1] = (unsigned long) None; for_each(m_clientlist.begin(), m_clientlist.end(), - FbTk::ChangeProperty(display, + ChangeProperty(display, FbAtoms::instance()->getWMStateAtom(), PropModeReplace, (unsigned char *)state, 2)); -- cgit v0.11.2