diff options
author | Ted Gould <ted@gould.cx> | 2011-01-27 09:42:23 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-01-27 09:42:23 -0600 |
commit | bbeca3ac7b912ab40bba3415beb3b9d34249bf9d (patch) | |
tree | 2c8024e8abddb24966a5c9e4f6ee69b53dda1942 | |
parent | 275bd0eec2e28b708ff6cda14531f63a8aa16e8e (diff) | |
parent | 717e9a319cd430428c297d0777b45c64e4d7f5fd (diff) | |
download | libdbusmenu-bbeca3ac7b912ab40bba3415beb3b9d34249bf9d.tar.gz libdbusmenu-bbeca3ac7b912ab40bba3415beb3b9d34249bf9d.tar.bz2 libdbusmenu-bbeca3ac7b912ab40bba3415beb3b9d34249bf9d.zip |
Updating to serializeable menuitem branch. Some function prototype changes.
-rw-r--r-- | libdbusmenu-glib/client.h | 21 | ||||
-rw-r--r-- | libdbusmenu-gtk/serializablemenuitem.c | 10 | ||||
-rw-r--r-- | libdbusmenu-gtk/serializablemenuitem.h | 11 |
3 files changed, 35 insertions, 7 deletions
diff --git a/libdbusmenu-glib/client.h b/libdbusmenu-glib/client.h index f371792..6d78edf 100644 --- a/libdbusmenu-glib/client.h +++ b/libdbusmenu-glib/client.h @@ -110,7 +110,28 @@ struct _DbusmenuClient { DbusmenuClientPrivate * priv; }; +/** + DbusmenuClientTypeHandler: + @newitem: The #DbusmenuMenuitem that was created + @parent: The parent of @newitem or #NULL if none + @client: A pointer to the #DbusmenuClient + @user_data: The data you gave us + + The type handler is called when a dbusmenu item is created + with a matching type as setup in #dbusmenu_client_add_type_handler +*/ typedef gboolean (*DbusmenuClientTypeHandler) (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client, gpointer user_data); + +/** + DbusmenuClientTypeDestroyHandler: + @client: A pointer to the #DbusmenuClient + @type: The type that this handler was registered with + @user_data: The data you gave us + + This handler is called when the type becomes unregistered by the + client. This is usally caused by the #DbusmenuClient being destroyed + and should free memory or unref objects in @user_data. +*/ typedef void (*DbusmenuClientTypeDestroyHandler) (DbusmenuClient * client, const gchar * type, gpointer user_data); GType dbusmenu_client_get_type (void); diff --git a/libdbusmenu-gtk/serializablemenuitem.c b/libdbusmenu-gtk/serializablemenuitem.c index f67434e..cfd864d 100644 --- a/libdbusmenu-gtk/serializablemenuitem.c +++ b/libdbusmenu-gtk/serializablemenuitem.c @@ -166,7 +166,7 @@ get_property (GObject * obj, guint id, GValue * value, GParamSpec * pspec) } /** - dbusmenu_gtk_serializable_menu_item_build_dbusmenu_menuitem: + dbusmenu_gtk_serializable_menu_item_build_menuitem: @smi: #DbusmenuGtkSerializableMenuItem to build a #DbusmenuMenuitem mirroring This function is for menu items that are instanciated from @@ -179,7 +179,7 @@ get_property (GObject * obj, guint id, GValue * value, GParamSpec * pspec) set by this object. */ DbusmenuMenuitem * -dbusmenu_gtk_serializable_menu_item_build_dbusmenu_menuitem (DbusmenuGtkSerializableMenuItem * smi) +dbusmenu_gtk_serializable_menu_item_build_menuitem (DbusmenuGtkSerializableMenuItem * smi) { g_return_val_if_fail(DBUSMENU_IS_GTK_SERIALIZABLE_MENU_ITEM(smi), NULL); @@ -207,7 +207,7 @@ type_handler (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuCli DbusmenuGtkSerializableMenuItem * smi = DBUSMENU_GTK_SERIALIZABLE_MENU_ITEM(g_object_new(th->type, NULL)); g_return_val_if_fail(smi != NULL, FALSE); - dbusmenu_gtk_serializable_menu_item_set_dbusmenu_menuitem(smi, newitem); + dbusmenu_gtk_serializable_menu_item_set_menuitem(smi, newitem); dbusmenu_gtkclient_newitem_base(DBUSMENU_GTKCLIENT(client), newitem, GTK_MENU_ITEM(smi), parent); return TRUE; @@ -265,7 +265,7 @@ dbusmenu_gtk_serializable_menu_item_register_to_client (DbusmenuClient * client, } /** - dbusmenu_gtk_serializable_menu_item_set_dbusmenu_menuitem: + dbusmenu_gtk_serializable_menu_item_set_menuitem: @smi: #DbusmenuGtkSerializableMenuItem to set the @DbusmenuGtkSerializableMenuItem::dbusmenu-menuitem of @mi: Menuitem to get the properties from @@ -276,7 +276,7 @@ dbusmenu_gtk_serializable_menu_item_register_to_client (DbusmenuClient * client, pick up this property being set. */ void -dbusmenu_gtk_serializable_menu_item_set_dbusmenu_menuitem (DbusmenuGtkSerializableMenuItem * smi, DbusmenuMenuitem * mi) +dbusmenu_gtk_serializable_menu_item_set_menuitem (DbusmenuGtkSerializableMenuItem * smi, DbusmenuMenuitem * mi) { g_return_if_fail(DBUSMENU_IS_GTK_SERIALIZABLE_MENU_ITEM(smi)); g_return_if_fail(mi != NULL); diff --git a/libdbusmenu-gtk/serializablemenuitem.h b/libdbusmenu-gtk/serializablemenuitem.h index 1ca3ef8..db28a24 100644 --- a/libdbusmenu-gtk/serializablemenuitem.h +++ b/libdbusmenu-gtk/serializablemenuitem.h @@ -90,6 +90,13 @@ struct _DbusmenuGtkSerializableMenuItemClass { DbusmenuGtkSerializableMenuItem: @parent: Inherit from GtkMenuItem @priv: Blind structure of private variables + + The Serializable Menuitem provides a way for menu items to be created + that can easily be picked up by the Dbusmenu GTK Parser. This way + you can create custom items, and transport them across dbusmenu to + your menus or the appmenu on the other side of the bus. By providing + these function the parser has enough information to both serialize, and + deserialize on the other side, the menuitem you've so carefully created. */ struct _DbusmenuGtkSerializableMenuItem { GtkMenuItem parent; @@ -99,9 +106,9 @@ struct _DbusmenuGtkSerializableMenuItem { GType dbusmenu_gtk_serializable_menu_item_get_type (void); -DbusmenuMenuitem * dbusmenu_gtk_serializable_menu_item_build_dbusmenu_menuitem (DbusmenuGtkSerializableMenuItem * smi); +DbusmenuMenuitem * dbusmenu_gtk_serializable_menu_item_build_menuitem (DbusmenuGtkSerializableMenuItem * smi); void dbusmenu_gtk_serializable_menu_item_register_to_client (DbusmenuClient * client, GType item_type); -void dbusmenu_gtk_serializable_menu_item_set_dbusmenu_menuitem (DbusmenuGtkSerializableMenuItem * smi, DbusmenuMenuitem * mi); +void dbusmenu_gtk_serializable_menu_item_set_menuitem (DbusmenuGtkSerializableMenuItem * smi, DbusmenuMenuitem * mi); G_END_DECLS |