RenderRegion Class Reference

THIS IS AN ABSTRACT CLASS. Don't try to create a RenderRegion itself, but rather create one of it's derived classes. A RenderRegion object is created when an area of the screen/printer (or any destination) has become invalid and needs to be redrawn. It 'lives' for as long as that region is still invalid. It is also used for e.g. exporting files or in smart click detection. Background rendering and region merging is achieved by using a List of Render Region objects. When a new region becomes invalid, a RenderRegion is created and added to that list. If the rendering is interrupted before it is complete, then it will continue again when the OnIdle routine scans through the list of RenderRegions. RenderRegions can also be created at other times for Immediate rendering. To use a RenderRegion, create an OSRenderRegion or a GRenderRegion depending on the method of rendering required, then Attach a DC and CWnd to the region to specify the Render destination. Next call InitRender which will return the RenderRegions previous render state if it had been interrupted or Null if it has just been created. You can then set attributes, Save/Restore them, and Render objects. When rendering is complete, call ExitRender passing the current render state. More...

#include <rndrgn.h>

Inheritance diagram for RenderRegion:

ListItem CCObject SimpleCCObject FormatRegion GRenderRegion ImagemapRenderRegion OSRenderRegion ScanningRenderRegion VectorFileRenderRegion XPFRenderRegion GRenderDIB GRenderWinG OSRenderBitmap PaperRenderRegion AIEPSGradientScanRenderRegion CMXRenderRegion EPSRenderRegion FlashRenderRegion List of all members.

Public Member Functions

 RenderRegion ()
 Used by the RectTool to suspend background redrawing. Used by DocView::CanContinue Default Constructor for RenderRegion Class.
 RenderRegion (DocRect ClipRect, Matrix ConvertMatrix, FIXED16 ViewScale)
 Constructor for a RenderRegion, allowing a invalid rectangle to be specified. The matrix passed is used to convert Document coords into device coords, taking into account scaling, scroll offsets etc.
 RenderRegion (const RenderRegion &other)
 Copy Constructor for RenderRegion. This conctructs a RenderRegion based on another. This involves copying all the current attributes and also making a copy of the ContextStack.
virtual ~RenderRegion ()
 Default Destructor for RenderRegion Class. Releases any memory claimed for the ContextStack.
virtual BOOL CopyRenderInfo (const RenderRegion &Other)
 Copies all the parameters from the render region 'Other' into this render region. This was written for the region merging code. When a new region is created, due to existing regions being split up, it should be based on the original region, with a different clipping rectangle.
virtual BOOL AttachDevice (View *, CNativeDC *, Spread *SpreadToAttach=NULL, bool fOwned=false)
virtual BOOL AttachDevice (View *, CCDC *, Spread *SpreadToAttach=NULL, bool fOwned=false)
 Attaches View, wxDC and Spread pointers to the RenderRegion. The View is used to for general rendering purposes. The wxDC is the device that we are rendering to. We extract the HDC from this and store it so we can recreate another wxDC object for background rendering. The Spread is just stored for external referance and is used to continue rendering during BackGnd redraw.
virtual BOOL InitDevice ()
 Initialises the render region's connection to the device information passed in to RenderRegion::AttachDevice.
virtual BOOL ImmediateRender ()
 Used to Draw something immediately.
virtual NodeGetBackmostChangedNode ()
virtual void SetBackmostChangedNode (Node *pInvalidNode)
 

virtual void ClearBackmostChangedNode (Node *pNode)
 

virtual BOOL RenderBits (LPBITMAPINFO lpBitmapInfo, LPBYTE lpBits, DocRect rect, BOOL bForceNoTransp=TRUE, Node *pEffectsOwner=NULL)
 To blit one bitmap defined by a DocRect into the current RenderRegion.
virtual BOOL RenderBits (LPBITMAPINFO lpBitmapInfo, LPBYTE lpBits, DocCoord *pCoords, INT32 numcoords, BOOL bForceNoTransp=TRUE, Node *pEffectsOwner=NULL)
 To blit one bitmap defined by a DocRect into the current RenderRegion.
virtual BOOL RenderBits (KernelBitmap *pkBitmap, DocCoord *pCoords, INT32 numcoords, BOOL bForceNoTransp, Node *pEffectsOwner)
 To blit one bitmap defined by a DocRect into the current RenderRegion.
virtual INT64 GetTotalCount ()
virtual INT64 GetStoredCount ()
virtual void SetStoredCount (INT64 llcount)
virtual void SetMatrix (Matrix &)
 This can be used to set the RenderRegions transform matrix to the given matrix. This should really be used with care!
Matrix GetMatrix ()
virtual Matrix ConcatenateMatrix (Matrix &)
 This can be used to add a transform in to the render regions transformation matrix. The function performs the following matrix operation :- MonoOn RenderMatrix = NewMatrix * RenderMatrix; MonoOff.
virtual BOOL StartRender ()
 Initialises the device attachment, if we haven't already done so for this render region. This is so that we can have a two-stage attachment of a device to a render region. This allows us to create render regions very quickly, which makes background rendering more efficient as quite often we will just throw them away without ever needing a proper connection to the device context.
virtual BOOL StopRender ()=0
virtual void SetClean (BOOL bResetChangedBounds, BOOL FillWhite)
 Virtual function used to inform render region that defers update that it should set its render state to be 'clean', i.e. if no more rendering occurs then it need not update the device. This is used for render regions such as GRenderRegions, where we render the paper using the host OS graphics primitives, but we have to render the paper into the GRenderRegion too, otherwise we will get garbage. Equally though, we don't want the GRenderRegion to do a potentially slow blit if all it is going to draw is some paper. It also allows the 'changed box' to be reset, so if we only have a small object on the page, then only the area containing the object is updated using a blit. The default implementation of this function does nothing - most render regions won't need to over-ride this null behaviour.
virtual BOOL IsClean ()
virtual BOOL CloseDown ()
 Base class declaration of the CloseDown function. It allows the CloseDown functions in the EPS and CMX filters to be virtual over-rides, which means that I don't need the IsKindOfs cluttering up the rendering loops.
virtual void ConditionalSuicide (void)
 Causes the object to commit suicide. This is to get around using a few if IS_A calls elsewhere in Camelot.
NodeGetRenderState ()
 Returns the Current Render State of the RenderRegion, which is a pointer to the next Node to render. If NULL then it is not currently rendering.
void SetRenderState (Node *RenderState)
SubRenderContextGetSubRenderState ()
void SetSubRenderState (SubRenderContext *SubRenderState)
BOOL IsSubRenderStateLocked (void) const
void LockSubRenderState (BOOL Lock)
CNativeDCGetRenderDC ()
INT32 GetTimeslice () const
void DefaultRender (BOOL bForceImmediate=FALSE)
 Calls the attatched view to render itself. This is used to continue rendering into a suspended RenderRegion.
ViewGetRenderView ()
SpreadGetRenderSpread ()
BOOL IsPrinting ()
BOOL IsRendering ()
BOOL IsVeryMono ()
BOOL IsHitDetect () const
BOOL IsUsingSmoothedBitmaps ()
void SetUsingSmoothedBitmaps (BOOL set)
void SaveContext ()
void RestoreContext ()
virtual BOOL SaveAttribute (UINT32 Index, AttributeValue *pAttr, BOOL Temp)
 Saves the current attribute on the attribute context stack, and installs the given attribute as the new attribute. If the attribute object is temporary, then it is deleted when the attribute is popped off the stack. See RenderRegion::RestoreAttribute.
void RestoreAttribute (UINT32 Index, AttributeValue *pAttr, BOOL Temp)
 Restore the given attribute to the current attribute array. This is called when the rendering context stack is popped - the current attribute is ousted (and deleted if it is a temporary object), and the given one is installed in its place.
virtual BOOL WantsGrids ()
 This function is designed to help with the rendering of grids, as they are not always wanted (eg xara eps). If your class of render region does not want grids to appear, then overide this function and get it to return FALSE. The default behaviour is to return TRUE, which will allow grids to render if they want to.
void SetBackgroundColour (DocColour &Colour)
 Sets the value of mBackground colour, which is used whenever the program needs to know what the background colour of a file is.
virtual void DrawPath (Path *PathToRender, PathProcessor *pCaller=NULL, PathShape psThis=PATHSHAPE_PATH)
 Renders a path (main entry-point). May start a binary-recursive rendering pipeline off by calling any active path processors to do their stuff.
PathProcessorGetFirstPathProcessor (void)
void PushPathProcessor (PathProcessor *pProcessor)
 Adds a PathProcessor to the rendering PathProcessor stack.
void PopPathProcessor (void)
 Pops a PathProcessor from the top of the rendering PathProcessor stack.
void EnableAllBrushPathProcessors (BOOL Enable)
 Enables or disables all the brush path processors on the stack.
virtual void DrawPathToOutputDevice (Path *PathToRender, PathShape shapePath=PATHSHAPE_PATH)=0
virtual void DrawRect (DocRect *RectToRender)=0
virtual void DrawDragRect (DocRect *RectToRender)=0
virtual void DrawDragBounds (DocRect *RectToRender)
 Used to draw a "rectangle" to screen (for dragging). However, the corners of the rectangle are passed through the current rendering matrix, so the rect may well be rotated or skewed by the time it reaches the screen.
virtual void DrawDashLine (const DocCoord &StartPoint, const DocCoord &EndPoint)
 Draws a dashed line between the two points. Uses the technology from DrawDragBounds().
virtual void DrawLine (const DocCoord &StartPoint, const DocCoord &EndPoint)=0
virtual void DrawPixel (const DocCoord &Point)=0
virtual void DrawBlob (DocCoord p, BlobType type)=0
virtual void DrawCross (const DocCoord &Point, const UINT32 Size)=0
virtual void DrawBitmap (const DocCoord &Point, KernelBitmap *pBitmap)=0
virtual void DrawBitmap (const DocCoord &Point, UINT32 BitmapID, UINT32 ToolID=0)=0
virtual BOOL DrawTransformedBitmap (NodeBitmap *pNodeBitmap)
virtual void DrawBitmapBlob (const DocCoord &Point, KernelBitmap *BlobShape)=0
virtual void DrawBitmapBlob (const DocCoord &Point, ResourceID resID)=0
virtual SlowJobResult DrawMaskedBitmap (const DocRect &Rect, KernelBitmap *pBitmap, MaskedRenderRegion *pMask, ProgressDisplay *Progress)
 Plots the bitmap using the mask supplied. The base class implementation here does nothing.
virtual void DrawFixedSystemText (StringBase *TheText, DocRect &BoundsRect, UINT32 uFormat=0x00000020|0x00000800|0x00000004)
 To draw simple text, using the default host-operating-system font. The size and style of this font are decided by the host OS (or oil code) and cannot be set in any way. To determine how much space is needed to display a string with this method, see the SeeAlso.
virtual void SetFixedSystemTextColours (DocColour *TextCol, DocColour *Background)
 To set the text and background colour(s) for any FixedSystem text rendered in this render region in the future (within the current rendering pass).
virtual void GetFixedSystemTextSize (StringBase *TheText, DocRect *BoundsRect, double *atDpi=NULL)
 To determine how much room is needed to plot a bit of text with RenderRegion::DrawFixedSystemText.
virtual BOOL DrawPathArrowHeads (DocCoord *Coords, PathVerb *Verbs, INT32 NumCoords)
 Draws arrows heads on the start or end of an open path, according to the current ArrowHead Attributes.
virtual BOOL DrawArrowHead (ArrowRec &ArrowToDraw, DocCoord &Centre, DocCoord &Direction, DocCoord *RetnCentre=NULL)
 Draw an Arrow head on the start or end of a line.
virtual void DrawPixelRect (DocRect *RectToRender)
 To try and plot a single pixel rectangle outline. It does this by using filled rectangles rather than just drawing the line itself. This is required because although GDI and GDraw fills can be made to match up, their outlines can't (at the time of writing). Assumes fill colour and line colour have already been set up along with a line width, usually assumed to be zero which means plot single-pixel lines. Usually, the fill colour is set to be the required line colour and the line colour is set to be transparent (COLOUR_TRANS).
virtual void DrawPixelLine (const DocCoord &StartPoint, const DocCoord &EndPoint)
 To try and plot a single pixel line. It does this by using a filled rectangle rather than just drawing the line itself. This is required because although GDI and GDraw fills can be made to match up, their outlines can't (at the time of writing). Assumes fill colour and line colour have already been set up along with a line width, usually assumed to be zero which means plot single-pixel lines. Usually, the fill colour is set to be the required line colour and the line colour is set to be transparent (COLOUR_TRANS).
virtual void SetLineColour (StrokeColourAttribute *, BOOL Temp)
 Set the current line colour according to an AttributeValue object, pushing the current line colour onto the context stack.
virtual void SetLineOverprint (OverprintLineAttrValue *, BOOL Temp)
 Set the line overprint state, pushing the current "overprint line" attribute onto the context stack.
virtual void SetLineTransp (StrokeTranspAttribute *, BOOL Temp)
 Set the current line colour according to an AttributeValue object, pushing the current line colour onto the context stack.
virtual void SetStrokeType (StrokeTypeAttrValue *, BOOL Temp)
 Set the current Stroke Type according to an AttributeValue object, pushing the current Stroke Type onto the context stack.
virtual void SetVariableWidth (VariableWidthAttrValue *, BOOL Temp)
 Set the current VariableWidth according to an AttributeValue object, pushing the current VariableWidth onto the context stack.
virtual void SetFillGeometry (ColourFillAttribute *, BOOL Temp)
 Set the current fill type according to an AttributeValue object, pushing the current fill type onto the context stack.
virtual void SetFillMapping (FillMappingAttribute *, BOOL Temp)
 Set the current fill type according to an AttributeValue object, pushing the current fill type onto the context stack.
virtual void SetFillEffect (FillEffectAttribute *, BOOL Temp)
 Set the current fill type according to an AttributeValue object, pushing the current fill type onto the context stack.
virtual void SetFillOverprint (OverprintFillAttrValue *, BOOL Temp)
 Set the fill overprint state, pushing the current "overprint fill" attribute onto the context stack.
virtual void SetTranspFillGeometry (TranspFillAttribute *, BOOL Temp)
 Set the current fill type according to an AttributeValue object, pushing the current fill type onto the context stack.
virtual void SetTranspFillMapping (TranspFillMappingAttribute *, BOOL Temp)
 Set the current fill type according to an AttributeValue object, pushing the current fill type onto the context stack.
virtual void SetPrintOnAllPlates (PrintOnAllPlatesAttrValue *, BOOL Temp)
 Set the PrintOnAllPlates state, pushing the current "print on all plates" attribute onto the context stack.
virtual void SetLineWidth (LineWidthAttribute *, BOOL Temp)
 Set the current line width according to an AttributeValue object, pushing the current linewidth onto the context stack.
virtual void SetStartCap (StartCapAttribute *, BOOL Temp)
 Set the current Line Cap according to an AttributeValue object, pushing the current LineCap the context stack.
virtual void SetStartArrow (StartArrowAttribute *, BOOL Temp)
 Set the current StartArrow according to an AttributeValue object, pushing the current StartArrow the context stack.
virtual void SetEndArrow (EndArrowAttribute *, BOOL Temp)
 Set the current EndArrow according to an AttributeValue object, pushing the current EndArrow the context stack.
virtual void SetJoinType (JoinTypeAttribute *, BOOL Temp)
 Set the current JoinType according to an AttributeValue object, pushing the current JoinType the context stack.
virtual void SetMitreLimit (MitreLimitAttribute *, BOOL Temp)
 Set the current MitreLimit according to an AttributeValue object, pushing the current MitreLimit the context stack.
virtual void SetDashPattern (DashPatternAttribute *, BOOL Temp)
 Set the current dash pattern according to an AttributeValue object, pushing the current dash pattern onto the context stack.
virtual void SetWindingRule (WindingRuleAttribute *, BOOL Temp)
 Set the current winding rule according to an AttributeValue object, pushing the current winding rule onto the context stack.
virtual void SetDrawingMode (DrawingModeAttribute *, BOOL Temp)
 Set the current drawing mode according to an AttributeValue object, pushing the current drawing mode onto the context stack.
virtual void SetQuality (QualityAttribute *, BOOL Temp)
 Set the current display quality according to an AttributeValue object, pushing the current quality onto the context stack.
virtual void SetWebAddress (WebAddressAttribute *, BOOL Temp)
 Set the current WebAddress.
virtual void SetTxtFontTypeface (TxtFontTypefaceAttribute *, BOOL Temp)
 Set the current Text Font Typeface according to an AttributeValue object, pushing the current Font Typeface onto the context stack.
virtual void SetTxtBold (TxtBoldAttribute *, BOOL Temp)
 Set the current Text Boldness according to an AttributeValue object, pushing the current Boldness onto the context stack.
virtual void SetTxtUnderline (TxtUnderlineAttribute *, BOOL Temp)
 Set the current Text Underline state according to an AttributeValue object, pushing the current Underline state onto the context stack.
virtual void SetTxtItalic (TxtItalicAttribute *, BOOL Temp)
 Set the current Text Italicness according to an AttributeValue object, pushing the current Italicness onto the context stack.
virtual void SetTxtAspectRatio (TxtAspectRatioAttribute *, BOOL Temp)
 Set the current Text Aspect Ratio according to an AttributeValue object, pushing the current Aspect Ratio onto the context stack.
virtual void SetTxtJustification (TxtJustificationAttribute *, BOOL Temp)
 Set the current Text Justification according to an AttributeValue object, pushing the current Justification onto the context stack.
virtual void SetTxtTracking (TxtTrackingAttribute *, BOOL Temp)
 Set the current Text Tracking according to an AttributeValue object, pushing the current Tracking onto the context stack.
virtual void SetTxtFontSize (TxtFontSizeAttribute *, BOOL Temp)
 Set the current Font Size according to an AttributeValue object, pushing the current font size state onto the context stack.
virtual void SetTxtScript (TxtScriptAttribute *, BOOL Temp)
 Set the current Text Script according to an AttributeValue object, pushing the current Script onto the context stack.
virtual void SetTxtBaseLine (TxtBaseLineAttribute *, BOOL Temp)
 Set the current Text BaseLine according to an AttributeValue object, pushing the current BaseLine onto the context stack.
virtual void SetTxtLineSpace (TxtLineSpaceAttribute *, BOOL Temp)
 Set the current Text LineSpace according to an AttributeValue object, pushing the current LineSpace onto the context stack.
virtual void SetTxtLeftMargin (TxtLeftMarginAttribute *, BOOL Temp)
 See other Set/Restore routines above.
virtual void SetTxtRightMargin (TxtRightMarginAttribute *, BOOL Temp)
virtual void SetTxtFirstIndent (TxtFirstIndentAttribute *, BOOL Temp)
virtual void SetTxtRuler (TxtRulerAttribute *, BOOL Temp)
virtual void SetSolidColours (BOOL SetSolid)
void SetLineColour (DocColour &NewLineColour)
 Set the line colour to a specific colour, pushing the current line colour onto the context stack.
void SetLineColour (StockColour NewLineColour)
 Set the line colour to a specific colour, pushing the current line colour onto the context stack.
void SetFillColour (DocColour &NewFillColour)
 Set the fill colour to a specific colour, pushing the current fill colour onto the context stack.
void SetFillColour (StockColour NewFillColour)
 Set the fill colour to a specific colour, pushing the current fill colour onto the context stack.
void SetLineWidth (MILLIPOINT NewLineWidth)
 Set the line width to a specific size, pushing the current line width onto the context stack.
void SetStartCap (LineCapType NewStartCap)
 Set the current Line Cap according to an AttributeValue object, pushing the current LineCap the context stack.
void SetStartArrow (StockArrow NewStartArrow)
 Set the current StartArrow according to an AttributeValue object, pushing the current Arrow the context stack.
void SetEndArrow (StockArrow NewEndArrow)
 Set the current EndArrow according to an AttributeValue object, pushing the current Arrow the context stack.
void SetStartArrow (ArrowRec &NewStartArrow)
 Set the current StartArrow according to an AttributeValue object, pushing the current Arrow the context stack.
void SetEndArrow (ArrowRec &NewEndArrow)
 Set the current EndArrow according to an AttributeValue object, pushing the current Arrow the context stack.
void SetJoinType (JointType NewJoinType)
 Set the current JoinType according to an AttributeValue object, pushing the current JoinType the context stack.
void SetMitreLimit (MILLIPOINT NewMitreLimit)
 Set the current MitreLimit according to an AttributeValue object, pushing the current Arrow the context stack.
void SetDashPattern (DashRec &NewDashPattern)
 Set the dash pattern, pushing the current dash pattern onto the context stack.
void SetDashPattern (StockDash NewDashPattern)
 Set the dash pattern, pushing the current dash pattern onto the context stack.
void SetWindingRule (WindingType NewWindingRule)
 Set the winding rule, pushing the current winding rule onto the context stack.
void SetDrawingMode (DrawModeType NewDrawingType)
 Set the drawing mode, pushing the current drawing mode onto the context stack.
void SetDefaultQuality ()
 Set the quality attribute to the default setting, pushing the current quality level onto the context stack.
void SetDeviceDashPattern (DashRec &NewDashPattern)
 Set the dash pattern, pushing the current dash pattern onto the context stack.
void SetDeviceDashPattern (StockDash NewDashPattern)
 Set the dash pattern, pushing the current dash pattern onto the context stack.
virtual void SetOffscreen (OffscreenAttrValue *pAttr)
 Uses attribute stacking to offscreen rendering system notified when offscreen bitmap has been rendered (ie occurs when subtree is finished rendering and attributes are being restored).
virtual void SetClipRegion (ClipRegionAttribute *, BOOL Temp)
 Set this render-region's current clipping region. See also: ClipRegionAttribute::Render(), RenderRegion::RestoreClipRegion().
virtual CCachedBitmap GrabBitmap (DocRect rectGrab)
virtual void RestoreLineColour (StrokeColourAttribute *, BOOL)
 Get rid of the current line colour, and restore the specified line colour value.
virtual void RestoreLineOverprint (OverprintLineAttrValue *, BOOL)
 Restore the previous Line Overprint state, popping the previous state from the rendering stack.
virtual void RestoreLineTransp (StrokeTranspAttribute *, BOOL)
 Get rid of the current line colour, and restore the specified line colour value.
virtual void RestoreStrokeType (StrokeTypeAttrValue *, BOOL)
 Get rid of the current stroke type, and restore the specified stroke type.
virtual void RestoreVariableWidth (VariableWidthAttrValue *, BOOL)
 Get rid of the current VariableWidth, and restore the specified VariableWidth.
virtual void RestoreFillGeometry (ColourFillAttribute *, BOOL)
 Get rid of the current fill type, and restore the specified fill type.
virtual void RestoreFillMapping (FillMappingAttribute *, BOOL)
 Get rid of the current fill type, and restore the specified fill type.
virtual void RestoreFillOverprint (OverprintFillAttrValue *, BOOL)
 Restore the previous Fill Overprint state, popping the previous state from the rendering stack.
virtual void RestoreTranspFillGeometry (TranspFillAttribute *, BOOL)
 Get rid of the current fill type, and restore the specified fill type.
virtual void RestoreTranspFillMapping (TranspFillMappingAttribute *, BOOL)
 Get rid of the current fill type, and restore the specified fill type.
virtual void RestoreFillEffect (FillEffectAttribute *, BOOL)
 Get rid of the current fill type, and restore the specified fill type.
virtual void RestoreLineWidth (LineWidthAttribute *, BOOL)
 Get rid of the current line width, and restore the specified line width.
virtual void RestoreDrawingMode (DrawingModeAttribute *, BOOL)
 Get rid of the current drawing mode, and restore the specified drawing mode.
virtual void RestoreWindingRule (WindingRuleAttribute *, BOOL)
 Get rid of the current winding rule, and restore the specified winding rule.
virtual void RestoreStartCap (StartCapAttribute *, BOOL)
 Get rid of the current start cap, and restore the specified one.
virtual void RestoreJoinType (JoinTypeAttribute *, BOOL)
 Get rid of the current JoinType, and restore the specified one.
virtual void RestoreQuality (QualityAttribute *, BOOL)
 Get rid of the current quality level, and restore the specified quality level.
virtual void RestoreDashPattern (DashPatternAttribute *, BOOL)
 Get rid of the current dash pattern, and restore the specified one.
virtual void RestoreStartArrow (StartArrowAttribute *, BOOL)
 Get rid of the current StartArrow, and restore the specified one.
virtual void RestoreEndArrow (EndArrowAttribute *, BOOL)
 Get rid of the current EndArrow, and restore the specified one.
virtual void RestoreMitreLimit (MitreLimitAttribute *, BOOL)
 Get rid of the current MitreLimit, and restore the specified one.
virtual void RestoreWebAddress (WebAddressAttribute *, BOOL)
 Restore the Web Address.
virtual void RestorePrintOnAllPlates (PrintOnAllPlatesAttrValue *, BOOL)
 Restore the previous print-on-all-plates state, popping the previous state from the rendering stack.
void RestoreTxtFontTypeface (TxtFontTypefaceAttribute *, BOOL)
 Get rid of the current Text Font Typeface, and restore the specified Typeface value.
void RestoreTxtBold (TxtBoldAttribute *, BOOL)
 Get rid of the current Text Boldness, and restore the specified Boldness value.
void RestoreTxtUnderline (TxtUnderlineAttribute *, BOOL)
 Get rid of the current Text underline state, and restore the specified underline value.
void RestoreTxtItalic (TxtItalicAttribute *, BOOL)
 Get rid of the current Text Italicness, and restore the specified Italicness value.
void RestoreTxtAspectRatio (TxtAspectRatioAttribute *, BOOL)
 Get rid of the current Text Aspect Ratio, and restore the specified Aspect Ratio value.
void RestoreTxtJustification (TxtJustificationAttribute *, BOOL)
 Get rid of the current Text Justification, and restore the specified Justification value.
void RestoreTxtTracking (TxtTrackingAttribute *, BOOL)
 Get rid of the current Text Tracking, and restore the specified Tracking value.
void RestoreTxtFontSize (TxtFontSizeAttribute *, BOOL)
 Get rid of the current font size, and restore the specified font size.
void RestoreTxtScript (TxtScriptAttribute *, BOOL)
 Get rid of the current Text Script, and restore the specified Script value.
void RestoreTxtBaseLine (TxtBaseLineAttribute *, BOOL)
 Get rid of the current Text BaseLine, and restore the specified BaseLine value.
void RestoreTxtLineSpace (TxtLineSpaceAttribute *, BOOL)
 Get rid of the current Text LineSpace, and restore the specified LineSpace value.
void RestoreTxtLeftMargin (TxtLeftMarginAttribute *, BOOL)
void RestoreTxtRightMargin (TxtRightMarginAttribute *, BOOL)
void RestoreTxtFirstIndent (TxtFirstIndentAttribute *, BOOL)
void RestoreTxtRuler (TxtRulerAttribute *, BOOL)
virtual void RestoreOffscreen (OffscreenAttrValue *)
virtual void RestoreClipRegion (ClipRegionAttribute *, BOOL)
 Restore this render-region's current clipping region, using the attribute supplied. See also: ClipRegionAttribute::Restore(), RenderRegion::SetClipRegion().
AttributeValueGetCurrentAttribute (UINT32 Index)
 Get a pointer to one of the render region's current attributes. The index indicates which kind of attribute should be returned.
OffscreenAttrValueGetCurrentOffscreenAttr ()
virtual BOOL CheckOffscreenBounds ()
void SetClipRect (DocRect &NewClipRect, BOOL ReCalcContextNode=FALSE)
 Sets the Clipping rectangle of the Render Region. Calls InitClipping() to acually set the clip region in an OS specific way.
DocRect GetClipRect ()
 Returns the clipping rectangle of the Render Region.
MILLIPOINT GetPixelWidth ()
MILLIPOINT GetScaledPixelWidth ()
virtual double GetPixelsPerInch ()
virtual void GetRenderRegionCaps (RRCaps *pCaps)
 This function allows a render region to declare what it can render and what it can not render. This base class version of the function says that it can render none of the options. If your render region can do some of these things then you should overide this function and set the appropriate flags.
BOOL SetRenderComplexShapes (BOOL NewState)
 This function sets the state of the flag RenderComplexShapes. This flag is used by some classes of render region to decide what shapes to draw. If the flag is TRUE, then all shapes will be drawn that are asked to be drawn. If it is FALSE, only the shapes that are not considered to be complex by the render region will rendered. OSRenderRegions use this, as they can be used as part of the 3 phase rendering system that needs to render only specific nodes.
BOOL TestForComplexShape (RRCaps *pCaps)
 This function is called whenever someone calls one of the primitive render functions in a ScanningRenderRegion. This takes a look at all the attributes (and anything else it might need to) to see if this represents a complex shape or not. If it is a complex shape, all the internal data members of the render region are updated accordingly. This function makes use of the RRCaps object that was set with the SetHostRRCaps() function to see what things the Host render region considers to be complex.
EFFECTTYPE GetFillEffect ()
 Decide what type of colour fade to use. Scope: Public.
void SetFilter (Filter *pFilter)
FilterGetFilter ()
virtual void ResizeRegion (DocRect &NewClipRect)
 Called when a Region is changed in size (eg. clipped to the client area).
virtual void ResetRegion (DocRect &NewClipRect)
 Resets the render region (after it has been merged), so that it no longer thinks it is banded etc. It also takes the Regions rectangle from the Current Clipping rectangle, so set this correctly before calling this function.
virtual BOOL SetFirstBand ()
 This function gives the render region a chance to see if it want to do some banding or not. If it decides it does, then this function will set it all up ready to start. It should be called before StartRender.
virtual BOOL GetNextBand ()
 This function goes and sets up the next band in the render region ready for rendering and returns TRUE if it went OK. If there are no more bands to render then the function returns FALSE.
DocRect GetRegionRect ()
 This function returns the size of the whole render region. Note that this may be different from the Clip rect. If the region is banded, then the Clip rect will hold the rect of the band that is being rendered, while the RegionRect will always hold the rect the whole region.
BOOL IsBanded ()
 To find out if the render region is banded.
BOOL CanBeMerged ()
 This is used to help simplify the merging code with banded region. A banded render region at the start of one of its bands looks similar to a render region that has done no rendering yet, and may be merged. This function allows banded regions to stop themselves from being merged after they have started rendering into their first band.
BOOL ResetColourContext ()
ColourContextGetColourContext ()
virtual void ResetRender ()
 Reset the rendering state of this region.
virtual BOOL RenderChar (WCHAR ch, Matrix *pMatrix)
 Render a character, using the specified transform and current attributes in the render region.
virtual BOOL WriteNewLine (void)
 Writes in a new-line token if necessary. In this class, it's just a stub function that's over-ridden in the derived classes.
PathCreateCharPath (WCHAR ch, Matrix *pMatrix=NULL)
 Create a path of the specified char, using the specified transform and current attributes in the render region Note: The caller is resposible for initialising the path's flags if required.
BOOL GetAttrdCharBounds (DocRect *pRect, WCHAR ch)
 Get the bounding box of the specified char (from a cache) and apply the required transform depending on attributes (this is a character relative rect!).
BOOL GetCharAttributeMatrix (Matrix *pAttrMatrix)
 calc attribute matrix based on FontSize, AspectRatio and Script attributes
void ColourCorrectBitmap (BitmapFillAttribute *Fill, BITMAPINFO *Info, RGBQUAD **Palette)
 Applies colour correction and/or contoning to a paletted bitmap being plotted.
BOOL RenderTree (Node *pRoot, BOOL bTimeSlice=TRUE, BOOL bClip=TRUE, RenderCallback *pCallback=NULL)
 To render a specified subtree in this RenderRegion. The dominating factor in this routine is that it renders the document with as little time overhead as possible. Obviously, this is mainly down to RenderRegions and the tree scanning routines working fast but we can do a bit to help.
BOOL RenderTreeCanContinue ()
 Decide whether we can continue to render in RenderTree.
BOOL RenderTreeNoCache (Node *pRoot)
 Renders a subtree with cacheing disabled.
virtual BOOL IsWrappedRender () const
virtual BOOL TranspTypeIsRGBTCompatible (UINT32 ttype) const
virtual BOOL SetSmoothingFlags (FillGeometryAttribute *Fill)
virtual BOOL RenderPaperAsInk ()
void SetImmediateRender (BOOL SetVal)
BOOL GetImmediateRender () const
void SetForceMixTransparency (BOOL bForceMix)
virtual CaptureStartCapture (CCObject *pOwner, DocRect CaptureRect, CAPTUREINFO cinfo, BOOL bTransparent=TRUE, BOOL bCaptureBackground=FALSE, double mpPixelWidth=0, NodeRenderableInk *pDirectSupplier=NULL)
 To start a bitmap capture of whatever is subsequently rendered.
virtual BOOL StopCapture (CCObject *pOwner, BOOL bRender=TRUE, BOOL bReleaseBitmap=FALSE, LPBITMAPINFO *plpBitmapInfo=NULL, LPBYTE *plpBits=NULL, DocRect *pCaptureRect=NULL, Matrix *pmatTransform=NULL, double *pdResolution=NULL)
 To stop a bitmap capture.
virtual BOOL ChangeCapture (CAPTUREINFO cinfo, BOOL bTransparent=TRUE, BOOL bCaptureBackground=FALSE)
 To inform the capture stack that things (transparency) have changed.
virtual INT32 GetCaptureDepth ()
virtual BOOL MasterCaptureIsCurrent () const
virtual CaptureGetTopCapture () const
virtual CaptureGetMasterCapture () const
virtual BOOL LockedTransparentCaptures () const
 Search down the Capture stack from the top or from the capture specified until we find one that owns a bitmap. The master capture at the bottom of the stack should ALWAYS own a bitmap!

Static Public Member Functions

static BOOL Init ()
 Initialise the render region.
static BOOL InitPrefs ()
 Initialises the RenderRegions preferences from the preference file. This is called once as Camelot starts up.

Public Attributes

DrawModeType DrawingMode
BOOL IsWaitingForRAM
BOOL IsLastBand
BOOL NeedsOSPaper
BOOL RenderOSPaper
BOOL IsPaperRendered
BOOL IsInkRenderStarted
Quality RRQuality
BOOL m_DoCompression

Protected Member Functions

virtual BOOL SetRenderToCapture (Capture *pCapture, BOOL ApplyClipRegion, BOOL bSetBitmap)
StrokeColourAttributePrepareLineColour (StrokeColourAttribute *SourceAttr=NULL)
 This function is used to allow 3 special attributes to function correctly. => Overprint line, Overprint fill, and Print on all plates.
ColourFillAttributePrepareFillGeometry (ColourFillAttribute *SourceAttr=NULL)
 This function is used to allow 3 special attributes to function correctly. => Overprint line, Overprint fill, and Print on all plates.
virtual void InitClipping ()=0
virtual void InitAttributes ()=0
virtual void SetLineAttributes (ChangeLineAttrType=CHANGELINEATTR_ALL)
 Inform the render region that an aspect of the path stroking attributes has changed. The base class version just updates the RenderRegion member variable StrokeFlags to reflect which aspects of the stroke attributes have become invalid. Derived render regions can either call the base class or just implement whatever methods they need for keeping track of these changes - or a combination of the two, of course. Some render regions (e.g. GRenderRegions) don't need to do anything about this at all as all attributes are invoked whenever anything is rendered. If this is the case, then this should be over-ridden to have a NULL implementation because this will improve rendering speed.
virtual void SetFillAttributes (ChangeAttrType Type=CHANGEATTR_ALL)
 Inform the render region that an aspect of the path filling attributes has changed. The base class version just updates the RenderRegion member variable FillFlags to reflect which aspects of the fill attributes have become invalid. Derived render regions can either call the base class or just implement whatever methods they need for keeping track of these changes - or a combination of the two, of course. Some render regions (e.g. GRenderRegions) don't need to do anything about this at all as all attributes are invoked whenever anything is rendered. If this is the case, then this should be over-ridden to have a NULL implementation because this will improve rendering speed.
virtual void SetTextAttributes (ChangeFillAttrType Type=CHANGEFILLATTR_ALL)
 Inform the render region that an aspect of the path filling attributes has changed. The base class version just updates the RenderRegion member variable FillFlags to reflect which aspects of the fill attributes have become invalid. Derived render regions can either call the base class or just implement whatever methods they need for keeping track of these changes - or a combination of the two, of course. Some render regions (e.g. GRenderRegions) don't need to do anything about this at all as all attributes are invoked whenever anything is rendered. If this is the case, then this should be over-ridden to have a NULL implementation because this will improve rendering speed.
virtual BOOL RenderNode (Node *pNode, Node *pRunToNode, RenderCallback *pCallback)
 Wrap up the common stuff that's done to every node we render Render a single node and find out whether we should suspend rendering at this point Helper function for RenderTree.
virtual void SetOSDrawingMode ()=0
virtual void SetQualityLevel ()
 Does nothing.
virtual MILLIPOINT CalcPixelWidth ()=0
virtual MILLIPOINT CalcScaledPixelWidth ()=0
BOOL TryToFuzzyClip (Path *pPath, DocCoord **pNewCoords, PathVerb **pNewVerbs, UINT32 *NewNumCoords)
 This function works out if clipping is needed (based on scale factor etc) and tries to clip the paths. If it works it will return TRUE, meaning that you should only try to draw that path info found in pNewCoords etc. If FALSE is returned pNewCoords etc will all be NULL. If this function returns TRUE it will have allocated memory to put the new coords and verbs in. It will be your responsibility to delete this memory after you have rendered the path.
void SetupFuzzyClipRects ()
 Sets up the fuzzy clipping rects, basing them on the CurrentClipRect. Don't ask me what they're used for - I'm just moving some useful code into a function :o).
BOOL CopyCurrentAttributes (const RenderRegion &)
 Copy the current attribute array of another render region into this render region. The copying is intelligent; i.e. if the other array contains 'temporary' objects, then it will copy them, so two render regions don't try to delete the same object when their destructor is called.

Protected Attributes

StackT< Capture * > m_CaptureStack
DocColour mBackgroundColour
DocRect InnerRect
DocRect OuterRect
BOOL RenderComplexShapes
INT64 m_countTotal
INT64 m_countStored
CCAPI RenderRegion::FlagBlock RenderFlags
RenderRegion::_StrokeFlags StrokeFlags
RenderRegion::_FillFlags FillFlags
RenderRegion::_TextFlags TextFlags
Matrix RenderMatrix
DocRect CurrentClipRect
ColourContextCurrentColContext
ViewRenderView
CNativeDCRenderDC
SpreadRenderSpread
bool m_fOwned
NodeCurrentRenderState
SubRenderContextCurrentSubRenderState
BOOL SubRenderStateLocked
FIXED16 ScaleFactor
AttributeEntryCurrentAttrs
INT32 NumCurrentAttrs
OffscreenAttrValueCurrentOffscreenAttr
INT32 Timeslice
BOOL m_bRenderTreeTimeSlice
MonotonicTime m_timeRenderTreeStartTime
MILLIPOINT PixelWidth
MILLIPOINT ScaledPixelWidth
RenderStack TheStack
DocRect RegionRect
BOOL IsRegionBanded
BOOL CanRegionBeMerged
Nodem_pBackmostChangedNode
BOOL IsBeingReset
Filterm_pFilter
BOOL m_bForceMix

Static Protected Attributes

static UINT32 SelectedBlobSize = 3
 The number represents the size of the blobs on the control points of selected objects. The Selected Blob Size is the size of the blobs when they have been clicked on.
static UINT32 UnSelectedBlobSize = 2
 The number represents the size of the blobs on the control points of selected objects. The UnSelected Blob Size is the size of the blobs when the object is selected, but none of its control points have been clicked on (and are not themselves selected).
