GDrawAsm Class Reference

A C++ wrapped around the assembler in GDRAW.DLL. More...

#include <GDrawIntf.h>

Inheritance diagram for GDrawAsm:

GDrawContext SimpleCCObject List of all members.

Public Member Functions

 GDrawAsm ()
 GDrawAsm (DWORD ThreadID)
 ~GDrawAsm ()
 Destructor - performs required tidy up.
virtual BOOL Init ()
 Can the this pointer be used to render things.
virtual BOOL Init (GDrawAsm *pSource)
virtual eError GetLastError ()
virtual INT32 GetGraduationTableSize ()
virtual INT32 GetGraduationTableLength ()
virtual INT32 GetLongGraduationTableSize ()
virtual INT32 GetLongGraduationTableLength ()
virtual INT32 GetTransparentGraduationTableSize ()
virtual INT32 GetTransparentGraduationTableLength ()
virtual INT32 GetLongTransparentGraduationTableSize ()
virtual INT32 GetLongTransparentGraduationTableLength ()
virtual void SetStackLimit (LPVOID)
 Stops bad paths form using all stack space up.
virtual void SetStackSize (DWORD)
 Stops bad paths form using all stack space up.
virtual BOOL SetupBitmap (INT32 Width, INT32 Height, INT32 Depth, LPBYTE Bits, DWORD Format, BOOL DoBiCompression=FALSE)
 This is the bitmap that will be drawn into with rendering calls.
virtual BOOL SetBitmap (CONST LPBITMAPINFOHEADER BitmapInfo, CONST LPBYTE Bitmap, DWORD BitmapFormat=2)
virtual BOOL SetMatrix (GMATRIX *)
 Sets the matrix to be used during rendering.
virtual void SetAntialiasFlag (BOOL)
 Sets the matrix to be used during rendering.
virtual void SetAntialiasQualityFlag (BOOL)
 

virtual void SetTileSmoothingFlag (BOOL)
 Sets smoother rendering of Bitmap Plotting, but does not work with perspectivised!
virtual void SetTileFilteringFlag (BOOL)
 Sets smoothest rendering of bitmaps - rotation & scaling.
virtual void SetMaxFilterSize (UINT32)
virtual BOOL Sharpen (INT32)
virtual BOOL Blur (INT32)
virtual void SetHintingFlag (BOOL)
 Sets the flag in GDraw which forces all exactly horizontal and vertical line segments to be hinted onto pixel centres.
virtual void SetFlatness (DWORD)
 Sets the flattening.
virtual void TransformPath (LPPOINT, LPPOINT, DWORD, GMATRIX *)
 Convert any number of points using a GMatrix.
virtual INT32 MaxScale (CONST GMATRIX *Matrix, CONST RECT *BBox)
 This returns a scale factor that should be safe to use for a drawing of the size of the given bounding box. Currently only the translation values of the matrix are used. To convert this maximum scale factor to a zoom value, divide by the scale factor required for 100% zoom.
virtual void SetHalftoneOrigin (DWORD, DWORD)
 Sets the origin of the dither patterns.
virtual BOOL SetDitherStyle (DitherStyle Style=DITHER_GREY_ORDERED)
 Sets the style of the dither patterns.
virtual BOOL AddToGraduationTable (COLORREF, BOOL, GraduationTable *, DWORD)
 Adds a colour to a grad table at the specified point.
virtual BOOL BuildGraduationTable (COLORREF, COLORREF, DWORD, GraduationTable *)
 Gets table ready for grad fills.
virtual BOOL BuildTransparencyTable (DWORD, DWORD, TransparentGradTable *)
 Gets table ready for transparent grad fills.
virtual BOOL SetColour (COLORREF)
 Sets drawing colour to be used in subsequent rendering.
virtual BOOL SetSolidColour (COLORREF, DWORD, DWORD)
 Sets drawing colour to be used in subsequent rendering.
virtual BOOL SetWordColour (DWORD)
 Sets drawing colour to be used in subsequent rendering.
virtual BOOL SetTransparency (COLORREF, TransparencyEnum)
 Sets drawing colour to be used in subsequent rendering with transparency. Only has effect if output device can do transparency, else falls into SetColour.
virtual BOOL ConvertBitmap (LPBITMAPINFOHEADER, LPBYTE, LPBITMAPINFOHEADER, LPBYTE, INT32)
 Converts bitmaps from one format to another. Currently supported modes are: 16->8 and 32->8.
virtual pcLOGPALETTE SelectPalette (INT32)
 Returns a 256 colour logical palette that should be used in 8-bit modes.
virtual BOOL SetGraduation (DWORD Style, CONST GraduationTable *Table, CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointC)
 Reads the currently selected palette and builds internal tables based upon the results. Should be called after a palette change. Note that this may take a few seconds to execute and should be called sparingly.
virtual BOOL SetTransparentGraduation (DWORD Style, CONST TranspGradTable *Table, CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointC)
 Reads the currently selected palette and builds internal tables based upon the results. Should be called after a palette change. Note that this may take a few seconds to execute and should be called sparingly.
virtual BOOL SetGraduation4 (DWORD Style, CONST GraduationTable *Table, CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointC, CONST POINT *PointD)
 Reads the currently selected palette and builds internal tables based upon the results. Should be called after a palette change. Note that this may take a few seconds to execute and should be called sparingly.
virtual BOOL SetTransparentGraduation4 (DWORD Style, CONST TranspGradTable *Table, CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointC, CONST POINT *PointD)
 Reads the currently selected palette and builds internal tables based upon the results. Should be called after a palette change. Note that this may take a few seconds to execute and should be called sparingly.
virtual BOOL SetBias (UINT32, double)
virtual BOOL SetGain (UINT32, double)
virtual BOOL SetBrightness (double)
virtual BOOL SetContrast (double)
virtual BOOL SetGamma (double)
virtual BOOL SetPostGamma (double)
virtual BOOL SetSaturation (double)
virtual BOOL SetContone (UINT32, COLORREF, COLORREF)
virtual BOOL SetInputRange (UINT32, BYTE, BYTE)
virtual BOOL SetOutputRange (UINT32, BYTE, BYTE)
virtual BOOL SetBitmapFill (LPBITMAPINFOHEADER, LPBYTE, DWORD, LPPOINT, COLORREF, LPRGBQUAD, LPBYTE, LPBYTE, LPBYTE, LPBYTE, DWORD)
virtual BOOL SetTransparentBitmapFill (LPBITMAPINFOHEADER, LPBYTE, DWORD, LPPOINT, COLORREF, BYTE *, DWORD)
virtual BOOL SetPerspectiveBitmapFill (LPBITMAPINFOHEADER, LPBYTE, DWORD, LPPOINT, COLORREF, LPRGBQUAD, LPBYTE, LPBYTE, LPBYTE, LPBYTE, DWORD)
virtual BOOL SetPerspectiveTransparentBitmapFill (LPBITMAPINFOHEADER, LPBYTE, DWORD, LPPOINT, COLORREF, BYTE *, DWORD)
virtual BOOL SetTransparencyLookupTable (CONST BYTE *Table)
 Sets the table for type 12 transparency.
virtual BOOL StrokePath (LPPOINT, const BYTE *, UINT32, BOOL, DWORD, CapStyles, JoinStyles, const DashType *)
virtual BOOL FillPath (LPPOINT, const BYTE *, UINT32, DWORD)
 Fills the path using the current fill style.
virtual BOOL FillRectangle (LPRECT)
 Fills the rectangle with the current fill style.
virtual BOOL FillPoint (LPPOINT)
 Sets one device pixel to the curent fill colour.
virtual INT32 StrokePathToPath (CONST POINT *IPoints, CONST BYTE *ITypes, DWORD ILength, POINT *OPoints, BYTE *OTypes, DWORD OLength, BOOL Close, DWORD LineWidth, CapStyles LineCaps, JoinStyles LineJoin, CONST DashType *Dash)
 Converts a path into another path by sort-of stroking in toto another data structure.
virtual BOOL GetStatistics (LPPOINT, const BYTE *, UINT32, DWORD, STATISTICS *)
 Fills the path counting various things about it.
virtual BOOL ClipRectangle (LPRECT)
 Sets clip rectangle of subsequent rendering.
virtual void ClearChangedBBox ()
 Resets 'changed' rectangle. Should be called before anything is drawn, then drawn areas will be accumulated into the BBox.
virtual BOOL GetChangedBBox (LPRECT)
 Gets size of 'changed' rectangle where pixels have been plotted.
virtual BOOL SetChangedBBox (LPRECT)
 Sets size of 'changed' rectangle where pixels have been plotted.
virtual COLORREF ConvertHSVtoRGB (COLORREF)
virtual COLORREF ConvertRGBtoHSV (COLORREF)
virtual DWORD GetMaxBitmapWidth (void)
virtual DWORD GetMaxBitmapDepth (void)
virtual BOOL Set3WayGraduation (DWORD Style, COLORREF ColourA, COLORREF ColourB, COLORREF ColourD, CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointD)
virtual BOOL Set3WayGraduation4 (DWORD Style, COLORREF ColourA, COLORREF ColourB, COLORREF ColourD, CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointC, CONST POINT *PointD)
virtual BOOL Set4WayGraduation (DWORD Style, COLORREF ColourA, COLORREF ColourB, COLORREF ColourC, COLORREF ColourD, CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointD)
virtual BOOL Set4WayGraduation4 (DWORD Style, COLORREF ColourA, COLORREF ColourB, COLORREF ColourC, COLORREF ColourD, CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointC, CONST POINT *PointD)
virtual BOOL SetTransparent3WayGraduation (DWORD Style, BYTE ValueA, BYTE ValueB, BYTE ValueD, CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointD)
virtual BOOL SetTransparent3WayGraduation4 (DWORD Style, BYTE ValueA, BYTE ValueB, BYTE ValueD, CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointC, CONST POINT *PointD)
virtual BOOL SetTransparent4WayGraduation (DWORD Style, BYTE ValueA, BYTE ValueB, BYTE ValueC, BYTE ValueD, CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointD)
virtual BOOL SetTransparent4WayGraduation4 (DWORD Style, BYTE ValueA, BYTE ValueB, BYTE ValueC, BYTE ValueD, CONST POINT *PointA, CONST POINT *PointB, CONST POINT *PointC, CONST POINT *PointD)
virtual BOOL SaveContext (GCONTEXT *Context)
 Saves the GDraw context.
virtual BOOL RestoreContext (CONST GCONTEXT *Context)
 Restores the GDraw context.
virtual BOOL SetConversionPalette (PLOGPALETTE)
 Sets the Palette that is to be used for ConvertBitmap.
virtual BOOL SetMiterLimit (DWORD)
virtual BOOL SetMatrixIntFlag (BOOL)
virtual BOOL SetDashAdjustmentFlag (BOOL)
virtual BOOL SetInvert (DWORD)
virtual BOOL InitialiseWithPalette (const LOGPALETTE *)
virtual const BYTE * ReturnBrush ()
virtual const BYTE * ReturnBrushRGB ()
virtual BOOL SetSeparationTables (const BGR *CyanSepTable=NULL, const BGR *MagentaSepTable=NULL, const BGR *YellowSepTable=NULL, const BGR *BlackSepTable=NULL, const BYTE *UnderColourRemovalTable=NULL, const BYTE *BlackGenerationTable=NULL)
 Sets process colour separation tables to be used in the future by various GDraw calls. See the GDraw documentation for details.
virtual BOOL SetBitmapConversionTable (const BGR *BitmapConversionTable=NULL)
 This function will set up the bitmap conversion table for use by the following plotting functions:.
virtual BOOL PlotBitmap (LPBITMAPINFOHEADER, LPBYTE, DWORD, LPPOINT, LPRGBQUAD, LPBYTE, LPBYTE, LPBYTE, LPBYTE)
virtual BOOL PlotPerspectiveBitmap (LPBITMAPINFOHEADER, LPBYTE, DWORD, LPPOINT, LPRGBQUAD, LPBYTE, LPBYTE, LPBYTE, LPBYTE)
virtual INT32 CalcStrokeBBox (CONST POINT *IPoints, CONST BYTE *ITypes, DWORD ILength, LPRECT Rect, BOOL Close, DWORD LineWidth, CapStyles LineCaps, JoinStyles LineJoin, CONST DashType *Dash)
virtual BOOL IsOverlap (LPPOINT, const BYTE *, UINT32, DWORD)
virtual BOOL CalcBBox (LPPOINT, const BYTE *, DWORD, LPRECT, BOOL)
virtual INT32 MakeRegion (LPPOINT, const BYTE *, UINT32, DWORD, REGION *, UINT32)
virtual BOOL DeviceClipRectangle (LPRECT)
virtual BOOL GetDeviceClipRectangle (LPRECT)
virtual BOOL ClipRegion (const REGION *)
virtual const REGIONGetClipRegion ()
virtual BOOL HintPath (CONST POINT *Points, CONST BYTE *Types, UINT32 Length, BOOL Close, DWORD LineWidth)
virtual INT32 MakeUnclippedRegion (CONST POINT *Points, CONST BYTE *Types, UINT32 Length, DWORD Winding, REGION *ORegion, UINT32 OLength)
virtual BOOL FillRegion (CONST REGION *Region, CONST POINT *Offset)
virtual INT32 SetBevelContrast (UINT32 nContrast)
virtual INT32 SetBevelLightness (UINT32 nContrast)
virtual INT32 SetBevelDarkness (UINT32 nContrast)
virtual INT32 TranslateBevelValue (BYTE nIndex, BYTE Colour)

Static Public Member Functions

static GDrawAsmGetContextForCurrentThread (void)
 Used by GRenderRegion to get a thread-safe context for rendering.

Protected Member Functions

virtual BOOL MakeCurrent ()
 Swaps the GDraw context Makes the GDraw context passed the current one.

Static Protected Member Functions

static INT32 GetContextLength ()
 Gets the length of a GDraw context.

Protected Attributes

GCONTEXTm_pContext
GCONTEXTSaveArea
INT32 SaveAreaLength
DWORD m_ThreadID
GDrawAsmm_pNext
GDrawAsmm_pPrevious

Static Protected Attributes

static GDrawAsmCurrent = NULL
static INT32 Instance = 0
static GDrawAsmsm_pListHead = NULL

Detailed Description

A C++ wrapped around the assembler in GDRAW.DLL.

Author:
Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/7/94
The caller should only ever need one instance of one of these (really its inherited brothers) and keep it around for the duration of the program. The keeper of the pointer to this is GRenderRegion.

If real GDraw is not available (e.g. Win16) then this returns FALSE from the Init function and all other member functions return failure codes.

See also:
GDrawContext

Definition at line 172 of file GDrawIntf.h.


Constructor & Destructor Documentation

GDrawAsm::GDrawAsm  ) 
 

Definition at line 134 of file GDrawIntf.cpp.

00134                    : GDrawContext()
00135 {
00136     m_pContext = NULL;
00137     Instance++;
00138     SaveArea = NULL;
00139     SaveAreaLength = 0;
00140     m_pPrevious = NULL;
00141     m_pNext = NULL;
00142 
00143     m_ThreadID = 0;
00144 }

GDrawAsm::GDrawAsm DWORD  ThreadID  ) 
 

Definition at line 147 of file GDrawIntf.cpp.

00147                                  : GDrawContext()
00148 {
00149     m_pContext = NULL;
00150     Instance++;
00151     SaveArea = NULL;
00152     SaveAreaLength = 0;
00153     m_pPrevious = NULL;
00154     m_pNext = NULL;
00155 
00156     if (ThreadID == 0)
00157         ThreadID = wxThread::GetCurrentId();
00158 
00159     // Insert this at the beginning of the list
00160     m_pNext = sm_pListHead;
00161     sm_pListHead = this;
00162 
00163     m_ThreadID = ThreadID;
00164 }

GDrawAsm::~GDrawAsm  ) 
 

Destructor - performs required tidy up.

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

Errors: - Scope: Public

See also:
-

Definition at line 350 of file GDrawIntf.cpp.

00351 {
00352     CriticalSection Ralph;
00353 
00354 //  TRACEUSER( "Gerry", _T("Deleting GDrawAsm at 0x%08x\n"), this);
00355 
00356     if (Instance > 0)
00357         Instance--;
00358 
00359 //  if (Instance == 0)
00360 //      XaDrawOld_Terminate(); // only terminate when the last one goes
00361 
00362 //  if (Instance == 0)
00363 //  {
00364 //      XaDraw_Terminate(s_pContext); // only terminate when the last one goes
00365 //      CCFree(s_pContext);
00366 //      s_pContext = NULL;
00367 //  }
00368 
00369     if (this == GRenderRegion::GetStaticDrawContext())
00370     {
00371         TRACEUSER("Gerry", _T("Deleting current GDraw context at 0x%08x\n"), this);
00372         GRenderRegion::SetTempDrawContext(NULL);
00373     }
00374 
00375     if (m_pContext)
00376     {
00377         CamProfile cp(CAMPROFILE_GDRAW);
00378         XaDraw_Terminate(m_pContext);
00379         CCFree(m_pContext);
00380 //      TRACEUSER( "Gerry", _T("Released context at 0x%08x\n"), m_pContext);
00381         m_pContext = NULL;
00382     }
00383 
00384     // Make Current not point at this cos it's a bit dangerous
00385     if (Current == this)
00386         Current = NULL;
00387 
00388     if (SaveArea)
00389     {
00390 //      TRACEUSER( "Gerry", _T("Destruct context of %d bytes at 0x%08x\n"), SaveAreaLength, SaveArea);
00391         CCFree((LPBYTE)SaveArea);   // Oh well, can't return errors
00392         SaveArea=NULL;      // For tidyness
00393         SaveAreaLength = 0;
00394     }
00395 
00396     // If we have a thread id
00397     if (m_ThreadID != 0)
00398     {
00399         // Remove this from the list
00400 
00401         if (m_pPrevious == NULL || sm_pListHead == this)
00402         {
00403             // We are the first item so make the head point to the next item
00404             sm_pListHead = m_pNext;
00405         }
00406         else
00407         {
00408             // Not the first so make the previous item point to the next item
00409             m_pPrevious->m_pNext = m_pNext;
00410         }
00411 
00412         // If we are not the last item
00413         if (m_pNext != NULL)
00414         {
00415             // Make the next item point to the previous item
00416             m_pNext->m_pPrevious = m_pPrevious;
00417         }
00418     }
00419 }


Member Function Documentation

BOOL GDrawAsm::AddToGraduationTable COLORREF  Colour,
BOOL  HSV,
GraduationTable Table,
DWORD  Index
[virtual]
 

Adds a colour to a grad table at the specified point.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/9/94
Parameters:
A colour to add. If HSV is TRUE then the colour is coverted to RGB [INPUTS] in HSV space, else in RGB space.
GraduationTable is updated to include the new colour. [OUTPUTS]
Returns:
TRUE if worked, FALSE if failed.

Errors: - Scope: Public

See also:
-

Implements GDrawContext.

Definition at line 1421 of file GDrawIntf.cpp.

01422 {
01423     CriticalSection Ralph;
01424     CamProfile cp(CAMPROFILE_GDRAW);
01425 
01426     return (MakeCurrent() && (XaColour_AddToGraduationTable(m_pContext, Colour, HSV, Table, Index ) ? FALSE : TRUE));
01427 }

virtual BOOL GDrawAsm::Blur INT32   )  [virtual]
 

Implements GDrawContext.

BOOL GDrawAsm::BuildGraduationTable COLORREF  Start,
COLORREF  End,
DWORD  HSV,
GraduationTable Table
[virtual]
 

Gets table ready for grad fills.

Author:
Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/7/94
Parameters:
A start and end colour. If HSV is TRUE then intermediate colours generated [INPUTS] in HSV space, else in RGB space.
GraduationTable is filled as required (defined in gconsts.h). [OUTPUTS]
Returns:
TRUE if worked, FALSE if failed.

Errors: - Scope: Public

See also:
-

Implements GDrawContext.

Definition at line 1446 of file GDrawIntf.cpp.

01447 {
01448     CriticalSection Ralph;
01449     CamProfile cp(CAMPROFILE_GDRAW);
01450 
01451     return (MakeCurrent() && (XaColour_BuildGraduationTable(m_pContext, Start, End, HSV, Table ) ? FALSE : TRUE));
01452 }

BOOL GDrawAsm::BuildTransparencyTable DWORD  Start,
DWORD  End,
TransparentGradTable Table
[virtual]
 

Gets table ready for transparent grad fills.

Author:
Will_Cowling (Xara Group Ltd) <camelotdev@xara.com>
Date:
23/8/94
Parameters:
A start and end transparency. [INPUTS]
TransparentGradTable is filled as required (defined in gconsts.h). [OUTPUTS]
Returns:
TRUE if worked, FALSE if failed.

Errors: - Scope: Public

See also:
-

Implements GDrawContext.

Definition at line 1470 of file GDrawIntf.cpp.

01471 {
01472     CriticalSection Ralph;
01473     CamProfile cp(CAMPROFILE_GDRAW);
01474 
01475     return (MakeCurrent() && (XaColour_BuildTransparencyTable(m_pContext, Start, End, Table ) ? FALSE : TRUE));
01476 }

BOOL GDrawAsm::CalcBBox LPPOINT  ,
const BYTE *  ,
DWORD  ,
LPRECT  ,
BOOL 
[virtual]
 

Implements GDrawContext.

Definition at line 2491 of file GDrawIntf.cpp.

02492 {
02493     CriticalSection Ralph;
02494     CamProfile cp(CAMPROFILE_GDRAW);
02495 
02496     return (MakeCurrent() && (XaDraw_CalcBBox(m_pContext, Points, Verbs, Length, Rect, FALSE != Flatten ) ? FALSE: TRUE));
02497 }

INT32 GDrawAsm::CalcStrokeBBox CONST POINT IPoints,
CONST BYTE *  ITypes,
DWORD  ILength,
LPRECT  Rect,
BOOL  Close,
DWORD  LineWidth,
CapStyles  LineCaps,
JoinStyles  LineJoin,
CONST DashType Dash
[virtual]
 

Implements GDrawContext.

Definition at line 2464 of file GDrawIntf.cpp.

02474 {
02475     CriticalSection Ralph;
02476     CamProfile cp(CAMPROFILE_GDRAW);
02477 
02478     if (!MakeCurrent()) return -1;
02479     return XaDraw_CalcStrokeBBox(m_pContext, IPoints, ITypes, ILength, Rect,
02480                                     FALSE != Close, LineWidth, LineCaps, LineJoin, Dash );
02481 }

void GDrawAsm::ClearChangedBBox  )  [virtual]
 

Resets 'changed' rectangle. Should be called before anything is drawn, then drawn areas will be accumulated into the BBox.

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

Errors: - Scope: Public

See also:
GetChangedBBox

Implements GDrawContext.

Definition at line 2207 of file GDrawIntf.cpp.

02208 {
02209     CriticalSection Ralph;
02210     CamProfile cp(CAMPROFILE_GDRAW);
02211 
02212     if (MakeCurrent()) XaDraw_ClearChangedBBox(m_pContext);
02213 }

BOOL GDrawAsm::ClipRectangle LPRECT  Rect  )  [virtual]
 

Sets clip rectangle of subsequent rendering.

Author:
Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/7/94
Parameters:
A rectangle (in logical coordinates). [INPUTS]
- [OUTPUTS]
Returns:
TRUE if worked, FALSE if failed.

Errors: - Scope: Public

See also:
-

Implements GDrawContext.

Definition at line 2182 of file GDrawIntf.cpp.

02183 {
02184     CriticalSection Ralph;
02185     CamProfile cp(CAMPROFILE_GDRAW);
02186 
02187     return (MakeCurrent() && (XaDraw_ClipRectangle(m_pContext, Rect ) ? FALSE : TRUE));
02188 }

BOOL GDrawAsm::ClipRegion const REGION  )  [virtual]
 

Implements GDrawContext.

Definition at line 2524 of file GDrawIntf.cpp.

02525 {
02526     CriticalSection Ralph;
02527     CamProfile cp(CAMPROFILE_GDRAW);
02528 
02529     return (MakeCurrent() && (XaDraw_ClipRegion(m_pContext, Region ) ? FALSE: TRUE));
02530 }

BOOL GDrawAsm::ConvertBitmap LPBITMAPINFOHEADER  SInfo,
LPBYTE  SBytes,
LPBITMAPINFOHEADER  DInfo,
LPBYTE  DBytes,
INT32  Dither
[virtual]
 

Converts bitmaps from one format to another. Currently supported modes are: 16->8 and 32->8.

Author:
Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/7/94
Parameters:
SInfo and SBytes are the source bitmap. Dither is the type of dithering [INPUTS] required (currently 0=ordered dither, 1=error diffused).
DInfo and DBytes are the destination bitmap. [OUTPUTS]
Returns:
TRUE if worked, FALSE if failed (e.g. unsupported bitmap depth(s))

Errors: - Scope: Public

See also:
-

Implements GDrawContext.

Definition at line 1595 of file GDrawIntf.cpp.

01597 {
01598     CriticalSection Ralph;
01599     CamProfile cp(CAMPROFILE_GDRAW);
01600 
01601     return (MakeCurrent() && (XaColour_ConvertBitmap(m_pContext, SInfo, SBytes, DInfo, DBytes, Dither ) ? FALSE : TRUE));
01602 }

COLORREF GDrawAsm::ConvertHSVtoRGB COLORREF   )  [virtual]
 

Implements GDrawContext.

Definition at line 2263 of file GDrawIntf.cpp.

02264 {
02265     CriticalSection Ralph;
02266     CamProfile cp(CAMPROFILE_GDRAW);
02267 
02268     MakeCurrent(); // Oooerr, should really not call GDraw if this fails
02269     return XaColour_ConvertHSVtoRGB(hsv );
02270 }

COLORREF GDrawAsm::ConvertRGBtoHSV COLORREF   )  [virtual]
 

Implements GDrawContext.

Definition at line 2272 of file GDrawIntf.cpp.

02273 {
02274     CriticalSection Ralph;
02275     CamProfile cp(CAMPROFILE_GDRAW);
02276 
02277     MakeCurrent(); // Oooerr, should really not call GDraw if this fails
02278     return XaColour_ConvertRGBtoHSV( rgb );
02279 }

BOOL GDrawAsm::DeviceClipRectangle LPRECT   )  [virtual]
 

Implements GDrawContext.

Definition at line 2508 of file GDrawIntf.cpp.

02509 {
02510     CriticalSection Ralph;
02511     CamProfile cp(CAMPROFILE_GDRAW);
02512 
02513     return (MakeCurrent() && (XaDraw_DeviceClipRectangle(m_pContext, Rect ) ? FALSE: TRUE));
02514 }

BOOL GDrawAsm::FillPath LPPOINT  Points,
const BYTE *  Verbs,
UINT32  Length,
DWORD  Winding
[virtual]
 

Fills the path using the current fill style.

Author:
Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/7/94
Parameters:
Points is the list of co-ords of the path. Verbs is the PC_xx verb list. [INPUTS] Length is how many points there are.
- [OUTPUTS]
Returns:
TRUE if worked, FALSE if failed.

Errors: - Scope: Public

See also:
-

Implements GDrawContext.

Definition at line 2034 of file GDrawIntf.cpp.

02035 {
02036     CriticalSection Ralph;
02037     CamProfile cp(CAMPROFILE_GDRAW);
02038 
02039     return (MakeCurrent() && (XaDraw_FillPath(m_pContext, Points, Verbs, Length, Winding ) ? FALSE : TRUE));
02040 }

BOOL GDrawAsm::FillPoint LPPOINT  Point  )  [virtual]
 

Sets one device pixel to the curent fill colour.

Author:
Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/7/94
Parameters:
Point is a coord. [INPUTS]
- [OUTPUTS]
Returns:
TRUE if worked, FALSE if failed.

Errors: - Scope: Public

See also:
-

Implements GDrawContext.

Definition at line 2109 of file GDrawIntf.cpp.

02110 {
02111     CriticalSection Ralph;
02112     CamProfile cp(CAMPROFILE_GDRAW);
02113 
02114     return (MakeCurrent() && (XaDraw_FillPoint(m_pContext, Point ) ? FALSE : TRUE));
02115 }

BOOL GDrawAsm::FillRectangle LPRECT  Rect  )  [virtual]
 

Fills the rectangle with the current fill style.

Author:
Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>
Date:
14/7/94
Parameters:
Rect is the rectangle. [INPUTS]
- [OUTPUTS]
Returns:
TRUE if worked, FALSE if failed.

Errors: - Scope: Public

See also:
-

Implements GDrawContext.

Definition at line 2085 of file GDrawIntf.cpp.

02086 {
02087     CriticalSection Ralph;
02088     CamProfile cp(CAMPROFILE_GDRAW);
02089 
02090     return (MakeCurrent() && (XaDraw_FillRectangle(m_pContext, Rect ) ? FALSE : TRUE));
02091 }

