libgimp, pdb: annotate arguments with none_ok as (nullable).

Same for returned value though it seems we have no function with none_ok
as return value. At least we have the rule in the generation script for
when this will happen.
This commit is contained in:
Jehan 2019-08-24 23:02:35 +02:00
parent 74143024a8
commit ac1c0ae3ce
4 changed files with 20 additions and 14 deletions

View File

@ -1438,7 +1438,7 @@ _gimp_image_floating_sel_attached_to (gint32 image_ID)
/**
* gimp_image_pick_color:
* @image: The image.
* @drawable: The drawable to pick from.
* @drawable: (nullable): The drawable to pick from.
* @x: x coordinate of upper-left corner of rectangle.
* @y: y coordinate of upper-left corner of rectangle.
* @sample_merged: Use the composite image, not the drawable.
@ -1509,7 +1509,7 @@ gimp_image_pick_color (GimpImage *image,
/**
* _gimp_image_pick_color: (skip)
* @image_ID: The image.
* @drawable_ID: The drawable to pick from.
* @drawable_ID: (nullable): The drawable to pick from.
* @x: x coordinate of upper-left corner of rectangle.
* @y: y coordinate of upper-left corner of rectangle.
* @sample_merged: Use the composite image, not the drawable.
@ -1679,7 +1679,7 @@ _gimp_image_pick_correlate_layer (gint32 image_ID,
* gimp_image_insert_layer:
* @image: The image.
* @layer: The layer.
* @parent: The parent layer.
* @parent: (nullable): The parent layer.
* @position: The layer position.
*
* Add the specified layer to the image.
@ -1736,7 +1736,7 @@ gimp_image_insert_layer (GimpImage *image,
* _gimp_image_insert_layer: (skip)
* @image_ID: The image.
* @layer_ID: The layer.
* @parent_ID: The parent layer.
* @parent_ID: (nullable): The parent layer.
* @position: The layer position.
*
* Add the specified layer to the image.
@ -2063,7 +2063,7 @@ _gimp_image_thaw_layers (gint32 image_ID)
* gimp_image_insert_channel:
* @image: The image.
* @channel: The channel.
* @parent: The parent channel.
* @parent: (nullable): The parent channel.
* @position: The channel position.
*
* Add the specified channel to the image.
@ -2115,7 +2115,7 @@ gimp_image_insert_channel (GimpImage *image,
* _gimp_image_insert_channel: (skip)
* @image_ID: The image.
* @channel_ID: The channel.
* @parent_ID: The parent channel.
* @parent_ID: (nullable): The parent channel.
* @position: The channel position.
*
* Add the specified channel to the image.
@ -2433,7 +2433,7 @@ _gimp_image_thaw_channels (gint32 image_ID)
* gimp_image_insert_vectors:
* @image: The image.
* @vectors: The vectors.
* @parent: The parent vectors.
* @parent: (nullable): The parent vectors.
* @position: The vectors position.
*
* Add the specified vectors to the image.
@ -2485,7 +2485,7 @@ gimp_image_insert_vectors (GimpImage *image,
* _gimp_image_insert_vectors: (skip)
* @image_ID: The image.
* @vectors_ID: The vectors.
* @parent_ID: The parent vectors.
* @parent_ID: (nullable): The parent vectors.
* @position: The vectors position.
*
* Add the specified vectors to the image.
@ -3255,7 +3255,7 @@ _gimp_image_lower_item_to_bottom (gint32 image_ID,
* gimp_image_reorder_item:
* @image: The image.
* @item: The item to reorder.
* @parent: The new parent item.
* @parent: (nullable): The new parent item.
* @position: The new position of the item.
*
* Reorder the specified item within its item tree
@ -3304,7 +3304,7 @@ gimp_image_reorder_item (GimpImage *image,
* _gimp_image_reorder_item: (skip)
* @image_ID: The image.
* @item_ID: The item to reorder.
* @parent_ID: The new parent item.
* @parent_ID: (nullable): The new parent item.
* @position: The new position of the item.
*
* Reorder the specified item within its item tree

View File

@ -37,7 +37,7 @@
/**
* _gimp_progress_init:
* @message: Message to use in the progress dialog.
* @gdisplay: GimpDisplay to update progressbar in, or -1 for a separate window.
* @gdisplay: (nullable): GimpDisplay to update progressbar in, or -1 for a separate window.
*
* Initializes the progress bar for the current plug-in.
*

View File

@ -37,7 +37,7 @@
/**
* gimp_text_fontname:
* @image: The image.
* @drawable: The affected drawable: (-1 for a new text layer).
* @drawable: (nullable): The affected drawable: (-1 for a new text layer).
* @x: The x coordinate for the left of the text bounding box.
* @y: The y coordinate for the top of the text bounding box.
* @text: The text to generate (in UTF-8 encoding).
@ -116,7 +116,7 @@ gimp_text_fontname (GimpImage *image,
/**
* _gimp_text_fontname: (skip)
* @image_ID: The image.
* @drawable_ID: The affected drawable: (-1 for a new text layer).
* @drawable_ID: (nullable): The affected drawable: (-1 for a new text layer).
* @x: The x coordinate for the left of the text bounding box.
* @y: The y coordinate for the top of the text bounding box.
* @text: The text to generate (in UTF-8 encoding).

View File

@ -152,6 +152,9 @@ sub generate_fun {
if (exists $argtype->{array}) {
$annotate = " (array length=$retarg->{array}->{name})";
}
if (exists $retarg->{none_ok}) {
$annotate .= " (nullable)";
}
if ($api_deprecated) {
if (exists $argtype->{out_annotate_d}) {
@ -276,8 +279,11 @@ sub generate_fun {
if (exists $arg->{in_annotate}) {
$argdesc .= " $arg->{in_annotate}";
}
if (exists $_->{none_ok}) {
$argdesc .= " (nullable)";
}
if (exists $arg->{array} || exists $arg->{in_annotate}) {
if (exists $arg->{array} || exists $_->{none_ok} || exists $arg->{in_annotate}) {
$argdesc .= ":";
}