From b4b927dad90baa43d290679872943144f1c2ab93 Mon Sep 17 00:00:00 2001 From: markt Date: Sat, 16 Jun 2007 22:50:09 +0000 Subject: moved function so fluxbox compiles with --disable-remember --- ChangeLog | 3 +++ src/Remember.cc | 28 +--------------------------- src/Remember.hh | 2 -- src/Window.cc | 28 +++++++++++++++++++++++++++- src/Window.hh | 1 + 5 files changed, 32 insertions(+), 30 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3fe485e..1ca0a67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ (Format: Year/Month/Day) Changes for 1.0.0: +*07/06/16: + * Fixed compile error with --disable-remember (Mark) + Window.cc/hh Remember.cc/hh *07/06/09: * Minor change to the /bin/sh - solution (Mathias) we are using now just $SHELL -c diff --git a/src/Remember.cc b/src/Remember.cc index 55816c4..cb1114c 100644 --- a/src/Remember.cc +++ b/src/Remember.cc @@ -290,32 +290,6 @@ Remember::~Remember() { s_instance = 0; } -int Remember::getDecoFromString(const string &str_label) { - if (strcasecmp(str_label.c_str(), "NONE") == 0) - return 0; - if (strcasecmp(str_label.c_str(), "NORMAL") == 0) - return FluxboxWindow::DECORM_LAST - 1; - if (strcasecmp(str_label.c_str(), "TINY") == 0) - return FluxboxWindow::DECORM_TITLEBAR - | FluxboxWindow::DECORM_ICONIFY - | FluxboxWindow::DECORM_MENU - | FluxboxWindow::DECORM_TAB; - if (strcasecmp(str_label.c_str(), "TOOL") == 0) - return FluxboxWindow::DECORM_TITLEBAR - | FluxboxWindow::DECORM_MENU; - if (strcasecmp(str_label.c_str(), "BORDER") == 0) - return FluxboxWindow::DECORM_BORDER - | FluxboxWindow::DECORM_MENU; - if (strcasecmp(str_label.c_str(), "TAB") == 0) - return FluxboxWindow::DECORM_BORDER - | FluxboxWindow::DECORM_MENU - | FluxboxWindow::DECORM_TAB; - unsigned int mask; - if (getuint(str_label.c_str(), mask)) - return mask; - return -1; -} - Application* Remember::find(WinClient &winclient) { // if it is already associated with a application, return that one // otherwise, check it against every pattern that we've got @@ -474,7 +448,7 @@ int Remember::parseApp(ifstream &file, Application &app, string *first_line) { app.rememberIconHiddenstate((strcasecmp(str_label.c_str(), "yes") == 0)); app.rememberFocusHiddenstate((strcasecmp(str_label.c_str(), "yes") == 0)); } else if (strcasecmp(str_key.c_str(), "Deco") == 0) { - int deco = getDecoFromString(str_label); + int deco = FluxboxWindow::getDecoMaskFromString(str_label); if (deco == -1) had_error = 1; else diff --git a/src/Remember.hh b/src/Remember.hh index a1e75da..581e525 100644 --- a/src/Remember.hh +++ b/src/Remember.hh @@ -205,8 +205,6 @@ public: Remember(); ~Remember(); - static int getDecoFromString(const std::string &str); - Application* find(WinClient &winclient); Application* add(WinClient &winclient); FluxboxWindow* findGroup(Application *, BScreen &screen); diff --git a/src/Window.cc b/src/Window.cc index 23e11bf..1c839f6 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -388,7 +388,7 @@ void FluxboxWindow::init() { m_blackbox_attrib.premax_w = m_blackbox_attrib.premax_h = 0; // set default decorations but don't apply them - setDecorationMask(Remember::getDecoFromString(screen().defaultDeco()), false); + setDecorationMask(getDecoMaskFromString(screen().defaultDeco()), false); functions.resize = functions.move = functions.iconify = functions.maximize = functions.close = functions.tabable = true; @@ -4206,3 +4206,29 @@ void FluxboxWindow::associateClient(WinClient &client) { evm.add(*this, client.window()); client.setFluxboxWindow(this); } + +int FluxboxWindow::getDecoMaskFromString(const string &str_label) { + if (strcasecmp(str_label.c_str(), "NONE") == 0) + return 0; + if (strcasecmp(str_label.c_str(), "NORMAL") == 0) + return FluxboxWindow::DECORM_LAST - 1; + if (strcasecmp(str_label.c_str(), "TINY") == 0) + return FluxboxWindow::DECORM_TITLEBAR + | FluxboxWindow::DECORM_ICONIFY + | FluxboxWindow::DECORM_MENU + | FluxboxWindow::DECORM_TAB; + if (strcasecmp(str_label.c_str(), "TOOL") == 0) + return FluxboxWindow::DECORM_TITLEBAR + | FluxboxWindow::DECORM_MENU; + if (strcasecmp(str_label.c_str(), "BORDER") == 0) + return FluxboxWindow::DECORM_BORDER + | FluxboxWindow::DECORM_MENU; + if (strcasecmp(str_label.c_str(), "TAB") == 0) + return FluxboxWindow::DECORM_BORDER + | FluxboxWindow::DECORM_MENU + | FluxboxWindow::DECORM_TAB; + unsigned int mask = atoi(str_label.c_str()); + if (mask) + return mask; + return -1; +} diff --git a/src/Window.hh b/src/Window.hh index 82cd492..d7d8910 100644 --- a/src/Window.hh +++ b/src/Window.hh @@ -399,6 +399,7 @@ public: int layerNum() const { return m_layernum; } void setLayerNum(int layernum); + static int getDecoMaskFromString(const std::string &str); unsigned int titlebarHeight() const; -- cgit v0.11.2