[gimp] GimpWarpTool: skeleton of the tool, with options
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] GimpWarpTool: skeleton of the tool, with options
- Date: Tue, 21 May 2013 21:45:23 +0000 (UTC)
commit d6ed13ef6cff5866c6f858691feb6d2a7c5104d4
Author: Michael Muré <batolettre gmail com>
Date: Mon May 23 21:11:08 2011 +0200
GimpWarpTool: skeleton of the tool, with options
app/tools/Makefile.am | 6 +-
app/tools/gimp-tools.c | 2 +
app/tools/gimpwarpoptions.c | 113 +++++++++++++++
app/tools/gimpwarpoptions.h | 54 +++++++
app/tools/gimpwarptool.c | 323 +++++++++++++++++++++++++++++++++++++++++++
app/tools/gimpwarptool.h | 57 ++++++++
app/tools/tools-enums.c | 39 +++++
app/tools/tools-enums.h | 16 ++
app/widgets/gimphelp-ids.h | 1 +
po/POTFILES.in | 2 +
10 files changed, 612 insertions(+), 1 deletions(-)
---
diff --git a/app/tools/Makefile.am b/app/tools/Makefile.am
index 828475e..176749f 100644
--- a/app/tools/Makefile.am
+++ b/app/tools/Makefile.am
@@ -203,7 +203,11 @@ libapptools_a_sources = \
gimpvectoroptions.c \
gimpvectoroptions.h \
gimpvectortool.c \
- gimpvectortool.h
+ gimpvectortool.h \
+ gimpwarpoptions.c \
+ gimpwarpoptions.h \
+ gimpwarptool.c \
+ gimpwarptool.h
libapptools_a_built_sources = tools-enums.c
diff --git a/app/tools/gimp-tools.c b/app/tools/gimp-tools.c
index 316241e..85d8d47 100644
--- a/app/tools/gimp-tools.c
+++ b/app/tools/gimp-tools.c
@@ -85,6 +85,7 @@
#include "gimptexttool.h"
#include "gimpunifiedtransformtool.h"
#include "gimpvectortool.h"
+#include "gimpwarptool.h"
#include "gimp-intl.h"
@@ -163,6 +164,7 @@ gimp_tools_init (Gimp *gimp)
gimp_crop_tool_register,
gimp_align_tool_register,
gimp_move_tool_register,
+ gimp_warp_tool_register,
/* non-modifying tools */
diff --git a/app/tools/gimpwarpoptions.c b/app/tools/gimpwarpoptions.c
new file mode 100644
index 0000000..e4460af
--- /dev/null
+++ b/app/tools/gimpwarpoptions.c
@@ -0,0 +1,113 @@
+/* GIMP - The GNU Image Manipulation Program
+ *
+ * gimpwarpoptions.c
+ * Copyright (C) 2011 Michael Muré <batolettre gmail com>
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include <gegl.h>
+#include <gtk/gtk.h>
+
+#include "libgimpconfig/gimpconfig.h"
+#include "libgimpwidgets/gimpwidgets.h"
+
+#include "tools-types.h"
+
+#include "gimpwarpoptions.h"
+#include "gimptooloptions-gui.h"
+
+#include "gimp-intl.h"
+
+
+enum
+{
+ PROP_0
+};
+
+
+static void gimp_warp_options_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec);
+static void gimp_warp_options_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec);
+
+
+G_DEFINE_TYPE (GimpWarpOptions, gimp_warp_options,
+ GIMP_TYPE_TOOL_OPTIONS)
+
+#define parent_class gimp_warp_options_parent_class
+
+
+static void
+gimp_warp_options_class_init (GimpWarpOptionsClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->set_property = gimp_warp_options_set_property;
+ object_class->get_property = gimp_warp_options_get_property;
+}
+
+static void
+gimp_warp_options_init (GimpWarpOptions *options)
+{
+}
+
+static void
+gimp_warp_options_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ GimpWarpOptions *options = GIMP_WARP_OPTIONS (object);
+
+ switch (property_id)
+ {
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+static void
+gimp_warp_options_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ GimpWarpOptions *options = GIMP_WARP_OPTIONS (object);
+
+ switch (property_id)
+ {
+
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+GtkWidget *
+gimp_warp_options_gui (GimpToolOptions *tool_options)
+{
+ GObject *config = G_OBJECT (tool_options);
+ GtkWidget *vbox = gimp_tool_options_gui (tool_options);
+
+ return vbox;
+}
diff --git a/app/tools/gimpwarpoptions.h b/app/tools/gimpwarpoptions.h
new file mode 100644
index 0000000..aba554c
--- /dev/null
+++ b/app/tools/gimpwarpoptions.h
@@ -0,0 +1,54 @@
+/* GIMP - The GNU Image Manipulation Program
+ *
+ * gimpwarpoptions.h
+ * Copyright (C) 2011 Michael Muré <batolettre gmail com>
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GIMP_WARP_OPTIONS_H__
+#define __GIMP_WARP_OPTIONS_H__
+
+
+#include "core/gimptooloptions.h"
+
+
+#define GIMP_TYPE_WARP_OPTIONS (gimp_warp_options_get_type ())
+#define GIMP_WARP_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_WARP_OPTIONS,
GimpWarpOptions))
+#define GIMP_WARP_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_WARP_OPTIONS,
GimpWarpOptionsClass))
+#define GIMP_IS_WARP_OPTIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_WARP_OPTIONS))
+#define GIMP_IS_WARP_OPTIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_WARP_OPTIONS))
+#define GIMP_WARP_OPTIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_WARP_OPTIONS,
GimpWarpOptionsClass))
+
+
+typedef struct _GimpWarpOptions GimpWarpOptions;
+typedef struct _GimpWarpOptionsClass GimpWarpOptionsClass;
+
+struct _GimpWarpOptions
+{
+ GimpToolOptions parent_instance;
+};
+
+struct _GimpWarpOptionsClass
+{
+ GimpToolOptionsClass parent_class;
+};
+
+
+GType gimp_warp_options_get_type (void) G_GNUC_CONST;
+
+GtkWidget * gimp_warp_options_gui (GimpToolOptions *tool_options);
+
+
+#endif /* __GIMP_WARP_OPTIONS_H__ */
diff --git a/app/tools/gimpwarptool.c b/app/tools/gimpwarptool.c
new file mode 100644
index 0000000..2b2b68c
--- /dev/null
+++ b/app/tools/gimpwarptool.c
@@ -0,0 +1,323 @@
+/* GIMP - The GNU Image Manipulation Program
+ *
+ * gimpwarptool.c
+ * Copyright (C) 2011 Michael Muré <batolettre gmail com>
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "config.h"
+
+#include <string.h>
+#include <stdlib.h>
+
+#include <gegl.h>
+#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
+
+#include "libgimpbase/gimpbase.h"
+#include "libgimpmath/gimpmath.h"
+#include "libgimpwidgets/gimpwidgets.h"
+
+#include "tools-types.h"
+
+#include "core/gimp.h"
+#include "core/gimpchannel.h"
+#include "core/gimpdrawable-shadow.h"
+#include "core/gimpimage.h"
+#include "core/gimpimagemap.h"
+#include "core/gimplayer.h"
+#include "core/gimpprogress.h"
+#include "core/gimpprojection.h"
+
+#include "widgets/gimphelp-ids.h"
+
+#include "display/gimpdisplay.h"
+#include "display/gimpdisplayshell.h"
+#include "display/gimpdisplayshell-transform.h"
+
+#include "gimpwarptool.h"
+#include "gimpwarpoptions.h"
+#include "gimptoolcontrol.h"
+
+#include "gimp-intl.h"
+
+
+static void gimp_warp_tool_start (GimpWarpTool *wt,
+ GimpDisplay *display);
+
+static void gimp_warp_tool_options_notify (GimpTool *tool,
+ GimpToolOptions *options,
+ const GParamSpec *pspec);
+static void gimp_warp_tool_button_press (GimpTool *tool,
+ const GimpCoords *coords,
+ guint32 time,
+ GdkModifierType state,
+ GimpButtonPressType press_type,
+ GimpDisplay *display);
+static void gimp_warp_tool_button_release (GimpTool *tool,
+ const GimpCoords *coords,
+ guint32 time,
+ GdkModifierType state,
+ GimpButtonReleaseType release_type,
+ GimpDisplay *display);
+static gboolean gimp_warp_tool_key_press (GimpTool *tool,
+ GdkEventKey *kevent,
+ GimpDisplay *display);
+static void gimp_warp_tool_motion (GimpTool *tool,
+ const GimpCoords *coords,
+ guint32 time,
+ GdkModifierType state,
+ GimpDisplay *display);
+static void gimp_warp_tool_control (GimpTool *tool,
+ GimpToolAction action,
+ GimpDisplay *display);
+static void gimp_warp_tool_cursor_update (GimpTool *tool,
+ const GimpCoords *coords,
+ GdkModifierType state,
+ GimpDisplay *display);
+static void gimp_warp_tool_oper_update (GimpTool *tool,
+ const GimpCoords *coords,
+ GdkModifierType state,
+ gboolean proximity,
+ GimpDisplay *display);
+
+static void gimp_warp_tool_draw (GimpDrawTool *draw_tool);
+
+G_DEFINE_TYPE (GimpWarpTool, gimp_warp_tool, GIMP_TYPE_DRAW_TOOL)
+
+#define parent_class gimp_warp_tool_parent_class
+
+
+void
+gimp_warp_tool_register (GimpToolRegisterCallback callback,
+ gpointer data)
+{
+ (* callback) (GIMP_TYPE_WARP_TOOL,
+ GIMP_TYPE_WARP_OPTIONS,
+ gimp_warp_options_gui,
+ 0,
+ "gimp-warp-tool",
+ _("Warp Transform"),
+ _("Warp Transform: Deform with different tools"),
+ N_("_Warp Transform"), "W",
+ NULL, GIMP_HELP_TOOL_WARP,
+ GIMP_STOCK_TOOL_WARP,
+ data);
+}
+
+static void
+gimp_warp_tool_class_init (GimpWarpToolClass *klass)
+{
+ GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
+ GimpDrawToolClass *draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
+
+ tool_class->options_notify = gimp_warp_tool_options_notify;
+ tool_class->button_press = gimp_warp_tool_button_press;
+ tool_class->button_release = gimp_warp_tool_button_release;
+ tool_class->key_press = gimp_warp_tool_key_press;
+ tool_class->motion = gimp_warp_tool_motion;
+ tool_class->control = gimp_warp_tool_control;
+ tool_class->cursor_update = gimp_warp_tool_cursor_update;
+ tool_class->oper_update = gimp_warp_tool_oper_update;
+
+ draw_tool_class->draw = gimp_warp_tool_draw;
+}
+
+static void
+gimp_warp_tool_init (GimpWarpTool *self)
+{
+ GimpTool *tool = GIMP_TOOL (self);
+
+ gimp_tool_control_set_dirty_mask (tool->control,
+ GIMP_DIRTY_IMAGE |
+ GIMP_DIRTY_IMAGE_STRUCTURE |
+ GIMP_DIRTY_DRAWABLE |
+ GIMP_DIRTY_SELECTION);
+ gimp_tool_control_set_wants_click (tool->control, TRUE);
+ gimp_tool_control_set_tool_cursor (tool->control,
+ GIMP_TOOL_CURSOR_PERSPECTIVE);
+}
+
+static void
+gimp_warp_tool_control (GimpTool *tool,
+ GimpToolAction action,
+ GimpDisplay *display)
+{
+ GimpWarpTool *wt = GIMP_WARP_TOOL (tool);
+
+ switch (action)
+ {
+ case GIMP_TOOL_ACTION_PAUSE:
+ case GIMP_TOOL_ACTION_RESUME:
+ case GIMP_TOOL_ACTION_HALT:
+ break;
+ }
+
+ GIMP_TOOL_CLASS (parent_class)->control (tool, action, display);
+}
+
+static void
+gimp_warp_tool_start (GimpWarpTool *wt,
+ GimpDisplay *display)
+{
+ GimpTool *tool = GIMP_TOOL (wt);
+
+ gimp_tool_control (tool, GIMP_TOOL_ACTION_HALT, display);
+
+ tool->display = display;
+
+ gimp_draw_tool_start (GIMP_DRAW_TOOL (wt), display);
+}
+
+static void
+gimp_warp_tool_options_notify (GimpTool *tool,
+ GimpToolOptions *options,
+ const GParamSpec *pspec)
+{
+ GimpWarpTool *ct = GIMP_WARP_TOOL (tool);
+
+ GIMP_TOOL_CLASS (parent_class)->options_notify (tool, options, pspec);
+
+ if (! tool->display)
+ return;
+
+ gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool));
+
+ if (strcmp (pspec->name, "foo") == 0)
+ {
+ }
+
+ gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool));
+}
+
+static gboolean
+gimp_warp_tool_key_press (GimpTool *tool,
+ GdkEventKey *kevent,
+ GimpDisplay *display)
+{
+ GimpWarpTool *wt = GIMP_WARP_TOOL (tool);
+
+ switch (kevent->keyval)
+ {
+ case GDK_KEY_BackSpace:
+ case GDK_KEY_Return:
+ case GDK_KEY_KP_Enter:
+ case GDK_KEY_ISO_Enter:
+ return TRUE;
+
+ case GDK_KEY_Escape:
+ gimp_tool_control (tool, GIMP_TOOL_ACTION_HALT, display);
+ return TRUE;
+
+ default:
+ break;
+ }
+
+ return FALSE;
+}
+
+static void
+gimp_warp_tool_motion (GimpTool *tool,
+ const GimpCoords *coords,
+ guint32 time,
+ GdkModifierType state,
+ GimpDisplay *display)
+{
+ GimpWarpTool *wt = GIMP_WARP_TOOL (tool);
+
+ gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool));
+
+ gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool));
+}
+
+static void
+gimp_warp_tool_oper_update (GimpTool *tool,
+ const GimpCoords *coords,
+ GdkModifierType state,
+ gboolean proximity,
+ GimpDisplay *display)
+{
+ GimpWarpTool *wt = GIMP_WARP_TOOL (tool);
+ GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (tool);
+
+ gimp_draw_tool_pause (draw_tool);
+
+ gimp_draw_tool_resume (draw_tool);
+}
+
+static void
+gimp_warp_tool_button_press (GimpTool *tool,
+ const GimpCoords *coords,
+ guint32 time,
+ GdkModifierType state,
+ GimpButtonPressType press_type,
+ GimpDisplay *display)
+{
+ GimpWarpTool *wt = GIMP_WARP_TOOL (tool);
+ GimpDrawTool *draw_tool = GIMP_DRAW_TOOL (tool);
+
+ if (display != tool->display)
+ gimp_warp_tool_start (wt, display);
+
+ gimp_tool_control_activate (tool->control);
+}
+
+void
+gimp_warp_tool_button_release (GimpTool *tool,
+ const GimpCoords *coords,
+ guint32 time,
+ GdkModifierType state,
+ GimpButtonReleaseType release_type,
+ GimpDisplay *display)
+{
+ GimpWarpTool *wt = GIMP_WARP_TOOL (tool);
+
+ gimp_draw_tool_pause (GIMP_DRAW_TOOL (wt));
+
+ gimp_tool_control_halt (tool->control);
+
+ if (release_type == GIMP_BUTTON_RELEASE_CANCEL)
+ {
+ }
+ else
+ {
+ }
+
+ gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool));
+}
+
+static void
+gimp_warp_tool_cursor_update (GimpTool *tool,
+ const GimpCoords *coords,
+ GdkModifierType state,
+ GimpDisplay *display)
+{
+ GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_PLUS;
+
+ if (tool->display)
+ {
+ modifier = GIMP_CURSOR_MODIFIER_MOVE;
+ }
+
+ gimp_tool_control_set_cursor_modifier (tool->control, modifier);
+
+ GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display);
+}
+
+static void
+gimp_warp_tool_draw (GimpDrawTool *draw_tool)
+{
+ GimpWarpTool *wt = GIMP_WARP_TOOL (draw_tool);
+}
diff --git a/app/tools/gimpwarptool.h b/app/tools/gimpwarptool.h
new file mode 100644
index 0000000..6aacdcb
--- /dev/null
+++ b/app/tools/gimpwarptool.h
@@ -0,0 +1,57 @@
+/* GIMP - The GNU Image Manipulation Program
+ *
+ * gimpwarptool.h
+ * Copyright (C) 2011 Michael Muré <batolettre gmail com>
+ *
+ * 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 3 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GIMP_WARP_TOOL_H__
+#define __GIMP_WARP_TOOL_H__
+
+
+#include "gimpdrawtool.h"
+
+
+#define GIMP_TYPE_WARP_TOOL (gimp_warp_tool_get_type ())
+#define GIMP_WARP_TOOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_WARP_TOOL,
GimpWarpTool))
+#define GIMP_WARP_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_WARP_TOOL,
GimpWarpToolClass))
+#define GIMP_IS_WARP_TOOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_WARP_TOOL))
+#define GIMP_IS_WARP_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_WARP_TOOL))
+#define GIMP_WARP_TOOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_WARP_TOOL,
GimpWarpToolClass))
+
+#define GIMP_WARP_TOOL_GET_OPTIONS(t) (GIMP_WARP_OPTIONS (gimp_tool_get_options (GIMP_TOOL (t))))
+
+
+typedef struct _GimpWarpTool GimpWarpTool;
+typedef struct _GimpWarpToolClass GimpWarpToolClass;
+
+struct _GimpWarpTool
+{
+ GimpDrawTool parent_instance;
+};
+
+struct _GimpWarpToolClass
+{
+ GimpDrawToolClass parent_class;
+};
+
+
+void gimp_warp_tool_register (GimpToolRegisterCallback callback,
+ gpointer data);
+
+GType gimp_warp_tool_get_type (void) G_GNUC_CONST;
+
+
+#endif /* __GIMP_WARP_TOOL_H__ */
diff --git a/app/tools/tools-enums.c b/app/tools/tools-enums.c
index 86a3c3e..3985eee 100644
--- a/app/tools/tools-enums.c
+++ b/app/tools/tools-enums.c
@@ -350,6 +350,45 @@ gimp_matting_engine_get_type (void)
return type;
}
+GType
+gimp_warp_behavior_get_type (void)
+{
+ static const GEnumValue values[] =
+ {
+ { GIMP_WARP_BEHAVIOR_MOVE, "GIMP_WARP_BEHAVIOR_MOVE", "imp-warp-behavior-move" },
+ { GEGL_WARP_BEHAVIOR_GROW, "GEGL_WARP_BEHAVIOR_GROW", "egl-warp-behavior-grow" },
+ { GEGL_WARP_BEHAVIOR_SHRINK, "GEGL_WARP_BEHAVIOR_SHRINK", "egl-warp-behavior-shrink" },
+ { GEGL_WARP_BEHAVIOR_SWIRL_CW, "GEGL_WARP_BEHAVIOR_SWIRL_CW", "egl-warp-behavior-swirl-cw" },
+ { GEGL_WARP_BEHAVIOR_SWIRL_CCW, "GEGL_WARP_BEHAVIOR_SWIRL_CCW", "egl-warp-behavior-swirl-ccw" },
+ { GEGL_WARP_BEHAVIOR_ERASE, "GEGL_WARP_BEHAVIOR_ERASE", "egl-warp-behavior-erase" },
+ { GEGL_WARP_BEHAVIOR_SMOOTH, "GEGL_WARP_BEHAVIOR_SMOOTH", "egl-warp-behavior-smooth" },
+ { 0, NULL, NULL }
+ };
+
+ static const GimpEnumDesc descs[] =
+ {
+ { GIMP_WARP_BEHAVIOR_MOVE, NC_("warp-behavior", "Move pixels"), NULL },
+ { GEGL_WARP_BEHAVIOR_GROW, NC_("warp-behavior", "Grow area"), NULL },
+ { GEGL_WARP_BEHAVIOR_SHRINK, NC_("warp-behavior", "Shrink area"), NULL },
+ { GEGL_WARP_BEHAVIOR_SWIRL_CW, NC_("warp-behavior", "Swirl clockwise"), NULL },
+ { GEGL_WARP_BEHAVIOR_SWIRL_CCW, NC_("warp-behavior", "Swirl counter-clockwise"), NULL },
+ { GEGL_WARP_BEHAVIOR_ERASE, NC_("warp-behavior", "Erase warping"), NULL },
+ { GEGL_WARP_BEHAVIOR_SMOOTH, NC_("warp-behavior", "Smooth warping"), NULL },
+ { 0, NULL, NULL }
+ };
+
+ static GType type = 0;
+
+ if (G_UNLIKELY (! type))
+ {
+ type = g_enum_register_static ("GimpWarpBehavior", values);
+ gimp_type_set_translation_context (type, "warp-behavior");
+ gimp_enum_set_value_descriptions (type, descs);
+ }
+
+ return type;
+}
+
/* Generated data ends here */
diff --git a/app/tools/tools-enums.h b/app/tools/tools-enums.h
index c56f7d1..a8c38e2 100644
--- a/app/tools/tools-enums.h
+++ b/app/tools/tools-enums.h
@@ -154,6 +154,22 @@ typedef enum
} GimpMattingEngine;
+#define GIMP_TYPE_WARP_BEHAVIOR (gimp_warp_behavior_get_type ())
+
+GType gimp_warp_behavior_get_type (void) G_GNUC_CONST;
+
+typedef enum
+{
+ GIMP_WARP_BEHAVIOR_MOVE, /*< desc="Move pixels" >*/
+ GEGL_WARP_BEHAVIOR_GROW, /*< desc="Grow area" >*/
+ GEGL_WARP_BEHAVIOR_SHRINK, /*< desc="Shrink area" >*/
+ GEGL_WARP_BEHAVIOR_SWIRL_CW, /*< desc="Swirl clockwise" >*/
+ GEGL_WARP_BEHAVIOR_SWIRL_CCW, /*< desc="Swirl counter-clockwise" >*/
+ GEGL_WARP_BEHAVIOR_ERASE, /*< desc="Erase warping" >*/
+ GEGL_WARP_BEHAVIOR_SMOOTH /*< desc="Smooth warping" >*/
+} GimpWarpBehavior;
+
+
/*
* non-registered enums; register them if needed
*/
diff --git a/app/widgets/gimphelp-ids.h b/app/widgets/gimphelp-ids.h
index 027423b..72097fb 100644
--- a/app/widgets/gimphelp-ids.h
+++ b/app/widgets/gimphelp-ids.h
@@ -299,6 +299,7 @@
#define GIMP_HELP_TOOL_THRESHOLD "gimp-tool-threshold"
#define GIMP_HELP_TOOL_UNIFIED_TRANSFORM "gimp-tool-unified-transform"
#define GIMP_HELP_TOOL_VECTORS "gimp-tool-vectors"
+#define GIMP_HELP_TOOL_WARP "gimp-tool-warp"
#define GIMP_HELP_TOOL_ZOOM "gimp-tool-zoom"
#define GIMP_HELP_FILTER_REPEAT "gimp-filter-repeat"
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 285111f..4c540f8 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -398,6 +398,8 @@ app/tools/gimptransformtool.c
app/tools/gimpunifiedtransformtool.c
app/tools/gimpvectoroptions.c
app/tools/gimpvectortool.c
+app/tools/gimpwarpoptions.c
+app/tools/gimpwarptool.c
app/tools/tools-enums.c
app/vectors/gimpvectors.c
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]