|
#define | G_TYPE_IS_OBJECT(type) (G_TYPE_FUNDAMENTAL (type) == G_TYPE_OBJECT) |
|
#define | G_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), G_TYPE_OBJECT, GObject)) |
|
#define | G_OBJECT_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), G_TYPE_OBJECT, GObjectClass)) |
|
#define | G_IS_OBJECT(object) (G_TYPE_CHECK_INSTANCE_FUNDAMENTAL_TYPE ((object), G_TYPE_OBJECT)) |
|
#define | G_IS_OBJECT_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_OBJECT)) |
|
#define | G_OBJECT_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), G_TYPE_OBJECT, GObjectClass)) |
|
#define | G_OBJECT_TYPE(object) (G_TYPE_FROM_INSTANCE (object)) |
|
#define | G_OBJECT_TYPE_NAME(object) (g_type_name (G_OBJECT_TYPE (object))) |
|
#define | G_OBJECT_CLASS_TYPE(class) (G_TYPE_FROM_CLASS (class)) |
|
#define | G_OBJECT_CLASS_NAME(class) (g_type_name (G_OBJECT_CLASS_TYPE (class))) |
|
#define | G_VALUE_HOLDS_OBJECT(value) (G_TYPE_CHECK_VALUE_TYPE ((value), G_TYPE_OBJECT)) |
|
#define | G_TYPE_INITIALLY_UNOWNED (g_initially_unowned_get_type()) |
|
#define | G_INITIALLY_UNOWNED(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), G_TYPE_INITIALLY_UNOWNED, GInitiallyUnowned)) |
|
#define | G_INITIALLY_UNOWNED_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class), G_TYPE_INITIALLY_UNOWNED, GInitiallyUnownedClass)) |
|
#define | G_IS_INITIALLY_UNOWNED(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), G_TYPE_INITIALLY_UNOWNED)) |
|
#define | G_IS_INITIALLY_UNOWNED_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class), G_TYPE_INITIALLY_UNOWNED)) |
|
#define | G_INITIALLY_UNOWNED_GET_CLASS(object) (G_TYPE_INSTANCE_GET_CLASS ((object), G_TYPE_INITIALLY_UNOWNED, GInitiallyUnownedClass)) |
|
#define | G_OBJECT_WARN_INVALID_PSPEC(object, pname, property_id, pspec) |
|
#define | G_OBJECT_WARN_INVALID_PROPERTY_ID(object, property_id, pspec) G_OBJECT_WARN_INVALID_PSPEC ((object), "property", (property_id), (pspec)) |
|
#define | g_clear_object(object_ptr) g_clear_pointer ((object_ptr), g_object_unref) |
|
#define | g_set_object(object_ptr, new_object) |
|
#define | g_assert_finalize_object(object) (g_assert_finalize_object ((GObject *) object)) |
|
#define | g_clear_weak_pointer(weak_pointer_location) |
|
#define | g_set_weak_pointer(weak_pointer_location, new_object) |
|
|
GOBJECT_AVAILABLE_IN_ALL GType | g_initially_unowned_get_type (void) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_class_install_property (GObjectClass *oclass, guint property_id, GParamSpec *pspec) |
|
GOBJECT_AVAILABLE_IN_ALL GParamSpec * | g_object_class_find_property (GObjectClass *oclass, const gchar *property_name) |
|
GOBJECT_AVAILABLE_IN_ALL GParamSpec ** | g_object_class_list_properties (GObjectClass *oclass, guint *n_properties) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_class_override_property (GObjectClass *oclass, guint property_id, const gchar *name) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_class_install_properties (GObjectClass *oclass, guint n_pspecs, GParamSpec **pspecs) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_interface_install_property (gpointer g_iface, GParamSpec *pspec) |
|
GOBJECT_AVAILABLE_IN_ALL GParamSpec * | g_object_interface_find_property (gpointer g_iface, const gchar *property_name) |
|
GOBJECT_AVAILABLE_IN_ALL GParamSpec ** | g_object_interface_list_properties (gpointer g_iface, guint *n_properties_p) |
|
GOBJECT_AVAILABLE_IN_ALL GType | g_object_get_type (void) G_GNUC_CONST |
|
GOBJECT_AVAILABLE_IN_ALL gpointer | g_object_new (GType object_type, const gchar *first_property_name,...) |
|
GOBJECT_AVAILABLE_IN_2_54 GObject * | g_object_new_with_properties (GType object_type, guint n_properties, const char *names[], const GValue values[]) |
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS gpointer | g_object_newv (GType object_type, guint n_parameters, GParameter *parameters) |
|
G_GNUC_END_IGNORE_DEPRECATIONS GOBJECT_AVAILABLE_IN_ALL GObject * | g_object_new_valist (GType object_type, const gchar *first_property_name, va_list var_args) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_set (gpointer object, const gchar *first_property_name,...) G_GNUC_NULL_TERMINATED |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_get (gpointer object, const gchar *first_property_name,...) G_GNUC_NULL_TERMINATED |
|
GOBJECT_AVAILABLE_IN_ALL gpointer | g_object_connect (gpointer object, const gchar *signal_spec,...) G_GNUC_NULL_TERMINATED |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_disconnect (gpointer object, const gchar *signal_spec,...) G_GNUC_NULL_TERMINATED |
|
GOBJECT_AVAILABLE_IN_2_54 void | g_object_setv (GObject *object, guint n_properties, const gchar *names[], const GValue values[]) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_set_valist (GObject *object, const gchar *first_property_name, va_list var_args) |
|
GOBJECT_AVAILABLE_IN_2_54 void | g_object_getv (GObject *object, guint n_properties, const gchar *names[], GValue values[]) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_get_valist (GObject *object, const gchar *first_property_name, va_list var_args) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_set_property (GObject *object, const gchar *property_name, const GValue *value) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_get_property (GObject *object, const gchar *property_name, GValue *value) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_freeze_notify (GObject *object) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_notify (GObject *object, const gchar *property_name) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_notify_by_pspec (GObject *object, GParamSpec *pspec) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_thaw_notify (GObject *object) |
|
GOBJECT_AVAILABLE_IN_ALL gboolean | g_object_is_floating (gpointer object) |
|
GOBJECT_AVAILABLE_IN_ALL gpointer | g_object_ref_sink (gpointer object) |
|
GOBJECT_AVAILABLE_IN_2_70 gpointer | g_object_take_ref (gpointer object) |
|
GOBJECT_AVAILABLE_IN_ALL gpointer | g_object_ref (gpointer object) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_unref (gpointer object) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_weak_ref (GObject *object, GWeakNotify notify, gpointer data) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_weak_unref (GObject *object, GWeakNotify notify, gpointer data) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_add_weak_pointer (GObject *object, gpointer *weak_pointer_location) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_remove_weak_pointer (GObject *object, gpointer *weak_pointer_location) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_add_toggle_ref (GObject *object, GToggleNotify notify, gpointer data) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_remove_toggle_ref (GObject *object, GToggleNotify notify, gpointer data) |
|
GOBJECT_AVAILABLE_IN_ALL gpointer | g_object_get_qdata (GObject *object, GQuark quark) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_set_qdata (GObject *object, GQuark quark, gpointer data) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_set_qdata_full (GObject *object, GQuark quark, gpointer data, GDestroyNotify destroy) |
|
GOBJECT_AVAILABLE_IN_ALL gpointer | g_object_steal_qdata (GObject *object, GQuark quark) |
|
GOBJECT_AVAILABLE_IN_2_34 gpointer | g_object_dup_qdata (GObject *object, GQuark quark, GDuplicateFunc dup_func, gpointer user_data) |
|
GOBJECT_AVAILABLE_IN_2_34 gboolean | g_object_replace_qdata (GObject *object, GQuark quark, gpointer oldval, gpointer newval, GDestroyNotify destroy, GDestroyNotify *old_destroy) |
|
GOBJECT_AVAILABLE_IN_ALL gpointer | g_object_get_data (GObject *object, const gchar *key) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_set_data (GObject *object, const gchar *key, gpointer data) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_set_data_full (GObject *object, const gchar *key, gpointer data, GDestroyNotify destroy) |
|
GOBJECT_AVAILABLE_IN_ALL gpointer | g_object_steal_data (GObject *object, const gchar *key) |
|
GOBJECT_AVAILABLE_IN_2_34 gpointer | g_object_dup_data (GObject *object, const gchar *key, GDuplicateFunc dup_func, gpointer user_data) |
|
GOBJECT_AVAILABLE_IN_2_34 gboolean | g_object_replace_data (GObject *object, const gchar *key, gpointer oldval, gpointer newval, GDestroyNotify destroy, GDestroyNotify *old_destroy) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_watch_closure (GObject *object, GClosure *closure) |
|
GOBJECT_AVAILABLE_IN_ALL GClosure * | g_cclosure_new_object (GCallback callback_func, GObject *object) |
|
GOBJECT_AVAILABLE_IN_ALL GClosure * | g_cclosure_new_object_swap (GCallback callback_func, GObject *object) |
|
GOBJECT_AVAILABLE_IN_ALL GClosure * | g_closure_new_object (guint sizeof_closure, GObject *object) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_value_set_object (GValue *value, gpointer v_object) |
|
GOBJECT_AVAILABLE_IN_ALL gpointer | g_value_get_object (const GValue *value) |
|
GOBJECT_AVAILABLE_IN_ALL gpointer | g_value_dup_object (const GValue *value) |
|
GOBJECT_AVAILABLE_IN_ALL gulong | g_signal_connect_object (gpointer instance, const gchar *detailed_signal, GCallback c_handler, gpointer gobject, GConnectFlags connect_flags) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_force_floating (GObject *object) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_object_run_dispose (GObject *object) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_value_take_object (GValue *value, gpointer v_object) |
|
void | g_value_set_object_take_ownership (GValue *value, gpointer v_object) |
|
GOBJECT_DEPRECATED gsize | g_object_compat_control (gsize what, gpointer data) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_clear_object (GObject **object_ptr) |
|
static gboolean | g_set_object (GObject **object_ptr, GObject *new_object) |
|
static void | g_assert_finalize_object (GObject *object) |
|
static void | g_clear_weak_pointer (gpointer *weak_pointer_location) |
|
static gboolean | g_set_weak_pointer (gpointer *weak_pointer_location, GObject *new_object) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_weak_ref_init (GWeakRef *weak_ref, gpointer object) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_weak_ref_clear (GWeakRef *weak_ref) |
|
GOBJECT_AVAILABLE_IN_ALL gpointer | g_weak_ref_get (GWeakRef *weak_ref) |
|
GOBJECT_AVAILABLE_IN_ALL void | g_weak_ref_set (GWeakRef *weak_ref, gpointer object) |
|
g_set_object: (skip) @object_ptr: (inout) (not optional) (nullable): a pointer to a GObject reference @new_object: (nullable) (transfer none): a pointer to the new GObject to assign to @object_ptr, or NULL to clear the pointer
Updates a GObject pointer to refer to @new_object.
It increments the reference count of @new_object (if non-NULL), decrements the reference count of the current value of @object_ptr (if non-NULL), and assigns @new_object to @object_ptr. The assignment is not atomic.
@object_ptr must not be NULL, but can point to a NULL value.
A macro is also included that allows this function to be used without pointer casts. The function itself is static inline, so its address may vary between compilation units.
One convenient usage of this function is in implementing property setters: |[ void foo_set_bar (Foo *foo, Bar *new_bar) { g_return_if_fail (IS_FOO (foo)); g_return_if_fail (new_bar == NULL || IS_BAR (new_bar));
if (g_set_object (&foo->bar, new_bar)) g_object_notify (foo, "bar"); } ]|
Returns: TRUE if the value of @object_ptr changed, FALSE otherwise
Since: 2.44
Definition at line 733 of file gobject.h.
736{
737 GObject *old_object = *object_ptr;
738
739
740
741
742
743
744
745 if (old_object == new_object)
747
748 if (new_object !=
NULL)
750
751 *object_ptr = new_object;
752
753 if (old_object !=
NULL)
755
757}
GOBJECT_AVAILABLE_IN_ALL gpointer g_object_ref(gpointer object)
References FALSE, g_object_ref(), g_object_unref(), NULL, and TRUE.
g_set_weak_pointer: (skip) @weak_pointer_location: the memory address of a pointer @new_object: (nullable) (transfer none): a pointer to the new GObject to assign to it, or NULL to clear the pointer
Updates a pointer to weakly refer to @new_object.
It assigns @new_object to @weak_pointer_location and ensures that @weak_pointer_location will automatically be set to NULL if @new_object gets destroyed. The assignment is not atomic. The weak reference is not thread-safe, see g_object_add_weak_pointer() for details.
The @weak_pointer_location argument must not be NULL.
A macro is also included that allows this function to be used without pointer casts. The function itself is static inline, so its address may vary between compilation units.
One convenient usage of this function is in implementing property setters: |[ void foo_set_bar (Foo *foo, Bar *new_bar) { g_return_if_fail (IS_FOO (foo)); g_return_if_fail (new_bar == NULL || IS_BAR (new_bar));
if (g_set_weak_pointer (&foo->bar, new_bar)) g_object_notify (foo, "bar"); } ]|
Returns: TRUE if the value of @weak_pointer_location changed, FALSE otherwise
Since: 2.56
Definition at line 889 of file gobject.h.
892{
894
895
896
897
898
899
900 if (old_object == new_object)
902
903 if (old_object !=
NULL)
905
906 *weak_pointer_location = new_object;
907
908 if (new_object !=
NULL)
910
912}
References FALSE, g_object_add_weak_pointer(), g_object_remove_weak_pointer(), NULL, and TRUE.