home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2002 April / pcpro0402.iso / essentials / graphics / Gimp / gimp-src-20001226.exe / src / gimp / app / undo.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-07-01  |  5.5 KB  |  135 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. #ifndef __UNDO_H__
  19. #define __UNDO_H__
  20.  
  21. #include "gimage.h"
  22. #include "undo_types.h"
  23.  
  24.  
  25. /*  Undo interface functions  */
  26.  
  27. gboolean      undo_push_group_start       (GImage       *gimage, 
  28.                        UndoType      type);
  29. gboolean      undo_push_group_end         (GImage       *gimage);
  30. gboolean      undo_push_image             (GImage       *gimage, 
  31.                        GimpDrawable *drawable, 
  32.                        gint          x1, 
  33.                        gint          y1, 
  34.                        gint          x2, 
  35.                        gint          y2);
  36. gboolean      undo_push_image_mod         (GImage       *gimage, 
  37.                        GimpDrawable *drawable, 
  38.                        gint          x1, 
  39.                        gint          y1, 
  40.                        gint          x2, 
  41.                        gint          y2, 
  42.                        gpointer      tiles_ptr, 
  43.                        gboolean      sparse);
  44. gboolean      undo_push_mask              (GImage       *gimage, 
  45.                        gpointer      mask_ptr);
  46. gboolean      undo_push_layer_displace    (GImage       *gimage,
  47.                        GimpLayer    *layer);
  48. gboolean      undo_push_transform         (GImage       *gimage, 
  49.                        gpointer      tu_ptr);
  50. gboolean      undo_push_paint             (GImage       *gimage, 
  51.                        gpointer      pu_ptr);
  52. gboolean      undo_push_layer             (GImage       *gimage, 
  53.                        UndoType      type, 
  54.                        gpointer      lu_ptr);
  55. gboolean      undo_push_layer_mod         (GImage       *gimage, 
  56.                        gpointer      layer_ptr);
  57. gboolean      undo_push_layer_mask        (GImage       *gimage, 
  58.                        UndoType      type, 
  59.                        gpointer      lmu_prt);
  60. gboolean      undo_push_layer_change      (GImage       *gimage, 
  61.                        GimpLayer    *layer);
  62. gboolean      undo_push_layer_reposition  (GImage       *gimage, 
  63.                        GimpLayer    *layer);
  64. gboolean      undo_push_channel           (GImage       *gimage, 
  65.                        UndoType      type, 
  66.                        gpointer      cu_ptr);
  67. gboolean      undo_push_channel_mod       (GImage       *gimage, 
  68.                        gpointer      cmu_ptr);
  69. gboolean      undo_push_fs_to_layer       (GImage       *gimage,
  70.                        gpointer      fsu_ptr);
  71. gboolean      undo_push_fs_rigor          (GImage       *gimage, 
  72.                        gint32        layer_ID);
  73. gboolean      undo_push_fs_relax          (GImage       *gimage, 
  74.                        gint32        layer_ID);
  75. gboolean      undo_push_gimage_mod        (GImage       *gimage);
  76. gboolean      undo_push_guide             (GImage       *gimage, 
  77.                        gpointer      guide);
  78. gboolean      undo_push_image_parasite    (GImage       *gimage,
  79.                        gpointer      parasite);
  80. gboolean      undo_push_drawable_parasite (GImage       *gimage, 
  81.                        GimpDrawable *drawable, 
  82.                        gpointer      parasite);
  83. gboolean      undo_push_image_parasite_remove    
  84.                                           (GImage       *gimage, 
  85.                        const gchar  *name);
  86. gboolean      undo_push_drawable_parasite_remove    
  87.                                           (GImage       *gimage, 
  88.                        GimpDrawable *drabable,
  89.                        const gchar  *name);
  90. gboolean      undo_push_qmask             (GImage       *gimage);
  91. gboolean      undo_push_resolution        (GImage       *gimage);
  92. gboolean      undo_push_layer_rename      (GImage       *gimage, 
  93.                        GimpLayer    *layer);
  94. gboolean      undo_push_cantundo          (GImage       *gimage, 
  95.                        const gchar  *action);
  96.  
  97. gboolean      undo_pop                    (GImage       *gimage);
  98. gboolean      undo_redo                   (GImage       *gimage);
  99. void          undo_free                   (GImage       *gimage);
  100.  
  101. const gchar  *undo_get_undo_name          (GImage       *gimage);
  102. const gchar  *undo_get_redo_name          (GImage       *gimage);
  103.  
  104.  
  105. /* Stack peeking functions */
  106. typedef gint (*undo_map_fn)     (const gchar *undoitemname, 
  107.                  gpointer     data);
  108.  
  109. void undo_map_over_undo_stack   (GImage      *gimage, 
  110.                  undo_map_fn  fn, 
  111.                  gpointer     data);
  112. void undo_map_over_redo_stack   (GImage      *gimage, 
  113.                  undo_map_fn  fn, 
  114.                  gpointer     data);
  115. UndoType undo_get_undo_top_type (GImage      *gimage);
  116.  
  117.  
  118. /* Not really appropriate here, since undo_history_new is not defined
  119.  * in undo.c, but it saves on having a full header file for just one
  120.  * function prototype. */
  121. GtkWidget *undo_history_new     (GImage      *gimage);
  122.  
  123.  
  124. /* Argument to undo_event signal emitted by gimages: */
  125. typedef enum 
  126. {
  127.   UNDO_PUSHED,    /* a new undo has been added to the undo stack       */
  128.   UNDO_EXPIRED,    /* an undo has been freed from the undo stack        */
  129.   UNDO_POPPED,    /* an undo has been executed and moved to redo stack */
  130.   UNDO_REDO,    /* a redo has been executed and moved to undo stack  */
  131.   UNDO_FREE     /* all undo and redo info has been cleared           */
  132. } undo_event_t;
  133.  
  134. #endif  /* __UNDO_H__ */
  135.