~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to app/tools/gimptransformtool.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* The GIMP -- an image manipulation program
 
1
/* GIMP - The GNU Image Manipulation Program
2
2
 * Copyright (C) 1995-2001 Spencer Kimball, Peter Mattis, and others
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify
20
20
#define __GIMP_TRANSFORM_TOOL_H__
21
21
 
22
22
 
 
23
#include "libgimpmath/gimpmatrix.h"
23
24
#include "gimpdrawtool.h"
24
25
 
25
 
#include "dialogs/dialogs-types.h" /* FIXME */
26
 
 
27
 
 
28
 
/* buffer sizes for scaling information strings (for the info dialog) */
29
 
#define MAX_INFO_BUF   40
30
 
#define TRAN_INFO_SIZE  8
31
 
 
32
 
 
33
 
typedef gdouble TransInfo[TRAN_INFO_SIZE];
 
26
 
 
27
#define TRANS_INFO_SIZE  8
 
28
 
 
29
 
 
30
typedef gdouble TransInfo[TRANS_INFO_SIZE];
34
31
 
35
32
 
36
33
#define GIMP_TYPE_TRANSFORM_TOOL            (gimp_transform_tool_get_type ())
40
37
#define GIMP_IS_TRANSFORM_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_TRANSFORM_TOOL))
41
38
#define GIMP_TRANSFORM_TOOL_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_TRANSFORM_TOOL, GimpTransformToolClass))
42
39
 
 
40
#define GIMP_TRANSFORM_TOOL_GET_OPTIONS(t)  (GIMP_TRANSFORM_OPTIONS (gimp_tool_get_options (GIMP_TOOL (t))))
 
41
 
43
42
 
44
43
typedef struct _GimpTransformToolClass GimpTransformToolClass;
45
44
 
47
46
{
48
47
  GimpDrawTool    parent_instance;
49
48
 
50
 
  gdouble         startx;         /*  starting x coord                 */
51
 
  gdouble         starty;         /*  starting y coord                 */
52
 
 
53
 
  gdouble         curx;           /*  current x coord                  */
54
 
  gdouble         cury;           /*  current y coord                  */
55
 
 
56
 
  gdouble         lastx;          /*  last x coord                     */
57
 
  gdouble         lasty;          /*  last y coord                     */
58
 
 
59
 
  GdkModifierType state;          /*  state of buttons and keys        */
60
 
 
61
 
  gint            x1, y1;         /*  upper left hand coordinate       */
62
 
  gint            x2, y2;         /*  lower right hand coords          */
63
 
  gdouble         cx, cy;         /*  center point (for rotation)      */
64
 
 
65
 
  gdouble         tx1, ty1;       /*  transformed coords               */
 
49
  gdouble         startx;          /*  starting x coord                  */
 
50
  gdouble         starty;          /*  starting y coord                  */
 
51
 
 
52
  gdouble         curx;            /*  current x coord                   */
 
53
  gdouble         cury;            /*  current y coord                   */
 
54
 
 
55
  gdouble         lastx;           /*  last x coord                      */
 
56
  gdouble         lasty;           /*  last y coord                      */
 
57
 
 
58
  GdkModifierType state;           /*  state of buttons and keys         */
 
59
 
 
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             */
 
64
 
 
65
  gdouble         tx1, ty1;        /*  transformed coords                */
66
66
  gdouble         tx2, ty2;
67
67
  gdouble         tx3, ty3;
68
68
  gdouble         tx4, ty4;
69
69
  gdouble         tcx, tcy;
70
70
 
71
 
  GimpMatrix3     transform;      /*  transformation matrix            */
72
 
  TransInfo       trans_info;     /*  transformation info              */
73
 
 
74
 
  TransInfo       old_trans_info; /*  for cancelling a drag operation  */
75
 
 
76
 
  TileManager    *original;       /*  pointer to original tiles        */
77
 
 
78
 
  TransformAction function;       /*  current tool activity            */
79
 
 
80
 
  gboolean        use_grid;       /*  does the tool use the grid       */
81
 
  gboolean        use_center;     /*  use the center handle            */
82
 
 
83
 
  gint            ngx, ngy;       /*  number of grid lines in original
84
 
                                   *  x and y directions
85
 
                                   */
86
 
  gdouble        *grid_coords;    /*  x and y coordinates of the grid
87
 
                                   *  endpoints (a total of (ngx+ngy)*2
88
 
                                   *  coordinate pairs)
89
 
                                   */
90
 
  gdouble        *tgrid_coords;   /*  transformed grid_coords          */
 
71
  GimpMatrix3     transform;       /*  transformation matrix             */
 
72
  TransInfo       trans_info;      /*  transformation info               */
 
73
 
 
74
  TransInfo       old_trans_info;  /*  for cancelling a drag operation   */
 
75
 
 
76
  TileManager    *original;        /*  pointer to original tiles         */
 
77
 
 
78
  TransformAction function;        /*  current tool activity             */
 
79
 
 
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 */
 
84
 
 
85
  gint            handle_w;        /*  handle width                      */
 
86
  gint            handle_h;        /*  handle height                     */
 
87
 
 
88
  gint            ngx, ngy;        /*  number of grid lines in original
 
89
                                    *  x and y directions
 
90
                                    */
 
91
  gdouble        *grid_coords;     /*  x and y coordinates of the grid
 
92
                                    *  endpoints (a total of (ngx+ngy)*2
 
93
                                    *  coordinate pairs)
 
94
                                    */
 
95
  gdouble        *tgrid_coords;    /*  transformed grid_coords           */
91
96
 
92
97
  GimpTransformType       type;
93
98
  GimpTransformDirection  direction;
94
99
 
95
 
  /*  transform info dialog  */
96
 
  const gchar    *shell_desc;
 
100
  const gchar    *undo_desc;
97
101
  const gchar    *progress_text;
98
102
 
99
 
  InfoDialog     *info_dialog;
 
103
  GtkWidget      *dialog;
100
104
};
101
105
 
102
106
struct _GimpTransformToolClass
107
111
  void          (* dialog)        (GimpTransformTool *tool);
108
112
  void          (* dialog_update) (GimpTransformTool *tool);
109
113
  void          (* prepare)       (GimpTransformTool *tool,
110
 
                                   GimpDisplay       *gdisp);
 
114
                                   GimpDisplay       *display);
111
115
  void          (* motion)        (GimpTransformTool *tool,
112
 
                                   GimpDisplay       *gdisp);
 
116
                                   GimpDisplay       *display);
113
117
  void          (* recalc)        (GimpTransformTool *tool,
114
 
                                   GimpDisplay       *gdisp);
 
118
                                   GimpDisplay       *display);
115
119
  TileManager * (* transform)     (GimpTransformTool *tool,
116
120
                                   GimpItem          *item,
117
121
                                   gboolean           mask_empty,
118
 
                                   GimpDisplay       *gdisp);
 
122
                                   GimpDisplay       *display);
119
123
};
120
124
 
121
125
 
122
126
GType   gimp_transform_tool_get_type       (void) G_GNUC_CONST;
123
127
 
124
128
void    gimp_transform_tool_recalc         (GimpTransformTool *tr_tool,
125
 
                                            GimpDisplay       *gdisp);
 
129
                                            GimpDisplay       *display);
126
130
void    gimp_transform_tool_expose_preview (GimpTransformTool *tr_tool);
127
131
 
128
132