static UINT32 MultiStageSelectedBlobSize = 4
static UINT32 MultiStageUnSelectedBlobSize = 3
static UINT32 ClipViewBlobSize = 8
 This number represents the size of the ClipView's special selection blobs. These blobs are only visible on selected ClipView groups when using the selector tool, and are used to select different sections of the group.

Private Attributes

PathProcessorPathProcessorStack

Classes

struct  _FillFlags
struct  _StrokeFlags
struct  _TextFlags
struct  FlagBlock

Detailed Description

THIS IS AN ABSTRACT CLASS. Don't try to create a RenderRegion itself, but rather create one of it's derived classes. A RenderRegion object is created when an area of the screen/printer (or any destination) has become invalid and needs to be redrawn. It 'lives' for as long as that region is still invalid. It is also used for e.g. exporting files or in smart click detection. Background rendering and region merging is achieved by using a List of Render Region objects. When a new region becomes invalid, a RenderRegion is created and added to that list. If the rendering is interrupted before it is complete, then it will continue again when the OnIdle routine scans through the list of RenderRegions. RenderRegions can also be created at other times for Immediate rendering. To use a RenderRegion, create an OSRenderRegion or a GRenderRegion depending on the method of rendering required, then Attach a DC and CWnd to the region to specify the Render destination. Next call InitRender which will return the RenderRegions previous render state if it had been interrupted or Null if it has just been created. You can then set attributes, Save/Restore them, and Render objects. When rendering is complete, call ExitRender passing the current render state.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/5/93
See also:
class OSRenderRegion; class GRenderRegion

Definition at line 373 of file rndrgn.h.


Constructor & Destructor Documentation

RenderRegion::RenderRegion  ) 
 

Used by the RectTool to suspend background redrawing. Used by DocView::CanContinue Default Constructor for RenderRegion Class.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/5/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 309 of file rndrgn.cpp.

00310 {
00311     NumCurrentAttrs = 0;
00312     CurrentAttrs = NULL;
00313 
00314     // By default try to render everything
00315     RenderComplexShapes = TRUE;
00316 
00317     TRACEUSER("Gavin",_T("RenderRegion::RenderRegion - RenderFlags.Rendering = FALSE;\n"));
00318     RenderFlags.Printing = FALSE;
00319     RenderFlags.Rendering = FALSE;
00320     RenderFlags.StackClaimed = FALSE;
00321     RenderFlags.ValidDevice = FALSE;
00322     RenderFlags.bImmediateRender = FALSE;
00323     RenderFlags.VeryMono = FALSE;
00324     RenderFlags.SmoothedBitmaps = FALSE;
00325     RenderFlags.HitDetect = FALSE;
00326 
00327     // All fill attributes are invalid to start with.
00328     FillFlags.ValidGeometry         = FALSE;
00329     FillFlags.ValidEffect           = FALSE;
00330     FillFlags.ValidMapping          = FALSE;
00331     FillFlags.ValidTransGeometry    = FALSE;
00332     FillFlags.ValidTransEffect      = FALSE;
00333     FillFlags.ValidTransMapping     = FALSE;
00334 
00335     StrokeFlags.ValidStrokeColour   = FALSE;
00336     StrokeFlags.ValidStrokeTransp   = FALSE;
00337     StrokeFlags.ValidLineWidth      = FALSE;
00338     StrokeFlags.ValidJoinType       = FALSE;
00339     StrokeFlags.ValidDashPattern    = FALSE;
00340     StrokeFlags.ValidLineCap        = FALSE;
00341     StrokeFlags.ValidStartArrow     = FALSE;
00342     StrokeFlags.ValidEndArrow       = FALSE;
00343     StrokeFlags.ValidMitreLimit     = FALSE;
00344 
00345     NeedsOSPaper = TRUE;
00346 
00347     DrawingMode = DM_COPYPEN;
00348     CurrentColContext = NULL;
00349 
00350     // Now setup the render state
00351     CurrentRenderState = NULL;
00352     CurrentSubRenderState = NULL;
00353     SubRenderStateLocked = FALSE;
00354 
00355     // Set the Fuzzy Clipping Rects to something
00356     InnerRect.MakeEmpty();
00357     OuterRect.MakeEmpty();
00358 
00359     // Set up vars to do with banded rendering
00360     RegionRect.MakeEmpty();
00361     IsRegionBanded = FALSE;
00362     CanRegionBeMerged = TRUE;
00363     IsWaitingForRAM = FALSE;
00364     IsLastBand = TRUE;
00365     IsBeingReset = FALSE;
00366     IsInkRenderStarted = FALSE;
00367     IsPaperRendered = FALSE;
00368 
00369     PathProcessorStack = NULL;
00370 
00371     // MarkH 23/7/99 - New Flag to wether or not to use the GDraw BiCompression Field!
00372     m_DoCompression = FALSE;
00373 
00374     m_pFilter = NULL;
00375 
00376     m_pBackmostChangedNode = NULL;
00377     m_timeRenderTreeStartTime.Sample();
00378     m_bRenderTreeTimeSlice = FALSE;
00379     m_countTotal = 0;
00380     m_countStored = 0;
00381 
00382     RenderDC = NULL;
00383     m_fOwned = FALSE;
00384     ScaleFactor = FIXED16(1);
00385 
00386     m_bForceMix = FALSE;
00387 
00388 //  double m_dboostm = 1.0;
00389 //  double m_dboostc = 0.0;
00390 
00391 #ifdef _DEBUG
00392     m_CurrentContextLevel = 0;
00393     m_TraceOutContextLevels = FALSE;
00394 //  m_TraceOutContextLevels = TRUE;
00395 #endif
00396 }

RenderRegion::RenderRegion DocRect  ClipRect,
Matrix  ConvertMatrix,
FIXED16  ViewScale
 

Constructor for a RenderRegion, allowing a invalid rectangle to be specified. The matrix passed is used to convert Document coords into device coords, taking into account scaling, scroll offsets etc.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/5/93
Parameters:
ClipRect is a DocRect defining the invalid rectangle to be rendered. [INPUTS] ConvertMatrix is a Matrix for converting Doc coords to OS coords. ViewScale is the scale factor of the view, used to calculate how much to flatten paths.
- [OUTPUTS]
Returns:
-

Errors: -

See also:
OSRenderRegion::OSRenderRegion()

Definition at line 418 of file rndrgn.cpp.

00419 {
00420     NumCurrentAttrs = 0;
00421     CurrentAttrs = NULL;
00422 
00423     // By default try to render everything
00424     RenderComplexShapes = TRUE;
00425 
00426     CurrentClipRect = ClipRect;
00427 
00428     RenderMatrix = ConvertMatrix;
00429 
00430 //  TRACE( _T("RR ClipRect = (%d, %d) - (%d, %d)\n"), ClipRect.lo.x, ClipRect.lo.y, ClipRect.hi.x, ClipRect.hi.y);
00431 //  RenderMatrix.Dump();
00432 
00433     ScaleFactor = ViewScale;
00434 
00435     RenderView = NULL;
00436     RenderDC = NULL;
00437     m_fOwned = FALSE;
00438 
00439     TRACEUSER("Gavin",_T("RenderRegion::RenderRegion - RenderFlags.Rendering = FALSE;\n"));
00440     RenderFlags.Printing = FALSE;
00441     RenderFlags.Rendering = FALSE;
00442     RenderFlags.StackClaimed = FALSE;
00443     RenderFlags.ValidDevice = FALSE;
00444     RenderFlags.bImmediateRender = FALSE;
00445     RenderFlags.VeryMono = FALSE;
00446     RenderFlags.SmoothedBitmaps = FALSE;
00447     RenderFlags.HitDetect = FALSE;
00448 
00449     DrawingMode = DM_COPYPEN;
00450 
00451     CurrentColContext = NULL;
00452 
00453     PixelWidth = 1;
00454     ScaledPixelWidth = 1;
00455 
00456     // Now setup the render state
00457     CurrentRenderState = NULL;
00458     CurrentSubRenderState = NULL;
00459     SubRenderStateLocked = FALSE;
00460 
00461     NeedsOSPaper = TRUE;
00462 
00463     // No paper has been rendered yet
00464     IsPaperRendered = FALSE;
00465     IsInkRenderStarted = FALSE;
00466 
00467     Timeslice = 100;                                            // 0.1 of a second
00468 
00469     // Set the Fuzzy Clipping Rects to something
00470     InnerRect.MakeEmpty();
00471     OuterRect.MakeEmpty();
00472 
00473     // Set up vars to do with banded rendering
00474     RegionRect = ClipRect;
00475     IsRegionBanded = FALSE;
00476     CanRegionBeMerged = TRUE;
00477     IsWaitingForRAM = FALSE;
00478     IsLastBand = TRUE;
00479     // Ilan
00480     IsBeingReset = FALSE;
00481 
00482     PathProcessorStack = NULL;
00483 
00484     m_pFilter = NULL;
00485 
00486     m_pBackmostChangedNode = NULL;
00487     m_timeRenderTreeStartTime.Sample();
00488     m_bRenderTreeTimeSlice = FALSE;
00489     m_countTotal = 0;
00490     m_countStored = 0;
00491 
00492     m_bForceMix = FALSE;
00493 
00494 #ifdef _DEBUG
00495     m_CurrentContextLevel = 0;
00496     m_TraceOutContextLevels = FALSE;
00497 //  m_TraceOutContextLevels = TRUE;
00498 #endif
00499 }

RenderRegion::RenderRegion const RenderRegion other  ) 
 

Copy Constructor for RenderRegion. This conctructs a RenderRegion based on another. This involves copying all the current attributes and also making a copy of the ContextStack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/7/93
Parameters:
The RenderRegion to copy [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 518 of file rndrgn.cpp.

00519 {
00520     PathProcessorStack = NULL;      // We don't copy the PPStack - that's done as attrs are copied
00521 
00522     CurrentClipRect = other.CurrentClipRect;
00523 
00524     RenderComplexShapes = other.RenderComplexShapes;
00525 
00526     RenderMatrix = other.RenderMatrix;
00527     ScaleFactor = other.ScaleFactor;
00528 
00529     RenderView = other.RenderView;
00530     RenderDC = other.RenderDC;
00531     m_fOwned = other.m_fOwned;
00532 //  DCHandle = other.DCHandle;
00533 
00534     RenderFlags = other.RenderFlags;
00535 
00536     RenderSpread = other.RenderSpread;
00537     CurrentColContext = other.CurrentColContext;
00538 
00539     PixelWidth = other.PixelWidth;
00540     ScaledPixelWidth = other.ScaledPixelWidth;
00541 
00542     Timeslice = other.Timeslice;
00543     RRQuality = other.RRQuality;
00544 
00545     NeedsOSPaper = other.NeedsOSPaper;
00546 
00547     // No paper has been rendered yet
00548     IsPaperRendered = other.IsPaperRendered;
00549     IsInkRenderStarted = other.IsInkRenderStarted;
00550 
00551 
00552     // Now setup the render state 
00553     CurrentRenderState = other.CurrentRenderState;
00554 //  CurrentSubRenderState = other.CurrentSubRenderState;
00555     CurrentSubRenderState = NULL;
00556     SubRenderStateLocked = FALSE;
00557 
00558     // Copy the current attributes
00559     NumCurrentAttrs = 0;        // We're constructing, so we have no current attrs yet
00560     CurrentAttrs = NULL;
00561     if (!CopyCurrentAttributes(other))
00562     {
00563         // Unable to copy the current attributes
00564         ENSURE(FALSE, "Unable to copy current attributes");
00565         InformError();
00566         return;
00567     }
00568     
00569     // Now make a copy of the ContextSatck
00570     if (!TheStack.Copy(&other.TheStack, this))
00571     {
00572         // Unable to copy the render stack
00573         ENSURE(FALSE, "Unable to copy Rendering stack");
00574         InformError();
00575         return;
00576     }
00577 
00578     DrawingMode = other.DrawingMode;
00579 
00580     // Set the Fuzzy Clipping Rects to something
00581     InnerRect = other.InnerRect;
00582     OuterRect = other.OuterRect;
00583 
00584     // Set up vars to do with banded rendering
00585     RegionRect = other.RegionRect;
00586     IsRegionBanded = other.IsRegionBanded;
00587     CanRegionBeMerged = other.CanRegionBeMerged;
00588     IsWaitingForRAM = other.IsWaitingForRAM;
00589     IsLastBand = other.IsLastBand;
00590     // Ilan
00591     IsBeingReset = FALSE;
00592 
00593     m_pFilter = other.m_pFilter;
00594 
00595     m_pBackmostChangedNode = other.m_pBackmostChangedNode;
00596     m_timeRenderTreeStartTime = other.m_timeRenderTreeStartTime;
00597     m_bRenderTreeTimeSlice = other.m_bRenderTreeTimeSlice;
00598     m_countTotal = other.m_countTotal;
00599     m_countStored = other.m_countStored;
00600 
00601     m_bForceMix = other.m_bForceMix;
00602 
00603 #ifdef _DEBUG
00604     m_CurrentContextLevel = 0;
00605     m_TraceOutContextLevels = FALSE;
00606 //  m_TraceOutContextLevels = TRUE;
00607 #endif
00608 }

RenderRegion::~RenderRegion  )  [virtual]
 

Default Destructor for RenderRegion Class. Releases any memory claimed for the ContextStack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/5/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
OSRenderRegion::~OSRenderRegion()

Definition at line 644 of file rndrgn.cpp.

00645 {
00646     // Ilan
00647     IsBeingReset = TRUE;
00648 
00649     // Get rid of any stacked Captures
00650     Capture* pCapture = GetTopCapture();
00651     while (pCapture)
00652     {
00653         ENSURE(!pCapture->OwnsBitmap(), "Capture unexpectedly owns bitmap in RenderRegion::ResetRegion");
00654 
00655         m_CaptureStack.Pop();
00656 //TRACEUSER( "Phil", _T("~RenderRegion Pop/Delete Capture\n"));
00657         if (pCapture->IsMaster())
00658         {
00659             SetRenderToCapture(pCapture, FALSE, FALSE);
00660         }
00661         else
00662         {
00663             pCapture->FreeDIB();
00664         }
00665         delete pCapture;
00666 
00667         pCapture = GetTopCapture();
00668     }
00669 
00670 
00671     if( m_fOwned )
00672     {
00673         delete RenderDC;
00674         RenderDC = NULL;
00675     }
00676 
00677 // Webster - markn 15/8/97
00678 // This has been taken out of Webster builds as it can cause fatal access violations with Paper render regions.
00679 // It is new path processor code that not's totally bug-free, and as path processors are not used in Webster,
00680 // it can be safely taken out.
00681 // Now taken out via new VECTOR_STROKING flag Neville 2/10/97 
00682 #ifdef VECTOR_STROKING
00683     // Ask the RenderStack to pop all attributes off itself. This gives them a chance
00684     // to clean up properly (remove PathProcessors etc).
00685     TheStack.CleanUpBeforeDestruct(this);
00686 #endif // VECTOR_STROKING
00687 
00688     // Nearly always non-NULL, but e.g. PaperRenderRegions will have deleted
00689     // their attributes before we get here so we check (and hence don't GPF!)
00690     if (CurrentAttrs != NULL)
00691     {
00692         for (INT32 i = 0; i < NumCurrentAttrs; i++)
00693         {
00694 
00695 // WEBSTER - markn 16/7/97
00696 // This hides a bug in the text tool, which won't go off if you don't use Path processors
00697 // The bug - 
00698 //      create a multi-line paragraph text object
00699 //      Select all and apply -5 base line shift
00700 //      Change to a large font
00701 //      Change the font
00702 //      Change the text size
00703 //      Should go bang
00704 //
00705 // I have no idea what the problem is (I'd fix it if I knew), and don't have time to spend on it.
00706 // Should be looked into though...
00707 // Now taken out via new VECTOR_STROKING flag Neville 2/10/97 
00708 #ifdef VECTOR_STROKING
00709             // Tell the attribute that it's being chucked out of scope
00710         //  CurrentAttrs[i].pAttr->GoingOutOfScope(this);
00711 #endif // VECTOR_STROKING
00712 
00713             // And delete it if it's a temporary attr
00714             if (CurrentAttrs[i].Temp)
00715             {
00716                 CC_ASSERT_VALID(CurrentAttrs[i].pAttr);
00717                 delete CurrentAttrs[i].pAttr;
00718             }
00719         }
00720 
00721         // We've finished with this array of attributes now
00722         CCFree(CurrentAttrs);
00723     }
00724 
00725     if (CurrentSubRenderState != NULL)
00726         delete CurrentSubRenderState;
00727 
00728     if (PathProcessorStack != NULL)
00729     {
00730 //      ERROR3("RenderRegion destructed while PathProcessors still active");
00731         while (PathProcessorStack != NULL)
00732             PopPathProcessor();
00733     }
00734 }


Member Function Documentation

BOOL RenderRegion::AttachDevice View ViewToAttach,
CCDC DCToAttach,
Spread SpreadToAttach = NULL,
bool  fOwned = false
[virtual]
 

Attaches View, wxDC and Spread pointers to the RenderRegion. The View is used to for general rendering purposes. The wxDC is the device that we are rendering to. We extract the HDC from this and store it so we can recreate another wxDC object for background rendering. The Spread is just stored for external referance and is used to continue rendering during BackGnd redraw.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/5/93
Parameters:
A View ptr ,wxDC ptr and Spread ptr to attach to the RenderRegion. [INPUTS] The View pointer must not be NULL!
Returns:
TRUE if attached successfully; FALSE if not.
NB. This function should be called before doing anything else in the AttachDevice() function of a derived class.

Returns:
Errors: If ViewToAttach is NULL => ERROR2
See also:
RenderRegion::InitDevice

Definition at line 863 of file rndrgn.cpp.

00865 {
00866     return AttachDevice(ViewToAttach, DCToAttach->GetDC(), SpreadToAttach, fOwned);
00867 }

BOOL RenderRegion::AttachDevice View ,
CNativeDC ,
Spread SpreadToAttach = NULL,
bool  fOwned = false
[virtual]
 

Reimplemented in CMXRenderRegion, EPSRenderRegion, GRenderClick, GRenderClickColour, GRenderClickColourNoPaper, GRenderRegion, and OSRenderRegion.

Definition at line 869 of file rndrgn.cpp.

00871 {
00872     RenderSpread = SpreadToAttach;
00873     RenderView   = ViewToAttach;
00874     RenderDC     = DCToAttach;
00875     m_fOwned     = fOwned;
00876 
00877     ERROR2IF(ViewToAttach == NULL, FALSE, "NULL View passed to RenderRegion::AttachDevice()!");
00878 
00879     // Find which view the render region is to be rendering to
00880     if (RenderView != NULL)
00881     {
00882         // We have a render window - calculate the pixel sizes.
00883         PixelWidth = CalcPixelWidth();
00884         ScaledPixelWidth = CalcScaledPixelWidth();
00885     }
00886     else if (IS_KIND_OF(OSRenderRegion))
00887     {
00888         // Only do this for OSRenderRegions because they can be used to
00889         // render into dialogs (GRenderRegions have their own system
00890         // of pixel size).
00891         PixelWidth = CalcPixelWidth();
00892         ScaledPixelWidth = CalcScaledPixelWidth();
00893     }
00894 
00895     // No ink rendering yet.
00896     CurrentRenderState = NULL;
00897     CurrentSubRenderState = NULL;
00898     SubRenderStateLocked = FALSE;
00899 
00900     // Initialise drawing mode.
00901     DrawingMode = DM_COPYPEN;
00902 
00903     // All ok
00904     return TRUE;
00905 }

virtual MILLIPOINT RenderRegion::CalcPixelWidth  )  [protected, pure virtual]
 

Implemented in AIEPSGradientScanRenderRegion, ImagemapRenderRegion, FormatRegion, ScanningRenderRegion, VectorFileRenderRegion, XPFRenderRegion, GRenderRegion, and OSRenderRegion.

virtual MILLIPOINT RenderRegion::CalcScaledPixelWidth  )  [protected, pure virtual]
 

Implemented in AIEPSGradientScanRenderRegion, ImagemapRenderRegion, FormatRegion, ScanningRenderRegion, VectorFileRenderRegion, XPFRenderRegion, GRenderRegion, and OSRenderRegion.

BOOL RenderRegion::CanBeMerged  ) 
 

This is used to help simplify the merging code with banded region. A banded render region at the start of one of its bands looks similar to a render region that has done no rendering yet, and may be merged. This function allows banded regions to stop themselves from being merged after they have started rendering into their first band.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/3/95
Returns:
TRUE if this render region can be merged now. FALSE if it should not be merged.

Definition at line 6416 of file rndrgn.cpp.

06417 {
06418     // If we have started rendering ink, then we can not merge
06419     if (IsInkRenderStarted)
06420         return FALSE;
06421 
06422     // if we have not, then we may be between bands in a banded render region
06423     return CanRegionBeMerged;
06424 }

BOOL RenderRegion::ChangeCapture CAPTUREINFO  cinfo,
BOOL  bTransparent = TRUE,
BOOL  bCaptureBackground = FALSE
[virtual]
 

To inform the capture stack that things (transparency) have changed.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/07/2004
Parameters:
- [INPUTS]
- [OUTPUTS]

Reimplemented in GRenderRegion.

Definition at line 7549 of file rndrgn.cpp.

07552 {
07553     // If there's a current RGBT capture active and we are changing to a non-transparent capture
07554     // Then mark that Capture as no longer being transparent
07555     // Blit whatever we have so far into the parent bitmap
07556     // Tell all enclosing captures (further up the stack) that they can no longer be transparent
07557     // either
07558     Capture* pCurrentCapture = GetTopCapture();
07559     if (pCurrentCapture==NULL)
07560         return FALSE;
07561 
07562     if (pCurrentCapture->IsMaster())
07563     {
07564         ENSURE(m_CaptureStack.Size()==1, "Master Capture not bottom capture in ChangeCapture");
07565         return FALSE;
07566     }
07567 
07568     return TRUE;
07569 }

virtual BOOL RenderRegion::CheckOffscreenBounds  )  [inline, virtual]
 

Reimplemented in ScanningRenderRegion, and XPFRenderRegion.

Definition at line 660 of file rndrgn.h.

00660 { return(TRUE); }

void RenderRegion::ClearBackmostChangedNode Node pNode  )  [virtual]
 

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/08/2004
Parameters:
- [INPUTS]
- [OUTPUTS]

Definition at line 7372 of file rndrgn.cpp.

07373 {
07374     if (pNode && (pNode == m_pBackmostChangedNode || pNode->IsNodeInSubtree(m_pBackmostChangedNode)))
07375     {
07376         m_pBackmostChangedNode = pNode->FindParentSpread();
07377     }
07378 }

BOOL RenderRegion::CloseDown  )  [virtual]
 

Base class declaration of the CloseDown function. It allows the CloseDown functions in the EPS and CMX filters to be virtual over-rides, which means that I don't need the IsKindOfs cluttering up the rendering loops.

Author:
Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/02/00
Parameters:
None. [INPUTS]
Returns:
TRUE.
See also:
RenderRegion::AttachDevice; RenderRegion::InitDevice

Reimplemented in PrintPSRenderRegion, and EPSRenderRegion.

Definition at line 1232 of file rndrgn.cpp.

01233 {
01234     return TRUE;
01235 }

void RenderRegion::ColourCorrectBitmap BitmapFillAttribute Fill,
BITMAPINFO Info,
RGBQUAD **  Palette
 

Applies colour correction and/or contoning to a paletted bitmap being plotted.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
1/6/96
Parameters:
Fill - NULL, or a pointer to a BFA which describes how this bitmap should [INPUTS] be contoned
Info - The bitmap info header

Palette - Must point to a (RGBQUAD *) which we can fill in (see outputs)

Parameters:
Palette - Will be returned NULL if you should use the original bitmap's [OUTPUTS] palette, else is a pointer to a CCMalloc'd block of memory containing a colour corrected RGBQUAD palette to use instead -in which case you MUST CCFree() the new block when you've finished plotting the bitmap.
Contoning and colour-correction of <=8bpp images is achieved by replacing the original palette with a corrected version. This means that even colour separation can be achieved on <=8bpp with this function.

Images of more than 8bpp cannot be contoned. Images of more than 8bpp should be colour corrected by setting GDraw up to do colour correction on the fly (GD->SetBitmapConversionTable).

This function thus takes a bitmap, and returns a pointer to the palette to be plot it with - if this pointer differs from the original one, it is then your responsibility to CCFree() the returned block to release the temporary memory.

Definition at line 6837 of file rndrgn.cpp.

06839 {
06840     ERROR3IF(Info == NULL || Palette == NULL, "illegal NULL params");
06841 
06842     *Palette = NULL;                    // Set up a suitable return default
06843 
06844     // --- If a fill was passed in, check if this is a contoned bitmap
06845     // If it is, we just provide a colour-corrected contone palette and return
06846     if (Fill != NULL && Fill->GetStartColour() != NULL && Fill->GetEndColour() != NULL)
06847     {
06848         *Palette = (RGBQUAD *) CCMalloc(256 * sizeof(RGBQUAD));
06849         if (*Palette == NULL)
06850         {
06851             ERROR3("No memory for palette");
06852             return;
06853         }
06854         GradTable32::BuildGraduatedPalette(*Fill->GetStartColour(), *Fill->GetEndColour(),
06855                                            GetRenderView(), GetFillEffect(),
06856                                            256, *Palette, Fill->GetProfile());
06857         return;
06858     }
06859     // --- If it's a paletted bitmap, then we just colour-correct the palette
06860     if (Info->bmiHeader.biBitCount <= 8)
06861     {
06862         // Not contoned, but should we colour-correct?
06863         if (CurrentColContext->GetColourPlate() != NULL &&
06864             !CurrentColContext->GetColourPlate()->IsDisabled())
06865         {
06866             *Palette = (RGBQUAD *) CCMalloc(256 * sizeof(RGBQUAD));
06867             if (*Palette == NULL)
06868             {
06869                 ERROR3("No memory for palette");
06870                 return;
06871             }
06872 
06873             RGBQUAD *OldPal = Info->bmiColors;
06874 
06875             DocColour temp;
06876             PColourRGBT Converted;
06877 
06878             for (DWORD i = 0; i < Info->bmiHeader.biClrUsed; i++)
06879             {
06880                 temp.SetRGBValue(OldPal[i].rgbRed, OldPal[i].rgbGreen, OldPal[i].rgbBlue);
06881 
06882                 CurrentColContext->ConvertColour(&temp, (ColourPacked *) &Converted);
06883 
06884                 (*Palette)[i].rgbRed        = Converted.Red;
06885                 (*Palette)[i].rgbGreen      = Converted.Green;
06886                 (*Palette)[i].rgbBlue       = Converted.Blue;
06887                 (*Palette)[i].rgbReserved   = OldPal[i].rgbReserved;
06888             }
06889         }
06890         return;
06891     }
06892 }

Matrix RenderRegion::ConcatenateMatrix Matrix NewMatrix  )  [virtual]
 

This can be used to add a transform in to the render regions transformation matrix. The function performs the following matrix operation :- MonoOn RenderMatrix = NewMatrix * RenderMatrix; MonoOff.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/10/93
Parameters:
NewMatrix - The Matrix that will be combined with the current [INPUTS] RenderMatrix in the RenderRegion
Returns:
The old RenderRegion Matrix
See also:
RenderRegion::SetMatrix

Definition at line 1324 of file rndrgn.cpp.

01325 {
01326     // Need to remember the old matrix so we can return it
01327     Matrix Temp = RenderMatrix;
01328 
01329     // Add a transform to the matrix we already have
01330     RenderMatrix = NewMatrix * RenderMatrix;
01331 
01332     // return the old matrix to the caller
01333     return Temp;
01334 }

void RenderRegion::ConditionalSuicide void   )  [virtual]
 

Causes the object to commit suicide. This is to get around using a few if IS_A calls elsewhere in Camelot.

Author:
Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/2/00
Parameters:
- [INPUTS]
Returns:
-

Reimplemented in CamelotEPSRenderRegion, NativeRenderRegion, and PrintPSRenderRegion.

Definition at line 1250 of file rndrgn.cpp.

01251 {
01252     // Yes, this is a legal C++ expression. Just don't attempt to call this object again.
01253     delete this;
01254 }

BOOL RenderRegion::CopyCurrentAttributes const RenderRegion Other  )  [protected]
 

Copy the current attribute array of another render region into this render region. The copying is intelligent; i.e. if the other array contains 'temporary' objects, then it will copy them, so two render regions don't try to delete the same object when their destructor is called.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
Other - the render region to copy from. [INPUTS]
Returns:
TRUE if the current attributes are copied ok; FALSE if not.

Errors: Out of memory.

Definition at line 1818 of file rndrgn.cpp.

01819 {
01820     // If the source render region has no attributes, this is ok, as we may
01821     // be cloning it before it has started rendering (attributes only get set up when
01822     // some rendering is done).
01823     if (Other.CurrentAttrs == NULL)
01824     {
01825         // No attributes - nothing to do.
01826         CurrentAttrs = NULL;
01827         NumCurrentAttrs = 0;
01828         return TRUE;
01829     }
01830 
01831     // Allocate a current attributes block.
01832     NumCurrentAttrs = Other.NumCurrentAttrs;
01833     ENSURE(NumCurrentAttrs != 0, "Mismatched attribute stack in CopyCurrentAttributes");
01834     INT32 AttrBlkSize = sizeof(AttributeEntry) * NumCurrentAttrs;
01835     CurrentAttrs = (AttributeEntry *) CCMalloc(AttrBlkSize);
01836     if (CurrentAttrs == NULL)
01837         return FALSE;
01838 
01839     // Copy the current attribute values across
01840     memcpy(CurrentAttrs, Other.CurrentAttrs, AttrBlkSize);
01841 
01842     // We must take copies of any temporary objects to avoid multiple deletion problems.
01843     for (INT32 i = 0; i < NumCurrentAttrs; i++)
01844     {
01845         if (CurrentAttrs[i].Temp)
01846         {
01847             // Get the runtime class info on this object
01848             CCRuntimeClass *pCCRuntimeClass = CurrentAttrs[i].pAttr->GetRuntimeClass();
01849     
01850             // Create another object of the same type
01851             AttributeValue *pNewAttr = (AttributeValue *) pCCRuntimeClass->CreateObject();
01852 
01853             if (pNewAttr == NULL)
01854             {
01855                 // Failed to create object - quit with error, but first ensure that all
01856                 // the rest of the attributes are marked as non-temporary.
01857                 // Otherwise the destructor will attempt to delete objects that belong 
01858                 // to the other render region.
01859                 for (INT32 j = i; j < NumCurrentAttrs; j++)
01860                     CurrentAttrs[j].Temp = FALSE;
01861 
01862                 return FALSE;
01863             }
01864 
01865             // Object created ok - get the object to copy its contents across.
01866             pNewAttr->SimpleCopy(CurrentAttrs[i].pAttr);
01867 
01868             // Place this attribute in the array
01869             CurrentAttrs[i].pAttr = pNewAttr;
01870         }
01871     }
01872 
01873     // It all worked
01874     return TRUE;
01875 }

BOOL RenderRegion::CopyRenderInfo const RenderRegion Other  )  [virtual]
 

Copies all the parameters from the render region 'Other' into this render region. This was written for the region merging code. When a new region is created, due to existing regions being split up, it should be based on the original region, with a different clipping rectangle.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/4/94
Parameters:
Other - The render region to get the info out of [INPUTS]
Returns:
FALSE if failed, TRUE if worked.

Reimplemented in GRenderRegion.

Definition at line 754 of file rndrgn.cpp.

00755 {
00756     // We're writing over our render info with the other RndRgn's settings, so we must vape
00757     // all of our PathProcessors (if there are any, which probably there shouldn't be)
00758     while (PathProcessorStack != NULL)
00759         PopPathProcessor();
00760 
00761     // Copy params to do with the rendering
00762     CurrentClipRect = Other.CurrentClipRect;
00763     RenderMatrix    = Other.RenderMatrix;
00764     ScaleFactor     = Other.ScaleFactor;
00765     RenderSpread    = Other.RenderSpread;
00766     DrawingMode     = Other.DrawingMode;
00767     CurrentColContext = Other.CurrentColContext;
00768     RenderComplexShapes = Other.RenderComplexShapes;
00769 
00770     // Copy params to do with the window we are rendering into
00771     RenderView      = Other.RenderView;
00772     RenderDC        = Other.RenderDC;
00773 //  DCHandle        = Other.DCHandle;
00774 
00775     // Copy the flags
00776     RenderFlags     = Other.RenderFlags;
00777 
00778     // Copy the pixel width info
00779     PixelWidth      = Other.PixelWidth;
00780     ScaledPixelWidth = Other.ScaledPixelWidth;
00781 
00782     // Copy the rendered state
00783     IsPaperRendered = Other.IsPaperRendered;
00784     IsInkRenderStarted = Other.IsInkRenderStarted;
00785     NeedsOSPaper = Other.NeedsOSPaper;
00786     Timeslice = Other.Timeslice;
00787     RRQuality = Other.RRQuality;
00788 
00789     // Copy the node to render
00790     CurrentRenderState = Other.CurrentRenderState;
00791     CurrentSubRenderState = NULL;
00792     SubRenderStateLocked = FALSE;
00793 
00794     // Copy the current attributes
00795     if (!CopyCurrentAttributes(Other))
00796     {
00797         // Unable to copy the current attributes
00798         ENSURE(FALSE, "Unable to copy current attributes");
00799         InformError();
00800         return FALSE;
00801     }
00802     
00803 
00804     // Now make a copy of the ContextSatck
00805     // Actually don't, or you get some attributes left from this render region at the bottom
00806 /*  if (!TheStack.Copy(&Other.TheStack, this))
00807     {
00808         // Unable to copy the render stack
00809         ENSURE(FALSE, "Unable to copy Rendering stack");
00810         InformError();
00811         return FALSE;
00812     }
00813 */
00814     DrawingMode = Other.DrawingMode;
00815 
00816     // Set the Fuzzy Clipping Rects to something
00817     InnerRect = Other.InnerRect;
00818     OuterRect = Other.OuterRect;
00819 
00820     // Set up vars to do with banded rendering
00821     RegionRect = Other.RegionRect;
00822     IsRegionBanded = Other.IsRegionBanded;
00823     CanRegionBeMerged = Other.CanRegionBeMerged;
00824     IsLastBand = Other.IsLastBand;
00825 
00826     // this is critical to make sure InitDevice gets called on the next StartRender
00827     RenderFlags.ValidDevice = FALSE;
00828 
00829     return TRUE;
00830 }

Path * RenderRegion::CreateCharPath WCHAR  ch,
Matrix pMatrix = NULL
 

Create a path of the specified char, using the specified transform and current attributes in the render region Note: The caller is resposible for initialising the path's flags if required.

Author:
Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/3/95
Parameters:
ch - unicode value of char [INPUTS] pMatrix - possible matrix to transform char to correct place in doc
Returns:
pointer to new path (else NULL if fails)

Definition at line 6119 of file rndrgn.cpp.

06120 {
06121     // get overall matrix - attribute matrix concatenated with given matrix if supplied
06122     Matrix matrix;
06123     if (GetCharAttributeMatrix(&matrix)==FALSE)
06124         return NULL;
06125     if (pMatrix)
06126         matrix*=*pMatrix;
06127 
06128     // create the default char path
06129     CharDescription CharDesc(ch, RR_TXTFONTTYPEFACE(), RR_TXTBOLD(), RR_TXTITALIC());
06130     Path* pPath=FontCache::CreateDefaultCharPath(CharDesc);
06131     if (pPath==NULL)
06132         return NULL;
06133 
06134     // apply overall matrix to path
06135     INT32      points=pPath->GetNumCoords();
06136     DocCoord* pCoords=pPath->GetCoordArray();
06137     BOOL ok=(pCoords!=NULL);
06138     if (ok) matrix.transform((Coord*)pCoords, points);
06139     
06140     // if not OK, delete path and set return value to NULL
06141     if (!ok)
06142     {
06143         delete pPath;
06144         pPath=NULL;
06145     }
06146 
06147     return pPath;
06148 }

void RenderRegion::DefaultRender BOOL  bForceImmediate = FALSE  ) 
 

Calls the attatched view to render itself. This is used to continue rendering into a suspended RenderRegion.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/7/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 1128 of file rndrgn.cpp.

01129 {
01130     ENSURE(RenderView != NULL,"RenderRegion::DefaultRender called with invalid RenderView");
01131 
01132     if (RenderView)
01133     {
01134         RenderView->AllocateDC();
01135         RenderDC = RenderView->GetRenderDC();
01136         if (RenderDC)
01137         {
01138             View * pView = RenderView; // as ContinueRenderView can delete the RenderRegion (i.e. "this").
01139             RenderView->SetCurrent();
01140             (RenderView->GetDoc())->SetCurrent();
01141             RenderView->ContinueRenderView(this, RenderSpread, TRUE, TRUE, bForceImmediate);
01142 
01143             // This MUST pair with AllocateDC
01144             pView->DoneWithDC(); // hint that we might like to drop this DC so a fresh one will be created
01145         }
01146         else
01147         {
01148             // This error causes a recursive error condition so I'll just TRACE for now
01149 //          Error::SetError(_R(IDT_INTERNAL_ERROR), 0);
01150 //          InformError();
01151             TRACE(_T("Failed to get a DC for rendering in RenderRegion::DefaultRender\n"));
01152         }
01153     }
01154 }

BOOL RenderRegion::DrawArrowHead ArrowRec ArrowToDraw,
DocCoord Centre,
DocCoord Direction,
DocCoord RetnCentre = NULL
[virtual]
 

Draw an Arrow head on the start or end of a line.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/4/95
Parameters:
An ArrowRec defining the Arrowhead, the Centre point of the Arrow and a [INPUTS] point defining the direction of the Arrow.
See also:
-

Definition at line 5477 of file rndrgn.cpp.

05479 {
05480     // Get a matrix to transform the Arrow
05481     Trans2DMatrix Trans;
05482     ArrowToDraw.GetArrowMatrix(Centre, Direction, RR_LINEWIDTH(), &Trans);
05483 
05484     // Get the current Render Matrix, and merge the arrow head
05485     // matrix with it.
05486 //  Matrix NewRenderMatrix = Trans.GetMatrix();
05487 //  NewRenderMatrix *= RenderMatrix;
05488 
05489     Path* TransPath = new Path();
05490     if (TransPath == NULL)
05491         return FALSE;
05492 
05493     BOOL    ok = TransPath->Initialise(ArrowToDraw.ArrowShape->GetNumCoords());
05494     if (ok) ok = TransPath->CopyPathDataFrom(ArrowToDraw.ArrowShape);
05495 
05496     if (!ok)
05497     {
05498         // Tidy up if we failed
05499         delete TransPath;
05500         return FALSE;
05501     }
05502 
05503     // calculate the start point of the arrow & put it into RetnCentre
05504     DocCoord Base;
05505     ArrowToDraw.GetArrowBase(&Base);
05506     
05507     Trans.Transform(&Base, 1);
05508 
05509     if (RetnCentre)
05510     {
05511         *RetnCentre = Base;
05512     }
05513 
05514     Trans.Transform(TransPath->GetCoordArray(), 
05515                     TransPath->GetNumCoords() );
05516 
05517     SaveContext();  // We have to change the Line and Fill colours
05518 
05519     // First make sure we don't try and draw Arrows on our Arrow heads !!!
05520     BOOL OldStartArrowState = RR_STARTARROW().IsNull;               
05521     BOOL OldEndArrowState   = RR_ENDARROW().IsNull;             
05522     RR_STARTARROW().IsNull = TRUE;              
05523     RR_ENDARROW().IsNull   = TRUE;          
05524 
05525     // Set the fill colour to the line colour and the line colour to transparent
05526     SetFillColour(RR_STROKECOLOUR());
05527     SetLineColour(COLOUR_TRANS);
05528 
05529     // Now set the Fill transparency to be a flat transparency, the
05530     // same as the current line transparency.
05531     FlatTranspFillAttribute* pAttr = new FlatTranspFillAttribute;
05532     pAttr->SetStartTransp(RR_STROKETRANSP()->GetStartTransp());
05533     pAttr->SetTranspType(RR_STROKETRANSP()->GetTranspType());
05534     SetTranspFillGeometry(pAttr, TRUE);
05535 
05536     // Make sure the Arrow Path is valid.
05537 //  ArrowToDraw.ArrowShape->IsFilled  = TRUE;
05538 //  ArrowToDraw.ArrowShape->IsStroked = FALSE;
05539     TransPath->IsFilled  = TRUE;
05540     TransPath->IsStroked = FALSE;
05541 
05542     // Draw the Arrow head
05543 //  DrawPath(ArrowToDraw.ArrowShape);
05544 
05545     DrawPath(TransPath);
05546 
05547     RR_STARTARROW().IsNull = OldStartArrowState;                
05548     RR_ENDARROW().IsNull   = OldEndArrowState;          
05549 
05550     RestoreContext();   // Get our Attributes Back.
05551 
05552     // Restore the old Rendering Matrix
05553 
05554     delete TransPath;
05555 
05556     return TRUE;
05557 }

