home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2002 April / pcpro0402.iso / essentials / graphics / Gimp / gimp-src-20001226.exe / src / gimp / app / gimpimageP.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-12-20  |  5.3 KB  |  125 lines

  1. /* The GIMP -- an 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 2 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, write to the Free Software
  16.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17.  */
  18.  
  19. #ifndef __GIMPIMAGEP_H__
  20. #define __GIMPIMAGEP_H__
  21.  
  22.  
  23. #include <gtk/gtk.h>  /*  eeeek  */
  24.  
  25. #include "gimpobject.h"
  26. #include "gimpimage.h"
  27.  
  28. #include "tile_manager.h"
  29. #include "temp_buf.h"
  30. #include "channel.h"
  31. #include "layer.h"
  32. #include "path.h"
  33. #include "undo_types.h"
  34.  
  35.  
  36. #define MAX_CHANNELS     4
  37.  
  38. struct _GimpImage
  39. {
  40.   GimpObject     gobject;
  41.  
  42.   gchar         *filename;          /*  original filename            */
  43.   gboolean       has_filename;        /*  has a valid filename         */
  44.   PlugInProcDef *save_proc;           /*  last PDB save proc used      */
  45.  
  46.   gint               width, height;   /*  width and height attributes  */
  47.   gdouble            xresolution;     /*  image x-res, in dpi          */
  48.   gdouble            yresolution;     /*  image y-res, in dpi          */
  49.   GimpUnit           unit;            /*  image unit                   */
  50.   GimpImageBaseType  base_type;       /*  base gimp_image type         */
  51.  
  52.   guchar  *cmap;                      /*  colormap--for indexed        */
  53.   gint     num_cols;                  /*  number of cols--for indexed  */
  54.  
  55.   gint      dirty;                    /*  dirty flag -- # of ops       */
  56.   gboolean  undo_on;                  /*  Is undo enabled?             */
  57.  
  58.   gint instance_count;                /*  number of instances          */
  59.   gint disp_count;                    /*  number of displays           */
  60.  
  61.   Tattoo tattoo_state;                /*  the next unique tattoo to use*/
  62.  
  63.   TileManager *shadow;                /*  shadow buffer tiles          */
  64.  
  65.                                       /*  Projection attributes  */
  66.   gint           construct_flag;      /*  flag for construction        */
  67.   GimpImageType  proj_type;           /*  type of the projection image */
  68.   gint           proj_bytes;          /*  bpp in projection image      */
  69.   gint           proj_level;          /*  projection level             */
  70.   TileManager   *projection;          /*  The projection--layers &     */
  71.                                       /*  channels                     */
  72.  
  73.   GList *guides;                      /*  guides                       */
  74.  
  75.                                       /*  Layer/Channel attributes  */
  76.   GSList *layers;                     /*  the list of layers           */
  77.   GSList *channels;                   /*  the list of masks            */
  78.   GSList *layer_stack;                /*  the layers in MRU order      */
  79.  
  80.   Layer   *active_layer;              /*  ID of active layer           */
  81.   Channel *active_channel;          /*  ID of active channel         */
  82.   Layer   *floating_sel;              /*  ID of fs layer               */
  83.   Channel *selection_mask;            /*  selection mask channel       */
  84.  
  85.   ParasiteList *parasites;            /*  Plug-in parasite data        */
  86.  
  87.   PathList *paths;                    /*  Paths data for this image    */
  88.  
  89.   gint visible [MAX_CHANNELS];        /*  visible channels             */
  90.   gint active  [MAX_CHANNELS];        /*  active channels              */
  91.  
  92.   gboolean  by_color_select;           /*  TRUE if there's an active    */
  93.                                       /*  "by color" selection dialog  */
  94.  
  95.   gboolean  qmask_state;              /*  TRUE if qmask is on          */
  96.   gdouble   qmask_opacity;            /*  opacity of the qmask channel */
  97.   guchar    qmask_color[3];           /*  rgb triplet of the color     */
  98.  
  99.                                       /*  Undo apparatus  */
  100.   GSList *undo_stack;                 /*  stack for undo operations    */
  101.   GSList *redo_stack;                 /*  stack for redo operations    */
  102.   gint    undo_bytes;                 /*  bytes in undo stack          */
  103.   gint    undo_levels;                /*  levels in undo stack         */
  104.   gint    group_count;              /*  nested undo groups           */
  105.   UndoType pushing_undo_group;        /*  undo group status flag       */
  106.   GtkWidget *undo_history;          /*  history viewer, or NULL      */
  107.  
  108.                                       /*  Composite preview  */
  109.   TempBuf *comp_preview;              /*  the composite preview        */
  110.   gboolean comp_preview_valid[3];     /*  preview valid-1/channel      */
  111. };
  112.  
  113. struct _GimpImageClass
  114. {
  115.   GimpObjectClass parent_class;
  116.   void (*dirty)   (GtkObject*);
  117.   void (*repaint) (GtkObject*);
  118.   void (*rename)  (GtkObject*);
  119. };
  120. typedef struct _GimpImageClass GimpImageClass;
  121.  
  122. #define GIMP_IMAGE_CLASS(klass)  GTK_CHECK_CLASS_CAST (klass, GIMP_TYPE_IMAGE, GimpImageClass)
  123.  
  124. #endif /* __GIMPIMAGEP_H__ */
  125.