This corrects what interface should be returned, there isn't a hierarchy with these IUISettings at all. It should return IUISettings and then QI for any others that it requires.
-- v3: windows.ui: Use DEFINE_IINSPECTABLE for IUISettings3 windows.ui: Add IUISettings2 stub interface windows.ui: Add Stubbed interface IUISettings include: Add Missing IUISettings interfaces.
From: Alistair Leslie-Hughes leslie_alistair@hotmail.com
--- include/windows.ui.viewmanagement.idl | 120 ++++++++++++++++++++++++++ 1 file changed, 120 insertions(+)
diff --git a/include/windows.ui.viewmanagement.idl b/include/windows.ui.viewmanagement.idl index e7a90646338..d71d63bda61 100644 --- a/include/windows.ui.viewmanagement.idl +++ b/include/windows.ui.viewmanagement.idl @@ -39,12 +39,26 @@ namespace Windows.UI.ViewManagement typedef enum UIElementType UIElementType;
interface IUISettings; + interface IUISettings2; interface IUISettings3; + interface IUISettings4; + interface IUISettings5; + interface IUISettings6; + + interface IUISettingsAnimationsEnabledChangedEventArgs; + interface IUISettingsAutoHideScrollBarsChangedEventArgs; + interface IUISettingsMessageDurationChangedEventArgs;
runtimeclass UISettings; + runtimeclass UISettingsAnimationsEnabledChangedEventArgs; + runtimeclass UISettingsAutoHideScrollBarsChangedEventArgs; + runtimeclass UISettingsMessageDurationChangedEventArgs;
declare { interface Windows.Foundation.TypedEventHandler<Windows.UI.ViewManagement.UISettings *, IInspectable *>; + interface Windows.Foundation.TypedEventHandler<Windows.UI.ViewManagement.UISettings *, Windows.UI.ViewManagement.UISettingsAnimationsEnabledChangedEventArgs *>; + interface Windows.Foundation.TypedEventHandler<Windows.UI.ViewManagement.UISettings *, Windows.UI.ViewManagement.UISettingsAutoHideScrollBarsChangedEventArgs *>; + interface Windows.Foundation.TypedEventHandler<Windows.UI.ViewManagement.UISettings *, Windows.UI.ViewManagement.UISettingsMessageDurationChangedEventArgs *>; }
[ @@ -141,6 +155,19 @@ namespace Windows.UI.ViewManagement HRESULT UIElementColor([in] Windows.UI.ViewManagement.UIElementType element, [out, retval] Windows.UI.Color *value); }
+ [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.UI.ViewManagement.UISettings), + uuid(bad82401-2721-44f9-bb91-2bb228be442f) + ] + interface IUISettings2 : IInspectable + { + [propget] HRESULT TextScaleFactor([out, retval] DOUBLE* value); + [eventadd] HRESULT TextScaleFactorChanged([in] Windows.Foundation.TypedEventHandler<Windows.UI.ViewManagement.UISettings*, + IInspectable*>* handler, [out, retval] EventRegistrationToken* cookie); + [eventremove] HRESULT TextScaleFactorChanged([in] EventRegistrationToken cookie); + } + [ contract(Windows.Foundation.UniversalApiContract, 1.0), exclusiveto(Windows.UI.ViewManagement.UISettings), @@ -154,6 +181,95 @@ namespace Windows.UI.ViewManagement [eventremove] HRESULT ColorValuesChanged([in] EventRegistrationToken cookie); }
+ [ + contract(Windows.Foundation.UniversalApiContract, 4.0), + exclusiveto(Windows.UI.ViewManagement.UISettings), + uuid(52bb3002-919b-4d6b-9b78-8dd66ff4b93b) + ] + interface IUISettings4 : IInspectable + { + [propget] HRESULT AdvancedEffectsEnabled([out, retval] boolean* value); + [eventadd] HRESULT AdvancedEffectsEnabledChanged([in] Windows.Foundation.TypedEventHandler<Windows.UI.ViewManagement.UISettings*, IInspectable*>* handler, + [out, retval] EventRegistrationToken* cookie); + [eventremove] HRESULT AdvancedEffectsEnabledChanged([in] EventRegistrationToken cookie); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 8.0), + exclusiveto(Windows.UI.ViewManagement.UISettings), + uuid(5349d588-0cb5-5f05-bd34-706b3231f0bd) + ] + interface IUISettings5 : IInspectable + { + [propget] HRESULT AutoHideScrollBars([out] [retval] boolean* value); + [eventadd] HRESULT AutoHideScrollBarsChanged([in] Windows.Foundation.TypedEventHandler<Windows.UI.ViewManagement.UISettings*, + Windows.UI.ViewManagement.UISettingsAutoHideScrollBarsChangedEventArgs*>* handler, [out, retval] EventRegistrationToken* token); + [eventremove] HRESULT AutoHideScrollBarsChanged([in] EventRegistrationToken token); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 10.0), + exclusiveto(Windows.UI.ViewManagement.UISettings), + uuid(aef19bd7-fe31-5a04-ada4-469aaec6dfa9) + ] + interface IUISettings6 : IInspectable + { + [eventadd] HRESULT AnimationsEnabledChanged([in] Windows.Foundation.TypedEventHandler<Windows.UI.ViewManagement.UISettings*, + Windows.UI.ViewManagement.UISettingsAnimationsEnabledChangedEventArgs*>* handler, [out, retval] EventRegistrationToken* token); + [eventremove] HRESULT AnimationsEnabledChanged([in] EventRegistrationToken token); + [eventadd] HRESULT MessageDurationChanged([in] Windows.Foundation.TypedEventHandler<Windows.UI.ViewManagement.UISettings*, + Windows.UI.ViewManagement.UISettingsMessageDurationChangedEventArgs*>* handler, [out, retval] EventRegistrationToken* token); + [eventremove] HRESULT MessageDurationChanged([in] EventRegistrationToken token); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 10.0), + exclusiveto(Windows.UI.ViewManagement.UISettingsAnimationsEnabledChangedEventArgs), + uuid(0c7b4b3d-2ea1-533e-894d-415bc5243c29) + ] + interface IUISettingsAnimationsEnabledChangedEventArgs : IInspectable + { + } + + [ + contract(Windows.Foundation.UniversalApiContract, 8.0), + exclusiveto(Windows.UI.ViewManagement.UISettingsAutoHideScrollBarsChangedEventArgs), + uuid(87afd4b2-9146-5f02-8f6b-06d454174c0f) + ] + interface IUISettingsAutoHideScrollBarsChangedEventArgs : IInspectable + { + } + + [ + contract(Windows.Foundation.UniversalApiContract, 10.0), + exclusiveto(Windows.UI.ViewManagement.UISettingsMessageDurationChangedEventArgs), + uuid(338aad52-4a5d-5b59-8002-d930f608fd6e) + ] + interface IUISettingsMessageDurationChangedEventArgs : IInspectable + { + } + + [contract(Windows.Foundation.UniversalApiContract, 10.0)] + [marshaling_behavior(agile)] + runtimeclass UISettingsAnimationsEnabledChangedEventArgs + { + [default] interface Windows.UI.ViewManagement.IUISettingsAnimationsEnabledChangedEventArgs; + } + + [contract(Windows.Foundation.UniversalApiContract, 8.0)] + [marshaling_behavior(agile)] + runtimeclass UISettingsAutoHideScrollBarsChangedEventArgs + { + [default] interface Windows.UI.ViewManagement.IUISettingsAutoHideScrollBarsChangedEventArgs; + } + + [contract(Windows.Foundation.UniversalApiContract, 10.0)] + [marshaling_behavior(agile)] + runtimeclass UISettingsMessageDurationChangedEventArgs + { + [default] interface Windows.UI.ViewManagement.IUISettingsMessageDurationChangedEventArgs; + } + [ activatable(Windows.Foundation.UniversalApiContract, 1.0), contract(Windows.Foundation.UniversalApiContract, 1.0), @@ -162,6 +278,10 @@ namespace Windows.UI.ViewManagement runtimeclass UISettings { [default] interface Windows.UI.ViewManagement.IUISettings; + [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.UI.ViewManagement.IUISettings2; [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.UI.ViewManagement.IUISettings3; + [contract(Windows.Foundation.UniversalApiContract, 4.0)] interface Windows.UI.ViewManagement.IUISettings4; + [contract(Windows.Foundation.UniversalApiContract, 8.0)] interface Windows.UI.ViewManagement.IUISettings5; + [contract(Windows.Foundation.UniversalApiContract, 10.0)] interface Windows.UI.ViewManagement.IUISettings6; } }
From: Alistair Leslie-Hughes leslie_alistair@hotmail.com
This corrects what interface should be returned, there isn't a hierarchy with these IUISettings at all. It should return IUISettings and the QI for any others that it requires. --- dlls/windows.ui/uisettings.c | 182 ++++++++++++++++++++++++++++++++--- 1 file changed, 170 insertions(+), 12 deletions(-)
diff --git a/dlls/windows.ui/uisettings.c b/dlls/windows.ui/uisettings.c index 943fbb6a37e..cd1a2b7050d 100644 --- a/dlls/windows.ui/uisettings.c +++ b/dlls/windows.ui/uisettings.c @@ -25,47 +25,62 @@ WINE_DEFAULT_DEBUG_CHANNEL(ui);
struct uisettings { + IUISettings IUISettings_iface; IUISettings3 IUISettings3_iface; LONG ref; };
+static inline struct uisettings *impl_from_IUISettings( IUISettings *iface ) +{ + return CONTAINING_RECORD( iface, struct uisettings, IUISettings_iface ); +} + static inline struct uisettings *impl_from_IUISettings3( IUISettings3 *iface ) { return CONTAINING_RECORD( iface, struct uisettings, IUISettings3_iface ); }
-static HRESULT WINAPI uisettings3_QueryInterface( IUISettings3 *iface, REFIID iid, void **out ) +static HRESULT WINAPI uisettings_QueryInterface( IUISettings *iface, REFIID iid, void **out ) { - struct uisettings *impl = impl_from_IUISettings3( iface ); + struct uisettings *impl = impl_from_IUISettings( iface );
TRACE( "iface %p, iid %s, out %p.\n", iface, debugstr_guid( iid ), out );
+ *out = NULL; + if (IsEqualGUID( iid, &IID_IUnknown ) || IsEqualGUID( iid, &IID_IInspectable ) || IsEqualGUID( iid, &IID_IAgileObject ) || - IsEqualGUID( iid, &IID_IUISettings3 )) + IsEqualGUID( iid, &IID_IUISettings )) + { + *out = &impl->IUISettings_iface; + } + else if (IsEqualGUID( iid, &IID_IUISettings3 )) { *out = &impl->IUISettings3_iface; - IInspectable_AddRef( *out ); - return S_OK; }
- FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); - *out = NULL; - return E_NOINTERFACE; + if (!*out) + { + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); + return E_NOINTERFACE; + } + + IUnknown_AddRef( (IUnknown*)*out ); + return S_OK; }
-static ULONG WINAPI uisettings3_AddRef( IUISettings3 *iface ) +static ULONG WINAPI uisettings_AddRef( IUISettings *iface ) { - struct uisettings *impl = impl_from_IUISettings3( iface ); + struct uisettings *impl = impl_from_IUISettings( iface ); ULONG ref = InterlockedIncrement( &impl->ref ); TRACE( "iface %p, ref %lu.\n", iface, ref ); return ref; }
-static ULONG WINAPI uisettings3_Release( IUISettings3 *iface ) +static ULONG WINAPI uisettings_Release( IUISettings *iface ) { - struct uisettings *impl = impl_from_IUISettings3( iface ); + struct uisettings *impl = impl_from_IUISettings( iface ); ULONG ref = InterlockedDecrement( &impl->ref );
TRACE( "iface %p, ref %lu.\n", iface, ref ); @@ -74,6 +89,148 @@ static ULONG WINAPI uisettings3_Release( IUISettings3 *iface ) return ref; }
+static HRESULT WINAPI uisettings_GetIids( IUISettings *iface, ULONG *iid_count, IID **iids ) +{ + FIXME( "iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids ); + return E_NOTIMPL; +} + +static HRESULT WINAPI uisettings_GetRuntimeClassName( IUISettings *iface, HSTRING *class_name ) +{ + FIXME( "iface %p, class_name %p stub!\n", iface, class_name ); + return E_NOTIMPL; +} + +static HRESULT WINAPI uisettings_GetTrustLevel( IUISettings *iface, TrustLevel *trust_level ) +{ + FIXME( "iface %p, trust_level %p stub!\n", iface, trust_level ); + return E_NOTIMPL; +} + +static HRESULT WINAPI uisettings_get_HandPreference( IUISettings *iface, enum HandPreference *value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI uisettings_get_CursorSize( IUISettings *iface, struct Size *value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI uisettings_get_ScrollBarSize( IUISettings *iface, struct Size *value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI uisettings_get_ScrollBarArrowSize( IUISettings *iface, struct Size *value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI uisettings_get_ScrollBarThumbBoxSize( IUISettings *iface, struct Size *value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI uisettings_get_MessageDuration( IUISettings *iface, UINT32 *value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI uisettings_get_AnimationsEnabled( IUISettings *iface, boolean *value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI uisettings_get_CaretBrowsingEnabled( IUISettings *iface, boolean *value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI uisettings_get_CaretBlinkRate( IUISettings *iface, UINT32 *value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI uisettings_get_CaretWidth( IUISettings *iface, UINT32 *value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI uisettings_get_DoubleClickTime( IUISettings *iface, UINT32 *value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI uisettings_get_MouseHoverTime( IUISettings *iface, UINT32 *value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI uisettings_UIElementColor( IUISettings *iface, enum UIElementType element, struct Color *value ) +{ + FIXME( "iface %p, element %d value %p stub!\n", iface, element, value ); + return E_NOTIMPL; +} + +static const struct IUISettingsVtbl uisettings_vtbl = +{ + uisettings_QueryInterface, + uisettings_AddRef, + uisettings_Release, + + /* IInspectable methods */ + uisettings_GetIids, + uisettings_GetRuntimeClassName, + uisettings_GetTrustLevel, + + /* IUISettings methods */ + uisettings_get_HandPreference, + uisettings_get_CursorSize, + uisettings_get_ScrollBarSize, + uisettings_get_ScrollBarArrowSize, + uisettings_get_ScrollBarThumbBoxSize, + uisettings_get_MessageDuration, + uisettings_get_AnimationsEnabled, + uisettings_get_CaretBrowsingEnabled, + uisettings_get_CaretBlinkRate, + uisettings_get_CaretWidth, + uisettings_get_DoubleClickTime, + uisettings_get_MouseHoverTime, + uisettings_UIElementColor +}; + + +static HRESULT WINAPI uisettings3_QueryInterface( IUISettings3 *iface, REFIID iid, void **out ) +{ + struct uisettings *impl = impl_from_IUISettings3( iface ); + return uisettings_QueryInterface(&impl->IUISettings_iface, iid, out); +} + +static ULONG WINAPI uisettings3_AddRef( IUISettings3 *iface ) +{ + struct uisettings *impl = impl_from_IUISettings3( iface ); + return uisettings_AddRef(&impl->IUISettings_iface); +} + +static ULONG WINAPI uisettings3_Release( IUISettings3 *iface ) +{ + struct uisettings *impl = impl_from_IUISettings3( iface ); + return uisettings_Release(&impl->IUISettings_iface); +} + static HRESULT WINAPI uisettings3_GetIids( IUISettings3 *iface, ULONG *iid_count, IID **iids ) { FIXME( "iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids ); @@ -244,6 +401,7 @@ static HRESULT WINAPI factory_ActivateInstance( IActivationFactory *iface, IInsp return E_OUTOFMEMORY; }
+ impl->IUISettings_iface.lpVtbl = &uisettings_vtbl; impl->IUISettings3_iface.lpVtbl = &uisettings3_vtbl; impl->ref = 1;
From: Alistair Leslie-Hughes leslie_alistair@hotmail.com
--- dlls/windows.ui/private.h | 38 +++++++++++++++++++++++++++++++ dlls/windows.ui/uisettings.c | 43 ++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+)
diff --git a/dlls/windows.ui/private.h b/dlls/windows.ui/private.h index 1af5faf152b..60a928ca865 100644 --- a/dlls/windows.ui/private.h +++ b/dlls/windows.ui/private.h @@ -38,4 +38,42 @@
extern IActivationFactory *uisettings_factory;
+#define DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from, iface_mem, expr ) \ + static inline impl_type *impl_from( iface_type *iface ) \ + { \ + return CONTAINING_RECORD( iface, impl_type, iface_mem ); \ + } \ + static HRESULT WINAPI pfx##_QueryInterface( iface_type *iface, REFIID iid, void **out ) \ + { \ + impl_type *impl = impl_from( iface ); \ + return IInspectable_QueryInterface( (IInspectable *)(expr), iid, out ); \ + } \ + static ULONG WINAPI pfx##_AddRef( iface_type *iface ) \ + { \ + impl_type *impl = impl_from( iface ); \ + return IInspectable_AddRef( (IInspectable *)(expr) ); \ + } \ + static ULONG WINAPI pfx##_Release( iface_type *iface ) \ + { \ + impl_type *impl = impl_from( iface ); \ + return IInspectable_Release( (IInspectable *)(expr) ); \ + } \ + static HRESULT WINAPI pfx##_GetIids( iface_type *iface, ULONG *iid_count, IID **iids ) \ + { \ + impl_type *impl = impl_from( iface ); \ + return IInspectable_GetIids( (IInspectable *)(expr), iid_count, iids ); \ + } \ + static HRESULT WINAPI pfx##_GetRuntimeClassName( iface_type *iface, HSTRING *class_name ) \ + { \ + impl_type *impl = impl_from( iface ); \ + return IInspectable_GetRuntimeClassName( (IInspectable *)(expr), class_name ); \ + } \ + static HRESULT WINAPI pfx##_GetTrustLevel( iface_type *iface, TrustLevel *trust_level ) \ + { \ + impl_type *impl = impl_from( iface ); \ + return IInspectable_GetTrustLevel( (IInspectable *)(expr), trust_level ); \ + } +#define DEFINE_IINSPECTABLE( pfx, iface_type, impl_type, base_iface ) \ + DEFINE_IINSPECTABLE_( pfx, iface_type, impl_type, impl_from_##iface_type, iface_type##_iface, &impl->base_iface ) + #endif diff --git a/dlls/windows.ui/uisettings.c b/dlls/windows.ui/uisettings.c index cd1a2b7050d..cd713f05c74 100644 --- a/dlls/windows.ui/uisettings.c +++ b/dlls/windows.ui/uisettings.c @@ -26,6 +26,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ui); struct uisettings { IUISettings IUISettings_iface; + IUISettings2 IUISettings2_iface; IUISettings3 IUISettings3_iface; LONG ref; }; @@ -55,6 +56,10 @@ static HRESULT WINAPI uisettings_QueryInterface( IUISettings *iface, REFIID iid, { *out = &impl->IUISettings_iface; } + else if (IsEqualGUID( iid, &IID_IUISettings2 )) + { + *out = &impl->IUISettings2_iface; + } else if (IsEqualGUID( iid, &IID_IUISettings3 )) { *out = &impl->IUISettings3_iface; @@ -212,6 +217,43 @@ static const struct IUISettingsVtbl uisettings_vtbl = uisettings_UIElementColor };
+DEFINE_IINSPECTABLE( uisettings2, IUISettings2, struct uisettings, IUISettings_iface ); + +static HRESULT WINAPI uisettings2_get_TextScaleFactor( IUISettings2 *iface,DOUBLE *value ) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + return E_NOTIMPL; +} + +static HRESULT WINAPI uisettings2_add_TextScaleFactorChanged( IUISettings2 *iface, ITypedEventHandler_UISettings_IInspectable *handler, + EventRegistrationToken *cookie ) +{ + FIXME( "iface %p, handler %p, cookie %p stub!\n", iface, handler, cookie ); + return E_NOTIMPL; +} + +static HRESULT WINAPI uisettings2_remove_TextScaleFactorChanged( IUISettings2 *iface, EventRegistrationToken cookie ) +{ + FIXME( "iface %p, cookie %#I64x stub!\n", iface, cookie.value ); + return E_NOTIMPL; +} + +static const struct IUISettings2Vtbl uisettings2_vtbl = +{ + uisettings2_QueryInterface, + uisettings2_AddRef, + uisettings2_Release, + + /* IInspectable methods */ + uisettings2_GetIids, + uisettings2_GetRuntimeClassName, + uisettings2_GetTrustLevel, + + /* IUISettings2 methods */ + uisettings2_get_TextScaleFactor, + uisettings2_add_TextScaleFactorChanged, + uisettings2_remove_TextScaleFactorChanged +};
static HRESULT WINAPI uisettings3_QueryInterface( IUISettings3 *iface, REFIID iid, void **out ) { @@ -402,6 +444,7 @@ static HRESULT WINAPI factory_ActivateInstance( IActivationFactory *iface, IInsp }
impl->IUISettings_iface.lpVtbl = &uisettings_vtbl; + impl->IUISettings2_iface.lpVtbl = &uisettings2_vtbl; impl->IUISettings3_iface.lpVtbl = &uisettings3_vtbl; impl->ref = 1;
From: Alistair Leslie-Hughes leslie_alistair@hotmail.com
--- dlls/windows.ui/uisettings.c | 41 +----------------------------------- 1 file changed, 1 insertion(+), 40 deletions(-)
diff --git a/dlls/windows.ui/uisettings.c b/dlls/windows.ui/uisettings.c index cd713f05c74..46377212055 100644 --- a/dlls/windows.ui/uisettings.c +++ b/dlls/windows.ui/uisettings.c @@ -36,11 +36,6 @@ static inline struct uisettings *impl_from_IUISettings( IUISettings *iface ) return CONTAINING_RECORD( iface, struct uisettings, IUISettings_iface ); }
-static inline struct uisettings *impl_from_IUISettings3( IUISettings3 *iface ) -{ - return CONTAINING_RECORD( iface, struct uisettings, IUISettings3_iface ); -} - static HRESULT WINAPI uisettings_QueryInterface( IUISettings *iface, REFIID iid, void **out ) { struct uisettings *impl = impl_from_IUISettings( iface ); @@ -255,41 +250,7 @@ static const struct IUISettings2Vtbl uisettings2_vtbl = uisettings2_remove_TextScaleFactorChanged };
-static HRESULT WINAPI uisettings3_QueryInterface( IUISettings3 *iface, REFIID iid, void **out ) -{ - struct uisettings *impl = impl_from_IUISettings3( iface ); - return uisettings_QueryInterface(&impl->IUISettings_iface, iid, out); -} - -static ULONG WINAPI uisettings3_AddRef( IUISettings3 *iface ) -{ - struct uisettings *impl = impl_from_IUISettings3( iface ); - return uisettings_AddRef(&impl->IUISettings_iface); -} - -static ULONG WINAPI uisettings3_Release( IUISettings3 *iface ) -{ - struct uisettings *impl = impl_from_IUISettings3( iface ); - return uisettings_Release(&impl->IUISettings_iface); -} - -static HRESULT WINAPI uisettings3_GetIids( IUISettings3 *iface, ULONG *iid_count, IID **iids ) -{ - FIXME( "iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids ); - return E_NOTIMPL; -} - -static HRESULT WINAPI uisettings3_GetRuntimeClassName( IUISettings3 *iface, HSTRING *class_name ) -{ - FIXME( "iface %p, class_name %p stub!\n", iface, class_name ); - return E_NOTIMPL; -} - -static HRESULT WINAPI uisettings3_GetTrustLevel( IUISettings3 *iface, TrustLevel *trust_level ) -{ - FIXME( "iface %p, trust_level %p stub!\n", iface, trust_level ); - return E_NOTIMPL; -} +DEFINE_IINSPECTABLE( uisettings3, IUISettings3, struct uisettings, IUISettings_iface );
static DWORD get_app_theme(void) {
I'm not sure what this MR is fixing exactly. `IUISettings` is the default interface, but unless an app specifically queries for it why add it? Do you have an app that depends on this? Or maybe add some tests showing what's broken?
This was discussed in https://gitlab.winehq.org/wine/wine/-/merge_requests/2103#note_23016
Chromium uses `IUISettings2` but doesn't seem to query for the default interface `IUISettings`. https://chromium.googlesource.com/chromium/src/+/refs/heads/main/ui/display/...
Same thing with FireFox, which queries `IUISettings2`, `IUISettings3`, `IUISettings4`, `IUISettings5`.
https://hg.mozilla.org/mozilla-central/file/tip/widget/windows/WindowsUIUtil...
Also, there's a lot of style inconsistencies in this MR. Please try to keep it consistent with the existing style.
FWIW, I was planning on eventually adding and implementing IUISettings[n] interfaces, but for now I don't see the point. I haven't come across an app that won't work without them. The biggest problem is that there's no place to add these user settings. Winecfg is too full as it is. I don't know if a new tab would be appropriate or if it's better to just add a new settings program altogether.
The application is Chromium based from the looks of things. I stubbed the IUISettings2 to see if it fixed the crash I was seeing. (It didn't). The crash is caused by a d3d11 issue but this is the first place I found that might be causing the crash.
It's not that the code is wrong, per say, but doesn't make sense when nothing is inherited.
The FireFox is a prime example of IUISettings base and Query for the other interfaces.
We can also add some basic default return values, if/when required.
It's not that the code is wrong, per say, but doesn't make sense when nothing is inherited.
Well the interfaces are independent so they don't get inherited. I don't really understand what you mean here, what exactly doesn't make sense?
The FireFox is a prime example of IUISettings base and Query for the other interfaces.
Could you explain this? From what I saw it directly queries `IUISettings5` before `IUISettings` and so on for the others.
For future reference, how can you tell if a class has a base interface that needs to be added prior to the queried interfaces?
Firefox might appear that way but it's not. The line uiSettingsAsInspectable.As(&uiSettings5) Is asking for the IUISettings5 interface from the IUISettings object.
These interfaces don't have a base as such, IUISettings2 doesn't inherit from IUISettings for example.
From the file windows.ui.viewmanagement.idl
under "runtimeclass UISettings" The interfaces listed here state that it supports the following interfaces. So, UISettings is the base (default) but supports UISettings2/3/4/5/6 interfaces as as well.