diff options
Diffstat (limited to 'libindicate/tests')
-rw-r--r-- | libindicate/tests/listen-and-print.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/libindicate/tests/listen-and-print.c b/libindicate/tests/listen-and-print.c index 772e4f1..381fdf2 100644 --- a/libindicate/tests/listen-and-print.c +++ b/libindicate/tests/listen-and-print.c @@ -2,6 +2,35 @@ #include <glib.h> #include "libindicate/listener.h" +static void +indicator_added (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * type, gpointer data) +{ + g_debug("Indicator Added: %s %d %s", (gchar *)server, (guint)*indicator, type); +} + +static void +indicator_removed (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * type, gpointer data) +{ + g_debug("Indicator Removed: %s %d %s", (gchar *)server, (guint)*indicator, type); +} + +static void +indicator_modified (IndicateListener * listener, IndicateListenerServer * server, IndicateListenerIndicator * indicator, gchar * type, gchar * property, gpointer data) +{ + g_debug("Indicator Modified: %s %d %s %s", (gchar *)server, (guint)*indicator, type, property); +} + +static void +server_added (IndicateListener * listener, IndicateListenerServer * server, gpointer data) +{ + g_debug("Indicator Server Added: %s", (gchar *)server); +} + +static void +server_removed (IndicateListener * listener, IndicateListenerServer * server, gpointer data) +{ + g_debug("Indicator Server Removed: %s", (gchar *)server); +} int main (int argc, char ** argv) @@ -10,6 +39,12 @@ main (int argc, char ** argv) IndicateListener * listener = indicate_listener_new(); + g_signal_connect(listener, "indicator-added", G_CALLBACK(indicator_added), NULL); + g_signal_connect(listener, "indicator-removed", G_CALLBACK(indicator_removed), NULL); + g_signal_connect(listener, "indicator-modified", G_CALLBACK(indicator_modified), NULL); + g_signal_connect(listener, "server-added", G_CALLBACK(server_added), NULL); + g_signal_connect(listener, "server-removed", G_CALLBACK(server_removed), NULL); + g_main_loop_run(g_main_loop_new(NULL, FALSE)); return 0; |