|
Krita Source Code Documentation
|
#include <kis_document_undo_store.h>
Inheritance diagram for KisDocumentUndoStore:Public Member Functions | |
| void | addCommand (KUndo2Command *cmd) override |
| void | beginMacro (const KUndo2MagicString ¯oName) override |
| void | endMacro () override |
| KisDocumentUndoStore (KisDocument *doc) | |
| const KUndo2Command * | presentCommand () override |
| void | purgeRedoState () override |
| void | undoLastCommand () override |
Public Member Functions inherited from KisUndoStore | |
| KisUndoStore () | |
| virtual | ~KisUndoStore () |
Private Attributes | |
| KisDocument * | m_doc |
Additional Inherited Members | |
Signals inherited from KisUndoStore | |
| void | historyStateChanged () |
Definition at line 15 of file kis_document_undo_store.h.
| KisDocumentUndoStore::KisDocumentUndoStore | ( | KisDocument * | doc | ) |
The thread of the document should be the same as the store to avoid incorrect signal delivery
Definition at line 17 of file kis_document_undo_store.cpp.
References connect(), KisUndoStore::historyStateChanged(), KIS_SAFE_ASSERT_RECOVER_NOOP, and KisDocument::undoStack.
|
overridevirtual |
Implements KisUndoStore.
Definition at line 51 of file kis_document_undo_store.cpp.
References m_doc, KUndo2QStack::push(), and KisDocument::undoStack.
|
overridevirtual |
Implements KisUndoStore.
Definition at line 57 of file kis_document_undo_store.cpp.
References KUndo2QStack::beginMacro(), m_doc, and KisDocument::undoStack.
|
overridevirtual |
Implements KisUndoStore.
Definition at line 62 of file kis_document_undo_store.cpp.
References KUndo2QStack::endMacro(), m_doc, and KisDocument::undoStack.
|
overridevirtual |
WARNING: All these methods are not considered as thread-safe
Implements KisUndoStore.
Definition at line 28 of file kis_document_undo_store.cpp.
References KUndo2QStack::command(), KUndo2QStack::index(), m_doc, and KisDocument::undoStack.
|
overridevirtual |
Implements KisUndoStore.
Definition at line 67 of file kis_document_undo_store.cpp.
References m_doc, KUndo2QStack::purgeRedoState(), and KisDocument::undoStack.
|
overridevirtual |
FIXME: Added as a workaround for being able to cancel creation of the new adjustment mask (or any other mask whose creation can be cancelled).
Ideally, we should use "addToIndex-commit" technique like git does. When a user presses Create button, we call command->redo() and save this command in a cache. When the user confirms creation of the layer with "OK" button, we "commit" the command to the undoStack. If the user changes his mind and presses Cancel, we just call command->undo() and remove the cache without committing it to the undoStack
Implements KisUndoStore.
Definition at line 33 of file kis_document_undo_store.cpp.
References m_doc, KUndo2QStack::undo(), and KisDocument::undoStack.
|
private |
Definition at line 28 of file kis_document_undo_store.h.