diff options
| author | Gian Mario Tagliaretti <gianmt@gnome.org> | 2009-03-08 22:11:30 +0000 |
|---|---|---|
| committer | Gian Mario Tagliaretti <gianmt@src.gnome.org> | 2009-03-08 22:11:30 +0000 |
| commit | 06828fcab9b80b89867ce269a45dbc62aec08c38 (patch) | |
| tree | 2af7b6c9d6d67bc3332bb48a25a9999ae68de094 /docs/reference/pygio-cancellable.xml | |
| parent | 4f358fdb583dcf9cfb25df54b8470c9ecfa872ba (diff) | |
| download | pygobject-06828fcab9b80b89867ce269a45dbc62aec08c38.tar.gz pygobject-06828fcab9b80b89867ce269a45dbc62aec08c38.tar.xz pygobject-06828fcab9b80b89867ce269a45dbc62aec08c38.zip | |
Add few gio classes.
2009-03-08 Gian Mario Tagliaretti <gianmt@gnome.org>
* docs/Makefile.am:
* docs/reference/pygio-classes.xml:
* docs/reference/pygobject-ref.xml:
* docs/reference/pygio-applaunchcontext.xml:
* docs/reference/pygio-cancellable.xml: Add few gio classes.
svn path=/trunk/; revision=1023
Diffstat (limited to 'docs/reference/pygio-cancellable.xml')
| -rw-r--r-- | docs/reference/pygio-cancellable.xml | 159 |
1 files changed, 159 insertions, 0 deletions
diff --git a/docs/reference/pygio-cancellable.xml b/docs/reference/pygio-cancellable.xml new file mode 100644 index 0000000..d36421c --- /dev/null +++ b/docs/reference/pygio-cancellable.xml @@ -0,0 +1,159 @@ +<?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-giocancellable"> + <refnamediv> + <refname>gio.Cancellable</refname> + <refpurpose>Thread-safe Operation Cancellation Stack.</refpurpose> + </refnamediv> + + <refsect1> + <title>Synopsis</title> + + <classsynopsis language="python"> + <ooclass><classname>gio.Cancellable</classname></ooclass> + <ooclass><classname><link linkend="class-gobject">gobject.GObject</link></classname></ooclass> + + <constructorsynopsis language="python"> + <methodname><link linkend="constructor-giocancellable">gio.Cancellable</link></methodname> + <methodparam></methodparam> + </constructorsynopsis> + + <methodsynopsis language="python"> + <methodname><link linkend="method-giocancellable--cancel">cancel</link></methodname> + <methodparam></methodparam> + </methodsynopsis> + <methodsynopsis language="python"> + <methodname><link linkend="method-giocancellable--get-fd">get_fd</link></methodname> + <methodparam></methodparam> + </methodsynopsis> + <methodsynopsis language="python"> + <methodname><link linkend="method-giocancellable--is-cancelled">is_cancelled</link></methodname> + <methodparam></methodparam> + </methodsynopsis> + <methodsynopsis language="python"> + <methodname><link linkend="method-giocancellable--pop-current">pop_current</link></methodname> + <methodparam></methodparam> + </methodsynopsis> + <methodsynopsis language="python"> + <methodname><link linkend="method-giocancellable--push-current">push_current</link></methodname> + <methodparam></methodparam> + </methodsynopsis> + <methodsynopsis language="python"> + <methodname><link linkend="method-giocancellable--reset">reset</link></methodname> + <methodparam></methodparam> + </methodsynopsis> + <methodsynopsis language="python"> + <methodname><link linkend="method-giocancellable--set-error-if-cancelled">set_error_if_cancelled</link></methodname> + <methodparam></methodparam> + </methodsynopsis> + + </classsynopsis> + </refsect1> + + <refsect1> + <title>Ancestry</title> + +<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link> + +-- <link linkend="class-giocancellable">gio.Cancellable</link> +</synopsis> + + </refsect1> + + <refsect1> + <title>Description</title> + + <para> + The <link linkend="class-giocancellable"><classname>gio.Cancellable</classname></link> + is a thread-safe operation cancellation stack used throughout GIO to allow for + cancellation of synchronous and asynchronous operations. + </para> + </refsect1> + + <refsect1 id="constructor-giocancellable"> + <title>Constructor</title> + + <programlisting><constructorsynopsis language="python"> + <methodname>gio.Cancellable</methodname> + <methodparam></methodparam> + </constructorsynopsis></programlisting> + <variablelist> + <varlistentry> + <term><emphasis>Returns</emphasis> :</term> + <listitem><simpara>a new + <link linkend="class-giocancellable"><classname>gio.Cancellable</classname></link>. + </simpara></listitem> + </varlistentry> + </variablelist> + + <para> + Creates a new <link linkend="class-giocancellable"><classname>gio.Cancellable</classname></link> object. + </para> + <para> + Applications that want to start one or more operations that should be cancellable should create a + <link linkend="class-giocancellable"><classname>gio.Cancellable</classname></link> + and pass it to the operations. + </para> + <para> + One <link linkend="class-giocancellable"><classname>gio.Cancellable</classname></link> + can be used in multiple consecutive operations, but not in multiple concurrent operations. + </para> + + </refsect1> + + <refsect1> + <title>Methods</title> + + <refsect2 id="method-giocancellable--cancel"> + <title>gio.Cancellable.cancel</title> + + <programlisting><methodsynopsis language="python"> + <methodname>cancel</methodname> + <methodparam></methodparam> + </methodsynopsis></programlisting> + + <variablelist> + </variablelist> + + <para> + The <methodname>cancel</methodname>() method will set cancellable to cancelled, + and will emit the "cancelled" signal. (However, see the warning about race conditions + in the documentation for that signal if you are planning to connect to it.) + </para> + <para> + This function is thread-safe. In other words, you can safely call it from a thread + other than the one running the operation that was passed the cancellable. + </para> + <para> + The convention within gio is that cancelling an asynchronous operation causes it + to complete asynchronously. That is, if you cancel the operation from the same thread + in which it is running, then the operation's GAsyncReadyCallback will not be invoked + until the application returns to the main loop. + </para> + </refsect2> + + <refsect2 id="method-giocancellable--get-fd"> + <title>gio.Cancellable.get_fd</title> + + <programlisting><methodsynopsis language="python"> + <methodname>get_fd</methodname> + <methodparam></methodparam> + </methodsynopsis></programlisting> + + <variablelist> + <varlistentry> + <term><emphasis>Returns</emphasis> :</term> + <listitem><simpara>A valid file descriptor. -1 if the file descriptor + is not supported, or on errors.</simpara></listitem> + </varlistentry> + </variablelist> + + <para> + The <methodname>get_fd</methodname>() method gets the file descriptor + for a cancellable job. This can be used to implement cancellable operations + on Unix systems. The returned fd will turn readable when cancellable is cancelled. + </para> + </refsect2> + </refsect1> +</refentry> |
