From 1f822bf64b8891dab03937060dd47b8003bb8ab5 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 6 Oct 2009 15:28:41 -0400 Subject: Building a base object. --- libindicator/Makefile.am | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'libindicator/Makefile.am') diff --git a/libindicator/Makefile.am b/libindicator/Makefile.am index be68721..29b7bb5 100644 --- a/libindicator/Makefile.am +++ b/libindicator/Makefile.am @@ -4,11 +4,19 @@ EXTRA_DIST = \ libindicatorincludedir=$(includedir)/libindicator-0.1/libindicator indicator_headers = \ - indicator.h + indicator.h \ + indicator-object.h libindicatorinclude_HEADERS = \ $(indicator_headers) +lib_LTLIBRARIES = \ + libindicator.la + +libindicator_la_SOURCES = \ + $(indicator_headers) \ + indicator-object.c + pkgconfig_DATA = indicator.pc pkgconfigdir = $(libdir)/pkgconfig -- cgit v1.2.3 From 24d025363c4a708c61acee26456a42a0b9a4b609 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 6 Oct 2009 16:32:23 -0400 Subject: Adding some pkg-config love to get things compiling all nice like. --- configure.ac | 13 +++++++++++++ libindicator/Makefile.am | 7 +++++++ 2 files changed, 20 insertions(+) (limited to 'libindicator/Makefile.am') diff --git a/configure.ac b/configure.ac index 70ef98b..fc7fcab 100644 --- a/configure.ac +++ b/configure.ac @@ -20,6 +20,19 @@ AC_CONFIG_MACRO_DIR([m4]) m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) +############################## +# Dependencies +############################## + +GLIB_REQUIRED_VERSION=2.18 +DBUS_REQUIRED_VERSION=0.76 + +PKG_CHECK_MODULES(LIBINDICATOR, glib-2.0 >= $GLIB_REQUIRED_VERSION + dbus-glib-1 >= $DBUS_REQUIRED_VERSION) + +AC_SUBST(LIBINDICATOR_CFLAGS) +AC_SUBST(LIBINDICATOR_LIBS) + ############################## # Custom Junk ############################## diff --git a/libindicator/Makefile.am b/libindicator/Makefile.am index 29b7bb5..db45f3c 100644 --- a/libindicator/Makefile.am +++ b/libindicator/Makefile.am @@ -17,6 +17,13 @@ libindicator_la_SOURCES = \ $(indicator_headers) \ indicator-object.c +libindicator_la_CFLAGS = \ + $(LIBINDICATOR_CFLAGS) \ + -Wall -Werror + +libindicator_la_LIBADD = \ + $(LIBINDICATOR_LIBS) + pkgconfig_DATA = indicator.pc pkgconfigdir = $(libdir)/pkgconfig -- cgit v1.2.3 From 606b4939df9845c82d92029abfe8403eb891a26b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 28 Oct 2009 16:58:19 -0500 Subject: Building ourselves a little dbus spec --- .bzrignore | 2 ++ libindicator/Makefile.am | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) (limited to 'libindicator/Makefile.am') diff --git a/.bzrignore b/.bzrignore index e81c2cd..0859cc8 100644 --- a/.bzrignore +++ b/.bzrignore @@ -117,3 +117,5 @@ tests/libdummy-indicator-blank.la tests/libdummy_indicator_blank_la-dummy-indicator-blank.lo libindicator-[0-9].[0-9].[0-9].tar.gz libindicator-[0-9].[0-9].[0-9].tar.gz.asc +libindicator/indicator-service-client.h +libindicator/indicator-service-server.h diff --git a/libindicator/Makefile.am b/libindicator/Makefile.am index db45f3c..6061ad8 100644 --- a/libindicator/Makefile.am +++ b/libindicator/Makefile.am @@ -1,3 +1,5 @@ +BUILT_SOURCES = +CLEANFILES = EXTRA_DIST = \ indicator.pc.in @@ -27,3 +29,31 @@ libindicator_la_LIBADD = \ pkgconfig_DATA = indicator.pc pkgconfigdir = $(libdir)/pkgconfig +################################## +# DBus Specs +################################## + +DBUS_SPECS = \ + indicator-service.xml + +%-client.h: %.xml + dbus-binding-tool \ + --prefix=_$(subst -,_,$(<:.xml=))_client \ + --mode=glib-client \ + --output=$@ \ + $< + +%-server.h: %.xml + dbus-binding-tool \ + --prefix=_$(subst -,_,$(<:.xml=))_server \ + --mode=glib-server \ + --output=$@ \ + $< + +BUILT_SOURCES += \ + $(DBUS_SPECS:.xml=-client.h) \ + $(DBUS_SPECS:.xml=-server.h) + +CLEANFILES += $(BUILT_SOURCES) + +EXTRA_DIST += $(DBUS_SPECS) -- cgit v1.2.3 From ba8af8211f01a5c470ac30275e907bc5a26be910 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 29 Oct 2009 09:27:05 -0500 Subject: Putting in some templated objects. --- .bzrignore | 2 ++ libindicator/Makefile.am | 8 +++-- libindicator/indicator-service-manager.c | 57 +++++++++++++++++++++++++++++++ libindicator/indicator-service-manager.h | 32 ++++++++++++++++++ libindicator/indicator-service.c | 58 ++++++++++++++++++++++++++++++++ libindicator/indicator-service.h | 33 ++++++++++++++++++ 6 files changed, 188 insertions(+), 2 deletions(-) create mode 100644 libindicator/indicator-service-manager.c create mode 100644 libindicator/indicator-service-manager.h create mode 100644 libindicator/indicator-service.c create mode 100644 libindicator/indicator-service.h (limited to 'libindicator/Makefile.am') diff --git a/.bzrignore b/.bzrignore index 0859cc8..0213668 100644 --- a/.bzrignore +++ b/.bzrignore @@ -119,3 +119,5 @@ libindicator-[0-9].[0-9].[0-9].tar.gz libindicator-[0-9].[0-9].[0-9].tar.gz.asc libindicator/indicator-service-client.h libindicator/indicator-service-server.h +libindicator/libindicator_la-indicator-service.lo +libindicator/libindicator_la-indicator-service-manager.lo diff --git a/libindicator/Makefile.am b/libindicator/Makefile.am index 6061ad8..cce87ca 100644 --- a/libindicator/Makefile.am +++ b/libindicator/Makefile.am @@ -7,7 +7,9 @@ libindicatorincludedir=$(includedir)/libindicator-0.1/libindicator indicator_headers = \ indicator.h \ - indicator-object.h + indicator-object.h \ + indicator-service.h \ + indicator-service-manager.h libindicatorinclude_HEADERS = \ $(indicator_headers) @@ -17,7 +19,9 @@ lib_LTLIBRARIES = \ libindicator_la_SOURCES = \ $(indicator_headers) \ - indicator-object.c + indicator-object.c \ + indicator-service.c \ + indicator-service-manager.c libindicator_la_CFLAGS = \ $(LIBINDICATOR_CFLAGS) \ diff --git a/libindicator/indicator-service-manager.c b/libindicator/indicator-service-manager.c new file mode 100644 index 0000000..6fd9a5b --- /dev/null +++ b/libindicator/indicator-service-manager.c @@ -0,0 +1,57 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "indicator-service-manager.h" + +typedef struct _IndicatorServiceManagerPrivate IndicatorServiceManagerPrivate; +struct _IndicatorServiceManagerPrivate { + int dummy; +}; + +#define INDICATOR_SERVICE_MANAGER_GET_PRIVATE(o) \ +(G_TYPE_INSTANCE_GET_PRIVATE ((o), INDICATOR_SERVICE_MANAGER_TYPE, IndicatorServiceManagerPrivate)) + +static void indicator_service_manager_class_init (IndicatorServiceManagerClass *klass); +static void indicator_service_manager_init (IndicatorServiceManager *self); +static void indicator_service_manager_dispose (GObject *object); +static void indicator_service_manager_finalize (GObject *object); + +G_DEFINE_TYPE (IndicatorServiceManager, indicator_service_manager, G_TYPE_OBJECT); + +static void +indicator_service_manager_class_init (IndicatorServiceManagerClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (IndicatorServiceManagerPrivate)); + + object_class->dispose = indicator_service_manager_dispose; + object_class->finalize = indicator_service_manager_finalize; + + + return; +} + +static void +indicator_service_manager_init (IndicatorServiceManager *self) +{ + + return; +} + +static void +indicator_service_manager_dispose (GObject *object) +{ + + G_OBJECT_CLASS (indicator_service_manager_parent_class)->dispose (object); + return; +} + +static void +indicator_service_manager_finalize (GObject *object) +{ + + G_OBJECT_CLASS (indicator_service_manager_parent_class)->finalize (object); + return; +} diff --git a/libindicator/indicator-service-manager.h b/libindicator/indicator-service-manager.h new file mode 100644 index 0000000..61c6e64 --- /dev/null +++ b/libindicator/indicator-service-manager.h @@ -0,0 +1,32 @@ +#ifndef __INDICATOR_SERVICE_MANAGER_H__ +#define __INDICATOR_SERVICE_MANAGER_H__ + +#include +#include + +G_BEGIN_DECLS + +#define INDICATOR_SERVICE_MANAGER_TYPE (indicator_service_manager_get_type ()) +#define INDICATOR_SERVICE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), INDICATOR_SERVICE_MANAGER_TYPE, IndicatorServiceManager)) +#define INDICATOR_SERVICE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), INDICATOR_SERVICE_MANAGER_TYPE, IndicatorServiceManagerClass)) +#define IS_INDICATOR_SERVICE_MANAGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), INDICATOR_SERVICE_MANAGER_TYPE)) +#define IS_INDICATOR_SERVICE_MANAGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), INDICATOR_SERVICE_MANAGER_TYPE)) +#define INDICATOR_SERVICE_MANAGER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), INDICATOR_SERVICE_MANAGER_TYPE, IndicatorServiceManagerClass)) + +typedef struct _IndicatorServiceManager IndicatorServiceManager; +typedef struct _IndicatorServiceManagerClass IndicatorServiceManagerClass; + +struct _IndicatorServiceManagerClass { + GObjectClass parent_class; + +}; + +struct _IndicatorServiceManager { + GObject parent; +}; + +GType indicator_service_manager_get_type (void); + +G_END_DECLS + +#endif diff --git a/libindicator/indicator-service.c b/libindicator/indicator-service.c new file mode 100644 index 0000000..089c9ad --- /dev/null +++ b/libindicator/indicator-service.c @@ -0,0 +1,58 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "indicator-service.h" + +typedef struct _IndicatorServicePrivate IndicatorServicePrivate; + +struct _IndicatorServicePrivate { + int dummy; +}; + +#define INDICATOR_SERVICE_GET_PRIVATE(o) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((o), INDICATOR_SERVICE_TYPE, IndicatorServicePrivate)) + +static void indicator_service_class_init (IndicatorServiceClass *klass); +static void indicator_service_init (IndicatorService *self); +static void indicator_service_dispose (GObject *object); +static void indicator_service_finalize (GObject *object); + +G_DEFINE_TYPE (IndicatorService, indicator_service, G_TYPE_OBJECT); + +static void +indicator_service_class_init (IndicatorServiceClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (IndicatorServicePrivate)); + + object_class->dispose = indicator_service_dispose; + object_class->finalize = indicator_service_finalize; + + + return; +} + +static void +indicator_service_init (IndicatorService *self) +{ + + return; +} + +static void +indicator_service_dispose (GObject *object) +{ + + G_OBJECT_CLASS (indicator_service_parent_class)->dispose (object); + return; +} + +static void +indicator_service_finalize (GObject *object) +{ + + G_OBJECT_CLASS (indicator_service_parent_class)->finalize (object); + return; +} diff --git a/libindicator/indicator-service.h b/libindicator/indicator-service.h new file mode 100644 index 0000000..0cec28c --- /dev/null +++ b/libindicator/indicator-service.h @@ -0,0 +1,33 @@ +#ifndef __INDICATOR_SERVICE_H__ +#define __INDICATOR_SERVICE_H__ + +#include +#include + +G_BEGIN_DECLS + +#define INDICATOR_SERVICE_TYPE (indicator_service_get_type ()) +#define INDICATOR_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), INDICATOR_SERVICE_TYPE, IndicatorService)) +#define INDICATOR_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), INDICATOR_SERVICE_TYPE, IndicatorServiceClass)) +#define IS_INDICATOR_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), INDICATOR_SERVICE_TYPE)) +#define IS_INDICATOR_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), INDICATOR_SERVICE_TYPE)) +#define INDICATOR_SERVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), INDICATOR_SERVICE_TYPE, IndicatorServiceClass)) + +typedef struct _IndicatorService IndicatorService; +typedef struct _IndicatorServiceClass IndicatorServiceClass; + +struct _IndicatorServiceClass { + GObjectClass parent_class; + +}; + +struct _IndicatorService { + GObject parent; + +}; + +GType indicator_service_get_type (void); + +G_END_DECLS + +#endif -- cgit v1.2.3 From 82aaaed9788d56fa2739da70621e56f1e21ec0a8 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 29 Oct 2009 16:29:47 -0500 Subject: Adding in some shared strings for finding intefaces and objects. --- libindicator/Makefile.am | 1 + libindicator/dbus-shared.h | 4 ++++ libindicator/indicator-service.c | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 libindicator/dbus-shared.h (limited to 'libindicator/Makefile.am') diff --git a/libindicator/Makefile.am b/libindicator/Makefile.am index cce87ca..209b787 100644 --- a/libindicator/Makefile.am +++ b/libindicator/Makefile.am @@ -19,6 +19,7 @@ lib_LTLIBRARIES = \ libindicator_la_SOURCES = \ $(indicator_headers) \ + dbus-shared.h \ indicator-object.c \ indicator-service.c \ indicator-service-manager.c diff --git a/libindicator/dbus-shared.h b/libindicator/dbus-shared.h new file mode 100644 index 0000000..f64588c --- /dev/null +++ b/libindicator/dbus-shared.h @@ -0,0 +1,4 @@ + +#define INDICATOR_SERVICE_INTERFACE "org.ayatana.indicator.service" +#define INDICATOR_SERVICE_OBJECT "/org/ayatana/indicator/service" + diff --git a/libindicator/indicator-service.c b/libindicator/indicator-service.c index 125ecfc..eef916b 100644 --- a/libindicator/indicator-service.c +++ b/libindicator/indicator-service.c @@ -9,6 +9,7 @@ void _indicator_service_server_watch (void); #include "indicator-service-server.h" +#include "dbus-shared.h" /* Private Stuff */ typedef struct _IndicatorServicePrivate IndicatorServicePrivate; @@ -129,7 +130,7 @@ indicator_service_init (IndicatorService *self) } dbus_g_connection_register_g_object(session_bus, - "/need/a/path", + INDICATOR_SERVICE_OBJECT, G_OBJECT(self)); return; -- cgit v1.2.3 From 90446e0f46aec726341a8e178bfa65ddcb057deb Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 2 Nov 2009 10:48:18 -0600 Subject: Fixing up the build rules so that they're directory independent. --- libindicator/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libindicator/Makefile.am') diff --git a/libindicator/Makefile.am b/libindicator/Makefile.am index 209b787..5c512cd 100644 --- a/libindicator/Makefile.am +++ b/libindicator/Makefile.am @@ -43,14 +43,14 @@ DBUS_SPECS = \ %-client.h: %.xml dbus-binding-tool \ - --prefix=_$(subst -,_,$(<:.xml=))_client \ + --prefix=_$(subst -,_,$(basename $(notdir $<)))_client \ --mode=glib-client \ --output=$@ \ $< %-server.h: %.xml dbus-binding-tool \ - --prefix=_$(subst -,_,$(<:.xml=))_server \ + --prefix=_$(subst -,_,$(basename $(notdir $<)))_server \ --mode=glib-server \ --output=$@ \ $< -- cgit v1.2.3