#include <ops.h>
Inheritance diagram for InvalidateRegionAction:
Public Member Functions | |
InvalidateRegionAction () | |
InvalidateRegionAction 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. | |
Protected Attributes | |
Range | NodeRange |
BOOL | IncludeBlobs:1 |
Spread * | pSpread |
Definition at line 763 of file ops.h.
|
InvalidateRegionAction constructor.
Definition at line 2742 of file ops.cpp.
|
|
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.
Reimplemented from Action. Reimplemented in InvalidateRegionIfBgRedrawAction. Definition at line 2766 of file ops.cpp. 02767 { 02768 InvalidateRegionAction* InvRgnAct; 02769 ActionCode ActCode; 02770 // Attempt to initialise the action 02771 if ((ActCode = InvalidateRegionAction::Init(pOperation, 02772 pOppositeActLst, 02773 NodeRange, 02774 pSpread, 02775 IncludeBlobs, 02776 (Action**)(&InvRgnAct))) != AC_FAIL) 02777 02778 02779 { 02780 // The action was successfully initialised 02781 02782 // Invalidate each nodes bounds 02783 02784 Document* pDocument = pOperation->GetWorkingDoc(); 02785 ENSURE(pDocument != 0, "There was no current document in InvalidateRegionAction" ); 02786 02787 if (pDocument != NULL) 02788 { 02789 BOOL bOldPTP = NodeRange.SetPromoteToParent(TRUE); 02790 NodeRenderableInk* CurrentNode = (NodeRenderableInk*)NodeRange.FindFirst(); 02791 02792 DocRect InvalidRgn; 02793 02794 while (CurrentNode != NULL) 02795 { 02796 if (CurrentNode->IsAnObject() || CurrentNode->IsPaper()) 02797 { 02798 // Find the region to invalidate 02799 InvalidRgn = (IncludeBlobs ? 02800 (((NodeRenderableInk*)CurrentNode)->GetUnionBlobBoundingRect()): 02801 (((NodeRenderableInk*)CurrentNode)->GetBoundingRect()) 02802 ); 02803 02804 pDocument->ForceRedraw(pSpread, InvalidRgn, TRUE, CurrentNode); 02805 } 02806 CurrentNode = (NodeRenderableInk*)NodeRange.FindNext(CurrentNode); 02807 } 02808 02809 NodeRange.SetPromoteToParent(bOldPTP); 02810 } 02811 02812 } 02813 return ActCode; 02814 }
|
|
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.
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.
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.
Reimplemented in InvalidateRegionIfBgRedrawAction. Definition at line 2865 of file ops.cpp. 02871 { 02872 ActionCode Ac = (Action::Init(pOp, 02873 pActionList, 02874 sizeof(InvalidateRegionAction), 02875 CC_RUNTIME_CLASS(InvalidateRegionAction), 02876 NewAction)); 02877 if (*NewAction != NULL) 02878 { 02879 ((InvalidateRegionAction*)(*NewAction))->NodeRange = nodeRange; 02880 ((InvalidateRegionAction*)(*NewAction))->IncludeBlobs = includeBlobs; 02881 ((InvalidateRegionAction*)(*NewAction))->pSpread = pSpread; 02882 } 02883 return (Ac); 02884 }
|
|
|
|
|
|
|