From 81afbd1f77b832d8ebef880a5ae6f8869b6a663c Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 20 Oct 2009 17:06:34 -0500 Subject: Okay, connecting this little thing into DBus already. --- src/libcustomindicator/custom-indicator.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src') diff --git a/src/libcustomindicator/custom-indicator.c b/src/libcustomindicator/custom-indicator.c index 82abd0e..a4081cd 100644 --- a/src/libcustomindicator/custom-indicator.c +++ b/src/libcustomindicator/custom-indicator.c @@ -8,6 +8,9 @@ #include "libcustomindicator/custom-indicator.h" #include "libcustomindicator/custom-indicator-enum-types.h" +#include "notification-item-server.h" +#include "notification-watcher-client.h" + /** CustomIndicatorPrivate: @id: The ID of the indicator. Maps to CustomIndicator::id. @@ -216,6 +219,10 @@ custom_indicator_class_init (CustomIndicatorClass *klass) NULL, NULL, g_cclosure_marshal_VOID__BOOLEAN, G_TYPE_NONE, 1, G_TYPE_BOOLEAN, G_TYPE_NONE); + + /* Initialize the object as a DBus type */ + dbus_g_object_type_install_info(CUSTOM_INDICATOR_TYPE, + &dbus_glib__notification_item_server_object_info); return; } @@ -235,6 +242,18 @@ custom_indicator_init (CustomIndicator *self) priv->watcher_proxy = NULL; + /* Put the object on DBus */ + GError * error = NULL; + DBusGConnection * connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error); + if (error != NULL) { + g_error("Unable to connect to the session bus when creating custom indicator: %s", error->message); + g_error_free(error); + return; + } + dbus_g_connection_register_g_object(connection, + "/need/a/path", + G_OBJECT(self)); + return; } -- cgit v1.2.3