File: InfTextSession.html

package info (click to toggle)
libinfinity 0.4.1-4
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 12,332 kB
  • ctags: 7,384
  • sloc: ansic: 65,073; xml: 36,770; sh: 10,347; makefile: 728
file content (424 lines) | stat: -rw-r--r-- 20,948 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>InfTextSession</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="libinftext-0.4 Reference Manual">
<link rel="up" href="ch01.html" title="libinftext API reference">
<link rel="prev" href="ch01.html" title="libinftext API reference">
<link rel="next" href="libinftext-04-inf-text-buffer.html" title="inf-text-buffer">
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="ch01.html" title="libinftext API reference">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="ch01.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">libinftext-0.4 Reference Manual</th>
<td><a accesskey="n" href="libinftext-04-inf-text-buffer.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#InfTextSession.synopsis" class="shortcut">Top</a>
                 | 
                <a href="#InfTextSession.description" class="shortcut">Description</a>
                 | 
                <a href="#InfTextSession.object-hierarchy" class="shortcut">Object Hierarchy</a>
                 | 
                <a href="#InfTextSession.implemented-interfaces" class="shortcut">Implemented Interfaces</a>
                 | 
                <a href="#InfTextSession.properties" class="shortcut">Properties</a>
</td></tr>
</table>
<div class="refentry" title="InfTextSession">
<a name="InfTextSession"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="InfTextSession.top_of_page"></a>InfTextSession</span></h2>
<p>InfTextSession</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="InfTextSession.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
enum                <a class="link" href="InfTextSession.html#InfTextSessionError" title="enum InfTextSessionError">InfTextSessionError</a>;
                    <a class="link" href="InfTextSession.html#InfTextSession-struct" title="InfTextSession">InfTextSession</a>;
<a class="link" href="InfTextSession.html" title="InfTextSession">InfTextSession</a> *    <a class="link" href="InfTextSession.html#inf-text-session-new" title="inf_text_session_new ()">inf_text_session_new</a>                (<a
href="../libinfinity-0.4/InfCommunicationManager.html"
>InfCommunicationManager</a> *manager,
                                                         <a class="link" href="libinftext-04-inf-text-buffer.html#InfTextBuffer">InfTextBuffer</a> *buffer,
                                                         <a
href="../libinfinity-0.4/InfIo.html"
>InfIo</a> *io,
                                                         <a
href="../libinfinity-0.4/InfSession.html#InfSessionStatus"
>InfSessionStatus</a> status,
                                                         <a
href="../libinfinity-0.4/InfCommunicationGroup.html"
>InfCommunicationGroup</a> *sync_group,
                                                         <a
href="../libinfinity-0.4/InfXmlConnection.html"
>InfXmlConnection</a> *sync_connection);
<a class="link" href="InfTextSession.html" title="InfTextSession">InfTextSession</a> *    <a class="link" href="InfTextSession.html#inf-text-session-new-with-user-table" title="inf_text_session_new_with_user_table ()">inf_text_session_new_with_user_table</a>
                                                        (<a
href="../libinfinity-0.4/InfCommunicationManager.html"
>InfCommunicationManager</a> *manager,
                                                         <a class="link" href="libinftext-04-inf-text-buffer.html#InfTextBuffer">InfTextBuffer</a> *buffer,
                                                         <a
href="../libinfinity-0.4/InfIo.html"
>InfIo</a> *io,
                                                         <a
href="../libinfinity-0.4/InfUserTable.html"
>InfUserTable</a> *user_table,
                                                         <a
href="../libinfinity-0.4/InfSession.html#InfSessionStatus"
>InfSessionStatus</a> status,
                                                         <a
href="../libinfinity-0.4/InfCommunicationGroup.html"
>InfCommunicationGroup</a> *sync_group,
                                                         <a
href="../libinfinity-0.4/InfXmlConnection.html"
>InfXmlConnection</a> *sync_connection);
void                <a class="link" href="InfTextSession.html#inf-text-session-set-user-color" title="inf_text_session_set_user_color ()">inf_text_session_set_user_color</a>     (<a class="link" href="InfTextSession.html" title="InfTextSession">InfTextSession</a> *session,
                                                         <a class="link" href="InfTextUser.html" title="InfTextUser">InfTextUser</a> *user,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gdouble"
>gdouble</a> hue);
void                <a class="link" href="InfTextSession.html#inf-text-session-flush-requests-for-user" title="inf_text_session_flush_requests_for_user ()">inf_text_session_flush_requests_for_user</a>
                                                        (<a class="link" href="InfTextSession.html" title="InfTextSession">InfTextSession</a> *session,
                                                         <a class="link" href="InfTextUser.html" title="InfTextUser">InfTextUser</a> *user);
