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

win32u: Move NtUserShowScrollBar implementation from user32.

parent f3c36f72
...@@ -395,7 +395,7 @@ static void LISTBOX_UpdateScroll( LB_DESCR *descr ) ...@@ -395,7 +395,7 @@ static void LISTBOX_UpdateScroll( LB_DESCR *descr )
} }
else else
{ {
ShowScrollBar( descr->self, SB_HORZ, FALSE ); NtUserShowScrollBar( descr->self, SB_HORZ, FALSE );
} }
} }
} }
......
...@@ -1158,7 +1158,7 @@ LRESULT MDIClientWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPARAM ...@@ -1158,7 +1158,7 @@ LRESULT MDIClientWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPARAM
case WM_MDITILE: case WM_MDITILE:
ci->mdiFlags |= MDIF_NEEDUPDATE; ci->mdiFlags |= MDIF_NEEDUPDATE;
ShowScrollBar( hwnd, SB_BOTH, FALSE ); NtUserShowScrollBar( hwnd, SB_BOTH, FALSE );
MDITile( hwnd, ci, wParam ); MDITile( hwnd, ci, wParam );
ci->mdiFlags &= ~MDIF_NEEDUPDATE; ci->mdiFlags &= ~MDIF_NEEDUPDATE;
return 0; return 0;
...@@ -1701,7 +1701,7 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll ) ...@@ -1701,7 +1701,7 @@ void WINAPI CalcChildScroll( HWND hwnd, INT scroll )
if (style & WS_MAXIMIZE) if (style & WS_MAXIMIZE)
{ {
HeapFree( GetProcessHeap(), 0, list ); HeapFree( GetProcessHeap(), 0, list );
ShowScrollBar( hwnd, SB_BOTH, FALSE ); NtUserShowScrollBar( hwnd, SB_BOTH, FALSE );
return; return;
} }
if (style & WS_VISIBLE) if (style & WS_VISIBLE)
......
...@@ -2004,31 +2004,6 @@ static BOOL SCROLL_ShowScrollBar( HWND hwnd, INT nBar, BOOL fShowH, BOOL fShowV ...@@ -2004,31 +2004,6 @@ static BOOL SCROLL_ShowScrollBar( HWND hwnd, INT nBar, BOOL fShowH, BOOL fShowV
/************************************************************************* /*************************************************************************
* ShowScrollBar (USER32.@)
*
* Shows or hides the scroll bar.
*
* PARAMS
* hwnd [I] Handle of window with scrollbar(s)
* nBar [I] One of SB_HORZ, SB_VERT, or SB_CTL
* fShow [I] TRUE = show, FALSE = hide
*
* RETURNS
* Success: TRUE
* Failure: FALSE
*/
BOOL WINAPI DECLSPEC_HOTPATCH ShowScrollBar(HWND hwnd, INT nBar, BOOL fShow)
{
if ( !hwnd )
return FALSE;
SCROLL_ShowScrollBar( hwnd, nBar, (nBar == SB_VERT) ? 0 : fShow,
(nBar == SB_HORZ) ? 0 : fShow );
return TRUE;
}
/*************************************************************************
* EnableScrollBar (USER32.@) * EnableScrollBar (USER32.@)
* *
* Enables or disables the scroll bars. * Enables or disables the scroll bars.
......
...@@ -739,7 +739,7 @@ ...@@ -739,7 +739,7 @@
@ stdcall ShowCaret(long) NtUserShowCaret @ stdcall ShowCaret(long) NtUserShowCaret
@ stdcall -import ShowCursor(long) NtUserShowCursor @ stdcall -import ShowCursor(long) NtUserShowCursor
@ stdcall ShowOwnedPopups(long long) @ stdcall ShowOwnedPopups(long long)
@ stdcall ShowScrollBar(long long long) @ stdcall ShowScrollBar(long long long) NtUserShowScrollBar
@ stub ShowStartGlass @ stub ShowStartGlass
@ stdcall ShowWindow(long long) NtUserShowWindow @ stdcall ShowWindow(long long) NtUserShowWindow
@ stdcall ShowWindowAsync(long long) NtUserShowWindowAsync @ stdcall ShowWindowAsync(long long) NtUserShowWindowAsync
......
...@@ -45,6 +45,7 @@ C_SRCS = \ ...@@ -45,6 +45,7 @@ C_SRCS = \
printdrv.c \ printdrv.c \
rawinput.c \ rawinput.c \
region.c \ region.c \
scroll.c \
spy.c \ spy.c \
syscall.c \ syscall.c \
sysparams.c \ sysparams.c \
......
...@@ -1236,6 +1236,7 @@ static struct unix_funcs unix_funcs = ...@@ -1236,6 +1236,7 @@ static struct unix_funcs unix_funcs =
NtUserSetWindowWord, NtUserSetWindowWord,
NtUserShowCaret, NtUserShowCaret,
NtUserShowCursor, NtUserShowCursor,
NtUserShowScrollBar,
NtUserShowWindow, NtUserShowWindow,
NtUserShowWindowAsync, NtUserShowWindowAsync,
NtUserSystemParametersInfo, NtUserSystemParametersInfo,
......
/*
* Scrollbar control
*
* Copyright 1993 Martin Ayotte
* Copyright 1994, 1996 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#if 0
#pragma makedep unix
#endif
#include "win32u_private.h"
#include "ntuser_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(scroll);
static BOOL show_scroll_bar( HWND hwnd, int bar, BOOL show_horz, BOOL show_vert )
{
ULONG old_style, set_bits = 0, clear_bits = 0;
TRACE( "hwnd=%p bar=%d horz=%d, vert=%d\n", hwnd, bar, show_horz, show_vert );
switch (bar)
{
case SB_CTL:
NtUserShowWindow( hwnd, show_horz ? SW_SHOW : SW_HIDE );
return TRUE;
case SB_BOTH:
case SB_HORZ:
if (show_horz) set_bits |= WS_HSCROLL;
else clear_bits |= WS_HSCROLL;
if (bar == SB_HORZ) break;
/* fall through */
case SB_VERT:
if (show_vert) set_bits |= WS_VSCROLL;
else clear_bits |= WS_VSCROLL;
break;
default:
return FALSE; /* Nothing to do! */
}
old_style = set_window_style( hwnd, set_bits, clear_bits );
if ((old_style & clear_bits) != 0 || (old_style & set_bits) != set_bits)
{
/* frame has been changed, let the window redraw itself */
NtUserSetWindowPos( hwnd, 0, 0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED );
return TRUE;
}
return FALSE; /* no frame changes */
}
/*************************************************************************
* NtUserShowScrollBar (win32u.@)
*/
BOOL WINAPI NtUserShowScrollBar( HWND hwnd, INT bar, BOOL show )
{
if (!hwnd) return FALSE;
show_scroll_bar( hwnd, bar, bar == SB_VERT ? 0 : show, bar == SB_HORZ ? 0 : show );
return TRUE;
}
...@@ -1259,7 +1259,7 @@ ...@@ -1259,7 +1259,7 @@
@ stdcall -syscall NtUserSetWindowsHookEx(ptr ptr long long ptr long) @ stdcall -syscall NtUserSetWindowsHookEx(ptr ptr long long ptr long)
@ stdcall NtUserShowCaret(long) @ stdcall NtUserShowCaret(long)
@ stdcall NtUserShowCursor(long) @ stdcall NtUserShowCursor(long)
@ stub NtUserShowScrollBar @ stdcall NtUserShowScrollBar(long long long)
@ stub NtUserShowSystemCursor @ stub NtUserShowSystemCursor
@ stdcall NtUserShowWindow(long long) @ stdcall NtUserShowWindow(long long)
@ stdcall NtUserShowWindowAsync(long long) @ stdcall NtUserShowWindowAsync(long long)
......
...@@ -310,6 +310,7 @@ struct unix_funcs ...@@ -310,6 +310,7 @@ struct unix_funcs
WORD (WINAPI *pNtUserSetWindowWord)( HWND hwnd, INT offset, WORD newval ); WORD (WINAPI *pNtUserSetWindowWord)( HWND hwnd, INT offset, WORD newval );
BOOL (WINAPI *pNtUserShowCaret)( HWND hwnd ); BOOL (WINAPI *pNtUserShowCaret)( HWND hwnd );
INT (WINAPI *pNtUserShowCursor)( BOOL show ); INT (WINAPI *pNtUserShowCursor)( BOOL show );
BOOL (WINAPI *pNtUserShowScrollBar)( HWND hwnd, INT bar, BOOL show );
BOOL (WINAPI *pNtUserShowWindow)( HWND hwnd, INT cmd ); BOOL (WINAPI *pNtUserShowWindow)( HWND hwnd, INT cmd );
BOOL (WINAPI *pNtUserShowWindowAsync)( HWND hwnd, INT cmd ); BOOL (WINAPI *pNtUserShowWindowAsync)( HWND hwnd, INT cmd );
BOOL (WINAPI *pNtUserSystemParametersInfo)( UINT action, UINT val, PVOID ptr, UINT winini ); BOOL (WINAPI *pNtUserSystemParametersInfo)( UINT action, UINT val, PVOID ptr, UINT winini );
......
...@@ -1334,6 +1334,12 @@ INT WINAPI NtUserShowCursor( BOOL show ) ...@@ -1334,6 +1334,12 @@ INT WINAPI NtUserShowCursor( BOOL show )
return unix_funcs->pNtUserShowCursor( show ); return unix_funcs->pNtUserShowCursor( show );
} }
BOOL WINAPI NtUserShowScrollBar( HWND hwnd, INT bar, BOOL show )
{
if (!unix_funcs) return FALSE;
return unix_funcs->pNtUserShowScrollBar( hwnd, bar, show );
}
BOOL WINAPI NtUserShowWindowAsync( HWND hwnd, INT cmd ) BOOL WINAPI NtUserShowWindowAsync( HWND hwnd, INT cmd )
{ {
if (!unix_funcs) return FALSE; if (!unix_funcs) return FALSE;
......
...@@ -718,6 +718,7 @@ HWINEVENTHOOK WINAPI NtUserSetWinEventHook( DWORD event_min, DWORD event_max, HM ...@@ -718,6 +718,7 @@ HWINEVENTHOOK WINAPI NtUserSetWinEventHook( DWORD event_min, DWORD event_max, HM
DWORD pid, DWORD tid, DWORD flags ); DWORD pid, DWORD tid, DWORD flags );
BOOL WINAPI NtUserShowCaret( HWND hwnd ); BOOL WINAPI NtUserShowCaret( HWND hwnd );
INT WINAPI NtUserShowCursor( BOOL show ); INT WINAPI NtUserShowCursor( BOOL show );
BOOL WINAPI NtUserShowScrollBar( HWND hwnd, INT bar, BOOL show );
BOOL WINAPI NtUserShowWindow( HWND hwnd, INT cmd ); BOOL WINAPI NtUserShowWindow( HWND hwnd, INT cmd );
BOOL WINAPI NtUserShowWindowAsync( HWND hwnd, INT cmd ); BOOL WINAPI NtUserShowWindowAsync( HWND hwnd, INT cmd );
BOOL WINAPI NtUserSystemParametersInfo( UINT action, UINT val, void *ptr, UINT winini ); BOOL WINAPI NtUserSystemParametersInfo( UINT action, UINT val, void *ptr, UINT winini );
......
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