<refentry id="gobject-The-Base-Object-Type">
<refmeta>
<refentrytitle role="top_of_page" id="gobject-The-Base-Object-Type.top_of_page">The Base Object Type</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GOBJECT Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>The Base Object Type</refname>
<refpurpose>The base object type</refpurpose>
</refnamediv>

<refsynopsisdiv id="gobject-The-Base-Object-Type.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>
<anchor id="GObject"/>
<synopsis>

#include &lt;glib-object.h&gt;

                    <link linkend="GObject-struct">GObject</link>;
                    <link linkend="GObjectClass">GObjectClass</link>;
                    <link linkend="GObjectConstructParam">GObjectConstructParam</link>;
<link linkend="void">void</link>                (<link linkend="GObjectGetPropertyFunc">*GObjectGetPropertyFunc</link>)           (<link linkend="GObject">GObject</link> *object,
                                                         <link linkend="guint">guint</link> property_id,
                                                         <link linkend="GValue">GValue</link> *value,
                                                         <link linkend="GParamSpec">GParamSpec</link> *pspec);
<link linkend="void">void</link>                (<link linkend="GObjectSetPropertyFunc">*GObjectSetPropertyFunc</link>)           (<link linkend="GObject">GObject</link> *object,
                                                         <link linkend="guint">guint</link> property_id,
                                                         const <link linkend="GValue">GValue</link> *value,
                                                         <link linkend="GParamSpec">GParamSpec</link> *pspec);
<link linkend="void">void</link>                (<link linkend="GObjectFinalizeFunc">*GObjectFinalizeFunc</link>)              (<link linkend="GObject">GObject</link> *object);
#define             <link linkend="G-TYPE-IS-OBJECT--CAPS">G_TYPE_IS_OBJECT</link>                    (type)
#define             <link linkend="G-OBJECT--CAPS">G_OBJECT</link>                            (object)
#define             <link linkend="G-IS-OBJECT--CAPS">G_IS_OBJECT</link>                         (object)
#define             <link linkend="G-OBJECT-CLASS--CAPS">G_OBJECT_CLASS</link>                      (class)
#define             <link linkend="G-IS-OBJECT-CLASS--CAPS">G_IS_OBJECT_CLASS</link>                   (class)
#define             <link linkend="G-OBJECT-GET-CLASS--CAPS">G_OBJECT_GET_CLASS</link>                  (object)
#define             <link linkend="G-OBJECT-TYPE--CAPS">G_OBJECT_TYPE</link>                       (object)
#define             <link linkend="G-OBJECT-TYPE-NAME--CAPS">G_OBJECT_TYPE_NAME</link>                  (object)
#define             <link linkend="G-OBJECT-CLASS-TYPE--CAPS">G_OBJECT_CLASS_TYPE</link>                 (class)
#define             <link linkend="G-OBJECT-CLASS-NAME--CAPS">G_OBJECT_CLASS_NAME</link>                 (class)
<link linkend="void">void</link>                <link linkend="g-object-class-install-property">g_object_class_install_property</link>     (<link linkend="GObjectClass">GObjectClass</link> *oclass,
                                                         <link linkend="guint">guint</link> property_id,
                                                         <link linkend="GParamSpec">GParamSpec</link> *pspec);
<link linkend="GParamSpec">GParamSpec</link>*         <link linkend="g-object-class-find-property">g_object_class_find_property</link>        (<link linkend="GObjectClass">GObjectClass</link> *oclass,
                                                         const <link linkend="gchar">gchar</link> *property_name);
<link linkend="GParamSpec">GParamSpec</link>**        <link linkend="g-object-class-list-properties">g_object_class_list_properties</link>      (<link linkend="GObjectClass">GObjectClass</link> *oclass,
                                                         <link linkend="guint">guint</link> *n_properties);
<link linkend="void">void</link>                <link linkend="g-object-class-override-property">g_object_class_override_property</link>    (<link linkend="GObjectClass">GObjectClass</link> *oclass,
                                                         <link linkend="guint">guint</link> property_id,
                                                         const <link linkend="gchar">gchar</link> *name);
<link linkend="void">void</link>                <link linkend="g-object-interface-install-property">g_object_interface_install_property</link> (<link linkend="gpointer">gpointer</link> g_iface,
                                                         <link linkend="GParamSpec">GParamSpec</link> *pspec);
<link linkend="GParamSpec">GParamSpec</link>*         <link linkend="g-object-interface-find-property">g_object_interface_find_property</link>    (<link linkend="gpointer">gpointer</link> g_iface,
                                                         const <link linkend="gchar">gchar</link> *property_name);
<link linkend="GParamSpec">GParamSpec</link>**        <link linkend="g-object-interface-list-properties">g_object_interface_list_properties</link>  (<link linkend="gpointer">gpointer</link> g_iface,
                                                         <link linkend="guint">guint</link> *n_properties_p);
<link linkend="gpointer">gpointer</link>            <link linkend="g-object-new">g_object_new</link>                        (<link linkend="GType">GType</link> object_type,
                                                         const <link linkend="gchar">gchar</link> *first_property_name,
                                                         ...);
<link linkend="gpointer">gpointer</link>            <link linkend="g-object-newv">g_object_newv</link>                       (<link linkend="GType">GType</link> object_type,
                                                         <link linkend="guint">guint</link> n_parameters,
                                                         <link linkend="GParameter">GParameter</link> *parameters);
                    <link linkend="GParameter">GParameter</link>;
<link linkend="gpointer">gpointer</link>            <link linkend="g-object-ref">g_object_ref</link>                        (<link linkend="gpointer">gpointer</link> object);
<link linkend="void">void</link>                <link linkend="g-object-unref">g_object_unref</link>                      (<link linkend="gpointer">gpointer</link> object);
<link linkend="gpointer">gpointer</link>            <link linkend="g-object-ref-sink">g_object_ref_sink</link>                   (<link linkend="gpointer">gpointer</link> object);
typedef             <link linkend="GInitiallyUnowned">GInitiallyUnowned</link>;
typedef             <link linkend="GInitiallyUnownedClass">GInitiallyUnownedClass</link>;
#define             <link linkend="G-TYPE-INITIALLY-UNOWNED--CAPS">G_TYPE_INITIALLY_UNOWNED</link>
<link linkend="gboolean">gboolean</link>            <link linkend="g-object-is-floating">g_object_is_floating</link>                (<link linkend="gpointer">gpointer</link> object);
<link linkend="void">void</link>                <link linkend="g-object-force-floating">g_object_force_floating</link>             (<link linkend="GObject">GObject</link> *object);
<link linkend="void">void</link>                (<link linkend="GWeakNotify">*GWeakNotify</link>)                      (<link linkend="gpointer">gpointer</link> data,
                                                         <link linkend="GObject">GObject</link> *where_the_object_was);
<link linkend="void">void</link>                <link linkend="g-object-weak-ref">g_object_weak_ref</link>                   (<link linkend="GObject">GObject</link> *object,
                                                         <link linkend="GWeakNotify">GWeakNotify</link> notify,
                                                         <link linkend="gpointer">gpointer</link> data);
<link linkend="void">void</link>                <link linkend="g-object-weak-unref">g_object_weak_unref</link>                 (<link linkend="GObject">GObject</link> *object,
                                                         <link linkend="GWeakNotify">GWeakNotify</link> notify,
                                                         <link linkend="gpointer">gpointer</link> data);
<link linkend="void">void</link>                <link linkend="g-object-add-weak-pointer">g_object_add_weak_pointer</link>           (<link linkend="GObject">GObject</link> *object,
                                                         <link linkend="gpointer">gpointer</link> *weak_pointer_location);
<link linkend="void">void</link>                <link linkend="g-object-remove-weak-pointer">g_object_remove_weak_pointer</link>        (<link linkend="GObject">GObject</link> *object,
                                                         <link linkend="gpointer">gpointer</link> *weak_pointer_location);
<link linkend="void">void</link>                (<link linkend="GToggleNotify">*GToggleNotify</link>)                    (<link linkend="gpointer">gpointer</link> data,
                                                         <link linkend="GObject">GObject</link> *object,
                                                         <link linkend="gboolean">gboolean</link> is_last_ref);
<link linkend="void">void</link>                <link linkend="g-object-add-toggle-ref">g_object_add_toggle_ref</link>             (<link linkend="GObject">GObject</link> *object,
                                                         <link linkend="GToggleNotify">GToggleNotify</link> notify,
                                                         <link linkend="gpointer">gpointer</link> data);
<link linkend="void">void</link>                <link linkend="g-object-remove-toggle-ref">g_object_remove_toggle_ref</link>          (<link linkend="GObject">GObject</link> *object,
                                                         <link linkend="GToggleNotify">GToggleNotify</link> notify,
                                                         <link linkend="gpointer">gpointer</link> data);
<link linkend="gpointer">gpointer</link>            <link linkend="g-object-connect">g_object_connect</link>                    (<link linkend="gpointer">gpointer</link> object,
                                                         const <link linkend="gchar">gchar</link> *signal_spec,
                                                         ...);
<link linkend="void">void</link>                <link linkend="g-object-disconnect">g_object_disconnect</link>                 (<link linkend="gpointer">gpointer</link> object,
                                                         const <link linkend="gchar">gchar</link> *signal_spec,
                                                         ...);
<link linkend="void">void</link>                <link linkend="g-object-set">g_object_set</link>                        (<link linkend="gpointer">gpointer</link> object,
                                                         const <link linkend="gchar">gchar</link> *first_property_name,
                                                         ...);
<link linkend="void">void</link>                <link linkend="g-object-get">g_object_get</link>                        (<link linkend="gpointer">gpointer</link> object,
                                                         const <link linkend="gchar">gchar</link> *first_property_name,
                                                         ...);
<link linkend="void">void</link>                <link linkend="g-object-notify">g_object_notify</link>                     (<link linkend="GObject">GObject</link> *object,
                                                         const <link linkend="gchar">gchar</link> *property_name);
<link linkend="void">void</link>                <link linkend="g-object-freeze-notify">g_object_freeze_notify</link>              (<link linkend="GObject">GObject</link> *object);
<link linkend="void">void</link>                <link linkend="g-object-thaw-notify">g_object_thaw_notify</link>                (<link linkend="GObject">GObject</link> *object);
<link linkend="gpointer">gpointer</link>            <link linkend="g-object-get-data">g_object_get_data</link>                   (<link linkend="GObject">GObject</link> *object,
                                                         const <link linkend="gchar">gchar</link> *key);
<link linkend="void">void</link>                <link linkend="g-object-set-data">g_object_set_data</link>                   (<link linkend="GObject">GObject</link> *object,
                                                         const <link linkend="gchar">gchar</link> *key,
                                                         <link linkend="gpointer">gpointer</link> data);
