gdrawcon.h

Go to the documentation of this file.
00001 // $Id: gdrawcon.h 1282 2006-06-09 09:46:49Z 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 //
00100 
00101 #ifndef INC_GDRAWCON
00102 #define INC_GDRAWCON
00103 
00104 //#include "gconsts.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00105 class TranspGradTable;
00106 
00107 /*******************************************************************************************
00108 
00109 >   class GDrawContext : public SimpleCCObject
00110 
00111     Author:     Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>
00112     Created:    14/7/94
00113     Purpose:    To put a C++ wrapper around the GDraw DLL. Also allows non-Gavin originated
00114                 GDraws (e.g. XDraw) to be dropped in as required. This class is almost a pure
00115                 base class - inherited classes have to have their own functions for almost
00116                 everything.
00117 
00118                 The caller should only ever need one instance of one of these (really its
00119                 inherited brothers) and keep it around for the duration of the program.
00120                 The keeper of the pointer to this is GRenderRegion.
00121 
00122                 With the exception of the ConvertBitmap function, this class could be put
00123                 in the kernel. Maybe it should. Perhaps. Ish.
00124 
00125 ********************************************************************************************/ 
00126 
00127 
00128 class GDrawContext : public SimpleCCObject
00129 {
00130 public:
00131 
00132     GDrawContext();
00133     virtual ~GDrawContext();
00134 
00135     virtual BOOL Init() = 0;
00136 
00137     virtual eError GetLastError() = 0;
00138 
00139     virtual INT32 GetGraduationTableSize() = 0;
00140     virtual INT32 GetGraduationTableLength() = 0;
00141     virtual INT32 GetLongGraduationTableSize() = 0;
00142     virtual INT32 GetLongGraduationTableLength() = 0;
00143     virtual INT32 GetTransparentGraduationTableSize() = 0;
00144     virtual INT32 GetTransparentGraduationTableLength() = 0;
00145     virtual INT32 GetLongTransparentGraduationTableSize() = 0;
00146     virtual INT32 GetLongTransparentGraduationTableLength() = 0;
00147 
00148     virtual void SetStackLimit( LPVOID ) = 0;
00149     virtual void SetStackSize( DWORD ) = 0;
00150 
00151     virtual BOOL SetupBitmap( INT32 Width, INT32 Height, INT32 Depth, LPBYTE Bits, DWORD Format = 2, BOOL DoBiCompression = FALSE ) = 0;
00152     virtual BOOL SetBitmap( CONST LPBITMAPINFOHEADER BitmapInfo, CONST LPBYTE Bitmap, DWORD BitmapFormat = 2) = 0;
00153 
00154     virtual BOOL SetMatrix( GMATRIX* ) = 0;
00155     virtual void SetAntialiasFlag( BOOL ) = 0;
00156     virtual void SetAntialiasQualityFlag( BOOL ) = 0;
00157     virtual void SetTileSmoothingFlag( BOOL ) = 0;
00158     virtual void SetTileFilteringFlag( BOOL ) = 0;
00159     virtual void SetMaxFilterSize( UINT32 ) = 0;
00160     virtual BOOL Sharpen( INT32 ) = 0;
00161     virtual BOOL Blur( INT32 ) = 0;
00162     virtual void SetHintingFlag( BOOL ) = 0;
00163     virtual void SetFlatness( DWORD ) = 0;
00164 
00165     virtual BOOL SetMiterLimit( DWORD ) = 0;
00166     virtual BOOL SetMatrixIntFlag( BOOL ) = 0;
00167     virtual BOOL SetDashAdjustmentFlag( BOOL ) = 0;
00168 
00169     virtual void TransformPath( LPPOINT, LPPOINT, DWORD, GMATRIX* ) = 0;
00170 
00171     virtual INT32 MaxScale( CONST GMATRIX *Matrix, CONST RECT *BBox ) = 0;
00172 
00173     // colour
00174     virtual void SetHalftoneOrigin( DWORD, DWORD ) = 0;
00175     virtual BOOL SetDitherStyle(DitherStyle Style = DITHER_GREY_ORDERED) = 0;
00176     virtual BOOL AddToGraduationTable( COLORREF, BOOL, GraduationTable*, DWORD ) = 0;
00177     virtual BOOL BuildGraduationTable( COLORREF, COLORREF, DWORD, GraduationTable* ) = 0;
00178     virtual BOOL BuildTransparencyTable( DWORD, DWORD, TransparentGradTable* ) = 0;
00179     virtual BOOL SetColour( COLORREF ) = 0;
00180     virtual BOOL SetSolidColour( COLORREF, DWORD BPP = 0, DWORD Format = 2 ) = 0;
00181     virtual BOOL SetWordColour( DWORD ) = 0;
00182     virtual BOOL SetTransparency( COLORREF, TransparencyEnum ) = 0;
00183     virtual BOOL ConvertBitmap( LPBITMAPINFOHEADER, LPBYTE, LPBITMAPINFOHEADER, LPBYTE, INT32 ) = 0;
00184     virtual const LOGPALETTE* SelectPalette( INT32 ) = 0;
00185 
00186     virtual BOOL SetInvert( DWORD ) = 0;
00187     virtual BOOL InitialiseWithPalette( const LOGPALETTE* ) = 0;
00188     virtual CONST BYTE* ReturnBrush() = 0;
00189     virtual CONST BYTE* ReturnBrushRGB() = 0;
00190 
00191     virtual BOOL SetSeparationTables(const BGR *CyanSepTable = NULL,
00192                                      const BGR *MagentaSepTable = NULL,
00193                                      const BGR *YellowSepTable = NULL,
00194                                      const BGR *BlackSepTable = NULL,
00195                                      const BYTE *UnderColourRemovalTable = NULL,
00196                                      const BYTE *BlackGenerationTable = NULL) = 0;
00197 
00198     virtual BOOL SetBitmapConversionTable( const BGR* BitmapConversionTable = NULL ) = 0;
00199 
00200     virtual BOOL SetGraduation(
00201         DWORD Style,
00202         CONST GraduationTable *Table,
00203         CONST POINT *PointA,
00204         CONST POINT *PointB,
00205         CONST POINT *PointC
00206     )  = 0;
00207     virtual BOOL SetTransparentGraduation(
00208         DWORD Style,
00209         CONST TranspGradTable *Table,
00210         CONST POINT *PointA,
00211         CONST POINT *PointB,
00212         CONST POINT *PointC
00213     )  = 0;
00214 
00215     virtual BOOL SetGraduation4(
00216         DWORD Style,
00217         CONST GraduationTable *Table,
00218         CONST POINT *PointA,
00219         CONST POINT *PointB,
00220         CONST POINT *PointC,
00221         CONST POINT *PointD
00222     )  = 0;
00223     virtual BOOL SetTransparentGraduation4(
00224         DWORD Style,
00225         CONST TranspGradTable *Table,
00226         CONST POINT *PointA,
00227         CONST POINT *PointB,
00228         CONST POINT *PointC,
00229         CONST POINT *PointD
00230     )  = 0;
00231 
00232     virtual BOOL SetBias(UINT32,double) = 0;
00233     virtual BOOL SetGain(UINT32,double) = 0;
00234     virtual BOOL SetBrightness(double) = 0;
00235     virtual BOOL SetContrast(double) = 0;
00236     virtual BOOL SetGamma(double) = 0;
00237     virtual BOOL SetPostGamma(double) = 0;
00238     virtual BOOL SetSaturation(double) = 0;
00239     virtual BOOL SetContone( UINT32, COLORREF=0x000000, COLORREF=0xFFFFFF ) = 0;
00240     virtual BOOL SetInputRange( UINT32,BYTE=0x00,BYTE=0xFF ) = 0;
00241     virtual BOOL SetOutputRange( UINT32,BYTE=0x00,BYTE=0xFF ) = 0;
00242 
00243     virtual BOOL SetBitmapFill( LPBITMAPINFOHEADER, LPBYTE, DWORD, LPPOINT, COLORREF, LPRGBQUAD,
00244                                     LPBYTE, LPBYTE, LPBYTE, LPBYTE, DWORD = 0) = 0;
00245 
00246     virtual BOOL SetTransparentBitmapFill( LPBITMAPINFOHEADER, LPBYTE, DWORD, LPPOINT, COLORREF, BYTE* = NULL, DWORD = 0) = 0;
00247 
00248     virtual BOOL SetPerspectiveBitmapFill( LPBITMAPINFOHEADER, LPBYTE, DWORD, LPPOINT, COLORREF, LPRGBQUAD,
00249                                             LPBYTE, LPBYTE, LPBYTE, LPBYTE, DWORD ) = 0;
00250 
00251     virtual BOOL SetPerspectiveTransparentBitmapFill( LPBITMAPINFOHEADER, LPBYTE, DWORD, LPPOINT, COLORREF, BYTE*, DWORD) = 0;
00252 
00253     virtual BOOL SetTransparencyLookupTable(CONST BYTE * Table)=0;
00254     
00255     // rendering
00256     virtual BOOL PlotBitmap( LPBITMAPINFOHEADER, LPBYTE, DWORD, LPPOINT, LPRGBQUAD,
00257                                     LPBYTE, LPBYTE, LPBYTE, LPBYTE) = 0;
00258 
00259     virtual BOOL PlotPerspectiveBitmap( LPBITMAPINFOHEADER, LPBYTE, DWORD, LPPOINT, LPRGBQUAD,
00260                                             LPBYTE, LPBYTE, LPBYTE, LPBYTE) = 0;
00261 
00262     virtual BOOL StrokePath( LPPOINT, const BYTE *, UINT32, BOOL, DWORD, CapStyles, JoinStyles, const DashType* ) = 0;
00263     virtual BOOL FillPath( LPPOINT, const BYTE *, UINT32, DWORD ) = 0;
00264     virtual BOOL FillRectangle( LPRECT ) = 0;
00265     virtual BOOL FillPoint( LPPOINT ) = 0;
00266     virtual INT32 StrokePathToPath(
00267         CONST POINT *IPoints,
00268         CONST BYTE  *ITypes,
00269         DWORD ILength,
00270         POINT *OPoints,
00271         BYTE  *OTypes,
00272         DWORD OLength,
00273         BOOL Close,
00274         DWORD LineWidth,
00275         CapStyles LineCaps,
00276         JoinStyles LineJoin,
00277         CONST DashType *Dash) = 0;
00278 
00279     virtual INT32 CalcStrokeBBox(
00280         CONST POINT *IPoints,
00281         CONST BYTE  *ITypes,
00282         DWORD ILength,
00283         LPRECT Rect,
00284         BOOL Close,
00285         DWORD LineWidth,
00286         CapStyles LineCaps,
00287         JoinStyles LineJoin,
00288         CONST DashType *Dash) = 0;
00289 
00290     virtual BOOL HintPath( 
00291         CONST POINT *Points,
00292         CONST BYTE  *Types,
00293         UINT32 Length,
00294         BOOL Close,
00295         DWORD LineWidth) = 0;
00296 
00297     virtual INT32 MakeUnclippedRegion( 
00298         CONST POINT *Points,
00299         CONST BYTE  *Types,
00300         UINT32 Length,
00301         DWORD Winding,
00302         REGION *ORegion,
00303         UINT32 OLength) = 0;
00304 
00305     virtual BOOL FillRegion( CONST REGION *Region, CONST POINT *Offset ) = 0;
00306 
00307     virtual INT32 SetBevelContrast(UINT32 nContrast) = 0;
00308     virtual INT32 SetBevelLightness(UINT32 nContrast) = 0;
00309     virtual INT32 SetBevelDarkness(UINT32 nContrast) = 0;
00310     virtual INT32 TranslateBevelValue(BYTE nIndex, BYTE Colour) = 0;
00311 
00312     // misc
00313     virtual BOOL IsOverlap( LPPOINT, const BYTE *, UINT32, DWORD) = 0;
00314     virtual BOOL GetStatistics( LPPOINT, const BYTE *, UINT32, DWORD, STATISTICS *) = 0;
00315     virtual BOOL CalcBBox( LPPOINT, const BYTE *, DWORD, LPRECT, BOOL) = 0;
00316 
00317     virtual INT32 MakeRegion( LPPOINT, const BYTE *, UINT32, DWORD, REGION *, UINT32) = 0;
00318 
00319     virtual BOOL ClipRectangle( LPRECT ) = 0;
00320     virtual BOOL DeviceClipRectangle( LPRECT ) = 0;
00321     virtual BOOL GetDeviceClipRectangle( LPRECT ) = 0;
00322     virtual BOOL ClipRegion( const REGION* ) = 0;
00323     virtual const REGION* GetClipRegion() = 0;
00324 
00325     virtual void ClearChangedBBox() = 0;
00326     virtual BOOL GetChangedBBox( LPRECT ) = 0;
00327     virtual BOOL SetChangedBBox( LPRECT ) = 0;
00328 
00329     virtual BOOL SetConversionPalette( PLOGPALETTE ) = 0;
00330 
00331     virtual COLORREF ConvertHSVtoRGB(COLORREF) = 0;
00332     virtual COLORREF ConvertRGBtoHSV(COLORREF) = 0;
00333 
00334     virtual DWORD GetMaxBitmapWidth(void) = 0;
00335     virtual DWORD GetMaxBitmapDepth(void) = 0;
00336 
00337     // New GDraw fill types
00338     virtual BOOL Set3WayGraduation(DWORD Style,
00339         COLORREF ColourA, COLORREF ColourB, COLORREF ColourD,
00340         CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointD) = 0;
00341 
00342     virtual BOOL Set3WayGraduation4(DWORD Style,
00343         COLORREF ColourA, COLORREF ColourB, COLORREF ColourD,
00344         CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointC, CONST POINT *PointD) = 0;
00345 
00346     virtual BOOL Set4WayGraduation(DWORD Style,
00347         COLORREF ColourA, COLORREF ColourB, COLORREF ColourC, COLORREF ColourD,
00348         CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointD) = 0;
00349 
00350     virtual BOOL Set4WayGraduation4(DWORD Style,
00351         COLORREF ColourA, COLORREF ColourB, COLORREF ColourC, COLORREF ColourD,
00352         CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointC, CONST POINT *PointD) = 0;
00353 
00354     virtual BOOL SetTransparent3WayGraduation(DWORD Style,
00355         BYTE ValueA, BYTE ValueB, BYTE ValueD,
00356         CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointD) = 0;
00357 
00358     virtual BOOL SetTransparent3WayGraduation4(DWORD Style,
00359         BYTE ValueA, BYTE ValueB, BYTE ValueD,
00360         CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointC, CONST POINT *PointD) = 0;
00361 
00362     virtual BOOL SetTransparent4WayGraduation(DWORD Style,
00363         BYTE ValueA, BYTE ValueB, BYTE ValueC, BYTE ValueD,
00364         CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointD) = 0;
00365 
00366     virtual BOOL SetTransparent4WayGraduation4(DWORD Style,
00367         BYTE ValueA, BYTE ValueB, BYTE ValueC, BYTE ValueD,
00368         CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointC, CONST POINT *PointD) = 0;
00369 
00370     virtual BOOL SaveContext(GCONTEXT* Context) = 0;
00371     virtual BOOL RestoreContext(CONST GCONTEXT* Context) = 0;
00372 
00373     virtual BOOL SetDefaultBitmapParameters();
00374 };
00375 
00376 
00377 #endif

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