1997-11-25 06:05:25 +08:00
|
|
|
/* 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
|
1998-04-13 13:44:11 +08:00
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2000-10-27 06:02:44 +08:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2000-12-17 05:37:03 +08:00
|
|
|
#include <gtk/gtk.h>
|
2000-01-14 20:41:00 +08:00
|
|
|
|
2001-01-25 06:36:18 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
2001-01-24 07:56:18 +08:00
|
|
|
|
2002-05-03 20:45:22 +08:00
|
|
|
#include "tools-types.h"
|
|
|
|
|
2001-05-09 10:32:03 +08:00
|
|
|
#include "core/gimpimage.h"
|
2001-07-07 22:53:42 +08:00
|
|
|
#include "core/gimpimage-crop.h"
|
2001-11-20 21:53:21 +08:00
|
|
|
#include "core/gimptoolinfo.h"
|
2001-04-18 05:43:29 +08:00
|
|
|
|
2003-08-22 09:42:57 +08:00
|
|
|
#include "widgets/gimphelp-ids.h"
|
2002-03-20 03:17:31 +08:00
|
|
|
|
2003-08-22 09:42:57 +08:00
|
|
|
#include "display/gimpdisplay.h"
|
2003-05-03 02:43:15 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
#include "gimprectangleoptions.h"
|
|
|
|
#include "gimprectangletool.h"
|
2003-02-05 22:39:40 +08:00
|
|
|
#include "gimpcropoptions.h"
|
2001-04-18 05:43:29 +08:00
|
|
|
#include "gimpcroptool.h"
|
2003-04-16 00:05:52 +08:00
|
|
|
#include "gimptoolcontrol.h"
|
2001-04-18 05:43:29 +08:00
|
|
|
|
2003-03-26 00:38:19 +08:00
|
|
|
#include "gimp-intl.h"
|
Lots of ii8n stuff here and some additions to the de.po. Applied
Wed Oct 14 17:46:15 EDT 1998 Adrian Likins <adrian@gimp.org>
* app/*, po/de.po, de/POTFILES.in, libgimp/gimpintl.h:
Lots of ii8n stuff here and some additions to the de.po.
Applied gimp-egger-981005-1 ,gimp-egger-981006-1,
gimp-egger-981007-1, gimp-egger-981008-1,
gimp-egger-981009-1.patch, gimp-egger-981010-1.patch
* plug-in/guillotine/guillotine.c: added the coordinates
of the split images from the original image to the title.
ie foo.jpg (0,0) for the image in the topleft.
* plug-in/script-fu/scripts/neon-logo.scm,
perspective-shadow.scm, predator.scm,rendermap.scm,
ripply-anim.scm, select_to_image.scm,swirltile.scm,
xach-effect.scm: updated scripts to use new script-fu stuff
wooo boy! a big un!
in testing this, it looks like some of the po files are busted.
but the code stuff seems okay.
-adrian
1998-10-15 07:23:52 +08:00
|
|
|
|
2000-12-29 23:22:01 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
static void gimp_crop_tool_class_init (GimpCropToolClass *klass);
|
|
|
|
static void gimp_crop_tool_init (GimpCropTool *crop_tool);
|
|
|
|
static void gimp_crop_tool_rectangle_tool_iface_init (GimpRectangleToolInterface *rectangle_iface);
|
|
|
|
|
|
|
|
static GObject * gimp_crop_tool_constructor (GType type,
|
|
|
|
guint n_params,
|
|
|
|
GObjectConstructParam *params);
|
|
|
|
static void gimp_crop_tool_finalize (GObject *object);
|
|
|
|
static void gimp_crop_tool_control (GimpTool *tool,
|
|
|
|
GimpToolAction action,
|
|
|
|
GimpDisplay *gdisp);
|
|
|
|
|
|
|
|
static void gimp_crop_tool_cursor_update (GimpTool *tool,
|
|
|
|
GimpCoords *coords,
|
|
|
|
GdkModifierType state,
|
|
|
|
GimpDisplay *gdisp);
|
|
|
|
|
|
|
|
static gboolean gimp_crop_tool_execute (GimpRectangleTool *rectangle,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint w,
|
|
|
|
gint h);
|
|
|
|
|
|
|
|
void gimp_crop_tool_set_controls (GimpRectangleTool *tool,
|
|
|
|
GtkWidget *controls);
|
|
|
|
GtkWidget * gimp_crop_tool_get_controls (GimpRectangleTool *tool);
|
|
|
|
void gimp_crop_tool_set_entry (GimpRectangleTool *tool,
|
|
|
|
GtkWidget *entry);
|
|
|
|
GtkWidget * gimp_crop_tool_get_entry (GimpRectangleTool *tool);
|
|
|
|
|
|
|
|
void gimp_crop_tool_set_startx (GimpRectangleTool *tool,
|
|
|
|
gint startx);
|
|
|
|
gint gimp_crop_tool_get_startx (GimpRectangleTool *tool);
|
|
|
|
void gimp_crop_tool_set_starty (GimpRectangleTool *tool,
|
|
|
|
gint starty);
|
|
|
|
gint gimp_crop_tool_get_starty (GimpRectangleTool *tool);
|
|
|
|
|
|
|
|
void gimp_crop_tool_set_lastx (GimpRectangleTool *tool,
|
|
|
|
gint lastx);
|
|
|
|
gint gimp_crop_tool_get_lastx (GimpRectangleTool *tool);
|
|
|
|
void gimp_crop_tool_set_lasty (GimpRectangleTool *tool,
|
|
|
|
gint lasty);
|
|
|
|
gint gimp_crop_tool_get_lasty (GimpRectangleTool *tool);
|
|
|
|
|
|
|
|
void gimp_crop_tool_set_pressx (GimpRectangleTool *tool,
|
|
|
|
gint pressx);
|
|
|
|
gint gimp_crop_tool_get_pressx (GimpRectangleTool *tool);
|
|
|
|
void gimp_crop_tool_set_pressy (GimpRectangleTool *tool,
|
|
|
|
gint pressy);
|
|
|
|
gint gimp_crop_tool_get_pressy (GimpRectangleTool *tool);
|
|
|
|
|
|
|
|
void gimp_crop_tool_set_x1 (GimpRectangleTool *tool,
|
|
|
|
gint x1);
|
|
|
|
gint gimp_crop_tool_get_x1 (GimpRectangleTool *tool);
|
|
|
|
void gimp_crop_tool_set_y1 (GimpRectangleTool *tool,
|
|
|
|
gint y1);
|
|
|
|
gint gimp_crop_tool_get_y1 (GimpRectangleTool *tool);
|
|
|
|
void gimp_crop_tool_set_x2 (GimpRectangleTool *tool,
|
|
|
|
gint x2);
|
|
|
|
gint gimp_crop_tool_get_x2 (GimpRectangleTool *tool);
|
|
|
|
void gimp_crop_tool_set_y2 (GimpRectangleTool *tool,
|
|
|
|
gint y2);
|
|
|
|
gint gimp_crop_tool_get_y2 (GimpRectangleTool *tool);
|
|
|
|
|
|
|
|
void gimp_crop_tool_set_function (GimpRectangleTool *tool,
|
|
|
|
guint function);
|
|
|
|
guint gimp_crop_tool_get_function (GimpRectangleTool *tool);
|
|
|
|
|
|
|
|
void gimp_crop_tool_set_dx1 (GimpRectangleTool *tool,
|
|
|
|
gint dx1);
|
|
|
|
gint gimp_crop_tool_get_dx1 (GimpRectangleTool *tool);
|
|
|
|
void gimp_crop_tool_set_dy1 (GimpRectangleTool *tool,
|
|
|
|
gint dy1);
|
|
|
|
gint gimp_crop_tool_get_dy1 (GimpRectangleTool *tool);
|
|
|
|
void gimp_crop_tool_set_dx2 (GimpRectangleTool *tool,
|
|
|
|
gint dx2);
|
|
|
|
gint gimp_crop_tool_get_dx2 (GimpRectangleTool *tool);
|
|
|
|
void gimp_crop_tool_set_dy2 (GimpRectangleTool *tool,
|
|
|
|
gint dy2);
|
|
|
|
gint gimp_crop_tool_get_dy2 (GimpRectangleTool *tool);
|
|
|
|
|
|
|
|
void gimp_crop_tool_set_dcw (GimpRectangleTool *tool,
|
|
|
|
gint dcw);
|
|
|
|
gint gimp_crop_tool_get_dcw (GimpRectangleTool *tool);
|
|
|
|
void gimp_crop_tool_set_dch (GimpRectangleTool *tool,
|
|
|
|
gint dch);
|
|
|
|
gint gimp_crop_tool_get_dch (GimpRectangleTool *tool);
|
|
|
|
void gimp_crop_tool_set_origx (GimpRectangleTool *tool,
|
|
|
|
gdouble origx);
|
|
|
|
gdouble gimp_crop_tool_get_origx (GimpRectangleTool *tool);
|
|
|
|
void gimp_crop_tool_set_origy (GimpRectangleTool *tool,
|
|
|
|
gdouble origy);
|
|
|
|
gdouble gimp_crop_tool_get_origy (GimpRectangleTool *tool);
|
|
|
|
|
|
|
|
void gimp_crop_tool_set_sizew (GimpRectangleTool *tool,
|
|
|
|
gdouble sizew);
|
|
|
|
gdouble gimp_crop_tool_get_sizew (GimpRectangleTool *tool);
|
|
|
|
void gimp_crop_tool_set_sizeh (GimpRectangleTool *tool,
|
|
|
|
gdouble sizeh);
|
|
|
|
gdouble gimp_crop_tool_get_sizeh (GimpRectangleTool *tool);
|
2001-02-28 11:29:03 +08:00
|
|
|
|
2001-03-02 00:57:16 +08:00
|
|
|
static GimpDrawToolClass *parent_class = NULL;
|
2001-02-28 11:29:03 +08:00
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-11-21 07:00:47 +08:00
|
|
|
/* public functions */
|
2001-07-07 22:53:42 +08:00
|
|
|
|
|
|
|
void
|
2002-03-29 11:50:29 +08:00
|
|
|
gimp_crop_tool_register (GimpToolRegisterCallback callback,
|
2002-05-03 19:31:08 +08:00
|
|
|
gpointer data)
|
1999-10-27 02:27:27 +08:00
|
|
|
{
|
2002-03-29 11:50:29 +08:00
|
|
|
(* callback) (GIMP_TYPE_CROP_TOOL,
|
2003-02-05 22:39:40 +08:00
|
|
|
GIMP_TYPE_CROP_OPTIONS,
|
|
|
|
gimp_crop_options_gui,
|
2003-06-28 19:20:37 +08:00
|
|
|
0,
|
2002-03-21 20:17:17 +08:00
|
|
|
"gimp-crop-tool",
|
GimpViewableDialogs everywhere, cleanup:
2002-09-01 Michael Natterer <mitch@gimp.org>
GimpViewableDialogs everywhere, cleanup:
* libgimpwidgets/gimpstock.c: added texts for the RESIZE, SCALE
and CROP stock items.
* app/widgets/gimpviewabledialog.c: update the title when the
viewable's name changes.
* app/gui/color-notebook.[ch]: added color_notebook_viewable_new()
which creates a GimpViewableDialog.
* app/widgets/gimpgradienteditor.[ch]
* app/gui/colormap-editor-commands.c
* app/gui/file-new-dialog.c
* app/gui/gradient-editor-commands.c
* app/gui/palette-editor-commands.c
* app/undo_history.c: use GimpViewableDialogs and the new
color_notebook constructor.
* app/gui/convert-dialog.c: #include "widgets/gimpviewabledialog.h"
* app/gui/image-commands.c
* app/gui/info-dialog.c
* app/gui/resize-dialog.c: minor cleanups.
* app/gui/info-window.c: cleaned up the whole thing, esp. the
"Extended" page. Added HSV color display to the color picker
frame. Set the icons as frame titles, stuff...
* app/tools/gimpimagemaptool.[ch]: removed "shell_title",
"shell_name" and "stock_id" from the GimpImageMapTool struct
because they can be obtained from the tool's GimpToolInfo object.
* app/tools/gimpbrightnesscontrasttool.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcurvestool.c
* app/tools/gimphuesaturationtool.c
* app/tools/gimplevelstool.c
* app/tools/gimpposterizetool.c
* app/tools/gimpthresholdtool.c: changed accordingly.
* app/tools/gimphistogramtool.c: same here: take values from
tool->tool_info instead of hardcoding them.
* app/tools/gimpcroptool.[ch]: removed the static crop dialog
variables and added them to the GimpCropTool struct. Feels safer
and makes the callback code much simpler. Use stock items for the
dialog's "Resize" and "Crop" buttons.
* app/tools/gimpmeasuretool.c
* app/tools/gimprotatetool.c: for consistency don't name the tools
"Blah Tool", also the dialog titles need to match the menu
entries.
Unrelated:
* libgimpwidgets/gimpwidgets.c: the recently changed, gtk-doc
comment was correct, as gtk-doc takes the parameter names from
the header, not the .c file.
* app/tools/gimptransformtool.c: set the transform tool's state to
TRANSFORM_CREATING after changing displays, so the initial matrix
components are saved correctly for the "Reset" function.
2002-09-01 16:44:57 +08:00
|
|
|
_("Crop & Resize"),
|
2001-11-21 07:00:47 +08:00
|
|
|
_("Crop or Resize an image"),
|
2005-08-15 22:23:28 +08:00
|
|
|
N_("_Crop & Resize"), NULL,
|
2003-08-22 09:42:57 +08:00
|
|
|
NULL, GIMP_HELP_TOOL_CROP,
|
2002-03-29 11:50:29 +08:00
|
|
|
GIMP_STOCK_TOOL_CROP,
|
2002-05-03 19:31:08 +08:00
|
|
|
data);
|
2001-07-07 22:53:42 +08:00
|
|
|
}
|
1998-12-04 14:46:52 +08:00
|
|
|
|
2001-08-14 22:53:55 +08:00
|
|
|
GType
|
2001-07-07 22:53:42 +08:00
|
|
|
gimp_crop_tool_get_type (void)
|
|
|
|
{
|
2001-08-14 22:53:55 +08:00
|
|
|
static GType tool_type = 0;
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2001-07-07 22:53:42 +08:00
|
|
|
if (! tool_type)
|
|
|
|
{
|
2001-08-14 22:53:55 +08:00
|
|
|
static const GTypeInfo tool_info =
|
|
|
|
{
|
|
|
|
sizeof (GimpCropToolClass),
|
2004-06-15 23:30:36 +08:00
|
|
|
(GBaseInitFunc) NULL,
|
|
|
|
(GBaseFinalizeFunc) NULL,
|
|
|
|
(GClassInitFunc) gimp_crop_tool_class_init,
|
|
|
|
NULL, /* class_finalize */
|
|
|
|
NULL, /* class_data */
|
|
|
|
sizeof (GimpCropTool),
|
|
|
|
0, /* n_preallocs */
|
|
|
|
(GInstanceInitFunc) gimp_crop_tool_init,
|
2001-08-14 22:53:55 +08:00
|
|
|
};
|
2005-08-15 22:23:28 +08:00
|
|
|
static const GInterfaceInfo rectangle_info =
|
|
|
|
{
|
|
|
|
(GInterfaceInitFunc) gimp_crop_tool_rectangle_tool_iface_init, /* interface_init */
|
|
|
|
NULL, /* interface_finalize */
|
|
|
|
NULL /* interface_data */
|
|
|
|
};
|
2005-08-23 08:18:08 +08:00
|
|
|
|
2001-08-14 22:53:55 +08:00
|
|
|
tool_type = g_type_register_static (GIMP_TYPE_DRAW_TOOL,
|
2004-06-15 23:30:36 +08:00
|
|
|
"GimpCropTool",
|
2001-08-14 22:53:55 +08:00
|
|
|
&tool_info, 0);
|
2005-08-15 22:23:28 +08:00
|
|
|
g_type_add_interface_static (tool_type,
|
|
|
|
GIMP_TYPE_RECTANGLE_TOOL,
|
|
|
|
&rectangle_info);
|
2001-07-07 22:53:42 +08:00
|
|
|
}
|
2001-08-14 22:53:55 +08:00
|
|
|
|
2001-07-07 22:53:42 +08:00
|
|
|
return tool_type;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1998-12-04 14:46:52 +08:00
|
|
|
static void
|
2001-07-07 22:53:42 +08:00
|
|
|
gimp_crop_tool_class_init (GimpCropToolClass *klass)
|
1999-04-09 06:25:54 +08:00
|
|
|
{
|
2004-06-02 06:04:20 +08:00
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
|
|
|
GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
|
|
|
|
GimpDrawToolClass *draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
|
1999-04-09 06:25:54 +08:00
|
|
|
|
2001-08-14 22:53:55 +08:00
|
|
|
parent_class = g_type_class_peek_parent (klass);
|
2001-07-07 22:53:42 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
object_class->constructor = gimp_crop_tool_constructor;
|
2001-08-14 22:53:55 +08:00
|
|
|
object_class->finalize = gimp_crop_tool_finalize;
|
2001-07-07 22:53:42 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
tool_class->initialize = gimp_rectangle_tool_initialize;
|
2001-07-07 22:53:42 +08:00
|
|
|
tool_class->control = gimp_crop_tool_control;
|
2005-08-15 22:23:28 +08:00
|
|
|
tool_class->button_press = gimp_rectangle_tool_button_press;
|
|
|
|
tool_class->button_release = gimp_rectangle_tool_button_release;
|
|
|
|
tool_class->motion = gimp_rectangle_tool_motion;
|
|
|
|
tool_class->key_press = gimp_rectangle_tool_key_press;
|
|
|
|
tool_class->modifier_key = gimp_rectangle_tool_modifier_key;
|
|
|
|
tool_class->oper_update = gimp_rectangle_tool_oper_update;
|
2001-11-09 03:14:51 +08:00
|
|
|
tool_class->cursor_update = gimp_crop_tool_cursor_update;
|
2001-07-07 22:53:42 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
draw_tool_class->draw = gimp_rectangle_tool_draw;
|
1999-04-09 06:25:54 +08:00
|
|
|
}
|
|
|
|
|
2001-07-07 22:53:42 +08:00
|
|
|
static void
|
|
|
|
gimp_crop_tool_init (GimpCropTool *crop_tool)
|
1998-12-04 14:46:52 +08:00
|
|
|
{
|
2005-08-15 22:23:28 +08:00
|
|
|
GimpTool *tool = GIMP_TOOL (crop_tool);
|
2001-04-01 04:41:39 +08:00
|
|
|
|
2004-06-05 07:08:29 +08:00
|
|
|
gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_CROP);
|
2001-07-07 22:53:42 +08:00
|
|
|
}
|
1998-12-04 14:46:52 +08:00
|
|
|
|
2001-07-07 22:53:42 +08:00
|
|
|
static void
|
2005-08-15 22:23:28 +08:00
|
|
|
gimp_crop_tool_rectangle_tool_iface_init (GimpRectangleToolInterface *rectangle_iface)
|
2001-07-07 22:53:42 +08:00
|
|
|
{
|
2005-08-15 22:23:28 +08:00
|
|
|
rectangle_iface->set_controls = gimp_crop_tool_set_controls;
|
|
|
|
rectangle_iface->get_controls = gimp_crop_tool_get_controls;
|
|
|
|
rectangle_iface->set_entry = gimp_crop_tool_set_entry;
|
|
|
|
rectangle_iface->get_entry = gimp_crop_tool_get_entry;
|
|
|
|
rectangle_iface->set_startx = gimp_crop_tool_set_startx;
|
|
|
|
rectangle_iface->get_startx = gimp_crop_tool_get_startx;
|
|
|
|
rectangle_iface->set_starty = gimp_crop_tool_set_starty;
|
|
|
|
rectangle_iface->get_starty = gimp_crop_tool_get_starty;
|
|
|
|
rectangle_iface->set_lastx = gimp_crop_tool_set_lastx;
|
|
|
|
rectangle_iface->get_lastx = gimp_crop_tool_get_lastx;
|
|
|
|
rectangle_iface->set_lasty = gimp_crop_tool_set_lasty;
|
|
|
|
rectangle_iface->get_lasty = gimp_crop_tool_get_lasty;
|
|
|
|
rectangle_iface->set_pressx = gimp_crop_tool_set_pressx;
|
|
|
|
rectangle_iface->get_pressx = gimp_crop_tool_get_pressx;
|
|
|
|
rectangle_iface->set_pressy = gimp_crop_tool_set_pressy;
|
|
|
|
rectangle_iface->get_pressy = gimp_crop_tool_get_pressy;
|
|
|
|
rectangle_iface->set_x1 = gimp_crop_tool_set_x1;
|
|
|
|
rectangle_iface->get_x1 = gimp_crop_tool_get_x1;
|
|
|
|
rectangle_iface->set_y1 = gimp_crop_tool_set_y1;
|
|
|
|
rectangle_iface->get_y1 = gimp_crop_tool_get_y1;
|
|
|
|
rectangle_iface->set_x2 = gimp_crop_tool_set_x2;
|
|
|
|
rectangle_iface->get_x2 = gimp_crop_tool_get_x2;
|
|
|
|
rectangle_iface->set_y2 = gimp_crop_tool_set_y2;
|
|
|
|
rectangle_iface->get_y2 = gimp_crop_tool_get_y2;
|
|
|
|
rectangle_iface->set_function = gimp_crop_tool_set_function;
|
|
|
|
rectangle_iface->get_function = gimp_crop_tool_get_function;
|
|
|
|
rectangle_iface->set_dx1 = gimp_crop_tool_set_dx1;
|
|
|
|
rectangle_iface->get_dx1 = gimp_crop_tool_get_dx1;
|
|
|
|
rectangle_iface->set_dy1 = gimp_crop_tool_set_dy1;
|
|
|
|
rectangle_iface->get_dy1 = gimp_crop_tool_get_dy1;
|
|
|
|
rectangle_iface->set_dx2 = gimp_crop_tool_set_dx2;
|
|
|
|
rectangle_iface->get_dx2 = gimp_crop_tool_get_dx2;
|
|
|
|
rectangle_iface->set_dy2 = gimp_crop_tool_set_dy2;
|
|
|
|
rectangle_iface->get_dy2 = gimp_crop_tool_get_dy2;
|
|
|
|
rectangle_iface->set_dcw = gimp_crop_tool_set_dcw;
|
|
|
|
rectangle_iface->get_dcw = gimp_crop_tool_get_dcw;
|
|
|
|
rectangle_iface->set_dch = gimp_crop_tool_set_dch;
|
|
|
|
rectangle_iface->get_dch = gimp_crop_tool_get_dch;
|
|
|
|
rectangle_iface->set_origx = gimp_crop_tool_set_origx;
|
|
|
|
rectangle_iface->get_origx = gimp_crop_tool_get_origx;
|
|
|
|
rectangle_iface->set_origy = gimp_crop_tool_set_origy;
|
|
|
|
rectangle_iface->get_origy = gimp_crop_tool_get_origy;
|
|
|
|
rectangle_iface->set_sizew = gimp_crop_tool_set_sizew;
|
|
|
|
rectangle_iface->get_sizew = gimp_crop_tool_get_sizew;
|
|
|
|
rectangle_iface->set_sizeh = gimp_crop_tool_set_sizeh;
|
|
|
|
rectangle_iface->get_sizeh = gimp_crop_tool_get_sizeh;
|
|
|
|
rectangle_iface->execute = gimp_crop_tool_execute;
|
2001-08-14 22:53:55 +08:00
|
|
|
}
|
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
static GObject *
|
|
|
|
gimp_crop_tool_constructor (GType type,
|
|
|
|
guint n_params,
|
|
|
|
GObjectConstructParam *params)
|
2001-08-14 22:53:55 +08:00
|
|
|
{
|
2005-08-15 22:23:28 +08:00
|
|
|
GObject *object;
|
2004-11-02 19:26:05 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
|
2001-08-14 22:53:55 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
gimp_rectangle_tool_constructor (object);
|
2001-08-14 22:53:55 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
return object;
|
1998-12-04 14:46:52 +08:00
|
|
|
}
|
|
|
|
|
1998-03-19 06:35:31 +08:00
|
|
|
static void
|
2005-08-15 22:23:28 +08:00
|
|
|
gimp_crop_tool_finalize (GObject *object)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-08-15 22:23:28 +08:00
|
|
|
gimp_rectangle_tool_finalize (object);
|
2005-08-23 08:18:08 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1998-03-19 06:35:31 +08:00
|
|
|
static void
|
2005-08-15 22:23:28 +08:00
|
|
|
gimp_crop_tool_control (GimpTool *tool,
|
|
|
|
GimpToolAction action,
|
|
|
|
GimpDisplay *gdisp)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-08-15 22:23:28 +08:00
|
|
|
gimp_rectangle_tool_control (tool, action, gdisp);
|
1998-07-27 05:49:42 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
GIMP_TOOL_CLASS (parent_class)->control (tool, action, gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
1998-03-19 06:35:31 +08:00
|
|
|
static void
|
2005-08-15 22:23:28 +08:00
|
|
|
gimp_crop_tool_cursor_update (GimpTool *tool,
|
|
|
|
GimpCoords *coords,
|
|
|
|
GdkModifierType state,
|
|
|
|
GimpDisplay *gdisp)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-08-15 22:23:28 +08:00
|
|
|
gimp_rectangle_tool_cursor_update (tool, coords, state, gdisp);
|
|
|
|
gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_CROP);
|
2001-07-07 22:53:42 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, gdisp);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2004-06-24 18:16:08 +08:00
|
|
|
static gboolean
|
2005-08-15 22:23:28 +08:00
|
|
|
gimp_crop_tool_execute (GimpRectangleTool *rectangle,
|
|
|
|
gint x,
|
|
|
|
gint y,
|
|
|
|
gint w,
|
|
|
|
gint h)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-08-15 22:23:28 +08:00
|
|
|
GimpTool *tool = GIMP_TOOL (rectangle);
|
|
|
|
GimpCropOptions *options;
|
|
|
|
GimpImage *gimage;
|
|
|
|
gboolean rectangle_exists;
|
2004-10-01 23:15:14 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
options = GIMP_CROP_OPTIONS (tool->tool_info->tool_options);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
gimage = tool->gdisp->gimage;
|
1999-04-08 13:20:37 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
rectangle_exists = (w > 0 && h > 0);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
/* if rectangle exists, crop it */
|
|
|
|
if (rectangle_exists)
|
2003-08-17 06:15:36 +08:00
|
|
|
{
|
2005-08-15 22:23:28 +08:00
|
|
|
gimp_image_crop (gimage, GIMP_CONTEXT (options),
|
|
|
|
x, y, w + x, h + y,
|
|
|
|
options->layer_only,
|
|
|
|
options->crop_mode == GIMP_CROP_MODE_CROP);
|
2005-08-23 08:18:08 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
gimp_image_flush (gimage);
|
2001-03-02 00:57:16 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
return TRUE;
|
2003-08-17 06:15:36 +08:00
|
|
|
}
|
|
|
|
|
2004-06-24 18:16:08 +08:00
|
|
|
return TRUE;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
void
|
|
|
|
gimp_crop_tool_set_controls (GimpRectangleTool *tool,
|
|
|
|
GtkWidget *controls)
|
1999-04-27 10:09:03 +08:00
|
|
|
{
|
2005-08-15 22:23:28 +08:00
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
crop_tool->controls = controls;
|
1999-04-27 10:09:03 +08:00
|
|
|
}
|
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
GtkWidget *
|
|
|
|
gimp_crop_tool_get_controls (GimpRectangleTool *tool)
|
2001-11-09 03:14:51 +08:00
|
|
|
{
|
2005-08-15 22:23:28 +08:00
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
return crop_tool->controls;
|
2003-08-17 06:15:36 +08:00
|
|
|
}
|
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
void
|
|
|
|
gimp_crop_tool_set_entry (GimpRectangleTool *tool,
|
|
|
|
GtkWidget *entry)
|
2003-08-17 06:15:36 +08:00
|
|
|
{
|
2005-08-15 22:23:28 +08:00
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
crop_tool->dimensions_entry = entry;
|
2001-11-09 03:14:51 +08:00
|
|
|
}
|
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
GtkWidget *
|
|
|
|
gimp_crop_tool_get_entry (GimpRectangleTool *tool)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-08-15 22:23:28 +08:00
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
return crop_tool->dimensions_entry;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
void
|
|
|
|
gimp_crop_tool_set_startx (GimpRectangleTool *tool,
|
|
|
|
gint startx)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-08-15 22:23:28 +08:00
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
crop_tool->startx = startx;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
gint
|
|
|
|
gimp_crop_tool_get_startx (GimpRectangleTool *tool)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-08-15 22:23:28 +08:00
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
return crop_tool->startx;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
void
|
|
|
|
gimp_crop_tool_set_starty (GimpRectangleTool *tool,
|
|
|
|
gint starty)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-08-15 22:23:28 +08:00
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
crop_tool->starty = starty;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
gint
|
|
|
|
gimp_crop_tool_get_starty (GimpRectangleTool *tool)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-08-15 22:23:28 +08:00
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
return crop_tool->starty;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
void
|
|
|
|
gimp_crop_tool_set_lastx (GimpRectangleTool *tool,
|
|
|
|
gint lastx)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-08-15 22:23:28 +08:00
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
crop_tool->lastx = lastx;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
gint
|
|
|
|
gimp_crop_tool_get_lastx (GimpRectangleTool *tool)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-08-15 22:23:28 +08:00
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
return crop_tool->lastx;
|
|
|
|
}
|
2004-10-01 20:23:43 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
void
|
|
|
|
gimp_crop_tool_set_lasty (GimpRectangleTool *tool,
|
|
|
|
gint lasty)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
crop_tool->lasty = lasty;
|
|
|
|
}
|
2004-09-06 07:42:30 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
gint
|
|
|
|
gimp_crop_tool_get_lasty (GimpRectangleTool *tool)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
return crop_tool->lasty;
|
|
|
|
}
|
1999-06-26 19:16:47 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
void
|
|
|
|
gimp_crop_tool_set_pressx (GimpRectangleTool *tool,
|
|
|
|
gint pressx)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
crop_tool->pressx = pressx;
|
|
|
|
}
|
2003-08-17 06:15:36 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
gint
|
|
|
|
gimp_crop_tool_get_pressx (GimpRectangleTool *tool)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
return crop_tool->pressx;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
void
|
|
|
|
gimp_crop_tool_set_pressy (GimpRectangleTool *tool,
|
|
|
|
gint pressy)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2005-08-15 22:23:28 +08:00
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
crop_tool->pressy = pressy;
|
|
|
|
}
|
2003-02-05 22:39:40 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
gint
|
|
|
|
gimp_crop_tool_get_pressy (GimpRectangleTool *tool)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
return crop_tool->pressy;
|
|
|
|
}
|
2001-11-10 22:17:01 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
void
|
|
|
|
gimp_crop_tool_set_x1 (GimpRectangleTool *tool,
|
|
|
|
gint x1)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
crop_tool->x1 = x1;
|
|
|
|
}
|
2001-11-10 22:17:01 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
gint
|
|
|
|
gimp_crop_tool_get_x1 (GimpRectangleTool *tool)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
return crop_tool->x1;
|
|
|
|
}
|
2001-11-20 21:53:21 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
void
|
|
|
|
gimp_crop_tool_set_y1 (GimpRectangleTool *tool,
|
|
|
|
gint y1)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
crop_tool->y1 = y1;
|
|
|
|
}
|
2004-06-15 23:30:36 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
gint
|
|
|
|
gimp_crop_tool_get_y1 (GimpRectangleTool *tool)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
return crop_tool->y1;
|
|
|
|
}
|
2001-11-20 21:53:21 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
void
|
|
|
|
gimp_crop_tool_set_x2 (GimpRectangleTool *tool,
|
|
|
|
gint x2)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
crop_tool->x2 = x2;
|
1999-04-13 05:53:41 +08:00
|
|
|
}
|
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
gint
|
|
|
|
gimp_crop_tool_get_x2 (GimpRectangleTool *tool)
|
1999-04-13 05:53:41 +08:00
|
|
|
{
|
2005-08-15 22:23:28 +08:00
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
return crop_tool->x2;
|
|
|
|
}
|
2003-09-30 02:06:15 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
void
|
|
|
|
gimp_crop_tool_set_y2 (GimpRectangleTool *tool,
|
|
|
|
gint y2)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
crop_tool->y2 = y2;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
gint
|
|
|
|
gimp_crop_tool_get_y2 (GimpRectangleTool *tool)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
return crop_tool->y2;
|
|
|
|
}
|
1999-07-01 00:19:52 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
void
|
|
|
|
gimp_crop_tool_set_function (GimpRectangleTool *tool,
|
|
|
|
guint function)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
crop_tool->function = function;
|
|
|
|
}
|
1999-04-13 05:53:41 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
guint
|
|
|
|
gimp_crop_tool_get_function (GimpRectangleTool *tool)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
return crop_tool->function;
|
|
|
|
}
|
2003-08-17 06:15:36 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
void
|
|
|
|
gimp_crop_tool_set_dx1 (GimpRectangleTool *tool,
|
|
|
|
gint dx1)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
crop_tool->dx1 = dx1;
|
|
|
|
}
|
2001-11-20 21:53:21 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
gint
|
|
|
|
gimp_crop_tool_get_dx1 (GimpRectangleTool *tool)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
return crop_tool->dx1;
|
|
|
|
}
|
GimpViewableDialogs everywhere, cleanup:
2002-09-01 Michael Natterer <mitch@gimp.org>
GimpViewableDialogs everywhere, cleanup:
* libgimpwidgets/gimpstock.c: added texts for the RESIZE, SCALE
and CROP stock items.
* app/widgets/gimpviewabledialog.c: update the title when the
viewable's name changes.
* app/gui/color-notebook.[ch]: added color_notebook_viewable_new()
which creates a GimpViewableDialog.
* app/widgets/gimpgradienteditor.[ch]
* app/gui/colormap-editor-commands.c
* app/gui/file-new-dialog.c
* app/gui/gradient-editor-commands.c
* app/gui/palette-editor-commands.c
* app/undo_history.c: use GimpViewableDialogs and the new
color_notebook constructor.
* app/gui/convert-dialog.c: #include "widgets/gimpviewabledialog.h"
* app/gui/image-commands.c
* app/gui/info-dialog.c
* app/gui/resize-dialog.c: minor cleanups.
* app/gui/info-window.c: cleaned up the whole thing, esp. the
"Extended" page. Added HSV color display to the color picker
frame. Set the icons as frame titles, stuff...
* app/tools/gimpimagemaptool.[ch]: removed "shell_title",
"shell_name" and "stock_id" from the GimpImageMapTool struct
because they can be obtained from the tool's GimpToolInfo object.
* app/tools/gimpbrightnesscontrasttool.c
* app/tools/gimpcolorbalancetool.c
* app/tools/gimpcurvestool.c
* app/tools/gimphuesaturationtool.c
* app/tools/gimplevelstool.c
* app/tools/gimpposterizetool.c
* app/tools/gimpthresholdtool.c: changed accordingly.
* app/tools/gimphistogramtool.c: same here: take values from
tool->tool_info instead of hardcoding them.
* app/tools/gimpcroptool.[ch]: removed the static crop dialog
variables and added them to the GimpCropTool struct. Feels safer
and makes the callback code much simpler. Use stock items for the
dialog's "Resize" and "Crop" buttons.
* app/tools/gimpmeasuretool.c
* app/tools/gimprotatetool.c: for consistency don't name the tools
"Blah Tool", also the dialog titles need to match the menu
entries.
Unrelated:
* libgimpwidgets/gimpwidgets.c: the recently changed, gtk-doc
comment was correct, as gtk-doc takes the parameter names from
the header, not the .c file.
* app/tools/gimptransformtool.c: set the transform tool's state to
TRANSFORM_CREATING after changing displays, so the initial matrix
components are saved correctly for the "Reset" function.
2002-09-01 16:44:57 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
void
|
|
|
|
gimp_crop_tool_set_dy1 (GimpRectangleTool *tool,
|
|
|
|
gint dy1)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
crop_tool->dy1 = dy1;
|
1999-04-15 07:39:12 +08:00
|
|
|
}
|
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
gint
|
|
|
|
gimp_crop_tool_get_dy1 (GimpRectangleTool *tool)
|
1998-08-15 21:34:54 +08:00
|
|
|
{
|
2005-08-15 22:23:28 +08:00
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
return crop_tool->dy1;
|
|
|
|
}
|
1998-08-15 21:34:54 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
void
|
|
|
|
gimp_crop_tool_set_dx2 (GimpRectangleTool *tool,
|
|
|
|
gint dx2)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
crop_tool->dx2 = dx2;
|
|
|
|
}
|
1998-08-15 21:34:54 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
gint
|
|
|
|
gimp_crop_tool_get_dx2 (GimpRectangleTool *tool)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
return crop_tool->dx2;
|
|
|
|
}
|
2001-11-10 22:17:01 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
void
|
|
|
|
gimp_crop_tool_set_dy2 (GimpRectangleTool *tool,
|
|
|
|
gint dy2)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
crop_tool->dy2 = dy2;
|
|
|
|
}
|
2001-11-10 22:17:01 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
gint
|
|
|
|
gimp_crop_tool_get_dy2 (GimpRectangleTool *tool)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
return crop_tool->dy2;
|
|
|
|
}
|
2001-11-10 22:17:01 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
void
|
|
|
|
gimp_crop_tool_set_dcw (GimpRectangleTool *tool,
|
|
|
|
gint dcw)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
crop_tool->dcw = dcw;
|
1998-08-15 21:34:54 +08:00
|
|
|
}
|
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
gint
|
|
|
|
gimp_crop_tool_get_dcw (GimpRectangleTool *tool)
|
1998-08-15 21:34:54 +08:00
|
|
|
{
|
2005-08-15 22:23:28 +08:00
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
return crop_tool->dcw;
|
|
|
|
}
|
1998-08-15 21:34:54 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
void
|
|
|
|
gimp_crop_tool_set_dch (GimpRectangleTool *tool,
|
|
|
|
gint dch)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
crop_tool->dch = dch;
|
|
|
|
}
|
1998-08-15 21:34:54 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
gint
|
|
|
|
gimp_crop_tool_get_dch (GimpRectangleTool *tool)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
return crop_tool->dch;
|
|
|
|
}
|
2001-11-10 22:17:01 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
void
|
|
|
|
gimp_crop_tool_set_origx (GimpRectangleTool *tool,
|
|
|
|
gdouble origx)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
crop_tool->origx = origx;
|
|
|
|
}
|
2001-11-10 22:17:01 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
gdouble
|
|
|
|
gimp_crop_tool_get_origx (GimpRectangleTool *tool)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
return crop_tool->origx;
|
1998-08-15 21:34:54 +08:00
|
|
|
}
|
2004-04-15 23:17:36 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
void
|
|
|
|
gimp_crop_tool_set_origy (GimpRectangleTool *tool,
|
|
|
|
gdouble origy)
|
2004-04-15 23:17:36 +08:00
|
|
|
{
|
2005-08-15 22:23:28 +08:00
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
crop_tool->origy = origy;
|
|
|
|
}
|
2004-04-15 23:17:36 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
gdouble
|
|
|
|
gimp_crop_tool_get_origy (GimpRectangleTool *tool)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
return crop_tool->origy;
|
|
|
|
}
|
2004-04-15 23:17:36 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
void
|
|
|
|
gimp_crop_tool_set_sizew (GimpRectangleTool *tool,
|
|
|
|
gdouble sizew)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
crop_tool->sizew = sizew;
|
|
|
|
}
|
2004-04-15 23:17:36 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
gdouble
|
|
|
|
gimp_crop_tool_get_sizew (GimpRectangleTool *tool)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
return crop_tool->sizew;
|
|
|
|
}
|
2005-01-24 03:33:31 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
void
|
|
|
|
gimp_crop_tool_set_sizeh (GimpRectangleTool *tool,
|
|
|
|
gdouble sizeh)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
crop_tool->sizeh = sizeh;
|
|
|
|
}
|
2004-04-15 23:17:36 +08:00
|
|
|
|
2005-08-15 22:23:28 +08:00
|
|
|
gdouble
|
|
|
|
gimp_crop_tool_get_sizeh (GimpRectangleTool *tool)
|
|
|
|
{
|
|
|
|
GimpCropTool *crop_tool = GIMP_CROP_TOOL (tool);
|
|
|
|
return crop_tool->sizeh;
|
2004-04-15 23:17:36 +08:00
|
|
|
}
|
|
|
|
|