Krita Source Code Documentation
Loading...
Searching...
No Matches
KisCommandUtils Namespace Reference

Classes

struct  AggregateCommand
 The AggregateCommand struct is a command with delayed initialization. On first redo() populateChildCommands() is called and the descendants add the desired commands to the internal list. After that, the added commands are executed on every undo()/redo(). More...
 
struct  CompositeCommand
 
struct  FlipFlopCommand
 
struct  LambdaCommand
 The LambdaCommand struct is a shorthand for creation of AggregateCommand commands using C++ lambda feature. Just pass a lambda object into a command and it will be called from within the context of the strokes thread to populate the command content. More...
 
struct  SkipFirstRedoBase
 
struct  SkipFirstRedoWrapper
 

Enumerations

enum  CommandId {
  MoveShapeId = 9999 , ResizeShapeId , TransformShapeId , ChangeShapeTransparencyId ,
  ChangeShapeBackgroundId , ChangeShapeStrokeId , ChangeShapeMarkersId , ChangeShapeParameterId ,
  ChangeEllipseShapeId , ChangeRectangleShapeId , ChangePathShapePointId , ChangePathShapeControlPointId ,
  ChangePaletteId , TransformToolId , ChangeNodeOpacityId , ChangeNodeNameId ,
  ChangeNodeCompositeOpId , ChangeCurrentTimeId , ChangeCurrentTimeToKeyId , DisableUIUpdatesCommandId ,
  UpdateCommandId , EmitImageSignalsCommandId , NodePropertyListCommandId , ChangeStoryboardChild ,
  ChangeTransformMaskCommand , ChangeProjectionColorCommand , SvgInlineSizeChangeCommand , SvgMoveTextCommand ,
  SvgInsertTextCommand , SvgRemoveTextCommand , ChangePaintOrderCommand , SvgTextMergePropertiesRangeCommand ,
  KoShapeMergeTextPropertiesCommandId , ImageAnimSettingCommandId
}
 

Functions

void redoAndMergeIntoAccumulatingCommand (KUndo2Command *cmd, QScopedPointer< KUndo2Command > &accumulatingCommand)
 

Enumeration Type Documentation

◆ CommandId

Enumerator
MoveShapeId 
ResizeShapeId 
TransformShapeId 
ChangeShapeTransparencyId 
ChangeShapeBackgroundId 
ChangeShapeStrokeId 
ChangeShapeMarkersId 
ChangeShapeParameterId 
ChangeEllipseShapeId 
ChangeRectangleShapeId 
ChangePathShapePointId 
ChangePathShapeControlPointId 
ChangePaletteId 
TransformToolId 
ChangeNodeOpacityId 
ChangeNodeNameId 
ChangeNodeCompositeOpId 
ChangeCurrentTimeId 
ChangeCurrentTimeToKeyId 
DisableUIUpdatesCommandId 
UpdateCommandId 
EmitImageSignalsCommandId 
NodePropertyListCommandId 
ChangeStoryboardChild 
ChangeTransformMaskCommand 
ChangeProjectionColorCommand 
SvgInlineSizeChangeCommand 
SvgMoveTextCommand 
SvgInsertTextCommand 
SvgRemoveTextCommand 
ChangePaintOrderCommand 
SvgTextMergePropertiesRangeCommand 
KoShapeMergeTextPropertiesCommandId 
ImageAnimSettingCommandId 

Definition at line 11 of file kis_command_ids.h.

11 {
12 MoveShapeId = 9999,
46};
The SvgTextMergePropertiesRangeCommand class This sets properties on a specific range in a single tex...
@ KoShapeMergeTextPropertiesCommandId

Function Documentation

◆ redoAndMergeIntoAccumulatingCommand()

KRITACOMMAND_EXPORT void KisCommandUtils::redoAndMergeIntoAccumulatingCommand ( KUndo2Command * cmd,
QScopedPointer< KUndo2Command > & accumulatingCommand )

A simple function to merge down commands in iterative actions, like the ones we use in shape manipulations. The function takes ownership of cmd and either merges it into accumulatingCommand (if exists) or just sets the accumulating command to that command

Definition at line 201 of file kis_command_utils.cpp.

202 {
203 cmd->redo();
204 if (accumulatingCommand) {
205 const bool isMerged = accumulatingCommand->mergeWith(cmd);
207 delete cmd;
208 } else {
209 accumulatingCommand.reset(cmd);
210 }
211 }
virtual void redo()
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)
Definition kis_assert.h:130

References KIS_SAFE_ASSERT_RECOVER_NOOP, and KUndo2Command::redo().