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
d9063802
Commit
d9063802
authored
Jul 20, 2021
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Jul 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uxtheme: Move themed scroll bar to uxtheme.
Signed-off-by:
Zhiyi Zhang
<
zzhang@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e02a7e57
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
89 additions
and
26 deletions
+89
-26
Makefile.in
dlls/comctl32/Makefile.in
+0
-1
theming.c
dlls/comctl32/theming.c
+0
-5
hook.c
dlls/user32/hook.c
+28
-0
scroll.c
dlls/user32/scroll.c
+8
-5
user32.spec
dlls/user32/user32.spec
+2
-2
user_private.h
dlls/user32/user_private.h
+3
-0
Makefile.in
dlls/uxtheme/Makefile.in
+1
-0
scrollbar.c
dlls/uxtheme/scrollbar.c
+10
-11
system.c
dlls/uxtheme/system.c
+18
-0
uxtheme.spec
dlls/uxtheme/uxtheme.spec
+2
-2
uxthemedll.h
dlls/uxtheme/uxthemedll.h
+8
-0
winuser.h
include/winuser.h
+9
-0
No files found.
dlls/comctl32/Makefile.in
View file @
d9063802
...
...
@@ -38,7 +38,6 @@ C_SRCS = \
tab.c
\
taskdialog.c
\
theme_dialog.c
\
theme_scrollbar.c
\
theming.c
\
toolbar.c
\
tooltips.c
\
...
...
dlls/comctl32/theming.c
View file @
d9063802
...
...
@@ -35,8 +35,6 @@ typedef LRESULT (CALLBACK* THEMING_SUBCLASSPROC)(HWND, UINT, WPARAM, LPARAM,
extern
LRESULT
CALLBACK
THEMING_DialogSubclassProc
(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
ULONG_PTR
)
DECLSPEC_HIDDEN
;
extern
LRESULT
CALLBACK
THEMING_ScrollbarSubclassProc
(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
ULONG_PTR
)
DECLSPEC_HIDDEN
;
static
const
WCHAR
dialogClass
[]
=
L"#32770"
;
...
...
@@ -47,7 +45,6 @@ static const struct ThemingSubclass
}
subclasses
[]
=
{
/* Note: list must be sorted by class name */
{
dialogClass
,
THEMING_DialogSubclassProc
},
{
WC_SCROLLBARW
,
THEMING_ScrollbarSubclassProc
}
};
#define NUM_SUBCLASSES (ARRAY_SIZE(subclasses))
...
...
@@ -78,11 +75,9 @@ static LRESULT CALLBACK subclass_proc ## N (HWND wnd, UINT msg, \
}
MAKE_SUBCLASS_PROC
(
0
)
MAKE_SUBCLASS_PROC
(
1
)
static
const
WNDPROC
subclassProcs
[
NUM_SUBCLASSES
]
=
{
subclass_proc0
,
subclass_proc1
,
};
/***********************************************************************
...
...
dlls/user32/hook.c
View file @
d9063802
...
...
@@ -81,6 +81,13 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
hook
);
WINE_DECLARE_DEBUG_CHANNEL
(
relay
);
static
struct
user_api_hook
original_user_api
=
{
USER_ScrollBarProc
,
};
static
struct
user_api_hook
hooked_user_api
;
struct
user_api_hook
*
user_api
=
&
original_user_api
;
struct
hook_info
{
INT
id
;
...
...
@@ -961,3 +968,24 @@ BOOL WINAPI IsWinEventHookInstalled(DWORD dwEvent)
WARN
(
"(%d)-stub!
\n
"
,
dwEvent
);
return
TRUE
;
}
/* Undocumented RegisterUserApiHook() */
BOOL
WINAPI
RegisterUserApiHook
(
const
struct
user_api_hook
*
new
,
struct
user_api_hook
*
old
)
{
if
(
!
new
)
return
FALSE
;
USER_Lock
();
hooked_user_api
=
*
new
;
user_api
=
&
hooked_user_api
;
if
(
old
)
*
old
=
original_user_api
;
USER_Unlock
();
return
TRUE
;
}
/* Undocumented UnregisterUserApiHook() */
void
WINAPI
UnregisterUserApiHook
(
void
)
{
InterlockedExchangePointer
((
void
**
)
&
user_api
,
&
original_user_api
);
}
dlls/user32/scroll.c
View file @
d9063802
...
...
@@ -1317,11 +1317,7 @@ static BOOL SCROLL_SetScrollRange(HWND hwnd, INT nBar, INT minVal, INT maxVal)
return
TRUE
;
}
/***********************************************************************
* ScrollBarWndProc_common
*/
LRESULT
ScrollBarWndProc_common
(
HWND
hwnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
,
BOOL
unicode
)
LRESULT
WINAPI
USER_ScrollBarProc
(
HWND
hwnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
,
BOOL
unicode
)
{
if
(
!
IsWindow
(
hwnd
))
return
0
;
...
...
@@ -1496,6 +1492,13 @@ LRESULT ScrollBarWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPARAM
return
0
;
}
/***********************************************************************
* ScrollBarWndProc_common
*/
LRESULT
ScrollBarWndProc_common
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
,
BOOL
unicode
)
{
return
user_api
->
pScrollBarWndProc
(
hwnd
,
msg
,
wParam
,
lParam
,
unicode
);
}
/*************************************************************************
* SetScrollInfo (USER32.@)
...
...
dlls/user32/user32.spec
View file @
d9063802
...
...
@@ -612,7 +612,7 @@
@ stdcall RegisterTasklist (long)
@ stdcall RegisterTouchHitTestingWindow(long long)
@ stdcall RegisterTouchWindow(long long)
# @ stub RegisterUserApiHook
@ stdcall RegisterUserApiHook(ptr ptr)
@ stdcall RegisterWindowMessageA(str)
@ stdcall RegisterWindowMessageW(wstr)
@ stdcall ReleaseCapture()
...
...
@@ -784,7 +784,7 @@
# @ stub UnregisterMessagePumpHook
@ stdcall UnregisterPowerSettingNotification(ptr)
@ stdcall UnregisterTouchWindow(long)
# @ stub UnregisterUserApiHook
@ stdcall UnregisterUserApiHook()
@ stdcall UpdateLayeredWindow(long long ptr ptr long ptr long ptr long)
@ stdcall UpdateLayeredWindowIndirect(long ptr)
@ stub UpdatePerUserSystemParameters
...
...
dlls/user32/user_private.h
View file @
d9063802
...
...
@@ -386,4 +386,7 @@ struct png_funcs
#define assert(expr) ((void)0)
#endif
extern
struct
user_api_hook
*
user_api
DECLSPEC_HIDDEN
;
LRESULT
WINAPI
USER_ScrollBarProc
(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
BOOL
)
DECLSPEC_HIDDEN
;
#endif
/* __WINE_USER_PRIVATE_H */
dlls/uxtheme/Makefile.in
View file @
d9063802
...
...
@@ -12,6 +12,7 @@ C_SRCS = \
metric.c
\
msstyles.c
\
property.c
\
scrollbar.c
\
stylemap.c
\
system.c
\
uxini.c
...
...
dlls/
comctl32/theme_
scrollbar.c
→
dlls/
uxtheme/
scrollbar.c
View file @
d9063802
...
...
@@ -28,8 +28,8 @@
#include "wingdi.h"
#include "winuser.h"
#include "uxtheme.h"
#include "uxthemedll.h"
#include "vssym32.h"
#include "comctl32.h"
#include "wine/debug.h"
/* Minimum size of the thumb in pixels */
...
...
@@ -525,27 +525,26 @@ static void paint_scrollbar(HWND hwnd, HTHEME theme)
EndPaint
(
hwnd
,
&
ps
);
}
LRESULT
CALLBACK
THEMING_ScrollbarSubclassProc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
,
ULONG_PTR
dwRefData
)
LRESULT
WINAPI
UXTHEME_ScrollbarWndProc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
,
BOOL
unicode
)
{
const
WCHAR
*
themeClass
=
WC_SCROLLBARW
;
HTHEME
theme
;
LRESULT
result
;
POINT
pt
;
TRACE
(
"(%p, 0x%x, %lu, %lu, %
lu)
\n
"
,
hwnd
,
msg
,
wParam
,
lParam
,
dwRefData
);
TRACE
(
"(%p, 0x%x, %lu, %lu, %
d)
\n
"
,
hwnd
,
msg
,
wParam
,
lParam
,
unicode
);
switch
(
msg
)
{
case
WM_CREATE
:
result
=
THEMING_CallOriginalClass
(
hwnd
,
msg
,
wParam
,
lParam
);
result
=
user_api
.
pScrollBarWndProc
(
hwnd
,
msg
,
wParam
,
lParam
,
unicode
);
OpenThemeData
(
hwnd
,
themeClass
);
return
result
;
case
WM_DESTROY
:
theme
=
GetWindowTheme
(
hwnd
);
CloseThemeData
(
theme
);
return
THEMING_CallOriginalClass
(
hwnd
,
msg
,
wParam
,
lParam
);
return
user_api
.
pScrollBarWndProc
(
hwnd
,
msg
,
wParam
,
lParam
,
unicode
);
case
WM_THEMECHANGED
:
theme
=
GetWindowTheme
(
hwnd
);
...
...
@@ -556,14 +555,14 @@ LRESULT CALLBACK THEMING_ScrollbarSubclassProc (HWND hwnd, UINT msg,
case
WM_SYSCOLORCHANGE
:
theme
=
GetWindowTheme
(
hwnd
);
if
(
!
theme
)
return
THEMING_CallOriginalClass
(
hwnd
,
msg
,
wParam
,
lParam
);
if
(
!
theme
)
return
user_api
.
pScrollBarWndProc
(
hwnd
,
msg
,
wParam
,
lParam
,
unicode
);
/* Do nothing. When themed, a WM_THEMECHANGED will be received, too,
* which will do the repaint. */
break
;
case
WM_PAINT
:
theme
=
GetWindowTheme
(
hwnd
);
if
(
!
theme
)
return
THEMING_CallOriginalClass
(
hwnd
,
msg
,
wParam
,
lParam
);
if
(
!
theme
)
return
user_api
.
pScrollBarWndProc
(
hwnd
,
msg
,
wParam
,
lParam
,
unicode
);
paint_scrollbar
(
hwnd
,
theme
);
break
;
...
...
@@ -571,7 +570,7 @@ LRESULT CALLBACK THEMING_ScrollbarSubclassProc (HWND hwnd, UINT msg,
case
WM_MOUSEMOVE
:
case
WM_MOUSELEAVE
:
theme
=
GetWindowTheme
(
hwnd
);
if
(
!
theme
)
return
THEMING_CallOriginalClass
(
hwnd
,
msg
,
wParam
,
lParam
);
if
(
!
theme
)
return
user_api
.
pScrollBarWndProc
(
hwnd
,
msg
,
wParam
,
lParam
,
unicode
);
pt
.
x
=
(
short
)
LOWORD
(
lParam
);
pt
.
y
=
(
short
)
HIWORD
(
lParam
);
...
...
@@ -579,7 +578,7 @@ LRESULT CALLBACK THEMING_ScrollbarSubclassProc (HWND hwnd, UINT msg,
break
;
default:
return
THEMING_CallOriginalClass
(
hwnd
,
msg
,
wParam
,
lParam
);
return
user_api
.
pScrollBarWndProc
(
hwnd
,
msg
,
wParam
,
lParam
,
unicode
);
}
return
0
;
...
...
dlls/uxtheme/system.c
View file @
d9063802
...
...
@@ -55,6 +55,8 @@ static WCHAR szCurrentTheme[MAX_PATH];
static
WCHAR
szCurrentColor
[
64
];
static
WCHAR
szCurrentSize
[
64
];
struct
user_api_hook
user_api
=
{
0
};
/***********************************************************************/
static
BOOL
CALLBACK
UXTHEME_broadcast_msg_enumchild
(
HWND
hWnd
,
LPARAM
msg
)
...
...
@@ -507,10 +509,12 @@ void UXTHEME_InitSystem(HINSTANCE hInst)
atDialogThemeEnabled
=
GlobalAddAtomW
(
L"ux_dialogtheme"
);
UXTHEME_LoadTheme
();
ThemeHooksInstall
();
}
void
UXTHEME_UninitSystem
(
void
)
{
ThemeHooksRemove
();
MSSTYLES_SetActiveTheme
(
NULL
,
FALSE
);
GlobalDeleteAtom
(
atWindowTheme
);
...
...
@@ -1220,3 +1224,17 @@ HRESULT WINAPI CheckThemeSignature(LPCWSTR pszThemeFileName)
MSSTYLES_CloseThemeFile
(
pt
);
return
S_OK
;
}
BOOL
WINAPI
ThemeHooksInstall
(
void
)
{
struct
user_api_hook
hooks
;
hooks
.
pScrollBarWndProc
=
UXTHEME_ScrollbarWndProc
;
return
RegisterUserApiHook
(
&
hooks
,
&
user_api
);
}
BOOL
WINAPI
ThemeHooksRemove
(
void
)
{
UnregisterUserApiHook
();
return
TRUE
;
}
dlls/uxtheme/uxtheme.spec
View file @
d9063802
...
...
@@ -29,8 +29,8 @@
31 stub -noname InitUserTheme
32 stub -noname InitUserRegistry
33 stub -noname ReestablishServerConnection
34 st
ub -noname ThemeHooksInstall
35 st
ub -noname ThemeHooksRemove
34 st
dcall -noname ThemeHooksInstall()
35 st
dcall -noname ThemeHooksRemove()
36 stub -noname RefreshThemeForTS
43 stub -noname ClassicGetSystemMetrics
44 stub -noname ClassicSystemParametersInfoA
...
...
dlls/uxtheme/uxthemedll.h
View file @
d9063802
...
...
@@ -21,6 +21,8 @@
#ifndef __WINE_UXTHEMEDLL_H
#define __WINE_UXTHEMEDLL_H
#include <winuser.h>
typedef
HANDLE
HTHEMEFILE
;
/**********************************************************************
...
...
@@ -93,10 +95,16 @@ HRESULT WINAPI EnumThemeSizes(LPWSTR pszThemeFileName, LPWSTR pszColorName,
DWORD
dwSizeNum
,
PTHEMENAMES
pszColorNames
)
DECLSPEC_HIDDEN
;
HRESULT
WINAPI
ParseThemeIniFile
(
LPCWSTR
pszIniFileName
,
LPWSTR
pszUnknown
,
ParseThemeIniFileProc
callback
,
LPVOID
lpData
)
DECLSPEC_HIDDEN
;
BOOL
WINAPI
ThemeHooksInstall
(
void
)
DECLSPEC_HIDDEN
;
BOOL
WINAPI
ThemeHooksRemove
(
void
)
DECLSPEC_HIDDEN
;
extern
void
UXTHEME_InitSystem
(
HINSTANCE
hInst
)
DECLSPEC_HIDDEN
;
extern
void
UXTHEME_UninitSystem
(
void
)
DECLSPEC_HIDDEN
;
extern
struct
user_api_hook
user_api
DECLSPEC_HIDDEN
;
LRESULT
WINAPI
UXTHEME_ScrollbarWndProc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
,
BOOL
unicode
)
DECLSPEC_HIDDEN
;
/* No alpha blending */
#define ALPHABLEND_NONE 0
/* "Cheap" binary alpha blending - but possibly faster */
...
...
include/winuser.h
View file @
d9063802
...
...
@@ -4407,6 +4407,15 @@ WORD WINAPI SYSTEM_KillSystemTimer( WORD );
#ifdef __WINESRC__
WINUSERAPI
BOOL
CDECL
__wine_send_input
(
HWND
hwnd
,
const
INPUT
*
input
,
const
RAWINPUT
*
rawinput
);
/* Uxtheme hook functions and struct */
struct
user_api_hook
{
LRESULT
(
WINAPI
*
pScrollBarWndProc
)(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
BOOL
);
};
WINUSERAPI
BOOL
WINAPI
RegisterUserApiHook
(
const
struct
user_api_hook
*
new
,
struct
user_api_hook
*
old
);
WINUSERAPI
void
WINAPI
UnregisterUserApiHook
(
void
);
#endif
#ifdef __cplusplus
...
...
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