From: Ignacy Kuchciński <ignacykuchcinski@gmail.com> --- include/Makefile.in | 1 + include/radialcontrollerinterop.idl | 39 ++++ include/windows.ui.input.idl | 333 +++++++++++++++++++++++++++- 3 files changed, 372 insertions(+), 1 deletion(-) create mode 100644 include/radialcontrollerinterop.idl diff --git a/include/Makefile.in b/include/Makefile.in index db9578e8baa..2cc2f720fe6 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -814,6 +814,7 @@ SOURCES = \ pstore.idl \ qedit.idl \ qos2.h \ + radialcontrollerinterop.idl \ ras.h \ rasdlg.h \ raserror.h \ diff --git a/include/radialcontrollerinterop.idl b/include/radialcontrollerinterop.idl new file mode 100644 index 00000000000..de54b5ec095 --- /dev/null +++ b/include/radialcontrollerinterop.idl @@ -0,0 +1,39 @@ +/* + * Copyright 2025 Ignacy Kuchciński + * + * 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 + */ + +import "inspectable.idl"; + +[ + uuid(1b0535c9-57ad-45c1-9d79-ad5c34360513), + object, + local +] +interface IRadialControllerInterop : IInspectable +{ + HRESULT CreateForWindow([in, annotation("__in")] HWND window, [in, annotation("__in")] REFIID riid, [out, retval, iid_is(riid), annotation("__com_outptr")] void **radialcontroller); +} + +[ + uuid(787cdaac-3186-476d-87e4-b9374a7b9970), + object, + local +] +interface IRadialControllerConfigurationInterop : IInspectable +{ + HRESULT GetForWindow([in, annotation("__in")] HWND window, [in, annotation("__in")] REFIID riid, [out, retval, iid_is(riid), annotation("__com_outptr")] void **radialcontrollerconfiguration); +} diff --git a/include/windows.ui.input.idl b/include/windows.ui.input.idl index f396a3ce8a7..2ecd9ef748b 100644 --- a/include/windows.ui.input.idl +++ b/include/windows.ui.input.idl @@ -27,10 +27,11 @@ import "windowscontracts.idl"; import "windows.foundation.idl"; import "windows.devices.input.idl"; import "windows.system.idl"; -import "windows.ui.core.idl"; namespace Windows.UI.Input { typedef enum PointerUpdateKind PointerUpdateKind; + typedef enum RadialControllerMenuKnownIcon RadialControllerMenuKnownIcon; + typedef enum RadialControllerSystemMenuItemKind RadialControllerSystemMenuItemKind; interface IPointerPoint; interface IPointerPointProperties; @@ -38,12 +39,49 @@ namespace Windows.UI.Input { interface IPointerPointStatics; interface IPointerPointTransform; + interface IRadialController; + interface IRadialControllerButtonClickedEventArgs; + interface IRadialControllerConfiguration; + interface IRadialControllerConfigurationStatics; + interface IRadialControllerControlAcquiredEventArgs; + interface IRadialControllerMenu; + interface IRadialControllerMenuItem; + interface IRadialControllerMenuItemStatics; + interface IRadialControllerRotationChangedEventArgs; + interface IRadialControllerScreenContact; + interface IRadialControllerScreenContactContinuedEventArgs; + interface IRadialControllerScreenContactStartedEventArgs; + interface IRadialControllerStatics; + runtimeclass PointerPoint; runtimeclass PointerPointProperties; + runtimeclass RadialController; + runtimeclass RadialControllerButtonClickedEventArgs; + runtimeclass RadialControllerConfiguration; + runtimeclass RadialControllerControlAcquiredEventArgs; + runtimeclass RadialControllerMenu; + runtimeclass RadialControllerMenuItem; + runtimeclass RadialControllerRotationChangedEventArgs; + runtimeclass RadialControllerScreenContact; + runtimeclass RadialControllerScreenContactContinuedEventArgs; + runtimeclass RadialControllerScreenContactStartedEventArgs; + declare { + interface Windows.Foundation.Collections.IIterable<Windows.UI.Input.RadialControllerSystemMenuItemKind>; + interface Windows.Foundation.Collections.IIterator<Windows.UI.Input.RadialControllerSystemMenuItemKind>; interface Windows.Foundation.Collections.IVectorView<Windows.UI.Input.PointerPoint *>; + interface Windows.Foundation.Collections.IVectorView<Windows.UI.Input.RadialControllerMenuItem *>; interface Windows.Foundation.Collections.IVector<Windows.UI.Input.PointerPoint *>; + interface Windows.Foundation.Collections.IVector<Windows.UI.Input.RadialControllerMenuItem *>; + interface Windows.Foundation.TypedEventHandler<Windows.UI.Input.RadialController *, Windows.UI.Input.RadialControllerScreenContactStartedEventArgs *>; + interface Windows.Foundation.TypedEventHandler<Windows.UI.Input.RadialController *, IInspectable *>; + interface Windows.Foundation.TypedEventHandler<Windows.UI.Input.RadialController *, Windows.UI.Input.RadialControllerScreenContactContinuedEventArgs *>; + interface Windows.Foundation.TypedEventHandler<Windows.UI.Input.RadialController *, IInspectable *>; + interface Windows.Foundation.TypedEventHandler<Windows.UI.Input.RadialController *, Windows.UI.Input.RadialControllerRotationChangedEventArgs *>; + interface Windows.Foundation.TypedEventHandler<Windows.UI.Input.RadialController *, Windows.UI.Input.RadialControllerButtonClickedEventArgs *>; + interface Windows.Foundation.TypedEventHandler<Windows.UI.Input.RadialController *, Windows.UI.Input.RadialControllerControlAcquiredEventArgs *>; + interface Windows.Foundation.TypedEventHandler<Windows.UI.Input.RadialControllerMenuItem *, IInspectable *>; } [ @@ -64,6 +102,34 @@ namespace Windows.UI.Input { XButton2Released = 10 }; + [ + contract(Windows.Foundation.UniversalApiContract, 3.0) + ] + enum RadialControllerMenuKnownIcon + { + Scroll = 0, + Zoom = 1, + UndoRedo = 2, + Volume = 3, + NextPreviousTrack = 4, + Ruler = 5, + InkColor = 6, + InkThickness = 7, + PenType = 8 + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 3.0) + ] + enum RadialControllerSystemMenuItemKind + { + Scroll = 0, + Zoom = 1, + UndoRedo = 2, + Volume = 3, + NextPreviousTrack = 4 + }; + [ contract(Windows.Foundation.UniversalApiContract, 1.0), exclusiveto(Windows.UI.Input.PointerPoint), @@ -148,6 +214,169 @@ namespace Windows.UI.Input { HRESULT TransformBounds([in] Windows.Foundation.Rect rect, [out, retval] Windows.Foundation.Rect *value); } + [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + exclusiveto(Windows.UI.Input.RadialController), + uuid(3055D1C8-DF51-43D4-B23B-0E1037467A09) + ] + interface IRadialController : IInspectable + { + [propget] HRESULT Menu([out] [retval] Windows.UI.Input.RadialControllerMenu **value); + [propget] HRESULT RotationResolutionInDegrees([out] [retval] DOUBLE *value); + [propput] HRESULT RotationResolutionInDegrees([in] DOUBLE value); + [propget] HRESULT UseAutomaticHapticFeedback([out] [retval] boolean *value); + [propput] HRESULT UseAutomaticHapticFeedback([in] boolean value); + [eventadd] HRESULT ScreenContactStarted([in] Windows.Foundation.TypedEventHandler<Windows.UI.Input.RadialController *, Windows.UI.Input.RadialControllerScreenContactStartedEventArgs *> *handler, [out] [retval] EventRegistrationToken *cookie); + [eventremove] HRESULT ScreenContactStarted([in] EventRegistrationToken cookie); + [eventadd] HRESULT ScreenContactEnded([in] Windows.Foundation.TypedEventHandler<Windows.UI.Input.RadialController *, IInspectable *> *handler, [out] [retval] EventRegistrationToken *cookie); + [eventremove] HRESULT ScreenContactEnded([in] EventRegistrationToken cookie); + [eventadd] HRESULT ScreenContactContinued([in] Windows.Foundation.TypedEventHandler<Windows.UI.Input.RadialController *, Windows.UI.Input.RadialControllerScreenContactContinuedEventArgs *> *handler, [out] [retval] EventRegistrationToken *cookie); + [eventremove] HRESULT ScreenContactContinued([in] EventRegistrationToken cookie); + [eventadd] HRESULT ControlLost([in] Windows.Foundation.TypedEventHandler<Windows.UI.Input.RadialController *, IInspectable *> *handler, [out] [retval] EventRegistrationToken *cookie); + [eventremove] HRESULT ControlLost([in] EventRegistrationToken cookie); + [eventadd] HRESULT RotationChanged([in] Windows.Foundation.TypedEventHandler<Windows.UI.Input.RadialController *, Windows.UI.Input.RadialControllerRotationChangedEventArgs *> *handler, [out] [retval] EventRegistrationToken *token); + [eventremove] HRESULT RotationChanged([in] EventRegistrationToken token); + [eventadd] HRESULT ButtonClicked([in] Windows.Foundation.TypedEventHandler<Windows.UI.Input.RadialController *, Windows.UI.Input.RadialControllerButtonClickedEventArgs *> *handler, [out] [retval] EventRegistrationToken *token); + [eventremove] HRESULT ButtonClicked([in] EventRegistrationToken token); + [eventadd] HRESULT ControlAcquired([in] Windows.Foundation.TypedEventHandler<Windows.UI.Input.RadialController *, Windows.UI.Input.RadialControllerControlAcquiredEventArgs *> *handler, [out] [retval] EventRegistrationToken *cookie); + [eventremove] HRESULT ControlAcquired([in] EventRegistrationToken cookie); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + exclusiveto(Windows.UI.Input.RadialControllerButtonClickedEventArgs), + uuid(206aa438-e651-11e5-bf62-2c27d7404e85) + ] + interface IRadialControllerButtonClickedEventArgs : IInspectable + { + [propget] HRESULT Contact([out] [retval] Windows.UI.Input.RadialControllerScreenContact **value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + exclusiveto(Windows.UI.Input.RadialControllerConfiguration), + uuid(a6b79ecb-6a52-4430-910c-56370a9d6b42) + ] + interface IRadialControllerConfiguration : IInspectable + { + HRESULT SetDefaultMenuItems([in] Windows.Foundation.Collections.IIterable<Windows.UI.Input.RadialControllerSystemMenuItemKind> *buttons); + HRESULT ResetToDefaultMenuItems(); + HRESULT TrySelectDefaultMenuItem([in] Windows.UI.Input.RadialControllerSystemMenuItemKind type, [out] [retval] boolean *result); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + exclusiveto(Windows.UI.Input.RadialControllerConfiguration), + uuid(79b6b0e5-069a-4486-a99d-8db772b9642f) + ] + interface IRadialControllerConfigurationStatics : IInspectable + { + HRESULT GetForCurrentView([out, retval] Windows.UI.Input.RadialControllerConfiguration **configuration); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + exclusiveto(Windows.UI.Input.RadialControllerControlAcquiredEventArgs), + uuid(206aa439-e651-11e5-bf62-2c27d7404e85) + ] + interface IRadialControllerControlAcquiredEventArgs : IInspectable + { + [propget] HRESULT Contact([out] [retval] Windows.UI.Input.RadialControllerScreenContact **value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + exclusiveto(Windows.UI.Input.RadialControllerMenu), + uuid(8506b35d-f640-4412-aba0-bad077e5ea8a) + ] + interface IRadialControllerMenu : IInspectable + { + [propget] HRESULT Items([out] [retval] Windows.Foundation.Collections.IVector<Windows.UI.Input.RadialControllerMenuItem *> **value); + [propget] HRESULT IsEnabled([out] [retval] boolean *value); + [propput] HRESULT IsEnabled([in] boolean value); + HRESULT GetSelectedMenuItem([out] [retval] Windows.UI.Input.RadialControllerMenuItem **result); + HRESULT SelectMenuItem([in] Windows.UI.Input.RadialControllerMenuItem *menuItem); + HRESULT TrySelectPreviouslySelectedMenuItem([out] [retval] boolean *result); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + exclusiveto(Windows.UI.Input.RadialControllerMenuItem), + uuid(c80fc98d-ad0b-4c9c-8f2f-136a2373a6ba) + ] + interface IRadialControllerMenuItem : IInspectable + { + [propget] HRESULT DisplayText([out] [retval] HSTRING *value); + [propget] HRESULT Tag([out] [retval] IInspectable **value); + [propput] HRESULT Tag([in] IInspectable *value); + [eventadd] HRESULT Invoked([in] Windows.Foundation.TypedEventHandler<Windows.UI.Input.RadialControllerMenuItem *, IInspectable *> *handler, [out] [retval] EventRegistrationToken *token); + [eventremove] HRESULT Invoked([in] EventRegistrationToken token); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + exclusiveto(Windows.UI.Input.RadialControllerMenuItem), + uuid(249e0887-d842-4524-9df8-e0d647edc887) + ] + interface IRadialControllerMenuItemStatics : IInspectable + { + HRESULT CreateFromIcon([in] HSTRING display_text, [in] Windows.Storage.Streams.RandomAccessStreamReference *icon, [out, retval] Windows.UI.Input.RadialControllerMenuItem **result); + HRESULT CreateFromKnownIcon([in] HSTRING display_text, [in] Windows.UI.Input.RadialControllerMenuKnownIcon value, [out, retval] Windows.UI.Input.RadialControllerMenuItem **result); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + exclusiveto(Windows.UI.Input.RadialControllerRotationChangedEventArgs), + uuid(206aa435-e651-11e5-bf62-2c27d7404e85) + ] + interface IRadialControllerRotationChangedEventArgs : IInspectable + { + [propget] HRESULT RotationDeltaInDegrees([out] [retval] DOUBLE *value); + [propget] HRESULT Contact([out] [retval] Windows.UI.Input.RadialControllerScreenContact **value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + exclusiveto(Windows.UI.Input.RadialControllerScreenContact), + uuid(206aa434-e651-11e5-bf62-2c27d7404e85) + ] + interface IRadialControllerScreenContact : IInspectable + { + [propget] HRESULT Bounds([out] [retval] Windows.Foundation.Rect *value); + [propget] HRESULT Position([out] [retval] Windows.Foundation.Point *value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + exclusiveto(Windows.UI.Input.RadialControllerScreenContactContinuedEventArgs), + uuid(206aa437-e651-11e5-bf62-2c27d7404e85) + ] + interface IRadialControllerScreenContactContinuedEventArgs : IInspectable + { + [propget] HRESULT Contact([out] [retval] Windows.UI.Input.RadialControllerScreenContact **value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + exclusiveto(Windows.UI.Input.RadialControllerScreenContactStartedEventArgs), + uuid(206aa436-e651-11e5-bf62-2c27d7404e85) + ] + interface IRadialControllerScreenContactStartedEventArgs : IInspectable + { + [propget] HRESULT Contact([out] [retval] Windows.UI.Input.RadialControllerScreenContact **value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + exclusiveto(Windows.UI.Input.RadialController), + uuid(faded0b7-b84c-4894-87aa-8f25aa5f288b) + ] + interface IRadialControllerStatics : IInspectable + { + HRESULT IsSupported([out, retval] boolean *result); + HRESULT CreateForCurrentView([out, retval] Windows.UI.Input.RadialController **result); + } + [ contract(Windows.Foundation.UniversalApiContract, 1.0), marshaling_behavior(none), @@ -167,4 +396,106 @@ namespace Windows.UI.Input { [default] interface Windows.UI.Input.IPointerPointProperties; [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.UI.Input.IPointerPointProperties2; } + + [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + marshaling_behavior(agile), + static(Windows.UI.Input.IRadialControllerStatics, Windows.Foundation.UniversalApiContract, 3.0) + ] + runtimeclass RadialController + { + [default] interface Windows.UI.Input.IRadialController; + /* [contract(Windows.Foundation.UniversalApiContract, 4.0)] interface Windows.UI.Input.IRadialController2; */ + } + + [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + marshaling_behavior(agile) + ] + runtimeclass RadialControllerButtonClickedEventArgs + { + [default] interface Windows.UI.Input.IRadialControllerButtonClickedEventArgs; + /* [contract(Windows.Foundation.UniversalApiContract, 4.0)] interface Windows.UI.Input.IRadialControllerButtonClickedEventArgs2; */ + } + + [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + marshaling_behavior(agile), + static(Windows.UI.Input.IRadialControllerConfigurationStatics, Windows.Foundation.UniversalApiContract, 3.0), + /* static(Windows.UI.Input.IRadialControllerConfigurationStatics2, Windows.Foundation.UniversalApiContract, 5.0) */ + ] + runtimeclass RadialControllerConfiguration + { + [default] interface Windows.UI.Input.IRadialControllerConfiguration; + /* [contract(Windows.Foundation.UniversalApiContract, 4.0)] interface Windows.UI.Input.IRadialControllerConfiguration2; */ + } + + [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + marshaling_behavior(agile) + ] + runtimeclass RadialControllerControlAcquiredEventArgs + { + [default] interface Windows.UI.Input.IRadialControllerControlAcquiredEventArgs; + /* [contract(Windows.Foundation.UniversalApiContract, 4.0)] interface Windows.UI.Input.IRadialControllerControlAcquiredEventArgs2; */ + } + + [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + marshaling_behavior(agile) + ] + runtimeclass RadialControllerMenu + { + [default] interface Windows.UI.Input.IRadialControllerMenu; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + marshaling_behavior(agile), + static(Windows.UI.Input.IRadialControllerMenuItemStatics, Windows.Foundation.UniversalApiContract, 3.0), + /* static(Windows.UI.Input.IRadialControllerMenuItemStatics2, Windows.Foundation.UniversalApiContract, 4.0) */ + ] + runtimeclass RadialControllerMenuItem + { + [default] interface Windows.UI.Input.IRadialControllerMenuItem; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + marshaling_behavior(agile) + ] + runtimeclass RadialControllerRotationChangedEventArgs + { + [default] interface Windows.UI.Input.IRadialControllerRotationChangedEventArgs; + /* [contract(Windows.Foundation.UniversalApiContract, 4.0)] interface Windows.UI.Input.IRadialControllerRotationChangedEventArgs2; */ + } + + [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + marshaling_behavior(agile) + ] + runtimeclass RadialControllerScreenContact + { + [default] interface Windows.UI.Input.IRadialControllerScreenContact; + } + + [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + marshaling_behavior(agile) + ] + runtimeclass RadialControllerScreenContactContinuedEventArgs + { + [default] interface Windows.UI.Input.IRadialControllerScreenContactContinuedEventArgs; + /* [contract(Windows.Foundation.UniversalApiContract, 4.0)] interface Windows.UI.Input.IRadialControllerScreenContactContinuedEventArgs2; */ + } + + [ + contract(Windows.Foundation.UniversalApiContract, 3.0), + marshaling_behavior(agile) + ] + runtimeclass RadialControllerScreenContactStartedEventArgs + { + [default] interface Windows.UI.Input.IRadialControllerScreenContactStartedEventArgs; + /* [contract(Windows.Foundation.UniversalApiContract, 4.0)] interface Windows.UI.Input.IRadialControllerScreenContactStartedEventArgs2; */ + } } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/8394