rndrgn.h

Go to the documentation of this file.
00001 // $Id: rndrgn.h 1445 2006-07-14 20:15:02Z phil $
00002 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
00003 ================================XARAHEADERSTART===========================
00004  
00005                Xara LX, a vector drawing and manipulation program.
00006                     Copyright (C) 1993-2006 Xara Group Ltd.
00007        Copyright on certain contributions may be held in joint with their
00008               respective authors. See AUTHORS file for details.
00009 
00010 LICENSE TO USE AND MODIFY SOFTWARE
00011 ----------------------------------
00012 
00013 This file is part of Xara LX.
00014 
00015 Xara LX is free software; you can redistribute it and/or modify it
00016 under the terms of the GNU General Public License version 2 as published
00017 by the Free Software Foundation.
00018 
00019 Xara LX and its component source files are distributed in the hope
00020 that it will be useful, but WITHOUT ANY WARRANTY; without even the
00021 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00022 See the GNU General Public License for more details.
00023 
00024 You should have received a copy of the GNU General Public License along
00025 with Xara LX (see the file GPL in the root directory of the
00026 distribution); if not, write to the Free Software Foundation, Inc., 51
00027 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00028 
00029 
00030 ADDITIONAL RIGHTS
00031 -----------------
00032 
00033 Conditional upon your continuing compliance with the GNU General Public
00034 License described above, Xara Group Ltd grants to you certain additional
00035 rights. 
00036 
00037 The additional rights are to use, modify, and distribute the software
00038 together with the wxWidgets library, the wxXtra library, and the "CDraw"
00039 library and any other such library that any version of Xara LX relased
00040 by Xara Group Ltd requires in order to compile and execute, including
00041 the static linking of that library to XaraLX. In the case of the
00042 "CDraw" library, you may satisfy obligation under the GNU General Public
00043 License to provide source code by providing a binary copy of the library
00044 concerned and a copy of the license accompanying it.
00045 
00046 Nothing in this section restricts any of the rights you have under
00047 the GNU General Public License.
00048 
00049 
00050 SCOPE OF LICENSE
00051 ----------------
00052 
00053 This license applies to this program (XaraLX) and its constituent source
00054 files only, and does not necessarily apply to other Xara products which may
00055 in part share the same code base, and are subject to their own licensing
00056 terms.
00057 
00058 This license does not apply to files in the wxXtra directory, which
00059 are built into a separate library, and are subject to the wxWindows
00060 license contained within that directory in the file "WXXTRA-LICENSE".
00061 
00062 This license does not apply to the binary libraries (if any) within
00063 the "libs" directory, which are subject to a separate license contained
00064 within that directory in the file "LIBS-LICENSE".
00065 
00066 
00067 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS
00068 ----------------------------------------------
00069 
00070 Subject to the terms of the GNU Public License (see above), you are
00071 free to do whatever you like with your modifications. However, you may
00072 (at your option) wish contribute them to Xara's source tree. You can
00073 find details of how to do this at:
00074   http://www.xaraxtreme.org/developers/
00075 
00076 Prior to contributing your modifications, you will need to complete our
00077 contributor agreement. This can be found at:
00078   http://www.xaraxtreme.org/developers/contribute/
00079 
00080 Please note that Xara will not accept modifications which modify any of
00081 the text between the start and end of this header (marked
00082 XARAHEADERSTART and XARAHEADEREND).
00083 
00084 
00085 MARKS
00086 -----
00087 
00088 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
00089 designs are registered or unregistered trademarks, design-marks, and/or
00090 service marks of Xara Group Ltd. All rights in these marks are reserved.
00091 
00092 
00093       Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK.
00094                         http://www.xara.com/
00095 
00096 =================================XARAHEADEREND============================
00097  */
00098 
00099 
00100 // RNDRGN.H
00101 //
00102 // Created: 10/5/93 by Phil, Will, Simon
00103 //
00104 
00105 #ifndef INC_RNDRGN
00106 #define INC_RNDRGN
00107 
00108 #include "listitem.h"       // We are derived for a ListItem
00109 #include "handles.h"        // Need definition of a MHANDLE
00110 #include "docrect.h"
00111 #include "rndstack.h"
00112 #include "quality.h"
00113 #include "attr.h"
00114 #include "pathtype.h"
00115 #include "gradtype.h"       // For Fill effect types
00116 #include "matrix.h"
00117 #include "txtattr.h"
00118 #include "slowjob.h"
00119 
00120 #include "pathshap.h"       // For the PathShape typedef
00121 
00122 #include "winrect.h"
00123 #include "bitmapcache.h"    // Included by GAT
00124 #include "capturemanager.h"
00125 #include "genstack.h"
00126 
00127 // These constants are WIN32 specific and are used by Windows - only code such as the internet galleries
00128 // They DO NOT NEED to be redefined for other operating systems as the code using them simply won't exist
00129 // Well, actually, they do, as CALCRECT (for instance) is used elsewhere
00130 
00131 #define FORMAT_TOP              0x00000000
00132 #define FORMAT_LEFT             0x00000000
00133 #define FORMAT_CENTER           0x00000001
00134 #define FORMAT_RIGHT            0x00000002
00135 #define FORMAT_VCENTER          0x00000004
00136 #define FORMAT_BOTTOM           0x00000008
00137 #define FORMAT_WORDBREAK        0x00000010
00138 #define FORMAT_SINGLELINE       0x00000020
00139 #define FORMAT_EXPANFORMATABS       0x00000040
00140 #define FORMAT_TABSTOP          0x00000080
00141 #define FORMAT_NOCLIP           0x00000100
00142 #define FORMAT_EXTERNALLEADING  0x00000200
00143 #define FORMAT_CALCRECT         0x00000400
00144 #define FORMAT_NOPREFIX         0x00000800
00145 #define FORMAT_INTERNAL         0x00001000
00146 #define DEFAULT_TEXT_FORMATTING     FORMAT_SINGLELINE | FORMAT_NOPREFIX | FORMAT_VCENTER 
00147 
00148 
00149 class Node;
00150 class Matrix;
00151 class Spread;
00152 class Path;
00153 class AttributeValue;
00154 class AttributeEntry;
00155 class View;
00156 class KernelBitmap;
00157 class RRCaps;
00158 class MaskedRenderRegion;
00159 class NodeBitmap;
00160 class DocColour;
00161 class ColourContext;
00162 class StrokeColourAttribute;
00163 class StrokeTranspAttribute;
00164 class StrokeTypeAttrValue;
00165 class ColourFillAttribute;
00166 class FillMappingAttribute;
00167 class FillEffectAttribute;
00168 class TranspFillAttribute;
00169 class TranspFillMappingAttribute;
00170 class LineWidthAttribute;
00171 class VariableWidthAttrValue;
00172 class StartCapAttribute;
00173 class EndCapAttribute;
00174 class StartArrowAttribute;
00175 class EndArrowAttribute;
00176 class JoinTypeAttribute;
00177 class MitreLimitAttribute;
00178 class DashPatternAttribute;
00179 class WindingRuleAttribute;
00180 class DrawingModeAttribute;
00181 class QualityAttribute;
00182 class BitmapFillAttribute;
00183 class WebAddressAttribute;
00184 class MouldAttribute;
00185 class TxtFontTypefaceAttribute;
00186 class TxtBoldAttribute;
00187 class TxtUnderlineAttribute;
00188 class TxtItalicAttribute;
00189 class TxtAspectRatioAttribute;
00190 class TxtJustificationAttribute;
00191 class TxtTrackingAttribute;
00192 class TxtTrackingAttribute;
00193 class TxtFontSizeAttribute;
00194 class TxtScriptAttribute;
00195 class TxtBaseLineAttribute;
00196 class TxtLineSpaceAttribute;
00197 class TxtLeftMarginAttribute;
00198 class TxtRightMarginAttribute;
00199 class TxtFirstIndentAttribute;
00200 class TxtRulerAttribute;
00201 class OverprintLineAttrValue;
00202 class OverprintFillAttrValue;
00203 class PrintOnAllPlatesAttrValue;
00204 class ProgressDisplay;
00205 class PathProcessor;
00206 class OffscreenAttrValue;
00207 class ClipRegionAttribute;
00208 class CaptureManager;
00209 class RenderCallback;
00210 
00211 /********************************************************************************************
00212 
00213 < ChangeAttrType
00214 
00215     Comment:    This is used in the function RenderRegion::SetFillAttributes(), to indicate
00216                 that a fill attribute has changed and the render region should do whatever
00217                 is appropriate to handle the change.  This enumerated type is just used
00218                 to indicate which aspect of the fill has changed.
00219     SeeAlso:    RenderRegion::SetFillAttributes
00220 
00221 ********************************************************************************************/ 
00222 
00223 typedef enum
00224 {
00225     CHANGEATTR_ALL      = -1,
00226     CHANGEATTR_GEOMETRY = 0,
00227     CHANGEATTR_EFFECT,
00228     CHANGEATTR_MAPPING,
00229     CHANGEATTR_TRANSP_GEOMETRY,
00230     CHANGEATTR_TRANSP_EFFECT,
00231     CHANGEATTR_TRANSP_MAPPING,
00232     CHANGEATTR_WINDING_RULE
00233 } ChangeAttrType;
00234 
00235 /********************************************************************************************
00236 
00237 < ChangeLineAttrType
00238 
00239     Comment:    This is used in the function RenderRegion::SetLineAttributes(), to indicate
00240                 that a line attribute has changed and the render region should do whatever
00241                 is appropriate to handle the change.  This enumerated type is just used
00242                 to indicate which aspect of the fill has changed.
00243     SeeAlso:    RenderRegion::SetLineAttributes
00244 
00245 ********************************************************************************************/ 
00246 
00247 typedef enum
00248 {
00249     CHANGELINEATTR_ALL = -1,
00250     CHANGEATTR_STROKECOL = 0,
00251     CHANGEATTR_STROKETRANSP,
00252     CHANGEATTR_LINEWIDTH,
00253     CHANGEATTR_JOINTYPE,
00254     CHANGEATTR_DASHPATTERN,
00255     CHANGEATTR_LINECAP,
00256     CHANGEATTR_STARTARROW,
00257     CHANGEATTR_ENDARROW,
00258     CHANGEATTR_MITRELIMIT
00259 } ChangeLineAttrType;
00260 
00261 /********************************************************************************************
00262 
00263 < ChangeAttrType
00264 
00265     Comment:    This is used in the function RenderRegion::SetFillAttributes(), to indicate
00266                 that a fill attribute has changed and the render region should do whatever
00267                 is appropriate to handle the change.  This enumerated type is just used
00268                 to indicate which aspect of the fill has changed.
00269     SeeAlso:    RenderRegion::SetFillAttributes
00270 
00271 ********************************************************************************************/ 
00272 
00273 typedef enum
00274 {
00275     CHANGEFILLATTR_ALL      = -1,
00276     CHANGEATTR_FONT = 0,
00277     CHANGEATTR_BOLD,
00278     CHANGEATTR_ITALIC,
00279     CHANGEATTR_UNDERLINE,
00280     CHANGEATTR_ASPECT,
00281     CHANGEATTR_TRACKING,
00282     CHANGEATTR_SIZE,
00283     CHANGEATTR_JUSTIFY, 
00284     CHANGEATTR_SCRIPT,
00285     CHANGEATTR_BASELINE,
00286     CHANGEATTR_LINESPACE,
00287     CHANGEATTR_LEFTMARGIN,
00288     CHANGEATTR_RIGHTMARGIN,
00289     CHANGEATTR_FIRSTINDENT,
00290     CHANGEATTR_RULER
00291 } ChangeFillAttrType;
00292 
00293 
00294 /********************************************************************************************
00295 
00296 >   class SubRenderContext : public CC_CLASS_MEMDUMP
00297 
00298     Author:     Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
00299     Created:    22/11/94
00300     Purpose:    Provide a base class for pointing to when storing sub-rendering
00301                 contexts.  These are needed when a node takes a long time to render, such
00302                 as a NodeBlender object which interrupts itself before all the blended
00303                 objects have finished rendering.
00304                 This class is essentially empty - derive your own specific context class
00305                 from it.
00306     SeeAlso:    RenderRegion; RenderRegion::SetSubRenderContext
00307     Notes:      RenderTree function uses renderstate member to determine control flow
00308                 when restarting interrupted tree rendering...
00309 
00310 ********************************************************************************************/
00311 
00312 class SubRenderContext : public CCObject
00313 {
00314     CC_DECLARE_DYNAMIC(SubRenderContext);
00315 
00316     SubRenderContext() {renderstate = SUBTREE_ROOTONLY;}
00317 
00318 public:
00319     SubtreeRenderState renderstate;
00320 };
00321 
00322 
00323 /********************************************************************************************
00324 
00325 >   class SubTreeRenderContext : public SubRenderContext
00326 
00327     Author:     Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
00328     Created:    14/10/2004
00329     Purpose:    Represents the rendering state where tree rendering has been suspended
00330                 but the current node is the root of a subtree that has ALREADY BEEN RENDERED
00331     SeeAlso:    RenderRegion; RenderRegion::SetSubRenderContext
00332 
00333 ********************************************************************************************/
00334 
00335 class SubTreeRenderContext : public SubRenderContext
00336 {
00337     CC_DECLARE_DYNAMIC(SubTreeRenderContext);
00338 
00339     SubTreeRenderContext() {renderstate = SUBTREE_NORENDER;}
00340 };
00341 
00342 
00343 /********************************************************************************************
00344 
00345 >   class RenderRegion : public ListItem
00346 
00347     Author:     Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
00348     Created:    11/5/93
00349     Purpose:    THIS IS AN ABSTRACT CLASS. Don't try to create a RenderRegion itself, but
00350                 rather create one of it's derived classes.
00351                 A RenderRegion object is created when an area of the screen/printer (or any
00352                 destination) has become invalid and needs to be redrawn. It 'lives' for as
00353                 long as that region is still invalid.  It is also used for e.g. exporting
00354                 files or in smart click detection.
00355                 Background rendering and region merging is achieved by using a List of Render
00356                 Region objects.  When a new region becomes invalid, a RenderRegion is created
00357                 and added to that list.  If the rendering is interrupted before it is
00358                 complete, then it will continue again when the OnIdle routine scans through
00359                 the list of RenderRegions.
00360                 RenderRegions can also be created at other times for Immediate rendering.
00361                 To use a RenderRegion, create an OSRenderRegion or a GRenderRegion depending
00362                 on the method of rendering required, then Attach a DC and CWnd to the region
00363                 to specify the Render destination.  Next call InitRender which will return
00364                 the RenderRegions previous render state if it had been interrupted or Null if
00365                 it has just been created.  You can then set attributes, Save/Restore them,
00366                 and Render objects. When rendering is complete, call ExitRender passing the
00367                 current render state.       
00368 
00369     SeeAlso:    class OSRenderRegion; class GRenderRegion
00370         
00371 ********************************************************************************************/
00372 
00373 class CCAPI RenderRegion : public ListItem
00374 {
00375 
00376     CC_DECLARE_DYNAMIC( RenderRegion )
00377     
00378 public:
00379     // Render Region Creation and Destruction
00380     RenderRegion();
00381     RenderRegion(DocRect ClipRect, Matrix ConvertMatrix, FIXED16 ViewScale);
00382     RenderRegion(const RenderRegion &other);    // Copy constructor
00383     virtual ~RenderRegion();
00384 
00385     static BOOL Init();
00386 
00387     // Function to copy all the parameters from another render region to this render region
00388     virtual BOOL CopyRenderInfo( const RenderRegion &Other);
00389 
00390     virtual BOOL AttachDevice(View *, CNativeDC *, Spread *SpreadToAttach = NULL, bool fOwned = false ); // OVERRIDE THIS
00391     virtual BOOL AttachDevice(View *, CCDC *, Spread *SpreadToAttach = NULL, bool fOwned = false ); // DO NOT OVERRIDE THIS
00392     virtual BOOL InitDevice();
00393 
00394     virtual BOOL ImmediateRender();
00395 
00396 //  virtual BOOL CanBackgroundRender() { return FALSE; }
00397 
00398     virtual Node* GetBackmostChangedNode() { return m_pBackmostChangedNode; }
00399     virtual void SetBackmostChangedNode(Node* pInvalidNode);
00400     virtual void ClearBackmostChangedNode(Node* pNode);
00401 
00402     virtual BOOL RenderBits(LPBITMAPINFO lpBitmapInfo, LPBYTE lpBits, DocRect rect, BOOL bForceNoTransp = TRUE, Node* pEffectsOwner = NULL);
00403     virtual BOOL RenderBits(LPBITMAPINFO lpBitmapInfo, LPBYTE lpBits, DocCoord* pCoords, INT32 numcoords, BOOL bForceNoTransp = TRUE, Node* pEffectsOwner = NULL);
00404     virtual BOOL RenderBits(KernelBitmap* pkBitmap, DocCoord* pCoords, INT32 numcoords, BOOL bForceNoTransp, Node* pEffectsOwner);
00405 
00406     virtual INT64   GetTotalCount() {return m_countTotal;}
00407     virtual INT64   GetStoredCount() {return m_countStored;}
00408     virtual void        SetStoredCount(INT64 llcount) {m_countStored = llcount;}
00409 
00410     // Functions to allow the transform matrix to be altered after the rr has been created
00411     virtual void    SetMatrix( Matrix& );
00412             Matrix  GetMatrix() { return RenderMatrix; }
00413     virtual Matrix  ConcatenateMatrix( Matrix& );
00414 
00415     // static init function to set up the user preferences from the .ini file
00416     static BOOL InitPrefs();
00417 
00418     virtual BOOL StartRender();
00419     virtual BOOL StopRender() = 0;
00420     virtual void SetClean(BOOL bResetChangedBounds, BOOL FillWhite);
00421     virtual BOOL IsClean() {return FALSE;}
00422 
00423     virtual BOOL CloseDown ();                  // Graeme (24-2-00).
00424     virtual void ConditionalSuicide ( void );   // Graeme (24-2-00).
00425 
00426     Node*                   GetRenderState();
00427     void                    SetRenderState(Node *RenderState) { CurrentRenderState = RenderState; }
00428 
00429     // Set a sub-render context. Note that you must not touch it if it is locked, as
00430     // that means somebody above you in the tree can store a sub-render context, and
00431     // hence you must not be interruptible or it'll all go wrong. (A cheap bodge by
00432     // Jason to allow interruptible stroke rendering without breaking when inside a blend)
00433     SubRenderContext*   GetSubRenderState() 
00434                             { return CurrentSubRenderState; }
00435     void                SetSubRenderState(SubRenderContext *SubRenderState) 
00436                             {
00437                                 ERROR3IF(SubRenderStateLocked && SubRenderState != NULL, "Oi! No!");
00438                                 CurrentSubRenderState = SubRenderState;
00439                                 if (SubRenderState == NULL)
00440                                     SubRenderStateLocked = FALSE;
00441                             }
00442     BOOL IsSubRenderStateLocked(void) const { return(SubRenderStateLocked); };
00443     void LockSubRenderState(BOOL Lock) { SubRenderStateLocked = Lock; };
00444 
00445 
00446     CNativeDC *GetRenderDC() { return RenderDC; }
00447     INT32   GetTimeslice() const        { return Timeslice; }
00448 
00449     void    DefaultRender(BOOL bForceImmediate = FALSE);    // Called during background rendering
00450 //  wxDC*   GetDCHandle()       { return DCHandle; }
00451     View*   GetRenderView()     { return RenderView; }
00452     Spread* GetRenderSpread()   { return RenderSpread; }
00453     BOOL    IsPrinting()        { return RenderFlags.Printing; }
00454     BOOL    IsRendering()       { return RenderFlags.Rendering; }
00455 
00456     BOOL    IsVeryMono()        { return RenderFlags.VeryMono; }
00457     BOOL    IsHitDetect() const     { return RenderFlags.VeryMono || RenderFlags.HitDetect; }
00458 
00459     BOOL    IsUsingSmoothedBitmaps() { return RenderFlags.SmoothedBitmaps; }
00460     void    SetUsingSmoothedBitmaps(BOOL set) { RenderFlags.SmoothedBitmaps = set; }
00461 
00462     void SaveContext();
00463     void RestoreContext();
00464 
00465 #ifdef _DEBUG
00466     BOOL m_TraceOutContextLevels;
00467     INT32 m_CurrentContextLevel;
00468     virtual void DebugTrace();
00469 #endif
00470 
00471     // For use by AttributeValue objects...
00472     virtual BOOL SaveAttribute(UINT32 Index, AttributeValue *pAttr, BOOL Temp);
00473     void RestoreAttribute(UINT32 Index, AttributeValue *pAttr, BOOL Temp);
00474 
00475     // Virtual Functions to help with rendering.
00476     virtual BOOL WantsGrids();
00477 
00478     // Set the background colour. This function is used for dealing with shadows.
00479     void SetBackgroundColour ( DocColour &Colour );
00480 
00481     // Functions that actually draw things      
00482     virtual void DrawPath(Path *PathToRender, PathProcessor *pCaller = NULL, PathShape psThis=PATHSHAPE_PATH);
00483                     // Renders a path (possibly via PathProcessors)
00484 
00485     PathProcessor *GetFirstPathProcessor(void) { return(PathProcessorStack); };
00486     void PushPathProcessor(PathProcessor *pProcessor);
00487     void PopPathProcessor(void);
00488                     // Path Processor stack management functions (called by attributes)
00489     
00490     void EnableAllBrushPathProcessors(BOOL Enable);
00491 
00492     virtual void DrawPathToOutputDevice(Path *PathToRender, PathShape shapePath=PATHSHAPE_PATH) = 0;
00493                     // Internal call used by DrawPath to actually render a path
00494                     // after it has been processed by the pathProcessor system
00495 
00496     virtual void DrawRect(DocRect *RectToRender) = 0;
00497     virtual void DrawDragRect(DocRect *RectToRender) = 0;
00498     virtual void DrawDragBounds(DocRect *RectToRender);
00499     virtual void DrawDashLine(const DocCoord &StartPoint, const DocCoord &EndPoint);
00500     virtual void DrawLine(const DocCoord &StartPoint, const DocCoord &EndPoint) = 0;
00501     virtual void DrawPixel(const DocCoord &Point) = 0;
00502     virtual void DrawBlob(DocCoord p, BlobType type) = 0;
00503     virtual void DrawCross(const DocCoord &Point, const UINT32 Size) = 0;
00504 
00505     virtual void DrawBitmap(const DocCoord &Point, KernelBitmap* pBitmap) = 0;
00506     virtual void DrawBitmap(const DocCoord &Point, UINT32 BitmapID, UINT32 ToolID = 0) = 0;
00507     virtual BOOL DrawTransformedBitmap(NodeBitmap *pNodeBitmap);
00508 
00509     virtual void DrawBitmapBlob(const DocCoord &Point, KernelBitmap* BlobShape) = 0;
00510     virtual void DrawBitmapBlob(const DocCoord &Point, ResourceID resID ) = 0;
00511 
00512     virtual SlowJobResult DrawMaskedBitmap(const DocRect &Rect, KernelBitmap* pBitmap, 
00513                                            MaskedRenderRegion* pMask, ProgressDisplay *Progress);
00514 
00515     virtual void DrawFixedSystemText(StringBase *TheText, DocRect &BoundsRect, UINT32 uFormat = DEFAULT_TEXT_FORMATTING);
00516     virtual void SetFixedSystemTextColours(DocColour *TextCol, DocColour *Background);
00517     virtual void GetFixedSystemTextSize(StringBase *TheText, DocRect *BoundsRect, double* atDpi = NULL);
00518 
00519     DrawModeType DrawingMode;
00520 
00521     // Arrow head rendering
00522     virtual BOOL DrawPathArrowHeads(DocCoord* Coords, PathVerb* Verbs, INT32 NumCoords);
00523     virtual BOOL DrawArrowHead(ArrowRec &ArrowToDraw, DocCoord &Centre, DocCoord &Direction,
00524         DocCoord * RetnCentre = NULL);
00525 
00526     // Functions for trying to draw reliable pixel lines and rectangles.
00527     // They actually draw using filled one pixel wide rectangles rather
00528     // than drawing single pixel lines
00529     virtual void DrawPixelRect(DocRect *RectToRender);
00530     virtual void DrawPixelLine(const DocCoord &StartPoint, const DocCoord &EndPoint);
00531 
00532     // Functions to Set the Attributes
00533     virtual void SetLineColour  (StrokeColourAttribute  *, BOOL Temp);
00534     virtual void SetLineOverprint(OverprintLineAttrValue *, BOOL Temp);
00535     virtual void SetLineTransp  (StrokeTranspAttribute  *, BOOL Temp);
00536 
00537     virtual void SetStrokeType   (StrokeTypeAttrValue *,    BOOL Temp);
00538     virtual void SetVariableWidth(VariableWidthAttrValue *, BOOL Temp);
00539 
00540     virtual void SetFillGeometry(ColourFillAttribute    *, BOOL Temp);
00541     virtual void SetFillMapping (FillMappingAttribute   *, BOOL Temp);
00542     virtual void SetFillEffect  (FillEffectAttribute    *, BOOL Temp);
00543     virtual void SetFillOverprint(OverprintFillAttrValue *, BOOL Temp);
00544 
00545     virtual void SetTranspFillGeometry(TranspFillAttribute *, BOOL Temp);
00546     virtual void SetTranspFillMapping (TranspFillMappingAttribute  *, BOOL Temp);
00547 
00548     virtual void SetPrintOnAllPlates(PrintOnAllPlatesAttrValue *, BOOL Temp);
00549 
00550     virtual void SetLineWidth   (LineWidthAttribute     *, BOOL Temp);
00551 
00552     virtual void SetStartCap    (StartCapAttribute      *, BOOL Temp);
00553     virtual void SetStartArrow  (StartArrowAttribute    *, BOOL Temp);
00554     virtual void SetEndArrow    (EndArrowAttribute      *, BOOL Temp);
00555     virtual void SetJoinType    (JoinTypeAttribute      *, BOOL Temp);
00556     virtual void SetMitreLimit  (MitreLimitAttribute    *, BOOL Temp);
00557     virtual void SetDashPattern (DashPatternAttribute   *, BOOL Temp);
00558     virtual void SetWindingRule (WindingRuleAttribute   *, BOOL Temp);
00559     virtual void SetDrawingMode (DrawingModeAttribute   *, BOOL Temp);
00560     virtual void SetQuality     (QualityAttribute       *, BOOL Temp);
00561 
00562     virtual void SetWebAddress      (WebAddressAttribute        *, BOOL Temp);
00563 
00564     virtual void SetTxtFontTypeface     (TxtFontTypefaceAttribute   *, BOOL Temp);
00565     virtual void SetTxtBold             (TxtBoldAttribute           *, BOOL Temp);
00566     virtual void SetTxtUnderline        (TxtUnderlineAttribute      *, BOOL Temp);
00567     virtual void SetTxtItalic           (TxtItalicAttribute         *, BOOL Temp);
00568     virtual void SetTxtAspectRatio      (TxtAspectRatioAttribute    *, BOOL Temp);
00569     virtual void SetTxtJustification    (TxtJustificationAttribute  *, BOOL Temp);
00570     virtual void SetTxtTracking         (TxtTrackingAttribute       *, BOOL Temp);
00571     virtual void SetTxtFontSize         (TxtFontSizeAttribute       *, BOOL Temp);
00572     virtual void SetTxtScript           (TxtScriptAttribute         *, BOOL Temp);
00573     virtual void SetTxtBaseLine         (TxtBaseLineAttribute       *, BOOL Temp);
00574     virtual void SetTxtLineSpace        (TxtLineSpaceAttribute      *, BOOL Temp);
00575     virtual void SetTxtLeftMargin       (TxtLeftMarginAttribute     *, BOOL Temp);
00576     virtual void SetTxtRightMargin      (TxtRightMarginAttribute    *, BOOL Temp);
00577     virtual void SetTxtFirstIndent      (TxtFirstIndentAttribute    *, BOOL Temp);
00578     virtual void SetTxtRuler            (TxtRulerAttribute          *, BOOL Temp);
00579 
00580     virtual void SetSolidColours(BOOL SetSolid) {}
00581 
00582     void SetLineColour(DocColour &NewLineColour);
00583     void SetLineColour(StockColour NewLineColour);
00584     void SetFillColour(DocColour &NewFillColour);
00585     void SetFillColour(StockColour NewFillColour);
00586     void SetLineWidth(MILLIPOINT NewLineWidth);
00587     void SetStartCap(LineCapType NewStartCap);
00588     void SetStartArrow(StockArrow NewStartArrow);
00589     void SetEndArrow(StockArrow NewEndArrow);
00590     void SetStartArrow(ArrowRec &NewStartArrow);
00591     void SetEndArrow(ArrowRec &NewEndArrow);
00592     void SetJoinType(JointType NewJoinType);
00593     void SetMitreLimit(MILLIPOINT NewMitreLimit);
00594     void SetDashPattern(DashRec &NewDashPattern);
00595     void SetDashPattern(StockDash NewDashPattern);
00596     void SetWindingRule(WindingType NewWindingRule);
00597     void SetDrawingMode(DrawModeType NewDrawingType);
00598     void SetDefaultQuality();
00599 
00600     void SetDeviceDashPattern(DashRec &NewDashPattern);
00601     void SetDeviceDashPattern(StockDash NewDashPattern);
00602 
00603     virtual void SetOffscreen(OffscreenAttrValue* pAttr);
00604     virtual void SetClipRegion(ClipRegionAttribute  *, BOOL Temp);
00605     virtual CCachedBitmap GrabBitmap(DocRect rectGrab) {return CCachedBitmap();}
00606 
00607     // Functions to restore the attributes
00608     virtual void RestoreLineColour  (StrokeColourAttribute *, BOOL);
00609     virtual void RestoreLineOverprint(OverprintLineAttrValue *, BOOL);
00610     virtual void RestoreLineTransp  (StrokeTranspAttribute *, BOOL);
00611 
00612     virtual void RestoreStrokeType   (StrokeTypeAttrValue *,    BOOL);
00613     virtual void RestoreVariableWidth(VariableWidthAttrValue *, BOOL);
00614 
00615     virtual void RestoreFillGeometry(ColourFillAttribute *, BOOL);
00616     virtual void RestoreFillMapping (FillMappingAttribute  *, BOOL);
00617     virtual void RestoreFillOverprint(OverprintFillAttrValue *, BOOL);
00618 
00619     virtual void RestoreTranspFillGeometry(TranspFillAttribute *, BOOL);
00620     virtual void RestoreTranspFillMapping (TranspFillMappingAttribute  *, BOOL);
00621 
00622     virtual void RestoreFillEffect  (FillEffectAttribute   *, BOOL);
00623     virtual void RestoreLineWidth   (LineWidthAttribute    *, BOOL);
00624     virtual void RestoreDrawingMode (DrawingModeAttribute  *, BOOL);
00625     virtual void RestoreWindingRule (WindingRuleAttribute  *, BOOL);
00626     virtual void RestoreStartCap    (StartCapAttribute     *, BOOL);
00627     virtual void RestoreJoinType    (JoinTypeAttribute     *, BOOL);
00628     virtual void RestoreQuality     (QualityAttribute      *, BOOL);
00629     virtual void RestoreDashPattern (DashPatternAttribute  *, BOOL);
00630     virtual void RestoreStartArrow  (StartArrowAttribute   *, BOOL);
00631     virtual void RestoreEndArrow    (EndArrowAttribute     *, BOOL);
00632     virtual void RestoreMitreLimit  (MitreLimitAttribute   *, BOOL);
00633 
00634     virtual void RestoreWebAddress  (WebAddressAttribute   *, BOOL);
00635 
00636     virtual void RestorePrintOnAllPlates(PrintOnAllPlatesAttrValue *, BOOL);
00637 
00638     void RestoreTxtFontTypeface     (TxtFontTypefaceAttribute   *, BOOL);
00639     void RestoreTxtBold             (TxtBoldAttribute           *, BOOL);
00640     void RestoreTxtUnderline        (TxtUnderlineAttribute      *, BOOL);
00641     void RestoreTxtItalic           (TxtItalicAttribute         *, BOOL);
00642     void RestoreTxtAspectRatio      (TxtAspectRatioAttribute    *, BOOL);
00643     void RestoreTxtJustification    (TxtJustificationAttribute  *, BOOL);
00644     void RestoreTxtTracking         (TxtTrackingAttribute       *, BOOL);
00645     void RestoreTxtFontSize         (TxtFontSizeAttribute       *, BOOL);
00646     void RestoreTxtScript           (TxtScriptAttribute         *, BOOL);
00647     void RestoreTxtBaseLine         (TxtBaseLineAttribute       *, BOOL);
00648     void RestoreTxtLineSpace        (TxtLineSpaceAttribute      *, BOOL);
00649     void RestoreTxtLeftMargin       (TxtLeftMarginAttribute     *, BOOL);
00650     void RestoreTxtRightMargin      (TxtRightMarginAttribute    *, BOOL);
00651     void RestoreTxtFirstIndent      (TxtFirstIndentAttribute    *, BOOL);
00652     void RestoreTxtRuler            (TxtRulerAttribute          *, BOOL);
00653 
00654     virtual void RestoreOffscreen(OffscreenAttrValue*);
00655     virtual void RestoreClipRegion  (ClipRegionAttribute    *, BOOL);
00656 
00657     AttributeValue *GetCurrentAttribute(UINT32 Index);
00658     OffscreenAttrValue* GetCurrentOffscreenAttr() { return(CurrentOffscreenAttr); }
00659 
00660     virtual BOOL CheckOffscreenBounds() { return(TRUE); }
00661 
00662     // RenderRegion clipping
00663     void    SetClipRect(DocRect &NewClipRect, BOOL ReCalcContextNode = FALSE);
00664     DocRect GetClipRect();
00665 
00666     // Return the size of a Pixel in MILLIPOINTS
00667     MILLIPOINT GetPixelWidth() { return PixelWidth; }
00668     MILLIPOINT GetScaledPixelWidth() { return ScaledPixelWidth; }
00669     virtual double GetPixelsPerInch() { return 72000.0/ScaledPixelWidth; }
00670 
00671     // Function to allow render regions to say what they can not render
00672     virtual void GetRenderRegionCaps(RRCaps* pCaps);
00673     BOOL SetRenderComplexShapes(BOOL NewState);
00674 
00675     // Function to work out if we are trying to render a complex shape
00676     BOOL TestForComplexShape(RRCaps* pCaps);
00677 
00678     // Used to render graduated fills.
00679     EFFECTTYPE GetFillEffect();
00680 
00681     // Record connection to a filter using this render region
00682     void SetFilter(Filter* pFilter) {m_pFilter = pFilter;}
00683     Filter* GetFilter() {return m_pFilter;}
00684 
00685     // Called when a region changes in size
00686     virtual void ResizeRegion(DocRect &NewClipRect);
00687 
00688     // Functions to help with the Banded rendering
00689     virtual void ResetRegion(DocRect &NewClipRect);
00690     virtual BOOL SetFirstBand();
00691     virtual BOOL GetNextBand();
00692     DocRect GetRegionRect();
00693     BOOL IsBanded();
00694     BOOL CanBeMerged();
00695     BOOL ResetColourContext();
00696     ColourContext* GetColourContext();
00697 
00698     virtual void ResetRender();
00699 
00700     virtual BOOL RenderChar(WCHAR ch, Matrix* pMatrix);
00701     virtual BOOL WriteNewLine ( void );
00702 
00703     Path* CreateCharPath(WCHAR ch, Matrix* pMatrix=NULL);
00704     BOOL  GetAttrdCharBounds(DocRect* pRect, WCHAR ch);
00705     BOOL  GetCharAttributeMatrix(Matrix* pAttrMatrix);
00706 
00707     void ColourCorrectBitmap(BitmapFillAttribute* Fill, BITMAPINFO *Info, RGBQUAD **Palette);
00708 
00709     // Core tree rendering function now in RenderRegion!
00710     BOOL RenderTree(Node* pRoot,
00711                     BOOL bTimeSlice = TRUE,
00712                     BOOL bClip = TRUE,
00713                     RenderCallback* pCallback = NULL);
00714     BOOL RenderTreeCanContinue();
00715     BOOL RenderTreeNoCache(Node* pRoot);
00716 
00717     virtual BOOL IsWrappedRender() const {return FALSE;}
00718     virtual BOOL TranspTypeIsRGBTCompatible(UINT32 ttype) const {return TRUE;}  // Should be TranspType ttype
00719     virtual BOOL SetSmoothingFlags(FillGeometryAttribute *Fill) {return TRUE;}
00720 
00721     // If this returns TRUE then paper nodes will be rendered via RenderTree
00722     virtual BOOL RenderPaperAsInk() { return(FALSE); }
00723 
00724 //  virtual double GetTranspBoostM() {return m_dboostm;}
00725 //  virtual double GetTranspBoostC() {return m_dboostc;}
00726 //  virtual void SetTranspBoost(double dc = 0.0, double dm = 1.0) {m_dboostc = dc; m_dboostm = dm;}
00727 
00728     void SetImmediateRender(BOOL SetVal)    {RenderFlags.bImmediateRender = SetVal;}
00729     BOOL GetImmediateRender() const         {return RenderFlags.bImmediateRender;}
00730 
00731     void SetForceMixTransparency(BOOL bForceMix) { m_bForceMix = bForceMix; }
00732 
00734     //
00735     // New Capture system
00736     //
00737 public:
00738     virtual Capture* StartCapture(CCObject* pOwner,
00739                               DocRect CaptureRect,
00740                               CAPTUREINFO cinfo,
00741                               BOOL bTransparent = TRUE,
00742                               BOOL bCaptureBackground = FALSE,
00743                               double mpPixelWidth = 0,
00744                               NodeRenderableInk* pDirectSupplier = NULL
00745                               );
00746     virtual BOOL StopCapture(CCObject* pOwner,
00747                              BOOL bRender = TRUE,
00748                              BOOL bReleaseBitmap = FALSE,
00749                              LPBITMAPINFO* plpBitmapInfo = NULL,
00750                              LPBYTE* plpBits = NULL,
00751                              DocRect* pCaptureRect = NULL,
00752                              Matrix* pmatTransform = NULL,
00753                              double* pdResolution = NULL
00754                              );
00755     virtual BOOL ChangeCapture(CAPTUREINFO cinfo,
00756                               BOOL bTransparent = TRUE,
00757                               BOOL bCaptureBackground = FALSE
00758                              );
00759     virtual INT32 GetCaptureDepth()             {return m_CaptureStack.Size();}
00760     virtual BOOL MasterCaptureIsCurrent() const {return (!m_CaptureStack.Empty() && GetTopCapture() && GetTopCapture()->IsMaster());}
00761     virtual Capture* GetTopCapture() const      {return m_CaptureStack.Empty() ? NULL : m_CaptureStack.Top();}
00762     virtual Capture* GetMasterCapture() const   {return m_CaptureStack.Empty() ? NULL : m_CaptureStack.Bottom();}
00763     virtual BOOL LockedTransparentCaptures() const;
00764 
00765 protected:
00766     virtual BOOL SetRenderToCapture(Capture* pCapture, BOOL ApplyClipRegion, BOOL bSetBitmap) {return TRUE;}
00767 
00768 // State variables
00769 protected:
00770     StackT<Capture*> m_CaptureStack;
00771 
00772 
00774     //
00775 public:
00776     // Variables.
00777     BOOL IsWaitingForRAM;
00778     BOOL IsLastBand;
00779 
00780     // Flag to indicate whether this render region needs the PaperRenderRegion to
00781     // update the paper on screen.
00782     BOOL NeedsOSPaper;
00783 
00784     // Flag to indicate that the paper should be rendered on the next 'StartRender' call
00785     BOOL RenderOSPaper;
00786 
00787     // Flag used to tell if the paper or any of the ink has been rendered yet
00788     BOOL IsPaperRendered;
00789     BOOL IsInkRenderStarted;
00790     Quality RRQuality;                          // used to control level of rendering
00791 
00792     // New Flag to say wether or not GDraw uses the biCompression field to do transparencies!
00793     BOOL m_DoCompression;
00794 
00795 protected:
00796     DocColour               mBackgroundColour;
00797     StrokeColourAttribute   *PrepareLineColour(StrokeColourAttribute *SourceAttr = NULL);
00798     ColourFillAttribute     *PrepareFillGeometry(ColourFillAttribute *SourceAttr = NULL);
00799         // Internal helper functions for handling effects of overprint and print-on-all-plates on colours
00800 
00801     // Protected functions
00802     virtual void InitClipping() = 0;        // Initialises the Clipping rectangle
00803     virtual void InitAttributes() = 0;      // Initialises all Attributes
00804     virtual void SetLineAttributes(ChangeLineAttrType = CHANGELINEATTR_ALL);
00805     virtual void SetFillAttributes(ChangeAttrType Type = CHANGEATTR_ALL);
00806     virtual void SetTextAttributes(ChangeFillAttrType Type = CHANGEFILLATTR_ALL);
00807     virtual BOOL RenderNode(Node* pNode, Node* pRunToNode, RenderCallback* pCallback);
00808 
00809     virtual void SetOSDrawingMode() = 0;
00810 
00811     virtual void SetQualityLevel();  // Made non-pure by Markn 6/8/97, because base class can now get called
00812 
00813     virtual MILLIPOINT CalcPixelWidth() = 0;
00814     virtual MILLIPOINT CalcScaledPixelWidth() = 0;
00815 
00816     // Functions to deal with the Fuzzy Clipping we perform at High Zoom factors
00817     BOOL TryToFuzzyClip(Path* pPath, DocCoord** pNewCoords, PathVerb** pNewVerbs, UINT32 *NewNumCoords);
00818     void SetupFuzzyClipRects();
00819 
00820     // The Fuzzy Clipping Rects used in Fuzzy Clipping.
00821     DocRect InnerRect;
00822     DocRect OuterRect;
00823 
00824     // BOOL to help things descide if they need to render complex shapes or not
00825     BOOL RenderComplexShapes;
00826 
00827     // Timing values to help optimise cacheing
00828     INT64 m_countTotal;
00829     INT64 m_countStored;
00830 
00831     struct CCAPI FlagBlock
00832     {
00833         BOOL Printing           : 1;
00834         BOOL Rendering          : 1;
00835         BOOL StackClaimed       : 1;
00836         BOOL ValidDevice        : 1;
00837         BOOL bImmediateRender   : 1;
00838         BOOL VeryMono           : 1;        // TRUE if very black&white (i.e. no dithering)
00839         BOOL SmoothedBitmaps    : 1;
00840         BOOL HitDetect          : 1;
00841     }   RenderFlags;
00842 
00843     struct _StrokeFlags
00844     {
00845         BOOL ValidStrokeColour  : 1;
00846         BOOL ValidStrokeTransp  : 1;
00847         BOOL ValidLineWidth     : 1;
00848         BOOL ValidJoinType      : 1;
00849         BOOL ValidDashPattern   : 1;
00850         BOOL ValidLineCap       : 1;
00851         BOOL ValidStartArrow    : 1;
00852         BOOL ValidEndArrow      : 1;
00853         BOOL ValidMitreLimit    : 1;
00854     } StrokeFlags;
00855 
00856     struct _FillFlags
00857     {
00858         BOOL ValidGeometry      : 1;
00859         BOOL ValidEffect        : 1;
00860         BOOL ValidMapping       : 1;
00861         BOOL ValidTransGeometry : 1;
00862         BOOL ValidTransEffect   : 1;
00863         BOOL ValidTransMapping  : 1;
00864         BOOL ValidWindingRule   : 1;
00865     } FillFlags;
00866     
00867     struct _TextFlags
00868     {
00869         BOOL ValidFont          : 1;
00870         BOOL ValidBold          : 1;
00871         BOOL ValidItalic        : 1;
00872         BOOL ValidUnderline     : 1;
00873         BOOL ValidAspect        : 1;
00874         BOOL ValidTracking      : 1;
00875         BOOL ValidFontSize      : 1;
00876         BOOL ValidJustify       : 1;
00877         BOOL ValidScript        : 1;
00878         BOOL ValidBaseLine      : 1;
00879         BOOL ValidLineSpace     : 1;
00880         BOOL ValidLeftMargin    : 1;
00881         BOOL ValidRightMargin   : 1;
00882         BOOL ValidFirstIndent   : 1;
00883         BOOL ValidRuler         : 1;
00884 
00885     } TextFlags;
00886     
00887 //  wxDC* DCHandle;             // This is used to recreate a CDC during BackGrnd redraw
00888     Matrix RenderMatrix;        // The current Transform Matrix 
00889     DocRect CurrentClipRect;    // The current Clipping rectangle (in DocCoords)
00890     ColourContext *CurrentColContext;   // The current ouptut colour context
00891 
00892     View               *RenderView;     // The kernel view that this RenderRegion is rendering to
00893     CNativeDC          *RenderDC;       // The DC that we are rendering into
00894     Spread             *RenderSpread;   // The Spread that we are rendering into
00895     bool                m_fOwned;
00896 
00897     Node*               CurrentRenderState;
00898     SubRenderContext*   CurrentSubRenderState;
00899     BOOL                SubRenderStateLocked;
00900 
00901     FIXED16 ScaleFactor;    // The scale factor of the view (1 is 100%)
00902 
00903     // Pointer to our current attributes
00904     AttributeEntry *CurrentAttrs;
00905     INT32 NumCurrentAttrs;
00906 
00907     // Ilan
00908     // Space for current offscreen attribute
00909     // Allows offscreen attribute derived classes to modify CurrentAttrs table
00910     // as well as render offscreen
00911     OffscreenAttrValue* CurrentOffscreenAttr;
00912 
00913     BOOL CopyCurrentAttributes(const RenderRegion &);
00914 
00915     // timeslice in milliseconds to be used in BG rendering and controlling vars
00916     INT32           Timeslice;
00917     BOOL            m_bRenderTreeTimeSlice;
00918     MonotonicTime   m_timeRenderTreeStartTime;
00919 
00920     // Static vars
00921     // The sizes of the Selection blobs (these are saved out as preferences)
00922     static UINT32 SelectedBlobSize;
00923     static UINT32 UnSelectedBlobSize;
00924     static UINT32 MultiStageSelectedBlobSize;
00925     static UINT32 MultiStageUnSelectedBlobSize;
00926 
00927     // The ClipView blob size is not saved out as a preference, as it refers to a
00928     // (fixed-width) bitmap blob.
00929     static UINT32 ClipViewBlobSize;
00930 
00931     // Size of pixels
00932     MILLIPOINT PixelWidth;
00933     MILLIPOINT ScaledPixelWidth;
00934 
00935     RenderStack TheStack;
00936 
00937     // Some vars used by the banded rendering stuff
00938     DocRect RegionRect;
00939     BOOL    IsRegionBanded;
00940     BOOL    CanRegionBeMerged;
00941 
00942     // This pointer tells code using this region what the backmost changed object was
00943     // that caused this Region to be generated (NULL if nothing changed)
00944     // Dumb routines can test for non-NULL to throw away cached info
00945     // Smart routines can test whether they are related to this object in various
00946     // ways before deciding to bin cached data (e.g. IsUnder)
00947     Node*   m_pBackmostChangedNode;
00948 
00949     // Ilan
00950     // set to TRUE to indicate to AttrValues, during the unwinding of the attribute context
00951     // stack, that the RR is being ResetRegion()d
00952     // set to FALSE otherwise (ie in the normal process of traversing the tree during rendering)
00953     BOOL    IsBeingReset;
00954 
00955     // Used to record a connection to a filter
00956     Filter* m_pFilter;
00957 
00958     // Used to force all non-alpha compatible transparency to mix
00959     BOOL m_bForceMix;
00960 
00961 //  double m_dboostm;
00962 //  double m_dboostc;
00963 
00964 private:
00965     PathProcessor *PathProcessorStack;      // A stack of currently active path processors 
00966 };
00967 
00968 
00969 // Macros to get at the basic attributes quickly...
00970 
00971 #define RR_STROKECOLOUR() (((StrokeColourAttribute *) CurrentAttrs[ATTR_STROKECOLOUR].pAttr)->Colour)
00972 #define RR_FILLCOLOUR()   (((ColourFillAttribute   *) CurrentAttrs[ATTR_FILLGEOMETRY].pAttr)->Colour)
00973 #define RR_LINEWIDTH()    (((LineWidthAttribute    *) CurrentAttrs[ATTR_LINEWIDTH   ].pAttr)->LineWidth)
00974 #define RR_WINDINGRULE()  (((WindingRuleAttribute  *) CurrentAttrs[ATTR_WINDINGRULE ].pAttr)->WindingRule)
00975 #define RR_STARTCAP()     (((StartCapAttribute     *) CurrentAttrs[ATTR_STARTCAP    ].pAttr)->StartCap)
00976 #define RR_JOINTYPE()     (((JoinTypeAttribute     *) CurrentAttrs[ATTR_JOINTYPE    ].pAttr)->JoinType)
00977 #define RR_QUALITY()      (((QualityAttribute      *) CurrentAttrs[ATTR_QUALITY     ].pAttr)->Quality)
00978 #define RR_STARTARROW()   (((StartArrowAttribute   *) CurrentAttrs[ATTR_STARTARROW  ].pAttr)->StartArrow)
00979 #define RR_ENDARROW()     (((EndArrowAttribute     *) CurrentAttrs[ATTR_ENDARROW    ].pAttr)->EndArrow)
00980 #define RR_MITRELIMIT()   (((MitreLimitAttribute   *) CurrentAttrs[ATTR_MITRELIMIT  ].pAttr)->MitreLimit)
00981 #define RR_DASHPATTERN()  (((DashPatternAttribute  *) CurrentAttrs[ATTR_DASHPATTERN ].pAttr)->DashPattern)
00982 
00983 #define RR_FILLTRANSP()         ((TranspFillAttribute*)CurrentAttrs[ATTR_TRANSPFILLGEOMETRY].pAttr)
00984 #define RR_FILLEFFECT()         ((FillEffectAttribute*)CurrentAttrs[ATTR_FILLEFFECT].pAttr)
00985 #define RR_FILLMAPPING()        ((FillMappingAttribute*)CurrentAttrs[ATTR_FILLMAPPING].pAttr)
00986 #define RR_TRANSPFILLMAPPING()  ((FillTranspMappingAttribute*)CurrentAttrs[ATTR_TRANSPFILLMAPPING].pAttr)
00987 #define RR_STROKETRANSP()       ((StrokeTranspAttribute*)CurrentAttrs[ATTR_STROKETRANSP].pAttr)
00988 
00989 #define RR_TXTFONTTYPEFACE()    (((TxtFontTypefaceAttribute  *) CurrentAttrs[ATTR_TXTFONTTYPEFACE ].pAttr)->HTypeface)
00990 
00991 #define RR_TXTBOLD()            (((TxtBoldAttribute         *) CurrentAttrs[ATTR_TXTBOLD ].pAttr)->BoldOn \
00992                                 ||((TxtFontTypefaceAttribute *) CurrentAttrs[ATTR_TXTFONTTYPEFACE ].pAttr)->IsBold)
00993 
00994 #define RR_TXTITALIC()          (((TxtItalicAttribute       *) CurrentAttrs[ATTR_TXTITALIC ].pAttr)->ItalicOn \
00995                                 ||((TxtFontTypefaceAttribute *) CurrentAttrs[ATTR_TXTFONTTYPEFACE ].pAttr)->IsItalic)
00996 
00997 #define RR_TXTASPECTRATIO()     (((TxtAspectRatioAttribute      *) CurrentAttrs[ATTR_TXTASPECTRATIO ].pAttr)->AspectRatio)
00998 #define RR_TXTJUSTIFICATION()   (((TxtJustificationAttribute    *) CurrentAttrs[ATTR_TXTJUSTIFICATION ].pAttr)->justification)
00999 #define RR_TXTTRACKING()        (((TxtTrackingAttribute         *) CurrentAttrs[ATTR_TXTTRACKING ].pAttr)->Tracking)
01000 #define RR_TXTUNDERLINE()       (((TxtUnderlineAttribute        *) CurrentAttrs[ATTR_TXTUNDERLINE ].pAttr)->Underlined)
01001 #define RR_TXTFONTSIZE()        (((TxtFontSizeAttribute         *) CurrentAttrs[ATTR_TXTFONTSIZE ].pAttr)->FontSize)
01002 #define RR_TXTSCRIPT()          ((TxtScriptAttribute            *) CurrentAttrs[ATTR_TXTSCRIPT ].pAttr)
01003 #define RR_TXTBASELINE()        (((TxtBaseLineAttribute         *) CurrentAttrs[ATTR_TXTBASELINE ].pAttr)->Value)
01004 #define RR_TXTLINESPACE()       (((TxtLineSpaceAttribute        *) CurrentAttrs[ATTR_TXTLINESPACE ].pAttr)->Value)
01005 #define RR_TXTLEFTMARGIN()      (((TxtLeftMarginAttribute       *) CurrentAttrs[ATTR_TXTLEFTMARGIN ].pAttr)->Value)
01006 #define RR_TXTRIGHTMARGIN()     (((TxtRightMarginAttribute      *) CurrentAttrs[ATTR_TXTRIGHTMARGIN ].pAttr)->Value)
01007 #define RR_TXTFIRSTINDENT()     (((TxtFirstIndentAttribute      *) CurrentAttrs[ATTR_TXTFIRSTINDENT ].pAttr)->Value)
01008 #define RR_TXTRULER()           (((TxtRulerAttribute            *) CurrentAttrs[ATTR_TXTRULER ].pAttr)->Value)
01009 
01010 #define RR_CLIPREGION()         ((ClipRegionAttribute*)CurrentAttrs[ATTR_CLIPREGION].pAttr)
01011 
01012 
01013 
01014 
01015 /********************************************************************************************
01016 
01017 >   class RenderCallback : public CCObject
01018 
01019     Author:     Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
01020     Created:    30/11/2004
01021     Purpose:    Provide a base class for handling callbacks from RenderTree
01022     Notes:      RenderTree function calls the BeforeNode function in this class when it's about
01023                 to render any Node.
01024                 Derive from this class and implement Callback to provide specialised
01025                 processing of nodes during rendering
01026                 Derived versions of Callback can:
01027                     * Prevent the node being rendered
01028                     * Set attributes
01029                     * Set subrender contexts
01030                     * Accumulate their own info about the render sequence
01031 
01032                 BeforeSubtree can be used to control navigation around the tree
01033                 AfterSubtree is there for completeness
01034 
01035 ********************************************************************************************/
01036 
01037 class RenderCallback : public CCObject
01038 {
01039 public:
01040     virtual BOOL BeforeNode(    RenderRegion* pRegion,
01041                                 Node* pNode)                    {return TRUE;}
01042 
01043     virtual BOOL BeforeSubtree( RenderRegion* pRegion,
01044                                 Node* pNode,
01045                                 Node** ppNextNode,
01046                                 BOOL bClip,
01047                                 SubtreeRenderState* pState)     {return FALSE;}
01048 
01049     virtual BOOL AfterSubtree(  RenderRegion* pRegion,
01050                                 Node* pNode)                    {return FALSE;}
01051 };
01052 
01053 
01054 #endif

Generated on Sat Nov 10 03:46:45 2007 for Camelot by  doxygen 1.4.4