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

#include <KisAsynchronouslyMergeableCommandInterface.h>

+ Inheritance diagram for KisAsynchronouslyMergeableCommandInterface:

Public Member Functions

virtual bool canMergeWith (const KUndo2Command *command) const =0
 
virtual ~KisAsynchronouslyMergeableCommandInterface ()
 

Detailed Description

A special base class for commands that should be able to merge (compress) when used inside KisProcessingApplicator (or anything else that uses KisSavedMacroCommand).

KisProcessingApplicator generates many commands, but undo stack wants only one command to represent user's action. That is why the action is wrapped into KisSavedMacroCommand. This macro command class has a special algorithm for merging an action consisting of multiple commands. This algorithm must know if all the commands of the macro can be merged before doing the actual merge. Using KUndo2Command::mergeWith() is not possible for this purpose, because it merges commands right away and one cannot undo that.

See also
KisSavedMacroCommand::mergeWith()
example in KisNodeCompositeOpCommand

Definition at line 30 of file KisAsynchronouslyMergeableCommandInterface.h.

Constructor & Destructor Documentation

◆ ~KisAsynchronouslyMergeableCommandInterface()

KisAsynchronouslyMergeableCommandInterface::~KisAsynchronouslyMergeableCommandInterface ( )
virtual

Definition at line 10 of file KisAsynchronouslyMergeableCommandInterface.cpp.

11{
12}

Member Function Documentation

◆ canMergeWith()

virtual bool KisAsynchronouslyMergeableCommandInterface::canMergeWith ( const KUndo2Command * command) const
pure virtual
Returns
true if command can be merged with (*this) command using KUndo2Command::mergeWith() call.

WARNING: if canMergeWith() returned true, then mergeWith() must also return true. Otherwise KisSavedMacroCommand will be able to enter inconsistent state and assert.

Implemented in KisNodeCompositeOpCommand, KisNodeOpacityCommand, KisNodePropertyListCommand, KisNodeRenameCommand, KisChangeProjectionColorCommand, KisImageAnimSettingCommand, DisableUIUpdatesCommand, UpdateCommand, and EmitImageSignalsCommand.


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