diff options
Diffstat (limited to 'docs/reference/pygobject-functions.xml')
-rw-r--r-- | docs/reference/pygobject-functions.xml | 889 |
1 files changed, 889 insertions, 0 deletions
diff --git a/docs/reference/pygobject-functions.xml b/docs/reference/pygobject-functions.xml new file mode 100644 index 0000000..7ca3918 --- /dev/null +++ b/docs/reference/pygobject-functions.xml @@ -0,0 +1,889 @@ +<?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="gobject-functions"> + <refnamediv> + <refname>gobject Functions</refname> + <refpurpose>miscellaneous functions</refpurpose> + </refnamediv> + + <refsect1> + <title>Synopsis</title> + + <programlisting> +<methodsynopsis language="python"> + <methodname><link +linkend="function-gobject--type-name">gobject.type_name</link></methodname> + <methodparam><parameter>type</parameter></methodparam> + </methodsynopsis><methodsynopsis language="python"> + <methodname><link +linkend="function-gobject--type-from-name">gobject.type_from_name</link></methodname> + <methodparam><parameter>type_name</parameter></methodparam> + </methodsynopsis><methodsynopsis language="python"> + <methodname><link +linkend="function-gobject--type-parent">gobject.type_parent</link></methodname> + <methodparam><parameter>type</parameter></methodparam> + </methodsynopsis><methodsynopsis language="python"> + <methodname><link +linkend="function-gobject--type-is-a">gobject.type_is_a</link></methodname> + <methodparam><parameter>type</parameter></methodparam> + <methodparam><parameter>parent_type</parameter></methodparam> + </methodsynopsis><methodsynopsis language="python"> + <methodname><link +linkend="function-gobject--type-children">gobject.type_children</link></methodname> + <methodparam><parameter>type</parameter></methodparam> + </methodsynopsis><methodsynopsis language="python"> + <methodname><link +linkend="function-gobject--type-interfaces">gobject.type_interfaces</link></methodname> + <methodparam><parameter>type</parameter></methodparam> + </methodsynopsis><methodsynopsis language="python"> + <methodname><link +linkend="function-gobject--type-register">gobject.type_register</link></methodname> + <methodparam><parameter>class</parameter></methodparam> + </methodsynopsis><methodsynopsis language="python"> + <methodname><link +linkend="function-gobject--signal-new">gobject.signal_new</link></methodname> + <methodparam><parameter>signal_name</parameter></methodparam> + <methodparam><parameter>type</parameter></methodparam> + <methodparam><parameter>flags</parameter></methodparam> + <methodparam><parameter>return_type</parameter></methodparam> + <methodparam><parameter>param_types</parameter></methodparam> + </methodsynopsis><methodsynopsis language="python"> + <methodname><link +linkend="function-gobject--signal-list-names">gobject.signal_list_names</link></methodname> + <methodparam><parameter role="keyword">type</parameter></methodparam> + </methodsynopsis><methodsynopsis language="python"> + <methodname><link +linkend="function-gobject--signal-list-ids">gobject.signal_list_ids</link></methodname> + <methodparam><parameter role="keyword">type</parameter></methodparam> + </methodsynopsis><methodsynopsis language="python"> + <methodname><link +linkend="function-gobject--signal-lookup">gobject.signal_lookup</link></methodname> + <methodparam><parameter role="keyword">name</parameter></methodparam> + <methodparam><parameter role="keyword">type</parameter></methodparam> + </methodsynopsis><methodsynopsis language="python"> + <methodname><link +linkend="function-gobject--signal-name">gobject.signal_name</link></methodname> + <methodparam><parameter role="keyword">signal_id</parameter></methodparam> + </methodsynopsis><methodsynopsis language="python"> + <methodname><link +linkend="function-gobject--signal-query1">gobject.signal_query</link></methodname> + <methodparam><parameter role="keyword">name</parameter></methodparam> + <methodparam><parameter role="keyword">type</parameter></methodparam> + </methodsynopsis><methodsynopsis language="python"> + <methodname><link +linkend="function-gobject--signal-query2">gobject.signal_query</link></methodname> + <methodparam><parameter role="keyword">signal_id</parameter></methodparam> + </methodsynopsis><methodsynopsis language="python"> + <methodname><link +linkend="function-gobject--list-properties">gobject.list_properties</link></methodname> + <methodparam><parameter>type</parameter></methodparam> + </methodsynopsis><methodsynopsis language="python"> + <methodname><link +linkend="function-gobject--new">gobject.new</link></methodname> + <methodparam><parameter>type</parameter></methodparam> + <methodparam><parameter>...</parameter></methodparam> + </methodsynopsis><methodsynopsis language="python"> + <methodname><link +linkend="function-gobject--signal-accumulator-true-handled">gobject.signal_accumulator_true_handled</link></methodname> + </methodsynopsis><methodsynopsis language="python"> + <methodname><link +linkend="function-gobject--add-emission-hook">gobject.add_emission_hook</link></methodname> + <methodparam><parameter>type</parameter></methodparam> + <methodparam><parameter>name</parameter></methodparam> + <methodparam><parameter>callback</parameter></methodparam> + <methodparam><parameter>...</parameter></methodparam> + </methodsynopsis><methodsynopsis language="python"> + <methodname><link +linkend="function-gobject--remove-emission-hook">gobject.remove_emission_hook</link></methodname> + <methodparam><parameter>type</parameter></methodparam> + <methodparam><parameter>name</parameter></methodparam> + <methodparam><parameter>hook_id</parameter></methodparam> + </methodsynopsis><methodsynopsis language="python"> + <methodname><link +linkend="function-gobject---install-metaclass">gobject._install_metaclass</link></methodname> + <methodparam><parameter>metaclass</parameter></methodparam> + </methodsynopsis> + </programlisting> + + </refsect1> + + <refsect1> + <title>Description</title> + + <para>These functions are part of the <literal>PyGTK</literal> gobject +module but are not directly associated with a specific class.</para> + + <note> + <para> + Many functions that previously were in this namespace got moved to <link + linkend="glib-functions"><literal>glib</literal></link> namespace instead. They + are still available in <literal>gobject</literal> for backward compatibility, but + not documented here. If you miss documentation for some function, be sure to + check <link linkend="glib-functions"><literal>glib</literal></link> first. + </para> + </note> + + </refsect1> + + <refsect1> + <title>Functions</title> + + <refsect2 id="function-gobject--type-name"> + <title>gobject.type_name</title> + + <programlisting><methodsynopsis language="python"> + <methodname>gobject.type_name</methodname> + <methodparam><parameter>type</parameter></methodparam> + </methodsynopsis></programlisting> + <variablelist> + <varlistentry> + <term><parameter>type</parameter> :</term> + <listitem><simpara>a GObject type, type ID or +instance</simpara></listitem> + </varlistentry> + <varlistentry> + <term><emphasis>Returns</emphasis> :</term> + <listitem><simpara></simpara></listitem> + </varlistentry> + </variablelist> + + <para>The <function>gobject.type_name</function>() function returns +the unique name that is assigned to the specified +<parameter>type</parameter>. <parameter>type</parameter> can be a GObject +type, type ID or instance. This function raises a TypeError exception +if <parameter>type</parameter> isn't a <literal>PyGTK</literal> type.</para> + + </refsect2> + + <refsect2 id="function-gobject--type-from-name"> + <title>gobject.type_from_name</title> + + <programlisting><methodsynopsis language="python"> + <methodname>gobject.type_from_name</methodname> + <methodparam><parameter>type_name</parameter></methodparam> + </methodsynopsis></programlisting> + <variablelist> + <varlistentry> + <term><parameter>type_name</parameter> :</term> + <listitem><simpara>a string containing the name of a +type</simpara></listitem> + </varlistentry> + <varlistentry> + <term><emphasis>Returns</emphasis> :</term> + <listitem><simpara>the type ID named +<parameter>type_name</parameter></simpara></listitem> + </varlistentry> + </variablelist> + + <para>The <function>gobject.type_from_name</function>() function +returns the type ID of the <literal>PyGTK</literal> type with the name +specified by <parameter>type_name</parameter>. This function raises a +RuntimeError exception if no type matches +<parameter>type_name</parameter>.</para> + + </refsect2> + + <refsect2 id="function-gobject--type-parent"> + <title>gobject.type_parent</title> + + <programlisting><methodsynopsis language="python"> + <methodname>gobject.type_parent</methodname> + <methodparam><parameter>type</parameter></methodparam> + </methodsynopsis></programlisting> + <variablelist> + <varlistentry> + <term><parameter>type</parameter> :</term> + <listitem><simpara>a GObject type, type ID or +instance</simpara></listitem> + </varlistentry> + <varlistentry> + <term><emphasis>Returns</emphasis> :</term> + <listitem><simpara>the parent type ID</simpara></listitem> + </varlistentry> + </variablelist> + + <para>The <function>gobject.type_parent</function>() function returns +the direct parent type ID of the specified <parameter>type</parameter>. +<parameter>type</parameter> can be a GObject type, type ID or instance. If +<parameter>type</parameter> has no parent, i.e. is a fundamental type, the +RuntimeError exception is raised. </para> + + </refsect2> + + <refsect2 id="function-gobject--type-is-a"> + <title>gobject.type_is_a</title> + + <programlisting><methodsynopsis language="python"> + <methodname>gobject.type_is_a</methodname> + <methodparam><parameter>type</parameter></methodparam> + <methodparam><parameter>parent_type</parameter></methodparam> + </methodsynopsis></programlisting> + <variablelist> + <varlistentry> + <term><parameter>type</parameter> :</term> + <listitem><simpara>a GObject type, type ID or +instance</simpara></listitem> + </varlistentry> + <varlistentry> + <term><parameter>parent_type</parameter> :</term> + <listitem><simpara>a GObject type, type ID or +instance</simpara></listitem> + </varlistentry> + <varlistentry> + <term><emphasis>Returns</emphasis> :</term> + <listitem><simpara><literal>TRUE</literal> if +<parameter>parent_type</parameter> is an ancestor of +<parameter>type</parameter></simpara></listitem> + </varlistentry> + </variablelist> + + <para>The <function>gobject.type_is_a</function>() function returns +<literal>TRUE</literal> if the specified <parameter>type</parameter> is a +descendant of the type specified by <parameter>parent_type</parameter>. This +function also returns <literal>TRUE</literal> if +<parameter>parent_type</parameter> is an interface and +<parameter>type</parameter> conforms to it.</para> + + </refsect2> + + <refsect2 id="function-gobject--type-children"> + <title>gobject.type_children</title> + + <programlisting><methodsynopsis language="python"> + <methodname>gobject.type_children</methodname> + <methodparam><parameter>type</parameter></methodparam> + </methodsynopsis></programlisting> + <variablelist> + <varlistentry> + <term><parameter>type</parameter> :</term> + <listitem><simpara>a GObject type, type ID or +instance</simpara></listitem> + </varlistentry> + <varlistentry> + <term><emphasis>Returns</emphasis> :</term> + <listitem><simpara>a list of the child types of +<parameter>type</parameter></simpara></listitem> + </varlistentry> + </variablelist> + + <para>The <function>gobject.type_children</function>() function +returns a list containing the child types of the specified +<parameter>type</parameter>.</para> + + </refsect2> + + <refsect2 id="function-gobject--type-interfaces"> + <title>gobject.type_interfaces</title> + + <programlisting><methodsynopsis language="python"> + <methodname>gobject.type_interfaces</methodname> + <methodparam><parameter>type</parameter></methodparam> + </methodsynopsis></programlisting> + <variablelist> + <varlistentry> + <term><parameter>type</parameter> :</term> + <listitem><simpara>a GObject type, type ID or +instance</simpara></listitem> + </varlistentry> + <varlistentry> + <term><emphasis>Returns</emphasis> :</term> + <listitem><simpara>a list of the interface types supported by +<parameter>type</parameter></simpara></listitem> + </varlistentry> + </variablelist> + + <para>The <function>gobject.type_interfaces</function>() function +returns a list of the interface types supported by +<parameter>type</parameter>. <parameter>type</parameter> can be a GObject +type, type ID or instance. This function returns a RuntimeError exception if +type is not a valid type or has no interfaces.</para> + + </refsect2> + + <refsect2 id="function-gobject--type-register"> + <title>gobject.type_register</title> + + <programlisting><methodsynopsis language="python"> + <methodname>gobject.type_register</methodname> + <methodparam><parameter>class</parameter></methodparam> + </methodsynopsis></programlisting> + <variablelist> + <varlistentry> + <term><parameter>class</parameter> :</term> + <listitem><simpara>a Python class that is a descendant of <link +linkend="class-gobject"><classname>gobject.GObject</classname></link></simpara></listitem> + </varlistentry> + </variablelist> + + <para>The <function>gobject.type_register</function>() function +registers the specified Python <parameter>class</parameter> as a PyGTK type. +class must be a descendant of <link +linkend="class-gobject"><classname>gobject.GObject</classname></link>. The function generates a name for the new type.</para> + + </refsect2> + + <refsect2 id="function-gobject--signal-new"> + <title>gobject.signal_new</title> + + <programlisting><methodsynopsis language="python"> + <methodname>gobject.signal_new</methodname> + <methodparam><parameter>signal_name</parameter></methodparam> + <methodparam><parameter>type</parameter></methodparam> + <methodparam><parameter>flags</parameter></methodparam> + <methodparam><parameter>return_type</parameter></methodparam> + <methodparam><parameter>param_types</parameter></methodparam> + </methodsynopsis></programlisting> + <variablelist> + <varlistentry> + <term><parameter>signal_name</parameter> :</term> + <listitem><simpara>a string containing the name of the +signal</simpara></listitem> + </varlistentry> + <varlistentry> + <term><parameter>type</parameter> :</term> + <listitem><simpara>the object type that the signal is associated +with</simpara></listitem> + </varlistentry> + <varlistentry> + <term><parameter>flags</parameter> :</term> + <listitem><simpara>the signal flags</simpara></listitem> + </varlistentry> + <varlistentry> + <term><parameter>return_type</parameter> :</term> + <listitem><simpara>the return type of the signal +handler</simpara></listitem> + </varlistentry> + <varlistentry> + <term><parameter>param_types</parameter> :</term> + <listitem><simpara>the parameter types passed to the signal +handler</simpara></listitem> + </varlistentry> + <varlistentry> + <term><emphasis>Returns</emphasis> :</term> + <listitem><simpara>a unique integer signal ID</simpara></listitem> + </varlistentry> + </variablelist> + + <para>The <function>gobject.signal_new</function>() function registers +a signal with the specified <parameter>signal_name</parameter> for the +specified object <parameter>type</parameter>. The value of +<parameter>flags</parameter> is a combination of:</para> + + <variablelist> + <varlistentry> + <term><literal>gobject.SIGNAL_RUN_FIRST</literal></term> + <listitem> + <simpara>Invoke the object method handler in the first emission +stage. </simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><literal>gobject.SIGNAL_RUN_LAST</literal></term> + <listitem> + <simpara>Invoke the object method handler in the third emission +stage.</simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><literal>gobject.SIGNAL_RUN_CLEANUP</literal></term> + <listitem> + <simpara>Invoke the object method handler in the last emission +stage.</simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><literal>gobject.SIGNAL_NO_RECURSE</literal></term> + <listitem> + <simpara>Signals being emitted for an object while currently +being in emission for this very object will not be emitted recursively, but +instead cause the first emission to be restarted.</simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><literal>gobject.SIGNAL_DETAILED</literal></term> + <listitem> + <simpara>This signal supports "::detail" appendixes to the +signal name upon handler connections and emissions.</simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><literal>gobject.SIGNAL_ACTION</literal></term> + <listitem> + <simpara>Action signals are signals that may freely be emitted +on alive objects from user code via <link +linkend="method-gobject--emit"><methodname>gobject.emit()</methodname>()</link> +and friends, without the need of being embedded into extra code that +performs pre or post emission adjustments on the object. They can also be +thought of as generically callable object methods.</simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><literal>gobject.SIGNAL_NO_HOOKS</literal></term> + <listitem> + <simpara> No emissions hooks are supported for this +signal.</simpara> + </listitem> + </varlistentry> + </variablelist> + + <para><parameter>return_type</parameter> is the type of the return +value from a signal handler and may be a gobject type, type ID or instance. +The <parameter>param_types</parameter> parameter is a list of additional +types that are passed to the signal handler. Each parameter type may be +specified as a gobject type, type ID or instance. For example, to add a +signal to the gtk.Window type called "my-signal" that calls a handler with a +gtk.Button widget and an integer value and a return value that is a +boolean, use:</para> + + <programlisting> + gobject.signal_new("my_signal", gtk.Window, gobject.SIGNAL_RUN_LAST, gobject.TYPE_BOOLEAN, (gtk.Button, gobject.TYPE_INT)) +</programlisting> + + </refsect2> + + <refsect2 id="function-gobject--signal-list-names"> + <title>gobject.signal_list_names</title> + + <programlisting><methodsynopsis language="python"> + <methodname>gobject.signal_list_names</methodname> + <methodparam><parameter role="keyword">type</parameter></methodparam> + </methodsynopsis></programlisting> + <variablelist> + <varlistentry> + <term><parameter role="keyword">type</parameter> :</term> + <listitem><simpara>a GObject type, type ID or +instance</simpara></listitem> + </varlistentry> + <varlistentry> + <term><emphasis>Returns</emphasis> :</term> + <listitem><simpara>a list of the signal names supported by +<parameter>type</parameter></simpara></listitem> + </varlistentry> + </variablelist> + + <para>The <function>gobject.signal_list_names</function>() function +returns a list of the names of the signals that are supported by the +specified GObject <parameter>type</parameter></para> + + <note> + <para>The type keyword is available in PyGTK 2.6 and above.</para> + </note> + + </refsect2> + + <refsect2 id="function-gobject--signal-list-ids"> + <title>gobject.signal_list_ids</title> + + <programlisting><methodsynopsis language="python"> + <methodname>gobject.signal_list_ids</methodname> + <methodparam><parameter role="keyword">type</parameter></methodparam> + </methodsynopsis></programlisting> + <variablelist> + <varlistentry> + <term><parameter role="keyword">type</parameter> :</term> + <listitem><simpara>a GObject type, type ID or +instance</simpara></listitem> + </varlistentry> + <varlistentry> + <term><emphasis>Returns</emphasis> :</term> + <listitem><simpara>a list of the signal ids supported by +<parameter>type</parameter></simpara></listitem> + </varlistentry> + </variablelist> + + <note> + <para>This method is available in PyGTK 2.6 and above.</para> + </note> + + <para>The <function>gobject.signal_list_ids</function>() function +returns a list of the integer ids of the signals that are supported by the +GObject specified by <parameter>type</parameter></para> + + </refsect2> + + <refsect2 id="function-gobject--signal-lookup"> + <title>gobject.signal_lookup</title> + + <programlisting><methodsynopsis language="python"> + <methodname>gobject.signal_lookup</methodname> + <methodparam><parameter role="keyword">name</parameter></methodparam> + <methodparam><parameter role="keyword">type</parameter></methodparam> + </methodsynopsis></programlisting> + <variablelist> + <varlistentry> + <term><parameter role="keyword">name</parameter> :</term> + <listitem><simpara>the name of a signal for +<parameter>type</parameter></simpara></listitem> + </varlistentry> + <varlistentry> + <term><parameter role="keyword">type</parameter> :</term> + <listitem><simpara>a GObject type, type ID or +instance</simpara></listitem> + </varlistentry> + <varlistentry> + <term><emphasis>Returns</emphasis> :</term> + <listitem><simpara>the integer id of a signal supported by +<parameter>type</parameter></simpara> or 0.</listitem> + </varlistentry> + </variablelist> + + <note> + <para>This method is available in PyGTK 2.6 and above.</para> + </note> + + <para>The <function>gobject.signal_lookup</function>() function +returns the id of the signal with the name specified by +<parameter>name</parameter> that is supported by the GObject specified +specified by<parameter>type</parameter>. 0 is returned if the signal is not +found.</para> + + </refsect2> + + <refsect2 id="function-gobject--signal-name"> + <title>gobject.signal_name</title> + + <programlisting><methodsynopsis language="python"> + <methodname>gobject.signal_name</methodname> + <methodparam><parameter role="keyword">signal_id</parameter></methodparam> + </methodsynopsis></programlisting> + <variablelist> + <varlistentry> + <term><parameter role="keyword">signal_id</parameter> :</term> + <listitem><simpara>an integer signal id</simpara></listitem> + </varlistentry> + <varlistentry> + <term><emphasis>Returns</emphasis> :</term> + <listitem><simpara>the name of the signal or +<literal>None</literal>.</simpara></listitem> + </varlistentry> + </variablelist> + + <note> + <para>This method is available in PyGTK 2.6 and above.</para> + </note> + + <para>The <function>gobject.signal_name</function>() function returns +the name of the signal that has the signal id specified by +<parameter>id</parameter>.</para> + + </refsect2> + + <refsect2 id="function-gobject--signal-query1"> + <title>gobject.signal_query</title> + + <programlisting><methodsynopsis language="python"> + <methodname>gobject.signal_query</methodname> + <methodparam><parameter role="keyword">name</parameter></methodparam> + <methodparam><parameter role="keyword">type</parameter></methodparam> + </methodsynopsis></programlisting> + <variablelist> + <varlistentry> + <term><parameter role="keyword">name</parameter> :</term> + <listitem><simpara>the name of a signal for +<parameter>type</parameter></simpara></listitem> + </varlistentry> + <varlistentry> + <term><parameter role="keyword">type</parameter> :</term> + <listitem><simpara>a GObject type, type ID or +instance</simpara></listitem> + </varlistentry> + <varlistentry> + <term><emphasis>Returns</emphasis> :</term> + <listitem><simpara>a 6-tuple containing signal information or +<literal>None</literal></simpara></listitem> + </varlistentry> + </variablelist> + + <note> + <para>This method is available in PyGTK 2.6 and above.</para> + </note> + + <para>The <function>gobject.signal_query</function>() function returns +a 6-tuple containing information about the signal with the name specified by +<parameter>name</parameter> that is supported by the GObject specified by +<parameter>type</parameter>. If the signal is not found +<literal>None</literal> is returned.</para> + + <para>The signal information 6-tuple contains:</para> + + <itemizedlist> + <listitem> + <simpara>the integer signal id</simpara> + </listitem> + <listitem> + <simpara>the signal name</simpara> + </listitem> + <listitem> + <simpara>the GType that the signal is registered for</simpara> + </listitem> + <listitem> + <simpara>the signal flags (see the <xref +linkend="gobject-signal-constants" +endterm="gobject-signal-constants-title"></xref>)</simpara> + </listitem> + <listitem> + <simpara>the GType of the return from the signal callback +function</simpara> + </listitem> + <listitem> + <simpara>a tuple containing the GTypes of the parameters that are +passed to the signal callback function. Note that these may not correspond +exactly to the <literal>PyGTK</literal> signal callback parameters.</simpara> + </listitem> + </itemizedlist> + + </refsect2> + + <refsect2 id="function-gobject--signal-query2"> + <title>gobject.signal_query</title> + + <programlisting><methodsynopsis language="python"> + <methodname>gobject.signal_query</methodname> + <methodparam><parameter role="keyword">signal_id</parameter></methodparam> + </methodsynopsis></programlisting> + <variablelist> + <varlistentry> + <term><parameter role="keyword">signal_id</parameter> :</term> + <listitem><simpara>the integer id of a signal</simpara></listitem> + </varlistentry> + <varlistentry> + <term><emphasis>Returns</emphasis> :</term> + <listitem><simpara>a 6-tuple containing signal information or +<literal>None</literal></simpara></listitem> + </varlistentry> + </variablelist> + + <note> + <para>This method is available in PyGTK 2.6 and above.</para> + </note> + + <para>The <function>gobject.signal_query</function>() function returns +a 6-tuple containing information about the signal with the id specified by +<parameter>signal_id</parameter>. If the signal is not found +<literal>None</literal> is returned.</para> + + <para>The signal information 6-tuple contains:</para> + + <itemizedlist> + <listitem> + <simpara>the integer signal id</simpara> + </listitem> + <listitem> + <simpara>the signal name</simpara> + </listitem> + <listitem> + <simpara>the GType that the signal is registered for</simpara> + </listitem> + <listitem> + <simpara>the signal flags (see the <xref +linkend="gobject-signal-constants" +endterm="gobject-signal-constants-title"></xref>)</simpara> + </listitem> + <listitem> + <simpara>the GType of the return from the signal callback +function</simpara> + </listitem> + <listitem> + <simpara>a tuple containing the GTypes of the parameters that are +passed to the signal callback function. Note that these may not correspond +exactly to the <literal>PyGTK</literal> signal callback parameters.</simpara> + </listitem> + </itemizedlist> + + </refsect2> + + <refsect2 id="function-gobject--list-properties"> + <title>gobject.list_properties</title> + + <programlisting><methodsynopsis language="python"> + <methodname>gobject.list_properties</methodname> + <methodparam><parameter>type</parameter></methodparam> + </methodsynopsis></programlisting> + <variablelist> + <varlistentry> + <term><parameter>type</parameter> :</term> + <listitem><simpara>a GObject type, type ID or +instance</simpara></listitem> + </varlistentry> + <varlistentry> + <term><emphasis>Returns</emphasis> :</term> + <listitem><simpara>a list of the properties (as GParam objects) +supported by <parameter>type</parameter></simpara></listitem> + </varlistentry> + </variablelist> + + <para>The <function>gobject.list_properties</function>() function +returns a list of the properties (as GParam objects) supported by +<parameter>type</parameter>.</para> + + </refsect2> + + <refsect2 id="function-gobject--new"> + <title>gobject.new</title> + + <programlisting><methodsynopsis language="python"> + <methodname>gobject.new</methodname> + <methodparam><parameter>type</parameter></methodparam> + <methodparam><parameter>...</parameter></methodparam> + </methodsynopsis></programlisting> + <variablelist> + <varlistentry> + <term><parameter>type</parameter> :</term> + <listitem><simpara>a GObject type, type ID or +instance</simpara></listitem> + </varlistentry> + <varlistentry> + <term><parameter>...</parameter> :</term> + <listitem><simpara>zero or more property-value +pairs</simpara></listitem> + </varlistentry> + <varlistentry> + <term><emphasis>Returns</emphasis> :</term> + <listitem><simpara>a new object if the specified +<parameter>type</parameter></simpara></listitem> + </varlistentry> + </variablelist> + + <para>The <function>gobject.new</function>() function returns a new +object of the specified <parameter>type</parameter>. type must specify a +type that is a descendant of <link +linkend="class-gobject"><classname>gobject.GObject</classname></link>. A +TypeError exception is raised if <parameter>type</parameter> specifies an +abstract class or a type that is not a descendant of <link +linkend="class-gobject"><classname>gobject.GObject</classname></link>. A set +of property-value pairs may be specified to set the value of the object's +properties.</para> + + </refsect2> + + <refsect2 id="function-gobject--signal-accumulator-true-handled"> + <title>gobject.signal_accumulator_true_handled</title> + + <programlisting><methodsynopsis language="python"> + <methodname>gobject.signal_accumulator_true_handled</methodname> + </methodsynopsis></programlisting> + + <note> + <para>This function is available in PyGTK 2.8 and above.</para> + </note> + + <para>The <function>signal_accumulator_true_handled</function>() + function is only used as accumulator argument when registering + signals.</para> + + </refsect2> + + <refsect2 id="function-gobject--add-emission-hook"> + <title>gobject.add_emission_hook</title> + + <programlisting><methodsynopsis language="python"> + <methodname>gobject.add_emission_hook</methodname> + <methodparam><parameter>type</parameter></methodparam> + <methodparam><parameter>name</parameter></methodparam> + <methodparam><parameter>callback</parameter></methodparam> + <methodparam><parameter>...</parameter></methodparam> + </methodsynopsis></programlisting> + <variablelist role="params"> + <varlistentry> + <term><emphasis>type</emphasis> :</term> + <listitem><simpara>a Python GObject instance or + type</simpara></listitem> + </varlistentry> + <varlistentry> + <term><emphasis>name</emphasis> :</term> + <listitem><simpara>a signal name</simpara></listitem> + </varlistentry> + <varlistentry> + <term><emphasis>callback</emphasis> :</term> + <listitem><simpara>a function</simpara></listitem> + </varlistentry> + <varlistentry> + <term><emphasis>...</emphasis> :</term> + <listitem><simpara>zero or more extra arguments that will be + passed to callback.</simpara></listitem> + </varlistentry> + <varlistentry> + <term><emphasis>Returns</emphasis> :</term> + <listitem><simpara>the hook id, for later use with <link + linkend="function-gobject--signal-remove-emission-hook"><function>gobject.signal_remove_emission_hook</function>()</link>.</simpara></listitem> + </varlistentry> + </variablelist> + <note> + <para>This function is available in PyGTK 2.8 and above.</para> + </note> + + <para>The <function>add_emission_hook</function>() function adds an + emission hook for the signal specified by <parameter>name</parameter>, + which will get called for any emission of that signal, independent of + the instance. This is possible only for signals which don't have the + <literal>gobject.SIGNAL_NO_HOOKS</literal> flag set.</para> + + </refsect2> + + <refsect2 id="function-gobject--remove-emission-hook"> + <title>gobject.remove_emission_hook</title> + + <programlisting><methodsynopsis language="python"> + <methodname>gobject.remove_emission_hook</methodname> + <methodparam><parameter>type</parameter></methodparam> + <methodparam><parameter>name</parameter></methodparam> + <methodparam><parameter>hook_id</parameter></methodparam> + </methodsynopsis></programlisting> + <variablelist role="params"> + <varlistentry> + <term><emphasis>type</emphasis> :</term> + <listitem><simpara>a Python GObject instance or + type</simpara></listitem> + </varlistentry> + <varlistentry> + <term><emphasis>name</emphasis> :</term> + <listitem><simpara>a signal name</simpara></listitem> + </varlistentry> + <varlistentry> + <term><emphasis>hook_id</emphasis> :</term> + <listitem><simpara>the id of the emission hook as returned by the + <link + linkend="function-gobject--add-emission-hook"><function>gobject.add_emission_hook</function>()</link>) + function.</simpara></listitem> + </varlistentry> + <varlistentry> + <term><emphasis>Returns</emphasis> :</term> + <listitem><simpara></simpara></listitem> + </varlistentry> + </variablelist> + <note> + <para>This function is available in PyGTK 2.8 and above.</para> + </note> + + <para>The <function>remove_emission_hook</function>() function deletes + an emission hook.</para> + + </refsect2> + + <refsect2 id="function-gobject---install-metaclass"> + <title>gobject._install_metaclass</title> + + <programlisting><methodsynopsis language="python"> + <methodname>gobject._install_metaclass</methodname> + <methodparam><parameter>metaclass</parameter></methodparam> + </methodsynopsis></programlisting> + <variablelist role="params"> + <varlistentry> + <term><emphasis>metaclass</emphasis> :</term> + <listitem><simpara></simpara></listitem> + </varlistentry> + </variablelist> + <note> + <para>This function is available in PyGTK 2.10 and above.</para> + </note> + + <para>The <function>_install_metaclass</function>() function installs + the metaclass specified by <parameter>metaclass</parameter>.</para> + + </refsect2> + + </refsect1> + +</refentry> |