core-types.h 11 KB
Newer Older
1
/* GIMP - The GNU Image Manipulation Program
2 3
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
 *
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 8 9 10 11 12 13 14
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * 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 19 20 21
 */

#ifndef __CORE_TYPES_H__
#define __CORE_TYPES_H__


22 23 24
#include "libgimpbase/gimpbasetypes.h"
#include "libgimpmath/gimpmathtypes.h"
#include "libgimpcolor/gimpcolortypes.h"
25
#include "libgimpmodule/gimpmoduletypes.h"
Sven Neumann's avatar
Sven Neumann committed
26
#include "libgimpthumb/gimpthumb-types.h"
27

28
#include "config/config-types.h"
29

30 31
#include "core/core-enums.h"

32

33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
/*  former base/ defines  */

#define MAX_CHANNELS  4

#define RED           0
#define GREEN         1
#define BLUE          2
#define ALPHA         3

#define GRAY          0
#define ALPHA_G       1

#define INDEXED       0
#define ALPHA_I       1


49 50
/*  defines  */

51 52 53 54 55 56 57 58 59 60 61
#define GIMP_COORDS_MIN_PRESSURE      0.0
#define GIMP_COORDS_MAX_PRESSURE      1.0
#define GIMP_COORDS_DEFAULT_PRESSURE  1.0

#define GIMP_COORDS_MIN_TILT         -1.0
#define GIMP_COORDS_MAX_TILT          1.0
#define GIMP_COORDS_DEFAULT_TILT      0.0

#define GIMP_COORDS_MIN_WHEEL         0.0
#define GIMP_COORDS_MAX_WHEEL         1.0
#define GIMP_COORDS_DEFAULT_WHEEL     0.5
62

63 64 65 66
#define GIMP_COORDS_DEFAULT_DISTANCE  0.0
#define GIMP_COORDS_DEFAULT_ROTATION  0.0
#define GIMP_COORDS_DEFAULT_SLIDER    0.0

67 68
#define GIMP_COORDS_DEFAULT_VELOCITY  0.0

69 70
#define GIMP_COORDS_DEFAULT_DIRECTION 0.0

71 72 73
#define GIMP_COORDS_DEFAULT_XSCALE    1.0
#define GIMP_COORDS_DEFAULT_YSCALE    1.0

74 75 76 77 78
#define GIMP_COORDS_DEFAULT_VALUES    { 0.0, 0.0, \
                                        GIMP_COORDS_DEFAULT_PRESSURE, \
                                        GIMP_COORDS_DEFAULT_TILT,     \
                                        GIMP_COORDS_DEFAULT_TILT,     \
                                        GIMP_COORDS_DEFAULT_WHEEL,    \
79 80 81
                                        GIMP_COORDS_DEFAULT_DISTANCE, \
                                        GIMP_COORDS_DEFAULT_ROTATION, \
                                        GIMP_COORDS_DEFAULT_SLIDER,   \
82
                                        GIMP_COORDS_DEFAULT_VELOCITY, \
83 84 85
                                        GIMP_COORDS_DEFAULT_DIRECTION,\
                                        GIMP_COORDS_DEFAULT_XSCALE,   \
                                        GIMP_COORDS_DEFAULT_YSCALE }
86

87

88
/*  base classes  */
89

90 91 92 93
typedef struct _GimpObject                      GimpObject;
typedef struct _GimpViewable                    GimpViewable;
typedef struct _GimpFilter                      GimpFilter;
typedef struct _GimpItem                        GimpItem;
94
typedef struct _GimpAuxItem                     GimpAuxItem;
95

96 97
typedef struct _Gimp                            Gimp;
typedef struct _GimpImage                       GimpImage;
98

99

100
/*  containers  */
101

102 103 104 105 106 107 108 109 110
typedef struct _GimpContainer                   GimpContainer;
typedef struct _GimpList                        GimpList;
typedef struct _GimpDocumentList                GimpDocumentList;
typedef struct _GimpDrawableStack               GimpDrawableStack;
typedef struct _GimpFilteredContainer           GimpFilteredContainer;
typedef struct _GimpFilterStack                 GimpFilterStack;
typedef struct _GimpItemStack                   GimpItemStack;
typedef struct _GimpLayerStack                  GimpLayerStack;
typedef struct _GimpTaggedContainer             GimpTaggedContainer;
111

112

113 114
/*  not really a container  */

115
typedef struct _GimpItemTree                    GimpItemTree;
116 117


118
/*  context objects  */
119

120 121 122 123
typedef struct _GimpContext                     GimpContext;
typedef struct _GimpFillOptions                 GimpFillOptions;
typedef struct _GimpStrokeOptions               GimpStrokeOptions;
typedef struct _GimpToolOptions                 GimpToolOptions;
124 125


126
/*  info objects  */
127

128 129
typedef struct _GimpPaintInfo                   GimpPaintInfo;
typedef struct _GimpToolInfo                    GimpToolInfo;
130 131 132 133


/*  data objects  */

134
typedef struct _GimpDataFactory                 GimpDataFactory;
135
typedef struct _GimpDataLoaderFactory           GimpDataLoaderFactory;
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
typedef struct _GimpData                        GimpData;
typedef struct _GimpBrush                       GimpBrush;
typedef struct _GimpBrushCache                  GimpBrushCache;
typedef struct _GimpBrushClipboard              GimpBrushClipboard;
typedef struct _GimpBrushGenerated              GimpBrushGenerated;
typedef struct _GimpBrushPipe                   GimpBrushPipe;
typedef struct _GimpCurve                       GimpCurve;
typedef struct _GimpDynamics                    GimpDynamics;
typedef struct _GimpDynamicsOutput              GimpDynamicsOutput;
typedef struct _GimpGradient                    GimpGradient;
typedef struct _GimpMybrush                     GimpMybrush;
typedef struct _GimpPalette                     GimpPalette;
typedef struct _GimpPaletteMru                  GimpPaletteMru;
typedef struct _GimpPattern                     GimpPattern;
typedef struct _GimpPatternClipboard            GimpPatternClipboard;
typedef struct _GimpToolPreset                  GimpToolPreset;
typedef struct _GimpTagCache                    GimpTagCache;
153 154


155 156
/*  drawable objects  */

157 158 159 160 161 162
typedef struct _GimpDrawable                    GimpDrawable;
typedef struct _GimpChannel                     GimpChannel;
typedef struct _GimpLayerMask                   GimpLayerMask;
typedef struct _GimpSelection                   GimpSelection;
typedef struct _GimpLayer                       GimpLayer;
typedef struct _GimpGroupLayer                  GimpGroupLayer;
163 164


luz.paz's avatar
luz.paz committed
165
/*  auxiliary image items  */
166 167 168 169 170

typedef struct _GimpGuide                       GimpGuide;
typedef struct _GimpSamplePoint                 GimpSamplePoint;


171 172
/*  undo objects  */

173 174 175
typedef struct _GimpUndo                        GimpUndo;
typedef struct _GimpUndoStack                   GimpUndoStack;
typedef struct _GimpUndoAccumulator             GimpUndoAccumulator;
176 177


Jehan's avatar
Jehan committed
178 179
/* Symmetry transformations */

180 181 182 183
typedef struct _GimpSymmetry                    GimpSymmetry;
typedef struct _GimpMirror                      GimpMirror;
typedef struct _GimpTiling                      GimpTiling;
typedef struct _GimpMandala                     GimpMandala;
Jehan's avatar
Jehan committed
184

185

186 187
/*  misc objects  */

188 189 190 191 192
typedef struct _GimpAsync                       GimpAsync;
typedef struct _GimpAsyncSet                    GimpAsyncSet;
typedef struct _GimpBuffer                      GimpBuffer;
typedef struct _GimpDrawableFilter              GimpDrawableFilter;
typedef struct _GimpEnvironTable                GimpEnvironTable;
193 194
typedef struct _GimpExtension                   GimpExtension;
typedef struct _GimpExtensionManager            GimpExtensionManager;
195 196 197 198 199 200 201 202 203 204 205 206
typedef struct _GimpHistogram                   GimpHistogram;
typedef struct _GimpIdTable                     GimpIdTable;
typedef struct _GimpImagefile                   GimpImagefile;
typedef struct _GimpInterpreterDB               GimpInterpreterDB;
typedef struct _GimpObjectQueue                 GimpObjectQueue;
typedef struct _GimpParasiteList                GimpParasiteList;
typedef struct _GimpPdbProgress                 GimpPdbProgress;
typedef struct _GimpProjection                  GimpProjection;
typedef struct _GimpSettings                    GimpSettings;
typedef struct _GimpSubProgress                 GimpSubProgress;
typedef struct _GimpTag                         GimpTag;
typedef struct _GimpTreeHandler                 GimpTreeHandler;
207
typedef struct _GimpTriviallyCancelableWaitable GimpTriviallyCancelableWaitable;
208
typedef struct _GimpUncancelableWaitable        GimpUncancelableWaitable;
209 210


211 212
/*  interfaces  */

213 214 215 216 217 218
typedef struct _GimpCancelable                  GimpCancelable;  /* dummy typedef */
typedef struct _GimpPickable                    GimpPickable;    /* dummy typedef */
typedef struct _GimpProgress                    GimpProgress;    /* dummy typedef */
typedef struct _GimpProjectable                 GimpProjectable; /* dummy typedef */
typedef struct _GimpTagged                      GimpTagged;      /* dummy typedef */
typedef struct _GimpWaitable                    GimpWaitable;    /* dummy typedef */
219 220


221 222
/*  non-object types  */

Ell's avatar
Ell committed
223
typedef struct _GimpBacktrace                   GimpBacktrace;
224 225 226 227 228 229 230
typedef struct _GimpBoundSeg                    GimpBoundSeg;
typedef struct _GimpCoords                      GimpCoords;
typedef struct _GimpGradientSegment             GimpGradientSegment;
typedef struct _GimpPaletteEntry                GimpPaletteEntry;
typedef struct _GimpScanConvert                 GimpScanConvert;
typedef struct _GimpTempBuf                     GimpTempBuf;
typedef         guint32                         GimpTattoo;
231

232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249
/* The following hack is made so that we can reuse the definition
 * the cairo definition of cairo_path_t without having to translate
 * between our own version of a bezier description and cairos version.
 *
 * to avoid having to include <cairo.h> in each and every file
 * including this file we only use the "real" definition when cairo.h
 * already has been included and use something else.
 *
 * Note that if you really want to work with GimpBezierDesc (except just
 * passing pointers to it around) you also need to include <cairo.h>.
 */
#ifdef CAIRO_VERSION
typedef cairo_path_t GimpBezierDesc;
#else
typedef void * GimpBezierDesc;
#endif


250 251
/*  functions  */

252 253 254
typedef void     (* GimpInitStatusFunc)    (const gchar *text1,
                                            const gchar *text2,
                                            gdouble      percentage);
255

256 257
typedef gboolean (* GimpObjectFilterFunc)  (GimpObject  *object,
                                            gpointer     user_data);
258

259 260
typedef gint64   (* GimpMemsizeFunc)       (gpointer     instance,
                                            gint64      *gui_size);
261

262

263 264 265 266
/*  structs  */

struct _GimpCoords
{
267
  /* axes as reported by the device */
268 269 270 271 272 273
  gdouble  x;
  gdouble  y;
  gdouble  pressure;
  gdouble  xtilt;
  gdouble  ytilt;
  gdouble  wheel;
274 275 276 277 278
  gdouble  distance;
  gdouble  rotation;
  gdouble  slider;

  /* synthetic axes */
279 280
  gdouble  velocity;
  gdouble  direction;
281 282

  /* view transform */
283
  gdouble  xscale;  /* the view scale                */
284
  gdouble  yscale;
285 286
  gdouble  angle;   /* the view rotation angle       */
  gboolean reflect; /* whether the view is reflected */
287 288
};

289 290 291 292 293 294 295 296 297 298 299 300
/*  temp hack as replacement for GdkSegment  */

typedef struct _GimpSegment GimpSegment;

struct _GimpSegment
{
  gint x1;
  gint y1;
  gint x2;
  gint y2;
};

301

302
#include "gegl/gimp-gegl-types.h"
303
#include "paint/paint-types.h"
304
#include "text/text-types.h"
305 306 307 308 309
#include "vectors/vectors-types.h"
#include "pdb/pdb-types.h"
#include "plug-in/plug-in-types.h"


310
#endif /* __CORE_TYPES_H__ */