From 7d84b5488b307ede744df763eb707c95f8f1f592 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 7 May 2012 20:04:36 +0100 Subject: [PATCH 8/8] Remove generated marshallers, just use g_cclosure_marshal_generic --- configure.ac | 3 -- extensions/Makefile.am | 13 --------- src/Makefile.am | 18 +----------- src/idle-server-connection.c | 3 +- tools/Makefile.am | 4 --- tools/glib-signals-marshal-gen.py | 55 ------------------------------------- 6 files changed, 2 insertions(+), 94 deletions(-) delete mode 100644 tools/glib-signals-marshal-gen.py diff --git a/configure.ac b/configure.ac index 6cf1d8d..f4510dc 100644 --- a/configure.ac +++ b/configure.ac @@ -79,9 +79,6 @@ PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.30.0, gobject-2.0 >= 2.30.0, gio-2.0 >= 2 AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) -GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` -AC_SUBST(GLIB_GENMARSHAL) - dnl Check for D-Bus PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.51, dbus-glib-1 >= 0.51]) diff --git a/extensions/Makefile.am b/extensions/Makefile.am index 4159788..03c073d 100644 --- a/extensions/Makefile.am +++ b/extensions/Makefile.am @@ -10,9 +10,6 @@ libidle_extensions_la_SOURCES = \ extensions.h nodist_libidle_extensions_la_SOURCES = \ - _gen/signals-marshal.c \ - _gen/signals-marshal.h \ - _gen/signals-marshal.list \ _gen/enums.h \ _gen/interfaces.h \ _gen/svc.h \ @@ -49,20 +46,10 @@ _gen/svc.c _gen/svc.h: _gen/all.xml \ $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-ginterface-gen.py \ --filename=_gen/svc --signal-marshal-prefix=_idle_ext \ --include='' \ - --include='"_gen/signals-marshal.h"' \ --not-implemented-func='tp_dbus_g_method_return_not_implemented' \ --allow-unstable \ $< Idle_Svc_ -_gen/signals-marshal.list: _gen/all.xml $(tools_dir)/glib-signals-marshal-gen.py - $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-signals-marshal-gen.py $< > $@ - -_gen/signals-marshal.h: _gen/signals-marshal.list - $(AM_V_GEN)$(GLIB_GENMARSHAL) --header --prefix=_idle_ext_marshal $< > $@ - -_gen/signals-marshal.c: _gen/signals-marshal.list - $(AM_V_GEN)$(GLIB_GENMARSHAL) --body --prefix=_idle_ext_marshal $< > $@ - _gen/enums.h: _gen/all.xml $(tools_dir)/c-constants-generator.xsl $(AM_V_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) \ --stringparam mixed-case-prefix Idle \ diff --git a/src/Makefile.am b/src/Makefile.am index 67be3e6..466a362 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,3 @@ -BUILT_SOURCES = \ - idle-server-connection-signals-marshal.h \ - idle-server-connection-signals-marshal.c - # correctly clean the generated source files CLEANFILES = $(BUILT_SOURCES) $(man_MANS) @@ -36,7 +32,7 @@ libidle_convenience_la_SOURCES = \ idle-server-connection.h \ idle-text.h \ idle-text.c \ - idle-server-connection-signals-marshal.list + $(NULL) nodist_libidle_convenience_la_SOURCES = \ $(BUILT_SOURCES) @@ -69,18 +65,6 @@ ALL_LIBS = \ @OPENSSL_LIBS@ \ @TELEPATHY_LIBS@ -%-signals-marshal.h: %-signals-marshal.list Makefile - $(AM_V_GEN)glib-genmarshal --header --prefix=$(subst -,_,$*)_marshal $< > $*-signals-marshal.h - -%-signals-marshal.c: %-signals-marshal.list Makefile - $(AM_V_GEN)glib-genmarshal --body --prefix=$(subst -,_,$*)_marshal $< > $*-signals-marshal.c - -%-marshal.h: %-marshal.list Makefile - $(AM_V_GEN)glib-genmarshal --header --prefix=$(subst -,_,$*)_marshal $< > $*-marshal.h - -%-marshal.c: %-marshal.list Makefile - $(AM_V_GEN)glib-genmarshal --body --prefix=$(subst -,_,$*)_marshal $< > $*-marshal.c - man_MANS = telepathy-idle.8 EXTRA_DIST = telepathy-idle.8.in diff --git a/src/idle-server-connection.c b/src/idle-server-connection.c index 43e81f3..0975838 100644 --- a/src/idle-server-connection.c +++ b/src/idle-server-connection.c @@ -31,7 +31,6 @@ #define IDLE_DEBUG_FLAG IDLE_DEBUG_NETWORK #include "idle-connection.h" #include "idle-debug.h" -#include "idle-server-connection-signals-marshal.h" typedef struct _IdleServerConnectionPrivate IdleServerConnectionPrivate; @@ -188,7 +187,7 @@ static void idle_server_connection_class_init(IdleServerConnectionClass *klass) G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED, 0, NULL, NULL, - idle_server_connection_marshal_VOID__UINT_UINT, + g_cclosure_marshal_generic, G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); signals[RECEIVED] = g_signal_new("received", diff --git a/tools/Makefile.am b/tools/Makefile.am index 788e956..7b4106d 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -3,7 +3,6 @@ EXTRA_DIST = \ c-interfaces-generator.xsl \ doc-generator.xsl \ glib-ginterface-gen.py \ - glib-signals-marshal-gen.py \ identity.xsl \ libglibcodegen.py \ libtpcodegen.py \ @@ -11,8 +10,5 @@ EXTRA_DIST = \ CLEANFILES = libglibcodegen.pyc libglibcodegen.pyo -glib-ginterface-gen.py: libglibcodegen.py - touch $@ - glib-ginterface-gen.py: libglibcodegen.py libtpcodegen.py touch $@ diff --git a/tools/glib-signals-marshal-gen.py b/tools/glib-signals-marshal-gen.py deleted file mode 100644 index 0d02c13..0000000 --- a/tools/glib-signals-marshal-gen.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/python - -import sys -import xml.dom.minidom -from string import ascii_letters, digits - - -from libglibcodegen import signal_to_marshal_name, method_to_glue_marshal_name - - -class Generator(object): - - def __init__(self, dom): - self.dom = dom - self.marshallers = {} - - def do_method(self, method): - marshaller = method_to_glue_marshal_name(method, 'PREFIX') - - assert '__' in marshaller - rhs = marshaller.split('__', 1)[1].split('_') - - self.marshallers[marshaller] = rhs - - def do_signal(self, signal): - marshaller = signal_to_marshal_name(signal, 'PREFIX') - - assert '__' in marshaller - rhs = marshaller.split('__', 1)[1].split('_') - - self.marshallers[marshaller] = rhs - - def __call__(self): - methods = self.dom.getElementsByTagName('method') - - for method in methods: - self.do_method(method) - - signals = self.dom.getElementsByTagName('signal') - - for signal in signals: - self.do_signal(signal) - - all = self.marshallers.keys() - all.sort() - for marshaller in all: - rhs = self.marshallers[marshaller] - if not marshaller.startswith('g_cclosure'): - print 'VOID:' + ','.join(rhs) - -if __name__ == '__main__': - argv = sys.argv[1:] - dom = xml.dom.minidom.parse(argv[0]) - - Generator(dom)() -- 1.7.10