From f6bc5ac04eab4b986760613df559ca8cbd2a62a2 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 23 Feb 2012 15:30:40 +0000 Subject: [PATCH 2/4] Generate code that uses g_cclosure_marshal_generic() --- tools/glib-client-marshaller-gen.py | 3 ++- tools/glib-ginterface-gen.py | 9 +++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/tools/glib-client-marshaller-gen.py b/tools/glib-client-marshaller-gen.py index 5444725..cb27d63 100644 --- a/tools/glib-client-marshaller-gen.py +++ b/tools/glib-client-marshaller-gen.py @@ -40,7 +40,8 @@ class Generator(object): for marshaller in all: rhs = self.marshallers[marshaller] - print ' dbus_g_object_register_marshaller (%s,' % marshaller + print ' dbus_g_object_register_marshaller (' + print ' g_cclosure_marshal_generic,' print ' G_TYPE_NONE, /* return */' for type in rhs: print ' G_TYPE_%s,' % type.replace('VOID', 'NONE') diff --git a/tools/glib-ginterface-gen.py b/tools/glib-ginterface-gen.py index e277b91..cc4e1f0 100644 --- a/tools/glib-ginterface-gen.py +++ b/tools/glib-ginterface-gen.py @@ -27,8 +27,7 @@ import os.path import xml.dom.minidom from libglibcodegen import Signature, type_to_gtype, cmp_by_name, \ - NS_TP, dbus_gutils_wincaps_to_uscore, \ - signal_to_marshal_name, method_to_glue_marshal_name + NS_TP, dbus_gutils_wincaps_to_uscore NS_TP = "http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" @@ -421,8 +420,7 @@ class Generator(object): 'not match' % (method.getAttribute('name'), lc_name)) lc_name = lc_name.lower() - marshaller = method_to_glue_marshal_name(method, - self.signal_marshal_prefix) + marshaller = 'g_cclosure_marshal_generic' wrapper = self.prefix_ + self.node_name_lc + '_' + lc_name self.b(" { (GCallback) %s, %s, %d }," % (wrapper, marshaller, offset)) @@ -717,8 +715,7 @@ class Generator(object): in_base_init.append(' G_SIGNAL_RUN_LAST|G_SIGNAL_DETAILED,') in_base_init.append(' 0,') in_base_init.append(' NULL, NULL,') - in_base_init.append(' %s,' - % signal_to_marshal_name(signal, self.signal_marshal_prefix)) + in_base_init.append(' g_cclosure_marshal_generic,') in_base_init.append(' G_TYPE_NONE,') tmp = ['%d' % len(args)] + [gtype for (ctype, name, gtype) in args] in_base_init.append(' %s);' % ',\n '.join(tmp)) -- 1.7.9.1