Commit 11a75a65 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Introduce NtUserMapWindowPoints.

And use it in user32. Signed-off-by: 's avatarJacek Caban <jacek@codeweavers.com> Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 8b6a4584
......@@ -356,27 +356,9 @@ static BOOL WINPOS_GetWinOffset( HWND hwndFrom, HWND hwndTo, BOOL *mirrored, POI
/*******************************************************************
* MapWindowPoints (USER32.@)
*/
INT WINAPI MapWindowPoints( HWND hwndFrom, HWND hwndTo, LPPOINT lppt, UINT count )
INT WINAPI MapWindowPoints( HWND hwnd_from, HWND hwnd_to, POINT *points, UINT count )
{
BOOL mirrored;
POINT offset;
UINT i;
if (!WINPOS_GetWinOffset( hwndFrom, hwndTo, &mirrored, &offset )) return 0;
for (i = 0; i < count; i++)
{
lppt[i].x += offset.x;
lppt[i].y += offset.y;
if (mirrored) lppt[i].x = -lppt[i].x;
}
if (mirrored && count == 2) /* special case for rectangle */
{
int tmp = lppt[0].x;
lppt[0].x = lppt[1].x;
lppt[1].x = tmp;
}
return MAKELONG( LOWORD(offset.x), LOWORD(offset.y) );
return NtUserMapWindowPoints( hwnd_from, hwnd_to, points, count );
}
......
......@@ -5151,6 +5151,13 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code )
case NtUserCallHwndParam_KillSystemTimer:
return kill_system_timer( hwnd, param );
case NtUserCallHwndParam_MapWindowPoints:
{
struct map_window_points_params *params = (void *)param;
return map_window_points( hwnd, params->hwnd_to, params->points, params->count,
get_thread_dpi() );
}
case NtUserCallHwndParam_MirrorRgn:
return mirror_window_region( hwnd, UlongToHandle(param) );
......
......@@ -852,6 +852,7 @@ enum
NtUserCallHwndParam_GetWindowWord,
NtUserCallHwndParam_IsChild,
NtUserCallHwndParam_KillSystemTimer,
NtUserCallHwndParam_MapWindowPoints,
NtUserCallHwndParam_MirrorRgn,
NtUserCallHwndParam_MonitorFromWindow,
NtUserCallHwndParam_ScreenToClient,
......@@ -968,6 +969,23 @@ static inline BOOL NtUserKillSystemTimer( HWND hwnd, UINT_PTR id )
return NtUserCallHwndParam( hwnd, id, NtUserCallHwndParam_KillSystemTimer );
}
struct map_window_points_params
{
HWND hwnd_to;
POINT *points;
UINT count;
};
static inline int NtUserMapWindowPoints( HWND hwnd_from, HWND hwnd_to, POINT *points, UINT count )
{
struct map_window_points_params params;
params.hwnd_to = hwnd_to;
params.points = points;
params.count = count;
return NtUserCallHwndParam( hwnd_from, (UINT_PTR)&params,
NtUserCallHwndParam_MapWindowPoints );
}
static inline BOOL NtUserMirrorRgn( HWND hwnd, HRGN hrgn )
{
return NtUserCallHwndParam( hwnd, HandleToUlong(hrgn), NtUserCallHwndParam_MirrorRgn );
......
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