[gimp] pdb, libgimp*: add (out caller-allocates) to all GimpRGB* return values



commit c12c031f2d23fd5c08471ab9b8f08cbaab224ad3
Author: Michael Natterer <mitch gimp org>
Date:   Thu Aug 1 15:39:13 2019 +0200

    pdb, libgimp*: add (out caller-allocates) to all GimpRGB* return values

 libgimp/gimpchannel_pdb.c           |  2 +-
 libgimp/gimpcontext_pdb.c           |  4 ++--
 libgimp/gimpgradient_pdb.c          |  4 ++--
 libgimp/gimpimage_pdb.c             |  2 +-
 libgimp/gimpimagegrid_pdb.c         |  4 ++--
 libgimp/gimppalette_pdb.c           |  2 +-
 libgimp/gimptextlayer_pdb.c         |  2 +-
 libgimpcolor/gimpcolorspace.c       | 14 ++++++++------
 libgimpcolor/gimprgb.c              |  4 ++--
 libgimpconfig/gimpscanner.c         |  2 +-
 libgimpwidgets/gimpcolorarea.c      |  5 +++--
 libgimpwidgets/gimpcolorbutton.c    |  3 ++-
 libgimpwidgets/gimpcolorhexentry.c  |  2 +-
 libgimpwidgets/gimpcolorselection.c |  6 ++++--
 libgimpwidgets/gimpcolorselector.c  |  5 +++--
 pdb/lib.pl                          |  8 +++++++-
 16 files changed, 41 insertions(+), 28 deletions(-)
