OptimalPrintRenderCallback Class Reference

Inheritance diagram for OptimalPrintRenderCallback:

RenderCallback CCObject SimpleCCObject List of all members.

Public Member Functions

 OptimalPrintRenderCallback (View *pView, Spread *pSpread, BOOL bRenderAll, ScanningRenderRegion *pScanRR, BOOL bPrintPaper, INT32 *pNodesSoFar, ProgressDisplay *pProgress, BOOL bCount)
virtual BOOL BeforeNode (RenderRegion *pRegion, Node *pNode)
virtual BOOL BeforeSubtree (RenderRegion *pRegion, Node *pNode, Node **ppNextNode, BOOL bClip, SubtreeRenderState *pState)
BOOL FinishRendering (RenderRegion *pRegion)

Protected Member Functions

BOOL RenderLastComplexSpan (RenderRegion *pRegion, Node *pNextSpanStart)

Private Attributes

Viewm_pView
Spreadm_pSpread
BOOL m_bRenderAll
ScanningRenderRegionm_pScanRR
BOOL m_bPrintPaper
INT32 * m_pNodesSoFar
ProgressDisplaym_pProgress
Nodem_pNextAction
Nodem_pComplexStart
BOOL m_bNextComplex
BOOL m_bDoingComplex
BOOL m_bCount
INT32 m_ComplexCount
DocRect m_SpanBoundsRect
DocRect m_NextBoundsRect

Detailed Description

Definition at line 2327 of file view.cpp.


Constructor & Destructor Documentation

OptimalPrintRenderCallback::OptimalPrintRenderCallback View pView,
Spread pSpread,
BOOL  bRenderAll,
ScanningRenderRegion pScanRR,
BOOL  bPrintPaper,
INT32 *  pNodesSoFar,
ProgressDisplay pProgress,
BOOL  bCount
[inline]
 

Definition at line 2330 of file view.cpp.

02332     {
02333         m_pView = pView;
02334         m_bRenderAll = bRenderAll;
02335         m_pScanRR = pScanRR;
02336         m_bPrintPaper = bPrintPaper;
02337         m_pNextAction = m_pScanRR->FindFirstFromList();
02338         m_bNextComplex = m_pScanRR->IsThisNodeComplex();
02339         m_NextBoundsRect = m_pScanRR->GetSpanBounds();
02340         m_bDoingComplex = FALSE;
02341         m_pSpread = pSpread;
02342         m_pNodesSoFar = pNodesSoFar;
02343         m_pProgress = pProgress;
02344         m_bCount = bCount;
02345         m_ComplexCount = 0;
02346     }


Member Function Documentation

virtual BOOL OptimalPrintRenderCallback::BeforeNode RenderRegion pRegion,
Node pNode
[inline, virtual]
 

Reimplemented from RenderCallback.

Definition at line 2348 of file view.cpp.

02349     {
02350         BOOL bRender = (!m_bDoingComplex || (pNode->IsAnAttribute() || pNode->IsANodeClipView())) &&
02351                         (m_bRenderAll || m_pView->IsPrintableNodeSelected(pNode));
02352 //      TRACE( _T("OPRC# BeforeNode    0x%08x - %s  returning %s\n", pNode, pNode->GetRuntimeClass()->GetClassName(), bRender ? "true" : "false"));
02353 
02354         if (!m_bCount && m_bDoingComplex)
02355             m_ComplexCount++;
02356         else if (m_pNodesSoFar)
02357             (*m_pNodesSoFar)++;
02358 
02359         if (m_bCount)
02360             return(FALSE);
02361 
02362         if (m_pProgress)
02363         {
02364             if (!m_pProgress->SetNodesRendered(*m_pNodesSoFar))
02365             {
02366                 TRACE( _T("*****************************\n"));
02367                 TRACE( _T("************ User aborted job\n"));
02368                 TRACE( _T("*****************************\n"));
02369             }
02370         }
02371 
02372         return(bRender);
02373     }

virtual BOOL OptimalPrintRenderCallback::BeforeSubtree RenderRegion pRegion,
Node pNode,
Node **  ppNextNode,
BOOL  bClip,
SubtreeRenderState pState
[inline, virtual]
 

Reimplemented from RenderCallback.

Definition at line 2375 of file view.cpp.

