[PATCH 0/2] MR10237: windows.ui: Implement uisettings_get_AnimationsEnabled().
For React Native. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10237
From: Zhiyi Zhang <zzhang@codeweavers.com> --- dlls/windows.ui/tests/uisettings.c | 39 ++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/dlls/windows.ui/tests/uisettings.c b/dlls/windows.ui/tests/uisettings.c index 9a7fe7c84ae..bf01281d3c3 100644 --- a/dlls/windows.ui/tests/uisettings.c +++ b/dlls/windows.ui/tests/uisettings.c @@ -244,6 +244,44 @@ static void test_UIElementColor( IUISettings *uisettings ) } } +static void test_AnimationsEnabled( IUISettings *uisettings ) +{ + BOOL client_area_animation, ret; + boolean enabled; + HRESULT hr; + + /* Crash on Windows */ + if (0) + { + hr = IUISettings_get_AnimationsEnabled( uisettings, NULL ); + ok( hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr ); + } + + ret = SystemParametersInfoW( SPI_GETCLIENTAREAANIMATION, 0, &client_area_animation, 0 ); + ok( ret, "SystemParametersInfoW failed, error %ld.\n", GetLastError() ); + hr = IUISettings_get_AnimationsEnabled( uisettings, &enabled ); + todo_wine + ok( hr == S_OK, "Got unexpected hr %#lx.\n", hr ); + todo_wine + ok( enabled == client_area_animation, "Expected %d, got %d.\n", client_area_animation, enabled ); + + ret = SystemParametersInfoW( SPI_SETCLIENTAREAANIMATION, 0, IntToPtr(!client_area_animation), 0 ); + ok( ret, "SystemParametersInfoW failed, error %ld.\n", GetLastError() ); + hr = IUISettings_get_AnimationsEnabled( uisettings, &enabled ); + todo_wine + ok( hr == S_OK, "Got unexpected hr %#lx.\n", hr ); + todo_wine + ok( enabled == !client_area_animation, "Expected %d, got %d.\n", !client_area_animation, enabled ); + + ret = SystemParametersInfoW( SPI_SETCLIENTAREAANIMATION, 0, IntToPtr(client_area_animation), 0 ); + ok( ret, "SystemParametersInfoW failed, error %ld.\n", GetLastError() ); + hr = IUISettings_get_AnimationsEnabled( uisettings, &enabled ); + todo_wine + ok( hr == S_OK, "Got unexpected hr %#lx.\n", hr ); + todo_wine + ok( enabled == client_area_animation, "Expected %d, got %d.\n", client_area_animation, enabled ); +} + static void test_UISettings(void) { static const WCHAR *uisettings_name = L"Windows.UI.ViewManagement.UISettings"; @@ -308,6 +346,7 @@ static void test_UISettings(void) IUISettings2_Release( uisettings2 ); + test_AnimationsEnabled( uisettings ); test_AccentColor( uisettings3 ); default_theme = get_app_theme(); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10237
From: Zhiyi Zhang <zzhang@codeweavers.com> --- dlls/windows.ui/tests/uisettings.c | 6 ------ dlls/windows.ui/uisettings.c | 11 +++++++++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/dlls/windows.ui/tests/uisettings.c b/dlls/windows.ui/tests/uisettings.c index bf01281d3c3..9614c179dd3 100644 --- a/dlls/windows.ui/tests/uisettings.c +++ b/dlls/windows.ui/tests/uisettings.c @@ -260,25 +260,19 @@ static void test_AnimationsEnabled( IUISettings *uisettings ) ret = SystemParametersInfoW( SPI_GETCLIENTAREAANIMATION, 0, &client_area_animation, 0 ); ok( ret, "SystemParametersInfoW failed, error %ld.\n", GetLastError() ); hr = IUISettings_get_AnimationsEnabled( uisettings, &enabled ); - todo_wine ok( hr == S_OK, "Got unexpected hr %#lx.\n", hr ); - todo_wine ok( enabled == client_area_animation, "Expected %d, got %d.\n", client_area_animation, enabled ); ret = SystemParametersInfoW( SPI_SETCLIENTAREAANIMATION, 0, IntToPtr(!client_area_animation), 0 ); ok( ret, "SystemParametersInfoW failed, error %ld.\n", GetLastError() ); hr = IUISettings_get_AnimationsEnabled( uisettings, &enabled ); - todo_wine ok( hr == S_OK, "Got unexpected hr %#lx.\n", hr ); - todo_wine ok( enabled == !client_area_animation, "Expected %d, got %d.\n", !client_area_animation, enabled ); ret = SystemParametersInfoW( SPI_SETCLIENTAREAANIMATION, 0, IntToPtr(client_area_animation), 0 ); ok( ret, "SystemParametersInfoW failed, error %ld.\n", GetLastError() ); hr = IUISettings_get_AnimationsEnabled( uisettings, &enabled ); - todo_wine ok( hr == S_OK, "Got unexpected hr %#lx.\n", hr ); - todo_wine ok( enabled == client_area_animation, "Expected %d, got %d.\n", client_area_animation, enabled ); } diff --git a/dlls/windows.ui/uisettings.c b/dlls/windows.ui/uisettings.c index ce95666723b..c816ed83d20 100644 --- a/dlls/windows.ui/uisettings.c +++ b/dlls/windows.ui/uisettings.c @@ -163,8 +163,15 @@ static HRESULT WINAPI uisettings_get_MessageDuration( IUISettings *iface, UINT32 static HRESULT WINAPI uisettings_get_AnimationsEnabled( IUISettings *iface, boolean *value ) { - FIXME( "iface %p, value %p stub!\n", iface, value ); - return E_NOTIMPL; + BOOL enabled, ret; + + TRACE( "iface %p, value %p.\n", iface, value ); + + ret = SystemParametersInfoW( SPI_GETCLIENTAREAANIMATION, 0, &enabled, 0 ); + if (!ret) return E_FAIL; + + *value = !!enabled; + return S_OK; } static HRESULT WINAPI uisettings_get_CaretBrowsingEnabled( IUISettings *iface, boolean *value ) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10237
participants (2)
-
Zhiyi Zhang -
Zhiyi Zhang (@zhiyi)