<link linkend="void">void</link>                <link linkend="g-object-set-data-full">g_object_set_data_full</link>              (<link linkend="GObject">GObject</link> *object,
                                                         const <link linkend="gchar">gchar</link> *key,
                                                         <link linkend="gpointer">gpointer</link> data,
                                                         <link linkend="GDestroyNotify">GDestroyNotify</link> destroy);
<link linkend="gpointer">gpointer</link>            <link linkend="g-object-steal-data">g_object_steal_data</link>                 (<link linkend="GObject">GObject</link> *object,
                                                         const <link linkend="gchar">gchar</link> *key);
<link linkend="gpointer">gpointer</link>            <link linkend="g-object-get-qdata">g_object_get_qdata</link>                  (<link linkend="GObject">GObject</link> *object,
                                                         <link linkend="GQuark">GQuark</link> quark);
<link linkend="void">void</link>                <link linkend="g-object-set-qdata">g_object_set_qdata</link>                  (<link linkend="GObject">GObject</link> *object,
                                                         <link linkend="GQuark">GQuark</link> quark,
                                                         <link linkend="gpointer">gpointer</link> data);
<link linkend="void">void</link>                <link linkend="g-object-set-qdata-full">g_object_set_qdata_full</link>             (<link linkend="GObject">GObject</link> *object,
                                                         <link linkend="GQuark">GQuark</link> quark,
                                                         <link linkend="gpointer">gpointer</link> data,
                                                         <link linkend="GDestroyNotify">GDestroyNotify</link> destroy);
<link linkend="gpointer">gpointer</link>            <link linkend="g-object-steal-qdata">g_object_steal_qdata</link>                (<link linkend="GObject">GObject</link> *object,
                                                         <link linkend="GQuark">GQuark</link> quark);
<link linkend="void">void</link>                <link linkend="g-object-set-property">g_object_set_property</link>               (<link linkend="GObject">GObject</link> *object,
                                                         const <link linkend="gchar">gchar</link> *property_name,
                                                         const <link linkend="GValue">GValue</link> *value);
<link linkend="void">void</link>                <link linkend="g-object-get-property">g_object_get_property</link>               (<link linkend="GObject">GObject</link> *object,
                                                         const <link linkend="gchar">gchar</link> *property_name,
                                                         <link linkend="GValue">GValue</link> *value);
<link linkend="GObject">GObject</link>*            <link linkend="g-object-new-valist">g_object_new_valist</link>                 (<link linkend="GType">GType</link> object_type,
                                                         const <link linkend="gchar">gchar</link> *first_property_name,
                                                         <link linkend="va-list">va_list</link> var_args);
<link linkend="void">void</link>                <link linkend="g-object-set-valist">g_object_set_valist</link>                 (<link linkend="GObject">GObject</link> *object,
                                                         const <link linkend="gchar">gchar</link> *first_property_name,
                                                         <link linkend="va-list">va_list</link> var_args);
<link linkend="void">void</link>                <link linkend="g-object-get-valist">g_object_get_valist</link>                 (<link linkend="GObject">GObject</link> *object,
                                                         const <link linkend="gchar">gchar</link> *first_property_name,
                                                         <link linkend="va-list">va_list</link> var_args);
<link linkend="void">void</link>                <link linkend="g-object-watch-closure">g_object_watch_closure</link>              (<link linkend="GObject">GObject</link> *object,
                                                         <link linkend="GClosure">GClosure</link> *closure);
<link linkend="void">void</link>                <link linkend="g-object-run-dispose">g_object_run_dispose</link>                (<link linkend="GObject">GObject</link> *object);
#define             <link linkend="G-OBJECT-WARN-INVALID-PROPERTY-ID--CAPS">G_OBJECT_WARN_INVALID_PROPERTY_ID</link>   (object, property_id, pspec)
</synopsis>
</refsynopsisdiv>

<refsect1 id="gobject-The-Base-Object-Type.object-hierarchy" role="object_hierarchy">
<title role="object_hierarchy.title">Object Hierarchy</title>
<synopsis>
  GObject
   +----<link linkend="GTypeModule">GTypeModule</link>
</synopsis>
</refsect1>






<refsect1 id="gobject-The-Base-Object-Type.signals" role="signal_proto">
<title role="signal_proto.title">Signals</title>
<synopsis>
  &quot;<link linkend="GObject-notify">notify</link>&quot;                                         : Run First / No Recursion / Has Details / Action / No Hooks
</synopsis>
</refsect1>


<refsect1 id="gobject-The-Base-Object-Type.description" role="desc">
<title role="desc.title">Description</title>
<para>
GObject is the fundamental type providing the common attributes and
methods for all object types in GTK+, Pango and other libraries
based on GObject.  The GObject class provides methods for object
construction and destruction, property access methods, and signal
support.  Signals are described in detail in <xref
linkend="gobject-Signals"/>.
</para>
<para>
<para id="floating-ref">
<link linkend="GInitiallyUnowned"><type>GInitiallyUnowned</type></link> is derived from <link linkend="GObject"><type>GObject</type></link>. The only difference between
the two is that the initial reference of a <link linkend="GInitiallyUnowned"><type>GInitiallyUnowned</type></link> is flagged
as a <firstterm>floating</firstterm> reference.
This means that it is not specifically claimed to be "owned" by
any code portion. The main motivation for providing floating references is
C convenience. In particular, it allows code to be written as:
<informalexample><programlisting>
container = create_container();
container_add_child (container, create_child());
</programlisting></informalexample>
If <function><link linkend="container-add-child"><function>container_add_child()</function></link></function> will <link linkend="g-object-ref-sink"><function>g_object_ref_sink()</function></link> the
passed in child, no reference of the newly created child is leaked.
Without floating references, <function><link linkend="container-add-child"><function>container_add_child()</function></link></function>
can only <link linkend="g-object-ref"><function>g_object_ref()</function></link> the new child, so to implement this code without
reference leaks, it would have to be written as:
<informalexample><programlisting>
Child *child;
container = create_container();
child = create_child();
container_add_child (container, child);
g_object_unref (child);
</programlisting></informalexample>
The floating reference can be converted into
an ordinary reference by calling <link linkend="g-object-ref-sink"><function>g_object_ref_sink()</function></link>.
For already sunken objects (objects that don't have a floating reference
anymore), <link linkend="g-object-ref-sink"><function>g_object_ref_sink()</function></link> is equivalent to <link linkend="g-object-ref"><function>g_object_ref()</function></link> and returns
a new reference.
Since floating references are useful almost exclusively for C convenience,
language bindings that provide automated reference and memory ownership
maintenance (such as smart pointers or garbage collection) therefore don't
need to expose floating references in their API.
</para>
</para>
<para>
Some object implementations may need to save an objects floating state
across certain code portions (an example is <link linkend="GtkMenu"><type>GtkMenu</type></link>), to achive this, the
following sequence can be used:
</para>
<para>
<informalexample><programlisting>
// save floating state
gboolean was_floating = g_object_is_floating (object);
g_object_ref_sink (object);
// protected code portion
...;
// restore floating state
if (was_floating)
  g_object_force_floating (object);
g_obejct_unref (object); // release previously acquired reference
</programlisting></informalexample></para>
<para>
</para>
</refsect1>

<refsect1 id="gobject-The-Base-Object-Type.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GObject-struct" role="struct">
<title>GObject</title>
<indexterm zone="GObject-struct"><primary sortas="Object">GObject</primary></indexterm><programlisting>typedef struct _GObject GObject;</programlisting>
<para>
All the fields in the <structname>GObject</structname> structure are private 
to the <link linkend="GObject"><type>GObject</type></link> implementation and should never be accessed directly.</para>
<para>
</para></refsect2>
<refsect2 id="GObjectClass" role="struct">
<title>GObjectClass</title>
<indexterm zone="GObjectClass"><primary sortas="ObjectClass">GObjectClass</primary></indexterm><programlisting>typedef struct {
  GTypeClass   g_type_class;

  /* seldomly overidden */
  GObject*   (*constructor)     (GType                  type,
                                 guint                  n_construct_properties,
                                 GObjectConstructParam *construct_properties);
  /* overridable methods */
  void       (*set_property)		(GObject        *object,
                                         guint           property_id,
                                         const GValue   *value,
                                         GParamSpec     *pspec);
  void       (*get_property)		(GObject        *object,
                                         guint           property_id,
                                         GValue         *value,
                                         GParamSpec     *pspec);
  void       (*dispose)			(GObject        *object);
  void       (*finalize)		(GObject        *object);
  /* seldomly overidden */
  void       (*dispatch_properties_changed) (GObject      *object,
					     guint	   n_pspecs,
					     GParamSpec  **pspecs);
  /* signals */
  void	     (*notify)			(GObject	*object,
					 GParamSpec	*pspec);

  /* called when done constructing */
  void	     (*constructed)		(GObject	*object);
} GObjectClass;
</programlisting>
<para>
The class structure for the <structname>GObject</structname> type.
</para>
<para>
<example>
<title>Implementing singletons using a constructor</title>
<programlisting>
static MySingleton *the_singleton = NULL;

static GObject*
my_singleton_constructor (GType                  type,
                          guint                  n_construct_params,
                          GObjectConstructParam *construct_params)
{
  GObject *object;
  
  if (!the_singleton)
    {
      object = G_OBJECT_CLASS (parent_class)->constructor (type,
                                                           n_construct_params,
                                                           construct_params);
      the_singleton = MY_SINGLETON (object);
    }
  else
    object = g_object_ref (G_OBJECT (the_singleton));

  return object;
}
</programlisting></example></para>
<para>
</para><variablelist role="struct">
<varlistentry>
<term><link linkend="GTypeClass">GTypeClass</link>&#160;<structfield>g_type_class</structfield>;</term>
<listitem><simpara> the parent class
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>constructor</structfield>&#160;()</term>
<listitem><simpara> the <parameter>constructor</parameter> function is called by <link linkend="g-object-new"><function>g_object_new()</function></link> to 
 complete the object initialization after all the construction properties are
 set. The first thing a <parameter>constructor</parameter> implementation must do is chain up to the
 <parameter>constructor</parameter> of the parent class. Overriding <parameter>constructor</parameter> should be rarely 
 needed, e.g. to handle construct properties, or to implement singletons.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>set_property</structfield>&#160;()</term>
<listitem><simpara> the generic setter for all properties of this type. Should be
 overridden for every type with properties. Implementations of <parameter>set_property</parameter>
 don't need to emit property change notification explicitly, this is handled
 by the type system.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>get_property</structfield>&#160;()</term>
<listitem><simpara> the generic getter for all properties of this type. Should be
 overridden for every type with properties.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>dispose</structfield>&#160;()</term>
