From bea741f5b7ba5aaa28c353fd32c44032686719d5 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Sun, 11 Jan 2009 23:51:55 -0600 Subject: Adding in signals so that we can talk to the app over DBus. Nice. --- libindicate/server.c | 22 ++++++++++++++++++++++ libindicate/server.h | 6 ++++++ 2 files changed, 28 insertions(+) (limited to 'libindicate') diff --git a/libindicate/server.c b/libindicate/server.c index 755f814..263df46 100644 --- a/libindicate/server.c +++ b/libindicate/server.c @@ -40,6 +40,28 @@ indicate_server_class_init (IndicateServerClass * class) gobj->finalize = indicate_server_finalize; + signals[INDICATOR_ADDED] = g_signal_new("indicator-added", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (IndicateServerClass, indicator_added), + NULL, NULL, + g_cclosure_marshal_VOID__UINT_POINTER, + G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_STRING); + signals[INDICATOR_REMOVED] = g_signal_new("indicator-removed", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (IndicateServerClass, indicator_removed), + NULL, NULL, + g_cclosure_marshal_VOID__UINT_POINTER, + G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_STRING); + signals[INDICATOR_MODIFIED] = g_signal_new("indicator-modified", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (IndicateServerClass, indicator_modified), + NULL, NULL, + g_cclosure_marshal_VOID__UINT_POINTER, + G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_STRING); + dbus_g_object_type_install_info(INDICATE_TYPE_SERVER, &dbus_glib_indicate_server_object_info); diff --git a/libindicate/server.h b/libindicate/server.h index cf52c0e..78c4d4b 100644 --- a/libindicate/server.h +++ b/libindicate/server.h @@ -28,6 +28,12 @@ typedef struct _IndicateServerClass IndicateServerClass; struct _IndicateServerClass { GObjectClass parent; + /* Signals */ + void (* indicator_added) (IndicateServer * server, guint id, gchar * type); + void (* indicator_removed) (IndicateServer * server, guint id, gchar * type); + void (* indicator_modified) (IndicateServer * server, guint id, gchar * property); + + /* Virtual Functions */ gboolean (*get_desktop) (IndicateServer * server, gchar ** desktop_path, GError **error); gboolean (*get_indicator_count) (IndicateServer * server, guint * count, GError **error); gboolean (*get_indicator_count_by_type) (IndicateServer * server, gchar * type, guint * count, GError **error); -- cgit v1.2.3