From 9b32ebdad64430cd5fcd4b6449ef925e47e3b00d Mon Sep 17 00:00:00 2001 From: David Capello Date: Sun, 13 Mar 2011 17:33:42 -0300 Subject: [PATCH] Rename Undo class to UndoHistory. --- src/CMakeLists.txt | 2 +- src/commands/cmd_cel_properties.cpp | 2 +- src/commands/cmd_clear.cpp | 2 +- src/commands/cmd_duplicate_layer.cpp | 2 +- src/commands/cmd_flip.cpp | 2 +- src/commands/cmd_invert_mask.cpp | 2 +- src/commands/cmd_load_mask.cpp | 2 +- src/commands/cmd_mask_all.cpp | 2 +- src/commands/cmd_merge_down_layer.cpp | 2 +- src/commands/cmd_new_file.cpp | 1 - src/commands/cmd_palette_editor.cpp | 2 +- src/commands/cmd_paste.cpp | 1 - src/commands/cmd_redo.cpp | 2 +- src/commands/cmd_remove_layer.cpp | 1 - src/commands/cmd_reselect_mask.cpp | 2 +- src/commands/cmd_undo.cpp | 2 +- src/commands/filters/filter_manager_impl.cpp | 2 +- src/dialogs/maskcol.cpp | 2 +- src/dialogs/vectmap.cpp | 2 +- src/raster/layer.cpp | 2 +- src/raster/raster.h | 2 +- src/raster/sprite.cpp | 8 +- src/raster/sprite.h | 4 +- src/raster/{undo.cpp => undo_history.cpp} | 90 ++++++++++---------- src/raster/{undo.h => undo_history.h} | 6 +- src/raster/undo_stream.h | 6 +- src/tools/inks.h | 2 +- src/undoable.cpp | 2 +- src/util/celmove.cpp | 2 +- src/util/clipboard.cpp | 2 +- src/util/misc.h | 5 +- src/widgets/statebar.cpp | 2 +- 32 files changed, 81 insertions(+), 87 deletions(-) rename src/raster/{undo.cpp => undo_history.cpp} (96%) rename src/raster/{undo.h => undo_history.h} (97%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 73390a176..fdada3209 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -212,7 +212,7 @@ add_library(aseprite-library raster/rotate.cpp raster/sprite.cpp raster/stock.cpp - raster/undo.cpp + raster/undo_history.cpp settings/ui_settings_impl.cpp skin/button_icon_impl.cpp skin/skin_theme.cpp diff --git a/src/commands/cmd_cel_properties.cpp b/src/commands/cmd_cel_properties.cpp index 9fe1671d2..86f16e6b7 100644 --- a/src/commands/cmd_cel_properties.cpp +++ b/src/commands/cmd_cel_properties.cpp @@ -31,7 +31,7 @@ #include "raster/layer.h" #include "raster/sprite.h" #include "raster/stock.h" -#include "raster/undo.h" +#include "raster/undo_history.h" #include "sprite_wrappers.h" class CelPropertiesCommand : public Command diff --git a/src/commands/cmd_clear.cpp b/src/commands/cmd_clear.cpp index eea2ba5a8..507c75467 100644 --- a/src/commands/cmd_clear.cpp +++ b/src/commands/cmd_clear.cpp @@ -24,7 +24,7 @@ #include "raster/layer.h" #include "raster/mask.h" #include "raster/sprite.h" -#include "raster/undo.h" +#include "raster/undo_history.h" #include "sprite_wrappers.h" #include "undoable.h" #include "widgets/color_bar.h" diff --git a/src/commands/cmd_duplicate_layer.cpp b/src/commands/cmd_duplicate_layer.cpp index 0adb58240..92034a753 100644 --- a/src/commands/cmd_duplicate_layer.cpp +++ b/src/commands/cmd_duplicate_layer.cpp @@ -26,7 +26,7 @@ #include "modules/gui.h" #include "raster/layer.h" #include "raster/sprite.h" -#include "raster/undo.h" +#include "raster/undo_history.h" #include "sprite_wrappers.h" static Layer *duplicate_layer(Sprite* sprite); diff --git a/src/commands/cmd_flip.cpp b/src/commands/cmd_flip.cpp index 3530d9d97..2dd42e36c 100644 --- a/src/commands/cmd_flip.cpp +++ b/src/commands/cmd_flip.cpp @@ -30,7 +30,7 @@ #include "raster/mask.h" #include "raster/sprite.h" #include "raster/stock.h" -#include "raster/undo.h" +#include "raster/undo_history.h" #include "sprite_wrappers.h" #include "undoable.h" #include "util/misc.h" diff --git a/src/commands/cmd_invert_mask.cpp b/src/commands/cmd_invert_mask.cpp index 16d5ca1fd..410367b4f 100644 --- a/src/commands/cmd_invert_mask.cpp +++ b/src/commands/cmd_invert_mask.cpp @@ -24,7 +24,7 @@ #include "raster/image.h" #include "raster/mask.h" #include "raster/sprite.h" -#include "raster/undo.h" +#include "raster/undo_history.h" #include "sprite_wrappers.h" ////////////////////////////////////////////////////////////////////// diff --git a/src/commands/cmd_load_mask.cpp b/src/commands/cmd_load_mask.cpp index 97fee326d..2d2222354 100644 --- a/src/commands/cmd_load_mask.cpp +++ b/src/commands/cmd_load_mask.cpp @@ -25,7 +25,7 @@ #include "modules/gui.h" #include "raster/mask.h" #include "raster/sprite.h" -#include "raster/undo.h" +#include "raster/undo_history.h" #include "sprite_wrappers.h" #include "util/msk_file.h" diff --git a/src/commands/cmd_mask_all.cpp b/src/commands/cmd_mask_all.cpp index 4ebadaf2a..cca2d8bfb 100644 --- a/src/commands/cmd_mask_all.cpp +++ b/src/commands/cmd_mask_all.cpp @@ -22,7 +22,7 @@ #include "modules/gui.h" #include "raster/mask.h" #include "raster/sprite.h" -#include "raster/undo.h" +#include "raster/undo_history.h" #include "sprite_wrappers.h" ////////////////////////////////////////////////////////////////////// diff --git a/src/commands/cmd_merge_down_layer.cpp b/src/commands/cmd_merge_down_layer.cpp index 24f98c54b..07934ebc7 100644 --- a/src/commands/cmd_merge_down_layer.cpp +++ b/src/commands/cmd_merge_down_layer.cpp @@ -28,7 +28,7 @@ #include "raster/layer.h" #include "raster/sprite.h" #include "raster/stock.h" -#include "raster/undo.h" +#include "raster/undo_history.h" #include "sprite_wrappers.h" ////////////////////////////////////////////////////////////////////// diff --git a/src/commands/cmd_new_file.cpp b/src/commands/cmd_new_file.cpp index f224fedeb..cccd5c3f7 100644 --- a/src/commands/cmd_new_file.cpp +++ b/src/commands/cmd_new_file.cpp @@ -36,7 +36,6 @@ #include "raster/layer.h" #include "raster/palette.h" #include "raster/sprite.h" -#include "raster/undo.h" #include "util/misc.h" #include "widgets/color_bar.h" #include "app/color_utils.h" diff --git a/src/commands/cmd_palette_editor.cpp b/src/commands/cmd_palette_editor.cpp index bd19273c9..5693bb837 100644 --- a/src/commands/cmd_palette_editor.cpp +++ b/src/commands/cmd_palette_editor.cpp @@ -45,7 +45,7 @@ #include "raster/quantization.h" #include "raster/sprite.h" #include "raster/stock.h" -#include "raster/undo.h" +#include "raster/undo_history.h" #include "skin/skin_slider_property.h" #include "sprite_wrappers.h" #include "ui_context.h" diff --git a/src/commands/cmd_paste.cpp b/src/commands/cmd_paste.cpp index 799125cac..ae6f44ffb 100644 --- a/src/commands/cmd_paste.cpp +++ b/src/commands/cmd_paste.cpp @@ -21,7 +21,6 @@ #include "commands/command.h" #include "raster/layer.h" #include "raster/sprite.h" -#include "raster/undo.h" #include "util/clipboard.h" #include "sprite_wrappers.h" diff --git a/src/commands/cmd_redo.cpp b/src/commands/cmd_redo.cpp index 142d70b75..001aede68 100644 --- a/src/commands/cmd_redo.cpp +++ b/src/commands/cmd_redo.cpp @@ -22,7 +22,7 @@ #include "app.h" #include "modules/gui.h" #include "raster/sprite.h" -#include "raster/undo.h" +#include "raster/undo_history.h" #include "widgets/statebar.h" #include "sprite_wrappers.h" diff --git a/src/commands/cmd_remove_layer.cpp b/src/commands/cmd_remove_layer.cpp index 078c227f7..9a642b08f 100644 --- a/src/commands/cmd_remove_layer.cpp +++ b/src/commands/cmd_remove_layer.cpp @@ -25,7 +25,6 @@ #include "modules/gui.h" #include "raster/layer.h" #include "raster/sprite.h" -#include "raster/undo.h" #include "undoable.h" #include "sprite_wrappers.h" #include "widgets/statebar.h" diff --git a/src/commands/cmd_reselect_mask.cpp b/src/commands/cmd_reselect_mask.cpp index 70c7ac5b7..f66df1572 100644 --- a/src/commands/cmd_reselect_mask.cpp +++ b/src/commands/cmd_reselect_mask.cpp @@ -22,7 +22,7 @@ #include "modules/gui.h" #include "raster/mask.h" #include "raster/sprite.h" -#include "raster/undo.h" +#include "raster/undo_history.h" #include "sprite_wrappers.h" ////////////////////////////////////////////////////////////////////// diff --git a/src/commands/cmd_undo.cpp b/src/commands/cmd_undo.cpp index b1f72a024..05b01c1ed 100644 --- a/src/commands/cmd_undo.cpp +++ b/src/commands/cmd_undo.cpp @@ -22,7 +22,7 @@ #include "app.h" #include "modules/gui.h" #include "raster/sprite.h" -#include "raster/undo.h" +#include "raster/undo_history.h" #include "widgets/statebar.h" #include "sprite_wrappers.h" diff --git a/src/commands/filters/filter_manager_impl.cpp b/src/commands/filters/filter_manager_impl.cpp index ce44038ec..5a088e43c 100644 --- a/src/commands/filters/filter_manager_impl.cpp +++ b/src/commands/filters/filter_manager_impl.cpp @@ -35,7 +35,7 @@ #include "raster/mask.h" #include "raster/sprite.h" #include "raster/stock.h" -#include "raster/undo.h" +#include "raster/undo_history.h" #include "widgets/editor.h" #include diff --git a/src/dialogs/maskcol.cpp b/src/dialogs/maskcol.cpp index 453416d3e..61c0ecdf5 100644 --- a/src/dialogs/maskcol.cpp +++ b/src/dialogs/maskcol.cpp @@ -35,7 +35,7 @@ #include "raster/image.h" #include "raster/mask.h" #include "raster/sprite.h" -#include "raster/undo.h" +#include "raster/undo_history.h" #include "util/misc.h" #include "widgets/color_bar.h" #include "widgets/color_button.h" diff --git a/src/dialogs/vectmap.cpp b/src/dialogs/vectmap.cpp index c1722bb03..eb722ed5c 100644 --- a/src/dialogs/vectmap.cpp +++ b/src/dialogs/vectmap.cpp @@ -25,7 +25,7 @@ #include "modules/gui.h" #include "raster/image.h" #include "raster/sprite.h" -#include "raster/undo.h" +#include "raster/undo_history.h" #include "util/misc.h" static void project(Image *image, int x, int y, double dmax, double *out_x, double *out_y) diff --git a/src/raster/layer.cpp b/src/raster/layer.cpp index 894d9031c..5c31a559d 100644 --- a/src/raster/layer.cpp +++ b/src/raster/layer.cpp @@ -27,7 +27,7 @@ #include "raster/layer.h" #include "raster/sprite.h" #include "raster/stock.h" -#include "raster/undo.h" +#include "raster/undo_history.h" static bool has_cels(const Layer* layer, int frame); diff --git a/src/raster/raster.h b/src/raster/raster.h index 28acc1a0f..ec431c439 100644 --- a/src/raster/raster.h +++ b/src/raster/raster.h @@ -34,6 +34,6 @@ #include "raster/rotate.h" #include "raster/sprite.h" #include "raster/stock.h" -#include "raster/undo.h" +#include "raster/undo_history.h" #endif diff --git a/src/raster/sprite.cpp b/src/raster/sprite.cpp index 9e3829af2..c2bfc170e 100644 --- a/src/raster/sprite.cpp +++ b/src/raster/sprite.cpp @@ -253,7 +253,7 @@ public: } } - Undo* getUndo() const { + UndoHistory* getUndo() const { return m_undo; } @@ -358,7 +358,7 @@ private: Layer* m_layer; // current layer Path* m_path; // working path Mask* m_mask; // selected mask region - Undo* m_undo; // undo stack + UndoHistory* m_undo; // undo stack struct { PathsList paths; // paths MasksList masks; // masks @@ -412,7 +412,7 @@ SpriteImpl::SpriteImpl(Sprite* sprite, int imgtype, int width, int height, int n m_layer = NULL; m_path = NULL; m_mask = mask_new(); - m_undo = new Undo(m_self); + m_undo = new UndoHistory(m_self); m_extraCel = NULL; m_extraImage = NULL; @@ -1281,7 +1281,7 @@ void Sprite::remapImages(int frame_from, int frame_to, const std::vector& m ////////////////////////////////////////////////////////////////////// // Undo -Undo* Sprite::getUndo() const +UndoHistory* Sprite::getUndo() const { return m_impl->getUndo(); } diff --git a/src/raster/sprite.h b/src/raster/sprite.h index dae2dad2c..09e99f64b 100644 --- a/src/raster/sprite.h +++ b/src/raster/sprite.h @@ -31,7 +31,7 @@ class Mask; class Palette; class Path; class Stock; -class Undo; +class UndoHistory; class Sprite; class RgbMap; struct _BoundSeg; @@ -155,7 +155,7 @@ public: //////////////////////////////////////// // Undo - Undo* getUndo() const; + UndoHistory* getUndo() const; //////////////////////////////////////// // Mask diff --git a/src/raster/undo.cpp b/src/raster/undo_history.cpp similarity index 96% rename from src/raster/undo.cpp rename to src/raster/undo_history.cpp index b46ba6381..44ea4c197 100644 --- a/src/raster/undo.cpp +++ b/src/raster/undo_history.cpp @@ -34,7 +34,7 @@ #include "raster/palette.h" #include "raster/sprite.h" #include "raster/stock.h" -#include "raster/undo.h" +#include "raster/undo_history.h" /* undo state */ enum { @@ -276,7 +276,7 @@ static int get_raw_mask_size(Mask* mask); ////////////////////////////////////////////////////////////////////// -Undo::Undo(Sprite* sprite) +UndoHistory::UndoHistory(Sprite* sprite) : GfxObj(GFXOBJ_UNDO) { m_sprite = sprite; @@ -295,59 +295,59 @@ Undo::Undo(Sprite* sprite) } } -Undo::~Undo() +UndoHistory::~UndoHistory() { delete m_undoStream; delete m_redoStream; } -bool Undo::isEnabled() const +bool UndoHistory::isEnabled() const { return m_enabled ? true: false; } -void Undo::setEnabled(bool state) +void UndoHistory::setEnabled(bool state) { m_enabled = state; } -bool Undo::canUndo() const +bool UndoHistory::canUndo() const { return !m_undoStream->empty(); } -bool Undo::canRedo() const +bool UndoHistory::canRedo() const { return !m_redoStream->empty(); } -void Undo::doUndo() +void UndoHistory::doUndo() { runUndo(DO_UNDO); } -void Undo::doRedo() +void UndoHistory::doRedo() { runUndo(DO_REDO); } -void Undo::clearRedo() +void UndoHistory::clearRedo() { if (!m_redoStream->empty()) m_redoStream->clear(); } -const char* Undo::getLabel() +const char* UndoHistory::getLabel() { return m_label; } -void Undo::setLabel(const char* label) +void UndoHistory::setLabel(const char* label) { m_label = label; } -const char* Undo::getNextUndoLabel() const +const char* UndoHistory::getNextUndoLabel() const { UndoChunk* chunk; @@ -357,7 +357,7 @@ const char* Undo::getNextUndoLabel() const return chunk->label; } -const char* Undo::getNextRedoLabel() const +const char* UndoHistory::getNextRedoLabel() const { UndoChunk* chunk; @@ -367,17 +367,17 @@ const char* Undo::getNextRedoLabel() const return chunk->label; } -bool Undo::isSavedState() const +bool UndoHistory::isSavedState() const { return (m_diffCount == m_diffSaved); } -void Undo::markSavedState() +void UndoHistory::markSavedState() { m_diffSaved = m_diffCount; } -void Undo::runUndo(int state) +void UndoHistory::runUndo(int state) { UndoStream* undo_stream = ((state == DO_UNDO)? m_undoStream: m_redoStream); @@ -408,7 +408,7 @@ void Undo::runUndo(int state) } while (level); } -void Undo::discardTail() +void UndoHistory::discardTail() { UndoStream* undo_stream = m_undoStream; UndoChunk* chunk; @@ -479,7 +479,7 @@ static bool out_of_group(UndoStream* undo_stream) } // Called every time a new undo is added. -void Undo::updateUndo() +void UndoHistory::updateUndo() { // TODO replace this with the following implementation: // * Add the undo limit to Undo class as a normal member (non-static). @@ -586,7 +586,7 @@ void Undo::updateUndo() ***********************************************************************/ -void Undo::undo_open() +void UndoHistory::undo_open() { chunk_open_new(m_undoStream); updateUndo(); @@ -612,7 +612,7 @@ static void chunk_open_invert(UndoStream* stream, UndoChunk* chunk) ***********************************************************************/ -void Undo::undo_close() +void UndoHistory::undo_close() { chunk_close_new(m_undoStream); updateUndo(); @@ -650,7 +650,7 @@ struct UndoChunkData ase_uint8 data[0]; }; -void Undo::undo_data(GfxObj *gfxobj, void *data, int size) +void UndoHistory::undo_data(GfxObj *gfxobj, void *data, int size) { chunk_data_new(m_undoStream, gfxobj, data, size); updateUndo(); @@ -718,7 +718,7 @@ struct UndoChunkImage ase_uint8 data[0]; }; -void Undo::undo_image(Image* image, int x, int y, int w, int h) +void UndoHistory::undo_image(Image* image, int x, int y, int w, int h) { chunk_image_new(m_undoStream, image, x, y, w, h); updateUndo(); @@ -805,7 +805,7 @@ struct UndoChunkFlip ase_uint8 horz; }; -void Undo::undo_flip(Image* image, int x1, int y1, int x2, int y2, bool horz) +void UndoHistory::undo_flip(Image* image, int x1, int y1, int x2, int y2, bool horz) { chunk_flip_new(m_undoStream, image, x1, y1, x2, y2, horz); updateUndo(); @@ -872,7 +872,7 @@ struct UndoChunkDirty ase_uint8 data[0]; }; -void Undo::undo_dirty(Image* image, Dirty* dirty) +void UndoHistory::undo_dirty(Image* image, Dirty* dirty) { chunk_dirty_new(m_undoStream, image, dirty); updateUndo(); @@ -921,7 +921,7 @@ struct UndoChunkAddImage ase_uint32 image_index; }; -void Undo::undo_add_image(Stock *stock, int image_index) +void UndoHistory::undo_add_image(Stock *stock, int image_index) { chunk_add_image_new(m_undoStream, stock, image_index); updateUndo(); @@ -972,7 +972,7 @@ struct UndoChunkRemoveImage ase_uint8 data[0]; }; -void Undo::undo_remove_image(Stock *stock, int image_index) +void UndoHistory::undo_remove_image(Stock *stock, int image_index) { chunk_remove_image_new(m_undoStream, stock, image_index); updateUndo(); @@ -1026,7 +1026,7 @@ struct UndoChunkReplaceImage ase_uint8 data[0]; }; -void Undo::undo_replace_image(Stock *stock, int image_index) +void UndoHistory::undo_replace_image(Stock *stock, int image_index) { chunk_replace_image_new(m_undoStream, stock, image_index); updateUndo(); @@ -1084,7 +1084,7 @@ struct UndoChunkAddCel ase_uint32 cel_id; }; -void Undo::undo_add_cel(Layer* layer, Cel* cel) +void UndoHistory::undo_add_cel(Layer* layer, Cel* cel) { chunk_add_cel_new(m_undoStream, layer, cel); updateUndo(); @@ -1130,7 +1130,7 @@ struct UndoChunkRemoveCel ase_uint8 data[0]; }; -void Undo::undo_remove_cel(Layer* layer, Cel* cel) +void UndoHistory::undo_remove_cel(Layer* layer, Cel* cel) { chunk_remove_cel_new(m_undoStream, layer, cel); updateUndo(); @@ -1180,7 +1180,7 @@ struct UndoChunkSetLayerName ase_uint8 name_text[0]; }; -void Undo::undo_set_layer_name(Layer* layer) +void UndoHistory::undo_set_layer_name(Layer* layer) { chunk_set_layer_name_new(m_undoStream, layer); updateUndo(); @@ -1235,7 +1235,7 @@ struct UndoChunkAddLayer ase_uint32 layer_id; }; -void Undo::undo_add_layer(Layer* folder, Layer* layer) +void UndoHistory::undo_add_layer(Layer* folder, Layer* layer) { chunk_add_layer_new(m_undoStream, folder, layer); updateUndo(); @@ -1283,7 +1283,7 @@ struct UndoChunkRemoveLayer ase_uint8 data[0]; }; -void Undo::undo_remove_layer(Layer* layer) +void UndoHistory::undo_remove_layer(Layer* layer) { chunk_remove_layer_new(m_undoStream, layer); updateUndo(); @@ -1338,7 +1338,7 @@ struct UndoChunkMoveLayer ase_uint32 after_id; }; -void Undo::undo_move_layer(Layer* layer) +void UndoHistory::undo_move_layer(Layer* layer) { chunk_move_layer_new(m_undoStream, layer); updateUndo(); @@ -1387,7 +1387,7 @@ struct UndoChunkSetLayer ase_uint32 layer_id; }; -void Undo::undo_set_layer(Sprite *sprite) +void UndoHistory::undo_set_layer(Sprite *sprite) { chunk_set_layer_new(m_undoStream, sprite); updateUndo(); @@ -1433,7 +1433,7 @@ struct UndoChunkAddPalette ase_uint32 palette_id; }; -void Undo::undo_add_palette(Sprite *sprite, Palette* palette) +void UndoHistory::undo_add_palette(Sprite *sprite, Palette* palette) { chunk_add_palette_new(m_undoStream, sprite, palette); updateUndo(); @@ -1478,7 +1478,7 @@ struct UndoChunkRemovePalette ase_uint8 data[0]; }; -void Undo::undo_remove_palette(Sprite *sprite, Palette* palette) +void UndoHistory::undo_remove_palette(Sprite *sprite, Palette* palette) { chunk_remove_palette_new(m_undoStream, sprite, palette); updateUndo(); @@ -1531,7 +1531,7 @@ struct UndoChunkSetPaletteColors ase_uint8 data[0]; }; -void Undo::undo_set_palette_colors(Sprite *sprite, Palette* palette, int from, int to) +void UndoHistory::undo_set_palette_colors(Sprite *sprite, Palette* palette, int from, int to) { chunk_set_palette_colors_new(m_undoStream, sprite, palette, from, to); updateUndo(); @@ -1599,7 +1599,7 @@ struct UndoChunkRemapPalette ase_uint8 mapping[256]; }; -void Undo::undo_remap_palette(Sprite* sprite, int frame_from, int frame_to, const std::vector& mapping) +void UndoHistory::undo_remap_palette(Sprite* sprite, int frame_from, int frame_to, const std::vector& mapping) { chunk_remap_palette_new(m_undoStream, sprite, frame_from, frame_to, mapping); updateUndo(); @@ -1655,7 +1655,7 @@ struct UndoChunkSetMask ase_uint8 data[0]; }; -void Undo::undo_set_mask(Sprite *sprite) +void UndoHistory::undo_set_mask(Sprite *sprite) { chunk_set_mask_new(m_undoStream, sprite); updateUndo(); @@ -1702,7 +1702,7 @@ struct UndoChunkSetImgType ase_uint32 imgtype; }; -void Undo::undo_set_imgtype(Sprite* sprite) +void UndoHistory::undo_set_imgtype(Sprite* sprite) { chunk_set_imgtype_new(m_undoStream, sprite); updateUndo(); @@ -1751,7 +1751,7 @@ struct UndoChunkSetSize ase_uint32 height; }; -void Undo::undo_set_size(Sprite* sprite) +void UndoHistory::undo_set_size(Sprite* sprite) { chunk_set_size_new(m_undoStream, sprite); updateUndo(); @@ -1795,7 +1795,7 @@ struct UndoChunkSetFrame ase_uint32 frame; }; -void Undo::undo_set_frame(Sprite* sprite) +void UndoHistory::undo_set_frame(Sprite* sprite) { chunk_set_frame_new(m_undoStream, sprite); updateUndo(); @@ -1838,7 +1838,7 @@ struct UndoChunkSetFrames ase_uint32 frames; }; -void Undo::undo_set_frames(Sprite *sprite) +void UndoHistory::undo_set_frames(Sprite *sprite) { chunk_set_frames_new(m_undoStream, sprite); updateUndo(); @@ -1883,7 +1883,7 @@ struct UndoChunkSetFrlen ase_uint32 duration; }; -void Undo::undo_set_frlen(Sprite *sprite, int frame) +void UndoHistory::undo_set_frlen(Sprite *sprite, int frame) { chunk_set_frlen_new(m_undoStream, sprite, frame); updateUndo(); diff --git a/src/raster/undo.h b/src/raster/undo_history.h similarity index 97% rename from src/raster/undo.h rename to src/raster/undo_history.h index 3d183c3d7..a0a0e6fc0 100644 --- a/src/raster/undo.h +++ b/src/raster/undo_history.h @@ -40,11 +40,11 @@ public: UndoException(const char* msg) throw() : base::Exception(msg) { } }; -class Undo : public GfxObj +class UndoHistory : public GfxObj { public: - Undo(Sprite* sprite); - virtual ~Undo(); + UndoHistory(Sprite* sprite); + virtual ~UndoHistory(); bool isEnabled() const; void setEnabled(bool state); diff --git a/src/raster/undo_stream.h b/src/raster/undo_stream.h index 45de91ddf..e307abec6 100644 --- a/src/raster/undo_stream.h +++ b/src/raster/undo_stream.h @@ -24,7 +24,7 @@ class UndoStream public: typedef ChunksList::iterator iterator; - UndoStream(Undo* undo) + UndoStream(UndoHistory* undo) { m_undo = undo; m_size = 0; @@ -35,7 +35,7 @@ public: clear(); } - Undo* getUndo() const + UndoHistory* getUndo() const { return m_undo; } @@ -88,7 +88,7 @@ public: } private: - Undo* m_undo; + UndoHistory* m_undo; ChunksList m_chunks; int m_size; }; diff --git a/src/tools/inks.h b/src/tools/inks.h index 463c7d670..294f8d56b 100644 --- a/src/tools/inks.h +++ b/src/tools/inks.h @@ -18,7 +18,7 @@ #include "app.h" // TODO avoid to include this file #include "app/color_utils.h" -#include "raster/undo.h" +#include "raster/undo_history.h" #include "tools/ink_processing.h" #include "context.h" diff --git a/src/undoable.cpp b/src/undoable.cpp index 0dfea06d6..ee788048d 100644 --- a/src/undoable.cpp +++ b/src/undoable.cpp @@ -32,7 +32,7 @@ #include "raster/quantization.h" #include "raster/sprite.h" #include "raster/stock.h" -#include "raster/undo.h" +#include "raster/undo_history.h" #include "sprite_wrappers.h" #include "undoable.h" diff --git a/src/util/celmove.cpp b/src/util/celmove.cpp index f3d85b4df..e7b9080dd 100644 --- a/src/util/celmove.cpp +++ b/src/util/celmove.cpp @@ -28,7 +28,7 @@ #include "raster/layer.h" #include "raster/sprite.h" #include "raster/stock.h" -#include "raster/undo.h" +#include "raster/undo_history.h" #include "sprite_wrappers.h" #include "util/celmove.h" diff --git a/src/util/clipboard.cpp b/src/util/clipboard.cpp index 645e96072..884a7a3b6 100644 --- a/src/util/clipboard.cpp +++ b/src/util/clipboard.cpp @@ -37,7 +37,7 @@ #include "raster/rotate.h" #include "raster/sprite.h" #include "raster/stock.h" -#include "raster/undo.h" +#include "raster/undo_history.h" #include "settings/settings.h" #include "skin/skin_parts.h" #include "skin/skin_theme.h" diff --git a/src/util/misc.h b/src/util/misc.h index 0708abced..8b9119e98 100644 --- a/src/util/misc.h +++ b/src/util/misc.h @@ -20,13 +20,10 @@ #define UTIL_MISC_H_INCLUDED #include "app/color.h" -#include "widgets/editor.h" /* for movement modes */ +#include "widgets/editor.h" // For movement modes -class Frame; class Image; -class Layer; class Sprite; -class Undo; Image* NewImageFromMask(const Sprite* src); diff --git a/src/widgets/statebar.cpp b/src/widgets/statebar.cpp index 8272e8719..71817ae98 100644 --- a/src/widgets/statebar.cpp +++ b/src/widgets/statebar.cpp @@ -38,7 +38,7 @@ #include "raster/image.h" #include "raster/layer.h" #include "raster/sprite.h" -#include "raster/undo.h" +#include "raster/undo_history.h" #include "skin/skin_theme.h" #include "sprite_wrappers.h" #include "tools/tool.h"