<listitem><simpara> the <parameter>dispose</parameter> function is supposed to drop all references to other 
 objects, but keep the instance otherwise intact, so that client method 
 invocations still work. It may be run multiple times (due to reference 
 loops). Before returning, <parameter>dispose</parameter> should chain up to the <parameter>dispose</parameter> method 
 of the parent class.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>finalize</structfield>&#160;()</term>
<listitem><simpara> instance finalization function, should finish the finalization of 
 the instance begun in <parameter>dispose</parameter> and chain up to the <parameter>finalize</parameter> method of the 
 parent class.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>dispatch_properties_changed</structfield>&#160;()</term>
<listitem><simpara> emits property change notification for a bunch
 of properties. Overriding <parameter>dispatch_properties_changed</parameter> should be rarely 
 needed.
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>notify</structfield>&#160;()</term>
<listitem><simpara> the class closure for the notify signal
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><structfield>constructed</structfield>&#160;()</term>
<listitem><simpara> the <parameter>constructed</parameter> function is called by <link linkend="g-object-new"><function>g_object_new()</function></link> as the
 final step of the object creation process.  At the point of the call, all
 construction properties have been set on the object.  The purpose of this
 call is to allow for object initialisation steps that can only be performed
 after construction properties have been set.  <parameter>constructed</parameter> implementors
 should chain up to the <parameter>constructed</parameter> call of their parent class to allow it
 to complete its initialisation.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="GObjectConstructParam" role="struct">
<title>GObjectConstructParam</title>
<indexterm zone="GObjectConstructParam"><primary sortas="ObjectConstructParam">GObjectConstructParam</primary></indexterm><programlisting>typedef struct {
  GParamSpec *pspec;
  GValue     *value;
} GObjectConstructParam;
</programlisting>
<para>
The <structname>GObjectConstructParam</structname> struct is an auxiliary 
structure used to hand <link linkend="GParamSpec"><type>GParamSpec</type></link>/<link linkend="GValue"><type>GValue</type></link> pairs to the <parameter>constructor</parameter> of
a <link linkend="GObjectClass"><type>GObjectClass</type></link>.</para>
<para>
</para><variablelist role="struct">
<varlistentry>
<term><link linkend="GParamSpec">GParamSpec</link>&#160;*<structfield>pspec</structfield>;</term>
<listitem><simpara> the <link linkend="GParamSpec"><type>GParamSpec</type></link> of the construct parameter
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GValue">GValue</link>&#160;*<structfield>value</structfield>;</term>
<listitem><simpara> the value to set the parameter to
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="GObjectGetPropertyFunc" role="function">
<title>GObjectGetPropertyFunc ()</title>
<indexterm zone="GObjectGetPropertyFunc"><primary sortas="ObjectGetPropertyFunc">GObjectGetPropertyFunc</primary></indexterm><programlisting><link linkend="void">void</link>                (*GObjectGetPropertyFunc)           (<link linkend="GObject">GObject</link> *object,
                                                         <link linkend="guint">guint</link> property_id,
                                                         <link linkend="GValue">GValue</link> *value,
                                                         <link linkend="GParamSpec">GParamSpec</link> *pspec);</programlisting>
<para>
The type of the <parameter>get_property</parameter> function of <link linkend="GObjectClass"><type>GObjectClass</type></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObject"><type>GObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>property_id</parameter>&#160;:</term>
<listitem><simpara> the numeric id under which the property was registered with
 <link linkend="g-object-class-install-property"><function>g_object_class_install_property()</function></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GValue"><type>GValue</type></link> to return the property value in
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GParamSpec"><type>GParamSpec</type></link> describing the property
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GObjectSetPropertyFunc" role="function">
<title>GObjectSetPropertyFunc ()</title>
<indexterm zone="GObjectSetPropertyFunc"><primary sortas="ObjectSetPropertyFunc">GObjectSetPropertyFunc</primary></indexterm><programlisting><link linkend="void">void</link>                (*GObjectSetPropertyFunc)           (<link linkend="GObject">GObject</link> *object,
                                                         <link linkend="guint">guint</link> property_id,
                                                         const <link linkend="GValue">GValue</link> *value,
                                                         <link linkend="GParamSpec">GParamSpec</link> *pspec);</programlisting>
<para>
The type of the <parameter>set_property</parameter> function of <link linkend="GObjectClass"><type>GObjectClass</type></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObject"><type>GObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>property_id</parameter>&#160;:</term>
<listitem><simpara> the numeric id under which the property was registered with
 <link linkend="g-object-class-install-property"><function>g_object_class_install_property()</function></link>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter>&#160;:</term>
<listitem><simpara> the new value for the property
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GParamSpec"><type>GParamSpec</type></link> describing the property
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GObjectFinalizeFunc" role="function">
<title>GObjectFinalizeFunc ()</title>
<indexterm zone="GObjectFinalizeFunc"><primary sortas="ObjectFinalizeFunc">GObjectFinalizeFunc</primary></indexterm><programlisting><link linkend="void">void</link>                (*GObjectFinalizeFunc)              (<link linkend="GObject">GObject</link> *object);</programlisting>
<para>
The type of the <parameter>finalize</parameter> function of <link linkend="GObjectClass"><type>GObjectClass</type></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GObject"><type>GObject</type></link> being finalized
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="G-TYPE-IS-OBJECT--CAPS" role="macro">
<title>G_TYPE_IS_OBJECT()</title>
<indexterm zone="G-TYPE-IS-OBJECT--CAPS"><primary sortas="TYPE_IS_OBJECT">G_TYPE_IS_OBJECT</primary></indexterm><programlisting>#define G_TYPE_IS_OBJECT(type)      (G_TYPE_FUNDAMENTAL (type) == G_TYPE_OBJECT)
</programlisting>
<para>
Check if the passed in type id is a <link linkend="G-TYPE-OBJECT--CAPS"><literal>G_TYPE_OBJECT</literal></link> or derived from it.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>type</parameter>&#160;:</term>
<listitem><simpara> Type id to check
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="G-OBJECT--CAPS" role="macro">
<title>G_OBJECT()</title>
<indexterm zone="G-OBJECT--CAPS"><primary sortas="OBJECT">G_OBJECT</primary></indexterm><programlisting>#define G_OBJECT(object)            (G_TYPE_CHECK_INSTANCE_CAST ((object), G_TYPE_OBJECT, GObject))
</programlisting>
<para>
Casts a <link linkend="GObject"><type>GObject</type></link> or derived pointer into a (GObject*) pointer.
Depending on the current debugging level, this function may invoke
certain runtime checks to identify invalid casts.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> Object which is subject to casting.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="G-IS-OBJECT--CAPS" role="macro">
<title>G_IS_OBJECT()</title>
<indexterm zone="G-IS-OBJECT--CAPS"><primary sortas="IS_OBJECT">G_IS_OBJECT</primary></indexterm><programlisting>#define G_IS_OBJECT(object)         (G_TYPE_CHECK_INSTANCE_TYPE ((object), G_TYPE_OBJECT))
</programlisting>
<para>
Checks whether a valid <link linkend="GTypeInstance"><type>GTypeInstance</type></link> pointer is of type <link linkend="G-TYPE-OBJECT--CAPS"><literal>G_TYPE_OBJECT</literal></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> Instance to check for being a <link linkend="G-TYPE-OBJECT--CAPS"><literal>G_TYPE_OBJECT</literal></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="G-OBJECT-CLASS--CAPS" role="macro">
<title>G_OBJECT_CLASS()</title>
<indexterm zone="G-OBJECT-CLASS--CAPS"><primary sortas="OBJECT_CLASS">G_OBJECT_CLASS</primary></indexterm><programlisting>#define G_OBJECT_CLASS(class)       (G_TYPE_CHECK_CLASS_CAST ((class), G_TYPE_OBJECT, GObjectClass))
</programlisting>
<para>
Casts a derived <link linkend="GObjectClass"><type>GObjectClass</type></link> structure into a <link linkend="GObjectClass"><type>GObjectClass</type></link> structure.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>class</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="GObjectClass"><type>GObjectClass</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="G-IS-OBJECT-CLASS--CAPS" role="macro">
<title>G_IS_OBJECT_CLASS()</title>
<indexterm zone="G-IS-OBJECT-CLASS--CAPS"><primary sortas="IS_OBJECT_CLASS">G_IS_OBJECT_CLASS</primary></indexterm><programlisting>#define G_IS_OBJECT_CLASS(class)    (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_OBJECT))
</programlisting>
<para>
Checks whether <parameter>class</parameter> "is a" valid <link linkend="GObjectClass"><type>GObjectClass</type></link> structure of type
<link linkend="G-TYPE-OBJECT--CAPS"><literal>G_TYPE_OBJECT</literal></link> or derived.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>class</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObjectClass"><type>GObjectClass</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="G-OBJECT-GET-CLASS--CAPS" role="macro">
<title>G_OBJECT_GET_CLASS()</title>
<indexterm zone="G-OBJECT-GET-CLASS--CAPS"><primary sortas="OBJECT_GET_CLASS">G_OBJECT_GET_CLASS</primary></indexterm><programlisting>#define G_OBJECT_GET_CLASS(object)  (G_TYPE_INSTANCE_GET_CLASS ((object), G_TYPE_OBJECT, GObjectClass))
</programlisting>
<para>
Get the class structure associated to a <link linkend="GObject"><type>GObject</type></link> instance.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObject"><type>GObject</type></link> instance.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="G-OBJECT-TYPE--CAPS" role="macro">
<title>G_OBJECT_TYPE()</title>
<indexterm zone="G-OBJECT-TYPE--CAPS"><primary sortas="OBJECT_TYPE">G_OBJECT_TYPE</primary></indexterm><programlisting>#define G_OBJECT_TYPE(object)       (G_TYPE_FROM_INSTANCE (object))
</programlisting>
<para>
Get the type id of an object.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> Object to return the type id for.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="G-OBJECT-TYPE-NAME--CAPS" role="macro">
<title>G_OBJECT_TYPE_NAME()</title>
<indexterm zone="G-OBJECT-TYPE-NAME--CAPS"><primary sortas="OBJECT_TYPE_NAME">G_OBJECT_TYPE_NAME</primary></indexterm><programlisting>#define G_OBJECT_TYPE_NAME(object)  (g_type_name (G_OBJECT_TYPE (object)))
</programlisting>
<para>
Get the name of an object's type.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> Object to return the type name for.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="G-OBJECT-CLASS-TYPE--CAPS" role="macro">
<title>G_OBJECT_CLASS_TYPE()</title>
<indexterm zone="G-OBJECT-CLASS-TYPE--CAPS"><primary sortas="OBJECT_CLASS_TYPE">G_OBJECT_CLASS_TYPE</primary></indexterm><programlisting>#define G_OBJECT_CLASS_TYPE(class)  (G_TYPE_FROM_CLASS (class))
</programlisting>
<para>
Get the type id of a class structure.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>class</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="GObjectClass"><type>GObjectClass</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="G-OBJECT-CLASS-NAME--CAPS" role="macro">
<title>G_OBJECT_CLASS_NAME()</title>
<indexterm zone="G-OBJECT-CLASS-NAME--CAPS"><primary sortas="OBJECT_CLASS_NAME">G_OBJECT_CLASS_NAME</primary></indexterm><programlisting>#define G_OBJECT_CLASS_NAME(class)  (g_type_name (G_OBJECT_CLASS_TYPE (class)))
</programlisting>
<para>
Return the name of a class structure's type.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>class</parameter>&#160;:</term>
<listitem><simpara> a valid <link linkend="GObjectClass"><type>GObjectClass</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-class-install-property" role="function">
<title>g_object_class_install_property ()</title>
<indexterm zone="g-object-class-install-property"><primary sortas="object_class_install_property">g_object_class_install_property</primary></indexterm><programlisting><link linkend="void">void</link>                g_object_class_install_property     (<link linkend="GObjectClass">GObjectClass</link> *oclass,
                                                         <link linkend="guint">guint</link> property_id,
                                                         <link linkend="GParamSpec">GParamSpec</link> *pspec);</programlisting>
