Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
6452e67e
Commit
6452e67e
authored
Jun 28, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 04, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Move scroll bar WM_CREATE implementation from user32.
parent
a7ff88c9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
79 deletions
+70
-79
scroll.c
dlls/user32/scroll.c
+2
-79
ntuser_private.h
dlls/win32u/ntuser_private.h
+6
-0
scroll.c
dlls/win32u/scroll.c
+62
-0
No files found.
dlls/user32/scroll.c
View file @
6452e67e
...
...
@@ -32,6 +32,7 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
scroll
);
typedef
struct
scroll_info
SCROLLBAR_INFO
,
*
LPSCROLLBAR_INFO
;
typedef
struct
scroll_bar_win_data
SCROLLBAR_WNDDATA
;
/* data for window that has (one or two) scroll bars */
typedef
struct
...
...
@@ -40,12 +41,6 @@ typedef struct
SCROLLBAR_INFO
vert
;
}
WINSCROLLBAR_INFO
,
*
LPWINSCROLLBAR_INFO
;
typedef
struct
{
DWORD
magic
;
SCROLLBAR_INFO
info
;
}
SCROLLBAR_WNDDATA
;
#define SCROLLBAR_MAGIC 0x5c6011ba
/* Minimum size of the rectangle between the arrows */
...
...
@@ -1127,75 +1122,6 @@ void SCROLL_TrackScrollBar( HWND hwnd, INT scrollbar, POINT pt )
}
/***********************************************************************
* SCROLL_CreateScrollBar
*
* Create a scroll bar
*
* PARAMS
* hwnd [I] Handle of window with scrollbar(s)
* lpCreate [I] The style and place of the scroll bar
*/
static
void
SCROLL_CreateScrollBar
(
HWND
hwnd
,
LPCREATESTRUCTW
lpCreate
)
{
LPSCROLLBAR_INFO
info
=
NULL
;
WND
*
win
;
TRACE
(
"hwnd=%p lpCreate=%p
\n
"
,
hwnd
,
lpCreate
);
win
=
WIN_GetPtr
(
hwnd
);
if
(
win
->
cbWndExtra
>=
sizeof
(
SCROLLBAR_WNDDATA
))
{
SCROLLBAR_WNDDATA
*
data
=
(
SCROLLBAR_WNDDATA
*
)
win
->
wExtra
;
data
->
magic
=
SCROLLBAR_MAGIC
;
info
=
&
data
->
info
;
}
else
WARN
(
"Not enough extra data
\n
"
);
WIN_ReleasePtr
(
win
);
if
(
!
info
)
return
;
if
(
lpCreate
->
style
&
WS_DISABLED
)
{
info
->
flags
=
ESB_DISABLE_BOTH
;
TRACE
(
"Created WS_DISABLED scrollbar
\n
"
);
}
if
(
lpCreate
->
style
&
(
SBS_SIZEGRIP
|
SBS_SIZEBOX
))
{
if
(
lpCreate
->
style
&
SBS_SIZEBOXTOPLEFTALIGN
)
NtUserMoveWindow
(
hwnd
,
lpCreate
->
x
,
lpCreate
->
y
,
GetSystemMetrics
(
SM_CXVSCROLL
)
+
1
,
GetSystemMetrics
(
SM_CYHSCROLL
)
+
1
,
FALSE
);
else
if
(
lpCreate
->
style
&
SBS_SIZEBOXBOTTOMRIGHTALIGN
)
NtUserMoveWindow
(
hwnd
,
lpCreate
->
x
+
lpCreate
->
cx
-
GetSystemMetrics
(
SM_CXVSCROLL
)
-
1
,
lpCreate
->
y
+
lpCreate
->
cy
-
GetSystemMetrics
(
SM_CYHSCROLL
)
-
1
,
GetSystemMetrics
(
SM_CXVSCROLL
)
+
1
,
GetSystemMetrics
(
SM_CYHSCROLL
)
+
1
,
FALSE
);
}
else
if
(
lpCreate
->
style
&
SBS_VERT
)
{
if
(
lpCreate
->
style
&
SBS_LEFTALIGN
)
NtUserMoveWindow
(
hwnd
,
lpCreate
->
x
,
lpCreate
->
y
,
GetSystemMetrics
(
SM_CXVSCROLL
)
+
1
,
lpCreate
->
cy
,
FALSE
);
else
if
(
lpCreate
->
style
&
SBS_RIGHTALIGN
)
NtUserMoveWindow
(
hwnd
,
lpCreate
->
x
+
lpCreate
->
cx
-
GetSystemMetrics
(
SM_CXVSCROLL
)
-
1
,
lpCreate
->
y
,
GetSystemMetrics
(
SM_CXVSCROLL
)
+
1
,
lpCreate
->
cy
,
FALSE
);
}
else
/* SBS_HORZ */
{
if
(
lpCreate
->
style
&
SBS_TOPALIGN
)
NtUserMoveWindow
(
hwnd
,
lpCreate
->
x
,
lpCreate
->
y
,
lpCreate
->
cx
,
GetSystemMetrics
(
SM_CYHSCROLL
)
+
1
,
FALSE
);
else
if
(
lpCreate
->
style
&
SBS_BOTTOMALIGN
)
NtUserMoveWindow
(
hwnd
,
lpCreate
->
x
,
lpCreate
->
y
+
lpCreate
->
cy
-
GetSystemMetrics
(
SM_CYHSCROLL
)
-
1
,
lpCreate
->
cx
,
GetSystemMetrics
(
SM_CYHSCROLL
)
+
1
,
FALSE
);
}
}
/*************************************************************************
* SCROLL_GetScrollInfo
*
...
...
@@ -1409,10 +1335,6 @@ LRESULT WINAPI USER_ScrollBarProc( HWND hwnd, UINT message, WPARAM wParam, LPARA
switch
(
message
)
{
case
WM_CREATE
:
SCROLL_CreateScrollBar
(
hwnd
,
(
LPCREATESTRUCTW
)
lParam
);
break
;
case
WM_ENABLE
:
{
SCROLLBAR_INFO
*
infoPtr
;
...
...
@@ -1503,6 +1425,7 @@ LRESULT WINAPI USER_ScrollBarProc( HWND hwnd, UINT message, WPARAM wParam, LPARA
}
break
;
case
WM_CREATE
:
case
WM_ERASEBKGND
:
case
WM_GETDLGCODE
:
return
NtUserMessageCall
(
hwnd
,
message
,
wParam
,
lParam
,
0
,
NtUserScrollBarWndProc
,
!
unicode
);
...
...
dlls/win32u/ntuser_private.h
View file @
6452e67e
...
...
@@ -216,6 +216,12 @@ struct scroll_info
BOOL
painted
;
/* Whether the scroll bar is painted by DefWinProc() */
};
struct
scroll_bar_win_data
{
DWORD
magic
;
struct
scroll_info
info
;
};
/* FIXME: make it private to class.c */
typedef
struct
tagWINDOWPROC
{
...
...
dlls/win32u/scroll.c
View file @
6452e67e
...
...
@@ -30,6 +30,8 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
scroll
);
#define SCROLLBAR_MAGIC 0x5c6011ba
static
struct
scroll_info
*
get_scroll_info_ptr
(
HWND
hwnd
,
int
bar
,
BOOL
alloc
)
{
struct
scroll_info
*
ret
=
NULL
;
...
...
@@ -82,10 +84,70 @@ static BOOL show_scroll_bar( HWND hwnd, int bar, BOOL show_horz, BOOL show_vert
return
FALSE
;
/* no frame changes */
}
static
void
create_scroll_bar
(
HWND
hwnd
,
CREATESTRUCTW
*
create
)
{
struct
scroll_info
*
info
=
NULL
;
WND
*
win
;
TRACE
(
"hwnd=%p create=%p
\n
"
,
hwnd
,
create
);
win
=
get_win_ptr
(
hwnd
);
if
(
win
->
cbWndExtra
>=
sizeof
(
struct
scroll_bar_win_data
))
{
struct
scroll_bar_win_data
*
data
=
(
struct
scroll_bar_win_data
*
)
win
->
wExtra
;
data
->
magic
=
SCROLLBAR_MAGIC
;
info
=
&
data
->
info
;
}
else
WARN
(
"Not enough extra data
\n
"
);
release_win_ptr
(
win
);
if
(
!
info
)
return
;
if
(
create
->
style
&
WS_DISABLED
)
{
info
->
flags
=
ESB_DISABLE_BOTH
;
TRACE
(
"Created WS_DISABLED scrollbar
\n
"
);
}
if
(
create
->
style
&
(
SBS_SIZEGRIP
|
SBS_SIZEBOX
))
{
if
(
create
->
style
&
SBS_SIZEBOXTOPLEFTALIGN
)
NtUserMoveWindow
(
hwnd
,
create
->
x
,
create
->
y
,
get_system_metrics
(
SM_CXVSCROLL
)
+
1
,
get_system_metrics
(
SM_CYHSCROLL
)
+
1
,
FALSE
);
else
if
(
create
->
style
&
SBS_SIZEBOXBOTTOMRIGHTALIGN
)
NtUserMoveWindow
(
hwnd
,
create
->
x
+
create
->
cx
-
get_system_metrics
(
SM_CXVSCROLL
)
-
1
,
create
->
y
+
create
->
cy
-
get_system_metrics
(
SM_CYHSCROLL
)
-
1
,
get_system_metrics
(
SM_CXVSCROLL
)
+
1
,
get_system_metrics
(
SM_CYHSCROLL
)
+
1
,
FALSE
);
}
else
if
(
create
->
style
&
SBS_VERT
)
{
if
(
create
->
style
&
SBS_LEFTALIGN
)
NtUserMoveWindow
(
hwnd
,
create
->
x
,
create
->
y
,
get_system_metrics
(
SM_CXVSCROLL
)
+
1
,
create
->
cy
,
FALSE
);
else
if
(
create
->
style
&
SBS_RIGHTALIGN
)
NtUserMoveWindow
(
hwnd
,
create
->
x
+
create
->
cx
-
get_system_metrics
(
SM_CXVSCROLL
)
-
1
,
create
->
y
,
get_system_metrics
(
SM_CXVSCROLL
)
+
1
,
create
->
cy
,
FALSE
);
}
else
/* SBS_HORZ */
{
if
(
create
->
style
&
SBS_TOPALIGN
)
NtUserMoveWindow
(
hwnd
,
create
->
x
,
create
->
y
,
create
->
cx
,
get_system_metrics
(
SM_CYHSCROLL
)
+
1
,
FALSE
);
else
if
(
create
->
style
&
SBS_BOTTOMALIGN
)
NtUserMoveWindow
(
hwnd
,
create
->
x
,
create
->
y
+
create
->
cy
-
get_system_metrics
(
SM_CYHSCROLL
)
-
1
,
create
->
cx
,
get_system_metrics
(
SM_CYHSCROLL
)
+
1
,
FALSE
);
}
}
LRESULT
scroll_bar_window_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
,
BOOL
ansi
)
{
switch
(
msg
)
{
case
WM_CREATE
:
create_scroll_bar
(
hwnd
,
(
CREATESTRUCTW
*
)
lparam
);
return
0
;
case
WM_ERASEBKGND
:
return
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment