grndrgn.h

Go to the documentation of this file.
00001 // $Id: grndrgn.h 1361 2006-06-25 16:43:38Z alex $
00002 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
00003 ================================XARAHEADERSTART===========================
00004  
00005                Xara LX, a vector drawing and manipulation program.
00006                     Copyright (C) 1993-2006 Xara Group Ltd.
00007        Copyright on certain contributions may be held in joint with their
00008               respective authors. See AUTHORS file for details.
00009 
00010 LICENSE TO USE AND MODIFY SOFTWARE
00011 ----------------------------------
00012 
00013 This file is part of Xara LX.
00014 
00015 Xara LX is free software; you can redistribute it and/or modify it
00016 under the terms of the GNU General Public License version 2 as published
00017 by the Free Software Foundation.
00018 
00019 Xara LX and its component source files are distributed in the hope
00020 that it will be useful, but WITHOUT ANY WARRANTY; without even the
00021 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00022 See the GNU General Public License for more details.
00023 
00024 You should have received a copy of the GNU General Public License along
00025 with Xara LX (see the file GPL in the root directory of the
00026 distribution); if not, write to the Free Software Foundation, Inc., 51
00027 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00028 
00029 
00030 ADDITIONAL RIGHTS
00031 -----------------
00032 
00033 Conditional upon your continuing compliance with the GNU General Public
00034 License described above, Xara Group Ltd grants to you certain additional
00035 rights. 
00036 
00037 The additional rights are to use, modify, and distribute the software
00038 together with the wxWidgets library, the wxXtra library, and the "CDraw"
00039 library and any other such library that any version of Xara LX relased
00040 by Xara Group Ltd requires in order to compile and execute, including
00041 the static linking of that library to XaraLX. In the case of the
00042 "CDraw" library, you may satisfy obligation under the GNU General Public
00043 License to provide source code by providing a binary copy of the library
00044 concerned and a copy of the license accompanying it.
00045 
00046 Nothing in this section restricts any of the rights you have under
00047 the GNU General Public License.
00048 
00049 
00050 SCOPE OF LICENSE
00051 ----------------
00052 
00053 This license applies to this program (XaraLX) and its constituent source
00054 files only, and does not necessarily apply to other Xara products which may
00055 in part share the same code base, and are subject to their own licensing
00056 terms.
00057 
00058 This license does not apply to files in the wxXtra directory, which
00059 are built into a separate library, and are subject to the wxWindows
00060 license contained within that directory in the file "WXXTRA-LICENSE".
00061 
00062 This license does not apply to the binary libraries (if any) within
00063 the "libs" directory, which are subject to a separate license contained
00064 within that directory in the file "LIBS-LICENSE".
00065 
00066 
00067 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS
00068 ----------------------------------------------
00069 
00070 Subject to the terms of the GNU Public License (see above), you are
00071 free to do whatever you like with your modifications. However, you may
00072 (at your option) wish contribute them to Xara's source tree. You can
00073 find details of how to do this at:
00074   http://www.xaraxtreme.org/developers/
00075 
00076 Prior to contributing your modifications, you will need to complete our
00077 contributor agreement. This can be found at:
00078   http://www.xaraxtreme.org/developers/contribute/
00079 
00080 Please note that Xara will not accept modifications which modify any of
00081 the text between the start and end of this header (marked
00082 XARAHEADERSTART and XARAHEADEREND).
00083 
00084 
00085 MARKS
00086 -----
00087 
00088 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
00089 designs are registered or unregistered trademarks, design-marks, and/or
00090 service marks of Xara Group Ltd. All rights in these marks are reserved.
00091 
00092 
00093       Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK.
00094                         http://www.xara.com/
00095 
00096 =================================XARAHEADEREND============================
00097  */
00098 
00099 // GRNDRGN.H
00100 //
00101 // Created: 29/6/93 by Will
00102 //
00103 
00104 #ifndef INC_GRNDRGN
00105 #define INC_GRNDRGN
00106 
00107 //#include "rndrgn.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00108 //#include "rendtype.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00109 //#include "winrect.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00110 //#include "ops.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00111 //#include "paths.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00112 #include "gdrawcon.h"
00113 //#include "monotime.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00114 #include "GDrawIntf.h"
00115 //#include "rrcaps.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00116 
00117 class GradFillAttribute;
00118 class BitmapFillAttribute;
00119 class BitmapTranspFillAttribute;
00120 class KernelBitmap;
00121 class TranspGradTable;
00122 class OffscreenAttrValue;
00123 class ClipRegionAttribute;
00124 class CaptureManager;
00125 class Capture;
00126 
00127 enum BitmapConvertHint;
00128 
00129 typedef struct {
00130     WORD palVersion;
00131     WORD palNumEntries;
00132     PALETTEENTRY palPalEntry[256];
00133 } RealLogPalette;
00134 
00135 typedef CMapPtrToPtr ClipRegionMap;
00136 typedef CMapPtrToPtr ClipRectMap;
00137 
00138 #define USE_wxBITMAP 0
00139 
00140 /********************************************************************************************
00141 
00142 >   class GRenderRegion : public RenderRegion
00143 
00144     Author:     Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
00145     Created:    11/5/93
00146     Purpose:    Encapsulates rendering using Gavins routines (ie. into a bitmap).
00147                 This object is created when something needs rendering using Gavins routines
00148                 eg. When anti-aliasing.  
00149                 See RenderRegion notes for more general details of this class. This is an
00150                 abstract class - see GRenderDIB or GRenderDDB for implementations.
00151 
00152 ********************************************************************************************/
00153 
00154 class GRenderRegion : public RenderRegion
00155 {
00156     CC_DECLARE_DYNAMIC( GRenderRegion )
00157 
00158     friend class GBrush;                            // so it can get to our vars etc
00159     friend class OpGDraw;
00160 //  friend class OpGFPU;
00161     friend class GRenderRegionWrapper;
00162     friend class ConcurrentRenderer;
00163     friend class GDrawBorrower;
00164 
00165 public:
00166 
00167     GRenderRegion();                                // do NOT use
00168     GRenderRegion(DocRect ClipRegion, Matrix ConvertMatrix, FIXED16 ViewScale, UINT32 Depth, double dpi);
00169     virtual ~GRenderRegion();
00170 
00171     static BOOL Init();
00172 
00173     // these are the virtual fns we need to instantiate a class
00174     virtual BOOL CopyRenderInfo( const RenderRegion &Other);
00175     virtual BOOL AttachDevice(View*, wxDC *, Spread* = NULL, bool fOwned = false );
00176     virtual BOOL InitDevice();
00177         
00178     BOOL StartRender();
00179     BOOL StopRender();
00180     virtual void SetClean(BOOL bResetChangedBounds, BOOL FillWhite);
00181     virtual BOOL IsClean() {return !HaveRenderedSomething;}
00182 
00183     void DrawPathToOutputDevice(Path* PathToDraw, PathShape shapePath=PATHSHAPE_PATH);
00184     void DrawRect(DocRect *RectToRender);
00185     void DrawDragRect(DocRect *RectToRender);
00186     void DrawLine(const DocCoord &StartPoint, const DocCoord &EndPoint);
00187     void DrawBlob(DocCoord p, BlobType type);
00188     void DrawPixel(const DocCoord &Point);
00189     void DrawCross(const DocCoord &Point, const UINT32 Size);
00190 
00191     void DrawBitmap(const DocCoord &Point, KernelBitmap* pBitmap);
00192     void DrawBitmap(const DocCoord &Point, UINT32 BitmapID, UINT32 ToolID = NULL);
00193     void DrawBitmap(const DocRect& rect, KernelBitmap* pBitmap);
00194     
00195     void DrawBitmapBlob(const DocCoord &Point, KernelBitmap* BlobShape) {}
00196     void DrawBitmapBlob(const DocCoord &Point, ResourceID resID ) {}
00197 
00198     void DrawFixedSystemText(StringBase *TheText, DocRect &BoundsRect, UINT32 uFormat = DEFAULT_TEXT_FORMATTING);
00199     void SetFixedSystemTextColours(DocColour *TextCol, DocColour *Background);
00200     void GetFixedSystemTextSize(StringBase *TheText, DocRect *BoundsRect, double* atDpi = NULL);
00201 
00202     void InitClipping();
00203     void InitAttributes();
00204     void SetLineAttributes();
00205     void SetFillAttributes();
00206     void SetOSDrawingMode();
00207     void SetQualityLevel();
00208 
00209     void Restore(RenderRegion*);
00210 
00211     BOOL RenderGradFillPath(Path *, GradFillAttribute* );
00212 
00213     BOOL RenderBitmapFill  (Path *, BitmapFillAttribute* );
00214 
00215     virtual void SetSolidColours(BOOL SetSolid);
00216 
00217     //static public functions
00218     static RenderRegion* Create(DocRect ClipRegion, Matrix ConvertMatrix, FIXED16 ViewScale,
00219                                 RenderType, View* pView = NULL, BOOL bForce32BPP = FALSE);
00220     static BOOL Init(BOOL);
00221     static void DeInit();
00222     static BOOL CalcBlitMode( INT32 Wanted );
00223 
00224     GDrawContext *GetDrawContext() const
00225     {
00226         return GD;
00227     };
00228 
00229     static GDrawContext* SetTempDrawContext(GDrawContext* pContext)
00230     {
00231         // Bad things will happen if we set this to NULL
00232         if (pContext == NULL)
00233         {
00234             TRACEUSER( "Gerry", _T("******** Trying to set a NULL GDrawContext\n") );
00235             pContext = pRealGD;
00236         }
00237         
00238         GDrawContext* pOldCon = GD;
00239         GD = pContext;
00240 //      TRACEUSER( "Gerry", _T("GDraw context set to 0x%08x (prev = 0x%08x)\n"), GD, pOldCon);
00241         return(pOldCon);
00242     };
00243 
00244     static GDrawContext *GetStaticDrawContext()
00245     {
00246 #ifdef RALPH
00247         if (GDrawAsm::GetContextForCurrentThread() != NULL)
00248             return(GDrawAsm::GetContextForCurrentThread());
00249 #endif
00250 
00251         return GD;
00252     };
00253 
00254     static GDrawContext *GetStaticDrawContext(INT32 DitherType)
00255     {
00256 #ifdef RALPH
00257         if (GDrawAsm::GetContextForCurrentThread() != NULL)
00258             return(GDrawAsm::GetContextForCurrentThread());
00259 #endif
00260 
00261         if ((DitherType == 0) || (DitherType == 3))
00262             return(ErrorDiffContext);
00263         else
00264             return(GD);
00265     }
00266 
00267     static INT32 GetDefaultTransparency() { return WhichTransparency; }
00268 
00269     static UINT32 SetPaletteEntries( LPBITMAPINFO lpBmi, wxDC* pOutputDC = NULL );
00270 
00271     // Used to calculate the size of the render region required
00272     virtual WinRect CalculateWinRect( Matrix& RenderMatrix, const DocRect& docrect,
00273                                       const double dpi);
00274     // let's non-renderregion code determine pixel dimensions of bounding boxes
00275     virtual WinRect CalculateWinRect( const DocRect& docrect);
00276 
00277     void SetDeepDIB(BOOL Value);
00278 
00279     // SMFIX
00280     // call to get the 32bit bitmap just to read it with no conversion going on
00281     // used when gathering stats for the palette
00282     const RGBQUAD* Get32BitRGBQuadData(){ return (RGBQUAD*)pBits;}
00283     UINT32 GetSizeOfRGBQuadData() { return pBitmapInfo ? pBitmapInfo->bmiHeader.biWidth * pBitmapInfo->bmiHeader.biHeight : 0; }
00284 
00285     void SetDoCompression(BOOL bDoCompression) { m_DoCompression = bDoCompression; }
00286 
00287     void SetDoBitmapConversion(BOOL bEnable) { m_bEnableConversion = bEnable; }
00288 
00289     DocRect GetChangedRect();
00290 
00291     void SetBitmapPointers(LPBITMAPINFO bi, LPBYTE by);
00292     BOOL GetBitmapPointers(LPBITMAPINFO* ppInfo, LPBYTE* ppBits, BOOL bCorrectTransparency = TRUE);
00293 
00294 protected:
00295 
00296     static GDrawContext *pRealGD;                       // ptr to GDraw we want to use
00297     static GDrawContext *GD;                            // ptr to GDraw we want to use
00298     static GDrawContext *ErrorDiffContext;              // ptr to special context for error diffusion
00299 
00300     GMATRIX CurrentGMatrix;
00301 
00302     GMATRIX SetGavinMatrix(GMATRIX* GMatrix);
00303     virtual GMATRIX MakeGavinMatrix(Matrix NewRenderMatrix, DocRect ClipRect, double PixelsPerInch, BOOL bMasterCapture);
00304     virtual double GetPixelsPerInch() {return PixelsPerInch;}
00305 
00306     MILLIPOINT CalcPixelWidth();
00307     double CalcPixelWidthDouble();
00308     MILLIPOINT CalcScaledPixelWidth();
00309     double CalcScaledPixelWidthDouble();
00310 
00311     RRCaps Caps;
00312 
00313 public:
00314     double GetScaledPixelWidthDouble();
00315     void SetSimulatePrinting(UINT32 PrintType);
00316     virtual void GetRenderRegionCaps(RRCaps* pCaps);
00317 
00318     // Function to draw a bitmap into the render region using a mask, and
00319     // and equivalent function to do the same, only colour separating it as it goes
00320     // The Separated version is called by this one if colour seps are enabled
00321     virtual SlowJobResult DrawMaskedBitmap(const DocRect &Rect, KernelBitmap* pBitmap, 
00322                                            MaskedRenderRegion* pMask, ProgressDisplay *Progress);
00323 protected:
00324     BOOL GetTransparencyFill(TranspGradTable*, DWORD*);
00325 
00326     virtual BOOL DrawArrowHead(ArrowRec &ArrowToDraw, DocCoord &Centre, DocCoord &Direction);
00327 
00328     BOOL SetBitmapTransparencyFill(TranspFillAttribute*, DWORD*, TranspGradTable*);
00329 
00330 //  LPBYTE m_pTempTransparencyBMPBits;  // member variable that may get set up in SetBitmapTransparencyFill and needs freeing later
00331                                         // GAT: Never used.
00332 
00333     BOOL SetFractalFill(ColourFillAttribute*, DWORD*);
00334     BOOL SetFractalTransparencyFill(TranspFillAttribute*, DWORD*);
00335 
00336     // these are pure virtual fns that must be instantiated in all derived classes,
00337     // together with the multiple paramter constructor and destructor.
00338     virtual LPBITMAPINFO GetLPBits( INT32 Width, INT32 Height, INT32 Depth, LPBYTE*) = 0;
00339     virtual void FreeLPBits( LPBITMAPINFO, LPBYTE ) = 0;
00340     virtual BOOL DisplayBits(LPBITMAPINFO lpDisplayBitmapInfo = NULL, LPBYTE lpDisplayBits = NULL) = 0;
00341     
00342     // this isn't pure, but is needed by some inherited classes
00343     virtual void InitBmpBits();                 // added by Ilan.
00344     virtual BOOL StartRenderAfter(GMATRIX*);
00345     virtual BOOL StartRenderMiddle();
00346     virtual void DisplayCurrentState();
00347 
00348     // these are the member variables
00349     LPBITMAPINFO pBitmapInfo;                           // ptr to BITMAPINFO
00350     LPBYTE pBits;                                       // ptr to actual bytes (or NULL)
00351 //  INT32 uBitmapSize;                                  // size of above
00352     UINT32 uBitmapDepth;                                    // in bits/pixel
00353     UINT32 uLineSize;
00354 
00355 #if USE_wxBITMAP
00356     wxBitmap* pBitmap;
00357     wxAlphaPixelData* pBitmapData;                      // Used to obtain and maintain lpBits.
00358 
00359     LPBITMAPINFO AllocWxBitmap( UINT32 Width, UINT32 Height, UINT32 Depth );
00360     void FreeWxBitmap();
00361 #endif
00362 
00363     wxRect WRect;                                       // its position in the owner window
00364     wxRect ScreenRect;                                  // its position in the whole screen bitmap
00365 
00366     double PixelsPerInch;                               // resolution of bitmap
00367     double dScaledPixelWidth;                           // accurate size of pixel with view zoom factored in
00368  
00369     wxPalette* hPalette;                                // palette used to render (or NULL)
00370     wxPalette* hPrevPalette;                            // original (previous) palette
00371 
00372     BOOL LocalBitmap;                                   // TRUE if this bitmap is a little one,
00373                                                         // FALSE if its a chunk of ScreenBitmap
00374     BOOL UseSolidColours;
00375 
00376     BOOL m_bForceBitmapSmoothing;                       // TRUE to enforce smoothing of all rendered bitmaps
00377                                                         // ; req'd by shadowing framework.
00378     BOOL m_bEnableConversion;
00379     BOOL ForceInitBmpBits;                              // Set when in-place conversion of RGBA bitmap invalidates it
00380 
00381     INT32 DitherStyle8Bit;                              // DitherStyle for 8 bit rendering
00382 
00383     BOOL HaveRenderedSomething;                         // TRUE if drawing has occurred
00384 
00385     UINT32 m_ForcePrintingCaps;
00386 
00387     void Display1to1Bitmap();
00388     void DisplayLtoHBitmap();
00389     void DisplayHto8Bitmap();
00390 
00391     void PlotBitmap( UINT32 ColourFlag );
00392     void PlotBitmap( wxDC *pDC, UINT32 ColourFlag, INT32 Left, INT32 Top, UINT32 Width, UINT32 Height, wxPalette* hPal, INT32, INT32 );
00393 public:
00394     static LPBYTE StaticPlotBitmap( wxDC *pDC, UINT32 ColourFlag, LPBITMAPINFO lpBitmapInfo, LPBYTE lpBits, INT32 Left, INT32 Top, UINT32 Width, UINT32 Height, wxPalette* hPal, INT32, INT32 );
00395 protected:
00396 //  KernelBitmap* FractalBitmap;        // GAT: Never used.
00397 
00398     // Limit of transparency in hit-detect pixels before pixel will be ignored
00399     static UINT32 ClickTranspLimit;
00400 
00401     // Whether to use high-quality anti-aliasing or not
00402     static BOOL HighQualityAA;
00403 
00404     // Bitmap conversion algorithm for show printer colours
00405     static INT32 BitmapConversion;
00406 
00407 public:
00408     // Allows you to override the normal checks which are made when deciding
00409     // whether to smooth a bitmap or not; if we're rendering at full quality
00410     // and the bitmap will let us, then we _will_ render it with smoothing.
00411     void SetForceBitmapSmoothing(BOOL ForceSmoothing) { m_bForceBitmapSmoothing = ForceSmoothing; }
00412     BOOL IsForcingBitmapSmoothing() { return m_bForceBitmapSmoothing; }
00413 
00414 private:
00415     BOOL SetGCol( DocColour& ) const;
00416     BOOL SetFillGCol( DocColour& ) const;
00417 
00418     DocCoord DocCoordToG(const DocCoord& DocPoint);
00419     void DocCoordToG( DocCoord *DocPoint );
00420     BOOL StrokePath( const DocCoord *, const PathVerb*, UINT32,
00421                      const DocCoord *, const PathVerb*, UINT32, BOOL DrawArrows = FALSE);
00422 
00423 
00424 protected:
00425     // don't make these into bitfields, as they get setup by the preferences code which
00426     // won't be able to cope
00427     static BOOL WantDoGDraw;                                        // TRUE if user wants it
00428     static UINT32 WantGDrawDepth;                                       // desired depth of off-screen bitmap
00429 //  static BOOL WantNoPalette;                                      // TRUE if palette switching not wanted
00430 //  static UINT32 WantBlitMode;                                     // 0=auto, 1=Stretch, 2=SetDIB, 3=BitBlt
00431     static BOOL WantHighColourDirect;                               // TRUE if deep sprite plots directly
00432     static BOOL WantDeepGDraw;                                      // TRUE for 32-bit bitmaps
00433 //  static BOOL WantWinG;                                           // TRUE to use WinG if poss
00434     static INT32  WhichPalette;
00435     static INT32  WhichDither;
00436     static INT32  WhichTransparency;
00437     static INT32  ViewDither;                                           // GDraw dither style used for Views
00438 
00439     static BOOL CanDoGDraw;                                         // TRUE if it is physically permitted
00440                                                                     // GAT: Set if GDraw initialises OK.
00441     static BOOL CanDoPalIndices;                                    // TRUE if GDI does DIB_PAL_INDICES
00442     static BOOL CanSetPalette;                                      // TRUE if screen has palette support
00443 //  static BOOL CanDoDeepDIBs;
00444 
00445     static INT32 ScreenDepth;                                           // in bits/pixel
00446     static INT32 ScreenWidth;                                           // in pixels
00447     static INT32 ScreenHeight;                                      // in pixels
00448     static INT32 LogPixelsX;
00449     static INT32 LogPixelsY;
00450 
00451 //GAT - Not used
00452 //  static LPBITMAPINFO ScreenBitmap;                               // NULL if none
00453 //  static LPBYTE ScreenBits;                                       // bitmap memory for above
00454 
00455     static LPRGBQUAD Fixed256Palette;                               // NULL if not fixed palette (256 cols only)
00456 //  static BOOL RealFPU;
00457     static BitmapConvertHint ScreenHinting;                         // used for hinting bitmap conversion
00458 
00459     static INT32 LastPaletteFlag;                                   // last value passed to GDraw_SelectPalette
00460 
00461     static RealLogPalette ErrorDiffPalette;                         // static LOGPALETTE structure for error diffusion
00462 
00463 protected:
00464     static void UpdateErrorDiffPalette(void);
00465 
00466 public:
00467 //  static INT32 MaxGMemory;                                            // largest allocation allowed (0=no limit)
00468 //  static UINT32 MaxGMemoryInK;                                        // the above in Kbytes
00469 //  static INT32 FreeGMemory;                                       // how much left to allocate
00470 
00471 
00472 public:
00473     static const LOGPALETTE* GetRecommendedPalette();
00474 //  static void PlotBitmap( wxDC *pDC, UINT32 ColourFlag, LPBITMAPINFO lpBitmapInfo, LPBYTE lpBits, INT32 Left, INT32 Top, INT32 Width, INT32 Height, wxPalette* hPal, INT32, INT32 );
00475     static BOOL StrokePathAvailable();
00476     static INT32 StrokePathToPath(
00477         CONST DocCoord *IPoints,
00478         CONST BYTE FAR *ITypes,
00479         size_t ILength,
00480         DocCoord *OPoints,
00481         BYTE  *OTypes,
00482         DWORD OLength,
00483         BOOL Close,
00484         DWORD LineWidth,
00485         DWORD Flattening,
00486         LineCapType LineCaps,
00487         JointType LineJoin,
00488         CONST DashType *Dash);
00489     static void GColInit( wxDC *, BOOL = FALSE );
00490     static void PaletteHasChanged();
00491     static void EnsurePalette(INT32 PaletteFlag);
00492     static LPLOGPALETTE GetErrorDiffPalette(void)
00493     {
00494         return((LPLOGPALETTE)&ErrorDiffPalette);
00495     };
00496     
00497     static void SetViewDither(INT32 dither){ViewDither = dither;};
00498 
00499     static DWORD GetMaxBitmapWidth(void);
00500     static DWORD GetMaxBitmapDepth(void);
00501     static INT32 GetDefaultDPI()
00502     {
00503         return LogPixelsX;
00504     };
00505 
00506 public:
00507     void SetDitherStyle8Bit(INT32 DitherStyle)
00508     {
00509         DitherStyle8Bit = DitherStyle;
00510     };
00511 
00512     // banding and mergeing with offscreen rendering system
00513     virtual void ResetRegion(DocRect &NewClipRect);
00514 
00515 public:
00516     void FreeOffscreenState();
00517 
00518 public:
00519     virtual void SetOffscreen(OffscreenAttrValue*);
00520     virtual void RestoreOffscreen(OffscreenAttrValue*);
00521     BOOL RenderBitmapWithTransparency(
00522                     Path*,
00523                     BitmapFillAttribute*,
00524                     BitmapTranspFillAttribute*
00525                 );
00526     virtual BOOL IsWrappedRender() const {return IsWrapped;}
00527     virtual BOOL TranspTypeIsRGBTCompatible(UINT32 ttype) const;    // Should be TranspType ttype
00528     TransparencyEnum MapTranspTypeToGDraw(UINT32 ttype, BOOL bGraduated) const;
00529 
00530 
00532     //
00533     // New Capture system
00534     //
00535 public:
00536     virtual Capture* StartCapture(CCObject* pOwner,
00537                               DocRect CaptureRect,
00538                               CAPTUREINFO cinfo,
00539                               BOOL bTransparent = TRUE,
00540                               BOOL bCaptureBackground = FALSE,
00541                               double mpPixelWidth = 0,
00542                               NodeRenderableInk* pDirectSupplier = NULL
00543                               );
00544     virtual BOOL StopCapture(CCObject* pOwner,
00545                              BOOL bRender = TRUE,
00546                              BOOL bReleaseBitmap = FALSE,
00547                              LPBITMAPINFO* plpBitmapInfo = NULL,
00548                              LPBYTE* plpBits = NULL,
00549                              DocRect* pCaptureRect = NULL,
00550                              Matrix* pmatTransform = NULL,
00551                              double* pdResolution = NULL
00552                              );
00553     virtual BOOL ChangeCapture(CAPTUREINFO cinfo,
00554                               BOOL bTransparent = TRUE,
00555                               BOOL bCaptureBackground = FALSE
00556                              );
00557 //  virtual INT32 GetCaptureDepth()             {return m_CaptureStack.Size();}
00558     virtual BOOL MasterCaptureIsCurrent() const {return (!m_CaptureStack.Empty() && GetTopCaptureBitmap() && GetTopCaptureBitmap()->IsMaster());}
00559 //  virtual Capture* GetTopCapture() const      {return m_CaptureStack.Empty() ? NULL : m_CaptureStack.Top();}
00560 //  virtual Capture* GetMasterCapture() const   {return m_CaptureStack.Empty() ? NULL : m_CaptureStack.Bottom();}
00561     virtual BOOL RenderCurrentCaptureState(BOOL bStartFromMaster = FALSE);
00562     virtual Capture* GetTopCaptureBitmap(Capture* pFromCapture = NULL) const;
00563     virtual BOOL TopCaptureIsDirect()           {return (GetTopCapture() && GetTopCapture()->IsDirect());}
00564 
00565 // Internal worker functions
00566 protected:
00567     virtual BOOL SetRenderToCapture(Capture* pCapture, BOOL bApplyClipRegion = FALSE, BOOL bSetBitmap = TRUE);
00568     virtual BOOL SetupDirectCapture(Capture* pNewCapture, NodeRenderableInk* pSupplier);
00569 
00570 // State variables
00571 //private:
00572 //  StackT<Capture*> m_CaptureStack;
00573 
00574 
00576     // Additional stuff for GRenderRegionWrapper (affects how bmp mem is allocated)
00577 protected:
00578     BOOL IsWrapped;
00579     void SetIsWrapped(BOOL flag) { IsWrapped = flag; }
00580 
00582     //  Karim 10/04/2000
00583     //  Implementation of clipping within a GRenderRegion.
00584 public:
00585     virtual void SetClipRegion      (ClipRegionAttribute * pClipAttr, BOOL Temp);
00586     virtual void RestoreClipRegion  (ClipRegionAttribute * pClipAttr, BOOL Temp);
00587 
00588 private:
00589 //  ClipRegionMap   m_ClipRegionMap;
00590 
00591 protected:
00592     const REGION* MakeClipRegionFromClipAttr(ClipRegionAttribute* pClipAttr);
00593     BOOL ApplyCurrentClipRegion();
00594     void FreeStoredClipRegions();
00596 
00597 public:
00598     void OffsetByHalfPixel();
00599     virtual BOOL GrabBitmap(DocRect* rectGrab, LPBITMAPINFO* plpBitmapInfo, LPBYTE* plpBits);
00600 
00601 #ifdef _DEBUG
00602 virtual void DebugTrace();
00603     BOOL DumpCaptureStack();
00604 #endif
00605 
00606 protected:
00607     // Andy Hills, 23-10-00:
00608     // Helper functions for RenderBitmapFill and SetBitmapTransparencyFill
00609     BOOL IsScaledUp(FillGeometryAttribute *Fill);
00610     BOOL IsAt100Percent(FillGeometryAttribute *Fill);
00611     BOOL IsDistorted(FillGeometryAttribute *Fill);
00612     BOOL NeedToSmooth(FillGeometryAttribute *Fill,BOOL bAlreadyScaled);
00613     virtual BOOL SetSmoothingFlags(FillGeometryAttribute *Fill);
00614 };
00615 
00616 
00617 class OpDescriptor;
00618 
00619 
00620 /******************************************************************************************
00621 
00622 >   class OpGDraw : public Operation
00623 
00624     Author:     Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>
00625     Created:    3/2/94
00626     Purpose:    Operation to toggle gdraw setting
00627     Notes:      Will be on a dialog somewhere eventually
00628 
00629 ********************************************************************************************/
00630 
00631 class OpGDraw : public Operation
00632 {
00633     CC_DECLARE_DYNCREATE( OpGDraw )
00634 
00635 public:
00636     OpGDraw();
00637 
00638     void Do(OpDescriptor*);
00639 
00640     static BOOL Init();
00641     static OpState GetState(String_256*, OpDescriptor*);    
00642 };
00643 
00644 #define OPTOKEN_GDRAW       _T("GDrawToggle")
00645 
00646 // We now always have CDraw (which pretends to be GDraw)
00647 //#define REAL_GDRAW 1
00648 
00649 // the possibility of nasty DDBs is only available on Intel platforms. It is permitted on
00650 // Intel 16-bit for test purposes
00651 //#ifdef _M_IX86
00652 //#define   REAL_DDB    0
00653 //#else
00654 //#define   REAL_DDB    0
00655 //#endif
00656 
00657 #endif

Generated on Sat Nov 10 03:48:36 2007 for Camelot by  doxygen 1.4.4