X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gobject%2Fgobject.h;h=971f365a62b1441a7fdf01870d7c6ce3acbd76e1;hb=309f5f978bc1378449fea2a81f4d47e749ae7ceb;hp=53a6aed09c88bb83f4b560e59bcb9bc342980edf;hpb=306db46123fef00d616201828bb1c3d6a43baeba;p=platform%2Fupstream%2Fglib.git diff --git a/gobject/gobject.h b/gobject/gobject.h index 53a6aed..971f365 100644 --- a/gobject/gobject.h +++ b/gobject/gobject.h @@ -344,8 +344,10 @@ struct _GObjectClass void (*constructed) (GObject *object); /*< private >*/ + gsize flags; + /* padding */ - gpointer pdummy[7]; + gpointer pdummy[6]; }; /** * GObjectConstructParam: @@ -388,6 +390,9 @@ GParamSpec**g_object_class_list_properties (GObjectClass *oclass, void g_object_class_override_property (GObjectClass *oclass, guint property_id, const gchar *name); +void g_object_class_install_properties (GObjectClass *oclass, + guint n_pspecs, + GParamSpec **pspecs); void g_object_interface_install_property (gpointer g_iface, GParamSpec *pspec); @@ -396,7 +401,7 @@ GParamSpec* g_object_interface_find_property (gpointer g_iface, GParamSpec**g_object_interface_list_properties (gpointer g_iface, guint *n_properties_p); -GType g_object_get_type (void); +GType g_object_get_type (void) G_GNUC_CONST; gpointer g_object_new (GType object_type, const gchar *first_property_name, ...); @@ -433,6 +438,8 @@ void g_object_get_property (GObject *object, void g_object_freeze_notify (GObject *object); void g_object_notify (GObject *object, const gchar *property_name); +void g_object_notify_by_pspec (GObject *object, + GParamSpec *pspec); void g_object_thaw_notify (GObject *object); gboolean g_object_is_floating (gpointer object); gpointer g_object_ref_sink (gpointer object); @@ -555,6 +562,21 @@ G_STMT_START { \ #define G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec) \ G_OBJECT_WARN_INVALID_PSPEC ((object), "property", (property_id), (pspec)) +void g_clear_object (volatile GObject **object_ptr); +#define g_clear_object(object_ptr) \ + G_STMT_START { \ + /* Only one access, please */ \ + gpointer *_p = (gpointer) (object_ptr); \ + gpointer _o; \ + \ + do \ + _o = g_atomic_pointer_get (_p); \ + while G_UNLIKELY (!g_atomic_pointer_compare_and_exchange (_p, _o, NULL));\ + \ + if (_o) \ + g_object_unref (_o); \ + } G_STMT_END + G_END_DECLS #endif /* __G_OBJECT_H__ */