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

« back to all changes in this revision

Viewing changes to app/paint/gimppaintcore.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 Spencer Kimball and Peter Mattis
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify
20
20
#define __GIMP_PAINT_CORE_H__
21
21
 
22
22
 
 
23
#include "libgimpmath/gimpvector.h"
23
24
#include "core/gimpobject.h"
24
25
 
25
26
 
37
38
{
38
39
  GimpObject   parent_instance;
39
40
 
40
 
  gint         ID;            /*  unique instance ID               */
41
 
 
42
 
  GimpCoords   start_coords;  /*  starting coords (for undo only)  */
43
 
 
44
 
  GimpCoords   cur_coords;    /*  current coords                   */
45
 
  GimpCoords   last_coords;   /*  last coords                      */
46
 
 
47
 
  GimpVector2  last_paint;    /*  last point that was painted      */
48
 
 
49
 
  gdouble      distance;      /*  distance traveled by brush       */
50
 
  gdouble      pixel_dist;    /*  distance in pixels               */
51
 
 
52
 
  gint         x1, y1;        /*  undo extents in image coords     */
53
 
  gint         x2, y2;        /*  undo extents in image coords     */
54
 
 
55
 
  gboolean     use_pressure;  /*  look at coords->pressure         */
56
 
 
57
 
  TileManager *undo_tiles;    /*  tiles which have been modified   */
58
 
  TileManager *canvas_tiles;  /*  the buffer to paint the mask to  */
59
 
 
60
 
  TempBuf     *orig_buf;      /*  the unmodified drawable pixels   */
61
 
  TempBuf     *canvas_buf;    /*  the buffer to paint pixels to    */
62
 
 
 
41
  gint         ID;               /*  unique instance ID                  */
 
42
 
 
43
  gchar       *undo_desc;        /*  undo description                    */
 
44
 
 
45
  GimpCoords   start_coords;     /*  starting coords (for undo only)     */
 
46
 
 
47
  GimpCoords   cur_coords;       /*  current coords                      */
 
48
  GimpCoords   last_coords;      /*  last coords                         */
 
49
 
 
50
  GimpVector2  last_paint;       /*  last point that was painted         */
 
51
 
 
52
  gdouble      distance;         /*  distance traveled by brush          */
 
53
  gdouble      pixel_dist;       /*  distance in pixels                  */
 
54
 
 
55
  gint         x1, y1;           /*  undo extents in image coords        */
 
56
  gint         x2, y2;           /*  undo extents in image coords        */
 
57
 
 
58
  gboolean     use_pressure;     /*  look at coords->pressure            */
 
59
  gboolean     use_saved_proj;   /*  keep the unmodified proj around     */
 
60
 
 
61
  TileManager *undo_tiles;       /*  tiles which have been modified      */
 
62
  TileManager *saved_proj_tiles; /*  proj tiles which have been modified */
 
63
  TileManager *canvas_tiles;     /*  the buffer to paint the mask to     */
 
64
 
 
65
  TempBuf     *orig_buf;         /*  the unmodified drawable pixels      */
 
66
  TempBuf     *orig_proj_buf;    /*  the unmodified projection pixels    */
 
67
  TempBuf     *canvas_buf;       /*  the buffer to paint pixels to       */
63
68
};
64
69
 
65
70
struct _GimpPaintCoreClass
67
72
  GimpObjectClass  parent_class;
68
73
 
69
74
  /*  virtual functions  */
70
 
  gboolean  (* start)          (GimpPaintCore    *core,
71
 
                                GimpDrawable     *drawable,
72
 
                                GimpPaintOptions *paint_options,
73
 
                                GimpCoords       *coords);
74
 
 
75
 
  gboolean  (* pre_paint)      (GimpPaintCore    *core,
76
 
                                GimpDrawable     *drawable,
77
 
                                GimpPaintOptions *paint_options,
78
 
                                GimpPaintState    paint_state,
79
 
                                guint32           time);
80
 
  void      (* paint)          (GimpPaintCore    *core,
81
 
                                GimpDrawable     *drawable,
82
 
                                GimpPaintOptions *paint_options,
83
 
                                GimpPaintState    paint_state,
84
 
                                guint32           time);
85
 
  void      (* post_paint)     (GimpPaintCore    *core,
86
 
                                GimpDrawable     *drawable,
87
 
                                GimpPaintOptions *paint_options,
88
 
                                GimpPaintState    paint_state,
89
 
                                guint32           time);
90
 
 
91
 
  void      (* interpolate)    (GimpPaintCore    *core,
92
 
                                GimpDrawable     *drawable,
93
 
                                GimpPaintOptions *paint_options,
94
 
                                guint32           time);
95
 
 
96
 
  TempBuf * (* get_paint_area) (GimpPaintCore    *core,
97
 
                                GimpDrawable     *drawable,
98
 
                                GimpPaintOptions *paint_options);
99
 
 
100
 
  gboolean  (* push_undo)      (GimpPaintCore    *core,
101
 
                                GimpImage        *gimage,
102
 
                                const gchar      *undo_desc);
 
75
  gboolean   (* start)          (GimpPaintCore    *core,
 
76
                                 GimpDrawable     *drawable,
 
77
                                 GimpPaintOptions *paint_options,
 
78
                                 GimpCoords       *coords,
 
79
                                 GError          **error);
 
80
 
 
81
  gboolean   (* pre_paint)      (GimpPaintCore    *core,
 
82
                                 GimpDrawable     *drawable,
 
83
                                 GimpPaintOptions *paint_options,
 
84
                                 GimpPaintState    paint_state,
 
85
                                 guint32           time);
 
86
  void       (* paint)          (GimpPaintCore    *core,
 
87
                                 GimpDrawable     *drawable,
 
88
                                 GimpPaintOptions *paint_options,
 
89
                                 GimpPaintState    paint_state,
 
90
                                 guint32           time);
 
91
  void       (* post_paint)     (GimpPaintCore    *core,
 
92
                                 GimpDrawable     *drawable,
 
93
                                 GimpPaintOptions *paint_options,
 
94
                                 GimpPaintState    paint_state,
 
95
                                 guint32           time);
 
96
 
 
97
  void       (* interpolate)    (GimpPaintCore    *core,
 
98
                                 GimpDrawable     *drawable,
 
99
                                 GimpPaintOptions *paint_options,
 
100
                                 guint32           time);
 
101
 
 
102
  TempBuf  * (* get_paint_area) (GimpPaintCore    *core,
 
103
                                 GimpDrawable     *drawable,
 
104
                                 GimpPaintOptions *paint_options);
 
105
 
 
106
  GimpUndo * (* push_undo)      (GimpPaintCore    *core,
 
107
                                 GimpImage        *image,
 
108
                                 const gchar      *undo_desc);
103
109
};
104
110
 
105
111
 
106
 
GType     gimp_paint_core_get_type       (void) G_GNUC_CONST;
107
 
 
108
 
void      gimp_paint_core_paint          (GimpPaintCore      *core,
109
 
                                          GimpDrawable       *drawable,
110
 
                                          GimpPaintOptions   *paint_options,
111
 
                                          GimpPaintState      state,
112
 
                                          guint32             time);
113
 
 
114
 
gboolean  gimp_paint_core_start          (GimpPaintCore      *core,
115
 
                                          GimpDrawable       *drawable,
116
 
                                          GimpPaintOptions   *paint_options,
117
 
                                          GimpCoords         *coords);
118
 
void      gimp_paint_core_finish         (GimpPaintCore      *core,
119
 
                                          GimpDrawable       *drawable);
120
 
void      gimp_paint_core_cancel         (GimpPaintCore      *core,
121
 
                                          GimpDrawable       *drawable);
122
 
void      gimp_paint_core_cleanup        (GimpPaintCore      *core);
123
 
 
124
 
void      gimp_paint_core_interpolate    (GimpPaintCore      *core,
125
 
                                          GimpDrawable       *drawable,
126
 
                                          GimpPaintOptions   *paint_options,
127
 
                                          guint32             time);
 
112
GType     gimp_paint_core_get_type                  (void) G_GNUC_CONST;
 
113
 
 
114
void      gimp_paint_core_paint                     (GimpPaintCore    *core,
 
115
                                                     GimpDrawable     *drawable,
 
116
                                                     GimpPaintOptions *paint_options,
 
117
                                                     GimpPaintState    state,
 
118
                                                     guint32           time);
 
119
 
 
120
gboolean  gimp_paint_core_start                     (GimpPaintCore    *core,
 
121
                                                     GimpDrawable     *drawable,
 
122
                                                     GimpPaintOptions *paint_options,
 
123
                                                     GimpCoords       *coords,
 
124
                                                     GError          **error);
 
125
void      gimp_paint_core_finish                    (GimpPaintCore    *core,
 
126
                                                     GimpDrawable     *drawable);
 
127
void      gimp_paint_core_cancel                    (GimpPaintCore    *core,
 
128
                                                     GimpDrawable     *drawable);
 
129
void      gimp_paint_core_cleanup                   (GimpPaintCore    *core);
 
