Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_legacy_undo_adapter.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2011 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
8
9#include "kis_image.h"
10
11
13 KisImageWSP image)
14 : KisUndoAdapter(undoStore, image.data()),
15 m_image(image),
16 m_macroCounter(0)
17{
18}
19
24
29
31{
32 if(!command) return;
33
34 if(m_macroCounter) {
35 undoStore()->addCommand(command);
36 }
37 else {
39 undoStore()->addCommand(command);
40 m_image->unlock();
41 }
42}
43
45{
46 if(!m_macroCounter) {
48 }
49
51 undoStore()->beginMacro(macroName);
52}
53
55{
57
58 if(!m_macroCounter) {
59 m_image->unlock();
60 }
62}
63
void unlock()
Definition kis_image.cc:805
void barrierLock(bool readOnly=false)
Wait until all the queued background jobs are completed and lock the image.
Definition kis_image.cc:756
void addCommand(KUndo2Command *cmd) override
void beginMacro(const KUndo2MagicString &macroName) override
const KUndo2Command * presentCommand() override
KisLegacyUndoAdapter(KisUndoStore *undoStore, KisImageWSP image)
KisUndoStore * undoStore()
virtual void addCommand(KUndo2Command *cmd)=0
virtual const KUndo2Command * presentCommand()=0
virtual void endMacro()=0
virtual void beginMacro(const KUndo2MagicString &macroName)=0
virtual void undoLastCommand()=0