MarkEditListAction Class Reference

An action to record/restore the current state of the LiveEffect EditList. An action to record/restore the current state of the LiveEffect EditList. More...

#include <opliveeffects.h>

Inheritance diagram for MarkEditListAction:

Action ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 MarkEditListAction ()
 
  • 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. This static function makes it a little easier to use this action. It creates an instance of this action and appends it to the action list. Inserts the floating endpoint into the Line Tool, creating an undo action to remove the endpoint.

 ~MarkEditListAction ()
virtual ActionCode Execute ()
 Inserts the floating endpoint into the Line Tool, creating an undo action to remove the endpoint.

Static Public Member Functions

static ActionCode Init (Operation *pOp, ActionList *pActionList, Action **NewAction)
 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 DoMarkEditList (Operation *pOp, ActionList *pActionList, EffectsStack *pPPStack, INT32 iStackPos)
 This static function makes it a little easier to use this action. It creates an instance of this action and appends it to the action list.

Public Attributes

IXMLDOMDocumentPtr pEditList
INT32 iStackPos

Detailed Description

An action to record/restore the current state of the LiveEffect EditList. An action to record/restore the current state of the LiveEffect EditList.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/09/2004
See also:

Definition at line 706 of file opliveeffects.h.


Constructor & Destructor Documentation

MarkEditListAction::MarkEditListAction  ) 
 

  • 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. This static function makes it a little easier to use this action. It creates an instance of this action and appends it to the action list. Inserts the floating endpoint into the Line Tool, creating an undo action to remove the endpoint.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/09/2004
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 4607 of file opliveeffects.cpp.

04608 {
04609     pEditList = NULL;
04610     iStackPos = -1;
04611 }

MarkEditListAction::~MarkEditListAction  ) 
 

Definition at line 4770 of file opliveeffects.cpp.

04771 {
04772     pEditList = NULL;
04773 }


Member Function Documentation

ActionCode MarkEditListAction::DoMarkEditList Operation pOp,
ActionList pActionList,
EffectsStack pPPStack,
INT32  iStackPos
[static]
 

This static function makes it a little easier to use this action. It creates an instance of this action and appends it to the action list.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/09/2004
Parameters:
pOp is the currently running operation [INPUTS] pActionList is a pointer ot the action list to which the action should be appended pTool is a pointer to the Line tool.
- [OUTPUTS]
Returns:
Action code which indicates success or failure to create the action

Errors: -

See also:
RemoveFloaterAction::DoRemove

Definition at line 4672 of file opliveeffects.cpp.

04677 {
04678     ERROR2IF(iStackPos<0, AC_FAIL, "Bad stack pos in DoMarkEditList");
04679 
04680     MarkEditListAction* RecAction = NULL;
04681     ActionCode Act = MarkEditListAction::Init(pOp, pActionList, (Action**)&RecAction);
04682     if ( (Act == AC_OK) && (RecAction != NULL) )
04683     {
04684         PPStackLevel* pLevel = (PPStackLevel*)pPPStack->FindItem(iStackPos);
04685         if (pLevel && pLevel->pPPNode && pLevel->pPPNode->IsBitmapEffect())
04686         {
04687             RecAction->pEditList = CXMLUtils::NewDocument(((NodeBitmapEffect*)pLevel->pPPNode)->GetEditList());
04688             RecAction->iStackPos = iStackPos;
04689         }
04690         else
04691             return AC_FAIL;
04692     }
04693     return Act;
04694 }

ActionCode MarkEditListAction::Execute  )  [virtual]
 

Inserts the floating endpoint into the Line Tool, creating an undo action to remove the endpoint.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/09/2004
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
ActionCode, either AC_OK, AC_NORECORD or AC_FAIL

Errors: -

See also:
RemoveFloaterAction::Execute

Reimplemented from Action.

Definition at line 4713 of file opliveeffects.cpp.

04714 {
04715     ERROR2IF(this->iStackPos<0, AC_FAIL, "Bad stack pos in MarkEditListAction::Execute");
04716 
04717     MarkEditListAction* ReAction = NULL;
04718     ActionCode Act = AC_FAIL;
04719     
04720     // Create a redo action for this action, which is another MarkEditListAction
04721     Act = MarkEditListAction::Init(pOperation, 
04722                                     pOppositeActLst, 
04723                                     (Action**)(&ReAction));
04724     if (Act == AC_FAIL)
04725         return AC_FAIL;
04726 
04727     // ---------------------------------------------------
04728     // Record the current edit list in the Action?
04729     EffectsStack* pPPStack = EffectsStack::GetEffectsStackFromSelection();
04730     if (pPPStack==NULL)
04731         return AC_FAIL;
04732 
04733     PPStackLevel* pLevel = (PPStackLevel*)pPPStack->FindItem(this->iStackPos);
04734     if (pLevel && pLevel->pPPNode && pLevel->pPPNode->IsBitmapEffect())
04735     {
04736         ReAction->pEditList = CXMLUtils::NewDocument(((NodeBitmapEffect*)pLevel->pPPNode)->GetEditList());
04737         ReAction->iStackPos = this->iStackPos;
04738     }
04739     else
04740     {
04741         ReAction->pEditList = CXMLUtils::NewDocument(this->pEditList);
04742         ReAction->iStackPos = this->iStackPos;
04743     }
04744 
04745     // ---------------------------------------------------
04746     // Now do the actual action
04747     // Run through the selection, setting edit lists on LiveEffects
04748     Node* pNode = NULL;
04749     if (pLevel) pNode = pLevel->listSelNodes.FindFirst();
04750     while (pNode)
04751     {
04752         if (pNode->IsBitmapEffect())
04753         {
04754             NodeBitmapEffect* pLE = (NodeBitmapEffect*)pNode;
04755             pLE->SetProcessedBitmap(NULL, NULL, DocRect(), 0, 0, 0, 0);         // Remove cached bitmap to be sure
04756             pLE->SetEditList(CXMLUtils::NewDocument(this->pEditList));
04757         }
04758         else
04759             return AC_FAIL;
04760         
04761         pNode = pLevel->listSelNodes.FindNext(pNode);
04762     }
04763 
04764     delete pPPStack;
04765     pPPStack = NULL;
04766 
04767     return Act;
04768 }

ActionCode MarkEditListAction::Init Operation pOp,
ActionList pActionList,
Action **  NewAction
[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:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/09/2004
Parameters:
pOp is the pointer to the operation to which this action belongs [INPUTS] pTool is pActionList is the action list to which this action should be added
NewAction is a pointer to a pointer to an action, allowing the function to [OUTPUTS] return a pointer to the created action
Returns:
ActionCode, one of AC_OK, AC_NO_RECORD or AC_FAIL

Errors: -

See also:
Action::Init()

Definition at line 4639 of file opliveeffects.cpp.

04642 {
04643     UINT32 ActSize = sizeof(MarkEditListAction);
04644 
04645     ActionCode Ac = Action::Init( pOp, pActionList, ActSize, CC_RUNTIME_CLASS(MarkEditListAction), NewAction);
04646 
04647     return Ac;
04648 }


Member Data Documentation

INT32 MarkEditListAction::iStackPos
 

Definition at line 725 of file opliveeffects.h.

IXMLDOMDocumentPtr MarkEditListAction::pEditList
 

Definition at line 724 of file opliveeffects.h.


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