InvalidateRegionIfBgRedrawAction Class Reference

When executed this action will Force a redraw of the bounding rectangles of each node in a range. This version will only invalidate the region if Background Redraw is in progress. More...

#include <ops.h>

Inheritance diagram for InvalidateRegionIfBgRedrawAction:

InvalidateRegionAction Action ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 InvalidateRegionIfBgRedrawAction ()
 InvalidateRegionIfBgRedrawAction constructor.
virtual ActionCode Execute ()
 Executes the InvalidateRegionAction which invalidates a region which is the union of the bounding rectangles of each node in the range. When the includeBlobs flag is TRUE the region which gets invalidated includes the objects blobs.

Static Public Member Functions

static ActionCode Init (Operation *const pOp, ActionList *pActionList, Range nodeRange, Spread *pSpread, BOOL includeBlobs, Action **NewAction)
 To check that there is sufficient room for the action in the operation history, and if there is, then to add the action to the operations action list.

Detailed Description

When executed this action will Force a redraw of the bounding rectangles of each node in a range. This version will only invalidate the region if Background Redraw is in progress.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/5/95
See also:
-

Definition at line 798 of file ops.h.


Constructor & Destructor Documentation

InvalidateRegionIfBgRedrawAction::InvalidateRegionIfBgRedrawAction  ) 
 

InvalidateRegionIfBgRedrawAction constructor.

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

Errors: -

See also:
-

Definition at line 2902 of file ops.cpp.

02903 {
02904 } 


Member Function Documentation

ActionCode InvalidateRegionIfBgRedrawAction::Execute  )  [virtual]
 

Executes the InvalidateRegionAction which invalidates a region which is the union of the bounding rectangles of each node in the range. When the includeBlobs flag is TRUE the region which gets invalidated includes the objects blobs.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/5/95
Parameters:
- [INPUTS]
ActionCode indicating if the action was successfully executed or not [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Reimplemented from InvalidateRegionAction.

Definition at line 2926 of file ops.cpp.

02927 {
02928     InvalidateRegionIfBgRedrawAction* InvRgnAct;  
02929     ActionCode ActCode;  
02930     // Attempt to initialise the action    
02931     if ((ActCode = InvalidateRegionIfBgRedrawAction::Init(pOperation,                    
02932                                                           pOppositeActLst,  
02933                                                           NodeRange,
02934                                                           pSpread, 
02935                                                           IncludeBlobs, 
02936                                                           (Action**)(&InvRgnAct))) != AC_FAIL) 
02937         
02938                 
02939     {   
02940         // The action was successfully initialised   
02941 
02942         if (!GetApplication()->IsBgRendering())
02943             return AC_OK;
02944 
02945 //      GetApplication()->DeleteRenderRegions(DocView::GetSelected());
02946 //      GetApplication()->BgRendering = FALSE;
02947 
02948         // Invalidate each nodes bounds 
02949     
02950         Document* pDocument = pOperation->GetWorkingDoc();
02951         ENSURE(pDocument != 0, "There was no current document in InvalidateRegionAction" );
02952         
02953         if (pDocument != NULL)
02954         {
02955             NodeRenderableInk* CurrentNode = (NodeRenderableInk*)NodeRange.FindFirst();
02956 
02957             DocRect InvalidRgn; 
02958         
02959             while (CurrentNode != NULL)
02960             {
02961                 if (CurrentNode->IsAnObject() || CurrentNode->IsPaper())
02962                 {
02963                     // Find the region to invalidate
02964                     InvalidRgn = (IncludeBlobs ? 
02965                                     (((NodeRenderableInk*)CurrentNode)->GetUnionBlobBoundingRect()):
02966                                     (((NodeRenderableInk*)CurrentNode)->GetBoundingRect())
02967                                  ); 
02968 
02969                     pDocument->ForceRedraw(pSpread, InvalidRgn, TRUE, CurrentNode);
02970                 }
02971                 CurrentNode = (NodeRenderableInk*)NodeRange.FindNext(CurrentNode); 
02972             }
02973         }
02974 
02975     }
02976     return ActCode;
02977 }   

ActionCode InvalidateRegionIfBgRedrawAction::Init Operation *const   pOp,
ActionList pActionList,
Range  nodeRange,
Spread pSpread,
BOOL  includeBlobs,
Action **  NewAction
[static]
 

To check that there is sufficient room for the action in the operation history, and if there is, then to add the action to the operations action list.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/5/95
Parameters:
pOp,: The operation to which the action should be added [INPUTS]
pActionList: The action list in the operation object

NodeRange: The range of nodes to be invalidated

pSpread: The ranges spread

IncludeBlobs: When TRUE invalidate the blob bounding rectangles of the nodes in the range.

Parameters:
NewAction,: A pointer to the action if it could be allocated. [OUTPUTS]
Returns:
AC_FAIL: There was not enough room in the operation history for the action and the user did not wish to continue. Usually End() should be called in this situation.
AC_NORECORD: There was not enough room in the operation history for the action, but the user requested that he wished to continue without undo.

AC_OK : The action was successfully initialised and added to the operation.

The function calls the Action::Init function passing the runtime class of an InvalidateRegionAction. If successful it records the NodeTag.

Returns:
Errors: -
See also:
Action::Init

Reimplemented from InvalidateRegionAction.

Definition at line 3027 of file ops.cpp.

03033 {       
03034     ActionCode Ac = (Action::Init(pOp,
03035                                   pActionList,
03036                                   sizeof(InvalidateRegionIfBgRedrawAction), 
03037                                   CC_RUNTIME_CLASS(InvalidateRegionIfBgRedrawAction), 
03038                                   NewAction));
03039     if (*NewAction != NULL)
03040     {
03041         ((InvalidateRegionIfBgRedrawAction*)(*NewAction))->NodeRange = nodeRange;
03042         ((InvalidateRegionIfBgRedrawAction*)(*NewAction))->IncludeBlobs = includeBlobs;
03043         ((InvalidateRegionIfBgRedrawAction*)(*NewAction))->pSpread = pSpread; 
03044     }
03045     return (Ac); 
03046 } 


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