<?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>

<refsynopsisdiv id="GCutEventLoop.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>#define             <link linkend="GCUT-EVENT-LOOP-ERROR:CAPS">GCUT_EVENT_LOOP_ERROR</link>
                    <link linkend="GCutEventLoop-struct">GCutEventLoop</link>;
                    <link linkend="GCutEventLoopClass">GCutEventLoopClass</link>;
<link linkend="GQuark"><returnvalue>GQuark</returnvalue></link>              <link linkend="gcut-event-loop-error-quark">gcut_event_loop_error_quark</link>         (<parameter><type>void</type></parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="gcut-event-loop-run">gcut_event_loop_run</link>                 (<parameter><link linkend="GCutEventLoop"><type>GCutEventLoop</type></link> *loop</parameter>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="gcut-event-loop-iterate">gcut_event_loop_iterate</link>             (<parameter><link linkend="GCutEventLoop"><type>GCutEventLoop</type></link> *loop</parameter>,
                                                         <parameter><link linkend="gboolean"><type>gboolean</type></link> may_block</parameter>);
<link linkend="void"><returnvalue>void</returnvalue></link>                <link linkend="gcut-event-loop-quit">gcut_event_loop_quit</link>                (<parameter><link linkend="GCutEventLoop"><type>GCutEventLoop</type></link> *loop</parameter>);
<link linkend="guint"><returnvalue>guint</returnvalue></link>               <link linkend="gcut-event-loop-watch-io">gcut_event_loop_watch_io</link>            (<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>);
<link linkend="guint"><returnvalue>guint</returnvalue></link>               <link linkend="gcut-event-loop-watch-child">gcut_event_loop_watch_child</link>         (<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>);
<link linkend="guint"><returnvalue>guint</returnvalue></link>               <link linkend="gcut-event-loop-watch-child-full">gcut_event_loop_watch_child_full</link>    (<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>);
<link linkend="guint"><returnvalue>guint</returnvalue></link>               <link linkend="gcut-event-loop-add-timeout">gcut_event_loop_add_timeout</link>         (<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>);
<link linkend="guint"><returnvalue>guint</returnvalue></link>               <link linkend="gcut-event-loop-add-timeout-full">gcut_event_loop_add_timeout_full</link>    (<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>);
<link linkend="guint"><returnvalue>guint</returnvalue></link>               <link linkend="gcut-event-loop-add-idle">gcut_event_loop_add_idle</link>            (<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>);
<link linkend="guint"><returnvalue>guint</returnvalue></link>               <link linkend="gcut-event-loop-add-idle-full">gcut_event_loop_add_idle_full</link>       (<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>);
<link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>            <link linkend="gcut-event-loop-remove">gcut_event_loop_remove</link>              (<parameter><link linkend="GCutEventLoop"><type>GCutEventLoop</type></link> *loop</parameter>,
                                                         <parameter><link linkend="guint"><type>guint</type></link> tag</parameter>);
</synopsis>
</refsynopsisdiv>
<refsect1 id="GCutEventLoop.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  <link linkend="GObject">GObject</link>
   +----GCutEventLoop
</synopsis>
</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.details" role="details">
<title role="details.title">Details</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>#define GCUT_EVENT_LOOP_ERROR           (gcut_event_loop_error_quark())
</programlisting>
<para>
</para></refsect2>
<refsect2 id="GCutEventLoop-struct" role="struct">
<title>GCutEventLoop</title>
<indexterm zone="GCutEventLoop-struct"><primary>GCutEventLoop</primary></indexterm>
<programlisting>typedef struct _GCutEventLoop GCutEventLoop;</programlisting>
<para>
</para></refsect2>
<refsect2 id="GCutEventLoopClass" role="struct">
<title>GCutEventLoopClass</title>
<indexterm zone="GCutEventLoopClass"><primary>GCutEventLoopClass</primary></indexterm>
<programlisting>typedef struct {
    GObjectClass parent_class;

    void     (*run)              (GCutEventLoop   *loop);
    gboolean (*iterate)          (GCutEventLoop   *loop,
                                  gboolean         may_block);
    void     (*quit)             (GCutEventLoop   *loop);

    guint    (*watch_io)         (GCutEventLoop   *loop,
                                  GIOChannel      *channel,
                                  GIOCondition     condition,
                                  GIOFunc          function,
                                  gpointer         data);
    guint    (*watch_child_full) (GCutEventLoop   *loop,
                                  gint             priority,
                                  GPid             pid,
                                  GChildWatchFunc  function,
                                  gpointer         data,
                                  GDestroyNotify   notify);
    guint    (*add_timeout_full) (GCutEventLoop   *loop,
                                  gint             priority,
                                  gdouble          interval_in_seconds,
                                  GSourceFunc      function,
                                  gpointer         data,
                                  GDestroyNotify   notify);
    guint    (*add_idle_full)    (GCutEventLoop   *loop,
                                  gint             priority,
                                  GSourceFunc      function,
                                  gpointer         data,
                                  GDestroyNotify   notify);
    gboolean (*remove)           (GCutEventLoop   *loop,
                                  guint            tag);
} GCutEventLoopClass;
</programlisting>
<para>
</para></refsect2>
<refsect2 id="gcut-event-loop-error-quark" role="function">
<title>gcut_event_loop_error_quark ()</title>
<indexterm zone="gcut-event-loop-error-quark"><primary>gcut_event_loop_error_quark</primary></indexterm>
<programlisting><link linkend="GQuark"><returnvalue>GQuark</returnvalue></link>              gcut_event_loop_error_quark         (<parameter><type>void</type></parameter>);</programlisting>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gcut-event-loop-run" role="function" condition="since:1.1.6">
<title>gcut_event_loop_run ()</title>
<indexterm zone="gcut-event-loop-run" role="1.1.6"><primary>gcut_event_loop_run</primary></indexterm>
<programlisting><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><variablelist role="params">
<varlistentry><term><parameter>loop</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GCutEventLoop"><type>GCutEventLoop</type></link>.
</simpara></listitem></varlistentry>
</variablelist><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 ()</title>
<indexterm zone="gcut-event-loop-iterate" role="1.1.6"><primary>gcut_event_loop_iterate</primary></indexterm>
<programlisting><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><variablelist role="params">
<varlistentry><term><parameter>loop</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GCutEventLoop"><type>GCutEventLoop</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>may_block</parameter>&#160;:</term>
<listitem><simpara>whether the call may block.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if a event was dispatched.

</simpara></listitem></varlistentry>
</variablelist><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 ()</title>
<indexterm zone="gcut-event-loop-quit" role="1.1.6"><primary>gcut_event_loop_quit</primary></indexterm>
<programlisting><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><variablelist role="params">
<varlistentry><term><parameter>loop</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GCutEventLoop"><type>GCutEventLoop</type></link>.
</simpara></listitem></varlistentry>
</variablelist><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 ()</title>
<indexterm zone="gcut-event-loop-watch-io" role="1.1.6"><primary>gcut_event_loop_watch_io</primary></indexterm>
<programlisting><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><variablelist role="params">
<varlistentry><term><parameter>loop</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GCutEventLoop"><type>GCutEventLoop</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>channel</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GIOChannel"><type>GIOChannel</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>condition</parameter>&#160;:</term>
<listitem><simpara>conditions to watch for
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>function</parameter>&#160;:</term>
<listitem><simpara>function to call
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>data to pass to <parameter>function</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the event ID.

</simpara></listitem></varlistentry>
</variablelist><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 ()</title>
<indexterm zone="gcut-event-loop-watch-child" role="1.1.6"><primary>gcut_event_loop_watch_child</primary></indexterm>
<programlisting><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><variablelist role="params">
<varlistentry><term><parameter>loop</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GCutEventLoop"><type>GCutEventLoop</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pid</parameter>&#160;:</term>
<listitem><simpara>process ID to watch
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>function</parameter>&#160;:</term>
<listitem><simpara>function to call
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>data to pass to <parameter>function</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the event ID.

</simpara></listitem></varlistentry>
</variablelist><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 ()</title>
<indexterm zone="gcut-event-loop-watch-child-full" role="1.1.6"><primary>gcut_event_loop_watch_child_full</primary></indexterm>
<programlisting><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><variablelist role="params">
<varlistentry><term><parameter>loop</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GCutEventLoop"><type>GCutEventLoop</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>priority</parameter>&#160;:</term>
<listitem><simpara>the priority of the event.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pid</parameter>&#160;:</term>
<listitem><simpara>process ID to watch
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>function</parameter>&#160;:</term>
<listitem><simpara>function to call
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>data to pass to <parameter>function</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>notify</parameter>&#160;:</term>
<listitem><simpara>function to call when the event is removed, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the event ID.

</simpara></listitem></varlistentry>
</variablelist><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 ()</title>
<indexterm zone="gcut-event-loop-add-timeout" role="1.1.6"><primary>gcut_event_loop_add_timeout</primary></indexterm>
<programlisting><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><variablelist role="params">
<varlistentry><term><parameter>loop</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GCutEventLoop"><type>GCutEventLoop</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>interval_in_seconds</parameter>&#160;:</term>
<listitem><simpara>the time between calls to the <parameter>function</parameter>, in seconds.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>function</parameter>&#160;:</term>
<listitem><simpara>function to call
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>data to pass to <parameter>function</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the event ID.

</simpara></listitem></varlistentry>
</variablelist><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 ()</title>
<indexterm zone="gcut-event-loop-add-timeout-full" role="1.1.6"><primary>gcut_event_loop_add_timeout_full</primary></indexterm>
<programlisting><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><variablelist role="params">
<varlistentry><term><parameter>loop</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GCutEventLoop"><type>GCutEventLoop</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>priority</parameter>&#160;:</term>
<listitem><simpara>the priority of the event.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>interval_in_seconds</parameter>&#160;:</term>
<listitem><simpara>the time between calls to the <parameter>function</parameter>, in seconds.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>function</parameter>&#160;:</term>
<listitem><simpara>function to call
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>data to pass to <parameter>function</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>notify</parameter>&#160;:</term>
<listitem><simpara>function to call when the event is removed, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the event ID.

</simpara></listitem></varlistentry>
</variablelist><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 ()</title>
<indexterm zone="gcut-event-loop-add-idle" role="1.1.6"><primary>gcut_event_loop_add_idle</primary></indexterm>
<programlisting><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><variablelist role="params">
<varlistentry><term><parameter>loop</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GCutEventLoop"><type>GCutEventLoop</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>function</parameter>&#160;:</term>
<listitem><simpara>function to call
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>data to pass to <parameter>function</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the event ID.

</simpara></listitem></varlistentry>
</variablelist><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 ()</title>
<indexterm zone="gcut-event-loop-add-idle-full" role="1.1.6"><primary>gcut_event_loop_add_idle_full</primary></indexterm>
<programlisting><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><variablelist role="params">
<varlistentry><term><parameter>loop</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GCutEventLoop"><type>GCutEventLoop</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>priority</parameter>&#160;:</term>
<listitem><simpara>the priority of the event.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>function</parameter>&#160;:</term>
<listitem><simpara>function to call
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara>data to pass to <parameter>function</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>notify</parameter>&#160;:</term>
<listitem><simpara>function to call when the event is removed, or <link linkend="NULL:CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the event ID.

</simpara></listitem></varlistentry>
</variablelist><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 ()</title>
<indexterm zone="gcut-event-loop-remove" role="1.1.6"><primary>gcut_event_loop_remove</primary></indexterm>
<programlisting><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><variablelist role="params">
<varlistentry><term><parameter>loop</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="GCutEventLoop"><type>GCutEventLoop</type></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>tag</parameter>&#160;:</term>
<listitem><simpara>the ID of the source to remove
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if the source was found and removed.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.1.6</para></refsect2>

</refsect1>

</refentry>