<para>
Installs a new property. This is usually done in the class initializer.
</para>
<para>
Note that it is possible to redefine a property in a derived class,
by installing a property with the same name. This can be useful at times,
e.g. to change the range of allowed values or the default value.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>oclass</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObjectClass"><type>GObjectClass</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>property_id</parameter>&#160;:</term>
<listitem><simpara> the id for the new property
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GParamSpec"><type>GParamSpec</type></link> for the new property
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-class-find-property" role="function">
<title>g_object_class_find_property ()</title>
<indexterm zone="g-object-class-find-property"><primary sortas="object_class_find_property">g_object_class_find_property</primary></indexterm><programlisting><link linkend="GParamSpec">GParamSpec</link>*         g_object_class_find_property        (<link linkend="GObjectClass">GObjectClass</link> *oclass,
                                                         const <link linkend="gchar">gchar</link> *property_name);</programlisting>
<para>
Looks up the <link linkend="GParamSpec"><type>GParamSpec</type></link> for a property of a class.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>oclass</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObjectClass"><type>GObjectClass</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>property_name</parameter>&#160;:</term>
<listitem><simpara> the name of the property to look up
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the <link linkend="GParamSpec"><type>GParamSpec</type></link> for the property, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if the class
         doesn't have a property of that name
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-class-list-properties" role="function">
<title>g_object_class_list_properties ()</title>
<indexterm zone="g-object-class-list-properties"><primary sortas="object_class_list_properties">g_object_class_list_properties</primary></indexterm><programlisting><link linkend="GParamSpec">GParamSpec</link>**        g_object_class_list_properties      (<link linkend="GObjectClass">GObjectClass</link> *oclass,
                                                         <link linkend="guint">guint</link> *n_properties);</programlisting>
<para>
Get an array of <link linkend="GParamSpec"><type>GParamSpec</type></link>* for all properties of a class.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>oclass</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObjectClass"><type>GObjectClass</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_properties</parameter>&#160;:</term>
<listitem><simpara> return location for the length of the returned array
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> an array of <link linkend="GParamSpec"><type>GParamSpec</type></link>* which should be freed after use
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-class-override-property" role="function" condition="since:2.4">
<title>g_object_class_override_property ()</title>
<indexterm zone="g-object-class-override-property" role="2.4"><primary sortas="object_class_override_property">g_object_class_override_property</primary></indexterm><programlisting><link linkend="void">void</link>                g_object_class_override_property    (<link linkend="GObjectClass">GObjectClass</link> *oclass,
                                                         <link linkend="guint">guint</link> property_id,
                                                         const <link linkend="gchar">gchar</link> *name);</programlisting>
<para>
Registers <parameter>property_id</parameter> as referring to a property with the
name <parameter>name</parameter> in a parent class or in an interface implemented
by <parameter>oclass</parameter>. This allows this class to <firstterm>override</firstterm>
a property implementation in a parent class or to provide
the implementation of a property from an interface.
</para>
<para>
<note>
Internally, overriding is implemented by creating a property of type
<link linkend="GParamSpecOverride"><type>GParamSpecOverride</type></link>; generally operations that query the properties of
the object class, such as <link linkend="g-object-class-find-property"><function>g_object_class_find_property()</function></link> or
<link linkend="g-object-class-list-properties"><function>g_object_class_list_properties()</function></link> will return the overridden
property. However, in one case, the <parameter>construct_properties</parameter> argument of
the <parameter>constructor</parameter> virtual function, the <link linkend="GParamSpecOverride"><type>GParamSpecOverride</type></link> is passed
instead, so that the <parameter>param_id</parameter> field of the <link linkend="GParamSpec"><type>GParamSpec</type></link> will be
correct.  For virtually all uses, this makes no difference. If you
need to get the overridden property, you can call
<link linkend="g-param-spec-get-redirect-target"><function>g_param_spec_get_redirect_target()</function></link>.
</note></para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>oclass</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObjectClass"><type>GObjectClass</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>property_id</parameter>&#160;:</term>
<listitem><simpara> the new property ID
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>name</parameter>&#160;:</term>
<listitem><simpara> the name of a property registered in a parent class or
 in an interface of this class.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="g-object-interface-install-property" role="function" condition="since:2.4">
<title>g_object_interface_install_property ()</title>
<indexterm zone="g-object-interface-install-property" role="2.4"><primary sortas="object_interface_install_property">g_object_interface_install_property</primary></indexterm><programlisting><link linkend="void">void</link>                g_object_interface_install_property (<link linkend="gpointer">gpointer</link> g_iface,
                                                         <link linkend="GParamSpec">GParamSpec</link> *pspec);</programlisting>
<para>
Add a property to an interface; this is only useful for interfaces
that are added to GObject-derived types. Adding a property to an
interface forces all objects classes with that interface to have a
compatible property. The compatible property could be a newly
created <link linkend="GParamSpec"><type>GParamSpec</type></link>, but normally
<link linkend="g-object-class-override-property"><function>g_object_class_override_property()</function></link> will be used so that the object
class only needs to provide an implementation and inherits the
property description, default value, bounds, and so forth from the
interface property.
</para>
<para>
This function is meant to be called from the interface's default
vtable initialization function (the <parameter>class_init</parameter> member of
<link linkend="GTypeInfo"><type>GTypeInfo</type></link>.) It must not be called after after <parameter>class_init</parameter> has
been called for any object types implementing this interface.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>g_iface</parameter>&#160;:</term>
<listitem><simpara> any interface vtable for the interface, or the default
 vtable for the interface.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GParamSpec"><type>GParamSpec</type></link> for the new property
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="g-object-interface-find-property" role="function" condition="since:2.4">
<title>g_object_interface_find_property ()</title>
<indexterm zone="g-object-interface-find-property" role="2.4"><primary sortas="object_interface_find_property">g_object_interface_find_property</primary></indexterm><programlisting><link linkend="GParamSpec">GParamSpec</link>*         g_object_interface_find_property    (<link linkend="gpointer">gpointer</link> g_iface,
                                                         const <link linkend="gchar">gchar</link> *property_name);</programlisting>
<para>
Find the <link linkend="GParamSpec"><type>GParamSpec</type></link> with the given name for an
interface. Generally, the interface vtable passed in as <parameter>g_iface</parameter>
will be the default vtable from <link linkend="g-type-default-interface-ref"><function>g_type_default_interface_ref()</function></link>, or,
if you know the interface has already been loaded,
<link linkend="g-type-default-interface-peek"><function>g_type_default_interface_peek()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>g_iface</parameter>&#160;:</term>
<listitem><simpara> any interface vtable for the interface, or the default
 vtable for the interface
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>property_name</parameter>&#160;:</term>
<listitem><simpara> name of a property to lookup.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the <link linkend="GParamSpec"><type>GParamSpec</type></link> for the property of the interface with the
         name <parameter>property_name</parameter>, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if no such property exists.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="g-object-interface-list-properties" role="function" condition="since:2.4">
<title>g_object_interface_list_properties ()</title>
<indexterm zone="g-object-interface-list-properties" role="2.4"><primary sortas="object_interface_list_properties">g_object_interface_list_properties</primary></indexterm><programlisting><link linkend="GParamSpec">GParamSpec</link>**        g_object_interface_list_properties  (<link linkend="gpointer">gpointer</link> g_iface,
                                                         <link linkend="guint">guint</link> *n_properties_p);</programlisting>
<para>
Lists the properties of an interface.Generally, the interface
vtable passed in as <parameter>g_iface</parameter> will be the default vtable from
<link linkend="g-type-default-interface-ref"><function>g_type_default_interface_ref()</function></link>, or, if you know the interface has
already been loaded, <link linkend="g-type-default-interface-peek"><function>g_type_default_interface_peek()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>g_iface</parameter>&#160;:</term>
<listitem><simpara> any interface vtable for the interface, or the default
 vtable for the interface
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_properties_p</parameter>&#160;:</term>
<listitem><simpara> location to store number of properties returned.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a pointer to an array of pointers to <link linkend="GParamSpec"><type>GParamSpec</type></link>
         structures. The paramspecs are owned by GLib, but the
         array should be freed with <link linkend="g-free"><function>g_free()</function></link> when you are done with
         it.
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.4</para></refsect2>
<refsect2 id="g-object-new" role="function">
<title>g_object_new ()</title>
<indexterm zone="g-object-new"><primary sortas="object_new">g_object_new</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link>            g_object_new                        (<link linkend="GType">GType</link> object_type,
                                                         const <link linkend="gchar">gchar</link> *first_property_name,
                                                         ...);</programlisting>
<para>
Creates a new instance of a <link linkend="GObject"><type>GObject</type></link> subtype and sets its properties.
</para>
<para>
Construction parameters (see <link linkend="G-PARAM-CONSTRUCT--CAPS"><type>G_PARAM_CONSTRUCT</type></link>, <link linkend="G-PARAM-CONSTRUCT-ONLY--CAPS"><type>G_PARAM_CONSTRUCT_ONLY</type></link>)
which are not explicitly specified are set to their default values.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object_type</parameter>&#160;:</term>
<listitem><simpara> the type id of the <link linkend="GObject"><type>GObject</type></link> subtype to instantiate
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>first_property_name</parameter>&#160;:</term>
<listitem><simpara> the name of the first property
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>...</parameter>&#160;:</term>
<listitem><simpara> the value of the first property, followed optionally by more
 name/value pairs, followed by <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new instance of <parameter>object_type</parameter>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-newv" role="function">
