Commit 07f2cc9d authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move process default layout handling from user32.

parent 6f3ed5fd
......@@ -309,6 +309,8 @@ static void load_uxtheme(void)
*/
BOOL WINAPI User32RegisterBuiltinClasses( const struct win_hook_params *params, ULONG size )
{
DWORD layout;
register_builtin( &BUTTON_builtin_class );
register_builtin( &COMBO_builtin_class );
register_builtin( &COMBOLBOX_builtin_class );
......@@ -322,6 +324,8 @@ BOOL WINAPI User32RegisterBuiltinClasses( const struct win_hook_params *params,
register_builtin( &STATIC_builtin_class );
register_builtin( &IME_builtin_class );
GetProcessDefaultLayout( &layout ); /* make sure that process layout is initialized */
/* Load uxtheme.dll so that standard scrollbars and dialogs are hooked for theming support */
load_uxtheme();
return TRUE;
......
......@@ -36,8 +36,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(win);
static DWORD process_layout = ~0u;
/***********************************************************************
* get_user_handle_ptr
......@@ -626,15 +624,6 @@ HWND WIN_CreateWindowEx( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE module,
}
}
/* FIXME: move to win32u */
if (!cs->hwndParent && className != (const WCHAR *)DESKTOP_CLASS_ATOM &&
(IS_INTRESOURCE(className) || wcsicmp( className, L"Message" )))
{
DWORD layout;
GetProcessDefaultLayout( &layout );
if (layout & LAYOUT_RTL) cs->dwExStyle |= WS_EX_LAYOUTRTL;
}
menu = cs->hMenu;
if (!menu && info.lpszMenuName && (cs->style & (WS_CHILD | WS_POPUP)) != WS_CHILD)
menu = LoadMenuW( cs->hInstance, info.lpszMenuName );
......@@ -1610,7 +1599,8 @@ BOOL WINAPI GetProcessDefaultLayout( DWORD *layout )
SetLastError( ERROR_NOACCESS );
return FALSE;
}
if (process_layout == ~0u)
*layout = NtUserGetProcessDefaultLayout();
if (*layout == ~0u)
{
WCHAR *str, buffer[MAX_PATH];
DWORD i, version_layout = 0;
......@@ -1640,9 +1630,8 @@ BOOL WINAPI GetProcessDefaultLayout( DWORD *layout )
done:
HeapFree( GetProcessHeap(), 0, data );
process_layout = version_layout;
NtUserSetProcessDefaultLayout( *layout = version_layout );
}
*layout = process_layout;
return TRUE;
}
......@@ -1654,8 +1643,7 @@ BOOL WINAPI GetProcessDefaultLayout( DWORD *layout )
*/
BOOL WINAPI SetProcessDefaultLayout( DWORD layout )
{
process_layout = layout;
return TRUE;
return NtUserSetProcessDefaultLayout( layout );
}
#ifdef _WIN64
......
......@@ -360,6 +360,7 @@ union sysparam_all_entry
static UINT system_dpi;
static RECT work_area;
DWORD process_layout = ~0u;
static HDC display_dc;
static pthread_mutex_t display_dc_lock = PTHREAD_MUTEX_INITIALIZER;
......@@ -4714,6 +4715,9 @@ ULONG_PTR WINAPI NtUserCallNoParam( ULONG code )
case NtUserCallNoParam_GetInputState:
return get_input_state();
case NtUserCallNoParam_GetProcessDefaultLayout:
return process_layout;
case NtUserCallNoParam_ReleaseCapture:
return release_capture();
......@@ -4805,6 +4809,10 @@ ULONG_PTR WINAPI NtUserCallOneParam( ULONG_PTR arg, ULONG code )
case NtUserCallOneParam_SetCaretBlinkTime:
return set_caret_blink_time( arg );
case NtUserCallOneParam_SetProcessDefaultLayout:
process_layout = arg;
return TRUE;
/* temporary exports */
case NtUserCallHooks:
{
......
......@@ -424,6 +424,7 @@ extern LRESULT send_message_timeout( HWND hwnd, UINT msg, WPARAM wparam, LPARAM
/* sysparams.c */
extern BOOL enable_thunk_lock DECLSPEC_HIDDEN;
extern DWORD process_layout DECLSPEC_HIDDEN;
extern HBRUSH get_55aa_brush(void) DECLSPEC_HIDDEN;
extern DWORD get_dialog_base_units(void) DECLSPEC_HIDDEN;
extern LONG get_char_dimensions( HDC hdc, TEXTMETRICW *metric, LONG *height ) DECLSPEC_HIDDEN;
......
......@@ -5126,6 +5126,7 @@ HWND WINAPI NtUserCreateWindowEx( DWORD ex_style, UNICODE_STRING *class_name,
(class_name->Length != sizeof(messageW) ||
wcsnicmp( class_name->Buffer, messageW, ARRAYSIZE(messageW) )))
{
if (process_layout & LAYOUT_RTL) cs.dwExStyle |= WS_EX_LAYOUTRTL;
parent = get_desktop_window();
}
}
......
......@@ -725,6 +725,7 @@ enum
NtUserCallNoParam_GetDesktopWindow,
NtUserCallNoParam_GetDialogBaseUnits,
NtUserCallNoParam_GetInputState,
NtUserCallNoParam_GetProcessDefaultLayout,
NtUserCallNoParam_ReleaseCapture,
/* temporary exports */
NtUserExitingThread,
......@@ -751,6 +752,11 @@ static inline BOOL NtUserGetInputState(void)
return NtUserCallNoParam( NtUserCallNoParam_GetInputState );
}
static inline DWORD NtUserGetProcessDefaultLayout(void)
{
return NtUserCallNoParam( NtUserCallNoParam_GetProcessDefaultLayout );
}
static inline BOOL NtUserReleaseCapture(void)
{
return NtUserCallNoParam( NtUserCallNoParam_ReleaseCapture );
......@@ -780,6 +786,7 @@ enum
NtUserCallOneParam_MessageBeep,
NtUserCallOneParam_RealizePalette,
NtUserCallOneParam_SetCaretBlinkTime,
NtUserCallOneParam_SetProcessDefaultLayout,
/* temporary exports */
NtUserCallHooks,
NtUserGetDeskPattern,
......@@ -898,6 +905,11 @@ static inline UINT NtUserRealizePalette( HDC hdc )
return NtUserCallOneParam( HandleToUlong(hdc), NtUserCallOneParam_RealizePalette );
}
static inline UINT NtUserSetProcessDefaultLayout( DWORD layout )
{
return NtUserCallOneParam( layout, NtUserCallOneParam_SetProcessDefaultLayout );
}
/* NtUserCallTwoParam codes, not compatible with Windows */
enum
{
......
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