20
20
#define __GIMP_TRANSFORM_TOOL_H__
23
#include "libgimpmath/gimpmatrix.h"
23
24
#include "gimpdrawtool.h"
25
#include "dialogs/dialogs-types.h" /* FIXME */
28
/* buffer sizes for scaling information strings (for the info dialog) */
29
#define MAX_INFO_BUF 40
30
#define TRAN_INFO_SIZE 8
33
typedef gdouble TransInfo[TRAN_INFO_SIZE];
27
#define TRANS_INFO_SIZE 8
30
typedef gdouble TransInfo[TRANS_INFO_SIZE];
36
33
#define GIMP_TYPE_TRANSFORM_TOOL (gimp_transform_tool_get_type ())
48
47
GimpDrawTool parent_instance;
50
gdouble startx; /* starting x coord */
51
gdouble starty; /* starting y coord */
53
gdouble curx; /* current x coord */
54
gdouble cury; /* current y coord */
56
gdouble lastx; /* last x coord */
57
gdouble lasty; /* last y coord */
59
GdkModifierType state; /* state of buttons and keys */
61
gint x1, y1; /* upper left hand coordinate */
62
gint x2, y2; /* lower right hand coords */
63
gdouble cx, cy; /* center point (for rotation) */
65
gdouble tx1, ty1; /* transformed coords */
49
gdouble startx; /* starting x coord */
50
gdouble starty; /* starting y coord */
52
gdouble curx; /* current x coord */
53
gdouble cury; /* current y coord */
55
gdouble lastx; /* last x coord */
56
gdouble lasty; /* last y coord */
58
GdkModifierType state; /* state of buttons and keys */
60
gint x1, y1; /* upper left hand coordinate */
61
gint x2, y2; /* lower right hand coords */
62
gdouble cx, cy; /* center point (for rotation) */
63
gdouble aspect; /* original aspect ratio */
65
gdouble tx1, ty1; /* transformed coords */
71
GimpMatrix3 transform; /* transformation matrix */
72
TransInfo trans_info; /* transformation info */
74
TransInfo old_trans_info; /* for cancelling a drag operation */
76
TileManager *original; /* pointer to original tiles */
78
TransformAction function; /* current tool activity */
80
gboolean use_grid; /* does the tool use the grid */
81
gboolean use_center; /* use the center handle */
83
gint ngx, ngy; /* number of grid lines in original
86
gdouble *grid_coords; /* x and y coordinates of the grid
87
* endpoints (a total of (ngx+ngy)*2
90
gdouble *tgrid_coords; /* transformed grid_coords */
71
GimpMatrix3 transform; /* transformation matrix */
72
TransInfo trans_info; /* transformation info */
74
TransInfo old_trans_info; /* for cancelling a drag operation */
76
TileManager *original; /* pointer to original tiles */
78
TransformAction function; /* current tool activity */
80
gboolean use_grid; /* does the tool use the grid */
81
gboolean use_handles; /* uses the corner handles */
82
gboolean use_center; /* uses the center handle */
83
gboolean use_mid_handles; /* use handles at midpoints of edges */
85
gint handle_w; /* handle width */
86
gint handle_h; /* handle height */
88
gint ngx, ngy; /* number of grid lines in original
91
gdouble *grid_coords; /* x and y coordinates of the grid
92
* endpoints (a total of (ngx+ngy)*2
95
gdouble *tgrid_coords; /* transformed grid_coords */
92
97
GimpTransformType type;
93
98
GimpTransformDirection direction;
95
/* transform info dialog */
96
const gchar *shell_desc;
100
const gchar *undo_desc;
97
101
const gchar *progress_text;
99
InfoDialog *info_dialog;
102
106
struct _GimpTransformToolClass
107
111
void (* dialog) (GimpTransformTool *tool);
108
112
void (* dialog_update) (GimpTransformTool *tool);
109
113
void (* prepare) (GimpTransformTool *tool,
114
GimpDisplay *display);
111
115
void (* motion) (GimpTransformTool *tool,
116
GimpDisplay *display);
113
117
void (* recalc) (GimpTransformTool *tool,
118
GimpDisplay *display);
115
119
TileManager * (* transform) (GimpTransformTool *tool,
117
121
gboolean mask_empty,
122
GimpDisplay *display);
122
126
GType gimp_transform_tool_get_type (void) G_GNUC_CONST;
124
128
void gimp_transform_tool_recalc (GimpTransformTool *tr_tool,
129
GimpDisplay *display);
126
130
void gimp_transform_tool_expose_preview (GimpTransformTool *tr_tool);