PaperRenderRegion Class Reference

Provide a fast way of rendering paper. One of these regions is used to render paper on screen, to avoid any lag we might get from using a bitmap type render region (e.g. GRenderRegion). More...

#include <osrndrgn.h>

Inheritance diagram for PaperRenderRegion:

OSRenderRegion RenderRegion ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 PaperRenderRegion (DocRect ClipRect, Matrix ConvertMatrix, FIXED16 ViewScale)
 Construct a PaperRenderRegion - this is a simple derivation from OSRenderRegion's constructor.
 ~PaperRenderRegion ()
 Perform any closedown necessary for the paper render region.
BOOL AttachDevice (View *pView, Spread *pSpread, wxDC *pDC, Matrix &ViewMatrix, FIXED16 ViewScale, DocRect &ClipRect, bool fOwned=false)
 Change the device attached to the PaperRenderRegion.
void DetachDevice ()
 Detach the render region form its device. This is done so that we don't try to use the DC etc. after it has been deleted.
virtual BOOL InitDevice ()
 Initialise the device specific mechanisms for this render region.

Detailed Description

Provide a fast way of rendering paper. One of these regions is used to render paper on screen, to avoid any lag we might get from using a bitmap type render region (e.g. GRenderRegion).

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/06/94
See also:
OSRenderRegion; GRenderRegion; DocView

Definition at line 439 of file osrndrgn.h.


Constructor & Destructor Documentation

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

Construct a PaperRenderRegion - this is a simple derivation from OSRenderRegion's constructor.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/06/94
Parameters:
As OSRenderRegion's constructor. [INPUTS]
See also:
OSRenderRegion; OSRenderRegion::OSRenderRegion

Definition at line 7125 of file osrndrgn.cpp.

07126     : OSRenderRegion(ClipRect, ConvertMatrix, ViewScale)
07127 {
07128 }

PaperRenderRegion::~PaperRenderRegion  ) 
 

Perform any closedown necessary for the paper render region.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/06/94
See also:
OSRenderRegion

Definition at line 7142 of file osrndrgn.cpp.

07143 {
07144 }


Member Function Documentation

BOOL PaperRenderRegion::AttachDevice View pView,
Spread pSpread,
wxDC *  pDC,
Matrix ViewMatrix,
FIXED16  ViewScale,
DocRect ClipRect,
bool  fOwned = false
 

Change the device attached to the PaperRenderRegion.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/06/94
Parameters:
pView - the window to attach to. [INPUTS] pSpread - the spread to attach to. pDC - the device context to render into ViewMatrix - the matrix needed to render this spread into this DC. ViewScale - the scale of the view to be rendered. ClipRect - the clip rectangle of the region.
Returns:
TRUE if attached ok; FALSE if not.
See also:
OSRenderRegion::AttachDevice

Definition at line 7166 of file osrndrgn.cpp.

07169 {
07170     if (!OSRenderRegion::AttachDevice(pView, pDC, pSpread))
07171         return(FALSE);
07172 
07173     // Update basic rendering variables for new device.
07174     // (These are normally set up the the constructor).
07175     CurrentClipRect = ClipRect;
07176     RenderMatrix = ViewMatrix;
07177     ScaleFactor = ViewScale;
07178 
07179     // Make sure we get rid of all attributes at Detach time - see DetachDevice() below.
07180     SaveContext();
07181 
07182     // Call base class to attach device.
07183 //  return OSRenderRegion::AttachDevice(pView, pDC, pSpread);
07184     return(TRUE);
07185 }

void PaperRenderRegion::DetachDevice  ) 
 

Detach the render region form its device. This is done so that we don't try to use the DC etc. after it has been deleted.

Author:
Tim_Browse (Xara Group Ltd) <camelotdev@xara.com>
Date:
28/06/94
See also:
PaperRenderRegion::AttachDevice

Definition at line 7199 of file osrndrgn.cpp.

07200 {
07201     // Lose all the attributes on our rendering stack
07202     RestoreContext();
07203 
07204     // Lose our current attribute block.
07205     CCFree(CurrentAttrs);
07206     CurrentAttrs = NULL;
07207 
07208     // Make sure we don't try to use this device again.
07209     RenderDC = NULL;
07210     RenderView = NULL;
07211     RenderSpread = NULL;
07212     RenderFlags.ValidDevice = FALSE;        // make sure InitDevice is called subsequently
07213                                             // else GBrushes tend not to work
07214 }

BOOL PaperRenderRegion::InitDevice  )  [virtual]
 

Initialise the device specific mechanisms for this render region.

Author:
Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
Date:
17/5/95
Returns:
TRUE if the device context is initialised ok; FALSE if not.
Notes: We use a single static PaperRenderRegion to save creating one all the time. However, this means that the check to see if we should use the MainFrame window's palette only occurs once (in Create()), and unfortunately this means that we always have the palette disabled due to the point at which the original Create happens to occur in startup.

Thus, this InitDevice has been overridden to check if we should use a palette every* time the RndRgn is initialised for a redraw, so that it will use the palette in the same way as the render regions which are created when needed.

Returns:
Errors: Same as base class.
See also:
OSRenderRegion::InitDevice

Reimplemented from OSRenderRegion.

Definition at line 7244 of file osrndrgn.cpp.

07245 {
07246     // As we use a static PaperRenderRegion, it has to check every time we go to use it if
07247     // we should be using a palette - otherwise, we get the wrong idea when we're Create'd
07248     // and then we fail to use the palette forever onwards!
07249     RFlags.UsePalette = (WantGDIPalette && PaletteManager::UsePalette()) ? TRUE : FALSE;
07250 
07251     // Call base class
07252     if (!OSRenderRegion::InitDevice())
07253         return FALSE;
07254 
07255     // All ok
07256     return TRUE;
07257 }


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