core-types.h 6.52 KB
Newer Older
Michael Natterer's avatar
Michael Natterer committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
/* The GIMP -- an image manipulation program
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (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
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef __CORE_TYPES_H__
#define __CORE_TYPES_H__


23 24 25 26 27
#include "libgimpbase/gimpbasetypes.h"
#include "libgimpmath/gimpmath.h"

#include "base/base-types.h"

28 29
#include "core/core-enums.h"

Michael Natterer's avatar
Michael Natterer committed
30

31 32 33 34 35 36
/*  defines  */

#define GIMP_OPACITY_TRANSPARENT 0.0
#define GIMP_OPACITY_OPAQUE      1.0


37 38
/*  enums  */

39 40 41 42 43 44
typedef enum  /*< chop=ADD_ >*/
{
  ADD_WHITE_MASK,
  ADD_BLACK_MASK,
  ADD_ALPHA_MASK,
  ADD_SELECTION_MASK,
45 46 47
  ADD_INV_SELECTION_MASK,
  ADD_COPY_MASK,
  ADD_INV_COPY_MASK
48 49
} AddMaskType;

50 51 52 53 54 55
typedef enum
{
  APPLY,
  DISCARD
} MaskApplyMode;

56 57 58 59 60 61 62
typedef enum
{
  HORIZONTAL,
  VERTICAL,
  UNKNOWN
} OrientationType;

63
typedef enum /*< pdb-skip >*/
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
{
  ORIENTATION_UNKNOWN,
  ORIENTATION_HORIZONTAL,
  ORIENTATION_VERTICAL
} InternalOrientationType;

/*  Selection Boolean operations  */
typedef enum /*< chop=CHANNEL_OP_ >*/
{
  CHANNEL_OP_ADD,
  CHANNEL_OP_SUB,
  CHANNEL_OP_REPLACE,
  CHANNEL_OP_INTERSECT
} ChannelOps;

Michael Natterer's avatar
Michael Natterer committed
79 80 81 82 83 84 85 86 87
typedef enum
{
  FOREGROUND_FILL,	/*< nick=FG_IMAGE_FILL >*/
  BACKGROUND_FILL,	/*< nick=BG_IMAGE_FILL >*/
  WHITE_FILL,		/*< nick=WHITE_IMAGE_FILL >*/
  TRANSPARENT_FILL,	/*< nick=TRANS_IMAGE_FILL >*/
  NO_FILL		/*< nick=NO_IMAGE_FILL >*/
} GimpFillType;

88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
typedef enum
{
  OFFSET_BACKGROUND,
  OFFSET_TRANSPARENT
} GimpOffsetType;

typedef enum
{
  EXPAND_AS_NECESSARY,
  CLIP_TO_IMAGE,
  CLIP_TO_BOTTOM_LAYER,
  FLATTEN_IMAGE
} MergeType;

typedef enum
{
  MAKE_PALETTE   = 0,
  REUSE_PALETTE  = 1,
  WEB_PALETTE    = 2,
  MONO_PALETTE   = 3,
  CUSTOM_PALETTE = 4
} ConvertPaletteType;

typedef enum
{
  NO_DITHER         = 0,
  FS_DITHER         = 1,
  FSLOWBLEED_DITHER = 2,
  FIXED_DITHER      = 3,

  NODESTRUCT_DITHER = 4 /* NEVER USE NODESTRUCT_DITHER EXPLICITLY */
} ConvertDitherType;

121 122 123 124 125 126 127
typedef enum
{
  FG_BUCKET_FILL,
  BG_BUCKET_FILL,
  PATTERN_BUCKET_FILL
} BucketFillMode;

Michael Natterer's avatar
Michael Natterer committed
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
typedef enum /*< pdb-skip >*/ /*< skip >*/
{
  /* NOTE: If you change this list, please update the textual mapping at
   *  the bottom of undo.c as well.
   */

  /* Type NO_UNDO_GROUP (0) is special - in the gimpimage structure it
   * means there is no undo group currently being added to.
   */
  NO_UNDO_GROUP = 0,

  FIRST_UNDO_GROUP = NO_UNDO_GROUP,

  IMAGE_SCALE_UNDO_GROUP,
  IMAGE_RESIZE_UNDO_GROUP,
  IMAGE_CONVERT_UNDO_GROUP,
  IMAGE_CROP_UNDO_GROUP,
  IMAGE_LAYERS_MERGE_UNDO_GROUP,
  IMAGE_QMASK_UNDO_GROUP,
  IMAGE_GUIDE_UNDO_GROUP,
148
  LAYER_PROPERTIES_UNDO_GROUP,
Michael Natterer's avatar
Michael Natterer committed
149 150 151 152 153 154 155 156 157 158 159 160
  LAYER_SCALE_UNDO_GROUP,
  LAYER_RESIZE_UNDO_GROUP,
  LAYER_DISPLACE_UNDO_GROUP,
  LAYER_LINKED_UNDO_GROUP,
  LAYER_APPLY_MASK_UNDO_GROUP,
  FS_FLOAT_UNDO_GROUP,
  FS_ANCHOR_UNDO_GROUP,
  EDIT_PASTE_UNDO_GROUP,
  EDIT_CUT_UNDO_GROUP,
  TEXT_UNDO_GROUP,
  TRANSFORM_UNDO_GROUP,
  PAINT_UNDO_GROUP,
161 162
  PARASITE_ATTACH_UNDO_GROUP,
  PARASITE_REMOVE_UNDO_GROUP,
Michael Natterer's avatar
Michael Natterer committed
163 164 165 166 167
  MISC_UNDO_GROUP,

  LAST_UNDO_GROUP = MISC_UNDO_GROUP
} UndoType;

