Commit af12b8b4 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Move the documentation from the commit message to the apidox

Still, our undo system should be better documented _in_ the source
code.
parent 043c7f74
......@@ -22,6 +22,10 @@
#include "kis_undo_adapter.h"
/**
* KisLegacyUndoAdapter -- blocks the strokes and updates queue,
* and then adds the command to a store
*/
class KRITAIMAGE_EXPORT KisLegacyUndoAdapter : public KisUndoAdapter
{
public:
......
......@@ -26,7 +26,14 @@ class KisUndoStore;
class KisSavedMacroCommand;
class KisStrokesFacade;
/**
* KisPostExecutionUndoAdapter -- used by the strokes. It doesn't
* call redo() when you add a command. It is assumed, that you have
* already executed the command yourself and now just notify
* the system about it. Warning: it doesn't inherit KisUndoAdapter
* because it doesn't fit the contract of this class. And, more
* important, KisTransaction should work differently with this class.
*/
class KRITAIMAGE_EXPORT KisPostExecutionUndoAdapter
{
public:
......
......@@ -45,6 +45,33 @@ public:
virtual void notifyCommandExecuted(const KUndo2Command * cmd) = 0;
};
/**
* See also: http://community.kde.org/Krita/Undo_adapter_vs_Undo_store
*
* Split the functionality of KisUndoAdapter into two classes:
* KisUndoStore and KisUndoAdapter. The former one works as an
* interface to an external storage of the undo information:
* undo stack, KoDocument, /dev/null. The latter one defines the
* behavior of the system when someone wants to add a command. There
* are three variants:
* 1) KisSurrogateUndoAdapter -- saves commands directly to the
* internal stack. Used for wrapping around legacy code into
* a single command.
* 2) KisLegacyUndoAdapter -- blocks the strokes and updates queue,
* and then adds the command to a store
* 3) KisPostExecutionUndoAdapter -- used by the strokes. It doesn't
* call redo() when you add a command. It is assumed, that you have
* already executed the command yourself and now just notify
* the system about it. Warning: it doesn't inherit KisUndoAdapter
* because it doesn't fit the contract of this class. And, more
* important, KisTransaction should work differently with this class.
*
* The ownership on the KisUndoStore (that substituted KisUndoAdapter
* in the document's code) now belongs to the image. It means that
* KisDoc2::createUndoStore() is just a factory method, the document
* doesn't store the undo store itself.
*/
class KRITAIMAGE_EXPORT KisUndoStore
{
public:
......
......@@ -24,7 +24,6 @@
class KoDocument;
class KUndo2Stack;
class KRITAIMAGE_EXPORT KisDocumentUndoStore : public KisUndoStore
{
public:
......@@ -48,6 +47,11 @@ private:
};
/**
* KisSurrogateUndoAdapter -- saves commands directly to the
* internal stack. Used for wrapping around legacy code into
* a single command.
*/
class KRITAIMAGE_EXPORT KisSurrogateUndoStore : public KisUndoStore
{
public:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment