Commit 3b346e35 authored by Tim Janik's avatar Tim Janik Committed by Tim Janik

remove left-over usages of an anonymous GBoxed typedef.

Mon Jun 11 17:07:06 2001  Tim Janik  <timj@gtk.org>

        * gboxed.[hc]: remove left-over usages of an anonymous GBoxed typedef.

        * gobjectnotifyqueue.c: moved property notify queue implementation
        bits into this function.

        * gparam.[hc]: added g_param_spec_pool_belongings(), completed
        g_param_spec_pool_list(). added GParameter for _setv() functions.

        * gobject.[hc]: use gobjectnotifyqueue.h implementation now.
        got rid of properties_changed signal.
        new functions g_object_newv(), g_object_class_list_properties().
        removed "properties_changed" signal.

        * gtype.[hc]: added g_type_depth() to figure number of parent
        types + 1 for a type.

        * gsignal.h: add g_signal_connect() (as per owen's request) and
        g_signal_connect_swapped().
parent efc2ec72
...@@ -71,6 +71,7 @@ arrays or arrays on the stack. ...@@ -71,6 +71,7 @@ arrays or arrays on the stack.
Portable way to copy <type>va_list</type> variables. Portable way to copy <type>va_list</type> variables.
</para> </para>
<!-- # Unused Parameters # -->
@ap1: the <type>va_list</type> variable to place a copy of @ap2 in. @ap1: the <type>va_list</type> variable to place a copy of @ap2 in.
@ap2: a <type>va_list</type>. @ap2: a <type>va_list</type>.
......
...@@ -14,12 +14,6 @@ gboxed ...@@ -14,12 +14,6 @@ gboxed
</para> </para>
<!-- ##### STRUCT GBoxed ##### -->
<para>
</para>
<!-- ##### USER_FUNCTION GBoxedCopyFunc ##### --> <!-- ##### USER_FUNCTION GBoxedCopyFunc ##### -->
<para> <para>
......
<!-- ##### STRUCT GBoxed ##### -->
<para>
</para>
<!-- ##### FUNCTION g_closure_add_fnotify ##### --> <!-- ##### FUNCTION g_closure_add_fnotify ##### -->
<para> <para>
......
...@@ -25,6 +25,7 @@ Parameter Specifications ...@@ -25,6 +25,7 @@ Parameter Specifications
@blurb: @blurb:
@flags: @flags:
@value_type: @value_type:
@owner_type:
<!-- ##### STRUCT GParamSpecClass ##### --> <!-- ##### STRUCT GParamSpecClass ##### -->
<para> <para>
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
G_BEGIN_DECLS G_BEGIN_DECLS
/* helper macro to avoid signed overflow for value comparisions */ /* helper macro to avoid signed overflow for value comparisions */
#define G_BSEARCH_ARRAY_CMP(v1,v2) ((v1) < (v2) ? -1 : (v1) > (v2) ? 1 : 0) #define G_BSEARCH_ARRAY_CMP(v1,v2) ((v1) < (v2) ? -1 : (v1) > (v2))
/* --- typedefs --- */ /* --- typedefs --- */
......
Mon Jun 11 17:07:06 2001 Tim Janik <timj@gtk.org>
* gboxed.[hc]: remove left-over usages of an anonymous GBoxed typedef.
* gobjectnotifyqueue.c: moved property notify queue implementation
bits into this function.
* gparam.[hc]: added g_param_spec_pool_belongings(), completed
g_param_spec_pool_list(). added GParameter for _setv() functions.
* gobject.[hc]: use gobjectnotifyqueue.h implementation now.
got rid of properties_changed signal.
new functions g_object_newv(), g_object_class_list_properties().
removed "properties_changed" signal.
* gtype.[hc]: added g_type_depth() to figure number of parent
types + 1 for a type.
* gsignal.h: add g_signal_connect() (as per owen's request) and
g_signal_connect_swapped().
2001-06-13 Havoc Pennington <hp@redhat.com> 2001-06-13 Havoc Pennington <hp@redhat.com>
* Makefile.am (progs_LDADD): link to ./libgobject-1.3.la * Makefile.am (progs_LDADD): link to ./libgobject-1.3.la
......
...@@ -52,9 +52,11 @@ gruntime_public_h_sources = @STRIP_BEGIN@ \ ...@@ -52,9 +52,11 @@ gruntime_public_h_sources = @STRIP_BEGIN@ \
gvaluearray.h \ gvaluearray.h \
gvaluecollector.h \ gvaluecollector.h \
gvaluetypes.h \ gvaluetypes.h \
gobjectnotifyqueue.c \
@STRIP_END@ @STRIP_END@
# GRuntime header files that don't get installed # GRuntime header files that don't get installed
gruntime_private_h_sources = gruntime_private_h_sources = @STRIP_BEGIN@ \
@STRIP_END@
# GRuntime C sources to build the library from # GRuntime C sources to build the library from
gruntime_c_sources = @STRIP_BEGIN@ \ gruntime_c_sources = @STRIP_BEGIN@ \
gboxed.c \ gboxed.c \
......
...@@ -333,7 +333,7 @@ g_boxed_type_register_static (const gchar *name, ...@@ -333,7 +333,7 @@ g_boxed_type_register_static (const gchar *name,
return type; return type;
} }
GBoxed* gpointer
g_boxed_copy (GType boxed_type, g_boxed_copy (GType boxed_type,
gconstpointer src_boxed) gconstpointer src_boxed)
{ {
......
...@@ -29,14 +29,13 @@ G_BEGIN_DECLS ...@@ -29,14 +29,13 @@ G_BEGIN_DECLS
/* --- typedefs --- */ /* --- typedefs --- */
typedef struct _GBoxed GBoxed;
typedef gpointer (*GBoxedInitFunc) (void); typedef gpointer (*GBoxedInitFunc) (void);
typedef gpointer (*GBoxedCopyFunc) (gpointer boxed); typedef gpointer (*GBoxedCopyFunc) (gpointer boxed);
typedef void (*GBoxedFreeFunc) (gpointer boxed); typedef void (*GBoxedFreeFunc) (gpointer boxed);
/* --- prototypes --- */ /* --- prototypes --- */
GBoxed* g_boxed_copy (GType boxed_type, gpointer g_boxed_copy (GType boxed_type,
gconstpointer src_boxed); gconstpointer src_boxed);
void g_boxed_free (GType boxed_type, void g_boxed_free (GType boxed_type,
gpointer boxed); gpointer boxed);
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
G_BEGIN_DECLS G_BEGIN_DECLS
/* helper macro to avoid signed overflow for value comparisions */ /* helper macro to avoid signed overflow for value comparisions */
#define G_BSEARCH_ARRAY_CMP(v1,v2) ((v1) < (v2) ? -1 : (v1) > (v2) ? 1 : 0) #define G_BSEARCH_ARRAY_CMP(v1,v2) ((v1) < (v2) ? -1 : (v1) > (v2))
/* --- typedefs --- */ /* --- typedefs --- */
......
...@@ -16,18 +16,17 @@ ...@@ -16,18 +16,17 @@
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA. * Boston, MA 02111-1307, USA.
*/ */
#include "gobject.h"
/* /*
* MT safe * MT safe
*/ */
#include "gobject.h"
#include "gvaluecollector.h" #include "gvaluecollector.h"
#include "gsignal.h" #include "gsignal.h"
#include "gparamspecs.h" #include "gparamspecs.h"
#include "gvaluetypes.h" #include "gvaluetypes.h"
#include "gobjectnotifyqueue.c"
#include <string.h> #include <string.h>
...@@ -35,7 +34,8 @@ ...@@ -35,7 +34,8 @@
/* --- macros --- */ /* --- macros --- */
#define PARAM_SPEC_PARAM_ID(pspec) (GPOINTER_TO_UINT (g_param_spec_get_qdata ((pspec), quark_property_id))) #define PARAM_SPEC_PARAM_ID(pspec) ((pspec)->param_id)
#define PARAM_SPEC_SET_PARAM_ID(pspec, id) ((pspec)->param_id = (id))
/* --- signals --- */ /* --- signals --- */
...@@ -52,10 +52,6 @@ enum { ...@@ -52,10 +52,6 @@ enum {
}; };
/* --- typedefs --- */
typedef struct _NotifyQueue NotifyQueue;
/* --- prototypes --- */ /* --- prototypes --- */
static void g_object_base_class_init (GObjectClass *class); static void g_object_base_class_init (GObjectClass *class);
static void g_object_base_class_finalize (GObjectClass *class); static void g_object_base_class_finalize (GObjectClass *class);
...@@ -93,41 +89,23 @@ static gchar* g_value_object_lcopy_value (const GValue *value, ...@@ -93,41 +89,23 @@ static gchar* g_value_object_lcopy_value (const GValue *value,
static void g_object_dispatch_properties_changed (GObject *object, static void g_object_dispatch_properties_changed (GObject *object,
guint n_pspecs, guint n_pspecs,
GParamSpec **pspecs); GParamSpec **pspecs);
static void g_object_properties_changed (GObject *object,
guint n_pspecs,
GParamSpec **pspecs);
static void g_object_notify_property_changed (GObject *object,
GParamSpec *pspec);
static inline NotifyQueue* object_freeze_notifies (GObject *object);
static inline void object_queue_property (GObject *object,
GParamSpec *pspec,
NotifyQueue *nqueue);
static inline void object_thaw_notifies (GObject *object,
NotifyQueue *nqueue);
static inline void object_get_property (GObject *object, static inline void object_get_property (GObject *object,
GParamSpec *pspec, GParamSpec *pspec,
GValue *value); GValue *value);
static inline void object_set_property (GObject *object, static inline void object_set_property (GObject *object,
GParamSpec *pspec, GParamSpec *pspec,
const GValue *value, const GValue *value,
NotifyQueue *nqueue); GObjectNotifyQueue *nqueue);
/* --- structures --- */ /* --- structures --- */
struct _NotifyQueue
{
GSList *pspecs;
guint n_pspecs;
guint freeze_count;
};
/* --- variables --- */ /* --- variables --- */
static GQuark quark_notify_queue = 0; static GQuark quark_closure_array = 0;
static GQuark quark_property_id = 0; static GParamSpecPool *pspec_pool = NULL;
static GQuark quark_closure_array = 0; static GObjectNotifyContext property_notify_context = { 0, };
static GParamSpecPool *pspec_pool = NULL; static gulong gobject_signals[LAST_SIGNAL] = { 0, };
static gulong gobject_signals[LAST_SIGNAL] = { 0, };
/* --- functions --- */ /* --- functions --- */
...@@ -218,8 +196,6 @@ g_object_base_class_init (GObjectClass *class) ...@@ -218,8 +196,6 @@ g_object_base_class_init (GObjectClass *class)
GObjectClass *pclass = g_type_class_peek_parent (class); GObjectClass *pclass = g_type_class_peek_parent (class);
/* reset instance specific fields and methods that don't get inherited */ /* reset instance specific fields and methods that don't get inherited */
class->n_property_specs = 0;
class->property_specs = NULL;
class->construct_properties = pclass ? g_slist_copy (pclass->construct_properties) : NULL; class->construct_properties = pclass ? g_slist_copy (pclass->construct_properties) : NULL;
class->get_property = NULL; class->get_property = NULL;
class->set_property = NULL; class->set_property = NULL;
...@@ -228,7 +204,7 @@ g_object_base_class_init (GObjectClass *class) ...@@ -228,7 +204,7 @@ g_object_base_class_init (GObjectClass *class)
static void static void
g_object_base_class_finalize (GObjectClass *class) g_object_base_class_finalize (GObjectClass *class)
{ {
guint i; GList *list, *node;
g_message ("finallizing base class of %s", G_OBJECT_CLASS_NAME (class)); g_message ("finallizing base class of %s", G_OBJECT_CLASS_NAME (class));
...@@ -236,26 +212,33 @@ g_object_base_class_finalize (GObjectClass *class) ...@@ -236,26 +212,33 @@ g_object_base_class_finalize (GObjectClass *class)
g_slist_free (class->construct_properties); g_slist_free (class->construct_properties);
class->construct_properties = NULL; class->construct_properties = NULL;
for (i = 0; i < class->n_property_specs; i++) list = g_param_spec_pool_belongings (pspec_pool, G_OBJECT_CLASS_TYPE (class));
for (node = list; node; node = node->next)
{ {
GParamSpec *pspec = class->property_specs[i]; GParamSpec *pspec = node->data;
g_param_spec_pool_remove (pspec_pool, pspec); g_param_spec_pool_remove (pspec_pool, pspec);
g_param_spec_set_qdata (pspec, quark_property_id, NULL); PARAM_SPEC_SET_PARAM_ID (pspec, 0);
g_param_spec_unref (pspec); g_param_spec_unref (pspec);
} }
class->n_property_specs = 0; g_list_free (list);
g_free (class->property_specs); }
class->property_specs = NULL;
static void
g_object_notify_dispatcher (GObject *object,
guint n_pspecs,
GParamSpec **pspecs)
{
G_OBJECT_GET_CLASS (object)->dispatch_properties_changed (object, n_pspecs, pspecs);
} }
static void static void
g_object_do_class_init (GObjectClass *class) g_object_do_class_init (GObjectClass *class)
{ {
quark_notify_queue = g_quark_from_static_string ("GObject-notify-queue");
quark_property_id = g_quark_from_static_string ("GObject-property-id");
quark_closure_array = g_quark_from_static_string ("GObject-closure-array"); quark_closure_array = g_quark_from_static_string ("GObject-closure-array");
pspec_pool = g_param_spec_pool_new (TRUE); pspec_pool = g_param_spec_pool_new (TRUE);
property_notify_context.quark_notify_queue = g_quark_from_static_string ("GObject-notify-queue");
property_notify_context.dispatcher = g_object_notify_dispatcher;
class->constructor = g_object_constructor; class->constructor = g_object_constructor;
class->set_property = g_object_do_set_property; class->set_property = g_object_do_set_property;
...@@ -263,18 +246,8 @@ g_object_do_class_init (GObjectClass *class) ...@@ -263,18 +246,8 @@ g_object_do_class_init (GObjectClass *class)
class->shutdown = g_object_shutdown; class->shutdown = g_object_shutdown;
class->finalize = g_object_finalize; class->finalize = g_object_finalize;
class->dispatch_properties_changed = g_object_dispatch_properties_changed; class->dispatch_properties_changed = g_object_dispatch_properties_changed;
class->properties_changed = g_object_properties_changed; class->notify = NULL;
class->notify = g_object_notify_property_changed;
gobject_signals[PROPERTIES_CHANGED] =
g_signal_newc ("properties_changed",
G_TYPE_FROM_CLASS (class),
G_SIGNAL_RUN_FIRST | G_SIGNAL_NO_RECURSE,
G_STRUCT_OFFSET (GObjectClass, properties_changed),
NULL, NULL,
g_cclosure_marshal_VOID__UINT_POINTER,
G_TYPE_NONE,
2, G_TYPE_UINT, G_TYPE_POINTER);
gobject_signals[NOTIFY] = gobject_signals[NOTIFY] =
g_signal_newc ("notify", g_signal_newc ("notify",
G_TYPE_FROM_CLASS (class), G_TYPE_FROM_CLASS (class),
...@@ -291,8 +264,6 @@ g_object_class_install_property (GObjectClass *class, ...@@ -291,8 +264,6 @@ g_object_class_install_property (GObjectClass *class,
guint property_id, guint property_id,
GParamSpec *pspec) GParamSpec *pspec)
{ {
guint i;
g_return_if_fail (G_IS_OBJECT_CLASS (class)); g_return_if_fail (G_IS_OBJECT_CLASS (class));
g_return_if_fail (G_IS_PARAM_SPEC (pspec)); g_return_if_fail (G_IS_PARAM_SPEC (pspec));
if (pspec->flags & G_PARAM_WRITABLE) if (pspec->flags & G_PARAM_WRITABLE)
...@@ -306,18 +277,6 @@ g_object_class_install_property (GObjectClass *class, ...@@ -306,18 +277,6 @@ g_object_class_install_property (GObjectClass *class,
if (pspec->flags & (G_PARAM_CONSTRUCT | G_PARAM_CONSTRUCT_ONLY)) if (pspec->flags & (G_PARAM_CONSTRUCT | G_PARAM_CONSTRUCT_ONLY))
g_return_if_fail (pspec->flags & G_PARAM_WRITABLE); g_return_if_fail (pspec->flags & G_PARAM_WRITABLE);
/* expensive paranoia checks ;( */
for (i = 0; i < class->n_property_specs; i++)
if (PARAM_SPEC_PARAM_ID (class->property_specs[i]) == property_id)
{
g_warning (G_STRLOC ": class `%s' already contains a property `%s' with id %u, "
"cannot install property `%s'",
G_OBJECT_CLASS_NAME (class),
class->property_specs[i]->name,
property_id,
pspec->name);
return;
}
if (g_param_spec_pool_lookup (pspec_pool, pspec->name, G_OBJECT_CLASS_TYPE (class), FALSE)) if (g_param_spec_pool_lookup (pspec_pool, pspec->name, G_OBJECT_CLASS_TYPE (class), FALSE))
{ {
g_warning (G_STRLOC ": class `%s' already contains a property named `%s'", g_warning (G_STRLOC ": class `%s' already contains a property named `%s'",
...@@ -328,11 +287,8 @@ g_object_class_install_property (GObjectClass *class, ...@@ -328,11 +287,8 @@ g_object_class_install_property (GObjectClass *class,
g_param_spec_ref (pspec); g_param_spec_ref (pspec);
g_param_spec_sink (pspec); g_param_spec_sink (pspec);
g_param_spec_set_qdata (pspec, quark_property_id, GUINT_TO_POINTER (property_id)); PARAM_SPEC_SET_PARAM_ID (pspec, property_id);
g_param_spec_pool_insert (pspec_pool, pspec, G_OBJECT_CLASS_TYPE (class)); g_param_spec_pool_insert (pspec_pool, pspec, G_OBJECT_CLASS_TYPE (class));
i = class->n_property_specs++;
class->property_specs = g_renew (GParamSpec*, class->property_specs, class->n_property_specs);
class->property_specs[i] = pspec;
if (pspec->flags & (G_PARAM_CONSTRUCT | G_PARAM_CONSTRUCT_ONLY)) if (pspec->flags & (G_PARAM_CONSTRUCT | G_PARAM_CONSTRUCT_ONLY))
class->construct_properties = g_slist_prepend (class->construct_properties, pspec); class->construct_properties = g_slist_prepend (class->construct_properties, pspec);
...@@ -357,42 +313,22 @@ g_object_class_find_property (GObjectClass *class, ...@@ -357,42 +313,22 @@ g_object_class_find_property (GObjectClass *class,
TRUE); TRUE);
} }
static void GParamSpec** /* free result */
free_notify_queue (gpointer data) g_object_class_list_properties (GObjectClass *class,
{ guint *n_properties_p)
NotifyQueue *nqueue = data;
g_slist_free (nqueue->pspecs);
g_free (nqueue);
}
static inline NotifyQueue*
object_freeze_notifies (GObject *object)
{ {
NotifyQueue *nqueue; GParamSpec **pspecs;
guint n;
nqueue = g_object_get_qdata (object, quark_notify_queue); g_return_val_if_fail (G_IS_OBJECT_CLASS (class), NULL);
if (!nqueue)
{
nqueue = g_new0 (NotifyQueue, 1);
g_object_set_qdata_full (object, quark_notify_queue, nqueue, free_notify_queue);
}
nqueue->freeze_count++;
return nqueue; pspecs = g_param_spec_pool_list (pspec_pool,
} G_OBJECT_CLASS_TYPE (class),
&n);
if (n_properties_p)
*n_properties_p = n;
static inline void return pspecs;
object_queue_property (GObject *object,
GParamSpec *pspec,
NotifyQueue *nqueue)
{
if (pspec->flags & G_PARAM_READABLE)
{
/* we will dedup later */
nqueue->pspecs = g_slist_prepend (nqueue->pspecs, pspec);
nqueue->n_pspecs++;
}
} }
static void static void
...@@ -401,8 +337,8 @@ g_object_init (GObject *object) ...@@ -401,8 +337,8 @@ g_object_init (GObject *object)
object->ref_count = 1; object->ref_count = 1;
g_datalist_init (&object->qdata); g_datalist_init (&object->qdata);
/* freeze object's notification queue, g_object_new_valist() takes care of that */ /* freeze object's notification queue, g_object_newv() preserves pairedness */
object_freeze_notifies (object); g_object_notify_queue_freeze (object, &property_notify_context);
#ifdef G_ENABLE_DEBUG #ifdef G_ENABLE_DEBUG
IF_DEBUG (OBJECTS) IF_DEBUG (OBJECTS)
...@@ -505,54 +441,10 @@ g_object_finalize (GObject *object) ...@@ -505,54 +441,10 @@ g_object_finalize (GObject *object)
#endif /* G_ENABLE_DEBUG */ #endif /* G_ENABLE_DEBUG */
} }
static inline void
object_thaw_notifies (GObject *object,
NotifyQueue *nqueue)
{
GParamSpec **pspecs;
GSList *slist;
guint n_pspecs = 0;
nqueue->freeze_count--;
if (nqueue->freeze_count)
return;
g_return_if_fail (object->ref_count > 0);
pspecs = g_new (GParamSpec*, nqueue->n_pspecs);
for (slist = nqueue->pspecs; slist; slist = slist->next)
{
GParamSpec *pspec = slist->data;
gint i = 0;
/* dedup, make pspecs in the list unique */
redo_dedup_check:
if (pspecs[i] == pspec)
continue;
if (++i < n_pspecs)
goto redo_dedup_check;
pspecs[n_pspecs++] = pspec;
}
g_object_set_qdata (object, quark_notify_queue, NULL);
if (n_pspecs)
G_OBJECT_GET_CLASS (object)->dispatch_properties_changed (object, n_pspecs, pspecs);
g_free (pspecs);
}
static void static void
g_object_dispatch_properties_changed (GObject *object, g_object_dispatch_properties_changed (GObject *object,
guint n_pspecs, guint n_pspecs,
GParamSpec **pspecs) GParamSpec **pspecs)
{
g_signal_emit (object, gobject_signals[PROPERTIES_CHANGED], 0, n_pspecs, pspecs);
}
static void
g_object_properties_changed (GObject *object,
guint n_pspecs,
GParamSpec **pspecs)
{ {
guint i; guint i;
...@@ -560,16 +452,6 @@ g_object_properties_changed (GObject *object, ...@@ -560,16 +452,6 @@ g_object_properties_changed (GObject *object,
g_signal_emit (object, gobject_signals[NOTIFY], g_quark_from_string (pspecs[i]->name), pspecs[i]); g_signal_emit (object, gobject_signals[NOTIFY], g_quark_from_string (pspecs[i]->name), pspecs[i]);
} }
static void
g_object_notify_property_changed (GObject *object,
GParamSpec *pspec)
{
if (0) /* FIXME */
g_message ("NOTIFICATION: property `%s' changed on object `%s'",
pspec->name,
G_OBJECT_TYPE_NAME (object));
}
void void
g_object_freeze_notify (GObject *object) g_object_freeze_notify (GObject *object)
{ {
...@@ -578,7 +460,7 @@ g_object_freeze_notify (GObject *object) ...@@ -578,7 +460,7 @@ g_object_freeze_notify (GObject *object)
return; return;
g_object_ref (object); g_object_ref (object);
object_freeze_notifies (object); g_object_notify_queue_freeze (object, &property_notify_context);
g_object_unref (object); g_object_unref (object);
} }
...@@ -605,10 +487,10 @@ g_object_notify (GObject *object, ...@@ -605,10 +487,10 @@ g_object_notify (GObject *object,
property_name); property_name);
else else
{ {
NotifyQueue *nqueue = object_freeze_notifies (object); GObjectNotifyQueue *nqueue = g_object_notify_queue_freeze (object, &property_notify_context);
object_queue_property (object, pspec, nqueue); g_object_notify_queue_add (object, nqueue, pspec);
object_thaw_notifies (object, nqueue); g_object_notify_queue_thaw (object, nqueue);
} }
g_object_unref (object); g_object_unref (object);
} }
...@@ -616,19 +498,19 @@ g_object_notify (GObject *object, ...@@ -616,19 +498,19 @@ g_object_notify (GObject *object,
void void
g_object_thaw_notify (GObject *object) g_object_thaw_notify (GObject *object)
{ {
NotifyQueue *nqueue; GObjectNotifyQueue *nqueue;
g_return_if_fail (G_IS_OBJECT (object)); g_return_if_fail (G_IS_OBJECT (object));
if (!object->ref_count) if (!object->ref_count)
return; return;
g_object_ref (object); g_object_ref (object);
nqueue = g_object_get_qdata (object, quark_notify_queue); nqueue = g_object_notify_queue_from_object (object, &property_notify_context);
if (!nqueue || !nqueue->freeze_count) if (!nqueue || !nqueue->freeze_count)
g_warning (G_STRLOC ": property-changed notification for %s(%p) is not frozen", g_warning (G_STRLOC ": property-changed notification for %s(%p) is not frozen",
G_OBJECT_TYPE_NAME (object), object); G_OBJECT_TYPE_NAME (object), object);
else else
object_thaw_notifies (object, nqueue); g_object_notify_queue_thaw (object, nqueue);
g_object_unref (object); g_object_unref (object);
} }
...@@ -637,18 +519,16 @@ object_get_property (GObject *object, ...@@ -637,18 +519,16 @@ object_get_property (GObject *object,
GParamSpec *pspec, GParamSpec *pspec,
GValue *value) GValue *value)
{ {
GObjectClass *class; GObjectClass *class = g_type_class_peek (pspec->owner_type);
class = g_type_class_peek (pspec->owner_type);
class->get_property (object, PARAM_SPEC_PARAM_ID (pspec), value, pspec); class->get_property (object, PARAM_SPEC_PARAM_ID (pspec), value, pspec);
} }
static inline void static