diff options
Diffstat (limited to 'src/Remember.cc')
-rw-r--r-- | src/Remember.cc | 65 |
1 files changed, 31 insertions, 34 deletions
diff --git a/src/Remember.cc b/src/Remember.cc index 62c0d18..2b8fbce 100644 --- a/src/Remember.cc +++ b/src/Remember.cc | |||
@@ -290,6 +290,32 @@ 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 | |||
293 | Application* Remember::find(WinClient &winclient) { | 319 | Application* Remember::find(WinClient &winclient) { |
294 | // if it is already associated with a application, return that one | 320 | // if it is already associated with a application, return that one |
295 | // otherwise, check it against every pattern that we've got | 321 | // otherwise, check it against every pattern that we've got |
@@ -448,40 +474,11 @@ int Remember::parseApp(ifstream &file, Application &app, string *first_line) { | |||
448 | app.rememberIconHiddenstate((strcasecmp(str_label.c_str(), "yes") == 0)); | 474 | app.rememberIconHiddenstate((strcasecmp(str_label.c_str(), "yes") == 0)); |
449 | app.rememberFocusHiddenstate((strcasecmp(str_label.c_str(), "yes") == 0)); | 475 | app.rememberFocusHiddenstate((strcasecmp(str_label.c_str(), "yes") == 0)); |
450 | } else if (strcasecmp(str_key.c_str(), "Deco") == 0) { | 476 | } else if (strcasecmp(str_key.c_str(), "Deco") == 0) { |
451 | if (strcasecmp(str_label.c_str(), "NONE") == 0) { | 477 | int deco = getDecoFromString(str_label); |
452 | app.rememberDecostate((unsigned int) 0); | 478 | if (deco == -1) |
453 | } else if (strcasecmp(str_label.c_str(), "NORMAL") == 0) { | 479 | had_error = 1; |
454 | app.rememberDecostate((unsigned int) 0xfffffff); | 480 | else |
455 | } else if (strcasecmp(str_label.c_str(), "TINY") == 0) { | 481 | app.rememberDecostate((unsigned int)deco); |
456 | app.rememberDecostate((unsigned int) | ||
457 | FluxboxWindow::DECORM_TITLEBAR | ||
458 | | FluxboxWindow::DECORM_ICONIFY | ||
459 | | FluxboxWindow::DECORM_MENU | ||
460 | | FluxboxWindow::DECORM_TAB | ||
461 | ); | ||
462 | } else if (strcasecmp(str_label.c_str(), "TOOL") == 0) { | ||
463 | app.rememberDecostate((unsigned int) | ||
464 | FluxboxWindow::DECORM_TITLEBAR | ||
465 | | FluxboxWindow::DECORM_MENU | ||
466 | ); | ||
467 | } else if (strcasecmp(str_label.c_str(), "BORDER") == 0) { | ||
468 | app.rememberDecostate((unsigned int) | ||
469 | FluxboxWindow::DECORM_BORDER | ||
470 | | FluxboxWindow::DECORM_MENU | ||
471 | ); | ||
472 | } else if (strcasecmp(str_label.c_str(), "TAB") == 0) { | ||
473 | app.rememberDecostate((unsigned int) | ||
474 | FluxboxWindow::DECORM_BORDER | ||
475 | | FluxboxWindow::DECORM_MENU | ||
476 | | FluxboxWindow::DECORM_TAB | ||
477 | ); | ||
478 | } else { | ||
479 | unsigned int mask; | ||
480 | if (getuint(str_label.c_str(), mask)) | ||
481 | app.rememberDecostate(mask); | ||
482 | else | ||
483 | had_error = 1; | ||
484 | } | ||
485 | } else if (strcasecmp(str_key.c_str(), "Alpha") == 0) { | 482 | } else if (strcasecmp(str_key.c_str(), "Alpha") == 0) { |
486 | int focused_a, unfocused_a; | 483 | int focused_a, unfocused_a; |
487 | if (sscanf(str_label.c_str(), "%i %i", &focused_a, &unfocused_a) == 2) | 484 | if (sscanf(str_label.c_str(), "%i %i", &focused_a, &unfocused_a) == 2) |