|
Krita Source Code Documentation
|
The command for adding a layer. More...
#include <kis_image_layer_add_command.h>
Inheritance diagram for KisImageLayerAddCommand:Public Types | |
| enum | Flag { None = 0x0 , DoRedoUpdates = 0x1 , DoUndoUpdates = 0x2 , DontActivateOnAddition = 0x4 } |
Public Member Functions | |
| KisImageLayerAddCommand (KisImageWSP image, KisNodeSP layer, KisNodeSP parent, KisNodeSP aboveThis, bool doRedoUpdates=true, bool doUndoUpdates=true) | |
| KisImageLayerAddCommand (KisImageWSP image, KisNodeSP layer, KisNodeSP parent, KisNodeSP aboveThis, Flags flags) | |
| KisImageLayerAddCommand (KisImageWSP image, KisNodeSP layer, KisNodeSP parent, quint32 index, bool doRedoUpdates=true, bool doUndoUpdates=true) | |
| KisImageLayerAddCommand (KisImageWSP image, KisNodeSP layer, KisNodeSP parent, quint32 index, Flags flags) | |
| void | redo () override |
| void | undo () override |
Public Member Functions inherited from KisImageCommand | |
| KisImageCommand (const KUndo2MagicString &name, KisImageWSP image, KUndo2Command *parent=0) | |
| ~KisImageCommand () override | |
Public Member Functions inherited from KUndo2Command | |
| QString | actionText () const |
| virtual bool | canAnnihilateWith (const KUndo2Command *other) const |
| const KUndo2Command * | child (int index) const |
| int | childCount () const |
| virtual QTime | endTime () const |
| KUndo2CommandExtraData * | extraData () const |
| bool | hasParent () const |
| virtual int | id () const |
| virtual bool | isMerged () const |
| KUndo2Command (const KUndo2MagicString &text, KUndo2Command *parent=0) | |
| KUndo2Command (KUndo2Command *parent=0) | |
| virtual QVector< KUndo2Command * > | mergeCommandsVector () const |
| virtual bool | mergeWith (const KUndo2Command *other) |
| virtual void | redoMergedCommands () |
| void | setEndTime () |
| virtual void | setEndTime (const QTime &time) |
| void | setExtraData (KUndo2CommandExtraData *data) |
| void | setText (const KUndo2MagicString &text) |
| void | setTime () |
| virtual void | setTime (const QTime &time) |
| virtual void | setTimedID (int timedID) |
| KUndo2MagicString | text () const |
| virtual QTime | time () const |
| virtual int | timedId () const |
| virtual bool | timedMergeWith (KUndo2Command *other) |
| virtual void | undoMergedCommands () |
| virtual | ~KUndo2Command () |
Private Attributes | |
| KisNodeSP | m_aboveThis |
| KisNodeAdditionFlags | m_additionFlags |
| bool | m_doRedoUpdates |
| bool | m_doUndoUpdates |
| quint32 | m_index |
| KisNodeSP | m_layer |
| KisNodeSP | m_parent |
Additional Inherited Members | |
Protected Attributes inherited from KisImageCommand | |
| KisImageWSP | m_image |
The command for adding a layer.
Definition at line 19 of file kis_image_layer_add_command.h.
| Enumerator | |
|---|---|
| None | |
| DoRedoUpdates | |
| DoUndoUpdates | |
| DontActivateOnAddition | |
Definition at line 23 of file kis_image_layer_add_command.h.
| KisImageLayerAddCommand::KisImageLayerAddCommand | ( | KisImageWSP | image, |
| KisNodeSP | layer, | ||
| KisNodeSP | parent, | ||
| KisNodeSP | aboveThis, | ||
| bool | doRedoUpdates = true, | ||
| bool | doUndoUpdates = true ) |
Constructor
| image | The image the command will be working on. |
| layer | The layer to add |
| parent | The parent node |
| aboveThis | The node above this |
| doRedoUpdates | Whether to make the redo updates |
| doUndoUpdates | Whether to make the undo updates |
Definition at line 14 of file kis_image_layer_add_command.cpp.
References m_aboveThis, m_layer, and m_parent.
| KisImageLayerAddCommand::KisImageLayerAddCommand | ( | KisImageWSP | image, |
| KisNodeSP | layer, | ||
| KisNodeSP | parent, | ||
| quint32 | index, | ||
| bool | doRedoUpdates = true, | ||
| bool | doUndoUpdates = true ) |
Definition at line 31 of file kis_image_layer_add_command.cpp.
References m_aboveThis, m_layer, and m_parent.
| KisImageLayerAddCommand::KisImageLayerAddCommand | ( | KisImageWSP | image, |
| KisNodeSP | layer, | ||
| KisNodeSP | parent, | ||
| KisNodeSP | aboveThis, | ||
| Flags | flags ) |
Definition at line 48 of file kis_image_layer_add_command.cpp.
References DontActivateNode, DontActivateOnAddition, and m_additionFlags.
| KisImageLayerAddCommand::KisImageLayerAddCommand | ( | KisImageWSP | image, |
| KisNodeSP | layer, | ||
| KisNodeSP | parent, | ||
| quint32 | index, | ||
| Flags | flags ) |
Definition at line 61 of file kis_image_layer_add_command.cpp.
References DontActivateNode, DontActivateOnAddition, and m_additionFlags.
|
overridevirtual |
Applies a change to the document. This function must be implemented in the derived class. Calling KUndo2QStack::push(), KUndo2QStack::undo() or KUndo2QStack::redo() from this function leads to undefined behavior.
The default implementation calls redo() on all child commands.
Reimplemented from KUndo2Command.
Definition at line 70 of file kis_image_layer_add_command.cpp.
References KisNodeFacade::addNode(), KisImage::bounds(), m_aboveThis, m_additionFlags, m_doRedoUpdates, KisImageCommand::m_image, m_index, m_layer, m_parent, KisNode::setDirty(), and KisWeakSharedPtr< T >::toStrongRef().
|
overridevirtual |
Reverts a change to the document. After undo() is called, the state of the document should be the same as before redo() was called. This function must be implemented in the derived class. Calling KUndo2QStack::push(), KUndo2QStack::undo() or KUndo2QStack::redo() from this function leads to undefined behavior.
The default implementation calls undo() on all child commands in reverse order.
Reimplemented from KUndo2Command.
Definition at line 87 of file kis_image_layer_add_command.cpp.
References KisImage::bounds(), m_doUndoUpdates, KisImageCommand::m_image, m_layer, KisNodeFacade::removeNode(), target(), and KisWeakSharedPtr< T >::toStrongRef().
|
private |
Definition at line 54 of file kis_image_layer_add_command.h.
|
private |
Definition at line 58 of file kis_image_layer_add_command.h.
|
private |
Definition at line 56 of file kis_image_layer_add_command.h.
|
private |
Definition at line 57 of file kis_image_layer_add_command.h.
|
private |
Definition at line 55 of file kis_image_layer_add_command.h.
|
private |
Definition at line 52 of file kis_image_layer_add_command.h.
|
private |
Definition at line 53 of file kis_image_layer_add_command.h.