File indexing completed on 2024-05-12 15:58:25
0001 /* 0002 * SPDX-FileCopyrightText: 2011 Dmitry Kazakov <dimula73@gmail.com> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #ifndef __KIS_LEGACY_UNDO_ADAPTER_H 0008 #define __KIS_LEGACY_UNDO_ADAPTER_H 0009 0010 #include "kis_undo_adapter.h" 0011 #include "kis_types.h" 0012 0013 0014 /** 0015 * KisLegacyUndoAdapter -- blocks the strokes and updates queue, 0016 * and then adds the command to a store 0017 */ 0018 class KRITAIMAGE_EXPORT KisLegacyUndoAdapter : public KisUndoAdapter 0019 { 0020 public: 0021 KisLegacyUndoAdapter(KisUndoStore *undoStore, KisImageWSP image); 0022 0023 const KUndo2Command* presentCommand() override; 0024 void undoLastCommand() override; 0025 void addCommand(KUndo2Command *cmd) override; 0026 void beginMacro(const KUndo2MagicString& macroName) override; 0027 void endMacro() override; 0028 private: 0029 KisImageWSP m_image; 0030 qint32 m_macroCounter; 0031 }; 0032 0033 #endif /* __KIS_LEGACY_UNDO_ADAPTER_H */