virtual void RenderRegion::DrawBitmap const DocCoord Point,
UINT32  BitmapID,
UINT32  ToolID = 0
[pure virtual]
 

Implemented in AIEPSGradientScanRenderRegion, ImagemapRenderRegion, MaskedRenderRegion, FormatRegion, PrintingMaskedRenderRegion, ScanningRenderRegion, VectorFileRenderRegion, XPFRenderRegion, GRenderRegion, and OSRenderRegion.

virtual void RenderRegion::DrawBitmap const DocCoord Point,
KernelBitmap pBitmap
[pure virtual]
 

Implemented in AIEPSGradientScanRenderRegion, ImagemapRenderRegion, MaskedRenderRegion, FormatRegion, PrintingMaskedRenderRegion, ScanningRenderRegion, VectorFileRenderRegion, XPFRenderRegion, GRenderRegion, and OSRenderRegion.

virtual void RenderRegion::DrawBitmapBlob const DocCoord Point,
ResourceID  resID
[pure virtual]
 

Implemented in AIEPSGradientScanRenderRegion, ImagemapRenderRegion, MaskedRenderRegion, FormatRegion, ScanningRenderRegion, VectorFileRenderRegion, XPFRenderRegion, GRenderRegion, and OSRenderRegion.

virtual void RenderRegion::DrawBitmapBlob const DocCoord Point,
KernelBitmap BlobShape
[pure virtual]
 

Implemented in AIEPSGradientScanRenderRegion, ImagemapRenderRegion, MaskedRenderRegion, FormatRegion, ScanningRenderRegion, VectorFileRenderRegion, XPFRenderRegion, GRenderRegion, and OSRenderRegion.

virtual void RenderRegion::DrawBlob DocCoord  p,
BlobType  type
[pure virtual]
 

Implemented in AIEPSGradientScanRenderRegion, ImagemapRenderRegion, MaskedRenderRegion, FormatRegion, ScanningRenderRegion, VectorFileRenderRegion, XPFRenderRegion, GRenderRegion, and OSRenderRegion.

virtual void RenderRegion::DrawCross const DocCoord Point,
const UINT32  Size
[pure virtual]
 

Implemented in AIEPSGradientScanRenderRegion, ImagemapRenderRegion, MaskedRenderRegion, FormatRegion, ScanningRenderRegion, VectorFileRenderRegion, XPFRenderRegion, GRenderRegion, and OSRenderRegion.

void RenderRegion::DrawDashLine const DocCoord StartPoint,
const DocCoord EndPoint
[virtual]
 

Draws a dashed line between the two points. Uses the technology from DrawDragBounds().

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/10/95
Parameters:
StartPoint - start of the line [INPUTS] EndPoint - end of the line
NOTE: This is the base class implementation that only partially works. Only designed to work correctly in OSRenderRegions

See also:
OSRenderRegion::DrawDashLine()

Reimplemented in OSRenderRegion.

Definition at line 5748 of file rndrgn.cpp.

05749 {
05750     Path ThePath;
05751     ThePath.Initialise(12, 12);
05752     ThePath.FindStartOfPath();
05753 
05754     ThePath.InsertMoveTo(StartPoint);
05755     ThePath.InsertLineTo(EndPoint);
05756     ThePath.IsFilled = FALSE;
05757 
05758     DrawPath(&ThePath);
05759 }

void RenderRegion::DrawDragBounds DocRect RectToRender  )  [virtual]
 

Used to draw a "rectangle" to screen (for dragging). However, the corners of the rectangle are passed through the current rendering matrix, so the rect may well be rotated or skewed by the time it reaches the screen.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/5/95
Parameters:
RectToRender - The bounding rectangle we wish to render. [INPUTS]
Notes: DO NOT confuse this method with DrawDragRect (which will draw a rectangle without skew or rotation)

OSRenderRegions override this method to provide dotted-line redraw of the bounds (note: Not a dash-pattern, a simple on/off pixel dottyness). Note that OSRenderRegions CALL THIS METHOD to actually draw the path, so taqke care if changing this function.

See also:
OSRenderRegion::DrawDragRect; OSRenderRegion::DrawDragBounds; Range::RenderXOROutlinesOn

Reimplemented in OSRenderRegion.

Definition at line 5714 of file rndrgn.cpp.

05715 {
05716     Path SquarePath;
05717     SquarePath.Initialise(12, 12);
05718     SquarePath.FindStartOfPath();
05719 
05720     SquarePath.InsertMoveTo(RectToRender->lo);
05721     SquarePath.InsertLineTo(DocCoord(RectToRender->hi.x, RectToRender->lo.y));
05722     SquarePath.InsertLineTo(RectToRender->hi);
05723     SquarePath.InsertLineTo(DocCoord(RectToRender->lo.x, RectToRender->hi.y));
05724     SquarePath.InsertLineTo(RectToRender->lo);
05725     SquarePath.IsFilled = FALSE;
05726 
05727     DrawPath(&SquarePath);
05728 }

virtual void RenderRegion::DrawDragRect DocRect RectToRender  )  [pure virtual]
 

Implemented in AIEPSGradientScanRenderRegion, ImagemapRenderRegion, MaskedRenderRegion, FormatRegion, ScanningRenderRegion, VectorFileRenderRegion, XPFRenderRegion, GRenderRegion, and OSRenderRegion.

void RenderRegion::DrawFixedSystemText StringBase TheText,
DocRect BoundsRect,
UINT32  uFormat = 0x00000020 | 0x00000800 | 0x00000004
[virtual]
 

To draw simple text, using the default host-operating-system font. The size and style of this font are decided by the host OS (or oil code) and cannot be set in any way. To determine how much space is needed to display a string with this method, see the SeeAlso.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/1/95
Parameters:
TheText - The string to render [INPUTS] BoundsRect - Determines where the text is to be plotted. The text will also be clipped within this bounding rectangle if it exceeds the available space.
Notes: THIS BASE CLASS METHOD IS UNSUPPORTED! DO NOT CALL IT! See OSRenderRegion for the supported versions of this method

See also:
OSRenderRegion::DrawFixedSystemText

OSRenderRegion::GetFixedSystemTextSize

Reimplemented in FormatRegion, GRenderRegion, and OSRenderRegion.

Definition at line 5052 of file rndrgn.cpp.

05053 {
05054     ERROR2RAW("Attempt to call unsupported RenderRegion::DrawFixedSystemText method");
05055 }

virtual void RenderRegion::DrawLine const DocCoord StartPoint,
const DocCoord EndPoint
[pure virtual]
 

Implemented in AIEPSGradientScanRenderRegion, ImagemapRenderRegion, MaskedRenderRegion, FormatRegion, PrintingMaskedRenderRegion, ScanningRenderRegion, VectorFileRenderRegion, XPFRenderRegion, GRenderRegion, and OSRenderRegion.

SlowJobResult RenderRegion::DrawMaskedBitmap const DocRect Rect,
KernelBitmap pBitmap,
MaskedRenderRegion pMask,
ProgressDisplay Progress
[virtual]
 

Plots the bitmap using the mask supplied. The base class implementation here does nothing.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/4/95
Parameters:
Point - the position to plot the bitmap [INPUTS] pBitmap - The bitmap that needs plotting pMask - The mask render region to use to indicate which bits of pBitmap needs to be plotted Progress - progress display object used when printing or exporting.
Returns:
Status of operation.

Reimplemented in CamelotEPSRenderRegion, GRenderRegion, and OSRenderRegion.

Definition at line 6750 of file rndrgn.cpp.

06752 {
06753     return SLOWJOB_SUCCESS;
06754 }

void RenderRegion::DrawPath Path pPath,
PathProcessor pCaller = NULL,
PathShape  shapePath = PATHSHAPE_PATH
[virtual]
 

Renders a path (main entry-point). May start a binary-recursive rendering pipeline off by calling any active path processors to do their stuff.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/12/96
Parameters:
pPath - Points to the path to be rendered [INPUTS] pCaller - NULL, or if you're calling this from a path processor, pass your 'this' pointer in here to support the recursion shapePath - (Graham 14/4/97) A tag which describes what shape the path is.
For example, if shapeThis=PATHSHAPE_RECTANGLE, then RenderRegions that want to treat rectangles differently can do so.

Ideally we should replace this so that rectangles are rendered by calling the DrawRect function, circles by calling the DrawCircle function, and so on.

See also:
RenderRegion::DrawPathToOutputDevice

Definition at line 5158 of file rndrgn.cpp.

05159 {
05160     ERROR3IF(pPath == NULL, "Illegal NULL param");
05161 
05162     PathProcessor *pNextProcessor = NULL;
05163     if (pCaller == NULL)
05164     {
05165         pNextProcessor = PathProcessorStack;                    // First call
05166     }
05167     else
05168     {
05169         pNextProcessor = pCaller->GetNextProcessor();           // Recursive call
05170     }
05171 
05172     // see if any of our processors actually do anything
05173     while (pNextProcessor != NULL && (!pNextProcessor->DoesActuallyDoAnything(this)))
05174     {
05175         pNextProcessor = pNextProcessor->GetNextProcessor();
05176     }
05177 
05178     // we seem to be getting problems with two path processor brushes on the stack
05179     // if we blend between a brush and a bevel
05180     if (pNextProcessor != NULL && pCaller != NULL &&
05181         pNextProcessor->IsAPathProcessorBrush() && pCaller->IsAPathProcessorBrush())
05182     {
05183         BrushHandle ThisHandle = ((PathProcessorBrush*)pCaller)->GetBrushDefinitionHandle();
05184         BrushHandle NextHandle = ((PathProcessorBrush*)pNextProcessor)->GetBrushDefinitionHandle();
05185         if (NextHandle == ThisHandle)
05186             pNextProcessor = NULL;
05187     }
05188 
05189     // If we found another PathProcessor to call, recursively call it
05190     if (pNextProcessor != NULL)
05191     {
05192         // Does the processor change both fill & stroke independently?
05193         if (pNextProcessor->WillChangeFillAndStrokeSeparately())
05194         {
05195             // Remember current path settings - we have to poke it directly
05196             // to be efficient about changing it.
05197             BOOL WasFilled  = pPath->IsFilled;
05198             BOOL WasStroked = pPath->IsStroked;
05199 
05200             // Call the PathProcessor to only fill the path, if it is filled.
05201             // There's a hideous special case in here for non-contoned bitmaps (which have a 
05202             // fill colour of TRANSPARENT! Arrrrgh!)
05203             if (WasFilled &&
05204                 (!RR_FILLCOLOUR().IsTransparent() ||
05205                  ((ColourFillAttribute   *) CurrentAttrs[ATTR_FILLGEOMETRY].pAttr)->IsABitmapFill()
05206                 )
05207                )
05208             {
05209                 pPath->IsStroked = FALSE;
05210                 pPath->IsFilled = TRUE;
05211                 pNextProcessor->ProcessPath(pPath, this, shapePath);
05212             }
05213 
05214             // And then call it again to only stroke the path
05215             if (WasStroked && !RR_STROKECOLOUR().IsTransparent())
05216             {
05217                 pPath->IsStroked = TRUE;
05218                 pPath->IsFilled = FALSE;
05219                 pNextProcessor->ProcessPath(pPath, this, shapePath);
05220             }
05221             
05222             // Restore previous path settings
05223             pPath->IsFilled  = WasFilled;
05224             pPath->IsStroked = WasStroked;
05225             return;
05226         }
05227 
05228         // It can be passed through as a single path
05229         pNextProcessor->ProcessPath(pPath, this, shapePath);
05230         return;
05231     }
05232 
05233 
05234     // We have now called any active path processors, so simply output the final
05235     // path to the output device
05236 
05237     //Graham 14/4/97: Also pass along the PathShape parameter to let the renderregion
05238     //know if the path is a special shape
05239     DrawPathToOutputDevice(pPath, shapePath);
05240 }

BOOL RenderRegion::DrawPathArrowHeads DocCoord Coords,
PathVerb Verbs,
INT32  NumCoords
[virtual]
 

Draws arrows heads on the start or end of an open path, according to the current ArrowHead Attributes.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
3/4/95
Parameters:
The path to render the arrow heads onto. [INPUTS]
See also:
-

Definition at line 5380 of file rndrgn.cpp.

05381 {
05382     BOOL ArrowRendered = FALSE;
05383 
05384     if (!RR_STARTARROW().IsNullArrow())
05385     {
05386         INT32 PathIndex = 0;
05387         DocCoord ArrowCentre;
05388         DocCoord ArrowDirection;
05389         DocCoord ArrowBase;
05390 
05391         // Find the first position of an ArrowHead
05392         BOOL GotPos = ArrowRec::GetFirstArrowPos(TRUE,
05393                                                  Coords, Verbs, NumCoords, 
05394                                                  &PathIndex, &ArrowCentre, &ArrowDirection);
05395 
05396         while (GotPos)
05397         {
05398             DrawArrowHead(RR_STARTARROW(), ArrowCentre, ArrowDirection, &ArrowBase);
05399 
05400             // DMc Update 25/2/99 so that arrows are drawn on the path - not after it !
05401             // find the coord which caused the arrow to be drawn
05402             BOOL bFound = FALSE;
05403 
05404             INT32 i;
05405             for (i = PathIndex - 1  ; i >= 0 && !bFound; i--)
05406             {
05407                 if (Verbs[i] == PT_MOVETO)
05408                 {
05409                     bFound = TRUE;
05410                 }
05411             }
05412 
05413             if (bFound && !(RR_STARTARROW().m_bExtendPath))
05414             {
05415                 // move the coord in the path back by arrow size
05416                 Coords[i+1].x = ArrowBase.x;
05417                 Coords[i+1].y = ArrowBase.y;                        
05418             }
05419 
05420             ArrowRendered = TRUE;
05421 
05422             // Find the next Arrow position (if there are any more subpaths)
05423             GotPos = ArrowRec::GetNextArrowPos(TRUE,
05424                                                Coords, Verbs, NumCoords, 
05425                                                &PathIndex, &ArrowCentre, &ArrowDirection);
05426         }
05427     }
05428 
05429     if (!RR_ENDARROW().IsNullArrow())
05430     {
05431         INT32 PathIndex = 0;
05432         DocCoord ArrowCentre;
05433         DocCoord ArrowDirection;
05434         DocCoord ArrowBase;
05435 
05436         // Find the first position of an ArrowHead
05437         BOOL GotPos = ArrowRec::GetFirstArrowPos(FALSE,
05438                                                  Coords, Verbs, NumCoords, 
05439                                                  &PathIndex, &ArrowCentre, &ArrowDirection);
05440         while (GotPos)
05441         {
05442             DrawArrowHead(RR_ENDARROW(), ArrowCentre, ArrowDirection, &ArrowBase);
05443 
05444             // move the coordinate on the path
05445             if (!(RR_ENDARROW().m_bExtendPath))
05446             {
05447                 Coords[PathIndex-1].x = ArrowBase.x;
05448                 Coords[PathIndex-1].y = ArrowBase.y;
05449             }
05450 
05451             ArrowRendered = TRUE;
05452 
05453             // Find the next Arrow position (if there are any more subpaths)
05454             GotPos = ArrowRec::GetNextArrowPos(FALSE,
05455                                                Coords, Verbs, NumCoords, 
05456                                                &PathIndex, &ArrowCentre, &ArrowDirection);
05457         }
05458     }
05459 
05460     return ArrowRendered;
05461 }

virtual void RenderRegion::DrawPathToOutputDevice Path PathToRender,
PathShape  shapePath = PATHSHAPE_PATH
[pure virtual]
 

Implemented in AIEPSGradientScanRenderRegion, CamelotEPSRenderRegion, CMXRenderRegion, ImagemapRenderRegion, MaskedRenderRegion, FormatRegion, PrintingMaskedRenderRegion, EPSRenderRegion, ScanningRenderRegion, FlashRenderRegion, XPFRenderRegion, GRenderRegion, and OSRenderRegion.

virtual void RenderRegion::DrawPixel const DocCoord Point  )  [pure virtual]
 

Implemented in AIEPSGradientScanRenderRegion, ImagemapRenderRegion, MaskedRenderRegion, FormatRegion, PrintingMaskedRenderRegion, ScanningRenderRegion, VectorFileRenderRegion, XPFRenderRegion, GRenderRegion, and OSRenderRegion.

void RenderRegion::DrawPixelLine const DocCoord StartPoint,
const DocCoord EndPoint
[virtual]
 

To try and plot a single pixel line. It does this by using a filled rectangle rather than just drawing the line itself. This is required because although GDI and GDraw fills can be made to match up, their outlines can't (at the time of writing). Assumes fill colour and line colour have already been set up along with a line width, usually assumed to be zero which means plot single-pixel lines. Usually, the fill colour is set to be the required line colour and the line colour is set to be transparent (COLOUR_TRANS).

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/1/95
Parameters:
StartPoint - The starting point to render from. [INPUTS] EndPoint - The end point to render to.
- [OUTPUTS]
Returns:
-
See also:
OSRenderRegion::DrawLine; GRenderRegion::DrawLine; RenderRegion::DrawPixelRect;

Reimplemented in FormatRegion.

Definition at line 5845 of file rndrgn.cpp.

05846 {
05847 // Below is some conditional code.
05848 // The correct code is directly below in the IF clause and just in fact calls the standard
05849 // DrawLine call.
05850 // The bodged version is the code in the ELSE clause and renders the single pixel line
05851 // using a filled rectangle. This is required because although GDI and GDraw fills
05852 // can be made to match up, their outlines can't (at the time of writing).
05853 //
05854 // By the way, Gavin says, it's faster to plot four upright rects than to stroke a path
05855 // to become the outline of the page!!!
05856 //
05857 #if 0
05858         DrawLine(StartPoint, EndPoint); 
05859 #else
05860         // Get the scaled pixel size for the view
05861         FIXED16 ScaledPixelWidth,
05862                 ScaledPixelHeight;
05863         RenderView->GetScaledPixelSize(&ScaledPixelWidth, &ScaledPixelHeight);
05864 
05865         // Draw the line
05866         DocRect VertRect(StartPoint.x,
05867                          StartPoint.y,
05868                          EndPoint.x + ScaledPixelWidth.MakeLong(),
05869                          EndPoint.y + ScaledPixelHeight.MakeLong());
05870         DrawRect(&VertRect);
05871 #endif
05872 }

void RenderRegion::DrawPixelRect DocRect RectToRender  )  [virtual]
 

To try and plot a single pixel rectangle outline. It does this by using filled rectangles rather than just drawing the line itself. This is required because although GDI and GDraw fills can be made to match up, their outlines can't (at the time of writing). Assumes fill colour and line colour have already been set up along with a line width, usually assumed to be zero which means plot single-pixel lines. Usually, the fill colour is set to be the required line colour and the line colour is set to be transparent (COLOUR_TRANS).

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/1/95
Parameters:
RectToRender - The rectangle we wish to render. [INPUTS]
- [OUTPUTS]
Returns:
-
See also:
OSRenderRegion::DrawRect; GRenderRegion::DrawRect; RenderRegion::DrawPixelLine;

Reimplemented in FormatRegion.

Definition at line 5782 of file rndrgn.cpp.

05783 {
05784 // Below is some conditional code.
05785 // The correct code is directly below in the IF clause and just in fact calls the standard
05786 // DrawRect call.
05787 // The bodged version is the code in the ELSE clause and renders the single pixel outline
05788 // using filled rectangles. This is required because although GDI and GDraw fills
05789 // can be made to match up, their outlines can't (at the time of writing).
05790 //
05791 // By the way, Gavin says, it's faster to plot four upright rects than to stroke a path
05792 // to become the outline of the page!!!
05793 //
05794 #if 0
05795         // Draw that page rectangle using the standard call
05796         DrawRect(RectToRender); 
05797 #else
05798         // Get the scaled pixel size for the view
05799         FIXED16 ScaledPixelWidth,
05800                 ScaledPixelHeight;
05801         RenderView->GetScaledPixelSize(&ScaledPixelWidth, &ScaledPixelHeight);
05802 
05803         // Draw a rectangle using 4 filled rectangles.
05804         DocRect VertRect(RectToRender->lo.x,
05805                          RectToRender->lo.y,
05806                          RectToRender->lo.x + ScaledPixelWidth.MakeLong(),
05807                          RectToRender->hi.y + ScaledPixelHeight.MakeLong());
05808         DrawRect(&VertRect);                // Left
05809 
05810         VertRect.Translate(RectToRender->Width(),0);
05811         DrawRect(&VertRect);                // Right
05812 
05813         DocRect HorzRect(RectToRender->lo.x,
05814                          RectToRender->lo.y,
05815                          RectToRender->hi.x,
05816                          RectToRender->lo.y + ScaledPixelHeight.MakeLong());
05817         DrawRect(&HorzRect);                // Bottom
05818 
05819         HorzRect.Translate(0,RectToRender->Height());
05820         DrawRect(&HorzRect);                // Top
05821 #endif
05822 }

virtual void RenderRegion::DrawRect DocRect RectToRender  )  [pure virtual]
 

Implemented in AIEPSGradientScanRenderRegion, ImagemapRenderRegion, MaskedRenderRegion, FormatRegion, PrintingMaskedRenderRegion, ScanningRenderRegion, VectorFileRenderRegion, XPFRenderRegion, GRenderRegion, and OSRenderRegion.

BOOL RenderRegion::DrawTransformedBitmap NodeBitmap pNodeBitmap  )  [virtual]
 

Reimplemented in CamelotEPSRenderRegion, MaskedRenderRegion, PrintingMaskedRenderRegion, ScanningRenderRegion, XPFRenderRegion, and OSRenderRegion.

Definition at line 5560 of file rndrgn.cpp.

05561 {
05562     // If we are not drawing complex shapes and this shape is, then return
05563     RRCaps Caps;
05564     GetRenderRegionCaps(&Caps);
05565     if ((!RenderComplexShapes) && (TestForComplexShape(&Caps)))
05566         return TRUE;
05567 
05568     if ((!RenderComplexShapes) && (pNodeBitmap->NeedsTransparency()))
05569         return TRUE;
05570 
05571     KernelBitmap* pkBitmap = pNodeBitmap->GetBitmap();
05572     if (pkBitmap==NULL || pkBitmap->GetWidth()==0 || pkBitmap->GetHeight()==0)
05573         return TRUE;
05574 
05575     // By default, we can't do arbitrarily transformed bitmaps - use a bitmap fill.
05576     SaveContext();
05577 
05578     // No lines on the rectangle
05579     SetLineColour(COLOUR_TRANS);
05580     SetLineWidth(0);
05581 
05582     if (RRQuality.GetFillQuality() == Quality::Bitmaps)
05583     {
05584         // The quality is set to show Bitmaps, with everything else in outline
05585         // mode, so we'll fake this by temorarily setting the quality to 'Solid'
05586         // just while we render this node.
05587 
05588         Quality NewQuality;
05589         NewQuality.SetQuality(31);  // Force solid fills while we render this node
05590 
05591         QualityAttribute* pQualityAttr = new QualityAttribute(NewQuality);
05592         SetQuality(pQualityAttr, TRUE);
05593     }
05594 
05595     // Simple bitmap fill which fills the whole shape
05596     BitmapFillAttribute *pBitmapAttr = new BitmapFillAttribute;
05597     pBitmapAttr->GetBitmapRef()->SetBitmap(pNodeBitmap->GetBitmap());
05598 
05599     if (IsVeryMono() && !pNodeBitmap->NeedsTransparency())
05600     {
05601         // VeryMono, so plot as black (unless it's a masked bitmap)
05602         DocColour ColBlack = COLOUR_BLACK;
05603         pBitmapAttr->SetStartColour(&ColBlack);
05604     }
05605 
05606     // (ChrisG - 7/11/00) Removed as the CanBeContoned bool is not supported. 
05607     //  This default value was stopping derived render regions from overriding
05608     //  this function, so almost all bitmaps were drawn by this code...
05609     // Err no ChrisG the header file used to be CanBeContoned = TRUE
05610     // so we DO RUN THIS CODE all the time ie all bitmaps CAN be contoned (sjk 19/11/00)
05611     else // if(CanBeContoned)
05612     {
05613         if (pNodeBitmap->GetStartColour())
05614             pBitmapAttr->SetStartColour(pNodeBitmap->GetStartColour());
05615     
05616         if (pNodeBitmap->GetEndColour())
05617             pBitmapAttr->SetEndColour(pNodeBitmap->GetEndColour());
05618     }
05619 
05620     DocCoord *Coords = pNodeBitmap->InkPath.GetCoordArray();
05621 
05622     pBitmapAttr->StartPoint = Coords[3];
05623     pBitmapAttr->EndPoint   = Coords[2];
05624     pBitmapAttr->EndPoint2  = Coords[0];
05625 
05626     // Set bitmap attribute, and get the render region to throw it away when it's finished
05627     // with (hence the TRUE parameter).
05628     SetFillGeometry(pBitmapAttr, TRUE);
05629 
05630     // Set the mapping to have no repeat, otherwise we get artifacts at the edges when
05631     // anti-aliasing is enabled (see bug 1391).
05632     FillMappingLinearAttribute *pNoRepeatAttr = new FillMappingLinearAttribute;
05633 
05634     // Repeat value of '3' means 'repeat inverted' (there are no symbolic names for
05635     // these repeat values - shout at Will if you want some!).
05636 //  pNoRepeatAttr->Repeat = 3;
05637     pNoRepeatAttr->Repeat = 0;
05638 
05639     // Set mapping attribute, and get the render region to throw it away when it's finished
05640     // with (hence the TRUE parameter).
05641     SetFillMapping(pNoRepeatAttr, TRUE);
05642 
05643     // Draw the bitmap by rendering a bitmap filled path.
05644     pNodeBitmap->InkPath.IsFilled = TRUE;
05645     DrawPath(&pNodeBitmap->InkPath);
05646 
05647     RestoreContext();
05648 
05649     // All done
05650     return TRUE;
05651 }

void RenderRegion::EnableAllBrushPathProcessors BOOL  Enable  ) 
 

Enables or disables all the brush path processors on the stack.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/12/96
Parameters:
Enable - whether we wish to enable the processors or not [INPUTS]

Definition at line 5355 of file rndrgn.cpp.

05356 {
05357     PathProcessor* pPP = PathProcessorStack;
05358 
05359     while (pPP != NULL)
05360     {
05361         if (pPP->IsAPathProcessorBrush())
05362             pPP->SetDisabled(!Enable);
05363         pPP = pPP->GetNextProcessor();
05364     }
05365 }

BOOL RenderRegion::GetAttrdCharBounds DocRect pBounds,
WCHAR  ch
 

Get the bounding box of the specified char (from a cache) and apply the required transform depending on attributes (this is a character relative rect!).

Author:
Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/3/95
Parameters:
ch - unicode value of char [INPUTS]
pRect - bounding box of char in doc [OUTPUTS]
Returns:
FALSE if fails

Definition at line 6084 of file rndrgn.cpp.

06085 {
06086     ERROR2IF(pBounds==NULL,FALSE,"RenderRegion::GetAttrdCharBounds() - pBounds==NULL");
06087 
06088     // get defualt bounds from cache
06089     CharDescription CharDesc(ch, RR_TXTFONTTYPEFACE(), RR_TXTBOLD(), RR_TXTITALIC());
06090     BOOL ok = FontCache::GetBounds(pBounds,CharDesc);
06091 
06092     // get and apply attribute matrix to bounds
06093     Matrix matrix;
06094     if (ok) ok = GetCharAttributeMatrix(&matrix);
06095     if (ok) ok = matrix.TransformBounds(pBounds);
06096 
06097     // transform inaccuracies cause empty rects to become non-empty
06098     // so for very small ones to be empty (ok as rect char relative)
06099     if (ok && pBounds->Width()<3 && pBounds->Height()<3)
06100         pBounds->MakeEmpty();
06101 
06102     return ok;
06103 }

virtual Node* RenderRegion::GetBackmostChangedNode  )  [inline, virtual]
 

Definition at line 398 of file rndrgn.h.

00398 { return m_pBackmostChangedNode; }

virtual INT32 RenderRegion::GetCaptureDepth  )  [inline, virtual]
 

Definition at line 759 of file rndrgn.h.

00759 {return m_CaptureStack.Size();}

BOOL RenderRegion::GetCharAttributeMatrix Matrix pAttrMatrix  ) 
 

calc attribute matrix based on FontSize, AspectRatio and Script attributes

Author:
Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/3/95
Parameters:
pAttrMatrix - [OUTPUTS]
Returns:
FALSE if fails

Definition at line 6161 of file rndrgn.cpp.

06162 {
06163     ERROR2IF(pAttrMatrix==NULL,FALSE,"RenderRegion::GetCharAttributeMatrix() - pAttrMatrix==NULL");
06164     TxtScriptAttribute* pScriptAttr=RR_TXTSCRIPT();
06165     ERROR2IF(pScriptAttr==NULL,FALSE,"RenderRegion::GetCharAttributeMatrix() - pScriptAttr==NULL");
06166 
06167     MILLIPOINT FontSize = RR_TXTFONTSIZE();
06168     MILLIPOINT OffsetY  = XLONG(FontSize) * pScriptAttr->Offset;
06169     FIXED16    fScaleY  = pScriptAttr->Size * Div32By32(FontSize, TextManager::GetDefaultHeight());
06170     FIXED16    fScaleX  = fScaleY * RR_TXTASPECTRATIO();
06171 
06172     *pAttrMatrix = Matrix(fScaleX,0,0,fScaleY,0,OffsetY);
06173 
06174     return TRUE;
06175 }

DocRect RenderRegion::GetClipRect  ) 
 

Returns the clipping rectangle of the Render Region.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/5/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
A DocRect describing the tightest bounding box around the clipping region

Errors: -

See also:
RenderRegion::SetClipRect(); RenderRegion::RenderRegion()

Definition at line 1405 of file rndrgn.cpp.

01406 {
01407     return CurrentClipRect;
01408 }

ColourContext * RenderRegion::GetColourContext  ) 
 

Definition at line 1031 of file rndrgn.cpp.

01032 {
01033     return(CurrentColContext);
01034 }

AttributeValue * RenderRegion::GetCurrentAttribute UINT32  Index  ) 
 

Get a pointer to one of the render region's current attributes. The index indicates which kind of attribute should be returned.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/2/95
Parameters:
Index - the ID of the attribute to be examined. [INPUTS]
Returns:
Pointer to the current attribute of the type requested; NULL if the index is out of range.

Definition at line 5889 of file rndrgn.cpp.

05890 {
05891     // Make sure this is a valid attribute index ID
05892     if (Index < (UINT32)NumCurrentAttrs)
05893         return CurrentAttrs[Index].pAttr;
05894 
05895     // Illegal index - return error
05896     return NULL;
05897 }

OffscreenAttrValue* RenderRegion::GetCurrentOffscreenAttr  )  [inline]
 

Definition at line 658 of file rndrgn.h.

00658 { return(CurrentOffscreenAttr); }

EFFECTTYPE RenderRegion::GetFillEffect  ) 
 

Decide what type of colour fade to use. Scope: Public.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/8/94
Returns:
TRUE, if should use HSV fades. FALSE, if should use RGB fades.

Definition at line 5666 of file rndrgn.cpp.

05667 {
05668     // Get the current Fill Effect
05669     FillEffectAttribute* FillEffect = RR_FILLEFFECT();
05670 
05671     // What kind of fill effect is this ?
05672     CCRuntimeClass* Effect = FillEffect->GetRuntimeClass();
05673 
05674     if (Effect == CC_RUNTIME_CLASS(FillEffectFadeAttribute))
05675         return EFFECT_RGB;          // Use RGB space
05676 
05677     if (Effect == CC_RUNTIME_CLASS(FillEffectRainbowAttribute))
05678         return EFFECT_HSV_SHORT;    // Use HSV short path
05679 
05680     if (Effect == CC_RUNTIME_CLASS(FillEffectAltRainbowAttribute))
05681         return EFFECT_HSV_LONG;     // Use HSV INT32 path
05682 
05683     return EFFECT_RGB;              // Default to RGB space 
05684 }

Filter* RenderRegion::GetFilter  )  [inline]
 

Definition at line 683 of file rndrgn.h.

00683 {return m_pFilter;}

PathProcessor* RenderRegion::GetFirstPathProcessor void   )  [inline]
 

Definition at line 485 of file rndrgn.h.

00485 { return(PathProcessorStack); };

void RenderRegion::GetFixedSystemTextSize StringBase TheText,
DocRect BoundsRect,
double *  atDpi = NULL
[virtual]
 

To determine how much room is needed to plot a bit of text with RenderRegion::DrawFixedSystemText.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/1/95
Parameters:
TheText - The string to get the rendered size of [INPUTS]
BoundsRect - Returned with the size of the rectangle needed to display [OUTPUTS] said text string. This rect always has one corner at (0,0)
Returns:
-
Notes: THIS BASE CLASS METHOD IS UNSUPPORTED! DO NOT CALL IT! See OSRenderRegion for the supported versions of this method

See also:
OSRenderRegion::DrawFixedSystemText

OSRenderRegion::GetFixedSystemTextSize

Reimplemented in FormatRegion, GRenderRegion, and OSRenderRegion.

Definition at line 5120 of file rndrgn.cpp.

05121 {
05122     if (BoundsRect != NULL)
05123         *BoundsRect = DocRect(0,0,0,0);
05124 
05125     ERROR2RAW("Attempt to call unsupported RenderRegion::GetFixedSystemTextSize method");
05126 }

BOOL RenderRegion::GetImmediateRender  )  const [inline]
 

Definition at line 729 of file rndrgn.h.

00729 {return RenderFlags.bImmediateRender;}

virtual Capture* RenderRegion::GetMasterCapture  )  const [inline, virtual]
 

Definition at line 762 of file rndrgn.h.

00762 {return m_CaptureStack.Empty() ? NULL : m_CaptureStack.Bottom();}

Matrix RenderRegion::GetMatrix  )  [inline]
 

Definition at line 412 of file rndrgn.h.

00412 { return RenderMatrix; }

BOOL RenderRegion::GetNextBand  )  [virtual]
 

This function goes and sets up the next band in the render region ready for rendering and returns TRUE if it went OK. If there are no more bands to render then the function returns FALSE.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/3/95
Returns:
TRUE if another band is ready to be rendered, FALSE if there were no more bands to render in this region.

Errors: Causes an error if it can not get the next render region ready.

See also:
RenderRegion::IsBanded

Reimplemented in GRenderBitmap, GRenderOptPalette, GRenderClick, GRenderDIB, and GRenderPrint.

Definition at line 6376 of file rndrgn.cpp.

06377 {
06378     // No more bands here
06379     return FALSE;
06380 }

virtual double RenderRegion::GetPixelsPerInch  )  [inline, virtual]
 

Reimplemented in ScanningRenderRegion, XPFRenderRegion, and GRenderRegion.

Definition at line 669 of file rndrgn.h.

00669 { return 72000.0/ScaledPixelWidth; }

MILLIPOINT RenderRegion::GetPixelWidth  )  [inline]
 

Definition at line 667 of file rndrgn.h.

00667 { return PixelWidth; }

DocRect RenderRegion::GetRegionRect  ) 
 

This function returns the size of the whole render region. Note that this may be different from the Clip rect. If the region is banded, then the Clip rect will hold the rect of the band that is being rendered, while the RegionRect will always hold the rect the whole region.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/3/95
Returns:
The rect of the actual region.

Definition at line 6192 of file rndrgn.cpp.

06193 {
06194     return RegionRect;
06195 }

CNativeDC* RenderRegion::GetRenderDC  )  [inline]
 

Definition at line 446 of file rndrgn.h.

00446 { return RenderDC; }

void RenderRegion::GetRenderRegionCaps RRCaps pCaps  )  [virtual]
 

This function allows a render region to declare what it can render and what it can not render. This base class version of the function says that it can render none of the options. If your render region can do some of these things then you should overide this function and set the appropriate flags.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/4/95
Parameters:
pCaps - the flags set for the things we are able to render [OUTPUTS]

Reimplemented in CamelotEPSRenderRegion, CMXRenderRegion, ImagemapRenderRegion, NativeRenderRegion, EPSRenderRegion, ScanningRenderRegion, XPFRenderRegion, GRenderRegion, and OSRenderRegion.

Definition at line 6442 of file rndrgn.cpp.

06443 {
06444     // by default, render regions can do Everything
06445     pCaps->CanDoAll();
06446 }

Spread* RenderRegion::GetRenderSpread  )  [inline]
 

Definition at line 452 of file rndrgn.h.

00452 { return RenderSpread; }

Node * RenderRegion::GetRenderState  ) 
 

Returns the Current Render State of the RenderRegion, which is a pointer to the next Node to render. If NULL then it is not currently rendering.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/7/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
A Ptr to a Node (or NULL if idle).

Errors: -

See also:
-

Definition at line 1053 of file rndrgn.cpp.

01054 {
01055     return CurrentRenderState;
01056 }

View* RenderRegion::GetRenderView  )  [inline]
 

Definition at line 451 of file rndrgn.h.

00451 { return RenderView; }

MILLIPOINT RenderRegion::GetScaledPixelWidth  )  [inline]
 

Definition at line 668 of file rndrgn.h.

00668 { return ScaledPixelWidth; }

virtual INT64 RenderRegion::GetStoredCount  )  [inline, virtual]
 

Definition at line 407 of file rndrgn.h.

00407 {return m_countStored;}

SubRenderContext* RenderRegion::GetSubRenderState  )  [inline]
 

Definition at line 433 of file rndrgn.h.

00434                             { return CurrentSubRenderState; }

INT32 RenderRegion::GetTimeslice  )  const [inline]
 

Definition at line 447 of file rndrgn.h.

00447 { return Timeslice; }

virtual Capture* RenderRegion::GetTopCapture  )  const [inline, virtual]
 

Definition at line 761 of file rndrgn.h.

00761 {return m_CaptureStack.Empty() ? NULL : m_CaptureStack.Top();}

virtual INT64 RenderRegion::GetTotalCount  )  [inline, virtual]
 

Definition at line 406 of file rndrgn.h.

00406 {return m_countTotal;}