<title>g_object_newv ()</title>
<indexterm zone="g-object-newv"><primary sortas="object_newv">g_object_newv</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link>            g_object_newv                       (<link linkend="GType">GType</link> object_type,
                                                         <link linkend="guint">guint</link> n_parameters,
                                                         <link linkend="GParameter">GParameter</link> *parameters);</programlisting>
<para>
Creates a new instance of a <link linkend="GObject"><type>GObject</type></link> subtype and sets its properties.
</para>
<para>
Construction parameters (see <link linkend="G-PARAM-CONSTRUCT--CAPS"><type>G_PARAM_CONSTRUCT</type></link>, <link linkend="G-PARAM-CONSTRUCT-ONLY--CAPS"><type>G_PARAM_CONSTRUCT_ONLY</type></link>)
which are not explicitly specified are set to their default values.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object_type</parameter>&#160;:</term>
<listitem><simpara> the type id of the <link linkend="GObject"><type>GObject</type></link> subtype to instantiate
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>n_parameters</parameter>&#160;:</term>
<listitem><simpara> the length of the <parameter>parameters</parameter> array
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>parameters</parameter>&#160;:</term>
<listitem><simpara> an array of <link linkend="GParameter"><type>GParameter</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new instance of <parameter>object_type</parameter>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GParameter" role="struct">
<title>GParameter</title>
<indexterm zone="GParameter"><primary sortas="Parameter">GParameter</primary></indexterm><programlisting>typedef struct {
  const gchar *name;
  GValue       value;
} GParameter;
</programlisting>
<para>
The <structname>GParameter</structname> struct is an auxiliary structure used
to hand parameter name/value pairs to <link linkend="g-object-newv"><function>g_object_newv()</function></link>.</para>
<para>
</para><variablelist role="struct">
<varlistentry>
<term>const&#160;<link linkend="gchar">gchar</link>&#160;*<structfield>name</structfield>;</term>
<listitem><simpara> the parameter name
</simpara></listitem>
</varlistentry>
<varlistentry>
<term><link linkend="GValue">GValue</link>&#160;<structfield>value</structfield>;</term>
<listitem><simpara> the parameter value
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-ref" role="function">
<title>g_object_ref ()</title>
<indexterm zone="g-object-ref"><primary sortas="object_ref">g_object_ref</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link>            g_object_ref                        (<link linkend="gpointer">gpointer</link> object);</programlisting>
<para>
Increases the reference count of <parameter>object</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObject"><type>GObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the same <parameter>object</parameter>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-unref" role="function">
<title>g_object_unref ()</title>
<indexterm zone="g-object-unref"><primary sortas="object_unref">g_object_unref</primary></indexterm><programlisting><link linkend="void">void</link>                g_object_unref                      (<link linkend="gpointer">gpointer</link> object);</programlisting>
<para>
Decreases the reference count of <parameter>object</parameter>. When its reference count
drops to 0, the object is finalized (i.e. its memory is freed).</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObject"><type>GObject</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-ref-sink" role="function" condition="since:2.10">
<title>g_object_ref_sink ()</title>
<indexterm zone="g-object-ref-sink" role="2.10"><primary sortas="object_ref_sink">g_object_ref_sink</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link>            g_object_ref_sink                   (<link linkend="gpointer">gpointer</link> object);</programlisting>
<para>
Increase the reference count of <parameter>object</parameter>, and possibly remove the
<link linkend="floating-ref">floating</link> reference, if <parameter>object</parameter>
has a floating reference.
</para>
<para>
In other words, if the object is floating, then this call "assumes
ownership" of the floating reference, converting it to a normal
reference by clearing the floating flag while leaving the reference
count unchanged.  If the object is not floating, then this call
adds a new normal reference increasing the reference count by one.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObject"><type>GObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <parameter>object</parameter>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.10</para></refsect2>
<refsect2 id="GInitiallyUnowned" role="typedef">
<title>GInitiallyUnowned</title>
<indexterm zone="GInitiallyUnowned"><primary sortas="InitiallyUnowned">GInitiallyUnowned</primary></indexterm><programlisting>typedef struct _GObject                  GInitiallyUnowned;
</programlisting>
<para>
All the fields in the <structname>GInitiallyUnowned</structname> structure 
are private to the <link linkend="GInitiallyUnowned"><type>GInitiallyUnowned</type></link> implementation and should never be 
accessed directly.</para>
<para>
</para></refsect2>
<refsect2 id="GInitiallyUnownedClass" role="typedef">
<title>GInitiallyUnownedClass</title>
<indexterm zone="GInitiallyUnownedClass"><primary sortas="InitiallyUnownedClass">GInitiallyUnownedClass</primary></indexterm><programlisting>typedef struct _GObjectClass             GInitiallyUnownedClass;
</programlisting>
<para>
The class structure for the <structname>GInitiallyUnowned</structname> type.</para>
<para>
</para></refsect2>
<refsect2 id="G-TYPE-INITIALLY-UNOWNED--CAPS" role="macro">
<title>G_TYPE_INITIALLY_UNOWNED</title>
<indexterm zone="G-TYPE-INITIALLY-UNOWNED--CAPS"><primary sortas="TYPE_INITIALLY_UNOWNED">G_TYPE_INITIALLY_UNOWNED</primary></indexterm><programlisting>#define G_TYPE_INITIALLY_UNOWNED	      (g_initially_unowned_get_type())
</programlisting>
<para>
The type for <link linkend="GInitiallyUnowned"><type>GInitiallyUnowned</type></link>.</para>
<para>
</para></refsect2>
<refsect2 id="g-object-is-floating" role="function" condition="since:2.10">
<title>g_object_is_floating ()</title>
<indexterm zone="g-object-is-floating" role="2.10"><primary sortas="object_is_floating">g_object_is_floating</primary></indexterm><programlisting><link linkend="gboolean">gboolean</link>            g_object_is_floating                (<link linkend="gpointer">gpointer</link> object);</programlisting>
<para>
Checks wether <parameter>object</parameter> has a <link linkend="floating-ref">floating</link>
reference.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObject"><type>GObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if <parameter>object</parameter> has a floating reference
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.10</para></refsect2>
<refsect2 id="g-object-force-floating" role="function" condition="since:2.10">
<title>g_object_force_floating ()</title>
<indexterm zone="g-object-force-floating" role="2.10"><primary sortas="object_force_floating">g_object_force_floating</primary></indexterm><programlisting><link linkend="void">void</link>                g_object_force_floating             (<link linkend="GObject">GObject</link> *object);</programlisting>
<para>
This function is intended for <link linkend="GObject"><type>GObject</type></link> implementations to re-enforce a
<link linkend="floating-ref">floating</link> object reference.
Doing this is seldomly required, all
<link linkend="GInitiallyUnowned"><type>GInitiallyUnowned</type></link><!-- -->s are created with a floating reference which
usually just needs to be sunken by calling <link linkend="g-object-ref-sink"><function>g_object_ref_sink()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObject"><type>GObject</type></link>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.10</para></refsect2>
<refsect2 id="GWeakNotify" role="function">
<title>GWeakNotify ()</title>
<indexterm zone="GWeakNotify"><primary sortas="WeakNotify">GWeakNotify</primary></indexterm><programlisting><link linkend="void">void</link>                (*GWeakNotify)                      (<link linkend="gpointer">gpointer</link> data,
                                                         <link linkend="GObject">GObject</link> *where_the_object_was);</programlisting>
<para>
A <link linkend="GWeakNotify"><type>GWeakNotify</type></link> function can be added to an object as a callback that gets
triggered when the object is finalized. Since the object is already being
finalized when the <link linkend="GWeakNotify"><type>GWeakNotify</type></link> is called, there's not much you could do 
with the object, apart from e.g. using its adress as hash-index or the like.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> data that was provided when the weak reference was established
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>where_the_object_was</parameter>&#160;:</term>
<listitem><simpara> the object being finalized
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-weak-ref" role="function">
<title>g_object_weak_ref ()</title>
<indexterm zone="g-object-weak-ref"><primary sortas="object_weak_ref">g_object_weak_ref</primary></indexterm><programlisting><link linkend="void">void</link>                g_object_weak_ref                   (<link linkend="GObject">GObject</link> *object,
                                                         <link linkend="GWeakNotify">GWeakNotify</link> notify,
                                                         <link linkend="gpointer">gpointer</link> data);</programlisting>
<para>
Adds a weak reference callback to an object. Weak references are
used for notification when an object is finalized. They are called
"weak references" because they allow you to safely hold a pointer
to an object without calling <link linkend="g-object-ref"><function>g_object_ref()</function></link> (<link linkend="g-object-ref"><function>g_object_ref()</function></link> adds a
strong reference, that is, forces the object to stay alive).</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> <link linkend="GObject"><type>GObject</type></link> to reference weakly
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>notify</parameter>&#160;:</term>
<listitem><simpara> callback to invoke before the object is freed
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> extra data to pass to notify
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-weak-unref" role="function">
<title>g_object_weak_unref ()</title>
<indexterm zone="g-object-weak-unref"><primary sortas="object_weak_unref">g_object_weak_unref</primary></indexterm><programlisting><link linkend="void">void</link>                g_object_weak_unref                 (<link linkend="GObject">GObject</link> *object,
                                                         <link linkend="GWeakNotify">GWeakNotify</link> notify,
                                                         <link linkend="gpointer">gpointer</link> data);</programlisting>
<para>
Removes a weak reference callback to an object.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> <link linkend="GObject"><type>GObject</type></link> to remove a weak reference from
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>notify</parameter>&#160;:</term>
<listitem><simpara> callback to search for
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> data to search for
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-add-weak-pointer" role="function">
<title>g_object_add_weak_pointer ()</title>
<indexterm zone="g-object-add-weak-pointer"><primary sortas="object_add_weak_pointer">g_object_add_weak_pointer</primary></indexterm><programlisting><link linkend="void">void</link>                g_object_add_weak_pointer           (<link linkend="GObject">GObject</link> *object,
                                                         <link linkend="gpointer">gpointer</link> *weak_pointer_location);</programlisting>
<para>
Adds a weak reference from weak_pointer to <parameter>object</parameter> to indicate that
the pointer located at <parameter>weak_pointer_location</parameter> is only valid during
the lifetime of <parameter>object</parameter>. When the <parameter>object</parameter> is finalized,
<parameter>weak_pointer</parameter> will be set to <link linkend="NULL--CAPS"><literal>NULL</literal></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> The object that should be weak referenced.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>weak_pointer_location</parameter>&#160;:</term>
<listitem><simpara> The memory address of a pointer.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-remove-weak-pointer" role="function">
<title>g_object_remove_weak_pointer ()</title>
<indexterm zone="g-object-remove-weak-pointer"><primary sortas="object_remove_weak_pointer">g_object_remove_weak_pointer</primary></indexterm><programlisting><link linkend="void">void</link>                g_object_remove_weak_pointer        (<link linkend="GObject">GObject</link> *object,
                                                         <link linkend="gpointer">gpointer</link> *weak_pointer_location);</programlisting>
