diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 79 | ||||
-rw-r--r-- | tests/Makefile.in | 187 | ||||
-rw-r--r-- | tests/run-xvfb.sh | 2 | ||||
-rw-r--r-- | tests/test-gtk-objects.c | 145 | ||||
-rw-r--r-- | tests/test-gtk-objects.jpg | bin | 0 -> 14376 bytes | |||
-rw-r--r-- | tests/test-gtk-shortcut-client.c | 76 | ||||
-rw-r--r-- | tests/test-gtk-shortcut-server.c | 99 |
7 files changed, 577 insertions, 11 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index f1b50bc..66f286b 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -7,8 +7,10 @@ TESTS = \ test-glib-properties \ test-glib-proxy \ test-glib-simple-items \ + test-gtk-objects-test \ test-glib-submenu \ test-gtk-label \ + test-gtk-shortcut \ test-gtk-reorder check_PROGRAMS = \ @@ -21,10 +23,13 @@ check_PROGRAMS = \ test-glib-proxy-client \ test-glib-proxy-server \ test-glib-proxy-proxy \ + test-gtk-objects \ test-glib-submenu-client \ test-glib-submenu-server \ test-gtk-label-client \ test-gtk-label-server \ + test-gtk-shortcut-client \ + test-gtk-shortcut-server \ test-glib-simple-items \ test-gtk-reorder-server @@ -119,7 +124,7 @@ OBJECT_XML_REPORT = test-glib-objects.xml test-glib-objects-test: test-glib-objects Makefile.am @echo "#!/bin/bash" > $@ - @echo $(DBUS_RUNNER) --task gtester --parameter --verbose --parameter -k --parameter -o --parameter $(OBJECT_XML_REPORT) --parameter ./test-glib-objects >> $@ + @echo $(DBUS_RUNNER) --task gtester --task-name test --parameter --verbose --parameter -k --parameter -o --parameter $(OBJECT_XML_REPORT) --parameter ./test-glib-objects >> $@ @chmod +x $@ test_glib_objects_SOURCES = \ @@ -231,6 +236,34 @@ test_glib_simple_items_LDADD = \ ../libdbusmenu-glib/libdbusmenu-glib.la \ $(DBUSMENUGLIB_LIBS) +###################### +# Test GTK Object +###################### + +GTK_OBJECT_XML_REPORT = test-gtk-objects.xml + +test-gtk-objects-test: test-gtk-objects Makefile.am + @echo "#!/bin/bash" > $@ + @echo $(XVFB_RUN) >> $@ + @echo $(DBUS_RUNNER) --task gtester --task-name test --parameter --verbose --parameter -k --parameter -o --parameter $(GTK_OBJECT_XML_REPORT) --parameter ./test-gtk-objects >> $@ + @chmod +x $@ + +test_gtk_objects_SOURCES = \ + test-gtk-objects.c + +test_gtk_objects_CFLAGS = \ + -I $(srcdir)/.. \ + $(DBUSMENUGLIB_CFLAGS) \ + $(DBUSMENUGTK_CFLAGS) \ + -DSRCDIR="\"$(srcdir)\"" \ + -Wall -Werror + +test_gtk_objects_LDADD = \ + ../libdbusmenu-glib/libdbusmenu-glib.la \ + ../libdbusmenu-gtk/libdbusmenu-gtk.la \ + $(DBUSMENUGLIB_LIBS) \ + $(DBUSMENUGTK_LIBS) + ######################### # Test GTK Label ######################### @@ -272,6 +305,46 @@ test_gtk_label_client_LDADD = \ $(DBUSMENUTESTS_LIBS) ######################### +# Test GTK Shortcut +######################### + +test-gtk-shortcut: test-gtk-shortcut-client test-gtk-shortcut-server Makefile.am + @echo "#!/bin/bash" > $@ + @echo $(XVFB_RUN) >> $@ + @echo $(DBUS_RUNNER) --task ./test-gtk-shortcut-client --task-name Client --task ./test-gtk-shortcut-server --task-name Server --ignore-return >> $@ + @chmod +x $@ + +test_gtk_shortcut_server_SOURCES = \ + test-gtk-shortcut-server.c + +test_gtk_shortcut_server_CFLAGS = \ + -I $(srcdir)/.. \ + $(DBUSMENUGTK_CFLAGS) \ + $(DBUSMENUTESTS_CFLAGS) \ + $(DBUSMENUGLIB_CFLAGS) -Wall -Werror + +test_gtk_shortcut_server_LDADD = \ + ../libdbusmenu-glib/libdbusmenu-glib.la \ + ../libdbusmenu-gtk/libdbusmenu-gtk.la \ + $(DBUSMENUGTK_LIBS) \ + $(DBUSMENUTESTS_LIBS) + +test_gtk_shortcut_client_SOURCES = \ + test-gtk-shortcut-client.c + +test_gtk_shortcut_client_CFLAGS = \ + -I $(srcdir)/.. \ + $(DBUSMENUGTK_CFLAGS) \ + $(DBUSMENUTESTS_CFLAGS) \ + $(DBUSMENUGLIB_CFLAGS) -Wall -Werror + +test_gtk_shortcut_client_LDADD = \ + ../libdbusmenu-glib/libdbusmenu-glib.la \ + ../libdbusmenu-gtk/libdbusmenu-gtk.la \ + $(DBUSMENUGTK_LIBS) \ + $(DBUSMENUTESTS_LIBS) + +######################### # Test GTK Reorder ######################### @@ -329,6 +402,7 @@ EXTRA_DIST = \ $(examples_DATA) \ run-xvfb.sh \ $(json_DATA) \ + test-gtk-objects.jpg \ dbusmenu-gtk/dbusMenuTest \ dbusmenu-gtk/mago_tests/dbusmenu.xml \ dbusmenu-gtk/mago_tests/dbusmenu.py \ @@ -357,5 +431,6 @@ distclean-local: DISTCLEANFILES = \ $(TESTS) \ - $(OBJECT_XML_REPORT) + $(OBJECT_XML_REPORT) \ + $(GTK_OBJECT_XML_REPORT) diff --git a/tests/Makefile.in b/tests/Makefile.in index 3535eca..9fb9bc6 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -36,7 +36,8 @@ build_triplet = @build@ host_triplet = @host@ TESTS = test-glib-objects-test test-glib-layout test-glib-properties \ test-glib-proxy test-glib-simple-items$(EXEEXT) \ - test-glib-submenu test-gtk-label test-gtk-reorder + test-gtk-objects-test test-glib-submenu test-gtk-label \ + test-gtk-shortcut test-gtk-reorder check_PROGRAMS = glib-server-nomenu$(EXEEXT) \ test-glib-objects$(EXEEXT) test-glib-layout-client$(EXEEXT) \ test-glib-layout-server$(EXEEXT) \ @@ -44,9 +45,11 @@ check_PROGRAMS = glib-server-nomenu$(EXEEXT) \ test-glib-properties-server$(EXEEXT) \ test-glib-proxy-client$(EXEEXT) \ test-glib-proxy-server$(EXEEXT) test-glib-proxy-proxy$(EXEEXT) \ - test-glib-submenu-client$(EXEEXT) \ + test-gtk-objects$(EXEEXT) test-glib-submenu-client$(EXEEXT) \ test-glib-submenu-server$(EXEEXT) \ test-gtk-label-client$(EXEEXT) test-gtk-label-server$(EXEEXT) \ + test-gtk-shortcut-client$(EXEEXT) \ + test-gtk-shortcut-server$(EXEEXT) \ test-glib-simple-items$(EXEEXT) \ test-gtk-reorder-server$(EXEEXT) subdir = tests @@ -197,6 +200,17 @@ test_gtk_label_server_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(test_gtk_label_server_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ +am_test_gtk_objects_OBJECTS = \ + test_gtk_objects-test-gtk-objects.$(OBJEXT) +test_gtk_objects_OBJECTS = $(am_test_gtk_objects_OBJECTS) +test_gtk_objects_DEPENDENCIES = \ + ../libdbusmenu-glib/libdbusmenu-glib.la \ + ../libdbusmenu-gtk/libdbusmenu-gtk.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +test_gtk_objects_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(test_gtk_objects_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ + -o $@ am_test_gtk_reorder_server_OBJECTS = \ test_gtk_reorder_server-test-gtk-reorder-server.$(OBJEXT) test_gtk_reorder_server_OBJECTS = \ @@ -209,6 +223,30 @@ test_gtk_reorder_server_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(test_gtk_reorder_server_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ +am_test_gtk_shortcut_client_OBJECTS = \ + test_gtk_shortcut_client-test-gtk-shortcut-client.$(OBJEXT) +test_gtk_shortcut_client_OBJECTS = \ + $(am_test_gtk_shortcut_client_OBJECTS) +test_gtk_shortcut_client_DEPENDENCIES = \ + ../libdbusmenu-glib/libdbusmenu-glib.la \ + ../libdbusmenu-gtk/libdbusmenu-gtk.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +test_gtk_shortcut_client_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(test_gtk_shortcut_client_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +am_test_gtk_shortcut_server_OBJECTS = \ + test_gtk_shortcut_server-test-gtk-shortcut-server.$(OBJEXT) +test_gtk_shortcut_server_OBJECTS = \ + $(am_test_gtk_shortcut_server_OBJECTS) +test_gtk_shortcut_server_DEPENDENCIES = \ + ../libdbusmenu-glib/libdbusmenu-glib.la \ + ../libdbusmenu-gtk/libdbusmenu-gtk.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) +test_gtk_shortcut_server_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(test_gtk_shortcut_server_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -248,8 +286,10 @@ SOURCES = $(glib_server_nomenu_SOURCES) \ $(test_glib_submenu_client_SOURCES) \ $(test_glib_submenu_server_SOURCES) \ $(test_gtk_label_client_SOURCES) \ - $(test_gtk_label_server_SOURCES) \ - $(test_gtk_reorder_server_SOURCES) + $(test_gtk_label_server_SOURCES) $(test_gtk_objects_SOURCES) \ + $(test_gtk_reorder_server_SOURCES) \ + $(test_gtk_shortcut_client_SOURCES) \ + $(test_gtk_shortcut_server_SOURCES) DIST_SOURCES = $(glib_server_nomenu_SOURCES) \ $(test_glib_layout_client_SOURCES) \ $(test_glib_layout_server_SOURCES) \ @@ -263,8 +303,10 @@ DIST_SOURCES = $(glib_server_nomenu_SOURCES) \ $(test_glib_submenu_client_SOURCES) \ $(test_glib_submenu_server_SOURCES) \ $(test_gtk_label_client_SOURCES) \ - $(test_gtk_label_server_SOURCES) \ - $(test_gtk_reorder_server_SOURCES) + $(test_gtk_label_server_SOURCES) $(test_gtk_objects_SOURCES) \ + $(test_gtk_reorder_server_SOURCES) \ + $(test_gtk_shortcut_client_SOURCES) \ + $(test_gtk_shortcut_server_SOURCES) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -612,6 +654,27 @@ test_glib_simple_items_LDADD = \ ../libdbusmenu-glib/libdbusmenu-glib.la \ $(DBUSMENUGLIB_LIBS) + +###################### +# Test GTK Object +###################### +GTK_OBJECT_XML_REPORT = test-gtk-objects.xml +test_gtk_objects_SOURCES = \ + test-gtk-objects.c + +test_gtk_objects_CFLAGS = \ + -I $(srcdir)/.. \ + $(DBUSMENUGLIB_CFLAGS) \ + $(DBUSMENUGTK_CFLAGS) \ + -DSRCDIR="\"$(srcdir)\"" \ + -Wall -Werror + +test_gtk_objects_LDADD = \ + ../libdbusmenu-glib/libdbusmenu-glib.la \ + ../libdbusmenu-gtk/libdbusmenu-gtk.la \ + $(DBUSMENUGLIB_LIBS) \ + $(DBUSMENUGTK_LIBS) + test_gtk_label_server_SOURCES = \ test-gtk-label-server.c @@ -642,6 +705,36 @@ test_gtk_label_client_LDADD = \ $(DBUSMENUGTK_LIBS) \ $(DBUSMENUTESTS_LIBS) +test_gtk_shortcut_server_SOURCES = \ + test-gtk-shortcut-server.c + +test_gtk_shortcut_server_CFLAGS = \ + -I $(srcdir)/.. \ + $(DBUSMENUGTK_CFLAGS) \ + $(DBUSMENUTESTS_CFLAGS) \ + $(DBUSMENUGLIB_CFLAGS) -Wall -Werror + +test_gtk_shortcut_server_LDADD = \ + ../libdbusmenu-glib/libdbusmenu-glib.la \ + ../libdbusmenu-gtk/libdbusmenu-gtk.la \ + $(DBUSMENUGTK_LIBS) \ + $(DBUSMENUTESTS_LIBS) + +test_gtk_shortcut_client_SOURCES = \ + test-gtk-shortcut-client.c + +test_gtk_shortcut_client_CFLAGS = \ + -I $(srcdir)/.. \ + $(DBUSMENUGTK_CFLAGS) \ + $(DBUSMENUTESTS_CFLAGS) \ + $(DBUSMENUGLIB_CFLAGS) -Wall -Werror + +test_gtk_shortcut_client_LDADD = \ + ../libdbusmenu-glib/libdbusmenu-glib.la \ + ../libdbusmenu-gtk/libdbusmenu-gtk.la \ + $(DBUSMENUGTK_LIBS) \ + $(DBUSMENUTESTS_LIBS) + test_gtk_reorder_server_SOURCES = \ test-gtk-reorder-server.c @@ -673,6 +766,7 @@ EXTRA_DIST = \ $(examples_DATA) \ run-xvfb.sh \ $(json_DATA) \ + test-gtk-objects.jpg \ dbusmenu-gtk/dbusMenuTest \ dbusmenu-gtk/mago_tests/dbusmenu.xml \ dbusmenu-gtk/mago_tests/dbusmenu.py \ @@ -698,7 +792,8 @@ CLEANFILES = \ DISTCLEANFILES = \ $(TESTS) \ - $(OBJECT_XML_REPORT) + $(OBJECT_XML_REPORT) \ + $(GTK_OBJECT_XML_REPORT) all: all-am @@ -785,9 +880,18 @@ test-gtk-label-client$(EXEEXT): $(test_gtk_label_client_OBJECTS) $(test_gtk_labe test-gtk-label-server$(EXEEXT): $(test_gtk_label_server_OBJECTS) $(test_gtk_label_server_DEPENDENCIES) @rm -f test-gtk-label-server$(EXEEXT) $(AM_V_CCLD)$(test_gtk_label_server_LINK) $(test_gtk_label_server_OBJECTS) $(test_gtk_label_server_LDADD) $(LIBS) +test-gtk-objects$(EXEEXT): $(test_gtk_objects_OBJECTS) $(test_gtk_objects_DEPENDENCIES) + @rm -f test-gtk-objects$(EXEEXT) + $(AM_V_CCLD)$(test_gtk_objects_LINK) $(test_gtk_objects_OBJECTS) $(test_gtk_objects_LDADD) $(LIBS) test-gtk-reorder-server$(EXEEXT): $(test_gtk_reorder_server_OBJECTS) $(test_gtk_reorder_server_DEPENDENCIES) @rm -f test-gtk-reorder-server$(EXEEXT) $(AM_V_CCLD)$(test_gtk_reorder_server_LINK) $(test_gtk_reorder_server_OBJECTS) $(test_gtk_reorder_server_LDADD) $(LIBS) +test-gtk-shortcut-client$(EXEEXT): $(test_gtk_shortcut_client_OBJECTS) $(test_gtk_shortcut_client_DEPENDENCIES) + @rm -f test-gtk-shortcut-client$(EXEEXT) + $(AM_V_CCLD)$(test_gtk_shortcut_client_LINK) $(test_gtk_shortcut_client_OBJECTS) $(test_gtk_shortcut_client_LDADD) $(LIBS) +test-gtk-shortcut-server$(EXEEXT): $(test_gtk_shortcut_server_OBJECTS) $(test_gtk_shortcut_server_DEPENDENCIES) + @rm -f test-gtk-shortcut-server$(EXEEXT) + $(AM_V_CCLD)$(test_gtk_shortcut_server_LINK) $(test_gtk_shortcut_server_OBJECTS) $(test_gtk_shortcut_server_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -809,7 +913,10 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_glib_submenu_server-test-glib-submenu-server.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_gtk_label_client-test-gtk-label-client.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_gtk_label_server-test-gtk-label-server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_gtk_objects-test-gtk-objects.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_gtk_reorder_server-test-gtk-reorder-server.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_gtk_shortcut_client-test-gtk-shortcut-client.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_gtk_shortcut_server-test-gtk-shortcut-server.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -1059,6 +1166,22 @@ test_gtk_label_server-test-gtk-label-server.obj: test-gtk-label-server.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_gtk_label_server_CFLAGS) $(CFLAGS) -c -o test_gtk_label_server-test-gtk-label-server.obj `if test -f 'test-gtk-label-server.c'; then $(CYGPATH_W) 'test-gtk-label-server.c'; else $(CYGPATH_W) '$(srcdir)/test-gtk-label-server.c'; fi` +test_gtk_objects-test-gtk-objects.o: test-gtk-objects.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_gtk_objects_CFLAGS) $(CFLAGS) -MT test_gtk_objects-test-gtk-objects.o -MD -MP -MF $(DEPDIR)/test_gtk_objects-test-gtk-objects.Tpo -c -o test_gtk_objects-test-gtk-objects.o `test -f 'test-gtk-objects.c' || echo '$(srcdir)/'`test-gtk-objects.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_gtk_objects-test-gtk-objects.Tpo $(DEPDIR)/test_gtk_objects-test-gtk-objects.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-gtk-objects.c' object='test_gtk_objects-test-gtk-objects.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_gtk_objects_CFLAGS) $(CFLAGS) -c -o test_gtk_objects-test-gtk-objects.o `test -f 'test-gtk-objects.c' || echo '$(srcdir)/'`test-gtk-objects.c + +test_gtk_objects-test-gtk-objects.obj: test-gtk-objects.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_gtk_objects_CFLAGS) $(CFLAGS) -MT test_gtk_objects-test-gtk-objects.obj -MD -MP -MF $(DEPDIR)/test_gtk_objects-test-gtk-objects.Tpo -c -o test_gtk_objects-test-gtk-objects.obj `if test -f 'test-gtk-objects.c'; then $(CYGPATH_W) 'test-gtk-objects.c'; else $(CYGPATH_W) '$(srcdir)/test-gtk-objects.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_gtk_objects-test-gtk-objects.Tpo $(DEPDIR)/test_gtk_objects-test-gtk-objects.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-gtk-objects.c' object='test_gtk_objects-test-gtk-objects.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_gtk_objects_CFLAGS) $(CFLAGS) -c -o test_gtk_objects-test-gtk-objects.obj `if test -f 'test-gtk-objects.c'; then $(CYGPATH_W) 'test-gtk-objects.c'; else $(CYGPATH_W) '$(srcdir)/test-gtk-objects.c'; fi` + test_gtk_reorder_server-test-gtk-reorder-server.o: test-gtk-reorder-server.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_gtk_reorder_server_CFLAGS) $(CFLAGS) -MT test_gtk_reorder_server-test-gtk-reorder-server.o -MD -MP -MF $(DEPDIR)/test_gtk_reorder_server-test-gtk-reorder-server.Tpo -c -o test_gtk_reorder_server-test-gtk-reorder-server.o `test -f 'test-gtk-reorder-server.c' || echo '$(srcdir)/'`test-gtk-reorder-server.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_gtk_reorder_server-test-gtk-reorder-server.Tpo $(DEPDIR)/test_gtk_reorder_server-test-gtk-reorder-server.Po @@ -1075,6 +1198,38 @@ test_gtk_reorder_server-test-gtk-reorder-server.obj: test-gtk-reorder-server.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_gtk_reorder_server_CFLAGS) $(CFLAGS) -c -o test_gtk_reorder_server-test-gtk-reorder-server.obj `if test -f 'test-gtk-reorder-server.c'; then $(CYGPATH_W) 'test-gtk-reorder-server.c'; else $(CYGPATH_W) '$(srcdir)/test-gtk-reorder-server.c'; fi` +test_gtk_shortcut_client-test-gtk-shortcut-client.o: test-gtk-shortcut-client.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_gtk_shortcut_client_CFLAGS) $(CFLAGS) -MT test_gtk_shortcut_client-test-gtk-shortcut-client.o -MD -MP -MF $(DEPDIR)/test_gtk_shortcut_client-test-gtk-shortcut-client.Tpo -c -o test_gtk_shortcut_client-test-gtk-shortcut-client.o `test -f 'test-gtk-shortcut-client.c' || echo '$(srcdir)/'`test-gtk-shortcut-client.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_gtk_shortcut_client-test-gtk-shortcut-client.Tpo $(DEPDIR)/test_gtk_shortcut_client-test-gtk-shortcut-client.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-gtk-shortcut-client.c' object='test_gtk_shortcut_client-test-gtk-shortcut-client.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_gtk_shortcut_client_CFLAGS) $(CFLAGS) -c -o test_gtk_shortcut_client-test-gtk-shortcut-client.o `test -f 'test-gtk-shortcut-client.c' || echo '$(srcdir)/'`test-gtk-shortcut-client.c + +test_gtk_shortcut_client-test-gtk-shortcut-client.obj: test-gtk-shortcut-client.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_gtk_shortcut_client_CFLAGS) $(CFLAGS) -MT test_gtk_shortcut_client-test-gtk-shortcut-client.obj -MD -MP -MF $(DEPDIR)/test_gtk_shortcut_client-test-gtk-shortcut-client.Tpo -c -o test_gtk_shortcut_client-test-gtk-shortcut-client.obj `if test -f 'test-gtk-shortcut-client.c'; then $(CYGPATH_W) 'test-gtk-shortcut-client.c'; else $(CYGPATH_W) '$(srcdir)/test-gtk-shortcut-client.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_gtk_shortcut_client-test-gtk-shortcut-client.Tpo $(DEPDIR)/test_gtk_shortcut_client-test-gtk-shortcut-client.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-gtk-shortcut-client.c' object='test_gtk_shortcut_client-test-gtk-shortcut-client.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_gtk_shortcut_client_CFLAGS) $(CFLAGS) -c -o test_gtk_shortcut_client-test-gtk-shortcut-client.obj `if test -f 'test-gtk-shortcut-client.c'; then $(CYGPATH_W) 'test-gtk-shortcut-client.c'; else $(CYGPATH_W) '$(srcdir)/test-gtk-shortcut-client.c'; fi` + +test_gtk_shortcut_server-test-gtk-shortcut-server.o: test-gtk-shortcut-server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_gtk_shortcut_server_CFLAGS) $(CFLAGS) -MT test_gtk_shortcut_server-test-gtk-shortcut-server.o -MD -MP -MF $(DEPDIR)/test_gtk_shortcut_server-test-gtk-shortcut-server.Tpo -c -o test_gtk_shortcut_server-test-gtk-shortcut-server.o `test -f 'test-gtk-shortcut-server.c' || echo '$(srcdir)/'`test-gtk-shortcut-server.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_gtk_shortcut_server-test-gtk-shortcut-server.Tpo $(DEPDIR)/test_gtk_shortcut_server-test-gtk-shortcut-server.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-gtk-shortcut-server.c' object='test_gtk_shortcut_server-test-gtk-shortcut-server.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_gtk_shortcut_server_CFLAGS) $(CFLAGS) -c -o test_gtk_shortcut_server-test-gtk-shortcut-server.o `test -f 'test-gtk-shortcut-server.c' || echo '$(srcdir)/'`test-gtk-shortcut-server.c + +test_gtk_shortcut_server-test-gtk-shortcut-server.obj: test-gtk-shortcut-server.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_gtk_shortcut_server_CFLAGS) $(CFLAGS) -MT test_gtk_shortcut_server-test-gtk-shortcut-server.obj -MD -MP -MF $(DEPDIR)/test_gtk_shortcut_server-test-gtk-shortcut-server.Tpo -c -o test_gtk_shortcut_server-test-gtk-shortcut-server.obj `if test -f 'test-gtk-shortcut-server.c'; then $(CYGPATH_W) 'test-gtk-shortcut-server.c'; else $(CYGPATH_W) '$(srcdir)/test-gtk-shortcut-server.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test_gtk_shortcut_server-test-gtk-shortcut-server.Tpo $(DEPDIR)/test_gtk_shortcut_server-test-gtk-shortcut-server.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test-gtk-shortcut-server.c' object='test_gtk_shortcut_server-test-gtk-shortcut-server.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_gtk_shortcut_server_CFLAGS) $(CFLAGS) -c -o test_gtk_shortcut_server-test-gtk-shortcut-server.obj `if test -f 'test-gtk-shortcut-server.c'; then $(CYGPATH_W) 'test-gtk-shortcut-server.c'; else $(CYGPATH_W) '$(srcdir)/test-gtk-shortcut-server.c'; fi` + mostlyclean-libtool: -rm -f *.lo @@ -1440,7 +1595,7 @@ test-glib-submenu: test-glib-submenu-client test-glib-submenu-server Makefile.am test-glib-objects-test: test-glib-objects Makefile.am @echo "#!/bin/bash" > $@ - @echo $(DBUS_RUNNER) --task gtester --parameter --verbose --parameter -k --parameter -o --parameter $(OBJECT_XML_REPORT) --parameter ./test-glib-objects >> $@ + @echo $(DBUS_RUNNER) --task gtester --task-name test --parameter --verbose --parameter -k --parameter -o --parameter $(OBJECT_XML_REPORT) --parameter ./test-glib-objects >> $@ @chmod +x $@ ###################### @@ -1466,6 +1621,12 @@ test-glib-proxy: test-glib-proxy-client test-glib-proxy-server test-glib-proxy-p @echo --task ./test-glib-proxy-proxy --parameter test.proxy.last_proxy --parameter test.proxy.server --task-name Proxy05 --ignore-return >> $@ @chmod +x $@ +test-gtk-objects-test: test-gtk-objects Makefile.am + @echo "#!/bin/bash" > $@ + @echo $(XVFB_RUN) >> $@ + @echo $(DBUS_RUNNER) --task gtester --task-name test --parameter --verbose --parameter -k --parameter -o --parameter $(GTK_OBJECT_XML_REPORT) --parameter ./test-gtk-objects >> $@ + @chmod +x $@ + ######################### # Test GTK Label ######################### @@ -1477,6 +1638,16 @@ test-gtk-label: test-gtk-label-client test-gtk-label-server test-gtk-label.json @chmod +x $@ ######################### +# Test GTK Shortcut +######################### + +test-gtk-shortcut: test-gtk-shortcut-client test-gtk-shortcut-server Makefile.am + @echo "#!/bin/bash" > $@ + @echo $(XVFB_RUN) >> $@ + @echo $(DBUS_RUNNER) --task ./test-gtk-shortcut-client --task-name Client --task ./test-gtk-shortcut-server --task-name Server --ignore-return >> $@ + @chmod +x $@ + +######################### # Test GTK Reorder ######################### diff --git a/tests/run-xvfb.sh b/tests/run-xvfb.sh index 3622dbf..3aa05c1 100644 --- a/tests/run-xvfb.sh +++ b/tests/run-xvfb.sh @@ -1,4 +1,4 @@ -if [ "$DISPLAY" == "" ]; then +if [ "x$DISPLAY" == "x" ]; then Xvfb -ac -noreset -screen 0 800x600x16 -help 2>/dev/null 1>&2 XID=`for id in 101 102 103 104 105 106 107 197 199 211 223 227 293 307 308 309 310 311 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 4703 4721 4723 4729 4733 4751 9973 9974 9975 9976 9977 9978 9979 9980 9981 9982 9983 9984 9985 9986 9987 9988 9989 9990 9991 9992 9993 9994 9995 9996 9997 9998 9999 ; do test -e /tmp/.X$id-lock || { echo $id; exit 0; }; done; exit 1` { Xvfb -ac -noreset -screen 0 800x600x16 :$XID -screen 0 800x600x16 -nolisten tcp -auth /dev/null >/dev/null 2>&1 & trap "kill -15 $! " 0 HUP INT QUIT TRAP USR1 PIPE TERM ; } || { echo "Gtk+Tests:ERROR: Failed to start Xvfb environment for X11 target tests."; exit 1; } diff --git a/tests/test-gtk-objects.c b/tests/test-gtk-objects.c new file mode 100644 index 0000000..726f404 --- /dev/null +++ b/tests/test-gtk-objects.c @@ -0,0 +1,145 @@ +/* +Testing for the various objects just by themselves. + +Copyright 2010 Canonical Ltd. + +Authors: + Ted Gould <ted@canonical.com> + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include <libdbusmenu-glib/menuitem.h> +#include <libdbusmenu-gtk/menuitem.h> +#include <gdk/gdkkeysyms.h> + +#define TEST_IMAGE SRCDIR "/" "test-gtk-objects.jpg" + +/* Building the basic menu item, make sure we didn't break + any core GObject stuff */ +static void +test_object_menuitem (void) +{ + /* Build a menu item */ + DbusmenuMenuitem * item = dbusmenu_menuitem_new(); + + /* Test to make sure it's a happy object */ + g_assert(item != NULL); + g_assert(G_IS_OBJECT(item)); + g_assert(DBUSMENU_IS_MENUITEM(item)); + + /* Set up a check to make sure it gets destroyed on unref */ + g_object_add_weak_pointer(G_OBJECT(item), (gpointer *)&item); + g_object_unref(item); + + /* Did it go away? */ + g_assert(item == NULL); + + return; +} + +/* Setting and getting a pixbuf */ +static void +test_object_prop_pixbuf (void) +{ + const gchar * prop_name = "image-test"; + + /* Build a menu item */ + DbusmenuMenuitem * item = dbusmenu_menuitem_new(); + + /* Test to make sure it's a happy object */ + g_assert(item != NULL); + g_assert(G_IS_OBJECT(item)); + g_assert(DBUSMENU_IS_MENUITEM(item)); + + /* Load our image */ + GdkPixbuf * pixbuf = gdk_pixbuf_new_from_file(TEST_IMAGE, NULL); + g_assert(pixbuf != NULL); + + /* Set the property */ + gboolean success = dbusmenu_menuitem_property_set_image(item, prop_name, pixbuf); + g_assert(success); + g_object_unref(pixbuf); + + /* Check to see if it's set */ + const GValue * val = dbusmenu_menuitem_property_get_value(item, prop_name); + g_assert(val != NULL); + + /* Get the pixbuf back! */ + GdkPixbuf * newpixbuf = dbusmenu_menuitem_property_get_image(item, prop_name); + g_assert(newpixbuf != NULL); + g_object_unref(newpixbuf); + + g_object_unref(item); + + return; +} + +/* Setting and getting a shortcut */ +static void +test_object_prop_shortcut (void) +{ + /* Build a menu item */ + DbusmenuMenuitem * item = dbusmenu_menuitem_new(); + + /* Test to make sure it's a happy object */ + g_assert(item != NULL); + g_assert(G_IS_OBJECT(item)); + g_assert(DBUSMENU_IS_MENUITEM(item)); + + guint key = GDK_c; + GdkModifierType modifier = GDK_CONTROL_MASK; + + /* Set a shortcut */ + gboolean success = dbusmenu_menuitem_property_set_shortcut(item, key, modifier); + g_assert(success); + + /* Check for value */ + const GValue * val = dbusmenu_menuitem_property_get_value(item, DBUSMENU_MENUITEM_PROP_SHORTCUT); + g_assert(val != NULL); + + /* Check to see if we love it */ + guint newkey = 0; + GdkModifierType newmodifier = 0; + dbusmenu_menuitem_property_get_shortcut(item, &newkey, &newmodifier); + + g_assert(key == newkey); + g_assert(newmodifier == modifier); + + g_object_unref(item); + + return; +} + +/* Build the test suite */ +static void +test_gtk_objects_suite (void) +{ + g_test_add_func ("/dbusmenu/gtk/objects/menuitem/base", test_object_menuitem); + g_test_add_func ("/dbusmenu/gtk/objects/menuitem/prop_pixbuf", test_object_prop_pixbuf); + g_test_add_func ("/dbusmenu/gtk/objects/menuitem/prop_shortcut", test_object_prop_shortcut); + return; +} + +gint +main (gint argc, gchar * argv[]) +{ + gtk_init(&argc, &argv); + + g_test_init(&argc, &argv, NULL); + + /* Test suites */ + test_gtk_objects_suite(); + + return g_test_run (); +} diff --git a/tests/test-gtk-objects.jpg b/tests/test-gtk-objects.jpg Binary files differnew file mode 100644 index 0000000..478704e --- /dev/null +++ b/tests/test-gtk-objects.jpg diff --git a/tests/test-gtk-shortcut-client.c b/tests/test-gtk-shortcut-client.c new file mode 100644 index 0000000..003885c --- /dev/null +++ b/tests/test-gtk-shortcut-client.c @@ -0,0 +1,76 @@ +/* +A test for libdbusmenu to ensure its quality. + +Copyright 2009 Canonical Ltd. + +Authors: + Ted Gould <ted@canonical.com> + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include <gtk/gtk.h> +#include <libdbusmenu-gtk/menu.h> +#include <libdbusmenu-gtk/client.h> + +static GMainLoop * mainloop = NULL; +static gboolean passed = TRUE; +static guint death_timer = 0; + +static gboolean +timer_func (gpointer data) +{ + passed = TRUE; + g_main_loop_quit(mainloop); + return FALSE; +} + +int +main (int argc, char ** argv) +{ + gtk_init(&argc, &argv); + + g_debug("Building Window"); + GtkWidget * window = gtk_window_new(GTK_WINDOW_TOPLEVEL); + GtkWidget * menubar = gtk_menu_bar_new(); + GtkWidget * menuitem = gtk_menu_item_new_with_label("Test"); + + DbusmenuGtkMenu * dmenu = dbusmenu_gtkmenu_new ("glib.label.test", "/org/test"); + DbusmenuGtkClient * dclient = dbusmenu_gtkmenu_get_client(dmenu); + + GtkAccelGroup * agroup = gtk_accel_group_new(); + dbusmenu_gtkclient_set_accel_group(dclient, agroup); + + gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), GTK_WIDGET(dmenu)); + gtk_widget_show(menuitem); + gtk_menu_bar_append(menubar, menuitem); + gtk_widget_show(menubar); + gtk_container_add(GTK_CONTAINER(window), menubar); + gtk_window_set_title(GTK_WINDOW(window), "libdbusmenu-gtk test"); + gtk_window_add_accel_group(GTK_WINDOW(window), agroup); + gtk_widget_show(window); + + death_timer = g_timeout_add_seconds(10, timer_func, window); + + g_debug("Entering Mainloop"); + mainloop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(mainloop); + + if (passed) { + g_debug("Quiting"); + return 0; + } else { + g_debug("Quiting as we're a failure"); + return 1; + } +} diff --git a/tests/test-gtk-shortcut-server.c b/tests/test-gtk-shortcut-server.c new file mode 100644 index 0000000..3b703a1 --- /dev/null +++ b/tests/test-gtk-shortcut-server.c @@ -0,0 +1,99 @@ +/* +A test for libdbusmenu to ensure its quality. + +Copyright 2009 Canonical Ltd. + +Authors: + Ted Gould <ted@canonical.com> + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include <glib.h> +#include <gdk/gdkkeysyms.h> + +#include <dbus/dbus.h> +#include <dbus/dbus-glib.h> +#include <dbus/dbus-glib-lowlevel.h> +#include <dbus/dbus-glib-bindings.h> + +#include <libdbusmenu-glib/menuitem.h> +#include <libdbusmenu-glib/server.h> +#include <libdbusmenu-gtk/menuitem.h> + +GMainLoop * mainloop = NULL; +DbusmenuServer * server = NULL; + +gboolean +timer_func (gpointer userdata) +{ + g_main_loop_quit(mainloop); + return FALSE; +} + +void +build_menu (void) +{ + DbusmenuMenuitem * item; + + DbusmenuMenuitem * root = dbusmenu_menuitem_new(); + + item = dbusmenu_menuitem_new(); + dbusmenu_menuitem_property_set(item, DBUSMENU_MENUITEM_PROP_LABEL, "Control-L"); + dbusmenu_menuitem_property_set_shortcut(item, GDK_l, GDK_CONTROL_MASK); + dbusmenu_menuitem_child_append(root, item); + g_object_unref(item); + + + dbusmenu_server_set_root(server, root); + g_object_unref(root); + + return; +} + +int +main (int argc, char ** argv) +{ + GError * error = NULL; + + g_type_init(); + + DBusGConnection * connection = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); + g_debug("DBus ID: %s", dbus_connection_get_server_id(dbus_g_connection_get_connection(dbus_g_bus_get(DBUS_BUS_SESSION, NULL)))); + + DBusGProxy * bus_proxy = dbus_g_proxy_new_for_name(connection, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); + guint nameret = 0; + + if (!org_freedesktop_DBus_request_name(bus_proxy, "glib.label.test", 0, &nameret, &error)) { + g_error("Unable to call to request name"); + return 1; + } + + if (nameret != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { + g_error("Unable to get name"); + return 1; + } + + server = dbusmenu_server_new("/org/test"); + build_menu(); + + g_timeout_add_seconds(10, timer_func, NULL); + + mainloop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(mainloop); + + g_debug("Quiting"); + + return 0; +} + |