Commit 522f0265 authored by Manish Singh's avatar Manish Singh
Browse files

Made appropriate changes to reflect Nick's previous change

* tools/pdbgen/pdb/gimage.pdb: Made appropriate changes to
reflect Nick's previous change

-Yosh
parent 76a994f1
Mon Jan 10 01:13:02 PST 2000 Manish Singh <yosh@gimp.org>
* tools/pdbgen/pdb/gimage.pdb: Made appropriate changes to
reflect Nick's previous change
Mon Jan 10 06:10:00 GMT 2000 Nick Lamb <njl195@zepler.org.uk> Mon Jan 10 06:10:00 GMT 2000 Nick Lamb <njl195@zepler.org.uk>
   
* app/gimage_cmds.c: Check resolution validity here too. * app/gimage_cmds.c: Check resolution validity here too.
......
...@@ -3323,24 +3323,28 @@ static Argument * ...@@ -3323,24 +3323,28 @@ static Argument *
image_set_resolution_invoker (Argument *args) image_set_resolution_invoker (Argument *args)
{ {
gboolean success = TRUE; gboolean success = TRUE;
gdouble xresolution, yresolution;
GimpImage *gimage; GimpImage *gimage;
gdouble xresolution;
gdouble yresolution;
gimage = pdb_id_to_image (args[0].value.pdb_int); gimage = pdb_id_to_image (args[0].value.pdb_int);
if (gimage == NULL) if (gimage == NULL)
success = FALSE; success = FALSE;
xresolution = args[1].value.pdb_float; xresolution = args[1].value.pdb_float;
yresolution = args[2].value.pdb_float; yresolution = args[2].value.pdb_float;
if (success)
{
if (xresolution < GIMP_MIN_RESOLUTION || xresolution > GIMP_MAX_RESOLUTION || if (xresolution < GIMP_MIN_RESOLUTION || xresolution > GIMP_MAX_RESOLUTION ||
yresolution < GIMP_MIN_RESOLUTION || yresolution > GIMP_MAX_RESOLUTION) yresolution < GIMP_MIN_RESOLUTION || yresolution > GIMP_MAX_RESOLUTION)
success = FALSE; success = FALSE;
else
if (success)
{ {
gimage->xresolution = args[1].value.pdb_float; gimage->xresolution = xresolution;
gimage->yresolution = args[2].value.pdb_float; gimage->yresolution = yresolution;
}
} }
return procedural_db_return_args (&image_set_resolution_proc, success); return procedural_db_return_args (&image_set_resolution_proc, success);
......
...@@ -1187,11 +1187,22 @@ HELP ...@@ -1187,11 +1187,22 @@ HELP
foreach $coord (qw(x y)) { foreach $coord (qw(x y)) {
my $arg = $inargs[$count]; my $arg = $inargs[$count];
$arg->{name} =~ s/res/"${coord}res"/e; $arg->{name} =~ s/res/"${coord}res"/e;
$arg->{alias} = "gimage->$arg->{name}";
$arg->{no_declare} = 1;
$arg->{desc} .= "in the $coord-axis, in dots per inch"; $arg->{desc} .= "in the $coord-axis, in dots per inch";
$count++; $count++;
} }
$invoke{code} = <<'CODE';
{
if (xresolution < GIMP_MIN_RESOLUTION || xresolution > GIMP_MAX_RESOLUTION ||
yresolution < GIMP_MIN_RESOLUTION || yresolution > GIMP_MAX_RESOLUTION)
success = FALSE;
else
{
gimage->xresolution = xresolution;
gimage->yresolution = yresolution;
}
}
CODE
CODE2 CODE2
my $unit_help = <<'HELP'; my $unit_help = <<'HELP';
...@@ -1323,7 +1334,7 @@ CODE ...@@ -1323,7 +1334,7 @@ CODE
); );
} }
@headers = qw(<string.h> "gimage.h"); @headers = qw(<string.h> "gimage.h" "libgimp/gimplimits.h");
$extra{app}->{code} = <<'CODE'; $extra{app}->{code} = <<'CODE';
/* Yuup, this is somewhat unsmooth, to say the least */ /* Yuup, this is somewhat unsmooth, to say the least */
......
...@@ -1187,11 +1187,22 @@ HELP ...@@ -1187,11 +1187,22 @@ HELP
foreach $coord (qw(x y)) { foreach $coord (qw(x y)) {
my $arg = $inargs[$count]; my $arg = $inargs[$count];
$arg->{name} =~ s/res/"${coord}res"/e; $arg->{name} =~ s/res/"${coord}res"/e;
$arg->{alias} = "gimage->$arg->{name}";
$arg->{no_declare} = 1;
$arg->{desc} .= "in the $coord-axis, in dots per inch"; $arg->{desc} .= "in the $coord-axis, in dots per inch";
$count++; $count++;
} }
$invoke{code} = <<'CODE';
{
if (xresolution < GIMP_MIN_RESOLUTION || xresolution > GIMP_MAX_RESOLUTION ||
yresolution < GIMP_MIN_RESOLUTION || yresolution > GIMP_MAX_RESOLUTION)
success = FALSE;
else
{
gimage->xresolution = xresolution;
gimage->yresolution = yresolution;
}
}
CODE
CODE2 CODE2
my $unit_help = <<'HELP'; my $unit_help = <<'HELP';
...@@ -1323,7 +1334,7 @@ CODE ...@@ -1323,7 +1334,7 @@ CODE
); );
} }
@headers = qw(<string.h> "gimage.h"); @headers = qw(<string.h> "gimage.h" "libgimp/gimplimits.h");
$extra{app}->{code} = <<'CODE'; $extra{app}->{code} = <<'CODE';
/* Yuup, this is somewhat unsmooth, to say the least */ /* Yuup, this is somewhat unsmooth, to say the least */
......
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