From 0689a0a4a8252d46a72048269faf00dba52a73c3 Mon Sep 17 00:00:00 2001
From: Mark Tiefenbruck <mark@fluxbox.org>
Date: Fri, 15 Aug 2008 04:42:13 -0700
Subject: move getDecoMaskFromString to FbWinFrame

---
 src/FbWinFrame.cc | 20 ++++++++++++++++++++
 src/FbWinFrame.hh |  1 +
 src/Remember.cc   |  2 +-
 src/Window.cc     | 23 ++---------------------
 src/Window.hh     |  2 --
 5 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc
index 3a3dc86..becbe36 100644
--- a/src/FbWinFrame.cc
+++ b/src/FbWinFrame.cc
@@ -1407,6 +1407,26 @@ void FbWinFrame::applyTabContainer() {
     }
 }
 
+int FbWinFrame::getDecoMaskFromString(const string &str_label) {
+    if (strcasecmp(str_label.c_str(), "NONE") == 0)
+        return DECOR_NONE;
+    if (strcasecmp(str_label.c_str(), "NORMAL") == 0)
+        return DECOR_NORMAL;
+    if (strcasecmp(str_label.c_str(), "TINY") == 0)
+        return DECOR_TINY;
+    if (strcasecmp(str_label.c_str(), "TOOL") == 0)
+        return DECOR_TOOL;
+    if (strcasecmp(str_label.c_str(), "BORDER") == 0)
+        return DECOR_BORDER;
+    if (strcasecmp(str_label.c_str(), "TAB") == 0)
+        return DECOR_TAB;
+    int mask = -1;
+    if (str_label.size() > 1 && str_label[0] == '0' && str_label[1] == 'x' ||
+        str_label.size() > 0 && isdigit(str_label[0]))
+        mask = strtol(str_label.c_str(), NULL, 0);
+    return mask;
+}
+
 void FbWinFrame::applyDecorations() {
     int grav_x=0, grav_y=0;
     // negate gravity
diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh
index 6d8249a..c9e15d0 100644
--- a/src/FbWinFrame.hh
+++ b/src/FbWinFrame.hh
@@ -228,6 +228,7 @@ public:
                         bool maximizing = false) const;
     void displaySize(unsigned int width, unsigned int height) const;
 
+    static int getDecoMaskFromString(const std::string &str);
     void setDecorationMask(unsigned int mask) { m_state.deco_mask = mask; }
     void applyDecorations();
 
diff --git a/src/Remember.cc b/src/Remember.cc
index 76d2221..fc5d9b6 100644
--- a/src/Remember.cc
+++ b/src/Remember.cc
@@ -513,7 +513,7 @@ int parseApp(ifstream &file, Application &app, string *first_line = 0) {
                 app.rememberIconHiddenstate((strcasecmp(str_label.c_str(), "yes") == 0));
                 app.rememberFocusHiddenstate((strcasecmp(str_label.c_str(), "yes") == 0));
             } else if (str_key == "deco") {
-                int deco = FluxboxWindow::getDecoMaskFromString(str_label);
+                int deco = FbWinFrame::getDecoMaskFromString(str_label);
                 if (deco == -1)
                     had_error = 1;
                 else
diff --git a/src/Window.cc b/src/Window.cc
index 6f8d0f7..9628598 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -427,7 +427,8 @@ void FluxboxWindow::init() {
     m_blackbox_attrib.premax_w = m_blackbox_attrib.premax_h = 0;
 
     // set default decorations but don't apply them
-    setDecorationMask(getDecoMaskFromString(screen().defaultDeco()), false);
+    setDecorationMask(FbWinFrame::getDecoMaskFromString(screen().defaultDeco()),
+                      false);
 
     functions.resize = functions.move = functions.iconify = functions.maximize
     = functions.close = functions.tabable = true;
@@ -4035,26 +4036,6 @@ void FluxboxWindow::associateClient(WinClient &client) {
     client.titleSig().attach(this);
 }
 
-int FluxboxWindow::getDecoMaskFromString(const string &str_label) {
-    if (strcasecmp(str_label.c_str(), "NONE") == 0)
-        return FbWinFrame::DECOR_NONE;
-    if (strcasecmp(str_label.c_str(), "NORMAL") == 0)
-        return FbWinFrame::DECOR_NORMAL;
-    if (strcasecmp(str_label.c_str(), "TINY") == 0)
-        return FbWinFrame::DECOR_TINY;
-    if (strcasecmp(str_label.c_str(), "TOOL") == 0)
-        return FbWinFrame::DECOR_TOOL;
-    if (strcasecmp(str_label.c_str(), "BORDER") == 0)
-        return FbWinFrame::DECOR_BORDER;
-    if (strcasecmp(str_label.c_str(), "TAB") == 0)
-        return FbWinFrame::DECOR_TAB;
-    int mask = -1;
-    if (str_label.size() > 1 && str_label[0] == '0' && str_label[1] == 'x' ||
-        str_label.size() > 0 && isdigit(str_label[0]))
-        mask = strtol(str_label.c_str(), NULL, 0);
-    return mask;
-}
-
 int FluxboxWindow::getOnHead() const {
     return screen().getHead(fbWindow());
 }
diff --git a/src/Window.hh b/src/Window.hh
index f0a390c..3c26530 100644
--- a/src/Window.hh
+++ b/src/Window.hh
@@ -465,8 +465,6 @@ public:
     int layerNum() const { return m_layernum; }
     void setLayerNum(int layernum);
 
-    static int getDecoMaskFromString(const std::string &str);
-
     unsigned int titlebarHeight() const;
 
     int initialState() const;
-- 
cgit v0.11.2