aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libindicate/listener.c22
-rw-r--r--libindicate/listener.h3
-rw-r--r--tests/im-client.c8
3 files changed, 32 insertions, 1 deletions
diff --git a/libindicate/listener.c b/libindicate/listener.c
index 31fdf4b..c659147 100644
--- a/libindicate/listener.c
+++ b/libindicate/listener.c
@@ -598,7 +598,27 @@ indicate_listener_get_property (IndicateListener * listener, IndicateListenerSer
get_property_data->indicator = indicator;
get_property_data->property = g_strdup(property);
- org_freedesktop_indicator_get_indicator_property_async (proxyt->proxy , (guint)indicator, property, get_property_cb, get_property_data);
+ org_freedesktop_indicator_get_indicator_property_async (proxyt->proxy , INDICATE_LISTENER_INDICATOR_ID(indicator), property, get_property_cb, get_property_data);
return;
}
+static void
+listener_display_cb (DBusGProxy *proxy, GError *error, gpointer userdata)
+{
+ if (error != NULL) {
+ g_warning("Listener display caused an error: %s", error->message);
+ }
+ return;
+}
+
+void
+indicate_listener_display (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator)
+{
+ IndicateListenerPrivate * priv = INDICATE_LISTENER_GET_PRIVATE(listener);
+
+ proxy_t * proxyt = g_hash_table_lookup(priv->proxies_working, server);
+
+ org_freedesktop_indicator_show_indicator_to_user_async (proxyt->proxy, INDICATE_LISTENER_INDICATOR_ID(indicator), listener_display_cb, NULL);
+
+ return;
+}
diff --git a/libindicate/listener.h b/libindicate/listener.h
index bc2332f..4cec7e4 100644
--- a/libindicate/listener.h
+++ b/libindicate/listener.h
@@ -60,6 +60,9 @@ void indicate_listener_get_property (IndicateListener * liste
gchar * property,
indicate_listener_get_property_cb callback,
gpointer data);
+void indicate_listener_display (IndicateListener * listener,
+ IndicateListenerServer * server,
+ IndicateListenerIndicator * indicator);
diff --git a/tests/im-client.c b/tests/im-client.c
index 43635f0..9e6bc77 100644
--- a/tests/im-client.c
+++ b/tests/im-client.c
@@ -2,6 +2,12 @@
#include <glib.h>
#include "libindicate/indicator-message.h"
+static void
+display (IndicateIndicator * indicator, gpointer data)
+{
+ g_debug("Ah, I've been displayed");
+}
+
int
main (int argc, char ** argv)
{
@@ -17,6 +23,8 @@ main (int argc, char ** argv)
indicate_indicator_set_property(INDICATE_INDICATOR(indicator), "time", "11:12");
+ g_signal_connect(G_OBJECT(indicator), INDICATE_INDICATOR_SIGNAL_DISPLAY, G_CALLBACK(display), NULL);
+
g_main_loop_run(g_main_loop_new(NULL, FALSE));
return 0;