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
615a90e2
Commit
615a90e2
authored
Sep 01, 2021
by
Zhiyi Zhang
Committed by
Alexandre Julliard
Sep 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uxtheme: Implement OpenThemeDataForDpi().
Signed-off-by:
Zhiyi Zhang
<
zzhang@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
069ed533
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
63 additions
and
8 deletions
+63
-8
msstyles.c
dlls/uxtheme/msstyles.c
+3
-1
msstyles.h
dlls/uxtheme/msstyles.h
+2
-1
system.c
dlls/uxtheme/system.c
+25
-6
system.c
dlls/uxtheme/tests/system.c
+31
-0
uxtheme.spec
dlls/uxtheme/uxtheme.spec
+1
-0
uxtheme.h
include/uxtheme.h
+1
-0
No files found.
dlls/uxtheme/msstyles.c
View file @
615a90e2
...
...
@@ -971,8 +971,9 @@ static void MSSTYLES_ParseThemeIni(PTHEME_FILE tf, BOOL setMetrics)
* pszAppName Application name, for theme styles specific
* to a particular application
* pszClassList List of requested classes, semicolon delimited
* dpi DPI for theme parts
*/
PTHEME_CLASS
MSSTYLES_OpenThemeClass
(
LPCWSTR
pszAppName
,
LPCWSTR
pszClassList
)
PTHEME_CLASS
MSSTYLES_OpenThemeClass
(
LPCWSTR
pszAppName
,
LPCWSTR
pszClassList
,
UINT
dpi
)
{
PTHEME_CLASS
cls
=
NULL
;
WCHAR
szClassName
[
MAX_THEME_CLASS_NAME
];
...
...
@@ -1004,6 +1005,7 @@ PTHEME_CLASS MSSTYLES_OpenThemeClass(LPCWSTR pszAppName, LPCWSTR pszClassList)
TRACE
(
"Opened app %s, class %s from list %s
\n
"
,
debugstr_w
(
cls
->
szAppName
),
debugstr_w
(
cls
->
szClassName
),
debugstr_w
(
pszClassList
));
cls
->
tf
=
tfActiveTheme
;
cls
->
tf
->
dwRefCount
++
;
cls
->
dpi
=
dpi
;
}
return
cls
;
}
...
...
dlls/uxtheme/msstyles.h
View file @
615a90e2
...
...
@@ -53,6 +53,7 @@ typedef struct _THEME_CLASS {
struct
_THEME_FILE
*
tf
;
WCHAR
szAppName
[
MAX_THEME_APP_NAME
];
WCHAR
szClassName
[
MAX_THEME_CLASS_NAME
];
UINT
dpi
;
PTHEME_PARTSTATE
partstate
;
struct
_THEME_CLASS
*
overrides
;
...
...
@@ -87,7 +88,7 @@ typedef struct _UXINI_FILE *PUXINI_FILE;
HRESULT
MSSTYLES_OpenThemeFile
(
LPCWSTR
lpThemeFile
,
LPCWSTR
pszColorName
,
LPCWSTR
pszSizeName
,
PTHEME_FILE
*
tf
)
DECLSPEC_HIDDEN
;
void
MSSTYLES_CloseThemeFile
(
PTHEME_FILE
tf
)
DECLSPEC_HIDDEN
;
HRESULT
MSSTYLES_SetActiveTheme
(
PTHEME_FILE
tf
,
BOOL
setMetrics
)
DECLSPEC_HIDDEN
;
PTHEME_CLASS
MSSTYLES_OpenThemeClass
(
LPCWSTR
pszAppName
,
LPCWSTR
pszClassList
)
DECLSPEC_HIDDEN
;
PTHEME_CLASS
MSSTYLES_OpenThemeClass
(
LPCWSTR
pszAppName
,
LPCWSTR
pszClassList
,
UINT
dpi
)
DECLSPEC_HIDDEN
;
HRESULT
MSSTYLES_CloseThemeClass
(
PTHEME_CLASS
tc
)
DECLSPEC_HIDDEN
;
BOOL
MSSTYLES_LookupProperty
(
LPCWSTR
pszPropertyName
,
int
*
dwPrimitive
,
int
*
dwId
)
DECLSPEC_HIDDEN
;
BOOL
MSSTYLES_LookupEnum
(
LPCWSTR
pszValueName
,
int
dwEnum
,
int
*
dwValue
)
DECLSPEC_HIDDEN
;
...
...
dlls/uxtheme/system.c
View file @
615a90e2
...
...
@@ -617,10 +617,7 @@ static LPWSTR UXTHEME_GetWindowProperty(HWND hwnd, ATOM aProp, LPWSTR pszBuffer,
return
NULL
;
}
/***********************************************************************
* OpenThemeDataEx (UXTHEME.61)
*/
HTHEME
WINAPI
OpenThemeDataEx
(
HWND
hwnd
,
LPCWSTR
pszClassList
,
DWORD
flags
)
static
HTHEME
open_theme_data
(
HWND
hwnd
,
LPCWSTR
pszClassList
,
DWORD
flags
,
UINT
dpi
)
{
WCHAR
szAppBuff
[
256
];
WCHAR
szClassBuff
[
256
];
...
...
@@ -647,11 +644,11 @@ HTHEME WINAPI OpenThemeDataEx(HWND hwnd, LPCWSTR pszClassList, DWORD flags)
pszUseClassList
=
pszClassList
;
if
(
pszUseClassList
)
hTheme
=
MSSTYLES_OpenThemeClass
(
pszAppName
,
pszUseClassList
);
hTheme
=
MSSTYLES_OpenThemeClass
(
pszAppName
,
pszUseClassList
,
dpi
);
/* Fall back to default class if the specified subclass is not found */
if
(
!
hTheme
)
hTheme
=
MSSTYLES_OpenThemeClass
(
NULL
,
pszUseClassList
);
hTheme
=
MSSTYLES_OpenThemeClass
(
NULL
,
pszUseClassList
,
dpi
);
}
if
(
IsWindow
(
hwnd
))
SetPropW
(
hwnd
,
(
LPCWSTR
)
MAKEINTATOM
(
atWindowTheme
),
hTheme
);
...
...
@@ -662,6 +659,28 @@ HTHEME WINAPI OpenThemeDataEx(HWND hwnd, LPCWSTR pszClassList, DWORD flags)
}
/***********************************************************************
* OpenThemeDataEx (UXTHEME.61)
*/
HTHEME
WINAPI
OpenThemeDataEx
(
HWND
hwnd
,
LPCWSTR
pszClassList
,
DWORD
flags
)
{
UINT
dpi
;
dpi
=
GetDpiForWindow
(
hwnd
);
if
(
!
dpi
)
dpi
=
96
;
return
open_theme_data
(
hwnd
,
pszClassList
,
flags
,
dpi
);
}
/***********************************************************************
* OpenThemeDataForDpi (UXTHEME.@)
*/
HTHEME
WINAPI
OpenThemeDataForDpi
(
HWND
hwnd
,
LPCWSTR
class_list
,
UINT
dpi
)
{
return
open_theme_data
(
hwnd
,
class_list
,
0
,
dpi
);
}
/***********************************************************************
* OpenThemeData (UXTHEME.@)
*/
HTHEME
WINAPI
OpenThemeData
(
HWND
hwnd
,
LPCWSTR
classlist
)
...
...
dlls/uxtheme/tests/system.c
View file @
615a90e2
...
...
@@ -34,6 +34,7 @@
#include "wine/test.h"
static
HTHEME
(
WINAPI
*
pOpenThemeDataEx
)(
HWND
,
LPCWSTR
,
DWORD
);
static
HTHEME
(
WINAPI
*
pOpenThemeDataForDpi
)(
HWND
,
LPCWSTR
,
UINT
);
static
HPAINTBUFFER
(
WINAPI
*
pBeginBufferedPaint
)(
HDC
,
const
RECT
*
,
BP_BUFFERFORMAT
,
BP_PAINTPARAMS
*
,
HDC
*
);
static
HRESULT
(
WINAPI
*
pBufferedPaintClear
)(
HPAINTBUFFER
,
const
RECT
*
);
static
HRESULT
(
WINAPI
*
pEndBufferedPaint
)(
HPAINTBUFFER
,
BOOL
);
...
...
@@ -79,6 +80,7 @@ static void init_funcs(void)
GET_PROC
(
uxtheme
,
GetBufferedPaintTargetDC
)
GET_PROC
(
uxtheme
,
GetBufferedPaintTargetRect
)
GET_PROC
(
uxtheme
,
OpenThemeDataEx
)
GET_PROC
(
uxtheme
,
OpenThemeDataForDpi
)
GET_PROC
(
user32
,
DisplayConfigGetDeviceInfo
)
GET_PROC
(
user32
,
DisplayConfigSetDeviceInfo
)
...
...
@@ -642,6 +644,34 @@ static void test_OpenThemeDataEx(void)
DestroyWindow
(
hWnd
);
}
static
void
test_OpenThemeDataForDpi
(
void
)
{
BOOL
is_theme_active
;
HTHEME
htheme
;
if
(
!
pOpenThemeDataForDpi
)
{
win_skip
(
"OpenThemeDataForDpi is unavailable.
\n
"
);
return
;
}
is_theme_active
=
IsThemeActive
();
SetLastError
(
0xdeadbeef
);
htheme
=
OpenThemeDataForDpi
(
NULL
,
WC_BUTTONW
,
96
);
if
(
is_theme_active
)
{
ok
(
!!
htheme
,
"Got a NULL handle.
\n
"
);
ok
(
GetLastError
()
==
NO_ERROR
,
"Expected error %u, got %u.
\n
"
,
NO_ERROR
,
GetLastError
());
CloseThemeData
(
htheme
);
}
else
{
ok
(
!
htheme
,
"Got a non-NULL handle.
\n
"
);
ok
(
GetLastError
()
==
E_PROP_ID_UNSUPPORTED
,
"Expected error %u, got %u.
\n
"
,
E_PROP_ID_UNSUPPORTED
,
GetLastError
());
}
}
static
void
test_GetCurrentThemeName
(
void
)
{
BOOL
bThemeActive
;
...
...
@@ -1084,6 +1114,7 @@ START_TEST(system)
test_SetWindowTheme
();
test_OpenThemeData
();
test_OpenThemeDataEx
();
test_OpenThemeDataForDpi
();
test_GetCurrentThemeName
();
test_GetThemePartSize
();
test_CloseThemeData
();
...
...
dlls/uxtheme/uxtheme.spec
View file @
615a90e2
...
...
@@ -106,6 +106,7 @@
@ stdcall IsThemeDialogTextureEnabled(ptr)
@ stdcall IsThemePartDefined(ptr long long)
@ stdcall OpenThemeData(ptr wstr)
@ stdcall OpenThemeDataForDpi(ptr wstr long)
@ stdcall SetThemeAppProperties(long)
@ stdcall SetWindowTheme(ptr wstr wstr)
@ stdcall SetWindowThemeAttribute(ptr long ptr long)
include/uxtheme.h
View file @
615a90e2
...
...
@@ -213,6 +213,7 @@ BOOL WINAPI IsThemeDialogTextureEnabled(HWND);
BOOL
WINAPI
IsThemePartDefined
(
HTHEME
,
int
,
int
);
HTHEME
WINAPI
OpenThemeData
(
HWND
,
LPCWSTR
);
HTHEME
WINAPI
OpenThemeDataEx
(
HWND
,
LPCWSTR
,
DWORD
);
HTHEME
WINAPI
OpenThemeDataForDpi
(
HWND
,
LPCWSTR
,
UINT
);
void
WINAPI
SetThemeAppProperties
(
DWORD
);
HRESULT
WINAPI
SetWindowTheme
(
HWND
,
LPCWSTR
,
LPCWSTR
);
HRESULT
WINAPI
SetWindowThemeAttribute
(
HWND
,
enum
WINDOWTHEMEATTRIBUTETYPE
,
PVOID
,
DWORD
);
...
...
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