XPFSpanRenderCallback Class Reference

#include <xpfrgn.h>

Inheritance diagram for XPFSpanRenderCallback:

RenderCallback CCObject SimpleCCObject List of all members.

Public Types

enum  RenderStateType { RS_BEFORESPAN = 0, RS_INSPAN, RS_AFTERSPAN }

Public Member Functions

 XPFSpanRenderCallback (Node *pFirst, Node *pLast, BOOL bBackground)
virtual BOOL BeforeNode (RenderRegion *pRegion, Node *pNode)
virtual BOOL BeforeSubtree (RenderRegion *pRegion, Node *pNode, Node **ppNextNode, BOOL bClip, SubtreeRenderState *pState)
virtual BOOL AfterSubtree (RenderRegion *pRegion, Node *pNode)

Protected Attributes

Nodem_pFirstNode
Nodem_pLastNode
BOOL m_bBackground
RenderStateType m_RenderState

Detailed Description

Definition at line 306 of file xpfrgn.h.


Member Enumeration Documentation

enum XPFSpanRenderCallback::RenderStateType
 

Enumerator:
RS_BEFORESPAN 
RS_INSPAN 
RS_AFTERSPAN 

Definition at line 309 of file xpfrgn.h.

00310     {
00311         RS_BEFORESPAN = 0,
00312         RS_INSPAN,
00313         RS_AFTERSPAN,
00314     } RenderStateType;


Constructor & Destructor Documentation

XPFSpanRenderCallback::XPFSpanRenderCallback Node pFirst,
Node pLast,
BOOL  bBackground
[inline]
 

Definition at line 316 of file xpfrgn.h.

00317     {
00318         m_pFirstNode = pFirst;
00319         m_pLastNode = pLast;
00320         m_bBackground = bBackground;
00321         m_RenderState = RS_BEFORESPAN;
00322     }


Member Function Documentation

BOOL XPFSpanRenderCallback::AfterSubtree RenderRegion pRegion,
Node pNode
[virtual]
 

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/06/2006
Parameters:
pRegion - pointer to a RenderRegion [INPUTS] pNode - pointer to a Node
Returns:
TRUE if ok, FALSE if bother

Reimplemented from RenderCallback.

Definition at line 3052 of file xpfrgn.cpp.

03053 {
03054 //  char* pStateStr = (m_RenderState == RS_INSPAN) ? "in" : (m_RenderState == RS_AFTERSPAN) ? "after" : "before";
03055 //  TRACE( _T("XPFSpanRC# AfterSubtree    0x%08x - %s  %s\n"), pNode, pNode->GetRuntimeClass()->m_lpszClassName, pStateStr);
03056 
03057     // By default we do want RenderAfterSubtree to be called
03058     BOOL bStopRender = FALSE;
03059     switch (m_RenderState)
03060     {
03061         case RS_BEFORESPAN:
03062             if (!m_bBackground && !pNode->IsNodeInSubtree(m_pFirstNode))
03063             {
03064                 // The first node isn't in this subtree so don't bother rendering it
03065                 bStopRender = TRUE;
03066             }
03067             break;
03068 
03069         case RS_INSPAN:
03070             if (pNode == m_pLastNode)
03071             {
03072 //              TRACE( _T("XPFSpanRC# End of span\n"));
03073                 // Change state to be after the span
03074                 m_RenderState = RS_AFTERSPAN;
03075             }
03076             break;
03077         
03078         case RS_AFTERSPAN:
03079             // Must skip everything until the end
03080             bStopRender = TRUE;
03081             break;
03082 
03083         default:
03084             TRACE( _T("XPFSpanRC# Bad RenderState in AfterSubtree\n"));
03085             break;
03086     }           
03087 //  TRACE( _T("XPFSpanRC# AfterSubtree  0x%08x - %s returning %s\n", pNode, pNode->GetRuntimeClass()->m_lpszClassName, bStopRender ? "true" : "false"));
03088     return(bStopRender);
03089 }

