variant of class_peek() which works for static types only.

Thu Nov 27 17:53:52 2003  Tim Janik  <timj@gtk.org>

        * gtype.[hc]:
        (g_type_class_peek_static): variant of class_peek() which works for
        static types only.

        * gobject.c:
        (g_object_do_class_init): make ::notify a run-action signal.
        (g_object_newv): use g_type_class_peek_static() by default to
        speed up common code path (trades two write-locks for one read-lock).
        (g_object_disconnect):
        (g_object_connect): allow signal specification words to be
        seperated by '-'.
        (g_object_set_valist):
        (g_object_new_valist): don't leak values.
        (g_object_get_property): check property for readability.
        (g_object_set_property): check property for writability and to
        not be construct-only.
        (g_object_set_valist): check property to not be construct-only.
This commit is contained in:
Tim Janik
2003-11-27 17:08:06 +00:00
committed by Tim Janik
parent 6e3b71aec3
commit 0642df0ab3
4 changed files with 112 additions and 47 deletions

View File

@@ -2462,6 +2462,25 @@ g_type_class_peek (GType type)
return class;
}
gpointer
g_type_class_peek_static (GType type)
{
TypeNode *node;
gpointer class;
node = lookup_type_node_I (type);
G_READ_LOCK (&type_rw_lock);
if (node && node->is_classed && node->data &&
/* peek only static types: */ node->plugin == NULL &&
node->data->class.class) /* common.ref_count _may_ be 0 */
class = node->data->class.class;
else
class = NULL;
G_READ_UNLOCK (&type_rw_lock);
return class;
}
gpointer
g_type_class_peek_parent (gpointer g_class)
{