From 89fddca1d7a2809278f9307367e7f6b600456dc1 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Tue, 15 Apr 2003 12:22:52 +0000 Subject: cleaning --- src/Gnome.cc | 7 ++-- src/Screen.cc | 21 ++++++---- src/Window.cc | 108 +++++++++++++++++++++++++++------------------------ src/Workspace.cc | 11 ++---- src/fluxbox.cc | 116 ++++++++++++++++++++++++++++--------------------------- src/fluxbox.hh | 47 +++++++++++----------- 6 files changed, 160 insertions(+), 150 deletions(-) diff --git a/src/Gnome.cc b/src/Gnome.cc index 717cc60..d4822c5 100644 --- a/src/Gnome.cc +++ b/src/Gnome.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Gnome.cc,v 1.16 2003/04/15 00:17:59 fluxgen Exp $ +// $Id: Gnome.cc,v 1.17 2003/04/15 12:22:52 fluxgen Exp $ #include "Gnome.hh" @@ -126,6 +126,7 @@ void Gnome::setupWindow(FluxboxWindow &win) { void Gnome::updateClientList(BScreen &screen) { size_t num=0; + // count window clients in each workspace BScreen::Workspaces::const_iterator workspace_it = screen.getWorkspacesList().begin(); BScreen::Workspaces::const_iterator workspace_it_end = @@ -138,14 +139,14 @@ void Gnome::updateClientList(BScreen &screen) { for (; win_it != win_it_end; ++win_it) num += (*win_it)->numClients(); } - //int num = getCurrentWorkspace()->getWindowList().size(); Window *wl = new (nothrow) Window[num]; if (wl == 0) { cerr<<"Fatal: Out of memory, can't allocate for gnome client list"<getDockLayer(), scrname+".slit.layer", altscrname+".Slit.Layer"), - toolbar_layernum(rm, Fluxbox::instance()->getDesktopLayer(), scrname+".toolbar.layer", altscrname+".Toolbar.Layer"), + slit_layernum(rm, Fluxbox::Layer(Fluxbox::instance()->getDockLayer()), + scrname+".slit.layer", altscrname+".Slit.Layer"), + toolbar_layernum(rm, Fluxbox::Layer(Fluxbox::instance()->getDesktopLayer()), + scrname+".toolbar.layer", altscrname+".Toolbar.Layer"), toolbar_mode(rm, ToolbarHandler::ICONS, scrname+".toolbar.mode", altscrname+".Toolbar.Mode"), toolbar_on_head(rm, 0, scrname+".toolbar.onhead", altscrname+".Toolbar.onHead"), - toolbar_placement(rm, Toolbar::BOTTOMCENTER, scrname+".toolbar.placement", altscrname+".Toolbar.Placement") + toolbar_placement(rm, Toolbar::BOTTOMCENTER, + scrname+".toolbar.placement", altscrname+".Toolbar.Placement") { }; @@ -460,7 +465,7 @@ BScreen::BScreen(ResourceManager &rm, image_control->installRootColormap(); root_colormap_installed = true; - fluxbox->load_rc(this); + fluxbox->load_rc(*this); image_control->setDither(*resource.image_dither); theme = new Theme(disp, getRootWindow(), colormap(), getScreenNumber(), @@ -698,7 +703,7 @@ void BScreen::reconfigure() { #ifdef DEBUG cerr<<__FILE__<<"("<<__LINE__<<"): BScreen::reconfigure"<loadRootCommand(this); + Fluxbox::instance()->loadRootCommand(*this); theme->setRootCommand(getRootCommand()); const string &filename = Fluxbox::instance()->getStyleFilename(); theme->load(filename.c_str()); // old theme engine diff --git a/src/Window.cc b/src/Window.cc index 4047f1b..9305fb6 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.cc,v 1.132 2003/04/15 00:50:25 rathnor Exp $ +// $Id: Window.cc,v 1.133 2003/04/15 12:18:37 fluxgen Exp $ #include "Window.hh" @@ -34,9 +34,9 @@ #include "Netizen.hh" #include "FbWinFrameTheme.hh" #include "MenuTheme.hh" - #include "TextButton.hh" #include "EventManager.hh" +#include "FbAtoms.hh" #ifdef HAVE_CONFIG_H #include "config.h" @@ -279,11 +279,12 @@ void FluxboxWindow::init() { // we don't want to duplicate code here and in attachClient m_clientlist.push_back(m_client); #ifdef DEBUG - cerr<<"FluxboxWindow::init(this="<title()); + btn->setJustify(m_frame.theme().justify()); m_labelbuttons[m_client] = btn; m_frame.addLabelButton(*btn); btn->show(); @@ -464,10 +465,6 @@ void FluxboxWindow::attachClient(WinClient &client) { if (client.m_win == this) return; -#ifdef DEBUG - cerr<<__FILE__<<"("<<__FUNCTION__<<")["<raise(); -#ifdef DEBUG - XSync(display, False); // so we see error/warnings in time - cerr<<__FILE__<<"("<<__FUNCTION__<<") clientlist size: "<window(), - fluxbox->getMotifWMHintsAtom(), 0, + motif_wm_hints, 0, PropMwmHintsElements, false, - fluxbox->getMotifWMHintsAtom(), &atom_return, + motif_wm_hints, &atom_return, &format, &num, &len, (unsigned char **) &m_client->mwm_hint) == Success && m_client->mwm_hint) { @@ -1550,7 +1546,7 @@ void FluxboxWindow::installColormap(bool install) { Colormap *cmaps = XListInstalledColormaps(display, m_client->window(), &ncmap); XWindowAttributes wattrib; if (cmaps) { //!! - if (m_client->getAttrib(wattrib)) { //XGetWindowAttributes(display, m_client->window, &wattrib)) { + if (m_client->getAttrib(wattrib)) { if (install) { // install the window's colormap for (i = 0; i < ncmap; i++) { @@ -1613,9 +1609,8 @@ bool FluxboxWindow::getState() { bool ret = false; int foo; unsigned long *state, ulfoo, nitems; - Fluxbox *fluxbox = Fluxbox::instance(); - if ((XGetWindowProperty(display, m_client->window(), fluxbox->getWMStateAtom(), - 0l, 2l, false, fluxbox->getWMStateAtom(), + if ((XGetWindowProperty(display, m_client->window(), FbAtoms::instance()->getWMStateAtom(), + 0l, 2l, false, FbAtoms::instance()->getWMStateAtom(), &atom_return, &foo, &nitems, &ulfoo, (unsigned char **) &state) != Success) || (! state)) { @@ -1713,13 +1708,13 @@ void FluxboxWindow::restoreAttributes() { Atom atom_return; int foo; unsigned long ulfoo, nitems; - Fluxbox *fluxbox = Fluxbox::instance(); + FbAtoms *fbatoms = FbAtoms::instance(); BaseDisplay::BlackboxAttributes *net; if (XGetWindowProperty(display, m_client->window(), - fluxbox->getFluxboxAttributesAtom(), 0l, + fbatoms->getFluxboxAttributesAtom(), 0l, PropBlackboxAttributesElements, false, - fluxbox->getFluxboxAttributesAtom(), &atom_return, &foo, + fbatoms->getFluxboxAttributesAtom(), &atom_return, &foo, &nitems, &ulfoo, (unsigned char **) &net) == Success && net && nitems == PropBlackboxAttributesElements) { blackbox_attrib.flags = net->flags; @@ -1949,7 +1944,11 @@ void FluxboxWindow::mapRequestEvent(XMapRequestEvent &re) { void FluxboxWindow::mapNotifyEvent(XMapEvent &ne) { - if (ne.window == m_client->window() && !ne.override_redirect && visible) { + WinClient *client = findClient(ne.window); + if (client == 0) + return; + + if (!ne.override_redirect && visible) { Fluxbox *fluxbox = Fluxbox::instance(); fluxbox->grab(); if (! validateClient()) @@ -1990,6 +1989,7 @@ void FluxboxWindow::unmapNotifyEvent(XUnmapEvent &ue) { #ifdef DEBUG cerr<<__FILE__<<"("<<__FUNCTION__<<"): 0x"<window()<clientList().begin(); FluxboxWindow::ClientList::iterator client_it_end = (*win_it)->clientList().end(); - for (; client_it != client_it_end; ++client_it) { - /* FbTk::RefCount - raise_and_focus(new RaiseFocusAndSetWorkspace(*this, - *(*client_it))); - */ + for (; client_it != client_it_end; ++client_it) m_clientmenu.insert(new ClientMenuItem(*(*client_it), *this)); - } } - + m_clientmenu.update(); } diff --git a/src/fluxbox.cc b/src/fluxbox.cc index 11dc5a5..9939c90 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.cc,v 1.108 2003/04/15 08:54:40 fluxgen Exp $ +// $Id: fluxbox.cc,v 1.109 2003/04/15 12:11:54 fluxgen Exp $ #include "fluxbox.hh" @@ -39,6 +39,8 @@ #include "EventManager.hh" #include "FbCommands.hh" #include "WinClient.hh" +#include "Keys.hh" +#include "FbAtoms.hh" //Use GNU extensions #ifndef _GNU_SOURCE @@ -356,7 +358,8 @@ Fluxbox::Titlebar Fluxbox::m_titlebar_left[] = {STICK}; Fluxbox::Titlebar Fluxbox::m_titlebar_right[] = {MINIMIZE, MAXIMIZE, CLOSE}; Fluxbox::Fluxbox(int m_argc, char **m_argv, const char *dpy_name, const char *rc) - : BaseDisplay(m_argv[0], dpy_name), FbAtoms(getXDisplay()), + : BaseDisplay(m_argv[0], dpy_name), + m_fbatoms(new FbAtoms()), m_resourcemanager(), m_screen_rm(), m_rc_tabs(m_resourcemanager, true, "session.tabs", "Session.Tabs"), m_rc_iconbar(m_resourcemanager, true, "session.iconbar", "Session.Iconbar"), @@ -970,7 +973,7 @@ void Fluxbox::handleClientMessage(XClientMessageEvent &ce) { if (ce.format != 32) return; - if (ce.message_type == getWMChangeStateAtom()) { + if (ce.message_type == m_fbatoms->getWMChangeStateAtom()) { FluxboxWindow *win = searchWindow(ce.window); if (! win || ! win->validateClient()) return; @@ -979,18 +982,18 @@ void Fluxbox::handleClientMessage(XClientMessageEvent &ce) { win->iconify(); if (ce.data.l[0] == NormalState) win->deiconify(); - } else if (ce.message_type == getFluxboxChangeWorkspaceAtom()) { + } else if (ce.message_type == m_fbatoms->getFluxboxChangeWorkspaceAtom()) { BScreen *screen = searchScreen(ce.window); if (screen && ce.data.l[0] >= 0 && ce.data.l[0] < (signed)screen->getCount()) screen->changeWorkspaceID(ce.data.l[0]); - } else if (ce.message_type == getFluxboxChangeWindowFocusAtom()) { + } else if (ce.message_type == m_fbatoms->getFluxboxChangeWindowFocusAtom()) { FluxboxWindow *win = searchWindow(ce.window); if (win && win->isVisible() && win->setInputFocus()) win->installColormap(True); - } else if (ce.message_type == getFluxboxCycleWindowFocusAtom()) { + } else if (ce.message_type == m_fbatoms->getFluxboxCycleWindowFocusAtom()) { BScreen *screen = searchScreen(ce.window); if (screen) { @@ -999,7 +1002,7 @@ void Fluxbox::handleClientMessage(XClientMessageEvent &ce) { else screen->nextFocus(); } - } else if (ce.message_type == getFluxboxChangeAttributesAtom()) { + } else if (ce.message_type == m_fbatoms->getFluxboxChangeAttributesAtom()) { FluxboxWindow *win = searchWindow(ce.window); @@ -1290,7 +1293,7 @@ void Fluxbox::handleKeyEvent(XKeyEvent &ke) { } -void Fluxbox::doWindowAction(Keys::KeyAction action, const int param) { +void Fluxbox::doWindowAction(int action, const int param) { if (!focused_window) return; @@ -1913,7 +1916,7 @@ void Fluxbox::load_rc() { } } -void Fluxbox::load_rc(BScreen *screen) { +void Fluxbox::load_rc(BScreen &screen) { //get resource filename string dbfile(getRcFilename()); if (dbfile.size() != 0) { @@ -1936,50 +1939,51 @@ void Fluxbox::load_rc(BScreen *screen) { XrmValue value; char *value_type, name_lookup[1024], class_lookup[1024]; - int screen_number = screen->getScreenNumber(); + int screen_number = screen.getScreenNumber(); sprintf(name_lookup, "session.screen%d.rowPlacementDirection", screen_number); sprintf(class_lookup, "Session.Screen%d.RowPlacementDirection", screen_number); if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, &value)) { if (! strncasecmp(value.addr, "righttoleft", value.size)) - screen->saveRowPlacementDirection(BScreen::RIGHTLEFT); + screen.saveRowPlacementDirection(BScreen::RIGHTLEFT); else - screen->saveRowPlacementDirection(BScreen::LEFTRIGHT); + screen.saveRowPlacementDirection(BScreen::LEFTRIGHT); } else - screen->saveRowPlacementDirection(BScreen::LEFTRIGHT); + screen.saveRowPlacementDirection(BScreen::LEFTRIGHT); sprintf(name_lookup, "session.screen%d.colPlacementDirection", screen_number); sprintf(class_lookup, "Session.Screen%d.ColPlacementDirection", screen_number); if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, &value)) { if (! strncasecmp(value.addr, "bottomtotop", value.size)) - screen->saveColPlacementDirection(BScreen::BOTTOMTOP); + screen.saveColPlacementDirection(BScreen::BOTTOMTOP); else - screen->saveColPlacementDirection(BScreen::TOPBOTTOM); + screen.saveColPlacementDirection(BScreen::TOPBOTTOM); } else - screen->saveColPlacementDirection(BScreen::TOPBOTTOM); + screen.saveColPlacementDirection(BScreen::TOPBOTTOM); - screen->removeWorkspaceNames(); + screen.removeWorkspaceNames(); sprintf(name_lookup, "session.screen%d.workspaceNames", screen_number); sprintf(class_lookup, "Session.Screen%d.WorkspaceNames", screen_number); if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, &value)) { #ifdef DEBUG - cerr<<__FILE__<<"("<<__LINE__<<"): Workspaces="<getNumberOfWorkspaces()<addWorkspaceName(nn); + screen.addWorkspaceName(nn); else break; } @@ -1992,13 +1996,13 @@ void Fluxbox::load_rc(BScreen *screen) { if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, &value)) { if (! strncasecmp(value.addr, "RowSmartPlacement", value.size)) - screen->savePlacementPolicy(BScreen::ROWSMARTPLACEMENT); + screen.savePlacementPolicy(BScreen::ROWSMARTPLACEMENT); else if (! strncasecmp(value.addr, "ColSmartPlacement", value.size)) - screen->savePlacementPolicy(BScreen::COLSMARTPLACEMENT); + screen.savePlacementPolicy(BScreen::COLSMARTPLACEMENT); else - screen->savePlacementPolicy(BScreen::CASCADEPLACEMENT); + screen.savePlacementPolicy(BScreen::CASCADEPLACEMENT); } else - screen->savePlacementPolicy(BScreen::ROWSMARTPLACEMENT); + screen.savePlacementPolicy(BScreen::ROWSMARTPLACEMENT); #ifdef SLIT sprintf(name_lookup, "session.screen%d.slit.placement", screen_number); @@ -2006,34 +2010,34 @@ void Fluxbox::load_rc(BScreen *screen) { if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, &value)) { if (! strncasecmp(value.addr, "TopLeft", value.size)) - screen->saveSlitPlacement(Slit::TOPLEFT); + screen.saveSlitPlacement(Slit::TOPLEFT); else if (! strncasecmp(value.addr, "CenterLeft", value.size)) - screen->saveSlitPlacement(Slit::CENTERLEFT); + screen.saveSlitPlacement(Slit::CENTERLEFT); else if (! strncasecmp(value.addr, "BottomLeft", value.size)) - screen->saveSlitPlacement(Slit::BOTTOMLEFT); + screen.saveSlitPlacement(Slit::BOTTOMLEFT); else if (! strncasecmp(value.addr, "TopCenter", value.size)) - screen->saveSlitPlacement(Slit::TOPCENTER); + screen.saveSlitPlacement(Slit::TOPCENTER); else if (! strncasecmp(value.addr, "BottomCenter", value.size)) - screen->saveSlitPlacement(Slit::BOTTOMCENTER); + screen.saveSlitPlacement(Slit::BOTTOMCENTER); else if (! strncasecmp(value.addr, "TopRight", value.size)) - screen->saveSlitPlacement(Slit::TOPRIGHT); + screen.saveSlitPlacement(Slit::TOPRIGHT); else if (! strncasecmp(value.addr, "BottomRight", value.size)) - screen->saveSlitPlacement(Slit::BOTTOMRIGHT); + screen.saveSlitPlacement(Slit::BOTTOMRIGHT); else - screen->saveSlitPlacement(Slit::CENTERRIGHT); + screen.saveSlitPlacement(Slit::CENTERRIGHT); } else - screen->saveSlitPlacement(Slit::CENTERRIGHT); + screen.saveSlitPlacement(Slit::CENTERRIGHT); sprintf(name_lookup, "session.screen%d.slit.direction", screen_number); sprintf(class_lookup, "Session.Screen%d.Slit.Direction", screen_number); if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, &value)) { if (! strncasecmp(value.addr, "Horizontal", value.size)) - screen->saveSlitDirection(Slit::HORIZONTAL); + screen.saveSlitDirection(Slit::HORIZONTAL); else - screen->saveSlitDirection(Slit::VERTICAL); + screen.saveSlitDirection(Slit::VERTICAL); } else - screen->saveSlitDirection(Slit::VERTICAL); + screen.saveSlitDirection(Slit::VERTICAL); sprintf(name_lookup, "session.screen%d.slit.autoHide", screen_number); @@ -2041,11 +2045,11 @@ void Fluxbox::load_rc(BScreen *screen) { if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, &value)) { if (! strncasecmp(value.addr, "True", value.size)) - screen->saveSlitAutoHide(True); + screen.saveSlitAutoHide(true); else - screen->saveSlitAutoHide(False); + screen.saveSlitAutoHide(false); } else - screen->saveSlitAutoHide(False); + screen.saveSlitAutoHide(false); /* #ifdef XINERAMA int tmp_head; @@ -2067,9 +2071,9 @@ void Fluxbox::load_rc(BScreen *screen) { sprintf(class_lookup, "Session.Screen%d.StrftimeFormat", screen_number); if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, &value)) - screen->saveStrftimeFormat(value.addr); + screen.saveStrftimeFormat(value.addr); else - screen->saveStrftimeFormat("%I:%M %p"); + screen.saveStrftimeFormat("%I:%M %p"); #else // HAVE_STRFTIME sprintf(name_lookup, "session.screen%d.dateFormat", screen_number); @@ -2077,11 +2081,11 @@ void Fluxbox::load_rc(BScreen *screen) { if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, &value)) { if (strncasecmp(value.addr, "european", value.size)) - screen->saveDateFormat(B_AMERICANDATE); + screen.saveDateFormat(B_AMERICANDATE); else - screen->saveDateFormat(B_EUROPEANDATE); + screen.saveDateFormat(B_EUROPEANDATE); } else - screen->saveDateFormat(B_AMERICANDATE); + screen.saveDateFormat(B_AMERICANDATE); sprintf(name_lookup, "session.screen%d.clockFormat", screen_number); sprintf(class_lookup, "Session.Screen%d.ClockFormat", screen_number); @@ -2089,23 +2093,23 @@ void Fluxbox::load_rc(BScreen *screen) { &value)) { int clock; if (sscanf(value.addr, "%d", &clock) != 1) - screen->saveClock24Hour(False); + screen.saveClock24Hour(False); else if (clock == 24) - screen->saveClock24Hour(True); + screen.saveClock24Hour(True); else - screen->saveClock24Hour(False); + screen.saveClock24Hour(False); } else - screen->saveClock24Hour(False); + screen.saveClock24Hour(False); #endif // HAVE_STRFTIME //check size on toolbarwidth percent - if (screen->getToolbarWidthPercent() <= 0 || - screen->getToolbarWidthPercent() > 100) - screen->saveToolbarWidthPercent(66); + if (screen.getToolbarWidthPercent() <= 0 || + screen.getToolbarWidthPercent() > 100) + screen.saveToolbarWidthPercent(66); } -void Fluxbox::loadRootCommand(BScreen *screen) { +void Fluxbox::loadRootCommand(BScreen &screen) { string dbfile(getRcFilename()); @@ -2115,13 +2119,13 @@ void Fluxbox::loadRootCommand(BScreen *screen) { XrmValue value; char *value_type, name_lookup[1024], class_lookup[1024]; - sprintf(name_lookup, "session.screen%d.rootCommand", screen->getScreenNumber()); - sprintf(class_lookup, "Session.Screen%d.RootCommand", screen->getScreenNumber()); + sprintf(name_lookup, "session.screen%d.rootCommand", screen.getScreenNumber()); + sprintf(class_lookup, "Session.Screen%d.RootCommand", screen.getScreenNumber()); if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, &value)) { - screen->saveRootCommand(value.addr==0 ? "": value.addr); + screen.saveRootCommand(value.addr==0 ? "": value.addr); } else - screen->saveRootCommand(""); + screen.saveRootCommand(""); } diff --git a/src/fluxbox.hh b/src/fluxbox.hh index c5db866..f7d2191 100644 --- a/src/fluxbox.hh +++ b/src/fluxbox.hh @@ -22,16 +22,14 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.hh,v 1.48 2003/04/15 00:50:25 rathnor Exp $ +// $Id: fluxbox.hh,v 1.49 2003/04/15 12:11:10 fluxgen Exp $ #ifndef FLUXBOX_HH #define FLUXBOX_HH #include "Resource.hh" -#include "Keys.hh" #include "BaseDisplay.hh" #include "Timer.hh" -#include "Toolbar.hh" #include "Observer.hh" #ifdef HAVE_CONFIG_H @@ -39,7 +37,6 @@ #endif // HAVE_CONFIG_H #include "SignalHandler.hh" -#include "FbAtoms.hh" #include #include @@ -65,6 +62,9 @@ class AtomHandler; class FluxboxWindow; +class Keys; +class BScreen; +class FbAtoms; /** main class for the window manager. @@ -72,7 +72,6 @@ class FluxboxWindow; */ class Fluxbox : public BaseDisplay, public FbTk::TimeoutHandler, public FbTk::SignalEventHandler, - public FbAtoms, public FbTk::Observer { public: Fluxbox(int argc, char **argv, const char * dpy_name= 0, const char *rc = 0); @@ -80,11 +79,10 @@ public: static Fluxbox *instance() { return singleton; } - inline bool useIconBar() { return *m_rc_iconbar; } + inline bool useIconBar() const { return *m_rc_iconbar; } inline void saveIconBar(bool value) { m_rc_iconbar = value; } -#ifdef HAVE_GETPID + inline Atom getFluxboxPidAtom() const { return fluxbox_pid; } -#endif // HAVE_GETPID FluxboxWindow *searchGroup(Window, FluxboxWindow *); FluxboxWindow *searchWindow(Window); @@ -101,8 +99,8 @@ public: enum FocusModel { SLOPPYFOCUS=0, SEMISLOPPYFOCUS, CLICKTOFOCUS }; - inline const std::vector& getTitlebarRight() { return *m_rc_titlebar_right; } - inline const std::vector& getTitlebarLeft() { return *m_rc_titlebar_left; } + inline const std::vector& getTitlebarRight() const { return *m_rc_titlebar_right; } + inline const std::vector& getTitlebarLeft() const { return *m_rc_titlebar_left; } inline const std::string &getStyleFilename() const { return *m_rc_stylefile; } inline const char *getMenuFilename() const { return m_rc_menufile->c_str(); } @@ -113,8 +111,8 @@ public: // class to store layer numbers (special Resource type) class Layer { public: - Layer(int i) : m_num(i) {}; - const int getNum() const { return m_num; } + explicit Layer(int i) : m_num(i) {}; + inline int getNum() const { return m_num; } Layer &operator=(int num) { m_num = num; return *this; } @@ -139,25 +137,25 @@ public: inline void maskWindowEvents(Window w, FluxboxWindow *bw) { masked = w; masked_window = bw; } - inline void setNoFocus(Bool f) { no_focus = f; } + inline void setNoFocus(bool f) { no_focus = f; } void watchKeyRelease(BScreen *screen, unsigned int mods); void setFocusedWindow(FluxboxWindow *w); void shutdown(); - void load_rc(BScreen *); - void loadRootCommand(BScreen *); + void load_rc(BScreen &scr); + void loadRootCommand(BScreen &scr); void loadTitlebar(); void saveStyleFilename(const char *val) { m_rc_stylefile = (val == 0 ? "" : val); } void saveMenuFilename(const char *); void saveTitlebarFilename(const char *); void saveSlitlistFilename(const char *val) { m_rc_slitlistfile = (val == 0 ? "" : val); } - void saveWindowSearch(Window, FluxboxWindow *); - void saveGroupSearch(Window, FluxboxWindow *); + void saveWindowSearch(Window win, FluxboxWindow *fbwin); + void saveGroupSearch(Window win, FluxboxWindow *fbwin); void save_rc(); - void removeWindowSearch(Window); - void removeGroupSearch(Window); - void restart(const char * = 0); + void removeWindowSearch(Window win); + void removeGroupSearch(Window win); + void restart(const char *command = 0); void reconfigure(); void rereadMenu(); void checkMenu(); @@ -211,8 +209,11 @@ private: void handleUnmapNotify(XUnmapEvent &ue); void handleClientMessage(XClientMessageEvent &ce); void handleKeyEvent(XKeyEvent &ke); - void doWindowAction(Keys::KeyAction action, const int param); + void doWindowAction(int action, const int param); + void setTitlebar(std::vector& dir, const char *arg); + std::auto_ptr m_fbatoms; + ResourceManager m_resourcemanager, m_screen_rm; //--- Resources @@ -226,7 +227,6 @@ private: Resource m_rc_titlebar_left, m_rc_titlebar_right; Resource m_rc_cache_life, m_rc_cache_max; - void setTitlebar(std::vector& dir, const char *arg); std::map windowSearch; std::map groupSearch; @@ -241,9 +241,7 @@ private: BScreen *watching_screen; unsigned int watch_keyrelease; -#ifdef HAVE_GETPID Atom fluxbox_pid; -#endif // HAVE_GETPID bool no_focus, reconfigure_wait, reread_menu_wait; Time last_time; @@ -258,6 +256,7 @@ private: static Fluxbox *singleton; std::vector m_atomhandler; + }; -- cgit v0.11.2