virtual CCachedBitmap RenderRegion::GrabBitmap DocRect  rectGrab  )  [inline, virtual]
 

Definition at line 605 of file rndrgn.h.

00605 {return CCachedBitmap();}

BOOL RenderRegion::ImmediateRender  )  [virtual]
 

Used to Draw something immediately.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/7/93
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if current clip rect is within view (ie whether to render or not).

Errors: -

See also:
-

Reimplemented in GRenderClick.

Definition at line 1073 of file rndrgn.cpp.

01074 {
01075     RenderFlags.bImmediateRender = TRUE;
01076     if (!StartRender())
01077         return FALSE;
01078 
01079     // Immediate render regions default to 0 line-width because they usually want to
01080     // render drag blobs etc which should be only one pixel wide.
01081     SetLineWidth(0);
01082 
01083     // Immediate render is usually used for blob rendering
01084     // normally we use the default quality, but we mustn't do that on hit-detection bitmaps
01085     // else they render outlined shapes as solid (See GRenderClick classes)
01086     SetDefaultQuality();
01087 
01088     //SetStartCap(LineCapButt);
01089     //SetJoinType(RoundJoin);
01090 
01091     return TRUE;
01092 }

BOOL RenderRegion::Init void   )  [static]
 

Initialise the render region.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/05/94
Returns:
TRUE if initialised ok; FALSE if not.

Reimplemented from SimpleCCObject.

Reimplemented in ImagemapRenderRegion, EPSRenderRegion, VectorFileRenderRegion, GRenderRegion, and OSRenderRegion.

Definition at line 623 of file rndrgn.cpp.

00624 {
00625     return TRUE;
00626 }

virtual void RenderRegion::InitAttributes  )  [protected, pure virtual]
 

Implemented in AIEPSGradientScanRenderRegion, ImagemapRenderRegion, FormatRegion, ScanningRenderRegion, VectorFileRenderRegion, XPFRenderRegion, GRenderRegion, and OSRenderRegion.

virtual void RenderRegion::InitClipping  )  [protected, pure virtual]
 

Implemented in AIEPSGradientScanRenderRegion, ImagemapRenderRegion, FormatRegion, ScanningRenderRegion, VectorFileRenderRegion, XPFRenderRegion, GRenderRegion, and OSRenderRegion.

BOOL RenderRegion::InitDevice  )  [virtual]
 

Initialises the render region's connection to the device information passed in to RenderRegion::AttachDevice.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/05/94
Returns:
TRUE if the device specific initialisation is completed successfully; FALSE if not.

Errors: Out of memory, Internal error

See also:
RenderRegion::AttachDevice

Reimplemented in CMXRenderRegion, PrintPSRenderRegion, EPSRenderRegion, GRenderPrint, GRenderRegion, OSRenderRegion, and PaperRenderRegion.

Definition at line 922 of file rndrgn.cpp.

00923 {
00924     // Find this documents default colour context for the screen (RGB)
00925     if (RenderView != NULL)
00926     {
00927         // Find a colour context for the View we're rendering. This will automatically find
00928         // a suitable local, document, or global context for us to use
00929         CurrentColContext = RenderView->GetColourContext(COLOURMODEL_RGBT);
00930         if (CurrentColContext == NULL)  // should never be a problem!
00931         {
00932             DiagnosticFn( _T("InitDevice:"), _T("No colour context") );
00933             ERROR(_R(IDT_INTERNAL_ERROR), FALSE);
00934         }
00935     }
00936     else
00937     {
00938         ERROR3("View is NULL in RenderRegion::InitDevice()");
00939         return FALSE;
00940     }
00941 
00942     // If this region has been reset, then we may already have
00943     // a CurrentAttrs array that needs to be de-allocated.
00944     if (CurrentAttrs != NULL)
00945     {
00946         // Release any temporary objects used by the 'current attribute' array.
00947         for (INT32 i = 0; i < NumCurrentAttrs; i++)
00948         {
00949             if (CurrentAttrs[i].Temp)
00950             {
00951                 CC_ASSERT_VALID(CurrentAttrs[i].pAttr);
00952                 delete CurrentAttrs[i].pAttr;
00953             }
00954         }
00955 
00956         // We've finished with this array of attributes now
00957         CCFree(CurrentAttrs);
00958         NumCurrentAttrs = 0;
00959     }
00960 
00961     // Set up the attributes for this device.
00962     CurrentAttrs = AttributeManager::GetDefaultAttributes();
00963 
00964     if (CurrentAttrs == NULL)
00965     {
00966         NumCurrentAttrs = 0;
00967         return FALSE;
00968     }
00969 
00970     // Find out how many attributes there are.
00971     NumCurrentAttrs = AttributeManager::GetNumAttributes();
00972 
00973     // Render all non-NULL attributes.
00974     for (INT32 i = 0; i < NumCurrentAttrs; i++)
00975     {
00976         if (CurrentAttrs[i].pAttr != NULL && CurrentAttrs[i].pAttr->CanBeRenderedDirectly())
00977             CurrentAttrs[i].pAttr->Render(this);
00978     }
00979 
00980     // Ilan
00981     // Initialise the current offscreen pointer with a placeholder
00982     // this ensures that there is a default value which can be shifted to TheStack
00983     // so that the Restore() function gets called to to signal when the offscreen
00984     // bitmap rendering process has completed
00985     // NB ATTR_FEATHER used, but any offscreen attr with a conventional Restore() function would do
00986     // NB2 don't need to free mem as it is a pointer to the default val
00987     CurrentOffscreenAttr = (OffscreenAttrValue*) AttributeManager::GetDefaultAttributeVal(ATTR_FEATHER);
00988 
00989     // Override the quality attribute according to the View's setting.
00990     // Don't bother if there is no DocView - e.g. it's a render region that is used
00991     // to export a file.
00992     if (RenderView != NULL)
00993     {
00994         // Create a new quality attribute and install it.
00995         QualityAttribute *pAttr = new QualityAttribute(RenderView->RenderQuality);
00996         ENSURE(pAttr != NULL, "No memory for quality attribute to be created");
00997         if (pAttr == NULL)
00998             return FALSE;
00999 
01000         // TRUE => Temp; delete this attribute when it is popped off the stack.
01001         SetQuality(pAttr, TRUE);
01002     }
01003 
01004     // Everything completed ok
01005     return TRUE;
01006 }

BOOL RenderRegion::InitPrefs  )  [static]
 

Initialises the RenderRegions preferences from the preference file. This is called once as Camelot starts up.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
22/9/93
Returns:
TRUE if the Preference section was created ok

Definition at line 244 of file rndrgn.cpp.

00245 {
00246     Camelot.DeclareSection( _T("Selection Blob Sizes"), 2 );
00247     Camelot.DeclarePref( _T("Selection Blob Sizes"), _T("Selected Blobs"), &SelectedBlobSize, 1, 30 );
00248     Camelot.DeclarePref( _T("Selection Blob Sizes"), _T("UnSelected Blobs"), &UnSelectedBlobSize, 1, 30 );
00249     Camelot.DeclarePref( _T("Selection Blob Sizes"), _T("Multi Stage Selected Blobs"), &MultiStageSelectedBlobSize, 1, 30 );
00250     Camelot.DeclarePref( _T("Selection Blob Sizes"), _T("Multi Stage UnSelected Blobs"), &MultiStageUnSelectedBlobSize, 1, 30 );
00251 
00252     return TRUE;
00253 }

BOOL RenderRegion::IsBanded  ) 
 

To find out if the render region is banded.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/3/95
Returns:
TRUE if this render region is banded

Definition at line 6394 of file rndrgn.cpp.

06395 {
06396     return IsRegionBanded;
06397 }

virtual BOOL RenderRegion::IsClean  )  [inline, virtual]
 

Reimplemented in GRenderRegion.

Definition at line 421 of file rndrgn.h.

00421 {return FALSE;}

BOOL RenderRegion::IsHitDetect  )  const [inline]
 

Definition at line 457 of file rndrgn.h.

BOOL RenderRegion::IsPrinting  )  [inline]
 

Definition at line 453 of file rndrgn.h.

00453 { return RenderFlags.Printing; }

BOOL RenderRegion::IsRendering  )  [inline]
 

Definition at line 454 of file rndrgn.h.

00454 { return RenderFlags.Rendering; }

BOOL RenderRegion::IsSubRenderStateLocked void   )  const [inline]
 

Definition at line 442 of file rndrgn.h.

00442 { return(SubRenderStateLocked); };

BOOL RenderRegion::IsUsingSmoothedBitmaps  )  [inline]
 

Definition at line 459 of file rndrgn.h.

00459 { return RenderFlags.SmoothedBitmaps; }

BOOL RenderRegion::IsVeryMono  )  [inline]
 

Definition at line 456 of file rndrgn.h.

00456 { return RenderFlags.VeryMono; }

virtual BOOL RenderRegion::IsWrappedRender  )  const [inline, virtual]
 

Reimplemented in GRenderRegion.

Definition at line 717 of file rndrgn.h.

00717 {return FALSE;}

BOOL RenderRegion::LockedTransparentCaptures  )  const [virtual]
 

Search down the Capture stack from the top or from the capture specified until we find one that owns a bitmap. The master capture at the bottom of the stack should ALWAYS own a bitmap!

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
07/08/2005
Parameters:
- [INPUTS]
- [OUTPUTS]

Definition at line 7588 of file rndrgn.cpp.

07589 {
07590     const ListT<Capture*>* pList = m_CaptureStack.GetListT();
07591 
07592     Capture* pCapture = NULL;
07593     ListT<Capture*>::ConstIterator it = pList->End();
07594     INT32 nListSize = pList->Size();
07595     INT32 i=0;
07596 
07597     for (i=0; i < nListSize; i++)
07598     {
07599         pCapture = *(--it);
07600         if (pCapture->OwnsBitmap() &&
07601             pCapture->IsTransparent() &&
07602             (pCapture->IsMaster() || pCapture->info.caFlags.LockedTransparent)
07603             )
07604             return TRUE;
07605     }
07606 
07607     return FALSE;
07608 }

void RenderRegion::LockSubRenderState BOOL  Lock  )  [inline]
 

Definition at line 443 of file rndrgn.h.

00443 { SubRenderStateLocked = Lock; };

virtual BOOL RenderRegion::MasterCaptureIsCurrent  )  const [inline, virtual]
 

Reimplemented in GRenderRegion.

Definition at line 760 of file rndrgn.h.

00760 {return (!m_CaptureStack.Empty() && GetTopCapture() && GetTopCapture()->IsMaster());}

void RenderRegion::PopPathProcessor void   ) 
 

Pops a PathProcessor from the top of the rendering PathProcessor stack.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/12/96
Notes: The PathProcessor is deleted after being popped.

See also:
PathProcessor; RenderRegion::PushPathProcessor

Definition at line 5314 of file rndrgn.cpp.

05315 {
05316 #if _DEBUG
05317     // BLOCK
05318     {
05319         PathProcessor *pPP = PathProcessorStack;
05320         while (pPP != NULL)
05321         {
05322 //          TRACEUSER( "Jason", _T("  "));      // More indent for each processor on the stack
05323             pPP = pPP->GetNextProcessor();
05324         }
05325 
05326 //      TRACEUSER( "Jason", _T("<< PopPathProcessor %x\n"), PathProcessorStack);
05327     }
05328 #endif
05329 
05330 
05331     PathProcessor *TOS = PathProcessorStack;
05332 
05333     if (TOS != NULL)
05334     {
05335         PathProcessorStack = TOS->GetNextProcessor();   // Link TOS to 2nd processor in chain
05336         TOS->SetNextProcessor(NULL);                    // And make the popped one "clean"
05337 
05338         // Finally, delete the path processor
05339         delete TOS;
05340     }
05341 }

ColourFillAttribute * RenderRegion::PrepareFillGeometry ColourFillAttribute SourceAttr = NULL  )  [protected]
 

This function is used to allow 3 special attributes to function correctly. => Overprint line, Overprint fill, and Print on all plates.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/7/96
Parameters:
SourceAttr - NULL (to copy the current rendering fill attribute), [INPUTS] or the attribute to be "prepared".
Returns:
NULL if the given attribute needs not be changed before it is stacked, or points to a new attribute which should be stacked in place of the given one. Note that it is up to the caller to delete the new attribute (so when stacking it, you should set the "Temp" flag)
These attributes are specil in that they act as modifiers to the current stroke and fill attributes - they convert active colours into either no-colour, or a special greyscale value.

This is achieved by the following 2 steps: (1) Whenever a colour attribute is stacked, it is possibly replaced by a copy which has been modified with respect to the current states of the 3 Imagesetting attributes. (2) Whenever an Imagesetting attribute is stacked, the current line and/or fill attributes are copied (if necessary) in order to "apply" the new attribute effects to the current rendering colours.

This function takes the appropriate attribute and determines if it needs to be changed. If it does, a new, replacement, attribute is created and returned, which the caller should use in place of the

Notes: This function has one other purpose: It fixes bogus graduated fills. A no-colour to no-colour grad fill is (strangely) rendered as a solid black fill, so this methid will convert these silly attributes into flat no-colour fills.

See also:
RenderRegion::SetFillGeometry; RenderRegion::SetLineColour

Definition at line 2062 of file rndrgn.cpp.

02063 {
02064     // --- Make sure we've got a source attribute to play with
02065     if (SourceAttr == NULL)     // No provided attribute, so use the current fill attr
02066         SourceAttr = (ColourFillAttribute *) CurrentAttrs[ATTR_FILLGEOMETRY].pAttr;
02067 
02068     if (SourceAttr == NULL)     // No attribute to modify
02069         return(NULL);
02070 
02071     // --- Find the source colours.
02072     DocColour *StartCol = SourceAttr->GetStartColour();
02073     if (StartCol == NULL)                                   // Bitmap fills may be NULL - we leave them be
02074         return(NULL);
02075 
02076     DocColour *EndCol   = SourceAttr->GetEndColour();       // Note: May be NULL if it's a flat fill
02077 
02078     ColourFillAttribute *NewAttr = NULL;
02079 
02080 
02081     // --- Check for bogus grad fills
02082     // A no-colour to no-colour grad fill renders as solid black, so we always convert this
02083     // into a simple no-colour flat fill
02084     if (EndCol != NULL && StartCol->IsTransparent() && EndCol->IsTransparent())
02085     {
02086         NewAttr = new FlatFillAttribute(*StartCol);
02087         return(NewAttr);
02088     }
02089 
02090     // --- Check for bitmap fills
02091     // We can't change the colours for PrintOnAllPlates because when printing these are rendered to
02092     // a masked render region, and then get colour-separated (doh!)
02093     // We can't render bitmaps with overprint, as we can't do a "transparent" colour in an
02094     // arbitrarily transformed bitmap
02095 //  if (SourceAttr->IsKindOf(CC_RUNTIME_CLASS(BitmapFillAttribute)))
02096     if (SourceAttr->IsAKindOfBitmapFill())
02097         return(NULL);
02098 
02099     // --- Check for the PrintOnAllPlates attribute
02100     if ( ((PrintOnAllPlatesAttrValue *) CurrentAttrs[ATTR_PRINTONALLPLATES].pAttr)->IsPrintOnAllPlatesOn() )
02101     {
02102         BOOL HaveNewStartCol = FALSE;
02103         BOOL HaveNewEndCol   = FALSE;
02104 
02105         DocColour NewStartCol;
02106         DocColour NewEndCol;
02107 
02108         // Get a global default CMYK colour context
02109         ColourContextGreyT *cc = (ColourContextGreyT *) ColourManager::GetColourContext(COLOURMODEL_GREYT);
02110         ERROR3IF(cc == NULL, "No default Greyscale colour context?!");
02111 
02112         BOOL bNegate = FALSE;
02113         ColourPlateType Plate = COLOURPLATE_KEY;
02114         if (RenderView && RenderView->GetColourPlate())
02115         {
02116             bNegate = RenderView->GetColourPlate()->IsNegative();
02117             if (!RenderView->GetColourPlate()->IsMonochrome())
02118                 Plate = RenderView->GetColourPlate()->GetType();
02119         }
02120 
02121         // Apply POAP to the start colour, if the colour will be affected
02122         if (!StartCol->IsTransparent() && StartCol->IsSeparable())
02123         {
02124             // The print on all plates attribute is set, so we convert this into a pre-separated
02125             // Key greyscale DocColour, overriding overprint etc. First get it as a greyscale:
02126             PColourGreyT GreyDef;
02127             cc->ConvertColour(StartCol, (ColourPacked *) &GreyDef);
02128 
02129             // Then create a new CMYK colour with the grey-level in the required component
02130             PColourCMYK ColDef = {0, 0, 0, 0};
02131             BYTE InkVal = bNegate ? GreyDef.Intensity : 255 - GreyDef.Intensity;
02132             switch (Plate)
02133             {
02134             case COLOURPLATE_CYAN:
02135                 ColDef.Cyan = InkVal;
02136                 break;
02137             case COLOURPLATE_MAGENTA:
02138                 ColDef.Magenta = InkVal;
02139                 break;
02140             case COLOURPLATE_YELLOW:
02141                 ColDef.Yellow = InkVal;
02142                 break;
02143             default:
02144                 // This handles normal and composite as well as mono, key and spot plates
02145                 ColDef.Key = InkVal;
02146                 break;
02147             }
02148 
02149             NewStartCol.SetCMYKValue(&ColDef);  // Set the new start colour to the CMYK value
02150             NewStartCol.SetSeparable(FALSE);    // And set it non-separable
02151 
02152             HaveNewStartCol = TRUE;             // Flag the fact that it's changed
02153         }
02154 
02155         // Apply POAP to the end colour (if any), if the colour will be affected
02156         if (EndCol != NULL && !EndCol->IsTransparent() && EndCol->IsSeparable())
02157         {
02158             // The print on all plates attribute is set, so we convert this into a pre-separated
02159             // Key greyscale DocColour, overriding overprint etc. First get it as a greyscale:
02160             PColourGreyT GreyDef;
02161             cc->ConvertColour(EndCol, (ColourPacked *) &GreyDef);
02162 
02163             // Then create a new CMYK colour with the grey-level in the required component
02164             PColourCMYK ColDef = {0, 0, 0, 0};
02165             BYTE InkVal = bNegate ? GreyDef.Intensity : 255 - GreyDef.Intensity;
02166             switch (Plate)
02167             {
02168             case COLOURPLATE_CYAN:
02169                 ColDef.Cyan = InkVal;
02170                 break;
02171             case COLOURPLATE_MAGENTA:
02172                 ColDef.Magenta = InkVal;
02173                 break;
02174             case COLOURPLATE_YELLOW:
02175                 ColDef.Yellow = InkVal;
02176                 break;
02177             default:
02178                 // This handles normal and composite as well as mono, key and spot plates
02179                 ColDef.Key = InkVal;
02180                 break;
02181             }
02182 
02183             NewEndCol.SetCMYKValue(&ColDef);    // Set the new start colour to the CMYK value
02184             NewEndCol.SetSeparable(FALSE);      // And set it non-separable
02185 
02186             HaveNewEndCol = TRUE;               // Flag the fact that it's changed
02187         }
02188 
02189         // Have we changed either colour? If so, create a new attribute and return it
02190         if (HaveNewStartCol || HaveNewEndCol)
02191         {
02192             if (EndCol == NULL)
02193             {
02194                 // It was a flat fill, so create a new flat fill attribute
02195                 NewAttr = new FlatFillAttribute(NewStartCol);
02196             }
02197             else
02198             {
02199                 // Create a similar graduated fill attribute with the new colours
02200                 CCRuntimeClass *pCCRuntimeClass = SourceAttr->GetRuntimeClass();
02201                 NewAttr = (ColourFillAttribute *) pCCRuntimeClass->CreateObject();
02202 
02203                 if (NewAttr != NULL)
02204                 {
02205                     // Copy the details of the source attribute
02206                     NewAttr->SimpleCopy(SourceAttr);
02207 
02208                     // Set up the attribute, replacing the colours we've decided to change
02209                     if (HaveNewStartCol)
02210                         NewAttr->SetStartColour(&NewStartCol);
02211 
02212                     if (HaveNewEndCol)
02213                         NewAttr->SetEndColour(&NewEndCol);
02214                 }
02215             }
02216 
02217             return(NewAttr);
02218         }
02219     }
02220 
02221 
02222     // --- Check for a valid ColourPlate - if there is none, then no more effects will apply
02223     ERROR3IF(CurrentColContext == NULL, "No colour context when rendering?!");
02224     ColourPlate *ColPlate = CurrentColContext->GetColourPlate();
02225 
02226     if (ColPlate == NULL || ColPlate->IsDisabled())
02227         return(NULL);
02228 
02229 
02230     // --- Check for overprint
02231     // Is this entire colour plate set to overprint?
02232     BOOL Overprint = CurrentColContext->GetColourPlate()->Overprints();
02233 
02234     // If not, then is there a current "overprint fill" attribute in effect?
02235     if (!Overprint)
02236         Overprint = ((OverprintFillAttrValue *) CurrentAttrs[ATTR_OVERPRINTFILL].pAttr)->IsOverprintOn();
02237 
02238     // If not, then is this a "black" CMYK colour/fill?
02239     // We check if "Always Overprint Black" is enabled, and if the fill is a flat "black" fill, or
02240     // a grad fill between two "black" colours - but the checks are in a special order to try to
02241     // make the code as efficient as possible.
02242     if (!Overprint && StartCol->GetColourModel() == COLOURMODEL_CMYK && !StartCol->IsTransparent())
02243     {
02244         // How about the end colour? If it's a flat fill (no end col), or the end col is also CMYK, we continue
02245         if ( EndCol == NULL || (EndCol->GetColourModel() == COLOURMODEL_CMYK && !EndCol->IsTransparent()) )
02246         {
02247             // Both colours are potentially "black" - is the "always overprint black objects" flag enabled?
02248             if (RenderView->GetPrintControl() != NULL)
02249             {
02250                 TypesetInfo *TPInfo = RenderView->GetPrintControl()->GetTypesetInfo();
02251                 
02252                 if (TPInfo != NULL && TPInfo->AlwaysOverprintBlack())
02253                 {
02254                     // It is enabled, so check if this is a CMYK colour with more than 95% Key in it.
02255                     ColourCMYK ColDef;
02256                     StartCol->GetSourceColour((ColourGeneric *) &ColDef);
02257 
02258                     if (ColDef.Key.MakeDouble() > 0.95)     // It is "black", so we'll overprint it
02259                     {
02260                         if (EndCol == NULL)
02261                             Overprint = TRUE;               // Flat "black" fill, so overprint it
02262                         else
02263                         {
02264                             // The start colour is "black", but is the End colour "black" too?
02265                             EndCol->GetSourceColour((ColourGeneric *) &ColDef);
02266 
02267                             if (ColDef.Key.MakeDouble() > 0.95)     // Both cols are "black" so we'll overprint
02268                                 Overprint = TRUE;
02269                         }
02270                     }
02271                 }
02272             }
02273         }
02274     }
02275 
02276     if (Overprint)
02277     {
02278         ERROR3IF(CurrentColContext->GetColourModel() != COLOURMODEL_RGBT,
02279                     "Rendering ColourContext is not RGB. Bummer");
02280 
02281         // If overprint is on, then check if the colour is visible on this plate (i.e. is it white?)
02282         PColourRGBT ColDef;
02283 
02284         // Check the start colour. If it's white, we'll set it to no-colour (note: the default is to be
02285         // no-colour, so we only have to flag the fact that we want to change it here)
02286         BOOL UseTransStart = FALSE;
02287         if (!StartCol->IsTransparent() && StartCol->IsSeparable())
02288         {
02289             CurrentColContext->ConvertColour(StartCol, (ColourPacked *) &ColDef);
02290             UseTransStart = (ColDef.Red > 254 && ColDef.Green > 254 && ColDef.Blue > 254);
02291         }
02292 
02293         // Check the end colour - same as the start col, except that it may be NULL if it's a flat fill
02294         BOOL UseTransEnd = FALSE;
02295         if (EndCol != NULL && !EndCol->IsTransparent() && EndCol->IsSeparable())
02296         {
02297             CurrentColContext->ConvertColour(EndCol, (ColourPacked *) &ColDef);
02298             UseTransEnd = (ColDef.Red > 254 && ColDef.Green > 254 && ColDef.Blue > 254);
02299         }
02300 
02301         if (UseTransStart || UseTransEnd)       // If we must change either end to transparent...
02302         {
02303             if (EndCol == NULL ||                                       // If it's a flat fill, or
02304                     ((UseTransStart || StartCol->IsTransparent()) &&    // the start and end are both
02305                      (UseTransEnd   || EndCol->IsTransparent()))        // no-colour, make a flat fill
02306                 )
02307             {
02308                 // Make a flat fill
02309                 // (NOTE: this convert-to-flat-fill is necessary for the no-colour to no-colour grad fills
02310                 // that overprint can create, as they otherwise (helpfully) render as a black solid fill
02311                 // rather than the expected no-fill, while a no-colour flat fill works properly)
02312                 DocColour Trans(COLOUR_TRANS);
02313                 NewAttr = new FlatFillAttribute((UseTransStart) ? Trans : *StartCol);
02314                 return(NewAttr);
02315             }
02316 
02317             // NOTE:
02318             // We don't change the fill if it will remain graduated, because a grad fill from a colour
02319             // to no-colour will not make the fill go transparent for overprint, so we might as well
02320             // just leave it alone - i.e. the only case we care about is when the grad fill ends
02321             // up as ultimately a transparent-transparent fill after colour separation.
02322         }
02323     }
02324 
02325     // No special effects apply - tell the caller to use the original
02326     return(NULL);
02327 }

StrokeColourAttribute * RenderRegion::PrepareLineColour StrokeColourAttribute SourceAttr = NULL  )  [protected]
 

This function is used to allow 3 special attributes to function correctly. => Overprint line, Overprint fill, and Print on all plates.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/7/96
Parameters:
SourceAttr - NULL (to copy the current rendering line attribute), [INPUTS] or the attribute to be "prepared".
Returns:
NULL if the given attribute needs not be changed before it is stacked, or points to a new attribute which should be stacked in place of the given one. Note that it is up to the caller to delete the new attribute (so when stacking it, you should set the "Temp" flag)
These attributes are specil in that they act as modifiers to the current stroke and fill attributes - they convert active colours into either no-colour, or a special greyscale value.

This is achieved by the following 2 steps: (1) Whenever a colour attribute is stacked, it is possibly replaced by a copy which has been modified with respect to the current states of the 3 Imagesetting attributes. (2) Whenever an Imagesetting attribute is stacked, the current line and/or fill attributes are copied (if necessary) in order to "apply" the new attribute effects to the current rendering colours.

This function takes the appropriate attribute and determines if it needs to be changed. If it does, a new, replacement, attribute is created and returned, which the caller should use in place of the

See also:
RenderRegion::SetFillGeometry; RenderRegion::SetLineColour

Definition at line 1917 of file rndrgn.cpp.

01918 {
01919     // --- Make sure we've got a source attribute to play with
01920     if (SourceAttr == NULL)
01921         SourceAttr = (StrokeColourAttribute *) CurrentAttrs[ATTR_STROKECOLOUR].pAttr;
01922 
01923     if (SourceAttr == NULL)     // No attribute to modify
01924         return(NULL);
01925 
01926     // --- Find the source line colour. If it's transparent or non-separable, we won't change it
01927     DocColour *SourceCol = SourceAttr->GetStartColour();
01928 
01929     if (SourceCol == NULL || SourceCol->IsTransparent() || !SourceCol->IsSeparable())
01930         return(NULL);
01931 
01932     // --- Check for the PrintOnAllPlates attribute
01933     if ( ((PrintOnAllPlatesAttrValue *) CurrentAttrs[ATTR_PRINTONALLPLATES].pAttr)->IsPrintOnAllPlatesOn() )
01934     {
01935         // Get a global default CMYK colour context
01936         ColourContextGreyT *cc = (ColourContextGreyT *) ColourManager::GetColourContext(COLOURMODEL_GREYT);
01937         ERROR3IF(cc == NULL, "No default Greyscale colour context?!");
01938 
01939         // The print on all plates attribute is set, so we convert this into a pre-separated
01940         // Key greyscale DocColour, overriding overprint etc. First get it as a greyscale:
01941         PColourGreyT GreyDef;
01942         cc->ConvertColour(SourceCol, (ColourPacked *) &GreyDef);
01943 
01944         // Then create a new CMYK colour with the grey-level in the Key component
01945         PColourCMYK ColDef;
01946         ColDef.Key = 255 - GreyDef.Intensity;
01947         ColDef.Cyan = ColDef.Magenta = ColDef.Yellow = 0;
01948 
01949         DocColour NewCol;                   // Place the SourceCol into a DocColour, and make
01950         NewCol.SetCMYKValue(&ColDef);       // it non-colour-separable, so that it is dumped
01951         NewCol.SetSeparable(FALSE);         // out to the rendering device as it stands
01952 
01953         // And create and return a new stroke colour attribute
01954         StrokeColourAttribute *NewAttr = new StrokeColourAttribute(NewCol);
01955         return(NewAttr);
01956     }
01957 
01958     // --- Check for a valid ColourPlate - if there is none, then no more effects will apply
01959     ERROR3IF(CurrentColContext == NULL, "No colour context when rendering?!");
01960     ColourPlate *ColPlate = CurrentColContext->GetColourPlate();
01961 
01962     // Is there an active colour plate? If not, no overprint effects will occur
01963     if (ColPlate == NULL || ColPlate->IsDisabled())
01964         return(NULL);
01965 
01966 
01967     // --- Check for overprint
01968     // Is this entire colour plate set to overprint?
01969     BOOL Overprint = CurrentColContext->GetColourPlate()->Overprints();
01970 
01971     // If not, then is there a current "overprint line" attribute in effect?
01972     if (!Overprint)
01973         Overprint = ((OverprintLineAttrValue *) CurrentAttrs[ATTR_OVERPRINTLINE].pAttr)->IsOverprintOn();
01974 
01975     // If not, then is this a CMYK colour?
01976     if (!Overprint && SourceCol->GetColourModel() == COLOURMODEL_CMYK)
01977     {
01978         // It is CMYK - is the "always overprint black objects" flag enabled?
01979         if (RenderView->GetPrintControl() != NULL)
01980         {
01981             TypesetInfo *TPInfo = RenderView->GetPrintControl()->GetTypesetInfo();
01982             
01983             if (TPInfo != NULL && TPInfo->AlwaysOverprintBlack())
01984             {
01985                 // It is enabled, so check if this is a CMYK colour with more than 95% Key in it.
01986                 ColourCMYK ColDef;
01987                 SourceCol->GetSourceColour((ColourGeneric *) &ColDef);
01988 
01989                 if (ColDef.Key.MakeDouble() > 0.95)     // It is "black", so we'll overprint it
01990                     Overprint = TRUE;
01991             }
01992         }
01993     }
01994 
01995     if (Overprint)
01996     {
01997         ERROR3IF(CurrentColContext->GetColourModel() != COLOURMODEL_RGBT,
01998                     "Rendering ColourContext is not RGB. Bummer");
01999 
02000         // If overprint is on, then check if the colour is visible on this plate (i.e. is it white?)
02001         PColourRGBT ColDef;
02002         CurrentColContext->ConvertColour(SourceCol, (ColourPacked *) &ColDef);
02003 
02004         if (ColDef.Red > 254 && ColDef.Green > 254 && ColDef.Blue > 254)
02005         {
02006             DocColour NewCol(COLOUR_TRANS);     // It shouldn't appear on this plate, so return no-colour
02007 
02008             StrokeColourAttribute *NewAttr = new StrokeColourAttribute(NewCol);
02009             return(NewAttr);
02010         }
02011     }
02012 
02013     // No special effects apply - tell the caller to use the original
02014     return(NULL);
02015 }

void RenderRegion::PushPathProcessor PathProcessor pProcessor  ) 
 

Adds a PathProcessor to the rendering PathProcessor stack.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/12/96
Parameters:
pProcessor - the processor to push onto the processor stack [INPUTS] THIS PROCESSOR IS NOW OWNED BY THE RENDER REGION and will be deleted when it is popped.
Notes: The render region must be supplied a new PathProcessor every time you push one, because PathProcessors generally have an internal state, and this must be preserved when background rendering or multi-threading causes the same thing to be rendered "simultaneously".

See also:
PathProcessor; RenderRegion::PopPathProcessor

Definition at line 5266 of file rndrgn.cpp.

05267 {
05268     ERROR3IF(pProcessor == NULL, "Illegal NULL param");
05269 
05270 
05271 #if _DEBUG
05272     // BLOCK
05273     {
05274         // In debug builds, scan the entire PathProcessor stack, checking that this
05275         // processor is ot already in it.
05276         ERROR3IF(pProcessor->GetNextProcessor() != NULL,
05277                     "PushPathProcessor - processor is already in a stack");
05278         PathProcessor *pPP = PathProcessorStack;
05279         while (pPP != NULL)
05280         {
05281 //          TRACEUSER( "Jason", _T("  "));      // More indent for each processor on the stack
05282             ERROR3IF(pPP == pProcessor, "PushPathProcessor - Processor pushed TWICE!");
05283             pPP = pPP->GetNextProcessor();
05284         }
05285     }
05286 
05287 //  TRACEUSER( "Jason", _T("  >> PushPathProcessor %x\n"), pProcessor);
05288 #endif
05289 
05290     if (pProcessor != NULL)
05291     {
05292         pProcessor->SetNextProcessor(PathProcessorStack);       // Make TOS the second
05293         PathProcessorStack = pProcessor;                        // And point TOS at new item
05294     }
05295 }

BOOL RenderRegion::RenderBits KernelBitmap pkBitmap,
DocCoord pCoords,
INT32  numcoords,
BOOL  bForceNoTransp,
Node pEffectsOwner
[virtual]
 

To blit one bitmap defined by a DocRect into the current RenderRegion.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
01/07/2004
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the bitmap was rendered
See also:
GRenderRegion::StartCapture

Definition at line 7701 of file rndrgn.cpp.

07702 {
07703     ERROR2IF(!(numcoords==2 || numcoords==3), FALSE, "Wrong number of coords passed to RenderBits");
07704 
07705     if (pkBitmap->GetWidth()==0 || pkBitmap->GetHeight()==0)
07706         return FALSE;
07707 
07708 //  TRACEUSER( "Phil", _T("RenderBits %x %d, %d, %d, %d, %d, %d\n"), lpBits, pCoords[0].x, pCoords[0].y, pCoords[1].x, pCoords[1].y, pCoords[2].x, pCoords[2].y);
07709     SaveContext();
07710 
07711     // No lines on the rectangle
07712     SetLineColour(COLOUR_TRANS);
07713     SetLineWidth(0);
07714 
07715     BitmapFillAttribute *pBitmapAttr = new BitmapFillAttribute;
07716     pBitmapAttr->GetBitmapRef()->SetBitmap(pkBitmap);
07717 
07718     Path InkPath;
07719     if (numcoords==2)
07720     {
07721         //  This code was for upright rectangles only...
07722         InkPath.Initialise();
07723         InkPath.AddMoveTo(pCoords[0]);
07724         InkPath.AddLineTo(DocCoord(pCoords[1].x, pCoords[0].y));
07725         InkPath.AddLineTo(pCoords[1]);
07726         InkPath.AddLineTo(DocCoord(pCoords[0].x, pCoords[1].y));
07727         InkPath.AddLineTo(pCoords[0]);
07728         InkPath.CloseSubPath();
07729 
07730         pBitmapAttr->StartPoint = pCoords[0];
07731         pBitmapAttr->EndPoint   = DocCoord(pCoords[1].x, pCoords[0].y);
07732         pBitmapAttr->EndPoint2  = DocCoord(pCoords[0].x, pCoords[1].y);
07733     }
07734     else
07735     {
07736         // This version of the same code uses the array of 3 coords describing a parallelogram
07737         InkPath.Initialise();
07738         InkPath.AddMoveTo(pCoords[0]);
07739         InkPath.AddLineTo(pCoords[1]);
07740         InkPath.AddLineTo(DocCoord(pCoords[2].x+pCoords[1].x-pCoords[0].x, pCoords[2].y+pCoords[1].y-pCoords[0].y));
07741         InkPath.AddLineTo(pCoords[2]);
07742         InkPath.AddLineTo(pCoords[0]);
07743         InkPath.CloseSubPath();
07744 
07745         pBitmapAttr->StartPoint = pCoords[0];
07746         pBitmapAttr->EndPoint   = pCoords[1];
07747         pBitmapAttr->EndPoint2  = pCoords[2];
07748     }
07749 
07750     // Set bitmap attribute, and get the render region to throw it away when it's finished
07751     // with (hence the TRUE parameter).
07752     SetFillGeometry(pBitmapAttr, TRUE);
07753     SetSmoothingFlags(pBitmapAttr);
07754 
07755     // Set the mapping to have no repeat, otherwise we get artifacts at the edges when
07756     // anti-aliasing is enabled (see bug 1391).
07757     FillMappingLinearAttribute *pNoRepeatAttr = new FillMappingLinearAttribute;
07758 
07759     // Repeat value of '3' means 'repeat inverted' (there are no symbolic names for
07760     // these repeat values - shout at Will if you want some!).
07761 //  pNoRepeatAttr->Repeat = 3;
07762     pNoRepeatAttr->Repeat = 0;
07763 
07764     // Set mapping attribute, and get the render region to throw it away when it's finished
07765     // with (hence the TRUE parameter).
07766     SetFillMapping(pNoRepeatAttr, TRUE);
07767 
07768     // Force a 0% mix transparency (the transparency is in the bitmap)
07769     FlatTranspFillAttribute NoFillTransp(TT_NoTranspType);
07770     StrokeTranspAttribute NoLineTransp(TT_NoTranspType);
07771     if (bForceNoTransp)
07772     {
07773         SetTranspFillGeometry(&NoFillTransp, FALSE);
07774         SetLineTransp(&NoLineTransp, FALSE);
07775     }
07776 
07777     if (pEffectsOwner && pEffectsOwner->IsBounded())
07778         ((NodeRenderableBounded*)pEffectsOwner)->RenderEffectAttributes(this);
07779 
07780     // Draw the bitmap by rendering a bitmap filled path.
07781     InkPath.IsFilled = TRUE;
07782     DrawPath(&InkPath);
07783 
07784     SetSmoothingFlags(NULL);
07785 
07786     RestoreContext();
07787 
07788     return TRUE;
07789 }

BOOL RenderRegion::RenderBits LPBITMAPINFO  lpBitmapInfo,
LPBYTE  lpBits,
DocCoord pCoords,
INT32  numcoords,
BOOL  bForceNoTransp = TRUE,
Node pEffectsOwner = NULL
[virtual]
 

To blit one bitmap defined by a DocRect into the current RenderRegion.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
01/07/2004
Parameters:
- [INPUTS]
lpBitmapInfo [OUTPUTS] lpBits rect
Returns:
TRUE if the bitmap was rendered
See also:
GRenderRegion::StartCapture

Definition at line 7652 of file rndrgn.cpp.

