Krita Source Code Documentation
Loading...
Searching...
No Matches
KisUndoStore Class Referenceabstract

#include <kis_undo_store.h>

+ Inheritance diagram for KisUndoStore:

Signals

void historyStateChanged ()
 

Public Member Functions

virtual void addCommand (KUndo2Command *cmd)=0
 
virtual void beginMacro (const KUndo2MagicString &macroName)=0
 
virtual void endMacro ()=0
 
 KisUndoStore ()
 
virtual const KUndo2CommandpresentCommand ()=0
 
virtual void purgeRedoState ()=0
 
virtual void undoLastCommand ()=0
 
virtual ~KisUndoStore ()
 

Detailed Description

See also: https://community.kde.org/Krita/Undo_adapter_vs_Undo_store

Split the functionality of KisUndoAdapter into two classes: KisUndoStore and KisUndoAdapter. The former one works as an interface to an external storage of the undo information: undo stack, KisDocument, /dev/null. The latter one defines the behavior of the system when someone wants to add a command. There are three variants: 1) KisSurrogateUndoAdapter – saves commands directly to the internal stack. Used for wrapping around legacy code into a single command. 2) KisLegacyUndoAdapter – blocks the strokes and updates queue, and then adds the command to a store 3) KisPostExecutionUndoAdapter – used by the strokes. It doesn't call redo() when you add a command. It is assumed, that you have already executed the command yourself and now just notify the system about it. Warning: it doesn't inherit KisUndoAdapter because it doesn't fit the contract of this class. And, more important, KisTransaction should work differently with this class.

The ownership on the KisUndoStore (that substituted KisUndoAdapter in the document's code) now belongs to the image. It means that KisDocument::createUndoStore() is just a factory method, the document doesn't store the undo store itself.

Definition at line 44 of file kis_undo_store.h.

Constructor & Destructor Documentation

◆ KisUndoStore()

KisUndoStore::KisUndoStore ( )

Definition at line 12 of file kis_undo_store.cpp.

13{
14}

◆ ~KisUndoStore()

KisUndoStore::~KisUndoStore ( )
virtual

Definition at line 16 of file kis_undo_store.cpp.

17{
18}

Member Function Documentation

◆ addCommand()

virtual void KisUndoStore::addCommand ( KUndo2Command * cmd)
pure virtual

◆ beginMacro()

virtual void KisUndoStore::beginMacro ( const KUndo2MagicString & macroName)
pure virtual

◆ endMacro()

virtual void KisUndoStore::endMacro ( )
pure virtual

◆ historyStateChanged

void KisUndoStore::historyStateChanged ( )
signal

◆ presentCommand()

virtual const KUndo2Command * KisUndoStore::presentCommand ( )
pure virtual

WARNING: All these methods are not considered as thread-safe

Implemented in KisSurrogateUndoStore, KisDumbUndoStore, KisMacroBasedUndoStore, and KisDocumentUndoStore.

◆ purgeRedoState()

virtual void KisUndoStore::purgeRedoState ( )
pure virtual

◆ undoLastCommand()

virtual void KisUndoStore::undoLastCommand ( )
pure virtual

The documentation for this class was generated from the following files: