diff options
-rw-r--r-- | libdbusmenu-glib/dbus-menu.xml | 34 | ||||
-rw-r--r-- | libdbusmenu-glib/server.c | 34 |
2 files changed, 67 insertions, 1 deletions
diff --git a/libdbusmenu-glib/dbus-menu.xml b/libdbusmenu-glib/dbus-menu.xml index 4b5a5d8..1350349 100644 --- a/libdbusmenu-glib/dbus-menu.xml +++ b/libdbusmenu-glib/dbus-menu.xml @@ -326,6 +326,20 @@ License version 3 and version 2.1 along with this program. If not, see </arg> </method> + <method name="EventGroup"> + <dox:d> + Used to pass a set of events as a single message for possibily several + different menuitems. This is done to optimize DBus traffic. + </dox:d> + <arg type="a(isvu)" name="events" direction="in"> + <dox:d> + An array of all the events that should be passed. This tuple should + match the parameters of the 'Event' signal. Which is roughly: + id, eventID, data and timestamp. + </dox:d> + </arg> + </method> + <method name="AboutToShow"> <dox:d> This is called by the applet to notify the application that it is about @@ -343,6 +357,26 @@ License version 3 and version 2.1 along with this program. If not, see </arg> </method> + <method name="AboutToShowGroup"> + <dox:d> + A function to tell several menus being shown that they are about to + be shown to the user. This is likely only useful for programitc purposes + so while the return values are returned, in general, the singular function + should be used in most user interacation scenarios. + </dox:d> + <arg type="ai" name="ids" direction="in"> + <dox:d> + The IDs of the menu items who's submenus are being shown. + </dox:d> + </arg> + <arg type="ai" name="updatesNeeded" direction="out"> + <dox:d> + The IDs of the menus that need updates. Note: if no update information + is needed the DBus message should set the no reply flag. + </dox:d> + </arg> + </method> + <!-- Signals --> <signal name="ItemsPropertiesUpdated"> <dox:d> diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 1b4ce95..e67ec58 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -42,7 +42,7 @@ License version 3 and version 2.1 along with this program. If not, see static void layout_update_signal (DbusmenuServer * server); -#define DBUSMENU_VERSION_NUMBER 2 +#define DBUSMENU_VERSION_NUMBER 3 #define DBUSMENU_INTERFACE "com.canonical.dbusmenu" /* Privates, I'll show you mine... */ @@ -118,7 +118,9 @@ enum { METHOD_GET_PROPERTY, METHOD_GET_PROPERTIES, METHOD_EVENT, + METHOD_EVENT_GROUP, METHOD_ABOUT_TO_SHOW, + METHOD_ABOUT_TO_SHOW_GROUP, /* Counter, do not remove! */ METHOD_COUNT }; @@ -191,9 +193,15 @@ static void bus_get_properties (DbusmenuServer * server, static void bus_event (DbusmenuServer * server, GVariant * params, GDBusMethodInvocation * invocation); +static void bus_event_group (DbusmenuServer * server, + GVariant * params, + GDBusMethodInvocation * invocation); static void bus_about_to_show (DbusmenuServer * server, GVariant * params, GDBusMethodInvocation * invocation); +static void bus_about_to_show_group (DbusmenuServer * server, + GVariant * params, + GDBusMethodInvocation * invocation); static void find_servers_cb (GDBusConnection * connection, const gchar * sender, const gchar * path, @@ -358,9 +366,15 @@ dbusmenu_server_class_init (DbusmenuServerClass *class) dbusmenu_method_table[METHOD_EVENT].interned_name = g_intern_static_string("Event"); dbusmenu_method_table[METHOD_EVENT].func = bus_event; + dbusmenu_method_table[METHOD_EVENT_GROUP].interned_name = g_intern_static_string("EventGroup"); + dbusmenu_method_table[METHOD_EVENT_GROUP].func = bus_event_group; + dbusmenu_method_table[METHOD_ABOUT_TO_SHOW].interned_name = g_intern_static_string("AboutToShow"); dbusmenu_method_table[METHOD_ABOUT_TO_SHOW].func = bus_about_to_show; + dbusmenu_method_table[METHOD_ABOUT_TO_SHOW_GROUP].interned_name = g_intern_static_string("AboutToShowGroup"); + dbusmenu_method_table[METHOD_ABOUT_TO_SHOW_GROUP].func = bus_about_to_show_group; + return; } @@ -1682,6 +1696,15 @@ bus_event (DbusmenuServer * server, GVariant * params, GDBusMethodInvocation * i return; } +/* Respond to the event group method that will send events to a + variety of menuitems */ +static void +bus_event_group (DbusmenuServer * server, GVariant * params, GDBusMethodInvocation * invocation) +{ + /* TODO: DO THIS */ + return; +} + /* Recieve the About To Show function. Pass it to our menu item. */ static void bus_about_to_show (DbusmenuServer * server, GVariant * params, GDBusMethodInvocation * invocation) @@ -1717,6 +1740,15 @@ bus_about_to_show (DbusmenuServer * server, GVariant * params, GDBusMethodInvoca return; } +/* Handle the about to show on a set of menus and tell all of them that + we love them */ +static void +bus_about_to_show_group (DbusmenuServer * server, GVariant * params, GDBusMethodInvocation * invocation) +{ + /* TODO: DO THIS */ + return; +} + /* Public Interface */ /** dbusmenu_server_new: |