Add some missing (nullable) annotations

Fixes https://gitlab.gnome.org/GNOME/gimp/-/issues/4750
This commit is contained in:
Niels De Graef 2020-05-01 15:33:27 +02:00
parent d4387987b5
commit 85d9730936
7 changed files with 33 additions and 29 deletions

View File

@ -433,7 +433,7 @@ gimp_gradient_get_extension (GimpData *data)
* gimp_gradient_get_color_at: * gimp_gradient_get_color_at:
* @gradient: a gradient * @gradient: a gradient
* @context: a context * @context: a context
* @seg: a segment to seed the search with (or %NULL) * @seg: (nullable): a segment to seed the search with (or %NULL)
* @pos: position in the gradient (between 0.0 and 1.0) * @pos: position in the gradient (between 0.0 and 1.0)
* @reverse: when %TRUE, use the reversed gradient * @reverse: when %TRUE, use the reversed gradient
* @blend_color_space: color space to use for blending RGB segments * @blend_color_space: color space to use for blending RGB segments

View File

@ -2176,9 +2176,9 @@ gimp_image_get_file_or_untitled (GimpImage *image)
* gimp_image_get_file: * gimp_image_get_file:
* @image: A #GimpImage. * @image: A #GimpImage.
* *
* Get the file of the XCF image, or NULL if there is no file. * Get the file of the XCF image, or %NULL if there is no file.
* *
* Returns: The file, or NULL. * Returns: (nullable): The file, or %NULL.
**/ **/
GFile * GFile *
gimp_image_get_file (GimpImage *image) gimp_image_get_file (GimpImage *image)
@ -2192,8 +2192,8 @@ gimp_image_get_file (GimpImage *image)
* gimp_image_get_imported_file: * gimp_image_get_imported_file:
* @image: A #GimpImage. * @image: A #GimpImage.
* *
* Returns: The file of the imported image, or NULL if the image has * Returns: (nullable): The file of the imported image, or %NULL if the image
* been saved as XCF after it was imported. * has been saved as XCF after it was imported.
**/ **/
GFile * GFile *
gimp_image_get_imported_file (GimpImage *image) gimp_image_get_imported_file (GimpImage *image)
@ -2207,8 +2207,8 @@ gimp_image_get_imported_file (GimpImage *image)
* gimp_image_get_exported_file: * gimp_image_get_exported_file:
* @image: A #GimpImage. * @image: A #GimpImage.
* *
* Returns: The file of the image last exported from this XCF file, or * Returns: (nullable): The file of the image last exported from this XCF file,
* NULL if the image has never been exported. * or %NULL if the image has never been exported.
**/ **/
GFile * GFile *
gimp_image_get_exported_file (GimpImage *image) gimp_image_get_exported_file (GimpImage *image)

View File

