diff options
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r-- | libdbusmenu-glib/client.h | 15 | ||||
-rw-r--r-- | libdbusmenu-glib/defaults.c | 8 | ||||
-rw-r--r-- | libdbusmenu-glib/defaults.h | 4 | ||||
-rw-r--r-- | libdbusmenu-glib/enum-types.h.in | 6 | ||||
-rw-r--r-- | libdbusmenu-glib/menuitem-marshal.list | 1 | ||||
-rw-r--r-- | libdbusmenu-glib/menuitem.c | 24 | ||||
-rw-r--r-- | libdbusmenu-glib/menuitem.h | 6 | ||||
-rw-r--r-- | libdbusmenu-glib/server.c | 2 | ||||
-rw-r--r-- | libdbusmenu-glib/server.h | 10 | ||||
-rw-r--r-- | libdbusmenu-glib/types.h | 11 |
10 files changed, 78 insertions, 9 deletions
diff --git a/libdbusmenu-glib/client.h b/libdbusmenu-glib/client.h index 0b94eb2..28d4dd3 100644 --- a/libdbusmenu-glib/client.h +++ b/libdbusmenu-glib/client.h @@ -74,6 +74,11 @@ G_BEGIN_DECLS * String to attach to signal #DbusmenuClient::event-result */ #define DBUSMENU_CLIENT_SIGNAL_EVENT_RESULT "event-result" +/** + * DBUSMENU_CLIENT_SIGNAL_TEXT_DIRECTION_CHANGED: + * + * String to attach to signal #DbusmenuClient::text-direction-changed + */ #define DBUSMENU_CLIENT_SIGNAL_TEXT_DIRECTION_CHANGED "text-direction-changed" /** @@ -88,7 +93,17 @@ G_BEGIN_DECLS * String to access property #DbusmenuClient:dbus-object */ #define DBUSMENU_CLIENT_PROP_DBUS_OBJECT "dbus-object" +/** + * DBUSMENU_CLIENT_PROP_STATUS: + * + * String to access property #DbusmenuClient:status + */ #define DBUSMENU_CLIENT_PROP_STATUS "status" +/** + * DBUSMENU_CLIENT_PROP_TEXT_DIRECTION: + * + * String to access property #DbusmenuClient:text-direction + */ #define DBUSMENU_CLIENT_PROP_TEXT_DIRECTION "text-direction" /** diff --git a/libdbusmenu-glib/defaults.c b/libdbusmenu-glib/defaults.c index 3ad5d76..c05ef38 100644 --- a/libdbusmenu-glib/defaults.c +++ b/libdbusmenu-glib/defaults.c @@ -156,7 +156,7 @@ entry_destroy (gpointer entry) static DbusmenuDefaults * default_defaults = NULL; -/** +/* * dbusmenu_defaults_ref_default: * * Get a reference to the default instance. If it doesn't exist this @@ -177,7 +177,7 @@ dbusmenu_defaults_ref_default (void) return default_defaults; } -/** +/* * dbusmenu_defaults_default_set: * @defaults: The #DbusmenuDefaults object to add to * @type: (allow-none): The #DbusmenuMenuitem type for this default if #NULL will default to #DBUSMENU_CLIENT_TYPE_DEFAULT @@ -216,7 +216,7 @@ dbusmenu_defaults_default_set (DbusmenuDefaults * defaults, const gchar * type, return; } -/** +/* * dbusmenu_defaults_default_get: * @defaults: The default database to use * @type: (allow-none): The #DbusmenuMenuitem type for this default if #NULL will default to #DBUSMENU_CLIENT_TYPE_DEFAULT @@ -253,7 +253,7 @@ dbusmenu_defaults_default_get (DbusmenuDefaults * defaults, const gchar * type, return entry->value; } -/** +/* * dbusmenu_defaults_default_get_type: * @defaults: The default database to use * @type: (allow-none): The #DbusmenuMenuitem type for this default if #NULL will default to #DBUSMENU_CLIENT_TYPE_DEFAULT diff --git a/libdbusmenu-glib/defaults.h b/libdbusmenu-glib/defaults.h index ab377f7..a1a8158 100644 --- a/libdbusmenu-glib/defaults.h +++ b/libdbusmenu-glib/defaults.h @@ -45,7 +45,7 @@ typedef struct _DbusmenuDefaults DbusmenuDefaults; typedef struct _DbusmenuDefaultsClass DbusmenuDefaultsClass; typedef struct _DbusmenuDefaultsPrivate DbusmenuDefaultsPrivate; -/** +/* * DbusmenuDefaultsClass: * * All of the signals and functions for #DbusmenuDefaults @@ -54,7 +54,7 @@ struct _DbusmenuDefaultsClass { GObjectClass parent_class; }; -/** +/* * DbusmenuDefaults: * * A singleton to hold all of the defaults for the menuitems diff --git a/libdbusmenu-glib/enum-types.h.in b/libdbusmenu-glib/enum-types.h.in index 8c5f463..488b615 100644 --- a/libdbusmenu-glib/enum-types.h.in +++ b/libdbusmenu-glib/enum-types.h.in @@ -51,6 +51,12 @@ G_END_DECLS GType @enum_name@_get_type (void) G_GNUC_CONST; const gchar * @enum_name@_get_nick (@EnumName@ value) G_GNUC_CONST; @EnumName@ @enum_name@_get_value_from_nick (const gchar * nick) G_GNUC_CONST; +/** + DBUSMENU_TYPE_@ENUMSHORT@: + + Gets the #GType value for the type associated with the + #@EnumName@ enumerated type. +*/ #define DBUSMENU_TYPE_@ENUMSHORT@ (@enum_name@_get_type()) /*** END value-header ***/ diff --git a/libdbusmenu-glib/menuitem-marshal.list b/libdbusmenu-glib/menuitem-marshal.list index e3cb272..4382ed7 100644 --- a/libdbusmenu-glib/menuitem-marshal.list +++ b/libdbusmenu-glib/menuitem-marshal.list @@ -4,3 +4,4 @@ VOID: OBJECT, UINT VOID: OBJECT VOID: VOID VOID: UINT +BOOLEAN: STRING, VARIANT, UINT diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c index de8a1ad..3dd98df 100644 --- a/libdbusmenu-glib/menuitem.c +++ b/libdbusmenu-glib/menuitem.c @@ -75,6 +75,7 @@ enum { REALIZED, SHOW_TO_USER, ABOUT_TO_SHOW, + EVENT, LAST_SIGNAL }; @@ -248,6 +249,23 @@ dbusmenu_menuitem_class_init (DbusmenuMenuitemClass *klass) NULL, NULL, _dbusmenu_menuitem_marshal_VOID__VOID, G_TYPE_BOOLEAN, 0, G_TYPE_NONE); + /** + DbusmenuMenuitem::event: + @arg0: The #DbusmenuMenuitem object. + @arg1: Name of the event + @arg2: Information passed along with the event + @arg3: X11 timestamp of when the event happened + + Emitted when an event is passed through. The event is signalled + after handle_event is called. + */ + signals[EVENT] = g_signal_new(DBUSMENU_MENUITEM_SIGNAL_EVENT, + G_TYPE_FROM_CLASS(klass), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET(DbusmenuMenuitemClass, event), + g_signal_accumulator_true_handled, NULL, + _dbusmenu_menuitem_marshal_BOOLEAN__STRING_VARIANT_UINT, + G_TYPE_BOOLEAN, 3, G_TYPE_STRING, G_TYPE_VARIANT, G_TYPE_UINT); g_object_class_install_property (object_class, PROP_ID, g_param_spec_int(PROP_ID_S, "ID for the menu item", @@ -1652,9 +1670,13 @@ dbusmenu_menuitem_handle_event (DbusmenuMenuitem * mi, const gchar * name, GVari #endif DbusmenuMenuitemClass * class = DBUSMENU_MENUITEM_GET_CLASS(mi); - if (class->handle_event != NULL) { + gboolean handled = FALSE; + g_signal_emit(G_OBJECT(mi), EVENT, g_quark_from_string(name), name, variant, timestamp, &handled); + + if (!handled && class->handle_event != NULL) { return class->handle_event(mi, name, variant, timestamp); } + return; } diff --git a/libdbusmenu-glib/menuitem.h b/libdbusmenu-glib/menuitem.h index 5f56803..6d41e25 100644 --- a/libdbusmenu-glib/menuitem.h +++ b/libdbusmenu-glib/menuitem.h @@ -96,6 +96,7 @@ G_BEGIN_DECLS * String to attach to signal #DbusmenuServer::about-to-show */ #define DBUSMENU_MENUITEM_SIGNAL_ABOUT_TO_SHOW "about-to-show" +#define DBUSMENU_MENUITEM_SIGNAL_EVENT "event" /** * DBUSMENU_MENUITEM_PROP_TYPE: @@ -320,12 +321,12 @@ typedef GVariant * (*dbusmenu_menuitem_buildvariant_slot_t) (DbusmenuMenuitem * * @handle_event: This function is to override how events are handled by subclasses. Look at #dbusmenu_menuitem_handle_event for lots of good information. * @send_about_to_show: Virtual function that notifies server that the client is about to show a menu. * @show_to_user: Slot for #DbusmenuMenuitem::show-to-user. + * @event: Slot for #DbsumenuMenuitem::event. * @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. * * Functions and signals that every menuitem should know something * about. @@ -351,13 +352,14 @@ struct _DbusmenuMenuitemClass void (*show_to_user) (DbusmenuMenuitem * mi, guint timestamp, gpointer cb_data); gboolean (*about_to_show) (void); + void (*event) (const gchar * name, GVariant * value, guint timestamp); + /*< Private >*/ void (*reserved1) (void); void (*reserved2) (void); void (*reserved3) (void); void (*reserved4) (void); void (*reserved5) (void); - void (*reserved6) (void); }; GType dbusmenu_menuitem_get_type (void); diff --git a/libdbusmenu-glib/server.c b/libdbusmenu-glib/server.c index c3faa6b..e3fd2cd 100644 --- a/libdbusmenu-glib/server.c +++ b/libdbusmenu-glib/server.c @@ -1635,6 +1635,7 @@ dbusmenu_server_get_text_direction (DbusmenuServer * server) /** dbusmenu_server_set_text_direction: @server: The #DbusmenuServer object to set the text direction on + @dir: Direction of the text Sets the text direction that should be exported over DBus for this server. If the value is set to #DBUSMENU_TEXT_DIRECTION_NONE @@ -1682,6 +1683,7 @@ dbusmenu_server_get_status (DbusmenuServer * server) /** dbusmenu_server_set_status: @server: The #DbusmenuServer to set the status on + @status: Status value to set on the server Changes the status of the server. */ diff --git a/libdbusmenu-glib/server.h b/libdbusmenu-glib/server.h index 3e07395..80b7abb 100644 --- a/libdbusmenu-glib/server.h +++ b/libdbusmenu-glib/server.h @@ -93,7 +93,17 @@ G_BEGIN_DECLS * String to access property #DbusmenuServer:version */ #define DBUSMENU_SERVER_PROP_VERSION "version" +/** + * DBUSMENU_SERVER_PROP_TEXT_DIRECTION: + * + * String to access property #DbusmenuServer:text-direction + */ #define DBUSMENU_SERVER_PROP_TEXT_DIRECTION "text-direction" +/** + * DBUSMENU_SERVER_PROP_STATUS: + * + * String to access property #DbusmenuServer:status + */ #define DBUSMENU_SERVER_PROP_STATUS "status" typedef struct _DbusmenuServerPrivate DbusmenuServerPrivate; diff --git a/libdbusmenu-glib/types.h b/libdbusmenu-glib/types.h index e573476..03ae801 100644 --- a/libdbusmenu-glib/types.h +++ b/libdbusmenu-glib/types.h @@ -59,6 +59,17 @@ typedef enum { /*< prefix=DBUSMENU_STATUS >*/ DBUSMENU_STATUS_NOTICE /*< nick=notice >*/ } DbusmenuStatus; +/** + SECTION:types + @short_description: Types that are used by both client and + server. + @stability: Unstable + @include: libdbusmenu-glib/types.h + + Enums that are used to describe states of the server across the + bus. They are sent over dbus using their nicks but then turned + back into enums by the client. +*/ G_END_DECLS #endif /* __DBUSMENU_TYPES_H__ */ |