Nikolay Sivov : gdiplus: Added GdipGetTextContrast.

Alexandre Julliard julliard at winehq.org
Mon Nov 10 07:43:54 CST 2008


Module: wine
Branch: master
Commit: 56173d400583915f60b0bfe75d08d9782b002cc3
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=56173d400583915f60b0bfe75d08d9782b002cc3

Author: Nikolay Sivov <bunglehead at gmail.com>
Date:   Sun Nov  9 14:32:26 2008 +0300

gdiplus: Added GdipGetTextContrast.

---

 dlls/gdiplus/gdiplus.spec      |    2 +-
 dlls/gdiplus/gdiplus_private.h |    1 +
 dlls/gdiplus/graphics.c        |   13 +++++++++++++
 dlls/gdiplus/tests/graphics.c  |   23 +++++++++++++++++++++++
 include/gdiplusflat.h          |    1 +
 5 files changed, 39 insertions(+), 1 deletions(-)

diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index a2790a3..0a29c10 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -395,7 +395,7 @@
 @ stdcall GdipGetStringFormatTabStopCount(ptr ptr)
 @ stdcall GdipGetStringFormatTabStops(ptr long ptr ptr)
 @ stdcall GdipGetStringFormatTrimming(ptr ptr)
-@ stub GdipGetTextContrast
+@ stdcall GdipGetTextContrast(ptr ptr)
 @ stdcall GdipGetTextRenderingHint(ptr ptr)
 @ stub GdipGetTextureImage
 @ stdcall GdipGetTextureTransform(ptr ptr)
diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h
index d3dce6a..57d63c2 100644
--- a/dlls/gdiplus/gdiplus_private.h
+++ b/dlls/gdiplus/gdiplus_private.h
@@ -100,6 +100,7 @@ struct GpGraphics{
     GpMatrix * worldtrans; /* world transform */
     BOOL busy;      /* hdc handle obtained by GdipGetDC */
     GpRegion *clip;
+    UINT textcontrast; /* not used yet. get/set only */
 };
 
 struct GpBrush{
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 3273494..764e9ac 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -763,6 +763,7 @@ GpStatus WINGDIPAPI GdipCreateFromHDC2(HDC hdc, HANDLE hDevice, GpGraphics **gra
     (*graphics)->unit = UnitDisplay;
     (*graphics)->scale = 1.0;
     (*graphics)->busy = FALSE;
+    (*graphics)->textcontrast = 4;
 
     return Ok;
 }
@@ -2507,6 +2508,18 @@ GpStatus WINGDIPAPI GdipGetSmoothingMode(GpGraphics *graphics, SmoothingMode *mo
     return Ok;
 }
 
+GpStatus WINGDIPAPI GdipGetTextContrast(GpGraphics *graphics, UINT *contrast)
+{
+    TRACE("(%p, %p)\n", graphics, contrast);
+
+    if(!graphics || !contrast)
+        return InvalidParameter;
+
+    *contrast = graphics->textcontrast;
+
+    return Ok;
+}
+
 /* FIXME: Text rendering hint is not used anywhere except the getter/setter. */
 GpStatus WINGDIPAPI GdipGetTextRenderingHint(GpGraphics *graphics,
     TextRenderingHint *hint)
diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c
index 1b4e310..9d06fd9 100644
--- a/dlls/gdiplus/tests/graphics.c
+++ b/dlls/gdiplus/tests/graphics.c
@@ -902,6 +902,28 @@ static void test_clear(void)
     expect(InvalidParameter, status);
 }
 
+static void test_textcontrast(void)
+{
+    GpStatus status;
+    HDC hdc = GetDC(0);
+    GpGraphics *graphics;
+    UINT contrast;
+
+    status = GdipGetTextContrast(NULL, NULL);
+    expect(InvalidParameter, status);
+
+    status = GdipCreateFromHDC(hdc, &graphics);
+    expect(Ok, status);
+
+    status = GdipGetTextContrast(graphics, NULL);
+    expect(InvalidParameter, status);
+    status = GdipGetTextContrast(graphics, &contrast);
+    expect(4, contrast);
+
+    GdipDeleteGraphics(graphics);
+    ReleaseDC(0, hdc);
+}
+
 START_TEST(graphics)
 {
     struct GdiplusStartupInput gdiplusStartupInput;
@@ -926,6 +948,7 @@ START_TEST(graphics)
     test_get_set_clip();
     test_isempty();
     test_clear();
+    test_textcontrast();
 
     GdiplusShutdown(gdiplusToken);
 }
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 203bcec..b8f14e1 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -200,6 +200,7 @@ GpStatus WINGDIPAPI GdipGetPageScale(GpGraphics*,REAL*);
 GpStatus WINGDIPAPI GdipGetPageUnit(GpGraphics*,GpUnit*);
 GpStatus WINGDIPAPI GdipGetPixelOffsetMode(GpGraphics*,PixelOffsetMode*);
 GpStatus WINGDIPAPI GdipGetSmoothingMode(GpGraphics*,SmoothingMode*);
+GpStatus WINGDIPAPI GdipGetTextContrast(GpGraphics*,UINT*);
 GpStatus WINGDIPAPI GdipGetTextRenderingHint(GpGraphics*,TextRenderingHint*);
 GpStatus WINGDIPAPI GdipGetWorldTransform(GpGraphics*,GpMatrix*);
 GpStatus WINGDIPAPI GdipGraphicsClear(GpGraphics*,ARGB);




More information about the wine-cvs mailing list