</pre>
</div>
<div class="refsect1" title="Object Hierarchy">
<a name="InfTextSession.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  <a
href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject"
>GObject</a>
   +----<a
href="../libinfinity-0.4/InfSession.html"
>InfSession</a>
         +----<a
href="../libinfinity-0.4/InfAdoptedSession.html"
>InfAdoptedSession</a>
               +----InfTextSession
</pre>
</div>
<div class="refsect1" title="Implemented Interfaces">
<a name="InfTextSession.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
<p>
InfTextSession implements
 <a
href="../libinfinity-0.4/InfCommunicationObject.html"
>InfCommunicationObject</a>.</p>
</div>
<div class="refsect1" title="Properties">
<a name="InfTextSession.properties"></a><h2>Properties</h2>
<pre class="synopsis">
  "<a class="link" href="InfTextSession.html#InfTextSession--caret-update-interval" title='The "caret-update-interval" property'>caret-update-interval</a>"    <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a>                 : Read / Write / Construct
</pre>
</div>
<div class="refsect1" title="Description">
<a name="InfTextSession.description"></a><h2>Description</h2>
<p>
</p>
</div>
<div class="refsect1" title="Details">
<a name="InfTextSession.details"></a><h2>Details</h2>
<div class="refsect2" title="enum InfTextSessionError">
<a name="InfTextSessionError"></a><h3>enum InfTextSessionError</h3>
<pre class="programlisting">typedef enum _InfTextSessionError {
  INF_TEXT_SESSION_ERROR_INVALID_HUE,

  INF_TEXT_SESSION_ERROR_FAILED
} InfTextSessionError;
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" title="InfTextSession">
<a name="InfTextSession-struct"></a><h3>InfTextSession</h3>
<pre class="programlisting">typedef struct _InfTextSession InfTextSession;</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2" title="inf_text_session_new ()">
<a name="inf-text-session-new"></a><h3>inf_text_session_new ()</h3>
<pre class="programlisting"><a class="link" href="InfTextSession.html" title="InfTextSession">InfTextSession</a> *    inf_text_session_new                (<a
href="../libinfinity-0.4/InfCommunicationManager.html"
>InfCommunicationManager</a> *manager,
                                                         <a class="link" href="libinftext-04-inf-text-buffer.html#InfTextBuffer">InfTextBuffer</a> *buffer,
                                                         <a
href="../libinfinity-0.4/InfIo.html"
>InfIo</a> *io,
                                                         <a
href="../libinfinity-0.4/InfSession.html#InfSessionStatus"
>InfSessionStatus</a> status,
                                                         <a
href="../libinfinity-0.4/InfCommunicationGroup.html"
>InfCommunicationGroup</a> *sync_group,
                                                         <a
href="../libinfinity-0.4/InfXmlConnection.html"
>InfXmlConnection</a> *sync_connection);</pre>
<p>
Creates a new <a class="link" href="InfTextSession.html" title="InfTextSession"><span class="type">InfTextSession</span></a>. The communication manager is used to send
and receive requests from subscription and synchronization. <em class="parameter"><code>buffer</code></em> will be
set to be initially empty if the session is initially synchronized
(see below). <em class="parameter"><code>io</code></em> is required to trigger timeouts.
</p>
<p>
If <em class="parameter"><code>status</code></em> is <code class="literal">INF_SESSION_PRESYNC</code> or <code class="literal">INF_SESSION_SYNCHRONIZING</code>, then the
session will initially be sychronized, meaning the initial content is
retrieved from <em class="parameter"><code>sync_connection</code></em>. If you are subscribed to the session, set
the subscription group via <a
href="../libinfinity-0.4/InfSession.html#inf-session-set-subscription-group"
><code class="function">inf_session_set_subscription_group()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>manager</code></em> :</span></p></td>
<td> A <a
href="../libinfinity-0.4/InfCommunicationManager.html"
><span class="type">InfCommunicationManager</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td> An initial <a class="link" href="libinftext-04-inf-text-buffer.html#InfTextBuffer"><span class="type">InfTextBuffer</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>io</code></em> :</span></p></td>
<td> A <a
href="../libinfinity-0.4/InfIo.html"
><span class="type">InfIo</span></a> object.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>status</code></em> :</span></p></td>
<td> The initial status of the session.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sync_group</code></em> :</span></p></td>
<td> A group in which the session is synchronized. Ignored if
<em class="parameter"><code>status</code></em> is <code class="literal">INF_SESSION_RUNNING</code>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sync_connection</code></em> :</span></p></td>
<td> A connection to synchronize the session from. Ignored if
<em class="parameter"><code>status</code></em> is <code class="literal">INF_SESSION_RUNNING</code>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A new <a class="link" href="InfTextSession.html" title="InfTextSession"><span class="type">InfTextSession</span></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_text_session_new_with_user_table ()">
<a name="inf-text-session-new-with-user-table"></a><h3>inf_text_session_new_with_user_table ()</h3>
<pre class="programlisting"><a class="link" href="InfTextSession.html" title="InfTextSession">InfTextSession</a> *    inf_text_session_new_with_user_table
                                                        (<a
href="../libinfinity-0.4/InfCommunicationManager.html"
>InfCommunicationManager</a> *manager,
                                                         <a class="link" href="libinftext-04-inf-text-buffer.html#InfTextBuffer">InfTextBuffer</a> *buffer,
                                                         <a
href="../libinfinity-0.4/InfIo.html"
>InfIo</a> *io,
                                                         <a
href="../libinfinity-0.4/InfUserTable.html"
>InfUserTable</a> *user_table,
                                                         <a
href="../libinfinity-0.4/InfSession.html#InfSessionStatus"
>InfSessionStatus</a> status,
                                                         <a
href="../libinfinity-0.4/InfCommunicationGroup.html"
>InfCommunicationGroup</a> *sync_group,
                                                         <a
href="../libinfinity-0.4/InfXmlConnection.html"
>InfXmlConnection</a> *sync_connection);</pre>
<p>
Creates a new <a class="link" href="InfTextSession.html" title="InfTextSession"><span class="type">InfTextSession</span></a>. The connection manager is used to send and
receive requests from subscription and synchronization. <em class="parameter"><code>buffer</code></em> will be
set to be initially empty if the session is initially synchronized
(see below). <em class="parameter"><code>io</code></em> is required to trigger timeouts.
</p>
<p>
If <em class="parameter"><code>status</code></em> is <code class="literal">INF_SESSION_PRESYNC</code> or <code class="literal">INF_SESSION_SYNCHRONIZING</code>, then the
session will initially be sychronized, meaning the initial content is
retrieved from <em class="parameter"><code>sync_connection</code></em>. If you are subscribed to the session, set
the subscription group via <a
href="../libinfinity-0.4/InfSession.html#inf-session-set-subscription-group"
><code class="function">inf_session_set_subscription_group()</code></a>.
</p>
<p>
<em class="parameter"><code>user_table</code></em> is used as an initial user table. The user table should only
contain unavailable users, if any, that may rejoin during the session. If
there was an available user in the user table, it would probably belong
to another session, but different sessions cannot share the same user
object.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>manager</code></em> :</span></p></td>
<td> A <a
href="../libinfinity-0.4/InfCommunicationManager.html"
><span class="type">InfCommunicationManager</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>buffer</code></em> :</span></p></td>
<td> An initial <a class="link" href="libinftext-04-inf-text-buffer.html#InfTextBuffer"><span class="type">InfTextBuffer</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>io</code></em> :</span></p></td>
<td> A <a
href="../libinfinity-0.4/InfIo.html"
><span class="type">InfIo</span></a> object.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_table</code></em> :</span></p></td>
<td> A <a
href="../libinfinity-0.4/InfUserTable.html"
><span class="type">InfUserTable</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>status</code></em> :</span></p></td>
<td> The initial status for the session.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sync_group</code></em> :</span></p></td>
<td> A group in which the session is synchronized. Ignored if
<em class="parameter"><code>status</code></em> is <code class="literal">INF_SESSION_RUNNING</code>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>sync_connection</code></em> :</span></p></td>
<td> A connection to synchronize the session from. Ignored if
<em class="parameter"><code>status</code></em> is <code class="literal">INF_SESSION_RUNNING</code>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> A new <a class="link" href="InfTextSession.html" title="InfTextSession"><span class="type">InfTextSession</span></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_text_session_set_user_color ()">
<a name="inf-text-session-set-user-color"></a><h3>inf_text_session_set_user_color ()</h3>
<pre class="programlisting">void                inf_text_session_set_user_color     (<a class="link" href="InfTextSession.html" title="InfTextSession">InfTextSession</a> *session,
                                                         <a class="link" href="InfTextUser.html" title="InfTextUser">InfTextUser</a> *user,
                                                         <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gdouble"
>gdouble</a> hue);</pre>
<p>
Changes the user color of <em class="parameter"><code>user</code></em>. <em class="parameter"><code>user</code></em> must have the <code class="literal">INF_USER_LOCAL</code> flag
set.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>session</code></em> :</span></p></td>
<td> A <a class="link" href="InfTextSession.html" title="InfTextSession"><span class="type">InfTextSession</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user</code></em> :</span></p></td>
<td> A local <a class="link" href="InfTextUser.html" title="InfTextUser"><span class="type">InfTextUser</span></a> from <em class="parameter"><code>session</code></em>'s user table.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>hue</code></em> :</span></p></td>
<td> New hue value for <em class="parameter"><code>user</code></em>'s color. Ranges from 0.0 (red) to 1.0 (red).
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="inf_text_session_flush_requests_for_user ()">
<a name="inf-text-session-flush-requests-for-user"></a><h3>inf_text_session_flush_requests_for_user ()</h3>
<pre class="programlisting">void                inf_text_session_flush_requests_for_user
                                                        (<a class="link" href="InfTextSession.html" title="InfTextSession">InfTextSession</a> *session,
                                                         <a class="link" href="InfTextUser.html" title="InfTextUser">InfTextUser</a> *user);</pre>
