[GDI32_WINETEST]

* Sync with Wine 1.3.29.

svn path=/trunk/; revision=53950
This commit is contained in:
Amine Khaldi 2011-10-03 09:26:08 +00:00
parent 3d7d862d32
commit 76fd17af43
18 changed files with 5892 additions and 679 deletions

View file

@ -1,4 +1,6 @@
set_rc_compiler()
add_definitions(
-D__ROS_LONG64__
-D_DLL -D__USE_CRTIMP)
@ -10,18 +12,21 @@ list(APPEND SOURCE
brush.c
clipping.c
dc.c
dib.c
font.c
gdiobj.c
generated.c
icm.c
font.c
mapping.c
metafile.c
palette.c
path.c
pen.c
testlist.c)
testlist.c
resource.rc)
add_executable(gdi32_winetest ${SOURCE})
allow_warnings(gdi32_winetest)
set_module_type(gdi32_winetest win32cui)
add_importlibs(gdi32_winetest gdi32 user32 advapi32 msvcrt kernel32 ntdll)
add_cd_file(TARGET gdi32_winetest DESTINATION reactos/bin FOR all)

File diff suppressed because it is too large Load diff

View file

@ -35,7 +35,8 @@ static void test_GetRandomRgn(void)
ok( hwnd != 0, "CreateWindow failed\n" );
SetRect(&window_rc, 400, 300, 500, 400);
MoveWindow(hwnd, window_rc.left, window_rc.top, window_rc.right - window_rc.left, window_rc.bottom - window_rc.top, FALSE);
SetWindowPos(hwnd, HWND_TOPMOST, window_rc.left, window_rc.top,
window_rc.right - window_rc.left, window_rc.bottom - window_rc.top, 0 );
hdc = GetDC(hwnd);
ret = GetRandomRgn(hdc, hrgn, 1);
@ -352,9 +353,114 @@ static void test_GetClipRgn(void)
ReleaseDC(NULL, hdc);
}
static void test_memory_dc_clipping(void)
{
HDC hdc;
HRGN hrgn, hrgn_empty;
HBITMAP hbmp;
RECT rc;
int ret;
hdc = CreateCompatibleDC(0);
hrgn_empty = CreateRectRgn(0, 0, 0, 0);
hrgn = CreateRectRgn(0, 0, 0, 0);
hbmp = CreateCompatibleBitmap(hdc, 100, 100);
ret = GetClipRgn(hdc, hrgn);
ok(ret == 0, "expected 0, got %d\n", ret);
ret = ExtSelectClipRgn(hdc, hrgn_empty, RGN_DIFF);
ok(ret == SIMPLEREGION, "expected SIMPLEREGION, got %d\n", ret);
ret = GetClipRgn(hdc, hrgn);
ok(ret == 1, "expected 1, got %d\n", ret);
ret = GetRgnBox(hrgn, &rc);
ok(ret == SIMPLEREGION, "expected SIMPLEREGION, got %d\n", ret);
ok(rc.left == 0 && rc.top == 0 && rc.right == 1 && rc.bottom == 1,
"expected 0,0-1,1, got %d,%d-%d,%d\n", rc.left, rc.top, rc.right, rc.bottom);
ret = ExtSelectClipRgn(hdc, 0, RGN_COPY);
ok(ret == SIMPLEREGION, "expected SIMPLEREGION, got %d\n", ret);
ret = GetClipRgn(hdc, hrgn);
ok(ret == 0, "expected 0, got %d\n", ret);
SelectObject(hdc, hbmp);
ret = ExtSelectClipRgn(hdc, hrgn_empty, RGN_DIFF);
ok(ret == SIMPLEREGION, "expected SIMPLEREGION, got %d\n", ret);
ret = GetClipRgn(hdc, hrgn);
ok(ret == 1, "expected 1, got %d\n", ret);
ret = GetRgnBox(hrgn, &rc);
ok(ret == SIMPLEREGION, "expected SIMPLEREGION, got %d\n", ret);
ok(rc.left == 0 && rc.top == 0 && rc.right == 100 && rc.bottom == 100,
"expected 0,0-100,100, got %d,%d-%d,%d\n", rc.left, rc.top, rc.right, rc.bottom);
DeleteDC(hdc);
DeleteObject(hrgn);
DeleteObject(hrgn_empty);
DeleteObject(hbmp);
}
static void test_window_dc_clipping(void)
{
HDC hdc;
HRGN hrgn, hrgn_empty;
HWND hwnd;
RECT rc;
int ret, screen_width, screen_height;
/* Windows versions earlier than Win2k do not support the virtual screen metrics,
* so we fall back to the primary screen metrics. */
screen_width = GetSystemMetrics(SM_CXVIRTUALSCREEN);
if(!screen_width) screen_width = GetSystemMetrics(SM_CXSCREEN);
screen_height = GetSystemMetrics(SM_CYVIRTUALSCREEN);
if(!screen_height) screen_height = GetSystemMetrics(SM_CYSCREEN);
trace("screen resolution %d x %d\n", screen_width, screen_height);
hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP,
-100, -100, screen_width * 2, screen_height * 2, 0, 0, 0, NULL);
hdc = GetWindowDC(0);
hrgn_empty = CreateRectRgn(0, 0, 0, 0);
hrgn = CreateRectRgn(0, 0, 0, 0);
ret = GetClipRgn(hdc, hrgn);
ok(ret == 0, "expected 0, got %d\n", ret);
ret = ExtSelectClipRgn(hdc, hrgn_empty, RGN_DIFF);
ok(ret == SIMPLEREGION, "expected SIMPLEREGION, got %d\n", ret);
ret = GetClipRgn(hdc, hrgn);
ok(ret == 1, "expected 1, got %d\n", ret);
ret = GetRgnBox(hrgn, &rc);
ok(ret == SIMPLEREGION, "expected SIMPLEREGION, got %d\n", ret);
ok(rc.left == 0 && rc.top == 0 && rc.right == screen_width && rc.bottom == screen_height,
"expected 0,0-%d,%d, got %d,%d-%d,%d\n", screen_width, screen_height,
rc.left, rc.top, rc.right, rc.bottom);
ret = ExtSelectClipRgn(hdc, 0, RGN_COPY);
ok(ret == SIMPLEREGION, "expected SIMPLEREGION, got %d\n", ret);
ret = GetClipRgn(hdc, hrgn);
ok(ret == 0, "expected 0, got %d\n", ret);
DeleteDC(hdc);
DeleteObject(hrgn);
DeleteObject(hrgn_empty);
DestroyWindow(hwnd);
}
START_TEST(clipping)
{
test_GetRandomRgn();
test_ExtCreateRegion();
test_GetClipRgn();
test_memory_dc_clipping();
test_window_dc_clipping();
}

View file

