Module: wine Branch: master Commit: 5662820072ef3ce138dd625a08bcd5770d3cee6a URL: http://source.winehq.org/git/wine.git/?a=commit;h=5662820072ef3ce138dd625a08...
Author: Evan Stade estade@gmail.com Date: Tue Aug 14 19:00:09 2007 -0700
gdiplus: Added GdipSetTextRenderingHint/GdipGetTextRenderingHint.
---
dlls/gdiplus/gdiplus.spec | 4 ++-- dlls/gdiplus/gdiplus_private.h | 1 + dlls/gdiplus/graphics.c | 23 +++++++++++++++++++++++ include/gdiplusenums.h | 11 +++++++++++ include/gdiplusflat.h | 2 ++ 5 files changed, 39 insertions(+), 2 deletions(-)
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index f0424ac..42591dc 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -396,7 +396,7 @@ @ stub GdipGetStringFormatTabStops @ stub GdipGetStringFormatTrimming @ stub GdipGetTextContrast -@ stub GdipGetTextRenderingHint +@ stdcall GdipGetTextRenderingHint(ptr ptr) @ stub GdipGetTextureImage @ stub GdipGetTextureTransform @ stub GdipGetTextureWrapMode @@ -594,7 +594,7 @@ @ stub GdipSetStringFormatTabStops @ stub GdipSetStringFormatTrimming @ stub GdipSetTextContrast -@ stub GdipSetTextRenderingHint +@ stdcall GdipSetTextRenderingHint(ptr long) @ stdcall GdipSetTextureTransform(ptr ptr) @ stub GdipSetTextureWrapMode @ stdcall GdipSetWorldTransform(ptr ptr) diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index bb73b47..c462e10 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -80,6 +80,7 @@ struct GpGraphics{ InterpolationMode interpolation; PixelOffsetMode pixeloffset; CompositingMode compmode; + TextRenderingHint texthint; GpUnit unit; /* page unit */ REAL scale; /* page scale */ GpMatrix * worldtrans; /* world transform */ diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 4bdaaee..968c89f 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -1686,6 +1686,18 @@ GpStatus WINGDIPAPI GdipGetSmoothingMode(GpGraphics *graphics, SmoothingMode *mo return Ok; }
+/* FIXME: Text rendering hint is not used anywhere except the getter/setter. */ +GpStatus WINGDIPAPI GdipGetTextRenderingHint(GpGraphics *graphics, + TextRenderingHint *hint) +{ + if(!graphics || !hint) + return InvalidParameter; + + *hint = graphics->texthint; + + return Ok; +} + GpStatus WINGDIPAPI GdipGetWorldTransform(GpGraphics *graphics, GpMatrix *matrix) { if(!graphics || !matrix) @@ -1813,6 +1825,17 @@ GpStatus WINGDIPAPI GdipSetSmoothingMode(GpGraphics *graphics, SmoothingMode mod return Ok; }
+GpStatus WINGDIPAPI GdipSetTextRenderingHint(GpGraphics *graphics, + TextRenderingHint hint) +{ + if(!graphics) + return InvalidParameter; + + graphics->texthint = hint; + + return Ok; +} + GpStatus WINGDIPAPI GdipSetWorldTransform(GpGraphics *graphics, GpMatrix *matrix) { if(!graphics || !matrix) diff --git a/include/gdiplusenums.h b/include/gdiplusenums.h index e503da5..3a68a54 100644 --- a/include/gdiplusenums.h +++ b/include/gdiplusenums.h @@ -204,6 +204,16 @@ enum CompositingMode CompositingModeSourceCopy };
+enum TextRenderingHint +{ + TextRenderingHintSystemDefault = 0, + TextRenderingHintSingleBitPerPixelGridFit, + TextRenderingHintSingleBitPerPixel, + TextRenderingHintAntiAliasGridFit, + TextRenderingHintAntiAlias, + TextRenderingHintClearTypeGridFit +}; + #ifndef __cplusplus
typedef enum Unit Unit; @@ -226,6 +236,7 @@ typedef enum MetafileType MetafileType; typedef enum LinearGradientMode LinearGradientMode; typedef enum EmfType EmfType; typedef enum CompositingMode CompositingMode; +typedef enum TextRenderingHint TextRenderingHint;
#endif /* end of c typedefs */
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 1c75813..d24d744 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -92,6 +92,7 @@ GpStatus WINGDIPAPI GdipGetPageScale(GpGraphics*,REAL*); GpStatus WINGDIPAPI GdipGetPageUnit(GpGraphics*,GpUnit*); GpStatus WINGDIPAPI GdipGetPixelOffsetMode(GpGraphics*,PixelOffsetMode*); GpStatus WINGDIPAPI GdipGetSmoothingMode(GpGraphics*,SmoothingMode*); +GpStatus WINGDIPAPI GdipGetTextRenderingHint(GpGraphics*,TextRenderingHint*); GpStatus WINGDIPAPI GdipGetWorldTransform(GpGraphics*,GpMatrix*); GpStatus WINGDIPAPI GdipRestoreGraphics(GpGraphics*,GraphicsState); GpStatus WINGDIPAPI GdipRotateWorldTransform(GpGraphics*,REAL,GpMatrixOrder); @@ -104,6 +105,7 @@ GpStatus WINGDIPAPI GdipSetPageScale(GpGraphics*,REAL); GpStatus WINGDIPAPI GdipSetPageUnit(GpGraphics*,GpUnit); GpStatus WINGDIPAPI GdipSetPixelOffsetMode(GpGraphics*,PixelOffsetMode); GpStatus WINGDIPAPI GdipSetSmoothingMode(GpGraphics*,SmoothingMode); +GpStatus WINGDIPAPI GdipSetTextRenderingHint(GpGraphics*,TextRenderingHint); GpStatus WINGDIPAPI GdipSetWorldTransform(GpGraphics*,GpMatrix*); GpStatus WINGDIPAPI GdipTranslateWorldTransform(GpGraphics*,REAL,REAL,GpMatrixOrder);