This file is indexed.

/usr/share/gtk-doc/html/cogl-2.0-experimental/cogl-2.0-experimental-Main-loop-integration.html is in libcogl-doc 1.22.0-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Main loop integration: Cogl 2.0 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="Cogl 2.0 Reference Manual">
<link rel="up" href="cogl-integration.html" title="Binding and Integrating">
<link rel="prev" href="cogl-2.0-experimental-SDL-Integration.html" title="SDL Integration">
<link rel="next" href="cogl-2.0-experimental-GType-Integration-API.html" title="GType Integration API">
<meta name="generator" content="GTK-Doc V1.24 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#cogl-2.0-experimental-Main-loop-integration.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="cogl-integration.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="cogl-2.0-experimental-SDL-Integration.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="cogl-2.0-experimental-GType-Integration-API.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="cogl-2.0-experimental-Main-loop-integration"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="cogl-2.0-experimental-Main-loop-integration.top_of_page"></a>Main loop integration</span></h2>
<p>Main loop integration — Functions for integrating Cogl with an
  application's main loop</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="cogl-2.0-experimental-Main-loop-integration.functions"></a><h2>Functions</h2>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-poll-renderer-get-info" title="cogl_poll_renderer_get_info ()">cogl_poll_renderer_get_info</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">void</span>
</td>
<td class="function_name">
<a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-poll-renderer-dispatch" title="cogl_poll_renderer_dispatch ()">cogl_poll_renderer_dispatch</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GSource</span> *
</td>
<td class="function_name">
<a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-glib-source-new" title="cogl_glib_source_new ()">cogl_glib_source_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GSource</span> *
</td>
<td class="function_name">
<a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-glib-renderer-source-new" title="cogl_glib_renderer_source_new ()">cogl_glib_renderer_source_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="cogl-2.0-experimental-Main-loop-integration.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword">enum</td>
<td class="function_name"><a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#CoglPollFDEvent" title="enum CoglPollFDEvent">CoglPollFDEvent</a></td>
</tr>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#CoglPollFD" title="CoglPollFD">CoglPollFD</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="cogl-2.0-experimental-Main-loop-integration.description"></a><h2>Description</h2>
<p>Cogl needs to integrate with the application's main loop so that it
can internally handle some events from the driver. All Cogl
applications must use these functions. They provide enough
information to describe the state that Cogl will need to wake up
on. An application using the GLib main loop can instead use
<a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-glib-source-new" title="cogl_glib_source_new ()"><code class="function">cogl_glib_source_new()</code></a> which provides a <span class="type">GSource</span> ready to be added
to the main loop.</p>
</div>
<div class="refsect1">
<a name="cogl-2.0-experimental-Main-loop-integration.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="cogl-poll-renderer-get-info"></a><h3>cogl_poll_renderer_get_info ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
cogl_poll_renderer_get_info (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-CoglRenderer---Connect-to-a-backend-renderer.html#CoglRenderer" title="CoglRenderer"><span class="type">CoglRenderer</span></a> *renderer</code></em>,
                             <em class="parameter"><code><a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#CoglPollFD" title="CoglPollFD"><span class="type">CoglPollFD</span></a> **poll_fds</code></em>,
                             <em class="parameter"><code><span class="type">int</span> *n_poll_fds</code></em>,
                             <em class="parameter"><code><span class="type">int64_t</span> *timeout</code></em>);</pre>
<p>Is used to integrate Cogl with an application mainloop that is based
on the unix poll(2) api (or <code class="function">select()</code> or something equivalent). This
api should be called whenever an application is about to go idle so
that Cogl has a chance to describe what file descriptor events it
needs to be woken up for.</p>
<div class="note">If your application is using the Glib mainloop then you
should jump to the <a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-glib-source-new" title="cogl_glib_source_new ()"><code class="function">cogl_glib_source_new()</code></a> api as a more convenient
way of integrating Cogl with the mainloop.</div>
<p>After the function is called *<em class="parameter"><code>poll_fds</code></em>
 will contain a pointer to
