aboutsummaryrefslogtreecommitdiffstats
path: root/tools/glib-client-gen.py
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-11-22 00:23:11 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-11-22 00:23:11 +0800
commitabb968c6cdc50023b248b328a403444e644619bc (patch)
tree677efd848554bd613de1f09f01d3146d1c911288 /tools/glib-client-gen.py
parent52bc77159e915ea52e32b4d7873aa644f885a859 (diff)
downloadgsoc2013-empathy-abb968c6cdc50023b248b328a403444e644619bc.tar
gsoc2013-empathy-abb968c6cdc50023b248b328a403444e644619bc.tar.gz
gsoc2013-empathy-abb968c6cdc50023b248b328a403444e644619bc.tar.bz2
gsoc2013-empathy-abb968c6cdc50023b248b328a403444e644619bc.tar.lz
gsoc2013-empathy-abb968c6cdc50023b248b328a403444e644619bc.tar.xz
gsoc2013-empathy-abb968c6cdc50023b248b328a403444e644619bc.tar.zst
gsoc2013-empathy-abb968c6cdc50023b248b328a403444e644619bc.zip
Update tools to latest version of tp-glib and include a gitignore
svn path=/trunk/; revision=1883
Diffstat (limited to 'tools/glib-client-gen.py')
-rw-r--r--tools/glib-client-gen.py35
1 files changed, 27 insertions, 8 deletions
diff --git a/tools/glib-client-gen.py b/tools/glib-client-gen.py
index e096395c5..701fcafeb 100644
--- a/tools/glib-client-gen.py
+++ b/tools/glib-client-gen.py
@@ -57,9 +57,13 @@ class Generator(object):
self.proxy_arg = 'gpointer '
def h(self, s):
+ if isinstance(s, unicode):
+ s = s.encode('utf-8')
self.__header.append(s)
def b(self, s):
+ if isinstance(s, unicode):
+ s = s.encode('utf-8')
self.__body.append(s)
def get_iface_quark(self):
@@ -656,13 +660,18 @@ class Generator(object):
self.b(' * @%s: Used to pass an \'in\' argument: %s'
% (name, xml_escape(get_docstring(elt) or '(Undocumented)')))
- self.b(' * @callback: called when the method call succeeds or fails')
- self.b(' * @user_data: user-supplied data passed to the callback')
+ self.b(' * @callback: called when the method call succeeds or fails;')
+ self.b(' * may be %NULL to make a "fire and forget" call with no ')
+ self.b(' * reply tracking')
+ self.b(' * @user_data: user-supplied data passed to the callback;')
+ self.b(' * must be %NULL if @callback is %NULL')
self.b(' * @destroy: called with the user_data as argument, after the')
- self.b(' * call has succeeded, failed or been cancelled')
- self.b(' * @weak_object: A #GObject which will be weakly referenced; ')
- self.b(' * if it is destroyed, this callback will automatically be')
- self.b(' * disconnected')
+ self.b(' * call has succeeded, failed or been cancelled;')
+ self.b(' * must be %NULL if @callback is %NULL')
+ self.b(' * @weak_object: If not %NULL, a #GObject which will be ')
+ self.b(' * weakly referenced; if it is destroyed, this call ')
+ self.b(' * will automatically be cancelled. Must be %NULL if ')
+ self.b(' * @callback is %NULL')
self.b(' *')
self.b(' * Start a %s method call.' % member)
self.b(' *')
@@ -703,6 +712,12 @@ class Generator(object):
self.b('')
self.b(' g_return_val_if_fail (%s (proxy), NULL);'
% self.proxy_assert)
+ self.b(' g_return_val_if_fail (callback != NULL || '
+ 'user_data == NULL, NULL);')
+ self.b(' g_return_val_if_fail (callback != NULL || '
+ 'destroy == NULL, NULL);')
+ self.b(' g_return_val_if_fail (callback != NULL || '
+ 'weak_object == NULL, NULL);')
self.b('')
self.b(' iface = tp_proxy_borrow_interface_by_id (')
self.b(' (TpProxy *) proxy,')
@@ -723,6 +738,10 @@ class Generator(object):
self.b(' 0,')
self.b(' error, user_data, weak_object);')
+ self.b('')
+ self.b(' if (destroy != NULL)')
+ self.b(' destroy (user_data);')
+ self.b('')
self.b(' g_error_free (error);')
self.b(' return NULL;')
self.b(' }')
@@ -794,8 +813,8 @@ class Generator(object):
self.b(' %s*%s;' % (ctype, name))
- self.b(' gboolean success:1;')
- self.b(' gboolean completed:1;')
+ self.b(' unsigned success:1;')
+ self.b(' unsigned completed:1;')
self.b('} _%s_%s_run_state_%s;'
% (self.prefix_lc, iface_lc, member_lc))