diff options
author | Ted Gould <ted@gould.cx> | 2011-02-07 16:43:15 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2011-02-07 16:43:15 -0600 |
commit | 3fab4873c00572044ddc8447d5aa0f3d2d9f8cd1 (patch) | |
tree | c8b2bb68005950073192a67da33ba998554fa58c /libdbusmenu-glib/client.h | |
parent | fd954bb9d7e00405e23acd03a7dda5d97fb66e02 (diff) | |
parent | 9c5089892566097a42c8dd75b9eb79a81b57b1e9 (diff) | |
download | libdbusmenu-3fab4873c00572044ddc8447d5aa0f3d2d9f8cd1.tar.gz libdbusmenu-3fab4873c00572044ddc8447d5aa0f3d2d9f8cd1.tar.bz2 libdbusmenu-3fab4873c00572044ddc8447d5aa0f3d2d9f8cd1.zip |
Updating to trunk
Diffstat (limited to 'libdbusmenu-glib/client.h')
-rw-r--r-- | libdbusmenu-glib/client.h | 50 |
1 files changed, 44 insertions, 6 deletions
diff --git a/libdbusmenu-glib/client.h b/libdbusmenu-glib/client.h index 5d4b5c3..6d78edf 100644 --- a/libdbusmenu-glib/client.h +++ b/libdbusmenu-glib/client.h @@ -56,6 +56,8 @@ G_BEGIN_DECLS #define DBUSMENU_CLIENT_TYPES_SEPARATOR "separator" #define DBUSMENU_CLIENT_TYPES_IMAGE "standard" +typedef struct _DbusmenuClientPrivate DbusmenuClientPrivate; + /** DbusmenuClientClass: @parent_class: #GObjectClass @@ -65,6 +67,10 @@ G_BEGIN_DECLS @event_result: Slot for #DbusmenuClient::event-error. @reserved1: Reserved for future use. @reserved2: Reserved for future use. + @reserved3: Reserved for future use. + @reserved4: Reserved for future use. + @reserved5: Reserved for future use. + @reserved6: Reserved for future use. A simple class that takes all of the information from a #DbusmenuServer over DBus and makes the same set of @@ -78,13 +84,15 @@ struct _DbusmenuClientClass { void (*root_changed) (DbusmenuMenuitem * newroot); void (*new_menuitem) (DbusmenuMenuitem * newitem); void (*item_activate) (DbusmenuMenuitem * item, guint timestamp); - void (*event_result) (DbusmenuMenuitem * item, gchar * event, GValue * data, guint timestamp, GError * error); + void (*event_result) (DbusmenuMenuitem * item, gchar * event, GVariant * data, guint timestamp, GError * error); - /* Reserved for future use */ + /*< Private >*/ void (*reserved1) (void); void (*reserved2) (void); - /* void (*reserved3) (void); */ - /* void (*reserved4) (void); */ + void (*reserved3) (void); + void (*reserved4) (void); + void (*reserved5) (void); + void (*reserved6) (void); }; /** @@ -97,9 +105,34 @@ struct _DbusmenuClientClass { typedef struct _DbusmenuClient DbusmenuClient; struct _DbusmenuClient { GObject parent; + + /*< Private >*/ + DbusmenuClientPrivate * priv; }; -typedef gboolean (*DbusmenuClientTypeHandler) (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client); +/** + 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); DbusmenuClient * dbusmenu_client_new (const gchar * name, @@ -108,10 +141,15 @@ DbusmenuMenuitem * dbusmenu_client_get_root (DbusmenuClient * client) gboolean dbusmenu_client_add_type_handler (DbusmenuClient * client, const gchar * type, DbusmenuClientTypeHandler newfunc); +gboolean dbusmenu_client_add_type_handler_full (DbusmenuClient * client, + const gchar * type, + DbusmenuClientTypeHandler newfunc, + gpointer user_data, + DbusmenuClientTypeDestroyHandler destory_func); void dbusmenu_client_send_event (DbusmenuClient * client, gint id, const gchar * name, - const GValue * value, + GVariant * variant, guint timestamp); void dbusmenu_client_send_about_to_show(DbusmenuClient * client, gint id, |