<para>
Removes a weak reference from <parameter>object</parameter> that was previously added
using <link linkend="g-object-add-weak-pointer"><function>g_object_add_weak_pointer()</function></link>. The <parameter>weak_pointer_location</parameter> has
to match the one used with <link linkend="g-object-add-weak-pointer"><function>g_object_add_weak_pointer()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> The object that is weak referenced.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>weak_pointer_location</parameter>&#160;:</term>
<listitem><simpara> The memory address of a pointer.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GToggleNotify" role="function">
<title>GToggleNotify ()</title>
<indexterm zone="GToggleNotify"><primary sortas="ToggleNotify">GToggleNotify</primary></indexterm><programlisting><link linkend="void">void</link>                (*GToggleNotify)                    (<link linkend="gpointer">gpointer</link> data,
                                                         <link linkend="GObject">GObject</link> *object,
                                                         <link linkend="gboolean">gboolean</link> is_last_ref);</programlisting>
<para>
A callback function used for notification when the state
of a toggle reference changes. See <link linkend="g-object-add-toggle-ref"><function>g_object_add_toggle_ref()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> Callback data passed to <link linkend="g-object-add-toggle-ref"><function>g_object_add_toggle_ref()</function></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> The object on which <link linkend="g-object-add-toggle-ref"><function>g_object_add_toggle_ref()</function></link> was called.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>is_last_ref</parameter>&#160;:</term>
<listitem><simpara> <link linkend="TRUE--CAPS"><literal>TRUE</literal></link> if the toggle reference is now the
 last reference to the object. <link linkend="FALSE--CAPS"><literal>FALSE</literal></link> if the toggle
 reference was the last reference and there are now other
 references.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-add-toggle-ref" role="function" condition="since:2.8">
<title>g_object_add_toggle_ref ()</title>
<indexterm zone="g-object-add-toggle-ref" role="2.8"><primary sortas="object_add_toggle_ref">g_object_add_toggle_ref</primary></indexterm><programlisting><link linkend="void">void</link>                g_object_add_toggle_ref             (<link linkend="GObject">GObject</link> *object,
                                                         <link linkend="GToggleNotify">GToggleNotify</link> notify,
                                                         <link linkend="gpointer">gpointer</link> data);</programlisting>
<para>
Increases the reference count of the object by one and sets a
callback to be called when all other references to the object are
dropped, or when this is already the last reference to the object
and another reference is established.
</para>
<para>
This functionality is intended for binding <parameter>object</parameter> to a proxy
object managed by another memory manager. This is done with two
paired references: the strong reference added by
<link linkend="g-object-add-toggle-ref"><function>g_object_add_toggle_ref()</function></link> and a reverse reference to the proxy
object which is either a strong reference or weak reference.
</para>
<para>
The setup is that when there are no other references to <parameter>object</parameter>,
only a weak reference is held in the reverse direction from <parameter>object</parameter>
to the proxy object, but when there are other references held to
<parameter>object</parameter>, a strong reference is held. The <parameter>notify</parameter> callback is called
when the reference from <parameter>object</parameter> to the proxy object should be
<firstterm>toggled</firstterm> from strong to weak (<parameter>is_last_ref</parameter>
true) or weak to strong (<parameter>is_last_ref</parameter> false).
</para>
<para>
Since a (normal) reference must be held to the object before
calling <link linkend="g-object-toggle-ref"><function>g_object_toggle_ref()</function></link>, the initial state of the reverse
link is always strong.
</para>
<para>
Multiple toggle references may be added to the same gobject,
however if there are multiple toggle references to an object, none
of them will ever be notified until all but one are removed.  For
this reason, you should only ever use a toggle reference if there
is important state in the proxy object.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObject"><type>GObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>notify</parameter>&#160;:</term>
<listitem><simpara> a function to call when this reference is the
 last reference to the object, or is no longer
 the last reference.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> data to pass to <parameter>notify</parameter>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.8</para></refsect2>
<refsect2 id="g-object-remove-toggle-ref" role="function" condition="since:2.8">
<title>g_object_remove_toggle_ref ()</title>
<indexterm zone="g-object-remove-toggle-ref" role="2.8"><primary sortas="object_remove_toggle_ref">g_object_remove_toggle_ref</primary></indexterm><programlisting><link linkend="void">void</link>                g_object_remove_toggle_ref          (<link linkend="GObject">GObject</link> *object,
                                                         <link linkend="GToggleNotify">GToggleNotify</link> notify,
                                                         <link linkend="gpointer">gpointer</link> data);</programlisting>
<para>
Removes a reference added with <link linkend="g-object-add-toggle-ref"><function>g_object_add_toggle_ref()</function></link>. The
reference count of the object is decreased by one.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObject"><type>GObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>notify</parameter>&#160;:</term>
<listitem><simpara> a function to call when this reference is the
 last reference to the object, or is no longer
 the last reference.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> data to pass to <parameter>notify</parameter>
</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 2.8</para></refsect2>
<refsect2 id="g-object-connect" role="function">
<title>g_object_connect ()</title>
<indexterm zone="g-object-connect"><primary sortas="object_connect">g_object_connect</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link>            g_object_connect                    (<link linkend="gpointer">gpointer</link> object,
                                                         const <link linkend="gchar">gchar</link> *signal_spec,
                                                         ...);</programlisting>
<para>
A convenience function to connect multiple signals at once.
</para>
<para>
The signal specs expected by this function have the form
"modifier::signal_name", where modifier can be one of the following:
<variablelist>
<varlistentry>
<term>signal</term>
<listitem><para>
equivalent to <literal>g_signal_connect_data (..., NULL, 0)</literal>
</para></listitem>
</varlistentry>
<varlistentry>
<term>object_signal</term>
<term>object-signal</term>
<listitem><para>
equivalent to <literal>g_signal_connect_object (..., 0)</literal>
</para></listitem>
</varlistentry>
<varlistentry>
<term>swapped_signal</term>
<term>swapped-signal</term>
<listitem><para>
equivalent to <literal>g_signal_connect_data (..., NULL, G_CONNECT_SWAPPED)</literal>
</para></listitem>
</varlistentry>
<varlistentry>
<term>swapped_object_signal</term>
<term>swapped-object-signal</term>
<listitem><para>
equivalent to <literal>g_signal_connect_object (..., G_CONNECT_SWAPPED)</literal>
</para></listitem>
</varlistentry>
<varlistentry>
<term>signal_after</term>
<term>signal-after</term>
<listitem><para>
equivalent to <literal>g_signal_connect_data (..., NULL, G_CONNECT_AFTER)</literal>
</para></listitem>
</varlistentry>
<varlistentry>
<term>object_signal_after</term>
<term>object-signal-after</term>
<listitem><para>
equivalent to <literal>g_signal_connect_object (..., G_CONNECT_AFTER)</literal>
</para></listitem>
</varlistentry>
<varlistentry>
<term>swapped_signal_after</term>
<term>swapped-signal-after</term>
<listitem><para>
equivalent to <literal>g_signal_connect_data (..., NULL, G_CONNECT_SWAPPED | G_CONNECT_AFTER)</literal>
</para></listitem>
</varlistentry>
<varlistentry>
<term>swapped_object_signal_after</term>
<term>swapped-object-signal-after</term>
<listitem><para>
equivalent to <literal>g_signal_connect_object (..., G_CONNECT_SWAPPED | G_CONNECT_AFTER)</literal>
</para></listitem>
</varlistentry>
</variablelist>
</para>
<para>
<informalexample><programlisting>
  menu->toplevel = g_object_connect (g_object_new (GTK_TYPE_WINDOW,
						   "type", GTK_WINDOW_POPUP,
						   "child", menu,
						   NULL),
				     "signal::event", gtk_menu_window_event, menu,
				     "signal::size_request", gtk_menu_window_size_request, menu,
				     "signal::destroy", gtk_widget_destroyed, &amp;menu-&gt;toplevel,
				     NULL);
</programlisting></informalexample></para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObject"><type>GObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>signal_spec</parameter>&#160;:</term>
<listitem><simpara> the spec for the first signal
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>...</parameter>&#160;:</term>
<listitem><simpara> <link linkend="GCallback"><type>GCallback</type></link> for the first signal, followed by data for the
      first signal, followed optionally by more signal
      spec/callback/data triples, followed by <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> <parameter>object</parameter>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-disconnect" role="function">
<title>g_object_disconnect ()</title>
<indexterm zone="g-object-disconnect"><primary sortas="object_disconnect">g_object_disconnect</primary></indexterm><programlisting><link linkend="void">void</link>                g_object_disconnect                 (<link linkend="gpointer">gpointer</link> object,
                                                         const <link linkend="gchar">gchar</link> *signal_spec,
                                                         ...);</programlisting>
<para>
A convenience function to disconnect multiple signals at once.
</para>
<para>
The signal specs expected by this function have the form
"any_signal", which means to disconnect any signal with matching
callback and data, or "any_signal::signal_name", which only
disconnects the signal named "signal_name".</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObject"><type>GObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>signal_spec</parameter>&#160;:</term>
<listitem><simpara> the spec for the first signal
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>...</parameter>&#160;:</term>
<listitem><simpara> <link linkend="GCallback"><type>GCallback</type></link> for the first signal, followed by data for the first signal,
 followed optionally by more signal spec/callback/data triples,
 followed by <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-set" role="function">
<title>g_object_set ()</title>
<indexterm zone="g-object-set"><primary sortas="object_set">g_object_set</primary></indexterm><programlisting><link linkend="void">void</link>                g_object_set                        (<link linkend="gpointer">gpointer</link> object,
                                                         const <link linkend="gchar">gchar</link> *first_property_name,
                                                         ...);</programlisting>
<para>
Sets properties on an object.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObject"><type>GObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>first_property_name</parameter>&#160;:</term>
<listitem><simpara> name of the first property to set
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>...</parameter>&#160;:</term>
<listitem><simpara> value for the first property, followed optionally by more
 name/value pairs, followed by <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-get" role="function">
<title>g_object_get ()</title>
<indexterm zone="g-object-get"><primary sortas="object_get">g_object_get</primary></indexterm><programlisting><link linkend="void">void</link>                g_object_get                        (<link linkend="gpointer">gpointer</link> object,
                                                         const <link linkend="gchar">gchar</link> *first_property_name,
                                                         ...);</programlisting>
