Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
7ac3b0fd
Commit
7ac3b0fd
authored
Jan 28, 2023
by
Mohamad Al-Jaf
Committed by
Alexandre Julliard
Feb 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windows.ui: Implement IUISettings3::GetColorValue().
parent
3c403fe1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
9 deletions
+51
-9
Makefile.in
dlls/windows.ui/Makefile.in
+1
-1
uisettings.c
dlls/windows.ui/tests/uisettings.c
+6
-6
uisettings.c
dlls/windows.ui/uisettings.c
+44
-2
No files found.
dlls/windows.ui/Makefile.in
View file @
7ac3b0fd
MODULE
=
windows.ui.dll
IMPORTS
=
combase
IMPORTS
=
combase
advapi32
C_SRCS
=
\
main.c
\
...
...
dlls/windows.ui/tests/uisettings.c
View file @
7ac3b0fd
...
...
@@ -134,15 +134,15 @@ static void test_UISettings(void)
reset_color
(
&
value
);
type
=
UIColorType_Foreground
;
hr
=
IUISettings3_GetColorValue
(
uisettings3
,
type
,
&
value
);
todo_wine
ok
(
hr
==
S_OK
,
"GetColorValue returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
value
.
A
==
255
&&
value
.
R
==
0
&&
value
.
G
==
0
&&
value
.
B
==
0
,
ok
(
hr
==
S_OK
,
"GetColorValue returned %#lx
\n
"
,
hr
);
ok
(
value
.
A
==
255
&&
value
.
R
==
0
&&
value
.
G
==
0
&&
value
.
B
==
0
,
"got unexpected value.A == %d value.R == %d value.G == %d value.B == %d
\n
"
,
value
.
A
,
value
.
R
,
value
.
G
,
value
.
B
);
reset_color
(
&
value
);
type
=
UIColorType_Background
;
hr
=
IUISettings3_GetColorValue
(
uisettings3
,
type
,
&
value
);
todo_wine
ok
(
hr
==
S_OK
,
"GetColorValue returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
value
.
A
==
255
&&
value
.
R
==
255
&&
value
.
G
==
255
&&
value
.
B
==
255
,
ok
(
hr
==
S_OK
,
"GetColorValue returned %#lx
\n
"
,
hr
);
ok
(
value
.
A
==
255
&&
value
.
R
==
255
&&
value
.
G
==
255
&&
value
.
B
==
255
,
"got unexpected value.A == %d value.R == %d value.G == %d value.B == %d
\n
"
,
value
.
A
,
value
.
R
,
value
.
G
,
value
.
B
);
/* Dark Theme */
...
...
@@ -151,14 +151,14 @@ static void test_UISettings(void)
reset_color
(
&
value
);
type
=
UIColorType_Foreground
;
hr
=
IUISettings3_GetColorValue
(
uisettings3
,
type
,
&
value
);
todo_wine
ok
(
hr
==
S_OK
,
"GetColorValue returned %#lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"GetColorValue returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
value
.
A
==
255
&&
value
.
R
==
255
&&
value
.
G
==
255
&&
value
.
B
==
255
,
"got unexpected value.A == %d value.R == %d value.G == %d value.B == %d
\n
"
,
value
.
A
,
value
.
R
,
value
.
G
,
value
.
B
);
reset_color
(
&
value
);
type
=
UIColorType_Background
;
hr
=
IUISettings3_GetColorValue
(
uisettings3
,
type
,
&
value
);
todo_wine
ok
(
hr
==
S_OK
,
"GetColorValue returned %#lx
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"GetColorValue returned %#lx
\n
"
,
hr
);
todo_wine
ok
(
value
.
A
==
255
&&
value
.
R
==
0
&&
value
.
G
==
0
&&
value
.
B
==
0
,
"got unexpected value.A == %d value.R == %d value.G == %d value.B == %d
\n
"
,
value
.
A
,
value
.
R
,
value
.
G
,
value
.
B
);
...
...
dlls/windows.ui/uisettings.c
View file @
7ac3b0fd
...
...
@@ -92,10 +92,52 @@ static HRESULT WINAPI uisettings3_GetTrustLevel( IUISettings3 *iface, TrustLevel
return
E_NOTIMPL
;
}
static
DWORD
get_app_theme
(
void
)
{
static
const
WCHAR
*
subkey
=
L"Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Themes
\\
Personalize"
;
static
const
WCHAR
*
name
=
L"AppsUseLightTheme"
;
static
const
HKEY
root
=
HKEY_CURRENT_USER
;
DWORD
ret
=
0
,
len
=
sizeof
(
ret
),
type
;
HKEY
hkey
;
if
(
RegOpenKeyExW
(
root
,
subkey
,
0
,
KEY_QUERY_VALUE
,
&
hkey
))
return
1
;
if
(
RegQueryValueExW
(
hkey
,
name
,
NULL
,
&
type
,
(
BYTE
*
)
&
ret
,
&
len
)
||
type
!=
REG_DWORD
)
ret
=
1
;
RegCloseKey
(
hkey
);
return
ret
;
}
static
void
set_color_value
(
BYTE
a
,
BYTE
r
,
BYTE
g
,
BYTE
b
,
Color
*
out
)
{
out
->
A
=
a
;
out
->
R
=
r
;
out
->
G
=
g
;
out
->
B
=
b
;
}
static
HRESULT
WINAPI
uisettings3_GetColorValue
(
IUISettings3
*
iface
,
UIColorType
type
,
Color
*
value
)
{
FIXME
(
"iface %p, type %d, color %p stub!
\n
"
,
iface
,
type
,
value
);
return
E_NOTIMPL
;
DWORD
theme
;
TRACE
(
"iface %p, type %d, value %p.
\n
"
,
iface
,
type
,
value
);
switch
(
type
)
{
case
UIColorType_Foreground
:
case
UIColorType_Background
:
theme
=
get_app_theme
();
break
;
default:
FIXME
(
"type %d not implemented.
\n
"
,
type
);
return
E_NOTIMPL
;
}
if
(
type
==
UIColorType_Foreground
)
set_color_value
(
255
,
theme
?
0
:
255
,
theme
?
0
:
255
,
theme
?
0
:
255
,
value
);
else
set_color_value
(
255
,
theme
?
255
:
0
,
theme
?
255
:
0
,
theme
?
255
:
0
,
value
);
TRACE
(
"Returning value.A = %d, value.R = %d, value.G = %d, value.B = %d
\n
"
,
value
->
A
,
value
->
R
,
value
->
G
,
value
->
B
);
return
S_OK
;
}
static
HRESULT
WINAPI
uisettings3_add_ColorValuesChanged
(
IUISettings3
*
iface
,
ITypedEventHandler_UISettings_IInspectable
*
handler
,
EventRegistrationToken
*
cookie
)
...
...
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