summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2007-11-26 16:44:31 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2007-11-26 16:44:31 +0000
commit40ff5a7c3753a1788b7430fa55995bae2d61a37f (patch)
tree581cd67279ae80b400854fed797ba154cb5cb772 /tools
parent9bf8cf916864127cc708ce555f93ade0f1cb1e29 (diff)
libglibcodegen.py: Add method_to_glue_marshal_name(), which returns the marshaller names used in dbus-glib glue code
Diffstat (limited to 'tools')
-rw-r--r--tools/libglibcodegen.py30
1 files changed, 25 insertions, 5 deletions
diff --git a/tools/libglibcodegen.py b/tools/libglibcodegen.py
index c1929e405..20ce45554 100644
--- a/tools/libglibcodegen.py
+++ b/tools/libglibcodegen.py
@@ -129,11 +129,13 @@ def signal_to_marshal_type(signal):
return mtype
+_glib_marshallers = ['VOID', 'BOOLEAN', 'CHAR', 'UCHAR', 'INT',
+ 'STRING', 'UINT', 'LONG', 'ULONG', 'ENUM', 'FLAGS', 'FLOAT',
+ 'DOUBLE', 'STRING', 'PARAM', 'BOXED', 'POINTER', 'OBJECT',
+ 'UINT_POINTER']
+
+
def signal_to_marshal_name(signal, prefix):
- glib_marshallers = ['VOID', 'BOOLEAN', 'CHAR', 'UCHAR', 'INT',
- 'STRING', 'UINT', 'LONG', 'ULONG', 'ENUM', 'FLAGS', 'FLOAT',
- 'DOUBLE', 'STRING', 'PARAM', 'BOXED', 'POINTER', 'OBJECT',
- 'UINT_POINTER']
mtype = signal_to_marshal_type(signal)
if len(mtype):
@@ -141,7 +143,25 @@ def signal_to_marshal_name(signal, prefix):
else:
name = 'VOID'
- if name in glib_marshallers:
+ if name in _glib_marshallers:
+ return 'g_cclosure_marshal_VOID__' + name
+ else:
+ return prefix + '_marshal_VOID__' + name
+
+
+def method_to_glue_marshal_name(method, prefix):
+
+ mtype = []
+ for i in method.getElementsByTagName("arg"):
+ if i.getAttribute("direction") != "out":
+ type = i.getAttribute("type")
+ mtype.append(type_to_gtype(type)[2])
+
+ mtype.append('POINTER')
+
+ name = '_'.join(mtype)
+
+ if name in _glib_marshallers:
return 'g_cclosure_marshal_VOID__' + name
else:
return prefix + '_marshal_VOID__' + name