<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="GCutEventLoop">
<refmeta>
<refentrytitle role="top_of_page" id="GCutEventLoop.top_of_page">Abstracted event loop</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>
  CUTTER Library
</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Abstracted event loop</refname>
<refpurpose>Abstracted event loop API for
customizing event loop in GCutter.</refpurpose>
</refnamediv>

<refsect1 id="GCutEventLoop.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_return" colwidth="150px"/>
<colspec colname="functions_name"/>
<tbody>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GCUT-EVENT-LOOP-ERROR:CAPS">GCUT_EVENT_LOOP_ERROR</link></entry></row>
<row><entry role="function_type"><link linkend="GQuark"><returnvalue>GQuark</returnvalue></link>
</entry><entry role="function_name"><link linkend="gcut-event-loop-error-quark">gcut_event_loop_error_quark</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gcut-event-loop-run">gcut_event_loop_run</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gcut-event-loop-iterate">gcut_event_loop_iterate</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gcut-event-loop-quit">gcut_event_loop_quit</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="guint"><returnvalue>guint</returnvalue></link>
</entry><entry role="function_name"><link linkend="gcut-event-loop-watch-io">gcut_event_loop_watch_io</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="guint"><returnvalue>guint</returnvalue></link>
</entry><entry role="function_name"><link linkend="gcut-event-loop-watch-child">gcut_event_loop_watch_child</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="guint"><returnvalue>guint</returnvalue></link>
</entry><entry role="function_name"><link linkend="gcut-event-loop-watch-child-full">gcut_event_loop_watch_child_full</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="guint"><returnvalue>guint</returnvalue></link>
</entry><entry role="function_name"><link linkend="gcut-event-loop-add-timeout">gcut_event_loop_add_timeout</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="guint"><returnvalue>guint</returnvalue></link>
</entry><entry role="function_name"><link linkend="gcut-event-loop-add-timeout-full">gcut_event_loop_add_timeout_full</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="guint"><returnvalue>guint</returnvalue></link>
</entry><entry role="function_name"><link linkend="gcut-event-loop-add-idle">gcut_event_loop_add_idle</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="guint"><returnvalue>guint</returnvalue></link>
</entry><entry role="function_name"><link linkend="gcut-event-loop-add-idle-full">gcut_event_loop_add_idle_full</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gcut-event-loop-remove">gcut_event_loop_remove</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="GCutEventLoop.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<screen>    <link linkend="GObject">GObject</link>
    <phrase role="lineart">&#9584;&#9472;&#9472;</phrase> GCutEventLoop
</screen>
</refsect1>


<refsect1 id="GCutEventLoop.description" role="desc">
<title role="desc.title">Description</title>
<para><link linkend="GCutEventLoop"><type>GCutEventLoop</type></link> encapsulates event loop. For example,
event loop is used in <link linkend="GCutProcess"><type>GCutProcess</type></link>. It uses the GLib's
default main context for it.</para>
<para>Normally, a custom <link linkend="GCutEventLoop"><type>GCutEventLoop</type></link> isn't required. It is
needed some special case. For example, using libev as
event loop backend instead of GLib's main loop.</para>
<para>GCutter provides <link linkend="GCutEventLoop"><type>GCutEventLoop</type></link> for GLib's main context
and main loop, <link linkend="GCutGLibEventLoop"><type>GCutGLibEventLoop</type></link>.</para>

</refsect1>
<refsect1 id="GCutEventLoop.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="GCUT-EVENT-LOOP-ERROR:CAPS" role="macro">
<title>GCUT_EVENT_LOOP_ERROR</title>
<indexterm zone="GCUT-EVENT-LOOP-ERROR:CAPS"><primary>GCUT_EVENT_LOOP_ERROR</primary></indexterm>
<programlisting language="C">#define GCUT_EVENT_LOOP_ERROR           (gcut_event_loop_error_quark())
</programlisting>
<para>
</para>
</refsect2>
<refsect2 id="gcut-event-loop-error-quark" role="function">
<title>gcut_event_loop_error_quark&#160;()</title>
<indexterm zone="gcut-event-loop-error-quark"><primary>gcut_event_loop_error_quark</primary></indexterm>
<programlisting language="C"><link linkend="GQuark"><returnvalue>GQuark</returnvalue></link>
gcut_event_loop_error_quark (<parameter><type>void</type></parameter>);</programlisting>
<para>
</para>
<refsect3 role="returns">
<title>Returns</title>