an array of <a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#CoglPollFD" title="CoglPollFD"><span class="type">CoglPollFD</span></a> structs describing the file descriptors
that Cogl expects. The fd and events members will be updated
accordingly. After the application has completed its idle it is
expected to either update the revents members directly in this
array or to create a copy of the array and update them
there.</p>
<p>When the application mainloop returns from calling poll(2) (or its
equivalent) then it should call <a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-poll-renderer-dispatch" title="cogl_poll_renderer_dispatch ()"><code class="function">cogl_poll_renderer_dispatch()</code></a>
passing a pointer the array of CoglPollFDs with updated
revent values.</p>
<p>When using the <a class="link" href="cogl-2.0-experimental-CoglRenderer---Connect-to-a-backend-renderer.html#COGL-WINSYS-ID-WGL:CAPS"><code class="literal">COGL_WINSYS_ID_WGL</code></a> winsys (where file descriptors
don't make any sense) or <a class="link" href="cogl-2.0-experimental-CoglRenderer---Connect-to-a-backend-renderer.html#COGL-WINSYS-ID-SDL:CAPS"><code class="literal">COGL_WINSYS_ID_SDL</code></a> (where the event
handling functions of SDL don't allow blocking on a file
descriptor) *n_poll_fds is guaranteed to be zero.</p>
<p><em class="parameter"><code>timeout</code></em>
 will contain a maximum amount of time to wait in
microseconds before the application should wake up or -1 if the
application should wait indefinitely. This can also be 0 if
Cogl needs to be woken up immediately.</p>
<div class="refsect3">
<a name="id-1.2.14.3.6.2.10"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>renderer</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-2.0-experimental-CoglRenderer---Connect-to-a-backend-renderer.html#CoglRenderer" title="CoglRenderer"><span class="type">CoglRenderer</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>poll_fds</p></td>
<td class="parameter_description"><p>A return location for a pointer to an array
of <a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#CoglPollFD" title="CoglPollFD"><span class="type">CoglPollFD</span></a>s</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>n_poll_fds</p></td>
<td class="parameter_description"><p>A return location for the number of entries in *<em class="parameter"><code>poll_fds</code></em>
</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>timeout</p></td>
<td class="parameter_description"><p>A return location for the maximum length of time to wait
in microseconds, or -1 to wait indefinitely.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.14.3.6.2.11"></a><h4>Returns</h4>
<p> A "poll fd state age" that changes whenever the set
of poll_fds has changed. If this API is being used to
integrate with another system mainloop api then
knowing if the set of file descriptors and events has
really changed can help avoid redundant work
depending the api. The age isn't guaranteed to change
when the timeout changes.</p>
</div>
<p class="since">Since: 1.16</p>
<p class="stability">Stability Level: <acronym title="Unstable interfaces are experimental or transitional. They are typically used to
give outside developers early access to new or rapidly changing technology, or
to provide an interim solution to a problem where a more general solution is
anticipated. No claims are made about either source or binary compatibility from
one minor release to the next.

The Unstable interface level is a warning that these interfaces are  subject to
change without warning and should not be used in unbundled products.

Given such caveats, customer impact need not be a factor when considering
incompatible changes to an Unstable interface in a major or minor release.
Nonetheless, when such changes are introduced, the changes should still be
mentioned in the release notes for the affected release.
"><span class="acronym">Unstable</span></acronym></p>
</div>
<hr>
<div class="refsect2">
<a name="cogl-poll-renderer-dispatch"></a><h3>cogl_poll_renderer_dispatch ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>
cogl_poll_renderer_dispatch (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-CoglRenderer---Connect-to-a-backend-renderer.html#CoglRenderer" title="CoglRenderer"><span class="type">CoglRenderer</span></a> *renderer</code></em>,
                             <em class="parameter"><code>const <a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#CoglPollFD" title="CoglPollFD"><span class="type">CoglPollFD</span></a> *poll_fds</code></em>,
                             <em class="parameter"><code><span class="type">int</span> n_poll_fds</code></em>);</pre>
<p>This should be called whenever an application is woken up from
going idle in its main loop. The <em class="parameter"><code>poll_fds</code></em>
 array should contain a
