gimp/tools/pdbgen/pdb/paths.pdb

723 lines
19 KiB
Plaintext
Raw Normal View History

# The GIMP -- an image manipulation program
# Copyright (C) 1995 Spencer Kimball and Peter Mattis
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# "Perlized" from C source by Andy Thomas <alt@gimp.org>
sub pdb_misc {
$author = $copyright = 'Andy Thomas';
$date = '1999';
}
# The defs
1999-03-28 06:36:11 +00:00
sub path_list {
$blurb = 'List the paths associated with the passed image.';
$help = <<'HELP';
1999-03-28 06:36:11 +00:00
List the paths associated with the passed image.
HELP
&pdb_misc;
@inargs = ( &std_image_arg );
$inargs[0]->{desc} = 'The ID of the image to list the paths from';
@outargs = (
{ name => 'path_list', type => 'stringarray',
desc => 'List of the paths belonging to this image.',
array => { name => 'num_paths',
desc => 'The number of paths returned.' },
init => 1 }
);
%invoke = (
code => 'path_list = gimp_container_get_name_array (gimage->vectors, &num_paths);'
);
}
1999-03-28 06:36:11 +00:00
sub path_get_points {
$blurb = 'List the points associated with the named path.';
$help = <<'HELP';
1999-03-28 06:36:11 +00:00
List the points associated with the named path.
HELP
&pdb_misc;
1999-03-28 06:36:11 +00:00
@inargs = (
&std_image_arg,
{ name => 'name', type => 'string',
desc => 'The name of the path whose points should be listed.' }
1999-03-28 06:36:11 +00:00
);
$inargs[0]->{desc} = 'The ID of the image to list the paths from.';
@outargs = (
{ name => 'path_type', type => 'int32', init => 1,
1999-03-28 06:36:11 +00:00
desc => 'The type of the path. Currently only one type (1 = Bezier)
is supported' },
{ name => 'path_closed', type => 'int32', init => 1,
desc => 'Return if the path is closed. (0 = path open, 1 = path
closed)' },
1999-03-28 06:36:11 +00:00
{ name => 'points_pairs', type => 'floatarray',
desc => 'The points in the path represented as 3 floats. The first is
the x pos, next is the y pos, last is the type of the pnt.
The type field is dependant on the path type. For beziers
(type 1 paths) the type can either be (1.0 = BEZIER_ANCHOR,
2.0 = BEZIER_CONTROL, 3.0 = BEZIER_MOVE). Note all points
are returned in pixel resolution.',
init => 1,
1999-03-28 06:36:11 +00:00
array => { name => 'num_path_point_details',
desc => 'The number of points returned. Each point is
made up of (x, y, pnt_type) of floats.',
alias => 'num_point_details', init => 1 } }
);
%invoke = (
vars => [ 'GimpVectors *vectors' ],
1999-03-28 06:36:11 +00:00
code => <<'CODE'
{
vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors)
1999-03-28 06:36:11 +00:00
{
GimpVectorsCompatPoint *points;
gint num_points;
path_type = 1; /* BEZIER (1.2 compat) */
points = gimp_vectors_compat_get_points (vectors, &num_points,
&path_closed);
num_point_details = num_points * 3;
if (points)
{
gdouble *curr_point;
gint i;
points_pairs = g_new0 (gdouble, num_point_details);
for (i = 0, curr_point = points_pairs;
i < num_points;
i++, curr_point += 3)
{
curr_point[0] = points[i].x;
curr_point[1] = points[i].y;
curr_point[2] = points[i].type;
}
g_free (points);
}
else
success = FALSE;
}
else
success = FALSE;
}
CODE
);
}
1999-03-28 06:36:11 +00:00
sub path_get_current {
$blurb = 'The name of the current path. Error if no paths.';
$help = <<'HELP';
The name of the current path. Error if no paths.
HELP
&pdb_misc;
@inargs = ( &std_image_arg );
$inargs[0]->{desc} = 'The ID of the image to get the current path from.';
@outargs = (
{ name => 'name', type => 'string',
desc => 'The name of the current path.',
init => 1 }
);
%invoke = (
vars => [ 'GimpVectors *vectors' ],
1999-03-28 06:36:11 +00:00
code => <<'CODE'
{
vectors = gimp_image_get_active_vectors (gimage);
if (vectors)
name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors)));
1999-03-28 06:36:11 +00:00
else
success = FALSE;
}
CODE
);
}
1999-03-28 06:36:11 +00:00
sub path_set_current {
$blurb = 'Sets the current path associated with the passed image.';
$help = <<'HELP';
Sets a named path as the current path.
HELP
&pdb_misc;
1999-03-28 06:36:11 +00:00
@inargs = (
&std_image_arg,
{ name => 'name', type => 'string',
desc => 'The name of the path to make current.' }
1999-03-28 06:36:11 +00:00
);
$inargs[0]->{desc} = 'The ID of the image in which a path will become current.';
%invoke = (
vars => [ 'GimpVectors *vectors' ],
code => <<'CODE'
{
vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors)
gimp_image_set_active_vectors (gimage, vectors);
else
success = FALSE;
}
CODE
);
}
1999-03-28 06:36:11 +00:00
sub path_set_points {
$blurb = 'Set the points associated with the named path.';
$help = <<'HELP';
1999-03-28 06:36:11 +00:00
Set the points associated with the named path.
HELP
&pdb_misc;
1999-03-28 06:36:11 +00:00
@inargs = (
&std_image_arg,
{ name => 'name', type => 'string',
desc => 'The name of the path to create. If it exists then a unique
name will be created - query the list of paths if you want
to make sure that the name of the path you create is
unique. This will be set as the current path.',
init => 1 },
1999-03-28 06:36:11 +00:00
{ name => 'ptype', type => 'int32',
desc => 'The type of the path. Currently only one type (1 = Bezier)
is supported.' },
{ name => 'points_pairs', type => 'floatarray',
1999-03-28 06:36:11 +00:00
desc => 'The points in the path represented as 3 floats. The first is
the x pos, next is the y pos, last is the type of the pnt.
The type field is dependant on the path type. For beziers
(type 1 paths) the type can either be (1.0 = BEZIER_ANCHOR,
2.0 = BEZIER_CONTROL, 3.0= BEZIER_MOVE). Note all points are
returned in pixel resolution.',
1999-03-28 06:36:11 +00:00
array => { name => 'num_path_points',
desc => 'The number of elements in the array, i.e. the number
of points in the path * 3. Each point is
made up of (x, y, type) of floats. Currently only
the creation of bezier curves is allowed. The type
1999-03-28 06:36:11 +00:00
parameter must be set to (1) to indicate a BEZIER
type curve. Note that for BEZIER curves, points
must be given in the following order: ACCACCAC...
If the path is not closed the last control
1999-03-28 06:36:11 +00:00
point is missed off. Points consist of three
control points (control/anchor/control) so for a
curve that is not closed there must be at least
two points passed (2 x,y pairs). If
(num_path_points/3) % 3 = 0 then the path is
assumed to be closed and the points are
ACCACCACCACC.',
init => 1 } }
);
$inargs[0]->{desc} = 'The ID of the image to set the paths in.';
%invoke = (
vars => [ 'gboolean closed = FALSE' ],
1999-03-28 06:36:11 +00:00
code => <<'CODE'
{
if ((num_path_points / 3) % 3 == 0)
closed = TRUE;
else if ((num_path_points / 3) % 3 != 2)
1999-03-28 06:36:11 +00:00
success = FALSE;
if (success)
{
GimpVectors *vectors;
gdouble *curr_point_pair;
GimpVectorsCompatPoint *points;
gint n_points;
gint i;
n_points = num_path_points / 3;
points = g_new0 (GimpVectorsCompatPoint, n_points);
for (i = 0, curr_point_pair = points_pairs;
i < n_points;
i++, curr_point_pair += 3)
{
points[i].x = curr_point_pair[0];
points[i].y = curr_point_pair[1];
points[i].type = curr_point_pair[2];
}
vectors = gimp_vectors_compat_new (gimage, name, points, n_points,
closed);
g_free (points);
if (vectors)
gimp_image_add_vectors (gimage, vectors, 0);
else
success = FALSE;
}
}
CODE
);
}
1999-03-28 06:36:11 +00:00
sub path_stroke_current {
$blurb = 'Stroke the current path in the passed image.';
$help = <<'HELP';
1999-03-28 06:36:11 +00:00
Stroke the current path in the passed image.
HELP
&pdb_misc;
@inargs = ( &std_image_arg );
1999-04-10 04:52:07 +00:00
$inargs[0]->{desc} = 'The ID of the image which contains the path to
stroke.';
%invoke = (
vars => [ 'GimpVectors *vectors', 'GimpDrawable *drawable' ],
1999-03-28 06:36:11 +00:00
code => <<'CODE'
{
vectors = gimp_image_get_active_vectors (gimage);
drawable = gimp_image_active_drawable (gimage);
1999-03-28 06:36:11 +00:00
if (vectors && drawable)
1999-03-28 06:36:11 +00:00
{
Get rid of the "current_context" which was in fact just a bunch of global 2004-04-15 Michael Natterer <mitch@gimp.org> Get rid of the "current_context" which was in fact just a bunch of global variables. Instead, pass the needed context all the way from the GUI and the PDB to the core. This is a prerequisite for macro recording and generally helps separating the various subsystems from each other. Work in progress... * app/core/gimp.[ch]: removed member "current_context" and gimp_[get|set]_current_context(). * app/core/gimp-edit.[ch] * app/core/gimpdrawable-blend.[ch] * app/core/gimpdrawable-bucket-fill.[ch] * app/core/gimpdrawable-offset.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-crop.[ch] * app/core/gimpimage-flip.[ch] * app/core/gimpimage-merge.[ch] * app/core/gimpimage-resize.[ch] * app/core/gimpimage-rotate.[ch] * app/core/gimpimage.[ch] * app/core/gimpimagefile.[ch] * app/core/gimpitem-linked.[ch] * app/core/gimpitem.[ch] * app/core/gimplayer.[ch] * app/core/gimpselection.[ch] * app/core/gimptemplate.[ch] * app/file/file-open.[ch] * app/file/file-save.[ch] * app/pdb/procedural_db.[ch] * app/text/gimptext-compat.[ch] * app/text/gimptextlayer-transform.[ch] * app/gui/brush-select.[ch] * app/gui/font-select.[ch] * app/gui/gradient-select.[ch] * app/gui/palette-select.[ch] * app/gui/pattern-select.[ch]: added tons of "GimpContext *context" parameters and use the passed context instead of gimp_get_current_context(). * app/app_procs.c * app/batch.c * app/core/gimpchannel.c * app/core/gimpdrawable.c * app/paint/gimperaser.c * app/paint/gimppaintbrush.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/text/gimptextlayer.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpcroptool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfliptool.c * app/tools/gimpinktool.c * app/tools/gimptransformtool.c * app/vectors/gimpvectors.c * app/gui/convert-dialog.c * app/gui/drawable-commands.c * app/gui/edit-commands.c * app/gui/file-commands.c * app/gui/file-new-dialog.c * app/gui/file-open-dialog.c * app/gui/file-save-dialog.c * app/gui/image-commands.c * app/gui/layers-commands.c * app/gui/offset-dialog.c * app/gui/select-commands.c * app/gui/vectors-commands.c * app/widgets/gimpdnd.c * app/widgets/gimpdocumentview.c * app/widgets/gimphelp.c * app/widgets/gimpthumbbox.c: pass gimp_get_user_context() or GIMP_CONTEXT(tool_options) or whatever is the right context to the changed core functions. * tools/pdbgen/app.pl: pass "GimpContext *context" to all generated PDB invokers. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/paint_tools.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/palettes.pdb * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/text_tool.pdb * tools/pdbgen/pdb/transform_tools.pdb: pass the new context parameter to the changed core functions. * app/pdb/*_cmds.c: regenerated.
2004-04-14 23:37:34 +00:00
GimpToolInfo *tool_info = gimp_context_get_tool (context);
success = gimp_item_stroke (GIMP_ITEM (vectors), drawable, context,
GIMP_OBJECT (tool_info->paint_info),
TRUE /* use defaults, not tool option values */);
}
1999-03-28 06:36:11 +00:00
else
success = FALSE;
}
CODE
);
}
sub path_get_point_at_dist {
1999-04-10 04:52:07 +00:00
$blurb = 'Get point on a path at a specified distance along the path.';
$help = <<'HELP';
This will return the x,y position of a point at a given distance along the
bezier curve. The distance will be obtained by first digitizing the
curve internally and then walking along the curve. For a closed curve the
start of the path is the first point on the path that was created. This might
not be obvious. Note the current path is used.
HELP
&pdb_misc;
1999-04-10 04:52:07 +00:00
@inargs = (
&std_image_arg,
{ name => 'distance', type => 'float',
desc => 'The distance along the path.' }
1999-04-10 04:52:07 +00:00
);
$inargs[0]->{desc} = 'The ID of the image the paths belongs to';
@outargs = (
1999-04-10 04:52:07 +00:00
{ name => 'x_point', type => 'int32',
desc => 'The x position of the point.', init => 1 },
1999-04-10 04:52:07 +00:00
{ name => 'y_point', type => 'int32',
desc => 'The y position of the point.', init => 1 },
1999-04-10 04:52:07 +00:00
{ name => 'gradient', type => 'float',
desc => 'The gradient at the specified point.', init => 1 }
);
%invoke = (
vars => [ 'GimpVectors *vectors', 'GimpStroke *stroke',
'gdouble distance_along', 'gdouble stroke_length',
'gdouble stroke_distance', 'GimpCoords position' ],
code => <<'CODE'
{
vectors = gimp_image_get_active_vectors (gimage);
1999-04-10 04:52:07 +00:00
if (vectors)
1999-04-10 04:52:07 +00:00
{
distance_along = 0.0;
stroke = gimp_vectors_stroke_get_next (vectors, NULL);
while (stroke != NULL )
{
stroke_length = gimp_stroke_get_length (stroke, 0.5);
if (distance_along + stroke_length < distance)
{
distance_along += stroke_length;
}
else
{
stroke_distance = distance - distance_along;
stroke_distance = stroke_distance < 0 ? 0: stroke_distance;
if (!gimp_stroke_get_point_at_dist (stroke, stroke_distance, 0.5,
&position, &gradient))
{
success = FALSE;
break;
}
else
{
success = TRUE;
x_point = ROUND (position.x);
y_point = ROUND (position.y);
break;
}
}
stroke = gimp_vectors_stroke_get_next (vectors, stroke);
}
1999-04-10 04:52:07 +00:00
}
else
{
success = FALSE;
}
}
CODE
);
}
sub path_get_tattoo {
1999-04-10 04:52:07 +00:00
$blurb = 'Returns the tattoo associated with the name path.';
$help = <<'HELP';
This procedure returns the tattoo associated with the specified path. A
tattoo is a unique and permanent identifier attached to a path that can
be used to uniquely identify a path within an image even between sessions.
HELP
&pdb_misc;
@inargs = (
&std_image_arg,
{ name => 'name', type => 'string',
desc => 'The name of the path whose tattoo should be obtained.' }
);
@outargs = (
1999-04-10 04:52:07 +00:00
{ name => 'tattoo', type => 'int32',
desc => 'The tattoo associated with the named path.', init => 1 }
);
%invoke = (
vars => [ 'GimpVectors *vectors' ],
code => <<'CODE'
{
vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors)
tattoo = gimp_item_get_tattoo (GIMP_ITEM (vectors));
1999-04-10 04:52:07 +00:00
else
success = FALSE;
}
CODE
);
}
sub path_set_tattoo {
$blurb = 'Sets the tattoo associated with the named path.';
$help = <<'HELP';
This procedure sets the tattoo associated with the specified path. A
tattoo is a unique and permenant identifier attached to a path that
can be used to uniquely identify a path within an image even between
sessions. Note that the value passed to this function must have been
obtained from a previous call to path_get_tattoo.
HELP
&pdb_misc;
@inargs = (
&std_image_arg,
{ name => 'name', type => 'string',
desc => 'the name of the path whose tattoo should be set' },
{ name => 'tattovalue', type => 'int32',
desc => "The tattoo associated with the name path. Only values
returned from 'path_get_tattoo' should be used here",
init => 1 }
);
%invoke = (
vars => [ 'GimpVectors *vectors' ],
code => <<'CODE'
{
vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors)
gimp_item_set_tattoo (GIMP_ITEM (vectors), tattovalue);
else
success = FALSE;
}
CODE
);
}
sub get_path_by_tattoo {
1999-04-10 04:52:07 +00:00
$blurb = 'Return the name of the path with the given tattoo.';
$help = <<'HELP';
The procedure returns the name of the path in the specified image
which has the passed tattoo. The tattoos are unique within the image
and will be preserved across sessions and through renaming of the path.
An error is returned if no path with the specified tattoo can be found.
HELP
&pdb_misc;
1999-04-10 04:52:07 +00:00
@inargs = (
&std_image_arg,
{ name => 'tattoo', type => 'int32',
desc => 'The tattoo of the required path.' }
);
@outargs = (
{ name => 'name', type => 'string', init => 1,
desc => 'The name of the path with the specified tattoo.' }
);
%invoke = (
vars => [ 'GimpVectors *vectors' ],
code => <<'CODE'
{
vectors = gimp_image_get_vectors_by_tattoo (gimage, tattoo);
if (vectors)
name = g_strdup (gimp_object_get_name (GIMP_OBJECT (vectors)));
else
success = FALSE;
}
CODE
);
}
sub path_delete {
$blurb = 'Delete the named path associated with the passed image.';
$help = <<'HELP';
Delete the named path.
HELP
&pdb_misc;
@inargs = (
&std_image_arg,
{ name => 'name', type => 'string',
desc => 'The name of the path to delete.' }
);
$inargs[0]->{desc} = 'The ID of the image to delete the path from.';
%invoke = (
vars => [ 'GimpVectors *vectors' ],
code => <<'CODE'
{
vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors)
gimp_image_remove_vectors (gimage, vectors);
else
success = FALSE;
}
CODE
);
}
sub path_get_locked {
$blurb = 'Returns the locked status associated with the named path.';
$help = <<'HELP';
This procedure returns the lock status associated with the specified
path. A path can be "locked" which means that the transformation
tool operations will also apply to the path.
HELP
&pdb_misc;
@inargs = (
&std_image_arg,
{ name => 'name', type => 'string',
desc => 'The name of the path whose locked status should be
obtained.' }
);
@outargs = (
{ name => 'lockstatus', type => 'int32',
desc => 'The lock status associated with the name path. 0 is
returned if the path is not locked. 1 is returned if the
path is locked.', init => 1 }
);
%invoke = (
vars => [ 'GimpVectors *vectors' ],
code => <<'CODE'
{
vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors)
lockstatus = gimp_item_get_linked (GIMP_ITEM (vectors));
else
success = FALSE;
}
CODE
);
}
sub path_set_locked {
$blurb = 'Set the locked status associated with the named path.';
$help = <<'HELP';
This procedure sets the lock status associated with the specified path. A
path can be "locked" which means that the transformation tool operations
will also apply to the path.
HELP
&pdb_misc;
@inargs = (
&std_image_arg,
{ name => 'name', type => 'string',
desc => 'the name of the path whose locked status should be set' },
{ name => 'lockstatus', type => 'int32',
desc => 'The lock status associated with the name path. 0 if the
path is not locked. 1 if the path is to be locked',
init => 1 }
);
%invoke = (
vars => [ 'GimpVectors *vectors' ],
code => <<'CODE'
{
vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors)
gimp_item_set_linked (GIMP_ITEM (vectors), lockstatus, TRUE);
else
success = FALSE;
}
CODE
);
}
sub path_to_selection {
$blurb = 'Transforms the active path into a selection';
$help = <<'HELP';
This procedure renders the desired path into the current selection.
HELP
$author = $copyright = 'Joao S. O. Bueno';
$date = '2003';
@inargs = (
&std_image_arg,
{ name => 'name', type => 'string',
desc => 'The name of the path which should be made into selection.' },
{ name => 'op', type => 'enum GimpChannelOps',
desc => 'The desired operation with current selection.' },
{ name => 'antialias', type => 'boolean',
desc => 'Antialias selection.' },
{ name => 'feather', type => 'boolean',
desc => 'Feather selection.' },
{ name => 'feather_radius_x', type => 'float',
desc => 'Feather radius x.' },
{ name => 'feather_radius_y', type => 'float',
desc => 'Feather radius y.' }
);
%invoke = (
vars => [ 'GimpVectors *vectors' ],
code => <<'CODE'
{
vectors = gimp_image_get_vectors_by_name (gimage, name);
if (vectors)
Treat changes to the selection like changes to any other drawable: 2003-10-06 Michael Natterer <mitch@gimp.org> Treat changes to the selection like changes to any other drawable: * app/core/gimpchannel.c * app/core/gimpchannel-combine.c: call gimp_drawable_update() after changing the channel. * app/core/gimpimage.[ch]: added struct GimpImageFlushAccumulator with one member "gboolean mask_changed". Connect to "update" of the selection and set accum.mask_changed to TRUE in the callback. Added default implementation for GimpImage::flush() and emit "mask_changed" there. Unrelated: * app/core/gimpimage.h: removed GimpGuide struct... * app/core/gimpimage-guides.h: ...and added it here. * app/core/gimpimage-undo-push.c (undo_pop_mask) (undo_pop_channel_mod): don't distinguish between selection and non-selection channels and just call gimp_drawable_update(). * app/core/gimpundo.h * app/core/gimpimage-undo.c: removed "gboolean mask_changed" from the GimpUndoAccumulator struct since we don't have to care about that signal explicitly any more. * app/display/gimpdisplay-foreach.[ch]: removed gimp_displays_flush(). * tools/pdbgen/pdb/display.pdb (displays_flush_invoker): call gimp_image_flush() on all images so the flush accumulator is honored. This generalization enables the removal of more special purpose code which was needed to treat the selection different: * app/core/gimpimage-mask-select.[ch]: removed... * app/core/gimpchannel-select.[ch]: ...and added under a new name because it's not selection specific any more. * app/core/gimpimage-mask.[ch]: removed... * app/core/gimpselection.[ch]: ...added the two remaining functions here. Removed all calls to gimp_image_mask_changed(). * app/core/Makefile.am * app/core/gimp-edit.c * app/core/gimpdrawable-transform.c * app/core/gimpimage-scale.c * app/core/gimpimage-snap.c * app/display/gimpdisplayshell.c * app/gui/channels-commands.c * app/gui/layers-commands.c * app/gui/select-commands.c * app/gui/vectors-commands.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpellipseselecttool.c * app/tools/gimpfreeselecttool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimpiscissorstool.c * app/tools/gimprectselecttool.c * app/tools/gimptransformtool.c * app/widgets/gimpchanneltreeview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpvectorstreeview.c * app/xcf/xcf-save.c * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/selection_tools.pdb: changed accordingly. * app/core/gimpdrawable-bucket-fill.c * app/core/gimpimage-colormap.c * app/core/gimplayer-floating-sel.c * app/core/gimplayer.c * app/gui/image-menu.c * app/paint/gimppaintcore.c * app/tools/gimpcroptool.c * app/tools/gimpinkoptions.c * app/tools/gimpvectortool.c: removed useless and/or obsolete #includes. * app/pdb/display_cmds.c * app/pdb/paths_cmds.c * app/pdb/selection_cmds.c * app/pdb/selection_tools_cmds.c: regenerated.
2003-10-06 12:17:11 +00:00
gimp_channel_select_vectors (gimp_image_get_mask (gimage),
_("Path to Selection"),
vectors,
op,
antialias,
feather,
feather_radius_x,
feather_radius_y);
else
success = FALSE;
}
CODE
);
}
sub path_import {
$blurb = 'Import paths from an SVG file.';
$help = <<'HELP';
This procedure imports paths from an SVG file. This is a temporary solution
until the new vectors PDB API is in place. Don't rely on this function
being available in future GIMP releases.
HELP
$author = $copyright = 'Sven Neumann';
$date = '2003';
@inargs = (
&std_image_arg,
{ name => 'filename', type => 'string', no_validate => 1,
desc => 'The name of the SVG file to import.' },
{ name => 'merge', type => 'boolean',
desc => 'Merge paths into a single vectors object.' },
{ name => 'scale', type => 'boolean',
desc => 'Scale the SVG to image dimensions.' }
);
%invoke = (
headers => [ qw("vectors/gimpvectors-import.h") ],
code => 'success = gimp_vectors_import_file (gimage, filename, merge, scale, -1, NULL);'
);
}
@headers = qw(<string.h> "core/gimp.h" "core/gimpcontext.h" "core/gimplist.h"
Treat changes to the selection like changes to any other drawable: 2003-10-06 Michael Natterer <mitch@gimp.org> Treat changes to the selection like changes to any other drawable: * app/core/gimpchannel.c * app/core/gimpchannel-combine.c: call gimp_drawable_update() after changing the channel. * app/core/gimpimage.[ch]: added struct GimpImageFlushAccumulator with one member "gboolean mask_changed". Connect to "update" of the selection and set accum.mask_changed to TRUE in the callback. Added default implementation for GimpImage::flush() and emit "mask_changed" there. Unrelated: * app/core/gimpimage.h: removed GimpGuide struct... * app/core/gimpimage-guides.h: ...and added it here. * app/core/gimpimage-undo-push.c (undo_pop_mask) (undo_pop_channel_mod): don't distinguish between selection and non-selection channels and just call gimp_drawable_update(). * app/core/gimpundo.h * app/core/gimpimage-undo.c: removed "gboolean mask_changed" from the GimpUndoAccumulator struct since we don't have to care about that signal explicitly any more. * app/display/gimpdisplay-foreach.[ch]: removed gimp_displays_flush(). * tools/pdbgen/pdb/display.pdb (displays_flush_invoker): call gimp_image_flush() on all images so the flush accumulator is honored. This generalization enables the removal of more special purpose code which was needed to treat the selection different: * app/core/gimpimage-mask-select.[ch]: removed... * app/core/gimpchannel-select.[ch]: ...and added under a new name because it's not selection specific any more. * app/core/gimpimage-mask.[ch]: removed... * app/core/gimpselection.[ch]: ...added the two remaining functions here. Removed all calls to gimp_image_mask_changed(). * app/core/Makefile.am * app/core/gimp-edit.c * app/core/gimpdrawable-transform.c * app/core/gimpimage-scale.c * app/core/gimpimage-snap.c * app/display/gimpdisplayshell.c * app/gui/channels-commands.c * app/gui/layers-commands.c * app/gui/select-commands.c * app/gui/vectors-commands.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpellipseselecttool.c * app/tools/gimpfreeselecttool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimpiscissorstool.c * app/tools/gimprectselecttool.c * app/tools/gimptransformtool.c * app/widgets/gimpchanneltreeview.c * app/widgets/gimpselectioneditor.c * app/widgets/gimpvectorstreeview.c * app/xcf/xcf-save.c * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/selection_tools.pdb: changed accordingly. * app/core/gimpdrawable-bucket-fill.c * app/core/gimpimage-colormap.c * app/core/gimplayer-floating-sel.c * app/core/gimplayer.c * app/gui/image-menu.c * app/paint/gimppaintcore.c * app/tools/gimpcroptool.c * app/tools/gimpinkoptions.c * app/tools/gimpvectortool.c: removed useless and/or obsolete #includes. * app/pdb/display_cmds.c * app/pdb/paths_cmds.c * app/pdb/selection_cmds.c * app/pdb/selection_tools_cmds.c: regenerated.
2003-10-06 12:17:11 +00:00
"core/gimptoolinfo.h" "core/gimpchannel-select.h"
"vectors/gimpanchor.h" "vectors/gimpbezierstroke.h"
"vectors/gimpvectors.h" "vectors/gimpvectors-compat.h"
"gimp-intl.h");
@procs = qw(path_list path_get_current path_set_current path_delete
path_get_points path_set_points
path_stroke_current path_get_point_at_dist
path_get_tattoo path_set_tattoo get_path_by_tattoo
path_get_locked path_set_locked path_to_selection
path_import);
%exports = (app => [@procs], lib => [@procs]);
1999-03-28 06:36:11 +00:00
$desc = 'Paths';
1;