Commit 56173d40 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

gdiplus: Added GdipGetTextContrast.

parent 48c4248d
...@@ -395,7 +395,7 @@ ...@@ -395,7 +395,7 @@
@ stdcall GdipGetStringFormatTabStopCount(ptr ptr) @ stdcall GdipGetStringFormatTabStopCount(ptr ptr)
@ stdcall GdipGetStringFormatTabStops(ptr long ptr ptr) @ stdcall GdipGetStringFormatTabStops(ptr long ptr ptr)
@ stdcall GdipGetStringFormatTrimming(ptr ptr) @ stdcall GdipGetStringFormatTrimming(ptr ptr)
@ stub GdipGetTextContrast @ stdcall GdipGetTextContrast(ptr ptr)
@ stdcall GdipGetTextRenderingHint(ptr ptr) @ stdcall GdipGetTextRenderingHint(ptr ptr)
@ stub GdipGetTextureImage @ stub GdipGetTextureImage
@ stdcall GdipGetTextureTransform(ptr ptr) @ stdcall GdipGetTextureTransform(ptr ptr)
......
...@@ -100,6 +100,7 @@ struct GpGraphics{ ...@@ -100,6 +100,7 @@ struct GpGraphics{
GpMatrix * worldtrans; /* world transform */ GpMatrix * worldtrans; /* world transform */
BOOL busy; /* hdc handle obtained by GdipGetDC */ BOOL busy; /* hdc handle obtained by GdipGetDC */
GpRegion *clip; GpRegion *clip;
UINT textcontrast; /* not used yet. get/set only */
}; };
struct GpBrush{ struct GpBrush{
......
...@@ -763,6 +763,7 @@ GpStatus WINGDIPAPI GdipCreateFromHDC2(HDC hdc, HANDLE hDevice, GpGraphics **gra ...@@ -763,6 +763,7 @@ GpStatus WINGDIPAPI GdipCreateFromHDC2(HDC hdc, HANDLE hDevice, GpGraphics **gra
(*graphics)->unit = UnitDisplay; (*graphics)->unit = UnitDisplay;
(*graphics)->scale = 1.0; (*graphics)->scale = 1.0;
(*graphics)->busy = FALSE; (*graphics)->busy = FALSE;
(*graphics)->textcontrast = 4;
return Ok; return Ok;
} }
...@@ -2507,6 +2508,18 @@ GpStatus WINGDIPAPI GdipGetSmoothingMode(GpGraphics *graphics, SmoothingMode *mo ...@@ -2507,6 +2508,18 @@ GpStatus WINGDIPAPI GdipGetSmoothingMode(GpGraphics *graphics, SmoothingMode *mo
return Ok; 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. */ /* FIXME: Text rendering hint is not used anywhere except the getter/setter. */
GpStatus WINGDIPAPI GdipGetTextRenderingHint(GpGraphics *graphics, GpStatus WINGDIPAPI GdipGetTextRenderingHint(GpGraphics *graphics,
TextRenderingHint *hint) TextRenderingHint *hint)
......
...@@ -902,6 +902,28 @@ static void test_clear(void) ...@@ -902,6 +902,28 @@ static void test_clear(void)
expect(InvalidParameter, status); 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) START_TEST(graphics)
{ {
struct GdiplusStartupInput gdiplusStartupInput; struct GdiplusStartupInput gdiplusStartupInput;
...@@ -926,6 +948,7 @@ START_TEST(graphics) ...@@ -926,6 +948,7 @@ START_TEST(graphics)
test_get_set_clip(); test_get_set_clip();
test_isempty(); test_isempty();
test_clear(); test_clear();
test_textcontrast();
GdiplusShutdown(gdiplusToken); GdiplusShutdown(gdiplusToken);
} }
...@@ -200,6 +200,7 @@ GpStatus WINGDIPAPI GdipGetPageScale(GpGraphics*,REAL*); ...@@ -200,6 +200,7 @@ GpStatus WINGDIPAPI GdipGetPageScale(GpGraphics*,REAL*);
GpStatus WINGDIPAPI GdipGetPageUnit(GpGraphics*,GpUnit*); GpStatus WINGDIPAPI GdipGetPageUnit(GpGraphics*,GpUnit*);
GpStatus WINGDIPAPI GdipGetPixelOffsetMode(GpGraphics*,PixelOffsetMode*); GpStatus WINGDIPAPI GdipGetPixelOffsetMode(GpGraphics*,PixelOffsetMode*);
GpStatus WINGDIPAPI GdipGetSmoothingMode(GpGraphics*,SmoothingMode*); GpStatus WINGDIPAPI GdipGetSmoothingMode(GpGraphics*,SmoothingMode*);
GpStatus WINGDIPAPI GdipGetTextContrast(GpGraphics*,UINT*);
GpStatus WINGDIPAPI GdipGetTextRenderingHint(GpGraphics*,TextRenderingHint*); GpStatus WINGDIPAPI GdipGetTextRenderingHint(GpGraphics*,TextRenderingHint*);
GpStatus WINGDIPAPI GdipGetWorldTransform(GpGraphics*,GpMatrix*); GpStatus WINGDIPAPI GdipGetWorldTransform(GpGraphics*,GpMatrix*);
GpStatus WINGDIPAPI GdipGraphicsClear(GpGraphics*,ARGB); GpStatus WINGDIPAPI GdipGraphicsClear(GpGraphics*,ARGB);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment