Commit 41989351 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move scroll tracking implementation from user32.

parent 13727e42
......@@ -113,13 +113,10 @@ extern HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType ) DECLSPEC_HIDDEN;
extern BOOL update_wallpaper( const WCHAR *wallpaper, const WCHAR *pattern ) DECLSPEC_HIDDEN;
/* nonclient area */
extern LRESULT NC_HandleNCMouseMove( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
extern LRESULT NC_HandleNCMouseLeave( HWND hwnd ) DECLSPEC_HIDDEN;
extern LRESULT NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam ) DECLSPEC_HIDDEN;
/* scrollbar */
extern void SCROLL_DrawNCScrollBar( HWND hwnd, HDC hdc, BOOL draw_horizontal, BOOL draw_vertical ) DECLSPEC_HIDDEN;
extern void SCROLL_DrawScrollBar( HWND hwnd, HDC hdc, INT nBar, enum SCROLL_HITTEST hit_test,
const struct SCROLL_TRACKING_INFO *tracking_info, BOOL arrows,
BOOL interior ) DECLSPEC_HIDDEN;
......
......@@ -103,20 +103,12 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
if(cs->style & (WS_HSCROLL | WS_VSCROLL))
{
SCROLLINFO si = {sizeof si, SIF_ALL, 0, 100, 0, 0, 0};
SetScrollInfo( hwnd, SB_HORZ, &si, FALSE );
SetScrollInfo( hwnd, SB_VERT, &si, FALSE );
NtUserSetScrollInfo( hwnd, SB_HORZ, &si, FALSE );
NtUserSetScrollInfo( hwnd, SB_VERT, &si, FALSE );
}
}
break;
case WM_NCMOUSEMOVE:
result = NC_HandleNCMouseMove( hwnd, wParam, lParam );
break;
case WM_NCMOUSELEAVE:
result = NC_HandleNCMouseLeave( hwnd );
break;
case WM_SYSCOMMAND:
result = NC_HandleSysCommand( hwnd, wParam, lParam );
break;
......@@ -238,20 +230,12 @@ LRESULT WINAPI DefWindowProcW(
if(cs->style & (WS_HSCROLL | WS_VSCROLL))
{
SCROLLINFO si = {sizeof si, SIF_ALL, 0, 100, 0, 0, 0};
SetScrollInfo( hwnd, SB_HORZ, &si, FALSE );
SetScrollInfo( hwnd, SB_VERT, &si, FALSE );
NtUserSetScrollInfo( hwnd, SB_HORZ, &si, FALSE );
NtUserSetScrollInfo( hwnd, SB_VERT, &si, FALSE );
}
}
break;
case WM_NCMOUSEMOVE:
result = NC_HandleNCMouseMove( hwnd, wParam, lParam );
break;
case WM_NCMOUSELEAVE:
result = NC_HandleNCMouseLeave( hwnd );
break;
case WM_SYSCOMMAND:
result = NC_HandleSysCommand( hwnd, wParam, lParam );
break;
......
......@@ -1639,7 +1639,7 @@ static void EDIT_UpdateScrollInfo(EDITSTATE *es)
si.nPos = es->y_offset;
TRACE("SB_VERT, nMin=%d, nMax=%d, nPage=%d, nPos=%d\n",
si.nMin, si.nMax, si.nPage, si.nPos);
SetScrollInfo(es->hwndSelf, SB_VERT, &si, TRUE);
NtUserSetScrollInfo(es->hwndSelf, SB_VERT, &si, TRUE);
}
if ((es->style & WS_HSCROLL) && !(es->flags & EF_HSCROLL_TRACK))
......@@ -1653,7 +1653,7 @@ static void EDIT_UpdateScrollInfo(EDITSTATE *es)
si.nPos = es->x_offset;
TRACE("SB_HORZ, nMin=%d, nMax=%d, nPage=%d, nPos=%d\n",
si.nMin, si.nMax, si.nPage, si.nPos);
SetScrollInfo(es->hwndSelf, SB_HORZ, &si, TRUE);
NtUserSetScrollInfo(es->hwndSelf, SB_HORZ, &si, TRUE);
}
}
......
......@@ -329,7 +329,7 @@ static void LISTBOX_UpdateScroll( LB_DESCR *descr )
SCROLLINFO info;
/* Check the listbox scroll bar flags individually before we call
SetScrollInfo otherwise when the listbox style is WS_HSCROLL and
NtUserSetScrollInfo otherwise when the listbox style is WS_HSCROLL and
no WS_VSCROLL, we end up with an uninitialized, visible horizontal
scroll bar when we do not need one.
if (!(descr->style & WS_VSCROLL)) return;
......@@ -357,11 +357,11 @@ static void LISTBOX_UpdateScroll( LB_DESCR *descr )
if (descr->style & LBS_DISABLENOSCROLL)
info.fMask |= SIF_DISABLENOSCROLL;
if (descr->style & WS_HSCROLL)
SetScrollInfo( descr->self, SB_HORZ, &info, TRUE );
NtUserSetScrollInfo( descr->self, SB_HORZ, &info, TRUE );
info.nMax = 0;
info.fMask = SIF_RANGE;
if (descr->style & WS_VSCROLL)
SetScrollInfo( descr->self, SB_VERT, &info, TRUE );
NtUserSetScrollInfo( descr->self, SB_VERT, &info, TRUE );
}
else
{
......@@ -373,7 +373,7 @@ static void LISTBOX_UpdateScroll( LB_DESCR *descr )
if (descr->style & LBS_DISABLENOSCROLL)
info.fMask |= SIF_DISABLENOSCROLL;
if (descr->style & WS_VSCROLL)
SetScrollInfo( descr->self, SB_VERT, &info, TRUE );
NtUserSetScrollInfo( descr->self, SB_VERT, &info, TRUE );
if ((descr->style & WS_HSCROLL) && descr->horz_extent)
{
......@@ -382,7 +382,7 @@ static void LISTBOX_UpdateScroll( LB_DESCR *descr )
info.fMask = SIF_POS | SIF_PAGE;
if (descr->style & LBS_DISABLENOSCROLL)
info.fMask |= SIF_DISABLENOSCROLL;
SetScrollInfo( descr->self, SB_HORZ, &info, TRUE );
NtUserSetScrollInfo( descr->self, SB_HORZ, &info, TRUE );
}
else
{
......@@ -391,7 +391,7 @@ static void LISTBOX_UpdateScroll( LB_DESCR *descr )
info.nMin = 0;
info.nMax = 0;
info.fMask = SIF_RANGE | SIF_DISABLENOSCROLL;
SetScrollInfo( descr->self, SB_HORZ, &info, TRUE );
NtUserSetScrollInfo( descr->self, SB_HORZ, &info, TRUE );
}
else
{
......@@ -1366,7 +1366,7 @@ static LRESULT LISTBOX_SetHorizontalExtent( LB_DESCR *descr, INT extent )
info.fMask = SIF_RANGE;
if (descr->style & LBS_DISABLENOSCROLL)
info.fMask |= SIF_DISABLENOSCROLL;
SetScrollInfo( descr->self, SB_HORZ, &info, TRUE );
NtUserSetScrollInfo( descr->self, SB_HORZ, &info, TRUE );
}
if (descr->horz_pos > extent - descr->width)
LISTBOX_SetHorizontalPos( descr, extent - descr->width );
......
......@@ -1730,7 +1730,7 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll )
info.nMin = childRect.left;
info.nMax = childRect.right - clientRect.right;
info.nPos = clientRect.left - childRect.left;
SetScrollInfo(hwnd, SB_HORZ, &info, TRUE);
NtUserSetScrollInfo(hwnd, SB_HORZ, &info, TRUE);
}
if (scroll == SB_HORZ) break;
/* fall through */
......@@ -1740,7 +1740,7 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll )
info.nMin = childRect.top;
info.nMax = childRect.bottom - clientRect.bottom;
info.nPos = clientRect.top - childRect.top;
SetScrollInfo(hwnd, SB_VERT, &info, TRUE);
NtUserSetScrollInfo(hwnd, SB_VERT, &info, TRUE);
}
break;
}
......
......@@ -142,65 +142,6 @@ BOOL WINAPI DECLSPEC_HOTPATCH AdjustWindowRectExForDpi( LPRECT rect, DWORD style
}
LRESULT NC_HandleNCMouseMove(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
RECT rect;
POINT pt;
TRACE("hwnd=%p wparam=%#Ix lparam=%#Ix\n", hwnd, wParam, lParam);
if (wParam != HTHSCROLL && wParam != HTVSCROLL)
return 0;
WIN_GetRectangles(hwnd, COORDS_CLIENT, &rect, NULL);
pt.x = (short)LOWORD(lParam);
pt.y = (short)HIWORD(lParam);
ScreenToClient(hwnd, &pt);
pt.x -= rect.left;
pt.y -= rect.top;
SCROLL_HandleScrollEvent(hwnd, wParam == HTHSCROLL ? SB_HORZ : SB_VERT, WM_NCMOUSEMOVE, pt);
return 0;
}
LRESULT NC_HandleNCMouseLeave(HWND hwnd)
{
LONG style = GetWindowLongW(hwnd, GWL_STYLE);
POINT pt = {0, 0};
TRACE("hwnd=%p\n", hwnd);
if (style & WS_HSCROLL)
SCROLL_HandleScrollEvent(hwnd, SB_HORZ, WM_NCMOUSELEAVE, pt);
if (style & WS_VSCROLL)
SCROLL_HandleScrollEvent(hwnd, SB_VERT, WM_NCMOUSELEAVE, pt);
return 0;
}
/***********************************************************************
* NC_TrackScrollBar
*
* Track a mouse button press on the horizontal or vertical scroll-bar.
*/
static void NC_TrackScrollBar( HWND hwnd, WPARAM wParam, POINT pt )
{
INT scrollbar;
if ((wParam & 0xfff0) == SC_HSCROLL)
{
if ((wParam & 0x0f) != HTHSCROLL) return;
scrollbar = SB_HORZ;
}
else /* SC_VSCROLL */
{
if ((wParam & 0x0f) != HTVSCROLL) return;
scrollbar = SB_VERT;
}
SCROLL_TrackScrollBar( hwnd, scrollbar, pt );
}
/***********************************************************************
* NC_HandleSysCommand
......@@ -214,16 +155,6 @@ LRESULT NC_HandleSysCommand( HWND hwnd, WPARAM wParam, LPARAM lParam )
switch (wParam & 0xfff0)
{
case SC_VSCROLL:
case SC_HSCROLL:
{
POINT pt;
pt.x = (short)LOWORD(lParam);
pt.y = (short)HIWORD(lParam);
NC_TrackScrollBar( hwnd, wParam, pt );
}
break;
case SC_TASKLIST:
WinExec( "taskman.exe", SW_SHOWNORMAL );
break;
......
......@@ -206,7 +206,7 @@
@ stdcall EnableMenuItem(long long long) NtUserEnableMenuItem
@ stdcall EnableMouseInPointer(long)
@ stdcall EnableNonClientDpiScaling(long)
@ stdcall EnableScrollBar(long long long)
@ stdcall -import EnableScrollBar(long long long) NtUserEnableScrollBar
@ stdcall EnableWindow(long long)
@ stdcall EndDeferWindowPos(long)
@ stdcall EndDialog(long long)
......@@ -373,7 +373,7 @@
@ stdcall GetRawInputDeviceList(ptr ptr long) NtUserGetRawInputDeviceList
# @ stub GetReasonTitleFromReasonCode
@ stdcall GetRegisteredRawInputDevices(ptr ptr long) NtUserGetRegisteredRawInputDevices
@ stdcall GetScrollBarInfo(long long ptr)
@ stdcall GetScrollBarInfo(long long ptr) NtUserGetScrollBarInfo
@ stdcall GetScrollInfo(long long ptr)
@ stdcall GetScrollPos(long long)
@ stdcall GetScrollRange(long long ptr ptr)
......@@ -699,7 +699,7 @@
@ stdcall SetPropW(long wstr long)
@ stdcall SetRect(ptr long long long long)
@ stdcall SetRectEmpty(ptr)
@ stdcall SetScrollInfo(long long ptr long)
@ stdcall -import SetScrollInfo(long long ptr long) NtUserSetScrollInfo
@ stdcall SetScrollPos(long long long long)
@ stdcall SetScrollRange(long long long long long)
@ stdcall SetShellWindow(long)
......
......@@ -157,7 +157,6 @@ static const struct user_callbacks user_funcs =
ImmProcessKey,
ImmTranslateMessage,
NtWaitForMultipleObjects,
SCROLL_DrawNCScrollBar,
free_win_ptr,
SCROLL_GetInternalInfo,
notify_ime,
......@@ -174,6 +173,16 @@ static NTSTATUS WINAPI User32CopyImage( const struct copy_image_params *params,
return HandleToUlong( ret );
}
static NTSTATUS WINAPI User32DrawScrollBar( const struct draw_scroll_bar_params *params, ULONG size )
{
RECT rect = params->rect;
user_api->pScrollBarDraw( params->hwnd, params->hdc, params->bar, params->hit_test,
&params->tracking_info, params->arrows, params->interior,
&rect, params->arrow_size, params->thumb_pos,
params->thumb_size, params->vertical );
return 0;
}
static NTSTATUS WINAPI User32DrawText( const struct draw_text_params *params, ULONG size )
{
size -= FIELD_OFFSET( struct draw_text_params, str );
......@@ -220,6 +229,7 @@ static const void *kernel_callback_table[NtUserCallCount] =
User32CallWindowProc,
User32CallWindowsHook,
User32CopyImage,
User32DrawScrollBar,
User32DrawText,
User32FreeCachedClipboardData,
User32LoadDriver,
......
......@@ -1182,20 +1182,6 @@ BOOL WINAPI IsWindowVisible( HWND hwnd )
}
/***********************************************************************
* WIN_IsWindowDrawable
*
* hwnd is drawable when it is visible, all parents are not
* minimized, and it is itself not minimized unless we are
* trying to draw its default class icon.
*/
BOOL WIN_IsWindowDrawable( HWND hwnd, BOOL icon )
{
/* FIXME: move callers to win32u */
return NtUserCallHwndParam( hwnd, icon, NtUserIsWindowDrawable );
}
/*******************************************************************
* GetTopWindow (USER32.@)
*/
......
......@@ -44,7 +44,6 @@ extern HWND WIN_IsCurrentThread( HWND hwnd ) DECLSPEC_HIDDEN;
extern ULONG WIN_SetStyle( HWND hwnd, ULONG set_bits, ULONG clear_bits ) DECLSPEC_HIDDEN;
extern BOOL WIN_GetRectangles( HWND hwnd, enum coords_relative relative, RECT *rectWindow, RECT *rectClient ) DECLSPEC_HIDDEN;
extern HWND WIN_CreateWindowEx( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE module, BOOL unicode ) DECLSPEC_HIDDEN;
extern BOOL WIN_IsWindowDrawable( HWND hwnd, BOOL ) DECLSPEC_HIDDEN;
extern HWND *WIN_ListChildren( HWND hwnd ) DECLSPEC_HIDDEN;
extern void MDI_CalcDefaultChildPos( HWND hwndClient, INT total, LPPOINT lpPos, INT delta, UINT *id ) DECLSPEC_HIDDEN;
extern HDESK open_winstation_desktop( HWINSTA hwinsta, LPCWSTR name, DWORD flags, BOOL inherit, ACCESS_MASK access ) DECLSPEC_HIDDEN;
......
......@@ -922,6 +922,28 @@ static void sys_command_size_move( HWND hwnd, WPARAM wparam )
}
}
/***********************************************************************
* track_nc_scroll_bar
*
* Track a mouse button press on the horizontal or vertical scroll-bar.
*/
static void track_nc_scroll_bar( HWND hwnd, WPARAM wparam, POINT pt )
{
int scrollbar;
if ((wparam & 0xfff0) == SC_HSCROLL)
{
if ((wparam & 0x0f) != HTHSCROLL) return;
scrollbar = SB_HORZ;
}
else /* SC_VSCROLL */
{
if ((wparam & 0x0f) != HTVSCROLL) return;
scrollbar = SB_VERT;
}
track_scroll_bar( hwnd, scrollbar, pt );
}
static LRESULT handle_sys_command( HWND hwnd, WPARAM wparam, LPARAM lparam )
{
TRACE( "hwnd %p WM_SYSCOMMAND %lx %lx\n", hwnd, wparam, lparam );
......@@ -956,7 +978,13 @@ static LRESULT handle_sys_command( HWND hwnd, WPARAM wparam, LPARAM lparam )
case SC_VSCROLL:
case SC_HSCROLL:
return 1; /* FIXME: handle on client side */
{
POINT pt;
pt.x = (short)LOWORD( lparam );
pt.y = (short)HIWORD( lparam );
track_nc_scroll_bar( hwnd, wparam, pt );
}
break;
case SC_MOUSEMENU:
track_mouse_menu_bar( hwnd, wparam & 0x000F, (short)LOWORD(lparam), (short)HIWORD(lparam) );
......@@ -1736,8 +1764,7 @@ static void nc_paint( HWND hwnd, HRGN clip )
draw_rect_edge( hdc, &rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST, 1 );
/* Draw the scroll-bars */
if (user_callbacks)
user_callbacks->draw_nc_scrollbar( hwnd, hdc, style & WS_HSCROLL, style & WS_VSCROLL );
draw_nc_scrollbar( hwnd, hdc, style & WS_HSCROLL, style & WS_VSCROLL );
/* Draw the "size-box" */
if ((style & WS_VSCROLL) && (style & WS_HSCROLL))
......@@ -2295,6 +2322,42 @@ static HBRUSH handle_control_color( HDC hdc, UINT type )
return get_sys_color_brush( COLOR_WINDOW );
}
static LRESULT handle_nc_mouse_move( HWND hwnd, WPARAM wparam, LPARAM lparam )
{
RECT rect;
POINT pt;
TRACE( "hwnd=%p wparam=%#lx lparam=%#lx\n", hwnd, wparam, lparam );
if (wparam != HTHSCROLL && wparam != HTVSCROLL)
return 0;
get_window_rects( hwnd, COORDS_CLIENT, &rect, NULL, get_thread_dpi() );
pt.x = (short)LOWORD( lparam );
pt.y = (short)HIWORD( lparam );
screen_to_client( hwnd, &pt );
pt.x -= rect.left;
pt.y -= rect.top;
handle_scroll_event( hwnd, wparam == HTHSCROLL ? SB_HORZ : SB_VERT, WM_NCMOUSEMOVE, pt );
return 0;
}
static LRESULT handle_nc_mouse_leave( HWND hwnd )
{
LONG style = get_window_long( hwnd, GWL_STYLE );
POINT pt = {0, 0};
TRACE( "hwnd=%p\n", hwnd );
if (style & WS_HSCROLL)
handle_scroll_event( hwnd, SB_HORZ, WM_NCMOUSELEAVE, pt );
if (style & WS_VSCROLL)
handle_scroll_event( hwnd, SB_VERT, WM_NCMOUSELEAVE, pt );
return 0;
}
LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, BOOL ansi )
{
LRESULT result = 0;
......@@ -2352,6 +2415,14 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
case WM_NCLBUTTONDBLCLK:
return handle_nc_button_dbl_click( hwnd, wparam, lparam );
case WM_NCMOUSEMOVE:
result = handle_nc_mouse_move( hwnd, wparam, lparam );
break;
case WM_NCMOUSELEAVE:
result = handle_nc_mouse_leave( hwnd );
break;
case WM_RBUTTONUP:
{
POINT pt;
......
......@@ -1164,6 +1164,7 @@ static struct unix_funcs unix_funcs =
NtUserDrawMenuBarTemp,
NtUserEmptyClipboard,
NtUserEnableMenuItem,
NtUserEnableScrollBar,
NtUserEndDeferWindowPosEx,
NtUserEndPaint,
NtUserEnumDisplayDevices,
......@@ -1184,6 +1185,7 @@ static struct unix_funcs unix_funcs =
NtUserGetMessage,
NtUserGetPriorityClipboardFormat,
NtUserGetQueueStatus,
NtUserGetScrollBarInfo,
NtUserGetSystemMenu,
NtUserGetUpdateRect,
NtUserGetUpdateRgn,
......@@ -1226,6 +1228,7 @@ static struct unix_funcs unix_funcs =
NtUserSetLayeredWindowAttributes,
NtUserSetMenu,
NtUserSetParent,
NtUserSetScrollInfo,
NtUserSetSysColors,
NtUserSetSystemMenu,
NtUserSetWindowLong,
......
......@@ -35,7 +35,6 @@ struct user_callbacks
BOOL (WINAPI *pImmProcessKey)(HWND, HKL, UINT, LPARAM, DWORD);
BOOL (WINAPI *pImmTranslateMessage)(HWND, UINT, WPARAM, LPARAM);
NTSTATUS (WINAPI *pNtWaitForMultipleObjects)(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,const LARGE_INTEGER*);
void (CDECL *draw_nc_scrollbar)( HWND hwnd, HDC hdc, BOOL draw_horizontal, BOOL draw_vertical );
void (CDECL *free_win_ptr)( struct tagWND *win );
struct scroll_info *(CDECL *get_scroll_info)( HWND hwnd, INT nBar, BOOL alloc );
void (CDECL *notify_ime)( HWND hwnd, UINT param );
......
......@@ -866,7 +866,7 @@
@ stub NtUserEnableMouseInputForCursorSuppression
@ stub NtUserEnableNonClientDpiScaling
@ stub NtUserEnableResizeLayoutSynchronization
@ stub NtUserEnableScrollBar
@ stdcall NtUserEnableScrollBar(long long long)
@ stub NtUserEnableSoftwareCursorForScreenCapture
@ stub NtUserEnableTouchPad
@ stub NtUserEnableWindowGDIScaledDpiMessage
......@@ -991,7 +991,7 @@
@ stdcall -syscall NtUserGetRegisteredRawInputDevices(ptr ptr long)
@ stub NtUserGetRequiredCursorSizes
@ stub NtUserGetResizeDCompositionSynchronizationObject
@ stub NtUserGetScrollBarInfo
@ stdcall NtUserGetScrollBarInfo(long long ptr)
@ stub NtUserGetSharedWindowData
@ stdcall -syscall NtUserGetSystemDpiForProcess(long)
@ stdcall NtUserGetSystemMenu(long long)
......@@ -1223,7 +1223,7 @@
@ stub NtUserSetProcessUIAccessZorder
@ stdcall -syscall NtUserSetProcessWindowStation(long)
@ stdcall -syscall NtUserSetProp(long wstr ptr)
@ stub NtUserSetScrollInfo
@ stdcall NtUserSetScrollInfo(long long ptr long)
@ stub NtUserSetSensorPresence
@ stub NtUserSetSharedWindowData
@ stub NtUserSetShellWindowEx
......
......@@ -223,6 +223,7 @@ struct unix_funcs
DWORD (WINAPI *pNtUserDrawMenuBarTemp)( HWND hwnd, HDC hdc, RECT *rect, HMENU handle, HFONT font );
BOOL (WINAPI *pNtUserEmptyClipboard)(void);
BOOL (WINAPI *pNtUserEnableMenuItem)( HMENU handle, UINT id, UINT flags );
BOOL (WINAPI *pNtUserEnableScrollBar)( HWND hwnd, UINT bar, UINT flags );
BOOL (WINAPI *pNtUserEndDeferWindowPosEx)( HDWP hdwp, BOOL async );
BOOL (WINAPI *pNtUserEndPaint)( HWND hwnd, const PAINTSTRUCT *ps );
NTSTATUS (WINAPI *pNtUserEnumDisplayDevices)( UNICODE_STRING *device, DWORD index,
......@@ -248,6 +249,7 @@ struct unix_funcs
BOOL (WINAPI *pNtUserGetMessage)( MSG *msg, HWND hwnd, UINT first, UINT last );
INT (WINAPI *pNtUserGetPriorityClipboardFormat)( UINT *list, INT count );
DWORD (WINAPI *pNtUserGetQueueStatus)( UINT flags );
BOOL (WINAPI *pNtUserGetScrollBarInfo)( HWND hwnd, LONG id, SCROLLBARINFO *info );
HMENU (WINAPI *pNtUserGetSystemMenu)( HWND hwnd, BOOL revert );
BOOL (WINAPI *pNtUserGetUpdateRect)( HWND hwnd, RECT *rect, BOOL erase );
INT (WINAPI *pNtUserGetUpdateRgn)( HWND hwnd, HRGN hrgn, BOOL erase );
......@@ -300,6 +302,7 @@ struct unix_funcs
BOOL (WINAPI *pNtUserSetLayeredWindowAttributes)( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags );
BOOL (WINAPI *pNtUserSetMenu)( HWND hwnd, HMENU menu );
HWND (WINAPI *pNtUserSetParent)( HWND hwnd, HWND parent );
INT (WINAPI *pNtUserSetScrollInfo)( HWND hwnd, INT bar, const SCROLLINFO *info, BOOL redraw );
BOOL (WINAPI *pNtUserSetSysColors)( INT count, const INT *colors, const COLORREF *values );
BOOL (WINAPI *pNtUserSetSystemMenu)( HWND hwnd, HMENU menu );
LONG (WINAPI *pNtUserSetWindowLong)( HWND hwnd, INT offset, LONG newval, BOOL ansi );
......@@ -441,9 +444,13 @@ extern BOOL process_rawinput_message( MSG *msg, UINT hw_id, const struct hardwar
extern BOOL rawinput_device_get_usages( HANDLE handle, USHORT *usage_page, USHORT *usage ) DECLSPEC_HIDDEN;
/* scroll.c */
extern void draw_nc_scrollbar( HWND hwnd, HDC hdc, BOOL draw_horizontal, BOOL draw_vertical ) DECLSPEC_HIDDEN;
extern BOOL get_scroll_info( HWND hwnd, INT bar, SCROLLINFO *info ) DECLSPEC_HIDDEN;
extern void handle_scroll_event( HWND hwnd, INT bar, UINT msg, POINT pt ) DECLSPEC_HIDDEN;
extern LRESULT scroll_bar_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
BOOL ansi ) DECLSPEC_HIDDEN;
extern void set_standard_scroll_painted( HWND hwnd, int bar, BOOL painted ) DECLSPEC_HIDDEN;
extern void track_scroll_bar( HWND hwnd, int scrollbar, POINT pt ) DECLSPEC_HIDDEN;
/* sysparams.c */
extern BOOL enable_thunk_lock DECLSPEC_HIDDEN;
......@@ -484,6 +491,7 @@ extern HDWP begin_defer_window_pos( INT count ) DECLSPEC_HIDDEN;
extern BOOL client_to_screen( HWND hwnd, POINT *pt ) DECLSPEC_HIDDEN;
extern void destroy_thread_windows(void) DECLSPEC_HIDDEN;
extern LRESULT destroy_window( HWND hwnd ) DECLSPEC_HIDDEN;
extern BOOL enable_window( HWND hwnd, BOOL enable ) DECLSPEC_HIDDEN;
extern BOOL get_client_rect( HWND hwnd, RECT *rect ) DECLSPEC_HIDDEN;
extern HWND get_desktop_window(void) DECLSPEC_HIDDEN;
extern UINT get_dpi_for_window( HWND hwnd ) DECLSPEC_HIDDEN;
......
......@@ -812,7 +812,7 @@ BOOL is_window_unicode( HWND hwnd )
}
/* see EnableWindow */
static BOOL enable_window( HWND hwnd, BOOL enable )
BOOL enable_window( HWND hwnd, BOOL enable )
{
BOOL ret;
......@@ -5442,6 +5442,12 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code )
case NtUserCallHwndParam_GetClientRect:
return get_client_rect( hwnd, (RECT *)param );
case NtUserCallHwndParam_GetScrollInfo:
{
struct get_scroll_info_params *params = (void *)param;
return get_scroll_info( hwnd, params->bar, params->info );
}
case NtUserCallHwndParam_GetWindowInfo:
return get_window_info( hwnd, (WINDOWINFO *)param );
......@@ -5501,9 +5507,6 @@ ULONG_PTR WINAPI NtUserCallHwndParam( HWND hwnd, DWORD_PTR param, DWORD code )
return show_owned_popups( hwnd, param );
/* temporary exports */
case NtUserIsWindowDrawable:
return is_window_drawable( hwnd, param );
case NtUserSetWindowStyle:
{
STYLESTRUCT *style = (void *)param;
......
......@@ -887,6 +887,12 @@ BOOL WINAPI NtUserEnableMenuItem( HMENU handle, UINT id, UINT flags )
return unix_funcs->pNtUserEnableMenuItem( handle, id, flags );
}
BOOL WINAPI NtUserEnableScrollBar( HWND hwnd, UINT bar, UINT flags )
{
if (!unix_funcs) return FALSE;
return unix_funcs->pNtUserEnableScrollBar( hwnd, bar, flags );
}
BOOL WINAPI NtUserEndDeferWindowPosEx( HDWP hdwp, BOOL async )
{
if (!unix_funcs) return FALSE;
......@@ -1048,6 +1054,12 @@ DWORD WINAPI NtUserGetQueueStatus( UINT flags )
return unix_funcs->pNtUserGetQueueStatus( flags );
}
BOOL WINAPI NtUserGetScrollBarInfo( HWND hwnd, LONG id, SCROLLBARINFO *info )
{
if (!unix_funcs) return FALSE;
return unix_funcs->pNtUserGetScrollBarInfo( hwnd, id, info );
}
BOOL WINAPI NtUserGetUpdatedClipboardFormats( UINT *formats, UINT size, UINT *out_size )
{
if (!unix_funcs) return FALSE;
......@@ -1274,6 +1286,12 @@ HWND WINAPI NtUserSetParent( HWND hwnd, HWND parent )
return unix_funcs->pNtUserSetParent( hwnd, parent );
}
INT WINAPI NtUserSetScrollInfo( HWND hwnd, INT bar, const SCROLLINFO *info, BOOL redraw )
{
if (!unix_funcs) return 0;
return unix_funcs->pNtUserSetScrollInfo( hwnd, bar, info, redraw );
}
BOOL WINAPI NtUserSetSysColors( INT count, const INT *colors, const COLORREF *values )
{
if (!unix_funcs) return FALSE;
......
......@@ -33,6 +33,7 @@ enum
NtUserCallWinProc,
NtUserCallWindowsHook,
NtUserCopyImage,
NtUserDrawScrollBar,
NtUserDrawText,
NtUserFreeCachedClipboardData,
NtUserLoadDriver,
......@@ -336,6 +337,24 @@ struct set_clipboard_params
UINT seqno;
};
/* NtUserDrawScrollBar params */
struct draw_scroll_bar_params
{
HWND hwnd;
HDC hdc;
INT bar;
UINT hit_test;
struct SCROLL_TRACKING_INFO tracking_info;
BOOL arrows;
BOOL interior;
RECT rect;
UINT enable_flags;
INT arrow_size;
INT thumb_pos;
INT thumb_size;
BOOL vertical;
};
/* internal messages codes */
enum wine_internal_message
{
......@@ -559,6 +578,7 @@ BOOL WINAPI NtUserDrawIconEx( HDC hdc, INT x0, INT y0, HICON icon, INT width,
DWORD WINAPI NtUserDrawMenuBarTemp( HWND hwnd, HDC hdc, RECT *rect, HMENU handle, HFONT font );
BOOL WINAPI NtUserEmptyClipboard(void);
BOOL WINAPI NtUserEnableMenuItem( HMENU handle, UINT id, UINT flags );
BOOL WINAPI NtUserEnableScrollBar( HWND hwnd, UINT bar, UINT flags );
BOOL WINAPI NtUserEndDeferWindowPosEx( HDWP hdwp, BOOL async );
BOOL WINAPI NtUserEndMenu(void);
BOOL WINAPI NtUserEndPaint( HWND hwnd, const PAINTSTRUCT *ps );
......@@ -625,6 +645,7 @@ UINT WINAPI NtUserGetRawInputData( HRAWINPUT rawinput, UINT command, void *da
UINT WINAPI NtUserGetRawInputDeviceInfo( HANDLE handle, UINT command, void *data, UINT *data_size );
UINT WINAPI NtUserGetRawInputDeviceList( RAWINPUTDEVICELIST *devices, UINT *device_count, UINT size );
UINT WINAPI NtUserGetRegisteredRawInputDevices( RAWINPUTDEVICE *devices, UINT *device_count, UINT size );
BOOL WINAPI NtUserGetScrollBarInfo( HWND hwnd, LONG id, SCROLLBARINFO *info );
ULONG WINAPI NtUserGetSystemDpiForProcess( HANDLE process );
HMENU WINAPI NtUserGetSystemMenu( HWND hwnd, BOOL revert );
HDESK WINAPI NtUserGetThreadDesktop( DWORD thread );
......@@ -701,6 +722,7 @@ HWND WINAPI NtUserSetParent( HWND hwnd, HWND parent );
BOOL WINAPI NtUserSetProcessDpiAwarenessContext( ULONG awareness, ULONG unknown );
BOOL WINAPI NtUserSetProcessWindowStation( HWINSTA handle );
BOOL WINAPI NtUserSetProp( HWND hwnd, const WCHAR *str, HANDLE handle );
INT WINAPI NtUserSetScrollInfo( HWND hwnd, INT bar, const SCROLLINFO *info, BOOL redraw );
BOOL WINAPI NtUserSetSysColors( INT count, const INT *colors, const COLORREF *values );
BOOL WINAPI NtUserSetSystemMenu( HWND hwnd, HMENU menu );
UINT_PTR WINAPI NtUserSetSystemTimer( HWND hwnd, UINT_PTR id, UINT timeout );
......@@ -1085,6 +1107,7 @@ enum
NtUserCallHwndParam_GetClassLongPtrW,
NtUserCallHwndParam_GetClassWord,
NtUserCallHwndParam_GetClientRect,
NtUserCallHwndParam_GetScrollInfo,
NtUserCallHwndParam_GetWindowInfo,
NtUserCallHwndParam_GetWindowLongA,
NtUserCallHwndParam_GetWindowLongW,
......@@ -1104,7 +1127,6 @@ enum
NtUserCallHwndParam_SetWindowPixelFormat,
NtUserCallHwndParam_ShowOwnedPopups,
/* temporary exports */
NtUserIsWindowDrawable,
NtUserSetWindowStyle,
NtUserSpyGetMsgName,
};
......@@ -1149,6 +1171,18 @@ static inline BOOL NtUserGetClientRect( HWND hwnd, RECT *rect )
return NtUserCallHwndParam( hwnd, (UINT_PTR)rect, NtUserCallHwndParam_GetClientRect );
}
struct get_scroll_info_params
{
int bar;
SCROLLINFO *info;
};
static inline BOOL NtUserGetScrollInfo( HWND hwnd, INT bar, SCROLLINFO *info )
{
struct get_scroll_info_params params = { .bar = bar, .info = info };
return NtUserCallHwndParam( hwnd, (UINT_PTR)&params, NtUserCallHwndParam_GetScrollInfo );
}
static inline BOOL NtUserGetWindowInfo( HWND hwnd, WINDOWINFO *info )
{
return NtUserCallHwndParam( hwnd, (UINT_PTR)info, NtUserCallHwndParam_GetWindowInfo );
......
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