<p>
This function sends all pending requests for <em class="parameter"><code>user</code></em> immediately. Requests
that modify the buffer are not queued normally, but cursor movement
requests are delayed in case are issued frequently, to save bandwidth.
</p>
<p>
The main purpose of this function is to send all pending requests before
changing a user's status to inactive or unavailable since inactive users
are automatically activated as soon as they issue a request.
</p>
<p>
TODO: We should probably detect this automatically, without requiring
people to call this function, i.e. flush requests for local users just
before they become inactive.
</p>
<p>
<em class="parameter"><code>user</code></em> must have the <code class="literal">INF_USER_LOCAL</code> flag set.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>session</code></em> :</span></p></td>
<td> A <a class="link" href="InfTextSession.html" title="InfTextSession"><span class="type">InfTextSession</span></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user</code></em> :</span></p></td>
<td> The <a class="link" href="InfTextUser.html" title="InfTextUser"><span class="type">InfTextUser</span></a> for which to flush messages.
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1" title="Property Details">
<a name="InfTextSession.property-details"></a><h2>Property Details</h2>
<div class="refsect2" title='The "caret-update-interval" property'>
<a name="InfTextSession--caret-update-interval"></a><h3>The <code class="literal">"caret-update-interval"</code> property</h3>
<pre class="programlisting">  "caret-update-interval"    <a
href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"
>guint</a>                 : Read / Write / Construct</pre>
<p>Minimum number of milliseconds between caret update broadcasts.</p>
<p>Default value: 500</p>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.11</div>
</body>
</html>