|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /proc/22697/root/usr/share/gtk-doc/html/gdk/ |
Upload File : |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Input</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
<link rel="start" 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.6 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="reference" href="reference.html" title="API Reference">
<link rel="index" href="ix01.html" title="Index">
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
<link rel="index" href="ix03.html" title="Index of new symbols in 2.2">
<link rel="index" href="ix04.html" title="Index of new symbols in 2.4">
<link rel="index" href="ix05.html" title="Index of new symbols in 2.6">
<link rel="index" href="ix06.html" title="Index of new symbols in 2.8">
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
</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"><nobr><a href="#id3120858" class="shortcut">Top</a>
 | 
<a href="#id3121060" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="gdk-Input"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id3120858"></a><span class="refentrytitle">Input</span>
</h2>
<p>Input — Callbacks on file descriptors</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">
#include <gdk/gdk.h>
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> <a href="gdk-Input.html#gdk-input-add-full">gdk_input_add_full</a> (<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> source,
<a href="gdk-Input.html#GdkInputCondition">GdkInputCondition</a> condition,
<a href="gdk-Input.html#GdkInputFunction">GdkInputFunction</a> function,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> data,
<a href="gdk-Input.html#GdkDestroyNotify">GdkDestroyNotify</a> destroy);
enum <a href="gdk-Input.html#GdkInputCondition">GdkInputCondition</a>;
void (<a href="gdk-Input.html#GdkInputFunction">*GdkInputFunction</a>) (<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> data,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> source,
<a href="gdk-Input.html#GdkInputCondition">GdkInputCondition</a> condition);
void (<a href="gdk-Input.html#GdkDestroyNotify">*GdkDestroyNotify</a>) (<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> data);
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> <a href="gdk-Input.html#gdk-input-add">gdk_input_add</a> (<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> source,
<a href="gdk-Input.html#GdkInputCondition">GdkInputCondition</a> condition,
<a href="gdk-Input.html#GdkInputFunction">GdkInputFunction</a> function,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> data);
void <a href="gdk-Input.html#gdk-input-remove">gdk_input_remove</a> (<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> tag);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id3121060"></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="../glib/glib-IO-Channels.html"
>IO Channel</a>
facility.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id3121087"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id3121097"></a><h3>
<a name="gdk-input-add-full"></a>gdk_input_add_full ()</h3>
<a class="indexterm" name="id3121112"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> gdk_input_add_full (<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> source,
<a href="gdk-Input.html#GdkInputCondition">GdkInputCondition</a> condition,
<a href="gdk-Input.html#GdkInputFunction">GdkInputFunction</a> function,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> data,
<a href="gdk-Input.html#GdkDestroyNotify">GdkDestroyNotify</a> destroy);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gdk_input_add_full</code> is deprecated and should not be used in newly-written code.</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>
<span class="term"><em class="parameter"><code>source</code></em> :</span></td>
<td>a file descriptor.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>condition</code></em> :</span></td>
<td>the condition.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>function</code></em> :</span></td>
<td>the callback function.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>data</code></em> :</span></td>
<td>callback data passed to <em class="parameter"><code>function</code></em>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>destroy</code></em> :</span></td>
<td>callback function to call with <em class="parameter"><code>data</code></em> when the input
handler is removed.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td>a tag that can later be used as an argument to
<a href="gdk-Input.html#gdk-input-remove"><code class="function">gdk_input_remove()</code></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3121294"></a><h3>
<a name="GdkInputCondition"></a>enum GdkInputCondition</h3>
<a class="indexterm" name="id3121308"></a><pre class="programlisting">typedef enum
{
GDK_INPUT_READ = 1 << 0,
GDK_INPUT_WRITE = 1 << 1,
GDK_INPUT_EXCEPTION = 1 << 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>
<span class="term"><a name="GDK-INPUT-READ:CAPS"></a><code class="literal">GDK_INPUT_READ</code></span></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>
<span class="term"><a name="GDK-INPUT-WRITE:CAPS"></a><code class="literal">GDK_INPUT_WRITE</code></span></td>
<td>the file descriptor has become available for writing.
</td>
</tr>
<tr>
<td>
<span class="term"><a name="GDK-INPUT-EXCEPTION:CAPS"></a><code class="literal">GDK_INPUT_EXCEPTION</code></span></td>
<td>an exception was raised on the file descriptor.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3121430"></a><h3>
<a name="GdkInputFunction"></a>GdkInputFunction ()</h3>
<a class="indexterm" name="id3121442"></a><pre class="programlisting">void (*GdkInputFunction) (<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> data,
<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> source,
<a href="gdk-Input.html#GdkInputCondition">GdkInputCondition</a> condition);</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>
<span class="term"><em class="parameter"><code>data</code></em> :</span></td>
<td>the user data passed to <a href="gdk-Input.html#gdk-input-add"><code class="function">gdk_input_add()</code></a> or <a href="gdk-Input.html#gdk-input-add-full"><code class="function">gdk_input_add_full()</code></a>.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>source</code></em> :</span></td>
<td>the source where the condition occurred.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>condition</code></em> :</span></td>
<td>the triggering condition.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3121556"></a><h3>
<a name="GdkDestroyNotify"></a>GdkDestroyNotify ()</h3>
<a class="indexterm" name="id3121569"></a><pre class="programlisting">void (*GdkDestroyNotify) (<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> data);</pre>
<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>
<span class="term"><em class="parameter"><code>data</code></em> :</span></td>
<td>the user data.
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3121623"></a><h3>
<a name="gdk-input-add"></a>gdk_input_add ()</h3>
<a class="indexterm" name="id3121639"></a><pre class="programlisting"><a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> gdk_input_add (<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> source,
<a href="gdk-Input.html#GdkInputCondition">GdkInputCondition</a> condition,
<a href="gdk-Input.html#GdkInputFunction">GdkInputFunction</a> function,
<a
href="../glib/glib-Basic-Types.html#gpointer"
>gpointer</a> data);</pre>
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Warning</h3>
<p><code class="literal">gdk_input_add</code> is deprecated and should not be used in newly-written code.</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>
<span class="term"><em class="parameter"><code>source</code></em> :</span></td>
<td>a file descriptor.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>condition</code></em> :</span></td>
<td>the condition.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>function</code></em> :</span></td>
<td>the callback function.
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>data</code></em> :</span></td>
<td>callback data passed to <em class="parameter"><code>function</code></em>.
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td>a tag that can later be used as an argument to
<a href="gdk-Input.html#gdk-input-remove"><code class="function">gdk_input_remove()</code></a>.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id3121792"></a><h3>
<a name="gdk-input-remove"></a>gdk_input_remove ()</h3>
<a class="indexterm" name="id3121807"></a><pre class="programlisting">void gdk_input_remove (<a
href="../glib/glib-Basic-Types.html#gint"
>gint</a> tag);</pre>
<div class="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 href="gdk-Input.html#gdk-input-add"><code class="function">gdk_input_add()</code></a> or
<a href="gdk-Input.html#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>
<span class="term"><em class="parameter"><code>tag</code></em> :</span></td>
<td>the tag returned when the callback was set up.
</td>
</tr></tbody>
</table></div>
</div>
</div>
<div class="refsect1" lang="en">
<a name="id3121890"></a><h2>See Also</h2>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td>
<span class="term"><a
href="../glib/glib-The-Main-Event-Loop.html"
>GLib Main Loop</a></span></td>
<td><p>The main loop in which input callbacks run.</p></td>
</tr>
<tr>
<td>
<span class="term"><a
href="../glib/glib-IO-Channels.html"
>IO Channels</a></span></td>
<td><p>A newer and more flexible way of doing IO
callbacks.</p></td>
</tr>
</tbody>
</table></div>
<p>
</p>
</div>
</div>
</body>
</html>