130
 
 
131
void      gimp_paint_core_interpolate               (GimpPaintCore    *core,
 
132
                                                     GimpDrawable     *drawable,
 
133
                                                     GimpPaintOptions *paint_options,
 
134
                                                     guint32           time);
128
135
 
129
136
 
130
137
/*  protected functions  */
131
138
 
132
 
TempBuf * gimp_paint_core_get_paint_area (GimpPaintCore      *core,
133
 
                                          GimpDrawable       *drawable,
134
 
                                          GimpPaintOptions   *options);
135
 
TempBuf * gimp_paint_core_get_orig_image (GimpPaintCore      *core,
136
 
                                          GimpDrawable       *drawable,
137
 
                                          gint                x1,
138
 
                                          gint                y1,
139
 
                                          gint                x2,
140
 
                                          gint                y2);
141
 
 
142
 
void      gimp_paint_core_paste    (GimpPaintCore            *core,
143
 
                                    PixelRegion              *paint_maskPR,
144
 
                                    GimpDrawable             *drawable,
145
 
                                    gdouble                   paint_opacity,
146
 
                                    gdouble                   image_opacity,
147
 
                                    GimpLayerModeEffects      paint_mode,
148
 
                                    GimpPaintApplicationMode  mode);
149
 
void      gimp_paint_core_replace  (GimpPaintCore            *core,
150
 
                                    PixelRegion              *paint_maskPR,
151
 
                                    GimpDrawable             *drawable,
152
 
                                    gdouble                   paint_opacity,
153
 
                                    gdouble                   image_opacity,
154
 
                                    GimpPaintApplicationMode  mode);
155
 
 
156
 
void    gimp_paint_core_validate_undo_tiles   (GimpPaintCore *core,
157
 
                                               GimpDrawable  *drawable,
158
 
                                               gint           x,
159
 
                                               gint           y,
160
 
                                               gint           w,
161
 
                                               gint           h);
162
 
void    gimp_paint_core_validate_canvas_tiles (GimpPaintCore *core,
163
 
                                               gint           x,
164
 
                                               gint           y,
165
 
                                               gint           w,
166
 
                                               gint           h);
 
139
TempBuf * gimp_paint_core_get_paint_area            (GimpPaintCore    *core,
 
140
                                                     GimpDrawable     *drawable,
 
141
                                                     GimpPaintOptions *options);
 
142
TempBuf * gimp_paint_core_get_orig_image            (GimpPaintCore    *core,
 
143
                                                     GimpDrawable     *drawable,
 
144
                                                     gint              x1,
 
145
                                                     gint              y1,
 
146
                                                     gint              x2,
 
147
                                                     gint              y2);
 
148
TempBuf * gimp_paint_core_get_orig_proj             (GimpPaintCore    *core,
 
149
                                                     GimpPickable     *pickable,
 
150
                                                     gint              x1,
 
151
                                                     gint              y1,
 
152
                                                     gint              x2,
 
153
                                                     gint              y2);
 
154
 
 
155
void      gimp_paint_core_paste             (GimpPaintCore            *core,
 
156
                                             PixelRegion              *paint_maskPR,
 
157
                                             GimpDrawable             *drawable,
 
158
                                             gdouble                   paint_opacity,
 
159
                                             gdouble                   image_opacity,
 
160
                                             GimpLayerModeEffects      paint_mode,
 
161
                                             GimpPaintApplicationMode  mode);
 
162
void      gimp_paint_core_replace           (GimpPaintCore            *core,
 
163
                                             PixelRegion              *paint_maskPR,
 
164
                                             GimpDrawable             *drawable,
 
165
                                             gdouble                   paint_opacity,
 
166
                                             gdouble                   image_opacity,
 
167
                                             GimpPaintApplicationMode  mode);
 
168
 
 
169
void      gimp_paint_core_validate_undo_tiles       (GimpPaintCore    *core,
 
170
                                                     GimpDrawable     *drawable,
 
171
                                                     gint              x,
 
172
                                                     gint              y,
 
173
                                                     gint              w,
 
174
                                                     gint              h);
 
175
void      gimp_paint_core_validate_saved_proj_tiles (GimpPaintCore    *core,
 
176
                                                     GimpPickable     *pickable,
 
177
                                                     gint              x,
 
178
                                                     gint              y,
 
179
                                                     gint              w,
 
180
                                                     gint              h);
 
181
void      gimp_paint_core_validate_canvas_tiles     (GimpPaintCore    *core,
 
182
                                                     gint              x,
 
183
                                                     gint              y,
 
184
                                                     gint              w,
 
185
                                                     gint              h);
167
186
 
168
187
 
169
188
#endif  /*  __GIMP_PAINT_CORE_H__  */