Commit 6bd316e0 authored by Michael Natterer's avatar Michael Natterer 😴

app: add new GimpToolTransformGrid subclass GimpToolHandleGrid

which implents the handle transform tool's interaction.
parent c83f0e88
......@@ -166,6 +166,8 @@ libappdisplay_a_sources = \
gimptoolgui.h \
gimptoolcompass.c \
gimptoolcompass.h \
gimptoolhandlegrid.c \
gimptoolhandlegrid.h \
gimptoolline.c \
gimptoolline.h \
gimptoolrotategrid.c \
......
......@@ -294,6 +294,37 @@ gimp_transform_function_get_type (void)
return type;
}
GType
gimp_transform_handle_mode_get_type (void)
{
static const GEnumValue values[] =
{
{ GIMP_HANDLE_MODE_ADD_TRANSFORM, "GIMP_HANDLE_MODE_ADD_TRANSFORM", "add-transform" },
{ GIMP_HANDLE_MODE_MOVE, "GIMP_HANDLE_MODE_MOVE", "move" },
{ GIMP_HANDLE_MODE_REMOVE, "GIMP_HANDLE_MODE_REMOVE", "remove" },
{ 0, NULL, NULL }
};
static const GimpEnumDesc descs[] =
{
{ GIMP_HANDLE_MODE_ADD_TRANSFORM, NC_("transform-handle-mode", "Add / Transform"), NULL },
{ GIMP_HANDLE_MODE_MOVE, NC_("transform-handle-mode", "Move"), NULL },
{ GIMP_HANDLE_MODE_REMOVE, NC_("transform-handle-mode", "Remove"), NULL },
{ 0, NULL, NULL }
};
static GType type = 0;
if (G_UNLIKELY (! type))
{
type = g_enum_register_static ("GimpTransformHandleMode", values);
gimp_type_set_translation_context (type, "transform-handle-mode");
gimp_enum_set_value_descriptions (type, descs);
}
return type;
}
GType
gimp_zoom_focus_get_type (void)
{
......
......@@ -134,6 +134,18 @@ typedef enum
} GimpTransformFunction;
#define GIMP_TYPE_TRANSFORM_HANDLE_MODE (gimp_transform_handle_mode_get_type ())
GType gimp_transform_handle_mode_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_HANDLE_MODE_ADD_TRANSFORM, /*< desc="Add / Transform" >*/
GIMP_HANDLE_MODE_MOVE, /*< desc="Move" >*/
GIMP_HANDLE_MODE_REMOVE /*< desc="Remove" >*/
} GimpTransformHandleMode;
#define GIMP_TYPE_ZOOM_FOCUS (gimp_zoom_focus_get_type ())
GType gimp_zoom_focus_get_type (void) G_GNUC_CONST;
......
This diff is collapsed.
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimptoolhandlegrid.h
* Copyright (C) 2017 Michael Natterer <mitch@gimp.org>
*
* 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_TOOL_HANDLE_GRID_H__
#define __GIMP_TOOL_HANDLE_GRID_H__
#include "gimptooltransformgrid.h"
#define GIMP_TYPE_TOOL_HANDLE_GRID (gimp_tool_handle_grid_get_type ())
#define GIMP_TOOL_HANDLE_GRID(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_TOOL_HANDLE_GRID, GimpToolHandleGrid))
#define GIMP_TOOL_HANDLE_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_TOOL_HANDLE_GRID, GimpToolHandleGridClass))
#define GIMP_IS_TOOL_HANDLE_GRID(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_TOOL_HANDLE_GRID))
#define GIMP_IS_TOOL_HANDLE_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_TOOL_HANDLE_GRID))
#define GIMP_TOOL_HANDLE_GRID_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_TOOL_HANDLE_GRID, GimpToolHandleGridClass))
typedef struct _GimpToolHandleGrid GimpToolHandleGrid;
typedef struct _GimpToolHandleGridPrivate GimpToolHandleGridPrivate;
typedef struct _GimpToolHandleGridClass GimpToolHandleGridClass;
struct _GimpToolHandleGrid
{
GimpToolTransformGrid parent_instance;
GimpToolHandleGridPrivate *private;
};
struct _GimpToolHandleGridClass
{
GimpToolTransformGridClass parent_class;
};
GType gimp_tool_handle_grid_get_type (void) G_GNUC_CONST;
GimpToolWidget * gimp_tool_handle_grid_new (GimpDisplayShell *shell,
gdouble x1,
gdouble y1,
gdouble x2,
gdouble y2);
#endif /* __GIMP_TOOL_HANDLE_GRID_H__ */
......@@ -9,37 +9,6 @@
#include "gimp-intl.h"
/* enumerations from "tools-enums.h" */
GType
gimp_transform_handle_mode_get_type (void)
{
static const GEnumValue values[] =
{
{ GIMP_HANDLE_MODE_ADD_TRANSFORM, "GIMP_HANDLE_MODE_ADD_TRANSFORM", "add-transform" },
{ GIMP_HANDLE_MODE_MOVE, "GIMP_HANDLE_MODE_MOVE", "move" },
{ GIMP_HANDLE_MODE_REMOVE, "GIMP_HANDLE_MODE_REMOVE", "remove" },
{ 0, NULL, NULL }
};
static const GimpEnumDesc descs[] =
{
{ GIMP_HANDLE_MODE_ADD_TRANSFORM, NC_("transform-handle-mode", "Add / Transform"), NULL },
{ GIMP_HANDLE_MODE_MOVE, NC_("transform-handle-mode", "Move"), NULL },
{ GIMP_HANDLE_MODE_REMOVE, NC_("transform-handle-mode", "Remove"), NULL },
{ 0, NULL, NULL }
};
static GType type = 0;
if (G_UNLIKELY (! type))
{
type = g_enum_register_static ("GimpTransformHandleMode", values);
gimp_type_set_translation_context (type, "transform-handle-mode");
gimp_enum_set_value_descriptions (type, descs);
}
return type;
}
GType
gimp_rectangle_constraint_get_type (void)
{
......
......@@ -23,18 +23,6 @@
* these enums are registered with the type system
*/
#define GIMP_TYPE_TRANSFORM_HANDLE_MODE (gimp_transform_handle_mode_get_type ())
GType gimp_transform_handle_mode_get_type (void) G_GNUC_CONST;
typedef enum
{
GIMP_HANDLE_MODE_ADD_TRANSFORM, /*< desc="Add / Transform" >*/
GIMP_HANDLE_MODE_MOVE, /*< desc="Move" >*/
GIMP_HANDLE_MODE_REMOVE /*< desc="Remove" >*/
} GimpTransformHandleMode;
#define GIMP_TYPE_RECTANGLE_CONSTRAINT (gimp_rectangle_constraint_get_type ())
GType gimp_rectangle_constraint_get_type (void) G_GNUC_CONST;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment