From 10b575bc8636f262b8667310bbbd96da7d32f040 Mon Sep 17 00:00:00 2001 From: Evan Stade Date: Mon, 23 Jul 2007 20:24:41 -0700 Subject: [PATCH] gdiplus: Added GdipSetPageUnit. --- dlls/gdiplus/gdiplus.spec | 4 ++-- dlls/gdiplus/gdiplus_private.h | 1 + dlls/gdiplus/graphics.c | 21 +++++++++++++++++++++ include/gdiplusflat.h | 2 ++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index e59516c6277..919efe62f74 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -306,7 +306,7 @@ @ stub GdipGetMetafileHeaderFromWmf @ stub GdipGetNearestColor @ stub GdipGetPageScale -@ stub GdipGetPageUnit +@ stdcall GdipGetPageUnit(ptr ptr) @ stub GdipGetPathData @ stdcall GdipGetPathFillMode(ptr ptr) @ stub GdipGetPathGradientBlend @@ -525,7 +525,7 @@ @ stub GdipSetMatrixElements @ stub GdipSetMetafileDownLevelRasterizationLimit @ stub GdipSetPageScale -@ stub GdipSetPageUnit +@ stdcall GdipSetPageUnit(ptr long) @ stdcall GdipSetPathFillMode(ptr long) @ stub GdipSetPathGradientBlend @ stub GdipSetPathGradientCenterColor diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index aac3278dcc7..72e2303e6fd 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -65,6 +65,7 @@ struct GpGraphics{ CompositingQuality compqual; InterpolationMode interpolation; PixelOffsetMode pixeloffset; + GpUnit unit; /* page unit */ }; struct GpBrush{ diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 64ac4fe1799..7a26d8766a6 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -701,6 +701,7 @@ GpStatus WINGDIPAPI GdipCreateFromHDC(HDC hdc, GpGraphics **graphics) (*graphics)->compqual = CompositingQualityDefault; (*graphics)->interpolation = InterpolationModeDefault; (*graphics)->pixeloffset = PixelOffsetModeDefault; + (*graphics)->unit = UnitDisplay; return Ok; } @@ -1018,6 +1019,16 @@ GpStatus WINGDIPAPI GdipGetInterpolationMode(GpGraphics *graphics, return Ok; } +GpStatus WINGDIPAPI GdipGetPageUnit(GpGraphics *graphics, GpUnit *unit) +{ + if(!graphics || !unit) + return InvalidParameter; + + *unit = graphics->unit; + + return Ok; +} + /* FIXME: Pixel offset mode is not used anywhere except the getter/setter. */ GpStatus WINGDIPAPI GdipGetPixelOffsetMode(GpGraphics *graphics, PixelOffsetMode *mode) @@ -1083,6 +1094,16 @@ GpStatus WINGDIPAPI GdipSetInterpolationMode(GpGraphics *graphics, return Ok; } +GpStatus WINGDIPAPI GdipSetPageUnit(GpGraphics *graphics, GpUnit unit) +{ + if(!graphics) + return InvalidParameter; + + graphics->unit = unit; + + return Ok; +} + GpStatus WINGDIPAPI GdipSetPixelOffsetMode(GpGraphics *graphics, PixelOffsetMode mode) { diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 706aa277afa..d0aae710356 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -62,12 +62,14 @@ GpStatus WINGDIPAPI GdipFillPolygonI(GpGraphics*,GpBrush*,GDIPCONST GpPoint*,INT GpFillMode); GpStatus WINGDIPAPI GdipGetCompositingQuality(GpGraphics*,CompositingQuality*); GpStatus WINGDIPAPI GdipGetInterpolationMode(GpGraphics*,InterpolationMode*); +GpStatus WINGDIPAPI GdipGetPageUnit(GpGraphics*,GpUnit*); GpStatus WINGDIPAPI GdipGetPixelOffsetMode(GpGraphics*,PixelOffsetMode*); GpStatus WINGDIPAPI GdipGetSmoothingMode(GpGraphics*,SmoothingMode*); GpStatus WINGDIPAPI GdipRestoreGraphics(GpGraphics*,GraphicsState); GpStatus WINGDIPAPI GdipSaveGraphics(GpGraphics*,GraphicsState*); GpStatus WINGDIPAPI GdipSetCompositingQuality(GpGraphics*,CompositingQuality); GpStatus WINGDIPAPI GdipSetInterpolationMode(GpGraphics*,InterpolationMode); +GpStatus WINGDIPAPI GdipSetPageUnit(GpGraphics*,GpUnit); GpStatus WINGDIPAPI GdipSetPixelOffsetMode(GpGraphics*,PixelOffsetMode); GpStatus WINGDIPAPI GdipSetSmoothingMode(GpGraphics*,SmoothingMode);