[gimp] gir: Add some missing (array length) annotations



commit 52a146604b64229330802c222621331d5eb8ff7a
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Sun May 3 18:11:29 2020 +0200

    gir: Add some missing (array length) annotations
    
    This will make sure that bindings can generate a more "native" API so
    they don't have to pass the length explicitly.

 libgimpbase/gimpmetadata.c   |  8 ++++----
 libgimpbase/gimputils.c      |  2 +-
 libgimpcolor/gimprgb-parse.c | 12 ++++++------
 libgimpconfig/gimpscanner.c  |  6 +++---
 4 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/libgimpbase/gimpmetadata.c b/libgimpbase/gimpmetadata.c
index d2f376ac97..06089527ab 100644
--- a/libgimpbase/gimpmetadata.c
+++ b/libgimpbase/gimpmetadata.c
@@ -979,7 +979,7 @@ gimp_metadata_save_to_file (GimpMetadata  *metadata,
 /**
  * gimp_metadata_set_from_exif:
  * @metadata:         A #GimpMetadata instance.
- * @exif_data:        The blob of Exif data to set
+ * @exif_data: (array length=exif_data_length): The blob of Exif data to set
  * @exif_data_length: Length of @exif_data, in bytes
  * @error:            Return location for error message
  *
@@ -1053,7 +1053,7 @@ gimp_metadata_set_from_exif (GimpMetadata  *metadata,
 /**
  * gimp_metadata_set_from_iptc:
  * @metadata:        A #GimpMetadata instance.
- * @iptc_data:       The blob of Ipc data to set
+ * @iptc_data: (array length=iptc_data_length): The blob of Iptc data to set
  * @iptc_data_length:Length of @iptc_data, in bytes
  * @error:           Return location for error message
  *
@@ -1101,8 +1101,8 @@ gimp_metadata_set_from_iptc (GimpMetadata  *metadata,
 /**
  * gimp_metadata_set_from_xmp:
  * @metadata:        A #GimpMetadata instance.
- * @xmp_data:        The blob of Exif data to set
- * @xmp_data_length: Length of @exif_data, in bytes
+ * @xmp_data: (array length=xmp_data_length): The blob of XMP data to set
+ * @xmp_data_length: Length of @xmp_data, in bytes
  * @error:           Return location for error message
  *
  * Sets the tags from a piece of XMP data on @metadata.
diff --git a/libgimpbase/gimputils.c b/libgimpbase/gimputils.c
index 52da9e63b6..dd46e18610 100644
--- a/libgimpbase/gimputils.c
+++ b/libgimpbase/gimputils.c
@@ -152,7 +152,7 @@ gimp_utf8_strtrim (const gchar *str,
 
 /**
  * gimp_any_to_utf8:
- * @str:            The string to be converted to UTF-8.
+ * @str: (array length=len): The string to be converted to UTF-8.
  * @len:            The length of the string, or -1 if the string
  *                  is nul-terminated.
  * @warning_format: The message format for the warning message if conversion
diff --git a/libgimpcolor/gimprgb-parse.c b/libgimpcolor/gimprgb-parse.c
index 38807daab7..8e50b99ce6 100644
--- a/libgimpcolor/gimprgb-parse.c
+++ b/libgimpcolor/gimprgb-parse.c
@@ -213,7 +213,7 @@ static const ColorEntry named_colors[] =
 /**
  * gimp_rgb_parse_name:
  * @rgb:  a #GimpRGB struct used to return the parsed color
- * @name: a color name (in UTF-8 encoding)
+ * @name: (array length=len): a color name (in UTF-8 encoding)
  * @len:  the length of @name, in bytes. or -1 if @name is nul-terminated
  *
  * Attempts to parse a color name. This function accepts <ulink
@@ -250,7 +250,7 @@ gimp_rgb_parse_name (GimpRGB     *rgb,
 /**
  * gimp_rgb_parse_hex:
  * @rgb: a #GimpRGB struct used to return the parsed color
- * @hex: a string describing a color in hexadecimal notation
+ * @hex: (array length=len): a string describing a color in hexadecimal notation
  * @len: the length of @hex, in bytes. or -1 if @hex is nul-terminated
  *
  * Attempts to parse a string describing an RGB color in hexadecimal
@@ -286,8 +286,8 @@ gimp_rgb_parse_hex (GimpRGB     *rgb,
 /**
  * gimp_rgb_parse_css:
  * @rgb: a #GimpRGB struct used to return the parsed color
- * @css: a string describing a color in CSS notation
- * @len: the length of @hex, in bytes. or -1 if @hex is nul-terminated
+ * @css: (array length=len): a string describing a color in CSS notation
+ * @len: the length of @css, in bytes. or -1 if @css is nul-terminated
  *
  * Attempts to parse a string describing an RGB color in CSS
  * notation. This can be either a numerical representation
@@ -326,8 +326,8 @@ gimp_rgb_parse_css (GimpRGB     *rgb,
 /**
  * gimp_rgba_parse_css:
  * @rgba: a #GimpRGB struct used to return the parsed color
- * @css: a string describing a color in CSS notation
- * @len: the length of @hex, in bytes. or -1 if @hex is nul-terminated
+ * @css: (array length=len): a string describing a color in CSS notation
+ * @len: the length of @css, in bytes. or -1 if @css is nul-terminated
  *
  * Similar to gimp_rgb_parse_css() but handles RGB colors with alpha
  * channel in the numerical CSS notation (<code>rgba(255,0,0,255)</code>
diff --git a/libgimpconfig/gimpscanner.c b/libgimpconfig/gimpscanner.c
index 888dd5b55a..3a620b2bec 100644
--- a/libgimpconfig/gimpscanner.c
+++ b/libgimpconfig/gimpscanner.c
@@ -228,9 +228,9 @@ gimp_scanner_new_stream (GInputStream  *input,
 
 /**
  * gimp_scanner_new_string:
- * @text:
- * @text_len:
- * @error:
+ * @text: (array length=text_len):
+ * @text_len: The length of @text, or -1 if NULL-terminated
+ * @error: return location for #GError, or %NULL
  *
  * Returns: (transfer full): The new #GimpScanner.
  *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]