list of file descriptors matched with the events that occurred in
revents. The events field is ignored. It is safe to pass in extra
file descriptors that Cogl didn't request when calling
<a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-poll-renderer-get-info" title="cogl_poll_renderer_get_info ()"><code class="function">cogl_poll_renderer_get_info()</code></a> or a shorter array missing some file
descriptors that Cogl requested.</p>
<div class="note">If your application didn't originally create a <a class="link" href="cogl-2.0-experimental-CoglRenderer---Connect-to-a-backend-renderer.html#CoglRenderer" title="CoglRenderer"><span class="type">CoglRenderer</span></a>
manually then you can easily get a <a class="link" href="cogl-2.0-experimental-CoglRenderer---Connect-to-a-backend-renderer.html#CoglRenderer" title="CoglRenderer"><span class="type">CoglRenderer</span></a> pointer by calling
<code class="function">cogl_get_renderer()</code>.</div>
<div class="refsect3">
<a name="id-1.2.14.3.6.3.6"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>renderer</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-2.0-experimental-CoglRenderer---Connect-to-a-backend-renderer.html#CoglRenderer" title="CoglRenderer"><span class="type">CoglRenderer</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>poll_fds</p></td>
<td class="parameter_description"><p>An array of <a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#CoglPollFD" title="CoglPollFD"><span class="type">CoglPollFD</span></a>s describing the events
that have occurred since the application went idle.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>n_poll_fds</p></td>
<td class="parameter_description"><p>The length of the <em class="parameter"><code>poll_fds</code></em>
array.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 1.16</p>
<p class="stability">Stability Level: <acronym title="Unstable interfaces are experimental or transitional. They are typically used to
give outside developers early access to new or rapidly changing technology, or
to provide an interim solution to a problem where a more general solution is
anticipated. No claims are made about either source or binary compatibility from
one minor release to the next.

The Unstable interface level is a warning that these interfaces are  subject to
change without warning and should not be used in unbundled products.

Given such caveats, customer impact need not be a factor when considering
incompatible changes to an Unstable interface in a major or minor release.
Nonetheless, when such changes are introduced, the changes should still be
mentioned in the release notes for the affected release.
"><span class="acronym">Unstable</span></acronym></p>
</div>
<hr>
<div class="refsect2">
<a name="cogl-glib-source-new"></a><h3>cogl_glib_source_new ()</h3>
<pre class="programlisting"><span class="returnvalue">GSource</span> *
cogl_glib_source_new (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#CoglContext" title="CoglContext"><span class="type">CoglContext</span></a> *context</code></em>,
                      <em class="parameter"><code><span class="type">int</span> priority</code></em>);</pre>
<p>Creates a <span class="type">GSource</span> which handles Cogl's internal system event
processing. This can be used as a convenience instead of
<a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-poll-renderer-get-info" title="cogl_poll_renderer_get_info ()"><code class="function">cogl_poll_renderer_get_info()</code></a> and <a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-poll-renderer-dispatch" title="cogl_poll_renderer_dispatch ()"><code class="function">cogl_poll_renderer_dispatch()</code></a> in
applications that are already using the GLib main loop. After this
is called the <span class="type">GSource</span> should be attached to the main loop using
<code class="function">g_source_attach()</code>.</p>
<p>Applications that manually connect to a <a class="link" href="cogl-2.0-experimental-CoglRenderer---Connect-to-a-backend-renderer.html#CoglRenderer" title="CoglRenderer"><span class="type">CoglRenderer</span></a> before they
create a <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#CoglContext" title="CoglContext"><span class="type">CoglContext</span></a> should instead use
<a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-glib-renderer-source-new" title="cogl_glib_renderer_source_new ()"><code class="function">cogl_glib_renderer_source_new()</code></a> so that events may be dispatched
before a context has been created. In that case you don't need to
use this api in addition later, it is simply enough to use
<a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-glib-renderer-source-new" title="cogl_glib_renderer_source_new ()"><code class="function">cogl_glib_renderer_source_new()</code></a> instead.</p>
<div class="note">This api is actually just a thin convenience wrapper around
<a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-glib-renderer-source-new" title="cogl_glib_renderer_source_new ()"><code class="function">cogl_glib_renderer_source_new()</code></a>
</div>
<div class="refsect3">
<a name="id-1.2.14.3.6.4.7"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>context</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-2.0-experimental-The-Top-Level-Context.html#CoglContext" title="CoglContext"><span class="type">CoglContext</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>priority</p></td>
<td class="parameter_description"><p>The priority of the <span class="type">GSource</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.14.3.6.4.8"></a><h4>Returns</h4>
<p> a new <span class="type">GSource</span></p>
</div>
<p class="since">Since: 1.10</p>
<p class="stability">Stability Level: <acronym title="Unstable interfaces are experimental or transitional. They are typically used to
give outside developers early access to new or rapidly changing technology, or
to provide an interim solution to a problem where a more general solution is
anticipated. No claims are made about either source or binary compatibility from
one minor release to the next.