BOOL XPFSpanRenderCallback::BeforeNode RenderRegion pRegion,
Node pNode
[virtual]
 

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/06/2006
Parameters:
pRegion - pointer to a RenderRegion [INPUTS] pNode - pointer to a Node
Returns:
TRUE if ok, FALSE if bother

Reimplemented from RenderCallback.

Definition at line 2946 of file xpfrgn.cpp.

02947 {
02948 //  char* pStateStr = (m_RenderState == RS_INSPAN) ? "in" : (m_RenderState == RS_AFTERSPAN) ? "after" : "before";
02949 //  TRACE( _T("XPFSpanRC# BeforeNode    0x%08x - %s  %s\n"), pNode, pNode->GetRuntimeClass()->m_lpszClassName, pStateStr);
02950     
02951     BOOL bRender = FALSE;
02952     switch (m_RenderState)
02953     {
02954         case RS_BEFORESPAN:
02955             if (m_bBackground || pNode->IsAnAttribute() || pNode->IsANodeClipView())
02956             {
02957                 // Let it render normally
02958                 bRender = TRUE;
02959             }
02960             break;
02961 
02962         case RS_INSPAN:
02963             bRender = TRUE;
02964             break;
02965         
02966         case RS_AFTERSPAN:
02967             // Must skip everything until the end
02968             bRender = FALSE;
02969             break;
02970 
02971         default:
02972             TRACE( _T("XPFSpanRC# Bad RenderState in BeforeNode\n"));
02973             break;
02974     }           
02975 
02976 //  TRACE( _T("XPFSpanRC# BeforeNode    0x%08x - %s returning %s\n", pNode, pNode->GetRuntimeClass()->m_lpszClassName, bRender ? "true" : "false"));
02977     return(bRender);
02978 }

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

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/06/2006
Parameters:
pRegion - pointer to a RenderRegion [INPUTS] pNode - pointer to a Node ppNextNode - pointer to a pointer to a Node bClip - pState - pointer to a SubtreeRenderState
Returns:
TRUE if ok, FALSE if bother

Reimplemented from RenderCallback.

Definition at line 2998 of file xpfrgn.cpp.

02999 {
03000 //  char* pStateStr = (m_RenderState == RS_INSPAN) ? "in" : (m_RenderState == RS_AFTERSPAN) ? "after" : "before";
03001 //  TRACE( _T("XPFSpanRC# BeforeSubtree 0x%08x - %s  %s\n"), pNode, pNode->GetRuntimeClass()->m_lpszClassName, pStateStr);
03002 
03003     switch (m_RenderState)
03004     {
03005         case RS_BEFORESPAN:
03006             if (pNode == m_pFirstNode)
03007             {
03008 //              TRACE( _T("XPFSpanRC# Start of span\n"));
03009                 // Change state to be in the span
03010                 m_RenderState = RS_INSPAN;
03011             }
03012             else if (!pNode->IsAnAttribute() && !m_bBackground && !pNode->IsNodeInSubtree(m_pFirstNode))
03013             {
03014                 // The first node isn't in this subtree so don't bother rendering it
03015                 *pState = SUBTREE_NORENDER;
03016                 return(TRUE);
03017             }
03018             break;
03019 
03020         case RS_INSPAN:
03021             break;
03022 
03023         case RS_AFTERSPAN:
03024             // Don't render this subtree
03025             *pState = SUBTREE_NORENDER;
03026             return(TRUE);
03027             break;
03028 
03029         default:
03030             TRACE( _T("XPFSpanRC# Bad RenderState in BeforeSubtree\n"));
03031             break;
03032     }           
03033     
03034     return(FALSE);
03035 }


Member Data Documentation

BOOL XPFSpanRenderCallback::m_bBackground [protected]
 

Definition at line 331 of file xpfrgn.h.

Node* XPFSpanRenderCallback::m_pFirstNode [protected]
 

Definition at line 329 of file xpfrgn.h.

Node* XPFSpanRenderCallback::m_pLastNode [protected]
 

Definition at line 330 of file xpfrgn.h.

RenderStateType XPFSpanRenderCallback::m_RenderState [protected]
 

Definition at line 332 of file xpfrgn.h.


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