From ec8cd6885a17a2a03fc65c89f6e10f3da42b59de Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 28 Oct 2009 14:52:08 -0500 Subject: Adding the custom-service interface. --- .bzrignore | 2 ++ 1 file changed, 2 insertions(+) (limited to '.bzrignore') diff --git a/.bzrignore b/.bzrignore index 7121e6e..f41b607 100644 --- a/.bzrignore +++ b/.bzrignore @@ -24,3 +24,5 @@ tests/test-libcustomindicator-dbus-client tests/test-libcustomindicator-dbus-server tests/libcustomindicator-tests tests/test-libcustomindicator-dbus +src/custom-service-client.h +src/custom-service-server.h -- cgit v1.2.3 From 53f654eec6419c4999a620f9f1e0aaf3f2ac5e89 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 6 Nov 2009 16:47:54 -0600 Subject: Adding in a set of marshallers to make our signals all happy. --- .bzrignore | 3 +++ src/Makefile.am | 6 ++++++ src/custom-service-appstore.c | 3 ++- src/custom-service-marshal.list | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 src/custom-service-marshal.list (limited to '.bzrignore') diff --git a/.bzrignore b/.bzrignore index f41b607..2942d56 100644 --- a/.bzrignore +++ b/.bzrignore @@ -26,3 +26,6 @@ tests/libcustomindicator-tests tests/test-libcustomindicator-dbus src/custom-service-client.h src/custom-service-server.h +src/custom-service-marshal.c +src/custom-service-marshal.h +src/stamp-marshal diff --git a/src/Makefile.am b/src/Makefile.am index 273c2dc..2fb861c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -4,6 +4,7 @@ BUILT_SOURCES = EXTRA_DIST = include $(top_srcdir)/Makefile.am.enum +include $(top_srcdir)/Makefile.am.marshal ################################## # Indicator @@ -33,6 +34,8 @@ indicator_custom_service_SOURCES = \ custom-service.c \ custom-service-appstore.h \ custom-service-appstore.c \ + custom-service-marshal.h \ + custom-service-marshal.c \ custom-service-server.h \ dbus-shared.h \ notification-item-client.h \ @@ -43,6 +46,9 @@ indicator_custom_service_CFLAGS = \ indicator_custom_service_LDADD = \ $(INDICATOR_LIBS) +glib_marshal_list = custom-service-marshal.list +glib_marshal_prefix = _custom_service_marshal + ################################## # Library ################################## diff --git a/src/custom-service-appstore.c b/src/custom-service-appstore.c index a012fae..02d7927 100644 --- a/src/custom-service-appstore.c +++ b/src/custom-service-appstore.c @@ -4,6 +4,7 @@ #include #include "custom-service-appstore.h" +#include "custom-service-marshal.h" #include "dbus-shared.h" /* DBus Prototypes */ @@ -59,7 +60,7 @@ custom_service_appstore_class_init (CustomServiceAppstoreClass *klass) G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (CustomServiceAppstore, application_added), NULL, NULL, - g_cclosure_marshal_VOID__POINTER, + _custom_service_marshal_VOID__STRING_INT_STRING_STRING, G_TYPE_NONE, 4, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_NONE); signals[APPLICATION_REMOVED] = g_signal_new ("application-removed", G_TYPE_FROM_CLASS(klass), diff --git a/src/custom-service-marshal.list b/src/custom-service-marshal.list new file mode 100644 index 0000000..4056f53 --- /dev/null +++ b/src/custom-service-marshal.list @@ -0,0 +1 @@ +VOID: STRING, INT, STRING, STRING -- cgit v1.2.3 From ffd996217a130a5252ca804c506205bbbbadef3a Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 6 Nov 2009 22:50:48 -0600 Subject: Adding some XML for dbus properties interface. --- .bzrignore | 2 ++ src/Makefile.am | 2 ++ src/dbus-properties.xml | 23 +++++++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 src/dbus-properties.xml (limited to '.bzrignore') diff --git a/.bzrignore b/.bzrignore index 2942d56..4d5f1b0 100644 --- a/.bzrignore +++ b/.bzrignore @@ -29,3 +29,5 @@ src/custom-service-server.h src/custom-service-marshal.c src/custom-service-marshal.h src/stamp-marshal +src/dbus-properties-client.h +src/dbus-properties-server.h diff --git a/src/Makefile.am b/src/Makefile.am index fa0137f..21d7cf8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -39,6 +39,7 @@ indicator_custom_service_SOURCES = \ custom-service-server.h \ custom-service-watcher.h \ custom-service-watcher.c \ + dbus-properties-client.h \ dbus-shared.h \ notification-item-client.h \ notification-watcher-server.h @@ -96,6 +97,7 @@ libcustomindicator_la_LIBADD = \ DBUS_SPECS = \ custom-service.xml \ + dbus-properties.xml \ notification-item.xml \ notification-watcher.xml diff --git a/src/dbus-properties.xml b/src/dbus-properties.xml new file mode 100644 index 0000000..c172895 --- /dev/null +++ b/src/dbus-properties.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3 From 23d6b5d0da79ac8afaff855f0eed4811615999f3 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 9 Nov 2009 00:14:54 -0600 Subject: Adding a defualt file for a little appliction that'll grow into a full app. --- .bzrignore | 1 + tests/Makefile.am | 19 ++++++++++++++++++- tests/test-simple-app.c | 8 ++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 tests/test-simple-app.c (limited to '.bzrignore') diff --git a/.bzrignore b/.bzrignore index 4d5f1b0..b582d67 100644 --- a/.bzrignore +++ b/.bzrignore @@ -31,3 +31,4 @@ src/custom-service-marshal.h src/stamp-marshal src/dbus-properties-client.h src/dbus-properties-server.h +tests/test-simple-app diff --git a/tests/Makefile.am b/tests/Makefile.am index f6a0525..39cd3a6 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -2,7 +2,8 @@ check_PROGRAMS = \ test-libcustomindicator \ test-libcustomindicator-dbus-client \ - test-libcustomindicator-dbus-server + test-libcustomindicator-dbus-server \ + test-simple-app TESTS = DISTCLEANFILES = $(TESTS) @@ -82,3 +83,19 @@ test-libcustomindicator-dbus: test-libcustomindicator-dbus-client test-libcustom TESTS += test-libcustomindicator-dbus +######################################### +## test-simple-app +######################################### + +test_simple_app_SOURCES = \ + test-simple-app.c + +test_simple_app_CFLAGS = \ + $(INDICATOR_CFLAGS) \ + -Wall -Werror \ + -I$(top_srcdir)/src + +test_simple_app_LDADD = \ + $(INDICATOR_LIBS) \ + $(top_builddir)/src/libcustomindicator.la + diff --git a/tests/test-simple-app.c b/tests/test-simple-app.c new file mode 100644 index 0000000..9c2d164 --- /dev/null +++ b/tests/test-simple-app.c @@ -0,0 +1,8 @@ + +int +main (int argc, char ** argv) +{ + + + return 0; +} -- cgit v1.2.3 From 62f0373e2b8c8bb54fd4c72182d40622fad1215b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 23 Nov 2009 15:44:18 -0600 Subject: Making a simple client --- .bzrignore | 3 +++ Makefile.am | 1 + configure.ac | 1 + example/Makefile.am | 19 +++++++++++++++++++ example/simple-client.c | 34 ++++++++++++++++++++++++++++++++++ 5 files changed, 58 insertions(+) create mode 100644 example/Makefile.am create mode 100644 example/simple-client.c (limited to '.bzrignore') diff --git a/.bzrignore b/.bzrignore index b582d67..0a09d4f 100644 --- a/.bzrignore +++ b/.bzrignore @@ -32,3 +32,6 @@ src/stamp-marshal src/dbus-properties-client.h src/dbus-properties-server.h tests/test-simple-app +example/.deps +example/.libs +example/simple-client diff --git a/Makefile.am b/Makefile.am index 4eb69d7..33f9f3e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,6 @@ SUBDIRS = data \ src \ + example \ tests DISTCHECK_CONFIGURE_FLAGS = --enable-localinstall diff --git a/configure.ac b/configure.ac index 015677c..d76aec8 100644 --- a/configure.ac +++ b/configure.ac @@ -81,6 +81,7 @@ Makefile src/Makefile data/Makefile tests/Makefile +example/Makefile ]) ########################### diff --git a/example/Makefile.am b/example/Makefile.am new file mode 100644 index 0000000..954b04e --- /dev/null +++ b/example/Makefile.am @@ -0,0 +1,19 @@ + +check_PROGRAMS = \ + simple-client + +######################################### +## simple-client +######################################### + +simple_client_SOURCES = \ + simple-client.c + +simple_client_CFLAGS = \ + $(INDICATOR_CFLAGS) \ + -Wall -Werror \ + -I$(top_srcdir)/src + +simple_client_LDADD = \ + $(INDICATOR_LIBS) \ + $(top_builddir)/src/libcustomindicator.la diff --git a/example/simple-client.c b/example/simple-client.c new file mode 100644 index 0000000..1c29647 --- /dev/null +++ b/example/simple-client.c @@ -0,0 +1,34 @@ + +#include "libcustomindicator/custom-indicator.h" +#include "libdbusmenu-glib/server.h" +#include "libdbusmenu-glib/menuitem.h" + +GMainLoop * mainloop = NULL; + +int +main (int argc, char ** argv) +{ + g_type_init(); + + CustomIndicator * ci = CUSTOM_INDICATOR(g_object_new(CUSTOM_INDICATOR_TYPE, NULL)); + g_assert(ci != NULL); + + custom_indicator_set_id(ci, "example-simple-client"); + custom_indicator_set_category(ci, CUSTOM_INDICATOR_CATEGORY_APPLICATION_STATUS); + custom_indicator_set_status(ci, CUSTOM_INDICATOR_STATUS_ACTIVE); + custom_indicator_set_icon(ci, "indicator-messages"); + custom_indicator_set_attention_icon(ci, "indicator-messages-new"); + + DbusmenuMenuitem * root = dbusmenu_menuitem_new(); + dbusmenu_menuitem_property_set(root, "label", "Root"); + + DbusmenuServer * menuservice = dbusmenu_server_new ("/need/a/menu/path"); + dbusmenu_server_set_root(menuservice, root); + + custom_indicator_set_menu(ci, menuservice); + + mainloop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(mainloop); + + return 0; +} -- cgit v1.2.3 From 254386fc933403d7b4ab559d6c9aa5dfb1234492 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 24 Nov 2009 13:04:41 -0600 Subject: Ignoring the marshallers --- .bzrignore | 1 + 1 file changed, 1 insertion(+) (limited to '.bzrignore') diff --git a/.bzrignore b/.bzrignore index 0a09d4f..ca8d63a 100644 --- a/.bzrignore +++ b/.bzrignore @@ -35,3 +35,4 @@ tests/test-simple-app example/.deps example/.libs example/simple-client +src/libcustom_la-custom-service-marshal.lo -- cgit v1.2.3