1 /* GIMP - The GNU Image Manipulation Program
2  * Copyright (C) 1995 Spencer Kimball and Peter Mattis
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef __CORE_TYPES_H__
19 #define __CORE_TYPES_H__
20 
21 
22 #include "libgimpbase/gimpbasetypes.h"
23 #include "libgimpmath/gimpmathtypes.h"
24 #include "libgimpcolor/gimpcolortypes.h"
25 #include "libgimpmodule/gimpmoduletypes.h"
26 #include "libgimpthumb/gimpthumb-types.h"
27 
28 #include "config/config-types.h"
29 
30 #include "core/core-enums.h"
31 
32 
33 /*  former base/ defines  */
34 
35 #define MAX_CHANNELS  4
36 
37 #define RED           0
38 #define GREEN         1
39 #define BLUE          2
40 #define ALPHA         3
41 
42 #define GRAY          0
43 #define ALPHA_G       1
44 
45 #define INDEXED       0
46 #define ALPHA_I       1
47 
48 
49 /*  defines  */
50 
51 #define GIMP_COORDS_MIN_PRESSURE      0.0
52 #define GIMP_COORDS_MAX_PRESSURE      1.0
53 #define GIMP_COORDS_DEFAULT_PRESSURE  1.0
54 
55 #define GIMP_COORDS_MIN_TILT         -1.0
56 #define GIMP_COORDS_MAX_TILT          1.0
57 #define GIMP_COORDS_DEFAULT_TILT      0.0
58 
59 #define GIMP_COORDS_MIN_WHEEL         0.0
60 #define GIMP_COORDS_MAX_WHEEL         1.0
61 #define GIMP_COORDS_DEFAULT_WHEEL     0.5
62 
63 #define GIMP_COORDS_DEFAULT_VELOCITY  0.0
64 
65 #define GIMP_COORDS_DEFAULT_DIRECTION 0.0
66 
67 #define GIMP_COORDS_DEFAULT_XSCALE    1.0
68 #define GIMP_COORDS_DEFAULT_YSCALE    1.0
69 
70 #define GIMP_COORDS_DEFAULT_VALUES    { 0.0, 0.0, \
71                                         GIMP_COORDS_DEFAULT_PRESSURE, \
72                                         GIMP_COORDS_DEFAULT_TILT,     \
73                                         GIMP_COORDS_DEFAULT_TILT,     \
74                                         GIMP_COORDS_DEFAULT_WHEEL,    \
75                                         GIMP_COORDS_DEFAULT_VELOCITY, \
76                                         GIMP_COORDS_DEFAULT_DIRECTION,\
77                                         GIMP_COORDS_DEFAULT_XSCALE,   \
78                                         GIMP_COORDS_DEFAULT_YSCALE }
79 
80 
81 /*  base classes  */
82 
83 typedef struct _GimpObject                      GimpObject;
84 typedef struct _GimpViewable                    GimpViewable;
85 typedef struct _GimpFilter                      GimpFilter;
86 typedef struct _GimpItem                        GimpItem;
87 typedef struct _GimpAuxItem                     GimpAuxItem;
88 
89 typedef struct _Gimp                            Gimp;
90 typedef struct _GimpImage                       GimpImage;
91 
92 
93 /*  containers  */
94 
95 typedef struct _GimpContainer                   GimpContainer;
96 typedef struct _GimpList                        GimpList;
97 typedef struct _GimpDocumentList                GimpDocumentList;
98 typedef struct _GimpDrawableStack               GimpDrawableStack;
99 typedef struct _GimpFilteredContainer           GimpFilteredContainer;
100 typedef struct _GimpFilterStack                 GimpFilterStack;
101 typedef struct _GimpItemStack                   GimpItemStack;
102 typedef struct _GimpLayerStack                  GimpLayerStack;
103 typedef struct _GimpTaggedContainer             GimpTaggedContainer;
104 typedef struct _GimpTreeProxy                   GimpTreeProxy;
105 
106 
107 /*  not really a container  */
108 
109 typedef struct _GimpItemTree                    GimpItemTree;
110 
111 
112 /*  context objects  */
113 
114 typedef struct _GimpContext                     GimpContext;
115 typedef struct _GimpFillOptions                 GimpFillOptions;
116 typedef struct _GimpStrokeOptions               GimpStrokeOptions;
117 typedef struct _GimpToolOptions                 GimpToolOptions;
118 
119 
120 /*  info objects  */
121 
122 typedef struct _GimpPaintInfo                   GimpPaintInfo;
123 typedef struct _GimpToolGroup                   GimpToolGroup;
124 typedef struct _GimpToolInfo                    GimpToolInfo;
125 typedef struct _GimpToolItem                    GimpToolItem;
126 
127 
128 /*  data objects  */
129 
130 typedef struct _GimpDataFactory                 GimpDataFactory;
131 typedef struct _GimpDataLoaderFactory           GimpDataLoaderFactory;
132 typedef struct _GimpData                        GimpData;
133 typedef struct _GimpBrush                       GimpBrush;
134 typedef struct _GimpBrushCache                  GimpBrushCache;
135 typedef struct _GimpBrushClipboard              GimpBrushClipboard;
136 typedef struct _GimpBrushGenerated              GimpBrushGenerated;
137 typedef struct _GimpBrushPipe                   GimpBrushPipe;
138 typedef struct _GimpCurve                       GimpCurve;
139 typedef struct _GimpDynamics                    GimpDynamics;
140 typedef struct _GimpDynamicsOutput              GimpDynamicsOutput;
141 typedef struct _GimpGradient                    GimpGradient;
142 typedef struct _GimpMybrush                     GimpMybrush;
143 typedef struct _GimpPalette                     GimpPalette;
144 typedef struct _GimpPaletteMru                  GimpPaletteMru;
145 typedef struct _GimpPattern                     GimpPattern;
146 typedef struct _GimpPatternClipboard            GimpPatternClipboard;
147 typedef struct _GimpToolPreset                  GimpToolPreset;
148 typedef struct _GimpTagCache                    GimpTagCache;
149 
150 
151 /*  drawable objects  */
152 
153 typedef struct _GimpDrawable                    GimpDrawable;
154 typedef struct _GimpChannel                     GimpChannel;
155 typedef struct _GimpLayerMask                   GimpLayerMask;
156 typedef struct _GimpSelection                   GimpSelection;
157 typedef struct _GimpLayer                       GimpLayer;
158 typedef struct _GimpGroupLayer                  GimpGroupLayer;
159 
160 
161 /*  auxillary image items  */
162 
163 typedef struct _GimpGuide                       GimpGuide;
164 typedef struct _GimpSamplePoint                 GimpSamplePoint;
165 
166 
167 /*  undo objects  */
168 
169 typedef struct _GimpUndo                        GimpUndo;
170 typedef struct _GimpUndoStack                   GimpUndoStack;
171 typedef struct _GimpUndoAccumulator             GimpUndoAccumulator;
172 
173 
174 /* Symmetry transformations */
175 
176 typedef struct _GimpSymmetry                    GimpSymmetry;
177 typedef struct _GimpMirror                      GimpMirror;
178 typedef struct _GimpTiling                      GimpTiling;
179 typedef struct _GimpMandala                     GimpMandala;
180 
181 
182 /*  misc objects  */
183 
184 typedef struct _GimpAsync                       GimpAsync;
185 typedef struct _GimpAsyncSet                    GimpAsyncSet;
186 typedef struct _GimpBuffer                      GimpBuffer;
187 typedef struct _GimpDrawableFilter              GimpDrawableFilter;
188 typedef struct _GimpEnvironTable                GimpEnvironTable;
189 typedef struct _GimpHistogram                   GimpHistogram;
190 typedef struct _GimpIdTable                     GimpIdTable;
191 typedef struct _GimpImagefile                   GimpImagefile;
192 typedef struct _GimpImageProxy                  GimpImageProxy;
193 typedef struct _GimpInterpreterDB               GimpInterpreterDB;
194 typedef struct _GimpLineArt                     GimpLineArt;
195 typedef struct _GimpObjectQueue                 GimpObjectQueue;
196 typedef struct _GimpParasiteList                GimpParasiteList;
197 typedef struct _GimpPdbProgress                 GimpPdbProgress;
198 typedef struct _GimpProjection                  GimpProjection;
199 typedef struct _GimpSettings                    GimpSettings;
200 typedef struct _GimpSubProgress                 GimpSubProgress;
201 typedef struct _GimpTag                         GimpTag;
202 typedef struct _GimpTreeHandler                 GimpTreeHandler;
203 typedef struct _GimpTriviallyCancelableWaitable GimpTriviallyCancelableWaitable;
204 typedef struct _GimpUncancelableWaitable        GimpUncancelableWaitable;
205 
206 
207 /*  interfaces  */
208 
209 typedef struct _GimpCancelable                  GimpCancelable;  /* dummy typedef */
210 typedef struct _GimpPickable                    GimpPickable;    /* dummy typedef */
211 typedef struct _GimpProgress                    GimpProgress;    /* dummy typedef */
212 typedef struct _GimpProjectable                 GimpProjectable; /* dummy typedef */
213 typedef struct _GimpTagged                      GimpTagged;      /* dummy typedef */
214 typedef struct _GimpWaitable                    GimpWaitable;    /* dummy typedef */
215 
216 
217 /*  non-object types  */
218 
219 typedef struct _GimpBacktrace                   GimpBacktrace;
220 typedef struct _GimpBoundSeg                    GimpBoundSeg;
221 typedef struct _GimpChunkIterator               GimpChunkIterator;
222 typedef struct _GimpCoords                      GimpCoords;
223 typedef struct _GimpGradientSegment             GimpGradientSegment;
224 typedef struct _GimpPaletteEntry                GimpPaletteEntry;
225 typedef struct _GimpScanConvert                 GimpScanConvert;
226 typedef struct _GimpTempBuf                     GimpTempBuf;
227 typedef         guint32                         GimpTattoo;
228 
229 /* The following hack is made so that we can reuse the definition
230  * the cairo definition of cairo_path_t without having to translate
231  * between our own version of a bezier description and cairos version.
232  *
233  * to avoid having to include <cairo.h> in each and every file
234  * including this file we only use the "real" definition when cairo.h
235  * already has been included and use something else.
236  *
237  * Note that if you really want to work with GimpBezierDesc (except just
238  * passing pointers to it around) you also need to include <cairo.h>.
239  */
240 #ifdef CAIRO_VERSION
241 typedef cairo_path_t GimpBezierDesc;
242 #else
243 typedef void * GimpBezierDesc;
244 #endif
245 
246 
247 /*  functions  */
248 
249 typedef void     (* GimpInitStatusFunc)    (const gchar *text1,
250                                             const gchar *text2,
251                                             gdouble      percentage);
252 
253 typedef gboolean (* GimpObjectFilterFunc)  (GimpObject  *object,
254                                             gpointer     user_data);
255 
256 typedef gint64   (* GimpMemsizeFunc)       (gpointer     instance,
257                                             gint64      *gui_size);
258 
259 typedef void     (* GimpRunAsyncFunc)      (GimpAsync   *async,
260                                             gpointer     user_data);
261 
262 
263 /*  structs  */
264 
265 struct _GimpCoords
266 {
267   gdouble  x;
268   gdouble  y;
269   gdouble  pressure;
270   gdouble  xtilt;
271   gdouble  ytilt;
272   gdouble  wheel;
273   gdouble  velocity;
274   gdouble  direction;
275   gdouble  xscale;  /* the view scale                */
276   gdouble  yscale;
277   gdouble  angle;   /* the view rotation angle       */
278   gboolean reflect; /* whether the view is reflected */
279   gboolean extended;
280 };
281 
282 /*  temp hack as replacement for GdkSegment  */
283 
284 typedef struct _GimpSegment GimpSegment;
285 
286 struct _GimpSegment
287 {
288   gint x1;
289   gint y1;
290   gint x2;
291   gint y2;
292 };
293 
294 
295 #include "gegl/gimp-gegl-types.h"
296 #include "paint/paint-types.h"
297 #include "text/text-types.h"
298 #include "vectors/vectors-types.h"
299 #include "pdb/pdb-types.h"
300 #include "plug-in/plug-in-types.h"
301 
302 
303 #endif /* __CORE_TYPES_H__ */
304