diff options
| author | Johan Dahlin <johan@src.gnome.org> | 2006-07-12 23:06:52 +0000 |
|---|---|---|
| committer | Johan Dahlin <johan@src.gnome.org> | 2006-07-12 23:06:52 +0000 |
| commit | 3bd20fd42ba96ab19ea217d7b224c766d00cc06a (patch) | |
| tree | e2dc99b09ccddcc5947b3c1c3541dcd6e7de9590 /docs/reference/pygobject-maincontext.xml | |
| parent | 347a9c39026842ea4d7fa97f931093209b23c97f (diff) | |
| download | pygobject-3bd20fd42ba96ab19ea217d7b224c766d00cc06a.tar.gz pygobject-3bd20fd42ba96ab19ea217d7b224c766d00cc06a.tar.xz pygobject-3bd20fd42ba96ab19ea217d7b224c766d00cc06a.zip | |
Import GObject part of John Finlay's PyGTK Reference Manual, copy over
* Makefile.am:
* configure.ac:
* docs/.cvsignore:
* docs/Makefile.am:
* docs/common.xsl:
* docs/devhelp.xsl:
* docs/html.xsl:
* docs/pdf-style.xsl:
* docs/pdf.xsl:
* docs/ref-html-style.xsl:
* docs/reference/.cvsignore:
* docs/reference/pygobject-classes.xml:
* docs/reference/pygobject-constants.xml:
* docs/reference/pygobject-functions.xml:
* docs/reference/pygobject-gboxed.xml:
* docs/reference/pygobject-ginterface.xml:
* docs/reference/pygobject-gpointer.xml:
* docs/reference/pygobject-maincontext.xml:
* docs/reference/pygobject-mainloop.xml:
* docs/reference/pygobject-ref.xml:
* docs/reference/pygobject.xml:
Import GObject part of John Finlay's PyGTK Reference Manual, copy
over infrastructure from the pygtk-web module.
Diffstat (limited to 'docs/reference/pygobject-maincontext.xml')
| -rw-r--r-- | docs/reference/pygobject-maincontext.xml | 152 |
1 files changed, 152 insertions, 0 deletions
diff --git a/docs/reference/pygobject-maincontext.xml b/docs/reference/pygobject-maincontext.xml new file mode 100644 index 0000000..129197a --- /dev/null +++ b/docs/reference/pygobject-maincontext.xml @@ -0,0 +1,152 @@ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" + "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"> + +<refentry id="class-gobjectmaincontext"> + <refnamediv> + <refname>gobject.MainContext</refname> + + <refpurpose>an object representing a set of event sources to be handled +in a <link +linkend="class-gobjectmainloop"><classname>gobject.MainLoop</classname></link>.</refpurpose> + </refnamediv> + + <refsect1> + <title>Synopsis</title> + +<classsynopsis language="python"> + <ooclass><classname>gobject.MainContext</classname></ooclass> +<constructorsynopsis language="python"> + <methodname><link linkend="constructor-gobjectmaincontext">gobject.MainContext</link></methodname> + </constructorsynopsis> +<methodsynopsis language="python"> + <methodname><link linkend="method-gobjectmaincontext--iteration">iteration</link></methodname> + <methodparam><parameter>may_block</parameter></methodparam> + </methodsynopsis> +<methodsynopsis language="python"> + <methodname><link linkend="method-gobjectmaincontext--pending">pending</link></methodname> + </methodsynopsis> +</classsynopsis> + +</refsect1> + + <refsect1> + <title>Ancestry</title> + +<synopsis>+-- <link linkend="class-gobjectmaincontext">gobject.MainContext</link> +</synopsis> + + </refsect1> + + <refsect1> + <title>Description</title> + + <para>A <link +linkend="class-gobjectmaincontext"><classname>gobject.MainContext</classname></link> +represents a set of event sources that can be run in a single thread. File +descriptors (plain files, pipes or sockets) and timeouts are the standard +event sources for <literal>GTK</literal> and <literal>PyGTK</literal> though +others can be added. Each event source is assigned a priority. The default +priority, <literal>gobject.PRIORITY_DEFAULT</literal>, is 0. Values less +than 0 denote higher priorities. Values greater than 0 denote lower +priorities. Events from high priority sources are always processed before +events from lower priority sources. Single iterations of a <link +linkend="class-gobjectmaincontext"><classname>gobject.MainContext</classname></link> +can be run with the <link +linkend="method-gobjectmaincontext--iteration"><methodname>iteration</methodname>()</link> +method.</para> + + </refsect1> + + <refsect1 id="constructor-gobjectmaincontext"> + <title>Constructor</title> + + <programlisting><constructorsynopsis language="python"> + <methodname>gobject.MainContext</methodname> + </constructorsynopsis></programlisting> + <variablelist> + <varlistentry> + <term><emphasis>Returns</emphasis> :</term> + <listitem><simpara>a new <link + linkend="class-gobjectmaincontext"><classname>gobject.MainContext</classname></link> + object.</simpara></listitem> + </varlistentry> + </variablelist> + + <para>Creates a new <link +linkend="class-gobjectmaincontext"><classname>gobject.MainContext</classname></link> +object.</para> + + </refsect1> + + <refsect1> + <title>Methods</title> + + <refsect2 id="method-gobjectmaincontext--iteration"> + <title>gobject.MainContext.iteration</title> + + <programlisting><methodsynopsis language="python"> + <methodname>iteration</methodname> + </methodsynopsis></programlisting> + <variablelist> + <varlistentry> + <term><parameter>may_block</parameter> :</term> + <listitem><simpara>if <literal>TRUE</literal> the call may block + waiting for an event.</simpara></listitem> + </varlistentry> + <varlistentry> + <term><emphasis>Returns</emphasis> :</term> + <listitem><simpara><literal>TRUE</literal> if events were + dispatched.</simpara></listitem> + </varlistentry> + </variablelist> + + <para>The <methodname>iteration</methodname>() method runs a single +iteration. This involves:</para> + + <itemizedlist> + <listitem> + <simpara>checking to see if any associated event sources are ready +to be processed;</simpara> + </listitem> + <listitem> + <simpara>then if no events sources are ready and +<parameter>may_block</parameter> is <literal>TRUE</literal>, waiting for a +source to become ready;</simpara> + </listitem> + <listitem> + <simpara>and finally, dispatching the highest priority events +sources that are ready</simpara> + </listitem> + </itemizedlist> + + <para>Note that even when <parameter>may_block</parameter> is +<literal>TRUE</literal>, it is still possible for +<methodname>iteration</methodname>() to return <literal>FALSE</literal>, +since the the wait may be interrupted for other reasons than an event source +becoming ready.</para> + + </refsect2> + + <refsect2 id="method-gobjectmaincontext--pending"> + <title>gobject.MainContext.pending</title> + + <programlisting><methodsynopsis language="python"> + <methodname>pending</methodname> + </methodsynopsis></programlisting> + <variablelist> + <varlistentry> + <term><emphasis>Returns</emphasis> :</term> + <listitem><simpara><literal>TRUE</literal> if events are + pending.</simpara></listitem> + </varlistentry> + </variablelist> + + <para>The <methodname>pending</methodname>() method checks if any +associated sources have pending events.</para> + + </refsect2> + + </refsect1> + +</refentry> |
