aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-11-06 20:41:18 -0600
committerTed Gould <ted@canonical.com>2009-11-06 20:41:18 -0600
commit591311a82b0ce6e0bc74439186bb22d5224d85c5 (patch)
treefc60b788c37a03f98a01e71af8151349cac447cf /src
parentced0ec2c7e9e9138fb42422e662bf03deb957343 (diff)
downloadayatana-indicator-application-591311a82b0ce6e0bc74439186bb22d5224d85c5.tar.gz
ayatana-indicator-application-591311a82b0ce6e0bc74439186bb22d5224d85c5.tar.bz2
ayatana-indicator-application-591311a82b0ce6e0bc74439186bb22d5224d85c5.zip
Woot! Now we have signals in our watcher. Let's rock on!
Diffstat (limited to 'src')
-rw-r--r--src/custom-service-watcher.c42
-rw-r--r--src/custom-service-watcher.h6
-rw-r--r--src/notification-watcher.xml2
3 files changed, 49 insertions, 1 deletions
diff --git a/src/custom-service-watcher.c b/src/custom-service-watcher.c
index 2b83c13..4f6c6d3 100644
--- a/src/custom-service-watcher.c
+++ b/src/custom-service-watcher.c
@@ -14,6 +14,7 @@ static gboolean _notification_watcher_server_is_notification_host_registered (Cu
#include "notification-watcher-server.h"
+/* Private Stuff */
typedef struct _CustomServiceWatcherPrivate CustomServiceWatcherPrivate;
struct _CustomServiceWatcherPrivate {
CustomServiceAppstore * appstore;
@@ -22,6 +23,18 @@ struct _CustomServiceWatcherPrivate {
#define CUSTOM_SERVICE_WATCHER_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), CUSTOM_SERVICE_WATCHER_TYPE, CustomServiceWatcherPrivate))
+/* Signals Stuff */
+enum {
+ SERVICE_REGISTERED,
+ SERVICE_UNREGISTERED,
+ NOTIFICATION_HOST_REGISTERED,
+ NOTIFICATION_HOST_UNREGISTERED,
+ LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
+
+/* GObject stuff */
static void custom_service_watcher_class_init (CustomServiceWatcherClass *klass);
static void custom_service_watcher_init (CustomServiceWatcher *self);
static void custom_service_watcher_dispose (GObject *object);
@@ -39,6 +52,35 @@ custom_service_watcher_class_init (CustomServiceWatcherClass *klass)
object_class->dispose = custom_service_watcher_dispose;
object_class->finalize = custom_service_watcher_finalize;
+ signals[SERVICE_REGISTERED] = g_signal_new ("service-registered",
+ G_TYPE_FROM_CLASS(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (CustomServiceWatcherClass, service_registered),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__STRING,
+ G_TYPE_NONE, 1, G_TYPE_STRING, G_TYPE_NONE);
+ signals[SERVICE_UNREGISTERED] = g_signal_new ("service-unregistered",
+ G_TYPE_FROM_CLASS(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (CustomServiceWatcherClass, service_unregistered),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__STRING,
+ G_TYPE_NONE, 1, G_TYPE_STRING, G_TYPE_NONE);
+ signals[NOTIFICATION_HOST_REGISTERED] = g_signal_new ("notification-host-registered",
+ G_TYPE_FROM_CLASS(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (CustomServiceWatcherClass, notification_host_registered),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0, G_TYPE_NONE);
+ signals[NOTIFICATION_HOST_UNREGISTERED] = g_signal_new ("notification-host-unregistered",
+ G_TYPE_FROM_CLASS(klass),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (CustomServiceWatcherClass, notification_host_unregistered),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0, G_TYPE_NONE);
+
dbus_g_object_type_install_info(CUSTOM_SERVICE_WATCHER_TYPE,
&dbus_glib__notification_watcher_server_object_info);
diff --git a/src/custom-service-watcher.h b/src/custom-service-watcher.h
index c705fb5..1a037be 100644
--- a/src/custom-service-watcher.h
+++ b/src/custom-service-watcher.h
@@ -20,6 +20,12 @@ typedef struct _CustomServiceWatcherClass CustomServiceWatcherClass;
struct _CustomServiceWatcherClass {
GObjectClass parent_class;
+
+ /* Signals */
+ void (*service_registered) (CustomServiceWatcher * watcher, gchar * object, gpointer data);
+ void (*service_unregistered) (CustomServiceWatcher * watcher, gchar * object, gpointer data);
+ void (*notification_host_registered) (CustomServiceWatcher * watcher, gpointer data);
+ void (*notification_host_unregistered) (CustomServiceWatcher * watcher, gpointer data);
};
struct _CustomServiceWatcher {
diff --git a/src/notification-watcher.xml b/src/notification-watcher.xml
index 93acf74..06e3e68 100644
--- a/src/notification-watcher.xml
+++ b/src/notification-watcher.xml
@@ -31,7 +31,7 @@
</signal>
<signal name="NotificationHostRegistered">
</signal>
- <signal name="NotificationHostUnegistered">
+ <signal name="NotificationHostUnregistered">
</signal>
</interface>