2010-02-03 11:31:25 -08:00
|
|
|
/* GIMP - The GNU 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 3 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
|
2018-07-11 14:47:19 -07:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2010-02-03 11:31:25 -08:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef __GIMP_IMAGE_PRIVATE_H__
|
|
|
|
|
#define __GIMP_IMAGE_PRIVATE_H__
|
|
|
|
|
|
|
|
|
|
|
2010-02-05 00:13:25 -08:00
|
|
|
typedef struct _GimpImageFlushAccumulator GimpImageFlushAccumulator;
|
|
|
|
|
|
|
|
|
|
struct _GimpImageFlushAccumulator
|
|
|
|
|
{
|
|
|
|
|
gboolean alpha_changed;
|
|
|
|
|
gboolean mask_changed;
|
|
|
|
|
gboolean floating_selection_changed;
|
|
|
|
|
gboolean preview_invalidated;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2010-02-03 11:31:25 -08:00
|
|
|
struct _GimpImagePrivate
|
|
|
|
|
{
|
|
|
|
|
gint ID; /* provides a unique ID */
|
|
|
|
|
|
|
|
|
|
GimpPlugInProcedure *load_proc; /* procedure used for loading */
|
|
|
|
|
GimpPlugInProcedure *save_proc; /* last save procedure used */
|
2014-07-02 05:24:02 -07:00
|
|
|
GimpPlugInProcedure *export_proc; /* last export procedure used */
|
2010-02-03 11:31:25 -08:00
|
|
|
|
|
|
|
|
gchar *display_name; /* display basename */
|
2012-07-17 13:52:49 -07:00
|
|
|
gchar *display_path; /* display full path */
|
2010-02-03 11:31:25 -08:00
|
|
|
gint width; /* width in pixels */
|
|
|
|
|
gint height; /* height in pixels */
|
|
|
|
|
gdouble xresolution; /* image x-res, in dpi */
|
|
|
|
|
gdouble yresolution; /* image y-res, in dpi */
|
|
|
|
|
GimpUnit resolution_unit; /* resolution unit */
|
|
|
|
|
GimpImageBaseType base_type; /* base gimp_image type */
|
2012-04-22 08:07:35 -07:00
|
|
|
GimpPrecision precision; /* image's precision */
|
2017-08-21 11:04:25 -07:00
|
|
|
GimpLayerMode new_layer_mode; /* default mode of new layers */
|
2010-02-03 11:31:25 -08:00
|
|
|
|
|
|
|
|
guchar *colormap; /* colormap (for indexed) */
|
|
|
|
|
gint n_colors; /* # of colors (for indexed) */
|
2010-10-27 06:40:43 -07:00
|
|
|
GimpPalette *palette; /* palette of colormap */
|
2012-03-18 09:48:42 -07:00
|
|
|
const Babl *babl_palette_rgb; /* palette's RGB Babl format */
|
|
|
|
|
const Babl *babl_palette_rgba; /* palette's RGBA Babl format */
|
2015-09-20 12:17:54 -07:00
|
|
|
|
2016-05-08 09:02:57 -07:00
|
|
|
gboolean is_color_managed; /* is this image color managed */
|
2015-08-16 10:38:11 -07:00
|
|
|
GimpColorProfile *color_profile; /* image's color profile */
|
2016-04-15 08:49:36 -07:00
|
|
|
|
|
|
|
|
/* Cached color transforms: from layer to sRGB u8 and double, and back */
|
2016-07-24 15:04:12 -07:00
|
|
|
gboolean color_transforms_created;
|
2016-05-25 12:35:54 -07:00
|
|
|
GimpColorTransform *transform_to_srgb_u8;
|
|
|
|
|
GimpColorTransform *transform_from_srgb_u8;
|
|
|
|
|
GimpColorTransform *transform_to_srgb_double;
|
|
|
|
|
GimpColorTransform *transform_from_srgb_double;
|
2010-02-03 11:31:25 -08:00
|
|
|
|
2013-10-19 09:38:01 -07:00
|
|
|
GimpMetadata *metadata; /* image's metadata */
|
|
|
|
|
|
2014-07-07 15:03:08 -07:00
|
|
|
GFile *file; /* the image's XCF file */
|
|
|
|
|
GFile *imported_file; /* the image's source file */
|
|
|
|
|
GFile *exported_file; /* the image's export file */
|
|
|
|
|
GFile *save_a_copy_file; /* the image's save-a-copy file */
|
2014-07-07 15:15:41 -07:00
|
|
|
GFile *untitled_file; /* a file saying "Untitled" */
|
2014-07-06 15:46:25 -07:00
|
|
|
|
2017-03-23 10:03:27 -07:00
|
|
|
gboolean xcf_compression; /* XCF compression enabled? */
|
2014-10-03 17:26:36 -07:00
|
|
|
|
2010-02-03 11:31:25 -08:00
|
|
|
gint dirty; /* dirty flag -- # of ops */
|
2014-08-25 01:04:17 -07:00
|
|
|
gint64 dirty_time; /* time when image became dirty */
|
2010-02-03 11:31:25 -08:00
|
|
|
gint export_dirty; /* 'dirty' but for export */
|
|
|
|
|
|
|
|
|
|
gint undo_freeze_count; /* counts the _freeze's */
|
2010-02-03 12:20:29 -08:00
|
|
|
|
|
|
|
|
gint instance_count; /* number of instances */
|
|
|
|
|
gint disp_count; /* number of displays */
|
2010-02-03 12:31:27 -08:00
|
|
|
|
|
|
|
|
GimpTattoo tattoo_state; /* the last used tattoo */
|
2010-02-03 12:46:09 -08:00
|
|
|
|
|
|
|
|
GimpProjection *projection; /* projection layers & channels */
|
|
|
|
|
GeglNode *graph; /* GEGL projection graph */
|
2012-10-06 14:58:46 -07:00
|
|
|
GeglNode *visible_mask; /* component visibility node */
|
2010-02-03 13:16:02 -08:00
|
|
|
|
2016-01-27 10:13:17 -08:00
|
|
|
GList *symmetries; /* Painting symmetries */
|
2016-02-03 12:25:17 -08:00
|
|
|
GimpSymmetry *active_symmetry; /* Active symmetry */
|
2016-01-27 10:13:17 -08:00
|
|
|
|
2010-02-03 13:16:02 -08:00
|
|
|
GList *guides; /* guides */
|
|
|
|
|
GimpGrid *grid; /* grid */
|
|
|
|
|
GList *sample_points; /* color sample points */
|
2010-02-03 14:00:31 -08:00
|
|
|
|
|
|
|
|
/* Layer/Channel attributes */
|
2010-02-06 04:41:16 -08:00
|
|
|
GimpItemTree *layers; /* the tree of layers */
|
|
|
|
|
GimpItemTree *channels; /* the tree of masks */
|
|
|
|
|
GimpItemTree *vectors; /* the tree of vectors */
|
2010-02-03 14:00:31 -08:00
|
|
|
GSList *layer_stack; /* the layers in MRU order */
|
2010-02-03 14:05:49 -08:00
|
|
|
|
|
|
|
|
GQuark layer_alpha_handler;
|
|
|
|
|
GQuark channel_name_changed_handler;
|
|
|
|
|
GQuark channel_color_changed_handler;
|
2010-02-03 14:12:22 -08:00
|
|
|
|
2010-02-03 14:24:18 -08:00
|
|
|
GimpLayer *floating_sel; /* the FS layer */
|
|
|
|
|
GimpChannel *selection_mask; /* the selection mask channel */
|
2010-02-03 14:42:32 -08:00
|
|
|
|
|
|
|
|
GimpParasiteList *parasites; /* Plug-in parasite data */
|
2010-02-04 00:08:50 -08:00
|
|
|
|
|
|
|
|
gboolean visible[MAX_CHANNELS]; /* visible channels */
|
|
|
|
|
gboolean active[MAX_CHANNELS]; /* active channels */
|
2010-02-04 00:49:45 -08:00
|
|
|
|
|
|
|
|
gboolean quick_mask_state; /* TRUE if quick mask is on */
|
|
|
|
|
gboolean quick_mask_inverted; /* TRUE if quick mask is inverted */
|
|
|
|
|
GimpRGB quick_mask_color; /* rgba triplet of the color */
|
2010-02-04 11:06:49 -08:00
|
|
|
|
|
|
|
|
/* Undo apparatus */
|
|
|
|
|
GimpUndoStack *undo_stack; /* stack for undo operations */
|
|
|
|
|
GimpUndoStack *redo_stack; /* stack for redo operations */
|
|
|
|
|
gint group_count; /* nested undo groups */
|
|
|
|
|
GimpUndoType pushing_undo_group; /* undo group status flag */
|
2010-02-04 12:09:19 -08:00
|
|
|
|
2013-01-27 07:52:38 -08:00
|
|
|
/* Signal emission accumulator */
|
2010-02-05 00:13:25 -08:00
|
|
|
GimpImageFlushAccumulator flush_accum;
|
2010-02-03 11:31:25 -08:00
|
|
|
};
|
|
|
|
|
|
app, libgimp*, modules: don't use g_type_class_add_private() ...
... and G_TYPE_INSTANCE_GET_PRIVATE()
g_type_class_add_private() and G_TYPE_INSTANCE_GET_PRIVATE() were
deprecated in GLib 2.58. Instead, use
G_DEFINE_[ABSTRACT_]TYPE_WITH_PRIVATE(), and
G_ADD_PRIVATE[_DYNAMIC](), and the implictly-defined
foo_get_instance_private() functions, all of which are available in
the GLib versions we depend on.
This commit only covers types registered using one of the
G_DEFINE_FOO() macros (i.e., most types), but not types with a
custom registration function, of which we still have a few -- GLib
currently only provides a (non-deprecated) public API for adding a
private struct using the G_DEFINE_FOO() macros.
Note that this commit was 99% auto-generated (because I'm not
*that* crazy :), so if there are any style mismatches... we'll have
to live with them for now.
2018-09-18 09:09:39 -07:00
|
|
|
#define GIMP_IMAGE_GET_PRIVATE(image) (((GimpImage *) (image))->priv)
|
2010-02-03 11:31:25 -08:00
|
|
|
|
2012-05-13 16:44:41 -07:00
|
|
|
void gimp_image_take_mask (GimpImage *image,
|
|
|
|
|
GimpChannel *mask);
|
|
|
|
|
|
2010-02-03 11:31:25 -08:00
|
|
|
|
|
|
|
|
#endif /* __GIMP_IMAGE_PRIVATE_H__ */
|