mirror of
git://source.winehq.org/git/wine.git
synced 2024-07-21 14:34:10 +00:00
win32u: Move NtUserLogicalToPerMonitorDPIPhysicalPoint implementation from user32.
This commit is contained in:
parent
fd38290918
commit
352e24dcdf
|
@ -691,14 +691,6 @@ static POINT map_dpi_point( POINT pt, UINT dpi_from, UINT dpi_to )
|
|||
return pt;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* point_win_to_phys_dpi
|
||||
*/
|
||||
static POINT point_win_to_phys_dpi( HWND hwnd, POINT pt )
|
||||
{
|
||||
return map_dpi_point( pt, GetDpiForWindow( hwnd ), get_win_monitor_dpi( hwnd ) );
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* point_phys_to_win_dpi
|
||||
*/
|
||||
|
@ -879,19 +871,6 @@ DPI_AWARENESS_CONTEXT WINAPI SetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT
|
|||
return ULongToHandle( prev );
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* LogicalToPhysicalPointForPerMonitorDPI (USER32.@)
|
||||
*/
|
||||
BOOL WINAPI LogicalToPhysicalPointForPerMonitorDPI( HWND hwnd, POINT *pt )
|
||||
{
|
||||
RECT rect;
|
||||
|
||||
if (!GetWindowRect( hwnd, &rect )) return FALSE;
|
||||
if (pt->x < rect.left || pt->y < rect.top || pt->x > rect.right || pt->y > rect.bottom) return FALSE;
|
||||
*pt = point_win_to_phys_dpi( hwnd, *pt );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* PhysicalToLogicalPointForPerMonitorDPI (USER32.@)
|
||||
*/
|
||||
|
|
|
@ -513,7 +513,7 @@
|
|||
@ stdcall LockWindowUpdate(long) NtUserLockWindowUpdate
|
||||
@ stdcall LockWorkStation()
|
||||
@ stdcall LogicalToPhysicalPoint(long ptr)
|
||||
@ stdcall LogicalToPhysicalPointForPerMonitorDPI(long ptr)
|
||||
@ stdcall LogicalToPhysicalPointForPerMonitorDPI(long ptr) NtUserLogicalToPerMonitorDPIPhysicalPoint
|
||||
@ stdcall LookupIconIdFromDirectory(ptr long)
|
||||
@ stdcall LookupIconIdFromDirectoryEx(ptr long long long long)
|
||||
@ stub MBToWCSEx
|
||||
|
|
|
@ -218,6 +218,7 @@ static void * const syscalls[] =
|
|||
NtUserIsClipboardFormatAvailable,
|
||||
NtUserKillTimer,
|
||||
NtUserLockWindowUpdate,
|
||||
NtUserLogicalToPerMonitorDPIPhysicalPoint,
|
||||
NtUserMapVirtualKeyEx,
|
||||
NtUserMenuItemFromPoint,
|
||||
NtUserMessageCall,
|
||||
|
|
|
@ -1720,6 +1720,14 @@ POINT map_dpi_point( POINT pt, UINT dpi_from, UINT dpi_to )
|
|||
return pt;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* point_win_to_phys_dpi
|
||||
*/
|
||||
static POINT point_win_to_phys_dpi( HWND hwnd, POINT pt )
|
||||
{
|
||||
return map_dpi_point( pt, get_dpi_for_window( hwnd ), get_win_monitor_dpi( hwnd ) );
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* point_phys_to_win_dpi
|
||||
*/
|
||||
|
@ -2440,6 +2448,19 @@ BOOL WINAPI NtUserGetDpiForMonitor( HMONITOR monitor, UINT type, UINT *x, UINT *
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* LogicalToPhysicalPointForPerMonitorDPI (win32u.@)
|
||||
*/
|
||||
BOOL WINAPI NtUserLogicalToPerMonitorDPIPhysicalPoint( HWND hwnd, POINT *pt )
|
||||
{
|
||||
RECT rect;
|
||||
|
||||
if (!get_window_rect( hwnd, &rect, get_thread_dpi() )) return FALSE;
|
||||
if (pt->x < rect.left || pt->y < rect.top || pt->x > rect.right || pt->y > rect.bottom) return FALSE;
|
||||
*pt = point_win_to_phys_dpi( hwnd, *pt );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* retrieve the cached base keys for a given entry */
|
||||
static BOOL get_base_keys( enum parameter_key index, HKEY *base_key, HKEY *volatile_key )
|
||||
{
|
||||
|
|
|
@ -1067,7 +1067,7 @@
|
|||
@ stub NtUserLockWindowStation
|
||||
@ stdcall -syscall NtUserLockWindowUpdate(long)
|
||||
@ stub NtUserLockWorkStation
|
||||
@ stub NtUserLogicalToPerMonitorDPIPhysicalPoint
|
||||
@ stdcall -syscall NtUserLogicalToPerMonitorDPIPhysicalPoint(long ptr)
|
||||
@ stub NtUserLogicalToPhysicalDpiPointForWindow
|
||||
@ stub NtUserLogicalToPhysicalPoint
|
||||
@ stub NtUserMNDragLeave
|
||||
|
|
|
@ -204,6 +204,7 @@
|
|||
SYSCALL_ENTRY( NtUserIsClipboardFormatAvailable ) \
|
||||
SYSCALL_ENTRY( NtUserKillTimer ) \
|
||||
SYSCALL_ENTRY( NtUserLockWindowUpdate ) \
|
||||
SYSCALL_ENTRY( NtUserLogicalToPerMonitorDPIPhysicalPoint ) \
|
||||
SYSCALL_ENTRY( NtUserMapVirtualKeyEx ) \
|
||||
SYSCALL_ENTRY( NtUserMenuItemFromPoint ) \
|
||||
SYSCALL_ENTRY( NtUserMessageCall ) \
|
||||
|
|
|
@ -2665,6 +2665,14 @@ NTSTATUS WINAPI wow64_NtUserLockWindowUpdate( UINT *args )
|
|||
return NtUserLockWindowUpdate( hwnd );
|
||||
}
|
||||
|
||||
NTSTATUS WINAPI wow64_NtUserLogicalToPerMonitorDPIPhysicalPoint( UINT *args )
|
||||
{
|
||||
HWND hwnd = get_handle( &args );
|
||||
POINT *pt = get_ptr( &args );
|
||||
|
||||
return NtUserLogicalToPerMonitorDPIPhysicalPoint( hwnd, pt );
|
||||
}
|
||||
|
||||
NTSTATUS WINAPI wow64_NtUserMapVirtualKeyEx( UINT *args )
|
||||
{
|
||||
UINT code = get_ulong( &args );
|
||||
|
|
|
@ -773,6 +773,7 @@ BOOL WINAPI NtUserInvalidateRect( HWND hwnd, const RECT *rect, BOOL erase );
|
|||
BOOL WINAPI NtUserInvalidateRgn( HWND hwnd, HRGN hrgn, BOOL erase );
|
||||
BOOL WINAPI NtUserKillTimer( HWND hwnd, UINT_PTR id );
|
||||
BOOL WINAPI NtUserLockWindowUpdate( HWND hwnd );
|
||||
BOOL WINAPI NtUserLogicalToPerMonitorDPIPhysicalPoint( HWND hwnd, POINT *pt );
|
||||
UINT WINAPI NtUserMapVirtualKeyEx( UINT code, UINT type, HKL layout );
|
||||
INT WINAPI NtUserMenuItemFromPoint( HWND hwnd, HMENU handle, int x, int y );
|
||||
LRESULT WINAPI NtUserMessageCall( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
|
||||
|
|
Loading…
Reference in a new issue