mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-30 10:56:37 +02:00
glib: Add missing (nullable) and (optional) annotations
Add various (nullable) and (optional) annotations which were missing from a variety of functions. Also port a couple of existing (allow-none) annotations in the same files to use (nullable) and (optional) as appropriate instead. Secondly, add various (not nullable) annotations as needed by the new default in gobject-introspection of marking gpointers as (nullable). See https://bugzilla.gnome.org/show_bug.cgi?id=729660. This includes adding some stub documentation comments for the assertion macro error functions, which weren’t previously documented. The new comments are purely to allow for annotations, and hence are marked as (skip) to prevent the symbols appearing in the GIR file. https://bugzilla.gnome.org/show_bug.cgi?id=719966
This commit is contained in:
@@ -702,7 +702,8 @@ g_object_class_install_properties (GObjectClass *oclass,
|
||||
|
||||
/**
|
||||
* g_object_interface_install_property:
|
||||
* @g_iface: any interface vtable for the interface, or the default
|
||||
* @g_iface: (type GObject.TypeInterface): any interface vtable for the
|
||||
* interface, or the default
|
||||
* vtable for the interface.
|
||||
* @pspec: the #GParamSpec for the new property
|
||||
*
|
||||
@@ -781,8 +782,8 @@ g_object_class_find_property (GObjectClass *class,
|
||||
|
||||
/**
|
||||
* g_object_interface_find_property:
|
||||
* @g_iface: any interface vtable for the interface, or the default
|
||||
* vtable for the interface
|
||||
* @g_iface: (type GObject.TypeInterface): any interface vtable for the
|
||||
* interface, or the default vtable for the interface
|
||||
* @property_name: name of a property to lookup.
|
||||
*
|
||||
* Find the #GParamSpec with the given name for an
|
||||
@@ -919,8 +920,8 @@ g_object_class_list_properties (GObjectClass *class,
|
||||
|
||||
/**
|
||||
* g_object_interface_list_properties:
|
||||
* @g_iface: any interface vtable for the interface, or the default
|
||||
* vtable for the interface
|
||||
* @g_iface: (type GObject.TypeInterface): any interface vtable for the
|
||||
* interface, or the default vtable for the interface
|
||||
* @n_properties_p: (out): location to store number of properties returned.
|
||||
*
|
||||
* Lists the properties of an interface.Generally, the interface
|
||||
@@ -1602,7 +1603,8 @@ g_object_get_type (void)
|
||||
* Construction parameters (see #G_PARAM_CONSTRUCT, #G_PARAM_CONSTRUCT_ONLY)
|
||||
* which are not explicitly specified are set to their default values.
|
||||
*
|
||||
* Returns: (transfer full): a new instance of @object_type
|
||||
* Returns: (transfer full) (type GObject.Object) : a new instance of
|
||||
* @object_type
|
||||
*/
|
||||
gpointer
|
||||
g_object_new (GType object_type,
|
||||
@@ -2248,7 +2250,7 @@ g_object_get_valist (GObject *object,
|
||||
|
||||
/**
|
||||
* g_object_set: (skip)
|
||||
* @object: a #GObject
|
||||
* @object: (type GObject.Object): a #GObject
|
||||
* @first_property_name: name of the first property to set
|
||||
* @...: value for the first property, followed optionally by more
|
||||
* name/value pairs, followed by %NULL
|
||||
@@ -2276,7 +2278,7 @@ g_object_set (gpointer _object,
|
||||
|
||||
/**
|
||||
* g_object_get: (skip)
|
||||
* @object: a #GObject
|
||||
* @object: (type GObject.Object): a #GObject
|
||||
* @first_property_name: name of the first property to get
|
||||
* @...: return location for the first property, followed optionally by more
|
||||
* name/return location pairs, followed by %NULL
|
||||
@@ -2452,7 +2454,7 @@ g_object_get_property (GObject *object,
|
||||
|
||||
/**
|
||||
* g_object_connect: (skip)
|
||||
* @object: a #GObject
|
||||
* @object: (type GObject.Object): a #GObject
|
||||
* @signal_spec: the spec for the first signal
|
||||
* @...: #GCallback for the first signal, followed by data for the
|
||||
* first signal, followed optionally by more signal
|
||||
@@ -2482,7 +2484,7 @@ g_object_get_property (GObject *object,
|
||||
* NULL);
|
||||
* ]|
|
||||
*
|
||||
* Returns: (transfer none): @object
|
||||
* Returns: (transfer none) (type GObject.Object): @object
|
||||
*/
|
||||
gpointer
|
||||
g_object_connect (gpointer _object,
|
||||
@@ -2554,7 +2556,7 @@ g_object_connect (gpointer _object,
|
||||
|
||||
/**
|
||||
* g_object_disconnect: (skip)
|
||||
* @object: a #GObject
|
||||
* @object: (type GObject.Object): a #GObject
|
||||
* @signal_spec: the spec for the first signal
|
||||
* @...: #GCallback for the first signal, followed by data for the first signal,
|
||||
* followed optionally by more signal spec/callback/data triples,
|
||||
@@ -2729,7 +2731,8 @@ g_object_weak_unref (GObject *object,
|
||||
/**
|
||||
* g_object_add_weak_pointer: (skip)
|
||||
* @object: The object that should be weak referenced.
|
||||
* @weak_pointer_location: (inout): The memory address of a pointer.
|
||||
* @weak_pointer_location: (inout) (not optional) (nullable): The memory address
|
||||
* of a pointer.
|
||||
*
|
||||
* Adds a weak reference from weak_pointer to @object to indicate that
|
||||
* the pointer located at @weak_pointer_location is only valid during
|
||||
@@ -2756,7 +2759,8 @@ g_object_add_weak_pointer (GObject *object,
|
||||
/**
|
||||
* g_object_remove_weak_pointer: (skip)
|
||||
* @object: The object that is weak referenced.
|
||||
* @weak_pointer_location: (inout): The memory address of a pointer.
|
||||
* @weak_pointer_location: (inout) (not optional) (nullable): The memory address
|
||||
* of a pointer.
|
||||
*
|
||||
* Removes a weak reference from @object that was previously added
|
||||
* using g_object_add_weak_pointer(). The @weak_pointer_location has
|
||||
@@ -3830,10 +3834,11 @@ g_value_dup_object (const GValue *value)
|
||||
|
||||
/**
|
||||
* g_signal_connect_object: (skip)
|
||||
* @instance: the instance to connect to.
|
||||
* @instance: (type GObject.TypeInstance): the instance to connect to.
|
||||
* @detailed_signal: a string of the form "signal-name::detail".
|
||||
* @c_handler: the #GCallback to connect.
|
||||
* @gobject: the object to pass as data to @c_handler.
|
||||
* @gobject: (type GObject.Object) (nullable): the object to pass as data
|
||||
* to @c_handler.
|
||||
* @connect_flags: a combination of #GConnectFlags.
|
||||
*
|
||||
* This is similar to g_signal_connect_data(), but uses a closure which
|
||||
@@ -4140,7 +4145,7 @@ g_initially_unowned_class_init (GInitiallyUnownedClass *klass)
|
||||
* g_weak_ref_init: (skip)
|
||||
* @weak_ref: (inout): uninitialized or empty location for a weak
|
||||
* reference
|
||||
* @object: (allow-none): a #GObject or %NULL
|
||||
* @object: (type GObject.Object) (nullable): a #GObject or %NULL
|
||||
*
|
||||
* Initialise a non-statically-allocated #GWeakRef.
|
||||
*
|
||||
@@ -4226,7 +4231,7 @@ g_weak_ref_get (GWeakRef *weak_ref)
|
||||
/**
|
||||
* g_weak_ref_set: (skip)
|
||||
* @weak_ref: location for a weak reference
|
||||
* @object: (allow-none): a #GObject or %NULL
|
||||
* @object: (type GObject.Object) (nullable): a #GObject or %NULL
|
||||
*
|
||||
* Change the object to which @weak_ref points, or set it to
|
||||
* %NULL.
|
||||
|
Reference in New Issue
Block a user