InitBlendAction Class Reference

#include <nodeblnd.h>

Inheritance diagram for InitBlendAction:

Action ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 InitBlendAction ()
 Constructor for the action.
 ~InitBlendAction ()
virtual ActionCode Execute ()
 Executes the action. It calls Deinit() then Reinit() on the blend, then invalidate its bounds.

Static Public Member Functions

static ActionCode Init (UndoableOperation *pOp, ActionList *pActionList, NodeBlend *pThisNodeBlend, BOOL StoreStartAndEndNodes=FALSE, BOOL bReverse=FALSE, BOOL bNodesMayBeChanged=FALSE)
 This is the function which creates an instance of this action. If there is no room in the undo buffer (which is determined by the base class Init function called within) the function will either return AC_NO_RECORD which means the operation can continue, but no undo information needs to be stored, or AC_OK which means the operation should continue AND record undo information. If the function returns AC_FAIL, there was not enough memory to record the undo information, and the user has decided not to continue with the operation.
static ActionCode InitOnBlender (UndoableOperation *pOp, ActionList *pActionList, NodeBlender *pThisNodeBlender, BOOL StoreStartAndEndNodes=FALSE, BOOL bReverse=FALSE)

Protected Attributes

NodeBlendm_pNodeBlend
NodeBlenderm_pNodeBlender
Nodem_pStartNode
Nodem_pEndNode
BOOL m_bReverse
BOOL m_bStoreStartAndEndNodes
InitBlendActionType m_enInitType
BOOL m_bNodesMayBeChanged

Detailed Description

Definition at line 385 of file nodeblnd.h.


Constructor & Destructor Documentation

InitBlendAction::InitBlendAction  ) 
 

Constructor for the action.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
8/2/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 3287 of file nodeblnd.cpp.

03288 {
03289     m_pNodeBlend = NULL;
03290     m_pNodeBlender = NULL;
03291     m_pStartNode = NULL;
03292     m_pEndNode = NULL;
03293     m_bReverse = FALSE;
03294     m_bStoreStartAndEndNodes = FALSE;
03295     m_enInitType = IBAT_INVALID;
03296 }

InitBlendAction::~InitBlendAction  ) 
 

Definition at line 3503 of file nodeblnd.cpp.

03504 {
03505 }


Member Function Documentation

ActionCode InitBlendAction::Execute  )  [virtual]
 

Executes the action. It calls Deinit() then Reinit() on the blend, then invalidate its bounds.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
8/2/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
ActionCode, one of AC_OK, AC_NO_RECORD or AC_FAIL

Errors: -

See also:
Action::Init()

Reimplemented from Action.

Definition at line 3434 of file nodeblnd.cpp.

03435 {
03436     if (pOperation->IS_KIND_OF(UndoableOperation))
03437     {
03438         switch (m_enInitType)
03439         {
03440             case IBAT_INIT:
03441             {
03442                 if (InitBlendAction::Init((UndoableOperation*)pOperation,pOppositeActLst,m_pNodeBlend,
03443                     m_bStoreStartAndEndNodes, m_bReverse, m_bNodesMayBeChanged) != AC_OK)
03444                     return AC_FAIL;
03445             }
03446             break;
03447             case IBAT_INITONBLENDER:
03448             {
03449                 if (InitBlendAction::InitOnBlender((UndoableOperation*)pOperation,pOppositeActLst,m_pNodeBlender,
03450                     m_bStoreStartAndEndNodes, m_bReverse) != AC_OK)
03451                     return AC_FAIL;
03452             }
03453             break;
03454             default:
03455             {
03456                 ERROR3 ("Er - I don't know what to do!");
03457                 return (AC_FAIL);
03458             }
03459             break;
03460         }
03461 
03462         // DMc
03463         // ok, if we've got either the start or the end nodes then re-init
03464         if (m_pStartNode != NULL && m_pEndNode != NULL)
03465         {
03466             NodeBlender * pBlender = NULL;
03467 
03468             switch (m_enInitType)
03469             {
03470                 case IBAT_INIT:
03471                 {
03472                     pBlender = (NodeBlender *)m_pNodeBlend->FindFirstChild(CC_RUNTIME_CLASS(NodeBlender));
03473                 }
03474                 break;
03475                 case IBAT_INITONBLENDER:
03476                 {
03477                     pBlender = m_pNodeBlender;//(NodeBlender *)m_pNodeBlend->FindFirstChild(CC_RUNTIME_CLASS(NodeBlender));
03478                 }
03479                 break;
03480                 default:
03481                 {
03482                     ERROR3 ("Er - I don't know what to do!");
03483                     return (AC_FAIL);
03484                 }
03485                 break;
03486             }
03487 
03488             if (pBlender)
03489             {
03490                 pBlender->Reinit((NodeRenderableInk *)m_pStartNode, (NodeRenderableInk *)m_pEndNode, FALSE);
03491             }
03492         }
03493 
03494         return AC_OK;
03495     }
03496     else
03497     {
03498         ERROR3("InitBlendAction::Execute() called with op that's not an undoable op");
03499         return AC_FAIL;
03500     }
03501 }

ActionCode InitBlendAction::Init UndoableOperation pOp,
ActionList pActionList,
NodeBlend pThisNodeBlend,
BOOL  StoreStartAndEndNodes = FALSE,
BOOL  bReverse = FALSE,
BOOL  bNodesMayBeChanged = FALSE
[static]
 

This is the function which creates an instance of this action. If there is no room in the undo buffer (which is determined by the base class Init function called within) the function will either return AC_NO_RECORD which means the operation can continue, but no undo information needs to be stored, or AC_OK which means the operation should continue AND record undo information. If the function returns AC_FAIL, there was not enough memory to record the undo information, and the user has decided not to continue with the operation.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
8/2/95
Parameters:
pOp = ptr to the operation to which this action belongs [INPUTS] pThisNodeBlend = ptr to blend to init. pActionList = ptr to action list to which this action should be added StoreStartAndEndNodes = Whether to store the start & end nodes or not bReverse = Whether to insert this action into the head or the tail of the action list (if FALSE it's treated normally)
- [OUTPUTS]
Returns:
ActionCode, one of AC_OK, AC_NO_RECORD or AC_FAIL
Records an action that, when executed, will Deinit() then Reinit() the blend, then invalidate its bounds.
Returns:
Errors: -
See also:
Action::Init()

Definition at line 3331 of file nodeblnd.cpp.

03333 {
03334     UINT32 ActSize = sizeof(InitBlendAction);
03335 
03336     InitBlendAction* pNewAction;
03337     ActionCode Ac = Action::Init(pOp,pActionList,ActSize,CC_RUNTIME_CLASS(InitBlendAction),(Action**)&pNewAction);
03338 
03339     NodeBlender * pBlender = (NodeBlender *)pThisNodeBlend->FindFirstChild(CC_RUNTIME_CLASS(NodeBlender));
03340 
03341     if (pNewAction)
03342         pNewAction->m_enInitType = IBAT_INIT;
03343 
03344     if (Ac != AC_FAIL && pNewAction != NULL)
03345     {
03346         pNewAction->m_pNodeBlend = pThisNodeBlend;
03347 
03348         if (StoreStartAndEndNodes && pBlender)
03349         {
03350             pNewAction->m_pStartNode = pBlender->GetNodeStart();
03351             pNewAction->m_pEndNode   = pBlender->GetNodeEnd();
03352         }
03353 
03354         pNewAction->m_bReverse = bReverse;
03355         pNewAction->m_bStoreStartAndEndNodes = StoreStartAndEndNodes;
03356         pNewAction->m_bNodesMayBeChanged = bNodesMayBeChanged;
03357 
03358         if (bReverse)
03359         {
03360             // reverse this action in the action list
03361             pActionList->RemoveItem(pNewAction);
03362             pActionList->AddHead(pNewAction);
03363         }
03364 
03365         pThisNodeBlend->InvalidateBlendBoundingRect();
03366         pThisNodeBlend->Deinit(bNodesMayBeChanged);
03367 //      if (!pOp->DoInvalidateNodeRegion(pThisNodeBlend,TRUE))
03368 //          Ac = AC_FAIL;
03369     }
03370 
03371     return Ac;
03372 }

ActionCode InitBlendAction::InitOnBlender UndoableOperation pOp,
ActionList pActionList,
NodeBlender pThisNodeBlender,
BOOL  StoreStartAndEndNodes = FALSE,
BOOL  bReverse = FALSE
[static]
 

Definition at line 3374 of file nodeblnd.cpp.

03376 {
03377     UINT32 ActSize = sizeof(InitBlendAction);
03378 
03379     InitBlendAction* pNewAction;
03380     ActionCode Ac = Action::Init(pOp,pActionList,ActSize,CC_RUNTIME_CLASS(InitBlendAction),(Action**)&pNewAction);
03381     
03382     NodeBlend* pThisNodeBlend = (NodeBlend *)pThisNodeBlender->FindParent(CC_RUNTIME_CLASS(NodeBlend));
03383 
03384     pNewAction->m_enInitType = IBAT_INITONBLENDER;
03385     pNewAction->m_pNodeBlender = pThisNodeBlender;
03386 
03387     if (Ac != AC_FAIL && pNewAction != NULL)
03388     {
03389         pNewAction->m_pNodeBlend = pThisNodeBlend;
03390 
03391         if (StoreStartAndEndNodes && pThisNodeBlender)
03392         {
03393             pNewAction->m_pStartNode = pThisNodeBlender->GetNodeStart();
03394             pNewAction->m_pEndNode   = pThisNodeBlender->GetNodeEnd();
03395         }
03396 
03397         pNewAction->m_bReverse = bReverse;
03398         pNewAction->m_bStoreStartAndEndNodes = StoreStartAndEndNodes;
03399         pNewAction->m_bNodesMayBeChanged = FALSE;
03400 
03401         if (bReverse)
03402         {
03403             // reverse this action in the action list
03404             pActionList->RemoveItem(pNewAction);
03405             pActionList->AddHead(pNewAction);
03406         }
03407 
03408         pThisNodeBlend->InvalidateBlendBoundingRect();
03409         pThisNodeBlend->Deinit();
03410 //      if (!pOp->DoInvalidateNodeRegion(pThisNodeBlend,TRUE))
03411 //          Ac = AC_FAIL;
03412     }
03413 
03414     return Ac;
03415 }


Member Data Documentation

BOOL InitBlendAction::m_bNodesMayBeChanged [protected]
 

Definition at line 424 of file nodeblnd.h.

BOOL InitBlendAction::m_bReverse [protected]
 

Definition at line 421 of file nodeblnd.h.

BOOL InitBlendAction::m_bStoreStartAndEndNodes [protected]
 

Definition at line 422 of file nodeblnd.h.

InitBlendActionType InitBlendAction::m_enInitType [protected]
 

Definition at line 423 of file nodeblnd.h.

Node* InitBlendAction::m_pEndNode [protected]
 

Definition at line 420 of file nodeblnd.h.

NodeBlend* InitBlendAction::m_pNodeBlend [protected]
 

Definition at line 417 of file nodeblnd.h.

NodeBlender* InitBlendAction::m_pNodeBlender [protected]
 

Definition at line 418 of file nodeblnd.h.

Node* InitBlendAction::m_pStartNode [protected]
 

Definition at line 419 of file nodeblnd.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:55:29 2007 for Camelot by  doxygen 1.4.4