07653 {
07654     ERROR2IF(!(numcoords==2 || numcoords==3), FALSE, "Wrong number of coords passed to RenderBits");
07655 
07656     if (lpBitmapInfo->bmiHeader.biWidth==0 || lpBitmapInfo->bmiHeader.biHeight==0)
07657         return FALSE;
07658 
07659 //  TRACEUSER( "Phil", _T("RenderBits %x %d, %d, %d, %d, %d, %d\n"), lpBits, pCoords[0].x, pCoords[0].y, pCoords[1].x, pCoords[1].y, pCoords[2].x, pCoords[2].y);
07660     CWxBitmap          *pBitmap = new CWxBitmap(lpBitmapInfo, lpBits);
07661     KernelBitmap       *pkBitmap = new KernelBitmap(pBitmap, TRUE);
07662     // Assume 8BPP bitmaps must be greyscale...
07663     if (pkBitmap->GetBPP()==8)
07664     {
07665         LPRGBQUAD pPalette = pkBitmap->GetPaletteForBitmap();
07666         for ( INT32 i=0 ; i<0x100 ; i++ )
07667             (UINT32&)pPalette[i] = i*0x010101 ;
07668     }
07669 
07670     RenderBits(pkBitmap, pCoords, numcoords, bForceNoTransp, pEffectsOwner);
07671 
07672     if (pBitmap)
07673     {
07674         pBitmap->BMBytes = ((CWxBitmap*)OILBitmap::Default)->BMBytes;
07675     }
07676     if (pkBitmap)
07677     {
07678         delete pkBitmap;
07679         pkBitmap = NULL;
07680     }
07681 
07682     return TRUE;
07683 }

BOOL RenderRegion::RenderBits LPBITMAPINFO  lpBitmapInfo,
LPBYTE  lpBits,
DocRect  rect,
BOOL  bForceNoTransp = TRUE,
Node pEffectsOwner = NULL
[virtual]
 

To blit one bitmap defined by a DocRect into the current RenderRegion.

?

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
01/07/2004
Parameters:
- [INPUTS]
lpBitmapInfo [OUTPUTS] lpBits rect
Returns:
TRUE if the bitmap was rendered
See also:
GRenderRegion::StartCapture

Definition at line 7629 of file rndrgn.cpp.

07630 {
07631     return RenderBits(lpBitmapInfo, lpBits, (DocCoord*)&rect, 2, bForceNoTransp, pEffectsOwner);
07632 }

BOOL RenderRegion::RenderChar WCHAR  ch,
Matrix pMatrix
[virtual]
 

Render a character, using the specified transform and current attributes in the render region.

Author:
Ed_Cornes (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/3/95
Parameters:
ch - unicode value of char [INPUTS] pMatrix - matrix specifying transforms to place char correctly in document
Returns:
FALSE if fails

Reimplemented in AIEPSRenderRegion, CamelotEPSRenderRegion, NativeRenderRegion, PrintingMaskedRenderRegion, PrintPSRenderRegion, EPSRenderRegion, and OSRenderRegion.

Definition at line 6033 of file rndrgn.cpp.

06034 {
06035     ERROR2IF(pMatrix==NULL,FALSE,"RenderRegion::RenderChar() - pMatrix==NULL");
06036     
06037     // create the char's path
06038     Path* pCharPath=CreateCharPath(ch,pMatrix);
06039     if (pCharPath==NULL)
06040         return FALSE;
06041 
06042     // if at least one point, draw path using current attibutes in render region
06043     if (pCharPath->GetNumCoords()!=0)
06044         DrawPath(pCharPath);
06045 
06046     // clean up
06047     delete pCharPath;
06048 
06049     return TRUE;
06050 }

BOOL RenderRegion::RenderNode Node pNode,
Node pRunToNode,
RenderCallback pCallback
[protected, virtual]
 

Wrap up the common stuff that's done to every node we render Render a single node and find out whether we should suspend rendering at this point Helper function for RenderTree.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/6/2004
Parameters:
- [INPUTS]
TRUE if RenderTree rendering can continue [OUTPUTS] FALSE if RenderTree rendering

Definition at line 7235 of file rndrgn.cpp.

07236 {
07237     BOOL bSuspendRendering = FALSE;
07238     BOOL bRender = TRUE;
07239 
07240     // Give RenderCallback object a chance to pre-process the rendering...
07241     if (pCallback)
07242         bRender = pCallback->BeforeNode(this, pNode);
07243 
07244     // Allow the loop to run forward to the RunTo node without rendering objects if it's set up...
07245     if (pRunToNode)
07246     {
07247         if (pRunToNode==pNode)              // If we are at the RunTo node
07248             pRunToNode = NULL;              // Then clear the system and allow it to render normally
07249         else
07250             if (pNode->IsAnObject())        // Else if this node is an object
07251                 bRender = FALSE;            // Don't let it render anything yet...
07252     }
07253 
07254     // If we can render this node, go ahead and do it.
07255     if (bRender && pNode->IsRenderedAsInk() && pNode->IsRenderable())
07256     {
07257 //TRACEUSER( "Phil", _T("RenderNode Node %x %s\n"), pNode, pNode->GetRuntimeClass()->m_lpszClassName);
07258         pNode->Render(this);                // Render the node
07259 
07260         if (CurrentSubRenderState!=NULL)    // If the node aborted rendering and set a subrender state
07261             bSuspendRendering = TRUE;       // Then Stop rendering without moving on the node pointer
07262     }
07263 
07264     return bSuspendRendering;
07265 }

virtual BOOL RenderRegion::RenderPaperAsInk  )  [inline, virtual]
 

Reimplemented in XPFRenderRegion.

Definition at line 722 of file rndrgn.h.

00722 { return(FALSE); }

BOOL RenderRegion::RenderTree Node pRoot,
BOOL  bTimeSlice = TRUE,
BOOL  bClip = TRUE,
RenderCallback pCallback = NULL
 

To render a specified subtree in this RenderRegion. The dominating factor in this routine is that it renders the document with as little time overhead as possible. Obviously, this is mainly down to RenderRegions and the tree scanning routines working fast but we can do a bit to help.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/5/93 (16/06/2004)
Parameters:
pRoot - pointer to root node [INPUTS] bTimeSlice - TRUE if rendering should be time-sliced (interruptible) bClip - TRUE if only those objects intersecting the clipping region should be rendered pCallback - Pointer to RenderCallback object to callback for each object or NULL
TRUE if rendering was interrupted (by reaching the end of a timeslice typically) [OUTPUTS] FALSE if rendering was completed

Definition at line 6935 of file rndrgn.cpp.

06939 {
06940 //  TRACEUSER( "Gerry", _T("In RenderTree CC = 0x%08x\n"), GetColourContext()->GetColourPlate());
06941     
06942     Node* pNode = NULL;
06943     Node* pRunToNode = NULL;
06944     DocRect ClipRect;
06945 
06946 //  BOOL HasRendered = FALSE;
06947     BOOL Continue = TRUE;
06948 // TEMP BODGE! DO NOT RELEASE!
06949 //bTimeSlice = FALSE;
06950     m_bRenderTreeTimeSlice = bTimeSlice;
06951 
06952 //  CBitmapCache* pBitmapCache = Camelot.GetBitmapCache();
06953 //  double ScaledPixelSize = GetScaledPixelWidth();
06954 
06955     // Record time when rendering started
06956     m_timeRenderTreeStartTime.Sample();
06957 
06958 PORTNOTE("other","PerfCounter not used under Linux")
06959 #if defined(__WXMSW__)
06960     LARGE_INTEGER countStart;
06961     LARGE_INTEGER countEnd;
06962     INT64 countOrigTotal = m_countTotal;
06963     QueryPerformanceCounter(&countStart);
06964 #endif
06965 
06966     // Find where to pick up rendering from...
06967     // Have we started rendering ink?
06968     if (bTimeSlice && IsInkRenderStarted)
06969         pNode = GetRenderState();
06970 
06971     if (!IsInkRenderStarted || pNode==NULL)
06972     {
06973         pNode = pRoot;
06974         SetRenderState(pRoot);
06975         if (CurrentSubRenderState != NULL)
06976         {
06977             // In the middle of rendering so lose this sub-context and set it to NULL
06978             delete CurrentSubRenderState;
06979             SetSubRenderState(NULL);
06980         }
06981 
06982         // We only want to do this once
06983         IsInkRenderStarted = TRUE;
06984     }
06985 
06986 #ifdef _DEBUG
06987     try
06988     {
06989 #endif
06990 
06991     // ---------------------------------------------------
06992     // This is the new rendering loop...
06993     //
06994     // The algorithm is basically this:
06995     //  Do
06996     //      Render A Subtree
06997     //  While more to do
06998     //
06999     //  In a bit more detail:
07000     //  Do
07001     //      Try to find deepest first child subtree of Node (pushing context onto stack, when going down)
07002     //      Else Render Node and Try to move to Next
07003     //          Else Render Parent and Move Next After Parent (pulling context off stack when coming up)
07004     //  While more to do
07005     //
07006     Node* pNextNode = NULL;
07007     Node* pChildNode = NULL;
07008     do
07009     {
07010 //      TRACEUSER( "Gerry", _T("    CC = 0x%08x\n"), GetColourContext()->GetColourPlate());
07011 //      if (GetColourContext()->GetColourPlate() == (ColourPlate*)0xfeeefeee) { __asm {INT32 3}; }
07012         
07013         // At this point pNode ALWAYS refers to a node/subtree that has NOT yet been rendered!
07014         // (Er, unless there's a SubRenderContext stored - in which case we must continue
07015         // to render the current node without entering its subtree.)
07016         //
07017         // -----------------------------------------------
07018         // --- Test Subtree ---
07019         //
07020         // Check whether it's even worth bothering with this subtree...
07021         // (RenderSubtree does clip rect testing)
07022         //
07023 //TRACEUSER( "Phil", _T("RenderTree %x %s\n"), pNode, pNode->GetRuntimeClass()->m_lpszClassName);
07024         SubtreeRenderState state = SUBTREE_ROOTANDCHILDREN;                 // Assume normal depth-first behaviour
07025         SubtreeRenderState callbackstate = SUBTREE_NORENDER;
07026         if (CurrentSubRenderState)                                          // If we're partway through a node
07027             state = CurrentSubRenderState->renderstate;                     // Continue rendering that node (usually SUBTREE_ROOTONLY)
07028         else
07029             if (pCallback && pCallback->BeforeSubtree(this, pNode, &pNextNode, bClip, &callbackstate))
07030                 state = callbackstate;
07031             else
07032             {
07033                 if (pNode->IsRenderable())                                  // If this node is at all renderable
07034                     state = pNode->RenderSubtree(this, &pNextNode, bClip);  // Allow node to decide where to go
07035                 else
07036                     state = SUBTREE_NORENDER;                               // Else don't render anything
07037             }
07038 
07039         // -----------------------------------------------
07040 //      if (GetColourContext()->GetColourPlate() == (ColourPlate*)0xfeeefeee) { __asm {INT32 3}; }
07041 
07042         if (state==SUBTREE_JUMPTO)
07043         {
07044             // Node wants rendering to jump somewhere else
07045             // This isn't really sorted yet - something needs to be done about context
07046             // stacking...
07047             if (pNextNode!=NULL)
07048             {
07049                 pNode = pNextNode;
07050                 continue;
07051             }
07052             // (If pNextNode was NULL then we fall through to finding the next node...)
07053         }
07054 
07055         if (state==SUBTREE_RUNTO)
07056         {
07057             // Node wants rendering to run forward to somewhere else without actually
07058             // rendering any object but maintaining the attribute stack correctly
07059             if (pNextNode!=NULL)
07060             {
07061                 pRunToNode = pNextNode;
07062                 // NOTE! Since we don't preserve pRunToNode outside this routine
07063                 // it must not abort due to timeslicing while pRunToNode!=NULL
07064             }
07065             // (If pNextNode was NULL then we fall through to finding the next node...)
07066         }
07067 
07068         if (state==SUBTREE_ROOTANDCHILDREN || state==SUBTREE_RUNTO)
07069         {
07070             // Depth-first, so check for children first...
07071             // Go down the tree from the current node, looking for child lists to render
07072             pChildNode = pNode->FindFirstChild();
07073             if (pChildNode)
07074             {
07075                 // Then scan the child list
07076                 SaveContext();                                              // <<<< Going down
07077                 //TRACEUSER( "Phil", _T("SaveContext scope = %x\n"), pNode);
07078 
07079                 // Set this child as the next subtree to consider...
07080                 pNode = pChildNode;
07081                 continue;
07082             }
07083         }
07084 
07085         // Finished trying to deal with subtree so render subtree root node
07086         if (state==SUBTREE_ROOTONLY || state==SUBTREE_ROOTANDCHILDREN || state==SUBTREE_RUNTO)
07087         {
07088             // No children or root only so render this node directly...
07089             BOOL bSuspend = RenderNode(pNode, pRunToNode, pCallback);
07090 //          if (GetColourContext()->GetColourPlate() == (ColourPlate*)0xfeeefeee) { __asm {INT32 3}; }
07091             if (bSuspend) break;
07092         }
07093 
07094         // Balance the call to RenderSubtree
07095         if (!(pCallback && pCallback->AfterSubtree(this, pNode)))
07096             pNode->RenderAfterSubtree(this);
07097         
07098         // -----------------------------------------------
07099         // --- Move on to next subtree ---
07100         //
07101         // SUBTREE_NORENDER
07102         //
07103         pNextNode = pNode->FindNext();
07104 
07105         // See if we got here because we set up a subrender context especially to do so
07106         // If so, get rid of this context so that rendering can proceed normally
07107         if (CurrentSubRenderState && CurrentSubRenderState->IsKindOf(CC_RUNTIME_CLASS(SubTreeRenderContext)))
07108         {
07109             delete CurrentSubRenderState;
07110             CurrentSubRenderState = NULL;
07111         }
07112 
07113         // -----------------------------------------------
07114         // --- Render Subtree Parents ---
07115         //
07116         // While no next sibling found, look for parent's next sibling...
07117         if (pNextNode==NULL && pNode!=pRoot && Continue)
07118         {
07119             do
07120             {
07121                 pNode = pNode->FindParent();
07122                 if (pNode)
07123                 {
07124                     // Render the parent node now that its children have all been rendered...
07125                     BOOL bSuspend = RenderNode(pNode, pRunToNode, pCallback);
07126 //                  if (GetColourContext()->GetColourPlate() == (ColourPlate*)0xfeeefeee) { __asm {INT32 3}; }
07127                     if (bSuspend) break;
07128 
07129                     //TRACEUSER( "Phil", _T("RestoreContext scope = %x\n"), pNode);
07130                     RestoreContext();                                           // >>>> Coming up
07131 
07132                     // Slightly unpleasant to have yet another call to the Node
07133                     // but for things to balance correctly, it needs to be given a chance
07134                     // to do stuff /outside/ the attribute scope created by the calls
07135                     // to SaveContext and RestoreContext...
07136                     //
07137                     // Balance the call to RenderSubtree
07138                     if (!(pCallback && pCallback->AfterSubtree(this, pNode)))
07139                         pNode->RenderAfterSubtree(this);
07140 
07141                     pNextNode = pNode->FindNext();
07142 
07143 PORTNOTE("other","PerfCounter not used under Linux")
07144 #if defined(__WXMSW__)
07145                     // I'm not really happy about doing this here but profiling will tell us
07146                     // whether it's really a problem...
07147                     QueryPerformanceCounter(&countEnd);
07148                     m_countTotal = countOrigTotal + countEnd.QuadPart - countStart.QuadPart;
07149 #endif
07150 
07151                     // See if we should stop coming up out of this subtree because we've run out of time
07152                     Continue = RenderTreeCanContinue();
07153                 }
07154             }
07155             while (pNextNode==NULL && pNode!=pRoot && Continue);
07156 
07157             if (!Continue)
07158             {
07159                 // We have run out of time while following parent links
07160                 // so we need to set things up so that when rendering
07161                 // is restarted, it doesn't go DOWN into the subtree again!!!
07162                 // We do this by setting up a subrender state so that the logic above
07163                 // will drop through the SUBTREE_NORENDER path
07164                 //
07165                 // Note: Leave the current node pointer alone
07166                 //
07167                 SubTreeRenderContext* pReturnHereContext = new SubTreeRenderContext();
07168                 SetSubRenderState(pReturnHereContext);
07169                 break;
07170             }
07171         }
07172 
07173         // We should move the current node pointer on if we know that
07174         // the 
07175         if (pNextNode && pNode!=pRoot) pNode = pNextNode;
07176 
07177 PORTNOTE("other","PerfCounter not used under Linux")
07178 #if defined(__WXMSW__)
07179         // I'm not really happy about doing this here but profiling will tell us
07180         // whether it's really a problem...
07181         QueryPerformanceCounter(&countEnd);
07182         m_countTotal = countOrigTotal + countEnd.QuadPart - countStart.QuadPart;
07183 #endif
07184         
07185         // See if we are time slicing and we still have more time available
07186         Continue = RenderTreeCanContinue();
07187     }
07188     while (pNode && pNode!=pRoot && (Continue || pRunToNode!=NULL));
07189     //
07190     // Here endeth the new rendering loop
07191     // ---------------------------------------------------
07192 
07193 
07194 #ifdef _DEBUG
07195     }
07196     catch (...)
07197     {
07198         TRACEUSER( "Phil", _T("Exception during rendering...\n"));
07199     }
07200 #endif
07201 
07202     if (pNode==pRoot) pNode = NULL;
07203 
07204     // Reset state to new posn in tree.
07205     SetRenderState(pNode);
07206 
07207     ENSURE(pRunToNode==NULL, "Expected pRunToNode to be NULL at end of RenderTree\n");
07208 
07209 //TRACEUSER( "Phil", _T("RenderTree exiting %x %s\n", pNode, pNode?pNode->GetRuntimeClass()->m_lpszClassName:"NULL"));
07210 //  if (pbHaveRendered)
07211 //      *pbHaveRendered = *pbHaveRendered || HasRendered;
07212 
07213     return Continue;
07214 }

BOOL RenderRegion::RenderTreeCanContinue  ) 
 

Decide whether we can continue to render in RenderTree.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/6/2004
Parameters:
- [INPUTS]
TRUE if RenderTree rendering can continue [OUTPUTS] FALSE if RenderTree rendering should stop

Definition at line 7283 of file rndrgn.cpp.

07284 {
07285     // If we are currently capturing offscreen stuff then we prefer to continue rendering
07286     // because the overhead of composing offscreen bitmaps together is so great
07287     // so lengthen the timeslice to make this happen less often
07288     INT32 t = Timeslice;
07289     if (GetCaptureDepth()>1) t = t*2;
07290     // if m_bRenderTreeTimeSlice == FALSE
07291     // or the timeslice hasn't elapsed yet then we can continue
07292     return !m_bRenderTreeTimeSlice || !m_timeRenderTreeStartTime.Elapsed(t);
07293 }

BOOL RenderRegion::RenderTreeNoCache Node pRoot  ) 
 

Renders a subtree with cacheing disabled.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
20/07/2005
Parameters:
pNode - pointer to root node of subtree to render [INPUTS]
Returns:
FALSE if the render failed TRUE if it worked

Definition at line 7310 of file rndrgn.cpp.

07311 {
07312     if (pRoot == NULL || this == NULL)
07313         return FALSE;
07314 
07315     // pNode may not be in the document tree!
07316     // So all bets are off regarding cacheing.
07317     // Therefore we disable cacheing during this render.
07318     ScopedFlagSetter fsBitmapCacheing(NodeRenderableBounded::bEnableCacheing, FALSE);
07319 
07320     SaveContext();
07321     RenderTree(pRoot, FALSE, FALSE);
07322     RestoreContext();
07323 
07324     return TRUE;
07325 }

BOOL RenderRegion::ResetColourContext  ) 
 

Definition at line 1008 of file rndrgn.cpp.

01009 {
01010     // Find this documents default colour context for the screen (RGB)
01011     if (RenderView != NULL)
01012     {
01013         // Find a colour context for the View we're rendering. This will automatically find
01014         // a suitable local, document, or global context for us to use
01015         CurrentColContext = RenderView->GetColourContext(COLOURMODEL_RGBT);
01016         if (CurrentColContext == NULL)  // should never be a problem!
01017         {
01018             DiagnosticFn( _T("InitDevice:"), _T("No colour context") );
01019             ERROR(_R(IDT_INTERNAL_ERROR), FALSE);
01020         }
01021     }
01022     else
01023     {
01024         ERROR3("View is NULL in RenderRegion::InitDevice()");
01025         return FALSE;
01026     }
01027 
01028     return(TRUE);
01029 }

void RenderRegion::ResetRegion DocRect NewClipRect  )  [virtual]
 

Resets the render region (after it has been merged), so that it no longer thinks it is banded etc. It also takes the Regions rectangle from the Current Clipping rectangle, so set this correctly before calling this function.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/5/95

Reimplemented in GRenderRegion.

Definition at line 6227 of file rndrgn.cpp.

06228 {
06229     // Note from Will. We really need to be re-rendering the Paper onto
06230     // the screen, if we have rendered something in this Region, but we
06231     // don't seem to be able to do this during a Paint message, as it
06232     // appears you can only render into the Area specified as invalid by
06233     // the message.  I tried clearing the clipping region etc, but this
06234     // made no difference.  There must be some way to do it though.
06235     // A solution would be to flag that the paper needs re-rendering, 
06236     // and do it on the next 'StartRender' call.
06237 
06238     Capture* pCapture = GetTopCapture();
06239     while (pCapture)
06240     {
06241         ENSURE(!pCapture->OwnsBitmap(), "Capture unexpectedly owns bitmap in RenderRegion::ResetRegion");
06242 
06243         m_CaptureStack.Pop();
06244 //TRACEUSER( "Phil", _T("ResetRegion Pop/Delete Capture\n"));
06245         if (pCapture->IsMaster())
06246         {
06247             SetRenderToCapture(pCapture, FALSE, FALSE);
06248         }
06249         else
06250         {
06251             pCapture->FreeDIB();
06252         }
06253         delete pCapture;
06254 
06255         pCapture = GetTopCapture();
06256     }
06257 
06258     // Set the new clipping rect
06259     SetClipRect(NewClipRect);
06260 
06261     // We set this flag to get the render region to blit the paper on the first
06262     // time past after it is reset.
06263     // Unfortunately this causes large amounts of unecessary blitting when scrolling
06264     // an empty document around with the push tool
06265     // Arrghh.  No we don't.  We clear the IsPaperRendered flag so that the paper is 
06266     // rendered into the region on the next render timeslice if the region requires it
06267     // This should eliminate all unecessary blitting
06268     // Gerry Iles 13/01/2006
06269 //  NeedsOSPaper = FALSE;
06270     IsPaperRendered = FALSE;
06271     
06272     // No Banding please
06273     IsRegionBanded = FALSE;
06274     IsWaitingForRAM = FALSE;
06275     IsLastBand = TRUE;
06276     CanRegionBeMerged = TRUE;
06277 
06278     // Set the region for this render region to match the clip rect
06279     RegionRect = CurrentClipRect;
06280 
06281     // Reset the rendering state
06282     ResetRender();
06283 
06284     // Make sure that that we re-init the device
06285     RenderFlags.ValidDevice = FALSE;
06286 }

void RenderRegion::ResetRender  )  [virtual]
 

Reset the rendering state of this region.

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

Definition at line 6300 of file rndrgn.cpp.

06301 {
06302     IsPaperRendered = FALSE;
06303     IsInkRenderStarted = FALSE;
06304 
06305     IsBeingReset = TRUE;
06306     {
06307         // Copy a blank stack over our old one, in order to wipe it clean.
06308         RenderStack EmptyStack;
06309         if (!TheStack.Copy(&EmptyStack, this))
06310         {
06311             // We failed to copy the empty attribute stack
06312             ERROR3("Empty Attribute Stack could not be copied");
06313         }
06314     }
06315     IsBeingReset = FALSE;
06316 
06317     // And clean up any errant PathProcessors. (If a node, e.g. a Mould, added a PathProcessor
06318     // and we aborted rendering halfway through its subtree, nobody calls the mould back
06319     // to de-initialise, so the PathProcessor would be left lying around)
06320     while (PathProcessorStack != NULL)
06321         PopPathProcessor();
06322 
06323     // Now setup the render state 
06324     CurrentRenderState = NULL;
06325     SubRenderStateLocked = FALSE;
06326     if (CurrentSubRenderState!=NULL)
06327     {
06328         // get rid of any sub-render context we may have.
06329         delete CurrentSubRenderState;
06330         CurrentSubRenderState = NULL;
06331     }
06332 }

void RenderRegion::ResizeRegion DocRect NewClipRect  )  [virtual]
 

Called when a Region is changed in size (eg. clipped to the client area).

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
4/7/95

Reimplemented in GRenderDIB.

Definition at line 6208 of file rndrgn.cpp.

06209 {
06210     // Just reset the region by default
06211     ResetRegion(NewClipRect);
06212 }

void RenderRegion::RestoreAttribute UINT32  Index,
AttributeValue pAttr,
BOOL  Temp
 

Restore the given attribute to the current attribute array. This is called when the rendering context stack is popped - the current attribute is ousted (and deleted if it is a temporary object), and the given one is installed in its place.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
Index - Unique attribute ID (See AttributeManager::RegisterDefaultAttribute). [INPUTS] pAttr - the new attribute to use as the current one. Temp - TRUE if pAttr points to a temporary object, FALSE if not.
See also:
RenderRegion::SaveAttribute

Definition at line 1756 of file rndrgn.cpp.

01757 {
01758 #ifdef DEBUG
01759     if(m_TraceOutContextLevels)
01760     {
01761         TRACE( _T("Am Resetting %d "), IsBeingReset);
01762         TRACE( _T("...Restoring Level %d Attribute 0x%x with 0x%x"),m_CurrentContextLevel,CurrentAttrs[Index].pAttr, pAttr);
01763     }
01764 
01765     // Make sure the current Attr is a valid pointer.
01766     if(!IsBeingReset)
01767         CC_ASSERT_VALID((CurrentAttrs[Index].pAttr));
01768 
01769     if(m_TraceOutContextLevels)
01770     {
01771         TRACE( _T(" Attribute %s\n"), (LPCTSTR)pAttr->GetRuntimeClass()->m_lpszClassName);
01772     }
01773 #endif
01774 
01775     // Mark Howitt Friday 13th Oct 2000
01776     // I`ve placed this new check in here in order to stop a problem that causes camelot to crash
01777     // when calling the GoingOutOfScope function. The problem is that the attribute that the stack
01778     // is pointing to has been deleted and is pointing at deleted memory!
01779     // This only happens in the case of when an Op is called when the render loop is deep inside
01780     // the tree and the Op affects an attribute above the current context which when restored is
01781     // corrupt!!! The way we are now dealing with this is to basically not call the GoingOutOfScope
01782     // function but just make a call to the PopPathProcessor function. This makes sure that we
01783     // relinquish any memory.
01784     // We`re using the IsBeingReset variable as it only goes TRUE when the region is about to die!
01785     // It`s also an Ilan variable used for the OffScreenRenderRegions!
01786     if(!IsBeingReset)
01787         CurrentAttrs[Index].pAttr->GoingOutOfScope(this);
01788     else
01789         PopPathProcessor();
01790 
01791     // If the current attribute is a temporary one, then delete it as we're about to stop
01792     // using it.
01793     if (CurrentAttrs[Index].Temp) 
01794         delete CurrentAttrs[Index].pAttr;
01795 
01796     // Install the new attribute.
01797     CurrentAttrs[Index].pAttr = pAttr; 
01798     CurrentAttrs[Index].Temp = Temp;
01799 }

void RenderRegion::RestoreClipRegion ClipRegionAttribute pAttr,
BOOL  Temp
[virtual]
 

Restore this render-region's current clipping region, using the attribute supplied. See also: ClipRegionAttribute::Restore(), RenderRegion::SetClipRegion().

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
11 April 2000
Parameters:
pAttr the new ClipRegionAttribute. [INPUTS] Temp whether the new attribute is temporary, and should therefore be deleted when it is finished with.

Reimplemented in AIEPSRenderRegion, EPSRenderRegion, and GRenderRegion.

Definition at line 5021 of file rndrgn.cpp.

05022 {
05023     RestoreAttribute(ATTR_CLIPREGION, (AttributeValue *) pAttr, Temp);
05024 }

void RenderRegion::RestoreContext  ) 
 

Definition at line 1103 of file rndrgn.cpp.

01104 {
01105     TheStack.RestoreContext(this);
01106 
01107 #ifdef _DEBUG
01108     m_CurrentContextLevel--;
01109 #endif
01110 }

void RenderRegion::RestoreDashPattern DashPatternAttribute pAttr,
BOOL  Temp
[virtual]
 

Get rid of the current dash pattern, and restore the specified one.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/10/94
Parameters:
pAttr - the object specifying the dash pattern to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetDashPattern

Definition at line 3416 of file rndrgn.cpp.

03417 {
03418     // Set up the new attribute
03419     RestoreAttribute(ATTR_DASHPATTERN, pAttr, Temp);
03420 
03421     // The line attributes need to be reset before drawing anything.
03422     SetLineAttributes(CHANGEATTR_DASHPATTERN);
03423 }

void RenderRegion::RestoreDrawingMode DrawingModeAttribute pAttr,
BOOL  Temp
[virtual]
 

Get rid of the current drawing mode, and restore the specified drawing mode.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
pAttr - the object specifying the drawing mode to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetDrawingMode

Definition at line 4133 of file rndrgn.cpp.

04134 {
04135     // Set up the new attribute
04136     RestoreAttribute(DrawingModeAttribute::ID, pAttr, Temp);
04137     DrawingMode = pAttr->DrawingMode;
04138 
04139     // The drawing mode needs to be set
04140     // MarkH - 12/11/99
04141     // First check to see if we`re dealing with a derived class or using the base class as
04142     // the base class ( RenderRegion ) 'SetOSDrawingMode()' is a pure virtual which will
04143     // ultimately crash in a big way if it is called!!!!
04144     if(!IS_A(this,RenderRegion))
04145     {
04146         SetOSDrawingMode();
04147     }
04148 }

void RenderRegion::RestoreEndArrow EndArrowAttribute pAttr,
BOOL  Temp
[virtual]
 

Get rid of the current EndArrow, and restore the specified one.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/4/95
Parameters:
pAttr - the object specifying the dash pattern to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetEndArrow

Definition at line 3900 of file rndrgn.cpp.

03901 {
03902     // Set up the new attribute
03903     RestoreAttribute(ATTR_ENDARROW, pAttr, Temp);
03904 
03905     // The line attributes need to be reset before drawing anything.
03906     SetLineAttributes(CHANGEATTR_ENDARROW);
03907 }

void RenderRegion::RestoreFillEffect FillEffectAttribute pAttr,
BOOL  Temp
[virtual]
 

Get rid of the current fill type, and restore the specified fill type.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
pAttr - the object specifying the fill type to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetFillType; RenderRegion::SetFillColour

Definition at line 3031 of file rndrgn.cpp.

03032 {
03033     // Set up the new attribute
03034     RestoreAttribute(ATTR_FILLEFFECT, pAttr, Temp);
03035 
03036     // The fill attributes need to be reset before drawing anything.
03037     SetFillAttributes(CHANGEATTR_EFFECT);
03038 }

void RenderRegion::RestoreFillGeometry ColourFillAttribute pAttr,
BOOL  Temp
[virtual]
 

Get rid of the current fill type, and restore the specified fill type.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
pAttr - the object specifying the fill type to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetFillType; RenderRegion::SetFillColour

Definition at line 2931 of file rndrgn.cpp.

02932 {
02933     // Set up the new attribute
02934     RestoreAttribute(ATTR_FILLGEOMETRY, pAttr, Temp);
02935 
02936     // The fill attributes need to be reset before drawing anything.
02937     SetFillAttributes(CHANGEATTR_GEOMETRY);
02938 }

void RenderRegion::RestoreFillMapping FillMappingAttribute pAttr,
BOOL  Temp
[virtual]
 

Get rid of the current fill type, and restore the specified fill type.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
pAttr - the object specifying the fill type to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetFillType; RenderRegion::SetFillColour

Definition at line 2981 of file rndrgn.cpp.

02982 {
02983     // Set up the new attribute
02984     RestoreAttribute(ATTR_FILLMAPPING, pAttr, Temp);
02985 
02986     // The fill attributes need to be reset before drawing anything.
02987     SetFillAttributes(CHANGEATTR_MAPPING);
02988 }

void RenderRegion::RestoreFillOverprint OverprintFillAttrValue NewAttr,
BOOL  Temp
[virtual]
 

Restore the previous Fill Overprint state, popping the previous state from the rendering stack.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/7/96
Parameters:
NewAttr - The new OverPrintLineAttrValue you want to set current [INPUTS] Temp - TRUE if this is a temporary object which the render region should delete when finished with it; FALSE if someone else will delete it (i.e. it's in the document tree)
See also:
RenderRegion::SetOverprintLine

Definition at line 2440 of file rndrgn.cpp.

02441 {
02442     RestoreAttribute(ATTR_OVERPRINTFILL, NewAttr, Temp);
02443 }

void RenderRegion::RestoreJoinType JoinTypeAttribute pAttr,
BOOL  Temp
[virtual]
 

Get rid of the current JoinType, and restore the specified one.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/4/95
Parameters:
pAttr - the object specifying the dash pattern to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetJoinType

Definition at line 3564 of file rndrgn.cpp.

03565 {
03566     // Set up the new attribute
03567     RestoreAttribute(ATTR_JOINTYPE, pAttr, Temp);
03568 
03569     // The line attributes need to be reset before drawing anything.
03570     SetLineAttributes(CHANGEATTR_JOINTYPE);
03571 }

void RenderRegion::RestoreLineColour StrokeColourAttribute pAttr,
BOOL  Temp
[virtual]
 

Get rid of the current line colour, and restore the specified line colour value.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
pAttr - the object specifying the colour to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetLineColour

Definition at line 2620 of file rndrgn.cpp.

02621 {
02622     // Restore the line colour attribute
02623     RestoreAttribute(ATTR_STROKECOLOUR, pAttr, Temp);
02624 
02625     // The line attributes need to be reset before drawing anything.
02626     SetLineAttributes(CHANGEATTR_STROKECOL);
02627 }

void RenderRegion::RestoreLineOverprint OverprintLineAttrValue NewAttr,
BOOL  Temp
[virtual]
 

Restore the previous Line Overprint state, popping the previous state from the rendering stack.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/7/96
Parameters:
NewAttr - The new OverPrintLineAttrValue you want to set current [INPUTS] Temp - TRUE if this is a temporary object which the render region should delete when finished with it; FALSE if someone else will delete it (i.e. it's in the document tree)
See also:
RenderRegion::SetOverprintLine

Definition at line 2382 of file rndrgn.cpp.

02383 {
02384     RestoreAttribute(ATTR_OVERPRINTLINE, NewAttr, Temp);
02385 }

void RenderRegion::RestoreLineTransp StrokeTranspAttribute pAttr,
BOOL  Temp
[virtual]
 

Get rid of the current line colour, and restore the specified line colour value.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
pAttr - the object specifying the colour to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetLineColour

Definition at line 2704 of file rndrgn.cpp.

02705 {
02706     // Restore the line colour attribute
02707     RestoreAttribute(ATTR_STROKETRANSP, pAttr, Temp);
02708 
02709     // The line attributes need to be reset before drawing anything.
02710     SetLineAttributes(CHANGEATTR_STROKETRANSP);
02711 }

void RenderRegion::RestoreLineWidth LineWidthAttribute pAttr,
BOOL  Temp
[virtual]
 

Get rid of the current line width, and restore the specified line width.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
pAttr - the object specifying the line width to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetLineWidth

Definition at line 3251 of file rndrgn.cpp.

03252 {
03253     // Set up the new attribute
03254     RestoreAttribute(ATTR_LINEWIDTH, pAttr, Temp);
03255 
03256     // The line attributes need to be reset before drawing anything.
03257     SetLineAttributes(CHANGEATTR_LINEWIDTH);
03258 
03259     // NB We need to invalidate the dash pattern too as this depends
03260     //    on line width (doesn't seem to matter normally, but PostScript
03261     //    gets dash patterns wrong otherwise.
03262     SetLineAttributes(CHANGEATTR_DASHPATTERN);
03263 }

void RenderRegion::RestoreMitreLimit MitreLimitAttribute pAttr,
BOOL  Temp
[virtual]
 

Get rid of the current MitreLimit, and restore the specified one.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/4/95
Parameters:
pAttr - the object specifying the dash pattern to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetMitreLimit

Definition at line 3974 of file rndrgn.cpp.

03975 {
03976     // Set up the new attribute
03977     RestoreAttribute(ATTR_MITRELIMIT, pAttr, Temp);
03978 
03979     // The line attributes need to be reset before drawing anything.
03980     SetLineAttributes(CHANGEATTR_MITRELIMIT);
03981 }

void RenderRegion::RestoreOffscreen OffscreenAttrValue  )  [virtual]
 

Reimplemented in MaskedRenderRegion, PrintingMaskedRenderRegion, GRenderBrush, and GRenderRegion.

Definition at line 4958 of file rndrgn.cpp.

04959 {
04960     // End this capture:
04961     // Don't render captured bitmap back into render region - owner will do that after processing
04962     // Release bitmap here - if this region is being reset
04963     if (!IsBeingReset)
04964     {
04965         LPBITMAPINFO lpCapturedBitmapInfo = NULL;
04966         LPBYTE lpCapturedBits = NULL;
04967         DocRect CaptureRect = CurrentOffscreenAttr->GetOffscreenBoundingRect(); // Initialise to size of feathered object
04968                                                                 // so that StopCapture can return sensible 24BPP bitmap if needed
04969         Capture* pTopCapture = GetTopCapture();
04970         ENSURE(pTopCapture && pTopCapture->GetOwner()==CurrentOffscreenAttr, "RestoreOffscreen attr is not owned by top capture\n");
04971         if (pTopCapture && pTopCapture->GetOwner()==CurrentOffscreenAttr)
04972         {
04973             StopCapture(CurrentOffscreenAttr, FALSE, IsBeingReset, &lpCapturedBitmapInfo, &lpCapturedBits, &CaptureRect);
04974         }
04975 
04976         // Normal restore in process of traversing the tree
04977         // So tell the offscreen attribute to handle the captured bitmap as it sees fit...
04978         CurrentOffscreenAttr->OffscreenRenderingCompleted(this, lpCapturedBitmapInfo, lpCapturedBits, CaptureRect);
04979     }
04980 
04981 //  RenderRegion::RestoreOffscreen(pAttr);
04982 
04983     CurrentOffscreenAttr = pAttr; 
04984 }

void RenderRegion::RestorePrintOnAllPlates PrintOnAllPlatesAttrValue NewAttr,
BOOL  Temp
[virtual]
 

Restore the previous print-on-all-plates state, popping the previous state from the rendering stack.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/7/96
Parameters:
NewAttr - The new OverPrintLineAttrValue you want to set current [INPUTS] Temp - TRUE if this is a temporary object which the render region should delete when finished with it; FALSE if someone else will delete it (i.e. it's in the document tree)
See also:
RenderRegion::SetOverprintLine

Definition at line 2503 of file rndrgn.cpp.

02504 {
02505     RestoreAttribute(ATTR_PRINTONALLPLATES, NewAttr, Temp);
02506 }

void RenderRegion::RestoreQuality QualityAttribute pAttr,
BOOL  Temp
[virtual]
 

Get rid of the current quality level, and restore the specified quality level.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
pAttr - the object specifying the quality level to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetQuality

Definition at line 3633 of file rndrgn.cpp.

03634 {
03635     // Set up the new attribute
03636     RestoreAttribute(ATTR_QUALITY, pAttr, Temp);
03637     RRQuality = pAttr->QualityValue;
03638 
03639     // The render region's rendering objects need to be reset before drawing anything.
03640     SetQualityLevel();
03641 }

void RenderRegion::RestoreStartArrow StartArrowAttribute pAttr,
BOOL  Temp
[virtual]
 

Get rid of the current StartArrow, and restore the specified one.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/4/95
Parameters:
pAttr - the object specifying the dash pattern to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetStartArrow

Definition at line 3799 of file rndrgn.cpp.

03800 {
03801     // Set up the new attribute
03802     RestoreAttribute(ATTR_STARTARROW, pAttr, Temp);
03803 
03804     // The line attributes need to be reset before drawing anything.
03805     SetLineAttributes(CHANGEATTR_STARTARROW);
03806 }

void RenderRegion::RestoreStartCap StartCapAttribute pAttr,
BOOL  Temp
[virtual]
 

Get rid of the current start cap, and restore the specified one.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/4/95
Parameters:
pAttr - the object specifying the dash pattern to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetStartCap

Definition at line 3490 of file rndrgn.cpp.

03491 {
03492     // Set up the new attribute
03493     RestoreAttribute(ATTR_STARTCAP, pAttr, Temp);
03494 
03495     // The line attributes need to be reset before drawing anything.
03496     SetLineAttributes(CHANGEATTR_LINECAP);
03497 }

void RenderRegion::RestoreStrokeType StrokeTypeAttrValue pAttr,
BOOL  Temp
[virtual]
 

Get rid of the current stroke type, and restore the specified stroke type.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/1/97
Parameters:
pAttr - the object specifying the new stroke type [INPUTS] Temp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetStrokeType

Definition at line 2757 of file rndrgn.cpp.

02758 {
02759     RestoreAttribute(ATTR_STROKETYPE, pAttr, Temp);
02760 }

void RenderRegion::RestoreTranspFillGeometry TranspFillAttribute pAttr,
BOOL  Temp
[virtual]
 

Get rid of the current fill type, and restore the specified fill type.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/8/94
Parameters:
pAttr - the object specifying the fill type to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetFillType; RenderRegion::SetFillColour

Definition at line 3125 of file rndrgn.cpp.

03126 {
03127     // Set up the new attribute
03128     RestoreAttribute(ATTR_TRANSPFILLGEOMETRY, pAttr, Temp);
03129 
03130     // The fill attributes need to be reset before drawing anything.
03131     SetFillAttributes(CHANGEATTR_TRANSP_GEOMETRY);
03132 }

void RenderRegion::RestoreTranspFillMapping TranspFillMappingAttribute pAttr,
BOOL  Temp
[virtual]
 

Get rid of the current fill type, and restore the specified fill type.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/8/94
Parameters:
pAttr - the object specifying the fill type to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetFillType; RenderRegion::SetFillColour

Definition at line 3173 of file rndrgn.cpp.

03174 {
03175     // Set up the new attribute
03176     RestoreAttribute(ATTR_TRANSPFILLMAPPING, pAttr, Temp);
03177 
03178     // The fill attributes need to be reset before drawing anything.
03179     SetFillAttributes(CHANGEATTR_TRANSP_MAPPING);
03180 }

void RenderRegion::RestoreTxtAspectRatio TxtAspectRatioAttribute pAttr,
BOOL  Temp
 

Get rid of the current Text Aspect Ratio, and restore the specified Aspect Ratio value.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pAttr - the object specifying the colour to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetTxtAspectRatio

Definition at line 4431 of file rndrgn.cpp.

04432 {
04433     // Restore the Text Aspect Ratio attribute
04434     RestoreAttribute(ATTR_TXTASPECTRATIO, (AttributeValue*)pAttr, Temp);
04435     SetTextAttributes(CHANGEATTR_ASPECT);
04436 }

void RenderRegion::RestoreTxtBaseLine TxtBaseLineAttribute pAttr,
BOOL  Temp
 

Get rid of the current Text BaseLine, and restore the specified BaseLine value.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pAttr - the object specifying the colour to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetTxtBaseLine

Definition at line 4618 of file rndrgn.cpp.

04619 {
04620     // Restore the Text BaseLine attribute
04621     RestoreAttribute(ATTR_TXTBASELINE, (AttributeValue*)pAttr, Temp);
04622     SetTextAttributes(CHANGEATTR_BASELINE);
04623 }

void RenderRegion::RestoreTxtBold TxtBoldAttribute pAttr,
BOOL  Temp
 

Get rid of the current Text Boldness, and restore the specified Boldness value.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pAttr - the object specifying the colour to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetTxtBold

Definition at line 4242 of file rndrgn.cpp.

04243 {
04244     // Restore the Text Bold attribute
04245     RestoreAttribute(ATTR_TXTBOLD, (AttributeValue*)pAttr, Temp);
04246     SetTextAttributes(CHANGEATTR_BOLD);
04247 }

void RenderRegion::RestoreTxtFirstIndent TxtFirstIndentAttribute ,
BOOL 
 

Definition at line 4724 of file rndrgn.cpp.

04725 {
04726     // Restore the attribute
04727     RestoreAttribute(ATTR_TXTFIRSTINDENT, (AttributeValue*)pAttr, Temp);
04728     SetTextAttributes(CHANGEATTR_FIRSTINDENT);
04729 }

void RenderRegion::RestoreTxtFontSize TxtFontSizeAttribute pAttr,
BOOL  Temp
 

Get rid of the current font size, and restore the specified font size.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pAttr - the object specifying the font size [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetTxtFontSize

Definition at line 4337 of file rndrgn.cpp.

04338 {
04339     // Restore the Text Italic attribute
04340     RestoreAttribute(ATTR_TXTFONTSIZE, (AttributeValue*)pAttr, Temp);
04341     SetTextAttributes(CHANGEATTR_SIZE);
04342 }

void RenderRegion::RestoreTxtFontTypeface TxtFontTypefaceAttribute pAttr,
BOOL  Temp
 

Get rid of the current Text Font Typeface, and restore the specified Typeface value.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pAttr - the object specifying the colour to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetTxtFontTypeface

Definition at line 4194 of file rndrgn.cpp.

04195 {
04196 //  BOOL NewAttr = pAttr->HTypeface != RR_TXTFONTTYPEFACE();
04197     // Restore the Font Typeface attribute
04198     RestoreAttribute(ATTR_TXTFONTTYPEFACE, (AttributeValue*)pAttr, Temp);
04199 //  if(NewAttr)
04200     SetTextAttributes(CHANGEATTR_FONT);
04201 }

void RenderRegion::RestoreTxtItalic TxtItalicAttribute pAttr,
BOOL  Temp
 

Get rid of the current Text Italicness, and restore the specified Italicness value.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pAttr - the object specifying the colour to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetTxtItalic

Definition at line 4289 of file rndrgn.cpp.

04290 {
04291     // Restore the Text Italic attribute
04292     RestoreAttribute(ATTR_TXTITALIC, (AttributeValue*)pAttr, Temp);
04293     SetTextAttributes(CHANGEATTR_ITALIC);
04294 }

void RenderRegion::RestoreTxtJustification TxtJustificationAttribute pAttr,
BOOL  Temp
 

Get rid of the current Text Justification, and restore the specified Justification value.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pAttr - the object specifying the colour to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetTxtJustification

Definition at line 4477 of file rndrgn.cpp.

04478 {
04479     // Restore the Text Justification attribute
04480     RestoreAttribute(ATTR_TXTJUSTIFICATION, (AttributeValue*)pAttr, Temp);
04481     SetTextAttributes(CHANGEATTR_JUSTIFY);
04482 }

void RenderRegion::RestoreTxtLeftMargin TxtLeftMarginAttribute ,
BOOL 
 

Definition at line 4692 of file rndrgn.cpp.

04693 {
04694     // Restore the attribute
04695     RestoreAttribute(ATTR_TXTLEFTMARGIN, (AttributeValue*)pAttr, Temp);
04696     SetTextAttributes(CHANGEATTR_LEFTMARGIN);
04697 }

void RenderRegion::RestoreTxtLineSpace TxtLineSpaceAttribute pAttr,
BOOL  Temp
 

Get rid of the current Text LineSpace, and restore the specified LineSpace value.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pAttr - the object specifying the colour to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetTxtLineSpace

Definition at line 4665 of file rndrgn.cpp.

04666 {
04667     // Restore the Text LineSpace attribute
04668     RestoreAttribute(ATTR_TXTLINESPACE, (AttributeValue*)pAttr, Temp);
04669     SetTextAttributes(CHANGEATTR_LINESPACE);
04670 }

void RenderRegion::RestoreTxtRightMargin TxtRightMarginAttribute ,
BOOL 
 

Definition at line 4708 of file rndrgn.cpp.

04709 {
04710     // Restore the attribute
04711     RestoreAttribute(ATTR_TXTRIGHTMARGIN, (AttributeValue*)pAttr, Temp);
04712     SetTextAttributes(CHANGEATTR_RIGHTMARGIN);
04713 }

void RenderRegion::RestoreTxtRuler TxtRulerAttribute ,
BOOL 
 

Definition at line 4740 of file rndrgn.cpp.

04741 {
04742     // Restore the attribute
04743     RestoreAttribute(ATTR_TXTRULER, (AttributeValue*)pAttr, Temp);
04744     SetTextAttributes(CHANGEATTR_RULER);
04745 }

void RenderRegion::RestoreTxtScript TxtScriptAttribute pAttr,
BOOL  Temp
 

Get rid of the current Text Script, and restore the specified Script value.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pAttr - the object specifying the colour to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetTxtScript

Definition at line 4571 of file rndrgn.cpp.

04572 {
04573     // Restore the Text Script attribute
04574     RestoreAttribute(ATTR_TXTSCRIPT, (AttributeValue*)pAttr, Temp);
04575     SetTextAttributes(CHANGEATTR_SCRIPT);
04576 }

void RenderRegion::RestoreTxtTracking TxtTrackingAttribute pAttr,
BOOL  Temp
 

Get rid of the current Text Tracking, and restore the specified Tracking value.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pAttr - the object specifying the colour to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetTxtTracking

Definition at line 4523 of file rndrgn.cpp.

04524 {
04525     // Restore the Text Tracking attribute
04526     RestoreAttribute(ATTR_TXTTRACKING, (AttributeValue*)pAttr, Temp);
04527     SetTextAttributes(CHANGEATTR_TRACKING);
04528 }

void RenderRegion::RestoreTxtUnderline TxtUnderlineAttribute pAttr,
BOOL  Temp
 

Get rid of the current Text underline state, and restore the specified underline value.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pAttr - the object specifying the colour to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetTxtUnderline

Definition at line 4385 of file rndrgn.cpp.

04386 {
04387     // Restore the Text Italic attribute
04388     RestoreAttribute(ATTR_TXTUNDERLINE, (AttributeValue*)pAttr, Temp);
04389     SetTextAttributes(CHANGEATTR_UNDERLINE);
04390 }

void RenderRegion::RestoreVariableWidth VariableWidthAttrValue pAttr,
BOOL  Temp
[virtual]
 

Get rid of the current VariableWidth, and restore the specified VariableWidth.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/1/97
Parameters:
pAttr - the object specifying the new stroke type [INPUTS] Temp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetVariableWidth

Definition at line 2806 of file rndrgn.cpp.

02807 {
02808     RestoreAttribute(ATTR_VARWIDTH, pAttr, Temp);
02809 }

void RenderRegion::RestoreWebAddress WebAddressAttribute pAttr,
BOOL  Temp
[virtual]
 

Restore the Web Address.

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/3/97
Parameters:
pAttr - pointer to a Web Address to set [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetWebAddress

Definition at line 3701 of file rndrgn.cpp.

03702 {
03703     // Set up the new attribute
03704     RestoreAttribute(ATTR_WEBADDRESS, (AttributeValue*) pAttr, Temp);
03705 }

void RenderRegion::RestoreWindingRule WindingRuleAttribute pAttr,
BOOL  Temp
[virtual]
 

Get rid of the current winding rule, and restore the specified winding rule.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
pAttr - the object specifying the winding rule to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::SetWindingRule

Definition at line 4051 of file rndrgn.cpp.

04052 {
04053     // Set up the new attribute
04054     RestoreAttribute(ATTR_WINDINGRULE, pAttr, Temp);
04055 
04056     // The fill attributes need to be reset before drawing anything.
04057     SetFillAttributes(CHANGEATTR_WINDING_RULE);
04058 }

BOOL RenderRegion::SaveAttribute UINT32  Index,
AttributeValue pAttr,
BOOL  Temp
[virtual]
 

Saves the current attribute on the attribute context stack, and installs the given attribute as the new attribute. If the attribute object is temporary, then it is deleted when the attribute is popped off the stack. See RenderRegion::RestoreAttribute.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
Index - Unique attribute ID (See AttributeManager::RegisterDefaultAttribute). [INPUTS] pAttr - the new attribute to use as the current one. Temp - TRUE if pAttr points to a temporary object, FALSE if not.
Returns:
TRUE if the operation completed successfully, FALSE if not.

Errors: Out of memory.

See also:
AttributeManager::RegisterDefaultAttribute

Reimplemented in EPSRenderRegion.

Definition at line 1710 of file rndrgn.cpp.

01711 {
01712 #ifdef _DEBUG
01713     if(m_TraceOutContextLevels)
01714     {
01715         TRACE( _T("...Saving Level %d Attribute %s 0x%x\n"),m_CurrentContextLevel,(LPCTSTR)pAttr->GetRuntimeClass()->GetClassName(), pAttr);
01716     }
01717 
01718     // Make sure the current Attr is a valid pointer.
01719     CC_ASSERT_VALID((CurrentAttrs[Index].pAttr));
01720     CC_ASSERT_VALID((pAttr));
01721 
01722 #endif
01723 
01724     // Push the current attribute onto the stack, and install the new attribute as
01725     // the 'current' one.
01726     if (TheStack.Push(CurrentAttrs[Index].pAttr, CurrentAttrs[Index].Temp))
01727     {
01728         CurrentAttrs[Index].pAttr = pAttr; 
01729         CurrentAttrs[Index].Temp = Temp;
01730 
01731         // Everything worked ok.
01732         return TRUE;
01733     }
01734 
01735     // Failed
01736     return FALSE;
01737 }

void RenderRegion::SaveContext  ) 
 

Definition at line 1094 of file rndrgn.cpp.

01095 {
01096     TheStack.SaveContext();
01097 
01098 #ifdef _DEBUG
01099     m_CurrentContextLevel++;
01100 #endif
01101 }

void RenderRegion::SetBackgroundColour DocColour Colour  ) 
 

Sets the value of mBackground colour, which is used whenever the program needs to know what the background colour of a file is.

Author:
Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
Date:
19/1/00 Input: Colour - The background colour of the current document.
Returns:
-
See also:
-

Definition at line 6794 of file rndrgn.cpp.

06795 {
06796     mBackgroundColour = Colour;
06797 }

void RenderRegion::SetBackmostChangedNode Node pInvalidNode  )  [virtual]
 

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
09/08/2004
Parameters:
- [INPUTS]
- [OUTPUTS]

Definition at line 7342 of file rndrgn.cpp.

07343 {
07344     if (pInvalidNode)
07345     {
07346         if (pInvalidNode->FindParent()==NULL)
07347         {
07348 //          ERROR2RAW("SetBackmostChangedNode called on node with no parent");
07349             return;
07350         }
07351 
07352         if (m_pBackmostChangedNode==NULL || pInvalidNode->IsUnder(m_pBackmostChangedNode))
07353             m_pBackmostChangedNode = pInvalidNode;
07354     }
07355 }

void RenderRegion::SetClean BOOL  bResetChangedBounds,
BOOL  FillWhite
[virtual]
 

Virtual function used to inform render region that defers update that it should set its render state to be 'clean', i.e. if no more rendering occurs then it need not update the device. This is used for render regions such as GRenderRegions, where we render the paper using the host OS graphics primitives, but we have to render the paper into the GRenderRegion too, otherwise we will get garbage. Equally though, we don't want the GRenderRegion to do a potentially slow blit if all it is going to draw is some paper. It also allows the 'changed box' to be reset, so if we only have a small object on the page, then only the area containing the object is updated using a blit. The default implementation of this function does nothing - most render regions won't need to over-ride this null behaviour.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/06/94
Parameters:
FillWhite is an optional parameter which lets the region fill itself with [INPUTS] white. This is used during hit-testing.
See also:
GRenderRegion::SetClean

Reimplemented in GRenderClick, and GRenderRegion.

Definition at line 1280 of file rndrgn.cpp.

01281 {
01282 }

void RenderRegion::SetClipRect DocRect NewClipRect,
BOOL  ReCalcContextNode = FALSE
 

Sets the Clipping rectangle of the Render Region. Calls InitClipping() to acually set the clip region in an OS specific way.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/6/93
Parameters:
A DocRect describing the tightest bounding box around the clipping region. [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
RenderRegion::GetClipRect(); RenderRegion::RenderRegion()

Definition at line 1357 of file rndrgn.cpp.

01358 {
01359     ENSURE(NewClipRect.IsValid(),"RenderRegion::SetClipRect called with Invalid Rectangle");
01360     CurrentClipRect = NewClipRect;
01361 
01362 ENSURE(GetMasterCapture()==NULL || MasterCaptureIsCurrent(), "SetClipRect being called while child Captures are running\n");
01363 if (GetMasterCapture()!=NULL)
01364 {
01365     if (MasterCaptureIsCurrent())
01366     {
01367         GetMasterCapture()->SetClipRect(NewClipRect);
01368     }
01369 }
01370 
01371     if (RenderFlags.Rendering)
01372     {
01373         // Do some OS specific initialisation of the clipping region
01374         InitClipping(); // This is implemented in the Derived classes (OSRenderRegion etc)
01375     }
01376 
01377     // if we need to recalculate the regions context node then go ahead
01378     if (ReCalcContextNode==TRUE)
01379     {
01380 //      CurrentRenderState = RenderSpread->FindFirstForClippedInkRender(&CurrentClipRect, this);
01381         CurrentRenderState = RenderSpread;  // For use with RenderTree
01382 
01383         // Don't need Node sub context anymore
01384         delete CurrentSubRenderState;
01385         CurrentSubRenderState = NULL;
01386         SubRenderStateLocked = FALSE;
01387     }
01388 }

void RenderRegion::SetClipRegion ClipRegionAttribute pAttr,
BOOL  Temp
[virtual]
 

Set this render-region's current clipping region. See also: ClipRegionAttribute::Render(), RenderRegion::RestoreClipRegion().

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
11 April 2000
Parameters:
pAttr the new ClipRegionAttribute. [INPUTS] Temp whether the new attribute is temporary, and should therefore be deleted when it is finished with.

Reimplemented in AIEPSRenderRegion, EPSRenderRegion, and GRenderRegion.

Definition at line 5000 of file rndrgn.cpp.

05001 {
05002     SaveAttribute(ATTR_CLIPREGION, (AttributeValue *) pAttr, Temp);
05003 }

void RenderRegion::SetDashPattern StockDash  NewDashPattern  ) 
 

Set the dash pattern, pushing the current dash pattern onto the context stack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/10/94
Parameters:
NewDashPattern - the on-off pattern of the dash. [INPUTS]
See also:
RenderRegion::RestoreDashPattern

Definition at line 3304 of file rndrgn.cpp.

03305 {
03306     DashPatternAttribute *TempAttr = new DashPatternAttribute();
03307     TempAttr->SetStockDashPattern(NewDashPattern);
03308 
03309     // Don't bother if it doesn't cause a change
03310     DashPatternAttribute *pAttr = (DashPatternAttribute *) CurrentAttrs[ATTR_DASHPATTERN].pAttr;
03311     if ((pAttr != NULL) && (TempAttr->DashPattern == pAttr->DashPattern))
03312     {
03313         delete TempAttr;
03314         return;
03315     }
03316 
03317     // Create a temporary attribute and use it to set the line colour.
03318     SetDashPattern(TempAttr, TRUE);
03319 }

void RenderRegion::SetDashPattern DashRec NewDashPattern  ) 
 

Set the dash pattern, pushing the current dash pattern onto the context stack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/10/94
Parameters:
NewDashPattern - the on-off pattern of the dash. [INPUTS]
See also:
RenderRegion::RestoreDashPattern

Definition at line 3278 of file rndrgn.cpp.

03279 {
03280     // Don't bother if it doesn't cause a change
03281     DashPatternAttribute *pAttr = (DashPatternAttribute *) CurrentAttrs[ATTR_DASHPATTERN].pAttr;
03282     if ((pAttr != NULL) && (NewDashPattern == pAttr->DashPattern))
03283         return;
03284 
03285     // Create a temporary attribute and use it to set the line colour.
03286     pAttr = new DashPatternAttribute();
03287     pAttr->SetDashPattern(NewDashPattern);
03288     SetDashPattern(pAttr, TRUE);
03289 }

void RenderRegion::SetDashPattern DashPatternAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current dash pattern according to an AttributeValue object, pushing the current dash pattern onto the context stack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/10/94
Parameters:
pAttr - the object specifying the line width to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::RestoreDashPattern

Definition at line 3392 of file rndrgn.cpp.

03393 {
03394     // Set up the new attribute
03395     if (SaveAttribute(ATTR_DASHPATTERN, pAttr, Temp))
03396     {
03397         // The line attributes need to be reset before drawing anything.
03398         SetLineAttributes(CHANGEATTR_DASHPATTERN);
03399     }
03400 }

void RenderRegion::SetDefaultQuality  ) 
 

Set the quality attribute to the default setting, pushing the current quality level onto the context stack.

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

Definition at line 3586 of file rndrgn.cpp.

03587 {
03588     // Create a temporary attribute and use it to set the default quality..
03589     QualityAttribute *pAttr = new QualityAttribute();
03590     SetQuality(pAttr, TRUE);
03591 }

void RenderRegion::SetDeviceDashPattern StockDash  NewDashPattern  ) 
 

Set the dash pattern, pushing the current dash pattern onto the context stack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/10/94
Parameters:
NewDashPattern - the on-off pattern of the dash. [INPUTS]
See also:
RenderRegion::RestoreDashPattern

Definition at line 3360 of file rndrgn.cpp.

03361 {
03362     DashPatternAttribute *TempAttr = new DashPatternAttribute();
03363     TempAttr->SetDeviceStockDashPattern(NewDashPattern, GetScaledPixelWidth());
03364 
03365     // Don't bother if it doesn't cause a change
03366     DashPatternAttribute *pAttr = (DashPatternAttribute *) CurrentAttrs[ATTR_DASHPATTERN].pAttr;
03367     if ((pAttr != NULL) && (TempAttr->DashPattern == pAttr->DashPattern))
03368     {
03369         delete TempAttr;
03370         return;
03371     }
03372 
03373     // Create a temporary attribute and use it to set the line colour.
03374     SetDashPattern(TempAttr, TRUE);
03375 }

void RenderRegion::SetDeviceDashPattern DashRec NewDashPattern  ) 
 

Set the dash pattern, pushing the current dash pattern onto the context stack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/10/94
Parameters:
NewDashPattern - the on-off pattern of the dash. [INPUTS]
See also:
RenderRegion::RestoreDashPattern

Definition at line 3334 of file rndrgn.cpp.

03335 {
03336     // Don't bother if it doesn't cause a change
03337     DashPatternAttribute *pAttr = (DashPatternAttribute *) CurrentAttrs[ATTR_DASHPATTERN].pAttr;
03338     if ((pAttr != NULL) && (NewDashPattern == pAttr->DashPattern))
03339         return;
03340 
03341     // Create a temporary attribute and use it to set the line colour.
03342     pAttr = new DashPatternAttribute();
03343     pAttr->SetDeviceDashPattern(NewDashPattern, GetScaledPixelWidth());
03344     SetDashPattern(pAttr, TRUE);
03345 }

void RenderRegion::SetDrawingMode DrawModeType  NewDrawingMode  ) 
 

Set the drawing mode, pushing the current drawing mode onto the context stack.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
NewDrawingMode - the drawing mode to use. [INPUTS]
See also:
RenderRegion::RestoreDrawingMode

Definition at line 4074 of file rndrgn.cpp.

04075 {
04076     // Don't bother if it doesn't cause a change
04077     DrawingModeAttribute *pAttr = 
04078         (DrawingModeAttribute *) CurrentAttrs[DrawingModeAttribute::ID].pAttr;
04079     if ((pAttr != NULL) && (NewDrawingMode == pAttr->DrawingMode))
04080         return;
04081 
04082     // Create a temporary attribute and use it to set the drawing mode
04083     pAttr = new DrawingModeAttribute(NewDrawingMode);
04084     SetDrawingMode(pAttr, TRUE);
04085 }

void RenderRegion::SetDrawingMode DrawingModeAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current drawing mode according to an AttributeValue object, pushing the current drawing mode onto the context stack.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
pAttr - the object specifying the drawing mode to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::RestoreDrawingMode

Definition at line 4102 of file rndrgn.cpp.

04103 {
04104     // Save the current attribute
04105     SaveAttribute(DrawingModeAttribute::ID, pAttr, Temp);
04106     DrawingMode = pAttr->DrawingMode;
04107 
04108     // The drawing mode needs to be set
04109     // MarkH - 12/11/99
04110     // First check to see if we`re dealing with a derived class or using the base class as
04111     // the base class ( RenderRegion ) 'SetOSDrawingMode()' is a pure virtual which will
04112     // ultimately crash in a big way if it is called!!!!
04113     if(!IS_A(this,RenderRegion))
04114     {
04115         SetOSDrawingMode();
04116     }
04117 }

void RenderRegion::SetEndArrow ArrowRec NewEndArrow  ) 
 

Set the current EndArrow according to an AttributeValue object, pushing the current Arrow the context stack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/4/95
Parameters:
NewEndArrow,the new Arrow to draw on the end of lines. [INPUTS]
See also:
RenderRegion::RestoreEndArrow

Definition at line 3848 of file rndrgn.cpp.

03849 {
03850     // Don't bother if it doesn't cause a change
03851     EndArrowAttribute *pAttr = (EndArrowAttribute *) CurrentAttrs[ATTR_ENDARROW].pAttr;
03852     if ((pAttr != NULL) && (pAttr->EndArrow == NewEndArrow))
03853         return;
03854 
03855     // Create a temporary attribute and use it to set the Start Arrow.
03856     pAttr = new EndArrowAttribute();
03857     pAttr->EndArrow = NewEndArrow;
03858     SetEndArrow(pAttr, TRUE);
03859 }

void RenderRegion::SetEndArrow StockArrow  NewEndArrow  ) 
 

Set the current EndArrow according to an AttributeValue object, pushing the current Arrow the context stack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/4/95
Parameters:
NewEndArrow,the new Arrow to draw on the end of lines. [INPUTS]
See also:
RenderRegion::RestoreEndArrow

Definition at line 3822 of file rndrgn.cpp.

03823 {
03824     // Don't bother if it doesn't cause a change
03825     EndArrowAttribute *pAttr = (EndArrowAttribute *) CurrentAttrs[ATTR_ENDARROW].pAttr;
03826     if ((pAttr != NULL) && (pAttr->EndArrow == NewEndArrow))
03827         return;
03828 
03829     // Create a temporary attribute and use it to set the Start Arrow.
03830     pAttr = new EndArrowAttribute();
03831     pAttr->EndArrow = NewEndArrow;
03832     SetEndArrow(pAttr, TRUE);
03833 }

void RenderRegion::SetEndArrow EndArrowAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current EndArrow according to an AttributeValue object, pushing the current EndArrow the context stack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/4/95
Parameters:
pAttr - the object specifying the dash pattern to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::RestoreEndArrow

Definition at line 3876 of file rndrgn.cpp.

03877 {
03878     // Set up the new attribute
03879     if (SaveAttribute(ATTR_ENDARROW, pAttr, Temp))
03880     {
03881         // The line attributes need to be reset before drawing anything.
03882         SetLineAttributes(CHANGEATTR_ENDARROW);
03883     }
03884 }

void RenderRegion::SetFillAttributes ChangeAttrType  Type = CHANGEATTR_ALL  )  [protected, virtual]
 

Inform the render region that an aspect of the path filling attributes has changed. The base class version just updates the RenderRegion member variable FillFlags to reflect which aspects of the fill attributes have become invalid. Derived render regions can either call the base class or just implement whatever methods they need for keeping track of these changes - or a combination of the two, of course. Some render regions (e.g. GRenderRegions) don't need to do anything about this at all as all attributes are invoked whenever anything is rendered. If this is the case, then this should be over-ridden to have a NULL implementation because this will improve rendering speed.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/10/94
Parameters:
Type - the type of the fill attribute that has changed, can be: [INPUTS]
CHANGEATTR_ALL CHANGEATTR_GEOMETRY CHANGEATTR_EFFECT CHANGEATTR_MAPPING

CHANGEATTR_TRANSP_GEOMETRY CHANGEATTR_TRANSP_EFFECT CHANGEATTR_TRANSP_MAPPING CHANGEATTR_WINDING_RULE

See also:
ChangeAttrType

Reimplemented in OSRenderRegion.

Definition at line 1643 of file rndrgn.cpp.

01644 {
01645     switch (Type)
01646     {
01647         case CHANGEATTR_ALL:
01648             FillFlags.ValidGeometry         = FALSE;
01649             FillFlags.ValidEffect           = FALSE;
01650             FillFlags.ValidMapping          = FALSE;
01651             FillFlags.ValidTransGeometry    = FALSE;
01652             FillFlags.ValidTransEffect      = FALSE;
01653             FillFlags.ValidTransMapping     = FALSE;
01654             FillFlags.ValidWindingRule      = FALSE;
01655             break;
01656 
01657         case CHANGEATTR_GEOMETRY:
01658             FillFlags.ValidGeometry         = FALSE;
01659             break;
01660 
01661         case CHANGEATTR_EFFECT:
01662             FillFlags.ValidEffect           = FALSE;
01663             break;
01664 
01665         case CHANGEATTR_MAPPING:
01666             FillFlags.ValidMapping          = FALSE;
01667             break;
01668 
01669         case CHANGEATTR_TRANSP_GEOMETRY:
01670             FillFlags.ValidTransGeometry    = FALSE;
01671             break;
01672 
01673         case CHANGEATTR_TRANSP_EFFECT:
01674             FillFlags.ValidTransEffect      = FALSE;
01675             break;
01676 
01677         case CHANGEATTR_TRANSP_MAPPING:
01678             FillFlags.ValidTransMapping     = FALSE;
01679             break;
01680 
01681         case CHANGEATTR_WINDING_RULE:
01682             FillFlags.ValidWindingRule      = FALSE;
01683             break;
01684 
01685         default:
01686             ERROR3_PF(("Invalid attribute type (%d) in SetFillAttributes", Type));
01687             break;
01688     }
01689 }

void RenderRegion::SetFillColour StockColour  New  ) 
 

Set the fill colour to a specific colour, pushing the current fill colour onto the context stack.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
NewFillColour - the colour to set the fill colour to. [INPUTS]
See also:
RenderRegion::RestoreFillColour

Definition at line 2856 of file rndrgn.cpp.

02857 {
02858     DocColour NewFillColour(New);
02859 
02860     // Don't bother if it doesn't cause a change
02861     ColourFillAttribute *pAttr = 
02862         (ColourFillAttribute *) CurrentAttrs[ATTR_FILLGEOMETRY].pAttr;
02863 
02864     if ((pAttr != NULL) && 
02865         (pAttr->GetRuntimeClass() == CC_RUNTIME_CLASS(FlatFillAttribute)) &&
02866         (NewFillColour == ((FlatFillAttribute *) pAttr)->Colour))
02867         return;
02868 
02869     // Create a temporary attribute and use it to set the line colour.
02870     pAttr = new FlatFillAttribute(NewFillColour);
02871     SetFillGeometry(pAttr, TRUE);
02872 }

void RenderRegion::SetFillColour DocColour NewFillColour  ) 
 

Set the fill colour to a specific colour, pushing the current fill colour onto the context stack.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
NewFillColour - the colour to set the fill colour to. [INPUTS]
See also:
RenderRegion::RestoreFillColour

Definition at line 2826 of file rndrgn.cpp.

02827 {
02828     // Don't bother if it doesn't cause a change
02829     ColourFillAttribute *pAttr = 
02830         (ColourFillAttribute *) CurrentAttrs[ATTR_FILLGEOMETRY].pAttr;
02831 
02832     if ((pAttr != NULL) && 
02833         (pAttr->GetRuntimeClass() == CC_RUNTIME_CLASS(FlatFillAttribute)) &&
02834         (NewFillColour == ((FlatFillAttribute *) pAttr)->Colour))
02835         return;
02836 
02837     // Create a temporary attribute and use it to set the line colour.
02838     pAttr = new FlatFillAttribute(NewFillColour);
02839     SetFillGeometry(pAttr, TRUE);
02840 }

void RenderRegion::SetFillEffect FillEffectAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current fill type according to an AttributeValue object, pushing the current fill type onto the context stack.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
pAttr - the object specifying the fill type to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::RestoreFillType; RenderRegion::SetFillColour

Definition at line 3007 of file rndrgn.cpp.

03008 {
03009     // Save the current attribute
03010     if (SaveAttribute(ATTR_FILLEFFECT, pAttr, Temp))
03011     {
03012         // The fill attributes need to be reset before drawing anything.
03013         SetFillAttributes(CHANGEATTR_EFFECT);
03014     }
03015 }

void RenderRegion::SetFillGeometry ColourFillAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current fill type according to an AttributeValue object, pushing the current fill type onto the context stack.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
pAttr - the object specifying the fill type to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::RestoreFillType; RenderRegion::SetFillColour

Definition at line 2893 of file rndrgn.cpp.

02894 {
02895     // Before stacking the attribute, check for overprint and print on all plates - these
02896     // may cause the fill colours to change, in which case we replace the given attribute
02897     // with a new modified one.
02898     ColourFillAttribute *NewAttr = PrepareFillGeometry(pAttr);
02899 
02900     if (NewAttr != NULL)
02901     {
02902         if (Temp)
02903             delete pAttr;
02904 
02905         pAttr = NewAttr;        // Use the modified attribute
02906         Temp = TRUE;            // ...which is always temporary
02907     }
02908 
02909     // Save the current attribute
02910     if (SaveAttribute(ATTR_FILLGEOMETRY, pAttr, Temp))
02911     {
02912         // The fill attributes need to be reset before drawing anything.
02913         SetFillAttributes(CHANGEATTR_GEOMETRY);
02914     }
02915 }

void RenderRegion::SetFillMapping FillMappingAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current fill type according to an AttributeValue object, pushing the current fill type onto the context stack.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
pAttr - the object specifying the fill type to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::RestoreFillType; RenderRegion::SetFillColour

Definition at line 2955 of file rndrgn.cpp.

02956 {
02957     // Save the current attribute
02958     if (SaveAttribute(ATTR_FILLMAPPING, pAttr, Temp))
02959     {
02960         // The fill attributes need to be reset before drawing anything.
02961         SetFillAttributes(CHANGEATTR_MAPPING);
02962     }
02963 }

void RenderRegion::SetFillOverprint OverprintFillAttrValue NewAttr,
BOOL  Temp
[virtual]
 

Set the fill overprint state, pushing the current "overprint fill" attribute onto the context stack.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/7/96
Parameters:
NewAttr - The new OverPrintFillAttrValue you want to set current [INPUTS] Temp - TRUE if this is a temporary object which the render region should delete when finished with it; FALSE if someone else will delete it (i.e. it's in the document tree)
See also:
RenderRegion::RestoreOverprintFill

Definition at line 2408 of file rndrgn.cpp.

02409 {
02410     // Set the new Overprint state
02411     SaveAttribute(ATTR_OVERPRINTFILL, NewAttr, Temp);
02412 
02413     // And make sure the current fill colour attribute is affected by the new overprint state
02414     ColourFillAttribute *NewFillGeometry = PrepareFillGeometry();
02415     if (NewFillGeometry != NULL)
02416         SetFillGeometry(NewFillGeometry, TRUE);
02417 }

void RenderRegion::SetFilter Filter pFilter  )  [inline]
 

Definition at line 682 of file rndrgn.h.

00682 {m_pFilter = pFilter;}

BOOL RenderRegion::SetFirstBand  )  [virtual]
 

This function gives the render region a chance to see if it want to do some banding or not. If it decides it does, then this function will set it all up ready to start. It should be called before StartRender.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
2/5/95
Returns:
TRUE if all went OK, FALSE if there was a problem

Reimplemented in GRenderBitmap, GRenderClick, GRenderDIB, and GRenderPrint.

Definition at line 6349 of file rndrgn.cpp.

06350 {
06351     // No Banding please
06352     IsRegionBanded = FALSE;
06353     IsWaitingForRAM = FALSE;
06354     IsLastBand = TRUE;
06355     CanRegionBeMerged = TRUE;
06356     return TRUE;
06357 }

void RenderRegion::SetFixedSystemTextColours DocColour TextCol,
DocColour Background
[virtual]
 

To set the text and background colour(s) for any FixedSystem text rendered in this render region in the future (within the current rendering pass).

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/1/95
Parameters:
TextCol - The foreground (text) colour (may be NULL) [INPUTS] Background - The background colour (may be NULL)
Notes: THIS BASE CLASS METHOD IS UNSUPPORTED! DO NOT CALL IT! See OSRenderRegion for the supported versions of this method

If either of the colours is passed in as a NULL pointer, that colour will not be set, and will remain at the previous setting.

Note that these values are passed directly to the host OS at the point of calling, so you must call this method every time the colour is changed (i.e. don't rely on just changing the DocColours that you passed in originally, as they aren't remembered in any way). Note also that if you call DrawFixedSystemText without a prior call to this method, the colours used are undefined.

See also:
OSRenderRegion::DrawFixedSystemText

Reimplemented in FormatRegion, GRenderRegion, and OSRenderRegion.

Definition at line 5089 of file rndrgn.cpp.

05090 {
05091     ERROR2RAW("Attempt to call unsupported RenderRegion::SetFixedSystemTextColours method");
05092 }

void RenderRegion::SetForceMixTransparency BOOL  bForceMix  )  [inline]
 

Definition at line 731 of file rndrgn.h.

00731 { m_bForceMix = bForceMix; }

void RenderRegion::SetImmediateRender BOOL  SetVal  )  [inline]
 

Definition at line 728 of file rndrgn.h.

00728 {RenderFlags.bImmediateRender = SetVal;}

void RenderRegion::SetJoinType JointType  NewJoinType  ) 
 

Set the current JoinType according to an AttributeValue object, pushing the current JoinType the context stack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/4/95
Parameters:
NewJoinType,the new Join Type to join lines with. [INPUTS]
See also:
RenderRegion::RestoreJoinType

Definition at line 3512 of file rndrgn.cpp.

03513 {
03514     // Don't bother if it doesn't cause a change
03515     JoinTypeAttribute *pAttr = (JoinTypeAttribute *) CurrentAttrs[ATTR_JOINTYPE].pAttr;
03516     if ((pAttr != NULL) && (NewJoinType == pAttr->JoinType))
03517         return;
03518 
03519     // Create a temporary attribute and use it to set the Join Type.
03520     pAttr = new JoinTypeAttribute();
03521     pAttr->JoinType = NewJoinType;
03522     SetJoinType(pAttr, TRUE);
03523 }

void RenderRegion::SetJoinType JoinTypeAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current JoinType according to an AttributeValue object, pushing the current JoinType the context stack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/4/95
Parameters:
pAttr - the object specifying the dash pattern to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::RestoreJoinType

Definition at line 3540 of file rndrgn.cpp.

03541 {
03542     // Set up the new attribute
03543     if (SaveAttribute(ATTR_JOINTYPE, pAttr, Temp))
03544     {
03545         // The line attributes need to be reset before drawing anything.
03546         SetLineAttributes(CHANGEATTR_JOINTYPE);
03547     }
03548 }

void RenderRegion::SetLineAttributes ChangeLineAttrType  Type = CHANGELINEATTR_ALL  )  [protected, virtual]
 

