diff options
author | markt <markt> | 2007-06-16 22:45:25 (GMT) |
---|---|---|
committer | markt <markt> | 2007-06-16 22:45:25 (GMT) |
commit | 2edf6a574137a6c42abd71522c1fb398556e5b19 (patch) | |
tree | c10034c03e10c6c043a7590f1e0972c289631026 | |
parent | 5704ad99d3e07fa1dc0a7b9cebd6135380df5e65 (diff) | |
download | fluxbox-2edf6a574137a6c42abd71522c1fb398556e5b19.zip fluxbox-2edf6a574137a6c42abd71522c1fb398556e5b19.tar.bz2 |
moved function so fluxbox compiles with --disable-remember
-rw-r--r-- | src/Remember.cc | 28 | ||||
-rw-r--r-- | src/Remember.hh | 2 | ||||
-rw-r--r-- | src/Window.cc | 28 | ||||
-rw-r--r-- | 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() { | |||
290 | s_instance = 0; | 290 | s_instance = 0; |
291 | } | 291 | } |
292 | 292 | ||
293 | int Remember::getDecoFromString(const string &str_label) { | ||
294 | if (strcasecmp(str_label.c_str(), "NONE") == 0) | ||
295 | return 0; | ||
296 | if (strcasecmp(str_label.c_str(), "NORMAL") == 0) | ||
297 | return FluxboxWindow::DECORM_LAST - 1; | ||
298 | if (strcasecmp(str_label.c_str(), "TINY") == 0) | ||
299 | return FluxboxWindow::DECORM_TITLEBAR | ||
300 | | FluxboxWindow::DECORM_ICONIFY | ||
301 | | FluxboxWindow::DECORM_MENU | ||
302 | | FluxboxWindow::DECORM_TAB; | ||
303 | if (strcasecmp(str_label.c_str(), "TOOL") == 0) | ||
304 | return FluxboxWindow::DECORM_TITLEBAR | ||
305 | | FluxboxWindow::DECORM_MENU; | ||
306 | if (strcasecmp(str_label.c_str(), "BORDER") == 0) | ||
307 | return FluxboxWindow::DECORM_BORDER | ||
308 | | FluxboxWindow::DECORM_MENU; | ||
309 | if (strcasecmp(str_label.c_str(), "TAB") == 0) | ||
310 | return FluxboxWindow::DECORM_BORDER | ||
311 | | FluxboxWindow::DECORM_MENU | ||
312 | | FluxboxWindow::DECORM_TAB; | ||
313 | unsigned int mask; | ||
314 | if (getuint(str_label.c_str(), mask)) | ||
315 | return mask; | ||
316 | return -1; | ||
317 | } | ||
318 | |||
319 | Application* Remember::find(WinClient &winclient) { | 293 | Application* Remember::find(WinClient &winclient) { |
320 | // if it is already associated with a application, return that one | 294 | // if it is already associated with a application, return that one |
321 | // otherwise, check it against every pattern that we've got | 295 | // otherwise, check it against every pattern that we've got |
@@ -474,7 +448,7 @@ int Remember::parseApp(ifstream &file, Application &app, string *first_line) { | |||
474 | app.rememberIconHiddenstate((strcasecmp(str_label.c_str(), "yes") == 0)); | 448 | app.rememberIconHiddenstate((strcasecmp(str_label.c_str(), "yes") == 0)); |
475 | app.rememberFocusHiddenstate((strcasecmp(str_label.c_str(), "yes") == 0)); | 449 | app.rememberFocusHiddenstate((strcasecmp(str_label.c_str(), "yes") == 0)); |
476 | } else if (strcasecmp(str_key.c_str(), "Deco") == 0) { | 450 | } else if (strcasecmp(str_key.c_str(), "Deco") == 0) { |
477 | int deco = getDecoFromString(str_label); | 451 | int deco = FluxboxWindow::getDecoMaskFromString(str_label); |
478 | if (deco == -1) | 452 | if (deco == -1) |
479 | had_error = 1; | 453 | had_error = 1; |
480 | else | 454 | 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: | |||
201 | Remember(); | 201 | Remember(); |
202 | ~Remember(); | 202 | ~Remember(); |
203 | 203 | ||
204 | static int getDecoFromString(const std::string &str); | ||
205 | |||
206 | Application* find(WinClient &winclient); | 204 | Application* find(WinClient &winclient); |
207 | Application* add(WinClient &winclient); | 205 | Application* add(WinClient &winclient); |
208 | FluxboxWindow* findGroup(Application *, BScreen &screen); | 206 | 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() { | |||
396 | m_blackbox_attrib.premax_w = m_blackbox_attrib.premax_h = 0; | 396 | m_blackbox_attrib.premax_w = m_blackbox_attrib.premax_h = 0; |
397 | 397 | ||
398 | // set default decorations but don't apply them | 398 | // set default decorations but don't apply them |
399 | setDecorationMask(Remember::getDecoFromString(screen().defaultDeco()), false); | 399 | setDecorationMask(getDecoMaskFromString(screen().defaultDeco()), false); |
400 | 400 | ||
401 | functions.resize = functions.move = functions.iconify = functions.maximize | 401 | functions.resize = functions.move = functions.iconify = functions.maximize |
402 | = functions.close = functions.tabable = true; | 402 | = functions.close = functions.tabable = true; |
@@ -4254,3 +4254,29 @@ void FluxboxWindow::associateClient(WinClient &client) { | |||
4254 | evm.add(*this, client.window()); | 4254 | evm.add(*this, client.window()); |
4255 | client.setFluxboxWindow(this); | 4255 | client.setFluxboxWindow(this); |
4256 | } | 4256 | } |
4257 | |||
4258 | int FluxboxWindow::getDecoMaskFromString(const string &str_label) { | ||
4259 | if (strcasecmp(str_label.c_str(), "NONE") == 0) | ||
4260 | return 0; | ||
4261 | if (strcasecmp(str_label.c_str(), "NORMAL") == 0) | ||
4262 | return FluxboxWindow::DECORM_LAST - 1; | ||
4263 | if (strcasecmp(str_label.c_str(), "TINY") == 0) | ||
4264 | return FluxboxWindow::DECORM_TITLEBAR | ||
4265 | | FluxboxWindow::DECORM_ICONIFY | ||
4266 | | FluxboxWindow::DECORM_MENU | ||
4267 | | FluxboxWindow::DECORM_TAB; | ||
4268 | if (strcasecmp(str_label.c_str(), "TOOL") == 0) | ||
4269 | return FluxboxWindow::DECORM_TITLEBAR | ||
4270 | | FluxboxWindow::DECORM_MENU; | ||
4271 | if (strcasecmp(str_label.c_str(), "BORDER") == 0) | ||
4272 | return FluxboxWindow::DECORM_BORDER | ||
4273 | | FluxboxWindow::DECORM_MENU; | ||
4274 | if (strcasecmp(str_label.c_str(), "TAB") == 0) | ||
4275 | return FluxboxWindow::DECORM_BORDER | ||
4276 | | FluxboxWindow::DECORM_MENU | ||
4277 | | FluxboxWindow::DECORM_TAB; | ||
4278 | unsigned int mask = atoi(str_label.c_str()); | ||
4279 | if (mask) | ||
4280 | return mask; | ||
4281 | return -1; | ||
4282 | } | ||
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: | |||
460 | int layerNum() const { return m_layernum; } | 460 | int layerNum() const { return m_layernum; } |
461 | void setLayerNum(int layernum); | 461 | void setLayerNum(int layernum); |
462 | 462 | ||
463 | static int getDecoMaskFromString(const std::string &str); | ||
463 | 464 | ||
464 | unsigned int titlebarHeight() const; | 465 | unsigned int titlebarHeight() const; |
465 | 466 | ||