]> Dogcows Code - chaz/openbox/blobdiff - openbox/openbox.c
change the menu plugin interface, no need for the create/destroy functions any more.
[chaz/openbox] / openbox / openbox.c
index b5fde8582e4dbd4545fd9398d101bd67ba7da3dd..165d7229730c79859e2d854c0a1ef504a156db25 100644 (file)
@@ -13,6 +13,8 @@
 #include "focus.h"
 #include "moveresize.h"
 #include "frame.h"
+#include "keyboard.h"
+#include "mouse.h"
 #include "extensions.h"
 #include "grab.h"
 #include "plugin.h"
@@ -67,8 +69,6 @@ static gchar    *sm_save_file;
 static void signal_handler(const ObEvent *e, void *data);
 static void parse_args(int argc, char **argv);
 
-static void exit_with_error(gchar *msg);
-
 int main(int argc, char **argv)
 {
     struct sigaction action;
@@ -130,9 +130,9 @@ int main(int argc, char **argv)
 
     ob_display = XOpenDisplay(NULL);
     if (ob_display == NULL)
-       exit_with_error("Failed to open the display.");
+       ob_exit_with_error("Failed to open the display.");
     if (fcntl(ConnectionNumber(ob_display), F_SETFD, 1) == -1)
-        exit_with_error("Failed to set display as close-on-exec.");
+        ob_exit_with_error("Failed to set display as close-on-exec.");
 
     if (sm_save_file)
         session_load(sm_save_file);
@@ -146,7 +146,7 @@ int main(int argc, char **argv)
 
     ob_rr_inst = RrInstanceNew(ob_display, ob_screen);
     if (ob_rr_inst == NULL)
-        exit_with_error("Failed to initialize the render library.");
+        ob_exit_with_error("Failed to initialize the render library.");
 
     /* XXX fork self onto other screens */
      
@@ -210,8 +210,10 @@ int main(int argc, char **argv)
     startup_save();
 
     if (screen_annex()) { /* it will be ours! */
+        ObParseInst *i;
+
         /* startup the parsing so everything can register sections of the rc */
-        parse_startup();
+        i = parse_startup();
 
         /* anything that is going to read data from the rc file needs to be 
            in this group */
@@ -224,27 +226,31 @@ int main(int argc, char **argv)
         window_startup();
         plugin_startup();
         /* load the plugins specified in the pluginrc */
-        plugin_loadall();
+        plugin_loadall(i);
 
         /* set up the kernel config shit */
-        config_startup();
-        menu_startup();
+        config_startup(i);
+        menu_startup(i);
         /* parse/load user options */
         if (parse_load_rc(&doc, &node))
-            parse_tree(doc, node->xmlChildrenNode, NULL);
+            parse_tree(i, doc, node->xmlChildrenNode);
         /* we're done with parsing now, kill it */
-        parse_shutdown();
+        parse_shutdown(i);
+
+        menu_parse();
 
         /* load the theme specified in the rc file */
         ob_rr_theme = RrThemeNew(ob_rr_inst, config_theme);
         if (ob_rr_theme == NULL)
-            exit_with_error("Unable to load a theme.");
+            ob_exit_with_error("Unable to load a theme.");
 
         moveresize_startup();
        screen_startup();
         group_startup();
        client_startup();
         dock_startup();
+        keyboard_startup();
+        mouse_startup();
 
         /* call startup for all the plugins */
         plugin_startall();
@@ -261,13 +267,15 @@ int main(int argc, char **argv)
        client_unmanage_all();
 
         plugin_shutdown(); /* calls all the plugins' shutdown functions */
+        menu_shutdown();
+        mouse_shutdown();
+        keyboard_shutdown();
         dock_shutdown();
        client_shutdown();
         group_shutdown();
        screen_shutdown();
        focus_shutdown();
         moveresize_shutdown();
-        menu_shutdown();
         window_shutdown();
         grab_shutdown();
        event_shutdown();
@@ -404,7 +412,7 @@ static void parse_args(int argc, char **argv)
     }
 }
 
-static void exit_with_error(gchar *msg)
+void ob_exit_with_error(gchar *msg)
 {
     g_critical(msg);
     session_shutdown();
This page took 0.026406 seconds and 4 git commands to generate.