<para>
Gets properties of an object.
</para>
<para>
In general, a copy is made of the property contents and the caller
is responsible for freeing the memory in the appropriate manner for
the type, for instance by calling <link linkend="g-free"><function>g_free()</function></link> or <link linkend="g-object-unref"><function>g_object_unref()</function></link>.
</para>
<para>
<example>
<title>Using g_object_get(<!-- -->)</title>
An example of using <link linkend="g-object-get"><function>g_object_get()</function></link> to get the contents
of three properties - one of type <link linkend="G-TYPE-INT--CAPS"><type>G_TYPE_INT</type></link>,
one of type <link linkend="G-TYPE-STRING--CAPS"><type>G_TYPE_STRING</type></link>, and one of type <link linkend="G-TYPE-OBJECT----CAPS"><type>""</type></link>
<programlisting>
 gint intval;
 gchar *strval;
 GObject *objval;

 g_object_get (my_object,
               "int-property", &amp;intval,
               "str-property", &amp;strval,
               "obj-property", &amp;objval,
               NULL);

 // Do something with intval, strval, objval

 g_free (strval);
 g_object_unref (objval);
</programlisting>
</example></para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObject"><type>GObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>first_property_name</parameter>&#160;:</term>
<listitem><simpara> name of the first property to get
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>...</parameter>&#160;:</term>
<listitem><simpara> return location for the first property, followed optionally by more
 name/return location pairs, followed by <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-notify" role="function">
<title>g_object_notify ()</title>
<indexterm zone="g-object-notify"><primary sortas="object_notify">g_object_notify</primary></indexterm><programlisting><link linkend="void">void</link>                g_object_notify                     (<link linkend="GObject">GObject</link> *object,
                                                         const <link linkend="gchar">gchar</link> *property_name);</programlisting>
<para>
Emits a "notify" signal for the property <parameter>property_name</parameter> on <parameter>object</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObject"><type>GObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>property_name</parameter>&#160;:</term>
<listitem><simpara> the name of a property installed on the class of <parameter>object</parameter>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-freeze-notify" role="function">
<title>g_object_freeze_notify ()</title>
<indexterm zone="g-object-freeze-notify"><primary sortas="object_freeze_notify">g_object_freeze_notify</primary></indexterm><programlisting><link linkend="void">void</link>                g_object_freeze_notify              (<link linkend="GObject">GObject</link> *object);</programlisting>
<para>
Increases the freeze count on <parameter>object</parameter>. If the freeze count is
non-zero, the emission of "notify" signals on <parameter>object</parameter> is
stopped. The signals are queued until the freeze count is decreased
to zero.
</para>
<para>
This is necessary for accessors that modify multiple properties to prevent
premature notification while the object is still being modified.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObject"><type>GObject</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-thaw-notify" role="function">
<title>g_object_thaw_notify ()</title>
<indexterm zone="g-object-thaw-notify"><primary sortas="object_thaw_notify">g_object_thaw_notify</primary></indexterm><programlisting><link linkend="void">void</link>                g_object_thaw_notify                (<link linkend="GObject">GObject</link> *object);</programlisting>
<para>
Reverts the effect of a previous call to
<link linkend="g-object-freeze-notify"><function>g_object_freeze_notify()</function></link>. The freeze count is decreased on <parameter>object</parameter>
and when it reaches zero, all queued "notify" signals are emitted.
</para>
<para>
It is an error to call this function when the freeze count is zero.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObject"><type>GObject</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-get-data" role="function">
<title>g_object_get_data ()</title>
<indexterm zone="g-object-get-data"><primary sortas="object_get_data">g_object_get_data</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link>            g_object_get_data                   (<link linkend="GObject">GObject</link> *object,
                                                         const <link linkend="gchar">gchar</link> *key);</programlisting>
<para>
Gets a named field from the objects table of associations (see <link linkend="g-object-set-data"><function>g_object_set_data()</function></link>).</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> <link linkend="GObject"><type>GObject</type></link> containing the associations
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>key</parameter>&#160;:</term>
<listitem><simpara> name of the key for that association
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the data if found, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if no such data exists.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-set-data" role="function">
<title>g_object_set_data ()</title>
<indexterm zone="g-object-set-data"><primary sortas="object_set_data">g_object_set_data</primary></indexterm><programlisting><link linkend="void">void</link>                g_object_set_data                   (<link linkend="GObject">GObject</link> *object,
                                                         const <link linkend="gchar">gchar</link> *key,
                                                         <link linkend="gpointer">gpointer</link> data);</programlisting>
<para>
Each object carries around a table of associations from
strings to pointers.  This function lets you set an association.
</para>
<para>
If the object already had an association with that name,
the old association will be destroyed.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> <link linkend="GObject"><type>GObject</type></link> containing the associations.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>key</parameter>&#160;:</term>
<listitem><simpara> name of the key
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> data to associate with that key
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-set-data-full" role="function">
<title>g_object_set_data_full ()</title>
<indexterm zone="g-object-set-data-full"><primary sortas="object_set_data_full">g_object_set_data_full</primary></indexterm><programlisting><link linkend="void">void</link>                g_object_set_data_full              (<link linkend="GObject">GObject</link> *object,
                                                         const <link linkend="gchar">gchar</link> *key,
                                                         <link linkend="gpointer">gpointer</link> data,
                                                         <link linkend="GDestroyNotify">GDestroyNotify</link> destroy);</programlisting>
<para>
Like <link linkend="g-object-set-data"><function>g_object_set_data()</function></link> except it adds notification
for when the association is destroyed, either by setting it
to a different value or when the object is destroyed.
</para>
<para>
Note that the <parameter>destroy</parameter> callback is not called if <parameter>data</parameter> is <link linkend="NULL--CAPS"><literal>NULL</literal></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> <link linkend="GObject"><type>GObject</type></link> containing the associations
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>key</parameter>&#160;:</term>
<listitem><simpara> name of the key
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> data to associate with that key
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>destroy</parameter>&#160;:</term>
<listitem><simpara> function to call when the association is destroyed
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-steal-data" role="function">
<title>g_object_steal_data ()</title>
<indexterm zone="g-object-steal-data"><primary sortas="object_steal_data">g_object_steal_data</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link>            g_object_steal_data                 (<link linkend="GObject">GObject</link> *object,
                                                         const <link linkend="gchar">gchar</link> *key);</programlisting>
<para>
Remove a specified datum from the object's data associations,
without invoking the association's destroy handler.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> <link linkend="GObject"><type>GObject</type></link> containing the associations
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>key</parameter>&#160;:</term>
<listitem><simpara> name of the key
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the data if found, or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if no such data exists.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-get-qdata" role="function">
<title>g_object_get_qdata ()</title>
<indexterm zone="g-object-get-qdata"><primary sortas="object_get_qdata">g_object_get_qdata</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link>            g_object_get_qdata                  (<link linkend="GObject">GObject</link> *object,
                                                         <link linkend="GQuark">GQuark</link> quark);</programlisting>
<para>
This function gets back user data pointers stored via
<link linkend="g-object-set-qdata"><function>g_object_set_qdata()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> The GObject to get a stored user data pointer from
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>quark</parameter>&#160;:</term>
<listitem><simpara> A <link linkend="GQuark"><type>GQuark</type></link>, naming the user data pointer
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> The user data pointer set, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-set-qdata" role="function">
<title>g_object_set_qdata ()</title>
<indexterm zone="g-object-set-qdata"><primary sortas="object_set_qdata">g_object_set_qdata</primary></indexterm><programlisting><link linkend="void">void</link>                g_object_set_qdata                  (<link linkend="GObject">GObject</link> *object,
                                                         <link linkend="GQuark">GQuark</link> quark,
                                                         <link linkend="gpointer">gpointer</link> data);</programlisting>
<para>
This sets an opaque, named pointer on an object.
The name is specified through a <link linkend="GQuark"><type>GQuark</type></link> (retrived e.g. via
<link linkend="g-quark-from-static-string"><function>g_quark_from_static_string()</function></link>), and the pointer
can be gotten back from the <parameter>object</parameter> with <link linkend="g-object-get-qdata"><function>g_object_get_qdata()</function></link>
until the <parameter>object</parameter> is finalized.
Setting a previously set user data pointer, overrides (frees)
the old pointer set, using <link linkend="NULL--CAPS"><type>NULL</type></link> as pointer essentially
removes the data stored.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> The GObject to set store a user data pointer
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>quark</parameter>&#160;:</term>
<listitem><simpara> A <link linkend="GQuark"><type>GQuark</type></link>, naming the user data pointer
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> An opaque user data pointer
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-set-qdata-full" role="function">
<title>g_object_set_qdata_full ()</title>
<indexterm zone="g-object-set-qdata-full"><primary sortas="object_set_qdata_full">g_object_set_qdata_full</primary></indexterm><programlisting><link linkend="void">void</link>                g_object_set_qdata_full             (<link linkend="GObject">GObject</link> *object,
                                                         <link linkend="GQuark">GQuark</link> quark,
                                                         <link linkend="gpointer">gpointer</link> data,
                                                         <link linkend="GDestroyNotify">GDestroyNotify</link> destroy);</programlisting>
<para>
This function works like <link linkend="g-object-set-qdata"><function>g_object_set_qdata()</function></link>, but in addition,
a void (*destroy) (gpointer) function may be specified which is
called with <parameter>data</parameter> as argument when the <parameter>object</parameter> is finalized, or
the data is being overwritten by a call to <link linkend="g-object-set-qdata"><function>g_object_set_qdata()</function></link>
with the same <parameter>quark</parameter>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> The GObject to set store a user data pointer
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>quark</parameter>&#160;:</term>
<listitem><simpara> A <link linkend="GQuark"><type>GQuark</type></link>, naming the user data pointer
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>data</parameter>&#160;:</term>
<listitem><simpara> An opaque user data pointer
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>destroy</parameter>&#160;:</term>
<listitem><simpara> Function to invoke with <parameter>data</parameter> as argument, when <parameter>data</parameter>
          needs to be freed
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-steal-qdata" role="function">
<title>g_object_steal_qdata ()</title>
<indexterm zone="g-object-steal-qdata"><primary sortas="object_steal_qdata">g_object_steal_qdata</primary></indexterm><programlisting><link linkend="gpointer">gpointer</link>            g_object_steal_qdata                (<link linkend="GObject">GObject</link> *object,
                                                         <link linkend="GQuark">GQuark</link> quark);</programlisting>
