3 #include "kernel/menu.h"
4 #include "kernel/screen.h"
6 static char *PLUGIN_NAME = "client_menu";
7 static Menu *send_to_menu;
13 #define CLIENT_MENU(m) ((Menu *)m)
14 #define CLIENT_MENU_DATA(m) ((Client_Menu_Data *)((Menu *)m)->plugin_data)
17 void client_menu_clean_up(Menu *m) {
20 void client_send_to_update(Menu *self)
25 for (i = 0; i < screen_num_desktops; ++i) {
27 Action *a = action_from_string("sendtodesktop");
28 a->data.sendto.desk = i;
29 a->data.sendto.follow = FALSE;
30 e = menu_entry_new(screen_desktop_names[i], a);
31 menu_add_entry(self, e);
34 menu_render_full(self);
37 void plugin_setup_config() { }
39 void plugin_shutdown() { }
41 void plugin_destroy (Menu *m)
45 void *plugin_create() /* TODO: need config */
47 Menu *m = menu_new(NULL, "client-menu", NULL);
48 menu_add_entry(m, menu_entry_new_submenu("Send To Workspace",
50 send_to_menu->parent = m;
52 menu_add_entry(m, menu_entry_new("Iconify",
53 action_from_string("iconify")));
54 menu_add_entry(m, menu_entry_new("Raise",
55 action_from_string("raise")));
56 menu_add_entry(m, menu_entry_new("Lower",
57 action_from_string("lower")));
58 menu_add_entry(m, menu_entry_new("Close",
59 action_from_string("close")));
60 menu_add_entry(m, menu_entry_new("Shade",
61 action_from_string("toggleshade")));
62 menu_add_entry(m, menu_entry_new("Omnipresent",
63 action_from_string("toggleomnipresent")));
81 /* create a Send To Workspace Menu */
82 send_to_menu = menu_new_full("Send To Workspace", "send-to-workspace",
83 NULL, NULL, client_send_to_update);
85 t = (Menu *)plugin_create("client_menu");