diff --git a/ChangeLog b/ChangeLog index b3859be5c0..751989dd5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2003-07-29 Manish Singh + + * tools/pdbgen/app.pl: added a utf8 option for string input + parameters, and validate them. + + * tools/pdbgen/pdb/text_tool.pdb: make the text parameter use it. + Partially addresses #79897. Also remove references to XLFD in the + doc text. + + * app/pdb/text_tool_cmds.c: regenerated + + * configure.in: Really bump the version number + 2003-07-29 Dave Neary * plug-ins/common/edge.c: Added several new edge detection diff --git a/app/pdb/text_tool_cmds.c b/app/pdb/text_tool_cmds.c index 4da210eddd..4a63b6dbb6 100644 --- a/app/pdb/text_tool_cmds.c +++ b/app/pdb/text_tool_cmds.c @@ -81,7 +81,7 @@ text_fontname_invoker (Gimp *gimp, y = args[3].value.pdb_float; text = (gchar *) args[4].value.pdb_pointer; - if (text == NULL) + if (text == NULL && !g_utf8_validate (text, -1, NULL)) success = FALSE; border = args[5].value.pdb_int; @@ -172,7 +172,7 @@ static ProcArg text_fontname_inargs[] = { GIMP_PDB_STRING, "fontname", - "The fontname (conforming to the X Logical Font Description Conventions)" + "The name of the font" } }; @@ -218,7 +218,7 @@ text_get_extents_fontname_invoker (Gimp *gimp, gchar *real_fontname; text = (gchar *) args[0].value.pdb_pointer; - if (text == NULL) + if (text == NULL && !g_utf8_validate (text, -1, NULL)) success = FALSE; size = args[1].value.pdb_float; @@ -277,7 +277,7 @@ static ProcArg text_get_extents_fontname_inargs[] = { GIMP_PDB_STRING, "fontname", - "The fontname (conforming to the X Logical Font Description Conventions)" + "The name of the font" } }; @@ -358,7 +358,7 @@ text_invoker (Gimp *gimp, y = args[3].value.pdb_float; text = (gchar *) args[4].value.pdb_pointer; - if (text == NULL) + if (text == NULL && !g_utf8_validate (text, -1, NULL)) success = FALSE; border = args[5].value.pdb_int; @@ -477,42 +477,42 @@ static ProcArg text_inargs[] = { GIMP_PDB_STRING, "foundry", - "The font foundry, \"*\" for any" + "The font foundry" }, { GIMP_PDB_STRING, "family", - "The font family, \"*\" for any" + "The font family" }, { GIMP_PDB_STRING, "weight", - "The font weight, \"*\" for any" + "The font weight" }, { GIMP_PDB_STRING, "slant", - "The font slant, \"*\" for any" + "The font slant" }, { GIMP_PDB_STRING, "set_width", - "The font set-width, \"*\" for any" + "The font set-width" }, { GIMP_PDB_STRING, "spacing", - "The font spacing, \"*\" for any" + "The font spacing" }, { GIMP_PDB_STRING, "registry", - "The font registry, \"*\" for any" + "The font registry" }, { GIMP_PDB_STRING, "encoding", - "The font encoding, \"*\" for any" + "The font encoding" } }; @@ -566,7 +566,7 @@ text_get_extents_invoker (Gimp *gimp, gchar *real_fontname; text = (gchar *) args[0].value.pdb_pointer; - if (text == NULL) + if (text == NULL && !g_utf8_validate (text, -1, NULL)) success = FALSE; size = args[1].value.pdb_float; @@ -653,42 +653,42 @@ static ProcArg text_get_extents_inargs[] = { GIMP_PDB_STRING, "foundry", - "The font foundry, \"*\" for any" + "The font foundry" }, { GIMP_PDB_STRING, "family", - "The font family, \"*\" for any" + "The font family" }, { GIMP_PDB_STRING, "weight", - "The font weight, \"*\" for any" + "The font weight" }, { GIMP_PDB_STRING, "slant", - "The font slant, \"*\" for any" + "The font slant" }, { GIMP_PDB_STRING, "set_width", - "The font set-width, \"*\" for any" + "The font set-width" }, { GIMP_PDB_STRING, "spacing", - "The font spacing, \"*\" for any" + "The font spacing" }, { GIMP_PDB_STRING, "registry", - "The font registry, \"*\" for any" + "The font registry" }, { GIMP_PDB_STRING, "encoding", - "The font encoding, \"*\" for any" + "The font encoding" } }; diff --git a/configure.in b/configure.in index c7d4a17050..bd67765fa9 100644 --- a/configure.in +++ b/configure.in @@ -32,7 +32,7 @@ GIMPPRINT_REQUIRED_VERSION=4.2.0 # GIMP_MAJOR_VERSION=1 GIMP_MINOR_VERSION=3 -GIMP_MICRO_VERSION=17 +GIMP_MICRO_VERSION=18 GIMP_INTERFACE_AGE=0 GIMP_BINARY_AGE=0 GIMP_VERSION=$GIMP_MAJOR_VERSION.$GIMP_MINOR_VERSION.$GIMP_MICRO_VERSION diff --git a/tools/pdbgen/app.pl b/tools/pdbgen/app.pl index 3cb6602caf..31bdec2b2e 100644 --- a/tools/pdbgen/app.pl +++ b/tools/pdbgen/app.pl @@ -253,7 +253,23 @@ sub marshal_inargs { $result .= ' ? TRUE : FALSE' if $pdbtype eq 'boolean'; $result .= ";\n"; - if ($pdbtype eq 'string' || $pdbtype eq 'parasite') { + if ($pdbtype eq 'string') { + my ($reverse, $test); + + if ($_->{utf8}) { + $reverse = sub { ${$_[0]} =~ s/!//; + ${$_[0]} =~ s/==/!=/ }; + $test = "$var == NULL && " . + "!g_utf8_validate ($var, -1, NULL)" + } + else { + $reverse = sub { ${$_[0]} =~ s/==/!=/ }; + $test = "$var == NULL"; + } + + $result .= &make_arg_test($_, $reverse, $test); + } + elsif ($pdbtype eq 'parasite') { $result .= &make_arg_test($_, sub { ${$_[0]} =~ s/==/!=/ }, "$var == NULL"); } diff --git a/tools/pdbgen/pdb/text_tool.pdb b/tools/pdbgen/pdb/text_tool.pdb index 00f594b00e..3d860c6fe2 100644 --- a/tools/pdbgen/pdb/text_tool.pdb +++ b/tools/pdbgen/pdb/text_tool.pdb @@ -28,14 +28,14 @@ sub pdb_misc { sub text_arg () {{ name => 'text', type => 'string', - desc => 'The text to generate' + desc => 'The text to generate', + utf8 => 1 }} sub fontname_arg () {{ name => 'fontname', type => 'string', - desc => 'The fontname (conforming to the X Logical Font Description - Conventions)' + desc => 'The name of the font' }} sub size_args () {( @@ -68,7 +68,7 @@ sub font_prop_args { foreach (@props) { (my $desc = $_) =~ s/_/-/g; push @result, { name => $_, type => 'string', - desc => qq/The font $desc, "*" for any/ } + desc => qq/The font $desc/ } } @result; }