PendingRedraws Class Reference

Encapsulates a set of regions in a DocView, which must be accumulated in order for them to be redrawn at some point, possibly all in one go. This class chooses the most efficient invalidation method, according to the number and nature of regions added. More...

#include <docview.h>

Inheritance diagram for PendingRedraws:

List CCObject SimpleCCObject List of all members.

Public Member Functions

 PendingRedraws ()
 Initialise a PendingRedraws object.
 ~PendingRedraws ()
 Destroys a PendingRedraws object.
BOOL AddInvalidRegion (Spread *, DocRect, Node *pInvalidNode)
 Add another invalid region to the specified Spread's collection.
void FlushRedraw (DocView *)
 Cause all pending update regions on all spreads for this DocView to be updated immediately.
void HandleNodeDeletion (Node *pNode)
 Cause all pending update regions on all spreads for this DocView to be updated immediately.

Private Member Functions

 CC_DECLARE_MEMDUMP (PendingRedraws)

Detailed Description

Encapsulates a set of regions in a DocView, which must be accumulated in order for them to be redrawn at some point, possibly all in one go. This class chooses the most efficient invalidation method, according to the number and nature of regions added.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/12/94
See also:
SpreadRedraws

Definition at line 174 of file docview.h.


Constructor & Destructor Documentation

PendingRedraws::PendingRedraws  ) 
 

Initialise a PendingRedraws object.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/12/94
See also:
SpreadRedraws; PendingRedraws

Definition at line 538 of file docview.cpp.

00539 {
00540 }

PendingRedraws::~PendingRedraws  ) 
 

Destroys a PendingRedraws object.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/12/94
See also:
SpreadRedraws; PendingRedraws

Definition at line 554 of file docview.cpp.

00555 {
00556     DeleteAll();
00557 }


Member Function Documentation

BOOL PendingRedraws::AddInvalidRegion Spread pSpread,
DocRect  Rect,
Node pInvalidNode
 

Add another invalid region to the specified Spread's collection.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/12/94
Parameters:
pSpread - the spread on which the invalid region is located. [INPUTS] Rect - the invalid region (in document co-ordinates)
Returns:
TRUE if added ok; FALSE if not

Errors: Out of memory => ERROR1

See also:
SpreadRedraws; PendingRedraws

Definition at line 576 of file docview.cpp.

00577 {
00578     // Look for this spread in our list
00579     SpreadRedraws *pItem = (SpreadRedraws *) GetHead();
00580 
00581     while ((pItem != NULL) && (pItem->GetSpread() != pSpread))
00582     {
00583         // Nope - try next item
00584         pItem = (SpreadRedraws *) GetNext(pItem);
00585     }
00586 
00587     if (pItem == NULL)
00588     {
00589         // No entry for the spread - we'd better make one
00590         pItem = new SpreadRedraws(pSpread);
00591 
00592         // Did it work?
00593         if (pItem == NULL)
00594             return FALSE;
00595 
00596         // Yes - add to the list
00597         AddTail(pItem);
00598     }
00599 
00600     // Got an an entry for this spread - add the region
00601     pItem->AddInvalidRegion(Rect, pInvalidNode);
00602 
00603     // All ok
00604     return TRUE;
00605 }

PendingRedraws::CC_DECLARE_MEMDUMP PendingRedraws   )  [private]
 

void PendingRedraws::FlushRedraw DocView pDocView  ) 
 

Cause all pending update regions on all spreads for this DocView to be updated immediately.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/12/94
Parameters:
pDocView - the DocView to invalidate. [INPUTS]
See also:
SpreadRedraws; PendingRedraws

Definition at line 620 of file docview.cpp.

00621 {
00622     // Invalidate the regions on each spread...
00623     SpreadRedraws *pItem = (SpreadRedraws *) GetHead();
00624 
00625     while (pItem != NULL)
00626     {
00627         // Invalid the regions on this spread, and delete this item
00628         pItem->FlushRedraw(pDocView);
00629         delete RemoveItem(pItem);
00630 
00631         // Now try the next item...
00632         pItem = (SpreadRedraws *) GetHead();
00633     }
00634 }

void PendingRedraws::HandleNodeDeletion Node pNode  ) 
 

Cause all pending update regions on all spreads for this DocView to be updated immediately.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/12/94
Parameters:
pDocView - the DocView to invalidate. [INPUTS]
See also:
SpreadRedraws; PendingRedraws

Definition at line 650 of file docview.cpp.

00651 {
00652     // Invalidate the regions on each spread...
00653     SpreadRedraws *pItem = (SpreadRedraws *) GetHead();
00654 
00655     while (pItem != NULL)
00656     {
00657         pItem->ClearBackmostChangedNode(pNode);
00658 
00659         // Now try the next item...
00660         pItem = (SpreadRedraws *) this->GetNext(pItem);
00661     }
00662 }


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