Inform the render region that an aspect of the path stroking attributes has changed. The base class version just updates the RenderRegion member variable StrokeFlags to reflect which aspects of the stroke attributes have become invalid. Derived render regions can either call the base class or just implement whatever methods they need for keeping track of these changes - or a combination of the two, of course. Some render regions (e.g. GRenderRegions) don't need to do anything about this at all as all attributes are invoked whenever anything is rendered. If this is the case, then this should be over-ridden to have a NULL implementation because this will improve rendering speed.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/4/95
Parameters:
Type - the type of the fill attribute that has changed, can be: [INPUTS]
CHANGEATTR_ALL CHANGEATTR_STROKECOL CHANGEATTR_STROKETRANSP CHANGEATTR_LINEWIDTH CHANGEATTR_JOINTYPE CHANGEATTR_DASHPATTERN CHANGEATTR_LINECAP CHANGEATTR_STARTARROW CHANGEATTR_ENDARROW CHANGEATTR_MITRELIMIT

See also:
ChangeLineAttrType

Reimplemented in OSRenderRegion.

Definition at line 1553 of file rndrgn.cpp.

01554 {
01555     switch (Type)
01556     {
01557         case CHANGELINEATTR_ALL:
01558             StrokeFlags.ValidStrokeColour   = FALSE;
01559             StrokeFlags.ValidStrokeTransp   = FALSE;
01560             StrokeFlags.ValidLineWidth      = FALSE;
01561             StrokeFlags.ValidJoinType       = FALSE;
01562             StrokeFlags.ValidDashPattern    = FALSE;
01563             StrokeFlags.ValidLineCap        = FALSE;
01564             StrokeFlags.ValidStartArrow     = FALSE;
01565             StrokeFlags.ValidEndArrow       = FALSE;
01566             StrokeFlags.ValidMitreLimit     = FALSE;
01567             break;
01568 
01569         case CHANGEATTR_STROKECOL:
01570             StrokeFlags.ValidStrokeColour   = FALSE;
01571             break;
01572 
01573         case CHANGEATTR_STROKETRANSP:
01574             StrokeFlags.ValidStrokeTransp   = FALSE;
01575             break;
01576 
01577         case CHANGEATTR_LINEWIDTH:
01578             StrokeFlags.ValidLineWidth      = FALSE;
01579             break;
01580 
01581         case CHANGEATTR_JOINTYPE:
01582             StrokeFlags.ValidJoinType       = FALSE;
01583             break;
01584 
01585         case CHANGEATTR_DASHPATTERN:
01586             StrokeFlags.ValidDashPattern    = FALSE;
01587             break;
01588 
01589         case CHANGEATTR_LINECAP:
01590             StrokeFlags.ValidLineCap        = FALSE;
01591             break;
01592 
01593         case CHANGEATTR_STARTARROW:
01594             StrokeFlags.ValidStartArrow     = FALSE;
01595             break;
01596 
01597         case CHANGEATTR_ENDARROW:
01598             StrokeFlags.ValidEndArrow       = FALSE;
01599             break;
01600 
01601         case CHANGEATTR_MITRELIMIT:
01602             StrokeFlags.ValidMitreLimit     = FALSE;
01603             break;
01604 
01605         default:
01606             ERROR3_PF(("Invalid attribute type (%d) in SetLineAttributes", Type));
01607             break;
01608     }
01609 }

void RenderRegion::SetLineColour StockColour  New  ) 
 

Set the line colour to a specific colour, pushing the current line colour onto the context stack.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
NewLineColour - the colour to set the line colour to. [INPUTS]
See also:
RenderRegion::RestoreLineColour

Definition at line 2550 of file rndrgn.cpp.

02551 {
02552     DocColour NewLineColour(New);
02553 
02554     // Don't bother if it doesn't cause a change
02555     StrokeColourAttribute *pAttr = (StrokeColourAttribute *) CurrentAttrs[ATTR_STROKECOLOUR].pAttr;
02556     if ((pAttr != NULL) && (NewLineColour == pAttr->Colour))
02557         return;
02558 
02559     // Create a temporary attribute and use it to set the line colour.
02560     pAttr = new StrokeColourAttribute(NewLineColour);
02561     SetLineColour(pAttr, TRUE);
02562 }

void RenderRegion::SetLineColour DocColour NewLineColour  ) 
 

Set the line colour to a specific colour, pushing the current line colour onto the context stack.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
NewLineColour - the colour to set the line colour to. [INPUTS]
See also:
RenderRegion::RestoreLineColour

Definition at line 2523 of file rndrgn.cpp.

02524 {
02525     // Don't bother if it doesn't cause a change
02526     StrokeColourAttribute *pAttr = (StrokeColourAttribute *) CurrentAttrs[ATTR_STROKECOLOUR].pAttr;
02527     if ((pAttr != NULL) && (NewLineColour == pAttr->Colour))
02528         return;
02529 
02530     // Create a temporary attribute and use it to set the line colour.
02531     pAttr = new StrokeColourAttribute(NewLineColour);
02532     SetLineColour(pAttr, TRUE);
02533 }

void RenderRegion::SetLineColour StrokeColourAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current line colour according to an AttributeValue object, pushing the current line colour onto the context stack.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
pAttr - the object specifying the colour to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::RestoreLineColour

Definition at line 2581 of file rndrgn.cpp.

02582 {
02583     // Before stacking the attribute, check for overprint and print on all plates - these
02584     // may cause the line colour to change, in which case we replace the given attribute
02585     // with a new modified one.
02586     StrokeColourAttribute *NewAttr = PrepareLineColour(pAttr);
02587 
02588     if (NewAttr != NULL)
02589     {
02590         if (Temp)
02591             delete pAttr;
02592 
02593         pAttr = NewAttr;        // Use the modified attribute
02594         Temp = TRUE;            // ...which is always temporary
02595     }
02596 
02597     // Save the current attribute and set up the new one
02598     if (SaveAttribute(ATTR_STROKECOLOUR, pAttr, Temp))
02599     {
02600         // The line attributes need to be reset before drawing anything.
02601         SetLineAttributes(CHANGEATTR_STROKECOL);
02602     }
02603 }

void RenderRegion::SetLineOverprint OverprintLineAttrValue NewAttr,
BOOL  Temp
[virtual]
 

Set the line overprint state, pushing the current "overprint line" attribute onto the context stack.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/7/96
Parameters:
NewAttr - The new OverPrintLineAttrValue you want to set current [INPUTS] Temp - TRUE if this is a temporary object which the render region should delete when finished with it; FALSE if someone else will delete it (i.e. it's in the document tree)
See also:
RenderRegion::RestoreOverprintLine

Definition at line 2350 of file rndrgn.cpp.

02351 {
02352     // Set the new Overprint state
02353     SaveAttribute(ATTR_OVERPRINTLINE, NewAttr, Temp);
02354 
02355     // And make sure the current line colour attribute is affected by the new overprint state
02356     StrokeColourAttribute *NewLineCol = PrepareLineColour();
02357     if (NewLineCol != NULL)
02358         SetLineColour(NewLineCol, TRUE);
02359 }

void RenderRegion::SetLineTransp StrokeTranspAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current line colour according to an AttributeValue object, pushing the current line colour onto the context stack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/11/94
Parameters:
pAttr - the object specifying the colour to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::RestoreLineColour

Definition at line 2644 of file rndrgn.cpp.

02645 {
02646     StrokeTranspAttribute* pNewAttr = NULL;
02647     if (m_bForceMix)
02648     {
02649         UINT32 Type = pAttr->GetTranspType();
02650         if (Type != TT_NoTranspType &&
02651             Type != TT_Mix &&
02652             Type != TT_DARKEN &&
02653             Type != TT_LIGHTEN &&
02654             Type != TT_BRIGHTNESS &&
02655             Type != TT_BEVEL)
02656         {
02657             if (Temp)
02658             {
02659                 pNewAttr = pAttr;
02660             }
02661             else
02662             {
02663                 pNewAttr = (StrokeTranspAttribute*)(pAttr->GetRuntimeClass()->CreateObject());
02664                 if (pNewAttr)
02665                 {
02666                     pNewAttr->SimpleCopy(pAttr);
02667                 }
02668             }
02669 
02670         }
02671     }
02672 
02673     if (pNewAttr)
02674     {
02675         pNewAttr->SetTranspType(TT_Mix);
02676         Temp = TRUE;
02677     }
02678     else
02679         pNewAttr = pAttr;
02680 
02681     // Save the current attribute and set up the new one
02682     if (SaveAttribute(ATTR_STROKETRANSP, pNewAttr, Temp))
02683     {
02684         // The line attributes need to be reset before drawing anything.
02685         SetLineAttributes(CHANGEATTR_STROKETRANSP);
02686     }
02687 }

void RenderRegion::SetLineWidth MILLIPOINT  NewLineWidth  ) 
 

Set the line width to a specific size, pushing the current line width onto the context stack.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
NewLineWidth - the size to set the line width to. [INPUTS]
See also:
RenderRegion::RestoreLineColour

Definition at line 3195 of file rndrgn.cpp.

03196 {
03197     // Don't bother if it doesn't cause a change
03198     LineWidthAttribute *pAttr = (LineWidthAttribute *) CurrentAttrs[ATTR_LINEWIDTH].pAttr;
03199     if ((pAttr != NULL) && (NewLineWidth == pAttr->LineWidth))
03200         return;
03201 
03202     // Create a temporary attribute and use it to set the line colour.
03203     pAttr = new LineWidthAttribute(NewLineWidth);
03204     SetLineWidth(pAttr, TRUE);
03205 }

void RenderRegion::SetLineWidth LineWidthAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current line width according to an AttributeValue object, pushing the current linewidth onto the context stack.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
pAttr - the object specifying the line width to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::RestoreLineWidth

Definition at line 3222 of file rndrgn.cpp.

03223 {
03224     // Set up the new attribute
03225     if (SaveAttribute(ATTR_LINEWIDTH, pAttr, Temp))
03226     {
03227         // The line attributes need to be reset before drawing anything.
03228         SetLineAttributes(CHANGEATTR_LINEWIDTH);
03229 
03230         // NB We need to invalidate the dash pattern too as this depends
03231         //    on line width (doesn't seem to matter normally, but PostScript
03232         //    gets dash patterns wrong otherwise.
03233         SetLineAttributes(CHANGEATTR_DASHPATTERN);
03234     }
03235 }

void RenderRegion::SetMatrix Matrix NewMatrix  )  [virtual]
 

This can be used to set the RenderRegions transform matrix to the given matrix. This should really be used with care!

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
26/10/93
Parameters:
NewMatrix - The matrix that will replace the old RenderMatrix [INPUTS]
See also:
RenderRegion::ConcatenateMatrix

Definition at line 1297 of file rndrgn.cpp.

01298 {
01299     // Set the Render Matrix to the one provided
01300     RenderMatrix = NewMatrix;
01301     if (GetMasterCapture())
01302     {
01303         GetMasterCapture()->CaptureMatrix = NewMatrix;
01304     }
01305 }

void RenderRegion::SetMitreLimit MILLIPOINT  NewMitreLimit  ) 
 

Set the current MitreLimit according to an AttributeValue object, pushing the current Arrow the context stack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/4/95
Parameters:
NewMitreLimit,the new Arrow to draw on the end of lines. [INPUTS]
See also:
RenderRegion::RestoreMitreLimit

Definition at line 3922 of file rndrgn.cpp.

03923 {
03924     // Don't bother if it doesn't cause a change
03925     MitreLimitAttribute *pAttr = (MitreLimitAttribute *) CurrentAttrs[ATTR_MITRELIMIT].pAttr;
03926     if ((pAttr != NULL) && (pAttr->MitreLimit == NewMitreLimit))
03927         return;
03928 
03929     // Create a temporary attribute and use it to set the Start Arrow.
03930     pAttr = new MitreLimitAttribute();
03931     pAttr->MitreLimit = NewMitreLimit;
03932     SetMitreLimit(pAttr, TRUE);
03933 }

void RenderRegion::SetMitreLimit MitreLimitAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current MitreLimit according to an AttributeValue object, pushing the current MitreLimit the context stack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/4/95
Parameters:
pAttr - the object specifying the dash pattern to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::RestoreMitreLimit

Definition at line 3950 of file rndrgn.cpp.

03951 {
03952     // Set up the new attribute
03953     if (SaveAttribute(ATTR_MITRELIMIT, pAttr, Temp))
03954     {
03955         // The line attributes need to be reset before drawing anything.
03956         SetLineAttributes(CHANGEATTR_MITRELIMIT);
03957     }
03958 }

void RenderRegion::SetOffscreen OffscreenAttrValue pAttr  )  [virtual]
 

Uses attribute stacking to offscreen rendering system notified when offscreen bitmap has been rendered (ie occurs when subtree is finished rendering and attributes are being restored).

See also:
RenderRegion::SaveAttribute;

Reimplemented in MaskedRenderRegion, PrintingMaskedRenderRegion, GRenderBrush, and GRenderRegion.

Definition at line 4771 of file rndrgn.cpp.

04772 {
04773 //  TRACEUSER( "Gerry", _T("RenderRegion::SetOffscreen (0x%08x)\n"), pAttr);
04774 
04775     // Karim 23/07/2000
04776     // Mustn't have feathering overhead for hit-testing, so
04777     // don't bother doing anything if we're a hit-test RR.
04778     if (IsHitDetect())
04779         return;
04780 
04781     // Karim 23/07/2000
04782     // Don't bother with feathering at all if our quality setting is too low.
04783     // Note: this test should probably be made in a Feather override of a Node vfn.
04784     if (RRQuality.GetFillQuality() < Quality::Graduated)
04785         return;
04786 
04787     //---------------------------------------------
04788     // Karim 20/07/2000
04789     // Moved from OffscreenAttrValue::Render(), to avoid checks for render-region types
04790     // in the feathering code.
04791     // The following code works out and sets the offscreen attr's
04792     // offscreen bounding box.
04793 
04794     // Invalid area = intersection of node's and render-region's bounding rects.
04795     //
04796     // Notes:   1.  Inflate the node's bounding rect slightly, so it _completely_
04797     //              encloses the node (sometimes it doesn't quite).
04798     //          2.  Inflate the RR's clip-rect slightly, so that we don't get
04799     //              anti-aliasing edge artifacts in the final feather-bmp render.
04800     //          3.  If printing, then use the GRR's inner rect instead of its clipping
04801     //              rect, to fix stripey printing of feathers.
04802     //              This BODGE is necessary because for some reason CurrentClipRect
04803     //              does not cover a GRR's whole bitmap when printing !?!?
04804 //  MILLIPOINT LargePixelWidth = (MILLIPOINT)ceil(GetScaledPixelWidthDouble());
04805     MILLIPOINT LargePixelWidth = GetScaledPixelWidth();
04806     DocRect NodeBB  = pAttr->GetLinkedNode()->GetBoundingRect();
04807     NodeBB.Inflate( LargePixelWidth );
04808 
04809     DocRect GRegionBB = CurrentClipRect;
04810 // Removed by Phil 2/6/2004
04811 // Seems to be bogus...
04812 //      if (IsPrinting())
04813 //          GRegionBB = InnerRect;
04814 //      else
04815         GRegionBB.Inflate( 2 * LargePixelWidth );
04816 
04817     // If we should be checking the bounds
04818     if (CheckOffscreenBounds())
04819     {
04820         // Then check them
04821         if (!NodeBB.IsIntersectedWith(GRegionBB))
04822             return;
04823     }
04824 
04825     // calculate their intersection.
04826     DocRect drOffBB = NodeBB.Intersection(GRegionBB);
04827 
04828     // Ensure that we have minimum pixel dimensions
04829     // Expand cliprect if more pixels required
04830     // NB expanding by GRR->ScaledPixelWidth will ensure we increase bmp size 
04831     // by exactly the no. of pixels required
04832     UINT32 RequiredWidth, RequiredHeight;
04833     pAttr->GetMinimumOffscreenBmpDimensions(&RequiredWidth,&RequiredHeight);
04834 //  WinRect Rect = CalculateWinRect( drOffBB );
04835     WinRect Rect = OSRenderRegion::DocRectToWin( RenderMatrix, drOffBB, GetPixelsPerInch() );   // NOTE! Use of ScaledPixelWidth in GetPixelsPerInch!
04836     UINT32 ProposedWidth    = Rect.width;
04837     UINT32 ProposedHeight   = Rect.height;
04838     MILLIPOINT ScaledPixelWidth = GetScaledPixelWidth();
04839 
04840     // We have to check if the render matrix involves rotation as we have to
04841     // expand the DocRect in the other direction
04842     // First get the components of the matrix
04843     FIXED16 comps[4];
04844     RenderMatrix.GetComponents(comps, NULL);
04845     // It is rotated if a = d = 0 and b = -c
04846     BOOL bRotated = (comps[0] == FIXED16(0) && comps[3] == FIXED16(0) && comps[1] == -comps[2]);
04847     if(ProposedWidth < (UINT32)RequiredWidth)
04848     {
04849         // make the bitmap wider
04850         // For odd pixel differences, widen rightwards by extra pixel
04851         MILLIPOINT ExtraPixelWidth = (MILLIPOINT)(RequiredWidth - ProposedWidth);
04852         MILLIPOINT Decrement = (ExtraPixelWidth / 2) * ScaledPixelWidth;
04853         MILLIPOINT Increment = Decrement + ((ExtraPixelWidth % 2) * ScaledPixelWidth);
04854 
04855         // if there is a rotation involved we have to increase the height of the DocRect
04856         // otherwise we increase the width
04857         if (bRotated)
04858         {
04859             drOffBB.lo.y -= Decrement;
04860             drOffBB.hi.y += Increment;
04861         }
04862         else
04863         {
04864             drOffBB.lo.x -= Decrement;
04865             drOffBB.hi.x += Increment;
04866         }
04867     }
04868 
04869     if (ProposedHeight < (UINT32)RequiredHeight)
04870     {
04871         // make the bitmap taller
04872         // For odd pixel differences, stretch upwards by extra pixel
04873         MILLIPOINT ExtraPixelHeight = (MILLIPOINT)(RequiredHeight - ProposedHeight);
04874         MILLIPOINT Decrement = (ExtraPixelHeight / 2) * ScaledPixelWidth;
04875         MILLIPOINT Increment = Decrement + ((ExtraPixelHeight & 1) * ScaledPixelWidth);
04876 
04877         // if there is a rotation involved we have to increase the width of the DocRect
04878         // otherwise we increase the height
04879         if (bRotated)
04880         {
04881             drOffBB.lo.x -= Decrement;
04882             drOffBB.hi.x += Increment;
04883         }
04884         else
04885         {
04886             drOffBB.lo.y -= Decrement;
04887             drOffBB.hi.y += Increment;
04888         }
04889     }
04890 
04891     pAttr->SetOffscreenBoundingRect(drOffBB);
04892 
04893     //---------------------------------------------
04894     // Now startup the offscreen capture...
04895     // 
04896     // If a non-mix attribute is already in scope we must not start capturing transparently
04897     // because transparent bitmaps can't render non-mix transparencies correctly
04898     // (See SetTranspFillGeometry and ChangeCapture)
04899     //
04900     // If the Master Capture is itself Transparent, then there's nothing we can do to grab
04901     // any non-mix transparencies correctly so test that first (typical case: Create Bitmap Copy)
04902     //
04903     BOOL bStartTransparently = FALSE;
04904     if (LockedTransparentCaptures())
04905         bStartTransparently = TRUE;
04906     else
04907     {
04908         TranspFillAttribute* pTransAttr = (TranspFillAttribute *) GetCurrentAttribute(ATTR_TRANSPFILLGEOMETRY);
04909         UINT32 ttype = pTransAttr->GetTranspType();
04910         bStartTransparently = (ttype==TT_NoTranspType || ttype==TT_Mix);
04911         // Also, scan down into the tree and see whether this node has any non-mix that would
04912         // cause us to revert to non-transparent capture
04913         // Because it's (probably) quicker to scan the tree than to revert during rendering...
04914         // Urgh.
04915         NodeRenderableInk* pLinkedNode = pAttr->GetLinkedNode()->IsAnObject() ? (NodeRenderableInk*)pAttr->GetLinkedNode() : NULL;
04916         bStartTransparently = bStartTransparently && !(pLinkedNode && pLinkedNode->ContainsNonMixTransparency(this));
04917     }
04918 
04919     Capture* pCapture = StartCapture(pAttr,
04920                                     drOffBB,
04921                                     CAPTUREINFO(ctNESTABLE, cfNONE + cfDEBUG),      // Don't allow collapse to master bitmap, CollapseToMaster=0
04922                                     bStartTransparently,
04923                                     !bStartTransparently
04924                                     );
04925     if (pCapture==NULL)
04926         return;
04927 
04928     // Save pointer to OffscreenAttr, and move current OffscreenAttr to the attr context stack
04929 //  RenderRegion::SetOffscreen(pAttr);
04930 
04931     // Push the current offscreen attribute onto the stack, and install the new attribute as
04932     // the 'current' one. (taken from RenderRegion::SaveAttribute)
04933     // NB I can't imagine a circumstance where you would want to render a Temp offscreen
04934     // attribute so I am forcing Temp = FALSE here
04935     if (TheStack.Push((AttributeValue*)CurrentOffscreenAttr, FALSE))
04936         CurrentOffscreenAttr = pAttr;
04937 }

virtual void RenderRegion::SetOSDrawingMode  )  [protected, pure virtual]
 

Implemented in AIEPSGradientScanRenderRegion, ImagemapRenderRegion, FormatRegion, ScanningRenderRegion, VectorFileRenderRegion, XPFRenderRegion, GRenderRegion, and OSRenderRegion.

void RenderRegion::SetPrintOnAllPlates PrintOnAllPlatesAttrValue NewAttr,
BOOL  Temp
[virtual]
 

Set the PrintOnAllPlates state, pushing the current "print on all plates" attribute onto the context stack.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/7/96
Parameters:
NewAttr - The new PrintOnAllPlatesAttrValue you want to set current [INPUTS] Temp - TRUE if this is a temporary object which the render region should delete when finished with it; FALSE if someone else will delete it (i.e. it's in the document tree)
See also:
RenderRegion::RestorePrintOnAllPlates

Definition at line 2466 of file rndrgn.cpp.

02467 {
02468     // Set the new Overprint state
02469     SaveAttribute(ATTR_PRINTONALLPLATES, NewAttr, Temp);
02470 
02471     // And make sure the current line colour attribute is affected by the new state
02472     StrokeColourAttribute *NewLineCol = PrepareLineColour();
02473     if (NewLineCol != NULL)
02474         SetLineColour(NewLineCol, TRUE);
02475 
02476     // And make sure the current fill colour attribute is affected by the new state
02477     ColourFillAttribute *NewFillGeometry = PrepareFillGeometry();
02478     if (NewFillGeometry != NULL)
02479         SetFillGeometry(NewFillGeometry, TRUE);
02480 }

void RenderRegion::SetQuality QualityAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current display quality according to an AttributeValue object, pushing the current quality onto the context stack.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
pAttr - the object specifying the quality to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::RestoreQuality

Definition at line 3608 of file rndrgn.cpp.

03609 {
03610     // Set up the new attribute
03611     SaveAttribute(ATTR_QUALITY, pAttr, Temp);
03612     RRQuality = pAttr->QualityValue;
03613 
03614     // The render region's rendering objects need to be reset before drawing anything.
03615     SetQualityLevel();
03616 }

void RenderRegion::SetQualityLevel void   )  [protected, virtual]
 

Does nothing.

Author:
Mark_Neves (Xara Group Ltd) <camelotdev@xara.com>
Date:
6/8/97
Parameters:
- [INPUTS]
This used to be a pure function until we found a way of making the base class get called (due to the introduction of the path processing code)

See also:
RenderRegion::SetQuality

Reimplemented in ImagemapRenderRegion, FormatRegion, ScanningRenderRegion, VectorFileRenderRegion, XPFRenderRegion, GRenderRegion, and OSRenderRegion.

Definition at line 3659 of file rndrgn.cpp.

03660 {
03661 }

BOOL RenderRegion::SetRenderComplexShapes BOOL  NewState  ) 
 

This function sets the state of the flag RenderComplexShapes. This flag is used by some classes of render region to decide what shapes to draw. If the flag is TRUE, then all shapes will be drawn that are asked to be drawn. If it is FALSE, only the shapes that are not considered to be complex by the render region will rendered. OSRenderRegions use this, as they can be used as part of the 3 phase rendering system that needs to render only specific nodes.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/4/95
Parameters:
NewState - The new state for the RenderComplexShapes flag [INPUTS]
Returns:
The old state of the flag
See also:
RenderRegion::TestForComplexShape

Definition at line 6717 of file rndrgn.cpp.

06718 {
06719     // make a note of the old value
06720     BOOL OldValue = RenderComplexShapes;
06721 
06722     // Set it to the new value
06723     RenderComplexShapes = NewState;
06724 
06725     // return the old value
06726     return OldValue;
06727 }

void RenderRegion::SetRenderState Node RenderState  )  [inline]
 

Reimplemented in ScanningRenderRegion.

Definition at line 427 of file rndrgn.h.

00427 { CurrentRenderState = RenderState; }

virtual BOOL RenderRegion::SetRenderToCapture Capture pCapture,
BOOL  ApplyClipRegion,
BOOL  bSetBitmap
[inline, protected, virtual]
 

Reimplemented in GRenderRegion.

Definition at line 766 of file rndrgn.h.

00766 {return TRUE;}

virtual BOOL RenderRegion::SetSmoothingFlags FillGeometryAttribute Fill  )  [inline, virtual]
 

Reimplemented in GRenderRegion.

Definition at line 719 of file rndrgn.h.

00719 {return TRUE;}

virtual void RenderRegion::SetSolidColours BOOL  SetSolid  )  [inline, virtual]
 

Reimplemented in GRenderRegion, and OSRenderRegion.

Definition at line 580 of file rndrgn.h.

00580 {}

void RenderRegion::SetStartArrow ArrowRec NewStartArrow  ) 
 

Set the current StartArrow according to an AttributeValue object, pushing the current Arrow the context stack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/4/95
Parameters:
NewStartArrow,the new Arrow to draw on the start of lines. [INPUTS]
See also:
RenderRegion::RestoreStartArrow

Definition at line 3747 of file rndrgn.cpp.

03748 {
03749     // Don't bother if it doesn't cause a change
03750     StartArrowAttribute *pAttr = (StartArrowAttribute *) CurrentAttrs[ATTR_STARTARROW].pAttr;
03751     if ((pAttr != NULL) && (pAttr->StartArrow == NewStartArrow))
03752         return;
03753 
03754     // Create a temporary attribute and use it to set the Start Arrow.
03755     pAttr = new StartArrowAttribute();
03756     pAttr->StartArrow = NewStartArrow;
03757     SetStartArrow(pAttr, TRUE);
03758 }

void RenderRegion::SetStartArrow StockArrow  NewStartArrow  ) 
 

Set the current StartArrow according to an AttributeValue object, pushing the current Arrow the context stack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/4/95
Parameters:
NewStartArrow,the new Arrow to draw on the start of lines. [INPUTS]
See also:
RenderRegion::RestoreStartArrow

Definition at line 3721 of file rndrgn.cpp.

03722 {
03723     // Don't bother if it doesn't cause a change
03724     StartArrowAttribute *pAttr = (StartArrowAttribute *) CurrentAttrs[ATTR_STARTARROW].pAttr;
03725     if ((pAttr != NULL) && (pAttr->StartArrow == NewStartArrow))
03726         return;
03727 
03728     // Create a temporary attribute and use it to set the Start Arrow.
03729     pAttr = new StartArrowAttribute();
03730     pAttr->StartArrow = NewStartArrow;
03731     SetStartArrow(pAttr, TRUE);
03732 }

void RenderRegion::SetStartArrow StartArrowAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current StartArrow according to an AttributeValue object, pushing the current StartArrow the context stack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/4/95
Parameters:
pAttr - the object specifying the dash pattern to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::RestoreStartArrow

Definition at line 3775 of file rndrgn.cpp.

03776 {
03777     // Set up the new attribute
03778     if (SaveAttribute(ATTR_STARTARROW, pAttr, Temp))
03779     {
03780         // The line attributes need to be reset before drawing anything.
03781         SetLineAttributes(CHANGEATTR_STARTARROW);
03782     }
03783 }

void RenderRegion::SetStartCap LineCapType  NewStartCap  ) 
 

Set the current Line Cap according to an AttributeValue object, pushing the current LineCap the context stack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/4/95
Parameters:
NewStartCap,the new LineCap Type to cap lines with. [INPUTS]
See also:
RenderRegion::RestoreStartCap

Definition at line 3438 of file rndrgn.cpp.

03439 {
03440     // Don't bother if it doesn't cause a change
03441     StartCapAttribute *pAttr = (StartCapAttribute *) CurrentAttrs[ATTR_STARTCAP].pAttr;
03442     if ((pAttr != NULL) && (NewStartCap == pAttr->StartCap))
03443         return;
03444 
03445     // Create a temporary attribute and use it to set the Start Cap.
03446     pAttr = new StartCapAttribute();
03447     pAttr->StartCap = NewStartCap;
03448     SetStartCap(pAttr, TRUE);
03449 }

void RenderRegion::SetStartCap StartCapAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current Line Cap according to an AttributeValue object, pushing the current LineCap the context stack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
5/4/95
Parameters:
pAttr - the object specifying the dash pattern to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::RestoreStartCap

Definition at line 3466 of file rndrgn.cpp.

03467 {
03468     // Set up the new attribute
03469     if (SaveAttribute(ATTR_STARTCAP, pAttr, Temp))
03470     {
03471         // The line attributes need to be reset before drawing anything.
03472         SetLineAttributes(CHANGEATTR_LINECAP);
03473     }
03474 }

virtual void RenderRegion::SetStoredCount INT64  llcount  )  [inline, virtual]
 

Definition at line 408 of file rndrgn.h.

00408 {m_countStored = llcount;}

void RenderRegion::SetStrokeType StrokeTypeAttrValue pAttr,
BOOL  Temp
[virtual]
 

Set the current Stroke Type according to an AttributeValue object, pushing the current Stroke Type onto the context stack.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/1/97
Parameters:
pAttr - the object specifying the colour to use. [INPUTS] Temp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::RestoreStrokeType

Definition at line 2733 of file rndrgn.cpp.

02734 {
02735     SaveAttribute(ATTR_STROKETYPE, pAttr, Temp);
02736 }

void RenderRegion::SetSubRenderState SubRenderContext SubRenderState  )  [inline]
 

Definition at line 435 of file rndrgn.h.

00436                             {
00437                                 ERROR3IF(SubRenderStateLocked && SubRenderState != NULL, "Oi! No!");
00438                                 CurrentSubRenderState = SubRenderState;
00439                                 if (SubRenderState == NULL)
00440                                     SubRenderStateLocked = FALSE;
00441                             }

void RenderRegion::SetTextAttributes ChangeFillAttrType  Type = CHANGEFILLATTR_ALL  )  [protected, virtual]
 

Inform the render region that an aspect of the path filling attributes has changed. The base class version just updates the RenderRegion member variable FillFlags to reflect which aspects of the fill attributes have become invalid. Derived render regions can either call the base class or just implement whatever methods they need for keeping track of these changes - or a combination of the two, of course. Some render regions (e.g. GRenderRegions) don't need to do anything about this at all as all attributes are invoked whenever anything is rendered. If this is the case, then this should be over-ridden to have a NULL implementation because this will improve rendering speed.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/10/94
Parameters:
Type - the type of the fill attribute that has changed, can be: [INPUTS]
CHANGEATTR_ALL CHANGEATTR_GEOMETRY CHANGEATTR_EFFECT CHANGEATTR_MAPPING CHANGEATTR_TRANSP_GEOMETRY CHANGEATTR_TRANSP_EFFECT CHANGEATTR_TRANSP_MAPPING CHANGEATTR_WINDING_RULE

See also:
ChangeAttrType

Definition at line 1440 of file rndrgn.cpp.

01441 {
01442     switch (Type)
01443     {
01444         case CHANGEFILLATTR_ALL:
01445             TextFlags.ValidFont         = FALSE;
01446             TextFlags.ValidBold         = FALSE;
01447             TextFlags.ValidItalic       = FALSE;
01448             TextFlags.ValidUnderline    = FALSE;
01449             TextFlags.ValidAspect       = FALSE;
01450             TextFlags.ValidTracking     = FALSE;
01451             TextFlags.ValidFontSize     = FALSE;
01452             TextFlags.ValidJustify      = FALSE;
01453             TextFlags.ValidScript       = FALSE; 
01454             TextFlags.ValidBaseLine     = FALSE;
01455             TextFlags.ValidLineSpace    = FALSE;
01456             TextFlags.ValidLeftMargin   = FALSE;
01457             TextFlags.ValidRightMargin  = FALSE;
01458             TextFlags.ValidFirstIndent  = FALSE;
01459             TextFlags.ValidRuler        = FALSE;
01460             break;
01461 
01462         case CHANGEATTR_FONT:
01463             TextFlags.ValidFont         = FALSE;
01464             break;
01465 
01466         case CHANGEATTR_BOLD:
01467             TextFlags.ValidBold         = FALSE;
01468             break;
01469 
01470         case CHANGEATTR_ITALIC:
01471             TextFlags.ValidItalic       = FALSE;
01472             break;
01473 
01474         case CHANGEATTR_UNDERLINE:
01475             TextFlags.ValidUnderline    = FALSE;
01476             break;
01477 
01478         case CHANGEATTR_ASPECT:
01479             TextFlags.ValidAspect       = FALSE;
01480             break;
01481 
01482         case CHANGEATTR_TRACKING:
01483             TextFlags.ValidTracking     = FALSE;
01484             break;
01485 
01486         case CHANGEATTR_SIZE:
01487             TextFlags.ValidFontSize     = FALSE;
01488             break;
01489         case CHANGEATTR_JUSTIFY:
01490             TextFlags.ValidJustify      = FALSE;
01491             break;
01492         case CHANGEATTR_SCRIPT:
01493             TextFlags.ValidScript       = FALSE;
01494             break;
01495         case CHANGEATTR_BASELINE:
01496             TextFlags.ValidBaseLine     = FALSE;
01497             break;
01498         case CHANGEATTR_LINESPACE:
01499             TextFlags.ValidLineSpace    = FALSE;
01500             break;
01501         case CHANGEATTR_LEFTMARGIN:
01502             TextFlags.ValidLeftMargin   = FALSE;
01503             break;
01504         case CHANGEATTR_RIGHTMARGIN:
01505             TextFlags.ValidRightMargin  = FALSE;
01506             break;
01507         case CHANGEATTR_FIRSTINDENT:
01508             TextFlags.ValidFirstIndent  = FALSE;
01509             break;
01510         case CHANGEATTR_RULER:
01511             TextFlags.ValidRuler        = FALSE;
01512             break;
01513 
01514         default:
01515             ERROR3_PF(("Invalid attribute type (%d) in SetFillAttributes", Type));
01516             break;
01517     }
01518 }

void RenderRegion::SetTranspFillGeometry TranspFillAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current fill type according to an AttributeValue object, pushing the current fill type onto the context stack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/8/94
Parameters:
pAttr - the object specifying the fill type to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::RestoreFillType; RenderRegion::SetFillColour

Definition at line 3055 of file rndrgn.cpp.

03056 {
03057     TranspFillAttribute* pNewAttr = NULL;
03058     if (m_bForceMix)
03059     {
03060         UINT32 Type = pAttr->GetTranspType();
03061         if (Type != TT_NoTranspType &&
03062             Type != TT_Mix &&
03063             Type != TT_DARKEN &&
03064             Type != TT_LIGHTEN &&
03065             Type != TT_BRIGHTNESS &&
03066             Type != TT_BEVEL)
03067         {
03068             if (Temp)
03069             {
03070                 pNewAttr = pAttr;
03071             }
03072             else
03073             {
03074                 pNewAttr = (TranspFillAttribute*)(pAttr->GetRuntimeClass()->CreateObject());
03075                 if (pNewAttr)
03076                 {
03077                     pNewAttr->SimpleCopy(pAttr);
03078                 }
03079             }
03080 
03081         }
03082     }
03083 
03084     if (pNewAttr)
03085     {
03086         pNewAttr->SetTranspType(TT_Mix);
03087         Temp = TRUE;
03088     }
03089     else
03090         pNewAttr = pAttr;
03091 
03092     // Save the current attribute
03093     if (SaveAttribute(ATTR_TRANSPFILLGEOMETRY, pNewAttr, Temp))
03094     {
03095         // The fill attributes need to be reset before drawing anything.
03096         SetFillAttributes(CHANGEATTR_TRANSP_GEOMETRY);
03097 
03098         // The capture system needs to know about non-MIX transparencies being set
03099         // because it can't capture them in RGBT bitmaps...
03100         UINT32 ttype = pNewAttr->GetTranspType();
03101         ERROR3IF(ttype<TT_NoTranspType || ttype>TT_MAX, "Someone's trying to set an unknown transp type!");
03102 
03103 //      if (!(ttype==TT_NoTranspType || ttype==TT_Mix))
03104         if (!TranspTypeIsRGBTCompatible(ttype))
03105         {
03106             ChangeCapture(CAPTUREINFO(ctREUSE, cfCOLLAPSETOMASTER), FALSE, TRUE);
03107         }
03108     }
03109 }

void RenderRegion::SetTranspFillMapping TranspFillMappingAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current fill type according to an AttributeValue object, pushing the current fill type onto the context stack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/8/94
Parameters:
pAttr - the object specifying the fill type to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::RestoreFillType; RenderRegion::SetFillColour

Definition at line 3149 of file rndrgn.cpp.

03150 {
03151     // Save the current attribute
03152     if (SaveAttribute(ATTR_TRANSPFILLMAPPING, pAttr, Temp))
03153     {
03154         // The fill attributes need to be reset before drawing anything.
03155         SetFillAttributes(CHANGEATTR_TRANSP_MAPPING);
03156     }
03157 }

void RenderRegion::SetTxtAspectRatio TxtAspectRatioAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current Text Aspect Ratio according to an AttributeValue object, pushing the current Aspect Ratio onto the context stack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pAttr - the object specifying the colour to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::RestoreTxtAspectRatio

Definition at line 4407 of file rndrgn.cpp.

04408 {
04409     // Save the current attribute and set up the new one
04410     if (SaveAttribute(ATTR_TXTASPECTRATIO, (AttributeValue*)pAttr, Temp))
04411     {
04412         SetTextAttributes(CHANGEATTR_ASPECT);
04413     }
04414 }

void RenderRegion::SetTxtBaseLine TxtBaseLineAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current Text BaseLine according to an AttributeValue object, pushing the current BaseLine onto the context stack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pAttr - the object specifying the colour to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::RestoreTxtBaseLine

Definition at line 4594 of file rndrgn.cpp.

04595 {
04596     // Save the current attribute and set up the new one
04597     if (SaveAttribute(ATTR_TXTBASELINE, (AttributeValue*)pAttr, Temp))
04598     {
04599         SetTextAttributes(CHANGEATTR_BASELINE);
04600     }
04601 }

void RenderRegion::SetTxtBold TxtBoldAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current Text Boldness according to an AttributeValue object, pushing the current Boldness onto the context stack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pAttr - the object specifying the colour to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::RestoreTxtBold

Definition at line 4218 of file rndrgn.cpp.

04219 {
04220     // Save the current attribute and set up the new one
04221     if (SaveAttribute(ATTR_TXTBOLD, (AttributeValue*)pAttr, Temp))
04222     {
04223         SetTextAttributes(CHANGEATTR_BOLD);
04224     }
04225 }

