diff options
author | Ted Gould <ted@gould.cx> | 2009-12-10 12:39:41 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2009-12-10 12:39:41 -0600 |
commit | 10e6923a8868dd8468e6e211a3631deafb578a3e (patch) | |
tree | 2a79277658598c8f47d22670d974a6c543fd1c2b | |
parent | 38c9adcb94c6ab0d273815705b474a801f56a59d (diff) | |
parent | 54203154fee5b70cf37c4ce4f92176d67597a7e8 (diff) | |
download | libdbusmenu-10e6923a8868dd8468e6e211a3631deafb578a3e.tar.gz libdbusmenu-10e6923a8868dd8468e6e211a3631deafb578a3e.tar.bz2 libdbusmenu-10e6923a8868dd8468e6e211a3631deafb578a3e.zip |
Merge in some of the changes from the 0.2 branch. Specifically we're taking:
* Changing the name to org.ayatana
* Underline fixes
* Documenation of the DBus API
We're not taking
* Updates to the test suite
* New tools
-rw-r--r-- | libdbusmenu-glib/client.c | 10 | ||||
-rw-r--r-- | libdbusmenu-glib/dbus-menu.xml | 59 | ||||
-rw-r--r-- | libdbusmenu-glib/server.c | 6 | ||||
-rw-r--r-- | libdbusmenu-gtk/client.c | 2 | ||||
-rw-r--r-- | libdbusmenu-gtk/client.h | 3 | ||||
-rw-r--r-- | libdbusmenu-gtk/menu.c | 8 |
6 files changed, 77 insertions, 11 deletions
diff --git a/libdbusmenu-glib/client.c b/libdbusmenu-glib/client.c index ab307bd..61f1ccf 100644 --- a/libdbusmenu-glib/client.c +++ b/libdbusmenu-glib/client.c @@ -351,7 +351,7 @@ id_update (DBusGProxy * proxy, guint id, DbusmenuClient * client) DbusmenuMenuitem * menuitem = dbusmenu_menuitem_find_id(priv->root, id); g_return_if_fail(menuitem != NULL); - org_freedesktop_dbusmenu_get_properties_async(proxy, id, menuitem_get_properties_cb, menuitem); + org_ayatana_dbusmenu_get_properties_async(proxy, id, menuitem_get_properties_cb, menuitem); return; } @@ -472,7 +472,7 @@ build_proxies (DbusmenuClient * client) priv->menuproxy = dbus_g_proxy_new_for_name_owner(priv->session_bus, priv->dbus_name, priv->dbus_object, - "org.freedesktop.dbusmenu", + "org.ayatana.dbusmenu", &error); if (error != NULL) { g_warning("Unable to get dbusmenu proxy for %s on %s: %s", priv->dbus_name, priv->dbus_object, error->message); @@ -647,7 +647,7 @@ static void menuitem_activate (DbusmenuMenuitem * mi, DbusmenuClient * client) { DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client); - org_freedesktop_dbusmenu_call_async (priv->menuproxy, dbusmenu_menuitem_get_id(mi), menuitem_call_cb, mi); + org_ayatana_dbusmenu_call_async (priv->menuproxy, dbusmenu_menuitem_get_id(mi), menuitem_call_cb, mi); return; } @@ -689,7 +689,7 @@ parse_layout_xml(DbusmenuClient * client, xmlNodePtr node, DbusmenuMenuitem * it propdata->item = item; propdata->parent = parent; - org_freedesktop_dbusmenu_get_properties_async(proxy, id, menuitem_get_properties_new_cb, propdata); + org_ayatana_dbusmenu_get_properties_async(proxy, id, menuitem_get_properties_new_cb, propdata); } else { g_warning("Unable to allocate memory to get properties for menuitem. This menuitem will never be realized."); } @@ -829,7 +829,7 @@ update_layout (DbusmenuClient * client) update_layout_cb, client, NULL, - G_TYPE_STRING, "org.freedesktop.dbusmenu", + G_TYPE_STRING, "org.ayatana.dbusmenu", G_TYPE_STRING, "layout", G_TYPE_INVALID, G_TYPE_VALUE, G_TYPE_INVALID); diff --git a/libdbusmenu-glib/dbus-menu.xml b/libdbusmenu-glib/dbus-menu.xml index cca9823..345c736 100644 --- a/libdbusmenu-glib/dbus-menu.xml +++ b/libdbusmenu-glib/dbus-menu.xml @@ -28,34 +28,91 @@ License version 3 and version 2.1 along with this program. If not, see <http://www.gnu.org/licenses/> --> <node name="/"> - <interface name="org.freedesktop.dbusmenu"> + <interface name="org.ayatana.dbusmenu"> <!-- Properties --> +<!-- +Provides an XML representation of the menu hierarchy + +XML syntax: + +<menu id="1" revision="2"> # Root container + <menu id="2" revision="2"> # First level menu, for example "File" + <menu id="3" revision="2"/> ~ Second level menu, for example "Open" + <menu id="4" revision="3"/> + ... + </menu> + <menu id="5" revision="2"> # Another first level menu, say "Edit" + ... + </menu> + ... +</menu> +--> <property name="layout" type="s" access="read"/> <!-- Functions --> + +<!-- +Each menu item has a set of properties. Property keys are in menuitem.h: + +- visible +- sensitive +- label +- icon +- icon-data +- type + +"type" property is an enum which can take the following values (client.h): + +- menuitem +- separator +- imageitem +--> <method name="GetProperty"> <arg type="u" name="id" direction="in" /> <arg type="s" name="property" direction="in" /> <arg type="s" name="value" direction="out" /> </method> + +<!-- +Convenience method to retrieve all properties in one call (more efficient) +--> <method name="GetProperties"> <arg type="u" name="id" direction="in" /> <arg type="a{ss}" name="properties" direction="out" /> </method> + +<!-- +This is called by the display to notify the application it should trigger +the action associated with a specific menu id +--> <method name="Call"> <arg type="u" name="id" direction="in" /> </method> <!-- Signals --> +<!-- +Triggered by the application to notify display that the property prop from menu id +as changed to value. +--> <signal name="IdPropUpdate"> <arg type="u" name="id" direction="out" /> <arg type="s" name="prop" direction="out" /> <arg type="s" name="value" direction="out" /> </signal> + +<!-- +Triggered by the application to notify display that all properties of menu id +should be considered outdated +--> <signal name="IdUpdate"> <arg type="u" name="id" direction="out" /> </signal> + +<!-- +Triggered by the application to notify display of a layout update, up to +revision +--> <signal name="LayoutUpdate"> <arg type="i" name="revision" direction="out" /> </signal> diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index 1ac1da6..84bfffe 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -161,7 +161,7 @@ dbusmenu_server_class_init (DbusmenuServerClass *class) g_object_class_install_property (object_class, PROP_DBUS_OBJECT, g_param_spec_string(DBUSMENU_SERVER_PROP_DBUS_OBJECT, "DBus object path", "The object that represents this set of menus on DBus", - "/org/freedesktop/dbusmenu", + "/org/ayatana/dbusmenu", G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_ROOT_NODE, g_param_spec_object(DBUSMENU_SERVER_PROP_ROOT_NODE, "Root menu node", @@ -472,7 +472,7 @@ _dbusmenu_server_call (DbusmenuServer * server, guint id, GError ** error) Creates a new #DbusmenuServer object with a specific object path on DBus. If @object is set to NULL the default object - name of "/org/freedesktop/dbusmenu" will be used. + name of "/org/ayatana/dbusmenu" will be used. Return value: A brand new #DbusmenuServer */ @@ -480,7 +480,7 @@ DbusmenuServer * dbusmenu_server_new (const gchar * object) { if (object == NULL) { - object = "/org/freedesktop/dbusmenu"; + object = "/org/ayatana/dbusmenu"; } DbusmenuServer * self = g_object_new(DBUSMENU_TYPE_SERVER, diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c index 8489424..fdebc6b 100644 --- a/libdbusmenu-gtk/client.c +++ b/libdbusmenu-gtk/client.c @@ -359,6 +359,7 @@ new_item_normal (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, Dbusmenu GtkMenuItem * gmi; gmi = GTK_MENU_ITEM(gtk_menu_item_new_with_label(dbusmenu_menuitem_property_get(newitem, DBUSMENU_MENUITEM_PROP_LABEL))); + gtk_menu_item_set_use_underline (gmi, TRUE); if (gmi != NULL) { dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem, gmi, parent); @@ -489,6 +490,7 @@ new_item_image (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuC GtkMenuItem * gmi; gmi = GTK_MENU_ITEM(gtk_image_menu_item_new_with_label(dbusmenu_menuitem_property_get(newitem, DBUSMENU_MENUITEM_PROP_LABEL))); + gtk_menu_item_set_use_underline (gmi, TRUE); if (gmi != NULL) { dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem, gmi, parent); diff --git a/libdbusmenu-gtk/client.h b/libdbusmenu-gtk/client.h index b1d816f..4cfbdcf 100644 --- a/libdbusmenu-gtk/client.h +++ b/libdbusmenu-gtk/client.h @@ -29,8 +29,7 @@ License version 3 and version 2.1 along with this program. If not, see #ifndef __DBUSMENU_GTKCLIENT_H__ #define __DBUSMENU_GTKCLIENT_H__ -#include <glib.h> -#include <glib-object.h> +#include <gtk/gtk.h> #include <libdbusmenu-glib/client.h> G_BEGIN_DECLS diff --git a/libdbusmenu-gtk/menu.c b/libdbusmenu-gtk/menu.c index 2dd7a6e..d2a8620 100644 --- a/libdbusmenu-gtk/menu.c +++ b/libdbusmenu-gtk/menu.c @@ -213,7 +213,9 @@ find_pos (GtkWidget * widget, gpointer data) static void root_child_added (DbusmenuMenuitem * root, DbusmenuMenuitem * child, guint position, DbusmenuGtkMenu * menu) { + #ifdef MASSIVEDEBUGGING g_debug("Root new child"); + #endif DbusmenuGtkMenuPrivate * priv = DBUSMENU_GTKMENU_GET_PRIVATE(menu); g_signal_connect(G_OBJECT(child), DBUSMENU_MENUITEM_SIGNAL_REALIZED, G_CALLBACK(child_realized), menu); @@ -240,7 +242,9 @@ root_child_added (DbusmenuMenuitem * root, DbusmenuMenuitem * child, guint posit static void root_child_moved (DbusmenuMenuitem * root, DbusmenuMenuitem * child, guint newposition, guint oldposition, DbusmenuGtkMenu * menu) { + #ifdef MASSIVEDEBUGGING g_debug("Root child moved"); + #endif DbusmenuGtkMenuPrivate * priv = DBUSMENU_GTKMENU_GET_PRIVATE(menu); gtk_menu_reorder_child(GTK_MENU(menu), GTK_WIDGET(dbusmenu_gtkclient_menuitem_get(priv->client, child)), newposition); return; @@ -250,7 +254,9 @@ root_child_moved (DbusmenuMenuitem * root, DbusmenuMenuitem * child, guint newpo static void root_child_delete (DbusmenuMenuitem * root, DbusmenuMenuitem * child, DbusmenuGtkMenu * menu) { + #ifdef MASSIVEDEBUGGING g_debug("Root child deleted"); + #endif DbusmenuGtkMenuPrivate * priv = DBUSMENU_GTKMENU_GET_PRIVATE(menu); GtkWidget * item = GTK_WIDGET(dbusmenu_gtkclient_menuitem_get(priv->client, child)); if (item != NULL) { @@ -268,7 +274,9 @@ root_child_delete (DbusmenuMenuitem * root, DbusmenuMenuitem * child, DbusmenuGt static void child_realized (DbusmenuMenuitem * child, gpointer userdata) { + #ifdef MASSIVEDEBUGGING g_debug("Root child realized"); + #endif g_return_if_fail(DBUSMENU_IS_GTKMENU(userdata)); DbusmenuGtkMenu * menu = DBUSMENU_GTKMENU(userdata); |