mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-02 09:01:13 +00:00
pdb: also allow none_ok on PDB type 'guide'.
This would be theoretically useful for gimp-image-find-next-guide except
that this function was already using the int type, and allowing 0. I'm
not changing to 'guide' type with none_ok because it would break the
libgimp API (the signature would change, with the type changing from
gint to guint).
Since it already works like this, I just leave a TODO for further
update.
With this and previous commit, we now fully replaced commit 69894d8bbf
attempts for allowing 0 to some types. There was in fact also some
change on 'tattoo' type, but I went through all the PDB functions we
had, one by one, and I don't think we currently have a single case where
we need to allow 0 as a tattoo value. If this need ever arises then we
can always add none_ok support easily in the future.
This commit is contained in:
parent
bf14d3db20
commit
80fe32dfc6
3 changed files with 5 additions and 3 deletions
|
@ -472,11 +472,12 @@ g_param_spec_uint ("$name",
|
|||
CODE
|
||||
}
|
||||
elsif ($pdbtype eq 'guide') {
|
||||
$min = exists $arg->{none_ok} ? 0 : 1,
|
||||
$pspec = <<CODE;
|
||||
g_param_spec_uint ("$name",
|
||||
"$nick",
|
||||
"$blurb",
|
||||
1, G_MAXUINT32, 1,
|
||||
$min, G_MAXUINT32, $min,
|
||||
$flags)
|
||||
CODE
|
||||
}
|
||||
|
|
|
@ -138,6 +138,7 @@ HELP
|
|||
@inargs = (
|
||||
{ name => 'image', type => 'image',
|
||||
desc => 'The image' },
|
||||
# TODO: this should be changed to type 'guide' with none_ok => 1 when we can break API.
|
||||
{ name => 'guide', type => '0 <= int32', default => 1, no_validate => 1,
|
||||
desc => 'The ID of the current guide (0 if first invocation)' }
|
||||
);
|
||||
|
|
|
@ -140,7 +140,7 @@ sub generate_fun {
|
|||
$annotate = " (array length=$retarg_len)";
|
||||
}
|
||||
|
||||
if (exists $retarg->{none_ok} && $type ne 'sample_point') {
|
||||
if (exists $retarg->{none_ok} && $type ne 'sample_point' && $type ne 'guide') {
|
||||
$annotate .= " (nullable)";
|
||||
}
|
||||
|
||||
|
@ -294,7 +294,7 @@ sub generate_fun {
|
|||
$n_annotations++;
|
||||
}
|
||||
|
||||
if (exists $_->{none_ok} && $type ne 'sample_point') {
|
||||
if (exists $_->{none_ok} && $type ne 'sample_point' && $type ne 'guide') {
|
||||
$argdesc .= " (nullable)";
|
||||
$n_annotations++;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue