Krita Source Code Documentation
Loading...
Searching...
No Matches
KisSuspendProjectionUpdatesStrokeStrategy::Private::EndBatchUIUpdatesCommand Struct Reference
+ Inheritance diagram for KisSuspendProjectionUpdatesStrokeStrategy::Private::EndBatchUIUpdatesCommand:

Public Member Functions

 EndBatchUIUpdatesCommand (KisSuspendProjectionUpdatesStrokeStrategy *strategy)
 
void redo () override
 
void undo () override
 
- Public Member Functions inherited from KisSuspendProjectionUpdatesStrokeStrategy::Private::StrokeJobCommand
 StrokeJobCommand (KisStrokeJobData::Sequentiality sequentiality=KisStrokeJobData::SEQUENTIAL, KisStrokeJobData::Exclusivity exclusivity=KisStrokeJobData::NORMAL)
 
- Public Member Functions inherited from KUndo2Command
QString actionText () const
 
virtual bool canAnnihilateWith (const KUndo2Command *other) const
 
const KUndo2Commandchild (int index) const
 
int childCount () const
 
virtual QTime endTime () const
 
KUndo2CommandExtraDataextraData () 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 ()
 

Public Attributes

KisSuspendProjectionUpdatesStrokeStrategym_strategy
 
- Public Attributes inherited from KisSuspendProjectionUpdatesStrokeStrategy::Private::StrokeJobCommand
KisStrokeJobData::Exclusivity m_exclusivity
 
KisStrokeJobData::Sequentiality m_sequentiality
 

Detailed Description

Constructor & Destructor Documentation

◆ EndBatchUIUpdatesCommand()

KisSuspendProjectionUpdatesStrokeStrategy::Private::EndBatchUIUpdatesCommand::EndBatchUIUpdatesCommand ( KisSuspendProjectionUpdatesStrokeStrategy * strategy)
inline

Definition at line 379 of file kis_suspend_projection_updates_stroke_strategy.cpp.

381 m_strategy(strategy) {}
StrokeJobCommand(KisStrokeJobData::Sequentiality sequentiality=KisStrokeJobData::SEQUENTIAL, KisStrokeJobData::Exclusivity exclusivity=KisStrokeJobData::NORMAL)

Member Function Documentation

◆ redo()

void KisSuspendProjectionUpdatesStrokeStrategy::Private::EndBatchUIUpdatesCommand::redo ( )
inlineoverridevirtual

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.

See also
undo()

Reimplemented from KUndo2Command.

Definition at line 383 of file kis_suspend_projection_updates_stroke_strategy.cpp.

383 {
384 KisImageSP image = m_strategy->m_d->image.toStrongRef();
386
388 m_strategy->m_d->sanityResumingFinished = true;
389 m_strategy->m_d->accumulatedDirtyRects.clear();
390 KIS_SAFE_ASSERT_RECOVER_NOOP(m_strategy->m_d->usedFilters.isEmpty());
391 }
KisImageSignalRouter * signalRouter()
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
Definition kis_assert.h:128
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)
Definition kis_assert.h:130

References KisImageSignalRouter::emitNotifyBatchUpdateEnded(), KisSuspendProjectionUpdatesStrokeStrategy::Private::image, KIS_SAFE_ASSERT_RECOVER_NOOP, KIS_SAFE_ASSERT_RECOVER_RETURN, KisSuspendProjectionUpdatesStrokeStrategy::m_d, m_strategy, and KisImage::signalRouter().

◆ undo()

void KisSuspendProjectionUpdatesStrokeStrategy::Private::EndBatchUIUpdatesCommand::undo ( )
inlineoverridevirtual

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.

See also
redo()

Even though this command is the last command of the stroke is can still be undone by suspendStrokeCallback(). It happens when a LodN stroke is started right after the last job of resume strategy was being executed. In such a case new stroke is placed right in front of our resume strategy and all the resuming work is undone (mimicking a normal suspend strategy).

The only thing we should control here is whether the state of the stroke is reset to default. Otherwise we'll do all the updates twice.

Reimplemented from KUndo2Command.

Definition at line 393 of file kis_suspend_projection_updates_stroke_strategy.cpp.

393 {
406 KIS_SAFE_ASSERT_RECOVER_NOOP(m_strategy->m_d->usedFilters.isEmpty());
407 KIS_SAFE_ASSERT_RECOVER_NOOP(m_strategy->m_d->accumulatedDirtyRects.isEmpty());
408
409 m_strategy->m_d->sanityResumingFinished = false;
410
411 KisImageSP image = m_strategy->m_d->image.toStrongRef();
413
415 }

References KisImageSignalRouter::emitNotifyBatchUpdateStarted(), KisSuspendProjectionUpdatesStrokeStrategy::Private::image, KIS_SAFE_ASSERT_RECOVER_NOOP, KIS_SAFE_ASSERT_RECOVER_RETURN, KisSuspendProjectionUpdatesStrokeStrategy::m_d, m_strategy, and KisImage::signalRouter().

Member Data Documentation

◆ m_strategy

KisSuspendProjectionUpdatesStrokeStrategy* KisSuspendProjectionUpdatesStrokeStrategy::Private::EndBatchUIUpdatesCommand::m_strategy

The documentation for this struct was generated from the following file: