renamed GimpParamSpecString's flag "no_validate" to "allow_non_utf8".

2007-04-26  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpparamspecs.[ch]: renamed GimpParamSpecString's
	flag "no_validate" to "allow_non_utf8".

	* tools/pdbgen/app.pl
	* tools/pdbgen/pdb/*.pdb: renamed argument flag
	"no_validate" (which turns off utf8-validation for strings) to
	"allow_non_utf8" and renamed "no_success" (which turns off
	argument validation alltogether) to "no_validate".
	Doesn't affect generated code.


svn path=/trunk/; revision=22350
This commit is contained in:
Michael Natterer 2007-04-26 19:10:23 +00:00 committed by Michael Natterer
parent 37a3f95d16
commit ff8ba7ea78
17 changed files with 91 additions and 79 deletions

View File

@ -1,3 +1,15 @@
2007-04-26 Michael Natterer <mitch@gimp.org>
* app/core/gimpparamspecs.[ch]: renamed GimpParamSpecString's
flag "no_validate" to "allow_non_utf8".
* tools/pdbgen/app.pl
* tools/pdbgen/pdb/*.pdb: renamed argument flag
"no_validate" (which turns off utf8-validation for strings) to
"allow_non_utf8" and renamed "no_success" (which turns off
argument validation alltogether) to "no_validate".
Doesn't affect generated code.
2007-04-26 Michael Natterer <mitch@gimp.org>
* tools/pdbgen/pdb/display.pdb (diplay_is_valid)

View File

@ -349,9 +349,9 @@ gimp_param_string_init (GParamSpec *pspec)
{
GimpParamSpecString *sspec = GIMP_PARAM_SPEC_STRING (pspec);
sspec->no_validate = FALSE;
sspec->null_ok = FALSE;
sspec->non_empty = FALSE;
sspec->allow_non_utf8 = FALSE;
sspec->null_ok = FALSE;
sspec->non_empty = FALSE;
}
static gboolean
@ -380,7 +380,7 @@ gimp_param_string_validate (GParamSpec *pspec,
return TRUE;
}
if (! sspec->no_validate &&
if (! sspec->allow_non_utf8 &&
! g_utf8_validate (string, -1, (const gchar **) &s))
{
if (value->data[1].v_uint & G_VALUE_NOCOPY_CONTENTS)
@ -417,7 +417,7 @@ GParamSpec *
gimp_param_spec_string (const gchar *name,
const gchar *nick,
const gchar *blurb,
gboolean no_validate,
gboolean allow_non_utf8,
gboolean null_ok,
gboolean non_empty,
const gchar *default_value,
@ -435,9 +435,9 @@ gimp_param_spec_string (const gchar *name,
g_free (G_PARAM_SPEC_STRING (sspec)->default_value);
G_PARAM_SPEC_STRING (sspec)->default_value = g_strdup (default_value);
sspec->no_validate = no_validate ? TRUE : FALSE;
sspec->null_ok = null_ok ? TRUE : FALSE;
sspec->non_empty = non_empty ? TRUE : FALSE;
sspec->allow_non_utf8 = allow_non_utf8 ? TRUE : FALSE;
sspec->null_ok = null_ok ? TRUE : FALSE;
sspec->non_empty = non_empty ? TRUE : FALSE;
}
return G_PARAM_SPEC (sspec);

View File

@ -151,9 +151,9 @@ struct _GimpParamSpecString
{
GParamSpecString parent_instance;
guint no_validate : 1;
guint null_ok : 1;
guint non_empty : 1;
guint allow_non_utf8 : 1;
guint null_ok : 1;
guint non_empty : 1;
};
GType gimp_param_string_get_type (void) G_GNUC_CONST;
@ -161,7 +161,7 @@ GType gimp_param_string_get_type (void) G_GNUC_CONST;
GParamSpec * gimp_param_spec_string (const gchar *name,
const gchar *nick,
const gchar *blurb,
gboolean no_validate,
gboolean allow_non_utf8,
gboolean null_ok,
gboolean non_empty,
const gchar *default_value,

View File

@ -117,7 +117,7 @@ sub marshal_inargs {
$argc++;
if (!exists $_->{no_success}) {
if (!exists $_->{no_validate}) {
$success = 1;
}
}
@ -197,7 +197,7 @@ sub generate_pspec {
$nick =~ s/-/ /g;
if (exists $arg->{no_success}) {
if (exists $arg->{no_validate}) {
$flags .= ' | GIMP_PARAM_NO_VALIDATE';
}
@ -358,7 +358,7 @@ g_param_spec_boolean ("$name",
CODE
}
elsif ($pdbtype eq 'string') {
$no_validate = exists $arg->{no_validate} ? 'TRUE' : 'FALSE';
$allow_non_utf8 = exists $arg->{allow_non_utf8} ? 'TRUE' : 'FALSE';
$null_ok = exists $arg->{null_ok} ? 'TRUE' : 'FALSE';
$non_empty = exists $arg->{non_empty} ? 'TRUE' : 'FALSE';
$default = exists $arg->{default} ? $arg->{default} : NULL;
@ -366,7 +366,7 @@ CODE
gimp_param_spec_string ("$name",
"$nick",
"$blurb",
$no_validate, $null_ok, $non_empty,
$allow_non_utf8, $null_ok, $non_empty,
$default,
$flags)
CODE

View File

@ -28,7 +28,7 @@ HELP
&neo_pdb_misc('2007', '2.4');
@inargs = (
{ name => 'display', type => 'display', no_success => 1,
{ name => 'display', type => 'display', no_validate => 1,
desc => 'The display to check' }
);

View File

@ -28,7 +28,7 @@ HELP
&neo_pdb_misc('2007', '2.4');
@inargs = (
{ name => 'drawable', type => 'drawable', no_success => 1,
{ name => 'drawable', type => 'drawable', no_validate => 1,
desc => 'The drawable to check' }
);
@ -876,9 +876,8 @@ HELP
@outargs = (
{ name => 'pixel', type => 'int8array',
desc => 'The pixel value',
array => { name => 'num_channels', type => 'int32',
desc => 'The number of channels for the pixel',
no_success => 1 } }
array => { name => 'num_channels', type => 'int32', no_validate => 1,
desc => 'The number of channels for the pixel' } }
);
%invoke = (
@ -936,9 +935,8 @@ HELP
desc => 'The y coordinate' },
{ name => 'pixel', type => 'int8array',
desc => 'The pixel value',
array => { name => 'num_channels', type => 'int32',
desc => 'The number of channels for the pixel',
no_success => 1 } }
array => { name => 'num_channels', type => 'int32', no_validate => 1,
desc => 'The number of channels for the pixel' } }
);
%invoke = (

View File

@ -704,9 +704,9 @@ HELP
desc => 'Use the reverse gradient' },
{ name => 'supersample', type => 'boolean',
desc => 'Do adaptive supersampling' },
{ name => 'max_depth', type => '1 <= int32 <= 9', no_success => 1,
{ name => 'max_depth', type => '1 <= int32 <= 9', no_validate => 1,
desc => 'Maximum recursion levels for supersampling' },
{ name => 'threshold', type => '0 <= float <= 4', no_success => 1,
{ name => 'threshold', type => '0 <= float <= 4', no_validate => 1,
desc => 'Supersampling threshold' },
{ name => 'dither', type => 'boolean',
desc => 'Use dithering to reduce banding' },

View File

@ -36,9 +36,9 @@ HELP
{ name => 'run_mode',
type => 'enum GimpRunMode (no GIMP_RUN_WITH_LAST_VALS)',
desc => 'The run mode' },
{ name => 'filename', type => 'string', no_validate => 1,
{ name => 'filename', type => 'string', allow_non_utf8 => 1,
desc => 'The name of the file to load' },
{ name => 'raw_filename', type => 'string', no_validate => 1,
{ name => 'raw_filename', type => 'string', allow_non_utf8 => 1,
desc => 'The name as entered by the user' }
);
@ -115,7 +115,7 @@ HELP
desc => 'The run mode' },
{ name => 'image', type => 'image',
desc => 'Destination image' },
{ name => 'filename', type => 'string', no_validate => 1,
{ name => 'filename', type => 'string', allow_non_utf8 => 1,
desc => 'The name of the file to load' }
);
@ -170,7 +170,7 @@ HELP
desc => 'The run mode' },
{ name => 'image', type => 'image',
desc => 'Destination image' },
{ name => 'filename', type => 'string', no_validate => 1,
{ name => 'filename', type => 'string', allow_non_utf8 => 1,
desc => 'The name of the file to load' }
);
@ -242,9 +242,9 @@ HELP
desc => 'Input image' },
{ name => 'drawable', type => 'drawable',
desc => 'Drawable to save' },
{ name => 'filename', type => 'string', no_validate => 1,
{ name => 'filename', type => 'string', allow_non_utf8 => 1,
desc => 'The name of the file to save the image in' },
{ name => 'raw_filename', type => 'string', no_validate => 1,
{ name => 'raw_filename', type => 'string', allow_non_utf8 => 1,
desc => 'The name as entered by the user' }
);
@ -315,7 +315,7 @@ HELP
$date = '1999-2003';
@inargs = (
{ name => 'filename', type => 'string', no_validate => 1,
{ name => 'filename', type => 'string', allow_non_utf8 => 1,
desc => 'The name of the file that owns the thumbnail to load' }
);
@ -369,7 +369,7 @@ HELP
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' },
{ name => 'filename', type => 'string', no_validate => 1,
{ name => 'filename', type => 'string', allow_non_utf8 => 1,
desc => 'The name of the file the thumbnail belongs to' },
);
@ -392,7 +392,7 @@ HELP
&josh_pdb_misc('1997');
@inargs = (
{ name => 'extension', type => 'string', no_validate => 1,
{ name => 'extension', type => 'string', allow_non_utf8 => 1,
desc => 'The extension the file will have' }
);
@ -423,13 +423,13 @@ HELP
@inargs = (
{ name => 'procedure_name', type => 'string', non_empty => 1,
desc => 'The name of the procedure to be used for loading' },
{ name => 'extensions', type => 'string', no_success => 1,
{ name => 'extensions', type => 'string', no_validate => 1,
desc => 'comma separated list of extensions this handler
can load (i.e. "jpg,jpeg")' },
{ name => 'prefixes', type => 'string', no_success => 1,
{ name => 'prefixes', type => 'string', no_validate => 1,
desc => 'comma separated list of prefixes this handler
can load (i.e. "http:,ftp:")' },
{ name => 'magics', type => 'string', no_success => 1,
{ name => 'magics', type => 'string', no_validate => 1,
desc => 'comma separated list of magic file information
this handler can load (i.e. "0,string,GIF")' }
);
@ -462,10 +462,10 @@ HELP
@inargs = (
{ name => 'procedure_name', type => 'string', non_empty => 1,
desc => 'The name of the procedure to be used for loading' },
{ name => 'extensions', type => 'string', no_success => 1,
{ name => 'extensions', type => 'string', no_validate => 1,
desc => 'comma separated list of extensions this handler
can load (i.e. "jpg,jpeg")' },
{ name => 'prefixes', type => 'string', no_success => 1,
{ name => 'prefixes', type => 'string', no_validate => 1,
desc => 'comma separated list of prefixes this handler
can load (i.e. "http:,ftp:")' }
);
@ -499,10 +499,10 @@ HELP
@inargs = (
{ name => 'procedure_name', type => 'string', non_empty => 1,
desc => 'The name of the procedure to be used for saving' },
{ name => 'extensions', type => 'string', no_success => 1,
{ name => 'extensions', type => 'string', no_validate => 1,
desc => 'comma separated list of extensions this handler
can save (i.e. "jpg,jpeg")' },
{ name => 'prefixes', type => 'string', no_success => 1,
{ name => 'prefixes', type => 'string', no_validate => 1,
desc => 'comma separated list of prefixes this handler
can save (i.e. "http:,ftp:")' }
);

View File

@ -31,7 +31,7 @@ sub gradients_popup {
desc => 'Title of the gradient selection dialog' },
{ name => 'initial_gradient', type => 'string', null_ok => 1,
desc => 'The name of the gradient to set as the first selected' },
{ name => 'sample_size', type => '1 <= int32 <= 10000', no_success => 1,
{ name => 'sample_size', type => '1 <= int32 <= 10000', no_validate => 1,
desc => 'Size of the sample to return when the gradient is changed' }
);

View File

@ -181,8 +181,8 @@ sub gradients_get_gradient_data {
{ name => 'name', type => 'string', null_ok => 1,
desc => 'The gradient name ("" means current active gradient)' },
{ name => 'sample_size', type => '1 <= int32 <= 10000',
desc => 'Size of the sample to return when the gradient is changed',
no_success => 1 },
no_validate => 1,
desc => 'Size of the sample to return when the gradient is changed' },
{ name => 'reverse', type => 'boolean',
desc => 'Use the reverse gradient' }
);

View File

@ -143,7 +143,7 @@ HELP
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' },
{ name => 'guide', type => 'guide', no_success => 1,
{ name => 'guide', type => 'guide', no_validate => 1,
desc => 'The ID of the current guide (0 if first invocation)' }
);

View File

@ -28,7 +28,7 @@ HELP
&neo_pdb_misc('2007', '2.4');
@inargs = (
{ name => 'image', type => 'image', no_success => 1,
{ name => 'image', type => 'image', no_validate => 1,
desc => 'The image to check' }
);
@ -598,7 +598,7 @@ HELP
{ name => 'sample_average', type => 'boolean',
desc => 'Average the color of all the pixels in a specified
radius' },
{ name => 'average_radius', type => '0 < float', no_success => 1,
{ name => 'average_radius', type => '0 < float', no_validate => 1,
desc => 'The radius of pixels to average' }
);
@ -2110,7 +2110,7 @@ HELP
{ name => 'image', type => 'image',
desc => 'The image' },
{ name => 'filename', type => 'string',
desc => 'The new image filename', no_validate => 1 }
desc => 'The new image filename', allow_non_utf8 => 1 }
);
%invoke = (

View File

@ -573,7 +573,7 @@ sub path_import {
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' },
{ name => 'filename', type => 'string', no_validate => 1,
{ name => 'filename', type => 'string', allow_non_utf8 => 1,
desc => 'The name of the SVG file to import.' },
{ name => 'merge', type => 'boolean',
desc => 'Merge paths into a single vectors object.' },

View File

@ -24,7 +24,7 @@ sub plugins_query {
&andy_pdb_misc('1998');
@inargs = (
{ name => 'search_string', type => 'string', no_success => 1,
{ name => 'search_string', type => 'string', no_validate => 1,
desc => 'If not an empty string then use this as a search pattern' }
);
@ -91,7 +91,7 @@ HELP
@inargs = (
{ name => 'domain_name', type => 'string',
desc => 'The name of the textdomain (must be unique)' },
{ name => 'domain_path', type => 'string', no_success => 1,
{ name => 'domain_path', type => 'string', no_validate => 1,
desc => 'The absolute path to the compiled message catalog (may be
NULL)' }
);

View File

@ -58,7 +58,8 @@ HELP
$copyright = $author . ' & Peter Mattis';
@inargs = (
{ name => 'filename', type => 'string', no_validate => 1, non_empty => 1,
{ name => 'filename', type => 'string', allow_non_utf8 => 1,
non_empty => 1,
desc => 'The dump filename' }
);
@ -93,19 +94,19 @@ HELP
&std_pdb_misc;
@inargs = (
{ name => 'name', type => 'string', no_validate => 1,
{ name => 'name', type => 'string', allow_non_utf8 => 1,
desc => 'The regex for procedure name' },
{ name => 'blurb', type => 'string', no_validate => 1,
{ name => 'blurb', type => 'string', allow_non_utf8 => 1,
desc => 'The regex for procedure blurb' },
{ name => 'help', type => 'string', no_validate => 1,
{ name => 'help', type => 'string', allow_non_utf8 => 1,
desc => 'The regex for procedure help' },
{ name => 'author', type => 'string', no_validate => 1,
{ name => 'author', type => 'string', allow_non_utf8 => 1,
desc => 'The regex for procedure author' },
{ name => 'copyright', type => 'string', no_validate => 1,
{ name => 'copyright', type => 'string', allow_non_utf8 => 1,
desc => 'The regex for procedure copyright' },
{ name => 'date', type => 'string', no_validate => 1,
{ name => 'date', type => 'string', allow_non_utf8 => 1,
desc => 'The regex for procedure date' },
{ name => 'proc_type', type => 'string', no_validate => 1,
{ name => 'proc_type', type => 'string', allow_non_utf8 => 1,
desc => 'The regex for procedure type: { \'Internal GIMP procedure\',
\'GIMP Plug-In\', \'GIMP Extension\',
\'Temporary Procedure\' }' }

View File

@ -167,21 +167,21 @@ sub text {
desc => 'The size of text in either pixels or points' },
{ name => 'size_type', type => 'enum GimpSizeType',
desc => 'The units of specified size' },
{ name => 'foundry', type => 'string', no_validate => 1,
{ name => 'foundry', type => 'string', allow_non_utf8 => 1,
desc => 'The font foundry' },
{ name => 'family', type => 'string', no_validate => 1,
{ name => 'family', type => 'string', allow_non_utf8 => 1,
desc => 'The font family' },
{ name => 'weight', type => 'string', no_validate => 1,
{ name => 'weight', type => 'string', allow_non_utf8 => 1,
desc => 'The font weight' },
{ name => 'slant', type => 'string', no_validate => 1,
{ name => 'slant', type => 'string', allow_non_utf8 => 1,
desc => 'The font slant' },
{ name => 'set_width', type => 'string', no_validate => 1,
{ name => 'set_width', type => 'string', allow_non_utf8 => 1,
desc => 'The font set-width' },
{ name => 'spacing', type => 'string', no_validate => 1,
{ name => 'spacing', type => 'string', allow_non_utf8 => 1,
desc => 'The font spacing' },
{ name => 'registry', type => 'string', no_validate => 1,
{ name => 'registry', type => 'string', allow_non_utf8 => 1,
desc => 'The font registry' },
{ name => 'encoding', type => 'string', no_validate => 1,
{ name => 'encoding', type => 'string', allow_non_utf8 => 1,
desc => 'The font encoding' }
);
@ -221,21 +221,21 @@ sub text_get_extents {
desc => 'The size of text in either pixels or points' },
{ name => 'size_type', type => 'enum GimpSizeType',
desc => 'The units of specified size' },
{ name => 'foundry', type => 'string', no_validate => 1,
{ name => 'foundry', type => 'string', allow_non_utf8 => 1,
desc => 'The font foundry' },
{ name => 'family', type => 'string', no_validate => 1,
{ name => 'family', type => 'string', allow_non_utf8 => 1,
desc => 'The font family' },
{ name => 'weight', type => 'string', no_validate => 1,
{ name => 'weight', type => 'string', allow_non_utf8 => 1,
desc => 'The font weight' },
{ name => 'slant', type => 'string', no_validate => 1,
{ name => 'slant', type => 'string', allow_non_utf8 => 1,
desc => 'The font slant' },
{ name => 'set_width', type => 'string', no_validate => 1,
{ name => 'set_width', type => 'string', allow_non_utf8 => 1,
desc => 'The font set-width' },
{ name => 'spacing', type => 'string', no_validate => 1,
{ name => 'spacing', type => 'string', allow_non_utf8 => 1,
desc => 'The font spacing' },
{ name => 'registry', type => 'string', no_validate => 1,
{ name => 'registry', type => 'string', allow_non_utf8 => 1,
desc => 'The font registry' },
{ name => 'encoding', type => 'string', no_validate => 1,
{ name => 'encoding', type => 'string', allow_non_utf8 => 1,
desc => 'The font encoding' }
);

View File

@ -26,7 +26,7 @@ HELP
&neo_pdb_misc('2007', '2.4');
@inargs = (
{ name => 'vectors', type => 'vectors', no_success => 1,
{ name => 'vectors', type => 'vectors', no_validate => 1,
desc => 'The vectors object to check' }
);
@ -1166,7 +1166,8 @@ HELP
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' },
{ name => 'filename', type => 'string', no_validate => 1, non_empty => 1,
{ name => 'filename', type => 'string', allow_non_utf8 => 1,
non_empty => 1,
desc => 'The name of the SVG file to import.' },
{ name => 'merge', type => 'boolean',
desc => 'Merge paths into a single vectors object.' },
@ -1226,7 +1227,7 @@ HELP
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' },
{ name => 'string', type => 'string', no_validate => 1,
{ name => 'string', type => 'string', allow_non_utf8 => 1,
desc => 'A string that must be a complete and valid SVG document.' },
{ name => 'length', type => 'int32',
desc => 'Number of bytes in string or -1 if the string is NULL