#include <EditableI.h>
Inheritance diagram for Edit::EditableI:
Editable interfaces is used by all the objects which are editable. The interface defines set of methods which are used for example by the undo-system in Demopaja.
|
Default constructor.
|
|
Default constructor with reference to the original.
|
|
Default destructor.
|
|
Starts new editing scope, returns current undo.
Implemented by the system. If the class needs to store extra information which cannot be stored in the clone() method or a special flag needs to be set, override this method, but remember to call this memeber at the beginning of the overridden method! |
|
Clones editable. Makes a clone of the editable and returns it. The duplicated editable has to be released when it is no longer used. The restore() method is used to clone the data. Also the reference to the original data is saved. Used internally, usually from the begin_editing() method.
|
|
Deep copy from a data block.
Example Implementation void TGAImportC::copy( DataBlockI* pBlock ) { TGAImportC* pFile = (TGAImportC*)pBlock; m_i32Width = pFile->m_i32Width; m_i32Height = pFile->m_i32Height; m_i32Bpp = pFile->m_i32Bpp; m_sFileName = pFile->m_sFileName; // duplicate data delete m_pData; uint32 ui32DataSize = m_i32Width * m_i32Height * (m_i32Bpp / 8); m_pData = new uint8[ui32DataSize]; memcpy( m_pData, pFile->m_pData, ui32DataSize ); } Reimplemented from Edit::DataBlockI. Reimplemented in Composition::ControllerC, Composition::EffectI, Import::FileHandleC, Import::FileListC, Composition::GizmoI, Composition::KeyC, Composition::LayerC, Composition::ParamI, Composition::ParamIntC, Composition::ParamFloatC, Composition::ParamVector2C, Composition::ParamVector3C, Composition::ParamColorC, Composition::ParamTextC, Composition::ParamFileC, Composition::SceneC, and Composition::TimeSegmentC. |
|
Creates new datablock, with reference to the original.
Reimplemented in Composition::ControllerC, Import::FileHandleC, Import::FileListC, Composition::KeyC, Composition::LayerC, Composition::ParamIntC, Composition::ParamFloatC, Composition::ParamVector2C, Composition::ParamVector3C, Composition::ParamColorC, Composition::ParamTextC, Composition::ParamFileC, Composition::SceneC, and Composition::TimeSegmentC. |
|
Creates new datablock. The create method of data block class creates new instance of the same class the data block is. Example implementation: DataBlockI* TGAImportC::create() { return new TGAImportC; }
Reimplemented from Edit::DataBlockI. Reimplemented in Composition::ControllerC, Import::FileHandleC, Import::FileListC, Composition::KeyC, Composition::LayerC, Composition::ParamIntC, Composition::ParamFloatC, Composition::ParamVector2C, Composition::ParamVector3C, Composition::ParamColorC, Composition::ParamTextC, Composition::ParamFileC, Composition::SceneC, and Composition::TimeSegmentC. |
|
Duplicates editable. Makes a duplicate of the editable and returns it. The duplicated editable has to be released when it is no longer used. The copy() method is used to duplicate the data. |
|
Ends current editing scope, set return previous undo. The default implementation sets the given undo object as current undo object. This method is implemented by the system and used internally.
|
|
Returns original editable, if the editable is a clone, else returns 0. Every time a editable is cloned a reference to the orginal data is saved too. This methods enables to get the pointer to the original data. This methods is mainly used to determine if the released editable is a clone, hence no data will be released. Example usage: TGAImportC::~TGAImportC() { // Check if this editable is a clone. if( get_original() ) return; // It's clone, return. // Delete data delete m_pData; } |
|
Returns current undo. Returns current undo object bind by the last begin_editing() call. The return value can be NULL. Implemented by the system. |
|
Load editable from a Demopaja input stream.
Reimplemented in Composition::ControllerC, Composition::EffectI, Import::FileHandleC, Import::FileListC, Composition::GizmoI, Composition::KeyC, Composition::LayerC, Composition::ParamI, Composition::ParamIntC, Composition::ParamFloatC, Composition::ParamVector2C, Composition::ParamVector3C, Composition::ParamColorC, Composition::ParamTextC, Composition::ParamFileC, Composition::SceneC, and Composition::TimeSegmentC. |
|
Shallow copy of a data block. Restores the local data from the given data block. This method is used by the Demopaja undo system to restore data from a copy. This method should only do a shallow copy, that is, copy the variables which can be changed by the methods in the interface of the class. For example if a import plugin class should not copy the data, but only pointer to the data since there isnt any method in the interface which would change the data. If the data can be changed the copy() is called automatically by the system. Example: void TGAImportC::restore( EditableI* pEditable ) { TGAImportC* pFile = (TGAImportC*)pEditable; m_ui32TextureId = pFile->m_ui32TextureId; m_pData = pFile->m_pData; m_i32Width = pFile->m_i32Width; m_i32Height = pFile->m_i32Height; m_i32Bpp = pFile->m_i32Bpp; m_sFileName = pFile->m_sFileName; }
Reimplemented in Composition::ControllerC, Composition::EffectI, Import::FileHandleC, Import::FileListC, Composition::GizmoI, Composition::KeyC, Composition::LayerC, Composition::ParamI, Composition::ParamIntC, Composition::ParamFloatC, Composition::ParamVector2C, Composition::ParamVector3C, Composition::ParamColorC, Composition::ParamTextC, Composition::ParamFileC, Composition::SceneC, and Composition::TimeSegmentC. |
|
Save editable to a Demopaja output stream.
Reimplemented in Composition::ControllerC, Composition::EffectI, Import::FileHandleC, Import::FileListC, Composition::GizmoI, Composition::KeyC, Composition::LayerC, Composition::ParamI, Composition::ParamIntC, Composition::ParamFloatC, Composition::ParamVector2C, Composition::ParamVector3C, Composition::ParamColorC, Composition::ParamTextC, Composition::ParamFileC, Composition::SceneC, and Composition::TimeSegmentC. |