<para></para>
</refsect3></refsect2>
<refsect2 id="gcut-event-loop-run" role="function" condition="since:1.1.6">
<title>gcut_event_loop_run&#160;()</title>
<indexterm zone="gcut-event-loop-run" role="1.1.6"><primary>gcut_event_loop_run</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gcut_event_loop_run (<parameter><link linkend="GCutEventLoop"><type>GCutEventLoop</type></link> *loop</parameter>);</programlisting>
<para>Runs the given event loop until <link linkend="gcut-event-loop-quit"><function>gcut_event_loop_quit()</function></link> is
called on the loop.</para>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>loop</para></entry>
<entry role="parameter_description"><para>a <link linkend="GCutEventLoop"><type>GCutEventLoop</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since 1.1.6</para></refsect2>
<refsect2 id="gcut-event-loop-iterate" role="function" condition="since:1.1.6">
<title>gcut_event_loop_iterate&#160;()</title>
<indexterm zone="gcut-event-loop-iterate" role="1.1.6"><primary>gcut_event_loop_iterate</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gcut_event_loop_iterate (<parameter><link linkend="GCutEventLoop"><type>GCutEventLoop</type></link> *loop</parameter>,
                         <parameter><link linkend="gboolean"><type>gboolean</type></link> may_block</parameter>);</programlisting>
<para>Runs a single iteration for the given event loop. If no
events are ready and <parameter>may_block</parameter>
 is <link linkend="TRUE:CAPS"><literal>TRUE</literal></link>, waiting
for a event become ready. Otherwise, if <parameter>may_block</parameter>
 is
<link linkend="FALSE:CAPS"><literal>FALSE</literal></link>, events are not waited to become ready.</para>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>loop</para></entry>
<entry role="parameter_description"><para>a <link linkend="GCutEventLoop"><type>GCutEventLoop</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>may_block</para></entry>
<entry role="parameter_description"><para>whether the call may block.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if a event was dispatched.</para>
<para></para>
</refsect3><para role="since">Since 1.1.6</para></refsect2>
<refsect2 id="gcut-event-loop-quit" role="function" condition="since:1.1.6">
<title>gcut_event_loop_quit&#160;()</title>
<indexterm zone="gcut-event-loop-quit" role="1.1.6"><primary>gcut_event_loop_quit</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gcut_event_loop_quit (<parameter><link linkend="GCutEventLoop"><type>GCutEventLoop</type></link> *loop</parameter>);</programlisting>
<para>Stops the <parameter>loop</parameter>
 from running.</para>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>loop</para></entry>
<entry role="parameter_description"><para>a <link linkend="GCutEventLoop"><type>GCutEventLoop</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><para role="since">Since 1.1.6</para></refsect2>
<refsect2 id="gcut-event-loop-watch-io" role="function" condition="since:1.1.6">
<title>gcut_event_loop_watch_io&#160;()</title>
<indexterm zone="gcut-event-loop-watch-io" role="1.1.6"><primary>gcut_event_loop_watch_io</primary></indexterm>
<programlisting language="C"><link linkend="guint"><returnvalue>guint</returnvalue></link>
gcut_event_loop_watch_io (<parameter><link linkend="GCutEventLoop"><type>GCutEventLoop</type></link> *loop</parameter>,
                          <parameter><link linkend="GIOChannel"><type>GIOChannel</type></link> *channel</parameter>,
                          <parameter><link linkend="GIOCondition"><type>GIOCondition</type></link> condition</parameter>,
                          <parameter><link linkend="GIOFunc"><type>GIOFunc</type></link> function</parameter>,
                          <parameter><link linkend="gpointer"><type>gpointer</type></link> data</parameter>);</programlisting>