@ -30,6 +30,8 @@
#include "winuser.h"
#include "winerror.h"
static DWORD (WINAPI *pSetLayout)(HDC hdc, DWORD layout);
static void dump_region(HRGN hrgn)
{
DWORD i, size;
@ -72,7 +74,7 @@ static void test_savedc_2(void)
ok(hdc != NULL, "GetDC failed\n");
ret = GetClipBox(hdc, &rc_clip);
ok(ret == SIMPLEREGION, "GetClipBox returned %d instead of SIMPLEREGION\n", ret);
ok(ret == SIMPLEREGION || broken(ret == COMPLEXREGION), "GetClipBox returned %d instead of SIMPLEREGION\n", ret);
ret = GetClipRgn(hdc, hrgn);
ok(ret == 0, "GetClipRgn returned %d instead of 0\n", ret);
ret = GetRgnBox(hrgn, &rc);
@ -105,17 +107,23 @@ todo_wine
ok(ret == SIMPLEREGION, "IntersectClipRect returned %d instead of SIMPLEREGION\n", ret);
ret = GetClipBox(hdc, &rc_clip);
ok(ret == SIMPLEREGION, "GetClipBox returned %d instead of SIMPLEREGION\n", ret);
ok(ret == SIMPLEREGION || broken(ret == COMPLEXREGION), "GetClipBox returned %d instead of SIMPLEREGION\n", ret);
SetRect(&rc, 0, 0, 50, 50);
ok(EqualRect(&rc, &rc_clip), "rects are not equal\n");
ok(EqualRect(&rc, &rc_clip),
"rects are not equal: (%d,%d-%d,%d) - (%d,%d-%d,%d)\n",
rc.left, rc.top, rc.right, rc.bottom,
rc_clip.left, rc_clip.top, rc_clip.right, rc_clip.bottom);
ret = RestoreDC(hdc, 1);
ok(ret, "ret = %d\n", ret);
ret = GetClipBox(hdc, &rc_clip);
ok(ret == SIMPLEREGION, "GetClipBox returned %d instead of SIMPLEREGION\n", ret);
ok(ret == SIMPLEREGION || broken(ret == COMPLEXREGION), "GetClipBox returned %d instead of SIMPLEREGION\n", ret);
SetRect(&rc, 0, 0, 100, 100);
ok(EqualRect(&rc, &rc_clip), "rects are not equal\n");
ok(EqualRect(&rc, &rc_clip),
"rects are not equal: (%d,%d-%d,%d) - (%d,%d-%d,%d)\n",
rc.left, rc.top, rc.right, rc.bottom,
rc_clip.left, rc_clip.top, rc_clip.right, rc_clip.bottom);
DeleteObject(hrgn);
ReleaseDC(hwnd, hdc);
@ -257,20 +265,50 @@ static void test_GdiConvertToDevmodeW(void)
static void test_CreateCompatibleDC(void)
{
BOOL bRet;
HDC hDC;
HDC hNewDC;
HDC hdc, hNewDC, hdcMetafile;
HBITMAP bitmap;
INT caps;
bitmap = CreateBitmap( 10, 10, 1, 1, NULL );
/* Create a DC compatible with the screen */
hDC = CreateCompatibleDC(NULL);
ok(hDC != NULL, "CreateCompatibleDC returned %p\n", hDC);
hdc = CreateCompatibleDC(NULL);
ok(hdc != NULL, "CreateCompatibleDC returned %p\n", hdc);
ok( SelectObject( hdc, bitmap ) != 0, "SelectObject failed\n" );
caps = GetDeviceCaps( hdc, TECHNOLOGY );
ok( caps == DT_RASDISPLAY, "wrong caps %u\n", caps );
/* Delete this DC, this should succeed */
bRet = DeleteDC(hDC);
bRet = DeleteDC(hdc);
ok(bRet == TRUE, "DeleteDC returned %u\n", bRet);
/* Try to create a DC compatible to the deleted DC. This has to fail */
hNewDC = CreateCompatibleDC(hDC);
hNewDC = CreateCompatibleDC(hdc);
ok(hNewDC == NULL, "CreateCompatibleDC returned %p\n", hNewDC);
hdc = GetDC( 0 );
hdcMetafile = CreateEnhMetaFileA(hdc, NULL, NULL, NULL);
ok(hdcMetafile != 0, "CreateEnhMetaFileA failed\n");
hNewDC = CreateCompatibleDC( hdcMetafile );
ok(hNewDC != NULL, "CreateCompatibleDC failed\n");
ok( SelectObject( hNewDC, bitmap ) != 0, "SelectObject failed\n" );
caps = GetDeviceCaps( hdcMetafile, TECHNOLOGY );
ok( caps == DT_RASDISPLAY, "wrong caps %u\n", caps );
caps = GetDeviceCaps( hNewDC, TECHNOLOGY );
ok( caps == DT_RASDISPLAY, "wrong caps %u\n", caps );
DeleteDC( hNewDC );
DeleteEnhMetaFile( CloseEnhMetaFile( hdcMetafile ));
ReleaseDC( 0, hdc );
hdcMetafile = CreateMetaFileA(NULL);
ok(hdcMetafile != 0, "CreateEnhMetaFileA failed\n");
hNewDC = CreateCompatibleDC( hdcMetafile );
ok(hNewDC == NULL, "CreateCompatibleDC succeeded\n");
caps = GetDeviceCaps( hdcMetafile, TECHNOLOGY );
ok( caps == DT_METAFILE, "wrong caps %u\n", caps );
DeleteMetaFile( CloseMetaFile( hdcMetafile ));
DeleteObject( bitmap );
}
static void test_DC_bitmap(void)
@ -494,66 +532,148 @@ todo_wine
ok(ret, "UnregisterClassA failed\n");
}
static void test_boundsrect_invalid(void)
static void test_boundsrect(void)
{
HDC hdc;
RECT rect, expect;
HBITMAP bitmap;
RECT rect, expect, set_rect;
UINT ret;
hdc = GetDC(NULL);
ok(hdc != NULL, "GetDC failed\n");
hdc = CreateCompatibleDC(0);
ok(hdc != NULL, "CreateCompatibleDC failed\n");
bitmap = CreateCompatibleBitmap( hdc, 200, 200 );
SelectObject( hdc, bitmap );
ret = GetBoundsRect(hdc, NULL, 0);
ok(ret == 0 ||
broken(ret == DCB_RESET), /* Win9x */
"Expected GetBoundsRect to return 0, got %u\n", ret);
ok(ret == 0, "Expected GetBoundsRect to return 0, got %u\n", ret);
ret = GetBoundsRect(hdc, NULL, ~0U);
ok(ret == 0 ||
broken(ret == DCB_RESET), /* Win9x */
ok(ret == 0, "Expected GetBoundsRect to return 0, got %u\n", ret);
/* Test parameter handling order. */
SetRect(&set_rect, 10, 20, 40, 50);
ret = SetBoundsRect(hdc, &set_rect, DCB_SET);
ok(ret & DCB_RESET,
"Expected return flag DCB_RESET to be set, got %u\n", ret);
ret = GetBoundsRect(hdc, NULL, DCB_RESET);
ok(ret == 0,
"Expected GetBoundsRect to return 0, got %u\n", ret);
if (GetBoundsRect(hdc, NULL, 0) == DCB_RESET)
win_skip("Win9x fails catastrophically with first GetBoundsRect call\n");
else
ret = GetBoundsRect(hdc, &rect, 0);
ok(ret == DCB_RESET,
"Expected GetBoundsRect to return DCB_RESET, got %u\n", ret);
SetRect(&expect, 0, 0, 0, 0);
ok(EqualRect(&rect, &expect) ||
broken(EqualRect(&rect, &set_rect)), /* nt4 sp1-5 */
"Expected output rectangle (0,0)-(0,0), got (%d,%d)-(%d,%d)\n",
rect.left, rect.top, rect.right, rect.bottom);
ret = GetBoundsRect(NULL, NULL, 0);
ok(ret == 0, "Expected GetBoundsRect to return 0, got %u\n", ret);
ret = GetBoundsRect(NULL, NULL, ~0U);
ok(ret == 0, "Expected GetBoundsRect to return 0, got %u\n", ret);
ret = SetBoundsRect(NULL, NULL, 0);
ok(ret == 0, "Expected SetBoundsRect to return 0, got %u\n", ret);
ret = SetBoundsRect(NULL, NULL, ~0U);
ok(ret == 0, "Expected SetBoundsRect to return 0, got %u\n", ret);
SetRect(&set_rect, 10, 20, 40, 50);
ret = SetBoundsRect(hdc, &set_rect, DCB_SET);
ok(ret == (DCB_RESET | DCB_DISABLE), "SetBoundsRect returned %x\n", ret);
ret = GetBoundsRect(hdc, &rect, 0);
ok(ret == DCB_SET, "GetBoundsRect returned %x\n", ret);
SetRect(&expect, 10, 20, 40, 50);
ok(EqualRect(&rect, &expect), "Got (%d,%d)-(%d,%d)\n",
rect.left, rect.top, rect.right, rect.bottom);
SetMapMode( hdc, MM_ANISOTROPIC );
SetViewportExtEx( hdc, 2, 2, NULL );
ret = GetBoundsRect(hdc, &rect, 0);
ok(ret == DCB_SET, "GetBoundsRect returned %x\n", ret);
SetRect(&expect, 5, 10, 20, 25);
ok(EqualRect(&rect, &expect), "Got (%d,%d)-(%d,%d)\n",
rect.left, rect.top, rect.right, rect.bottom);
SetViewportOrgEx( hdc, 20, 30, NULL );
ret = GetBoundsRect(hdc, &rect, 0);
ok(ret == DCB_SET, "GetBoundsRect returned %x\n", ret);
SetRect(&expect, -5, -5, 10, 10);
ok(EqualRect(&rect, &expect), "Got (%d,%d)-(%d,%d)\n",
rect.left, rect.top, rect.right, rect.bottom);
SetRect(&set_rect, 10, 20, 40, 50);
ret = SetBoundsRect(hdc, &set_rect, DCB_SET);
ok(ret == (DCB_SET | DCB_DISABLE), "SetBoundsRect returned %x\n", ret);
ret = GetBoundsRect(hdc, &rect, 0);
ok(ret == DCB_SET, "GetBoundsRect returned %x\n", ret);
SetRect(&expect, 10, 20, 40, 50);
ok(EqualRect(&rect, &expect), "Got (%d,%d)-(%d,%d)\n",
rect.left, rect.top, rect.right, rect.bottom);
SetMapMode( hdc, MM_TEXT );
SetViewportOrgEx( hdc, 0, 0, NULL );
ret = GetBoundsRect(hdc, &rect, 0);
ok(ret == DCB_SET, "GetBoundsRect returned %x\n", ret);
SetRect(&expect, 40, 70, 100, 130);
ok(EqualRect(&rect, &expect), "Got (%d,%d)-(%d,%d)\n",
rect.left, rect.top, rect.right, rect.bottom);
if (pSetLayout)
{
/* Test parameter handling order. */
SetRect(&rect, 0, 0, 50, 50);
ret = SetBoundsRect(hdc, &rect, DCB_SET);
ok(ret & DCB_RESET,
"Expected return flag DCB_RESET to be set, got %u\n", ret);
ret = GetBoundsRect(hdc, NULL, DCB_RESET);
ok(ret == 0,
"Expected GetBoundsRect to return 0, got %u\n", ret);
pSetLayout( hdc, LAYOUT_RTL );
ret = GetBoundsRect(hdc, &rect, 0);
ok(ret == DCB_RESET,
"Expected GetBoundsRect to return DCB_RESET, got %u\n", ret);
SetRect(&expect, 0, 0, 0, 0);
ok(EqualRect(&rect, &expect),
"Expected output rectangle (0,0)-(0,0), got (%d,%d)-(%d,%d)\n",
ok(ret == DCB_SET, "GetBoundsRect returned %x\n", ret);
SetRect(&expect, 159, 70, 99, 130);
ok(EqualRect(&rect, &expect), "Got (%d,%d)-(%d,%d)\n",
rect.left, rect.top, rect.right, rect.bottom);
SetRect(&set_rect, 50, 25, 30, 35);
ret = SetBoundsRect(hdc, &set_rect, DCB_SET);
ok(ret == (DCB_SET | DCB_DISABLE), "SetBoundsRect returned %x\n", ret);
ret = GetBoundsRect(hdc, &rect, 0);
ok(ret == DCB_SET, "GetBoundsRect returned %x\n", ret);
SetRect(&expect, 50, 25, 30, 35);
ok(EqualRect(&rect, &expect), "Got (%d,%d)-(%d,%d)\n",
rect.left, rect.top, rect.right, rect.bottom);
pSetLayout( hdc, LAYOUT_LTR );
ret = GetBoundsRect(hdc, &rect, 0);
ok(ret == DCB_SET, "GetBoundsRect returned %x\n", ret);
SetRect(&expect, 149, 25, 169, 35);
ok(EqualRect(&rect, &expect), "Got (%d,%d)-(%d,%d)\n",
rect.left, rect.top, rect.right, rect.bottom);
}
if (GetBoundsRect(hdc, NULL, 0) == DCB_RESET)
win_skip("Win9x fails catastrophically with NULL device context parameter\n");
else
/* empty rect resets, except on nt4 */
SetRect(&expect, 20, 20, 10, 10);
ret = SetBoundsRect(hdc, &set_rect, DCB_SET);
ok(ret == (DCB_SET | DCB_DISABLE), "SetBoundsRect returned %x\n", ret);
ret = GetBoundsRect(hdc, &rect, 0);
ok(ret == DCB_RESET || broken(ret == DCB_SET) /* nt4 */,
"GetBoundsRect returned %x\n", ret);
if (ret == DCB_RESET)
{
ret = GetBoundsRect(NULL, NULL, 0);
ok(ret == 0, "Expected GetBoundsRect to return 0, got %u\n", ret);
SetRect(&expect, 0, 0, 0, 0);
ok(EqualRect(&rect, &expect), "Got (%d,%d)-(%d,%d)\n",
rect.left, rect.top, rect.right, rect.bottom);
ret = GetBoundsRect(NULL, NULL, ~0U);
ok(ret == 0, "Expected GetBoundsRect to return 0, got %u\n", ret);
ret = SetBoundsRect(NULL, NULL, 0);
ok(ret == 0, "Expected SetBoundsRect to return 0, got %u\n", ret);
ret = SetBoundsRect(NULL, NULL, ~0U);
ok(ret == 0, "Expected SetBoundsRect to return 0, got %u\n", ret);
SetRect(&expect, 20, 20, 20, 20);
ret = SetBoundsRect(hdc, &set_rect, DCB_SET);
ok(ret == (DCB_RESET | DCB_DISABLE), "SetBoundsRect returned %x\n", ret);
ret = GetBoundsRect(hdc, &rect, 0);
ok(ret == DCB_RESET, "GetBoundsRect returned %x\n", ret);
SetRect(&expect, 0, 0, 0, 0);
ok(EqualRect(&rect, &expect), "Got (%d,%d)-(%d,%d)\n",
rect.left, rect.top, rect.right, rect.bottom);
}
DeleteDC(hdc);
DeleteDC( hdc );
DeleteObject( bitmap );
}
static void test_desktop_colorres(void)
@ -592,17 +712,87 @@ static void test_desktop_colorres(void)
}
}
DeleteDC(hdc);
ReleaseDC(NULL, hdc);
}
static void test_gamma(void)
{
BOOL ret;
HDC hdc = GetDC(NULL);
WORD oldramp[3][256], ramp[3][256];
INT i;
ret = GetDeviceGammaRamp(hdc, &oldramp);
if (!ret)
{
win_skip("GetDeviceGammaRamp failed, skipping tests\n");
goto done;
}
/* try to set back old ramp */
ret = SetDeviceGammaRamp(hdc, &oldramp);
if (!ret)
{
win_skip("SetDeviceGammaRamp failed, skipping tests\n");
goto done;
}
memcpy(ramp, oldramp, sizeof(ramp));
/* set one color ramp to zeros */
memset(ramp[0], 0, sizeof(ramp[0]));
ret = SetDeviceGammaRamp(hdc, &ramp);
ok(!ret, "SetDeviceGammaRamp succeeded\n");
/* set one color ramp to a flat straight rising line */
for (i = 0; i < 256; i++) ramp[0][i] = i;
ret = SetDeviceGammaRamp(hdc, &ramp);
todo_wine ok(!ret, "SetDeviceGammaRamp succeeded\n");
/* set one color ramp to a steep straight rising line */
for (i = 0; i < 256; i++) ramp[0][i] = i * 256;
ret = SetDeviceGammaRamp(hdc, &ramp);
ok(ret, "SetDeviceGammaRamp failed\n");
/* try a bright gamma ramp */
ramp[0][0] = 0;
ramp[0][1] = 0x7FFF;
for (i = 2; i < 256; i++) ramp[0][i] = 0xFFFF;
ret = SetDeviceGammaRamp(hdc, &ramp);
ok(!ret, "SetDeviceGammaRamp succeeded\n");
/* try ramps which are not uniform */
ramp[0][0] = 0;
for (i = 1; i < 256; i++) ramp[0][i] = ramp[0][i - 1] + 512;
ret = SetDeviceGammaRamp(hdc, &ramp);
ok(ret, "SetDeviceGammaRamp failed\n");
ramp[0][0] = 0;
for (i = 2; i < 256; i+=2)
{
ramp[0][i - 1] = ramp[0][i - 2];
ramp[0][i] = ramp[0][i - 2] + 512;
}
ret = SetDeviceGammaRamp(hdc, &ramp);
ok(ret, "SetDeviceGammaRamp failed\n");
/* cleanup: set old ramp again */
ret = SetDeviceGammaRamp(hdc, &oldramp);
ok(ret, "SetDeviceGammaRamp failed\n");
done:
ReleaseDC(NULL, hdc);
}
START_TEST(dc)
{
pSetLayout = (void *)GetProcAddress( GetModuleHandle("gdi32.dll"), "SetLayout");
test_savedc();
test_savedc_2();
test_GdiConvertToDevmodeW();
test_CreateCompatibleDC();
test_DC_bitmap();
test_DeleteDC();
test_boundsrect_invalid();
test_boundsrect();
test_desktop_colorres();
test_gamma();
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -11,14 +11,16 @@
<file>brush.c</file>
<file>clipping.c</file>
<file>dc.c</file>
<file>dib.c</file>
<file>font.c</file>
<file>gdiobj.c</file>
<file>generated.c</file>
<file>icm.c</file>
<file>font.c</file>
<file>mapping.c</file>
<file>metafile.c</file>
<file>palette.c</file>
<file>path.c</file>
<file>pen.c</file>
<file>testlist.c</file>
<file>resource.rc</file>
</module>

View file

@ -81,6 +81,14 @@ static void test_gdi_objects(void)
"GetObject(NULL obj), expected 0, NO_ERROR, got %d, %u\n",
i, GetLastError());
/* GetObject expects ERROR_NOACCESS when passed an invalid buffer */
hp = SelectObject(hdc, GetStockObject(BLACK_PEN));
SetLastError(0);
i = GetObjectA(hp, (INT_PTR)buff, (LPVOID)sizeof(buff));
ok (!i && (GetLastError() == 0 || GetLastError() == ERROR_NOACCESS),
"GetObject(invalid buff), expected 0, ERROR_NOACCESS, got %d, %u\n",
i, GetLastError());
/* GetObjectType does SetLastError() on a null object */
SetLastError(0);
i = GetObjectType(NULL);
@ -110,6 +118,7 @@ struct hgdiobj_event
static DWORD WINAPI thread_proc(void *param)
{
LOGPEN lp;
DWORD status;
struct hgdiobj_event *hgdiobj_event = param;
hgdiobj_event->hdc = CreateDC("display", NULL, NULL, NULL);
@ -122,8 +131,8 @@ static DWORD WINAPI thread_proc(void *param)
ok(hgdiobj_event->hgdiobj2 != 0, "Failed to create pen\n");
SetEvent(hgdiobj_event->ready_event);
ok(WaitForSingleObject(hgdiobj_event->stop_event, INFINITE) == WAIT_OBJECT_0,
"WaitForSingleObject error %u\n", GetLastError());
status = WaitForSingleObject(hgdiobj_event->stop_event, INFINITE);
ok(status == WAIT_OBJECT_0, "WaitForSingleObject error %u\n", GetLastError());
ok(!GetObject(hgdiobj_event->hgdiobj1, sizeof(lp), &lp), "GetObject should fail\n");
@ -139,6 +148,8 @@ static void test_thread_objects(void)
HANDLE hthread;
struct hgdiobj_event hgdiobj_event;
INT ret;
DWORD status;
BOOL bRet;
hgdiobj_event.stop_event = CreateEvent(NULL, 0, 0, NULL);
ok(hgdiobj_event.stop_event != NULL, "CreateEvent error %u\n", GetLastError());
@ -148,11 +159,11 @@ static void test_thread_objects(void)
hthread = CreateThread(NULL, 0, thread_proc, &hgdiobj_event, 0, &tid);
ok(hthread != NULL, "CreateThread error %u\n", GetLastError());
ok(WaitForSingleObject(hgdiobj_event.ready_event, INFINITE) == WAIT_OBJECT_0,
"WaitForSingleObject error %u\n", GetLastError());
status = WaitForSingleObject(hgdiobj_event.ready_event, INFINITE);
ok(status == WAIT_OBJECT_0, "WaitForSingleObject error %u\n", GetLastError());
ok(GetObject(hgdiobj_event.hgdiobj1, sizeof(lp), &lp) == sizeof(lp),
"GetObject error %u\n", GetLastError());
ret = GetObject(hgdiobj_event.hgdiobj1, sizeof(lp), &lp);
ok(ret == sizeof(lp), "GetObject error %u\n", GetLastError());
ok(lp.lopnStyle == PS_DASHDOTDOT, "wrong pen style %d\n", lp.lopnStyle);
ok(lp.lopnWidth.x == 17, "wrong pen width.y %d\n", lp.lopnWidth.x);
ok(lp.lopnWidth.y == 0, "wrong pen width.y %d\n", lp.lopnWidth.y);
@ -161,20 +172,23 @@ static void test_thread_objects(void)
ret = GetDeviceCaps(hgdiobj_event.hdc, TECHNOLOGY);
ok(ret == DT_RASDISPLAY, "GetDeviceCaps(TECHNOLOGY) should return DT_RASDISPLAY not %d\n", ret);
ok(DeleteObject(hgdiobj_event.hgdiobj1), "DeleteObject error %u\n", GetLastError());
ok(DeleteDC(hgdiobj_event.hdc), "DeleteDC error %u\n", GetLastError());
bRet = DeleteObject(hgdiobj_event.hgdiobj1);
ok(bRet, "DeleteObject error %u\n", GetLastError());
bRet = DeleteDC(hgdiobj_event.hdc);
ok(bRet, "DeleteDC error %u\n", GetLastError());
type = GetObjectType(hgdiobj_event.hgdiobj2);
ok(type == OBJ_REGION, "GetObjectType returned %u\n", type);
SetEvent(hgdiobj_event.stop_event);
ok(WaitForSingleObject(hthread, INFINITE) == WAIT_OBJECT_0,
"WaitForSingleObject error %u\n", GetLastError());
status = WaitForSingleObject(hthread, INFINITE);
ok(status == WAIT_OBJECT_0, "WaitForSingleObject error %u\n", GetLastError());
CloseHandle(hthread);
type = GetObjectType(hgdiobj_event.hgdiobj2);
ok(type == OBJ_REGION, "GetObjectType returned %u\n", type);
ok(DeleteObject(hgdiobj_event.hgdiobj2), "DeleteObject error %u\n", GetLastError());
bRet = DeleteObject(hgdiobj_event.hgdiobj2);
ok(bRet, "DeleteObject error %u\n", GetLastError());
CloseHandle(hgdiobj_event.stop_event);
CloseHandle(hgdiobj_event.ready_event);
@ -207,7 +221,7 @@ static void test_GetCurrentObject(void)
hobj = GetCurrentObject(hdc, OBJ_PEN);
ok(hobj == hpen, "OBJ_PEN is wrong: %p\n", hobj);
hobj = GetCurrentObject(hdc, OBJ_EXTPEN);
ok(hobj == hpen || broken(hobj == 0) /* win9x */, "OBJ_EXTPEN is wrong: %p\n", hobj);
ok(hobj == hpen, "OBJ_EXTPEN is wrong: %p\n", hobj);
hbrush = CreateSolidBrush(RGB(10, 20, 30));
assert(hbrush != 0);
@ -243,7 +257,7 @@ static void test_GetCurrentObject(void)
hobj = GetCurrentObject(hdc, OBJ_PEN);
ok(hobj == hpen, "OBJ_PEN is wrong: %p\n", hobj);
hobj = GetCurrentObject(hdc, OBJ_EXTPEN);
ok(hobj == hpen || broken(hobj == 0) /* win9x */, "OBJ_EXTPEN is wrong: %p\n", hobj);
ok(hobj == hpen, "OBJ_EXTPEN is wrong: %p\n", hobj);
hcs = GetColorSpace(hdc);
if (hcs)
@ -254,7 +268,7 @@ static void test_GetCurrentObject(void)
ok(hcs != 0, "CreateColorSpace failed\n");
SelectObject(hdc, hcs);
hobj = GetCurrentObject(hdc, OBJ_COLORSPACE);
ok(hobj == hcs || broken(hobj == 0) /* win9x */, "OBJ_COLORSPACE is wrong: %p\n", hobj);
ok(hobj == hcs, "OBJ_COLORSPACE is wrong: %p\n", hobj);
}
hrgn = CreateRectRgn(1, 1, 100, 100);

