[gnome-desktop] wall-clock: Add test application



commit ac4db1e9f86ae8626160668d18da5a91712cbb3e
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Sep 27 21:36:47 2012 +0200

    wall-clock: Add test application

 libgnome-desktop/Makefile.am       |    4 +++-
 libgnome-desktop/test-wall-clock.c |   33 +++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 1 deletions(-)
---
diff --git a/libgnome-desktop/Makefile.am b/libgnome-desktop/Makefile.am
index 0ab7a5b..e1dd1e8 100644
--- a/libgnome-desktop/Makefile.am
+++ b/libgnome-desktop/Makefile.am
@@ -128,7 +128,7 @@ gnome_rr_debug_LDADD =		\
 	$(lib_LTLIBRARIES)	\
 	$(XLIB_LIBS)
 
-noinst_PROGRAMS = test-xkb-info test-pnp-ids
+noinst_PROGRAMS = test-xkb-info test-pnp-ids test-wall-clock
 test_xkb_info_LDADD =		\
 	$(GNOME_DESKTOP_LIBS)	\
 	$(lib_LTLIBRARIES)	\
@@ -136,4 +136,6 @@ test_xkb_info_LDADD =		\
 
 test_pnp_ids_LDADD = $(test_xkb_info_LDADD)
 
+test_wall_clock_LDADD = $(test_xkb_info_LDADD)
+
 -include $(top_srcdir)/git.mk
diff --git a/libgnome-desktop/test-wall-clock.c b/libgnome-desktop/test-wall-clock.c
new file mode 100644
index 0000000..f3e212f
--- /dev/null
+++ b/libgnome-desktop/test-wall-clock.c
@@ -0,0 +1,33 @@
+#define GNOME_DESKTOP_USE_UNSTABLE_API
+#include <libgnome-desktop/gnome-wall-clock.h>
+
+static void
+clock_changed (GObject    *object,
+	       GParamSpec *pspec,
+	       gpointer    user_data)
+{
+	const char *txt;
+
+	txt = gnome_wall_clock_get_clock (GNOME_WALL_CLOCK (object));
+	g_print ("%s\n", txt);
+}
+
+int main (int argc, char **argv)
+{
+	GMainLoop *loop;
+	GnomeWallClock *clock;
+
+	g_setenv ("G_MESSAGES_DEBUG", "all", TRUE);
+
+	g_type_init ();
+
+	loop = g_main_loop_new (NULL, FALSE);
+
+	clock = g_object_new (GNOME_TYPE_WALL_CLOCK, NULL);
+	g_signal_connect (G_OBJECT (clock), "notify::clock",
+			  G_CALLBACK (clock_changed), NULL);
+
+	g_main_loop_run (loop);
+
+	return 0;
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]