diff options
author | Ted Gould <ted@canonical.com> | 2009-01-15 23:11:56 -0600 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-01-15 23:11:56 -0600 |
commit | fe3addbe95bcd54af249b315ee8d10be71005be8 (patch) | |
tree | ca2b3e43e0e82a898ad3396f2c9d86f9f34c59f9 /libindicate/tests | |
parent | 0d1e01e34d94b47b8785cac9138f529c1fcc55b9 (diff) | |
download | libayatana-indicator-fe3addbe95bcd54af249b315ee8d10be71005be8.tar.gz libayatana-indicator-fe3addbe95bcd54af249b315ee8d10be71005be8.tar.bz2 libayatana-indicator-fe3addbe95bcd54af249b315ee8d10be71005be8.zip |
Changing the test to do the printing by itself instead of using the debug messages in the class itself
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; |