FlashRenderCallback Class Reference

Handling callbacks from RenderTree Notes: RenderTree function calls the main function in this class when it's about to render any Node. More...

#include <swffiltr.h>

Inheritance diagram for FlashRenderCallback:

RenderCallback CCObject SimpleCCObject List of all members.

Public Member Functions

 FlashRenderCallback (FlashFilter *pFilter, FlashRenderRegion *pFRR, BOOL bVisibleLayersOnly, BOOL bSelectedOnly, Node *pBackgroundNode)
virtual BOOL BeforeNode (RenderRegion *pRegion, Node *pNode)
 Handle the callback from RenderTree that has been requested by Filter.
virtual BOOL BeforeSubtree (RenderRegion *pRegion, Node *pNode, Node **ppNextNode, BOOL bClip, SubtreeRenderState *pState)
 Handle the callback from RenderTree that has been requested by Filter.

Private Attributes

FlashFilterm_pFilter
FlashRenderRegionm_pFRR
Nodem_pBackgroundNode
BOOL m_bVisibleLayersOnly
BOOL m_bSelectedOnly

Detailed Description

Handling callbacks from RenderTree Notes: RenderTree function calls the main function in this class when it's about to render any Node.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
01/12/2004

Definition at line 186 of file swffiltr.h.


Constructor & Destructor Documentation

FlashRenderCallback::FlashRenderCallback FlashFilter pFilter,
FlashRenderRegion pFRR,
BOOL  bVisibleLayersOnly,
BOOL  bSelectedOnly,
Node pBackgroundNode
[inline]
 

Definition at line 189 of file swffiltr.h.

00190     {
00191         m_pFilter = pFilter;
00192         m_pFRR = pFRR;
00193         m_bVisibleLayersOnly = bVisibleLayersOnly;
00194         m_bSelectedOnly = bSelectedOnly;
00195         m_pBackgroundNode = pBackgroundNode;
00196     }


Member Function Documentation

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

Handle the callback from RenderTree that has been requested by Filter.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
01/12/2004
Parameters:
pNode - pointer to node about to be rendered by RenderTree [INPUTS] pRender - pointer to RenderRegion running RenderTree loop
- [OUTPUTS]
Returns:
TRUE if node can be rendered FALSE if not

Reimplemented from RenderCallback.

Definition at line 576 of file swffiltr.cpp.

00577 {
00578     // If this is the background node, ignore it
00579     if (m_pBackgroundNode != NULL && pNode == m_pBackgroundNode)
00580         return FALSE;
00581 
00582     // Declare variables.
00583     LayerState  ThisLayer = m_pFilter->GetButtonState(pNode);
00584     String_256  ButtonName;
00585 
00586     // Set the layer state.
00587     m_pFRR->SetLayerState(ThisLayer);
00588 
00589     // Get the layer ID, so that we can tell if it's a button or not.
00590     if (ThisLayer != NO_BUTTON && m_pFilter->GetButtonName(pNode, ButtonName))
00591     {
00592         // The name has been successfully extracted, and is passed into the render
00593         // region.
00594         m_pFRR->SetButtonName((TCHAR*)ButtonName);
00595     }
00596     else
00597     {
00598         // A NULL pointer in this function instructs the RenderRegion to treat the
00599         // next node as an ordinary shape, rather than a button.
00600         m_pFRR->SetButtonName(NULL);
00601     }
00602 
00603     // Update the progress display
00604     if (pNode->IsNodeRenderableClass())
00605         m_pFilter->UpdateFilterProgress(((NodeRenderable*)pNode)->GetSizeOfExport(m_pFilter));
00606     else
00607         m_pFilter->UpdateFilterProgress(0);             // For back compatibility with previous version of this code
00608 
00609     // Render (export) the node that we have, using special export rendering if it exists.
00610     BOOL bExportRendered = pNode->ExportRender(pRegion);
00611 
00612     return (!bExportRendered);                      // If not exported let RenderTree do it, return TRUE
00613 }

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

Handle the callback from RenderTree that has been requested by Filter.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/11/2004
Parameters:
pNode - pointer to node about to be rendered by RenderTree [INPUTS] pRender - pointer to RenderRegion running RenderTree loop
pNextNode - pointer to node where navigation should continue [OUTPUTS] State - Navigation state for RenderTree state machine
Returns:
TRUE if we've returned a valid SubRenderState FALSE if not

Reimplemented from RenderCallback.

Definition at line 636 of file swffiltr.cpp.

00641 {
00642     // We're not counting so let normal, smart navigation take place
00643     if (pNode->NeedsToExport(pRegion, m_bVisibleLayersOnly, m_bSelectedOnly))
00644     {
00645         // This node does need to be exported
00646         // Tell the node at the root of the subtree that we're about to export it and it's children
00647         pNode->PreExportRender(pRegion);
00648         return FALSE;                       // Tell RenderTree we want normal navigation to take place
00649     }
00650     else
00651     {
00652         *pState = SUBTREE_NORENDER;         // Tell RenderTree we want to forcibly skip this node
00653         return TRUE;
00654     }
00655 }


Member Data Documentation

BOOL FlashRenderCallback::m_bSelectedOnly [private]
 

Definition at line 210 of file swffiltr.h.

BOOL FlashRenderCallback::m_bVisibleLayersOnly [private]
 

Definition at line 209 of file swffiltr.h.

Node* FlashRenderCallback::m_pBackgroundNode [private]
 

Definition at line 208 of file swffiltr.h.

FlashFilter* FlashRenderCallback::m_pFilter [private]
 

Definition at line 206 of file swffiltr.h.

FlashRenderRegion* FlashRenderCallback::m_pFRR [private]
 

Definition at line 207 of file swffiltr.h.


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