mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-20 19:43:01 +00:00
0a7dca9110
Mon Aug 23 10:15:32 EDT 1999 Austin Donnelly <austin@gimp.org> Dirty flag now correct in all cases. Can be displayed in image window title too. See NOTE near gimp_image_dirty() for details. * app/fileops.c: gimp_image_clean_all() after reverting an image. * app/gdisplay.c: register handlers for gimage dirty and clean signals to update image title. New image-title-format expansion: %Dx expands to x if the image is dirty. * app/gdisplay_ops.c: gimage->dirty flags != 0 is the correct condition to test to see if an image is dirty. * app/gimpdrawable.c: gimp_image_dirty() should never be called except from an undo_push_* function. Call undo_push_cantundo() if you want to dirty the image but can't be bothered writing an undo handler (be ashamed of yourself!). * app/gimpimage.c: new gimage signal: clean. Emitted when an undo operation takes place. Gimage changes when either dirty or clean is emitted, so if you need to update previews etc, look for both! Move group_count into gimage structure, since leaving it as a static in undo.c is bad if two undo groups are started on different images at the same time. More changes of gimp_image_dirty() to undo_push_cantundo() (parasite-related, plus layer moves). See the NOTE on dirty counter near gimp_image_dirty() for the full story. gimp_image_dirty() and gimp_image_clean() simplified - counter can go negative. * app/gimpimageP.h: group_count moved from undo.c * app/layers_dialog.c: push undo for layer name change, rather than dirtying the image. * app/undo.c: layer rename undo functions added. undo_push_cantundo() convenience functions added. group_count made per-gimage since everything else is. When blowing away redo stack, make image infinitely dirty if redo info contained file save point. * app/undo.h: added undo_push_layer_rename() and undo_push_cantundo(). * TODO: added idea for undo history window.
98 lines
4 KiB
C
98 lines
4 KiB
C
/* 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 __UNDO_H__
|
|
#define __UNDO_H__
|
|
|
|
#include "gimage.h"
|
|
|
|
/* Undo types */
|
|
#define IMAGE_UNDO 1
|
|
#define IMAGE_MOD_UNDO 2
|
|
#define MASK_UNDO 3
|
|
#define LAYER_DISPLACE_UNDO 4
|
|
#define TRANSFORM_UNDO 5
|
|
#define PAINT_UNDO 6
|
|
#define LAYER_UNDO 7
|
|
#define LAYER_MOD 8
|
|
#define LAYER_MASK_UNDO 9
|
|
#define LAYER_CHANGE 10
|
|
#define LAYER_POSITION 11
|
|
#define CHANNEL_UNDO 12
|
|
#define CHANNEL_MOD 13
|
|
#define FS_TO_LAYER_UNDO 14
|
|
#define GIMAGE_MOD 15
|
|
#define FS_RIGOR 16
|
|
#define FS_RELAX 17
|
|
#define GUIDE_UNDO 18
|
|
|
|
/* Aggregate undo types */
|
|
#define FLOAT_MASK_UNDO 20
|
|
#define EDIT_PASTE_UNDO 21
|
|
#define EDIT_CUT_UNDO 22
|
|
#define TRANSFORM_CORE_UNDO 23
|
|
#define PAINT_CORE_UNDO 24
|
|
#define FLOATING_LAYER_UNDO 25
|
|
#define LINKED_LAYER_UNDO 26
|
|
#define LAYER_APPLY_MASK_UNDO 27
|
|
#define LAYER_MERGE_UNDO 28
|
|
#define FS_ANCHOR_UNDO 29
|
|
#define GIMAGE_MOD_UNDO 30
|
|
#define CROP_UNDO 31
|
|
#define LAYER_SCALE_UNDO 32
|
|
#define LAYER_RESIZE_UNDO 33
|
|
#define QMASK_UNDO 34
|
|
#define MISC_UNDO 100
|
|
|
|
/* Undo interface functions */
|
|
|
|
int undo_push_group_start (GImage *, int);
|
|
int undo_push_group_end (GImage *);
|
|
int undo_push_image (GImage *, GimpDrawable *, int, int, int, int);
|
|
int undo_push_image_mod (GImage *, GimpDrawable *, int, int, int, int, void *, int);
|
|
int undo_push_mask (GImage *, void *);
|
|
int undo_push_layer_displace (GImage *, GimpLayer*);
|
|
int undo_push_transform (GImage *, void *);
|
|
int undo_push_paint (GImage *, void *);
|
|
int undo_push_layer (GImage *, void *);
|
|
int undo_push_layer_mod (GImage *, void *);
|
|
int undo_push_layer_mask (GImage *, void *);
|
|
int undo_push_layer_change (GImage *, int);
|
|
int undo_push_layer_position (GImage *, int);
|
|
int undo_push_channel (GImage *, void *);
|
|
int undo_push_channel_mod (GImage *, void *);
|
|
int undo_push_fs_to_layer (GImage *, void *);
|
|
int undo_push_fs_rigor (GImage *, int);
|
|
int undo_push_fs_relax (GImage *, int);
|
|
int undo_push_gimage_mod (GImage *);
|
|
int undo_push_guide (GImage *, void *);
|
|
int undo_push_image_parasite (GImage *, void *);
|
|
int undo_push_drawable_parasite (GImage *, GimpDrawable *, void *);
|
|
int undo_push_image_parasite_remove (GImage *, const char *);
|
|
int undo_push_drawable_parasite_remove (GImage *, GimpDrawable *,
|
|
const char *);
|
|
int undo_push_qmask (GImage *, int);
|
|
int undo_push_layer_rename (GImage *, Layer *);
|
|
int undo_push_cantundo (GImage *, const char *);
|
|
|
|
int undo_pop (GImage *);
|
|
int undo_redo (GImage *);
|
|
void undo_free (GImage *);
|
|
|
|
|
|
#endif /* __UNDO_H__ */
|