The Unstable interface level is a warning that these interfaces are  subject to
change without warning and should not be used in unbundled products.

Given such caveats, customer impact need not be a factor when considering
incompatible changes to an Unstable interface in a major or minor release.
Nonetheless, when such changes are introduced, the changes should still be
mentioned in the release notes for the affected release.
"><span class="acronym">Unstable</span></acronym></p>
</div>
<hr>
<div class="refsect2">
<a name="cogl-glib-renderer-source-new"></a><h3>cogl_glib_renderer_source_new ()</h3>
<pre class="programlisting"><span class="returnvalue">GSource</span> *
cogl_glib_renderer_source_new (<em class="parameter"><code><a class="link" href="cogl-2.0-experimental-CoglRenderer---Connect-to-a-backend-renderer.html#CoglRenderer" title="CoglRenderer"><span class="type">CoglRenderer</span></a> *renderer</code></em>,
                               <em class="parameter"><code><span class="type">int</span> priority</code></em>);</pre>
<p>Creates a <span class="type">GSource</span> which handles Cogl's internal system event
processing. This can be used as a convenience instead of
<a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-poll-renderer-get-info" title="cogl_poll_renderer_get_info ()"><code class="function">cogl_poll_renderer_get_info()</code></a> and <a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#cogl-poll-renderer-dispatch" title="cogl_poll_renderer_dispatch ()"><code class="function">cogl_poll_renderer_dispatch()</code></a> in
applications that are already using the GLib main loop. After this
is called the <span class="type">GSource</span> should be attached to the main loop using
<code class="function">g_source_attach()</code>.</p>
<div class="refsect3">
<a name="id-1.2.14.3.6.5.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>renderer</p></td>
<td class="parameter_description"><p>A <a class="link" href="cogl-2.0-experimental-CoglRenderer---Connect-to-a-backend-renderer.html#CoglRenderer" title="CoglRenderer"><span class="type">CoglRenderer</span></a></p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>priority</p></td>
<td class="parameter_description"><p>The priority of the <span class="type">GSource</span></p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.14.3.6.5.6"></a><h4>Returns</h4>
<p> a new <span class="type">GSource</span></p>
</div>
<p class="since">Since: 1.16</p>
<p class="stability">Stability Level: <acronym title="Unstable interfaces are experimental or transitional. They are typically used to
give outside developers early access to new or rapidly changing technology, or
to provide an interim solution to a problem where a more general solution is
anticipated. No claims are made about either source or binary compatibility from
one minor release to the next.

The Unstable interface level is a warning that these interfaces are  subject to
change without warning and should not be used in unbundled products.

Given such caveats, customer impact need not be a factor when considering
incompatible changes to an Unstable interface in a major or minor release.
Nonetheless, when such changes are introduced, the changes should still be
mentioned in the release notes for the affected release.
"><span class="acronym">Unstable</span></acronym></p>
</div>
</div>
<div class="refsect1">
<a name="cogl-2.0-experimental-Main-loop-integration.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="CoglPollFDEvent"></a><h3>enum CoglPollFDEvent</h3>
<p>A bitmask of events that Cogl may need to wake on for a file
descriptor. Note that these all have the same values as the
corresponding defines for the poll function call on Unix so they
may be directly passed to poll.</p>
<div class="refsect3">
<a name="id-1.2.14.3.7.2.4"></a><h4>Members</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="300px" class="enum_members_name">
<col class="enum_members_description">
<col width="200px" class="enum_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="enum_member_name"><p><a name="COGL-POLL-FD-EVENT-IN:CAPS"></a>COGL_POLL_FD_EVENT_IN</p></td>
<td class="enum_member_description">
<p>there is data to read</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="COGL-POLL-FD-EVENT-PRI:CAPS"></a>COGL_POLL_FD_EVENT_PRI</p></td>
<td class="enum_member_description">
<p>data can be written (without blocking)</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="COGL-POLL-FD-EVENT-OUT:CAPS"></a>COGL_POLL_FD_EVENT_OUT</p></td>
<td class="enum_member_description">
<p>there is urgent data to read.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="COGL-POLL-FD-EVENT-ERR:CAPS"></a>COGL_POLL_FD_EVENT_ERR</p></td>
<td class="enum_member_description">
<p>error condition</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="COGL-POLL-FD-EVENT-HUP:CAPS"></a>COGL_POLL_FD_EVENT_HUP</p></td>
<td class="enum_member_description">
<p>hung up (the connection has been broken, usually
                         for pipes and sockets).</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