<para>Adds the <parameter>channel</parameter>
 into <parameter>loop</parameter>
 with the default
priority. <parameter>function</parameter>
 is called when <parameter>condition</parameter>
 is met for
the given <parameter>channel</parameter>
.</para>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>loop</para></entry>
<entry role="parameter_description"><para>a <link linkend="GCutEventLoop"><type>GCutEventLoop</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>channel</para></entry>
<entry role="parameter_description"><para>a <link linkend="GIOChannel"><type>GIOChannel</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>condition</para></entry>
<entry role="parameter_description"><para>conditions to watch for</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>function</para></entry>
<entry role="parameter_description"><para>function to call</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>data</para></entry>
<entry role="parameter_description"><para>data to pass to <parameter>function</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> the event ID.</para>
<para></para>
</refsect3><para role="since">Since 1.1.6</para></refsect2>
<refsect2 id="gcut-event-loop-watch-child" role="function" condition="since:1.1.6">
<title>gcut_event_loop_watch_child&#160;()</title>
<indexterm zone="gcut-event-loop-watch-child" role="1.1.6"><primary>gcut_event_loop_watch_child</primary></indexterm>
<programlisting language="C"><link linkend="guint"><returnvalue>guint</returnvalue></link>
gcut_event_loop_watch_child (<parameter><link linkend="GCutEventLoop"><type>GCutEventLoop</type></link> *loop</parameter>,
                             <parameter><link linkend="GPid"><type>GPid</type></link> pid</parameter>,
                             <parameter><link linkend="GChildWatchFunc"><type>GChildWatchFunc</type></link> function</parameter>,
                             <parameter><link linkend="gpointer"><type>gpointer</type></link> data</parameter>);</programlisting>
<para>Adds the <parameter>function</parameter>
 to be called when the child indicated
by <parameter>pid</parameter>
 exits into <parameter>loop</parameter>
 with the default priority.</para>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>loop</para></entry>
<entry role="parameter_description"><para>a <link linkend="GCutEventLoop"><type>GCutEventLoop</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>pid</para></entry>
<entry role="parameter_description"><para>process ID to watch</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>function</para></entry>
<entry role="parameter_description"><para>function to call</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>data</para></entry>
<entry role="parameter_description"><para>data to pass to <parameter>function</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> the event ID.</para>
<para></para>
</refsect3><para role="since">Since 1.1.6</para></refsect2>
<refsect2 id="gcut-event-loop-watch-child-full" role="function" condition="since:1.1.6">
<title>gcut_event_loop_watch_child_full&#160;()</title>
<indexterm zone="gcut-event-loop-watch-child-full" role="1.1.6"><primary>gcut_event_loop_watch_child_full</primary></indexterm>
<programlisting language="C"><link linkend="guint"><returnvalue>guint</returnvalue></link>
gcut_event_loop_watch_child_full (<parameter><link linkend="GCutEventLoop"><type>GCutEventLoop</type></link> *loop</parameter>,
                                  <parameter><link linkend="gint"><type>gint</type></link> priority</parameter>,
                                  <parameter><link linkend="GPid"><type>GPid</type></link> pid</parameter>,
                                  <parameter><link linkend="GChildWatchFunc"><type>GChildWatchFunc</type></link> function</parameter>,
                                  <parameter><link linkend="gpointer"><type>gpointer</type></link> data</parameter>,
                                  <parameter><link linkend="GDestroyNotify"><type>GDestroyNotify</type></link> notify</parameter>);</programlisting>
<para>Adds the <parameter>function</parameter>
 to be called when the child indicated
by <parameter>pid</parameter>
 exits into <parameter>loop</parameter>
 with the <parameter>priority</parameter>
