diff options
author | fluxgen <fluxgen> | 2002-12-13 20:19:05 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2002-12-13 20:19:05 (GMT) |
commit | 6f01383c89b47edbd635c16dfebca3b9af27eb9a (patch) | |
tree | a0e018a7574be45d659ac89c1594244816c2f496 /src | |
parent | 939f13be4fb6b587f92718b3cc00ce45ea92d77e (diff) | |
download | fluxbox_paul-6f01383c89b47edbd635c16dfebca3b9af27eb9a.zip fluxbox_paul-6f01383c89b47edbd635c16dfebca3b9af27eb9a.tar.bz2 |
fixed autoptr on rootmenu
Diffstat (limited to 'src')
-rw-r--r-- | src/Screen.cc | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index 455748b..d85021a 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -1,8 +1,8 @@ | |||
1 | // Screen.cc for Fluxbox Window Manager | 1 | // Screen.cc for Fluxbox Window Manager |
2 | // Copyright (c) 2001 - 2002 Henrik Kinnunen (fluxgen@linuxmail.org) | 2 | // Copyright (c) 2001 - 2002 Henrik Kinnunen (fluxgen at users.sourceforge.net) |
3 | // | 3 | // |
4 | // Screen.cc for Blackbox - an X11 Window manager | 4 | // Screen.cc for Blackbox - an X11 Window manager |
5 | // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) | 5 | // Copyright (c) 1997 - 2000 Brad Hughes (bhughes at tcac.net) |
6 | // | 6 | // |
7 | // Permission is hereby granted, free of charge, to any person obtaining a | 7 | // Permission is hereby granted, free of charge, to any person obtaining a |
8 | // copy of this software and associated documentation files (the "Software"), | 8 | // copy of this software and associated documentation files (the "Software"), |
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: Screen.cc,v 1.91 2002/12/04 22:43:18 fluxgen Exp $ | 25 | // $Id: Screen.cc,v 1.92 2002/12/13 20:19:05 fluxgen Exp $ |
26 | 26 | ||
27 | 27 | ||
28 | #include "Screen.hh" | 28 | #include "Screen.hh" |
@@ -190,7 +190,6 @@ getString() { | |||
190 | template<> | 190 | template<> |
191 | string Resource<Toolbar::Placement>:: | 191 | string Resource<Toolbar::Placement>:: |
192 | getString() { | 192 | getString() { |
193 | cerr<<"m_value = "<<m_value<<endl; | ||
194 | switch (m_value) { | 193 | switch (m_value) { |
195 | case Toolbar::TOPLEFT: | 194 | case Toolbar::TOPLEFT: |
196 | return string("TopLeft"); | 195 | return string("TopLeft"); |
@@ -300,7 +299,6 @@ BScreen::BScreen(ResourceManager &rm, | |||
300 | getScreenNumber(), XVisualIDFromVisual(getVisual()), | 299 | getScreenNumber(), XVisualIDFromVisual(getVisual()), |
301 | getDepth()); | 300 | getDepth()); |
302 | 301 | ||
303 | rootmenu = 0; | ||
304 | Fluxbox * const fluxbox = Fluxbox::instance(); | 302 | Fluxbox * const fluxbox = Fluxbox::instance(); |
305 | #ifdef HAVE_GETPID | 303 | #ifdef HAVE_GETPID |
306 | pid_t bpid = getpid(); | 304 | pid_t bpid = getpid(); |
@@ -421,12 +419,12 @@ BScreen::BScreen(ResourceManager &rm, | |||
421 | m_slit.reset(new Slit(this)); | 419 | m_slit.reset(new Slit(this)); |
422 | #endif // SLIT | 420 | #endif // SLIT |
423 | 421 | ||
424 | initMenu(); | 422 | initMenu(); // create and initiate rootmenu |
425 | 423 | ||
426 | raiseWindows(Workspace::Stack()); | 424 | raiseWindows(Workspace::Stack()); |
427 | 425 | ||
428 | //update menus | 426 | //update menus |
429 | rootmenu->update(); | 427 | m_rootmenu->update(); |
430 | 428 | ||
431 | if (m_slit.get()) | 429 | if (m_slit.get()) |
432 | m_slit->reconfigure(); | 430 | m_slit->reconfigure(); |
@@ -535,7 +533,6 @@ BScreen::~BScreen() { | |||
535 | } | 533 | } |
536 | netizenList.clear(); | 534 | netizenList.clear(); |
537 | 535 | ||
538 | delete rootmenu; | ||
539 | delete workspacemenu; | 536 | delete workspacemenu; |
540 | delete m_iconmenu; | 537 | delete m_iconmenu; |
541 | delete configmenu; | 538 | delete configmenu; |
@@ -624,11 +621,11 @@ void BScreen::reconfigure() { | |||
624 | configmenu->reconfigure(); | 621 | configmenu->reconfigure(); |
625 | 622 | ||
626 | { | 623 | { |
627 | int remember_sub = rootmenu->currentSubmenu(); | 624 | int remember_sub = m_rootmenu->currentSubmenu(); |
628 | initMenu(); | 625 | initMenu(); |
629 | raiseWindows(Workspace::Stack()); | 626 | raiseWindows(Workspace::Stack()); |
630 | rootmenu->reconfigure(); | 627 | m_rootmenu->reconfigure(); |
631 | rootmenu->drawSubmenu(remember_sub); | 628 | m_rootmenu->drawSubmenu(remember_sub); |
632 | } | 629 | } |
633 | 630 | ||
634 | m_toolbar->setPlacement(*resource.toolbar_placement); | 631 | m_toolbar->setPlacement(*resource.toolbar_placement); |
@@ -663,7 +660,7 @@ void BScreen::rereadMenu() { | |||
663 | initMenu(); | 660 | initMenu(); |
664 | raiseWindows(Workspace::Stack()); | 661 | raiseWindows(Workspace::Stack()); |
665 | 662 | ||
666 | rootmenu->reconfigure(); | 663 | m_rootmenu->reconfigure(); |
667 | } | 664 | } |
668 | 665 | ||
669 | 666 | ||
@@ -1053,7 +1050,7 @@ void BScreen::raiseWindows(const Workspace::Stack &workspace_stack) { | |||
1053 | for (; rit != rit_end; ++rit) { | 1050 | for (; rit != rit_end; ++rit) { |
1054 | session_stack[i++] = (*rit)->windowID(); | 1051 | session_stack[i++] = (*rit)->windowID(); |
1055 | } | 1052 | } |
1056 | session_stack[i++] = rootmenu->windowID(); | 1053 | session_stack[i++] = m_rootmenu->windowID(); |
1057 | 1054 | ||
1058 | if (m_toolbar->isOnTop()) | 1055 | if (m_toolbar->isOnTop()) |
1059 | session_stack[i++] = m_toolbar->getWindowID(); | 1056 | session_stack[i++] = m_toolbar->getWindowID(); |
@@ -1235,13 +1232,13 @@ void BScreen::raiseFocus() { | |||
1235 | void BScreen::initMenu() { | 1232 | void BScreen::initMenu() { |
1236 | I18n *i18n = I18n::instance(); | 1233 | I18n *i18n = I18n::instance(); |
1237 | 1234 | ||
1238 | if (rootmenu) { | 1235 | if (m_rootmenu.get()) { |
1239 | rootmenuList.erase(rootmenuList.begin(), rootmenuList.end()); | 1236 | rootmenuList.erase(rootmenuList.begin(), rootmenuList.end()); |
1240 | 1237 | ||
1241 | while (rootmenu->numberOfItems()) | 1238 | while (m_rootmenu->numberOfItems()) |
1242 | rootmenu->remove(0); | 1239 | m_rootmenu->remove(0); |
1243 | } else | 1240 | } else |
1244 | rootmenu = new Rootmenu(this); | 1241 | m_rootmenu.reset(new Rootmenu(this)); |
1245 | 1242 | ||
1246 | bool defaultMenu = true; | 1243 | bool defaultMenu = true; |
1247 | Fluxbox * const fb = Fluxbox::instance(); | 1244 | Fluxbox * const fb = Fluxbox::instance(); |
@@ -1264,8 +1261,8 @@ void BScreen::initMenu() { | |||
1264 | string label; | 1261 | string label; |
1265 | err = StringUtil::getStringBetween(label, line.c_str()+pos, '(', ')'); | 1262 | err = StringUtil::getStringBetween(label, line.c_str()+pos, '(', ')'); |
1266 | if (err>0) { | 1263 | if (err>0) { |
1267 | rootmenu->setLabel(label.c_str()); | 1264 | m_rootmenu->setLabel(label.c_str()); |
1268 | defaultMenu = parseMenuFile(menu_file, rootmenu, row); | 1265 | defaultMenu = parseMenuFile(menu_file, m_rootmenu.get(), row); |
1269 | } else | 1266 | } else |
1270 | cerr<<"Error in menufile. Line("<<row<<")"<<endl; | 1267 | cerr<<"Error in menufile. Line("<<row<<")"<<endl; |
1271 | break; | 1268 | break; |
@@ -1285,19 +1282,19 @@ void BScreen::initMenu() { | |||
1285 | } | 1282 | } |
1286 | 1283 | ||
1287 | if (defaultMenu) { | 1284 | if (defaultMenu) { |
1288 | rootmenu->setInternalMenu(); | 1285 | m_rootmenu->setInternalMenu(); |
1289 | rootmenu->insert(i18n->getMessage( | 1286 | m_rootmenu->insert(i18n->getMessage( |
1290 | FBNLS::ScreenSet, FBNLS::Screenxterm, | 1287 | FBNLS::ScreenSet, FBNLS::Screenxterm, |
1291 | "xterm"), | 1288 | "xterm"), |
1292 | BScreen::EXECUTE, | 1289 | BScreen::EXECUTE, |
1293 | i18n->getMessage( | 1290 | i18n->getMessage( |
1294 | FBNLS::ScreenSet, FBNLS::Screenxterm, | 1291 | FBNLS::ScreenSet, FBNLS::Screenxterm, |
1295 | "xterm")); | 1292 | "xterm")); |
1296 | rootmenu->insert(i18n->getMessage( | 1293 | m_rootmenu->insert(i18n->getMessage( |
1297 | FBNLS::ScreenSet, FBNLS::ScreenRestart, | 1294 | FBNLS::ScreenSet, FBNLS::ScreenRestart, |
1298 | "Restart"), | 1295 | "Restart"), |
1299 | BScreen::RESTART); | 1296 | BScreen::RESTART); |
1300 | rootmenu->insert(i18n->getMessage( | 1297 | m_rootmenu->insert(i18n->getMessage( |
1301 | FBNLS::ScreenSet, FBNLS::ScreenExit, | 1298 | FBNLS::ScreenSet, FBNLS::ScreenExit, |
1302 | "Exit"), | 1299 | "Exit"), |
1303 | BScreen::EXIT); | 1300 | BScreen::EXIT); |