Docs: use quotes instead of firstterm
[platform/upstream/glib.git] / gobject / gobject.c
index 543fc7d..d700266 100644 (file)
@@ -12,9 +12,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
+ * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
  * <para id="floating-ref">
  * GInitiallyUnowned is derived from GObject. The only difference between
  * 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
- * any code portion. The main motivation for providing floating references is
- * C convenience. In particular, it allows code to be written as:
- * |[
+ * as a "floating" 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:
+ * |[<!-- language="C" --> 
  * container = create_container ();
  * container_add_child (container, create_child());
  * ]|
- * If <function>container_add_child()</function> will g_object_ref_sink() the
- * passed in child, no reference of the newly created child is leaked.
- * Without floating references, <function>container_add_child()</function>
- * can only g_object_ref() the new child, so to implement this code without
- * reference leaks, it would have to be written as:
- * |[
+ * If container_add_child() calls g_object_ref_sink() on the passed-in child,
+ * no reference of the newly created child is leaked. Without floating
+ * references, container_add_child() can only g_object_ref() the new child,
+ * so to implement this code without reference leaks, it would have to be
+ * written as:
+ * |[<!-- language="C" --> 
  * Child *child;
  * container = create_container ();
  * child = create_child ();
  * container_add_child (container, child);
  * g_object_unref (child);
  * ]|
- * The floating reference can be converted into
- * an ordinary reference by calling g_object_ref_sink().
- * 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
- * a new reference.
+ * The floating reference can be converted into an ordinary reference by
+ * calling g_object_ref_sink(). 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 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) should not
@@ -86,7 +84,7 @@
  * across certain code portions (an example is #GtkMenu), to achieve this,
  * the following sequence can be used:
  *
- * |[
+ * |[<!-- language="C" --> 
  * /&ast; save floating state &ast;/
  * gboolean was_floating = g_object_is_floating (object);
  * g_object_ref_sink (object);
@@ -176,7 +174,7 @@ static void g_object_dispatch_properties_changed    (GObject        *object,
 static guint               object_floating_flag_handler (GObject        *object,
                                                          gint            job);
 
-static void object_interface_check_properties           (gpointer        func_data,
+static void object_interface_check_properties           (gpointer        check_data,
                                                         gpointer        g_iface);
 
 /* --- typedefs --- */
@@ -197,11 +195,10 @@ static GQuark                 quark_closure_array = 0;
 static GQuark              quark_weak_refs = 0;
 static GQuark              quark_toggle_refs = 0;
 static GQuark               quark_notify_queue;
+static GQuark               quark_in_construction;
 static GParamSpecPool      *pspec_pool = NULL;
 static gulong              gobject_signals[LAST_SIGNAL] = { 0, };
 static guint (*floating_flag_handler) (GObject*, gint) = object_floating_flag_handler;
-G_LOCK_DEFINE_STATIC (construction_mutex);
-static GSList *construction_objects = NULL;
 /* qdata pointing to GSList<GWeakRef *>, protected by weak_locations_lock */
 static GQuark              quark_weak_locations = 0;
 static GRWLock              weak_locations_lock;
@@ -314,7 +311,6 @@ g_object_notify_queue_add (GObject            *object,
 #ifdef G_ENABLE_DEBUG
 #define        IF_DEBUG(debug_type)    if (_g_type_debug_flags & G_TYPE_DEBUG_ ## debug_type)
 G_LOCK_DEFINE_STATIC     (debug_objects);
-static volatile GObject *g_trap_object_ref = NULL;
 static guint            debug_objects_count = 0;
 static GHashTable      *debug_objects_ht = NULL;
 
@@ -451,6 +447,7 @@ g_object_do_class_init (GObjectClass *class)
   quark_weak_locations = g_quark_from_static_string ("GObject-weak-locations");
   quark_toggle_refs = g_quark_from_static_string ("GObject-toggle-references");
   quark_notify_queue = g_quark_from_static_string ("GObject-notify-queue");
+  quark_in_construction = g_quark_from_static_string ("GObject-in-construction");
   pspec_pool = g_param_spec_pool_new (TRUE);
 
   class->constructor = g_object_constructor;
@@ -476,7 +473,7 @@ g_object_do_class_init (GObjectClass *class)
    * This signal is typically used to obtain change notification for a
    * single property, by specifying the property name as a detail in the
    * g_signal_connect() call, like this:
-   * |[
+   * |[<!-- language="C" --> 
    * g_signal_connect (text_view->buffer, "notify::paste-target-list",
    *                   G_CALLBACK (gtk_text_view_target_list_notify),
    *                   text_view)
@@ -508,7 +505,7 @@ install_property_internal (GType       g_type,
 {
   if (g_param_spec_pool_lookup (pspec_pool, pspec->name, g_type, FALSE))
     {
-      g_warning ("When installing property: type `%s' already has a property named `%s'",
+      g_warning ("When installing property: type '%s' already has a property named '%s'",
                 g_type_name (g_type),
                 pspec->name);
       return;
@@ -540,8 +537,10 @@ g_object_class_install_property (GObjectClass *class,
   g_return_if_fail (G_IS_PARAM_SPEC (pspec));
 
   if (CLASS_HAS_DERIVED_CLASS (class))
-    g_error ("Attempt to add property %s::%s to class after it was derived",
-            G_OBJECT_CLASS_NAME (class), pspec->name);
+    g_error ("Attempt to add property %s::%s to class after it was derived", G_OBJECT_CLASS_NAME (class), pspec->name);
+
+  if (!g_type_is_in_init (G_OBJECT_CLASS_TYPE (class)))
+    g_warning ("Attempt to add property %s::%s after class was initialised", G_OBJECT_CLASS_NAME (class), pspec->name);
 
   class->flags |= CLASS_HAS_PROPS_FLAG;
 
@@ -573,11 +572,11 @@ g_object_class_install_property (GObjectClass *class,
 /**
  * g_object_class_install_properties:
  * @oclass: a #GObjectClass
- * @n_pspecs: the length of the #GParamSpec<!-- -->s array
- * @pspecs: (array length=n_pspecs): the #GParamSpec<!-- -->s array
+ * @n_pspecs: the length of the #GParamSpecs array
+ * @pspecs: (array length=n_pspecs): the #GParamSpecs array
  *   defining the new properties
  *
- * Installs new properties from an array of #GParamSpec<!-- -->s. This is
+ * Installs new properties from an array of #GParamSpecs. This is
  * usually done in the class initializer.
  *
  * The property id of each property is the index of each #GParamSpec in
@@ -587,10 +586,10 @@ g_object_class_install_property (GObjectClass *class,
  * be used to store a #GParamSpec.
  *
  * This function should be used if you plan to use a static array of
- * #GParamSpec<!-- -->s and g_object_notify_by_pspec(). For instance, this
+ * #GParamSpecs and g_object_notify_by_pspec(). For instance, this
  * class initialization:
  *
- * |[
+ * |[<!-- language="C" --> 
  * enum {
  *   PROP_0, PROP_FOO, PROP_BAR, N_PROPERTIES
  * };
@@ -623,7 +622,7 @@ g_object_class_install_property (GObjectClass *class,
  *
  * allows calling g_object_notify_by_pspec() to notify of property changes:
  *
- * |[
+ * |[<!-- language="C" --> 
  * void
  * my_object_set_foo (MyObject *self, gint foo)
  * {
@@ -653,6 +652,9 @@ g_object_class_install_properties (GObjectClass  *oclass,
     g_error ("Attempt to add properties to %s after it was derived",
              G_OBJECT_CLASS_NAME (oclass));
 
+  if (!g_type_is_in_init (G_OBJECT_CLASS_TYPE (oclass)))
+    g_warning ("Attempt to add properties to %s after it was initialised", G_OBJECT_CLASS_NAME (oclass));
+
   oclass_type = G_OBJECT_CLASS_TYPE (oclass);
   parent_type = g_type_parent (oclass_type);
 
@@ -807,13 +809,12 @@ g_object_interface_find_property (gpointer      g_iface,
  * @name: the name of a property registered in a parent class or
  *  in an interface of this class.
  *
- * Registers @property_id as referring to a property with the
- * name @name in a parent class or in an interface implemented
- * by @oclass. 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.
+ * Registers @property_id as referring to a property with the name
+ * @name in a parent class or in an interface implemented by @oclass.
+ * This allows this class to "override" a property implementation in
+ * a parent class or to provide the implementation of a property from
+ * an interface.
  *
- * <note>
  * Internally, overriding is implemented by creating a property of type
  * #GParamSpecOverride; generally operations that query the properties of
  * the object class, such as g_object_class_find_property() or
@@ -824,7 +825,6 @@ g_object_interface_find_property (gpointer      g_iface,
  * correct.  For virtually all uses, this makes no difference. If you
  * need to get the overridden property, you can call
  * g_param_spec_get_redirect_target().
- * </note>
  *
  * Since: 2.4
  */
@@ -945,6 +945,12 @@ g_object_interface_list_properties (gpointer      g_iface,
   return pspecs;
 }
 
+static inline gboolean
+object_in_construction (GObject *object)
+{
+  return g_datalist_id_get_data (&object->qdata, quark_in_construction) != NULL;
+}
+
 static void
 g_object_init (GObject         *object,
               GObjectClass     *class)
@@ -960,10 +966,8 @@ g_object_init (GObject             *object,
 
   if (CLASS_HAS_CUSTOM_CONSTRUCTOR (class))
     {
-      /* enter construction list for notify_queue_thaw() and to allow construct-only properties */
-      G_LOCK (construction_mutex);
-      construction_objects = g_slist_prepend (construction_objects, object);
-      G_UNLOCK (construction_mutex);
+      /* mark object in-construction for notify_queue_thaw() and to allow construct-only properties */
+      g_datalist_id_set_data (&object->qdata, quark_in_construction, object);
     }
 
 #ifdef G_ENABLE_DEBUG
@@ -1016,6 +1020,12 @@ g_object_real_dispose (GObject *object)
 static void
 g_object_finalize (GObject *object)
 {
+  if (object_in_construction (object))
+    {
+      g_error ("object %s %p finalized while still in-construction",
+               G_OBJECT_TYPE_NAME (object), object);
+    }
+
   g_datalist_clear (&object->qdata);
   
 #ifdef G_ENABLE_DEBUG
@@ -1147,6 +1157,11 @@ g_object_notify_by_spec_internal (GObject    *object,
  * When possible, eg. when signaling a property change from within the class
  * that registered the property, you should use g_object_notify_by_pspec()
  * instead.
+ *
+ * Note that emission of the notify signal may be blocked with
+ * g_object_freeze_notify(). In this case, the signal emissions are queued
+ * and will be emitted (in reverse order) when g_object_thaw_notify() is
+ * called.
  */
 void
 g_object_notify (GObject     *object,
@@ -1170,7 +1185,7 @@ g_object_notify (GObject     *object,
                                    TRUE);
 
   if (!pspec)
-    g_warning ("%s: object class `%s' has no property named `%s'",
+    g_warning ("%s: object class '%s' has no property named '%s'",
               G_STRFUNC,
               G_OBJECT_TYPE_NAME (object),
               property_name);
@@ -1194,7 +1209,7 @@ g_object_notify (GObject     *object,
  * instead, is to store the GParamSpec used with
  * g_object_class_install_property() inside a static array, e.g.:
  *
- *|[
+ *|[<!-- language="C" --> 
  *   enum
  *   {
  *     PROP_0,
@@ -1219,7 +1234,7 @@ g_object_notify (GObject     *object,
  *
  * and then notify a change on the "foo" property with:
  *
- * |[
+ * |[<!-- language="C" --> 
  *   g_object_notify_by_pspec (self, properties[PROP_FOO]);
  * ]|
  *
@@ -1233,6 +1248,9 @@ g_object_notify_by_pspec (GObject    *object,
   g_return_if_fail (G_IS_OBJECT (object));
   g_return_if_fail (G_IS_PARAM_SPEC (pspec));
 
+  if (g_atomic_int_get (&object->ref_count) == 0)
+    return;
+
   g_object_ref (object);
   g_object_notify_by_spec_internal (object, pspec);
   g_object_unref (object);
@@ -1247,7 +1265,8 @@ g_object_notify_by_pspec (GObject    *object,
  * and when it reaches zero, queued "notify" signals are emitted.
  *
  * Duplicate notifications for each property are squashed so that at most one
- * #GObject::notify signal is emitted for each property.
+ * #GObject::notify signal is emitted for each property, in the reverse order
+ * in which they have been queued.
  *
  * It is an error to call this function when the freeze count is zero.
  */
@@ -1336,7 +1355,7 @@ object_set_property (GObject             *object,
   /* provide a copy to work from, convert (if necessary) and validate */
   g_value_init (&tmp_value, pspec->value_type);
   if (!g_value_transform (value, &tmp_value))
-    g_warning ("unable to set property `%s' of type `%s' from value of type `%s'",
+    g_warning ("unable to set property '%s' of type '%s' from value of type '%s'",
               pspec->name,
               g_type_name (pspec->value_type),
               G_VALUE_TYPE_NAME (value));
@@ -1344,7 +1363,7 @@ object_set_property (GObject             *object,
     {
       gchar *contents = g_strdup_value_contents (value);
 
-      g_warning ("value \"%s\" of type `%s' is invalid or out of range for property `%s' of type `%s'",
+      g_warning ("value \"%s\" of type '%s' is invalid or out of range for property '%s' of type '%s'",
                 contents,
                 G_VALUE_TYPE_NAME (value),
                 pspec->name,
@@ -1366,7 +1385,7 @@ object_set_property (GObject             *object,
 }
 
 static void
-object_interface_check_properties (gpointer func_data,
+object_interface_check_properties (gpointer check_data,
                                   gpointer g_iface)
 {
   GTypeInterface *iface_class = g_iface;
@@ -1554,38 +1573,6 @@ g_object_new (GType         object_type,
   return object;
 }
 
-static gboolean
-slist_maybe_remove (GSList       **slist,
-                    gconstpointer  data)
-{
-  GSList *last = NULL, *node = *slist;
-  while (node)
-    {
-      if (node->data == data)
-        {
-          if (last)
-            last->next = node->next;
-          else
-            *slist = node->next;
-          g_slist_free_1 (node);
-          return TRUE;
-        }
-      last = node;
-      node = last->next;
-    }
-  return FALSE;
-}
-
-static inline gboolean
-object_in_construction_list (GObject *object)
-{
-  gboolean in_construction;
-  G_LOCK (construction_mutex);
-  in_construction = g_slist_find (construction_objects, object) != NULL;
-  G_UNLOCK (construction_mutex);
-  return in_construction;
-}
-
 static gpointer
 g_object_new_with_custom_constructor (GObjectClass          *class,
                                       GObjectConstructParam *params,
@@ -1661,14 +1648,24 @@ g_object_new_with_custom_constructor (GObjectClass          *class,
     g_value_unset (&cvalues[cvals_used]);
   g_free (cvalues);
 
-  /* g_object_init() will have added us to the construction_objects
-   * list.  Check if we're in it (and remove us) in order to find
-   * out if we were newly-constructed or this is an already-existing
-   * singleton (in which case we should not do 'constructed').
+  /* There is code in the wild that relies on being able to return NULL
+   * from its custom constructor.  This was never a supported operation,
+   * but since the code is already out there...
    */
-  G_LOCK (construction_mutex);
-  newly_constructed = slist_maybe_remove (&construction_objects, object);
-  G_UNLOCK (construction_mutex);
+  if (object == NULL)
+    {
+      g_critical ("Custom constructor for class %s returned NULL (which is invalid). "
+                  "Please use GInitable instead.", G_OBJECT_CLASS_NAME (class));
+      return NULL;
+    }
+
+  /* g_object_init() will have marked the object as being in-construction.
+   * Check if the returned object still is so marked, or if this is an
+   * already-existing singleton (in which case we should not do 'constructed').
+   */
+  newly_constructed = object_in_construction (object);
+  if (newly_constructed)
+    g_datalist_id_set_data (&object->qdata, quark_in_construction, NULL);
 
   if (CLASS_HAS_PROPS (class))
     {
@@ -1833,14 +1830,14 @@ g_object_newv (GType       object_type,
 
           if G_UNLIKELY (!pspec)
             {
-              g_critical ("%s: object class `%s' has no property named `%s'",
+              g_critical ("%s: object class '%s' has no property named '%s'",
                           G_STRFUNC, g_type_name (object_type), parameters[i].name);
               continue;
             }
 
           if G_UNLIKELY (~pspec->flags & G_PARAM_WRITABLE)
             {
-              g_critical ("%s: property `%s' of object class `%s' is not writable",
+              g_critical ("%s: property '%s' of object class '%s' is not writable",
                           G_STRFUNC, pspec->name, g_type_name (object_type));
               continue;
             }
@@ -1852,7 +1849,7 @@ g_object_newv (GType       object_type,
                     break;
               if G_UNLIKELY (k != j)
                 {
-                  g_critical ("%s: construct property `%s' for type `%s' cannot be set twice",
+                  g_critical ("%s: construct property '%s' for type '%s' cannot be set twice",
                               G_STRFUNC, parameters[i].name, g_type_name (object_type));
                   continue;
                 }
@@ -1927,7 +1924,7 @@ g_object_new_valist (GType        object_type,
 
           if G_UNLIKELY (!pspec)
             {
-              g_critical ("%s: object class `%s' has no property named `%s'",
+              g_critical ("%s: object class '%s' has no property named '%s'",
                           G_STRFUNC, g_type_name (object_type), name);
               /* Can't continue because arg list will be out of sync. */
               break;
@@ -1935,7 +1932,7 @@ g_object_new_valist (GType        object_type,
 
           if G_UNLIKELY (~pspec->flags & G_PARAM_WRITABLE)
             {
-              g_critical ("%s: property `%s' of object class `%s' is not writable",
+              g_critical ("%s: property '%s' of object class '%s' is not writable",
                           G_STRFUNC, pspec->name, g_type_name (object_type));
               break;
             }
@@ -1947,7 +1944,7 @@ g_object_new_valist (GType        object_type,
                     break;
               if G_UNLIKELY (i != n_params)
                 {
-                  g_critical ("%s: property `%s' for type `%s' cannot be set twice",
+                  g_critical ("%s: property '%s' for type '%s' cannot be set twice",
                               G_STRFUNC, name, g_type_name (object_type));
                   break;
                 }
@@ -2072,7 +2069,7 @@ g_object_set_valist (GObject       *object,
                                        TRUE);
       if (!pspec)
        {
-         g_warning ("%s: object class `%s' has no property named `%s'",
+         g_warning ("%s: object class '%s' has no property named '%s'",
                     G_STRFUNC,
                     G_OBJECT_TYPE_NAME (object),
                     name);
@@ -2080,15 +2077,15 @@ g_object_set_valist (GObject     *object,
        }
       if (!(pspec->flags & G_PARAM_WRITABLE))
        {
-         g_warning ("%s: property `%s' of object class `%s' is not writable",
+         g_warning ("%s: property '%s' of object class '%s' is not writable",
                     G_STRFUNC,
                     pspec->name,
                     G_OBJECT_TYPE_NAME (object));
          break;
        }
-      if ((pspec->flags & G_PARAM_CONSTRUCT_ONLY) && !object_in_construction_list (object))
+      if ((pspec->flags & G_PARAM_CONSTRUCT_ONLY) && !object_in_construction (object))
         {
-          g_warning ("%s: construct property \"%s\" for object `%s' can't be set after construction",
+          g_warning ("%s: construct property \"%s\" for object '%s' can't be set after construction",
                      G_STRFUNC, pspec->name, G_OBJECT_TYPE_NAME (object));
           break;
         }
@@ -2153,7 +2150,7 @@ g_object_get_valist (GObject       *object,
                                        TRUE);
       if (!pspec)
        {
-         g_warning ("%s: object class `%s' has no property named `%s'",
+         g_warning ("%s: object class '%s' has no property named '%s'",
                     G_STRFUNC,
                     G_OBJECT_TYPE_NAME (object),
                     name);
@@ -2161,7 +2158,7 @@ g_object_get_valist (GObject       *object,
        }
       if (!(pspec->flags & G_PARAM_READABLE))
        {
-         g_warning ("%s: property `%s' of object class `%s' is not readable",
+         g_warning ("%s: property '%s' of object class '%s' is not readable",
                     G_STRFUNC,
                     pspec->name,
                     G_OBJECT_TYPE_NAME (object));
@@ -2197,6 +2194,10 @@ g_object_get_valist (GObject      *object,
  *  name/value pairs, followed by %NULL
  *
  * Sets properties on an object.
+ *
+ * Note that the "notify" signals are queued and only emitted (in
+ * reverse order) after all properties have been set. See
+ * g_object_freeze_notify().
  */
 void
 g_object_set (gpointer     _object,
@@ -2226,12 +2227,9 @@ g_object_set (gpointer     _object,
  * is responsible for freeing the memory in the appropriate manner for
  * the type, for instance by calling g_free() or g_object_unref().
  *
- * <example>
- * <title>Using g_object_get(<!-- -->)</title>
- * An example of using g_object_get() to get the contents
- * of three properties - one of type #G_TYPE_INT,
- * one of type #G_TYPE_STRING, and one of type #G_TYPE_OBJECT:
- * <programlisting>
+ * Here is an example of using g_object_get() to get the contents
+ * of three properties: an integer, a string and an object:
+ * |[<!-- language="C" --> 
  *  gint intval;
  *  gchar *strval;
  *  GObject *objval;
@@ -2242,12 +2240,11 @@ g_object_set (gpointer     _object,
  *                "obj-property", &objval,
  *                NULL);
  *
- *  // Do something with intval, strval, objval
+ *  /&ast; Do something with intval, strval, objval &ast;/
  *
  *  g_free (strval);
  *  g_object_unref (objval);
- * </programlisting>
- * </example>
+ *  ]|
  */
 void
 g_object_get (gpointer     _object,
@@ -2292,17 +2289,17 @@ g_object_set_property (GObject      *object,
                                    G_OBJECT_TYPE (object),
                                    TRUE);
   if (!pspec)
-    g_warning ("%s: object class `%s' has no property named `%s'",
+    g_warning ("%s: object class '%s' has no property named '%s'",
               G_STRFUNC,
               G_OBJECT_TYPE_NAME (object),
               property_name);
   else if (!(pspec->flags & G_PARAM_WRITABLE))
-    g_warning ("%s: property `%s' of object class `%s' is not writable",
+    g_warning ("%s: property '%s' of object class '%s' is not writable",
                G_STRFUNC,
                pspec->name,
                G_OBJECT_TYPE_NAME (object));
-  else if ((pspec->flags & G_PARAM_CONSTRUCT_ONLY) && !object_in_construction_list (object))
-    g_warning ("%s: construct property \"%s\" for object `%s' can't be set after construction",
+  else if ((pspec->flags & G_PARAM_CONSTRUCT_ONLY) && !object_in_construction (object))
+    g_warning ("%s: construct property \"%s\" for object '%s' can't be set after construction",
                G_STRFUNC, pspec->name, G_OBJECT_TYPE_NAME (object));
   else
     object_set_property (object, pspec, value, nqueue);
@@ -2345,12 +2342,12 @@ g_object_get_property (GObject     *object,
                                    G_OBJECT_TYPE (object),
                                    TRUE);
   if (!pspec)
-    g_warning ("%s: object class `%s' has no property named `%s'",
+    g_warning ("%s: object class '%s' has no property named '%s'",
               G_STRFUNC,
               G_OBJECT_TYPE_NAME (object),
               property_name);
   else if (!(pspec->flags & G_PARAM_READABLE))
-    g_warning ("%s: property `%s' of object class `%s' is not readable",
+    g_warning ("%s: property '%s' of object class '%s' is not readable",
                G_STRFUNC,
                pspec->name,
                G_OBJECT_TYPE_NAME (object));
@@ -2367,7 +2364,7 @@ g_object_get_property (GObject       *object,
        }
       else if (!g_value_type_transformable (pspec->value_type, G_VALUE_TYPE (value)))
        {
-         g_warning ("%s: can't retrieve property `%s' of type `%s' as value of type `%s'",
+         g_warning ("%s: can't retrieve property '%s' of type '%s' as value of type '%s'",
                     G_STRFUNC, pspec->name,
                     g_type_name (pspec->value_type),
                     G_VALUE_TYPE_NAME (value));
@@ -2402,72 +2399,23 @@ g_object_get_property (GObject     *object,
  *
  * 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>
- *
- * |[
+ * * - signal: equivalent to g_signal_connect_data (..., NULL, 0)
+ * - object-signal, object_signal: equivalent to g_signal_connect_object (..., 0)
+ * - swapped-signal, swapped_signal: equivalent to g_signal_connect_data (..., NULL, G_CONNECT_SWAPPED)
+ * - swapped_object_signal, swapped-object-signal: equivalent to g_signal_connect_object (..., G_CONNECT_SWAPPED)
+ * - signal_after, signal-after: equivalent to g_signal_connect_data (..., NULL, G_CONNECT_AFTER)
+ * - object_signal_after, object-signal-after: equivalent to g_signal_connect_object (..., G_CONNECT_AFTER)
+ * - swapped_signal_after, swapped-signal-after: equivalent to g_signal_connect_data (..., NULL, G_CONNECT_SWAPPED | G_CONNECT_AFTER)
+ * - swapped_object_signal_after, swapped-object-signal-after: equivalent to g_signal_connect_object (..., G_CONNECT_SWAPPED | G_CONNECT_AFTER)
+ *
+ * |[<!-- language="C" --> 
  *   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,
+ *                                  "signal::destroy", gtk_widget_destroyed, &menu->toplevel,
  *                                  NULL);
  * ]|
  *
@@ -2845,7 +2793,7 @@ g_object_ref_sink (gpointer _object)
  * This function is intended for #GObject implementations to re-enforce a
  * <link linkend="floating-ref">floating</link> object reference.
  * Doing this is seldom required: all
- * #GInitiallyUnowned<!-- -->s are created with a floating reference which
+ * #GInitiallyUnowneds are created with a floating reference which
  * usually just needs to be sunken by calling g_object_ref_sink().
  *
  * Since: 2.10
@@ -2910,8 +2858,8 @@ toggle_refs_notify (GObject *object,
  * to the proxy object, but when there are other references held to
  * @object, a strong reference is held. The @notify callback is called
  * when the reference from @object to the proxy object should be
- * <firstterm>toggled</firstterm> from strong to weak (@is_last_ref
- * true) or weak to strong (@is_last_ref false).
+ * "toggled" from strong to weak (@is_last_ref true) or weak to strong
+ * (@is_last_ref false).
  *
  * Since a (normal) reference must be held to the object before
  * calling g_object_add_toggle_ref(), the initial state of the reverse
@@ -3037,12 +2985,6 @@ g_object_ref (gpointer _object)
   g_return_val_if_fail (G_IS_OBJECT (object), NULL);
   g_return_val_if_fail (object->ref_count > 0, NULL);
   
-#ifdef  G_ENABLE_DEBUG
-  if (g_trap_object_ref == object)
-    G_BREAKPOINT ();
-#endif  /* G_ENABLE_DEBUG */
-
-
   old_val = g_atomic_int_add (&object->ref_count, 1);
 
   if (old_val == 1 && OBJECT_HAS_TOGGLE_REF (object))
@@ -3069,11 +3011,6 @@ g_object_unref (gpointer _object)
   g_return_if_fail (G_IS_OBJECT (object));
   g_return_if_fail (object->ref_count > 0);
   
-#ifdef  G_ENABLE_DEBUG
-  if (g_trap_object_ref == object)
-    G_BREAKPOINT ();
-#endif  /* G_ENABLE_DEBUG */
-
   /* here we want to atomically do: if (ref_count>1) { ref_count--; return; } */
  retry_atomic_decrement1:
   old_ref = g_atomic_int_get (&object->ref_count);
@@ -3323,7 +3260,7 @@ g_object_dup_qdata (GObject        *object,
  *
  * If the previous value was replaced then ownership of the
  * old value (@oldval) is passed to the caller, including
- * the registred destroy notify for it (passed out in @old_destroy).
+ * the registered destroy notify for it (passed out in @old_destroy).
  * Its up to the caller to free this as he wishes, which may
  * or may not include using @old_destroy as sometimes replacement
  * should not destroy the object in the normal way.
@@ -3387,7 +3324,7 @@ g_object_set_qdata_full (GObject       *object,
  * set).
  * Usually, calling this function is only required to update
  * user data pointers with a destroy notifier, for example:
- * |[
+ * |[<!-- language="C" --> 
  * void
  * object_add_to_user_list (GObject     *object,
  *                          const gchar *new_string)
@@ -3532,7 +3469,7 @@ g_object_dup_data (GObject        *object,
  *
  * If the previous value was replaced then ownership of the
  * old value (@oldval) is passed to the caller, including
- * the registred destroy notify for it (passed out in @old_destroy).
+ * the registered destroy notify for it (passed out in @old_destroy).
  * Its up to the caller to free this as he wishes, which may
  * or may not include using @old_destroy as sometimes replacement
  * should not destroy the object in the normal way.
@@ -3659,14 +3596,14 @@ g_value_object_collect_value (GValue      *value,
       GObject *object = collect_values[0].v_pointer;
       
       if (object->g_type_instance.g_class == NULL)
-       return g_strconcat ("invalid unclassed object pointer for value type `",
+       return g_strconcat ("invalid unclassed object pointer for value type '",
                            G_VALUE_TYPE_NAME (value),
                            "'",
                            NULL);
       else if (!g_value_type_compatible (G_OBJECT_TYPE (object), G_VALUE_TYPE (value)))
-       return g_strconcat ("invalid object type `",
+       return g_strconcat ("invalid object type '",
                            G_OBJECT_TYPE_NAME (object),
-                           "' for value type `",
+                           "' for value type '",
                            G_VALUE_TYPE_NAME (value),
                            "'",
                            NULL);
@@ -3688,7 +3625,7 @@ g_value_object_lcopy_value (const GValue *value,
   GObject **object_p = collect_values[0].v_pointer;
   
   if (!object_p)
-    return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
+    return g_strdup_printf ("value location for '%s' passed as NULL", G_VALUE_TYPE_NAME (value));
 
   if (!value->data[0].v_pointer)
     *object_p = NULL;
@@ -4130,9 +4067,9 @@ g_initially_unowned_class_init (GInitiallyUnownedClass *klass)
  * objects.
  *
  * If the object's #GObjectClass.dispose method results in additional
- * references to the object being held, any #GWeakRef<!-- -->s taken
+ * references to the object being held, any #GWeakRefs taken
  * before it was disposed will continue to point to %NULL.  If
- * #GWeakRef<!-- -->s are taken after the object is disposed and
+ * #GWeakRefs are taken after the object is disposed and
  * re-referenced, they will continue to point to it until its refcount
  * goes back to zero, at which point they too will be invalidated.
  */