<para>
This function gets back user data pointers stored via
<link linkend="g-object-set-qdata"><function>g_object_set_qdata()</function></link> and removes the <parameter>data</parameter> from object
without invoking its <link linkend="destroy"><function>destroy()</function></link> function (if any was
set).
Usually, calling this function is only required to update
user data pointers with a destroy notifier, for example:
<informalexample><programlisting>
void
object_add_to_user_list (GObject     *object,
                         const gchar *new_string)
{
  // the quark, naming the object data
  GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
  // retrive the old string list
  GList *list = g_object_steal_qdata (object, quark_string_list);

  // prepend new string
  list = g_list_prepend (list, g_strdup (new_string));
  // this changed 'list', so we need to set it again
  g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
}
static void
free_string_list (gpointer data)
{
  GList *node, *list = data;

  for (node = list; node; node = node->next)
    g_free (node->data);
  g_list_free (list);
}
</programlisting></informalexample>
Using <link linkend="g-object-get-qdata"><function>g_object_get_qdata()</function></link> in the above example, instead of
<link linkend="g-object-steal-qdata"><function>g_object_steal_qdata()</function></link> would have left the destroy function set,
and thus the partial string list would have been freed upon
<link linkend="g-object-set-qdata-full"><function>g_object_set_qdata_full()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> The GObject to get a stored user data pointer from
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>quark</parameter>&#160;:</term>
<listitem><simpara> A <link linkend="GQuark"><type>GQuark</type></link>, naming the user data pointer
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> The user data pointer set, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-set-property" role="function">
<title>g_object_set_property ()</title>
<indexterm zone="g-object-set-property"><primary sortas="object_set_property">g_object_set_property</primary></indexterm><programlisting><link linkend="void">void</link>                g_object_set_property               (<link linkend="GObject">GObject</link> *object,
                                                         const <link linkend="gchar">gchar</link> *property_name,
                                                         const <link linkend="GValue">GValue</link> *value);</programlisting>
<para>
Sets a property on an object.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObject"><type>GObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>property_name</parameter>&#160;:</term>
<listitem><simpara> the name of the property to set
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter>&#160;:</term>
<listitem><simpara> the value
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-get-property" role="function">
<title>g_object_get_property ()</title>
<indexterm zone="g-object-get-property"><primary sortas="object_get_property">g_object_get_property</primary></indexterm><programlisting><link linkend="void">void</link>                g_object_get_property               (<link linkend="GObject">GObject</link> *object,
                                                         const <link linkend="gchar">gchar</link> *property_name,
                                                         <link linkend="GValue">GValue</link> *value);</programlisting>
<para>
Gets a property of an object.
</para>
<para>
In general, a copy is made of the property contents and the caller is
responsible for freeing the memory by calling <link linkend="g-value-unset"><function>g_value_unset()</function></link>.
</para>
<para>
Note that <link linkend="g-object-get-property"><function>g_object_get_property()</function></link> is really intended for language
bindings, <link linkend="g-object-get"><function>g_object_get()</function></link> is much more convenient for C programming.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObject"><type>GObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>property_name</parameter>&#160;:</term>
<listitem><simpara> the name of the property to get
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter>&#160;:</term>
<listitem><simpara> return location for the property value
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-new-valist" role="function">
<title>g_object_new_valist ()</title>
<indexterm zone="g-object-new-valist"><primary sortas="object_new_valist">g_object_new_valist</primary></indexterm><programlisting><link linkend="GObject">GObject</link>*            g_object_new_valist                 (<link linkend="GType">GType</link> object_type,
                                                         const <link linkend="gchar">gchar</link> *first_property_name,
                                                         <link linkend="va-list">va_list</link> var_args);</programlisting>
<para>
Creates a new instance of a <link linkend="GObject"><type>GObject</type></link> subtype and sets its properties.
</para>
<para>
Construction parameters (see <link linkend="G-PARAM-CONSTRUCT--CAPS"><type>G_PARAM_CONSTRUCT</type></link>, <link linkend="G-PARAM-CONSTRUCT-ONLY--CAPS"><type>G_PARAM_CONSTRUCT_ONLY</type></link>)
which are not explicitly specified are set to their default values.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object_type</parameter>&#160;:</term>
<listitem><simpara> the type id of the <link linkend="GObject"><type>GObject</type></link> subtype to instantiate
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>first_property_name</parameter>&#160;:</term>
<listitem><simpara> the name of the first property
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>var_args</parameter>&#160;:</term>
<listitem><simpara> the value of the first property, followed optionally by more
 name/value pairs, followed by <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> a new instance of <parameter>object_type</parameter>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-set-valist" role="function">
<title>g_object_set_valist ()</title>
<indexterm zone="g-object-set-valist"><primary sortas="object_set_valist">g_object_set_valist</primary></indexterm><programlisting><link linkend="void">void</link>                g_object_set_valist                 (<link linkend="GObject">GObject</link> *object,
                                                         const <link linkend="gchar">gchar</link> *first_property_name,
                                                         <link linkend="va-list">va_list</link> var_args);</programlisting>
<para>
Sets properties on an object.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObject"><type>GObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>first_property_name</parameter>&#160;:</term>
<listitem><simpara> name of the first property to set
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>var_args</parameter>&#160;:</term>
<listitem><simpara> value for the first property, followed optionally by more
 name/value pairs, followed by <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-get-valist" role="function">
<title>g_object_get_valist ()</title>
<indexterm zone="g-object-get-valist"><primary sortas="object_get_valist">g_object_get_valist</primary></indexterm><programlisting><link linkend="void">void</link>                g_object_get_valist                 (<link linkend="GObject">GObject</link> *object,
                                                         const <link linkend="gchar">gchar</link> *first_property_name,
                                                         <link linkend="va-list">va_list</link> var_args);</programlisting>
<para>
Gets properties of an object.
</para>
<para>
In general, a copy is made of the property contents and the caller
is responsible for freeing the memory in the appropriate manner for
the type, for instance by calling <link linkend="g-free"><function>g_free()</function></link> or <link linkend="g-object-unref"><function>g_object_unref()</function></link>.
</para>
<para>
See <link linkend="g-object-get"><function>g_object_get()</function></link>.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObject"><type>GObject</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>first_property_name</parameter>&#160;:</term>
<listitem><simpara> name of the first property to get
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>var_args</parameter>&#160;:</term>
<listitem><simpara> return location for the first property, followed optionally by more
 name/return location pairs, followed by <link linkend="NULL--CAPS"><literal>NULL</literal></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-watch-closure" role="function">
<title>g_object_watch_closure ()</title>
<indexterm zone="g-object-watch-closure"><primary sortas="object_watch_closure">g_object_watch_closure</primary></indexterm><programlisting><link linkend="void">void</link>                g_object_watch_closure              (<link linkend="GObject">GObject</link> *object,
                                                         <link linkend="GClosure">GClosure</link> *closure);</programlisting>
<para>
This function essentially limits the life time of the <parameter>closure</parameter> to
the life time of the object. That is, when the object is finalized,
the <parameter>closure</parameter> is invalidated by calling <link linkend="g-closure-invalidate"><function>g_closure_invalidate()</function></link> on
it, in order to prevent invocations of the closure with a finalized
(nonexisting) object. Also, <link linkend="g-object-ref"><function>g_object_ref()</function></link> and <link linkend="g-object-unref"><function>g_object_unref()</function></link> are
added as marshal guards to the <parameter>closure</parameter>, to ensure that an extra
reference count is held on <parameter>object</parameter> during invocation of the
<parameter>closure</parameter>.  Usually, this function will be called on closures that
use this <parameter>object</parameter> as closure data.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> GObject restricting lifetime of <parameter>closure</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>closure</parameter>&#160;:</term>
<listitem><simpara> GClosure to watch
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-object-run-dispose" role="function">
<title>g_object_run_dispose ()</title>
<indexterm zone="g-object-run-dispose"><primary sortas="object_run_dispose">g_object_run_dispose</primary></indexterm><programlisting><link linkend="void">void</link>                g_object_run_dispose                (<link linkend="GObject">GObject</link> *object);</programlisting>
<para>
Releases all references to other objects. This can be used to break
reference cycles.
</para>
<para>
This functions should only be called from object system implementations.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> a <link linkend="GObject"><type>GObject</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="G-OBJECT-WARN-INVALID-PROPERTY-ID--CAPS" role="macro">
<title>G_OBJECT_WARN_INVALID_PROPERTY_ID()</title>
<indexterm zone="G-OBJECT-WARN-INVALID-PROPERTY-ID--CAPS"><primary sortas="OBJECT_WARN_INVALID_PROPERTY_ID">G_OBJECT_WARN_INVALID_PROPERTY_ID</primary></indexterm><programlisting>#define             G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec)</programlisting>
<para>
This macro should be used to emit a standard warning about unexpected 
properties in <link linkend="set-property"><function>set_property()</function></link> and <link linkend="get-property"><function>get_property()</function></link> implementations.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GObject"><type>GObject</type></link> on which <link linkend="set-property"><function>set_property()</function></link> or <link linkend="get-property"><function>get_property()</function></link> was called
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>property_id</parameter>&#160;:</term>
<listitem><simpara> the numeric id of the property
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GParamSpec"><type>GParamSpec</type></link> of the property
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>

<refsect1 id="gobject-The-Base-Object-Type.signal-details" role="signals">
<title role="signals.title">Signal Details</title>
<refsect2 id="GObject-notify" role="signal"><title>The <literal>&quot;notify&quot;</literal> signal</title>
<indexterm zone="GObject-notify"><primary sortas="Object::notify">GObject::notify</primary></indexterm><programlisting><link linkend="void">void</link>                user_function                      (<link linkend="GObject">GObject</link>    *gobject,
                                                        <link linkend="GParamSpec">GParamSpec</link> *pspec,
                                                        <link linkend="gpointer">gpointer</link>    user_data)      : Run First / No Recursion / Has Details / Action / No Hooks</programlisting>
<para>
The notify signal is emitted on an object when one of its
properties has been changed. Note that getting this signal
doesn't guarantee that the value of the property has actually
changed, it may also be emitted when the setter for the property
is called to reinstate the previous value.
</para>
<para>
This signal is typically used to obtain change notification for a
single property, by specifying the property name as a detail in the
<link linkend="g-signal-connect"><function>g_signal_connect()</function></link> call, like this:
<informalexample><programlisting>
g_signal_connect (text_view->buffer, "notify::paste-target-list",
                  G_CALLBACK (gtk_text_view_target_list_notify),
                  text_view)
</programlisting></informalexample>
It is important to note that you must use
<link linkend="canonical-parameter-name">canonical</link> parameter names as
detail strings for the notify signal.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>gobject</parameter>&#160;:</term>
<listitem><simpara> the object which received the signal.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>pspec</parameter>&#160;:</term>
<listitem><simpara> the <link linkend="GParamSpec"><type>GParamSpec</type></link> of the property which changed.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>user_data</parameter>&#160;:</term>
<listitem><simpara>user data set when the signal handler was connected.</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>


<refsect1 id="gobject-The-Base-Object-Type.see-also">
<title>See Also</title>
#GParamSpecObject, <link linkend="g-param-spec-object"><function>g_param_spec_object()</function></link>
</refsect1>

</refentry>
