From 2209cb8604a929a6f1af5cec4991388ad32a7d1c Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 6 Dec 2010 09:50:21 -0600 Subject: Changing to not use the dbus binding tool but to instead turn the XML files into pseudo-C --- src/Makefile.am | 36 ++++++++++++++---------------------- 1 file changed, 14 insertions(+), 22 deletions(-) (limited to 'src/Makefile.am') diff --git a/src/Makefile.am b/src/Makefile.am index 073fc41..ce83951 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -54,10 +54,6 @@ libappindicatorinclude_HEADERS = \ $(libappindicator_headers) \ $(glib_enum_h) -BUILT_SOURCES += \ - notification-watcher-client.h \ - notification-item-server.h - libappindicator_la_SOURCES = \ $(libappindicator_headers) \ app-indicator-enum-types.c \ @@ -65,7 +61,11 @@ libappindicator_la_SOURCES = \ application-service-marshal.c \ dbus-shared.h \ generate-id.h \ - generate-id.c + generate-id.c \ + notification-item.xml.h \ + notification-item.xml.c \ + notification-watcher.xml.h \ + notification-watcher.xml.c libappindicator_la_LDFLAGS = \ -version-info 1:0:0 \ @@ -99,25 +99,17 @@ DBUS_SPECS = \ notification-item.xml \ notification-watcher.xml -%-client.h: %.xml - dbus-binding-tool \ - --prefix=_$(notdir $(subst -,_,$(<:.xml=)))_client \ - --mode=glib-client \ - --output=$@ \ - $< - -%-server.h: %.xml - dbus-binding-tool \ - --prefix=_$(notdir $(subst -,_,$(<:.xml=)))_server \ - --mode=glib-server \ - --output=$@ \ - $< +%.xml.h: %.xml + echo "extern const char * $(subst -,_,$(subst .,_,$(basename $@)));" > $@ -BUILT_SOURCES += \ - $(DBUS_SPECS:.xml=-client.h) \ - $(DBUS_SPECS:.xml=-server.h) +%.xml.c: %.xml + echo "const char * $(subst -,_,$(subst .,_,$(basename $@))) = " > $@ + sed -e "s:\":\\\\\":g" -e s:^:\": -e s:\$$:\\\\n\": $< >> $@ + echo ";" >> $@ -CLEANFILES += $(BUILT_SOURCES) +CLEANFILES += \ + $(DBUS_SPECS:.xml=.xml.h) \ + $(DBUS_SPECS:.xml=.xml.c) EXTRA_DIST += $(DBUS_SPECS) -- cgit v1.2.3 From f590403207e1f675983c90188c1d8d24ebb1d0c1 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 6 Dec 2010 10:07:01 -0600 Subject: Entirely unsure why this makes things better, but well, it does. --- src/Makefile.am | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/Makefile.am') diff --git a/src/Makefile.am b/src/Makefile.am index ce83951..673938b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -100,12 +100,20 @@ DBUS_SPECS = \ notification-watcher.xml %.xml.h: %.xml - echo "extern const char * $(subst -,_,$(subst .,_,$(basename $@)));" > $@ + @echo "Building $@ from $<" + @echo "extern const char * $(subst -,_,$(subst .,_,$(basename $@)));" > $@ %.xml.c: %.xml - echo "const char * $(subst -,_,$(subst .,_,$(basename $@))) = " > $@ - sed -e "s:\":\\\\\":g" -e s:^:\": -e s:\$$:\\\\n\": $< >> $@ - echo ";" >> $@ + @echo "Building $@ from $<" + @echo "const char * $(subst -,_,$(subst .,_,$(basename $@))) = " > $@ + @sed -e "s:\":\\\\\":g" -e s:^:\": -e s:\$$:\\\\n\": $< >> $@ + @echo ";" >> $@ + +BUILT_SOURCES += \ + notification-item.xml.c \ + notification-item.xml.h \ + notification-watcher.xml.c \ + notification-watcher.xml.h CLEANFILES += \ $(DBUS_SPECS:.xml=.xml.h) \ -- cgit v1.2.3 From 07aeca3802b2e19878b24637f1f73d971c7be101 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 6 Dec 2010 16:38:29 -0600 Subject: Switching the names of the generated files to stop automake from thinking it needs to build the XML files. --- src/Makefile.am | 30 ++++++++++++++++-------------- src/app-indicator.c | 8 ++++---- 2 files changed, 20 insertions(+), 18 deletions(-) (limited to 'src/Makefile.am') diff --git a/src/Makefile.am b/src/Makefile.am index 673938b..5b6adc2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -62,10 +62,10 @@ libappindicator_la_SOURCES = \ dbus-shared.h \ generate-id.h \ generate-id.c \ - notification-item.xml.h \ - notification-item.xml.c \ - notification-watcher.xml.h \ - notification-watcher.xml.c + gen-notification-item.xml.h \ + gen-notification-item.xml.c \ + gen-notification-watcher.xml.h \ + gen-notification-watcher.xml.c libappindicator_la_LDFLAGS = \ -version-info 1:0:0 \ @@ -99,25 +99,27 @@ DBUS_SPECS = \ notification-item.xml \ notification-watcher.xml -%.xml.h: %.xml +gen-%.xml.h: %.xml @echo "Building $@ from $<" - @echo "extern const char * $(subst -,_,$(subst .,_,$(basename $@)));" > $@ + @echo "extern const char * $(subst -,_,$(subst .,_,$(basename $<)));" > $@ -%.xml.c: %.xml +gen-%.xml.c: %.xml @echo "Building $@ from $<" - @echo "const char * $(subst -,_,$(subst .,_,$(basename $@))) = " > $@ + @echo "const char * $(subst -,_,$(subst .,_,$(basename $<))) = " > $@ @sed -e "s:\":\\\\\":g" -e s:^:\": -e s:\$$:\\\\n\": $< >> $@ @echo ";" >> $@ BUILT_SOURCES += \ - notification-item.xml.c \ - notification-item.xml.h \ - notification-watcher.xml.c \ - notification-watcher.xml.h + gen-notification-item.xml.c \ + gen-notification-item.xml.h \ + gen-notification-watcher.xml.c \ + gen-notification-watcher.xml.h CLEANFILES += \ - $(DBUS_SPECS:.xml=.xml.h) \ - $(DBUS_SPECS:.xml=.xml.c) + gen-notification-item.xml.c \ + gen-notification-item.xml.h \ + gen-notification-watcher.xml.c \ + gen-notification-watcher.xml.h EXTRA_DIST += $(DBUS_SPECS) diff --git a/src/app-indicator.c b/src/app-indicator.c index 0b31018..0d469ac 100644 --- a/src/app-indicator.c +++ b/src/app-indicator.c @@ -48,8 +48,8 @@ License version 3 and version 2.1 along with this program. If not, see #include "app-indicator-enum-types.h" #include "application-service-marshal.h" -#include "notification-watcher.xml.h" -#include "notification-item.xml.h" +#include "gen-notification-watcher.xml.h" +#include "gen-notification-item.xml.h" #include "dbus-shared.h" #include "generate-id.h" @@ -561,7 +561,7 @@ app_indicator_class_init (AppIndicatorClass *klass) if (item_node_info == NULL) { GError * error = NULL; - item_node_info = g_dbus_node_info_new_for_xml(notification_item_xml, &error); + item_node_info = g_dbus_node_info_new_for_xml(notification_item, &error); if (error != NULL) { g_error("Unable to parse Notification Item DBus interface: %s", error->message); g_error_free(error); @@ -579,7 +579,7 @@ app_indicator_class_init (AppIndicatorClass *klass) if (watcher_node_info == NULL) { GError * error = NULL; - watcher_node_info = g_dbus_node_info_new_for_xml(notification_watcher_xml, &error); + watcher_node_info = g_dbus_node_info_new_for_xml(notification_watcher, &error); if (error != NULL) { g_error("Unable to parse Notification Item DBus interface: %s", error->message); g_error_free(error); -- cgit v1.2.3 From 41edd6b1dd171d887fe6bc860a1451358b630add Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 8 Dec 2010 11:00:54 -0600 Subject: Adding in some '_' so that the symbols don't get exported in the library. --- src/Makefile.am | 4 ++-- src/app-indicator.c | 6 +++--- src/generate-id.c | 2 +- src/generate-id.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/Makefile.am') diff --git a/src/Makefile.am b/src/Makefile.am index 5b6adc2..a5ea29b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -101,11 +101,11 @@ DBUS_SPECS = \ gen-%.xml.h: %.xml @echo "Building $@ from $<" - @echo "extern const char * $(subst -,_,$(subst .,_,$(basename $<)));" > $@ + @echo "extern const char * _$(subst -,_,$(subst .,_,$(basename $<)));" > $@ gen-%.xml.c: %.xml @echo "Building $@ from $<" - @echo "const char * $(subst -,_,$(subst .,_,$(basename $<))) = " > $@ + @echo "const char * _$(subst -,_,$(subst .,_,$(basename $<))) = " > $@ @sed -e "s:\":\\\\\":g" -e s:^:\": -e s:\$$:\\\\n\": $< >> $@ @echo ";" >> $@ diff --git a/src/app-indicator.c b/src/app-indicator.c index 2b45b85..404d69d 100644 --- a/src/app-indicator.c +++ b/src/app-indicator.c @@ -477,7 +477,7 @@ app_indicator_class_init (AppIndicatorClass *klass) if (item_node_info == NULL) { GError * error = NULL; - item_node_info = g_dbus_node_info_new_for_xml(notification_item, &error); + item_node_info = g_dbus_node_info_new_for_xml(_notification_item, &error); if (error != NULL) { g_error("Unable to parse Notification Item DBus interface: %s", error->message); g_error_free(error); @@ -495,7 +495,7 @@ app_indicator_class_init (AppIndicatorClass *klass) if (watcher_node_info == NULL) { GError * error = NULL; - watcher_node_info = g_dbus_node_info_new_for_xml(notification_watcher, &error); + watcher_node_info = g_dbus_node_info_new_for_xml(_notification_watcher, &error); if (error != NULL) { g_error("Unable to parse Notification Item DBus interface: %s", error->message); g_error_free(error); @@ -2300,7 +2300,7 @@ app_indicator_get_ordering_index (AppIndicator *self) g_return_val_if_fail (IS_APP_INDICATOR (self), 0); if (self->priv->ordering_index == 0) { - return generate_id(self->priv->category, self->priv->id); + return _generate_id(self->priv->category, self->priv->id); } else { return self->priv->ordering_index; } diff --git a/src/generate-id.c b/src/generate-id.c index 14d762e..6389678 100644 --- a/src/generate-id.c +++ b/src/generate-id.c @@ -24,7 +24,7 @@ with this program. If not, see . #define MULTIPLIER 32 guint32 -generate_id (const AppIndicatorCategory catenum, const gchar * id) +_generate_id (const AppIndicatorCategory catenum, const gchar * id) { guchar category = 0; guchar first = 0; diff --git a/src/generate-id.h b/src/generate-id.h index 9d3167d..2c31921 100644 --- a/src/generate-id.h +++ b/src/generate-id.h @@ -25,6 +25,6 @@ with this program. If not, see . #include #include "app-indicator.h" -guint32 generate_id (const AppIndicatorCategory category, const gchar * id); +guint32 _generate_id (const AppIndicatorCategory category, const gchar * id); #endif /* __GENERATE_ID_H__ */ -- cgit v1.2.3