---
diff --git a/libgimp/gimpchannel_pdb.c b/libgimp/gimpchannel_pdb.c
index bd79075ade..1a4e8abb91 100644
--- a/libgimp/gimpchannel_pdb.c
+++ b/libgimp/gimpchannel_pdb.c
@@ -369,7 +369,7 @@ gimp_channel_set_opacity (gint32  channel_ID,
 /**
  * gimp_channel_get_color:
  * @channel_ID: The channel.
- * @color: (out): The channel compositing color.
+ * @color: (out caller-allocates): The channel compositing color.
  *
  * Get the compositing color of the specified channel.
  *
diff --git a/libgimp/gimpcontext_pdb.c b/libgimp/gimpcontext_pdb.c
index ef4bf9dafa..5cf949a740 100644
--- a/libgimp/gimpcontext_pdb.c
+++ b/libgimp/gimpcontext_pdb.c
@@ -322,7 +322,7 @@ gimp_context_set_stroke_method (GimpStrokeMethod stroke_method)
 
 /**
  * gimp_context_get_foreground:
- * @foreground: (out): The foreground color.
+ * @foreground: (out caller-allocates): The foreground color.
  *
  * Get the current GIMP foreground color.
  *
@@ -395,7 +395,7 @@ gimp_context_set_foreground (const GimpRGB *foreground)
 
 /**
  * gimp_context_get_background:
- * @background: (out): The background color.
+ * @background: (out caller-allocates): The background color.
  *
  * Get the current GIMP background color.
  *
diff --git a/libgimp/gimpgradient_pdb.c b/libgimp/gimpgradient_pdb.c
index d98bf58186..882a3d670e 100644
--- a/libgimp/gimpgradient_pdb.c
+++ b/libgimp/gimpgradient_pdb.c
@@ -377,7 +377,7 @@ gimp_gradient_get_custom_samples (const gchar    *name,
  * gimp_gradient_segment_get_left_color:
  * @name: The gradient name.
  * @segment: The index of the segment within the gradient.
- * @color: (out): The return color.
+ * @color: (out caller-allocates): The return color.
  * @opacity: (out): The opacity of the endpoint.
  *
  * Retrieves the left endpoint color of the specified segment
@@ -475,7 +475,7 @@ gimp_gradient_segment_set_left_color (const gchar   *name,
  * gimp_gradient_segment_get_right_color:
  * @name: The gradient name.
  * @segment: The index of the segment within the gradient.
- * @color: (out): The return color.
+ * @color: (out caller-allocates): The return color.
  * @opacity: (out): The opacity of the endpoint.
  *
  * Retrieves the right endpoint color of the specified segment
diff --git a/libgimp/gimpimage_pdb.c b/libgimp/gimpimage_pdb.c
index 88b1da18b4..a4a16d5100 100644
--- a/libgimp/gimpimage_pdb.c
+++ b/libgimp/gimpimage_pdb.c
@@ -738,7 +738,7 @@ gimp_image_floating_sel_attached_to (gint32 image_ID)
  * @sample_merged: Use the composite image, not the drawable.
  * @sample_average: Average the color of all the pixels in a specified radius.
  * @average_radius: The radius of pixels to average.
- * @color: (out): The return color.
+ * @color: (out caller-allocates): The return color.
  *
  * Determine the color at the given drawable coordinates
  *
diff --git a/libgimp/gimpimagegrid_pdb.c b/libgimp/gimpimagegrid_pdb.c
index d64c7384e4..ff0322edde 100644
--- a/libgimp/gimpimagegrid_pdb.c
+++ b/libgimp/gimpimagegrid_pdb.c
@@ -219,7 +219,7 @@ gimp_image_grid_set_offset (gint32  image_ID,
 /**
  * gimp_image_grid_get_foreground_color:
  * @image_ID: The image.
- * @fgcolor: (out): The image's grid foreground color.
+ * @fgcolor: (out caller-allocates): The image's grid foreground color.
  *
  * Sets the foreground color of an image's grid.
  *
@@ -296,7 +296,7 @@ gimp_image_grid_set_foreground_color (gint32         image_ID,
 /**
  * gimp_image_grid_get_background_color:
  * @image_ID: The image.
- * @bgcolor: (out): The image's grid background color.
+ * @bgcolor: (out caller-allocates): The image's grid background color.
  *
  * Sets the background color of an image's grid.
  *
diff --git a/libgimp/gimppalette_pdb.c b/libgimp/gimppalette_pdb.c
index 4af74f481a..7302378412 100644
--- a/libgimp/gimppalette_pdb.c
+++ b/libgimp/gimppalette_pdb.c
@@ -466,7 +466,7 @@ gimp_palette_delete_entry (const gchar *name,
  * gimp_palette_entry_get_color:
  * @name: The palette name.
  * @entry_num: The entry to retrieve.
- * @color: (out): The color requested.
+ * @color: (out caller-allocates): The color requested.
  *
  * Gets the specified palette entry from the specified palette.
  *
diff --git a/libgimp/gimptextlayer_pdb.c b/libgimp/gimptextlayer_pdb.c
index e05f1318b5..df195ae857 100644
--- a/libgimp/gimptextlayer_pdb.c
+++ b/libgimp/gimptextlayer_pdb.c
@@ -817,7 +817,7 @@ gimp_text_layer_set_justification (gint32                layer_ID,
 /**
  * gimp_text_layer_get_color:
  * @layer_ID: The text layer.
- * @color: (out): The color of the text.
+ * @color: (out caller-allocates): The color of the text.
  *
  * Get the color of the text in a text layer.
  *
diff --git a/libgimpcolor/gimpcolorspace.c b/libgimpcolor/gimpcolorspace.c
index f1a0e1b7d4..eec8b7bce6 100644
--- a/libgimpcolor/gimpcolorspace.c
+++ b/libgimpcolor/gimpcolorspace.c
@@ -53,7 +53,7 @@
 /**
  * gimp_rgb_to_hsv:
  * @rgb: A color value in the RGB colorspace
- * @hsv: The value converted to the HSV colorspace
+ * @hsv: (out caller-allocates): The value converted to the HSV colorspace
  *
  * Does a conversion from RGB to HSV (Hue, Saturation,
  * Value) colorspace.
@@ -106,7 +106,7 @@ gimp_rgb_to_hsv (const GimpRGB *rgb,
 /**
  * gimp_hsv_to_rgb:
  * @hsv: A color value in the HSV colorspace
- * @rgb: The returned RGB value.
+ * @rgb: (out caller-allocates): The returned RGB value.
  *
  * Converts a color value from HSV to RGB colorspace
  **/
@@ -185,7 +185,7 @@ gimp_hsv_to_rgb (const GimpHSV *hsv,
 /**
  * gimp_rgb_to_hsl:
  * @rgb: A color value in the RGB colorspace
- * @hsl: The value converted to HSL
+ * @hsl: (out caller-allocates): The value converted to HSL
  *
  * Convert an RGB color value to a HSL (Hue, Saturation, Lightness)
  * color value.
@@ -271,7 +271,8 @@ gimp_hsl_value (gdouble n1,
 /**
  * gimp_hsl_to_rgb:
  * @hsl: A color value in the HSL colorspace
- * @rgb: The value converted to a value in the RGB colorspace
+ * @rgb: (out caller-allocates): The value converted to a value
+ *       in the RGB colorspace
  *
  * Convert a HSL color value to an RGB color value.
  **/
@@ -314,7 +315,8 @@ gimp_hsl_to_rgb (const GimpHSL *hsl,
  * @rgb: A value in the RGB colorspace
  * @pullout: A scaling value (0-1) indicating how much black should be
  *           pulled out
- * @cmyk: The input value naively converted to the CMYK colorspace
+ * @cmyk: (out caller-allocates): The input value naively converted
+ *        to the CMYK colorspace
  *
  * Does a naive conversion from RGB to CMYK colorspace. A simple
  * formula that doesn't take any color-profiles into account is used.
@@ -363,7 +365,7 @@ gimp_rgb_to_cmyk (const GimpRGB  *rgb,
 /**
  * gimp_cmyk_to_rgb:
  * @cmyk: A color value in the CMYK colorspace
- * @rgb: The value converted to the RGB colorspace
+ * @rgb: (out caller-allocates): The value converted to the RGB colorspace
  *
  * Does a simple transformation from the CMYK colorspace to the RGB
  * colorspace, without taking color profiles into account.
diff --git a/libgimpcolor/gimprgb.c b/libgimpcolor/gimprgb.c
index 4ed7d0804c..2545959dbd 100644
--- a/libgimpcolor/gimprgb.c
+++ b/libgimpcolor/gimprgb.c
@@ -159,7 +159,7 @@ gimp_rgb_set_pixel (GimpRGB       *rgb,
  * gimp_rgb_get_pixel:
  * @rgb:    a #GimpRGB struct
  * @format: a Babl format
- * @pixel:  pointer to the destination pixel
+ * @pixel:  (out caller-allocates): pointer to the destination pixel
  *
  * Writes the red, green, blue and alpha components of @rgb to the
  * color stored in @pixel. The pixel format of @pixel is determined by
@@ -428,7 +428,7 @@ gimp_rgba_set_pixel (GimpRGB       *rgba,
  * gimp_rgba_get_pixel:
  * @rgba:   a #GimpRGB struct
  * @format: a Babl format
- * @pixel:  pointer to the destination pixel
+ * @pixel:  (out caller-allocates): pointer to the destination pixel
  *
  * Writes the red, green, blue and alpha components of @rgba to the
  * color stored in @pixel. The pixel format of @pixel is determined by
diff --git a/libgimpconfig/gimpscanner.c b/libgimpconfig/gimpscanner.c
index 08c15ecaab..36f05847cd 100644
--- a/libgimpconfig/gimpscanner.c
+++ b/libgimpconfig/gimpscanner.c
@@ -649,7 +649,7 @@ enum
  * gimp_scanner_parse_color:
  * @scanner: A #GScanner created by gimp_scanner_new_file() or
  *           gimp_scanner_new_string()
- * @dest: Pointer to a color to store the result
+ * @dest: (out caller-allocates): Pointer to a color to store the result
  *
  * Return value: %TRUE on success
  *
diff --git a/libgimpwidgets/gimpcolorarea.c b/libgimpwidgets/gimpcolorarea.c
index 030ef6e022..7ee12c72b6 100644
--- a/libgimpwidgets/gimpcolorarea.c
+++ b/libgimpwidgets/gimpcolorarea.c
@@ -554,8 +554,9 @@ gimp_color_area_set_color (GimpColorArea *area,
 
 /**
  * gimp_color_area_get_color:
- * @area: Pointer to a #GimpColorArea.
- * @color: Pointer to a #GimpRGB struct that is used to return the color.
+ * @area:  Pointer to a #GimpColorArea.
+ * @color: (out caller-allocates): Pointer to a #GimpRGB struct
+ *         that is used to return the color.
  *
  * Retrieves the current color of the @area.
  **/
diff --git a/libgimpwidgets/gimpcolorbutton.c b/libgimpwidgets/gimpcolorbutton.c
index 966fe9cc30..cd98af249b 100644
--- a/libgimpwidgets/gimpcolorbutton.c
+++ b/libgimpwidgets/gimpcolorbutton.c
@@ -725,7 +725,8 @@ gimp_color_button_set_color (GimpColorButton *button,
 /**
  * gimp_color_button_get_color:
  * @button: Pointer to a #GimpColorButton.
- * @color:  Pointer to a #GimpRGB struct used to return the color.
+ * @color:  (out caller-allocates): Pointer to a #GimpRGB struct
+ *          used to return the color.
  *
  * Retrieves the currently set color from the @button.
  **/
diff --git a/libgimpwidgets/gimpcolorhexentry.c b/libgimpwidgets/gimpcolorhexentry.c
index c4621d0e7c..bd8f3ab965 100644
--- a/libgimpwidgets/gimpcolorhexentry.c
+++ b/libgimpwidgets/gimpcolorhexentry.c
@@ -250,7 +250,7 @@ gimp_color_hex_entry_set_color (GimpColorHexEntry *entry,
 /**
  * gimp_color_hex_entry_get_color:
  * @entry: a #GimpColorHexEntry widget
- * @color: pointer to a #GimpRGB
+ * @color: (out caller-allocates): pointer to a #GimpRGB
  *
  * Retrieves the color value displayed by a #GimpColorHexEntry.
  *
diff --git a/libgimpwidgets/gimpcolorselection.c b/libgimpwidgets/gimpcolorselection.c
index b9d40359ba..43db69608a 100644
--- a/libgimpwidgets/gimpcolorselection.c
+++ b/libgimpwidgets/gimpcolorselection.c
@@ -471,7 +471,8 @@ gimp_color_selection_set_color (GimpColorSelection *selection,
 /**
  * gimp_color_selection_get_color:
  * @selection: A #GimpColorSelection widget.
- * @color:     (out): Return location for the @selection's current @color.
+ * @color:     (out caller-allocates): Return location for the
+ *             @selection's current @color.
  *
  * This function returns the #GimpColorSelection's current color.
  **/
@@ -509,7 +510,8 @@ gimp_color_selection_set_old_color (GimpColorSelection *selection,
 /**
  * gimp_color_selection_get_old_color:
  * @selection: A #GimpColorSelection widget.
- * @color:     (out): Return location for the @selection's old @color.
+ * @color:     (out caller-allocates): Return location for the
+ *             @selection's old @color.
  *
  * This function returns the #GimpColorSelection's old color.
  **/
diff --git a/libgimpwidgets/gimpcolorselector.c b/libgimpwidgets/gimpcolorselector.c
index d107c8d6f7..593d31c3bf 100644
--- a/libgimpwidgets/gimpcolorselector.c
+++ b/libgimpwidgets/gimpcolorselector.c
@@ -377,8 +377,9 @@ gimp_color_selector_set_color (GimpColorSelector *selector,
 /**
  * gimp_color_selector_get_color:
  * @selector: A #GimpColorSelector widget.
- * @rgb:      Return location for the color.
- * @hsv:      Return location for the same same color in HSV.
+ * @rgb:      (out caller-allocates): Return location for the color.
+ * @hsv:      (out caller-allocates): Return location for the same same
+ *            color in HSV.
  *
  * Retrieves the color shown in the @selector widget.
  *
diff --git a/pdb/lib.pl b/pdb/lib.pl
index ed2113a759..5c62d93b00 100644
--- a/pdb/lib.pl
+++ b/pdb/lib.pl
@@ -353,7 +353,13 @@ CODE
 
                    $argdesc .= " * \@$_->{libname}";
                    $argdesc .= '_ID' if $arg->{id};
-                   $argdesc .= ": (out)";
+
+                   if ($arg->{name} eq 'COLOR') {
+                       $argdesc .= ": (out caller-allocates)";
+                   }
+                   else {
+                       $argdesc .= ": (out)";
+                   }
 
                    if (exists $arg->{array}) {
                        $argdesc .= " (array length=@outargs[$argc - 2]->{name})";


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