diff options
author | markt <markt> | 2007-06-16 22:50:09 (GMT) |
---|---|---|
committer | markt <markt> | 2007-06-16 22:50:09 (GMT) |
commit | b4b927dad90baa43d290679872943144f1c2ab93 (patch) | |
tree | 217aeb0c06e1e8d7c6997c658572944652e627b9 /src | |
parent | 6f8a5c7a8dc4552105205c8c9f0d270703bcc271 (diff) | |
download | fluxbox_pavel-b4b927dad90baa43d290679872943144f1c2ab93.zip fluxbox_pavel-b4b927dad90baa43d290679872943144f1c2ab93.tar.bz2 |
moved function so fluxbox compiles with --disable-remember
Diffstat (limited to 'src')
-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 55816c4..cb1114c 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 a1e75da..581e525 100644 --- a/src/Remember.hh +++ b/src/Remember.hh | |||
@@ -205,8 +205,6 @@ public: | |||
205 | Remember(); | 205 | Remember(); |
206 | ~Remember(); | 206 | ~Remember(); |
207 | 207 | ||
208 | static int getDecoFromString(const std::string &str); | ||
209 | |||
210 | Application* find(WinClient &winclient); | 208 | Application* find(WinClient &winclient); |
211 | Application* add(WinClient &winclient); | 209 | Application* add(WinClient &winclient); |
212 | FluxboxWindow* findGroup(Application *, BScreen &screen); | 210 | FluxboxWindow* findGroup(Application *, BScreen &screen); |
diff --git a/src/Window.cc b/src/Window.cc index 23e11bf..1c839f6 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -388,7 +388,7 @@ void FluxboxWindow::init() { | |||
388 | m_blackbox_attrib.premax_w = m_blackbox_attrib.premax_h = 0; | 388 | m_blackbox_attrib.premax_w = m_blackbox_attrib.premax_h = 0; |
389 | 389 | ||
390 | // set default decorations but don't apply them | 390 | // set default decorations but don't apply them |
391 | setDecorationMask(Remember::getDecoFromString(screen().defaultDeco()), false); | 391 | setDecorationMask(getDecoMaskFromString(screen().defaultDeco()), false); |
392 | 392 | ||
393 | functions.resize = functions.move = functions.iconify = functions.maximize | 393 | functions.resize = functions.move = functions.iconify = functions.maximize |
394 | = functions.close = functions.tabable = true; | 394 | = functions.close = functions.tabable = true; |
@@ -4206,3 +4206,29 @@ void FluxboxWindow::associateClient(WinClient &client) { | |||
4206 | evm.add(*this, client.window()); | 4206 | evm.add(*this, client.window()); |
4207 | client.setFluxboxWindow(this); | 4207 | client.setFluxboxWindow(this); |
4208 | } | 4208 | } |
4209 | |||
4210 | int FluxboxWindow::getDecoMaskFromString(const string &str_label) { | ||
4211 | if (strcasecmp(str_label.c_str(), "NONE") == 0) | ||
4212 | return 0; | ||
4213 | if (strcasecmp(str_label.c_str(), "NORMAL") == 0) | ||
4214 | return FluxboxWindow::DECORM_LAST - 1; | ||
4215 | if (strcasecmp(str_label.c_str(), "TINY") == 0) | ||
4216 | return FluxboxWindow::DECORM_TITLEBAR | ||
4217 | | FluxboxWindow::DECORM_ICONIFY | ||
4218 | | FluxboxWindow::DECORM_MENU | ||
4219 | | FluxboxWindow::DECORM_TAB; | ||
4220 | if (strcasecmp(str_label.c_str(), "TOOL") == 0) | ||
4221 | return FluxboxWindow::DECORM_TITLEBAR | ||
4222 | | FluxboxWindow::DECORM_MENU; | ||
4223 | if (strcasecmp(str_label.c_str(), "BORDER") == 0) | ||
4224 | return FluxboxWindow::DECORM_BORDER | ||
4225 | | FluxboxWindow::DECORM_MENU; | ||
4226 | if (strcasecmp(str_label.c_str(), "TAB") == 0) | ||
4227 | return FluxboxWindow::DECORM_BORDER | ||
4228 | | FluxboxWindow::DECORM_MENU | ||
4229 | | FluxboxWindow::DECORM_TAB; | ||
4230 | unsigned int mask = atoi(str_label.c_str()); | ||
4231 | if (mask) | ||
4232 | return mask; | ||
4233 | return -1; | ||
4234 | } | ||
diff --git a/src/Window.hh b/src/Window.hh index 82cd492..d7d8910 100644 --- a/src/Window.hh +++ b/src/Window.hh | |||
@@ -399,6 +399,7 @@ public: | |||
399 | int layerNum() const { return m_layernum; } | 399 | int layerNum() const { return m_layernum; } |
400 | void setLayerNum(int layernum); | 400 | void setLayerNum(int layernum); |
401 | 401 | ||
402 | static int getDecoMaskFromString(const std::string &str); | ||
402 | 403 | ||
403 | unsigned int titlebarHeight() const; | 404 | unsigned int titlebarHeight() const; |
404 | 405 | ||