2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
1997-11-25 06:05:25 +08:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
Merged the Polygon Select Tool capabilities with the Free Select Tool.
2008-05-18 Martin Nordholts <martinn@svn.gnome.org>
Merged the Polygon Select Tool capabilities with the Free Select
Tool. Among the things still to do is improved help texts, more
suitable graphics, and cursor mangement, but the core
functionality is in place. Thanks to Alexia Death for initial
testing. It will also be neccesary to do some work to adapt the
Foreground Select Tool to the new Free Select Tool implementation.
Quick instructions on how the tool works:
o A click adds a polygonal segment, a drag adds a free-hand
segment
o Return-key commits, Escape-key cancels, Backspace-key removes
last segment
o You can grab and move segment vertices
o You can cancel both a move, and the creation of a segment
* app/tools/gimpfreeselecttool.[ch]: More or less
reimplemented. We keep a sequential array of all the points in the
polygon (including the free segments), and we have another array
with point indices that we use to represent the segments. On top
of this we have a few helper functions that tries to abstract away
the pretty raw nature of the implementation.
* app/tools/gimpforegroundselecttool.[ch]: Keep track on its own
last_coord, and adjust to the new implementation of the Free
Select Tool. Still needs some work, for example handling that the
Free Select Tool now resets GimpTool::display.
(gimp_foreground_select_tool_key_press): Pass on key event to
parent class when appropriate. (Bails out too early though...)
svn path=/trunk/; revision=25693
2008-05-18 19:39:17 +08:00
|
|
|
* Major improvement to support polygonal segments
|
|
|
|
* Copyright (C) 2008 Martin Nordholts
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
1997-11-25 06:05:25 +08:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
1997-11-25 06:05:25 +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
|
2009-01-18 06:28:01 +08:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
1997-11-25 06:05:25 +08:00
|
|
|
*/
|
2000-07-30 00:12:40 +08:00
|
|
|
|
2000-12-17 05:37:03 +08:00
|
|
|
#include "config.h"
|
|
|
|
|
2008-10-10 04:24:04 +08:00
|
|
|
#include <gegl.h>
|
2000-12-29 23:22:01 +08:00
|
|
|
#include <gtk/gtk.h>
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2001-08-06 00:08:19 +08:00
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
2001-05-10 06:34:59 +08:00
|
|
|
#include "tools-types.h"
|
2000-12-17 05:37:03 +08:00
|
|
|
|
2001-05-09 10:32:03 +08:00
|
|
|
#include "core/gimpchannel.h"
|
2003-10-06 20:17:11 +08:00
|
|
|
#include "core/gimpchannel-select.h"
|
2001-05-09 10:32:03 +08:00
|
|
|
#include "core/gimpimage.h"
|
2016-05-20 22:46:26 +08:00
|
|
|
#include "core/gimplayer-floating-selection.h"
|
2001-01-25 06:36:18 +08:00
|
|
|
|
2003-08-22 09:42:57 +08:00
|
|
|
#include "widgets/gimphelp-ids.h"
|
|
|
|
|
2001-09-26 07:23:09 +08:00
|
|
|
#include "display/gimpdisplay.h"
|
2017-06-23 07:59:37 +08:00
|
|
|
#include "display/gimptoolpolygon.h"
|
2001-09-26 07:23:09 +08:00
|
|
|
|
2001-03-10 01:39:18 +08:00
|
|
|
#include "gimpfreeselecttool.h"
|
2003-02-09 05:12:03 +08:00
|
|
|
#include "gimpselectionoptions.h"
|
2003-04-16 00:05:52 +08:00
|
|
|
#include "gimptoolcontrol.h"
|
2001-03-10 01:39:18 +08:00
|
|
|
|
2003-03-26 00:38:19 +08:00
|
|
|
#include "gimp-intl.h"
|
2001-03-10 01:39:18 +08:00
|
|
|
|
2000-07-30 00:12:40 +08:00
|
|
|
|
2017-06-23 07:59:37 +08:00
|
|
|
struct _GimpFreeSelectToolPrivate
|
2008-05-22 03:36:16 +08:00
|
|
|
{
|
2008-05-22 23:40:18 +08:00
|
|
|
/* The selection operation active when the tool was started */
|
2017-06-23 07:59:37 +08:00
|
|
|
GimpChannelOps operation_at_start;
|
2008-05-25 22:31:33 +08:00
|
|
|
|
2017-06-23 07:59:37 +08:00
|
|
|
GimpToolWidget *polygon;
|
|
|
|
GimpToolWidget *grab_widget;
|
|
|
|
};
|
2008-05-22 03:36:16 +08:00
|
|
|
|
Merged the Polygon Select Tool capabilities with the Free Select Tool.
2008-05-18 Martin Nordholts <martinn@svn.gnome.org>
Merged the Polygon Select Tool capabilities with the Free Select
Tool. Among the things still to do is improved help texts, more
suitable graphics, and cursor mangement, but the core
functionality is in place. Thanks to Alexia Death for initial
testing. It will also be neccesary to do some work to adapt the
Foreground Select Tool to the new Free Select Tool implementation.
Quick instructions on how the tool works:
o A click adds a polygonal segment, a drag adds a free-hand
segment
o Return-key commits, Escape-key cancels, Backspace-key removes
last segment
o You can grab and move segment vertices
o You can cancel both a move, and the creation of a segment
* app/tools/gimpfreeselecttool.[ch]: More or less
reimplemented. We keep a sequential array of all the points in the
polygon (including the free segments), and we have another array
with point indices that we use to represent the segments. On top
of this we have a few helper functions that tries to abstract away
the pretty raw nature of the implementation.
* app/tools/gimpforegroundselecttool.[ch]: Keep track on its own
last_coord, and adjust to the new implementation of the Free
Select Tool. Still needs some work, for example handling that the
Free Select Tool now resets GimpTool::display.
(gimp_foreground_select_tool_key_press): Pass on key event to
parent class when appropriate. (Bails out too early though...)
svn path=/trunk/; revision=25693
2008-05-18 19:39:17 +08:00
|
|
|
|
2008-06-20 20:34:37 +08:00
|
|
|
static void gimp_free_select_tool_finalize (GObject *object);
|
|
|
|
static void gimp_free_select_tool_control (GimpTool *tool,
|
|
|
|
GimpToolAction action,
|
|
|
|
GimpDisplay *display);
|
|
|
|
static void gimp_free_select_tool_oper_update (GimpTool *tool,
|
2008-11-01 23:17:36 +08:00
|
|
|
const GimpCoords *coords,
|
2008-06-20 20:34:37 +08:00
|
|
|
GdkModifierType state,
|
|
|
|
gboolean proximity,
|
|
|
|
GimpDisplay *display);
|
|
|
|
static void gimp_free_select_tool_cursor_update (GimpTool *tool,
|
2008-11-01 23:17:36 +08:00
|
|
|
const GimpCoords *coords,
|
2008-06-20 20:34:37 +08:00
|
|
|
GdkModifierType state,
|
|
|
|
GimpDisplay *display);
|
|
|
|
static void gimp_free_select_tool_button_press (GimpTool *tool,
|
2008-11-01 23:17:36 +08:00
|
|
|
const GimpCoords *coords,
|
2008-06-20 20:34:37 +08:00
|
|
|
guint32 time,
|
|
|
|
GdkModifierType state,
|
2009-06-20 23:37:31 +08:00
|
|
|
GimpButtonPressType press_type,
|
2008-06-20 20:34:37 +08:00
|
|
|
GimpDisplay *display);
|
|
|
|
static void gimp_free_select_tool_button_release (GimpTool *tool,
|
2008-11-01 23:17:36 +08:00
|
|
|
const GimpCoords *coords,
|
2008-06-20 20:34:37 +08:00
|
|
|
guint32 time,
|
|
|
|
GdkModifierType state,
|
|
|
|
GimpButtonReleaseType release_type,
|
|
|
|
GimpDisplay *display);
|
|
|
|
static void gimp_free_select_tool_motion (GimpTool *tool,
|
2008-11-01 23:17:36 +08:00
|
|
|
const GimpCoords *coords,
|
2008-06-20 20:34:37 +08:00
|
|
|
guint32 time,
|
|
|
|
GdkModifierType state,
|
|
|
|
GimpDisplay *display);
|
|
|
|
static gboolean gimp_free_select_tool_key_press (GimpTool *tool,
|
|
|
|
GdkEventKey *kevent,
|
|
|
|
GimpDisplay *display);
|
|
|
|
static void gimp_free_select_tool_modifier_key (GimpTool *tool,
|
|
|
|
GdkModifierType key,
|
|
|
|
gboolean press,
|
|
|
|
GdkModifierType state,
|
|
|
|
GimpDisplay *display);
|
|
|
|
static void gimp_free_select_tool_active_modifier_key (GimpTool *tool,
|
|
|
|
GdkModifierType key,
|
|
|
|
gboolean press,
|
|
|
|
GdkModifierType state,
|
|
|
|
GimpDisplay *display);
|
2017-06-23 07:59:37 +08:00
|
|
|
|
2008-06-20 20:34:37 +08:00
|
|
|
static void gimp_free_select_tool_draw (GimpDrawTool *draw_tool);
|
2017-06-23 07:59:37 +08:00
|
|
|
|
2008-06-20 20:34:37 +08:00
|
|
|
static void gimp_free_select_tool_real_select (GimpFreeSelectTool *fst,
|
2017-06-23 07:59:37 +08:00
|
|
|
GimpDisplay *display,
|
|
|
|
const GimpVector2 *points,
|
|
|
|
gint n_points);
|
|
|
|
|
|
|
|
static void gimp_free_select_tool_polygon_changed (GimpToolWidget *polygon,
|
|
|
|
GimpFreeSelectTool *fst);
|
|
|
|
static void gimp_free_select_tool_polygon_status (GimpToolWidget *polygon,
|
|
|
|
const gchar *status,
|
|
|
|
GimpFreeSelectTool *fst);
|
|
|
|
static void gimp_free_select_tool_polygon_commit (GimpToolWidget *polygon,
|
|
|
|
GimpFreeSelectTool *fst);
|
|
|
|
static void gimp_free_select_tool_polygon_cancel (GimpToolWidget *polygon,
|
|
|
|
GimpFreeSelectTool *fst);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2000-12-31 12:07:42 +08:00
|
|
|
|
2005-12-13 17:13:50 +08:00
|
|
|
G_DEFINE_TYPE (GimpFreeSelectTool, gimp_free_select_tool,
|
|
|
|
GIMP_TYPE_SELECTION_TOOL);
|
1999-04-13 01:55:06 +08:00
|
|
|
|
2005-12-13 17:13:50 +08:00
|
|
|
#define parent_class gimp_free_select_tool_parent_class
|
1997-11-25 06:05:25 +08:00
|
|
|
|
1999-04-09 06:25:54 +08:00
|
|
|
|
2001-03-10 01:39:18 +08:00
|
|
|
void
|
2002-03-29 11:50:29 +08:00
|
|
|
gimp_free_select_tool_register (GimpToolRegisterCallback callback,
|
2002-05-03 19:31:08 +08:00
|
|
|
gpointer data)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2002-03-29 11:50:29 +08:00
|
|
|
(* callback) (GIMP_TYPE_FREE_SELECT_TOOL,
|
2003-02-05 22:39:40 +08:00
|
|
|
GIMP_TYPE_SELECTION_OPTIONS,
|
|
|
|
gimp_selection_options_gui,
|
2003-06-28 19:20:37 +08:00
|
|
|
0,
|
2002-03-21 20:17:17 +08:00
|
|
|
"gimp-free-select-tool",
|
2001-11-21 07:00:47 +08:00
|
|
|
_("Free Select"),
|
2016-10-07 04:44:07 +08:00
|
|
|
_("Free Select Tool: Select a hand-drawn region with free "
|
|
|
|
"and polygonal segments"),
|
2004-04-29 21:19:28 +08:00
|
|
|
N_("_Free Select"), "F",
|
2003-08-22 09:42:57 +08:00
|
|
|
NULL, GIMP_HELP_TOOL_FREE_SELECT,
|
2017-03-05 23:01:59 +08:00
|
|
|
GIMP_ICON_TOOL_FREE_SELECT,
|
2002-05-03 19:31:08 +08:00
|
|
|
data);
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2001-03-10 01:39:18 +08:00
|
|
|
static void
|
|
|
|
gimp_free_select_tool_class_init (GimpFreeSelectToolClass *klass)
|
|
|
|
{
|
2004-06-05 07:08:29 +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);
|
2001-03-10 01:39:18 +08:00
|
|
|
|
2008-06-20 20:34:37 +08:00
|
|
|
object_class->finalize = gimp_free_select_tool_finalize;
|
2001-03-10 01:39:18 +08:00
|
|
|
|
2008-06-20 20:34:37 +08:00
|
|
|
tool_class->control = gimp_free_select_tool_control;
|
|
|
|
tool_class->oper_update = gimp_free_select_tool_oper_update;
|
|
|
|
tool_class->cursor_update = gimp_free_select_tool_cursor_update;
|
|
|
|
tool_class->button_press = gimp_free_select_tool_button_press;
|
|
|
|
tool_class->button_release = gimp_free_select_tool_button_release;
|
|
|
|
tool_class->motion = gimp_free_select_tool_motion;
|
|
|
|
tool_class->key_press = gimp_free_select_tool_key_press;
|
|
|
|
tool_class->modifier_key = gimp_free_select_tool_modifier_key;
|
|
|
|
tool_class->active_modifier_key = gimp_free_select_tool_active_modifier_key;
|
2001-03-10 01:39:18 +08:00
|
|
|
|
2008-06-20 20:34:37 +08:00
|
|
|
draw_tool_class->draw = gimp_free_select_tool_draw;
|
2005-07-29 09:48:56 +08:00
|
|
|
|
2008-06-20 20:34:37 +08:00
|
|
|
klass->select = gimp_free_select_tool_real_select;
|
2008-05-22 03:36:16 +08:00
|
|
|
|
2008-08-16 18:07:43 +08:00
|
|
|
g_type_class_add_private (klass, sizeof (GimpFreeSelectToolPrivate));
|
2001-03-10 01:39:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
Merged the Polygon Select Tool capabilities with the Free Select Tool.
2008-05-18 Martin Nordholts <martinn@svn.gnome.org>
Merged the Polygon Select Tool capabilities with the Free Select
Tool. Among the things still to do is improved help texts, more
suitable graphics, and cursor mangement, but the core
functionality is in place. Thanks to Alexia Death for initial
testing. It will also be neccesary to do some work to adapt the
Foreground Select Tool to the new Free Select Tool implementation.
Quick instructions on how the tool works:
o A click adds a polygonal segment, a drag adds a free-hand
segment
o Return-key commits, Escape-key cancels, Backspace-key removes
last segment
o You can grab and move segment vertices
o You can cancel both a move, and the creation of a segment
* app/tools/gimpfreeselecttool.[ch]: More or less
reimplemented. We keep a sequential array of all the points in the
polygon (including the free segments), and we have another array
with point indices that we use to represent the segments. On top
of this we have a few helper functions that tries to abstract away
the pretty raw nature of the implementation.
* app/tools/gimpforegroundselecttool.[ch]: Keep track on its own
last_coord, and adjust to the new implementation of the Free
Select Tool. Still needs some work, for example handling that the
Free Select Tool now resets GimpTool::display.
(gimp_foreground_select_tool_key_press): Pass on key event to
parent class when appropriate. (Bails out too early though...)
svn path=/trunk/; revision=25693
2008-05-18 19:39:17 +08:00
|
|
|
gimp_free_select_tool_init (GimpFreeSelectTool *fst)
|
2001-03-10 01:39:18 +08:00
|
|
|
{
|
2017-06-23 07:59:37 +08:00
|
|
|
GimpTool *tool = GIMP_TOOL (fst);
|
|
|
|
|
|
|
|
fst->private = G_TYPE_INSTANCE_GET_PRIVATE (fst,
|
|
|
|
GIMP_TYPE_FREE_SELECT_TOOL,
|
|
|
|
GimpFreeSelectToolPrivate);
|
2001-03-10 01:39:18 +08:00
|
|
|
|
2014-06-03 02:55:33 +08:00
|
|
|
gimp_tool_control_set_motion_mode (tool->control, GIMP_MOTION_MODE_EXACT);
|
2007-03-10 23:07:56 +08:00
|
|
|
gimp_tool_control_set_wants_click (tool->control, TRUE);
|
2008-08-21 00:22:09 +08:00
|
|
|
gimp_tool_control_set_precision (tool->control,
|
|
|
|
GIMP_CURSOR_PRECISION_SUBPIXEL);
|
2004-06-05 07:08:29 +08:00
|
|
|
gimp_tool_control_set_tool_cursor (tool->control,
|
|
|
|
GIMP_TOOL_CURSOR_FREE_SELECT);
|
2001-03-10 01:39:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2001-08-14 22:53:55 +08:00
|
|
|
gimp_free_select_tool_finalize (GObject *object)
|
2001-03-10 01:39:18 +08:00
|
|
|
{
|
2008-08-16 18:07:43 +08:00
|
|
|
GimpFreeSelectTool *fst = GIMP_FREE_SELECT_TOOL (object);
|
2017-06-23 07:59:37 +08:00
|
|
|
GimpFreeSelectToolPrivate *priv = fst->private;
|
Merged the Polygon Select Tool capabilities with the Free Select Tool.
2008-05-18 Martin Nordholts <martinn@svn.gnome.org>
Merged the Polygon Select Tool capabilities with the Free Select
Tool. Among the things still to do is improved help texts, more
suitable graphics, and cursor mangement, but the core
functionality is in place. Thanks to Alexia Death for initial
testing. It will also be neccesary to do some work to adapt the
Foreground Select Tool to the new Free Select Tool implementation.
Quick instructions on how the tool works:
o A click adds a polygonal segment, a drag adds a free-hand
segment
o Return-key commits, Escape-key cancels, Backspace-key removes
last segment
o You can grab and move segment vertices
o You can cancel both a move, and the creation of a segment
* app/tools/gimpfreeselecttool.[ch]: More or less
reimplemented. We keep a sequential array of all the points in the
polygon (including the free segments), and we have another array
with point indices that we use to represent the segments. On top
of this we have a few helper functions that tries to abstract away
the pretty raw nature of the implementation.
* app/tools/gimpforegroundselecttool.[ch]: Keep track on its own
last_coord, and adjust to the new implementation of the Free
Select Tool. Still needs some work, for example handling that the
Free Select Tool now resets GimpTool::display.
(gimp_foreground_select_tool_key_press): Pass on key event to
parent class when appropriate. (Bails out too early though...)
svn path=/trunk/; revision=25693
2008-05-18 19:39:17 +08:00
|
|
|
|
2017-06-23 07:59:37 +08:00
|
|
|
g_clear_object (&priv->polygon);
|
2008-05-22 18:53:20 +08:00
|
|
|
|
Merged the Polygon Select Tool capabilities with the Free Select Tool.
2008-05-18 Martin Nordholts <martinn@svn.gnome.org>
Merged the Polygon Select Tool capabilities with the Free Select
Tool. Among the things still to do is improved help texts, more
suitable graphics, and cursor mangement, but the core
functionality is in place. Thanks to Alexia Death for initial
testing. It will also be neccesary to do some work to adapt the
Foreground Select Tool to the new Free Select Tool implementation.
Quick instructions on how the tool works:
o A click adds a polygonal segment, a drag adds a free-hand
segment
o Return-key commits, Escape-key cancels, Backspace-key removes
last segment
o You can grab and move segment vertices
o You can cancel both a move, and the creation of a segment
* app/tools/gimpfreeselecttool.[ch]: More or less
reimplemented. We keep a sequential array of all the points in the
polygon (including the free segments), and we have another array
with point indices that we use to represent the segments. On top
of this we have a few helper functions that tries to abstract away
the pretty raw nature of the implementation.
* app/tools/gimpforegroundselecttool.[ch]: Keep track on its own
last_coord, and adjust to the new implementation of the Free
Select Tool. Still needs some work, for example handling that the
Free Select Tool now resets GimpTool::display.
(gimp_foreground_select_tool_key_press): Pass on key event to
parent class when appropriate. (Bails out too early though...)
svn path=/trunk/; revision=25693
2008-05-18 19:39:17 +08:00
|
|
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_free_select_tool_commit (GimpFreeSelectTool *fst,
|
|
|
|
GimpDisplay *display)
|
|
|
|
{
|
2017-06-23 07:59:37 +08:00
|
|
|
GimpFreeSelectToolPrivate *private = fst->private;
|
2008-05-22 03:36:16 +08:00
|
|
|
|
2017-06-23 07:59:37 +08:00
|
|
|
if (private->polygon)
|
Merged the Polygon Select Tool capabilities with the Free Select Tool.
2008-05-18 Martin Nordholts <martinn@svn.gnome.org>
Merged the Polygon Select Tool capabilities with the Free Select
Tool. Among the things still to do is improved help texts, more
suitable graphics, and cursor mangement, but the core
functionality is in place. Thanks to Alexia Death for initial
testing. It will also be neccesary to do some work to adapt the
Foreground Select Tool to the new Free Select Tool implementation.
Quick instructions on how the tool works:
o A click adds a polygonal segment, a drag adds a free-hand
segment
o Return-key commits, Escape-key cancels, Backspace-key removes
last segment
o You can grab and move segment vertices
o You can cancel both a move, and the creation of a segment
* app/tools/gimpfreeselecttool.[ch]: More or less
reimplemented. We keep a sequential array of all the points in the
polygon (including the free segments), and we have another array
with point indices that we use to represent the segments. On top
of this we have a few helper functions that tries to abstract away
the pretty raw nature of the implementation.
* app/tools/gimpforegroundselecttool.[ch]: Keep track on its own
last_coord, and adjust to the new implementation of the Free
Select Tool. Still needs some work, for example handling that the
Free Select Tool now resets GimpTool::display.
(gimp_foreground_select_tool_key_press): Pass on key event to
parent class when appropriate. (Bails out too early though...)
svn path=/trunk/; revision=25693
2008-05-18 19:39:17 +08:00
|
|
|
{
|
2017-06-23 07:59:37 +08:00
|
|
|
const GimpVector2 *points;
|
|
|
|
gint n_points;
|
Merged the Polygon Select Tool capabilities with the Free Select Tool.
2008-05-18 Martin Nordholts <martinn@svn.gnome.org>
Merged the Polygon Select Tool capabilities with the Free Select
Tool. Among the things still to do is improved help texts, more
suitable graphics, and cursor mangement, but the core
functionality is in place. Thanks to Alexia Death for initial
testing. It will also be neccesary to do some work to adapt the
Foreground Select Tool to the new Free Select Tool implementation.
Quick instructions on how the tool works:
o A click adds a polygonal segment, a drag adds a free-hand
segment
o Return-key commits, Escape-key cancels, Backspace-key removes
last segment
o You can grab and move segment vertices
o You can cancel both a move, and the creation of a segment
* app/tools/gimpfreeselecttool.[ch]: More or less
reimplemented. We keep a sequential array of all the points in the
polygon (including the free segments), and we have another array
with point indices that we use to represent the segments. On top
of this we have a few helper functions that tries to abstract away
the pretty raw nature of the implementation.
* app/tools/gimpforegroundselecttool.[ch]: Keep track on its own
last_coord, and adjust to the new implementation of the Free
Select Tool. Still needs some work, for example handling that the
Free Select Tool now resets GimpTool::display.
(gimp_foreground_select_tool_key_press): Pass on key event to
parent class when appropriate. (Bails out too early though...)
svn path=/trunk/; revision=25693
2008-05-18 19:39:17 +08:00
|
|
|
|
2017-06-23 07:59:37 +08:00
|
|
|
gimp_tool_polygon_get_points (GIMP_TOOL_POLYGON (private->polygon),
|
|
|
|
&points, &n_points);
|
Merged the Polygon Select Tool capabilities with the Free Select Tool.
2008-05-18 Martin Nordholts <martinn@svn.gnome.org>
Merged the Polygon Select Tool capabilities with the Free Select
Tool. Among the things still to do is improved help texts, more
suitable graphics, and cursor mangement, but the core
functionality is in place. Thanks to Alexia Death for initial
testing. It will also be neccesary to do some work to adapt the
Foreground Select Tool to the new Free Select Tool implementation.
Quick instructions on how the tool works:
o A click adds a polygonal segment, a drag adds a free-hand
segment
o Return-key commits, Escape-key cancels, Backspace-key removes
last segment
o You can grab and move segment vertices
o You can cancel both a move, and the creation of a segment
* app/tools/gimpfreeselecttool.[ch]: More or less
reimplemented. We keep a sequential array of all the points in the
polygon (including the free segments), and we have another array
with point indices that we use to represent the segments. On top
of this we have a few helper functions that tries to abstract away
the pretty raw nature of the implementation.
* app/tools/gimpforegroundselecttool.[ch]: Keep track on its own
last_coord, and adjust to the new implementation of the Free
Select Tool. Still needs some work, for example handling that the
Free Select Tool now resets GimpTool::display.
(gimp_foreground_select_tool_key_press): Pass on key event to
parent class when appropriate. (Bails out too early though...)
svn path=/trunk/; revision=25693
2008-05-18 19:39:17 +08:00
|
|
|
|
2017-06-23 07:59:37 +08:00
|
|
|
if (n_points >= 3)
|
2008-06-20 20:22:46 +08:00
|
|
|
{
|
2017-06-23 07:59:37 +08:00
|
|
|
GIMP_FREE_SELECT_TOOL_GET_CLASS (fst)->select (fst, display,
|
|
|
|
points, n_points);
|
2008-06-20 20:22:46 +08:00
|
|
|
}
|
Merged the Polygon Select Tool capabilities with the Free Select Tool.
2008-05-18 Martin Nordholts <martinn@svn.gnome.org>
Merged the Polygon Select Tool capabilities with the Free Select
Tool. Among the things still to do is improved help texts, more
suitable graphics, and cursor mangement, but the core
functionality is in place. Thanks to Alexia Death for initial
testing. It will also be neccesary to do some work to adapt the
Foreground Select Tool to the new Free Select Tool implementation.
Quick instructions on how the tool works:
o A click adds a polygonal segment, a drag adds a free-hand
segment
o Return-key commits, Escape-key cancels, Backspace-key removes
last segment
o You can grab and move segment vertices
o You can cancel both a move, and the creation of a segment
* app/tools/gimpfreeselecttool.[ch]: More or less
reimplemented. We keep a sequential array of all the points in the
polygon (including the free segments), and we have another array
with point indices that we use to represent the segments. On top
of this we have a few helper functions that tries to abstract away
the pretty raw nature of the implementation.
* app/tools/gimpforegroundselecttool.[ch]: Keep track on its own
last_coord, and adjust to the new implementation of the Free
Select Tool. Still needs some work, for example handling that the
Free Select Tool now resets GimpTool::display.
(gimp_foreground_select_tool_key_press): Pass on key event to
parent class when appropriate. (Bails out too early though...)
svn path=/trunk/; revision=25693
2008-05-18 19:39:17 +08:00
|
|
|
}
|
|
|
|
|
2017-06-23 07:59:37 +08:00
|
|
|
gimp_image_flush (gimp_display_get_image (display));
|
2008-06-20 20:34:37 +08:00
|
|
|
}
|
|
|
|
|
2008-05-21 01:06:19 +08:00
|
|
|
static void
|
2017-06-23 07:59:37 +08:00
|
|
|
gimp_free_select_tool_halt (GimpFreeSelectTool *fst)
|
2008-05-21 01:06:19 +08:00
|
|
|
{
|
2017-06-23 07:59:37 +08:00
|
|
|
GimpFreeSelectToolPrivate *private = fst->private;
|
2008-05-21 01:06:19 +08:00
|
|
|
|
2017-06-23 07:59:37 +08:00
|
|
|
g_clear_object (&private->polygon);
|
2008-05-21 01:06:19 +08:00
|
|
|
}
|
|
|
|
|
2005-08-01 02:29:10 +08:00
|
|
|
static void
|
|
|
|
gimp_free_select_tool_control (GimpTool *tool,
|
|
|
|
GimpToolAction action,
|
2006-03-29 01:55:52 +08:00
|
|
|
GimpDisplay *display)
|
2005-08-01 02:29:10 +08:00
|
|
|
{
|
2017-06-23 07:59:37 +08:00
|
|
|
GimpFreeSelectTool *fst = GIMP_FREE_SELECT_TOOL (tool);
|
2011-04-01 21:02:28 +08:00
|
|
|
|
2005-08-01 02:29:10 +08:00
|
|
|
switch (action)
|
|
|
|
{
|
2006-05-22 05:12:01 +08:00
|
|
|
case GIMP_TOOL_ACTION_PAUSE:
|
|
|
|
case GIMP_TOOL_ACTION_RESUME:
|
2005-08-01 02:29:10 +08:00
|
|
|
break;
|
|
|
|
|
2006-05-22 05:12:01 +08:00
|
|
|
case GIMP_TOOL_ACTION_HALT:
|
2017-06-23 07:59:37 +08:00
|
|
|
gimp_free_select_tool_halt (fst);
|
2005-08-01 02:29:10 +08:00
|
|
|
break;
|
2014-04-05 04:34:26 +08:00
|
|
|
|
|
|
|
case GIMP_TOOL_ACTION_COMMIT:
|
2015-11-21 02:17:45 +08:00
|
|
|
gimp_free_select_tool_commit (fst, display);
|
2014-04-05 04:34:26 +08:00
|
|
|
break;
|
2005-08-01 02:29:10 +08:00
|
|
|
}
|
|
|
|
|
2006-03-29 01:55:52 +08:00
|
|
|
GIMP_TOOL_CLASS (parent_class)->control (tool, action, display);
|
2005-08-01 02:29:10 +08:00
|
|
|
}
|
|
|
|
|
Merged the Polygon Select Tool capabilities with the Free Select Tool.
2008-05-18 Martin Nordholts <martinn@svn.gnome.org>
Merged the Polygon Select Tool capabilities with the Free Select
Tool. Among the things still to do is improved help texts, more
suitable graphics, and cursor mangement, but the core
functionality is in place. Thanks to Alexia Death for initial
testing. It will also be neccesary to do some work to adapt the
Foreground Select Tool to the new Free Select Tool implementation.
Quick instructions on how the tool works:
o A click adds a polygonal segment, a drag adds a free-hand
segment
o Return-key commits, Escape-key cancels, Backspace-key removes
last segment
o You can grab and move segment vertices
o You can cancel both a move, and the creation of a segment
* app/tools/gimpfreeselecttool.[ch]: More or less
reimplemented. We keep a sequential array of all the points in the
polygon (including the free segments), and we have another array
with point indices that we use to represent the segments. On top
of this we have a few helper functions that tries to abstract away
the pretty raw nature of the implementation.
* app/tools/gimpforegroundselecttool.[ch]: Keep track on its own
last_coord, and adjust to the new implementation of the Free
Select Tool. Still needs some work, for example handling that the
Free Select Tool now resets GimpTool::display.
(gimp_foreground_select_tool_key_press): Pass on key event to
parent class when appropriate. (Bails out too early though...)
svn path=/trunk/; revision=25693
2008-05-18 19:39:17 +08:00
|
|
|
static void
|
2008-11-01 23:17:36 +08:00
|
|
|
gimp_free_select_tool_oper_update (GimpTool *tool,
|
|
|
|
const GimpCoords *coords,
|
|
|
|
GdkModifierType state,
|
|
|
|
gboolean proximity,
|
|
|
|
GimpDisplay *display)
|
Merged the Polygon Select Tool capabilities with the Free Select Tool.
2008-05-18 Martin Nordholts <martinn@svn.gnome.org>
Merged the Polygon Select Tool capabilities with the Free Select
Tool. Among the things still to do is improved help texts, more
suitable graphics, and cursor mangement, but the core
functionality is in place. Thanks to Alexia Death for initial
testing. It will also be neccesary to do some work to adapt the
Foreground Select Tool to the new Free Select Tool implementation.
Quick instructions on how the tool works:
o A click adds a polygonal segment, a drag adds a free-hand
segment
o Return-key commits, Escape-key cancels, Backspace-key removes
last segment
o You can grab and move segment vertices
o You can cancel both a move, and the creation of a segment
* app/tools/gimpfreeselecttool.[ch]: More or less
reimplemented. We keep a sequential array of all the points in the
polygon (including the free segments), and we have another array
with point indices that we use to represent the segments. On top
of this we have a few helper functions that tries to abstract away
the pretty raw nature of the implementation.
* app/tools/gimpforegroundselecttool.[ch]: Keep track on its own
last_coord, and adjust to the new implementation of the Free
Select Tool. Still needs some work, for example handling that the
Free Select Tool now resets GimpTool::display.
(gimp_foreground_select_tool_key_press): Pass on key event to
parent class when appropriate. (Bails out too early though...)
svn path=/trunk/; revision=25693
2008-05-18 19:39:17 +08:00
|
|
|
{
|
2008-08-16 18:07:43 +08:00
|
|
|
GimpFreeSelectTool *fst = GIMP_FREE_SELECT_TOOL (tool);
|
2017-06-23 07:59:37 +08:00
|
|
|
GimpFreeSelectToolPrivate *priv = fst->private;
|
Merged the Polygon Select Tool capabilities with the Free Select Tool.
2008-05-18 Martin Nordholts <martinn@svn.gnome.org>
Merged the Polygon Select Tool capabilities with the Free Select
Tool. Among the things still to do is improved help texts, more
suitable graphics, and cursor mangement, but the core
functionality is in place. Thanks to Alexia Death for initial
testing. It will also be neccesary to do some work to adapt the
Foreground Select Tool to the new Free Select Tool implementation.
Quick instructions on how the tool works:
o A click adds a polygonal segment, a drag adds a free-hand
segment
o Return-key commits, Escape-key cancels, Backspace-key removes
last segment
o You can grab and move segment vertices
o You can cancel both a move, and the creation of a segment
* app/tools/gimpfreeselecttool.[ch]: More or less
reimplemented. We keep a sequential array of all the points in the
polygon (including the free segments), and we have another array
with point indices that we use to represent the segments. On top
of this we have a few helper functions that tries to abstract away
the pretty raw nature of the implementation.
* app/tools/gimpforegroundselecttool.[ch]: Keep track on its own
last_coord, and adjust to the new implementation of the Free
Select Tool. Still needs some work, for example handling that the
Free Select Tool now resets GimpTool::display.
(gimp_foreground_select_tool_key_press): Pass on key event to
parent class when appropriate. (Bails out too early though...)
svn path=/trunk/; revision=25693
2008-05-18 19:39:17 +08:00
|
|
|
|
2015-11-21 02:17:45 +08:00
|
|
|
if (display != tool->display)
|
|
|
|
{
|
|
|
|
GIMP_TOOL_CLASS (parent_class)->oper_update (tool, coords, state,
|
|
|
|
proximity, display);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-06-23 07:59:37 +08:00
|
|
|
if (priv->polygon)
|
2016-10-07 04:44:07 +08:00
|
|
|
{
|
2017-06-23 07:59:37 +08:00
|
|
|
gimp_tool_widget_hover (priv->polygon, coords, state, proximity);
|
Merged the Polygon Select Tool capabilities with the Free Select Tool.
2008-05-18 Martin Nordholts <martinn@svn.gnome.org>
Merged the Polygon Select Tool capabilities with the Free Select
Tool. Among the things still to do is improved help texts, more
suitable graphics, and cursor mangement, but the core
functionality is in place. Thanks to Alexia Death for initial
testing. It will also be neccesary to do some work to adapt the
Foreground Select Tool to the new Free Select Tool implementation.
Quick instructions on how the tool works:
o A click adds a polygonal segment, a drag adds a free-hand
segment
o Return-key commits, Escape-key cancels, Backspace-key removes
last segment
o You can grab and move segment vertices
o You can cancel both a move, and the creation of a segment
* app/tools/gimpfreeselecttool.[ch]: More or less
reimplemented. We keep a sequential array of all the points in the
polygon (including the free segments), and we have another array
with point indices that we use to represent the segments. On top
of this we have a few helper functions that tries to abstract away
the pretty raw nature of the implementation.
* app/tools/gimpforegroundselecttool.[ch]: Keep track on its own
last_coord, and adjust to the new implementation of the Free
Select Tool. Still needs some work, for example handling that the
Free Select Tool now resets GimpTool::display.
(gimp_foreground_select_tool_key_press): Pass on key event to
parent class when appropriate. (Bails out too early though...)
svn path=/trunk/; revision=25693
2008-05-18 19:39:17 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2008-11-01 23:17:36 +08:00
|
|
|
gimp_free_select_tool_cursor_update (GimpTool *tool,
|
|
|
|
const GimpCoords *coords,
|
|
|
|
GdkModifierType state,
|
|
|
|
GimpDisplay *display)
|
Merged the Polygon Select Tool capabilities with the Free Select Tool.
2008-05-18 Martin Nordholts <martinn@svn.gnome.org>
Merged the Polygon Select Tool capabilities with the Free Select
Tool. Among the things still to do is improved help texts, more
suitable graphics, and cursor mangement, but the core
functionality is in place. Thanks to Alexia Death for initial
testing. It will also be neccesary to do some work to adapt the
Foreground Select Tool to the new Free Select Tool implementation.
Quick instructions on how the tool works:
o A click adds a polygonal segment, a drag adds a free-hand
segment
o Return-key commits, Escape-key cancels, Backspace-key removes
last segment
o You can grab and move segment vertices
o You can cancel both a move, and the creation of a segment
* app/tools/gimpfreeselecttool.[ch]: More or less
reimplemented. We keep a sequential array of all the points in the
polygon (including the free segments), and we have another array
with point indices that we use to represent the segments. On top
of this we have a few helper functions that tries to abstract away
the pretty raw nature of the implementation.
* app/tools/gimpforegroundselecttool.[ch]: Keep track on its own
last_coord, and adjust to the new implementation of the Free
Select Tool. Still needs some work, for example handling that the
Free Select Tool now resets GimpTool::display.
(gimp_foreground_select_tool_key_press): Pass on key event to
parent class when appropriate. (Bails out too early though...)
svn path=/trunk/; revision=25693
2008-05-18 19:39:17 +08:00
|
|
|
{
|
2017-06-23 07:59:37 +08:00
|
|
|
GimpFreeSelectTool *fst = GIMP_FREE_SELECT_TOOL (tool);
|
|
|
|
GimpFreeSelectToolPrivate *priv = fst->private;
|
|
|
|
GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE;
|
Merged the Polygon Select Tool capabilities with the Free Select Tool.
2008-05-18 Martin Nordholts <martinn@svn.gnome.org>
Merged the Polygon Select Tool capabilities with the Free Select
Tool. Among the things still to do is improved help texts, more
suitable graphics, and cursor mangement, but the core
functionality is in place. Thanks to Alexia Death for initial
testing. It will also be neccesary to do some work to adapt the
Foreground Select Tool to the new Free Select Tool implementation.
Quick instructions on how the tool works:
o A click adds a polygonal segment, a drag adds a free-hand
segment
o Return-key commits, Escape-key cancels, Backspace-key removes
last segment
o You can grab and move segment vertices
o You can cancel both a move, and the creation of a segment
* app/tools/gimpfreeselecttool.[ch]: More or less
reimplemented. We keep a sequential array of all the points in the
polygon (including the free segments), and we have another array
with point indices that we use to represent the segments. On top
of this we have a few helper functions that tries to abstract away
the pretty raw nature of the implementation.
* app/tools/gimpforegroundselecttool.[ch]: Keep track on its own
last_coord, and adjust to the new implementation of the Free
Select Tool. Still needs some work, for example handling that the
Free Select Tool now resets GimpTool::display.
(gimp_foreground_select_tool_key_press): Pass on key event to
parent class when appropriate. (Bails out too early though...)
svn path=/trunk/; revision=25693
2008-05-18 19:39:17 +08:00
|
|
|
|
2008-05-25 23:08:50 +08:00
|
|
|
if (tool->display == NULL)
|
2008-05-22 13:44:28 +08:00
|
|
|
{
|
2015-11-21 02:17:45 +08:00
|
|
|
GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state,
|
2008-05-22 13:44:28 +08:00
|
|
|
display);
|
2016-10-07 04:44:07 +08:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2017-06-23 07:59:37 +08:00
|
|
|
if (priv->polygon && display == tool->display)
|
2016-10-07 04:44:07 +08:00
|
|
|
{
|
2017-06-23 07:59:37 +08:00
|
|
|
gimp_tool_widget_get_cursor (priv->polygon, coords, state,
|
|
|
|
NULL, NULL, &modifier);
|
2008-05-25 23:08:50 +08:00
|
|
|
}
|
2016-10-07 04:44:07 +08:00
|
|
|
|
|
|
|
gimp_tool_set_cursor (tool, display,
|
|
|
|
gimp_tool_control_get_cursor (tool->control),
|
|
|
|
gimp_tool_control_get_tool_cursor (tool->control),
|
|
|
|
modifier);
|
Merged the Polygon Select Tool capabilities with the Free Select Tool.
2008-05-18 Martin Nordholts <martinn@svn.gnome.org>
Merged the Polygon Select Tool capabilities with the Free Select
Tool. Among the things still to do is improved help texts, more
suitable graphics, and cursor mangement, but the core
functionality is in place. Thanks to Alexia Death for initial
testing. It will also be neccesary to do some work to adapt the
Foreground Select Tool to the new Free Select Tool implementation.
Quick instructions on how the tool works:
o A click adds a polygonal segment, a drag adds a free-hand
segment
o Return-key commits, Escape-key cancels, Backspace-key removes
last segment
o You can grab and move segment vertices
o You can cancel both a move, and the creation of a segment
* app/tools/gimpfreeselecttool.[ch]: More or less
reimplemented. We keep a sequential array of all the points in the
polygon (including the free segments), and we have another array
with point indices that we use to represent the segments. On top
of this we have a few helper functions that tries to abstract away
the pretty raw nature of the implementation.
* app/tools/gimpforegroundselecttool.[ch]: Keep track on its own
last_coord, and adjust to the new implementation of the Free
Select Tool. Still needs some work, for example handling that the
Free Select Tool now resets GimpTool::display.
(gimp_foreground_select_tool_key_press): Pass on key event to
parent class when appropriate. (Bails out too early though...)
svn path=/trunk/; revision=25693
2008-05-18 19:39:17 +08:00
|
|
|
}
|
|
|
|
|
2000-12-31 12:07:42 +08:00
|
|
|
static void
|
2009-06-20 23:37:31 +08:00
|
|
|
gimp_free_select_tool_button_press (GimpTool *tool,
|
|
|
|
const GimpCoords *coords,
|
|
|
|
guint32 time,
|
|
|
|
GdkModifierType state,
|
|
|
|
GimpButtonPressType press_type,
|
|
|
|
GimpDisplay *display)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2008-08-16 18:07:43 +08:00
|
|
|
GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (tool);
|
|
|
|
GimpFreeSelectTool *fst = GIMP_FREE_SELECT_TOOL (tool);
|
2017-06-23 07:59:37 +08:00
|
|
|
GimpFreeSelectToolPrivate *private = fst->private;
|
2011-06-03 15:46:10 +08:00
|
|
|
GimpSelectionOptions *options = GIMP_SELECTION_TOOL_GET_OPTIONS (tool);
|
1997-11-25 06:05:25 +08:00
|
|
|
|
2011-06-03 15:46:10 +08:00
|
|
|
if (tool->display && tool->display != display)
|
2015-11-21 02:17:45 +08:00
|
|
|
gimp_tool_control (tool, GIMP_TOOL_ACTION_COMMIT, tool->display);
|
2011-06-03 15:46:10 +08:00
|
|
|
|
2017-06-23 07:59:37 +08:00
|
|
|
if (! private->polygon) /* not tool->display, we have a subclass */
|
2008-05-25 19:25:56 +08:00
|
|
|
{
|
2017-06-23 07:59:37 +08:00
|
|
|
GimpDisplayShell *shell = gimp_display_get_shell (display);
|
|
|
|
|
2011-06-03 15:46:10 +08:00
|
|
|
/* First of all handle delegation to the selection mask edit logic
|
|
|
|
* if appropriate.
|
|
|
|
*/
|
|
|
|
if (gimp_selection_tool_start_edit (GIMP_SELECTION_TOOL (fst),
|
|
|
|
display, coords))
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
tool->display = display;
|
|
|
|
|
|
|
|
/* We want to apply the selection operation that was current when
|
|
|
|
* the tool was started, so we save this information
|
|
|
|
*/
|
2017-06-23 07:59:37 +08:00
|
|
|
private->operation_at_start = options->operation;
|
2008-05-25 19:25:56 +08:00
|
|
|
|
2017-06-23 07:59:37 +08:00
|
|
|
private->polygon = gimp_tool_polygon_new (shell);
|
2014-04-17 16:51:50 +08:00
|
|
|
|
2017-06-23 07:59:37 +08:00
|
|
|
g_signal_connect (private->polygon, "changed",
|
|
|
|
G_CALLBACK (gimp_free_select_tool_polygon_changed),
|
|
|
|
fst);
|
|
|
|
g_signal_connect (private->polygon, "status",
|
|
|
|
G_CALLBACK (gimp_free_select_tool_polygon_status),
|
|
|
|
fst);
|
|
|
|
g_signal_connect (private->polygon, "commit",
|
|
|
|
G_CALLBACK (gimp_free_select_tool_polygon_commit),
|
|
|
|
fst);
|
|
|
|
g_signal_connect (private->polygon, "cancel",
|
|
|
|
G_CALLBACK (gimp_free_select_tool_polygon_cancel),
|
|
|
|
fst);
|
2011-03-01 04:04:42 +08:00
|
|
|
|
2017-06-23 07:59:37 +08:00
|
|
|
gimp_draw_tool_start (draw_tool, display);
|
2001-11-09 03:14:51 +08:00
|
|
|
|
2017-06-23 07:59:37 +08:00
|
|
|
gimp_tool_widget_hover (private->polygon, coords, state, TRUE);
|
Merged the Polygon Select Tool capabilities with the Free Select Tool.
2008-05-18 Martin Nordholts <martinn@svn.gnome.org>
Merged the Polygon Select Tool capabilities with the Free Select
Tool. Among the things still to do is improved help texts, more
suitable graphics, and cursor mangement, but the core
functionality is in place. Thanks to Alexia Death for initial
testing. It will also be neccesary to do some work to adapt the
Foreground Select Tool to the new Free Select Tool implementation.
Quick instructions on how the tool works:
o A click adds a polygonal segment, a drag adds a free-hand
segment
o Return-key commits, Escape-key cancels, Backspace-key removes
last segment
o You can grab and move segment vertices
o You can cancel both a move, and the creation of a segment
* app/tools/gimpfreeselecttool.[ch]: More or less
reimplemented. We keep a sequential array of all the points in the
polygon (including the free segments), and we have another array
with point indices that we use to represent the segments. On top
of this we have a few helper functions that tries to abstract away
the pretty raw nature of the implementation.
* app/tools/gimpforegroundselecttool.[ch]: Keep track on its own
last_coord, and adjust to the new implementation of the Free
Select Tool. Still needs some work, for example handling that the
Free Select Tool now resets GimpTool::display.
(gimp_foreground_select_tool_key_press): Pass on key event to
parent class when appropriate. (Bails out too early though...)
svn path=/trunk/; revision=25693
2008-05-18 19:39:17 +08:00
|
|
|
}
|
2008-05-23 02:05:10 +08:00
|
|
|
|
2017-06-23 07:59:37 +08:00
|
|
|
gimp_tool_control_activate (tool->control);
|
2008-05-23 02:05:10 +08:00
|
|
|
|
2017-06-23 07:59:37 +08:00
|
|
|
if (gimp_tool_widget_button_press (private->polygon, coords, time, state,
|
|
|
|
press_type))
|
|
|
|
{
|
|
|
|
private->grab_widget = private->polygon;
|
Merged the Polygon Select Tool capabilities with the Free Select Tool.
2008-05-18 Martin Nordholts <martinn@svn.gnome.org>
Merged the Polygon Select Tool capabilities with the Free Select
Tool. Among the things still to do is improved help texts, more
suitable graphics, and cursor mangement, but the core
functionality is in place. Thanks to Alexia Death for initial
testing. It will also be neccesary to do some work to adapt the
Foreground Select Tool to the new Free Select Tool implementation.
Quick instructions on how the tool works:
o A click adds a polygonal segment, a drag adds a free-hand
segment
o Return-key commits, Escape-key cancels, Backspace-key removes
last segment
o You can grab and move segment vertices
o You can cancel both a move, and the creation of a segment
* app/tools/gimpfreeselecttool.[ch]: More or less
reimplemented. We keep a sequential array of all the points in the
polygon (including the free segments), and we have another array
with point indices that we use to represent the segments. On top
of this we have a few helper functions that tries to abstract away
the pretty raw nature of the implementation.
* app/tools/gimpforegroundselecttool.[ch]: Keep track on its own
last_coord, and adjust to the new implementation of the Free
Select Tool. Still needs some work, for example handling that the
Free Select Tool now resets GimpTool::display.
(gimp_foreground_select_tool_key_press): Pass on key event to
parent class when appropriate. (Bails out too early though...)
svn path=/trunk/; revision=25693
2008-05-18 19:39:17 +08:00
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2000-12-31 12:07:42 +08:00
|
|
|
static void
|
2007-02-28 02:55:12 +08:00
|
|
|
gimp_free_select_tool_button_release (GimpTool *tool,
|
2008-11-01 23:17:36 +08:00
|
|
|
const GimpCoords *coords,
|
2007-02-28 02:55:12 +08:00
|
|
|
guint32 time,
|
|
|
|
GdkModifierType state,
|
|
|
|
GimpButtonReleaseType release_type,
|
|
|
|
GimpDisplay *display)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2015-11-21 02:17:45 +08:00
|
|
|
GimpFreeSelectTool *fst = GIMP_FREE_SELECT_TOOL (tool);
|
2017-06-23 07:59:37 +08:00
|
|
|
GimpFreeSelectToolPrivate *priv = fst->private;
|
2015-11-21 02:17:45 +08:00
|
|
|
GimpImage *image = gimp_display_get_image (display);
|
2001-11-20 21:53:21 +08:00
|
|
|
|
2011-03-01 04:04:42 +08:00
|
|
|
gimp_tool_control_halt (tool->control);
|
|
|
|
|
2007-03-10 23:07:56 +08:00
|
|
|
switch (release_type)
|
2005-07-29 08:16:45 +08:00
|
|
|
{
|
Merged the Polygon Select Tool capabilities with the Free Select Tool.
2008-05-18 Martin Nordholts <martinn@svn.gnome.org>
Merged the Polygon Select Tool capabilities with the Free Select
Tool. Among the things still to do is improved help texts, more
suitable graphics, and cursor mangement, but the core
functionality is in place. Thanks to Alexia Death for initial
testing. It will also be neccesary to do some work to adapt the
Foreground Select Tool to the new Free Select Tool implementation.
Quick instructions on how the tool works:
o A click adds a polygonal segment, a drag adds a free-hand
segment
o Return-key commits, Escape-key cancels, Backspace-key removes
last segment
o You can grab and move segment vertices
o You can cancel both a move, and the creation of a segment
* app/tools/gimpfreeselecttool.[ch]: More or less
reimplemented. We keep a sequential array of all the points in the
polygon (including the free segments), and we have another array
with point indices that we use to represent the segments. On top
of this we have a few helper functions that tries to abstract away
the pretty raw nature of the implementation.
* app/tools/gimpforegroundselecttool.[ch]: Keep track on its own
last_coord, and adjust to the new implementation of the Free
Select Tool. Still needs some work, for example handling that the
Free Select Tool now resets GimpTool::display.
(gimp_foreground_select_tool_key_press): Pass on key event to
parent class when appropriate. (Bails out too early though...)
svn path=/trunk/; revision=25693
2008-05-18 19:39:17 +08:00
|
|
|
case GIMP_BUTTON_RELEASE_CLICK:
|
|
|
|
case GIMP_BUTTON_RELEASE_NO_MOTION:
|
2015-11-21 02:17:45 +08:00
|
|
|
/* If there is a floating selection, anchor it */
|
|
|
|
if (gimp_image_get_floating_selection (image))
|
|
|
|
{
|
|
|
|
floating_sel_anchor (gimp_image_get_floating_selection (image));
|
|
|
|
|
|
|
|
gimp_tool_control (tool, GIMP_TOOL_ACTION_HALT, display);
|
|
|
|
|
2017-06-23 07:59:37 +08:00
|
|
|
return;
|
2015-11-21 02:17:45 +08:00
|
|
|
}
|
2008-05-22 18:53:20 +08:00
|
|
|
|
2017-06-23 07:59:37 +08:00
|
|
|
/* fallthru */
|
Merged the Polygon Select Tool capabilities with the Free Select Tool.
2008-05-18 Martin Nordholts <martinn@svn.gnome.org>
Merged the Polygon Select Tool capabilities with the Free Select
Tool. Among the things still to do is improved help texts, more
suitable graphics, and cursor mangement, but the core
functionality is in place. Thanks to Alexia Death for initial
testing. It will also be neccesary to do some work to adapt the
Foreground Select Tool to the new Free Select Tool implementation.
Quick instructions on how the tool works:
o A click adds a polygonal segment, a drag adds a free-hand
segment
o Return-key commits, Escape-key cancels, Backspace-key removes
last segment
o You can grab and move segment vertices
o You can cancel both a move, and the creation of a segment
* app/tools/gimpfreeselecttool.[ch]: More or less
reimplemented. We keep a sequential array of all the points in the
polygon (including the free segments), and we have another array
with point indices that we use to represent the segments. On top
of this we have a few helper functions that tries to abstract away
the pretty raw nature of the implementation.
* app/tools/gimpforegroundselecttool.[ch]: Keep track on its own
last_coord, and adjust to the new implementation of the Free
Select Tool. Still needs some work, for example handling that the
Free Select Tool now resets GimpTool::display.
(gimp_foreground_select_tool_key_press): Pass on key event to
parent class when appropriate. (Bails out too early though...)
svn path=/trunk/; revision=25693
2008-05-18 19:39:17 +08:00
|
|
|
|
|
|
|
default:
|
2017-06-23 07:59:37 +08:00
|
|
|
if (priv->grab_widget)
|
|
|
|
{
|
|
|
|
gimp_tool_widget_button_release (priv->grab_widget,
|
|
|
|
coords, time, state, release_type);
|
|
|
|
priv->grab_widget = NULL;
|
|
|
|
}
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-12-31 12:07:42 +08:00
|
|
|
static void
|
2008-11-01 23:17:36 +08:00
|
|
|
gimp_free_select_tool_motion (GimpTool *tool,
|
|
|
|
const GimpCoords *coords,
|
|
|
|
guint32 time,
|
|
|
|
GdkModifierType state,
|
|
|
|
GimpDisplay *display)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2017-06-23 07:59:37 +08:00
|
|
|
GimpFreeSelectTool *fst = GIMP_FREE_SELECT_TOOL (tool);
|
|
|
|
GimpFreeSelectToolPrivate *priv = fst->private;
|
2000-07-30 00:12:40 +08:00
|
|
|
|
2017-06-23 07:59:37 +08:00
|
|
|
if (priv->grab_widget)
|
|
|
|
{
|
|
|
|
gimp_tool_widget_motion (priv->grab_widget, coords, time, state);
|
|
|
|
}
|
Merged the Polygon Select Tool capabilities with the Free Select Tool.
2008-05-18 Martin Nordholts <martinn@svn.gnome.org>
Merged the Polygon Select Tool capabilities with the Free Select
Tool. Among the things still to do is improved help texts, more
suitable graphics, and cursor mangement, but the core
functionality is in place. Thanks to Alexia Death for initial
testing. It will also be neccesary to do some work to adapt the
Foreground Select Tool to the new Free Select Tool implementation.
Quick instructions on how the tool works:
o A click adds a polygonal segment, a drag adds a free-hand
segment
o Return-key commits, Escape-key cancels, Backspace-key removes
last segment
o You can grab and move segment vertices
o You can cancel both a move, and the creation of a segment
* app/tools/gimpfreeselecttool.[ch]: More or less
reimplemented. We keep a sequential array of all the points in the
polygon (including the free segments), and we have another array
with point indices that we use to represent the segments. On top
of this we have a few helper functions that tries to abstract away
the pretty raw nature of the implementation.
* app/tools/gimpforegroundselecttool.[ch]: Keep track on its own
last_coord, and adjust to the new implementation of the Free
Select Tool. Still needs some work, for example handling that the
Free Select Tool now resets GimpTool::display.
(gimp_foreground_select_tool_key_press): Pass on key event to
parent class when appropriate. (Bails out too early though...)
svn path=/trunk/; revision=25693
2008-05-18 19:39:17 +08:00
|
|
|
}
|
2001-11-09 03:14:51 +08:00
|
|
|
|
Merged the Polygon Select Tool capabilities with the Free Select Tool.
2008-05-18 Martin Nordholts <martinn@svn.gnome.org>
Merged the Polygon Select Tool capabilities with the Free Select
Tool. Among the things still to do is improved help texts, more
suitable graphics, and cursor mangement, but the core
functionality is in place. Thanks to Alexia Death for initial
testing. It will also be neccesary to do some work to adapt the
Foreground Select Tool to the new Free Select Tool implementation.
Quick instructions on how the tool works:
o A click adds a polygonal segment, a drag adds a free-hand
segment
o Return-key commits, Escape-key cancels, Backspace-key removes
last segment
o You can grab and move segment vertices
o You can cancel both a move, and the creation of a segment
* app/tools/gimpfreeselecttool.[ch]: More or less
reimplemented. We keep a sequential array of all the points in the
polygon (including the free segments), and we have another array
with point indices that we use to represent the segments. On top
of this we have a few helper functions that tries to abstract away
the pretty raw nature of the implementation.
* app/tools/gimpforegroundselecttool.[ch]: Keep track on its own
last_coord, and adjust to the new implementation of the Free
Select Tool. Still needs some work, for example handling that the
Free Select Tool now resets GimpTool::display.
(gimp_foreground_select_tool_key_press): Pass on key event to
parent class when appropriate. (Bails out too early though...)
svn path=/trunk/; revision=25693
2008-05-18 19:39:17 +08:00
|
|
|
static gboolean
|
|
|
|
gimp_free_select_tool_key_press (GimpTool *tool,
|
|
|
|
GdkEventKey *kevent,
|
|
|
|
GimpDisplay *display)
|
|
|
|
{
|
2017-06-23 07:59:37 +08:00
|
|
|
GimpFreeSelectTool *fst = GIMP_FREE_SELECT_TOOL (tool);
|
|
|
|
GimpFreeSelectToolPrivate *priv = fst->private;
|
2003-05-27 19:52:03 +08:00
|
|
|
|
2017-06-23 07:59:37 +08:00
|
|
|
if (priv->polygon)
|
2003-05-27 19:52:03 +08:00
|
|
|
{
|
2017-06-23 07:59:37 +08:00
|
|
|
return gimp_tool_widget_key_press (priv->polygon, kevent);
|
2003-05-27 19:52:03 +08:00
|
|
|
}
|
|
|
|
|
Merged the Polygon Select Tool capabilities with the Free Select Tool.
2008-05-18 Martin Nordholts <martinn@svn.gnome.org>
Merged the Polygon Select Tool capabilities with the Free Select
Tool. Among the things still to do is improved help texts, more
suitable graphics, and cursor mangement, but the core
functionality is in place. Thanks to Alexia Death for initial
testing. It will also be neccesary to do some work to adapt the
Foreground Select Tool to the new Free Select Tool implementation.
Quick instructions on how the tool works:
o A click adds a polygonal segment, a drag adds a free-hand
segment
o Return-key commits, Escape-key cancels, Backspace-key removes
last segment
o You can grab and move segment vertices
o You can cancel both a move, and the creation of a segment
* app/tools/gimpfreeselecttool.[ch]: More or less
reimplemented. We keep a sequential array of all the points in the
polygon (including the free segments), and we have another array
with point indices that we use to represent the segments. On top
of this we have a few helper functions that tries to abstract away
the pretty raw nature of the implementation.
* app/tools/gimpforegroundselecttool.[ch]: Keep track on its own
last_coord, and adjust to the new implementation of the Free
Select Tool. Still needs some work, for example handling that the
Free Select Tool now resets GimpTool::display.
(gimp_foreground_select_tool_key_press): Pass on key event to
parent class when appropriate. (Bails out too early though...)
svn path=/trunk/; revision=25693
2008-05-18 19:39:17 +08:00
|
|
|
return FALSE;
|
1997-11-25 06:05:25 +08:00
|
|
|
}
|
|
|
|
|
2008-05-23 02:05:10 +08:00
|
|
|
static void
|
|
|
|
gimp_free_select_tool_modifier_key (GimpTool *tool,
|
|
|
|
GdkModifierType key,
|
|
|
|
gboolean press,
|
|
|
|
GdkModifierType state,
|
|
|
|
GimpDisplay *display)
|
|
|
|
{
|
2017-06-23 07:59:37 +08:00
|
|
|
GimpFreeSelectTool *fst = GIMP_FREE_SELECT_TOOL (tool);
|
|
|
|
GimpFreeSelectToolPrivate *priv = fst->private;
|
2008-05-25 22:31:33 +08:00
|
|
|
|
2017-06-23 07:59:37 +08:00
|
|
|
if (priv->polygon && display == tool->display)
|
2008-06-24 02:41:53 +08:00
|
|
|
{
|
2017-06-23 07:59:37 +08:00
|
|
|
gimp_tool_widget_hover_modifier (priv->polygon, key, press, state);
|
2008-06-24 02:41:53 +08:00
|
|
|
}
|
2008-05-25 22:31:33 +08:00
|
|
|
|
2015-11-21 02:17:45 +08:00
|
|
|
GIMP_TOOL_CLASS (parent_class)->modifier_key (tool, key, press, state,
|
2008-05-23 02:05:10 +08:00
|
|
|
display);
|
|
|
|
}
|
|
|
|
|
2008-06-20 20:34:37 +08:00
|
|
|
static void
|
|
|
|
gimp_free_select_tool_active_modifier_key (GimpTool *tool,
|
|
|
|
GdkModifierType key,
|
|
|
|
gboolean press,
|
|
|
|
GdkModifierType state,
|
|
|
|
GimpDisplay *display)
|
|
|
|
{
|
2017-06-23 07:59:37 +08:00
|
|
|
GimpFreeSelectTool *fst = GIMP_FREE_SELECT_TOOL (tool);
|
|
|
|
GimpFreeSelectToolPrivate *priv = fst->private;
|
2008-06-20 20:34:37 +08:00
|
|
|
|
2017-06-23 07:59:37 +08:00
|
|
|
if (priv->polygon && display == tool->display)
|
2008-06-20 20:34:37 +08:00
|
|
|
{
|
2017-06-23 07:59:37 +08:00
|
|
|
gimp_tool_widget_motion_modifier (priv->polygon, key, press, state);
|
2008-06-20 20:34:37 +08:00
|
|
|
|
2017-06-23 07:59:37 +08:00
|
|
|
GIMP_TOOL_CLASS (parent_class)->active_modifier_key (tool,
|
|
|
|
key, press, state,
|
|
|
|
display);
|
|
|
|
}
|
2008-06-20 20:34:37 +08:00
|
|
|
}
|
|
|
|
|
1997-11-25 06:05:25 +08:00
|
|
|
static void
|
2001-03-10 01:39:18 +08:00
|
|
|
gimp_free_select_tool_draw (GimpDrawTool *draw_tool)
|
1997-11-25 06:05:25 +08:00
|
|
|
{
|
2017-06-23 07:59:37 +08:00
|
|
|
GimpFreeSelectTool *fst = GIMP_FREE_SELECT_TOOL (draw_tool);
|
|
|
|
GimpFreeSelectToolPrivate *priv = fst->private;
|
2005-12-13 17:13:50 +08:00
|
|
|
|
2017-06-23 07:59:37 +08:00
|
|
|
if (priv->polygon)
|
Merged the Polygon Select Tool capabilities with the Free Select Tool.
2008-05-18 Martin Nordholts <martinn@svn.gnome.org>
Merged the Polygon Select Tool capabilities with the Free Select
Tool. Among the things still to do is improved help texts, more
suitable graphics, and cursor mangement, but the core
functionality is in place. Thanks to Alexia Death for initial
testing. It will also be neccesary to do some work to adapt the
Foreground Select Tool to the new Free Select Tool implementation.
Quick instructions on how the tool works:
o A click adds a polygonal segment, a drag adds a free-hand
segment
o Return-key commits, Escape-key cancels, Backspace-key removes
last segment
o You can grab and move segment vertices
o You can cancel both a move, and the creation of a segment
* app/tools/gimpfreeselecttool.[ch]: More or less
reimplemented. We keep a sequential array of all the points in the
polygon (including the free segments), and we have another array
with point indices that we use to represent the segments. On top
of this we have a few helper functions that tries to abstract away
the pretty raw nature of the implementation.
* app/tools/gimpforegroundselecttool.[ch]: Keep track on its own
last_coord, and adjust to the new implementation of the Free
Select Tool. Still needs some work, for example handling that the
Free Select Tool now resets GimpTool::display.
(gimp_foreground_select_tool_key_press): Pass on key event to
parent class when appropriate. (Bails out too early though...)
svn path=/trunk/; revision=25693
2008-05-18 19:39:17 +08:00
|
|
|
{
|
2017-06-23 07:59:37 +08:00
|
|
|
GimpCanvasItem *item = gimp_tool_widget_get_item (priv->polygon);
|
|
|
|
|
|
|
|
gimp_draw_tool_add_item (draw_tool, item);
|
Merged the Polygon Select Tool capabilities with the Free Select Tool.
2008-05-18 Martin Nordholts <martinn@svn.gnome.org>
Merged the Polygon Select Tool capabilities with the Free Select
Tool. Among the things still to do is improved help texts, more
suitable graphics, and cursor mangement, but the core
functionality is in place. Thanks to Alexia Death for initial
testing. It will also be neccesary to do some work to adapt the
Foreground Select Tool to the new Free Select Tool implementation.
Quick instructions on how the tool works:
o A click adds a polygonal segment, a drag adds a free-hand
segment
o Return-key commits, Escape-key cancels, Backspace-key removes
last segment
o You can grab and move segment vertices
o You can cancel both a move, and the creation of a segment
* app/tools/gimpfreeselecttool.[ch]: More or less
reimplemented. We keep a sequential array of all the points in the
polygon (including the free segments), and we have another array
with point indices that we use to represent the segments. On top
of this we have a few helper functions that tries to abstract away
the pretty raw nature of the implementation.
* app/tools/gimpforegroundselecttool.[ch]: Keep track on its own
last_coord, and adjust to the new implementation of the Free
Select Tool. Still needs some work, for example handling that the
Free Select Tool now resets GimpTool::display.
(gimp_foreground_select_tool_key_press): Pass on key event to
parent class when appropriate. (Bails out too early though...)
svn path=/trunk/; revision=25693
2008-05-18 19:39:17 +08:00
|
|
|
}
|
|
|
|
}
|
2005-12-13 17:13:50 +08:00
|
|
|
|
2005-07-29 09:48:56 +08:00
|
|
|
static void
|
Merged the Polygon Select Tool capabilities with the Free Select Tool.
2008-05-18 Martin Nordholts <martinn@svn.gnome.org>
Merged the Polygon Select Tool capabilities with the Free Select
Tool. Among the things still to do is improved help texts, more
suitable graphics, and cursor mangement, but the core
functionality is in place. Thanks to Alexia Death for initial
testing. It will also be neccesary to do some work to adapt the
Foreground Select Tool to the new Free Select Tool implementation.
Quick instructions on how the tool works:
o A click adds a polygonal segment, a drag adds a free-hand
segment
o Return-key commits, Escape-key cancels, Backspace-key removes
last segment
o You can grab and move segment vertices
o You can cancel both a move, and the creation of a segment
* app/tools/gimpfreeselecttool.[ch]: More or less
reimplemented. We keep a sequential array of all the points in the
polygon (including the free segments), and we have another array
with point indices that we use to represent the segments. On top
of this we have a few helper functions that tries to abstract away
the pretty raw nature of the implementation.
* app/tools/gimpforegroundselecttool.[ch]: Keep track on its own
last_coord, and adjust to the new implementation of the Free
Select Tool. Still needs some work, for example handling that the
Free Select Tool now resets GimpTool::display.
(gimp_foreground_select_tool_key_press): Pass on key event to
parent class when appropriate. (Bails out too early though...)
svn path=/trunk/; revision=25693
2008-05-18 19:39:17 +08:00
|
|
|
gimp_free_select_tool_real_select (GimpFreeSelectTool *fst,
|
2017-06-23 07:59:37 +08:00
|
|
|
GimpDisplay *display,
|
|
|
|
const GimpVector2 *points,
|
|
|
|
gint n_points)
|
2005-07-29 09:48:56 +08:00
|
|
|
{
|
2008-08-16 18:07:43 +08:00
|
|
|
GimpSelectionOptions *options = GIMP_SELECTION_TOOL_GET_OPTIONS (fst);
|
2017-06-23 07:59:37 +08:00
|
|
|
GimpFreeSelectToolPrivate *priv = fst->private;
|
2009-10-08 01:00:42 +08:00
|
|
|
GimpImage *image = gimp_display_get_image (display);
|
2005-07-29 09:48:56 +08:00
|
|
|
|
2009-10-08 01:00:42 +08:00
|
|
|
gimp_channel_select_polygon (gimp_image_get_mask (image),
|
2008-05-23 22:09:55 +08:00
|
|
|
C_("command", "Free Select"),
|
2017-06-23 07:59:37 +08:00
|
|
|
n_points,
|
|
|
|
points,
|
2008-05-22 23:40:18 +08:00
|
|
|
priv->operation_at_start,
|
2005-07-29 09:48:56 +08:00
|
|
|
options->antialias,
|
|
|
|
options->feather,
|
|
|
|
options->feather_radius,
|
2006-08-26 01:19:36 +08:00
|
|
|
options->feather_radius,
|
|
|
|
TRUE);
|
2008-05-22 02:23:23 +08:00
|
|
|
|
2011-04-01 21:02:28 +08:00
|
|
|
gimp_tool_control (GIMP_TOOL (fst), GIMP_TOOL_ACTION_HALT, display);
|
2005-07-29 09:48:56 +08:00
|
|
|
}
|
|
|
|
|
2017-06-23 07:59:37 +08:00
|
|
|
static void
|
|
|
|
gimp_free_select_tool_polygon_changed (GimpToolWidget *polygon,
|
|
|
|
GimpFreeSelectTool *fst)
|
2008-05-22 03:36:16 +08:00
|
|
|
{
|
2017-06-23 07:59:37 +08:00
|
|
|
}
|
2008-05-22 03:36:16 +08:00
|
|
|
|
2017-06-23 07:59:37 +08:00
|
|
|
static void
|
|
|
|
gimp_free_select_tool_polygon_status (GimpToolWidget *polygon,
|
|
|
|
const gchar *status,
|
|
|
|
GimpFreeSelectTool *fst)
|
|
|
|
{
|
|
|
|
GimpTool *tool = GIMP_TOOL (fst);
|
2008-05-22 03:36:16 +08:00
|
|
|
|
2017-06-23 07:59:37 +08:00
|
|
|
if (status)
|
|
|
|
{
|
|
|
|
gimp_tool_replace_status (tool, tool->display, "%s", status);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gimp_tool_pop_status (tool, tool->display);
|
|
|
|
}
|
2008-05-22 03:36:16 +08:00
|
|
|
}
|
2017-06-23 07:59:37 +08:00
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_free_select_tool_polygon_commit (GimpToolWidget *polygon,
|
|
|
|
GimpFreeSelectTool *fst)
|
|
|
|
{
|
|
|
|
GimpTool *tool = GIMP_TOOL (fst);
|
|
|
|
|
|
|
|
gimp_tool_control (tool, GIMP_TOOL_ACTION_COMMIT, tool->display);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_free_select_tool_polygon_cancel (GimpToolWidget *polygon,
|
|
|
|
GimpFreeSelectTool *fst)
|
|
|
|
{
|
|
|
|
GimpTool *tool = GIMP_TOOL (fst);
|
|
|
|
|
|
|
|
gimp_tool_control (tool, GIMP_TOOL_ACTION_HALT, tool->display);
|
|
|
|
}
|
|
|
|
|