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

gdiplus: Added GdipGetTextContrast.

parent 48c4248d
......@@ -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)
......
......@@ -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{
......
......@@ -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)
......
......@@ -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);
}
......@@ -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);
......
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