diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2008-08-15 11:42:13 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2008-08-15 11:42:13 (GMT) |
commit | 0689a0a4a8252d46a72048269faf00dba52a73c3 (patch) | |
tree | 451b1b6f759afdc9d0383a4bfe17e8fd5aff3110 /src | |
parent | 06d696f99b276e3394aec10f52c206aec4697c76 (diff) | |
download | fluxbox_lack-0689a0a4a8252d46a72048269faf00dba52a73c3.zip fluxbox_lack-0689a0a4a8252d46a72048269faf00dba52a73c3.tar.bz2 |
move getDecoMaskFromString to FbWinFrame
Diffstat (limited to 'src')
-rw-r--r-- | src/FbWinFrame.cc | 20 | ||||
-rw-r--r-- | src/FbWinFrame.hh | 1 | ||||
-rw-r--r-- | src/Remember.cc | 2 | ||||
-rw-r--r-- | src/Window.cc | 23 | ||||
-rw-r--r-- | 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() { | |||
1407 | } | 1407 | } |
1408 | } | 1408 | } |
1409 | 1409 | ||
1410 | int FbWinFrame::getDecoMaskFromString(const string &str_label) { | ||
1411 | if (strcasecmp(str_label.c_str(), "NONE") == 0) | ||
1412 | return DECOR_NONE; | ||
1413 | if (strcasecmp(str_label.c_str(), "NORMAL") == 0) | ||
1414 | return DECOR_NORMAL; | ||
1415 | if (strcasecmp(str_label.c_str(), "TINY") == 0) | ||
1416 | return DECOR_TINY; | ||
1417 | if (strcasecmp(str_label.c_str(), "TOOL") == 0) | ||
1418 | return DECOR_TOOL; | ||
1419 | if (strcasecmp(str_label.c_str(), "BORDER") == 0) | ||
1420 | return DECOR_BORDER; | ||
1421 | if (strcasecmp(str_label.c_str(), "TAB") == 0) | ||
1422 | return DECOR_TAB; | ||
1423 | int mask = -1; | ||
1424 | if (str_label.size() > 1 && str_label[0] == '0' && str_label[1] == 'x' || | ||
1425 | str_label.size() > 0 && isdigit(str_label[0])) | ||
1426 | mask = strtol(str_label.c_str(), NULL, 0); | ||
1427 | return mask; | ||
1428 | } | ||
1429 | |||
1410 | void FbWinFrame::applyDecorations() { | 1430 | void FbWinFrame::applyDecorations() { |
1411 | int grav_x=0, grav_y=0; | 1431 | int grav_x=0, grav_y=0; |
1412 | // negate gravity | 1432 | // 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: | |||
228 | bool maximizing = false) const; | 228 | bool maximizing = false) const; |
229 | void displaySize(unsigned int width, unsigned int height) const; | 229 | void displaySize(unsigned int width, unsigned int height) const; |
230 | 230 | ||
231 | static int getDecoMaskFromString(const std::string &str); | ||
231 | void setDecorationMask(unsigned int mask) { m_state.deco_mask = mask; } | 232 | void setDecorationMask(unsigned int mask) { m_state.deco_mask = mask; } |
232 | void applyDecorations(); | 233 | void applyDecorations(); |
233 | 234 | ||
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) { | |||
513 | app.rememberIconHiddenstate((strcasecmp(str_label.c_str(), "yes") == 0)); | 513 | app.rememberIconHiddenstate((strcasecmp(str_label.c_str(), "yes") == 0)); |
514 | app.rememberFocusHiddenstate((strcasecmp(str_label.c_str(), "yes") == 0)); | 514 | app.rememberFocusHiddenstate((strcasecmp(str_label.c_str(), "yes") == 0)); |
515 | } else if (str_key == "deco") { | 515 | } else if (str_key == "deco") { |
516 | int deco = FluxboxWindow::getDecoMaskFromString(str_label); | 516 | int deco = FbWinFrame::getDecoMaskFromString(str_label); |
517 | if (deco == -1) | 517 | if (deco == -1) |
518 | had_error = 1; | 518 | had_error = 1; |
519 | else | 519 | 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() { | |||
427 | m_blackbox_attrib.premax_w = m_blackbox_attrib.premax_h = 0; | 427 | m_blackbox_attrib.premax_w = m_blackbox_attrib.premax_h = 0; |
428 | 428 | ||
429 | // set default decorations but don't apply them | 429 | // set default decorations but don't apply them |
430 | setDecorationMask(getDecoMaskFromString(screen().defaultDeco()), false); | 430 | setDecorationMask(FbWinFrame::getDecoMaskFromString(screen().defaultDeco()), |
431 | false); | ||
431 | 432 | ||
432 | functions.resize = functions.move = functions.iconify = functions.maximize | 433 | functions.resize = functions.move = functions.iconify = functions.maximize |
433 | = functions.close = functions.tabable = true; | 434 | = functions.close = functions.tabable = true; |
@@ -4035,26 +4036,6 @@ void FluxboxWindow::associateClient(WinClient &client) { | |||
4035 | client.titleSig().attach(this); | 4036 | client.titleSig().attach(this); |
4036 | } | 4037 | } |
4037 | 4038 | ||
4038 | int FluxboxWindow::getDecoMaskFromString(const string &str_label) { | ||
4039 | if (strcasecmp(str_label.c_str(), "NONE") == 0) | ||
4040 | return FbWinFrame::DECOR_NONE; | ||
4041 | if (strcasecmp(str_label.c_str(), "NORMAL") == 0) | ||
4042 | return FbWinFrame::DECOR_NORMAL; | ||
4043 | if (strcasecmp(str_label.c_str(), "TINY") == 0) | ||
4044 | return FbWinFrame::DECOR_TINY; | ||
4045 | if (strcasecmp(str_label.c_str(), "TOOL") == 0) | ||
4046 | return FbWinFrame::DECOR_TOOL; | ||
4047 | if (strcasecmp(str_label.c_str(), "BORDER") == 0) | ||
4048 | return FbWinFrame::DECOR_BORDER; | ||
4049 | if (strcasecmp(str_label.c_str(), "TAB") == 0) | ||
4050 | return FbWinFrame::DECOR_TAB; | ||
4051 | int mask = -1; | ||
4052 | if (str_label.size() > 1 && str_label[0] == '0' && str_label[1] == 'x' || | ||
4053 | str_label.size() > 0 && isdigit(str_label[0])) | ||
4054 | mask = strtol(str_label.c_str(), NULL, 0); | ||
4055 | return mask; | ||
4056 | } | ||
4057 | |||
4058 | int FluxboxWindow::getOnHead() const { | 4039 | int FluxboxWindow::getOnHead() const { |
4059 | return screen().getHead(fbWindow()); | 4040 | return screen().getHead(fbWindow()); |
4060 | } | 4041 | } |
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: | |||
465 | int layerNum() const { return m_layernum; } | 465 | int layerNum() const { return m_layernum; } |
466 | void setLayerNum(int layernum); | 466 | void setLayerNum(int layernum); |
467 | 467 | ||
468 | static int getDecoMaskFromString(const std::string &str); | ||
469 | |||
470 | unsigned int titlebarHeight() const; | 468 | unsigned int titlebarHeight() const; |
471 | 469 | ||
472 | int initialState() const; | 470 | int initialState() const; |