From 2edf6a574137a6c42abd71522c1fb398556e5b19 Mon Sep 17 00:00:00 2001 From: markt Date: Sat, 16 Jun 2007 22:45:25 +0000 Subject: moved function so fluxbox compiles with --disable-remember --- src/Remember.cc | 28 +--------------------------- src/Remember.hh | 2 -- src/Window.cc | 28 +++++++++++++++++++++++++++- src/Window.hh | 1 + 4 files changed, 29 insertions(+), 30 deletions(-) diff --git a/src/Remember.cc b/src/Remember.cc index 1ee60d7..329e999 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 3a6d636..7ecf8c2 100644 --- a/src/Remember.hh +++ b/src/Remember.hh @@ -201,8 +201,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 44fd4c9..8b92999 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -396,7 +396,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; @@ -4254,3 +4254,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 8a4866e..6e04ded 100644 --- a/src/Window.hh +++ b/src/Window.hh @@ -460,6 +460,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