From bca77a7a1e38c1d97211394799cf103bc02b0547 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 6 Nov 2009 21:40:28 -0600 Subject: Getting the registration signal, and passing it up the stack. --- src/custom-service-appstore.c | 4 ++-- src/custom-service-appstore.h | 8 ++++---- src/custom-service-watcher.c | 24 +++++++++++++----------- src/notification-watcher.xml | 1 + 4 files changed, 20 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/custom-service-appstore.c b/src/custom-service-appstore.c index ceb2c17..b25ffa7 100644 --- a/src/custom-service-appstore.c +++ b/src/custom-service-appstore.c @@ -106,7 +106,7 @@ custom_service_appstore_finalize (GObject *object) } void -custom_service_appstore_application_add (CustomServiceAppstore * appstore, gchar * dbus_name, gchar * dbus_object) +custom_service_appstore_application_add (CustomServiceAppstore * appstore, const gchar * dbus_name, const gchar * dbus_object) { g_return_if_fail(IS_CUSTOM_SERVICE_APPSTORE(appstore)); g_return_if_fail(dbus_name != NULL && dbus_name[0] != '\0'); @@ -117,7 +117,7 @@ custom_service_appstore_application_add (CustomServiceAppstore * appstore, gchar } void -custom_service_appstore_application_remove (CustomServiceAppstore * appstore, gchar * dbus_name, gchar * dbus_object) +custom_service_appstore_application_remove (CustomServiceAppstore * appstore, const gchar * dbus_name, const gchar * dbus_object) { g_return_if_fail(IS_CUSTOM_SERVICE_APPSTORE(appstore)); g_return_if_fail(dbus_name != NULL && dbus_name[0] != '\0'); diff --git a/src/custom-service-appstore.h b/src/custom-service-appstore.h index e1cb52a..7263617 100644 --- a/src/custom-service-appstore.h +++ b/src/custom-service-appstore.h @@ -29,11 +29,11 @@ struct _CustomServiceAppstore { GType custom_service_appstore_get_type (void); void custom_service_appstore_application_add (CustomServiceAppstore * appstore, - gchar * dbus_name, - gchar * dbus_object); + const gchar * dbus_name, + const gchar * dbus_object); void custom_service_appstore_application_remove (CustomServiceAppstore * appstore, - gchar * dbus_name, - gchar * dbus_object); + const gchar * dbus_name, + const gchar * dbus_object); G_END_DECLS diff --git a/src/custom-service-watcher.c b/src/custom-service-watcher.c index 4f6c6d3..a0a1b27 100644 --- a/src/custom-service-watcher.c +++ b/src/custom-service-watcher.c @@ -3,14 +3,15 @@ #endif #include +#include #include "custom-service-watcher.h" #include "dbus-shared.h" -static gboolean _notification_watcher_server_register_service (CustomServiceWatcher * appstore, const gchar * service, DBusGMethodInvocation * method); -static gboolean _notification_watcher_server_registered_services (CustomServiceWatcher * appstore, GArray ** apps); -static gboolean _notification_watcher_server_protocol_version (CustomServiceWatcher * appstore, char ** version); -static gboolean _notification_watcher_server_register_notification_host (CustomServiceWatcher * appstore, const gchar * host); -static gboolean _notification_watcher_server_is_notification_host_registered (CustomServiceWatcher * appstore, gboolean * haveHost); +static gboolean _notification_watcher_server_register_service (CustomServiceWatcher * appwatcher, const gchar * service, DBusGMethodInvocation * method); +static gboolean _notification_watcher_server_registered_services (CustomServiceWatcher * appwatcher, GArray ** apps); +static gboolean _notification_watcher_server_protocol_version (CustomServiceWatcher * appwatcher, char ** version); +static gboolean _notification_watcher_server_register_notification_host (CustomServiceWatcher * appwatcher, const gchar * host); +static gboolean _notification_watcher_server_is_notification_host_registered (CustomServiceWatcher * appwatcher, gboolean * haveHost); #include "notification-watcher-server.h" @@ -142,38 +143,39 @@ custom_service_watcher_new (CustomServiceAppstore * appstore) } static gboolean -_notification_watcher_server_register_service (CustomServiceWatcher * appstore, const gchar * service, DBusGMethodInvocation * method) +_notification_watcher_server_register_service (CustomServiceWatcher * appwatcher, const gchar * service, DBusGMethodInvocation * method) { + CustomServiceWatcherPrivate * priv = CUSTOM_SERVICE_WATCHER_GET_PRIVATE(appwatcher); - + custom_service_appstore_application_add(priv->appstore, dbus_g_method_get_sender(method), service); dbus_g_method_return(method, G_TYPE_NONE); return TRUE; } static gboolean -_notification_watcher_server_registered_services (CustomServiceWatcher * appstore, GArray ** apps) +_notification_watcher_server_registered_services (CustomServiceWatcher * appwatcher, GArray ** apps) { return FALSE; } static gboolean -_notification_watcher_server_protocol_version (CustomServiceWatcher * appstore, char ** version) +_notification_watcher_server_protocol_version (CustomServiceWatcher * appwatcher, char ** version) { *version = g_strdup("Ayatana Version 1"); return TRUE; } static gboolean -_notification_watcher_server_register_notification_host (CustomServiceWatcher * appstore, const gchar * host) +_notification_watcher_server_register_notification_host (CustomServiceWatcher * appwatcher, const gchar * host) { return FALSE; } static gboolean -_notification_watcher_server_is_notification_host_registered (CustomServiceWatcher * appstore, gboolean * haveHost) +_notification_watcher_server_is_notification_host_registered (CustomServiceWatcher * appwatcher, gboolean * haveHost) { *haveHost = TRUE; return TRUE; diff --git a/src/notification-watcher.xml b/src/notification-watcher.xml index 06e3e68..7b034e7 100644 --- a/src/notification-watcher.xml +++ b/src/notification-watcher.xml @@ -7,6 +7,7 @@ + -- cgit v1.2.3