gimp/app/pdb/transform-tools-cmds.c

911 lines
41 KiB
C
Raw Normal View History

/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995-2003 Spencer Kimball and Peter Mattis
2001-11-20 02:54:13 +08:00
*
* This program is free software: you can redistribute it and/or modify
2001-11-20 02:54:13 +08:00
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
2001-11-20 02:54:13 +08:00
* (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, see <http://www.gnu.org/licenses/>.
2001-11-20 02:54:13 +08:00
*/
/* NOTE: This file is auto-generated by pdbgen.pl. */
2001-11-20 02:54:13 +08:00
#include "config.h"
#include <gegl.h>
2001-11-20 02:54:13 +08:00
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpmath/gimpmath.h"
#include "libgimpbase/gimpbase.h"
2001-11-20 02:54:13 +08:00
#include "pdb-types.h"
Finally landed the new GimpConfig based gimprc parser. It's not finished 2002-11-18 Sven Neumann <sven@gimp.org> Finally landed the new GimpConfig based gimprc parser. It's not finished yet but we need to start somewhere. This release removes the old gimprc.[ch] files. The gimprc format changes slightly, but the changes are minimal. The Preferences dialog is temporarily disabled since it still needs to be ported. If you are are afraid, stay away from CVS for a few days ;-) * app/Makefile.am * app/gimprc.[ch]: removed the old gimprc system. * app/base/Makefile.am * app/base/base-config.[ch]: removed these files in favor of config/gimpbaseconfig.[ch]. * app/core/Makefile.am * app/core/gimpcoreconfig.[ch]: removed these files in favor of config/gimpcoreconfig.[ch]. * app/config/Makefile.am * app/config/config-types.h: moved typedefs into this new file. * app/config/gimpbaseconfig.[ch] * app/config/gimpcoreconfig.[ch] * app/config/gimpdisplayconfig.[ch] * app/config/gimpguiconfig.[ch] * app/config/gimprc.[ch] * app/config/test-config.c: brought into shape for real use. * app/base/base-types.h: include config/config-types.h here. Added a global GimpBaseConfig *base_config variable to ease migration. * app/gui/Makefile.am: temporarily disabled the preferences dialog. * app/app_procs.c * app/undo.c * app/undo_history.c * app/base/base.[ch] * app/base/gimphistogram.c * app/base/pixel-processor.c * app/base/temp-buf.c * app/base/tile-cache.c * app/core/core-types.h * app/core/gimp-documents.c * app/core/gimp.c * app/core/gimpbrush.c * app/core/gimpbrushgenerated.c * app/core/gimpcontext.c * app/core/gimpdrawable-transform.c * app/core/gimpimage-new.c * app/core/gimpimage.c * app/core/gimpimagefile.c * app/core/gimpmodules.c * app/core/gimppattern.c * app/display/Makefile.am * app/display/gimpdisplay-handlers.c * app/display/gimpdisplay.[ch] * app/display/gimpdisplayshell-callbacks.c * app/display/gimpdisplayshell-handlers.c * app/display/gimpdisplayshell-layer-select.c * app/display/gimpdisplayshell-render.c * app/display/gimpdisplayshell-scale.c * app/display/gimpdisplayshell-scroll.c * app/display/gimpdisplayshell-selection.c * app/display/gimpdisplayshell.[ch] * app/display/gimpnavigationview.c * app/file/file-save.c * app/gui/device-status-dialog.c * app/gui/dialogs-constructors.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/gui.c * app/gui/menus.c * app/gui/paths-dialog.c * app/gui/resize-dialog.c * app/gui/session.c * app/gui/test-commands.c * app/gui/tips-dialog.c * app/gui/tips-dialog.h * app/gui/user-install-dialog.c * app/gui/view-commands.c * app/paint/gimppaintcore.c * app/plug-in/plug-in.c * app/plug-in/plug-ins.c * app/tools/gimpbezierselecttool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpcolorpickertool.c * app/tools/gimpcroptool.c * app/tools/gimpeditselectiontool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimpinktool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmeasuretool.c * app/tools/gimppainttool.c * app/tools/gimppathtool.c * app/tools/gimptexttool.[ch] * app/tools/selection_options.c * app/tools/tools.c * app/tools/transform_options.c * app/widgets/gimphelp.c * app/widgets/gimpitemfactory.c * app/widgets/gimpselectioneditor.c * app/xcf/xcf-load.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/gimprc.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/transform_tools.pdb: use the new config system instead of the old gimprc stuff. * etc/gimprc.in * etc/gimprc_user.in: adapted to the new gimprc format. Will update the man-page later... * app/pdb/fileops_cmds.c * app/pdb/gimprc_cmds.c * app/pdb/image_cmds.c * app/pdb/layer_cmds.c * app/pdb/transform_tools_cmds.c * libgimp/gimpgimprc_pdb.c: regenerated.
2002-11-19 04:50:31 +08:00
#include "config/gimpcoreconfig.h"
#include "core/gimp-transform-utils.h"
#include "core/gimp.h"
#include "core/gimpchannel.h"
2001-11-20 02:54:13 +08:00
#include "core/gimpdrawable-transform.h"
#include "core/gimpdrawable.h"
add the layer to the image before pasting to it. Fixes bug #132504. 2004-01-26 Michael Natterer <mitch@gimp.org> * plug-ins/script-fu/scripts/unsharp-mask.scm: add the layer to the image before pasting to it. Fixes bug #132504. Fixed the underlying problem: make it impossible to attach floating selections to drawables which are not currently part of the image's layer or channel stacks. Also cleaned up image <-> floating_sel interaction: * app/core/gimplayer-floating-sel.[ch] (floating_sel_attach): added assertion that the drawable is part of the image (see below). Don't call gimp_image_floating_selection_changed(), it's emitted by gimp_image_add_layer() now. (floating_sel_remove) (floating_sel_anchor): don't emit "floating_selection_changed", it's emitted by gimp_image_remove_layer() now. (floating_sel_anchor): removed the fix for bug #132162 because gimp_image_remove_layer() behaves correctly now (see below). Renamed floating_sel_reset() to floating_sel_activate_drawable(). Added g_return_if_fail() all over the place. * app/core/gimpimage.[ch]: added new function gimp_image_owns_item() which return TRUE if the passed item is part of the image. (gimp_image_add_layer): emit "floating_selection_changed" here if needed. (gimp_image_remove_layer): emit "floating_selection_changed" if needed, don't try to activate a layer if we called floating_sel_activate_drawable(). This is the real fix for bug #132162. * app/core/gimpimage-undo-push.c (undo_pop_layer): apply the same fixes as to gimp_image_add,remove_layer(). Don't call gimp_drawable_invalidate_preview() on the previously active layer because that's done by gimp_image_set_active_layer() now. * app/xcf/xcf-load.c: remember the "floating_sel_drawable" in the XcfInfo struct and attach it *after* all layers and channels are loaded to avoid attaching the floating selection to an out-of-image drawable. * app/core/gimp-edit.c (gimp_edit_paste) * app/core/gimpdrawable-transform.c (gimp_drawable_transform_affine, gimp_drawable_transform_flip, gimp_drawable_transform_rotate) * app/core/gimpselection.c (gimp_selection_float) * app/text/gimptext-compat.c (text_render): added checks for gimp_image_owns_item() in all functions which can produce floating selections. * tools/pdbgen/pdb/edit.pdb * tools/pdbgen/pdb/floating_sel.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/text_tool.pdb * tools/pdbgen/pdb/transform_tools.pdb: added checks for gimp_item_owns_image() and return an execution error if invoked with a drawable which is not part of the image. * app/pdb/edit_cmds.c * app/pdb/floating_sel_cmds.c * app/pdb/selection_cmds.c * app/pdb/text_tool_cmds.c * app/pdb/transform_tools_cmds.c: regenerated.
2004-01-26 23:34:47 +08:00
#include "core/gimpimage.h"
#include "core/gimpparamspecs.h"
#include "core/gimpprogress.h"
2001-11-20 02:54:13 +08:00
#include "gimppdb.h"
#include "gimppdb-utils.h"
#include "gimpprocedure.h"
#include "internal-procs.h"
#include "gimp-intl.h"
2001-11-20 02:54:13 +08:00
static GimpValueArray *
flip_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpValueArray *args,
GError **error)
2001-11-20 02:54:13 +08:00
{
gboolean success = TRUE;
GimpValueArray *return_vals;
2001-11-20 02:54:13 +08:00
GimpDrawable *drawable;
gint32 flip_type;
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp);
flip_type = g_value_get_enum (gimp_value_array_index (args, 1));
2001-11-20 02:54:13 +08:00
if (success)
{
gint x, y, width, height;
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
GIMP_PDB_ITEM_CONTENT |
GIMP_PDB_ITEM_POSITION, error);
if (success &&
gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height))
{
gdouble axis;
gimp_transform_get_flip_axis (x, y, width, height,
flip_type, TRUE, &axis);
if (! gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) &&
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (GIMP_ITEM (drawable)))))
{
if (! gimp_drawable_transform_flip (drawable, context,
flip_type, axis, FALSE))
{
success = FALSE;
}
}
else
{
gimp_item_flip (GIMP_ITEM (drawable), context,
flip_type, axis, FALSE);
}
}
2001-11-20 02:54:13 +08:00
}
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
2001-11-20 02:54:13 +08:00
if (success)
gimp_value_set_drawable (gimp_value_array_index (return_vals, 1), drawable);
2001-11-20 02:54:13 +08:00
return return_vals;
2001-11-20 02:54:13 +08:00
}
static GimpValueArray *
perspective_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpValueArray *args,
GError **error)
2001-11-20 02:54:13 +08:00
{
gboolean success = TRUE;
GimpValueArray *return_vals;
2001-11-20 02:54:13 +08:00
GimpDrawable *drawable;
gboolean interpolation;
tools/pdbgen/pdb/brush.pdb tools/pdbgen/pdb/brushes.pdb 2006-03-15 Michael Natterer <mitch@gimp.org> * tools/pdbgen/pdb/brush.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/context.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/drawable_transform.pdb * tools/pdbgen/pdb/gradient.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/palettes.pdb * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/pattern.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/procedural_db.pdb * tools/pdbgen/pdb/transform_tools.pdb: let pdbgen handle *only* variables for arguments and return values and declare all local variables inside the C code. Removed lots of alias => '<expression>' and no_declare => 1 stuff from return values, instead let pdbgen declare the variables and assign them manually in the C code. More cleanup. * tools/pdbgen/app.pl: removed support for proc->vars. * app/pdb/brush_cmds.c * app/pdb/brushes_cmds.c * app/pdb/context_cmds.c * app/pdb/drawable_cmds.c * app/pdb/drawable_transform_cmds.c * app/pdb/gradient_cmds.c * app/pdb/gradients_cmds.c * app/pdb/image_cmds.c * app/pdb/palette_cmds.c * app/pdb/palettes_cmds.c * app/pdb/paths_cmds.c * app/pdb/pattern_cmds.c * app/pdb/patterns_cmds.c * app/pdb/procedural_db_cmds.c * app/pdb/transform_tools_cmds.c * libgimp/gimpbrush_pdb.c * libgimp/gimpbrushes_pdb.c * libgimp/gimpgradient_pdb.c * libgimp/gimpgradients_pdb.c * libgimp/gimppalette_pdb.c * libgimp/gimppalettes_pdb.c * libgimp/gimppatterns_pdb.c: regenerated.
2006-03-15 20:49:25 +08:00
gdouble x0;
gdouble y0;
gdouble x1;
gdouble y1;
gdouble x2;
gdouble y2;
gdouble x3;
gdouble y3;
2001-11-20 02:54:13 +08:00
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp);
interpolation = g_value_get_boolean (gimp_value_array_index (args, 1));
x0 = g_value_get_double (gimp_value_array_index (args, 2));
y0 = g_value_get_double (gimp_value_array_index (args, 3));
x1 = g_value_get_double (gimp_value_array_index (args, 4));
y1 = g_value_get_double (gimp_value_array_index (args, 5));
x2 = g_value_get_double (gimp_value_array_index (args, 6));
y2 = g_value_get_double (gimp_value_array_index (args, 7));
x3 = g_value_get_double (gimp_value_array_index (args, 8));
y3 = g_value_get_double (gimp_value_array_index (args, 9));
2001-11-20 02:54:13 +08:00
if (success)
{
gint x, y, width, height;
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
GIMP_PDB_ITEM_CONTENT |
GIMP_PDB_ITEM_POSITION, error);
if (success &&
gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height))
{
GimpMatrix3 matrix;
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
gint off_x, off_y;
gimp_item_get_offset (GIMP_ITEM (drawable), &off_x, &off_y);
x += off_x;
y += off_y;
/* Assemble the transformation matrix */
gimp_matrix3_identity (&matrix);
gimp_transform_matrix_perspective (&matrix,
x, y, width, height,
x0, y0, x1, y1,
x2, y2, x3, y3);
if (interpolation)
interpolation_type = gimp->config->interpolation_type;
if (progress)
gimp_progress_start (progress, FALSE, _("Perspective"));
if (! gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) &&
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (GIMP_ITEM (drawable)))))
{
if (! gimp_drawable_transform_affine (drawable, context,
&matrix,
GIMP_TRANSFORM_FORWARD,
interpolation_type,
FALSE, progress))
{
success = FALSE;
}
}
else
{
gimp_item_transform (GIMP_ITEM (drawable), context, &matrix,
GIMP_TRANSFORM_FORWARD,
interpolation,
FALSE, progress);
}
if (progress)
gimp_progress_end (progress);
}
2001-11-20 02:54:13 +08:00
}
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
2001-11-20 02:54:13 +08:00
if (success)
gimp_value_set_drawable (gimp_value_array_index (return_vals, 1), drawable);
2001-11-20 02:54:13 +08:00
return return_vals;
2001-11-20 02:54:13 +08:00
}
static GimpValueArray *
rotate_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpValueArray *args,
GError **error)
2001-11-20 02:54:13 +08:00
{
gboolean success = TRUE;
GimpValueArray *return_vals;
2001-11-20 02:54:13 +08:00
GimpDrawable *drawable;
gboolean interpolation;
gdouble angle;
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp);
interpolation = g_value_get_boolean (gimp_value_array_index (args, 1));
angle = g_value_get_double (gimp_value_array_index (args, 2));
2001-11-20 02:54:13 +08:00
if (success)
{
gint x, y, width, height;
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
GIMP_PDB_ITEM_CONTENT |
GIMP_PDB_ITEM_POSITION, error);
if (success &&
gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height))
{
GimpMatrix3 matrix;
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
gint off_x, off_y;
gimp_item_get_offset (GIMP_ITEM (drawable), &off_x, &off_y);
x += off_x;
y += off_y;
/* Assemble the transformation matrix */
gimp_matrix3_identity (&matrix);
gimp_transform_matrix_rotate_rect (&matrix,
x, y, width, height,
angle);
if (interpolation)
interpolation_type = gimp->config->interpolation_type;
if (progress)
gimp_progress_start (progress, FALSE, _("Rotating"));
if (! gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) &&
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (GIMP_ITEM (drawable)))))
{
if (! gimp_drawable_transform_affine (drawable, context,
&matrix,
GIMP_TRANSFORM_FORWARD,
interpolation_type,
FALSE, progress))
{
success = FALSE;
}
}
else
{
gimp_item_transform (GIMP_ITEM (drawable), context, &matrix,
GIMP_TRANSFORM_FORWARD,
interpolation,
FALSE, progress);
}
if (progress)
gimp_progress_end (progress);
}
2001-11-20 02:54:13 +08:00
}
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
2001-11-20 02:54:13 +08:00
if (success)
gimp_value_set_drawable (gimp_value_array_index (return_vals, 1), drawable);
2001-11-20 02:54:13 +08:00
return return_vals;
2001-11-20 02:54:13 +08:00
}
static GimpValueArray *
scale_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpValueArray *args,
GError **error)
2001-11-20 02:54:13 +08:00
{
gboolean success = TRUE;
GimpValueArray *return_vals;
2001-11-20 02:54:13 +08:00
GimpDrawable *drawable;
gboolean interpolation;
tools/pdbgen/pdb/brush.pdb tools/pdbgen/pdb/brushes.pdb 2006-03-15 Michael Natterer <mitch@gimp.org> * tools/pdbgen/pdb/brush.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/context.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/drawable_transform.pdb * tools/pdbgen/pdb/gradient.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/palettes.pdb * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/pattern.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/procedural_db.pdb * tools/pdbgen/pdb/transform_tools.pdb: let pdbgen handle *only* variables for arguments and return values and declare all local variables inside the C code. Removed lots of alias => '<expression>' and no_declare => 1 stuff from return values, instead let pdbgen declare the variables and assign them manually in the C code. More cleanup. * tools/pdbgen/app.pl: removed support for proc->vars. * app/pdb/brush_cmds.c * app/pdb/brushes_cmds.c * app/pdb/context_cmds.c * app/pdb/drawable_cmds.c * app/pdb/drawable_transform_cmds.c * app/pdb/gradient_cmds.c * app/pdb/gradients_cmds.c * app/pdb/image_cmds.c * app/pdb/palette_cmds.c * app/pdb/palettes_cmds.c * app/pdb/paths_cmds.c * app/pdb/pattern_cmds.c * app/pdb/patterns_cmds.c * app/pdb/procedural_db_cmds.c * app/pdb/transform_tools_cmds.c * libgimp/gimpbrush_pdb.c * libgimp/gimpbrushes_pdb.c * libgimp/gimpgradient_pdb.c * libgimp/gimpgradients_pdb.c * libgimp/gimppalette_pdb.c * libgimp/gimppalettes_pdb.c * libgimp/gimppatterns_pdb.c: regenerated.
2006-03-15 20:49:25 +08:00
gdouble x0;
gdouble y0;
gdouble x1;
gdouble y1;
2001-11-20 02:54:13 +08:00
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp);
interpolation = g_value_get_boolean (gimp_value_array_index (args, 1));
x0 = g_value_get_double (gimp_value_array_index (args, 2));
y0 = g_value_get_double (gimp_value_array_index (args, 3));
x1 = g_value_get_double (gimp_value_array_index (args, 4));
y1 = g_value_get_double (gimp_value_array_index (args, 5));
2001-11-20 02:54:13 +08:00
if (success)
{
gint x, y, width, height;
success = (gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
GIMP_PDB_ITEM_CONTENT |
GIMP_PDB_ITEM_POSITION, error) &&
tools/pdbgen/pdb/brush.pdb tools/pdbgen/pdb/brushes.pdb 2006-03-15 Michael Natterer <mitch@gimp.org> * tools/pdbgen/pdb/brush.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/context.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/drawable_transform.pdb * tools/pdbgen/pdb/gradient.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/palette.pdb * tools/pdbgen/pdb/palettes.pdb * tools/pdbgen/pdb/paths.pdb * tools/pdbgen/pdb/pattern.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/procedural_db.pdb * tools/pdbgen/pdb/transform_tools.pdb: let pdbgen handle *only* variables for arguments and return values and declare all local variables inside the C code. Removed lots of alias => '<expression>' and no_declare => 1 stuff from return values, instead let pdbgen declare the variables and assign them manually in the C code. More cleanup. * tools/pdbgen/app.pl: removed support for proc->vars. * app/pdb/brush_cmds.c * app/pdb/brushes_cmds.c * app/pdb/context_cmds.c * app/pdb/drawable_cmds.c * app/pdb/drawable_transform_cmds.c * app/pdb/gradient_cmds.c * app/pdb/gradients_cmds.c * app/pdb/image_cmds.c * app/pdb/palette_cmds.c * app/pdb/palettes_cmds.c * app/pdb/paths_cmds.c * app/pdb/pattern_cmds.c * app/pdb/patterns_cmds.c * app/pdb/procedural_db_cmds.c * app/pdb/transform_tools_cmds.c * libgimp/gimpbrush_pdb.c * libgimp/gimpbrushes_pdb.c * libgimp/gimpgradient_pdb.c * libgimp/gimpgradients_pdb.c * libgimp/gimppalette_pdb.c * libgimp/gimppalettes_pdb.c * libgimp/gimppatterns_pdb.c: regenerated.
2006-03-15 20:49:25 +08:00
x0 < x1 && y0 < y1);
if (success &&
gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height))
{
GimpMatrix3 matrix;
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
gint off_x, off_y;
gimp_item_get_offset (GIMP_ITEM (drawable), &off_x, &off_y);
x += off_x;
y += off_y;
/* Assemble the transformation matrix */
gimp_matrix3_identity (&matrix);
gimp_transform_matrix_scale (&matrix,
x, y, width, height,
x0, y0, x1 - x0, y1 - y0);
if (interpolation)
interpolation_type = gimp->config->interpolation_type;
if (progress)
gimp_progress_start (progress, FALSE, _("Scaling"));
if (! gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) &&
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (GIMP_ITEM (drawable)))))
{
if (! gimp_drawable_transform_affine (drawable, context,
&matrix,
GIMP_TRANSFORM_FORWARD,
interpolation_type,
FALSE, progress))
{
success = FALSE;
}
}
else
{
gimp_item_transform (GIMP_ITEM (drawable), context, &matrix,
GIMP_TRANSFORM_FORWARD,
interpolation,
FALSE, progress);
}
if (progress)
gimp_progress_end (progress);
}
2001-11-20 02:54:13 +08:00
}
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
2001-11-20 02:54:13 +08:00
if (success)
gimp_value_set_drawable (gimp_value_array_index (return_vals, 1), drawable);
2001-11-20 02:54:13 +08:00
return return_vals;
2001-11-20 02:54:13 +08:00
}
static GimpValueArray *
shear_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpValueArray *args,
GError **error)
2001-11-20 02:54:13 +08:00
{
gboolean success = TRUE;
GimpValueArray *return_vals;
2001-11-20 02:54:13 +08:00
GimpDrawable *drawable;
gboolean interpolation;
gint32 shear_type;
gdouble magnitude;
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp);
interpolation = g_value_get_boolean (gimp_value_array_index (args, 1));
shear_type = g_value_get_enum (gimp_value_array_index (args, 2));
magnitude = g_value_get_double (gimp_value_array_index (args, 3));
2001-11-20 02:54:13 +08:00
if (success)
{
gint x, y, width, height;
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
GIMP_PDB_ITEM_CONTENT |
GIMP_PDB_ITEM_POSITION, error);
if (success &&
gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height))
{
GimpMatrix3 matrix;
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
gint off_x, off_y;
gimp_item_get_offset (GIMP_ITEM (drawable), &off_x, &off_y);
x += off_x;
y += off_y;
/* Assemble the transformation matrix */
gimp_matrix3_identity (&matrix);
gimp_transform_matrix_shear (&matrix,
x, y, width, height,
shear_type, magnitude);
if (interpolation)
interpolation_type = gimp->config->interpolation_type;
if (progress)
gimp_progress_start (progress, FALSE, _("Shearing"));
if (! gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) &&
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (GIMP_ITEM (drawable)))))
{
if (! gimp_drawable_transform_affine (drawable, context,
&matrix,
GIMP_TRANSFORM_FORWARD,
interpolation_type,
FALSE, progress))
{
success = FALSE;
}
}
else
{
gimp_item_transform (GIMP_ITEM (drawable), context, &matrix,
GIMP_TRANSFORM_FORWARD,
interpolation,
FALSE, progress);
}
if (progress)
gimp_progress_end (progress);
}
2001-11-20 02:54:13 +08:00
}
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
2001-11-20 02:54:13 +08:00
if (success)
gimp_value_set_drawable (gimp_value_array_index (return_vals, 1), drawable);
2001-11-20 02:54:13 +08:00
return return_vals;
2001-11-20 02:54:13 +08:00
}
static GimpValueArray *
transform_2d_invoker (GimpProcedure *procedure,
Gimp *gimp,
GimpContext *context,
GimpProgress *progress,
const GimpValueArray *args,
GError **error)
2001-11-20 02:54:13 +08:00
{
gboolean success = TRUE;
GimpValueArray *return_vals;
2001-11-20 02:54:13 +08:00
GimpDrawable *drawable;
gboolean interpolation;
gdouble source_x;
gdouble source_y;
gdouble scale_x;
gdouble scale_y;
gdouble angle;
gdouble dest_x;
gdouble dest_y;
drawable = gimp_value_get_drawable (gimp_value_array_index (args, 0), gimp);
interpolation = g_value_get_boolean (gimp_value_array_index (args, 1));
source_x = g_value_get_double (gimp_value_array_index (args, 2));
source_y = g_value_get_double (gimp_value_array_index (args, 3));
scale_x = g_value_get_double (gimp_value_array_index (args, 4));
scale_y = g_value_get_double (gimp_value_array_index (args, 5));
angle = g_value_get_double (gimp_value_array_index (args, 6));
dest_x = g_value_get_double (gimp_value_array_index (args, 7));
dest_y = g_value_get_double (gimp_value_array_index (args, 8));
2001-11-20 02:54:13 +08:00
if (success)
{
gint x, y, width, height;
success = gimp_pdb_item_is_attached (GIMP_ITEM (drawable), NULL,
GIMP_PDB_ITEM_CONTENT |
GIMP_PDB_ITEM_POSITION, error);
if (success &&
gimp_item_mask_intersect (GIMP_ITEM (drawable), &x, &y, &width, &height))
{
GimpMatrix3 matrix;
GimpInterpolationType interpolation_type = GIMP_INTERPOLATION_NONE;
/* Assemble the transformation matrix */
gimp_matrix3_identity (&matrix);
gimp_matrix3_translate (&matrix, -source_x, -source_y);
gimp_matrix3_scale (&matrix, scale_x, scale_y);
gimp_matrix3_rotate (&matrix, angle);
gimp_matrix3_translate (&matrix, dest_x, dest_y);
if (interpolation)
interpolation_type = gimp->config->interpolation_type;
if (progress)
gimp_progress_start (progress, FALSE, _("2D Transform"));
if (! gimp_viewable_get_children (GIMP_VIEWABLE (drawable)) &&
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (GIMP_ITEM (drawable)))))
{
if (! gimp_drawable_transform_affine (drawable, context,
&matrix, GIMP_TRANSFORM_FORWARD,
interpolation_type,
FALSE, progress))
{
success = FALSE;
}
}
else
{
gimp_item_transform (GIMP_ITEM (drawable), context, &matrix,
GIMP_TRANSFORM_FORWARD,
interpolation,
FALSE, progress);
}
if (progress)
gimp_progress_end (progress);
}
}
return_vals = gimp_procedure_get_return_values (procedure, success,
error ? *error : NULL);
if (success)
gimp_value_set_drawable (gimp_value_array_index (return_vals, 1), drawable);
return return_vals;
}
void
app/pdb/Makefile.am app/pdb/pdb-types.h new object GimpPDB which keeps all 2006-04-26 Michael Natterer <mitch@gimp.org> * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppdb.[ch]: new object GimpPDB which keeps all procedures and functions to register and run them. Renamed all functions and did some cleanups. * app/pdb/gimp-pdb.[ch] * app/core/gimp.[ch]: removed the same stuff here. * app/pdb/gimp-pdb-query.[ch]: removed these files... * app/pdb/gimppdb-query.[ch]: ...added here as members of GimpPDB. * app/pdb/gimp-pdb-compat.h: fix include guard. * app/batch.c * app/actions/vectors-commands.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimphelp.c * app/xcf/xcf.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed includes and function calls accordingly. * tools/pdbgen/app.pl: pass around GimpPDB instead of Gimp pointers to register the internal procedures with. Changed some newlines in the generated code. * app/pdb/*_cmds.c * app/pdb/internal_procs.[ch]: regenerated. * app/core/gimppdbprogress.[ch] * app/widgets/gimppdbdialog.[ch]: added "pdb" CONSTRUCT_ONLY properties. * app/plug-in/plug-in-progress.c * app/gui/gui-vtable.c: pass gimp->pdb when creating them. * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: use the new local pdb pointers instead of some foo->bar->gimp->pdb overkill.
2006-04-26 17:13:47 +08:00
register_transform_tools_procs (GimpPDB *pdb)
{
GimpProcedure *procedure;
/*
* gimp-flip
*/
app/plug-in/Makefile.am app/plug-in/plug-in-types.h removed... 2006-04-06 Michael Natterer <mitch@gimp.org> * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/plug-in/plug-in-proc-def.[ch]: removed... * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppluginprocedure.[ch]: ...and added here. Virtualized get_progname(). * app/pdb/gimptemporaryprocedure.[ch]: new class derived from GimpPlugInProcedure. * app/pdb/gimpprocedure.[ch] (struct GimpProcedure): remove union exec_method and all the structs it needed. Procedure execution is properly virtualized now. Removed gimp_procedure_initialize() and grow the args and values arrays dynamically in gimp_procedure_add_argument()/return_value(). Added marshal_func parameter to gimp_procedure_new(). * app/actions/plug-in-actions.c * app/actions/plug-in-commands.c * app/core/gimp-gui.c * app/dialogs/file-save-dialog.c * app/file/file-open.c * app/file/file-save.c * app/file/file-utils.c * app/gui/gui-vtable.c * app/menus/plug-in-menus.c * app/plug-in/plug-in-def.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-run.c * app/plug-in/plug-in.c * app/plug-in/plug-ins-query.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimpfileprocview.c * app/widgets/gimppluginaction.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/plug_in.pdb * tools/pdbgen/app.pl: changed accordingly. * app/pdb/*_cmds.c: regenerated. * app/pdb/gimp-pdb.c: added uglyness to make the app link again.
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new (flip_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-flip");
gimp_procedure_set_static_strings (procedure,
"gimp-flip",
"Deprecated: Use 'gimp-item-transform-flip-simple' instead.",
"Deprecated: Use 'gimp-item-transform-flip-simple' instead.",
"",
"",
"",
"gimp-item-transform-flip-simple");
gimp_procedure_add_argument (procedure,
gimp_param_spec_drawable_id ("drawable",
"drawable",
"The affected drawable",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_enum ("flip-type",
"flip type",
"Type of flip",
GIMP_TYPE_ORIENTATION_TYPE,
GIMP_ORIENTATION_HORIZONTAL,
GIMP_PARAM_READWRITE));
gimp_param_spec_enum_exclude_value (GIMP_PARAM_SPEC_ENUM (procedure->args[1]),
GIMP_ORIENTATION_UNKNOWN);
gimp_procedure_add_return_value (procedure,
gimp_param_spec_drawable_id ("drawable",
"drawable",
"The flipped drawable",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
app/pdb/Makefile.am app/pdb/pdb-types.h new object GimpPDB which keeps all 2006-04-26 Michael Natterer <mitch@gimp.org> * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppdb.[ch]: new object GimpPDB which keeps all procedures and functions to register and run them. Renamed all functions and did some cleanups. * app/pdb/gimp-pdb.[ch] * app/core/gimp.[ch]: removed the same stuff here. * app/pdb/gimp-pdb-query.[ch]: removed these files... * app/pdb/gimppdb-query.[ch]: ...added here as members of GimpPDB. * app/pdb/gimp-pdb-compat.h: fix include guard. * app/batch.c * app/actions/vectors-commands.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimphelp.c * app/xcf/xcf.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed includes and function calls accordingly. * tools/pdbgen/app.pl: pass around GimpPDB instead of Gimp pointers to register the internal procedures with. Changed some newlines in the generated code. * app/pdb/*_cmds.c * app/pdb/internal_procs.[ch]: regenerated. * app/core/gimppdbprogress.[ch] * app/widgets/gimppdbdialog.[ch]: added "pdb" CONSTRUCT_ONLY properties. * app/plug-in/plug-in-progress.c * app/gui/gui-vtable.c: pass gimp->pdb when creating them. * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: use the new local pdb pointers instead of some foo->bar->gimp->pdb overkill.
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-perspective
*/
app/plug-in/Makefile.am app/plug-in/plug-in-types.h removed... 2006-04-06 Michael Natterer <mitch@gimp.org> * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/plug-in/plug-in-proc-def.[ch]: removed... * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppluginprocedure.[ch]: ...and added here. Virtualized get_progname(). * app/pdb/gimptemporaryprocedure.[ch]: new class derived from GimpPlugInProcedure. * app/pdb/gimpprocedure.[ch] (struct GimpProcedure): remove union exec_method and all the structs it needed. Procedure execution is properly virtualized now. Removed gimp_procedure_initialize() and grow the args and values arrays dynamically in gimp_procedure_add_argument()/return_value(). Added marshal_func parameter to gimp_procedure_new(). * app/actions/plug-in-actions.c * app/actions/plug-in-commands.c * app/core/gimp-gui.c * app/dialogs/file-save-dialog.c * app/file/file-open.c * app/file/file-save.c * app/file/file-utils.c * app/gui/gui-vtable.c * app/menus/plug-in-menus.c * app/plug-in/plug-in-def.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-run.c * app/plug-in/plug-in.c * app/plug-in/plug-ins-query.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimpfileprocview.c * app/widgets/gimppluginaction.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/plug_in.pdb * tools/pdbgen/app.pl: changed accordingly. * app/pdb/*_cmds.c: regenerated. * app/pdb/gimp-pdb.c: added uglyness to make the app link again.
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new (perspective_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-perspective");
gimp_procedure_set_static_strings (procedure,
"gimp-perspective",
"Deprecated: Use 'gimp-item-transform-perspective' instead.",
"Deprecated: Use 'gimp-item-transform-perspective' instead.",
"",
"",
"",
"gimp-item-transform-perspective");
gimp_procedure_add_argument (procedure,
gimp_param_spec_drawable_id ("drawable",
"drawable",
"The affected drawable",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_boolean ("interpolation",
"interpolation",
"Whether to use interpolation",
FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("x0",
"x0",
"The new x coordinate of upper-left corner of original bounding box",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("y0",
"y0",
"The new y coordinate of upper-left corner of original bounding box",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("x1",
"x1",
"The new x coordinate of upper-right corner of original bounding box",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("y1",
"y1",
"The new y coordinate of upper-right corner of original bounding box",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("x2",
"x2",
"The new x coordinate of lower-left corner of original bounding box",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("y2",
"y2",
"The new y coordinate of lower-left corner of original bounding box",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("x3",
"x3",
"The new x coordinate of lower-right corner of original bounding box",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("y3",
"y3",
"The new y coordinate of lower-right corner of original bounding box",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
gimp_param_spec_drawable_id ("drawable",
"drawable",
"The newly mapped drawable",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
app/pdb/Makefile.am app/pdb/pdb-types.h new object GimpPDB which keeps all 2006-04-26 Michael Natterer <mitch@gimp.org> * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppdb.[ch]: new object GimpPDB which keeps all procedures and functions to register and run them. Renamed all functions and did some cleanups. * app/pdb/gimp-pdb.[ch] * app/core/gimp.[ch]: removed the same stuff here. * app/pdb/gimp-pdb-query.[ch]: removed these files... * app/pdb/gimppdb-query.[ch]: ...added here as members of GimpPDB. * app/pdb/gimp-pdb-compat.h: fix include guard. * app/batch.c * app/actions/vectors-commands.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimphelp.c * app/xcf/xcf.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed includes and function calls accordingly. * tools/pdbgen/app.pl: pass around GimpPDB instead of Gimp pointers to register the internal procedures with. Changed some newlines in the generated code. * app/pdb/*_cmds.c * app/pdb/internal_procs.[ch]: regenerated. * app/core/gimppdbprogress.[ch] * app/widgets/gimppdbdialog.[ch]: added "pdb" CONSTRUCT_ONLY properties. * app/plug-in/plug-in-progress.c * app/gui/gui-vtable.c: pass gimp->pdb when creating them. * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: use the new local pdb pointers instead of some foo->bar->gimp->pdb overkill.
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-rotate
*/
app/plug-in/Makefile.am app/plug-in/plug-in-types.h removed... 2006-04-06 Michael Natterer <mitch@gimp.org> * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/plug-in/plug-in-proc-def.[ch]: removed... * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppluginprocedure.[ch]: ...and added here. Virtualized get_progname(). * app/pdb/gimptemporaryprocedure.[ch]: new class derived from GimpPlugInProcedure. * app/pdb/gimpprocedure.[ch] (struct GimpProcedure): remove union exec_method and all the structs it needed. Procedure execution is properly virtualized now. Removed gimp_procedure_initialize() and grow the args and values arrays dynamically in gimp_procedure_add_argument()/return_value(). Added marshal_func parameter to gimp_procedure_new(). * app/actions/plug-in-actions.c * app/actions/plug-in-commands.c * app/core/gimp-gui.c * app/dialogs/file-save-dialog.c * app/file/file-open.c * app/file/file-save.c * app/file/file-utils.c * app/gui/gui-vtable.c * app/menus/plug-in-menus.c * app/plug-in/plug-in-def.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-run.c * app/plug-in/plug-in.c * app/plug-in/plug-ins-query.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimpfileprocview.c * app/widgets/gimppluginaction.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/plug_in.pdb * tools/pdbgen/app.pl: changed accordingly. * app/pdb/*_cmds.c: regenerated. * app/pdb/gimp-pdb.c: added uglyness to make the app link again.
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new (rotate_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-rotate");
gimp_procedure_set_static_strings (procedure,
"gimp-rotate",
"Deprecated: Use 'gimp-item-transform-rotate' instead.",
"Deprecated: Use 'gimp-item-transform-rotate' instead.",
"",
"",
"",
"gimp-item-transform-rotate");
gimp_procedure_add_argument (procedure,
gimp_param_spec_drawable_id ("drawable",
"drawable",
"The affected drawable",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_boolean ("interpolation",
"interpolation",
"Whether to use interpolation",
FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("angle",
"angle",
"The angle of rotation (radians)",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
gimp_param_spec_drawable_id ("drawable",
"drawable",
"The rotated drawable",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
app/pdb/Makefile.am app/pdb/pdb-types.h new object GimpPDB which keeps all 2006-04-26 Michael Natterer <mitch@gimp.org> * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppdb.[ch]: new object GimpPDB which keeps all procedures and functions to register and run them. Renamed all functions and did some cleanups. * app/pdb/gimp-pdb.[ch] * app/core/gimp.[ch]: removed the same stuff here. * app/pdb/gimp-pdb-query.[ch]: removed these files... * app/pdb/gimppdb-query.[ch]: ...added here as members of GimpPDB. * app/pdb/gimp-pdb-compat.h: fix include guard. * app/batch.c * app/actions/vectors-commands.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimphelp.c * app/xcf/xcf.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed includes and function calls accordingly. * tools/pdbgen/app.pl: pass around GimpPDB instead of Gimp pointers to register the internal procedures with. Changed some newlines in the generated code. * app/pdb/*_cmds.c * app/pdb/internal_procs.[ch]: regenerated. * app/core/gimppdbprogress.[ch] * app/widgets/gimppdbdialog.[ch]: added "pdb" CONSTRUCT_ONLY properties. * app/plug-in/plug-in-progress.c * app/gui/gui-vtable.c: pass gimp->pdb when creating them. * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: use the new local pdb pointers instead of some foo->bar->gimp->pdb overkill.
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-scale
*/
app/plug-in/Makefile.am app/plug-in/plug-in-types.h removed... 2006-04-06 Michael Natterer <mitch@gimp.org> * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/plug-in/plug-in-proc-def.[ch]: removed... * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppluginprocedure.[ch]: ...and added here. Virtualized get_progname(). * app/pdb/gimptemporaryprocedure.[ch]: new class derived from GimpPlugInProcedure. * app/pdb/gimpprocedure.[ch] (struct GimpProcedure): remove union exec_method and all the structs it needed. Procedure execution is properly virtualized now. Removed gimp_procedure_initialize() and grow the args and values arrays dynamically in gimp_procedure_add_argument()/return_value(). Added marshal_func parameter to gimp_procedure_new(). * app/actions/plug-in-actions.c * app/actions/plug-in-commands.c * app/core/gimp-gui.c * app/dialogs/file-save-dialog.c * app/file/file-open.c * app/file/file-save.c * app/file/file-utils.c * app/gui/gui-vtable.c * app/menus/plug-in-menus.c * app/plug-in/plug-in-def.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-run.c * app/plug-in/plug-in.c * app/plug-in/plug-ins-query.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimpfileprocview.c * app/widgets/gimppluginaction.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/plug_in.pdb * tools/pdbgen/app.pl: changed accordingly. * app/pdb/*_cmds.c: regenerated. * app/pdb/gimp-pdb.c: added uglyness to make the app link again.
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new (scale_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-scale");
gimp_procedure_set_static_strings (procedure,
"gimp-scale",
"Deprecated: Use 'gimp-item-transform-scale' instead.",
"Deprecated: Use 'gimp-item-transform-scale' instead.",
"",
"",
"",
"gimp-item-transform-scale");
gimp_procedure_add_argument (procedure,
gimp_param_spec_drawable_id ("drawable",
"drawable",
"The affected drawable",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_boolean ("interpolation",
"interpolation",
"Whether to use interpolation",
FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("x0",
"x0",
"The new x coordinate of the upper-left corner of the scaled region",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("y0",
"y0",
"The new y coordinate of the upper-left corner of the scaled region",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("x1",
"x1",
"The new x coordinate of the lower-right corner of the scaled region",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("y1",
"y1",
"The new y coordinate of the lower-right corner of the scaled region",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
gimp_param_spec_drawable_id ("drawable",
"drawable",
"The scaled drawable",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
app/pdb/Makefile.am app/pdb/pdb-types.h new object GimpPDB which keeps all 2006-04-26 Michael Natterer <mitch@gimp.org> * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppdb.[ch]: new object GimpPDB which keeps all procedures and functions to register and run them. Renamed all functions and did some cleanups. * app/pdb/gimp-pdb.[ch] * app/core/gimp.[ch]: removed the same stuff here. * app/pdb/gimp-pdb-query.[ch]: removed these files... * app/pdb/gimppdb-query.[ch]: ...added here as members of GimpPDB. * app/pdb/gimp-pdb-compat.h: fix include guard. * app/batch.c * app/actions/vectors-commands.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimphelp.c * app/xcf/xcf.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed includes and function calls accordingly. * tools/pdbgen/app.pl: pass around GimpPDB instead of Gimp pointers to register the internal procedures with. Changed some newlines in the generated code. * app/pdb/*_cmds.c * app/pdb/internal_procs.[ch]: regenerated. * app/core/gimppdbprogress.[ch] * app/widgets/gimppdbdialog.[ch]: added "pdb" CONSTRUCT_ONLY properties. * app/plug-in/plug-in-progress.c * app/gui/gui-vtable.c: pass gimp->pdb when creating them. * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: use the new local pdb pointers instead of some foo->bar->gimp->pdb overkill.
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
/*
* gimp-shear
*/
app/plug-in/Makefile.am app/plug-in/plug-in-types.h removed... 2006-04-06 Michael Natterer <mitch@gimp.org> * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/plug-in/plug-in-proc-def.[ch]: removed... * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppluginprocedure.[ch]: ...and added here. Virtualized get_progname(). * app/pdb/gimptemporaryprocedure.[ch]: new class derived from GimpPlugInProcedure. * app/pdb/gimpprocedure.[ch] (struct GimpProcedure): remove union exec_method and all the structs it needed. Procedure execution is properly virtualized now. Removed gimp_procedure_initialize() and grow the args and values arrays dynamically in gimp_procedure_add_argument()/return_value(). Added marshal_func parameter to gimp_procedure_new(). * app/actions/plug-in-actions.c * app/actions/plug-in-commands.c * app/core/gimp-gui.c * app/dialogs/file-save-dialog.c * app/file/file-open.c * app/file/file-save.c * app/file/file-utils.c * app/gui/gui-vtable.c * app/menus/plug-in-menus.c * app/plug-in/plug-in-def.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-run.c * app/plug-in/plug-in.c * app/plug-in/plug-ins-query.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimpfileprocview.c * app/widgets/gimppluginaction.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/plug_in.pdb * tools/pdbgen/app.pl: changed accordingly. * app/pdb/*_cmds.c: regenerated. * app/pdb/gimp-pdb.c: added uglyness to make the app link again.
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new (shear_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-shear");
gimp_procedure_set_static_strings (procedure,
"gimp-shear",
"Deprecated: Use 'gimp-item-transform-shear' instead.",
"Deprecated: Use 'gimp-item-transform-shear' instead.",
"",
"",
"",
"gimp-item-transform-shear");
gimp_procedure_add_argument (procedure,
gimp_param_spec_drawable_id ("drawable",
"drawable",
"The affected drawable",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_boolean ("interpolation",
"interpolation",
"Whether to use interpolation",
FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
gimp_param_spec_enum ("shear-type",
"shear type",
"Type of shear",
GIMP_TYPE_ORIENTATION_TYPE,
GIMP_ORIENTATION_HORIZONTAL,
GIMP_PARAM_READWRITE));
gimp_param_spec_enum_exclude_value (GIMP_PARAM_SPEC_ENUM (procedure->args[2]),
GIMP_ORIENTATION_UNKNOWN);
gimp_procedure_add_argument (procedure,
g_param_spec_double ("magnitude",
"magnitude",
"The magnitude of the shear",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
gimp_param_spec_drawable_id ("drawable",
"drawable",
"The sheared drawable",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
app/pdb/Makefile.am app/pdb/pdb-types.h new object GimpPDB which keeps all 2006-04-26 Michael Natterer <mitch@gimp.org> * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppdb.[ch]: new object GimpPDB which keeps all procedures and functions to register and run them. Renamed all functions and did some cleanups. * app/pdb/gimp-pdb.[ch] * app/core/gimp.[ch]: removed the same stuff here. * app/pdb/gimp-pdb-query.[ch]: removed these files... * app/pdb/gimppdb-query.[ch]: ...added here as members of GimpPDB. * app/pdb/gimp-pdb-compat.h: fix include guard. * app/batch.c * app/actions/vectors-commands.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimphelp.c * app/xcf/xcf.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed includes and function calls accordingly. * tools/pdbgen/app.pl: pass around GimpPDB instead of Gimp pointers to register the internal procedures with. Changed some newlines in the generated code. * app/pdb/*_cmds.c * app/pdb/internal_procs.[ch]: regenerated. * app/core/gimppdbprogress.[ch] * app/widgets/gimppdbdialog.[ch]: added "pdb" CONSTRUCT_ONLY properties. * app/plug-in/plug-in-progress.c * app/gui/gui-vtable.c: pass gimp->pdb when creating them. * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: use the new local pdb pointers instead of some foo->bar->gimp->pdb overkill.
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
2001-11-20 02:54:13 +08:00
/*
* gimp-transform-2d
*/
app/plug-in/Makefile.am app/plug-in/plug-in-types.h removed... 2006-04-06 Michael Natterer <mitch@gimp.org> * app/plug-in/Makefile.am * app/plug-in/plug-in-types.h * app/plug-in/plug-in-proc-def.[ch]: removed... * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppluginprocedure.[ch]: ...and added here. Virtualized get_progname(). * app/pdb/gimptemporaryprocedure.[ch]: new class derived from GimpPlugInProcedure. * app/pdb/gimpprocedure.[ch] (struct GimpProcedure): remove union exec_method and all the structs it needed. Procedure execution is properly virtualized now. Removed gimp_procedure_initialize() and grow the args and values arrays dynamically in gimp_procedure_add_argument()/return_value(). Added marshal_func parameter to gimp_procedure_new(). * app/actions/plug-in-actions.c * app/actions/plug-in-commands.c * app/core/gimp-gui.c * app/dialogs/file-save-dialog.c * app/file/file-open.c * app/file/file-save.c * app/file/file-utils.c * app/gui/gui-vtable.c * app/menus/plug-in-menus.c * app/plug-in/plug-in-def.c * app/plug-in/plug-in-message.c * app/plug-in/plug-in-progress.c * app/plug-in/plug-in-rc.c * app/plug-in/plug-in-run.c * app/plug-in/plug-in.c * app/plug-in/plug-ins-query.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimpfileprocview.c * app/widgets/gimppluginaction.c * app/xcf/xcf.c * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/plug_in.pdb * tools/pdbgen/app.pl: changed accordingly. * app/pdb/*_cmds.c: regenerated. * app/pdb/gimp-pdb.c: added uglyness to make the app link again.
2006-04-06 18:01:30 +08:00
procedure = gimp_procedure_new (transform_2d_invoker);
gimp_object_set_static_name (GIMP_OBJECT (procedure),
"gimp-transform-2d");
gimp_procedure_set_static_strings (procedure,
"gimp-transform-2d",
"Deprecated: Use 'gimp-item-transform-2d' instead.",
"Deprecated: Use 'gimp-item-transform-2d' instead.",
"",
"",
"",
"gimp-item-transform-2d");
gimp_procedure_add_argument (procedure,
gimp_param_spec_drawable_id ("drawable",
"drawable",
"The affected drawable",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_boolean ("interpolation",
"interpolation",
"Whether to use interpolation",
FALSE,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("source-x",
"source x",
"X coordinate of the transformation center",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("source-y",
"source y",
"Y coordinate of the transformation center",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("scale-x",
"scale x",
"Amount to scale in x direction",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("scale-y",
"scale y",
"Amount to scale in y direction",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("angle",
"angle",
"The angle of rotation (radians)",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("dest-x",
"dest x",
"X coordinate of where the centre goes",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_argument (procedure,
g_param_spec_double ("dest-y",
"dest y",
"Y coordinate of where the centre goes",
-G_MAXDOUBLE, G_MAXDOUBLE, 0,
GIMP_PARAM_READWRITE));
gimp_procedure_add_return_value (procedure,
gimp_param_spec_drawable_id ("drawable",
"drawable",
"The transformed drawable",
pdb->gimp, FALSE,
GIMP_PARAM_READWRITE));
app/pdb/Makefile.am app/pdb/pdb-types.h new object GimpPDB which keeps all 2006-04-26 Michael Natterer <mitch@gimp.org> * app/pdb/Makefile.am * app/pdb/pdb-types.h * app/pdb/gimppdb.[ch]: new object GimpPDB which keeps all procedures and functions to register and run them. Renamed all functions and did some cleanups. * app/pdb/gimp-pdb.[ch] * app/core/gimp.[ch]: removed the same stuff here. * app/pdb/gimp-pdb-query.[ch]: removed these files... * app/pdb/gimppdb-query.[ch]: ...added here as members of GimpPDB. * app/pdb/gimp-pdb-compat.h: fix include guard. * app/batch.c * app/actions/vectors-commands.c * app/dialogs/about-dialog.c * app/file/file-open.c * app/file/file-save.c * app/plug-in/plug-in-message.c * app/plug-in/plug-ins.c * app/widgets/gimpfiledialog.c * app/widgets/gimphelp.c * app/xcf/xcf.c * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/font_select.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/palette_select.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/procedural_db.pdb: changed includes and function calls accordingly. * tools/pdbgen/app.pl: pass around GimpPDB instead of Gimp pointers to register the internal procedures with. Changed some newlines in the generated code. * app/pdb/*_cmds.c * app/pdb/internal_procs.[ch]: regenerated. * app/core/gimppdbprogress.[ch] * app/widgets/gimppdbdialog.[ch]: added "pdb" CONSTRUCT_ONLY properties. * app/plug-in/plug-in-progress.c * app/gui/gui-vtable.c: pass gimp->pdb when creating them. * app/widgets/gimpbrushselect.c * app/widgets/gimpfontselect.c * app/widgets/gimpgradientselect.c * app/widgets/gimppaletteselect.c * app/widgets/gimppatternselect.c: use the new local pdb pointers instead of some foo->bar->gimp->pdb overkill.
2006-04-26 17:13:47 +08:00
gimp_pdb_register_procedure (pdb, procedure);
g_object_unref (procedure);
2001-11-20 02:54:13 +08:00
}