168

Michael Natterer's avatar
Michael Natterer committed
169 170 171 172
/*  base objects  */

typedef struct _GimpObject          GimpObject;

173 174
typedef struct _Gimp                Gimp;

175 176
typedef struct _GimpParasiteList    GimpParasiteList;

Michael Natterer's avatar
Michael Natterer committed
177 178
typedef struct _GimpModuleInfoObj   GimpModuleInfoObj;

Michael Natterer's avatar
Michael Natterer committed
179 180 181 182 183 184 185 186 187
typedef struct _GimpContainer       GimpContainer;
typedef struct _GimpList            GimpList;
typedef struct _GimpDataList        GimpDataList;

typedef struct _GimpDataFactory     GimpDataFactory;

typedef struct _GimpContext         GimpContext;

typedef struct _GimpViewable        GimpViewable;
188
typedef struct _GimpItem            GimpItem;
Michael Natterer's avatar
Michael Natterer committed
189

Michael Natterer's avatar
Michael Natterer committed
190 191
typedef struct _GimpBuffer          GimpBuffer;

192
typedef struct _GimpPaintInfo       GimpPaintInfo;
Michael Natterer's avatar
Michael Natterer committed
193 194
typedef struct _GimpToolInfo        GimpToolInfo;

195
typedef struct _GimpImagefile       GimpImagefile;
Michael Natterer's avatar
Michael Natterer committed
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229

/*  drawable objects  */

typedef struct _GimpDrawable        GimpDrawable;

typedef struct _GimpChannel         GimpChannel;

typedef struct _GimpLayer           GimpLayer;
typedef struct _GimpLayerMask       GimpLayerMask;

typedef struct _GimpImage           GimpImage;


/*  data objects  */

typedef struct _GimpData            GimpData;

typedef struct _GimpBrush	    GimpBrush;
typedef struct _GimpBrushGenerated  GimpBrushGenerated;
typedef struct _GimpBrushPipe       GimpBrushPipe;

typedef struct _GimpGradient        GimpGradient;

typedef struct _GimpPattern         GimpPattern;

typedef struct _GimpPalette         GimpPalette;


/*  undo objects  */

typedef struct _GimpUndo            GimpUndo;
typedef struct _GimpUndoStack       GimpUndoStack;


230 231 232 233 234
/*  other objects  */

typedef struct _ImageMap            ImageMap; /* temp_hack, will be an object */


Michael Natterer's avatar
Michael Natterer committed
235 236
/*  non-object types  */

237 238
typedef struct _GimpCoords          GimpCoords;

239 240
typedef struct _GimpCoreConfig      GimpCoreConfig;

Michael Natterer's avatar
Michael Natterer committed
241 242
typedef struct _GimpGuide           GimpGuide;

243 244
typedef struct _GimpImageNewValues  GimpImageNewValues;

245 246 247 248
typedef struct _GimpProgress        GimpProgress;

typedef         guint32             GimpTattoo;

249 250
typedef struct _GimpPaletteEntry    GimpPaletteEntry;

251 252 253 254 255 256 257

/*  EEK stuff  */

typedef struct _Path                Path;
typedef struct _PathPoint           PathPoint;
typedef struct _PathList            PathList;

Michael Natterer's avatar
Michael Natterer committed
258

259 260 261 262 263
/*  stuff which is forward declared here so we don't need to cross-include it  */

typedef struct _GimpToolOptions     GimpToolOptions;


Michael Natterer's avatar
Michael Natterer committed
264 265
/*  functions  */

266 267 268
typedef void       (* GimpInitStatusFunc)       (const gchar *text1,
                                                 const gchar *text2,
                                                 gdouble      percentage);
Michael Natterer's avatar
Michael Natterer committed
269 270 271 272 273
typedef void       (* GimpDataFileLoaderFunc)   (const gchar *filename,
						 gpointer     loader_data);
typedef GimpData * (* GimpDataObjectLoaderFunc) (const gchar *filename);


274 275 276 277 278 279 280 281 282 283 284 285 286
/*  structs  */

struct _GimpCoords
{
  gdouble x;
  gdouble y;
  gdouble pressure;
  gdouble xtilt;
  gdouble ytilt;
  gdouble wheel;
};


287 288 289 290 291 292
#include "paint/paint-types.h"
#include "vectors/vectors-types.h"
#include "pdb/pdb-types.h"
#include "plug-in/plug-in-types.h"


Michael Natterer's avatar
Michael Natterer committed
293
#endif /* __CORE_TYPES_H__ */