1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
5 Callbacks on file descriptors.
7 <!-- ##### SECTION Long_Description ##### -->
9 The functions in this section are used to establish
10 callbacks when some condition becomes true for
11 a file descriptor. They are currently just wrappers around
12 the <link linkend="glib-IO-Channels">IO Channel</link>
16 <!-- ##### SECTION See_Also ##### -->
21 <term><link linkend="glib-The-Main-Event-Loop">GLib Main Loop</link></term>
22 <listitem><para>The main loop in which input callbacks run.</para></listitem>
26 <term><link linkend="glib-IO-Channels">IO Channels</link></term>
27 <listitem><para>A newer and more flexible way of doing IO
28 callbacks.</para></listitem>
34 <!-- ##### FUNCTION gdk_input_add_full ##### -->
36 Establish a callback when a condition becomes true on
40 @source: a file descriptor.
41 @condition: the condition.
42 @function: the callback function.
43 @data: callback data passed to @function.
44 @destroy: callback function to call with @data when the input
46 @Returns: a tag that can later be used as an argument to
50 <!-- ##### ENUM GdkInputCondition ##### -->
52 A set of bit flags used to specify conditions for which
53 an input callback will be triggered. The three members
54 of this enumeration correspond to the @readfds,
55 @writefds, and @exceptfds arguments to the
56 <function>select</function> system call.
58 <informaltable pgwide="1" frame="none" role="enum">
59 <tgroup cols="2"><colspec colwidth="2*"/><colspec colwidth="8*"/>
63 <entry>GDK_INPUT_READ</entry>
64 <entry>the file descriptor has become available for reading.
65 (Or, as is standard in Unix, a socket or pipe was closed
66 at the other end; this is the case if a subsequent read
67 on the file descriptor returns a count of zero.)</entry>
71 <entry>GDK_INPUT_WRITE</entry>
72 <entry>the file descriptor has become available for writing.</entry>
76 <entry>GDK_INPUT_EXCEPTION</entry>
77 <entry>an exception was raised on the file descriptor.</entry>
80 </tbody></tgroup></informaltable>
87 <!-- ##### USER_FUNCTION GdkInputFunction ##### -->
89 A callback function that will be called when some condition
93 @data: the user data passed to gdk_input_add() or gdk_input_add_full().
94 @source: the source where the condition occurred.
95 @condition: the triggering condition.
98 <!-- ##### USER_FUNCTION GdkDestroyNotify ##### -->
100 A callback function called when a piece of user data is
101 no longer being stored by GDK. Will typically free the
102 structure or object that @data points to.
105 @data: the user data.
108 <!-- ##### FUNCTION gdk_input_add ##### -->
110 Establish a callback when a condition becomes true on
114 @source: a file descriptor.
115 @condition: the condition.
116 @function: the callback function.
117 @data: callback data passed to @function.
118 @Returns: a tag that can later be used as an argument to
122 <!-- ##### FUNCTION gdk_input_remove ##### -->
124 Remove a callback added with gdk_input_add() or
125 gdk_input_add_full().
128 @tag: the tag returned when the callback was set up.