Commit 933be6a8 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

allow the use of constants when specifying limits for a PDB type.

2007-07-05  Sven Neumann  <sven@gimp.org>

	* tools/pdbgen/pdb.pl (arg_parse): allow the use of constants when
	specifying limits for a PDB type.

	* tools/pdbgen/pdb/channel.pdb
	* tools/pdbgen/pdb/image.pdb
	* tools/pdbgen/pdb/layer.pdb: use GIMP_MAX_IMAGE_SIZE as limit for
	image and drawable sizes.

	* tools/pdbgen/pdb/selection_tools.pdb: added missing include.

	* app/pdb/channel_cmds.c
	* app/pdb/image_cmds.c
	* app/pdb/layer_cmds.c
	* app/pdb/selection_tools_cmds.c: regenerated.

svn path=/trunk/; revision=22870
parent a2c401b0
2007-07-05 Sven Neumann <sven@gimp.org>
* tools/pdbgen/pdb.pl (arg_parse): allow the use of constants when
specifying limits for a PDB type.
* tools/pdbgen/pdb/channel.pdb
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/layer.pdb: use GIMP_MAX_IMAGE_SIZE as limit for
image and drawable sizes.
* tools/pdbgen/pdb/selection_tools.pdb: added missing include.
* app/pdb/channel_cmds.c
* app/pdb/image_cmds.c
* app/pdb/layer_cmds.c
* app/pdb/selection_tools_cmds.c: regenerated.
2007-07-05 Sven Neumann <sven@gimp.org>
* app/tools/gimpdrawtool.c (gimp_draw_tool_draw_corner): changed
......@@ -23,6 +23,7 @@
#include <glib-object.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpcolor/gimpcolor.h"
#include "pdb-types.h"
......@@ -358,13 +359,13 @@ register_channel_procs (GimpPDB *pdb)
gimp_param_spec_int32 ("width",
"width",
"The channel width",
1, G_MAXINT32, 1,
1, GIMP_MAX_IMAGE_SIZE, 1,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("height",
"height",
"The channel height",
1, G_MAXINT32, 1,
1, GIMP_MAX_IMAGE_SIZE, 1,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_string ("name",
......
......@@ -2331,13 +2331,13 @@ register_image_procs (GimpPDB *pdb)
gimp_param_spec_int32 ("width",
"width",
"The width of the image",
1, G_MAXINT32, 1,
1, GIMP_MAX_IMAGE_SIZE, 1,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("height",
"height",
"The height of the image",
1, G_MAXINT32, 1,
1, GIMP_MAX_IMAGE_SIZE, 1,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_enum ("type",
......@@ -2535,13 +2535,13 @@ register_image_procs (GimpPDB *pdb)
gimp_param_spec_int32 ("new-width",
"new width",
"New image width",
1, G_MAXINT32, 1,
1, GIMP_MAX_IMAGE_SIZE, 1,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("new-height",
"new height",
"New image height",
1, G_MAXINT32, 1,
1, GIMP_MAX_IMAGE_SIZE, 1,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("offx",
......@@ -2603,13 +2603,13 @@ register_image_procs (GimpPDB *pdb)
gimp_param_spec_int32 ("new-width",
"new width",
"New image width",
1, G_MAXINT32, 1,
1, GIMP_MAX_IMAGE_SIZE, 1,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("new-height",
"new height",
"New image height",
1, G_MAXINT32, 1,
1, GIMP_MAX_IMAGE_SIZE, 1,
GIMP_PARAM_READWRITE));
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
......@@ -2637,13 +2637,13 @@ register_image_procs (GimpPDB *pdb)
gimp_param_spec_int32 ("new-width",
"new width",
"New image width: (0 < new_width <= width)",
1, G_MAXINT32, 1,
1, GIMP_MAX_IMAGE_SIZE, 1,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("new-height",
"new height",
"New image height: (0 < new_height <= height)",
1, G_MAXINT32, 1,
1, GIMP_MAX_IMAGE_SIZE, 1,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("offx",
......
......@@ -23,6 +23,8 @@
#include <glib-object.h>
#include "libgimpbase/gimpbase.h"
#include "pdb-types.h"
#include "gimppdb.h"
#include "gimpprocedure.h"
......@@ -855,13 +857,13 @@ register_layer_procs (GimpPDB *pdb)
gimp_param_spec_int32 ("width",
"width",
"The layer width",
1, G_MAXINT32, 1,
1, GIMP_MAX_IMAGE_SIZE, 1,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("height",
"height",
"The layer height",
1, G_MAXINT32, 1,
1, GIMP_MAX_IMAGE_SIZE, 1,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_enum ("type",
......@@ -1012,13 +1014,13 @@ register_layer_procs (GimpPDB *pdb)
gimp_param_spec_int32 ("new-width",
"new width",
"New layer width",
1, G_MAXINT32, 1,
1, GIMP_MAX_IMAGE_SIZE, 1,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("new-height",
"new height",
"New layer height",
1, G_MAXINT32, 1,
1, GIMP_MAX_IMAGE_SIZE, 1,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_boolean ("local-origin",
......@@ -1052,13 +1054,13 @@ register_layer_procs (GimpPDB *pdb)
gimp_param_spec_int32 ("new-width",
"new width",
"New layer width",
1, G_MAXINT32, 1,
1, GIMP_MAX_IMAGE_SIZE, 1,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("new-height",
"new height",
"New layer height",
1, G_MAXINT32, 1,
1, GIMP_MAX_IMAGE_SIZE, 1,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_int32 ("offx",
......
......@@ -23,6 +23,7 @@
#include <glib-object.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpcolor/gimpcolor.h"
#include "pdb-types.h"
......@@ -978,13 +979,13 @@ register_selection_tools_procs (GimpPDB *pdb)
g_param_spec_double ("corner-radius-x",
"corner radius x",
"The corner radius in X direction",
0, G_MAXDOUBLE, 0,
0, GIMP_MAX_IMAGE_SIZE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("corner-radius-y",
"corner radius y",
"The corner radius in Y direction",
0, G_MAXDOUBLE, 0,
0, GIMP_MAX_IMAGE_SIZE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_enum ("operation",
......
......@@ -240,9 +240,9 @@ sub arg_parse {
push @retvals, $1 if $1;
return @retvals;
}
elsif ($arg =~ /^(?:([+-.\d][^\s]*) \s* (<=|<))?
elsif ($arg =~ /^(?:([+-.\dA-Z_][^\s]*) \s* (<=|<))?
\s* (\w+) \s*
(?:(<=|<) \s* ([+-.\d][^\s]*))?
(?:(<=|<) \s* ([+-.\dA-Z_][^\s]*))?
/x) {
return ($3, $1, $2 ? $premap{$2} : $2, $5, $4 ? $postmap{$4} : $4);
}
......
......@@ -34,9 +34,9 @@ HELP
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image to which to add the channel' },
{ name => 'width', type => '1 <= int32',
{ name => 'width', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
desc => 'The channel width' },
{ name => 'height', type => '1 <= int32',
{ name => 'height', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
desc => 'The channel height' },
{ name => 'name', type => 'string',
desc => 'The channel name' },
......@@ -342,6 +342,8 @@ CODE
}
@headers = qw("libgimpbase/gimpbase.h");
@procs = qw(channel_new channel_new_from_component channel_copy
channel_combine_masks
channel_get_show_masked channel_set_show_masked
......
......@@ -97,9 +97,9 @@ HELP
&std_pdb_misc;
@inargs = (
{ name => 'width', type => '1 <= int32',
{ name => 'width', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
desc => 'The width of the image' },
{ name => 'height', type => '1 <= int32',
{ name => 'height', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
desc => 'The height of the image' },
{ name => 'type', type => 'enum GimpImageBaseType',
desc => 'The type of image' }
......@@ -204,9 +204,9 @@ HELP
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' },
{ name => 'new_width', type => '1 <= int32',
{ name => 'new_width', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
desc => 'New image width' },
{ name => 'new_height', type => '1 <= int32',
{ name => 'new_height', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
desc => 'New image height' },
{ name => 'offx', type => 'int32',
desc => 'x offset between upper left corner of old and
......@@ -272,9 +272,9 @@ HELP
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' },
{ name => 'new_width', type => '1 <= int32',
{ name => 'new_width', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
desc => 'New image width' },
{ name => 'new_height', type => '1 <= int32',
{ name => 'new_height', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
desc => 'New image height' }
);
......@@ -306,9 +306,9 @@ HELP
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image' },
{ name => 'new_width', type => '1 <= int32',
{ name => 'new_width', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
desc => 'New image width: (0 < new_width <= width)' },
{ name => 'new_height', type => '1 <= int32',
{ name => 'new_height', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
desc => 'New image height: (0 < new_height <= height)' },
{ name => 'offx', type => '0 <= int32',
desc => 'x offset: (0 <= offx <= (width - new_width))' },
......
......@@ -33,9 +33,9 @@ HELP
@inargs = (
{ name => 'image', type => 'image',
desc => 'The image to which to add the layer' },
{ name => 'width', type => '1 <= int32',
{ name => 'width', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
desc => 'The layer width' },
{ name => 'height', type => '1 <= int32',
{ name => 'height', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
desc => 'The layer height' },
{ name => 'type', type => 'enum GimpImageType',
desc => 'The layer type' },
......@@ -233,9 +233,9 @@ HELP
@inargs = (
{ name => 'layer', type => 'layer',
desc => 'The layer' },
{ name => 'new_width', type => '1 <= int32',
{ name => 'new_width', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
desc => 'New layer width' },
{ name => 'new_height', type => '1 <= int32',
{ name => 'new_height', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
desc => 'New layer height' },
{ name => 'local_origin', type => 'boolean',
desc => 'Use a local origin (as opposed to the image origin)' }
......@@ -270,9 +270,9 @@ HELP
@inargs = (
{ name => 'layer', type => 'layer',
desc => 'The layer' },
{ name => 'new_width', type => '1 <= int32',
{ name => 'new_width', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
desc => 'New layer width' },
{ name => 'new_height', type => '1 <= int32',
{ name => 'new_height', type => '1 <= int32 <= GIMP_MAX_IMAGE_SIZE',
desc => 'New layer height' },
{ name => 'offx', type => 'int32',
desc => 'x offset between upper left corner of old and
......@@ -914,7 +914,8 @@ CODE
}
@headers = qw("config/gimpcoreconfig.h"
@headers = qw("libgimpbase/gimpbase.h"
"config/gimpcoreconfig.h"
"core/gimp.h"
"core/gimpimage-undo.h"
"core/gimpitem-linked.h"
......
......@@ -528,7 +528,9 @@ CODE
}
@headers = qw("core/gimpchannel-select.h" "gimp-intl.h");
@headers = qw("libgimpbase/gimpbase.h"
"core/gimpchannel-select.h"
"gimp-intl.h");
@procs = qw(by_color_select by_color_select_full
ellipse_select
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment