aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-glib
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-01-28 14:14:13 -0600
committerTed Gould <ted@gould.cx>2011-01-28 14:14:13 -0600
commit36826dcea61c5bcf6be1fa50a80c205d58283e62 (patch)
treeb3451d8ac03e67e775b22f2c8e31100b2c9c09fe /libdbusmenu-glib
parent35265154f7d70dc31837ff8fe4e45a810c393c2b (diff)
downloadlibdbusmenu-36826dcea61c5bcf6be1fa50a80c205d58283e62.tar.gz
libdbusmenu-36826dcea61c5bcf6be1fa50a80c205d58283e62.tar.bz2
libdbusmenu-36826dcea61c5bcf6be1fa50a80c205d58283e62.zip
Adding a signal for events
Diffstat (limited to 'libdbusmenu-glib')
-rw-r--r--libdbusmenu-glib/menuitem-marshal.list1
-rw-r--r--libdbusmenu-glib/menuitem.c18
-rw-r--r--libdbusmenu-glib/menuitem.h5
3 files changed, 23 insertions, 1 deletions
diff --git a/libdbusmenu-glib/menuitem-marshal.list b/libdbusmenu-glib/menuitem-marshal.list
index e3cb272..b2e02e5 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
+VOID: STRING, VARIANT, UINT
diff --git a/libdbusmenu-glib/menuitem.c b/libdbusmenu-glib/menuitem.c
index b40195c..83d98fa 100644
--- a/libdbusmenu-glib/menuitem.c
+++ b/libdbusmenu-glib/menuitem.c
@@ -71,6 +71,7 @@ enum {
REALIZED,
SHOW_TO_USER,
ABOUT_TO_SHOW,
+ EVENT,
LAST_SIGNAL
};
@@ -244,6 +245,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),
+ NULL, NULL,
+ _dbusmenu_menuitem_marshal_VOID__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",
diff --git a/libdbusmenu-glib/menuitem.h b/libdbusmenu-glib/menuitem.h
index a4c7611..dee7ee1 100644
--- a/libdbusmenu-glib/menuitem.h
+++ b/libdbusmenu-glib/menuitem.h
@@ -51,6 +51,7 @@ G_BEGIN_DECLS
#define DBUSMENU_MENUITEM_SIGNAL_REALIZED_ID (g_signal_lookup(DBUSMENU_MENUITEM_SIGNAL_REALIZED, DBUSMENU_TYPE_MENUITEM))
#define DBUSMENU_MENUITEM_SIGNAL_SHOW_TO_USER "show-to-user"
#define DBUSMENU_MENUITEM_SIGNAL_ABOUT_TO_SHOW "about-to-show"
+#define DBUSMENU_MENUITEM_SIGNAL_EVENT "event"
#define DBUSMENU_MENUITEM_PROP_TYPE "type"
#define DBUSMENU_MENUITEM_PROP_VISIBLE "visible"
@@ -133,6 +134,7 @@ typedef void (*dbusmenu_menuitem_buildxml_slot_t) (DbusmenuMenuitem * mi, GPtrAr
* @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.
@@ -162,13 +164,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);