]> Dogcows Code - chaz/openbox/blobdiff - openbox/client_menu.c
move the client and client-list menus into the 'kernel'
[chaz/openbox] / openbox / client_menu.c
similarity index 69%
rename from plugins/menu/client_menu.c
rename to openbox/client_menu.c
index 0c2167c374a8bfccc50f2afa58854361b6a07517..bd57f06d8d4667c680cbe52bf849d05a1962d847 100644 (file)
@@ -33,8 +33,6 @@ enum {
     CLIENT_CLOSE
 };
 
-void plugin_setup_config() { }
-
 static void client_update(ObMenuFrame *frame, gpointer data)
 {
     ObMenu *menu = frame->menu;
@@ -103,7 +101,7 @@ static void send_to_update(ObMenuFrame *frame, gpointer data)
     GSList *acts;
     ObAction *act;
 
-    menu_clear_entries(SEND_TO_MENU_NAME);
+    menu_clear_entries(menu);
 
     if (!frame->client)
         return;
@@ -113,7 +111,7 @@ static void send_to_update(ObMenuFrame *frame, gpointer data)
         guint desk;
 
         if (i >= screen_num_desktops) {
-            menu_add_separator(CLIENT_MENU_NAME, -1);
+            menu_add_separator(menu, -1);
 
             desk = DESKTOP_ALL;
             name = _("All desktops");
@@ -126,7 +124,7 @@ static void send_to_update(ObMenuFrame *frame, gpointer data)
         act->data.sendto.desk = desk;
         act->data.sendto.follow = FALSE;
         acts = g_slist_prepend(NULL, act);
-        menu_add_normal(SEND_TO_MENU_NAME, desk, name, acts);
+        menu_add_normal(menu, desk, name, acts);
 
         if (frame->client->desktop == desk) {
             ObMenuEntry *e = menu_find_entry_id(menu, desk);
@@ -136,69 +134,63 @@ static void send_to_update(ObMenuFrame *frame, gpointer data)
     }
 }
 
-void plugin_startup()
+void client_menu_startup()
 {
     GSList *acts;
+    ObMenu *menu;
 
-    menu_new(LAYER_MENU_NAME, _("Layer"), NULL);
-    menu_set_update_func(LAYER_MENU_NAME, layer_update);
+    menu = menu_new(LAYER_MENU_NAME, _("Layer"), NULL);
+    menu_set_update_func(menu, layer_update);
 
     acts = g_slist_prepend(NULL, action_from_string("SendToTopLayer"));
-    menu_add_normal(LAYER_MENU_NAME, LAYER_TOP, _("Always on top"), acts);
+    menu_add_normal(menu, LAYER_TOP, _("Always on top"), acts);
 
     acts = g_slist_prepend(NULL, action_from_string("SendToNormalLayer"));
-    menu_add_normal(LAYER_MENU_NAME, LAYER_NORMAL, _("Normal"), acts);
+    menu_add_normal(menu, LAYER_NORMAL, _("Normal"), acts);
 
     acts = g_slist_prepend(NULL, action_from_string("SendToBottomLayer"));
-    menu_add_normal(LAYER_MENU_NAME, LAYER_BOTTOM, _("Always on bottom"),acts);
+    menu_add_normal(menu, LAYER_BOTTOM, _("Always on bottom"),acts);
 
 
-    menu_new(SEND_TO_MENU_NAME, _("Send to desktop"), NULL);
-    menu_set_update_func(SEND_TO_MENU_NAME, send_to_update);
+    menu = menu_new(SEND_TO_MENU_NAME, _("Send to desktop"), NULL);
+    menu_set_update_func(menu, send_to_update);
 
 
-    menu_new(CLIENT_MENU_NAME, _("Client menu"), NULL);
-    menu_set_update_func(CLIENT_MENU_NAME, client_update);
+    menu = menu_new(CLIENT_MENU_NAME, _("Client menu"), NULL);
+    menu_set_update_func(menu, client_update);
 
-    menu_add_submenu(CLIENT_MENU_NAME, CLIENT_SEND_TO, SEND_TO_MENU_NAME);
+    menu_add_submenu(menu, CLIENT_SEND_TO, SEND_TO_MENU_NAME);
 
-    menu_add_submenu(CLIENT_MENU_NAME, CLIENT_LAYER, LAYER_MENU_NAME);
+    menu_add_submenu(menu, CLIENT_LAYER, LAYER_MENU_NAME);
 
     acts = g_slist_prepend(NULL, action_from_string("Iconify"));
-    menu_add_normal(CLIENT_MENU_NAME, CLIENT_ICONIFY, _("Iconify"), acts);
+    menu_add_normal(menu, CLIENT_ICONIFY, _("Iconify"), acts);
 
     acts = g_slist_prepend(NULL, action_from_string("ToggleMaximizeFull"));
-    menu_add_normal(CLIENT_MENU_NAME, CLIENT_MAXIMIZE, _("Maximize"), acts);
+    menu_add_normal(menu, CLIENT_MAXIMIZE, _("Maximize"), acts);
 
     acts = g_slist_prepend(NULL, action_from_string("Raise"));
-    menu_add_normal(CLIENT_MENU_NAME, CLIENT_RAISE, _("Raise to top"), acts);
+    menu_add_normal(menu, CLIENT_RAISE, _("Raise to top"), acts);
 
     acts = g_slist_prepend(NULL, action_from_string("Lower"));
-    menu_add_normal(CLIENT_MENU_NAME, CLIENT_LOWER, _("Lower to bottom"),acts);
+    menu_add_normal(menu, CLIENT_LOWER, _("Lower to bottom"),acts);
 
     acts = g_slist_prepend(NULL, action_from_string("ToggleShade"));
-    menu_add_normal(CLIENT_MENU_NAME, CLIENT_SHADE, _("Roll up/down"), acts);
+    menu_add_normal(menu, CLIENT_SHADE, _("Roll up/down"), acts);
 
     acts = g_slist_prepend(NULL, action_from_string("ToggleDecorations"));
-    menu_add_normal(CLIENT_MENU_NAME, CLIENT_DECORATE, _("Decorate"), acts);
+    menu_add_normal(menu, CLIENT_DECORATE, _("Decorate"), acts);
 
-    menu_add_separator(CLIENT_MENU_NAME, -1);
+    menu_add_separator(menu, -1);
 
     acts = g_slist_prepend(NULL, action_from_string("KeyboardMove"));
-    menu_add_normal(CLIENT_MENU_NAME, CLIENT_MOVE, _("Move"), acts);
+    menu_add_normal(menu, CLIENT_MOVE, _("Move"), acts);
 
     acts = g_slist_prepend(NULL, action_from_string("KeyboardResize"));
-    menu_add_normal(CLIENT_MENU_NAME, CLIENT_RESIZE, _("Resize"), acts);
+    menu_add_normal(menu, CLIENT_RESIZE, _("Resize"), acts);
 
-    menu_add_separator(CLIENT_MENU_NAME, -1);
+    menu_add_separator(menu, -1);
 
     acts = g_slist_prepend(NULL, action_from_string("Close"));
-    menu_add_normal(CLIENT_MENU_NAME, CLIENT_CLOSE, _("Close"), acts);
-}
-
-void plugin_shutdown()
-{
-    menu_free(LAYER_MENU_NAME);
-    menu_free(SEND_TO_MENU_NAME);
-    menu_free(CLIENT_MENU_NAME);
+    menu_add_normal(menu, CLIENT_CLOSE, _("Close"), acts);
 }
This page took 0.026875 seconds and 4 git commands to generate.