Commit d0cd105d authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

user32/tests: Use device context layout functions directly.

parent 904a238b
......@@ -550,24 +550,13 @@ static void test_invisible_create(void)
static void test_dc_layout(void)
{
DWORD (WINAPI *pSetLayout)(HDC hdc, DWORD layout);
DWORD (WINAPI *pGetLayout)(HDC hdc);
HWND hwnd_cache_rtl, hwnd_owndc_rtl, hwnd_classdc_rtl, hwnd_classdc2_rtl;
HDC hdc;
DWORD layout;
HMODULE mod = GetModuleHandleA("gdi32.dll");
pGetLayout = (void *)GetProcAddress( mod, "GetLayout" );
pSetLayout = (void *)GetProcAddress( mod, "SetLayout" );
if (!pGetLayout || !pSetLayout)
{
win_skip( "Don't have SetLayout\n" );
return;
}
hdc = GetDC( hwnd_cache );
pSetLayout( hdc, LAYOUT_RTL );
layout = pGetLayout( hdc );
SetLayout( hdc, LAYOUT_RTL );
layout = GetLayout( hdc );
ReleaseDC( hwnd_cache, hdc );
if (!layout)
{
......@@ -584,42 +573,42 @@ static void test_dc_layout(void)
hwnd_classdc2_rtl = CreateWindowExA(WS_EX_LAYOUTRTL, "classdc_class", NULL, WS_OVERLAPPED | WS_VISIBLE,
200, 200, 100, 100, 0, 0, GetModuleHandleA(0), NULL );
hdc = GetDC( hwnd_cache_rtl );
layout = pGetLayout( hdc );
layout = GetLayout( hdc );
ok( layout == LAYOUT_RTL, "wrong layout %x\n", layout );
pSetLayout( hdc, 0 );
SetLayout( hdc, 0 );
ReleaseDC( hwnd_cache_rtl, hdc );
hdc = GetDC( hwnd_owndc_rtl );
layout = pGetLayout( hdc );
layout = GetLayout( hdc );
ok( layout == LAYOUT_RTL, "wrong layout %x\n", layout );
ReleaseDC( hwnd_cache_rtl, hdc );
hdc = GetDC( hwnd_cache );
layout = pGetLayout( hdc );
layout = GetLayout( hdc );
ok( layout == 0, "wrong layout %x\n", layout );
ReleaseDC( hwnd_cache, hdc );
hdc = GetDC( hwnd_owndc_rtl );
layout = pGetLayout( hdc );
layout = GetLayout( hdc );
ok( layout == LAYOUT_RTL, "wrong layout %x\n", layout );
pSetLayout( hdc, 0 );
SetLayout( hdc, 0 );
ReleaseDC( hwnd_owndc_rtl, hdc );
hdc = GetDC( hwnd_owndc_rtl );
layout = pGetLayout( hdc );
layout = GetLayout( hdc );
ok( layout == LAYOUT_RTL, "wrong layout %x\n", layout );
ReleaseDC( hwnd_owndc_rtl, hdc );
hdc = GetDC( hwnd_classdc_rtl );
layout = pGetLayout( hdc );
layout = GetLayout( hdc );
ok( layout == LAYOUT_RTL, "wrong layout %x\n", layout );
pSetLayout( hdc, 0 );
SetLayout( hdc, 0 );
ReleaseDC( hwnd_classdc_rtl, hdc );
hdc = GetDC( hwnd_classdc2_rtl );
layout = pGetLayout( hdc );
layout = GetLayout( hdc );
ok( layout == LAYOUT_RTL, "wrong layout %x\n", layout );
ReleaseDC( hwnd_classdc2_rtl, hdc );
hdc = GetDC( hwnd_classdc );
layout = pGetLayout( hdc );
layout = GetLayout( hdc );
ok( layout == LAYOUT_RTL, "wrong layout %x\n", layout );
ReleaseDC( hwnd_classdc_rtl, hdc );
......
......@@ -62,8 +62,6 @@ static BOOL (WINAPI *pGetProcessDefaultLayout)( DWORD *layout );
static BOOL (WINAPI *pSetProcessDefaultLayout)( DWORD layout );
static BOOL (WINAPI *pFlashWindow)( HWND hwnd, BOOL bInvert );
static BOOL (WINAPI *pFlashWindowEx)( PFLASHWINFO pfwi );
static DWORD (WINAPI *pSetLayout)(HDC hdc, DWORD layout);
static DWORD (WINAPI *pGetLayout)(HDC hdc);
static BOOL (WINAPI *pMirrorRgn)(HWND hwnd, HRGN hrgn);
static BOOL (WINAPI *pGetWindowDisplayAffinity)(HWND hwnd, DWORD *affinity);
static BOOL (WINAPI *pSetWindowDisplayAffinity)(HWND hwnd, DWORD affinity);
......@@ -5908,6 +5906,7 @@ static void test_CreateWindow(void)
RECT rc, rc_minmax;
MINMAXINFO minmax;
BOOL res;
HDC hdc;
#define expect_menu(window, menu) \
SetLastError(0xdeadbeef); \
......@@ -6248,11 +6247,9 @@ static void test_CreateWindow(void)
"invalid error %u\n", GetLastError());
DestroyWindow(hwnd);
if (pGetLayout && pSetLayout)
{
HDC hdc = GetDC( parent );
pSetLayout( hdc, LAYOUT_RTL );
if (pGetLayout( hdc ))
hdc = GetDC( parent );
SetLayout( hdc, LAYOUT_RTL );
if (GetLayout( hdc ))
{
ReleaseDC( parent, hdc );
DestroyWindow( parent );
......@@ -6313,8 +6310,6 @@ static void test_CreateWindow(void)
else win_skip( "SetProcessDefaultLayout not supported\n" );
}
else win_skip( "SetLayout not supported\n" );
}
else win_skip( "SetLayout not available\n" );
DestroyWindow(parent);
......@@ -11856,8 +11851,6 @@ START_TEST(win)
pSetProcessDefaultLayout = (void *)GetProcAddress( user32, "SetProcessDefaultLayout" );
pFlashWindow = (void *)GetProcAddress( user32, "FlashWindow" );
pFlashWindowEx = (void *)GetProcAddress( user32, "FlashWindowEx" );
pGetLayout = (void *)GetProcAddress( gdi32, "GetLayout" );
pSetLayout = (void *)GetProcAddress( gdi32, "SetLayout" );
pMirrorRgn = (void *)GetProcAddress( gdi32, "MirrorRgn" );
pGetWindowDisplayAffinity = (void *)GetProcAddress( user32, "GetWindowDisplayAffinity" );
pSetWindowDisplayAffinity = (void *)GetProcAddress( user32, "SetWindowDisplayAffinity" );
......
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