BOOL GDrawAsm::FillRegion CONST REGION Region,
CONST POINT Offset
[virtual]
 

Implements GDrawContext.

Definition at line 2567 of file GDrawIntf.cpp.

02568 {
02569     CriticalSection Ralph;
02570     CamProfile cp(CAMPROFILE_GDRAW);
02571 
02572     return (MakeCurrent() && (XaDraw_FillRegion(m_pContext, Region, Offset ) ? FALSE: TRUE));
02573 }

BOOL GDrawAsm::GetChangedBBox LPRECT  Rect  )  [virtual]
 

Gets size of 'changed' rectangle where pixels have been plotted.

Author:
Andy_Pennell (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/7/94
Parameters:
- [INPUTS]
A rectangle in pixel co-ordinates. [OUTPUTS]
Returns:
TRUE if worked, FALSE if failed.

Errors: - Scope: Public

See also:
-

Implements GDrawContext.

Definition at line 2231 of file GDrawIntf.cpp.

02232 {
02233     CriticalSection Ralph;
02234     CamProfile cp(CAMPROFILE_GDRAW);
02235 
02236     return (MakeCurrent() && (XaDraw_GetChangedBBox(m_pContext, Rect ) ? FALSE : TRUE));
02237 }

CONST REGION * GDrawAsm::GetClipRegion  )  [virtual]
 

Implements GDrawContext.

Definition at line 2532 of file GDrawIntf.cpp.

02533 {
02534     CriticalSection Ralph;
02535     CamProfile cp(CAMPROFILE_GDRAW);
02536 
02537     return MakeCurrent() ? XaDraw_GetClipRegion(m_pContext) : NULL;
02538 }

GDrawAsm * GDrawAsm::GetContextForCurrentThread void   )  [static]
 

Used by GRenderRegion to get a thread-safe context for rendering.

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
11/9/96
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
A pointer to the first context in the list whose ThreadID matches (NULL if no matches)

Errors: - Scope: Public static

See also:
-

Definition at line 184 of file GDrawIntf.cpp.

00185 {
00186     CriticalSection Ralph;
00187 
00188     GDrawAsm *pContext = sm_pListHead;
00189 
00190     DWORD ThreadID = wxThread::GetCurrentId();
00191 
00192     while (pContext && (ThreadID != pContext->m_ThreadID))
00193     {
00194         pContext = pContext->m_pNext;
00195     }
00196 
00197     TRACE( wxT("GetContextForCurrentThread = %p"), pContext );
00198 
00199     return(pContext);
00200 }

INT32 GDrawAsm::GetContextLength  )  [static, protected]
 

Gets the length of a GDraw context.

Author:
Alex_Bligh (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/10/94
Parameters:
None [INPUTS]
- [OUTPUTS]
Returns:
Length of this GDraw context

Errors: - Scope: Protected

See also:
-

Definition at line 560 of file GDrawIntf.cpp.

00561 {
00562     CamProfile cp(CAMPROFILE_GDRAW);
00563     return(XaDraw_ContextLength());
00564 }

BOOL GDrawAsm::GetDeviceClipRectangle LPRECT   )  [virtual]
 

Implements GDrawContext.

Definition at line 2516 of file GDrawIntf.cpp.

02517 {
02518     CriticalSection Ralph;
02519     CamProfile cp(CAMPROFILE_GDRAW);
02520 
02521     return (MakeCurrent() && (XaDraw_GetDeviceClipRectangle(m_pContext, Rect ) ? FALSE: TRUE));
02522 }

INT32 GDrawAsm::GetGraduationTableLength  )  [virtual]
 

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/10/96
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The number of entries in the graduation table Scope: Public

Implements GDrawContext.

Definition at line 762 of file GDrawIntf.cpp.

00763 {
00764     CamProfile cp(CAMPROFILE_GDRAW);
00765     return(XaColour_GetGraduationTableLength());
00766 }

INT32 GDrawAsm::GetGraduationTableSize  )  [virtual]
 

Author:
Gerry_Iles (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/10/96
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
The size in bytes of the graduation table Scope: Public

Implements GDrawContext.

Definition at line 736 of file GDrawIntf.cpp.

00737 {
00738     CriticalSection Ralph;
00739