@ -270,7 +270,7 @@ gimp_scan_convert_add_bezier (GimpScanConvert *sc,
* extend to a distance of more than @miter times @width from * extend to a distance of more than @miter times @width from
* the actual join point * the actual join point
* @dash_offset: offset to apply on the dash pattern * @dash_offset: offset to apply on the dash pattern
* @dash_info: dash pattern or %NULL for a solid line * @dash_info: (nullable): dash pattern or %NULL for a solid line
* *
* Stroke the content of a GimpScanConvert. The next * Stroke the content of a GimpScanConvert. The next
* gimp_scan_convert_render() will result in the outline of the * gimp_scan_convert_render() will result in the outline of the

View File

@ -219,7 +219,7 @@ gimp_tagged_get_identifier (GimpTagged *tagged)
* If the object does not want to support such remapping (objects not * If the object does not want to support such remapping (objects not
* stored in file for example) it can return %NULL. * stored in file for example) it can return %NULL.
* *
* Returns: checksum string if object needs identifier remapping, * Returns: (nullable): checksum string if object needs identifier remapping,
* %NULL otherwise. Returned string must be freed with #g_free(). * %NULL otherwise. Returned string must be freed with #g_free().
**/ **/
gchar * gchar *

View File

@ -570,7 +570,7 @@ gimp_clipboard_get_curve (Gimp *gimp)
/** /**
* gimp_clipboard_set_image: * gimp_clipboard_set_image:
* @gimp: pointer to #Gimp * @gimp: pointer to #Gimp
* @image: a #GimpImage, or %NULL. * @image: (nullable): a #GimpImage, or %NULL.
* *
* Offers the image in %GDK_SELECTION_CLIPBOARD. * Offers the image in %GDK_SELECTION_CLIPBOARD.
**/ **/
@ -620,7 +620,7 @@ gimp_clipboard_set_image (Gimp *gimp,
/** /**
* gimp_clipboard_set_buffer: * gimp_clipboard_set_buffer:
* @gimp: pointer to #Gimp * @gimp: pointer to #Gimp
* @buffer: a #GimpBuffer, or %NULL. * @buffer: (nullable): a #GimpBuffer, or %NULL.
* *
* Offers the buffer in %GDK_SELECTION_CLIPBOARD. * Offers the buffer in %GDK_SELECTION_CLIPBOARD.
**/ **/
@ -668,7 +668,7 @@ gimp_clipboard_set_buffer (Gimp *gimp,
/** /**
* gimp_clipboard_set_svg: * gimp_clipboard_set_svg:
* @gimp: pointer to #Gimp * @gimp: pointer to #Gimp
* @svg: a string containing the SVG data, or %NULL * @svg: (nullable): a string containing the SVG data, or %NULL
* *
* Offers SVG data in %GDK_SELECTION_CLIPBOARD. * Offers SVG data in %GDK_SELECTION_CLIPBOARD.
**/ **/
@ -743,7 +743,7 @@ gimp_clipboard_set_text (Gimp *gimp,
/** /**
* gimp_clipboard_set_curve: * gimp_clipboard_set_curve:
* @gimp: pointer to #Gimp * @gimp: pointer to #Gimp
* @curve: a #GimpCurve, or %NULL * @curve: (nullable): a #GimpCurve, or %NULL
* *
* Offers curve data in %GDK_SELECTION_CLIPBOARD. * Offers curve data in %GDK_SELECTION_CLIPBOARD.
**/ **/

View File

@ -312,7 +312,7 @@ gimp_procedure_config_get_values (GimpProcedureConfig *config,
/** /**
* gimp_procedure_config_begin_run: * gimp_procedure_config_begin_run:
* @config: a #GimpProcedureConfig * @config: a #GimpProcedureConfig
* @image: a #GimpImage or %NULL * @image: (nullable): a #GimpImage or %NULL
* @run_mode: the #GimpRunMode passed to a #GimpProcedure's run() * @run_mode: the #GimpRunMode passed to a #GimpProcedure's run()
* @args: the #GimpValueArray passed to a #GimpProcedure's run() * @args: the #GimpValueArray passed to a #GimpProcedure's run()
* *
@ -451,7 +451,7 @@ gimp_procedure_config_end_run (GimpProcedureConfig *config,
* @original_image: the #GimpImage passed to run() * @original_image: the #GimpImage passed to run()
* @run_mode: the #GimpRunMode passed to a #GimpProcedure's run() * @run_mode: the #GimpRunMode passed to a #GimpProcedure's run()
* @args: the #GimpValueArray passed to a #GimpProcedure's run() * @args: the #GimpValueArray passed to a #GimpProcedure's run()
* @mime_type: the exported file format's mime type, or %NULL. * @mime_type: (nullable): exported file format's mime type, or %NULL.
* *
* This is a variant of gimp_procedure_config_begin_run() to be used * This is a variant of gimp_procedure_config_begin_run() to be used
* by file export procedures using #GimpSaveProcedure. It must be * by file export procedures using #GimpSaveProcedure. It must be
@ -506,7 +506,7 @@ gimp_procedure_config_end_run (GimpProcedureConfig *config,
* argument is initialized with the default comment returned by * argument is initialized with the default comment returned by
* gimp_get_default_comment(). * gimp_get_default_comment().
* *
* Returns: (transfer none): The #GimpMetadata to be used for this * Returns: (transfer none) (nullable): The #GimpMetadata to be used for this
* export, or %NULL if @original_image doesn't have metadata. * export, or %NULL if @original_image doesn't have metadata.
* *
* Since: 3.0 * Since: 3.0

View File

@ -84,7 +84,7 @@ static gboolean gimp_utils_gdb_available (gint major,
/** /**
* gimp_utf8_strtrim: * gimp_utf8_strtrim:
* @str: an UTF-8 encoded string (or %NULL) * @str: (nullable): an UTF-8 encoded string (or %NULL)
* @max_chars: the maximum number of characters before the string get * @max_chars: the maximum number of characters before the string get
* trimmed * trimmed
* *
@ -522,7 +522,7 @@ gimp_file_show_in_file_manager (GFile *file,
/** /**
* gimp_strip_uline: * gimp_strip_uline:
* @str: underline infested string (or %NULL) * @str: (nullable): underline infested string (or %NULL)
* *
* This function returns a copy of @str stripped of underline * This function returns a copy of @str stripped of underline
* characters. This comes in handy when needing to strip mnemonics * characters. This comes in handy when needing to strip mnemonics
@ -586,7 +586,7 @@ gimp_strip_uline (const gchar *str)
/** /**
* gimp_escape_uline: * gimp_escape_uline:
* @str: Underline infested string (or %NULL) * @str: (nullable): Underline infested string (or %NULL)
* *
* This function returns a copy of @str with all underline converted * This function returns a copy of @str with all underline converted
* to two adjacent underlines. This comes in handy when needing to display * to two adjacent underlines. This comes in handy when needing to display
@ -718,7 +718,7 @@ gimp_canonicalize_identifier (const gchar *identifier)
* *
* Retrieves #GimpEnumDesc associated with the given value, or %NULL. * Retrieves #GimpEnumDesc associated with the given value, or %NULL.
* *
* Returns: the value's #GimpEnumDesc. * Returns: (nullable): the value's #GimpEnumDesc.
* *
* Since: 2.2 * Since: 2.2
**/ **/
@ -751,10 +751,12 @@ gimp_enum_get_desc (GEnumClass *enum_class,
* gimp_enum_get_value: * gimp_enum_get_value:
* @enum_type: the #GType of a registered enum * @enum_type: the #GType of a registered enum
* @value: an integer value * @value: an integer value
* @value_name: return location for the value's name (or %NULL) * @value_name: (optional): return location for the value's name (or %NULL)
* @value_nick: return location for the value's nick (or %NULL) * @value_nick: (optional): return location for the value's nick (or %NULL)
* @value_desc: return location for the value's translated description (or %NULL) * @value_desc: (optional): return location for the value's translated
* @value_help: return location for the value's translated help (or %NULL) * description (or %NULL)
* @value_help: (optional): return location for the value's translated help
* (or %NULL)
* *
* Checks if @value is valid for the enum registered as @enum_type. * Checks if @value is valid for the enum registered as @enum_type.
* If the value exists in that enum, its name, nick and its translated * If the value exists in that enum, its name, nick and its translated
@ -942,7 +944,7 @@ gimp_enum_value_get_abbrev (GEnumClass *enum_class,
* *
* Retrieves the first #GimpFlagsDesc that matches the given value, or %NULL. * Retrieves the first #GimpFlagsDesc that matches the given value, or %NULL.
* *
* Returns: the value's #GimpFlagsDesc. * Returns: (nullable): the value's #GimpFlagsDesc.
* *
* Since: 2.2 * Since: 2.2
**/ **/
@ -975,10 +977,12 @@ gimp_flags_get_first_desc (GFlagsClass *flags_class,
* gimp_flags_get_first_value: * gimp_flags_get_first_value:
* @flags_type: the #GType of registered flags * @flags_type: the #GType of registered flags
* @value: an integer value * @value: an integer value
* @value_name: return location for the value's name (or %NULL) * @value_name: (optional): return location for the value's name (or %NULL)
* @value_nick: return location for the value's nick (or %NULL) * @value_nick: (optional): return location for the value's nick (or %NULL)
* @value_desc: return location for the value's translated description (or %NULL) * @value_desc: (optional): return location for the value's translated
* @value_help: return location for the value's translated help (or %NULL) * description (or %NULL)
* @value_help: (optional): return location for the value's translated help
* (or %NULL)
* *
* Checks if @value is valid for the flags registered as @flags_type. * Checks if @value is valid for the flags registered as @flags_type.
* If the value exists in that flags, its name, nick and its * If the value exists in that flags, its name, nick and its