void RenderRegion::SetTxtFirstIndent TxtFirstIndentAttribute ,
BOOL  Temp
[virtual]
 

Definition at line 4715 of file rndrgn.cpp.

04716 {
04717     // Save the current attribute and set up the new one
04718     if (SaveAttribute(ATTR_TXTFIRSTINDENT, (AttributeValue*)pAttr, Temp))
04719     {
04720         SetTextAttributes(CHANGEATTR_FIRSTINDENT);
04721     }
04722 }

void RenderRegion::SetTxtFontSize TxtFontSizeAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current Font Size according to an AttributeValue object, pushing the current font size state onto the context stack.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pAttr - the object specifying the font size to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.

Definition at line 4311 of file rndrgn.cpp.

04312 {
04313     // Save the current attribute and set up the new one
04314     if (SaveAttribute(ATTR_TXTFONTSIZE, (AttributeValue*)pAttr, Temp))
04315     {
04316         SetTextAttributes(CHANGEATTR_SIZE);
04317     }
04318 }

void RenderRegion::SetTxtFontTypeface TxtFontTypefaceAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current Text Font Typeface according to an AttributeValue object, pushing the current Font Typeface onto the context stack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pAttr - the object specifying the colour to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::RestoreTxtFontTypeface

Definition at line 4170 of file rndrgn.cpp.

04171 {
04172     // Save the current attribute and set up the new one
04173     if (SaveAttribute(ATTR_TXTFONTTYPEFACE, (AttributeValue*)pAttr, Temp))
04174     {
04175         SetTextAttributes(CHANGEATTR_FONT);
04176     }
04177 }

void RenderRegion::SetTxtItalic TxtItalicAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current Text Italicness according to an AttributeValue object, pushing the current Italicness onto the context stack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pAttr - the object specifying the colour to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::RestoreTxtItalic

Definition at line 4265 of file rndrgn.cpp.

04266 {
04267     // Save the current attribute and set up the new one
04268     if (SaveAttribute(ATTR_TXTITALIC, (AttributeValue*)pAttr, Temp))
04269     {
04270         SetTextAttributes(CHANGEATTR_ITALIC);
04271     }
04272 }

void RenderRegion::SetTxtJustification TxtJustificationAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current Text Justification according to an AttributeValue object, pushing the current Justification onto the context stack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pAttr - the object specifying the colour to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::RestoreTxtJustification

Definition at line 4453 of file rndrgn.cpp.

04454 {
04455     // Save the current attribute and set up the new one
04456     if (SaveAttribute(ATTR_TXTJUSTIFICATION, (AttributeValue*)pAttr, Temp))
04457     {
04458         SetTextAttributes(CHANGEATTR_JUSTIFY);
04459     }
04460 }

void RenderRegion::SetTxtLeftMargin TxtLeftMarginAttribute pAttr,
BOOL  Temp
[virtual]
 

See other Set/Restore routines above.

Author:
Martin Wuerthner <xara@mw-software.com>
Date:
13/06/06
Parameters:
See other Set/Restore routines above [INPUTS]

Definition at line 4683 of file rndrgn.cpp.

04684 {
04685     // Save the current attribute and set up the new one
04686     if (SaveAttribute(ATTR_TXTLEFTMARGIN, (AttributeValue*)pAttr, Temp))
04687     {
04688         SetTextAttributes(CHANGEATTR_LEFTMARGIN);
04689     }
04690 }

void RenderRegion::SetTxtLineSpace TxtLineSpaceAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current Text LineSpace according to an AttributeValue object, pushing the current LineSpace onto the context stack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pAttr - the object specifying the colour to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::RestoreTxtLineSpace

Definition at line 4641 of file rndrgn.cpp.

04642 {
04643     // Save the current attribute and set up the new one
04644     if (SaveAttribute(ATTR_TXTLINESPACE, (AttributeValue*)pAttr, Temp))
04645     {
04646         SetTextAttributes(CHANGEATTR_LINESPACE);
04647     }
04648 }

void RenderRegion::SetTxtRightMargin TxtRightMarginAttribute ,
BOOL  Temp
[virtual]
 

Definition at line 4699 of file rndrgn.cpp.

04700 {
04701     // Save the current attribute and set up the new one
04702     if (SaveAttribute(ATTR_TXTRIGHTMARGIN, (AttributeValue*)pAttr, Temp))
04703     {
04704         SetTextAttributes(CHANGEATTR_RIGHTMARGIN);
04705     }
04706 }

void RenderRegion::SetTxtRuler TxtRulerAttribute ,
BOOL  Temp
[virtual]
 

Definition at line 4731 of file rndrgn.cpp.

04732 {
04733     // Save the current attribute and set up the new one
04734     if (SaveAttribute(ATTR_TXTRULER, (AttributeValue*)pAttr, Temp))
04735     {
04736         SetTextAttributes(CHANGEATTR_RULER);
04737     }
04738 }

void RenderRegion::SetTxtScript TxtScriptAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current Text Script according to an AttributeValue object, pushing the current Script onto the context stack.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/04/95
Parameters:
pAttr - the object specifying the colour to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::RestoreTxtScript

Definition at line 4547 of file rndrgn.cpp.

04548 {
04549     // Save the current attribute and set up the new one
04550     if (SaveAttribute(ATTR_TXTSCRIPT, (AttributeValue*)pAttr, Temp))
04551     {
04552         SetTextAttributes(CHANGEATTR_SCRIPT);
04553     }
04554 }

void RenderRegion::SetTxtTracking TxtTrackingAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current Text Tracking according to an AttributeValue object, pushing the current Tracking onto the context stack.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pAttr - the object specifying the colour to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::RestoreTxtTracking

Definition at line 4499 of file rndrgn.cpp.

04500 {
04501     // Save the current attribute and set up the new one
04502     if (SaveAttribute(ATTR_TXTTRACKING, (AttributeValue*)pAttr, Temp))
04503     {
04504         SetTextAttributes(CHANGEATTR_TRACKING);
04505     }
04506 }

void RenderRegion::SetTxtUnderline TxtUnderlineAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current Text Underline state according to an AttributeValue object, pushing the current Underline state onto the context stack.

Author:
Simon_Maneggio (Xara Group Ltd) <camelotdev@xara.com>
Date:
13/03/95
Parameters:
pAttr - the object specifying the colour to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.

Definition at line 4361 of file rndrgn.cpp.

04362 {
04363     // Save the current attribute and set up the new one
04364     if (SaveAttribute(ATTR_TXTUNDERLINE, (AttributeValue*)pAttr, Temp))
04365     {
04366         SetTextAttributes(CHANGEATTR_UNDERLINE);
04367     }
04368 }

void RenderRegion::SetupFuzzyClipRects  )  [protected]
 

Sets up the fuzzy clipping rects, basing them on the CurrentClipRect. Don't ask me what they're used for - I'm just moving some useful code into a function :o).

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
01/08/2000

Definition at line 5998 of file rndrgn.cpp.

05999 {
06000     // Set up the Fuzzy Clipping Rects.
06001     if (!CurrentClipRect.IsValid())
06002         return;
06003 
06004     // Inner rect is used to clip with, so we need to make it bigger than the region so that
06005     // things like thick lines do not show up.
06006     InnerRect = CurrentClipRect;
06007     INT32 ScaleBy = (RR_LINEWIDTH()/2) + 16 * ScaledPixelWidth;
06008     InnerRect.Inflate(ScaleBy, ScaleBy);
06009 
06010     if (!InnerRect.IsValid())
06011         return;
06012 
06013     // The outer rect is used to determine if clipping is needed, so make it
06014     // a few times bigger than the inner rect.
06015     OuterRect = InnerRect;
06016     OuterRect.Inflate(InnerRect.Width()*3, InnerRect.Height()*3);
06017 }

void RenderRegion::SetUsingSmoothedBitmaps BOOL  set  )  [inline]
 

Definition at line 460 of file rndrgn.h.

00460 { RenderFlags.SmoothedBitmaps = set; }

void RenderRegion::SetVariableWidth VariableWidthAttrValue pAttr,
BOOL  Temp
[virtual]
 

Set the current VariableWidth according to an AttributeValue object, pushing the current VariableWidth onto the context stack.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
7/1/97
Parameters:
pAttr - the object specifying the colour to use. [INPUTS] Temp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::RestoreVariableWidth

Definition at line 2782 of file rndrgn.cpp.

02783 {
02784     SaveAttribute(ATTR_VARWIDTH, pAttr, Temp);
02785 }

void RenderRegion::SetWebAddress WebAddressAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current WebAddress.

Author:
Graham_Walmsley (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/3/97
Parameters:
pAttr - pointer to a Web Address to set [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
This attribute has no effect on rendering, so there's no need to change anything in the rendering system itself when we do this.

See also:
RenderRegion::RestoreWebAddress

Definition at line 3681 of file rndrgn.cpp.

03682 {
03683     // Set up the new attribute
03684     SaveAttribute(ATTR_WEBADDRESS, (AttributeValue*) pAttr, Temp);
03685 }

void RenderRegion::SetWindingRule WindingType  NewWindingRule  ) 
 

Set the winding rule, pushing the current winding rule onto the context stack.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
NewWindingRule - the winding rule to use. [INPUTS]
See also:
RenderRegion::RestoreWindingRule

Definition at line 3999 of file rndrgn.cpp.

04000 {
04001     // Don't bother if it doesn't cause a change
04002     WindingRuleAttribute *pAttr = 
04003         (WindingRuleAttribute *) CurrentAttrs[ATTR_WINDINGRULE].pAttr;
04004     if ((pAttr != NULL) && (NewWindingRule == pAttr->WindingRule))
04005         return;
04006 
04007     // Create a temporary attribute and use it to set the drawing mode
04008     pAttr = new WindingRuleAttribute(NewWindingRule);
04009     SetWindingRule(pAttr, TRUE);
04010 }

void RenderRegion::SetWindingRule WindingRuleAttribute pAttr,
BOOL  Temp
[virtual]
 

Set the current winding rule according to an AttributeValue object, pushing the current winding rule onto the context stack.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/04/94
Parameters:
pAttr - the object specifying the winding rule to use. [INPUTS] Tmp - indicates if pAttr points to a temporary attribute that should be deleted when it's finished with.
See also:
RenderRegion::RestoreWindingRule

Definition at line 4027 of file rndrgn.cpp.

04028 {
04029     // Save the current attribute
04030     if (SaveAttribute(ATTR_WINDINGRULE, pAttr, Temp))
04031     {
04032         // The fill attributes need to be reset before drawing anything.
04033         SetFillAttributes(CHANGEATTR_WINDING_RULE);
04034     }
04035 }

Capture * RenderRegion::StartCapture CCObject pOwner,
DocRect  CaptureRect,
CAPTUREINFO  cinfo,
BOOL  bTransparent = TRUE,
BOOL  bCaptureBackground = FALSE,
double  dPPI = 0,
NodeRenderableInk pDirectSupplier = NULL
[virtual]
 

To start a bitmap capture of whatever is subsequently rendered.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/06/2004
Parameters:
pOwnerNode - Node in tree which "owns" this capture [INPUTS] CaptureRect - The rectangle to capture ctype - The type of capture required bTransparent - The capture could be transparent RGBT bCaptureBackground - The capture should include the state of the background
- [OUTPUTS]
Returns:
TRUE if a Capture was successfully set up
See also:
GRenderRegion::StopCapture

Reimplemented in GRenderRegion.

Definition at line 7407 of file rndrgn.cpp.

07414 {
07415     ENSURE(cinfo.caType==ctNESTABLE, "We only support nestable captures at the moment\n");
07416 
07417     // 1) alloc new mem, and setup state variables for new offscreen rendering
07418         // mem alloced = bmp
07419         // vars setup = docrect, gmatrix
07420     // 2) save current
07421     // 3) change to new offscreen state
07422 
07423     // If there's already a capture running and this one is nested but wants to change 
07424     // the transparency type then we must notify existing captures of the change...
07425     Capture* pCurrentCapture = GetTopCapture();
07426     if (pCurrentCapture!=NULL && cinfo.caType==ctNESTABLE && !cinfo.caFlags.GrabRendered && pCurrentCapture->IsTransparent() && !bTransparent)
07427     {
07428         ChangeCapture(cinfo, bTransparent, bCaptureBackground);
07429     }
07430 
07431     // If the caller didn't specify the capture resolution in pixels per inch
07432     // Then set it to the default value of the render region
07433     // And use the default matrix in our setup calculations
07434     Matrix CaptureMatrix;
07435     if (dPPI==0)
07436     {
07437 //      dPPI = GetPixelsPerInch();
07438 
07439         // Find current top bitmap capture and copy its res and res scale control flag
07440         Capture* pCap = GetTopCapture();
07441         ERROR2IF(pCap==NULL, NULL, "There MUST be a bitmap capture in the stack - the master capture at least");
07442         dPPI = pCap->dPixelsPerInch;
07443         cinfo.caFlags.CalcScaledPixWidth = pCap->info.caFlags.CalcScaledPixWidth;
07444 
07445         CaptureMatrix = RenderMatrix;
07446     }
07447     else
07448     {
07449         // If the caller specified a particular DPI we will assume he wants the capture
07450         // to grab the rendered objects at 100% scale...
07451         // No need to construct a new matrix in a complex way - the clip rect and
07452         // object are all stored in doccoords.
07453 //      CaptureMatrix = Identity;
07454     }
07455 
07456     // In non-Master Captures, make sure that we use a default colour context
07457     // to prevent multiple colour corrections when rendering bitmaps in "print preview"
07458     // type modes...
07459     ColourContext* pColContext = NULL;
07460     if (!cinfo.caFlags.Master)
07461     {
07462         BOOL bOldForce = RenderView->SetForceDefaultColourContexts();
07463         pColContext = RenderView->GetColourContext(COLOURMODEL_RGBT);
07464         RenderView->SetForceDefaultColourContexts(bOldForce);
07465     }
07466     else
07467     {
07468         // Must get RenderRegion's current colour context for Master Capture
07469         pColContext = CurrentColContext;
07470     }
07471 
07472     // Create a new capture instance...
07473     Capture* pNewCapture = new Capture(pOwner, cinfo, CaptureMatrix, CaptureRect, dPPI, pColContext);
07474     ENSURE(!pNewCapture->IsMaster(), "Can only have one master capture!");
07475 
07476     m_CaptureStack.Push(pNewCapture);
07477 
07478     return pNewCapture;
07479 }

BOOL RenderRegion::StartRender void   )  [virtual]
 

Initialises the device attachment, if we haven't already done so for this render region. This is so that we can have a two-stage attachment of a device to a render region. This allows us to create render regions very quickly, which makes background rendering more efficient as quite often we will just throw them away without ever needing a proper connection to the device context.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/05/94
See also:
RenderRegion::AttachDevice; RenderRegion::InitDevice

Reimplemented in ArtWorksEPSRenderRegion, CamelotEPSRenderRegion, MaskedRenderRegion, PrintPSRenderRegion, ScanningRenderRegion, VectorFileRenderRegion, XPFRenderRegion, GRenderBitmap, GRenderClick, GRenderClickColour, GRenderPrint, GRenderRegion, and OSRenderRegion.

Definition at line 1173 of file rndrgn.cpp.

01174 {
01175     // If the device has not been Inited, then do it now
01176     if (!RenderFlags.ValidDevice)
01177     {
01178         // Device needs to be initialised
01179         if (!InitDevice())
01180         {
01181             // Something's gone wrong - inform the user.
01182             //InformSeriousError();
01183             TRACE( _T("InitDevice failed in Render Region (Could be not enough mem for Gdraw bitmap)"));
01184             return FALSE;
01185         }
01186 
01187         // Make sure we don't do this again for this render region
01188         RenderFlags.ValidDevice = TRUE;
01189     }
01190 
01191     // Set up the Fuzzy Clipping Rects
01192     // Inner rect is used to clip with, so we need to make it bigger than the region so that
01193     // things like thick lines do not show up
01194     InnerRect = CurrentClipRect;
01195     INT32 ScaleBy = 1000*ScaledPixelWidth;
01196     InnerRect.Inflate(ScaleBy, ScaleBy);
01197 
01198     // The outer rect is used to determine if clipping is needed, so make it
01199     // a few times bigger than the inner rect
01200     OuterRect = InnerRect;
01201     OuterRect.Inflate(InnerRect.Width()*3, InnerRect.Height()*3);
01202 
01203     // Create the default, master capture...
01204     Capture* pNewMasterCapture = NULL;
01205 
01206     if (m_CaptureStack.Empty())
01207     {
01208         pNewMasterCapture = new Capture(this, CAPTUREINFO(ctNESTABLE, cfMASTER | cfPIXWIDTHSCALE), RenderMatrix, CurrentClipRect, GetPixelsPerInch(), CurrentColContext);   // NOTE! Use of ScaledPixelWidth in GetPixelsPerInch in RenderRegion!
01209         if (pNewMasterCapture==NULL) return FALSE;
01210 
01211         m_CaptureStack.Push(pNewMasterCapture);
01212     }
01213 
01214     return TRUE;
01215 }

BOOL RenderRegion::StopCapture CCObject pOwner,
BOOL  bRender = TRUE,
BOOL  bReleaseBitmap = FALSE,
LPBITMAPINFO plpBitmapInfo = NULL,
LPBYTE plpBits = NULL,
DocRect pCaptureRect = NULL,
Matrix pmatTransform = NULL,
double *  pdResolution = NULL
[virtual]
 

To stop a bitmap capture.

Author:
Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
Date:
30/06/2004
Parameters:
pEndNode - Node in tree which "owns" this capture [INPUTS]
- [OUTPUTS]
Returns:
TRUE if the Capture resulted in a bitmap being usefully created
See also:
GRenderRegion::StartCapture

Reimplemented in GRenderRegion.

Definition at line 7505 of file rndrgn.cpp.

07513 {
07514     Capture* pCapture = GetTopCapture();
07515     if (pCapture==NULL)
07516         return FALSE;
07517 
07518     if (pCapture->IsMaster())
07519     {
07520         ERROR2(FALSE, "StopCapture called on the master capture!\n");
07521         return FALSE;
07522     }
07523 
07524     // Pop the capture off the stack now
07525     m_CaptureStack.Pop();
07526 
07527     delete pCapture;
07528 
07529     return TRUE;
07530 }

virtual BOOL RenderRegion::StopRender  )  [pure virtual]
 

Implemented in AIEPSGradientScanRenderRegion, CamelotEPSRenderRegion, ImagemapRenderRegion, FormatRegion, PrintPSRenderRegion, ScanningRenderRegion, VectorFileRenderRegion, XPFRenderRegion, GRenderPrint, GRenderRegion, and OSRenderRegion.

BOOL RenderRegion::TestForComplexShape RRCaps pCaps  ) 
 

This function is called whenever someone calls one of the primitive render functions in a ScanningRenderRegion. This takes a look at all the attributes (and anything else it might need to) to see if this represents a complex shape or not. If it is a complex shape, all the internal data members of the render region are updated accordingly. This function makes use of the RRCaps object that was set with the SetHostRRCaps() function to see what things the Host render region considers to be complex.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
10/4/95
Returns:
TRUE if the current state of the attributes make this a complex shape. FALSE if the host render region could render this with no trouble
See also:
SetHostRRCaps()

Definition at line 6469 of file rndrgn.cpp.

06470 {
06471     // we will start off assuming that this is not a complex shape we are trying to draw
06472     BOOL IsComplex = FALSE;
06473 
06474     // If we are in very low quality mode then assume everything is simple
06475     if (RRQuality.GetFillQuality() <= Quality::Bitmaps)
06476         return FALSE;
06477 
06478     if (pCaps->DoesRegionDoNothing())
06479         return TRUE;
06480 
06481     // if the host rr can not do transparancy, then see if there is any
06482     if (!pCaps->Transparency)
06483     {
06484         // Find out about the transparancy attribute
06485         TranspFillAttribute* pTransAttr = RR_FILLTRANSP();
06486         UINT32 Type = pTransAttr->GetTranspType();
06487         UINT32* pAmount1 = pTransAttr->GetStartTransp();
06488 
06489         // This may be a grad fill transp
06490         // we will get ready for this by setting up a var for the end transp
06491         UINT32  DefaultAmount = 0;
06492         UINT32* pAmount2 = &DefaultAmount;
06493         UINT32* pAmount3 = &DefaultAmount;
06494         UINT32* pAmount4 = &DefaultAmount;
06495 
06496         // get the end point transparencies (if there are any)
06497         if (pTransAttr->GetEndTransp())
06498             pAmount2 = pTransAttr->GetEndTransp();
06499 
06500         if (pTransAttr->GetEndTransp2())
06501             pAmount3 = pTransAttr->GetEndTransp2();
06502         
06503         if (pTransAttr->GetEndTransp3())
06504             pAmount4 = pTransAttr->GetEndTransp3();
06505 
06506         // See if there is any transparency in it
06507         if ((Type != 1) ||
06508             (*pAmount1 > 1) || 
06509             (*pAmount2 > 1) || 
06510             (*pAmount3 > 1) || 
06511             (*pAmount4 > 1))
06512         {
06513             // we found something that might be a bit transparent
06514             IsComplex = TRUE;
06515         }
06516 
06517         // CGS could - check for transparency profiling here as well
06518         // BUT these no point, since if were dealing with transparency,
06519         // then IsComplex will have just been set to TRUE by the above, which will cause us
06520         // to be rendered correctly anyway ....
06521 
06522         // Get the current fill attr
06523         FillGeometryAttribute* pFillAttr = (FillGeometryAttribute*) CurrentAttrs[ATTR_FILLGEOMETRY].pAttr;
06524 
06525         if (!IsComplex)
06526         {
06527             if (pFillAttr->GetBitmap() != NULL)
06528             {
06529                 KernelBitmap* pBmp = pFillAttr->GetBitmap();
06530                 if (pBmp && pBmp->IsTransparent())
06531                     IsComplex = TRUE;
06532             }
06533         }
06534 
06535         // now check for colour ramp ....
06536 
06537         if (!IsComplex)
06538         {
06539             // if there is a colour ramp, then the shape is complex ....
06540             
06541             if (pFillAttr->GetColourRamp () != NULL)
06542             {
06543                 IsComplex = TRUE;
06544             }
06545         }
06546 
06547         // now lets check for fill profiling ....
06548 
06549         CProfileBiasGain DefaultBiasGain;
06550 
06551         if (!(pFillAttr->GetProfile () == DefaultBiasGain))
06552         {
06553             IsComplex = TRUE;
06554 
06555 
06556 
06557         }
06558     }
06559 
06560     // If it is not complex yet, and we can't do bitmaps, see if we can do them
06561     if ((!IsComplex) && (!pCaps->BitmapFills || !pCaps->PerspectiveBitmapFills))
06562     {
06563         // Get the current fill attr
06564         ColourFillAttribute* pFillAttr = (ColourFillAttribute*) CurrentAttrs[ATTR_FILLGEOMETRY].pAttr;
06565 
06566         // see if it is a bitmap fill, and if it is, mark the shape as complex
06567         if (pFillAttr->IS_KIND_OF(BitmapFillAttribute))
06568         {
06569             // First check for the simple case of clipped bitmaps, as opposed to tiled
06570             // bitmap fills.
06571             FillMappingAttribute* pMapAttr = (FillMappingAttribute*) CurrentAttrs[ATTR_FILLMAPPING].pAttr;
06572             if ((pMapAttr->Repeat == 1) && 
06573                 (pCaps->ClippedSimpleBitmaps || pCaps->ClippedArbitraryBitmaps))
06574             {
06575                 // 'Simple' bitmap fill - is it a simple stretch, or has it been 
06576                 // arbitrarily transformed?
06577                 if (!pCaps->ClippedArbitraryBitmaps)
06578                 {
06579                     // Here we check the start and end points - the default arrangement is this:
06580                     //
06581                     //  EndPoint2
06582                     //      ^
06583                     //      |
06584                     //      |
06585                     //      |
06586                     //      |
06587                     //      +----------->  EndPoint
06588                     //  StartPoint
06589                     //
06590                     // So we check that the start and end points are aligned in the y axis,
06591                     // and then check that the start and second end point are aligned in
06592                     // the x axis.
06593                     //
06594                     DocCoord Geometry[3];
06595                     Geometry[0] = *(pFillAttr->GetStartPoint());
06596                     Geometry[1] = *(pFillAttr->GetEndPoint());
06597                     Geometry[2] = *(pFillAttr->GetEndPoint2());
06598                     if ((Geometry[0].x != Geometry[2].x) ||
06599                         (Geometry[0].y != Geometry[1].y))
06600                     {
06601                         // It's not a simple stretch - we can't do it!
06602                         IsComplex = TRUE;
06603                     }
06604                 }
06605             }
06606             else
06607             {
06608                 if (!pCaps->BitmapFills)
06609                     // We can't do bitmap fills!
06610                     IsComplex = TRUE;
06611                 else if (pFillAttr->IsPerspective() && !pCaps->PerspectiveBitmapFills)
06612                     // Bitmap fill is perspectivised, and we can't do that.
06613                     IsComplex = TRUE;
06614             }
06615         }
06616     }
06617 
06618     // If it is not complex yet, and we can't do Grad Fills, see if we can do them
06619     if ((!IsComplex) && (!pCaps->GradFills || !pCaps->PerspectiveGradFills || !pCaps->Grad3and4Fills))
06620     {
06621         // Get the current fill attr
06622         ColourFillAttribute* pFillAttr = (ColourFillAttribute*) CurrentAttrs[ATTR_FILLGEOMETRY].pAttr;
06623         FillMappingAttribute* pMapAttr = (FillMappingAttribute*) CurrentAttrs[ATTR_FILLMAPPING].pAttr;
06624         
06625         // see if it is a graduated fill, and if it is, mark the shape as complex
06626         if (pFillAttr->IsAGradFill())
06627         {
06628             if (!pCaps->GradFills)
06629                 // We just can't do graduated fills
06630                 IsComplex = TRUE;
06631             else if (pFillAttr->IsPerspective() && !pCaps->PerspectiveGradFills)
06632                 // It's perspectivised, and we can't do that.
06633                 IsComplex = TRUE;
06634             else if (pFillAttr->IsASquareFill() && !pCaps->Grad3and4Fills)
06635                 // We use the same flag rather than put a new one in as this fill type 
06636                 // will probably be supported soon
06637                 IsComplex = TRUE;
06638             else if (pFillAttr->IsAThreeColFill() && !pCaps->Grad3and4Fills)
06639                 IsComplex = TRUE;
06640 //Mark Howitt, 13/10/97. If the fill is a new repeating grad fill, then that`s really complex!
06641             else if (pMapAttr->Repeat == 4)
06642                 IsComplex = TRUE;
06643 //CGS, 24/5/2000  Need to do this for the new multi-stage and profiled fills as well ....
06644             // now check for colour ramp ....
06645             // if there is a colour ramp, then the shape is real complex ....
06646             else if (pFillAttr->GetColourRamp () != NULL)
06647             {
06648                 IsComplex = TRUE;
06649             }
06650             // now check for fill profiling ....
06651             else
06652             {
06653                 CProfileBiasGain DefaultBiasGain;
06654 
06655                 // if their not identical, then were complex!
06656                 if (!(pFillAttr->GetProfile () == DefaultBiasGain))
06657                 {
06658                     IsComplex = TRUE;
06659 
06660 
06661 
06662                 }
06663             }
06664         }
06665     }
06666 
06667     // Test for offscreen attributes.
06668     // We currently do this for all RRs 'cept those which can do everything.
06669     if (!IsComplex && !pCaps->DoesRegionDoAll())
06670     {
06671         OffscreenAttrValue* pOffAttr = CurrentOffscreenAttr;
06672 
06673         // we're complex if the current attr is not the default.
06674         if ( ! ((GeometryLinkedAttrValue*)pOffAttr)->IsDefaultFlagSet() )
06675             IsComplex = TRUE;
06676     }
06677 
06678     // Test to see whether the RR can clip its output to an arbitrary path.
06679     // Currently, only GRenderRegion and PostScript RR's can do this.
06680     if (!IsComplex && !pCaps->ClippedOutput)
06681     {
06682         ClipRegionAttribute* pClipAttr = RR_CLIPREGION();
06683         IsComplex = (pClipAttr->GetClipPath() != NULL);
06684     }
06685 
06686     // we seem to have problems printing variable width strokes, though the problem
06687     // goes away if they are transparent, so treat them as complex
06688     if (PathProcessorStack != NULL && PathProcessorStack->IsAPathProcessorStroke())
06689         IsComplex = TRUE;
06690 
06691 
06692     // return what we found out
06693     return IsComplex;
06694 }

virtual BOOL RenderRegion::TranspTypeIsRGBTCompatible UINT32  ttype  )  const [inline, virtual]
 

Reimplemented in GRenderRegion.

Definition at line 718 of file rndrgn.h.

00718 {return TRUE;}  // Should be TranspType ttype

BOOL RenderRegion::TryToFuzzyClip Path pPath,
DocCoord **  pNewCoords,
PathVerb **  pNewVerbs,
UINT32 NewNumCoords
[protected]
 

This function works out if clipping is needed (based on scale factor etc) and tries to clip the paths. If it works it will return TRUE, meaning that you should only try to draw that path info found in pNewCoords etc. If FALSE is returned pNewCoords etc will all be NULL. If this function returns TRUE it will have allocated memory to put the new coords and verbs in. It will be your responsibility to delete this memory after you have rendered the path.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
9/3/95
Parameters:
pPath - The path to try to clip [INPUTS]
pNewCoords - The clipped coords that need rendering [OUTPUTS] pNewVerbs - The Clipped set of verbs NewNumCoords - The number of coords in this new clipped path
Returns:
TRUE if it needed to clip the path, FALSE if it did nothing

Definition at line 5924 of file rndrgn.cpp.

05926 {
05927     // Start out by setting all the return values to something sensible
05928     *pNewCoords = NULL;
05929     *pNewVerbs = NULL;
05930     *NewNumCoords = 0;
05931     
05932     // Decide if we need to clip this path in order to draw it
05933     // Only bother if we are zoomed in a bit (400%)
05934     if (RenderView->GetViewScale() > FIXED16(4))
05935     {
05936         // Make some new coords etc
05937         DocCoord* pOldCoords = pPath->GetCoordArray();
05938         PathVerb* pOldVerbs = pPath->GetVerbArray();
05939         size_t OldNumCoords = (size_t)pPath->GetNumCoords();
05940         
05941         // Allow the new path to have a few extra points in it as this is possible.
05942         // If it gets to be more than this, then it will simply be unclipped
05943         // Usually the number of points is reduced when clipping.
05944         size_t NumCoords = OldNumCoords+20;
05945 
05946         // Get some mem for the coords
05947         DocCoord* Coords = new DocCoord[NumCoords];
05948         if (Coords==NULL)
05949             return FALSE;
05950 
05951         // Get some mem for the verbs
05952         PathVerb* Verbs = new PathVerb[NumCoords];
05953         if (Verbs==NULL)
05954         {
05955             delete [] Coords;
05956             return FALSE;
05957         }
05958 
05959         // Actually clip the path to the rectangles
05960         NumCoords = FuzzyClip( (PPOINT)pOldCoords, pOldVerbs, OldNumCoords, pPath->IsFilled,
05961                                 (RECT*)(&InnerRect), (RECT*)(&OuterRect),
05962                                 (PPOINT)Coords, Verbs, NumCoords);
05963         // See if it worked
05964         if (NumCoords == (size_t)-1)
05965         {
05966             // No it did not, so clean up and return
05967             delete [] Coords;
05968             delete [] Verbs;
05969             return FALSE;
05970         }
05971         else
05972         {
05973             // fill in the correct values for the outputs and return TRUE
05974             *pNewCoords = Coords;
05975             *pNewVerbs = Verbs;
05976             *NewNumCoords = (UINT32)NumCoords;
05977             return TRUE;
05978         }
05979     }
05980 
05981     // There was no need to clip, so return false
05982     return FALSE;
05983 }

BOOL RenderRegion::WantsGrids  )  [virtual]
 

This function is designed to help with the rendering of grids, as they are not always wanted (eg xara eps). If your class of render region does not want grids to appear, then overide this function and get it to return FALSE. The default behaviour is to return TRUE, which will allow grids to render if they want to.

Author:
Rik_Heywood (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/12/95
Returns:
TRUE

Reimplemented in CMXRenderRegion, ImagemapRenderRegion, NativeRenderRegion, and EPSRenderRegion.

Definition at line 6775 of file rndrgn.cpp.

06776 {
06777     return TRUE;
06778 }

BOOL RenderRegion::WriteNewLine void   )  [virtual]
 

Writes in a new-line token if necessary. In this class, it's just a stub function that's over-ridden in the derived classes.

Author:
Graeme_Sutherland (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/4/00
Parameters:
- [INPUTS]
Returns:
TRUE - Success. FALSE - Failure.

Reimplemented in AIEPSRenderRegion, CamelotEPSRenderRegion, and EPSRenderRegion.

Definition at line 6066 of file rndrgn.cpp.

06067 {
06068     return TRUE;
06069 }


Member Data Documentation

BOOL RenderRegion::CanRegionBeMerged [protected]
 

Definition at line 940 of file rndrgn.h.

UINT32 RenderRegion::ClipViewBlobSize = 8 [static, protected]
 

This number represents the size of the ClipView's special selection blobs. These blobs are only visible on selected ClipView groups when using the selector tool, and are used to select different sections of the group.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
22 May 2000
See also:
SelectedBlobSize

Definition at line 929 of file rndrgn.h.

AttributeEntry* RenderRegion::CurrentAttrs [protected]
 

Definition at line 904 of file rndrgn.h.

DocRect RenderRegion::CurrentClipRect [protected]
 

Definition at line 889 of file rndrgn.h.

ColourContext* RenderRegion::CurrentColContext [protected]
 

Definition at line 890 of file rndrgn.h.

OffscreenAttrValue* RenderRegion::CurrentOffscreenAttr [protected]
 

Definition at line 911 of file rndrgn.h.

Node* RenderRegion::CurrentRenderState [protected]
 

Definition at line 897 of file rndrgn.h.

SubRenderContext* RenderRegion::CurrentSubRenderState [protected]
 

Definition at line 898 of file rndrgn.h.

DrawModeType RenderRegion::DrawingMode
 

Definition at line 519 of file rndrgn.h.

struct RenderRegion::_FillFlags RenderRegion::FillFlags [protected]
 

DocRect RenderRegion::InnerRect [protected]
 

Definition at line 821 of file rndrgn.h.

BOOL RenderRegion::IsBeingReset [protected]
 

Definition at line 953 of file rndrgn.h.

BOOL RenderRegion::IsInkRenderStarted
 

Definition at line 789 of file rndrgn.h.

BOOL RenderRegion::IsLastBand
 

Definition at line 778 of file rndrgn.h.

BOOL RenderRegion::IsPaperRendered
 

Definition at line 788 of file rndrgn.h.

BOOL RenderRegion::IsRegionBanded [protected]
 

Definition at line 939 of file rndrgn.h.

BOOL RenderRegion::IsWaitingForRAM
 

Definition at line 777 of file rndrgn.h.

BOOL RenderRegion::m_bForceMix [protected]
 

Definition at line 959 of file rndrgn.h.

BOOL RenderRegion::m_bRenderTreeTimeSlice [protected]
 

Definition at line 917 of file rndrgn.h.

StackT<Capture*> RenderRegion::m_CaptureStack [protected]
 

Definition at line 770 of file rndrgn.h.

INT64 RenderRegion::m_countStored [protected]
 

Definition at line 829 of file rndrgn.h.

INT64 RenderRegion::m_countTotal [protected]
 

Definition at line 828 of file rndrgn.h.

BOOL RenderRegion::m_DoCompression
 

Definition at line 793 of file rndrgn.h.

bool RenderRegion::m_fOwned [protected]
 

Definition at line 895 of file rndrgn.h.

Node* RenderRegion::m_pBackmostChangedNode [protected]
 

Definition at line 947 of file rndrgn.h.

Filter* RenderRegion::m_pFilter [protected]
 

Reimplemented in XPFRenderRegion.

Definition at line 956 of file rndrgn.h.

MonotonicTime RenderRegion::m_timeRenderTreeStartTime [protected]
 

Definition at line 918 of file rndrgn.h.

DocColour RenderRegion::mBackgroundColour [protected]
 

Definition at line 796 of file rndrgn.h.

UINT32 RenderRegion::MultiStageSelectedBlobSize = 4 [static, protected]
 

Definition at line 924 of file rndrgn.h.

UINT32 RenderRegion::MultiStageUnSelectedBlobSize = 3 [static, protected]
 

Definition at line 925 of file rndrgn.h.

BOOL RenderRegion::NeedsOSPaper
 

Definition at line 782 of file rndrgn.h.

INT32 RenderRegion::NumCurrentAttrs [protected]
 

Definition at line 905 of file rndrgn.h.

DocRect RenderRegion::OuterRect [protected]
 

Definition at line 822 of file rndrgn.h.

PathProcessor* RenderRegion::PathProcessorStack [private]
 

Definition at line 965 of file rndrgn.h.

MILLIPOINT RenderRegion::PixelWidth [protected]
 

Definition at line 932 of file rndrgn.h.

DocRect RenderRegion::RegionRect [protected]
 

Definition at line 938 of file rndrgn.h.

BOOL RenderRegion::RenderComplexShapes [protected]
 

Definition at line 825 of file rndrgn.h.

CNativeDC* RenderRegion::RenderDC [protected]
 

Definition at line 893 of file rndrgn.h.

struct CCAPI RenderRegion::FlagBlock RenderRegion::RenderFlags [protected]
 

Matrix RenderRegion::RenderMatrix [protected]
 

Definition at line 888 of file rndrgn.h.

BOOL RenderRegion::RenderOSPaper
 

Definition at line 785 of file rndrgn.h.

Spread* RenderRegion::RenderSpread [protected]
 

Definition at line 894 of file rndrgn.h.

View* RenderRegion::RenderView [protected]
 

Definition at line 892 of file rndrgn.h.

Quality RenderRegion::RRQuality
 

Definition at line 790 of file rndrgn.h.

MILLIPOINT RenderRegion::ScaledPixelWidth [protected]
 

Definition at line 933 of file rndrgn.h.

FIXED16 RenderRegion::ScaleFactor [protected]
 

Definition at line 901 of file rndrgn.h.

UINT32 RenderRegion::SelectedBlobSize = 3 [static, protected]
 

The number represents the size of the blobs on the control points of selected objects. The Selected Blob Size is the size of the blobs when they have been clicked on.

Preference: SelectedBlobSize Section: Selection Blob Sizes Range: 0 - 30

See also:
UnSelectedBlobSize

Definition at line 922 of file rndrgn.h.

struct RenderRegion::_StrokeFlags RenderRegion::StrokeFlags [protected]
 

BOOL RenderRegion::SubRenderStateLocked [protected]
 

Definition at line 899 of file rndrgn.h.

struct RenderRegion::_TextFlags RenderRegion::TextFlags [protected]
 

RenderStack RenderRegion::TheStack [protected]
 

Definition at line 935 of file rndrgn.h.

INT32 RenderRegion::Timeslice [protected]
 

Definition at line 916 of file rndrgn.h.

UINT32 RenderRegion::UnSelectedBlobSize = 2 [static, protected]
 

The number represents the size of the blobs on the control points of selected objects. The UnSelected Blob Size is the size of the blobs when the object is selected, but none of its control points have been clicked on (and are not themselves selected).

Preference: UnSelectedBlobSize Section: Selection Blob Sizes Range: 0 - 30

See also:
SelectedBlobSize

Definition at line 923 of file rndrgn.h.


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