diff --git a/app/pdb/image-sample-points-cmds.c b/app/pdb/image-sample-points-cmds.c index 1a17fafbca..be57dc069e 100644 --- a/app/pdb/image-sample-points-cmds.c +++ b/app/pdb/image-sample-points-cmds.c @@ -298,13 +298,13 @@ register_image_sample_points_procs (GimpPDB *pdb) g_param_spec_uint ("sample-point", "sample point", "The ID of the current sample point (0 if first invocation)", - 1, G_MAXUINT32, 1, + 0, G_MAXUINT32, 0, GIMP_PARAM_READWRITE | GIMP_PARAM_NO_VALIDATE)); gimp_procedure_add_return_value (procedure, g_param_spec_uint ("next-sample-point", "next sample point", "The next sample point's ID", - 1, G_MAXUINT32, 1, + 0, G_MAXUINT32, 0, GIMP_PARAM_READWRITE)); gimp_pdb_register_procedure (pdb, procedure); g_object_unref (procedure); diff --git a/pdb/app.pl b/pdb/app.pl index fec21aadae..4acca8daa9 100644 --- a/pdb/app.pl +++ b/pdb/app.pl @@ -481,11 +481,12 @@ g_param_spec_uint ("$name", CODE } elsif ($pdbtype eq 'sample_point') { + $min = exists $arg->{none_ok} ? 0 : 1, $pspec = < 'image', type => 'image', desc => 'The image' }, - { name => 'sample_point', type => 'sample_point', no_validate => 1, + { name => 'sample_point', type => 'sample_point', no_validate => 1, none_ok => 1, desc => 'The ID of the current sample point (0 if first invocation)' } ); @outargs = ( - { name => 'next_sample_point', type => 'sample_point', + { name => 'next_sample_point', type => 'sample_point', none_ok => 1, desc => "The next sample point's ID" } ); diff --git a/pdb/lib.pl b/pdb/lib.pl index 272d2f2c59..438539f4f4 100644 --- a/pdb/lib.pl +++ b/pdb/lib.pl @@ -139,7 +139,8 @@ sub generate_fun { $retarg_len = $retarg->{array}->{name}; $annotate = " (array length=$retarg_len)"; } - if (exists $retarg->{none_ok}) { + + if (exists $retarg->{none_ok} && $type ne 'sample_point') { $annotate .= " (nullable)"; } @@ -199,6 +200,7 @@ sub generate_fun { my $desc = exists $_->{desc} ? $_->{desc} : ""; my $var_len; my $value; + my $n_annotations = 0; if (exists $_->{nopdb}) { $argc--; @@ -284,16 +286,20 @@ sub generate_fun { if (exists $arg->{array}) { $argdesc .= " (array length=$var_len)"; + $n_annotations++; } if (exists $arg->{in_annotate}) { $argdesc .= " $arg->{in_annotate}"; - } - if (exists $_->{none_ok}) { - $argdesc .= " (nullable)"; + $n_annotations++; } - if (exists $arg->{array} || exists $_->{none_ok} || exists $arg->{in_annotate}) { + if (exists $_->{none_ok} && $type ne 'sample_point') { + $argdesc .= " (nullable)"; + $n_annotations++; + } + + if ($n_annotations > 0) { $argdesc .= ":"; }