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.
From: Alistair Leslie-Hughes leslie_alistair@hotmail.com
--- include/windows.ui.viewmanagement.idl | 106 ++++++++++++++++++++++++++ 1 file changed, 106 insertions(+)
diff --git a/include/windows.ui.viewmanagement.idl b/include/windows.ui.viewmanagement.idl index e7a90646338..e7f0c801e02 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,17 @@ 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 +179,83 @@ 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 +264,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 then 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..e8cb6863964 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/uisettings.c | 83 ++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+)
diff --git a/dlls/windows.ui/uisettings.c b/dlls/windows.ui/uisettings.c index e8cb6863964..489df303f9f 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; }; @@ -35,6 +36,11 @@ static inline struct uisettings *impl_from_IUISettings( IUISettings *iface ) return CONTAINING_RECORD( iface, struct uisettings, IUISettings_iface ); }
+static inline struct uisettings *impl_from_IUISettings2( IUISettings2 *iface ) +{ + return CONTAINING_RECORD( iface, struct uisettings, IUISettings2_iface ); +} + static inline struct uisettings *impl_from_IUISettings3( IUISettings3 *iface ) { return CONTAINING_RECORD( iface, struct uisettings, IUISettings3_iface ); @@ -55,6 +61,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 +222,78 @@ static const struct IUISettingsVtbl uisettings_vtbl = uisettings_UIElementColor };
+static HRESULT WINAPI uisettings2_QueryInterface(IUISettings2 *iface, REFIID iid, void **out) +{ + struct uisettings *impl = impl_from_IUISettings2( iface ); + return uisettings_QueryInterface(&impl->IUISettings_iface, iid, out); +} + +static ULONG WINAPI uisettings2_AddRef(IUISettings2 *iface) +{ + struct uisettings *impl = impl_from_IUISettings2( iface ); + return uisettings_AddRef(&impl->IUISettings_iface); +} + +static ULONG WINAPI uisettings2_Release(IUISettings2 *iface) +{ + struct uisettings *impl = impl_from_IUISettings2( iface ); + return uisettings_Release(&impl->IUISettings_iface); +} + +static HRESULT WINAPI uisettings2_GetIids(IUISettings2 *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 uisettings2_GetRuntimeClassName(IUISettings2 *iface, HSTRING *class_name) +{ + FIXME( "iface %p, class_name %p stub!\n", iface, class_name ); + return E_NOTIMPL; +} + +static HRESULT WINAPI uisettings2_GetTrustLevel(IUISettings2 *iface, TrustLevel *trust_level) +{ + FIXME( "iface %p, trust_level %p stub!\n", iface, trust_level ); + return E_NOTIMPL; +} + +static HRESULT WINAPI uisettings2_get_TextScaleFactor(IUISettings2 *iface,DOUBLE *value) +{ + FIXME( "iface %p, value %p stub!\n", iface, value ); + *value = 1.0; + return S_OK; +} + +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 +484,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;
Rémi Bernon (@rbernon) commented about include/windows.ui.viewmanagement.idl:
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*>;
```suggestion:-2+0 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 *>; ```
Same nitpicks elsewhere.
Rémi Bernon (@rbernon) commented about include/windows.ui.viewmanagement.idl:
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);
- }
```suggestion:-9+0 [ 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); } ```
Same elsewhere, please keep the style consistent.
Rémi Bernon (@rbernon) commented about include/windows.ui.viewmanagement.idl:
[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);
- }
Maybe `IUISettings` should indeed be returned instead of `IUISettings3` by default as it's the default interface, but other than that I don't think it is necessary to add any other iterface, or even declare them, if no application cares about them.
Rémi Bernon (@rbernon) commented about dlls/windows.ui/uisettings.c:
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)
```suggestion:-0+0 static HRESULT WINAPI uisettings_QueryInterface( IUISettings *iface, REFIID iid, void **out ) ```
Same style nitpick in other method declarations.
Rémi Bernon (@rbernon) commented about dlls/windows.ui/uisettings.c:
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)
```suggestion:-0+0 if (!*out) ```
Rémi Bernon (@rbernon) commented about dlls/windows.ui/uisettings.c:
{ *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 );
```suggestion:-0+0 IUnknown_AddRef( (IUnknown *)*out ); ```
Rémi Bernon (@rbernon) commented about dlls/windows.ui/uisettings.c:
{ FIXME( "iface %p, trust_level %p stub!\n", iface, trust_level ); return E_NOTIMPL; }
You could copy it from some other winrt module to private.h, and use `DEFINE_IINSPECTABLE` here.
Rémi Bernon (@rbernon) commented about dlls/windows.ui/uisettings.c:
+{
- FIXME( "iface %p, iid_count %p, iids %p stub!\n", iface, iid_count, iids );
- return E_NOTIMPL;
+}
+static HRESULT WINAPI uisettings2_GetRuntimeClassName(IUISettings2 *iface, HSTRING *class_name) +{
- FIXME( "iface %p, class_name %p stub!\n", iface, class_name );
- return E_NOTIMPL;
+}
+static HRESULT WINAPI uisettings2_GetTrustLevel(IUISettings2 *iface, TrustLevel *trust_level) +{
- FIXME( "iface %p, trust_level %p stub!\n", iface, trust_level );
- return E_NOTIMPL;
+}
Same here, you could use `DEFINE_IINSPECTABLE` to save all these lines.
Rémi Bernon (@rbernon) commented about dlls/windows.ui/uisettings.c:
+{
- FIXME( "iface %p, class_name %p stub!\n", iface, class_name );
- return E_NOTIMPL;
+}
+static HRESULT WINAPI uisettings2_GetTrustLevel(IUISettings2 *iface, TrustLevel *trust_level) +{
- FIXME( "iface %p, trust_level %p stub!\n", iface, trust_level );
- return E_NOTIMPL;
+}
+static HRESULT WINAPI uisettings2_get_TextScaleFactor(IUISettings2 *iface,DOUBLE *value) +{
- FIXME( "iface %p, value %p stub!\n", iface, value );
- *value = 1.0;
- return S_OK;
The stub should return `E_NOTIMPL` first, then a test would be welcome to validate that 1.0 and S_OK are sensible return values.
Rémi Bernon (@rbernon) commented about dlls/windows.ui/uisettings.c:
- return E_NOTIMPL;
+}
+static HRESULT WINAPI uisettings2_GetRuntimeClassName(IUISettings2 *iface, HSTRING *class_name) +{
- FIXME( "iface %p, class_name %p stub!\n", iface, class_name );
- return E_NOTIMPL;
+}
+static HRESULT WINAPI uisettings2_GetTrustLevel(IUISettings2 *iface, TrustLevel *trust_level) +{
- FIXME( "iface %p, trust_level %p stub!\n", iface, trust_level );
- return E_NOTIMPL;
+}
+static HRESULT WINAPI uisettings2_get_TextScaleFactor(IUISettings2 *iface,DOUBLE *value)
```suggestion:-0+0 static HRESULT WINAPI uisettings2_get_TextScaleFactor( IUISettings2 *iface, DOUBLE *value ) ``` Same nitpick below.