#include <view.h>
Inheritance diagram for View:

Public Member Functions | |
| View () | |
| Initialise a View object. | |
| virtual | ~View () |
| Cleans up a view object. | |
| BOOL | ConnectToOilView (CCamView *) |
| To set up the bi-directional connection between the OIL view object and the View. The OIL view object causes the creation of the View and so already has a pointer to it when it calls this routine to set up the connection in the other direction. | |
| Document * | GetDoc () const |
| Returns the linake between this View and its Document. | |
| CCamView * | GetConnectionToOilView () const |
| To get a pointer to the OIL view object which mirrors this one. Note that this can return NULL if the View does not have a mirroring OIL object. In this case the view is closed but the View remains available so that in the future a new view will be able to use all of its viewing parameters. | |
| PrintControl * | GetPrintControl () |
| Simple way of getting the PrintControl object associated with this view's document. | |
| virtual void | SetViewState (ViewState *) |
| Sets the structure which is shared by both View and the OIL view object to which it is connected. NB. PrintViews do NOT share the ViewState with the OIL view, because the OIL view is the screen based view, so the PrintView is the only one that needs to use the view state. The CCamView always uses the ViewState of its DocView, not its PrintView. | |
| virtual BOOL | ViewStateChanged ()=0 |
| BOOL | SetCurrent () |
| Make this object be the 'current' View. | |
| virtual void | SetViewPixelSize ()=0 |
| void | OnDraw (wxDC *, OilRect) |
| Do the drawing, guv. | |
| virtual void | ContinueRenderView (RenderRegion *, Spread *, BOOL fRenderPaper=TRUE, BOOL fDeleteRegionAfter=TRUE, BOOL bForceImmediate=FALSE)=0 |
| virtual wxDC * | GetRenderDC ()=0 |
| virtual void | AllocateDC () |
| Hints that we've done with our DC. | |
| virtual void | DoneWithDC () |
| Hints that we've done with our DC. | |
| virtual BOOL | RenderTreeCallback (Node *pNode, RenderRegion *pRender) |
| RenderViewResult | RenderOptimalView (RenderRegion *r, Matrix &, Spread *, BOOL) |
| This function has been designed along similar lines to the RenderView() function found elsewhere in this file. This version of the function is slightly different though. This version of the function is able to render complex objects, such as transparent objects into normal render regions. It does this by first scanning through all the objects that need rendering to see if any of them require complex things. If they do, then part of the rendering is done into a bitmap and blitted over the rest of the shapes using a masked blit. All very complicated really! This is the optimal version of this function, that will render individual complex shapes to the device instead of building them all up and blitting them in one go. This will produce the best quality results as as many objects as possible will be rendered to the resolution of the device. | |
| SlowJobResult | RenderOptimalBitmapPhase (DocRect &ClipRect, Matrix &, Spread *, RenderRegion *, Node *, Node *, BOOL RenderAllObjects, BOOL bPrintPaper, INT32 &, ProgressDisplay *pProgress, INT32 TotalProgress) |
| Renders the masked bitmap part of the process. This function will get called many times during the typical rendering of the document (once for each run of complex nodes in the document). | |
| virtual RenderViewResult | RenderSimpleView (RenderRegion *, Matrix &, Spread *, BOOL) |
| This function has been designed along similar lines to the RenderView() function found elsewhere in this file. This version of the function is slightly different though. This version of the function is able to render complex objects, such as transparent objects into normal render regions. It does this by first scanning through all the objects that need rendering to see if any of them require complex things. If they do, then part of the rendering is done into a bitmap and blitted over the rest of the shapes using a masked blit. All very complicated really! | |
| SlowJobResult | RenderBitmapPhase (DocRect &ClipRect, Matrix &, Spread *, RenderRegion *, Node *, Node *, BOOL bRenderAll, BOOL bPrintPaper, ProgressDisplay &Progress) |
| This function is called from RenderSimpleView if it ends up having to do the 3 phase rendering system. This function performs the bitmap phase, where all the objects deemed to be complex by the Host render region are rendered into a bitmap using GDraw and a mono, mask bitmap. The bitmap is blitted into the host render region using the mask bitmap, minimising the amount of bitmaps ending up in the view (important for things like postscript that do not really like bitmaps very much). | |
| virtual void | RenderPaper (Spread *, DocRect, wxDC *, Matrix &) |
| Actually renders the paper onto the screen. Moved from 'MakeNewRenderRegion' so that it can be called from outside (eg. ResetRegion). | |
| virtual BOOL | RenderPageMarks (RenderRegion *, Matrix &, DocRect &, Spread *) |
| Performs the rendering of page marks, ie crop marks, registration marks etc to the screen and printer. This base class version does nothing. All mark rendering technology is held in DocView and PrintView. | |
| virtual BOOL | GetForeBackMode ()=0 |
| virtual void | SetForeBackMode (BOOL)=0 |
| virtual Matrix | ConstructRenderingMatrix (Spread *pSpread) |
| From the given spread, construct a matrix that will convert spread coordinates to OS coordinates. | |
| virtual Matrix | ConstructScaledRenderingMatrix (Spread *pSpread, double ScaleFactor) |
| Create a rendermatrix at ScaleFactor precision of the current Scale Allows you to create a bitmap with higher/lower resolution than the current view eg used to create a bitmap of a given invalid region at double the current zoom factor (ie synonymous concept to "double resolution" or "double DPI"). | |
| FIXED16 | GetPixelWidth () |
| Get the width of a pixel in this view. | |
| FIXED16 | GetPixelHeight () |
| Get the height of a pixel in this view. | |
| void | GetPixelSize (FIXED16 *PixelWidth, FIXED16 *PixelHeight) |
| Get the size of a pixel in this view. | |
| virtual void | SetPixelSize (FIXED16 PixelWidth, FIXED16 PixelHeight) |
| Set the size of a pixel in this view. | |
| FIXED16 | GetScaledPixelWidth () |
| Get the width of a scaled pixel in this view. | |
| FIXED16 | GetScaledPixelHeight () |
| Get the height of a scaled pixel in this view. | |
| void | GetScaledPixelSize (FIXED16 *PixelWidth, FIXED16 *PixelHeight) |
| Get the size of a scaled pixel in this view. | |
| virtual void | SetScaledPixelSize (FIXED16 PixelWidth, FIXED16 PixelHeight) |
| Set the size of a scaled pixel in this view. | |
| virtual double | GetConvertToEditableShapesDPI () |
| Allows derived view classes to override the reolution. | |
| ColourContext * | GetColourContext (ColourModel Model, BOOL ReturnNULLIfNone=FALSE) |
| To find an appropriate colour context in the given colour model for use when rendering into this view. This allows us to control colour separation and correction down to a per-view level. | |
| ColourPlate * | GetColourPlate (void) |
| To find out what colour separation options are currently in use by this view. | |
| void | SetColourPlate (ColourPlate *NewPlate, BOOL bSendContextChanged=TRUE) |
| Sets a new colour plate (colour separation description for this view. Any future requests for colour contexts for this view (e.g. the next time it is redrawn, etc) will return a ColourContext using this new ColourPlate. | |
| void | SetColourContext (ColourModel Model, ColourContext *NewContext=NULL) |
| Sets a new colour context for this view. | |
| BOOL | GetForceDefaultColourContexts (void) |
| BOOL | SetForceDefaultColourContexts (BOOL bForceDefault=TRUE) |
| WorkCoord | GetScrollOffsets () const |
| To find the position of the top left corner of the display. | |
| virtual BOOL | SetScrollOffsets (WorkCoord, BOOL RedrawNeeded=TRUE) |
| To scroll this view to a new position over the document. The coordinate supplied is the coordinate of the top left corner of the viewport onto the document. The RedrawNeeded flag is TRUE when any invalid areas created should be redrawn immediately and FALSE if they should be ignored. | |
| FIXED16 | GetViewScale () const |
| Inquire the viewing scale factor from this View. | |
| virtual BOOL | SetViewScale (FIXED16) |
| Set the viewing scale factor for this view. (Also, sets up the scaled pixel size in DocCoord if this View is current. | |
| virtual DocRect | GetDocViewRect (Spread *)=0 |
| virtual void | SetExtent (DocCoord, DocCoord)=0 |
| virtual WorkRect | GetViewRect ()=0 |
Static Public Member Functions | |
| static void | Deinit () |
| De-initialises the view system. At the moment this involves destroying our PaperRenderRegion. | |
| static View * | GetCurrent () |
| Find the current View object which SHOULD have been set as one of the very first actions during event processing. | |
| static void | SetNoCurrent () |
| Set the current View pointer to be NULL, i.e., there is no current View object. | |
| static void | DeInitOnTopRegion () |
| Deinitialises the static OnTop RenderRegion, used for blob rendering. | |
| static BOOL | IsPrintableNodeSelected (Node *) |
| Determine whether a given node should be rendered when we are printing with "selected objects only" enabled. It checks to see if the node is bounded - if it isn't, then it's an attribute or similar and so is always rendered. If it is bounded then return TRUE if it is selected or if it is the child of a selected object. Otherwise we return FALSE to indicate that it should not be printed. | |
Public Attributes | |
| Quality | RenderQuality |
Protected Member Functions | |
| virtual void | RenderPaper (RenderRegion *, Spread *) |
| To render the parts of a Document which are not rendered when printing. Ie. all the parts of the document that represent the paper on which the ink will be rendered. This function does not take any notice of the RenderControl object - it renders until it has finished so that at least the pages, pasteboard, etc. will be drawn when any region is invalidated. | |
| SlowJobResult | RenderSimpleNodes (Node *pNode, RenderRegion *pRender, ProgressDisplay &Progress, Node *pLastComplexNode=NULL) |
| Function to render nodes 'normally' during 3-pass rendering. This copes with stopping at the specified last complex node, and with only printing selected objects if the user has requested it. | |
| SlowJobResult | RenderSimpleNodesUnclipped (Node *pNode, RenderRegion *pRender, ProgressDisplay &Progress, Node *pLastComplexNode=NULL) |
| Function to render nodes 'normally' during 3-pass rendering. This copes with stopping at the specified last complex node, and with only printing selected objects if the user has requested it. | |
| RenderRegion * | NewRenderRegion (DocRect InvalidRect, Matrix &ViewMatrix, wxDC *pDevContext, Spread *pSpread, RenderType rType, bool fOwned=false) |
| virtual void | MakeNewRenderRegion (Spread *, DocRect, wxDC *, RenderType, BOOL PaintPaper=FALSE, Node *pInvalidNode=NULL) |
| Makes a new render region and adds it to the list associated with the DocView. Depending on the type of render region requested, it may be rendered to completion immediately (e.g. print regions are). Note that if PaintPaper is FALSE, pDevContext isn't used, so can be NULL. | |
Protected Attributes | |
| CCamView * | pViewWindow |
| Document * | pDoc |
| ViewState * | pVState |
| FIXED16 | PixelWidth |
| FIXED16 | PixelHeight |
| FIXED16 | ScaledPixelWidth |
| FIXED16 | ScaledPixelHeight |
| ColourPlate * | ColPlate |
| ColourContextArray | ColourContexts |
| BOOL | ShouldDeleteContext [16] |
| BOOL | ForceDefaultColourContexts |
| FIXED16 | Scale |
| DocRect | PhysExtent |
| BOOL | m_bSolidDrag |
Static Protected Attributes | |
| static View * | Current = NULL |
Private Member Functions | |
| CC_DECLARE_DYNAMIC (View) | |
Static Private Attributes | |
| static PaperRenderRegion * | pPaperRegion = NULL |
| static PaperRenderRegion * | pOnTopRegion = NULL |
Definition at line 228 of file view.h.
|
|
Initialise a View object.
Definition at line 180 of file view.cpp. 00181 { 00182 // No connections yet... 00183 pViewWindow = NULL; 00184 pDoc = NULL; 00185 pVState= NULL; 00186 00187 // Actual size of OIL pixels that this view uses - default to 96dpi. 00188 PixelWidth = PixelHeight = FIXED16(72000.0 / 96); 00189 00190 // Scaled size of OIL pixels that this view uses - default to scale of 100% 00191 ScaledPixelWidth = ScaledPixelHeight = PixelWidth; 00192 00193 // View scale factor - default to 100% 00194 Scale = 1.0; 00195 00196 // Initialise our ColourPlate and colour contexts to NULL pointers 00197 ForceDefaultColourContexts = FALSE; 00198 ColPlate = NULL; 00199 00200 for (INT32 i = 0; i < (INT32) MAX_COLOURMODELS; i++) 00201 { 00202 ColourContexts.Context[i] = NULL; 00203 ShouldDeleteContext[i] = TRUE; 00204 } 00205 00206 m_bSolidDrag = FALSE; 00207 }
|
|
|
Cleans up a view object.
Definition at line 222 of file view.cpp. 00223 { 00224 if (this == Current) 00225 SetNoCurrent(); 00226 00227 // Decommission all colour contexts that we own 00228 ColourContextList *cclist = ColourContextList::GetList(); 00229 ERROR3IF( cclist == NULL, "No ColourContextList? What's up?" ); 00230 00231 // Delete any old context we had in use (ignoring the ShouldDeleteContext flags) 00232 for (INT32 i = 0; i < (INT32) MAX_COLOURMODELS; i++) 00233 { 00234 if (ColourContexts.Context[i] != NULL) 00235 cclist->RemoveContext(&(ColourContexts.Context[i])); 00236 } 00237 00238 if (ColPlate != NULL) 00239 delete ColPlate; 00240 00241 if (pVState != NULL) 00242 { 00243 delete pVState; 00244 pVState=NULL; 00245 } 00246 }
|
|
|
Hints that we've done with our DC.
Definition at line 261 of file view.cpp. 00262 { 00263 if (pViewWindow) 00264 pViewWindow->AllocateDC(); 00265 }
|
|
|
|
|
|
To set up the bi-directional connection between the OIL view object and the View. The OIL view object causes the creation of the View and so already has a pointer to it when it calls this routine to set up the connection in the other direction.
Definition at line 323 of file view.cpp. 00324 { 00325 ERROR2IF(this==NULL,FALSE,"View member func called on NULL pointer"); 00326 00327 ERROR2IF(pViewWindow != NULL, FALSE, 00328 "View::ConnectToOilView called when connection already established"); 00329 00330 pViewWindow = pOilView; 00331 00332 return TRUE; 00333 }
|
|
|
From the given spread, construct a matrix that will convert spread coordinates to OS coordinates.
Reimplemented in ExpressView, and PrintView. Definition at line 1113 of file view.cpp. 01114 { 01115 // Get the PIXELISED origin of spread coordinates, in document coords 01116 DocCoord SpreadCoordOrigin = pSpread->GetSpreadCoordOrigin(TRUE, this); 01117 01118 // Convert it into logical Work Coords 01119 // NOTE: We convert this via the spread, because the Spread Coord Origin can now 01120 // lie *outside* the current chapter/spread pasteboard bounds, and so the version 01121 // of this call that takes a document pointer can't find the enclosing chapter! 01122 // Of course, we know the enclosing chapter, because this point is in a known spread! 01123 WorkCoord WorkCoordOffset = SpreadCoordOrigin.ToWork(pSpread, this); 01124 01125 // Offset it by the window scroll position 01126 WorkCoordOffset.x -= pVState->GetScrollPos().x; 01127 WorkCoordOffset.y -= pVState->GetScrollPos().y; 01128 01129 // Just in case the above hasn't work (the DocCoord conversion seems to produce some rounding 01130 // errors), Pixelize the offset 01131 WorkCoordOffset.Pixelise(72000.0/PixelWidth.MakeDouble(),72000.0/PixelHeight.MakeDouble()); 01132 01133 // Construct the transformation matrix for the spread. 01134 Matrix RenderMatrix; 01135 01136 // We can chop the 64bit values down to 32bit now, as we have them in the correct range 01137 Matrix TranslateToOrigin( (INT32)WorkCoordOffset.x, (INT32)WorkCoordOffset.y); 01138 01139 Matrix ScaleMat(Scale, Scale); 01140 01141 // The following matrix compositions MUST be performed in this order. 01142 // If you are tempted to optimise this code MAKE SURE THAT THEY ARE STILL 01143 // IN THIS ORDER WHEN YOU'VE FINISHED! 01144 01145 // Apply scale factors to convert from millipoint distances to pixel distances... 01146 RenderMatrix *= ScaleMat; 01147 01148 // Apply scroll-offset translation to move origin to viewing position... 01149 RenderMatrix *= TranslateToOrigin; 01150 01151 return RenderMatrix; 01152 }
|
|
||||||||||||
|
Create a rendermatrix at ScaleFactor precision of the current Scale Allows you to create a bitmap with higher/lower resolution than the current view eg used to create a bitmap of a given invalid region at double the current zoom factor (ie synonymous concept to "double resolution" or "double DPI").
Definition at line 1171 of file view.cpp. 01172 { 01173 // Get the PIXELISED origin of spread coordinates, in document coords 01174 DocCoord SpreadCoordOrigin = pSpread->GetSpreadCoordOrigin(TRUE, this); 01175 01176 // Convert it into logical Work Coords 01177 // NOTE: We convert this via the spread, because the Spread Coord Origin can now 01178 // lie *outside* the current chapter/spread pasteboard bounds, and so the version 01179 // of this call that takes a document pointer can't find the enclosing chapter! 01180 // Of course, we know the enclosing chapter, because this point is in a known spread! 01181 WorkCoord WorkCoordOffset = SpreadCoordOrigin.ToWork(pSpread, this); 01182 01183 // Offset it by the window scroll position 01184 WorkCoordOffset.x -= pVState->GetScrollPos().x; 01185 WorkCoordOffset.y -= pVState->GetScrollPos().y; 01186 01187 // Construct the transformation matrix for the spread. 01188 Matrix RenderMatrix; 01189 01190 // We can chop the 64bit values down to 32bit now, as we have them in the correct range 01191 Matrix TranslateToOrigin( (INT32)WorkCoordOffset.x, (INT32)WorkCoordOffset.y); 01192 01193 FIXED16 ScaledScale = Scale.MakeDouble() * ScaleFactor; 01194 Matrix ScaleMat(ScaledScale, ScaledScale); 01195 01196 // The following matrix compositions MUST be performed in this order. 01197 // If you are tempted to optimise this code MAKE SURE THAT THEY ARE STILL 01198 // IN THIS ORDER WHEN YOU'VE FINISHED! 01199 01200 // Apply scale factors to convert from millipoint distances to pixel distances... 01201 RenderMatrix *= ScaleMat; 01202 01203 // Apply scroll-offset translation to move origin to viewing position... 01204 RenderMatrix *= TranslateToOrigin; 01205 01206 return RenderMatrix; 01207 }
|
|
||||||||||||||||||||||||
|
Implemented in DocView, ExpressView, PrintView, XPFView, ClipboardView, DialogView, and MetafileView. |
|
|
De-initialises the view system. At the moment this involves destroying our PaperRenderRegion.
Definition at line 298 of file view.cpp. 00299 { 00300 // Lose our PaperRenderRegion... 00301 delete pPaperRegion; 00302 delete pOnTopRegion; 00303 }
|
|
|
Deinitialises the static OnTop RenderRegion, used for blob rendering.
Definition at line 568 of file view.cpp. 00569 { 00570 if (pOnTopRegion) 00571 pOnTopRegion->DetachDevice(); 00572 }
|
|
|
Hints that we've done with our DC.
Definition at line 280 of file view.cpp. 00281 { 00282 if (pViewWindow) 00283 pViewWindow->DoneWithDC(); 00284 }
|
|
||||||||||||
|
To find an appropriate colour context in the given colour model for use when rendering into this view. This allows us to control colour separation and correction down to a per-view level.
ONLY Use the returned pointer temporarily - If the view is deleted or if the ColourPlate options on the view are changed, the context will be deleted. You should thus always call this function to get the current Context - it's cached, and quick after the first call.
Definition at line 1407 of file view.cpp. 01408 { 01409 // If our internal flag is set, we will return a default global colour context 01410 // This allows View::RenderOptimalBitmapPhase to create RenderRegions which will 01411 // not colour spearate or correct (as we want to do the correction as a post process 01412 // on the produced bitmap) 01413 if (ForceDefaultColourContexts) 01414 return(ColourManager::GetColourContext(Model, pDoc)); 01415 01416 01417 // Under normal circumstances, if we have a special ColourPlate, we look in our 01418 // cache for an appropriate context. First, we'll make sure an appropriate context 01419 // is cached (We don't do this if the caller specified ReturnNULLIfNone) 01420 if (!ReturnNULLIfNone && ColourContexts.Context[Model] == NULL && ColPlate != NULL) 01421 { 01422 // It's not cached yet - create a new context of this type 01423 ColourContext *NewCC = NULL; 01424 01425 switch(Model) 01426 { 01427 case COLOURMODEL_RGBT: 01428 NewCC = new ColourContextRGBT(this); 01429 break; 01430 01431 case COLOURMODEL_CMYK: 01432 NewCC = new ColourContextCMYK(this); 01433 break; 01434 01435 default: 01436 ERROR3("View::GetColourContext only supports RGB/CMYK contexts at present"); 01437 break; 01438 } 01439 01440 if (NewCC != NULL) 01441 { 01442 // Copy our ColourPlate 01443 ColourPlate *NewPlate = new ColourPlate(*ColPlate); 01444 01445 if (NewPlate == NULL) 01446 { 01447 // Failure - delete the ColourContext and abandon the attempt 01448 delete NewCC; 01449 NewCC = NULL; 01450 } 01451 else 01452 { 01453 // Attach the ColourPlate to the context, add it into our cache of ColourContexts, 01454 // and add the new context to the context list 01455 NewCC->SetColourPlate(NewPlate); 01456 01457 ColourContextList *cclist = ColourContextList::GetList(); 01458 ERROR3IF(cclist == NULL, "No ColourContextList? What's up?"); 01459 01460 ColourContexts.Context[Model] = NewCC; 01461 cclist->AddContext(&(ColourContexts.Context[Model])); 01462 } 01463 } 01464 } 01465 01466 // See if we've got a cached context we can return 01467 ColourContext *cc = ColourContexts.Context[Model]; 01468 01469 // If we own our own colour context, then use it. Otherwise, find a suitable 01470 // context from our parent document; if that has none, then use a global default. 01471 // (We don't do this if the caller specified ReturnNULLIfNone) 01472 if (cc == NULL && !ReturnNULLIfNone) 01473 cc = ColourManager::GetColourContext(Model, pDoc); 01474 01475 return(cc); 01476 }
|
|
|
To find out what colour separation options are currently in use by this view.
Definition at line 1495 of file view.cpp. 01496 { 01497 return(ColPlate); 01498 }
|
|
|
To get a pointer to the OIL view object which mirrors this one. Note that this can return NULL if the View does not have a mirroring OIL object. In this case the view is closed but the View remains available so that in the future a new view will be able to use all of its viewing parameters.
Definition at line 350 of file view.cpp. 00351 { 00352 return pViewWindow; 00353 }
|
|
|
Allows derived view classes to override the reolution.
Reimplemented in XPFView. Definition at line 1343 of file view.cpp. 01344 { 01345 INT32 iPixPerInch = 0; 01346 if (!GetApplication()->GetConvertToEditableShapesDPI(&iPixPerInch)) 01347 { 01348 ERROR3("View::GetConvertToEditableShapesDPI; Couldn't get app's dpi"); 01349 iPixPerInch = 96; 01350 } 01351 01352 return(iPixPerInch); 01353 }
|
|
|
Find the current View object which SHOULD have been set as one of the very first actions during event processing.
Reimplemented in DocView. Definition at line 386 of file view.cpp. 00387 { 00388 #ifdef RALPH 00389 if(::GetCurrentThreadId() == RalphDocument::GetImportingThreadID()) 00390 { 00391 return RalphDocument::GetImportingDoc()->GetFirstDocView(); 00392 } 00393 #endif 00394 00395 return Current; 00396 }
|
|
|
Returns the linake between this View and its Document.
Definition at line 368 of file view.cpp. 00369 { 00370 return pDoc; 00371 }
|
|
|
Implemented in DocView, ExpressView, PrintView, XPFView, ClipboardView, DialogView, and MetafileView. |
|
|
Definition at line 374 of file view.h. 00374 { return(ForceDefaultColourContexts); }
|
|
|
Implemented in DocView, ExpressView, PrintView, XPFView, ClipboardView, DialogView, and MetafileView. |
|
|
Get the height of a pixel in this view.
Definition at line 1238 of file view.cpp. 01239 { 01240 return PixelHeight; 01241 }
|
|
||||||||||||
|
Get the size of a pixel in this view.
Definition at line 1254 of file view.cpp. 01255 { 01256 *pPixelWidth = PixelWidth; 01257 *pPixelHeight = PixelHeight; 01258 }
|
|
|
Get the width of a pixel in this view.
Definition at line 1221 of file view.cpp. 01222 { 01223 return PixelWidth; 01224 }
|
|
|
Simple way of getting the PrintControl object associated with this view's document.
Definition at line 4172 of file view.cpp. 04173 { 04174 #ifndef STANDALONE 04175 04176 if (pDoc == NULL) 04177 // This view is not attached to a document (e.g. it's a DialogView) 04178 return NULL; 04179 04180 // Find print control object for this document, to see if we are 04181 // printing via bitmap, and so if we need to band the output. 04182 PrintComponent *pPrintComponent = (PrintComponent *) 04183 pDoc->GetDocComponent(CC_RUNTIME_CLASS(PrintComponent)); 04184 ERROR2IF(pPrintComponent == NULL, NULL, 04185 "Unable to find PrintComponent object in document."); 04186 04187 PrintControl *pPrintControl = pPrintComponent->GetPrintControl(); 04188 ERROR2IF(pPrintControl == NULL, NULL, 04189 "Unable to find PrintControl object in document component."); 04190 04191 return pPrintControl; 04192 04193 #else 04194 return NULL; 04195 #endif 04196 }
|
|
|
Implemented in DocView, ExpressView, PrintView, XPFView, ClipboardView, DialogView, and MetafileView. |
|
|
Get the height of a scaled pixel in this view.
Definition at line 1307 of file view.cpp. 01308 { 01309 return ScaledPixelHeight; 01310 }
|
|
||||||||||||
|
Get the size of a scaled pixel in this view.
Definition at line 1323 of file view.cpp. 01324 { 01325 *pScaledPixelWidth = ScaledPixelWidth; 01326 *pScaledPixelHeight = ScaledPixelHeight; 01327 }
|
|
|
Get the width of a scaled pixel in this view.
Definition at line 1290 of file view.cpp. 01291 { 01292 return ScaledPixelWidth; 01293 }
|
|
|
To find the position of the top left corner of the display.
Definition at line 1038 of file view.cpp. 01039 { 01040 ERROR2IF(this==NULL,WorkCoord(0,0),"View member func called on NULL pointer"); 01041 01042 return pVState->GetScrollPos(); 01043 }
|
|
|
Implemented in DocView, ExpressView, PrintView, XPFView, ClipboardView, DialogView, and MetafileView. |
|
|
Inquire the viewing scale factor from this View.
Definition at line 1091 of file view.cpp. 01092 { 01093 return Scale; 01094 }
|
|
|
Determine whether a given node should be rendered when we are printing with "selected objects only" enabled. It checks to see if the node is bounded - if it isn't, then it's an attribute or similar and so is always rendered. If it is bounded then return TRUE if it is selected or if it is the child of a selected object. Otherwise we return FALSE to indicate that it should not be printed.
Definition at line 2228 of file view.cpp. 02229 { 02230 if (pNode->IsBounded()) 02231 { 02232 // We must check the selected status of this node. 02233 // Even if this node is not selected, its parent might be, so we 02234 // scan upwards until we find a layer, or a selected node. 02235 Node *pTestNode = pNode; 02236 while ((pTestNode != NULL) && 02237 (!pTestNode->IsSelected()) && 02238 (!pTestNode->IsLayer())) 02239 { 02240 pTestNode = pTestNode->FindParent(); 02241 } 02242 02243 // If we failed to find a parent at some point then it can't possibly be selected 02244 if (pTestNode == NULL) 02245 return(FALSE); 02246 02247 // If it is selected then we'd better print this node 02248 if (pTestNode->IsSelected()) 02249 return(TRUE); 02250 02251 // If the original node is a shadow then we should test the right sibling 02252 // and print this node if that is selected 02253 if (pNode->IsAShadow()) 02254 { 02255 Node* pRightSibling = pNode->FindNext(); 02256 if (pRightSibling && pRightSibling->IsSelected()) 02257 return(TRUE); 02258 } 02259 02260 // Fall back to not printing this node 02261 return(FALSE); 02262 02263 // Ok, what did we find? 02264 // return ((pTestNode != NULL) && pTestNode->IsSelected()); 02265 } 02266 else 02267 { 02268 // It is a non-bounded node such as an attribute so we render it always. 02269 return TRUE; 02270 } 02271 }
|
|
||||||||||||||||||||||||||||
|
Makes a new render region and adds it to the list associated with the DocView. Depending on the type of render region requested, it may be rendered to completion immediately (e.g. print regions are). Note that if PaintPaper is FALSE, pDevContext isn't used, so can be NULL.
Reimplemented in PrintView. Definition at line 598 of file view.cpp. 00600 { 00601 // Construct the transformation matrix for the spread. 00602 Matrix RenderMatrix = ConstructRenderingMatrix(pSpread); 00603 00604 // Go and create the new render region 00605 |