<tr>
<td class="enum_member_name"><p><a name="COGL-POLL-FD-EVENT-NVAL:CAPS"></a>COGL_POLL_FD_EVENT_NVAL</p></td>
<td class="enum_member_description">
<p>invalid request. The file descriptor is not open.</p>
</td>
<td class="enum_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 1.10</p>
<p class="stability">Stability Level: <acronym title="Unstable interfaces are experimental or transitional. They are typically used to
give outside developers early access to new or rapidly changing technology, or
to provide an interim solution to a problem where a more general solution is
anticipated. No claims are made about either source or binary compatibility from
one minor release to the next.

The Unstable interface level is a warning that these interfaces are  subject to
change without warning and should not be used in unbundled products.

Given such caveats, customer impact need not be a factor when considering
incompatible changes to an Unstable interface in a major or minor release.
Nonetheless, when such changes are introduced, the changes should still be
mentioned in the release notes for the affected release.
"><span class="acronym">Unstable</span></acronym></p>
</div>
<hr>
<div class="refsect2">
<a name="CoglPollFD"></a><h3>CoglPollFD</h3>
<pre class="programlisting">typedef struct {
  int fd;
  short int events;
  short int revents;
} CoglPollFD;
</pre>
<p>A struct for describing the state of a file descriptor that Cogl
needs to block on. The <em class="parameter"><code>events</code></em>
 field contains a bitmask of
<a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#CoglPollFDEvent" title="enum CoglPollFDEvent"><span class="type">CoglPollFDEvent</span></a>s that should cause the application to wake
up. After the application is woken up from idle it should pass back
an array of <a class="link" href="cogl-2.0-experimental-Main-loop-integration.html#CoglPollFD" title="CoglPollFD"><span class="type">CoglPollFD</span></a>s to Cogl and update the <em class="parameter"><code>revents</code></em>

mask to the actual events that occurred on the file descriptor.</p>
<p>Note that CoglPollFD is deliberately exactly the same as struct
pollfd on Unix so that it can simply be cast when calling poll.</p>
<div class="refsect3">
<a name="id-1.2.14.3.7.3.6"></a><h4>Members</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody>
<tr>
<td class="struct_member_name"><p><span class="type">int</span> <em class="structfield"><code><a name="CoglPollFD.fd"></a>fd</code></em>;</p></td>
<td class="struct_member_description"><p>The file descriptor to block on</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p>short <span class="type">int</span> <em class="structfield"><code><a name="CoglPollFD.events"></a>events</code></em>;</p></td>
<td class="struct_member_description"><p>A bitmask of events to block on</p></td>
<td class="struct_member_annotations"> </td>
</tr>
<tr>
<td class="struct_member_name"><p>short <span class="type">int</span> <em class="structfield"><code><a name="CoglPollFD.revents"></a>revents</code></em>;</p></td>
<td class="struct_member_description"><p>A bitmask of returned events</p></td>
<td class="struct_member_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: 1.10</p>
<p class="stability">Stability Level: <acronym title="Unstable interfaces are experimental or transitional. They are typically used to
give outside developers early access to new or rapidly changing technology, or
to provide an interim solution to a problem where a more general solution is
anticipated. No claims are made about either source or binary compatibility from
one minor release to the next.

The Unstable interface level is a warning that these interfaces are  subject to
change without warning and should not be used in unbundled products.

Given such caveats, customer impact need not be a factor when considering
incompatible changes to an Unstable interface in a major or minor release.
Nonetheless, when such changes are introduced, the changes should still be
mentioned in the release notes for the affected release.
"><span class="acronym">Unstable</span></acronym></p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.24</div>
</body>
</html>