Update the floating docs wrt to GInitiallyUnowned.

2006-03-30  Matthias Clasen  <mclasen@redhat.com>

	* gobject/tmpl/objects.sgml: Update the floating docs wrt
	to GInitiallyUnowned.
This commit is contained in:
Matthias Clasen 2006-03-30 20:38:09 +00:00 committed by Matthias Clasen
parent 8763438c33
commit 9b6f47f9b4
2 changed files with 11 additions and 6 deletions

View File

@ -1,5 +1,8 @@
2006-03-30 Matthias Clasen <mclasen@redhat.com> 2006-03-30 Matthias Clasen <mclasen@redhat.com>
* gobject/tmpl/objects.sgml: Update the floating docs wrt
to GInitiallyUnowned.
* gobject/tmpl/param_value_types.sgml: * gobject/tmpl/param_value_types.sgml:
* gobject/tmpl/objects.sgml: * gobject/tmpl/objects.sgml:
* gobject/tmpl/gtype.sgml: Additions * gobject/tmpl/gtype.sgml: Additions

View File

@ -13,11 +13,12 @@ property access methods, and signal support.
Signals are described in detail in <xref linkend="gobject-Signals"/>. Signals are described in detail in <xref linkend="gobject-Signals"/>.
</para> </para>
<para id="floating-ref"> <para id="floating-ref">
The initial reference a #GObject is created with is flagged as a #GInitiallyUnowned is derived from #GObject. The only difference between
<firstterm>floating</firstterm> reference. the two is that the initial reference of a #GInitiallyUnowned is flagged
as a <firstterm>floating</firstterm> reference.
This means that it is not specifically claimed to be "owned" by This means that it is not specifically claimed to be "owned" by
any code portion. The main motivation for providing floating references is any code portion. The main motivation for providing floating references is
C convenience. In particular, it allowes code to be written as: C convenience. In particular, it allows code to be written as:
<example><programlisting> <example><programlisting>
container = create_container(); container = create_container();
container_add_child (container, create_child()); container_add_child (container, create_child());
@ -39,7 +40,7 @@ an ordinary reference by calling g_object_ref_sink().
For already sunken objects (objects that don't have a floating reference For already sunken objects (objects that don't have a floating reference
anymore), g_object_ref_sink() is equivalent to g_object_ref() and returns anymore), g_object_ref_sink() is equivalent to g_object_ref() and returns
a new reference. a new reference.
Since floating references are useful allmost exclusively for C convenience, Since floating references are useful almost exclusively for C convenience,
language bindings that provide automated reference and memory ownership language bindings that provide automated reference and memory ownership
maintenance (such as smart pointers or garbage collection) therefore don't maintenance (such as smart pointers or garbage collection) therefore don't
need to expose floating references in their API. need to expose floating references in their API.
@ -145,6 +146,7 @@ my_singleton_constructor (GType type,
needed. needed.
@notify: the class closure for the notify signal @notify: the class closure for the notify signal
<!-- ##### STRUCT GObjectConstructParam ##### --> <!-- ##### STRUCT GObjectConstructParam ##### -->
<para> <para>
The <structname>GObjectConstructParam</structname> struct is an auxiliary The <structname>GObjectConstructParam</structname> struct is an auxiliary
@ -484,8 +486,8 @@ reference.
This function is intended for #GObject implementations to re-enforce a This function is intended for #GObject implementations to re-enforce a
<link linkend="floating-ref">floating</link> object reference. <link linkend="floating-ref">floating</link> object reference.
Doing this is seldomly required, all Doing this is seldomly required, all
#GObject<!-- -->s are created with a floating reference which usually #GInitiallyUnowned<!-- -->s are created with a floating reference which
just needs to be sunken by calling g_object_ref_sink(). usually just needs to be sunken by calling g_object_ref_sink().
</para> </para>
@object: a #GObject @object: a #GObject