diff options
author | Ted Gould <ted@canonical.com> | 2009-08-26 10:03:34 -0500 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-08-26 10:03:34 -0500 |
commit | 91fa6c67e8720123c2d81ac8aac0ef5aa4ac97e8 (patch) | |
tree | 1fd884a1b01002a2fd465251737f5ca317a8655d /src | |
parent | 03ca8ad97b53334826abc317472932289b17f69f (diff) | |
download | ayatana-indicator-messages-91fa6c67e8720123c2d81ac8aac0ef5aa4ac97e8.tar.gz ayatana-indicator-messages-91fa6c67e8720123c2d81ac8aac0ef5aa4ac97e8.tar.bz2 ayatana-indicator-messages-91fa6c67e8720123c2d81ac8aac0ef5aa4ac97e8.zip |
Setting up signals and callbacks, oh my! Watch for lions.
Diffstat (limited to 'src')
-rw-r--r-- | src/indicator-messages.c | 56 |
1 files changed, 55 insertions, 1 deletions
diff --git a/src/indicator-messages.c b/src/indicator-messages.c index a7628b0..87fd77e 100644 --- a/src/indicator-messages.c +++ b/src/indicator-messages.c @@ -31,6 +31,7 @@ INDICATOR_SET_VERSION INDICATOR_SET_NAME("messages") #include "dbus-data.h" +#include "messages-service-client.h" static GtkWidget * main_image = NULL; @@ -39,7 +40,43 @@ static GtkIconSize design_team_size; static DBusGProxy * icon_proxy = NULL; -gboolean +static void +attention_changed_cb (DBusGProxy * proxy, gboolean dot, gpointer userdata) +{ + +} + +static void +icon_changed_cb (DBusGProxy * proxy, gboolean hidden, gpointer userdata) +{ + +} + +static void +watch_cb (DBusGProxy * proxy, GError * error, gpointer userdata) +{ + if (error != NULL) { + g_warning("Watch failed! %s", error->message); + g_error_free(error); + } + return; +} + +static void +attention_cb (DBusGProxy * proxy, gboolean dot, GError * error, gpointer userdata) +{ + + return; +} + +static void +icon_cb (DBusGProxy * proxy, gboolean hidden, GError * error, gpointer userdata) +{ + + return; +} + +static gboolean setup_icon_proxy (gpointer userdata) { DBusGConnection * connection = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); @@ -56,6 +93,23 @@ setup_icon_proxy (gpointer userdata) g_warning("Unable to get messages service interface."); return FALSE; } + + org_ayatana_indicator_messages_service_watch_async(icon_proxy, watch_cb, NULL); + + dbus_g_proxy_connect_signal(icon_proxy, + "AttentionChanged", + G_CALLBACK(attention_changed_cb), + NULL, + NULL); + + dbus_g_proxy_connect_signal(icon_proxy, + "IconChanged", + G_CALLBACK(icon_changed_cb), + NULL, + NULL); + + org_ayatana_indicator_messages_service_attention_requested_async(icon_proxy, attention_cb, NULL); + org_ayatana_indicator_messages_service_icon_shown_async(icon_proxy, icon_cb, NULL); return FALSE; } |