.</para>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>loop</para></entry>
<entry role="parameter_description"><para>a <link linkend="GCutEventLoop"><type>GCutEventLoop</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>priority</para></entry>
<entry role="parameter_description"><para>the priority of the event.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>pid</para></entry>
<entry role="parameter_description"><para>process ID to watch</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>function</para></entry>
<entry role="parameter_description"><para>function to call</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>data</para></entry>
<entry role="parameter_description"><para>data to pass to <parameter>function</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>notify</para></entry>
<entry role="parameter_description"><para>function to call when the event is removed, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> the event ID.</para>
<para></para>
</refsect3><para role="since">Since 1.1.6</para></refsect2>
<refsect2 id="gcut-event-loop-add-timeout" role="function" condition="since:1.1.6">
<title>gcut_event_loop_add_timeout&#160;()</title>
<indexterm zone="gcut-event-loop-add-timeout" role="1.1.6"><primary>gcut_event_loop_add_timeout</primary></indexterm>
<programlisting language="C"><link linkend="guint"><returnvalue>guint</returnvalue></link>
gcut_event_loop_add_timeout (<parameter><link linkend="GCutEventLoop"><type>GCutEventLoop</type></link> *loop</parameter>,
                             <parameter><link linkend="gdouble"><type>gdouble</type></link> interval_in_seconds</parameter>,
                             <parameter><link linkend="GSourceFunc"><type>GSourceFunc</type></link> function</parameter>,
                             <parameter><link linkend="gpointer"><type>gpointer</type></link> data</parameter>);</programlisting>
<para>Adds the <parameter>function</parameter>
 to be called at regular intervals,
with the default priority.</para>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>loop</para></entry>
<entry role="parameter_description"><para>a <link linkend="GCutEventLoop"><type>GCutEventLoop</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>interval_in_seconds</para></entry>
<entry role="parameter_description"><para>the time between calls to the <parameter>function</parameter>
, in seconds.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>function</para></entry>
<entry role="parameter_description"><para>function to call</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>data</para></entry>
<entry role="parameter_description"><para>data to pass to <parameter>function</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> the event ID.</para>
<para></para>
</refsect3><para role="since">Since 1.1.6</para></refsect2>
<refsect2 id="gcut-event-loop-add-timeout-full" role="function" condition="since:1.1.6">
<title>gcut_event_loop_add_timeout_full&#160;()</title>
<indexterm zone="gcut-event-loop-add-timeout-full" role="1.1.6"><primary>gcut_event_loop_add_timeout_full</primary></indexterm>
<programlisting language="C"><link linkend="guint"><returnvalue>guint</returnvalue></link>
gcut_event_loop_add_timeout_full (<parameter><link linkend="GCutEventLoop"><type>GCutEventLoop</type></link> *loop</parameter>,
                                  <parameter><link linkend="gint"><type>gint</type></link> priority</parameter>,
                                  <parameter><link linkend="gdouble"><type>gdouble</type></link> interval_in_seconds</parameter>,
                                  <parameter><link linkend="GSourceFunc"><type>GSourceFunc</type></link> function</parameter>,
                                  <parameter><link linkend="gpointer"><type>gpointer</type></link> data</parameter>,
                                  <parameter><link linkend="GDestroyNotify"><type>GDestroyNotify</type></link> notify</parameter>);</programlisting>
<para>Adds the <parameter>function</parameter>
 to be called at regular intervals,
with the <parameter>priority</parameter>
.</para>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>loop</para></entry>
<entry role="parameter_description"><para>a <link linkend="GCutEventLoop"><type>GCutEventLoop</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>priority</para></entry>
<entry role="parameter_description"><para>the priority of the event.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>interval_in_seconds</para></entry>
<entry role="parameter_description"><para>the time between calls to the <parameter>function</parameter>
, in seconds.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>function</para></entry>
<entry role="parameter_description"><para>function to call</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>data</para></entry>
<entry role="parameter_description"><para>data to pass to <parameter>function</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>notify</para></entry>
<entry role="parameter_description"><para>function to call when the event is removed, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> the event ID.</para>
<para></para>
</refsect3><para role="since">Since 1.1.6</para></refsect2>
<refsect2 id="gcut-event-loop-add-idle" role="function" condition="since:1.1.6">
<title>gcut_event_loop_add_idle&#160;()</title>
<indexterm zone="gcut-event-loop-add-idle" role="1.1.6"><primary>gcut_event_loop_add_idle</primary></indexterm>
<programlisting language="C"><link linkend="guint"><returnvalue>guint</returnvalue></link>
gcut_event_loop_add_idle (<parameter><link linkend="GCutEventLoop"><type>GCutEventLoop</type></link> *loop</parameter>,
                          <parameter><link linkend="GSourceFunc"><type>GSourceFunc</type></link> function</parameter>,
                          <parameter><link linkend="gpointer"><type>gpointer</type></link> data</parameter>);</programlisting>
