moved function so fluxbox compiles with --disable-remember
markt markt
5 files changed,
32 insertions(+),
30 deletions(-)
M
src/Remember.cc
→
src/Remember.cc
@@ -290,32 +290,6 @@
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 @@ } else if (strcasecmp(str_key.c_str(), "Hidden") == 0) {
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
M
src/Remember.hh
→
src/Remember.hh
@@ -205,8 +205,6 @@
Remember(); ~Remember(); - static int getDecoFromString(const std::string &str); - Application* find(WinClient &winclient); Application* add(WinClient &winclient); FluxboxWindow* findGroup(Application *, BScreen &screen);
M
src/Window.cc
→
src/Window.cc
@@ -388,7 +388,7 @@ m_blackbox_attrib.premax_x = m_blackbox_attrib.premax_y = 0;
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 @@ evm.add(*this, btn->window()); // we take care of button events for this
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; +}
M
src/Window.hh
→
src/Window.hh
@@ -399,6 +399,7 @@
int layerNum() const { return m_layernum; } void setLayerNum(int layernum); + static int getDecoMaskFromString(const std::string &str); unsigned int titlebarHeight() const;