4
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
5
<title>ibuspendingcall</title>
6
6
<meta name="generator" content="DocBook XSL Stylesheets V1.74.3">
7
<link rel="home" href="index.html" title="iBus Reference Manual">
8
<link rel="up" href="ch05.html" title="Others">
7
<link rel="home" href="index.html" title="IBus Reference Manual">
8
<link rel="up" href="ch04.html" title="Communication and Configuration">
9
9
<link rel="prev" href="IBusObservedPath.html" title="IBusObservedPath">
10
10
<link rel="next" href="IBusProxy.html" title="IBusProxy">
11
11
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
13
<link rel="chapter" href="ch01.html" title="API Overviews">
14
<link rel="chapter" href="ch02.html" title="User Interfaces">
13
<link rel="chapter" href="ch01.html" title="Overview">
14
<link rel="chapter" href="ch02.html" title="Panel (User Interfaces)">
15
15
<link rel="chapter" href="ch03.html" title="Input method engine">
16
<link rel="chapter" href="ch04.html" title="Configuration">
17
<link rel="chapter" href="ch05.html" title="Others">
16
<link rel="chapter" href="ch04.html" title="Communication and Configuration">
17
<link rel="chapter" href="ch05.html" title="Internal">
19
19
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
20
20
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
21
21
<tr valign="middle">
22
22
<td><a accesskey="p" href="IBusObservedPath.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
23
<td><a accesskey="u" href="ch05.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
23
<td><a accesskey="u" href="ch04.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
24
24
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
25
<th width="100%" align="center">iBus Reference Manual</th>
25
<th width="100%" align="center">IBus Reference Manual</th>
26
26
<td><a accesskey="n" href="IBusProxy.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
28
28
<tr><td colspan="5" class="shortcuts">
36
36
<div class="refnamediv"><table width="100%"><tr>
38
38
<h2><span class="refentrytitle"><a name="ibus-ibuspendingcall.top_of_page"></a>ibuspendingcall</span></h2>
39
<p>ibuspendingcall</p>
39
<p>ibuspendingcall — A DBusPendingCall in IBus.</p>
41
41
<td valign="top" align="right"></td>
42
42
</tr></table></div>
43
<div class="refsect1" lang="en">
44
<a name="ibus-ibuspendingcall.stability-level"></a><h2>Stability Level</h2>
45
Stable, unless otherwise indicated
43
47
<div class="refsynopsisdiv">
44
48
<a name="ibus-ibuspendingcall.synopsis"></a><h2>Synopsis</h2>
45
49
<pre class="synopsis">
99
103
<div class="refsect1" lang="en">
100
104
<a name="ibus-ibuspendingcall.description"></a><h2>Description</h2>
106
An IBusPendingCall is essentially a DBusPendingCall, which representing an expected reply.
107
A IBusPendingCall can be created when you send a message that should have a reply.
110
Besides DBusPendingCall functions, An IBusPendingCall can be manipulated
111
with its own specific functions, which are defined in this section.</p>
104
115
<div class="refsect1" lang="en">
118
131
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"
119
132
>gpointer</a> user_data);</pre>
134
Callback prototype of pending call notify function.</p>
122
137
<div class="variablelist"><table border="0">
123
138
<col align="left" valign="top">
126
141
<td><p><span class="term"><em class="parameter"><code>pending</code></em> :</span></p></td>
142
<td> An IBusPendingCall.
131
146
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
147
<td> User data for the callback function.
140
155
<a name="ibus-pending-call-ref"></a><h3>ibus_pending_call_ref ()</h3>
141
156
<pre class="programlisting"><a class="link" href="ibus-ibuspendingcall.html#IBusPendingCall" title="IBusPendingCall">IBusPendingCall</a>* ibus_pending_call_ref (<a class="link" href="ibus-ibuspendingcall.html#IBusPendingCall" title="IBusPendingCall">IBusPendingCall</a> *pending);</pre>
158
Increases the reference count on a pending call.</p>
144
161
<div class="variablelist"><table border="0">
145
162
<col align="left" valign="top">
148
165
<td><p><span class="term"><em class="parameter"><code>pending</code></em> :</span></p></td>
166
<td> An IBusPendingCall.
153
170
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
171
<td> A reference of IBusPendingCall.
162
179
<a name="ibus-pending-call-unref"></a><h3>ibus_pending_call_unref ()</h3>
163
180
<pre class="programlisting">void ibus_pending_call_unref (<a class="link" href="ibus-ibuspendingcall.html#IBusPendingCall" title="IBusPendingCall">IBusPendingCall</a> *pending);</pre>
182
Decreases the reference count on a pending call.</p>
166
185
<div class="variablelist"><table border="0">
167
186
<col align="left" valign="top">
169
188
<td><p><span class="term"><em class="parameter"><code>pending</code></em> :</span></p></td>
189
<td> An IBusPendingCall.
186
205
href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
187
206
>GDestroyNotify</a> free_user_data);</pre>
208
Sets a notification function to be called when the reply is received or the pending call times out.</p>
190
211
<div class="variablelist"><table border="0">
191
212
<col align="left" valign="top">
194
215
<td><p><span class="term"><em class="parameter"><code>pending</code></em> :</span></p></td>
216
<td> An IBusPendingCall.
199
220
<td><p><span class="term"><em class="parameter"><code>function</code></em> :</span></p></td>
221
<td> An pending call notify callback function.
204
225
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
226
<td> User data for the callback function.
209
230
<td><p><span class="term"><em class="parameter"><code>free_user_data</code></em> :</span></p></td>
231
<td> Callback to free the user_data.
214
235
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
236
<td> TRUE if succeed; FALSE if not enough memory.
223
244
<a name="ibus-pending-call-cancel"></a><h3>ibus_pending_call_cancel ()</h3>
224
245
<pre class="programlisting">void ibus_pending_call_cancel (<a class="link" href="ibus-ibuspendingcall.html#IBusPendingCall" title="IBusPendingCall">IBusPendingCall</a> *pending);</pre>
247
Cancels the pending call, such that any reply or error received will just be ignored.
250
Drops the dbus library's internal reference to the DBusPendingCall so will free the call
251
if nobody else is holding a reference.
252
But usually application owns a reference from <code class="function">dbus_connection_send_with_reply()</code>.
255
Note that canceling a pending call will not simulate a timed-out call;
256
if a call times out, then a timeout error reply is received.
257
If you cancel the call, no reply is received unless the reply was already received before you canceled.</p>
227
260
<div class="variablelist"><table border="0">
228
261
<col align="left" valign="top">
230
263
<td><p><span class="term"><em class="parameter"><code>pending</code></em> :</span></p></td>
264
<td> An IBusPendingCall.
240
273
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"
241
274
>gboolean</a> ibus_pending_call_get_completed (<a class="link" href="ibus-ibuspendingcall.html#IBusPendingCall" title="IBusPendingCall">IBusPendingCall</a> *pending);</pre>
276
Whether the pending call has received a reply or not.</p>
244
279
<div class="variablelist"><table border="0">
245
280
<col align="left" valign="top">
248
283
<td><p><span class="term"><em class="parameter"><code>pending</code></em> :</span></p></td>
284
<td> An IBusPendingCall.
253
288
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
289
<td> TRUE if pending call has received a reply; FALSE otherwise.
262
297
<a name="ibus-pending-call-steal-reply"></a><h3>ibus_pending_call_steal_reply ()</h3>
263
298
<pre class="programlisting"><a class="link" href="ibus-ibusmessage.html#IBusMessage" title="IBusMessage">IBusMessage</a>* ibus_pending_call_steal_reply (<a class="link" href="ibus-ibuspendingcall.html#IBusPendingCall" title="IBusPendingCall">IBusPendingCall</a> *pending);</pre>
300
Gets the reply, or returns NULL if none has been received yet.
303
Ownership of the reply message passes to the caller.
304
This function can only be called once per pending call,
305
since the reply message is transferred to the caller.</p>
266
308
<div class="variablelist"><table border="0">
267
309
<col align="left" valign="top">
270
312
<td><p><span class="term"><em class="parameter"><code>pending</code></em> :</span></p></td>
313
<td> An IBusPendingCall.
275
317
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
318
<td> Replied message; NULL if none has been received yet.
284
326
<a name="ibus-pending-call-block"></a><h3>ibus_pending_call_block ()</h3>
285
327
<pre class="programlisting">void ibus_pending_call_block (<a class="link" href="ibus-ibuspendingcall.html#IBusPendingCall" title="IBusPendingCall">IBusPendingCall</a> *pending);</pre>
329
Block until the pending call is completed.
330
The blocking is as with <a class="link" href="IBusConnection.html#ibus-connection-send-with-reply-and-block" title="ibus_connection_send_with_reply_and_block ()"><code class="function">ibus_connection_send_with_reply_and_block()</code></a>;
331
it does not enter the main loop or process other messages,
332
it simply waits for the reply in question.
335
If the pending call is already completed, this function returns immediately.</p>
288
338
<div class="variablelist"><table border="0">
289
339
<col align="left" valign="top">
291
341
<td><p><span class="term"><em class="parameter"><code>pending</code></em> :</span></p></td>
342
<td> An IBusPendingCall.
299
349
<a name="ibus-pending-call-wait"></a><h3>ibus_pending_call_wait ()</h3>
300
350
<pre class="programlisting">void ibus_pending_call_wait (<a class="link" href="ibus-ibuspendingcall.html#IBusPendingCall" title="IBusPendingCall">IBusPendingCall</a> *pending);</pre>
352
Wait until the pending call is completed.
355
See also: <a class="link" href="ibus-ibuspendingcall.html#ibus-pending-call-get-completed" title="ibus_pending_call_get_completed ()"><code class="function">ibus_pending_call_get_completed()</code></a>.</p>
303
358
<div class="variablelist"><table border="0">
304
359
<col align="left" valign="top">
306
361
<td><p><span class="term"><em class="parameter"><code>pending</code></em> :</span></p></td>
362
<td> An IBusPendingCall.
319
374
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
320
375
>gint</a> *slot_p);</pre>
377
Allocates an integer ID to be used for storing application-specific data on any IBusPendingCall.
380
The allocated ID may then be used with <a class="link" href="ibus-ibuspendingcall.html#ibus-pending-call-set-data" title="ibus_pending_call_set_data ()"><code class="function">ibus_pending_call_set_data()</code></a> and <a class="link" href="ibus-ibuspendingcall.html#ibus-pending-call-get-data" title="ibus_pending_call_get_data ()"><code class="function">ibus_pending_call_get_data()</code></a>.
381
The passed-in slot must be initialized to -1, and is filled in with the slot ID.
382
If the passed-in slot is not -1, it's assumed to be already allocated, and
383
its reference count is increased.
386
The allocated slot is global, i.e. all DBusPendingCall objects
387
will have a slot with the given integer ID reserved.</p>
323
390
<div class="variablelist"><table border="0">
324
391
<col align="left" valign="top">
327
394
<td><p><span class="term"><em class="parameter"><code>slot_p</code></em> :</span></p></td>
395
<td> Address of a global variable storing the slot.
332
399
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
400
<td> TRUE if succeed; FALSE if insufficient memory.
343
410
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
344
411
>gint</a> *slot_p);</pre>
413
Deallocates a global ID for IBusPendingCall data slots.
416
<a class="link" href="ibus-ibuspendingcall.html#ibus-pending-call-get-data" title="ibus_pending_call_get_data ()"><code class="function">ibus_pending_call_get_data()</code></a> and <a class="link" href="ibus-ibuspendingcall.html#ibus-pending-call-set-data" title="ibus_pending_call_set_data ()"><code class="function">ibus_pending_call_set_data()</code></a> may no longer be used with this slot.
417
Existing data stored on existing IBusPendingCall objects will be freed when
418
the IBusPendingCall is finalized, but may not be retrieved
419
(and may only be replaced if someone else reallocates the slot).
420
When the reference count on the passed-in slot reaches 0, it is set to -1.</p>
347
423
<div class="variablelist"><table border="0">
348
424
<col align="left" valign="top">
350
426
<td><p><span class="term"><em class="parameter"><code>slot_p</code></em> :</span></p></td>
427
<td> Address of a global variable storing the slot.
369
445
href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"
370
446
>GDestroyNotify</a> free_data_func);</pre>
448
Stores a pointer on a IBusPendingCall, along with an optional function
449
to be used for freeing the data when the data is set again, or when the pending call is finalized.
452
The slot number must have been allocated with <a class="link" href="ibus-ibuspendingcall.html#ibus-pending-call-allocate-data-slot" title="ibus_pending_call_allocate_data_slot ()"><code class="function">ibus_pending_call_allocate_data_slot()</code></a>.</p>
373
455
<div class="variablelist"><table border="0">
374
456
<col align="left" valign="top">
377
459
<td><p><span class="term"><em class="parameter"><code>pending</code></em> :</span></p></td>
460
<td> An IBusPendingCall.
382
464
<td><p><span class="term"><em class="parameter"><code>slot</code></em> :</span></p></td>
465
<td> The slot number.
387
469
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
470
<td> The data to store
392
474
<td><p><span class="term"><em class="parameter"><code>free_data_func</code></em> :</span></p></td>
475
<td> Callback to free the data.
397
479
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
480
<td> TRUE if there was enough memory to store the data; FALSE otherwise.
411
493
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"
412
494
>gint</a> slot);</pre>
496
Retrieves data previously set with <a class="link" href="ibus-ibuspendingcall.html#ibus-pending-call-set-data" title="ibus_pending_call_set_data ()"><code class="function">ibus_pending_call_set_data()</code></a>.
499
The slot must still be allocated (must not have been freed).</p>
415
502
<div class="variablelist"><table border="0">
416
503
<col align="left" valign="top">
419
506
<td><p><span class="term"><em class="parameter"><code>pending</code></em> :</span></p></td>
507
<td> An IBusPendingCall.
424
511
<td><p><span class="term"><em class="parameter"><code>slot</code></em> :</span></p></td>
512
<td> The slot number.
429
516
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
517
<td> The stored data; NULL if no such data.