diff options
| author | Scott Moynes <smoynes@nexus.carleton.ca> | 2003-05-21 23:58:40 +0000 |
|---|---|---|
| committer | Scott Moynes <smoynes@nexus.carleton.ca> | 2003-05-21 23:58:40 +0000 |
| commit | 71d2605e1c24732e923333419d829f1c5f867fed (patch) | |
| tree | d5f25de1dfd118a80f0c139199b280d584dc5a69 /plugins/menu | |
| parent | 955d9d8e3048d04edb8986bfe7693e659204eae3 (diff) | |
Client menus
Add "client_menu" to pluginrc to use.
Diffstat (limited to 'plugins/menu')
| -rw-r--r-- | plugins/menu/Makefile.am | 5 | ||||
| -rw-r--r-- | plugins/menu/client_menu.c | 87 |
2 files changed, 91 insertions, 1 deletions
diff --git a/plugins/menu/Makefile.am b/plugins/menu/Makefile.am index dbd29822..40b9b64d 100644 --- a/plugins/menu/Makefile.am +++ b/plugins/menu/Makefile.am @@ -5,7 +5,7 @@ CPPFLAGS=$(XFT_CFLAGS) $(GLIB_CFLAGS) $(LIBSN_CFLAGS) @CPPFLAGS@ \ INCLUDES=-I../.. -plugin_LTLIBRARIES=timed_menu.la fifo_menu.la +plugin_LTLIBRARIES=timed_menu.la fifo_menu.la client_menu.la timed_menu_la_LDFLAGS=-module -avoid-version timed_menu_la_SOURCES=timed_menu.c @@ -13,6 +13,9 @@ timed_menu_la_SOURCES=timed_menu.c fifo_menu_la_LDFLAGS=-module -avoid-version fifo_menu_la_SOURCES=fifo_menu.c +client_menu_la_LDFLAGS=-module -avoid-version +client_menu_la_SOURCES=client_menu.c + noinst_HEADERS=timed_menu.h fifo_menu.h MAINTAINERCLEANFILES=Makefile.in diff --git a/plugins/menu/client_menu.c b/plugins/menu/client_menu.c new file mode 100644 index 00000000..56ec6ce3 --- /dev/null +++ b/plugins/menu/client_menu.c @@ -0,0 +1,87 @@ +#include <glib.h> + +#include "kernel/menu.h" +#include "kernel/screen.h" + +static char *PLUGIN_NAME = "client_menu"; +static Menu *send_to_menu; + +typedef struct { + +} Client_Menu_Data; + +#define CLIENT_MENU(m) ((Menu *)m) +#define CLIENT_MENU_DATA(m) ((Client_Menu_Data *)((Menu *)m)->plugin_data) + + +void client_menu_clean_up(Menu *m) { +} + +void client_send_to_update(Menu *self) +{ + guint i; + g_message("yo!"); + + for (i = 0; i < screen_num_desktops; ++i) { + MenuEntry *e; + Action *a = action_from_string("sendtodesktop"); + a->data.sendto.desk = i; + a->data.sendto.follow = FALSE; + e = menu_entry_new(screen_desktop_names[i], a); + menu_add_entry(self, e); + } + + menu_render_full(self); +} + +void plugin_setup_config() { } + +void plugin_shutdown() { } + +void plugin_destroy (Menu *m) +{ +} + +void *plugin_create() /* TODO: need config */ +{ + Menu *m = menu_new(NULL, "client-menu", NULL); + menu_add_entry(m, menu_entry_new_submenu("Send To Workspace", + send_to_menu)); + send_to_menu->parent = m; + + menu_add_entry(m, menu_entry_new("Iconify", + action_from_string("iconify"))); + menu_add_entry(m, menu_entry_new("Raise", + action_from_string("raise"))); + menu_add_entry(m, menu_entry_new("Lower", + action_from_string("lower"))); + menu_add_entry(m, menu_entry_new("Close", + action_from_string("close"))); + menu_add_entry(m, menu_entry_new("Shade", + action_from_string("toggleshade"))); + menu_add_entry(m, menu_entry_new("Omnipresent", + action_from_string("toggleomnipresent"))); + + /* send to desktop + iconify + raise + lower + close + kill + shade + omnipresent + decorations + */ + return (void *)m; +} + +void plugin_startup() +{ + Menu *t; + /* create a Send To Workspace Menu */ + send_to_menu = menu_new_full("Send To Workspace", "send-to-workspace", + NULL, NULL, client_send_to_update); + + t = (Menu *)plugin_create("client_menu"); +} + |
