|
Krita Source Code Documentation
|
#include <kis_transaction_data.h>
Inheritance diagram for KisTransactionData:Public Attributes | |
| bool | defaultPixelChanged = false |
| KisPaintDeviceSP | device |
| bool | firstRedo |
| QScopedPointer< KUndo2Command > | flattenUndoCommand |
| QScopedPointer< OptionalInterstrokeInfo > | interstrokeInfo |
| KisMementoSP | memento |
| QPoint | newOffset |
| KoColor | oldDefaultPixel |
| QPoint | oldOffset |
| bool | resetSelectionOutlineCache |
| KisDataManagerSP | savedDataManager |
| QPainterPath | savedOutlineCache |
| bool | savedOutlineCacheValid |
| bool | suppressUpdates = false |
| bool | transactionFinished |
| int | transactionFrameId |
| int | transactionTime |
Protected Member Functions | |
| virtual void | restoreSelectionOutlineCache (bool undo) |
| virtual void | saveSelectionOutlineCache () |
Private Member Functions | |
| void | doFlattenUndoRedo (bool undo) |
| void | init (KisPaintDeviceSP device) |
| void | possiblyFlattenSelection (KisPaintDeviceSP device) |
| void | possiblyNotifySelectionChanged () |
| void | possiblyResetOutlineCache () |
| void | startUpdates () |
Private Member Functions inherited from Private | |
| Private (KisCanvas2 *c) | |
Private Attributes | |
| Private *const | m_d |
Private Attributes inherited from Private | |
| KisCanvas2 * | canvas |
| int | displayedFrame |
| int | intendedFrame |
A tile based undo command.
Ordinary KUndo2Command subclasses store parameters and apply the action in the redo() command, however, Krita doesn't work like this. Undo replaces the current tiles in a paint device with the old tiles, redo replaces them again with the new tiles without actually executing the command that changed the image data again.
Definition at line 37 of file kis_transaction_data.cpp.
| KisTransactionData::KisTransactionData | ( | const KUndo2MagicString & | name, |
| KisPaintDeviceSP | device, | ||
| bool | resetSelectionOutlineCache, | ||
| KisTransactionWrapperFactory * | interstrokeDataFactory, | ||
| KUndo2Command * | parent, | ||
| bool | suppressUpdates ) |
Definition at line 67 of file kis_transaction_data.cpp.
References device, init(), KisPaintDevice::interstrokeData(), m_d, possiblyFlattenSelection(), resetSelectionOutlineCache, saveSelectionOutlineCache(), KUndo2Command::setTimedID(), and suppressUpdates.
|
override |
| KisDataManagerSP KisTransactionData::dataManager | ( | ) |
|
private |
Definition at line 226 of file kis_transaction_data.cpp.
|
virtual |
Definition at line 132 of file kis_transaction_data.cpp.
References DEBUG_ACTION, KIS_ASSERT_RECOVER_RETURN, and m_d.
|
private |
Definition at line 89 of file kis_transaction_data.cpp.
References KisPaintDeviceFramesInterface::currentFrameId(), KisDefaultBoundsBase::currentTime(), DEBUG_ACTION, KisPaintDevice::defaultBounds(), KisPaintDevice::defaultPixel(), device, KisPaintDevice::framesInterface(), m_d, KisPaintDevice::x(), and KisPaintDevice::y().
| void KisTransactionData::moveDevice | ( | const QPoint | newOffset | ) |
|
private |
Definition at line 209 of file kis_transaction_data.cpp.
References KisSharedPtr< T >::data(), KisWeakSharedPtr< T >::data(), device, KisSelection::flatten(), m_d, and KisPixelSelection::parentSelection.
|
private |
Definition at line 186 of file kis_transaction_data.cpp.
References m_d, KisSelection::notifySelectionChanged(), and KisPixelSelection::parentSelection.
|
private |
Definition at line 197 of file kis_transaction_data.cpp.
References KisPixelSelection::invalidateOutlineCache(), and m_d.
| void KisTransactionData::possiblySwitchCurrentTime | ( | ) |
|
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 249 of file kis_transaction_data.cpp.
References DEBUG_ACTION, doFlattenUndoRedo(), m_d, possiblyNotifySelectionChanged(), possiblyResetOutlineCache(), restoreSelectionOutlineCache(), and startUpdates().
|
protectedvirtual |
Definition at line 332 of file kis_transaction_data.cpp.
References KisPixelSelection::invalidateOutlineCache(), m_d, KisPixelSelection::outlineCache, KisPixelSelection::outlineCacheValid, savedOutlineCache, savedOutlineCacheValid, KisPixelSelection::setOutlineCache(), and undo().
|
protectedvirtual |
Definition at line 315 of file kis_transaction_data.cpp.
References m_d, KisPixelSelection::outlineCache, KisPixelSelection::outlineCacheValid, and possiblyResetOutlineCache().
|
private |
Definition at line 155 of file kis_transaction_data.cpp.
References m_d.
|
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 288 of file kis_transaction_data.cpp.
References DEBUG_ACTION, doFlattenUndoRedo(), m_d, possiblyNotifySelectionChanged(), restoreSelectionOutlineCache(), and startUpdates().
| bool KisTransactionData::defaultPixelChanged = false |
Definition at line 48 of file kis_transaction_data.cpp.
| KisPaintDeviceSP KisTransactionData::device |
Definition at line 40 of file kis_transaction_data.cpp.
| bool KisTransactionData::firstRedo |
Definition at line 42 of file kis_transaction_data.cpp.
| QScopedPointer<KUndo2Command> KisTransactionData::flattenUndoCommand |
Definition at line 52 of file kis_transaction_data.cpp.
| QScopedPointer<OptionalInterstrokeInfo> KisTransactionData::interstrokeInfo |
Definition at line 59 of file kis_transaction_data.cpp.
|
private |
Definition at line 51 of file kis_transaction_data.h.
| KisMementoSP KisTransactionData::memento |
Definition at line 41 of file kis_transaction_data.cpp.
| QPoint KisTransactionData::newOffset |
Definition at line 45 of file kis_transaction_data.cpp.
| KoColor KisTransactionData::oldDefaultPixel |
Definition at line 47 of file kis_transaction_data.cpp.
| QPoint KisTransactionData::oldOffset |
Definition at line 44 of file kis_transaction_data.cpp.
| bool KisTransactionData::resetSelectionOutlineCache |
Definition at line 53 of file kis_transaction_data.cpp.
| KisDataManagerSP KisTransactionData::savedDataManager |
Definition at line 57 of file kis_transaction_data.cpp.
| QPainterPath KisTransactionData::savedOutlineCache |
Definition at line 51 of file kis_transaction_data.cpp.
| bool KisTransactionData::savedOutlineCacheValid |
Definition at line 50 of file kis_transaction_data.cpp.
| bool KisTransactionData::suppressUpdates = false |
Definition at line 60 of file kis_transaction_data.cpp.
| bool KisTransactionData::transactionFinished |
Definition at line 43 of file kis_transaction_data.cpp.
| int KisTransactionData::transactionFrameId |
Definition at line 56 of file kis_transaction_data.cpp.
| int KisTransactionData::transactionTime |
Definition at line 55 of file kis_transaction_data.cpp.