For React Native.
From: Zhiyi Zhang zzhang@codeweavers.com
--- include/Makefile.in | 1 + include/windows.ui.windowmanagement.idl | 188 ++++++++++++++++++++++++ 2 files changed, 189 insertions(+) create mode 100644 include/windows.ui.windowmanagement.idl
diff --git a/include/Makefile.in b/include/Makefile.in index 1c2c3a44a75..662b149da32 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -935,6 +935,7 @@ SOURCES = \ windows.ui.notifications.idl \ windows.ui.viewmanagement.core.idl \ windows.ui.viewmanagement.idl \ + windows.ui.windowmanagement.idl \ windows.ui.xaml.hosting.desktopwindowxamlsource.idl \ windows.ui.xaml.idl \ windows.ui.xaml.interop.idl \ diff --git a/include/windows.ui.windowmanagement.idl b/include/windows.ui.windowmanagement.idl new file mode 100644 index 00000000000..b6ca12c0248 --- /dev/null +++ b/include/windows.ui.windowmanagement.idl @@ -0,0 +1,188 @@ +/* + * Copyright 2025 Zhiyi Zhang for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifdef __WIDL__ +#pragma winrt ns_prefix +#endif + +#ifndef DO_NO_IMPORTS +import "inspectable.idl"; +import "asyncinfo.idl"; +import "eventtoken.idl"; +import "windowscontracts.idl"; +import "windows.foundation.idl"; +import "windows.system.idl"; +import "windows.ui.idl"; +import "windows.ui.composition.idl"; +#endif + +namespace Windows.UI.WindowManagement +{ + typedef enum WindowingEnvironmentKind WindowingEnvironmentKind; + + interface IDisplayRegion; + interface IWindowingEnvironment; + interface IWindowingEnvironmentAddedEventArgs; + interface IWindowingEnvironmentChangedEventArgs; + interface IWindowingEnvironmentRemovedEventArgs; + interface IWindowingEnvironmentStatics; + + runtimeclass DisplayRegion; + runtimeclass WindowingEnvironment; + runtimeclass WindowingEnvironmentAddedEventArgs; + runtimeclass WindowingEnvironmentChangedEventArgs; + runtimeclass WindowingEnvironmentRemovedEventArgs; + + declare { + interface Windows.Foundation.Collections.IIterable<Windows.UI.WindowManagement.DisplayRegion *>; + interface Windows.Foundation.Collections.IIterable<Windows.UI.WindowManagement.WindowingEnvironment *>; + interface Windows.Foundation.Collections.IIterator<Windows.UI.WindowManagement.DisplayRegion *>; + interface Windows.Foundation.Collections.IIterator<Windows.UI.WindowManagement.WindowingEnvironment *>; + interface Windows.Foundation.Collections.IVectorView<Windows.UI.WindowManagement.DisplayRegion *>; + interface Windows.Foundation.Collections.IVectorView<Windows.UI.WindowManagement.WindowingEnvironment *>; + interface Windows.Foundation.TypedEventHandler<Windows.UI.WindowManagement.DisplayRegion *, IInspectable *>; + interface Windows.Foundation.TypedEventHandler<Windows.UI.WindowManagement.WindowingEnvironment *, Windows.UI.WindowManagement.WindowingEnvironmentChangedEventArgs *>; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 8.0) + ] + enum WindowingEnvironmentKind + { + Unknown = 0, + Overlapped = 1, + Tiled = 2, + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 8.0), + exclusiveto(Windows.UI.WindowManagement.DisplayRegion), + uuid(db50c3a2-4094-5f47-8cb1-ea01ddafaa94) + ] + interface IDisplayRegion : IInspectable + { + [propget] HRESULT DisplayMonitorDeviceId([out, retval] HSTRING *value); + [propget] HRESULT IsVisible([out, retval] boolean *value); + [propget] HRESULT WorkAreaOffset([out, retval] Windows.Foundation.Point *value); + [propget] HRESULT WorkAreaSize([out, retval] Windows.Foundation.Size *value); + [propget] HRESULT WindowingEnvironment([out, retval] Windows.UI.WindowManagement.WindowingEnvironment **value); + [eventadd] HRESULT Changed([in] Windows.Foundation.TypedEventHandler<Windows.UI.WindowManagement.DisplayRegion *, IInspectable *> *handler, [out, retval] EventRegistrationToken *token); + [eventremove] HRESULT Changed([in] EventRegistrationToken token); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 8.0), + exclusiveto(Windows.UI.WindowManagement.WindowingEnvironment), + uuid(264363c0-2a49-5417-b3ae-48a71c63a3bd) + ] + interface IWindowingEnvironment : IInspectable + { + [propget] HRESULT IsEnabled([out, retval] boolean *value); + [propget] HRESULT Kind([out, retval] Windows.UI.WindowManagement.WindowingEnvironmentKind *value); + HRESULT GetDisplayRegions([out, retval] Windows.Foundation.Collections.IVectorView<Windows.UI.WindowManagement.DisplayRegion *> **result); + [eventadd] HRESULT Changed([in] Windows.Foundation.TypedEventHandler<Windows.UI.WindowManagement.WindowingEnvironment *, Windows.UI.WindowManagement.WindowingEnvironmentChangedEventArgs *> *handler, [out, retval] EventRegistrationToken *token); + [eventremove] HRESULT Changed([in] EventRegistrationToken token); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 8.0), + exclusiveto(Windows.UI.WindowManagement.WindowingEnvironmentAddedEventArgs), + uuid(ff2a5b7f-f183-5c66-99b2-429082069299) + ] + interface IWindowingEnvironmentAddedEventArgs : IInspectable + { + [propget] HRESULT WindowingEnvironment([out, retval] Windows.UI.WindowManagement.WindowingEnvironment **value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 8.0), + exclusiveto(Windows.UI.WindowManagement.WindowingEnvironmentChangedEventArgs), + uuid(4160cfc6-023d-5e9a-b431-350e67dc978a) + ] + interface IWindowingEnvironmentChangedEventArgs : IInspectable + { + } + + [ + contract(Windows.Foundation.UniversalApiContract, 8.0), + exclusiveto(Windows.UI.WindowManagement.WindowingEnvironmentRemovedEventArgs), + uuid(2e5b5473-beff-5e53-9316-7e775fe568b3) + ] + interface IWindowingEnvironmentRemovedEventArgs : IInspectable + { + [propget] HRESULT WindowingEnvironment([out, retval] Windows.UI.WindowManagement.WindowingEnvironment **value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 8.0), + exclusiveto(Windows.UI.WindowManagement.WindowingEnvironment), + uuid(874e9fb7-c642-55ab-8aa2-162f734a9a72) + ] + interface IWindowingEnvironmentStatics : IInspectable + { + [overload("FindAll")] HRESULT FindAll([out, retval] Windows.Foundation.Collections.IVectorView<Windows.UI.WindowManagement.WindowingEnvironment *> **result); + [overload("FindAll")] HRESULT FindAllWithKind([in] Windows.UI.WindowManagement.WindowingEnvironmentKind kind, [out, retval] Windows.Foundation.Collections.IVectorView<Windows.UI.WindowManagement.WindowingEnvironment *> **result); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 8.0), + marshaling_behavior(agile) + ] + runtimeclass DisplayRegion + { + [default] interface Windows.UI.WindowManagement.IDisplayRegion; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 8.0), + marshaling_behavior(agile), + static(Windows.UI.WindowManagement.IWindowingEnvironmentStatics, Windows.Foundation.UniversalApiContract, 8.0), + threading(both) + ] + runtimeclass WindowingEnvironment + { + [default] interface Windows.UI.WindowManagement.IWindowingEnvironment; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 8.0), + marshaling_behavior(agile) + ] + runtimeclass WindowingEnvironmentAddedEventArgs + { + [default] interface Windows.UI.WindowManagement.IWindowingEnvironmentAddedEventArgs; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 8.0), + marshaling_behavior(agile) + ] + runtimeclass WindowingEnvironmentChangedEventArgs + { + [default] interface Windows.UI.WindowManagement.IWindowingEnvironmentChangedEventArgs; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 8.0), + marshaling_behavior(agile) + ] + runtimeclass WindowingEnvironmentRemovedEventArgs + { + [default] interface Windows.UI.WindowManagement.IWindowingEnvironmentRemovedEventArgs; + } +}
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/windows.ui/classes.idl | 1 + include/windows.ui.viewmanagement.idl | 551 +++++++++++++++++++++++++- 2 files changed, 551 insertions(+), 1 deletion(-)
diff --git a/dlls/windows.ui/classes.idl b/dlls/windows.ui/classes.idl index a36e858603f..f8c59c3169f 100644 --- a/dlls/windows.ui/classes.idl +++ b/dlls/windows.ui/classes.idl @@ -37,4 +37,5 @@ import "windows.devices.input.idl"; #define DO_NO_IMPORTS #include "windows.ui.core.idl" #include "windows.ui.input.idl" +#include "windows.ui.windowmanagement.idl" #include "windows.ui.viewmanagement.idl" diff --git a/include/windows.ui.viewmanagement.idl b/include/windows.ui.viewmanagement.idl index 1be8fac2f0d..e6dfb1659ce 100644 --- a/include/windows.ui.viewmanagement.idl +++ b/include/windows.ui.viewmanagement.idl @@ -31,15 +31,49 @@ import "windows.devices.enumeration.idl"; import "windows.ui.idl"; import "windows.ui.core.idl"; /* import "windows.ui.popups.idl"; */ -/* import "windows.ui.windowmanagement.idl"; */ +import "windows.ui.windowmanagement.idl"; #endif
namespace Windows.UI.ViewManagement { + apicontract ViewManagementViewScalingContract; + + typedef enum ApplicationViewBoundsMode ApplicationViewBoundsMode; + typedef enum ApplicationViewMode ApplicationViewMode; + typedef enum ApplicationViewOrientation ApplicationViewOrientation; + typedef enum ApplicationViewState ApplicationViewState; + typedef enum ApplicationViewSwitchingOptions ApplicationViewSwitchingOptions; + typedef enum ApplicationViewWindowingMode ApplicationViewWindowingMode; + typedef enum FullScreenSystemOverlayMode FullScreenSystemOverlayMode; typedef enum HandPreference HandPreference; typedef enum UIColorType UIColorType; typedef enum UIElementType UIElementType; typedef enum UserInteractionMode UserInteractionMode; + typedef enum ViewSizePreference ViewSizePreference; + + interface IApplicationView; + interface IApplicationView2; + interface IApplicationView3; + interface IApplicationView4; + interface IApplicationView7; + interface IApplicationView9; + interface IApplicationViewConsolidatedEventArgs; + interface IApplicationViewConsolidatedEventArgs2; + interface IApplicationViewFullscreenStatics; + interface IApplicationViewInteropStatics; + interface IApplicationViewScaling; + interface IApplicationViewScalingStatics; + interface IApplicationViewStatics; + interface IApplicationViewStatics2; + interface IApplicationViewStatics3; + interface IApplicationViewStatics4; + interface IApplicationViewSwitcherStatics; + interface IApplicationViewSwitcherStatics2; + interface IApplicationViewSwitcherStatics3; + interface IApplicationViewTitleBar; + interface IApplicationViewTransferContext; + interface IApplicationViewTransferContextStatics; + interface IApplicationViewWithContext;
interface IUISettings; interface IUISettings2; @@ -53,6 +87,8 @@ namespace Windows.UI.ViewManagement
interface IUIViewSettings; interface IUIViewSettingsStatics; + interface IViewModePreferences; + interface IViewModePreferencesStatics;
interface IInputPane; interface IInputPane2; @@ -61,6 +97,12 @@ namespace Windows.UI.ViewManagement interface IInputPaneStatics; interface IInputPaneStatics2;
+ runtimeclass ApplicationView; + runtimeclass ApplicationViewConsolidatedEventArgs; + runtimeclass ApplicationViewScaling; + runtimeclass ApplicationViewSwitcher; + runtimeclass ApplicationViewTitleBar; + runtimeclass ApplicationViewTransferContext; runtimeclass UISettings; runtimeclass UISettingsAnimationsEnabledChangedEventArgs; runtimeclass UISettingsAutoHideScrollBarsChangedEventArgs; @@ -68,8 +110,11 @@ namespace Windows.UI.ViewManagement runtimeclass UIViewSettings; runtimeclass InputPane; runtimeclass InputPaneVisibilityEventArgs; + runtimeclass ViewModePreferences;
declare { + interface Windows.Foundation.TypedEventHandler<Windows.UI.ViewManagement.ApplicationView *, IInspectable *>; + interface Windows.Foundation.TypedEventHandler<Windows.UI.ViewManagement.ApplicationView *, Windows.UI.ViewManagement.ApplicationViewConsolidatedEventArgs *>; 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 *>; @@ -77,6 +122,89 @@ namespace Windows.UI.ViewManagement interface Windows.Foundation.TypedEventHandler<Windows.UI.ViewManagement.InputPane*, Windows.UI.ViewManagement.InputPaneVisibilityEventArgs*>; }
+ [ + contractversion(1.0) + ] + apicontract ViewManagementViewScalingContract + { + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0) + ] + enum ApplicationViewBoundsMode + { + UseVisible = 0, + UseCoreWindow = 1, + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 4.0) + ] + enum ApplicationViewMode + { + Default = 0, + CompactOverlay = 1, + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0) + ] + enum ApplicationViewOrientation + { + Landscape = 0, + Portrait = 1, + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0) + ] + enum ApplicationViewState + { + FullScreenLandscape = 0, + Filled = 1, + Snapped = 2, + FullScreenPortrait = 3, + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + flags + ] + enum ApplicationViewSwitchingOptions + { + Default = 0x0, + SkipAnimation = 0x1, + ConsolidateViews = 0x2, + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0) + ] + enum ApplicationViewWindowingMode + { + Auto = 0, + PreferredLaunchViewSize = 1, + FullScreen = 2, + [ + contract(Windows.Foundation.UniversalApiContract, 7.0) + ] + CompactOverlay = 3, + [ + contract(Windows.Foundation.UniversalApiContract, 7.0) + ] + Maximized = 4, + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0) + ] + enum FullScreenSystemOverlayMode + { + Standard = 0, + Minimal = 1, + }; + [ contract(Windows.Foundation.UniversalApiContract, 1.0) ] @@ -158,6 +286,323 @@ namespace Windows.UI.ViewManagement Touch = 1, };
+ [ + contract(Windows.Foundation.UniversalApiContract, 1.0) + ] + enum ViewSizePreference + { + Default = 0, + UseLess = 1, + UseHalf = 2, + UseMore = 3, + UseMinimum = 4, + UseNone = 5, + [ + contract(Windows.Foundation.UniversalApiContract, 4.0) + ] + Custom = 6, + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.UI.ViewManagement.ApplicationView), + uuid(d222d519-4361-451e-96c4-60f4f9742db0) + ] + interface IApplicationView : IInspectable + { + [propget] HRESULT Orientation([out, retval] Windows.UI.ViewManagement.ApplicationViewOrientation *value); + [propget] HRESULT AdjacentToLeftDisplayEdge([out, retval] boolean *value); + [propget] HRESULT AdjacentToRightDisplayEdge([out, retval] boolean *value); + [propget] HRESULT IsFullScreen([out, retval] boolean *value); + [propget] HRESULT IsOnLockScreen([out, retval] boolean *value); + [propget] HRESULT IsScreenCaptureEnabled([out, retval] boolean *value); + [propput] HRESULT IsScreenCaptureEnabled([in] boolean value); + [propput] HRESULT Title([in] HSTRING value); + [propget] HRESULT Title([out, retval] HSTRING *value); + [propget] HRESULT Id([out, retval] INT32 *value); + [eventadd] HRESULT Consolidated([in] Windows.Foundation.TypedEventHandler<Windows.UI.ViewManagement.ApplicationView *, Windows.UI.ViewManagement.ApplicationViewConsolidatedEventArgs *> *handler, [out, retval] EventRegistrationToken *token); + [eventremove] HRESULT Consolidated([in] EventRegistrationToken token); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.UI.ViewManagement.ApplicationView), + uuid(e876b196-a545-40dc-b594-450cba68cc00) + ] + interface IApplicationView2 : IInspectable + { + [propget] HRESULT SuppressSystemOverlays([out, retval] boolean *value); + [propput] HRESULT SuppressSystemOverlays([in] boolean value); + [propget] HRESULT VisibleBounds([out, retval] Windows.Foundation.Rect *value); + [eventadd] HRESULT VisibleBoundsChanged([in] Windows.Foundation.TypedEventHandler<Windows.UI.ViewManagement.ApplicationView *, IInspectable *> *handler, [out, retval] EventRegistrationToken *token); + [eventremove] HRESULT VisibleBoundsChanged([in] EventRegistrationToken token); + HRESULT SetDesiredBoundsMode([in] Windows.UI.ViewManagement.ApplicationViewBoundsMode mode, [out, retval] boolean *success); + [propget] HRESULT DesiredBoundsMode([out, retval] Windows.UI.ViewManagement.ApplicationViewBoundsMode *value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.UI.ViewManagement.ApplicationView), + uuid(903c9ce5-793a-4fdf-a2b2-af1ac21e3108) + ] + interface IApplicationView3 : IInspectable + { + [propget] HRESULT TitleBar([out, retval] Windows.UI.ViewManagement.ApplicationViewTitleBar **value); + [propget] HRESULT FullScreenSystemOverlayMode([out, retval] Windows.UI.ViewManagement.FullScreenSystemOverlayMode *value); + [propput] HRESULT FullScreenSystemOverlayMode([in] Windows.UI.ViewManagement.FullScreenSystemOverlayMode value); + [propget] HRESULT IsFullScreenMode([out, retval] boolean *value); + HRESULT TryEnterFullScreenMode([out, retval] boolean *success); + HRESULT ExitFullScreenMode(); + HRESULT ShowStandardSystemOverlays(); + HRESULT TryResizeView([in] Windows.Foundation.Size value, [out, retval] boolean *success); + HRESULT SetPreferredMinSize([in] Windows.Foundation.Size size); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 4.0), + exclusiveto(Windows.UI.ViewManagement.ApplicationView), + uuid(15e5cbec-9e0f-46b5-bc3f-9bf653e74b5e) + ] + interface IApplicationView4 : IInspectable + { + [propget] HRESULT ViewMode([out, retval] Windows.UI.ViewManagement.ApplicationViewMode *value); + HRESULT IsViewModeSupported([in] Windows.UI.ViewManagement.ApplicationViewMode mode, [out, retval] boolean *is_mode_supported); + [overload("TryEnterViewModeAsync")] HRESULT TryEnterViewModeAsync([in] Windows.UI.ViewManagement.ApplicationViewMode mode, [out, retval] Windows.Foundation.IAsyncOperation<boolean> **operation); + [overload("TryEnterViewModeAsync")] HRESULT TryEnterViewModeWithPreferencesAsync([in] Windows.UI.ViewManagement.ApplicationViewMode mode, [in] Windows.UI.ViewManagement.ViewModePreferences *preferences, [out, retval] Windows.Foundation.IAsyncOperation<boolean> **operation); + HRESULT TryConsolidateAsync([out, retval] Windows.Foundation.IAsyncOperation<boolean> **operation); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 8.0), + exclusiveto(Windows.UI.ViewManagement.ApplicationView), + uuid(a0369647-5faf-5aa6-9c38-befbb12a071e) + ] + interface IApplicationView7 : IInspectable + { + [propget] HRESULT PersistedStateId([out, retval] HSTRING *value); + [propput] HRESULT PersistedStateId([in] HSTRING value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 8.0), + exclusiveto(Windows.UI.ViewManagement.ApplicationView), + uuid(9c6516f9-021a-5f01-93e5-9bdad2647574) + ] + interface IApplicationView9 : IInspectable + { + [propget] HRESULT WindowingEnvironment([out, retval] Windows.UI.WindowManagement.WindowingEnvironment **value); + HRESULT GetDisplayRegions([out, retval] Windows.Foundation.Collections.IVectorView<Windows.UI.WindowManagement.DisplayRegion *> **result); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.UI.ViewManagement.ApplicationViewConsolidatedEventArgs), + uuid(514449ec-7ea2-4de7-a6a6-7dfbaaebb6fb) + ] + interface IApplicationViewConsolidatedEventArgs : IInspectable + { + [propget] HRESULT IsUserInitiated([out, retval] boolean *value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 4.0), + exclusiveto(Windows.UI.ViewManagement.ApplicationViewConsolidatedEventArgs), + uuid(1c199ecc-6dc1-40f4-afee-07d9ea296430) + ] + interface IApplicationViewConsolidatedEventArgs2 : IInspectable + { + [propget] HRESULT IsAppInitiated([out, retval] boolean *value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.UI.ViewManagement.ApplicationView), + uuid(bc792ebd-64fe-4b65-a0c0-901ce2b68636) + ] + interface IApplicationViewFullscreenStatics : IInspectable + { + HRESULT TryUnsnapToFullscreen([out, retval] boolean *success); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.UI.ViewManagement.ApplicationView), + uuid(c446fb5d-4793-4896-a8e2-be57a8bb0f50) + ] + interface IApplicationViewInteropStatics : IInspectable + { + HRESULT GetApplicationViewIdForWindow([in] Windows.UI.Core.ICoreWindow *window, [out, retval] INT32 *id); + } + + [ + contract(Windows.UI.ViewManagement.ViewManagementViewScalingContract, 1.0), + exclusiveto(Windows.UI.ViewManagement.ApplicationViewScaling), + uuid(1d0ddc23-23f3-4b2d-84fe-74bf37b48b66) + ] + interface IApplicationViewScaling : IInspectable + { + } + + [ + contract(Windows.UI.ViewManagement.ViewManagementViewScalingContract, 1.0), + exclusiveto(Windows.UI.ViewManagement.ApplicationViewScaling), + uuid(b08fecf0-b946-45c8-a5e3-71f5aa78f861) + ] + interface IApplicationViewScalingStatics : IInspectable + { + [propget] HRESULT DisableLayoutScaling([out, retval] boolean *value); + HRESULT TrySetDisableLayoutScaling([in] boolean disabled, [out, retval] boolean *success); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.UI.ViewManagement.ApplicationView), + uuid(010a6306-c433-44e5-a9f2-bd84d4030a95) + ] + interface IApplicationViewStatics : IInspectable + { + [propget] HRESULT Value([out, retval] Windows.UI.ViewManagement.ApplicationViewState *value); + HRESULT TryUnsnap([out, retval] boolean *success); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.UI.ViewManagement.ApplicationView), + uuid(af338ae5-cf64-423c-85e5-f3e72448fb23) + ] + interface IApplicationViewStatics2 : IInspectable + { + HRESULT GetForCurrentView([out, retval] Windows.UI.ViewManagement.ApplicationView **current); + [propget] HRESULT TerminateAppOnFinalViewClose([out, retval] boolean *value); + [propput] HRESULT TerminateAppOnFinalViewClose([in] boolean value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.UI.ViewManagement.ApplicationView), + uuid(a28d7594-8c41-4e13-9719-5164796fe4c7) + ] + interface IApplicationViewStatics3 : IInspectable + { + [propget] HRESULT PreferredLaunchWindowingMode([out, retval] Windows.UI.ViewManagement.ApplicationViewWindowingMode *value); + [propput] HRESULT PreferredLaunchWindowingMode([in] Windows.UI.ViewManagement.ApplicationViewWindowingMode value); + [propget] HRESULT PreferredLaunchViewSize([out, retval] Windows.Foundation.Size *value); + [propput] HRESULT PreferredLaunchViewSize([in] Windows.Foundation.Size value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 8.0), + exclusiveto(Windows.UI.ViewManagement.ApplicationView), + uuid(08fd8d33-2611-5336-a315-d98e6366c9db) + ] + interface IApplicationViewStatics4 : IInspectable + { + HRESULT ClearAllPersistedState(); + HRESULT ClearPersistedState([in] HSTRING key); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.UI.ViewManagement.ApplicationViewSwitcher), + uuid(975f2f1e-e656-4c5e-a0a1-717c6ffa7d64) + ] + interface IApplicationViewSwitcherStatics : IInspectable + { + HRESULT DisableShowingMainViewOnActivation(); + [overload("TryShowAsStandaloneAsync")] HRESULT TryShowAsStandaloneAsync([in] INT32 view_id, [out, retval] Windows.Foundation.IAsyncOperation<boolean> **operation); + [overload("TryShowAsStandaloneAsync")] HRESULT TryShowAsStandaloneWithSizePreferenceAsync([in] INT32 view_id, [in] Windows.UI.ViewManagement.ViewSizePreference preference, [out, retval] Windows.Foundation.IAsyncOperation<boolean> **operation); + [overload("TryShowAsStandaloneAsync")] HRESULT TryShowAsStandaloneWithAnchorViewAndSizePreferenceAsync([in] INT32 view_id, [in] Windows.UI.ViewManagement.ViewSizePreference size_preference, [in] INT32 anchor_view_id, [in] Windows.UI.ViewManagement.ViewSizePreference anchor_size_preference, [out, retval] Windows.Foundation.IAsyncOperation<boolean> **operation); + [overload("SwitchAsync")] HRESULT SwitchAsync([in] INT32 view_id, [out, retval] Windows.Foundation.IAsyncAction **operation); + [overload("SwitchAsync")] HRESULT SwitchFromViewAsync([in] INT32 to_view_id, [in] INT32 from_view_id, [out, retval] Windows.Foundation.IAsyncAction **operation); + [overload("SwitchAsync")] HRESULT SwitchFromViewWithOptionsAsync([in] INT32 to_view_id, [in] INT32 from_view_id, [in] Windows.UI.ViewManagement.ApplicationViewSwitchingOptions options, [out, retval] Windows.Foundation.IAsyncAction **operation); + HRESULT PrepareForCustomAnimatedSwitchAsync([in] INT32 to_view_id, [in] INT32 from_view_id, [in] Windows.UI.ViewManagement.ApplicationViewSwitchingOptions options, [out, retval] Windows.Foundation.IAsyncOperation<boolean> **operation); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.UI.ViewManagement.ApplicationViewSwitcher), + uuid(60e995cd-4fc2-48c4-b8e3-395f2b9f0fc1) + ] + interface IApplicationViewSwitcherStatics2 : IInspectable + { + HRESULT DisableSystemViewActivationPolicy(); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 4.0), + exclusiveto(Windows.UI.ViewManagement.ApplicationViewSwitcher), + uuid(92059420-80a7-486d-b21f-c7a4a242a383) + ] + interface IApplicationViewSwitcherStatics3 : IInspectable + { + [overload("TryShowAsViewModeAsync")] HRESULT TryShowAsViewModeAsync([in] INT32 view_id, [in] Windows.UI.ViewManagement.ApplicationViewMode mode, [out, retval] Windows.Foundation.IAsyncOperation<boolean> **operation); + [overload("TryShowAsViewModeAsync")] HRESULT TryShowAsViewModeWithPreferencesAsync([in] INT32 view_id, [in] Windows.UI.ViewManagement.ApplicationViewMode mode, [in] Windows.UI.ViewManagement.ViewModePreferences *preferences, [out, retval] Windows.Foundation.IAsyncOperation<boolean> **operation); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.UI.ViewManagement.ApplicationViewTitleBar), + uuid(00924ac0-932b-4a6b-9c4b-dc38c82478ce) + ] + interface IApplicationViewTitleBar : IInspectable + { + [propput] HRESULT ForegroundColor([in] Windows.Foundation.IReference<Windows.UI.Color> *value); + [propget] HRESULT ForegroundColor([out, retval] Windows.Foundation.IReference<Windows.UI.Color> **value); + [propput] HRESULT BackgroundColor([in] Windows.Foundation.IReference<Windows.UI.Color> *value); + [propget] HRESULT BackgroundColor([out, retval] Windows.Foundation.IReference<Windows.UI.Color> **value); + [propput] HRESULT ButtonForegroundColor([in] Windows.Foundation.IReference<Windows.UI.Color> *value); + [propget] HRESULT ButtonForegroundColor([out, retval] Windows.Foundation.IReference<Windows.UI.Color> **value); + [propput] HRESULT ButtonBackgroundColor([in] Windows.Foundation.IReference<Windows.UI.Color> *value); + [propget] HRESULT ButtonBackgroundColor([out, retval] Windows.Foundation.IReference<Windows.UI.Color> **value); + [propput] HRESULT ButtonHoverForegroundColor([in] Windows.Foundation.IReference<Windows.UI.Color> *value); + [propget] HRESULT ButtonHoverForegroundColor([out, retval] Windows.Foundation.IReference<Windows.UI.Color> **value); + [propput] HRESULT ButtonHoverBackgroundColor([in] Windows.Foundation.IReference<Windows.UI.Color> *value); + [propget] HRESULT ButtonHoverBackgroundColor([out, retval] Windows.Foundation.IReference<Windows.UI.Color> **value); + [propput] HRESULT ButtonPressedForegroundColor([in] Windows.Foundation.IReference<Windows.UI.Color> *value); + [propget] HRESULT ButtonPressedForegroundColor([out, retval] Windows.Foundation.IReference<Windows.UI.Color> **value); + [propput] HRESULT ButtonPressedBackgroundColor([in] Windows.Foundation.IReference<Windows.UI.Color> *value); + [propget] HRESULT ButtonPressedBackgroundColor([out, retval] Windows.Foundation.IReference<Windows.UI.Color> **value); + [propput] HRESULT InactiveForegroundColor([in] Windows.Foundation.IReference<Windows.UI.Color> *value); + [propget] HRESULT InactiveForegroundColor([out, retval] Windows.Foundation.IReference<Windows.UI.Color> **value); + [propput] HRESULT InactiveBackgroundColor([in] Windows.Foundation.IReference<Windows.UI.Color> *value); + [propget] HRESULT InactiveBackgroundColor([out, retval] Windows.Foundation.IReference<Windows.UI.Color> **value); + [propput] HRESULT ButtonInactiveForegroundColor([in] Windows.Foundation.IReference<Windows.UI.Color> *value); + [propget] HRESULT ButtonInactiveForegroundColor([out, retval] Windows.Foundation.IReference<Windows.UI.Color> **value); + [propput] HRESULT ButtonInactiveBackgroundColor([in] Windows.Foundation.IReference<Windows.UI.Color> *value); + [propget] HRESULT ButtonInactiveBackgroundColor([out, retval] Windows.Foundation.IReference<Windows.UI.Color> **value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 2.0), + exclusiveto(Windows.UI.ViewManagement.ApplicationViewTransferContext), + uuid(8574bc63-3c17-408e-9408-8a1a9ea81bfa) + ] + interface IApplicationViewTransferContext : IInspectable + { + [propget] HRESULT ViewId([out, retval] INT32 *value); + [propput] HRESULT ViewId([in] INT32 value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 2.0), + exclusiveto(Windows.UI.ViewManagement.ApplicationViewTransferContext), + uuid(15a89d92-dd79-4b0b-bc47-d5f195f14661) + ] + interface IApplicationViewTransferContextStatics : IInspectable + { + [propget] HRESULT DataPackageFormatId([out, retval] HSTRING *value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 8.0), + exclusiveto(Windows.UI.ViewManagement.ApplicationView), + uuid(bd55d512-9dc1-44fc-8501-666625df60dc) + ] + interface IApplicationViewWithContext : IInspectable + { + [propget] HRESULT UIContext([out, retval] Windows.UI.UIContext **value); + } + [ contract(Windows.Foundation.UniversalApiContract, 1.0), exclusiveto(Windows.UI.ViewManagement.UISettings), @@ -366,6 +811,101 @@ namespace Windows.UI.ViewManagement HRESULT GetForUIContext([in] Windows.UI.UIContext *context, [out, retval] Windows.UI.ViewManagement.InputPane **result); }
+ [ + contract(Windows.Foundation.UniversalApiContract, 4.0), + exclusiveto(Windows.UI.ViewManagement.ViewModePreferences), + uuid(878fcd3a-0b99-42c9-84d0-d3f1d403554b) + ] + interface IViewModePreferences : IInspectable + { + [propget] HRESULT ViewSizePreference([out, retval] Windows.UI.ViewManagement.ViewSizePreference *value); + [propput] HRESULT ViewSizePreference([in] Windows.UI.ViewManagement.ViewSizePreference value); + [propget] HRESULT CustomSize([out, retval] Windows.Foundation.Size *value); + [propput] HRESULT CustomSize([in] Windows.Foundation.Size value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 4.0), + exclusiveto(Windows.UI.ViewManagement.ViewModePreferences), + uuid(69b60a65-5de5-40d8-8306-3833df7a2274) + ] + interface IViewModePreferencesStatics : IInspectable + { + HRESULT CreateDefault([in] Windows.UI.ViewManagement.ApplicationViewMode mode, [out, retval] Windows.UI.ViewManagement.ViewModePreferences **result); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile), + static(Windows.UI.ViewManagement.IApplicationViewFullscreenStatics, Windows.Foundation.UniversalApiContract, 1.0), + static(Windows.UI.ViewManagement.IApplicationViewInteropStatics, Windows.Foundation.UniversalApiContract, 1.0), + static(Windows.UI.ViewManagement.IApplicationViewStatics, Windows.Foundation.UniversalApiContract, 1.0), + static(Windows.UI.ViewManagement.IApplicationViewStatics2, Windows.Foundation.UniversalApiContract, 1.0), + static(Windows.UI.ViewManagement.IApplicationViewStatics3, Windows.Foundation.UniversalApiContract, 1.0), + static(Windows.UI.ViewManagement.IApplicationViewStatics4, Windows.Foundation.UniversalApiContract, 8.0), + threading(both) + ] + runtimeclass ApplicationView + { + [contract(Windows.Foundation.UniversalApiContract, 1.0)] [default] interface Windows.UI.ViewManagement.IApplicationView; + [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.UI.ViewManagement.IApplicationView2; + [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.UI.ViewManagement.IApplicationView3; + [contract(Windows.Foundation.UniversalApiContract, 4.0)] interface Windows.UI.ViewManagement.IApplicationView4; + [contract(Windows.Foundation.UniversalApiContract, 8.0)] interface Windows.UI.ViewManagement.IApplicationView7; + [contract(Windows.Foundation.UniversalApiContract, 8.0)] interface Windows.UI.ViewManagement.IApplicationView9; + [contract(Windows.Foundation.UniversalApiContract, 8.0)] interface Windows.UI.ViewManagement.IApplicationViewWithContext; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile) + ] + runtimeclass ApplicationViewConsolidatedEventArgs + { + [default] interface Windows.UI.ViewManagement.IApplicationViewConsolidatedEventArgs; + [contract(Windows.Foundation.UniversalApiContract, 4.0)] interface Windows.UI.ViewManagement.IApplicationViewConsolidatedEventArgs2; + } + + [ + contract(Windows.UI.ViewManagement.ViewManagementViewScalingContract, 1.0), + static(Windows.UI.ViewManagement.IApplicationViewScalingStatics, Windows.UI.ViewManagement.ViewManagementViewScalingContract, 1.0) + ] + runtimeclass ApplicationViewScaling + { + [default] interface Windows.UI.ViewManagement.IApplicationViewScaling; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile), + static(Windows.UI.ViewManagement.IApplicationViewSwitcherStatics, Windows.Foundation.UniversalApiContract, 1.0), + static(Windows.UI.ViewManagement.IApplicationViewSwitcherStatics2, Windows.Foundation.UniversalApiContract, 1.0), + static(Windows.UI.ViewManagement.IApplicationViewSwitcherStatics3, Windows.Foundation.UniversalApiContract, 4.0), + threading(both) + ] + runtimeclass ApplicationViewSwitcher + { + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile) + ] + runtimeclass ApplicationViewTitleBar + { + [contract(Windows.Foundation.UniversalApiContract, 1.0), default] interface Windows.UI.ViewManagement.IApplicationViewTitleBar; + } + + [ + activatable(Windows.Foundation.UniversalApiContract, 2.0), + contract(Windows.Foundation.UniversalApiContract, 2.0), + static(Windows.UI.ViewManagement.IApplicationViewTransferContextStatics, Windows.Foundation.UniversalApiContract, 2.0) + ] + runtimeclass ApplicationViewTransferContext + { + [contract(Windows.Foundation.UniversalApiContract, 2.0), default] interface Windows.UI.ViewManagement.IApplicationViewTransferContext; + } + [ activatable(Windows.Foundation.UniversalApiContract, 1.0), contract(Windows.Foundation.UniversalApiContract, 1.0), @@ -439,4 +979,13 @@ namespace Windows.UI.ViewManagement { [default] interface Windows.UI.ViewManagement.IInputPaneVisibilityEventArgs; } + + [ + contract(Windows.Foundation.UniversalApiContract, 4.0), + static(Windows.UI.ViewManagement.IViewModePreferencesStatics, Windows.Foundation.UniversalApiContract, 4.0) + ] + runtimeclass ViewModePreferences + { + [contract(Windows.Foundation.UniversalApiContract, 4.0), default] interface Windows.UI.ViewManagement.IViewModePreferences; + } }
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/twinapi.appcore/classes.idl | 2 ++ dlls/windows.ui/classes.idl | 1 + include/windows.ui.viewmanagement.idl | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+)
diff --git a/dlls/twinapi.appcore/classes.idl b/dlls/twinapi.appcore/classes.idl index e846c523e9e..2abd79b8de5 100644 --- a/dlls/twinapi.appcore/classes.idl +++ b/dlls/twinapi.appcore/classes.idl @@ -29,9 +29,11 @@ import "windowscontracts.idl"; import "windows.foundation.idl"; import "windows.globalization.idl"; import "windows.storage.streams.idl"; +import "windows.ui.windowmanagement.idl";
#define DO_NO_IMPORTS #define _TWINAPI_APPCORE #include "windows.security.exchangeactivesyncprovisioning.idl" #include "windows.system.profile.idl" #include "windows.system.userprofile.idl" +#include "windows.ui.viewmanagement.idl" diff --git a/dlls/windows.ui/classes.idl b/dlls/windows.ui/classes.idl index f8c59c3169f..6c0e0991474 100644 --- a/dlls/windows.ui/classes.idl +++ b/dlls/windows.ui/classes.idl @@ -35,6 +35,7 @@ import "windows.ui.idl"; import "windows.devices.input.idl";
#define DO_NO_IMPORTS +#define _WINDOWS_UI #include "windows.ui.core.idl" #include "windows.ui.input.idl" #include "windows.ui.windowmanagement.idl" diff --git a/include/windows.ui.viewmanagement.idl b/include/windows.ui.viewmanagement.idl index e6dfb1659ce..d7fad9fe2b8 100644 --- a/include/windows.ui.viewmanagement.idl +++ b/include/windows.ui.viewmanagement.idl @@ -97,12 +97,16 @@ namespace Windows.UI.ViewManagement interface IInputPaneStatics; interface IInputPaneStatics2;
+#ifndef _WINDOWS_UI runtimeclass ApplicationView; +#endif runtimeclass ApplicationViewConsolidatedEventArgs; runtimeclass ApplicationViewScaling; +#ifndef _WINDOWS_UI runtimeclass ApplicationViewSwitcher; runtimeclass ApplicationViewTitleBar; runtimeclass ApplicationViewTransferContext; +#endif runtimeclass UISettings; runtimeclass UISettingsAnimationsEnabledChangedEventArgs; runtimeclass UISettingsAutoHideScrollBarsChangedEventArgs; @@ -113,8 +117,10 @@ namespace Windows.UI.ViewManagement runtimeclass ViewModePreferences;
declare { +#ifndef _WINDOWS_UI interface Windows.Foundation.TypedEventHandler<Windows.UI.ViewManagement.ApplicationView *, IInspectable *>; interface Windows.Foundation.TypedEventHandler<Windows.UI.ViewManagement.ApplicationView *, Windows.UI.ViewManagement.ApplicationViewConsolidatedEventArgs *>; +#endif 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 *>; @@ -303,6 +309,7 @@ namespace Windows.UI.ViewManagement Custom = 6, };
+#ifndef _WINDOWS_UI [ contract(Windows.Foundation.UniversalApiContract, 1.0), exclusiveto(Windows.UI.ViewManagement.ApplicationView), @@ -393,6 +400,7 @@ namespace Windows.UI.ViewManagement [propget] HRESULT WindowingEnvironment([out, retval] Windows.UI.WindowManagement.WindowingEnvironment **value); HRESULT GetDisplayRegions([out, retval] Windows.Foundation.Collections.IVectorView<Windows.UI.WindowManagement.DisplayRegion *> **result); } +#endif
[ contract(Windows.Foundation.UniversalApiContract, 1.0), @@ -414,6 +422,7 @@ namespace Windows.UI.ViewManagement [propget] HRESULT IsAppInitiated([out, retval] boolean *value); }
+#ifndef _WINDOWS_UI [ contract(Windows.Foundation.UniversalApiContract, 1.0), exclusiveto(Windows.UI.ViewManagement.ApplicationView), @@ -433,6 +442,7 @@ namespace Windows.UI.ViewManagement { HRESULT GetApplicationViewIdForWindow([in] Windows.UI.Core.ICoreWindow *window, [out, retval] INT32 *id); } +#endif
[ contract(Windows.UI.ViewManagement.ViewManagementViewScalingContract, 1.0), @@ -454,6 +464,7 @@ namespace Windows.UI.ViewManagement HRESULT TrySetDisableLayoutScaling([in] boolean disabled, [out, retval] boolean *success); }
+#ifndef _WINDOWS_UI [ contract(Windows.Foundation.UniversalApiContract, 1.0), exclusiveto(Windows.UI.ViewManagement.ApplicationView), @@ -602,6 +613,7 @@ namespace Windows.UI.ViewManagement { [propget] HRESULT UIContext([out, retval] Windows.UI.UIContext **value); } +#endif
[ contract(Windows.Foundation.UniversalApiContract, 1.0), @@ -834,6 +846,7 @@ namespace Windows.UI.ViewManagement HRESULT CreateDefault([in] Windows.UI.ViewManagement.ApplicationViewMode mode, [out, retval] Windows.UI.ViewManagement.ViewModePreferences **result); }
+#ifndef _WINDOWS_UI [ contract(Windows.Foundation.UniversalApiContract, 1.0), marshaling_behavior(agile), @@ -855,6 +868,7 @@ namespace Windows.UI.ViewManagement [contract(Windows.Foundation.UniversalApiContract, 8.0)] interface Windows.UI.ViewManagement.IApplicationView9; [contract(Windows.Foundation.UniversalApiContract, 8.0)] interface Windows.UI.ViewManagement.IApplicationViewWithContext; } +#endif
[ contract(Windows.Foundation.UniversalApiContract, 1.0), @@ -875,6 +889,7 @@ namespace Windows.UI.ViewManagement [default] interface Windows.UI.ViewManagement.IApplicationViewScaling; }
+#ifndef _WINDOWS_UI [ contract(Windows.Foundation.UniversalApiContract, 1.0), marshaling_behavior(agile), @@ -905,6 +920,7 @@ namespace Windows.UI.ViewManagement { [contract(Windows.Foundation.UniversalApiContract, 2.0), default] interface Windows.UI.ViewManagement.IApplicationViewTransferContext; } +#endif
[ activatable(Windows.Foundation.UniversalApiContract, 1.0), @@ -980,6 +996,7 @@ namespace Windows.UI.ViewManagement [default] interface Windows.UI.ViewManagement.IInputPaneVisibilityEventArgs; }
+#ifndef _WINDOWS_UI [ contract(Windows.Foundation.UniversalApiContract, 4.0), static(Windows.UI.ViewManagement.IViewModePreferencesStatics, Windows.Foundation.UniversalApiContract, 4.0) @@ -988,4 +1005,5 @@ namespace Windows.UI.ViewManagement { [contract(Windows.Foundation.UniversalApiContract, 4.0), default] interface Windows.UI.ViewManagement.IViewModePreferences; } +#endif }
From: Zhiyi Zhang zzhang@codeweavers.com
Windows.UI.ViewManagement.UIViewSettings should be registered to twinapi.appcore.dll instead of windows.ui.dll. --- include/windows.ui.viewmanagement.idl | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/include/windows.ui.viewmanagement.idl b/include/windows.ui.viewmanagement.idl index d7fad9fe2b8..0132e5f5091 100644 --- a/include/windows.ui.viewmanagement.idl +++ b/include/windows.ui.viewmanagement.idl @@ -964,6 +964,7 @@ namespace Windows.UI.ViewManagement [default] interface Windows.UI.ViewManagement.IUISettingsMessageDurationChangedEventArgs; }
+#ifndef _WINDOWS_UI [ static(Windows.UI.ViewManagement.IUIViewSettingsStatics, Windows.Foundation.UniversalApiContract, 1.0), contract(Windows.Foundation.UniversalApiContract, 1.0), @@ -973,6 +974,7 @@ namespace Windows.UI.ViewManagement { [default] interface Windows.UI.ViewManagement.IUIViewSettings; } +#endif
[ static(Windows.UI.ViewManagement.IInputPaneStatics, Windows.Foundation.UniversalApiContract, 1.0),
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/twinapi.appcore/tests/twinapi.c | 36 ++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+)
diff --git a/dlls/twinapi.appcore/tests/twinapi.c b/dlls/twinapi.appcore/tests/twinapi.c index e86281b895e..bd14e03bf6b 100644 --- a/dlls/twinapi.appcore/tests/twinapi.c +++ b/dlls/twinapi.appcore/tests/twinapi.c @@ -37,6 +37,8 @@ #include "windows.system.profile.h" #define WIDL_using_Windows_System_UserProfile #include "windows.system.userprofile.h" +#define WIDL_using_Windows_UI_ViewManagement +#include "windows.ui.viewmanagement.h"
#include "wine/test.h"
@@ -231,6 +233,39 @@ static void test_AdvertisingManager(void) ok( ref == 1, "got ref %ld.\n", ref ); }
+static void test_ApplicationView(void) +{ + static const WCHAR *class_name = RuntimeClass_Windows_UI_ViewManagement_ApplicationView; + IActivationFactory *factory; + HSTRING str; + HRESULT hr; + LONG ref; + + hr = WindowsCreateString( class_name, wcslen( class_name ), &str ); + ok( hr == S_OK, "got hr %#lx.\n", hr ); + + hr = RoGetActivationFactory( str, &IID_IActivationFactory, (void **)&factory ); + WindowsDeleteString( str ); + todo_wine + ok( hr == S_OK || broken( hr == REGDB_E_CLASSNOTREG ), "got hr %#lx.\n", hr ); + if (FAILED( hr )) + { + todo_wine + win_skip( "%s runtimeclass not registered, skipping tests.\n", wine_dbgstr_w( class_name ) ); + return; + } + + check_interface( factory, &IID_IUnknown, TRUE ); + check_interface( factory, &IID_IInspectable, TRUE ); + check_interface( factory, &IID_IAgileObject, TRUE ); + check_interface( factory, &IID_IActivationFactory, TRUE ); + check_interface( factory, &IID_IApplicationViewStatics, TRUE ); + check_interface( factory, &IID_IApplicationViewStatics2, TRUE ); + + ref = IActivationFactory_Release( factory ); + ok( ref == 1, "got ref %ld.\n", ref ); +} + START_TEST(twinapi) { HRESULT hr; @@ -241,6 +276,7 @@ START_TEST(twinapi) test_EasClientDeviceInformation(); test_AnalyticsVersionInfo(); test_AdvertisingManager(); + test_ApplicationView();
RoUninitialize(); }
From: Zhiyi Zhang zzhang@codeweavers.com
--- dlls/twinapi.appcore/Makefile.in | 1 + dlls/twinapi.appcore/application_view.c | 199 ++++++++++++++++++++++++ dlls/twinapi.appcore/main.c | 2 + dlls/twinapi.appcore/private.h | 5 +- dlls/twinapi.appcore/tests/twinapi.c | 2 - 5 files changed, 205 insertions(+), 4 deletions(-) create mode 100644 dlls/twinapi.appcore/application_view.c
diff --git a/dlls/twinapi.appcore/Makefile.in b/dlls/twinapi.appcore/Makefile.in index bdec3df54fa..a68379ff96b 100644 --- a/dlls/twinapi.appcore/Makefile.in +++ b/dlls/twinapi.appcore/Makefile.in @@ -5,6 +5,7 @@ IMPORTS = combase advapi32 SOURCES = \ advertising_manager.c \ analytics_info.c \ + application_view.c \ classes.idl \ client_device_information.c \ main.c diff --git a/dlls/twinapi.appcore/application_view.c b/dlls/twinapi.appcore/application_view.c new file mode 100644 index 00000000000..334f0dcded0 --- /dev/null +++ b/dlls/twinapi.appcore/application_view.c @@ -0,0 +1,199 @@ +/* WinRT Windows.UI.ViewManagement.ApplicationView implementation + * + * Copyright 2025 Zhiyi Zhang for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(twinapi); + +struct factory +{ + IActivationFactory IActivationFactory_iface; + IApplicationViewStatics IApplicationViewStatics_iface; + IApplicationViewStatics2 IApplicationViewStatics2_iface; + LONG ref; +}; + +static inline struct factory *impl_from_IActivationFactory(IActivationFactory *iface) +{ + return CONTAINING_RECORD(iface, struct factory, IActivationFactory_iface); +} + +static HRESULT WINAPI activation_factory_QueryInterface(IActivationFactory *iface, REFIID iid, + void **out) +{ + struct factory *impl = impl_from_IActivationFactory(iface); + + TRACE("iface %p, iid %s, out %p stub!\n", iface, debugstr_guid(iid), out); + + if (IsEqualGUID(iid, &IID_IUnknown) + || IsEqualGUID(iid, &IID_IInspectable) + || IsEqualGUID(iid, &IID_IAgileObject) + || IsEqualGUID(iid, &IID_IActivationFactory)) + { + IActivationFactory_AddRef(&impl->IActivationFactory_iface); + *out = &impl->IActivationFactory_iface; + return S_OK; + } + else if (IsEqualGUID(iid, &IID_IApplicationViewStatics)) + { + IApplicationViewStatics_AddRef(&impl->IApplicationViewStatics_iface); + *out = &impl->IApplicationViewStatics_iface; + return S_OK; + } + else if (IsEqualGUID(iid, &IID_IApplicationViewStatics2)) + { + IApplicationViewStatics2_AddRef(&impl->IApplicationViewStatics2_iface); + *out = &impl->IApplicationViewStatics2_iface; + return S_OK; + } + + FIXME("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI activation_factory_AddRef(IActivationFactory *iface) +{ + struct factory *impl = impl_from_IActivationFactory(iface); + ULONG ref = InterlockedIncrement(&impl->ref); + TRACE("iface %p, ref %lu.\n", iface, ref); + return ref; +} + +static ULONG WINAPI activation_factory_Release(IActivationFactory *iface) +{ + struct factory *impl = impl_from_IActivationFactory(iface); + ULONG ref = InterlockedDecrement(&impl->ref); + TRACE("iface %p, ref %lu.\n", iface, ref); + return ref; +} + +static HRESULT WINAPI activation_factory_GetIids(IActivationFactory *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 activation_factory_GetRuntimeClassName(IActivationFactory *iface, + HSTRING *class_name) +{ + FIXME("iface %p, class_name %p stub!\n", iface, class_name); + return E_NOTIMPL; +} + +static HRESULT WINAPI activation_factory_GetTrustLevel(IActivationFactory *iface, + TrustLevel *trust_level) +{ + FIXME("iface %p, trust_level %p stub!\n", iface, trust_level); + return E_NOTIMPL; +} + +static HRESULT WINAPI activation_factory_ActivateInstance(IActivationFactory *iface, + IInspectable **instance) +{ + FIXME("iface %p, instance %p stub!\n", iface, instance); + return E_NOTIMPL; +} + +static const struct IActivationFactoryVtbl activation_factory_vtbl = +{ + activation_factory_QueryInterface, + activation_factory_AddRef, + activation_factory_Release, + /* IInspectable methods */ + activation_factory_GetIids, + activation_factory_GetRuntimeClassName, + activation_factory_GetTrustLevel, + /* IActivationFactory methods */ + activation_factory_ActivateInstance, +}; + +DEFINE_IINSPECTABLE(statics, IApplicationViewStatics, struct factory, IActivationFactory_iface) + +static HRESULT WINAPI statics_Value(IApplicationViewStatics *iface, ApplicationViewState *value) +{ + FIXME("iface %p, value %p stub!\n", iface, value); + return E_NOTIMPL; +} + +static HRESULT WINAPI statics_TryUnsnap(IApplicationViewStatics *iface, boolean *success) +{ + FIXME("iface %p, success %p stub!\n", iface, success); + return E_NOTIMPL; +} + +static const struct IApplicationViewStaticsVtbl statics_vtbl = +{ + statics_QueryInterface, + statics_AddRef, + statics_Release, + /* IInspectable methods */ + statics_GetIids, + statics_GetRuntimeClassName, + statics_GetTrustLevel, + /* IApplicationViewStatics methods */ + statics_Value, + statics_TryUnsnap, +}; + +DEFINE_IINSPECTABLE(statics2, IApplicationViewStatics2, struct factory, IActivationFactory_iface) + +static HRESULT WINAPI statics2_GetForCurrentView(IApplicationViewStatics2 *iface, IApplicationView **current) +{ + FIXME("iface %p, current %p stub!\n", iface, current); + return E_NOTIMPL; +} + +static HRESULT WINAPI statics2_get_TerminateAppOnFinalViewClose(IApplicationViewStatics2 *iface, boolean *value) +{ + FIXME("iface %p, value %p stub!\n", iface, value); + return E_NOTIMPL; +} + +static HRESULT WINAPI statics2_put_TerminateAppOnFinalViewClose(IApplicationViewStatics2 *iface, boolean value) +{ + FIXME("iface %p, value %d stub!\n", iface, value); + return E_NOTIMPL; +} + +static const struct IApplicationViewStatics2Vtbl statics2_vtbl = +{ + statics2_QueryInterface, + statics2_AddRef, + statics2_Release, + /* IInspectable methods */ + statics2_GetIids, + statics2_GetRuntimeClassName, + statics2_GetTrustLevel, + /* IApplicationViewStatics2 methods */ + statics2_GetForCurrentView, + statics2_get_TerminateAppOnFinalViewClose, + statics2_put_TerminateAppOnFinalViewClose +}; + +static struct factory factory = +{ + {&activation_factory_vtbl}, + {&statics_vtbl}, + {&statics2_vtbl}, + 1, +}; + +IActivationFactory *application_view_factory = &factory.IActivationFactory_iface; diff --git a/dlls/twinapi.appcore/main.c b/dlls/twinapi.appcore/main.c index 5d97963af19..eab55d33e1a 100644 --- a/dlls/twinapi.appcore/main.c +++ b/dlls/twinapi.appcore/main.c @@ -75,6 +75,8 @@ HRESULT WINAPI DllGetActivationFactory( HSTRING classid, IActivationFactory **fa IActivationFactory_QueryInterface( analytics_info_factory, &IID_IActivationFactory, (void **)factory ); else if (!wcscmp( buffer, RuntimeClass_Windows_System_UserProfile_AdvertisingManager )) IActivationFactory_QueryInterface( advertising_manager_factory, &IID_IActivationFactory, (void **)factory ); + else if (!wcscmp( buffer, RuntimeClass_Windows_UI_ViewManagement_ApplicationView )) + IActivationFactory_QueryInterface( application_view_factory, &IID_IActivationFactory, (void **)factory );
if (*factory) return S_OK; return CLASS_E_CLASSNOTAVAILABLE; diff --git a/dlls/twinapi.appcore/private.h b/dlls/twinapi.appcore/private.h index 7063962e2b4..bb62d7f6332 100644 --- a/dlls/twinapi.appcore/private.h +++ b/dlls/twinapi.appcore/private.h @@ -36,11 +36,12 @@ #include "windows.system.profile.h" #define WIDL_using_Windows_System_UserProfile #include "windows.system.userprofile.h" +#define WIDL_using_Windows_UI_ViewManagement +#include "windows.ui.viewmanagement.h"
#include "wine/debug.h"
-#include "wine/debug.h" - +extern IActivationFactory *application_view_factory; extern IActivationFactory *client_device_information_factory; extern IActivationFactory *analytics_info_factory; extern IActivationFactory *advertising_manager_factory; diff --git a/dlls/twinapi.appcore/tests/twinapi.c b/dlls/twinapi.appcore/tests/twinapi.c index bd14e03bf6b..35c33fb96fa 100644 --- a/dlls/twinapi.appcore/tests/twinapi.c +++ b/dlls/twinapi.appcore/tests/twinapi.c @@ -246,11 +246,9 @@ static void test_ApplicationView(void)
hr = RoGetActivationFactory( str, &IID_IActivationFactory, (void **)&factory ); WindowsDeleteString( str ); - todo_wine ok( hr == S_OK || broken( hr == REGDB_E_CLASSNOTREG ), "got hr %#lx.\n", hr ); if (FAILED( hr )) { - todo_wine win_skip( "%s runtimeclass not registered, skipping tests.\n", wine_dbgstr_w( class_name ) ); return; }