02377     {
02378 //      TRACE( _T("OPRC# BeforeSubtree 0x%08x - %s\n"), pNode, pNode->GetRuntimeClass()->GetClassName());
02379 
02380         if (!m_bCount && pNode == m_pNextAction)
02381         {
02382             BOOL bIsComplex = m_bNextComplex;
02383             TRACEUSER("noone", _T("OPRC# BeforeSubtree 0x%08x - %s\n"), pNode, pNode->GetRuntimeClass()->GetClassName());
02384             TRACEUSER("noone", _T("Hit Start of %s span\n"), bIsComplex ? _T("complex") : _T("simple") );
02385             // If we have been doing a complex span then we need to render it now
02386             if (m_bDoingComplex)
02387             {
02388                 TRACEUSER("noone", _T("Try to render the last complex span NumNodes = %d\n"), m_ComplexCount);
02389                 RenderLastComplexSpan(pRegion, pNode);
02390             }
02391             
02392             m_SpanBoundsRect = m_NextBoundsRect;
02393             m_pNextAction = m_pScanRR->FindNextFromList();
02394             m_bNextComplex = m_pScanRR->IsThisNodeComplex();
02395             m_NextBoundsRect = m_pScanRR->GetSpanBounds();
02396             TRACEUSER("noone", _T("NextBounds = (%d, %d) - (%d, %d)\n"), m_NextBoundsRect.lo.x, m_NextBoundsRect.lo.y, 
02397                 m_NextBoundsRect.hi.x, m_NextBoundsRect.hi.y );
02398             TRACEUSER("noone", _T("NextAction is %s 0x%08x - %s\n"), m_bNextComplex ? _T("complex") : _T("simple"), m_pNextAction, 
02399                 m_pNextAction ? m_pNextAction->GetRuntimeClass()->GetClassName() : _T("") );
02400             m_ComplexCount = 0;
02401             m_pComplexStart = bIsComplex ? pNode : NULL;
02402             m_bDoingComplex = bIsComplex;
02403         }
02404         
02405         return(FALSE);
02406     }

BOOL OptimalPrintRenderCallback::FinishRendering RenderRegion pRegion  )  [inline]
 

Definition at line 2410 of file view.cpp.

02411     {
02412         if (!m_bCount && m_bDoingComplex)
02413         {
02414             RenderLastComplexSpan(pRegion, NULL);
02415         }
02416 
02417         return true; 
02418     }

BOOL OptimalPrintRenderCallback::RenderLastComplexSpan RenderRegion pRegion,
Node pNextSpanStart
[inline, protected]
 

Definition at line 2421 of file view.cpp.

02422     {
02423         // Call RenderOptimalBitmapPhase to handle this
02424         SlowJobResult BitmapResult;
02425         DocRect ClipRect = pRegion->GetClipRect();
02426         ClipRect = ClipRect.Intersection(m_SpanBoundsRect);
02427 //      TRACE( _T("ClipRect = (%d, %d) - (%d, %d)\n"), ClipRect.lox, ClipRect.loy, ClipRect.hix, ClipRect.hiy);
02428         if (ClipRect.IsValid() && !ClipRect.IsEmpty())
02429         {
02430             Matrix ViewTrans = pRegion->GetMatrix();
02431 //          TRACE( _T("Rendering from 0x%08x - %s\n", m_pComplexStart, m_pComplexStart?m_pComplexStart->GetRuntimeClass()->m_lpszClassName:""));
02432 //          TRACE( _T("Rendering to   0x%08x - %s\n", pNextSpanStart, pNextSpanStart?pNextSpanStart->GetRuntimeClass()->m_lpszClassName:""));
02433             BitmapResult = m_pView->RenderOptimalBitmapPhase(ClipRect, ViewTrans, m_pSpread, pRegion,
02434                                               m_pComplexStart, pNextSpanStart, m_bRenderAll,
02435                                               m_bPrintPaper, *m_pNodesSoFar, m_pProgress, m_ComplexCount);
02436         }
02437 
02438         return true; 
02439     }


Member Data Documentation

BOOL OptimalPrintRenderCallback::m_bCount [private]
 

Definition at line 2454 of file view.cpp.

BOOL OptimalPrintRenderCallback::m_bDoingComplex [private]
 

Definition at line 2453 of file view.cpp.

BOOL OptimalPrintRenderCallback::m_bNextComplex [private]
 

Definition at line 2452 of file view.cpp.

BOOL OptimalPrintRenderCallback::m_bPrintPaper [private]
 

Definition at line 2446 of file view.cpp.

BOOL OptimalPrintRenderCallback::m_bRenderAll [private]
 

Definition at line 2444 of file view.cpp.

INT32 OptimalPrintRenderCallback::m_ComplexCount [private]
 

Definition at line 2455 of file view.cpp.

DocRect OptimalPrintRenderCallback::m_NextBoundsRect [private]
 

Definition at line 2457 of file view.cpp.

Node* OptimalPrintRenderCallback::m_pComplexStart [private]
 

Definition at line 2451 of file view.cpp.

Node* OptimalPrintRenderCallback::m_pNextAction [private]
 

Definition at line 2450 of file view.cpp.

INT32* OptimalPrintRenderCallback::m_pNodesSoFar [private]
 

Definition at line 2447 of file view.cpp.

ProgressDisplay* OptimalPrintRenderCallback::m_pProgress [private]
 

Definition at line 2448 of file view.cpp.

ScanningRenderRegion* OptimalPrintRenderCallback::m_pScanRR [private]
 

Definition at line 2445 of file view.cpp.

Spread* OptimalPrintRenderCallback::m_pSpread [private]
 

Definition at line 2443 of file view.cpp.

View* OptimalPrintRenderCallback::m_pView [private]
 

Definition at line 2442 of file view.cpp.

DocRect OptimalPrintRenderCallback::m_SpanBoundsRect [private]
 

Definition at line 2456 of file view.cpp.


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