View file

@ -63,16 +63,10 @@ static void test_GetICMProfileA( HDC dc )
ok( !ret, "GetICMProfileA succeeded\n" );
ok( size, "expected size > 0\n" );
ok( filename[0] == 0, "Expected filename to be empty\n" );
ok( error == ERROR_INSUFFICIENT_BUFFER ||
error == ERROR_SUCCESS, /* Win95 */
"got %d, expected ERROR_INSUFFICIENT_BUFFER or ERROR_SUCCESS(Win95)\n", error );
ok( error == ERROR_INSUFFICIENT_BUFFER, "got %d, expected ERROR_INSUFFICIENT_BUFFER\n", error );
/* Next test will crash on Win95 */
if ( error == ERROR_INSUFFICIENT_BUFFER )
{
ret = GetICMProfileA( dc, NULL, filename );
ok( !ret, "GetICMProfileA succeeded\n" );
}
ret = GetICMProfileA( dc, NULL, filename );
ok( !ret, "GetICMProfileA succeeded\n" );
size = MAX_PATH;
ret = GetICMProfileA( dc, &size, filename );
@ -176,6 +170,129 @@ static void test_SetICMMode( HDC dc )
DeleteDC( dc );
}
static CALLBACK INT enum_profiles_callbackA( LPSTR filename, LPARAM lparam )
{
trace("%s\n", filename);
return 1;
}
static void test_EnumICMProfilesA( HDC dc )
{
INT ret;
ret = EnumICMProfilesA( NULL, NULL, 0 );
ok(ret == -1 || broken(ret == 0) /* nt4 */, "expected -1, got %d\n", ret);
ret = EnumICMProfilesA( dc, enum_profiles_callbackA, 0 );
ok(ret == -1 || ret == 1 || broken(ret == 0) /* nt4 */,
"expected -1 or 1, got %d\n", ret);
ret = EnumICMProfilesA( dc, NULL, 0 );
ok(ret == -1 || broken(ret == 0) /* nt4 */, "expected -1, got %d\n", ret);
}
static CALLBACK INT enum_profiles_callbackW( LPWSTR filename, LPARAM lparam )
{
return 1;
}
static void test_EnumICMProfilesW( HDC dc )
{
INT ret;
ret = EnumICMProfilesW( NULL, NULL, 0 );
ok(ret == -1 || broken(ret == 0) /* NT4 */, "expected -1, got %d\n", ret);
ret = EnumICMProfilesW( dc, NULL, 0 );
ok(ret == -1 || broken(ret == 0) /* NT4 */, "expected -1, got %d\n", ret);
ret = EnumICMProfilesW( dc, enum_profiles_callbackW, 0 );
ok(ret == -1 || ret == 1 || broken(ret == 0) /* NT4 */, "expected -1 or 1, got %d\n", ret);
}
static void test_SetICMProfileA( HDC dc )
{
BOOL ret;
char profile[MAX_PATH];
DWORD len, error;
SetLastError( 0xdeadbeef );
ret = SetICMProfileA( NULL, NULL );
if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
{
win_skip("SetICMProfileA is not implemented\n");
return;
}
len = sizeof(profile);
ret = GetICMProfileA( dc, &len, profile );
ok(ret, "GetICMProfileA failed %u\n", GetLastError());
SetLastError( 0xdeadbeef );
ret = SetICMProfileA( NULL, NULL );
error = GetLastError();
ok(!ret, "SetICMProfileA succeeded\n");
ok(error == ERROR_INVALID_PARAMETER,
"expected ERROR_INVALID_PARAMETER, got %u\n", error);
SetLastError( 0xdeadbeef );
ret = SetICMProfileA( NULL, profile );
error = GetLastError();
ok(!ret, "SetICMProfileA succeeded\n");
ok(error == ERROR_INVALID_HANDLE,
"expected ERROR_INVALID_HANDLE, got %u\n", error);
SetLastError( 0xdeadbeef );
ret = SetICMProfileA( dc, NULL );
error = GetLastError();
ok(!ret, "SetICMProfileA succeeded\n");
ok(error == ERROR_INVALID_PARAMETER,
"expected ERROR_INVALID_PARAMETER, got %u\n", error);
ret = SetICMProfileA( dc, profile );
ok(ret, "SetICMProfileA failed %u\n", GetLastError());
}
static void test_SetICMProfileW( HDC dc )
{
BOOL ret;
WCHAR profile[MAX_PATH];
DWORD len, error;
SetLastError( 0xdeadbeef );
ret = SetICMProfileW( NULL, NULL );
if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
{
win_skip("SetICMProfileW is not implemented\n");
return;
}
len = sizeof(profile)/sizeof(profile[0]);
ret = GetICMProfileW( dc, &len, profile );
ok(ret, "GetICMProfileW failed %u\n", GetLastError());
SetLastError( 0xdeadbeef );
ret = SetICMProfileW( NULL, NULL );
error = GetLastError();
ok(!ret, "SetICMProfileW succeeded\n");
ok(error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", error);
SetLastError( 0xdeadbeef );
ret = SetICMProfileW( NULL, profile );
error = GetLastError();
ok(!ret, "SetICMProfileW succeeded\n");
ok(error == ERROR_INVALID_HANDLE, "expected ERROR_INVALID_HANDLE, got %u\n", error);
SetLastError( 0xdeadbeef );
ret = SetICMProfileW( dc, NULL );
error = GetLastError();
ok(!ret, "SetICMProfileW succeeded\n");
ok(error == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %u\n", error);
ret = SetICMProfileW( dc, profile );
ok(ret, "SetICMProfileW failed %u\n", GetLastError());
}
START_TEST(icm)
{
HDC dc = GetDC( NULL );
@ -183,6 +300,10 @@ START_TEST(icm)
test_GetICMProfileA( dc );
test_GetICMProfileW( dc );
test_SetICMMode( dc );
test_EnumICMProfilesA( dc );
test_EnumICMProfilesW( dc );
test_SetICMProfileA( dc );
test_SetICMProfileW( dc );
ReleaseDC( NULL, dc );
}

View file

@ -29,7 +29,13 @@
#include "winuser.h"
#include "winerror.h"
#define rough_match(got, expected) (abs((got) - (expected)) <= 5)
static DWORD (WINAPI *pSetLayout)(HDC hdc, DWORD layout);
static DWORD (WINAPI *pGetLayout)(HDC hdc);
static INT (WINAPI *pGetRandomRgn)(HDC hDC, HRGN hRgn, INT iCode);
static BOOL (WINAPI *pGetTransform)(HDC, DWORD, XFORM *);
static DWORD (WINAPI *pSetVirtualResolution)(HDC, DWORD, DWORD, DWORD, DWORD);
#define rough_match(got, expected) (abs( MulDiv( (got) - (expected), 1000, (expected) )) <= 5)
#define expect_LPtoDP(_hdc, _x, _y) \
{ \
@ -39,7 +45,7 @@
ok(rough_match(_pt.y, _y), "expected y %d, got %d\n", (_y), _pt.y); \
}
#define expect_world_trasform(_hdc, _em11, _em22) \
#define expect_world_transform(_hdc, _em11, _em22) \
{ \
BOOL _ret; \
XFORM _xform; \
@ -73,16 +79,11 @@
static void test_world_transform(void)
{
BOOL is_win9x;
HDC hdc;
INT ret, size_cx, size_cy, res_x, res_y, dpi_x, dpi_y;
XFORM xform;
SIZE size;
SetLastError(0xdeadbeef);
GetWorldTransform(0, NULL);
is_win9x = GetLastError() == ERROR_CALL_NOT_IMPLEMENTED;
hdc = CreateCompatibleDC(0);
xform.eM11 = 1.0f;
@ -105,30 +106,22 @@ static void test_world_transform(void)
expect_viewport_ext(hdc, 1, 1);
expect_window_ext(hdc, 1, 1);
expect_world_trasform(hdc, 1.0, 1.0);
expect_world_transform(hdc, 1.0, 1.0);
expect_LPtoDP(hdc, 1000, 1000);
SetLastError(0xdeadbeef);
ret = SetMapMode(hdc, MM_LOMETRIC);
ok(ret == MM_TEXT, "expected MM_TEXT, got %d\n", ret);
if (is_win9x)
{
expect_viewport_ext(hdc, dpi_x, dpi_y);
expect_window_ext(hdc, 254, -254);
}
else
{
expect_viewport_ext(hdc, res_x, -res_y);
ok( GetWindowExtEx( hdc, &size ), "GetWindowExtEx failed\n" );
ok( size.cx == size_cx * 10 ||
size.cx == MulDiv( res_x, 254, dpi_x ), /* Vista uses a more precise method */
"expected cx %d or %d, got %d\n", size_cx * 10, MulDiv( res_x, 254, dpi_x ), size.cx );
ok( size.cy == size_cy * 10 ||
size.cy == MulDiv( res_y, 254, dpi_y ), /* Vista uses a more precise method */
"expected cy %d or %d, got %d\n", size_cy * 10, MulDiv( res_y, 254, dpi_y ), size.cy );
}
expect_world_trasform(hdc, 1.0, 1.0);
expect_viewport_ext(hdc, res_x, -res_y);
ok( GetWindowExtEx( hdc, &size ), "GetWindowExtEx failed\n" );
ok( rough_match( size.cx, size_cx * 10 ) ||
rough_match( size.cx, MulDiv( res_x, 254, dpi_x )), /* Vista uses a more precise method */
"expected cx %d or %d, got %d\n", size_cx * 10, MulDiv( res_x, 254, dpi_x ), size.cx );
ok( rough_match( size.cy, size_cy * 10 ) ||
rough_match( size.cy, MulDiv( res_y, 254, dpi_y )), /* Vista uses a more precise method */
"expected cy %d or %d, got %d\n", size_cy * 10, MulDiv( res_y, 254, dpi_y ), size.cy );
expect_world_transform(hdc, 1.0, 1.0);
expect_LPtoDP(hdc, MulDiv(1000 / 10, res_x, size_cx), -MulDiv(1000 / 10, res_y, size_cy));
SetLastError(0xdeadbeef);
@ -137,7 +130,7 @@ static void test_world_transform(void)
expect_viewport_ext(hdc, 1, 1);
expect_window_ext(hdc, 1, 1);
expect_world_trasform(hdc, 1.0, 1.0);
expect_world_transform(hdc, 1.0, 1.0);
expect_LPtoDP(hdc, 1000, 1000);
ret = SetGraphicsMode(hdc, GM_ADVANCED);
@ -150,7 +143,7 @@ static void test_world_transform(void)
expect_viewport_ext(hdc, 1, 1);
expect_window_ext(hdc, 1, 1);
expect_world_trasform(hdc, 1.0, 1.0);
expect_world_transform(hdc, 1.0, 1.0);
expect_LPtoDP(hdc, 1000, 1000);
/* The transform must conform to (eM11 * eM22 != eM12 * eM21) requirement */
@ -177,7 +170,7 @@ static void test_world_transform(void)
expect_viewport_ext(hdc, 1, 1);
expect_window_ext(hdc, 1, 1);
expect_world_trasform(hdc, 20.0, 20.0);
expect_world_transform(hdc, 20.0, 20.0);
expect_LPtoDP(hdc, 20000, 20000);
SetLastError(0xdeadbeef);
@ -186,13 +179,13 @@ static void test_world_transform(void)
expect_viewport_ext(hdc, res_x, -res_y);
ok( GetWindowExtEx( hdc, &size ), "GetWindowExtEx failed\n" );
ok( size.cx == size_cx * 10 ||
size.cx == MulDiv( res_x, 254, dpi_x ), /* Vista uses a more precise method */
ok( rough_match( size.cx, size_cx * 10 ) ||
rough_match( size.cx, MulDiv( res_x, 254, dpi_x )), /* Vista uses a more precise method */
"expected cx %d or %d, got %d\n", size_cx * 10, MulDiv( res_x, 254, dpi_x ), size.cx );
ok( size.cy == size_cy * 10 ||
size.cy == MulDiv( res_y, 254, dpi_y ), /* Vista uses a more precise method */
ok( rough_match( size.cy, size_cy * 10 ) ||
rough_match( size.cy, MulDiv( res_y, 254, dpi_y )), /* Vista uses a more precise method */
"expected cy %d or %d, got %d\n", size_cy * 10, MulDiv( res_y, 254, dpi_y ), size.cy );
expect_world_trasform(hdc, 20.0, 20.0);
expect_world_transform(hdc, 20.0, 20.0);
expect_LPtoDP(hdc, MulDiv(20000, res_x, size.cx), -MulDiv(20000, res_y, size.cy));
SetLastError(0xdeadbeef);
@ -201,34 +194,210 @@ static void test_world_transform(void)
expect_viewport_ext(hdc, 1, 1);
expect_window_ext(hdc, 1, 1);
expect_world_trasform(hdc, 20.0, 20.0);
expect_world_transform(hdc, 20.0, 20.0);
expect_LPtoDP(hdc, 20000, 20000);
size.cx = 0xdeadbeef;
size.cy = 0xdeadbeef;
ret = SetViewportExtEx(hdc, -1, -1, &size);
ok(ret, "SetViewportExtEx(-1, -1) failed\n");
ok(size.cx == 1 && size.cy == 1, "expected 1,1 got %d,%d\n", size.cx, size.cy);
expect_viewport_ext(hdc, 1, 1);
expect_window_ext(hdc, 1, 1);
expect_world_transform(hdc, 20.0, 20.0);
expect_LPtoDP(hdc, 20000, 20000);
ret = SetMapMode(hdc, MM_ANISOTROPIC);
ok(ret == MM_TEXT, "expected MM_TEXT, got %d\n", ret);
expect_viewport_ext(hdc, 1, 1);
expect_window_ext(hdc, 1, 1);
expect_world_transform(hdc, 20.0, 20.0);
expect_LPtoDP(hdc, 20000, 20000);
size.cx = 0xdeadbeef;
size.cy = 0xdeadbeef;
ret = SetViewportExtEx(hdc, -1, -1, &size);
ok(ret, "SetViewportExtEx(-1, -1) failed\n");
ok(size.cx == 1 && size.cy == 1, "expected 1,1 got %d,%d\n", size.cx, size.cy);
expect_viewport_ext(hdc, -1, -1);
expect_window_ext(hdc, 1, 1);
expect_world_transform(hdc, 20.0, 20.0);
expect_LPtoDP(hdc, -20000, -20000);
ret = SetGraphicsMode(hdc, GM_COMPATIBLE);
ok(ret, "SetGraphicsMode(GM_COMPATIBLE) should not fail if DC has't an identity transform\n");
ret = GetGraphicsMode(hdc);
ok(ret == GM_COMPATIBLE, "expected GM_COMPATIBLE, got %d\n", ret);
expect_viewport_ext(hdc, 1, 1);
expect_viewport_ext(hdc, -1, -1);
expect_window_ext(hdc, 1, 1);
expect_world_trasform(hdc, 20.0, 20.0);
expect_LPtoDP(hdc, 20000, 20000);
expect_world_transform(hdc, 20.0, 20.0);
expect_LPtoDP(hdc, -20000, -20000);
DeleteDC(hdc);
}
static void test_dc_layout(void)
{
INT ret, size_cx, size_cy, res_x, res_y, dpi_x, dpi_y;
SIZE size;
POINT pt;
HBITMAP bitmap;
RECT rc, ret_rc;
HDC hdc;
HRGN hrgn;
if (!pGetLayout || !pSetLayout)
{
win_skip( "Don't have SetLayout\n" );
return;
}
hdc = CreateCompatibleDC(0);
bitmap = CreateCompatibleBitmap( hdc, 100, 100 );
SelectObject( hdc, bitmap );
size_cx = GetDeviceCaps(hdc, HORZSIZE);
size_cy = GetDeviceCaps(hdc, VERTSIZE);
res_x = GetDeviceCaps(hdc, HORZRES);
res_y = GetDeviceCaps(hdc, VERTRES);
dpi_x = GetDeviceCaps(hdc, LOGPIXELSX);
dpi_y = GetDeviceCaps(hdc, LOGPIXELSY);
ret = GetMapMode( hdc );
ok(ret == MM_TEXT, "expected MM_TEXT, got %d\n", ret);
expect_viewport_ext(hdc, 1, 1);
expect_window_ext(hdc, 1, 1);
expect_world_transform(hdc, 1.0, 1.0);
expect_LPtoDP(hdc, 1000, 1000);
pSetLayout( hdc, LAYOUT_RTL );
if (!pGetLayout( hdc ))
{
win_skip( "SetLayout not supported\n" );
DeleteDC(hdc);
return;
}
ret = GetMapMode( hdc );
ok(ret == MM_ANISOTROPIC, "expected MM_ANISOTROPIC, got %d\n", ret);
expect_viewport_ext(hdc, 1, 1);
expect_window_ext(hdc, 1, 1);
expect_world_transform(hdc, 1.0, 1.0);
expect_LPtoDP(hdc, -1000 + 99, 1000);
GetViewportOrgEx( hdc, &pt );
ok( pt.x == 0 && pt.y == 0, "wrong origin %d,%d\n", pt.x, pt.y );
GetWindowOrgEx( hdc, &pt );
ok( pt.x == 0 && pt.y == 0, "wrong origin %d,%d\n", pt.x, pt.y );
GetDCOrgEx( hdc, &pt );
ok( pt.x == 0 && pt.y == 0, "wrong origin %d,%d\n", pt.x, pt.y );
if (pGetTransform)
{
XFORM xform;
BOOL ret = pGetTransform( hdc, 0x204, &xform ); /* World -> Device */
ok( ret, "got %d\n", ret );
ok( xform.eM11 == -1.0, "got %f\n", xform.eM11 );
ok( xform.eM12 == 0.0, "got %f\n", xform.eM12 );
ok( xform.eM21 == 0.0, "got %f\n", xform.eM21 );
ok( xform.eM22 == 1.0, "got %f\n", xform.eM22 );
ok( xform.eDx == 99.0, "got %f\n", xform.eDx );
ok( xform.eDy == 0.0, "got %f\n", xform.eDy );
}
SetRect( &rc, 10, 10, 20, 20 );
IntersectClipRect( hdc, 10, 10, 20, 20 );
hrgn = CreateRectRgn( 0, 0, 0, 0 );
GetClipRgn( hdc, hrgn );
GetRgnBox( hrgn, &ret_rc );
ok( EqualRect( &rc, &ret_rc ), "wrong clip box %d,%d - %d,%d\n",
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom );
pSetLayout( hdc, LAYOUT_LTR );
SetRect( &rc, 80, 10, 90, 20 );
GetClipRgn( hdc, hrgn );
GetRgnBox( hrgn, &ret_rc );
ok( EqualRect( &rc, &ret_rc ), "wrong clip box %d,%d - %d,%d\n",
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom );
GetClipBox( hdc, &ret_rc );
ok( EqualRect( &rc, &ret_rc ), "wrong clip box %d,%d - %d,%d\n",
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom );
IntersectClipRect( hdc, 80, 10, 85, 20 );
pSetLayout( hdc, LAYOUT_RTL );
SetRect( &rc, 15, 10, 20, 20 );
GetClipRgn( hdc, hrgn );
GetRgnBox( hrgn, &ret_rc );
ok( EqualRect( &rc, &ret_rc ), "wrong clip box %d,%d - %d,%d\n",
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom );
GetClipBox( hdc, &ret_rc );
ok( EqualRect( &rc, &ret_rc ), "wrong clip box %d,%d - %d,%d\n",
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom );
SetRectRgn( hrgn, 60, 10, 80, 20 );
pSetLayout( hdc, LAYOUT_LTR );
ExtSelectClipRgn( hdc, hrgn, RGN_OR );
pSetLayout( hdc, LAYOUT_RTL );
SetRect( &rc, 15, 10, 40, 20 );
GetClipRgn( hdc, hrgn );
GetRgnBox( hrgn, &ret_rc );
ok( EqualRect( &rc, &ret_rc ), "wrong clip box %d,%d - %d,%d\n",
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom );
GetClipBox( hdc, &ret_rc );
ok( EqualRect( &rc, &ret_rc ), "wrong clip box %d,%d - %d,%d\n",
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom );
/* OffsetClipRgn mirrors too */
OffsetClipRgn( hdc, 5, 5 );
OffsetRect( &rc, 5, 5 );
GetClipRgn( hdc, hrgn );
GetRgnBox( hrgn, &ret_rc );
ok( EqualRect( &rc, &ret_rc ), "wrong clip box %d,%d - %d,%d\n",
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom );
/* GetRandomRgn returns the raw region */
if (pGetRandomRgn)
{
SetRect( &rc, 55, 15, 80, 25 );
pGetRandomRgn( hdc, hrgn, 1 );
GetRgnBox( hrgn, &ret_rc );
ok( EqualRect( &rc, &ret_rc ), "wrong clip box %d,%d - %d,%d\n",
ret_rc.left, ret_rc.top, ret_rc.right, ret_rc.bottom );
}
SetMapMode(hdc, MM_LOMETRIC);
ret = GetMapMode( hdc );
ok(ret == MM_ANISOTROPIC, "expected MM_ANISOTROPIC, got %d\n", ret);
expect_viewport_ext(hdc, res_x, -res_y);
ok( GetWindowExtEx( hdc, &size ), "GetWindowExtEx failed\n" );
ok( rough_match( size.cx, size_cx * 10 ) ||
rough_match( size.cx, MulDiv( res_x, 254, dpi_x )), /* Vista uses a more precise method */
"expected cx %d or %d, got %d\n", size_cx * 10, MulDiv( res_x, 254, dpi_x ), size.cx );
ok( rough_match( size.cy, size_cy * 10 ) ||
rough_match( size.cy, MulDiv( res_y, 254, dpi_y )), /* Vista uses a more precise method */
"expected cy %d or %d, got %d\n", size_cy * 10, MulDiv( res_y, 254, dpi_y ), size.cy );
expect_world_transform(hdc, 1.0, 1.0);
expect_LPtoDP(hdc, -MulDiv(1000 / 10, res_x, size_cx) + 99, -MulDiv(1000 / 10, res_y, size_cy));
SetMapMode(hdc, MM_TEXT);
ret = GetMapMode( hdc );
ok(ret == MM_ANISOTROPIC, "expected MM_ANISOTROPIC, got %d\n", ret);
pSetLayout( hdc, LAYOUT_LTR );
ret = GetMapMode( hdc );
ok(ret == MM_ANISOTROPIC, "expected MM_ANISOTROPIC, got %d\n", ret);
SetMapMode(hdc, MM_TEXT);
ret = GetMapMode( hdc );
ok(ret == MM_TEXT, "expected MM_TEXT, got %d\n", ret);
DeleteDC(hdc);
DeleteObject( bitmap );
}
static void test_modify_world_transform(void)
{
HDC hdc = GetDC(0);
int ret;
ret = SetGraphicsMode(hdc, GM_ADVANCED);
if(!ret) /* running in win9x so quit */
{
ReleaseDC(0, hdc);
skip("GM_ADVANCED is not supported on this platform\n");
return;
}
ok(ret, "ret = %d\n", ret);
ret = ModifyWorldTransform(hdc, NULL, MWT_IDENTITY);
ok(ret, "ret = %d\n", ret);
@ -346,14 +515,11 @@ static void test_setvirtualresolution(void)
{
HDC hdc = CreateICA("DISPLAY", NULL, NULL, NULL);
DWORD r;
DWORD (WINAPI *pSetVirtualResolution)(HDC, DWORD, DWORD, DWORD, DWORD);
INT horz_res = GetDeviceCaps(hdc, HORZRES);
INT horz_size = GetDeviceCaps(hdc, HORZSIZE);
INT log_pixels_x = GetDeviceCaps(hdc, LOGPIXELSX);
SIZE orig_lometric_vp, orig_lometric_wnd;
pSetVirtualResolution = (void *)GetProcAddress(GetModuleHandleA("gdi32.dll"), "SetVirtualResolution");
if(!pSetVirtualResolution)
{
win_skip("Don't have SetVirtualResolution\n");
@ -458,13 +624,10 @@ static inline void xform_near_match(int line, XFORM *got, XFORM *expect)
static void test_gettransform(void)
{
HDC hdc = CreateICA("DISPLAY", NULL, NULL, NULL);
BOOL (WINAPI *pGetTransform)(HDC, DWORD, XFORM *);
XFORM xform, expect;
BOOL r;
SIZE lometric_vp, lometric_wnd;
pGetTransform = (void *)GetProcAddress(GetModuleHandleA("gdi32.dll"), "GetTransform");
if(!pGetTransform)
{
win_skip("Don't have GetTransform\n");
@ -560,8 +723,16 @@ static void test_gettransform(void)
START_TEST(mapping)
{
HMODULE mod = GetModuleHandleA("gdi32.dll");
pGetLayout = (void *)GetProcAddress( mod, "GetLayout" );
pSetLayout = (void *)GetProcAddress( mod, "SetLayout" );
pGetRandomRgn = (void *)GetProcAddress( mod, "GetRandomRgn" );
pGetTransform = (void *)GetProcAddress( mod, "GetTransform" );
pSetVirtualResolution = (void *)GetProcAddress( mod, "SetVirtualResolution" );
test_modify_world_transform();
test_world_transform();
test_dc_layout();
test_isotropic_mapping();
test_setvirtualresolution();
test_gettransform();

View file

@ -37,6 +37,8 @@ static BOOL emr_processed = FALSE;
static INT (WINAPI * pGetRelAbs)(HDC, DWORD);
static INT (WINAPI * pSetRelAbs)(HDC, INT);
static COLORREF (WINAPI *pSetDCBrushColor)(HDC,COLORREF);
static COLORREF (WINAPI *pSetDCPenColor)(HDC,COLORREF);
#define GDI_GET_PROC(func) \
p ## func = (void *)GetProcAddress(hGDI, #func); \
@ -54,6 +56,8 @@ static void init_function_pointers(void)
assert(hGDI);
GDI_GET_PROC(GetRelAbs);
GDI_GET_PROC(SetRelAbs);
GDI_GET_PROC(SetDCBrushColor);
GDI_GET_PROC(SetDCPenColor);
}
static int CALLBACK eto_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table,
@ -264,6 +268,141 @@ static void test_ExtTextOut(void)
DestroyWindow(hwnd);
}
struct eto_scale_test_record
{
INT graphics_mode;
INT map_mode;
double ex_scale;
double ey_scale;
BOOL processed;
};
static int CALLBACK eto_scale_enum_proc(HDC hdc, HANDLETABLE *handle_table,
const ENHMETARECORD *emr, int n_objs, LPARAM param)
{
struct eto_scale_test_record *test = (struct eto_scale_test_record*)param;
if (emr->iType == EMR_EXTTEXTOUTW)
{
const EMREXTTEXTOUTW *pExtTextOutW = (const EMREXTTEXTOUTW *)emr;
trace("gm %d, mm %d, scale %f, %f, expected %f, %f\n",
test->graphics_mode, test->map_mode,
pExtTextOutW->exScale, pExtTextOutW->eyScale,
test->ex_scale, test->ey_scale);
ok(fabs(test->ex_scale - pExtTextOutW->exScale) < 0.001,
"Got exScale %f, expected %f\n", pExtTextOutW->exScale, test->ex_scale);
ok(fabs(test->ey_scale - pExtTextOutW->eyScale) < 0.001,
"Got eyScale %f, expected %f\n", pExtTextOutW->eyScale, test->ey_scale);
test->processed = TRUE;
}
return 1;
}
static void test_ExtTextOutScale(void)
{
const RECT rc = { 0, 0, 100, 100 };
const WCHAR str[] = {'a',0 };
struct eto_scale_test_record test;
HDC hdcDisplay, hdcMetafile;
HENHMETAFILE hMetafile;
HWND hwnd;
SIZE wndext, vportext;
int horzSize, vertSize, horzRes, vertRes;
int ret;
int i;
hwnd = CreateWindowExA(0, "static", NULL, WS_POPUP | WS_VISIBLE,
0, 0, 200, 200, 0, 0, 0, NULL);
ok(hwnd != 0, "CreateWindowExA failed\n");
hdcDisplay = GetDC(hwnd);
ok(hdcDisplay != 0, "GetDC failed\n");
horzSize = GetDeviceCaps(hdcDisplay, HORZSIZE);
horzRes = GetDeviceCaps(hdcDisplay, HORZRES);
vertSize = GetDeviceCaps(hdcDisplay, VERTSIZE);
vertRes = GetDeviceCaps(hdcDisplay, VERTRES);
ok(horzSize && horzRes && vertSize && vertRes, "GetDeviceCaps failed\n");
for (i = 0; i < 16; i++)
{
test.graphics_mode = i / 8 + 1;
test.map_mode = i % 8 + 1;
ret = SetGraphicsMode(hdcDisplay, test.graphics_mode);
ok(ret, "SetGraphicsMode failed\n");
ret = SetMapMode(hdcDisplay, test.map_mode);
ok(ret, "SetMapMode failed\n");
if ((test.map_mode == MM_ISOTROPIC) || (test.map_mode == MM_ANISOTROPIC))
{
ret = SetWindowExtEx(hdcDisplay, 1, 1, NULL);
ok(ret, "SetWindowExtEx failed\n");
ret = SetViewportExtEx(hdcDisplay, -20, -10, NULL);
ok(ret, "SetViewportExtEx failed\n");
}
ret = GetViewportExtEx(hdcDisplay, &vportext);
ok(ret, "GetViewportExtEx failed\n");
ret = GetWindowExtEx(hdcDisplay, &wndext);
ok(ret, "GetWindowExtEx failed\n");
trace("gm %d, mm %d, wnd %d,%d, vp %d,%d horz %d,%d vert %d,%d\n",
test.graphics_mode, test.map_mode,
wndext.cx, wndext.cy, vportext.cx, vportext.cy,
horzSize, horzRes, vertSize, vertRes);
if (test.graphics_mode == GM_COMPATIBLE)
{
test.ex_scale = 100.0 * ((FLOAT)horzSize / (FLOAT)horzRes) /
((FLOAT)wndext.cx / (FLOAT)vportext.cx);
test.ey_scale = 100.0 * ((FLOAT)vertSize / (FLOAT)vertRes) /
((FLOAT)wndext.cy / (FLOAT)vportext.cy);
}
else
{
test.ex_scale = 0.0;
test.ey_scale = 0.0;
}
hdcMetafile = CreateEnhMetaFileA(hdcDisplay, NULL, NULL, NULL);
ok(hdcMetafile != 0, "CreateEnhMetaFileA failed\n");
ret = SetGraphicsMode(hdcMetafile, test.graphics_mode);
ok(ret, "SetGraphicsMode failed\n");
ret = SetMapMode(hdcMetafile, test.map_mode);
ok(ret, "SetMapMode failed\n");
if ((test.map_mode == MM_ISOTROPIC) || (test.map_mode == MM_ANISOTROPIC))
{
ret = SetWindowExtEx(hdcMetafile, 1, 1, NULL);
ok(ret, "SetWindowExtEx failed\n");
ret = SetViewportExtEx(hdcMetafile, -20, -10, NULL);
ok(ret, "SetViewportExtEx failed\n");
}
ret = ExtTextOutW(hdcMetafile, 0, 0, 0, 0, str, 1, NULL);
ok(ret, "ExtTextOutW failed\n");
hMetafile = CloseEnhMetaFile(hdcMetafile);
ok(hMetafile != 0, "CloseEnhMetaFile failed\n");
test.processed = 0;
ret = EnumEnhMetaFile(hdcDisplay, hMetafile, eto_scale_enum_proc, &test, &rc);
ok(ret, "EnumEnhMetaFile failed\n");
ok(test.processed, "EnumEnhMetaFile couldn't find EMR_EXTTEXTOUTW record\n");
ret = DeleteEnhMetaFile(hMetafile);
ok(ret, "DeleteEnhMetaFile failed\n");
}
ret = ReleaseDC(hwnd, hdcDisplay);
ok(ret, "ReleaseDC failed\n");
DestroyWindow(hwnd);
}
static void check_dc_state(HDC hdc, int restore_no,
int wnd_org_x, int wnd_org_y, int wnd_ext_x, int wnd_ext_y,
int vp_org_x, int vp_org_y, int vp_ext_x, int vp_ext_y)
@ -340,13 +479,17 @@ static int CALLBACK savedc_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table,
ret = GetWorldTransform(hdc, &xform);
if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
{
ok(GetWindowOrgEx(hdc, &pt), "GetWindowOrgEx error %u\n", GetLastError());
ret = GetWindowOrgEx(hdc, &pt);
ok(ret, "GetWindowOrgEx error %u\n", GetLastError());
trace("window org (%d,%d)\n", pt.x, pt.y);
ok(GetViewportOrgEx(hdc, &pt), "GetViewportOrgEx error %u\n", GetLastError());
ret = GetViewportOrgEx(hdc, &pt);
ok(ret, "GetViewportOrgEx error %u\n", GetLastError());
trace("vport org (%d,%d)\n", pt.x, pt.y);
ok(GetWindowExtEx(hdc, &size), "GetWindowExtEx error %u\n", GetLastError());
ret = GetWindowExtEx(hdc, &size);
ok(ret, "GetWindowExtEx error %u\n", GetLastError());
trace("window ext (%d,%d)\n", size.cx, size.cy);
ok(GetViewportExtEx(hdc, &size), "GetViewportExtEx error %u\n", GetLastError());
ret = GetViewportExtEx(hdc, &size);
ok(ret, "GetViewportExtEx error %u\n", GetLastError());
trace("vport ext (%d,%d)\n", size.cx, size.cy);
}
else
@ -458,13 +601,17 @@ static int CALLBACK savedc_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table,
ret = GetWorldTransform(hdc, &xform);
if (!ret && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
{
ok(GetWindowOrgEx(hdc, &pt), "GetWindowOrgEx error %u\n", GetLastError());
ret = GetWindowOrgEx(hdc, &pt);
ok(ret, "GetWindowOrgEx error %u\n", GetLastError());
trace("window org (%d,%d)\n", pt.x, pt.y);
ok(GetViewportOrgEx(hdc, &pt), "GetViewportOrgEx error %u\n", GetLastError());
ret = GetViewportOrgEx(hdc, &pt);
ok(ret, "GetViewportOrgEx error %u\n", GetLastError());
trace("vport org (%d,%d)\n", pt.x, pt.y);
ok(GetWindowExtEx(hdc, &size), "GetWindowExtEx error %u\n", GetLastError());
ret = GetWindowExtEx(hdc, &size);
ok(ret, "GetWindowExtEx error %u\n", GetLastError());
trace("window ext (%d,%d)\n", size.cx, size.cy);
ok(GetViewportExtEx(hdc, &size), "GetViewportExtEx error %u\n", GetLastError());
ret = GetViewportExtEx(hdc, &size);
ok(ret, "GetViewportExtEx error %u\n", GetLastError());
trace("vport ext (%d,%d)\n", size.cx, size.cy);
}
else
@ -512,8 +659,10 @@ static void test_SaveDC(void)
SetPixelV(hdcMetafile, 50, 50, 0);
ret = GetViewportOrgEx(hdcMetafile, &pt);
ok(ret, "GetViewportOrgEx error %u\n", GetLastError());
ok(pt.x == 0,"Expecting ViewportOrg x of 0, got %i\n",pt.x);
ret = GetViewportExtEx(hdcMetafile, &size);
ok(ret, "GetViewportExtEx error %u\n", GetLastError());
ok(size.cx == 120,"Expecting ViewportExt cx of 120, got %i\n",size.cx);
ret = SaveDC(hdcMetafile);
ok(ret == 1, "ret = %d\n", ret);
@ -527,8 +676,10 @@ static void test_SaveDC(void)
SetPixelV(hdcMetafile, 50, 50, 0);
ret = GetViewportOrgEx(hdcMetafile, &pt);
ok(ret, "GetViewportOrgEx error %u\n", GetLastError());
ok(pt.x == 10,"Expecting ViewportOrg x of 10, got %i\n",pt.x);
ret = GetViewportExtEx(hdcMetafile, &size);
ok(ret, "GetViewportExtEx error %u\n", GetLastError());
ok(size.cx == 200,"Expecting ViewportExt cx of 200, got %i\n",size.cx);
ret = SaveDC(hdcMetafile);
ok(ret == 2, "ret = %d\n", ret);
@ -544,8 +695,10 @@ static void test_SaveDC(void)
SetPixelV(hdcMetafile, 50, 50, 0);
ret = GetViewportOrgEx(hdcMetafile, &pt);
ok(ret, "GetViewportOrgEx error %u\n", GetLastError());
ok(pt.x == 20,"Expecting ViewportOrg x of 20, got %i\n",pt.x);
ret = GetViewportExtEx(hdcMetafile, &size);
ok(ret, "GetViewportExtEx error %u\n", GetLastError());
ok(size.cx == 300,"Expecting ViewportExt cx of 300, got %i\n",size.cx);
ret = SaveDC(hdcMetafile);
ok(ret == 3, "ret = %d\n", ret);
@ -564,15 +717,19 @@ static void test_SaveDC(void)
SetPixelV(hdcMetafile, 50, 50, 0);
ret = GetViewportOrgEx(hdcMetafile, &pt);
ok(ret, "GetViewportOrgEx error %u\n", GetLastError());
ok(pt.x == 30,"Expecting ViewportOrg x of 30, got %i\n",pt.x);
ret = GetViewportExtEx(hdcMetafile, &size);
ok(ret, "GetViewportExtEx error %u\n", GetLastError());
ok(size.cx == 400,"Expecting ViewportExt cx of 400, got %i\n",size.cx);
ret = RestoreDC(hdcMetafile, -1);
ok(ret, "ret = %d\n", ret);
ret = GetViewportOrgEx(hdcMetafile, &pt);
ok(ret, "GetViewportOrgEx error %u\n", GetLastError());
ok(pt.x == 20,"Expecting ViewportOrg x of 20, got %i\n",pt.x);
ret = GetViewportExtEx(hdcMetafile, &size);
ok(ret, "GetViewportExtEx error %u\n", GetLastError());
ok(size.cx == 300,"Expecting ViewportExt cx of 300, got %i\n",size.cx);
ok( GetPolyFillMode( hdcMetafile ) == ALTERNATE, "PolyFillMode not restored\n" );
ok( GetBkColor( hdcMetafile ) == 0, "Background color not restored\n" );
@ -580,14 +737,18 @@ static void test_SaveDC(void)
ok(ret == 3, "ret = %d\n", ret);
ret = GetViewportOrgEx(hdcMetafile, &pt);
ok(ret, "GetViewportOrgEx error %u\n", GetLastError());
ok(pt.x == 20,"Expecting ViewportOrg x of 20, got %i\n",pt.x);
ret = GetViewportExtEx(hdcMetafile, &size);
ok(ret, "GetViewportExtEx error %u\n", GetLastError());
ok(size.cx == 300,"Expecting ViewportExt cx of 300, got %i\n",size.cx);
ret = RestoreDC(hdcMetafile, 1);
ok(ret, "ret = %d\n", ret);
ret = GetViewportOrgEx(hdcMetafile, &pt);
ok(ret, "GetViewportOrgEx error %u\n", GetLastError());
ok(pt.x == 0,"Expecting ViewportOrg x of 0, got %i\n",pt.x);
ret = GetViewportExtEx(hdcMetafile, &size);
ok(ret, "GetViewportExtEx error %u\n", GetLastError());
ok(size.cx == 120,"Expecting ViewportExt cx of 120, got %i\n",size.cx);
SetWindowOrgEx(hdcMetafile, -4, -4, NULL);
@ -599,15 +760,19 @@ static void test_SaveDC(void)
SetPixelV(hdcMetafile, 50, 50, 0);
ret = GetViewportOrgEx(hdcMetafile, &pt);
ok(ret, "GetViewportOrgEx error %u\n", GetLastError());
ok(pt.x == 40,"Expecting ViewportOrg x of 40, got %i\n",pt.x);
ret = GetViewportExtEx(hdcMetafile, &size);
ok(ret, "GetViewportExtEx error %u\n", GetLastError());
ok(size.cx == 50,"Expecting ViewportExt cx of 50, got %i\n",size.cx);
ret = SaveDC(hdcMetafile);
ok(ret == 1, "ret = %d\n", ret);
ret = GetViewportOrgEx(hdcMetafile, &pt);
ok(ret, "GetViewportOrgEx error %u\n", GetLastError());
ok(pt.x == 40,"Expecting ViewportOrg x of 40, got %i\n",pt.x);
ret = GetViewportExtEx(hdcMetafile, &size);
ok(ret, "GetViewportExtEx error %u\n", GetLastError());
ok(size.cx == 50,"Expecting ViewportExt cx of 50, got %i\n",size.cx);
ret = SaveDC(hdcMetafile);
ok(ret == 2, "ret = %d\n", ret);
@ -635,8 +800,10 @@ static void test_SaveDC(void)
ret = RestoreDC(hdcMetafile, 1);
ok(ret, "ret = %d\n", ret);
ret = GetViewportOrgEx(hdcMetafile, &pt);
ok(ret, "GetViewportOrgEx error %u\n", GetLastError());
ok(pt.x == 40,"Expecting ViewportOrg x of 40, got %i\n",pt.x);
ret = GetViewportExtEx(hdcMetafile, &size);
ok(ret, "GetViewportExtEx error %u\n", GetLastError());
ok(size.cx == 50,"Expecting ViewportExt cx of 50, got %i\n",size.cx);
hFontCheck = SelectObject(hdcMetafile, hFontOld);
@ -683,10 +850,18 @@ static void test_mf_SaveDC(void)
/* Need to write something to the emf, otherwise Windows won't play it back */
LineTo(hdcMetafile, 150, 150);
SetWindowOrgEx(hdcMetafile, 0, 0, NULL);
SetViewportOrgEx(hdcMetafile, 0, 0, NULL);
SetWindowExtEx(hdcMetafile, 110, 110, NULL );
SetViewportExtEx(hdcMetafile, 120, 120, NULL );
pt.x = pt.y = 5555;
SetWindowOrgEx(hdcMetafile, 0, 0, &pt);
ok( pt.x == 5555 && pt.y == 5555, "wrong origin %d,%d\n", pt.x, pt.y);
pt.x = pt.y = 5555;
SetViewportOrgEx(hdcMetafile, 0, 0, &pt);
ok( pt.x == 5555 && pt.y == 5555, "wrong origin %d,%d\n", pt.x, pt.y);
size.cx = size.cy = 5555;
SetWindowExtEx(hdcMetafile, 110, 110, &size );
ok( size.cx == 5555 && size.cy == 5555, "wrong size %d,%d\n", size.cx, size.cy );
size.cx = size.cy = 5555;
SetViewportExtEx(hdcMetafile, 120, 120, &size );
ok( size.cx == 5555 && size.cy == 5555, "wrong size %d,%d\n", size.cx, size.cy );
/* Force Win9x to update DC state */
SetPixelV(hdcMetafile, 50, 50, 0);
@ -860,6 +1035,21 @@ static const unsigned char MF_PATTERN_BRUSH_BITS[] = {
0x00, 0x00
};
static const unsigned char MF_DCBRUSH_BITS[] =
{
0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x2a, 0x00,
0x00, 0x00, 0x02, 0x00, 0x08, 0x00, 0x00, 0x00,
0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0xfc, 0x02,
0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x2d, 0x01, 0x00, 0x00,
0x08, 0x00, 0x00, 0x00, 0xfa, 0x02, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x2d, 0x01, 0x01, 0x00,
0x07, 0x00, 0x00, 0x00, 0x1b, 0x04, 0x14, 0x00,
0x14, 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x03, 0x00,
0x00, 0x00, 0x00, 0x00
};
static const unsigned char MF_TEXTOUT_ON_PATH_BITS[] =
{
0x01, 0x00, 0x09, 0x00, 0x00, 0x03, 0x19, 0x00,
@ -1086,6 +1276,50 @@ static const unsigned char EMF_BITBLT[] =
0x10, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00
};
static const unsigned char EMF_DCBRUSH_BITS[] =
{
0x01, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00,
0x0a, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,
0x13, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
0x39, 0x01, 0x00, 0x00, 0x39, 0x01, 0x00, 0x00,
0x52, 0x02, 0x00, 0x00, 0x52, 0x02, 0x00, 0x00,
0x20, 0x45, 0x4d, 0x46, 0x00, 0x00, 0x01, 0x00,
0x44, 0x01, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00,
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00,
0x40, 0x01, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xe2, 0x04, 0x00,
0x80, 0xa9, 0x03, 0x00, 0x25, 0x00, 0x00, 0x00,
0x0c, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x80,
0x25, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
0x13, 0x00, 0x00, 0x80, 0x27, 0x00, 0x00, 0x00,
0x18, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x55, 0x00,
0x00, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00,
0x0c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x26, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x33, 0x44, 0x55, 0x00, 0x25, 0x00, 0x00, 0x00,
0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x2b, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00,
0x0a, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,
0x13, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00,
0x28, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, 0x00,
0x18, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x12, 0x34, 0x56, 0x00,
0x00, 0x00, 0x00, 0x00, 0x25, 0x00, 0x00, 0x00,
0x0c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x28, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
0x0c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x0e, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
0x14, 0x00, 0x00, 0x00
};
/* For debugging or dumping the raw metafiles produced by
* new test functions.
@ -1428,12 +1662,12 @@ static int compare_emf_bits(const HENHMETAFILE mf, const unsigned char *bits,
const ENHMETARECORD *emr2 = (const ENHMETARECORD *)(buf + offset2);
if(!winetest_interactive)
skip("skipping match_emf_record(), bug 5393\n");
skip("skipping match_emf_record(), bug 5393\n");
else
{
trace("%s: EMF record %u, size %u/record %u, size %u\n",
desc, emr1->iType, emr1->nSize, emr2->iType, emr2->nSize);
desc, emr1->iType, emr1->nSize, emr2->iType, emr2->nSize);
if (!match_emf_record(emr1, emr2, desc, ignore_scaling)) return -1;
}
@ -1508,6 +1742,58 @@ static void test_emf_BitBlt(void)
#undef BMP_DIM
}
static void test_emf_DCBrush(void)
{
HDC hdcMetafile;
HENHMETAFILE hMetafile;
HBRUSH hBrush;
HPEN hPen;
BOOL ret;
COLORREF color;
if (!pSetDCBrushColor || !pSetDCPenColor)
{
win_skip( "SetDCBrush/PenColor not supported\n" );
return;
}
hdcMetafile = CreateEnhMetaFileA(GetDC(0), NULL, NULL, NULL);
ok( hdcMetafile != 0, "CreateEnhMetaFileA failed\n" );
hBrush = SelectObject(hdcMetafile, GetStockObject(DC_BRUSH));
ok(hBrush != 0, "SelectObject error %d.\n", GetLastError());
hPen = SelectObject(hdcMetafile, GetStockObject(DC_PEN));
ok(hPen != 0, "SelectObject error %d.\n", GetLastError());
color = pSetDCBrushColor( hdcMetafile, RGB(0x55,0x55,0x55) );
ok( color == 0xffffff, "SetDCBrushColor returned %x\n", color );
color = pSetDCPenColor( hdcMetafile, RGB(0x33,0x44,0x55) );
ok( color == 0, "SetDCPenColor returned %x\n", color );
Rectangle( hdcMetafile, 10, 10, 20, 20 );
color = pSetDCBrushColor( hdcMetafile, RGB(0x12,0x34,0x56) );
ok( color == 0x555555, "SetDCBrushColor returned %x\n", color );
hMetafile = CloseEnhMetaFile(hdcMetafile);
ok( hMetafile != 0, "CloseEnhMetaFile failed\n" );
if (compare_emf_bits (hMetafile, EMF_DCBRUSH_BITS, sizeof(EMF_DCBRUSH_BITS),
"emf_DC_Brush", FALSE ) != 0)
{
dump_emf_bits(hMetafile, "emf_DC_Brush");
dump_emf_records(hMetafile, "emf_DC_Brush");
}
ret = DeleteEnhMetaFile(hMetafile);
ok( ret, "DeleteEnhMetaFile error %d\n", GetLastError());
ret = DeleteObject(hBrush);
ok( ret, "DeleteObject(HBRUSH) error %d\n", GetLastError());
ret = DeleteObject(hPen);
ok( ret, "DeleteObject(HPEN) error %d\n", GetLastError());
}
/* Test a blank metafile. May be used as a template for new tests. */
static void test_mf_Blank(void)
@ -1669,6 +1955,7 @@ static void test_SetMetaFileBits(void)
ret = DeleteMetaFile(hmf);
ok(ret, "DeleteMetaFile(%p) error %d\n", hmf, GetLastError());
#ifndef _WIN64 /* Generates access violation on XP x64 and Win2003 x64 */
/* Now with zeroed out mtSize field */
memcpy(buf, MF_GRAPHICS_BITS, sizeof(MF_GRAPHICS_BITS));
mh = (METAHEADER *)buf;
@ -1686,6 +1973,7 @@ static void test_SetMetaFileBits(void)
ret = DeleteMetaFile(hmf);
ok(ret, "DeleteMetaFile(%p) error %d\n", hmf, GetLastError());
#endif
}
/* Simple APIs from mfdrv/graphics.c
@ -1782,6 +2070,53 @@ static void test_mf_PatternBrush(void)
HeapFree (GetProcessHeap(), 0, orig_lb);
}
static void test_mf_DCBrush(void)
{
HDC hdcMetafile;
HMETAFILE hMetafile;
HBRUSH hBrush;
HPEN hPen;
BOOL ret;
COLORREF color;
if (!pSetDCBrushColor || !pSetDCPenColor)
{
win_skip( "SetDCBrush/PenColor not supported\n" );
return;
}
hdcMetafile = CreateMetaFileA(NULL);
ok( hdcMetafile != 0, "CreateMetaFileA failed\n" );
hBrush = SelectObject(hdcMetafile, GetStockObject(DC_BRUSH));
ok(hBrush != 0, "SelectObject error %d.\n", GetLastError());
hPen = SelectObject(hdcMetafile, GetStockObject(DC_PEN));
ok(hPen != 0, "SelectObject error %d.\n", GetLastError());
color = pSetDCBrushColor( hdcMetafile, RGB(0x55,0x55,0x55) );
ok( color == CLR_INVALID, "SetDCBrushColor returned %x\n", color );
color = pSetDCPenColor( hdcMetafile, RGB(0x33,0x44,0x55) );
ok( color == CLR_INVALID, "SetDCPenColor returned %x\n", color );
Rectangle( hdcMetafile, 10, 10, 20, 20 );
color = pSetDCBrushColor( hdcMetafile, RGB(0x12,0x34,0x56) );
ok( color == CLR_INVALID, "SetDCBrushColor returned %x\n", color );
hMetafile = CloseMetaFile(hdcMetafile);
ok( hMetafile != 0, "CloseMetaFile failed\n" );
if (compare_mf_bits(hMetafile, MF_DCBRUSH_BITS, sizeof(MF_DCBRUSH_BITS), "mf_DCBrush") != 0)
{
dump_mf_bits(hMetafile, "mf_DCBrush");
EnumMetaFile(0, hMetafile, mf_enum_proc, 0);
}
ret = DeleteMetaFile(hMetafile);
ok(ret, "DeleteMetaFile(%p) error %d\n", hMetafile, GetLastError());
}
static void test_mf_ExtTextOut_on_path(void)
{
HDC hdcMetafile;
@ -1991,6 +2326,7 @@ static int CALLBACK clip_emf_enum_proc(HDC hdc, HANDLETABLE *handle_table,
ok(ret == sizeof(rgn2.data.rdh) + sizeof(RECT), "expected sizeof(rgn), got %u\n", ret);
ret = GetRegionData(hrgn, sizeof(rgn2), &rgn2.data);
ok(ret == sizeof(rgn2), "expected sizeof(rgn2), got %u\n", ret);
trace("size %u, type %u, count %u, rgn size %u, bound (%d,%d-%d,%d)\n",
rgn2.data.rdh.dwSize, rgn2.data.rdh.iType,
@ -2475,6 +2811,7 @@ static void getwinmetafilebits(UINT mode, int scale, RECT *rc)
METAHEADER *mh = NULL;
METARECORD *rec;
INT horz_res, vert_res, horz_size, vert_size;
INT curve_caps, line_caps, poly_caps;
display_dc = GetDC(NULL);
ok(display_dc != NULL, "display_dc is NULL\n");
@ -2486,6 +2823,16 @@ static void getwinmetafilebits(UINT mode, int scale, RECT *rc)
emf_dc = CreateEnhMetaFileA(display_dc, NULL, rc, NULL);
ok(emf_dc != NULL, "emf_dc is NULL\n");
curve_caps = GetDeviceCaps(emf_dc, CURVECAPS);
ok(curve_caps == 511, "expect 511 got %d\n", curve_caps);
line_caps = GetDeviceCaps(emf_dc, LINECAPS);
ok(line_caps == 254, "expect 254 got %d\n", line_caps);
poly_caps = GetDeviceCaps(emf_dc, POLYGONALCAPS);
ok(poly_caps == 255, "expect 511 got %d\n", poly_caps);
for(i = 0; i < 3000; i++) /* This is enough to take emf_size > 0xffff */
Rectangle(emf_dc, 0, 0, 1000, 20);
emf = CloseEnhMetaFile(emf_dc);
@ -2753,14 +3100,17 @@ START_TEST(metafile)
/* For enhanced metafiles (enhmfdrv) */
test_ExtTextOut();
test_ExtTextOutScale();
test_SaveDC();
test_emf_BitBlt();
test_emf_DCBrush();
/* For win-format metafiles (mfdrv) */
test_mf_SaveDC();
test_mf_Blank();
test_mf_Graphics();
test_mf_PatternBrush();
test_mf_DCBrush();
test_CopyMetaFile();
test_SetMetaFileBits();
test_mf_ExtTextOut_on_path();

View file

@ -53,7 +53,7 @@ static void test_DIB_PAL_COLORS(void) {
COLORREF setColor, chkColor, getColor;
int i;
/* Initalize the logical palette with a few colours */
/* Initialize the logical palette with a few colours */
logpalette->palVersion = 0x300;
logpalette->palNumEntries = 8;
memcpy( logpalette->palPalEntry, logpalettedata, sizeof(logpalettedata) );
@ -110,9 +110,7 @@ static void test_DIB_PAL_COLORS(void) {
SetPixel( memhdc, 0, 0, setColor );
chkColor = RGB( logpalettedata[3].peRed, logpalettedata[3].peGreen, logpalettedata[3].peBlue );
getColor = GetPixel( memhdc, 0, 0 );
ok( getColor == chkColor ||
broken(getColor == 0), /* win9x */
"getColor=%08X\n", (UINT)getColor );
ok( getColor == chkColor, "getColor=%08X\n", (UINT)getColor );
SelectPalette( memhdc, hpalOld, FALSE );
DeleteObject( hpal );
@ -131,7 +129,7 @@ static void test_palette_entries(void)
PALETTEENTRY palEntry = { 0x1, 0x2, 0x3, 0xff };
PALETTEENTRY getEntryResult;
/* Initalize the logical palette with a few colours */
/* Initialize the logical palette with a few colours */
logpalette->palVersion = 0x300;
logpalette->palNumEntries = 8;
memcpy( logpalette->palPalEntry, logpalettedata, sizeof(logpalettedata) );

View file

@ -89,8 +89,9 @@ static void test_widenpath(void)
Polyline(hdc, pnt, 6);
EndPath(hdc);
ret = WidenPath(hdc);
ok(ret == TRUE, "WidenPath failed: %d\n", GetLastError());
nSize = GetPath(hdc, NULL, NULL, 0);
ok(nSize > 6, "WidenPath should compute a widdened path with a 1px wide pen. Path length is %d, should be more than 6\n", nSize);
ok(nSize > 6, "WidenPath should compute a widened path with a 1px wide pen. Path length is %d, should be more than 6\n", nSize);
ReleaseDC(0, hdc);
return;

View file

@ -81,7 +81,11 @@ static void test_logpen(void)
lp.lopnColor = pen[i].color;
SetLastError(0xdeadbeef);
hpen = CreatePenIndirect(&lp);
ok(hpen != 0, "CreatePen error %d\n", GetLastError());
if(hpen == 0 && GetLastError() == ERROR_INVALID_PARAMETER)
{
win_skip("No support for pen style %u (%d)\n", pen[i].style, i);
continue;
}
obj_type = GetObjectType(hpen);
ok(obj_type == OBJ_PEN, "wrong object type %u\n", obj_type);
@ -293,7 +297,7 @@ static void test_logpen(void)
ok(ext_pen.elp.elpHatch == HS_CROSS, "expected HS_CROSS, got %p\n", (void *)ext_pen.elp.elpHatch);
ok(ext_pen.elp.elpNumEntries == 2, "expected 0, got %x\n", ext_pen.elp.elpNumEntries);
ok(ext_pen.elp.elpStyleEntry[0] == 0xabc, "expected 0xabc, got %x\n", ext_pen.elp.elpStyleEntry[0]);
ok(ext_pen.elp.elpStyleEntry[1] == 0xdef, "expected 0xabc, got %x\n", ext_pen.elp.elpStyleEntry[1]);
ok(ext_pen.elp.elpStyleEntry[1] == 0xdef, "expected 0xdef, got %x\n", ext_pen.elp.elpStyleEntry[1]);
break;
default:
@ -424,7 +428,7 @@ test_geometric_pens:
ok(ext_pen.elp.elpHatch == HS_CROSS, "expected HS_CROSS, got %p\n", (void *)ext_pen.elp.elpHatch);
ok(ext_pen.elp.elpNumEntries == 2, "expected 0, got %x\n", ext_pen.elp.elpNumEntries);
ok(ext_pen.elp.elpStyleEntry[0] == 0xabc, "expected 0xabc, got %x\n", ext_pen.elp.elpStyleEntry[0]);
ok(ext_pen.elp.elpStyleEntry[1] == 0xdef, "expected 0xabc, got %x\n", ext_pen.elp.elpStyleEntry[1]);
ok(ext_pen.elp.elpStyleEntry[1] == 0xdef, "expected 0xdef, got %x\n", ext_pen.elp.elpStyleEntry[1]);
break;
default:
@ -475,6 +479,8 @@ static void test_ps_alternate(void)
HBITMAP bmp;
HPEN pen;
LOGBRUSH lb;
INT iRet;
HGDIOBJ hRet;
lb.lbStyle = BS_SOLID;
lb.lbColor = RGB(0xff,0xff,0xff);
@ -490,9 +496,12 @@ static void test_ps_alternate(void)
ok(hdc != NULL, "gle=%d\n", GetLastError());
bmp = CreateBitmap(8, 1, 1, 1, NULL);
ok(bmp != NULL, "gle=%d\n", GetLastError());
ok(SelectObject(hdc, bmp) != NULL, "gle=%d\n", GetLastError());
ok(SelectObject(hdc, pen) != NULL, "gle=%d\n", GetLastError());
ok(SetBkMode(hdc, TRANSPARENT), "gle=%d\n", GetLastError());
hRet = SelectObject(hdc, bmp);
ok(hRet != NULL, "gle=%d\n", GetLastError());
hRet = SelectObject(hdc, pen);
ok(hRet != NULL, "gle=%d\n", GetLastError());
iRet = SetBkMode(hdc, TRANSPARENT);
ok(iRet, "gle=%d\n", GetLastError());
TEST_LINE(0, 1, "10000000")
TEST_LINE(0, 2, "10000000")

View file

@ -0,0 +1,24 @@
/*
* Resources for gdi32 test suite.
*
* Copyright 2010 Dmitry Timoshkov
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "windef.h"
/* @makedep: wine_test.ttf */
wine_test.ttf RCDATA wine_test.ttf

View file

@ -10,6 +10,7 @@ extern void func_bitmap(void);
extern void func_brush(void);
extern void func_clipping(void);
extern void func_dc(void);
extern void func_dib(void);
extern void func_font(void);
extern void func_gdiobj(void);
extern void func_generated(void);
@ -26,6 +27,7 @@ const struct test winetest_testlist[] =
{ "brush", func_brush },
{ "clipping", func_clipping },
{ "dc", func_dc },
{ "dib", func_dib },
{ "font", func_font },
{ "gdiobj", func_gdiobj },
{ "generated", func_generated },

View file

@ -0,0 +1,180 @@
SplineFontDB: 3.0
FontName: wine_test
FullName: wine_test
FamilyName: wine_test
Weight: Medium
Copyright: Copyright (c) 2010 Dmitry Timoshkov
Version: 001.000
ItalicAngle: 0
UnderlinePosition: -205
UnderlineWidth: 102
Ascent: 1638
Descent: 410
sfntRevision: 0x00010000
LayerCount: 2
Layer: 0 1 "Back" 1
Layer: 1 1 "Fore" 0
XUID: [1021 905 592216984 1247726]
FSType: 0
OS2Version: 2
OS2_WeightWidthSlopeOnly: 0
OS2_UseTypoMetrics: 1
CreationTime: 1288336343
ModificationTime: 1288336873
PfmFamily: 17
TTFWeight: 500
TTFWidth: 5
LineGap: 184
VLineGap: 0
Panose: 2 0 6 3 0 0 0 0 0 0
OS2TypoAscent: 0
OS2TypoAOffset: 1
OS2TypoDescent: 0
OS2TypoDOffset: 1
OS2TypoLinegap: 184
OS2WinAscent: 0
OS2WinAOffset: 1
OS2WinDescent: 0
OS2WinDOffset: 1
HheadAscent: 0
HheadAOffset: 1
HheadDescent: 0
HheadDOffset: 1
OS2SubXSize: 1331
OS2SubYSize: 1433
OS2SubXOff: 0
OS2SubYOff: 286
OS2SupXSize: 1331
OS2SupYSize: 1433
OS2SupXOff: 0
OS2SupYOff: 983
OS2StrikeYSize: 102
OS2StrikeYPos: 530
OS2Vendor: 'Wine'
OS2CodePages: 00000001.00000000
OS2UnicodeRanges: 00000001.00000000.00000000.00000000
MarkAttachClasses: 1
DEI: 91125
ShortTable: cvt 2
68
1297
EndShort
ShortTable: maxp 16
1
0
4
8
2
0
0
2
0
1
1
0
64
46
0
0
EndShort
LangName: 1033 "" "" "" "Wine : wine_test : 4-11-2010"
GaspTable: 1 65535 2
Encoding: UnicodeBmp
UnicodeInterp: none
NameList: Adobe Glyph List
DisplaySize: -24
AntiAlias: 1
FitToEm: 1
WinInfo: 65 65 19
BeginChars: 65539 4
StartChar: .notdef
Encoding: 65536 -1 0
Width: 748
Flags: W
TtInstrs:
PUSHB_2
1
0
MDAP[rnd]
ALIGNRP
PUSHB_3
7
4
0
MIRP[min,rnd,black]
SHP[rp2]
PUSHB_2
6
5
MDRP[rp0,min,rnd,grey]
ALIGNRP
PUSHB_3
3
2
0
MIRP[min,rnd,black]
SHP[rp2]
SVTCA[y-axis]
PUSHB_2
3
0
MDAP[rnd]
ALIGNRP
PUSHB_3
5
4
0
MIRP[min,rnd,black]
SHP[rp2]
PUSHB_3
7
6
1
MIRP[rp0,min,rnd,grey]
ALIGNRP
PUSHB_3
1
2
0
MIRP[min,rnd,black]
SHP[rp2]
EndTTInstrs
LayerCount: 2
Fore
SplineSet
68 0 m 1,0,-1
68 1365 l 1,1,-1
612 1365 l 1,2,-1
612 0 l 1,3,-1
68 0 l 1,0,-1
136 68 m 1,4,-1
544 68 l 1,5,-1
544 1297 l 1,6,-1
136 1297 l 1,7,-1
136 68 l 1,4,-1
EndSplineSet
EndChar
StartChar: .null
Encoding: 65537 -1 1
Width: 0
Flags: W
LayerCount: 2
EndChar
StartChar: nonmarkingreturn
Encoding: 65538 -1 2
Width: 682
Flags: W
LayerCount: 2
EndChar
StartChar: exclam
Encoding: 33 33 3
Width: 0
Flags: W
LayerCount: 2
EndChar
EndChars
EndSplineFont

Binary file not shown.