Commit e13d3f17 authored by Michael Natterer's avatar Michael Natterer 😴

app: remove a lot of cruft from GimpTransformTool

All tools have a widget now so none of this stuff is needed any longer.
parent 38c9ee9e
......@@ -155,7 +155,6 @@ gimp_handle_transform_tool_init (GimpHandleTransformTool *ht_tool)
GimpTransformTool *tr_tool = GIMP_TRANSFORM_TOOL (ht_tool);
tr_tool->progress_text = _("Handle transformation");
tr_tool->use_grid = TRUE;
tr_tool->does_perspective = TRUE;
ht_tool->saved_handle_mode = GIMP_HANDLE_MODE_ADD_TRANSFORM;
......
......@@ -23,6 +23,34 @@
#include "gimptransformtool.h" /* for TransInfo */
typedef enum
{
TRANSFORM_CREATING,
TRANSFORM_HANDLE_NONE,
TRANSFORM_HANDLE_NW_P, /* perspective handles */
TRANSFORM_HANDLE_NE_P,
TRANSFORM_HANDLE_SW_P,
TRANSFORM_HANDLE_SE_P,
TRANSFORM_HANDLE_NW, /* north west */
TRANSFORM_HANDLE_NE, /* north east */
TRANSFORM_HANDLE_SW, /* south west */
TRANSFORM_HANDLE_SE, /* south east */
TRANSFORM_HANDLE_N, /* north */
TRANSFORM_HANDLE_S, /* south */
TRANSFORM_HANDLE_E, /* east */
TRANSFORM_HANDLE_W, /* west */
TRANSFORM_HANDLE_CENTER, /* for moving */
TRANSFORM_HANDLE_PIVOT, /* pivot for rotation and scaling */
TRANSFORM_HANDLE_N_S, /* shearing handles */
TRANSFORM_HANDLE_S_S,
TRANSFORM_HANDLE_E_S,
TRANSFORM_HANDLE_W_S,
TRANSFORM_HANDLE_ROTATION, /* rotation handle */
TRANSFORM_HANDLE_NUM /* keep this last so *handles[] is the right size */
} TransformAction;
#define GIMP_TYPE_PERSPECTIVE_CLONE_TOOL (gimp_perspective_clone_tool_get_type ())
#define GIMP_PERSPECTIVE_CLONE_TOOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_PERSPECTIVE_CLONE_TOOL, GimpPerspectiveCloneTool))
#define GIMP_PERSPECTIVE_CLONE_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_PERSPECTIVE_CLONE_TOOL, GimpPerspectiveCloneToolClass))
......
......@@ -114,7 +114,6 @@ gimp_perspective_tool_init (GimpPerspectiveTool *perspective_tool)
GIMP_TOOL_CURSOR_PERSPECTIVE);
tr_tool->progress_text = _("Perspective transformation");
tr_tool->use_grid = TRUE;
tr_tool->does_perspective = TRUE;
}
......
......@@ -127,7 +127,6 @@ gimp_rotate_tool_init (GimpRotateTool *rotate_tool)
gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_ROTATE);
tr_tool->progress_text = _("Rotating");
tr_tool->use_grid = TRUE;
}
static gboolean
......
......@@ -119,7 +119,6 @@ gimp_scale_tool_init (GimpScaleTool *scale_tool)
gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_RESIZE);
tr_tool->progress_text = _("Scaling");
tr_tool->use_grid = TRUE;
}
static void
......
......@@ -117,7 +117,6 @@ gimp_shear_tool_init (GimpShearTool *shear_tool)
gimp_tool_control_set_tool_cursor (tool->control, GIMP_TOOL_CURSOR_SHEAR);
tr_tool->progress_text = _("Shearing");
tr_tool->use_grid = TRUE;
}
static void
......
This diff is collapsed.
......@@ -22,34 +22,6 @@
#include "gimpdrawtool.h"
typedef enum
{
TRANSFORM_CREATING,
TRANSFORM_HANDLE_NONE,
TRANSFORM_HANDLE_NW_P, /* perspective handles */
TRANSFORM_HANDLE_NE_P,
TRANSFORM_HANDLE_SW_P,
TRANSFORM_HANDLE_SE_P,
TRANSFORM_HANDLE_NW, /* north west */
TRANSFORM_HANDLE_NE, /* north east */
TRANSFORM_HANDLE_SW, /* south west */
TRANSFORM_HANDLE_SE, /* south east */
TRANSFORM_HANDLE_N, /* north */
TRANSFORM_HANDLE_S, /* south */
TRANSFORM_HANDLE_E, /* east */
TRANSFORM_HANDLE_W, /* west */
TRANSFORM_HANDLE_CENTER, /* for moving */
TRANSFORM_HANDLE_PIVOT, /* pivot for rotation and scaling */
TRANSFORM_HANDLE_N_S, /* shearing handles */
TRANSFORM_HANDLE_S_S,
TRANSFORM_HANDLE_E_S,
TRANSFORM_HANDLE_W_S,
TRANSFORM_HANDLE_ROTATION, /* rotation handle */
TRANSFORM_HANDLE_NUM /* keep this last so *handles[] is the right size */
} TransformAction;
/* This is not the number of items in the enum above, but the max size
* of the enums at the top of each transformation tool, stored in
* trans_info and related
......@@ -75,18 +47,6 @@ struct _GimpTransformTool
{
GimpDrawTool parent_instance;
gdouble curx; /* current x coord */
gdouble cury; /* current y coord */
gdouble lastx; /* last x coord */
gdouble lasty; /* last y coord */
gdouble previousx; /* previous x coord */
gdouble previousy; /* previous y coord */
gdouble mousex; /* x coord where mouse was clicked */
gdouble mousey; /* y coord where mouse was clicked */
gint x1, y1; /* upper left hand coordinate */
gint x2, y2; /* lower right hand coords */
......@@ -103,18 +63,13 @@ struct _GimpTransformTool
GimpItem *hidden_item; /* the item that was hidden during
the transform */
TransformAction function; /* current tool activity */
gboolean use_grid; /* does the tool use the grid */
gboolean does_perspective; /* does the tool do non-affine
* transformations
*/
GimpToolWidget *widget;
GimpToolWidget *grab_widget;
GimpCanvasItem *preview;
GimpCanvasItem *handles[TRANSFORM_HANDLE_NUM];
const gchar *progress_text;
......@@ -129,21 +84,10 @@ struct _GimpTransformToolClass
void (* dialog) (GimpTransformTool *tool);
void (* dialog_update) (GimpTransformTool *tool);
void (* prepare) (GimpTransformTool *tool);
GimpToolWidget * (* get_widget) (GimpTransformTool *tool);
void (* motion) (GimpTransformTool *tool);
void (* recalc_matrix) (GimpTransformTool *tool,
GimpToolWidget *widget);
gchar * (* get_undo_desc) (GimpTransformTool *tool);
TransformAction (* pick_function) (GimpTransformTool *tool,
const GimpCoords *coords,
GdkModifierType state,
GimpDisplay *display);
void (* cursor_update) (GimpTransformTool *tr_tool,
GimpCursorType *cursor,
GimpCursorModifier *modifier);
void (* draw_gui) (GimpTransformTool *tool);
GeglBuffer * (* transform) (GimpTransformTool *tool,
GimpItem *item,
GeglBuffer *orig_buffer,
......
......@@ -111,7 +111,6 @@ gimp_unified_transform_tool_init (GimpUnifiedTransformTool *unified_tool)
GimpTransformTool *tr_tool = GIMP_TRANSFORM_TOOL (unified_tool);
tr_tool->progress_text = _("Unified transform");
tr_tool->use_grid = TRUE;
tr_tool->does_perspective = TRUE;
}
......
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