File: gdk-Input.html

package info (click to toggle)
gtk%2B2.0 2.20.1-2%2Bdeb6u2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 136,284 kB
  • ctags: 66,487
  • sloc: ansic: 590,318; sh: 10,559; makefile: 5,573; xml: 1,357; python: 866; perl: 776; asm: 457; awk: 72; cpp: 34
file content (316 lines) | stat: -rw-r--r-- 18,769 bytes parent folder | download | duplicates (2)
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Input</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="GDK Reference Manual">
<link rel="up" href="reference.html" title="API Reference">
<link rel="prev" href="gdk-Threads.html" title="Threads">
<link rel="next" href="gdk-Input-Devices.html" title="Input Devices">
<meta name="generator" content="GTK-Doc V1.14 (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="2">
<tr valign="middle">
<td><a accesskey="p" href="gdk-Threads.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="reference.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">GDK Reference Manual</th>
<td><a accesskey="n" href="gdk-Input-Devices.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gdk-Input.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#gdk-Input.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry" title="Input">
<a name="gdk-Input"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gdk-Input.top_of_page"></a>Input</span></h2>
<p>Input — Callbacks on file descriptors</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="gdk-Input.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gdk/gdk.h&gt;

<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                <a class="link" href="gdk-Input.html#gdk-input-add-full" title="gdk_input_add_full ()">gdk_input_add_full</a>                  (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> source</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Input.html#GdkInputCondition" title="enum GdkInputCondition"><span class="type">GdkInputCondition</span></a> condition</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Input.html#GdkInputFunction" title="GdkInputFunction ()"><span class="type">GdkInputFunction</span></a> function</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy</code></em>);
enum                <a class="link" href="gdk-Input.html#GdkInputCondition" title="enum GdkInputCondition">GdkInputCondition</a>;
<span class="returnvalue">void</span>                (<a class="link" href="gdk-Input.html#GdkInputFunction" title="GdkInputFunction ()">*GdkInputFunction</a>)                 (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> source</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Input.html#GdkInputCondition" title="enum GdkInputCondition"><span class="type">GdkInputCondition</span></a> condition</code></em>);
<span class="returnvalue">void</span>                (<a class="link" href="gdk-Input.html#GdkDestroyNotify" title="GdkDestroyNotify ()">*GdkDestroyNotify</a>)                 (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                <a class="link" href="gdk-Input.html#gdk-input-add" title="gdk_input_add ()">gdk_input_add</a>                       (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> source</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Input.html#GdkInputCondition" title="enum GdkInputCondition"><span class="type">GdkInputCondition</span></a> condition</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Input.html#GdkInputFunction" title="GdkInputFunction ()"><span class="type">GdkInputFunction</span></a> function</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gdk-Input.html#gdk-input-remove" title="gdk_input_remove ()">gdk_input_remove</a>                    (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> tag</code></em>);
</pre>
</div>
<div class="refsect1" title="Description">
<a name="gdk-Input.description"></a><h2>Description</h2>
<p>
The functions in this section are used to establish
callbacks when some condition becomes true for
a file descriptor. They are currently just wrappers around
the <a href="/usr/share/gtk-doc/html/glib/glib-IO-Channels.html">IO Channel</a>
facility.
</p>
</div>
<div class="refsect1" title="Details">
<a name="gdk-Input.details"></a><h2>Details</h2>
<div class="refsect2" title="gdk_input_add_full ()">
<a name="gdk-input-add-full"></a><h3>gdk_input_add_full ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                gdk_input_add_full                  (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> source</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Input.html#GdkInputCondition" title="enum GdkInputCondition"><span class="type">GdkInputCondition</span></a> condition</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Input.html#GdkInputFunction" title="GdkInputFunction ()"><span class="type">GdkInputFunction</span></a> function</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy</code></em>);</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gdk_input_add_full</code> has been deprecated since version 2.14 and should not be used in newly-written code. Use <a href="/usr/share/gtk-doc/html/glib/glib-IO-Channels.html#g-io-add-watch-full"><code class="function">g_io_add_watch_full()</code></a> on a <a href="/usr/share/gtk-doc/html/glib/glib-IO-Channels.html#GIOChannel"><span class="type">GIOChannel</span></a></p>
</div>
<p>
Establish a callback when a condition becomes true on
a file descriptor.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>source</code></em> :</span></p></td>
<td>a file descriptor.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>condition</code></em> :</span></p></td>
<td>the condition.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>function</code></em> :</span></p></td>
<td>the callback function.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>callback data passed to <em class="parameter"><code>function</code></em>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>destroy</code></em> :</span></p></td>
<td>callback function to call with <em class="parameter"><code>data</code></em> when the input
handler is removed.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a tag that can later be used as an argument to
<a class="link" href="gdk-Input.html#gdk-input-remove" title="gdk_input_remove ()"><code class="function">gdk_input_remove()</code></a>.

</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="enum GdkInputCondition">
<a name="GdkInputCondition"></a><h3>enum GdkInputCondition</h3>
<pre class="programlisting">typedef enum
{
  GDK_INPUT_READ       = 1 &lt;&lt; 0,
  GDK_INPUT_WRITE      = 1 &lt;&lt; 1,
  GDK_INPUT_EXCEPTION  = 1 &lt;&lt; 2
} GdkInputCondition;
</pre>
<p>
A set of bit flags used to specify conditions for which
an input callback will be triggered. The three members
of this enumeration correspond to the <em class="parameter"><code>readfds</code></em>,
<em class="parameter"><code>writefds</code></em>, and <em class="parameter"><code>exceptfds</code></em> arguments to the
<code class="function">select</code> system call.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="GDK-INPUT-READ:CAPS"></a><span class="term"><code class="literal">GDK_INPUT_READ</code></span></p></td>
<td>the file descriptor has become available for reading.
(Or, as is standard in Unix, a socket or pipe was closed
at the other end; this is the case if a subsequent read
on the file descriptor returns a count of zero.)
</td>
</tr>
<tr>
<td><p><a name="GDK-INPUT-WRITE:CAPS"></a><span class="term"><code class="literal">GDK_INPUT_WRITE</code></span></p></td>
<td>the file descriptor has become available for writing.
</td>
</tr>
<tr>
<td><p><a name="GDK-INPUT-EXCEPTION:CAPS"></a><span class="term"><code class="literal">GDK_INPUT_EXCEPTION</code></span></p></td>
<td>an exception was raised on the file descriptor.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="GdkInputFunction ()">
<a name="GdkInputFunction"></a><h3>GdkInputFunction ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                (*GdkInputFunction)                 (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> source</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Input.html#GdkInputCondition" title="enum GdkInputCondition"><span class="type">GdkInputCondition</span></a> condition</code></em>);</pre>
<p>
A callback function that will be called when some condition
occurs.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>the user data passed to <a class="link" href="gdk-Input.html#gdk-input-add" title="gdk_input_add ()"><code class="function">gdk_input_add()</code></a> or <a class="link" href="gdk-Input.html#gdk-input-add-full" title="gdk_input_add_full ()"><code class="function">gdk_input_add_full()</code></a>.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>source</code></em> :</span></p></td>
<td>the source where the condition occurred.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>condition</code></em> :</span></p></td>
<td>the triggering condition.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="GdkDestroyNotify ()">
<a name="GdkDestroyNotify"></a><h3>GdkDestroyNotify ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                (*GdkDestroyNotify)                 (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">GdkDestroyNotify</code> is deprecated and should not be used in newly-written code.</p>
</div>
<p>
A callback function called when a piece of user data is
no longer being stored by GDK. Will typically free the
structure or object that <em class="parameter"><code>data</code></em> points to.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>the user data.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gdk_input_add ()">
<a name="gdk-input-add"></a><h3>gdk_input_add ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a>                gdk_input_add                       (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> source</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Input.html#GdkInputCondition" title="enum GdkInputCondition"><span class="type">GdkInputCondition</span></a> condition</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Input.html#GdkInputFunction" title="GdkInputFunction ()"><span class="type">GdkInputFunction</span></a> function</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gdk_input_add</code> has been deprecated since version 2.14 and should not be used in newly-written code. Use <a href="/usr/share/gtk-doc/html/glib/glib-IO-Channels.html#g-io-add-watch"><code class="function">g_io_add_watch()</code></a> on a <a href="/usr/share/gtk-doc/html/glib/glib-IO-Channels.html#GIOChannel"><span class="type">GIOChannel</span></a></p>
</div>
<p>
Establish a callback when a condition becomes true on
a file descriptor.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>source</code></em> :</span></p></td>
<td>a file descriptor.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>condition</code></em> :</span></p></td>
<td>the condition.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>function</code></em> :</span></p></td>
<td>the callback function.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>callback data passed to <em class="parameter"><code>function</code></em>.
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> a tag that can later be used as an argument to
<a class="link" href="gdk-Input.html#gdk-input-remove" title="gdk_input_remove ()"><code class="function">gdk_input_remove()</code></a>.

</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" title="gdk_input_remove ()">
<a name="gdk-input-remove"></a><h3>gdk_input_remove ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_input_remove                    (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> tag</code></em>);</pre>
<div class="warning" title="Warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gdk_input_remove</code> is deprecated and should not be used in newly-written code.</p>
</div>
<p>
Remove a callback added with <a class="link" href="gdk-Input.html#gdk-input-add" title="gdk_input_add ()"><code class="function">gdk_input_add()</code></a> or
<a class="link" href="gdk-Input.html#gdk-input-add-full" title="gdk_input_add_full ()"><code class="function">gdk_input_add_full()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>tag</code></em> :</span></p></td>
<td>the tag returned when the callback was set up.
</td>
</tr></tbody>
</table></div>
</div>
</div>
<div class="refsect1" title="See Also">
<a name="gdk-Input.see-also"></a><h2>See Also</h2>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-The-Main-Event-Loop.html">GLib Main Loop</a></span></p></td>
<td><p>The main loop in which input callbacks run.</p></td>
</tr>
<tr>
<td><p><span class="term"><a href="/usr/share/gtk-doc/html/glib/glib-IO-Channels.html">IO Channels</a></span></p></td>
<td><p>A newer and more flexible way of doing IO
callbacks.</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.14</div>
</body>
</html>