summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2008-01-15 12:04:56 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2008-01-15 12:04:56 +0000
commit0b5efac1c4c65818e9ffa70f186277aabac0dc33 (patch)
treee37f1b0cd6f9e2a2a43c9a8f09ccaef0e5015f74 /tools
parenteff2352b333bb41edb60ab683c010934db4a9fc4 (diff)
downloadtelepathy-glib-0b5efac1c4c65818e9ffa70f186277aabac0dc33.tar.gz
Add an argument to tp_cli_*_run_*, through which the TpProxyPendingCall is written, to allow for cancellation
20080115120456-53eee-22bd9a569a71769999f126aaf62905f566fd63a8.gz
Diffstat (limited to 'tools')
-rw-r--r--tools/glib-client-gen.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/tools/glib-client-gen.py b/tools/glib-client-gen.py
index 2e4da95b0..44b3621f1 100644
--- a/tools/glib-client-gen.py
+++ b/tools/glib-client-gen.py
@@ -764,7 +764,8 @@ class Generator(object):
# gint timeout_ms,
# const GArray *in_properties,
# GPtrArray **out0,
- # GError **error);
+ # GError **error,
+ # TpProxyPendingCall **pending_call);
self.b('typedef struct {')
self.b(' GMainLoop *loop;')
@@ -864,7 +865,13 @@ class Generator(object):
'returned: <![CDATA[%s]]>'
% (name, get_docstring(elt) or '(Undocumented)'))
- self.b(' * @error: Used to return errors if %FALSE is returned')
+ self.b(' * @error: If not %NULL, used to return errors if %FALSE ')
+ self.b(' * is returned')
+ self.b(' * @pending_call: If not %NULL, set before re-entering ')
+ self.b(' * the main loop, to point to a #TpProxyPendingCall ')
+ self.b(' * which can be used to cancel this call with ')
+ self.b(' * tp_proxy_pending_call_cancel(), causing a return of ')
+ self.b(' * %FALSE with @error set to %TP_DBUS_ERROR_CANCELLED')
self.b(' *')
self.b(' * Call the method %s and run the main loop' % member)
self.b(' * until it returns. Before calling this method, you must')
@@ -897,10 +904,12 @@ class Generator(object):
self.h(' %s*%s,' % (ctype, name))
self.b(' %s*%s,' % (ctype, name))
- self.h(' GError **error);')
+ self.h(' GError **error,')
+ self.h(' TpProxyPendingCall **pending_call);')
self.h('')
- self.b(' GError **error)')
+ self.b(' GError **error,')
+ self.b(' TpProxyPendingCall **pending_call)')
self.b('{')
self.b(' DBusGProxy *iface;')
self.b(' GQuark interface = %s;' % self.get_iface_quark())
@@ -932,6 +941,9 @@ class Generator(object):
self.b(' %s,' % reentrant_invoke)
self.b(' NULL, &state, NULL, NULL, TRUE);')
self.b('')
+ self.b(' if (pending_call != NULL)')
+ self.b(' *pending_call = pc;')
+ self.b('')
self.b(' tp_proxy_pending_call_v0_take_pending_call (pc,')
self.b(' dbus_g_proxy_begin_call_with_timeout (iface,')
self.b(' "%s",' % member)