]> Dogcows Code - chaz/openbox/blobdiff - src/Rootmenu.cc
temporary solution to avoid placing windows over the slit and toolbar, until NETWM...
[chaz/openbox] / src / Rootmenu.cc
index ddb29855be42d1f72dc90df0c2d2002045b3b372..2bda207074bd3fc3d77b1513af6b680206334251 100644 (file)
 #  include <stdio.h>
 #endif // HAVE_STDIO_H
 
-#ifdef    STDC_HEADERS
+#ifdef    HAVE_STDLIB_H
 #  include <stdlib.h>
+#endif // HAVE_STDLIB_H
+
+#ifdef    HAVE_STRING_H
 #  include <string.h>
-#endif // STDC_HEADERS
+#endif // HAVE_STRING_H
 
 #ifdef    HAVE_SYS_PARAM_H
 #  include <sys/param.h>
@@ -52,9 +55,9 @@
 #endif // MAXPATHLEN
 
 
-Rootmenu::Rootmenu(BScreen *scrn) : Basemenu(scrn) {
-  screen = scrn;
-  openbox = screen->getOpenbox();
+Rootmenu::Rootmenu(BScreen &scrn) : Basemenu(scrn), screen(scrn),
+  openbox(scrn.getOpenbox())
+{
 }
 
 
@@ -73,9 +76,9 @@ void Rootmenu::itemSelected(int button, int index) {
 #ifndef    __EMX__
       char displaystring[MAXPATHLEN];
       sprintf(displaystring, "DISPLAY=%s",
-             DisplayString(screen->getBaseDisplay()->getXDisplay()));
+             DisplayString(screen.getBaseDisplay().getXDisplay()));
       sprintf(displaystring + strlen(displaystring) - 1, "%d",
-             screen->getScreenNumber());
+             screen.getScreenNumber());
 
       bexec(item->exec(), displaystring);
 #else //   __EMX__
@@ -85,28 +88,28 @@ void Rootmenu::itemSelected(int button, int index) {
     break;
 
   case BScreen::Restart:
-    openbox->restart();
+    openbox.restart();
     break;
 
   case BScreen::RestartOther:
     if (item->exec())
-      openbox->restart(item->exec());
+      openbox.restart(item->exec());
     break;
 
   case BScreen::Exit:
-    openbox->shutdown();
+    openbox.shutdown();
     break;
 
   case BScreen::SetStyle:
     if (item->exec())
-      openbox->saveStyleFilename(item->exec());
+      openbox.setStyleFilename(item->exec());
 
   case BScreen::Reconfigure:
-    openbox->reconfigure();
+    openbox.reconfigure();
     return;
   }
 
-  if (! (screen->getRootmenu()->isTorn() || isTorn()) &&
+  if (! (screen.getRootmenu()->isTorn() || isTorn()) &&
       item->function() != BScreen::Reconfigure &&
       item->function() != BScreen::SetStyle)
     hide();
This page took 0.023251 seconds and 4 git commands to generate.