<para>Adds the <parameter>function</parameter>
 to be called whenever there are no
higher priority events pending with the default priority.</para>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>loop</para></entry>
<entry role="parameter_description"><para>a <link linkend="GCutEventLoop"><type>GCutEventLoop</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>function</para></entry>
<entry role="parameter_description"><para>function to call</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>data</para></entry>
<entry role="parameter_description"><para>data to pass to <parameter>function</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> the event ID.</para>
<para></para>
</refsect3><para role="since">Since 1.1.6</para></refsect2>
<refsect2 id="gcut-event-loop-add-idle-full" role="function" condition="since:1.1.6">
<title>gcut_event_loop_add_idle_full&#160;()</title>
<indexterm zone="gcut-event-loop-add-idle-full" role="1.1.6"><primary>gcut_event_loop_add_idle_full</primary></indexterm>
<programlisting language="C"><link linkend="guint"><returnvalue>guint</returnvalue></link>
gcut_event_loop_add_idle_full (<parameter><link linkend="GCutEventLoop"><type>GCutEventLoop</type></link> *loop</parameter>,
                               <parameter><link linkend="gint"><type>gint</type></link> priority</parameter>,
                               <parameter><link linkend="GSourceFunc"><type>GSourceFunc</type></link> function</parameter>,
                               <parameter><link linkend="gpointer"><type>gpointer</type></link> data</parameter>,
                               <parameter><link linkend="GDestroyNotify"><type>GDestroyNotify</type></link> notify</parameter>);</programlisting>
<para>Adds the <parameter>function</parameter>
 to be called whenever there are no
higher priority events pending with the <parameter>priority</parameter>
.</para>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>loop</para></entry>
<entry role="parameter_description"><para>a <link linkend="GCutEventLoop"><type>GCutEventLoop</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>priority</para></entry>
<entry role="parameter_description"><para>the priority of the event.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>function</para></entry>
<entry role="parameter_description"><para>function to call</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>data</para></entry>
<entry role="parameter_description"><para>data to pass to <parameter>function</parameter>
</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>notify</para></entry>
<entry role="parameter_description"><para>function to call when the event is removed, or <link linkend="NULL:CAPS"><literal>NULL</literal></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> the event ID.</para>
<para></para>
</refsect3><para role="since">Since 1.1.6</para></refsect2>
<refsect2 id="gcut-event-loop-remove" role="function" condition="since:1.1.6">
<title>gcut_event_loop_remove&#160;()</title>
<indexterm zone="gcut-event-loop-remove" role="1.1.6"><primary>gcut_event_loop_remove</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gcut_event_loop_remove (<parameter><link linkend="GCutEventLoop"><type>GCutEventLoop</type></link> *loop</parameter>,
                        <parameter><link linkend="guint"><type>guint</type></link> tag</parameter>);</programlisting>
<para>Removes the event with the given ID, <parameter>tag</parameter>
.</para>
<refsect3 role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>loop</para></entry>
<entry role="parameter_description"><para>a <link linkend="GCutEventLoop"><type>GCutEventLoop</type></link>.</para></entry>
<entry role="parameter_annotations"></entry></row>
<row><entry role="parameter_name"><para>tag</para></entry>
<entry role="parameter_description"><para>the ID of the source to remove</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the source was found and removed.</para>
<para></para>
</refsect3><para role="since">Since 1.1.6</para></refsect2>

</refsect1>
<refsect1 id="GCutEventLoop.other_details" role="details">
<title role="details.title">Types and Values</title>

</refsect1>

</refentry>
