From: Ignacy Kuchciński ignacykuchcinski@gmail.com
--- dlls/windows.ui/Makefile.in | 3 + dlls/windows.ui/main.c | 9 + dlls/windows.ui/private.h | 5 + dlls/windows.ui/radialcontroller.c | 179 ++++++++++++++++++ .../radialcontrollerconfiguration.c | 179 ++++++++++++++++++ dlls/windows.ui/radialcontrollermenuitem.c | 143 ++++++++++++++ 6 files changed, 518 insertions(+) create mode 100644 dlls/windows.ui/radialcontroller.c create mode 100644 dlls/windows.ui/radialcontrollerconfiguration.c create mode 100644 dlls/windows.ui/radialcontrollermenuitem.c
diff --git a/dlls/windows.ui/Makefile.in b/dlls/windows.ui/Makefile.in index e88a40188b1..efd4871f434 100644 --- a/dlls/windows.ui/Makefile.in +++ b/dlls/windows.ui/Makefile.in @@ -5,6 +5,9 @@ SOURCES = \ classes.idl \ inputpane.c \ main.c \ + radialcontroller.c \ + radialcontrollerconfiguration.c \ + radialcontrollermenuitem.c \ uisettings.c \ uiviewsettings.c \ weakref.c diff --git a/dlls/windows.ui/main.c b/dlls/windows.ui/main.c index 87b8f87561a..d61c1a7e1d6 100644 --- a/dlls/windows.ui/main.c +++ b/dlls/windows.ui/main.c @@ -38,6 +38,15 @@ HRESULT WINAPI DllGetActivationFactory( HSTRING classid, IActivationFactory **fa
*factory = NULL;
+ if (!wcscmp( buffer, RuntimeClass_Windows_UI_Input_RadialController )) + IActivationFactory_QueryInterface( radialcontroller_factory, &IID_IActivationFactory, (void **)factory ); + + if (!wcscmp( buffer, RuntimeClass_Windows_UI_Input_RadialControllerConfiguration )) + IActivationFactory_QueryInterface( radialcontrollerconfiguration_factory, &IID_IActivationFactory, (void **)factory ); + + if (!wcscmp( buffer, RuntimeClass_Windows_UI_Input_RadialControllerMenuItem )) + IActivationFactory_QueryInterface( radialcontrollermenuitem_factory, &IID_IActivationFactory, (void **)factory ); + if (!wcscmp( buffer, RuntimeClass_Windows_UI_ViewManagement_UISettings )) IActivationFactory_QueryInterface( uisettings_factory, &IID_IActivationFactory, (void **)factory );
diff --git a/dlls/windows.ui/private.h b/dlls/windows.ui/private.h index 6e611e5d5d3..e11cfc40523 100644 --- a/dlls/windows.ui/private.h +++ b/dlls/windows.ui/private.h @@ -33,9 +33,14 @@ #include "windows.foundation.h" #define WIDL_using_Windows_UI #include "windows.ui.h" +#define WIDL_using_Windows_UI_Input +#include "windows.ui.input.h" #define WIDL_using_Windows_UI_ViewManagement #include "windows.ui.viewmanagement.h"
+extern IActivationFactory *radialcontroller_factory; +extern IActivationFactory *radialcontrollerconfiguration_factory; +extern IActivationFactory *radialcontrollermenuitem_factory; extern IActivationFactory *uisettings_factory; extern IActivationFactory *uiviewsettings_factory; extern IActivationFactory *inputpane_factory; diff --git a/dlls/windows.ui/radialcontroller.c b/dlls/windows.ui/radialcontroller.c new file mode 100644 index 00000000000..d7ed09f44cf --- /dev/null +++ b/dlls/windows.ui/radialcontroller.c @@ -0,0 +1,179 @@ +/* WinRT Windows.UI Implementation + * + * Copyright (C) 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 + */ + +#include "private.h" +#include "initguid.h" +#include "radialcontrollerinterop.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(ui); + +struct radialcontroller_statics +{ + IActivationFactory IActivationFactory_iface; + IRadialControllerInterop IRadialControllerInterop_iface; + IRadialControllerStatics IRadialControllerStatics_iface; + LONG ref; +}; + +static inline struct radialcontroller_statics *impl_from_IActivationFactory( IActivationFactory *iface ) +{ + return CONTAINING_RECORD( iface, struct radialcontroller_statics, IActivationFactory_iface ); +} + +static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID iid, void **out ) +{ + struct radialcontroller_statics *impl = impl_from_IActivationFactory( iface ); + + TRACE( "iface %p, iid %s, out %p.\n", iface, debugstr_guid( iid ), out ); + + if (IsEqualGUID( iid, &IID_IUnknown ) || + IsEqualGUID( iid, &IID_IInspectable ) || + IsEqualGUID( iid, &IID_IActivationFactory )) + { + *out = &impl->IActivationFactory_iface; + IInspectable_AddRef( *out ); + return S_OK; + } + else if (IsEqualGUID( iid, &IID_IRadialControllerInterop)) + { + *out = &impl->IRadialControllerInterop_iface; + IInspectable_AddRef( *out ); + return S_OK; + } + else if (IsEqualGUID( iid, &IID_IRadialControllerStatics )) + { + *out = &impl->IRadialControllerStatics_iface; + IInspectable_AddRef( *out ); + return S_OK; + } + + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI factory_AddRef( IActivationFactory *iface ) +{ + struct radialcontroller_statics *impl = impl_from_IActivationFactory( iface ); + ULONG ref = InterlockedIncrement( &impl->ref ); + TRACE( "iface %p, ref %lu.\n", iface, ref ); + return ref; +} + +static ULONG WINAPI factory_Release( IActivationFactory *iface ) +{ + struct radialcontroller_statics *impl = impl_from_IActivationFactory( iface ); + ULONG ref = InterlockedDecrement( &impl->ref ); + TRACE( "iface %p, ref %lu.\n", iface, ref ); + return ref; +} + +static HRESULT WINAPI 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 factory_GetRuntimeClassName( IActivationFactory *iface, HSTRING *class_name ) +{ + FIXME( "iface %p, class_name %p stub!\n", iface, class_name ); + return E_NOTIMPL; +} + +static HRESULT WINAPI factory_GetTrustLevel( IActivationFactory *iface, TrustLevel *trust_level ) +{ + FIXME( "iface %p, trust_name %p stub!\n", iface, trust_level ); + return E_NOTIMPL; +} + +static HRESULT WINAPI factory_ActivateInstance( IActivationFactory *iface, IInspectable **instance ) +{ + FIXME( "iface %p, instance %p stub!\n", iface, instance ); + return E_NOTIMPL; +} + +static const struct IActivationFactoryVtbl factory_vtbl = +{ + factory_QueryInterface, + factory_AddRef, + factory_Release, + + /* IInspectable methods */ + factory_GetIids, + factory_GetRuntimeClassName, + factory_GetTrustLevel, + + /* IActivationFactory methods */ + factory_ActivateInstance, +}; + +DEFINE_IINSPECTABLE( radialcontroller_interop, IRadialControllerInterop, struct radialcontroller_statics, IActivationFactory_iface ); + +static HRESULT WINAPI radialcontroller_interop_GetForWindow( IRadialControllerInterop *iface, HWND window, REFIID riid, void **radialcontroller ) +{ + struct radialcontroller_statics *impl = impl_from_IRadialControllerInterop ( iface ); + + TRACE( "(window %p, riid %s, radialcontroller %p)\n", window, debugstr_guid( riid ), radialcontroller ); + + factory_ActivateInstance( &impl->IActivationFactory_iface, (IInspectable **)radialcontroller ); + return S_OK; +} + +static const struct IRadialControllerInteropVtbl radialcontroller_interop_vtbl = +{ + radialcontroller_interop_QueryInterface, + radialcontroller_interop_AddRef, + radialcontroller_interop_Release, + + /* IInspectable methods */ + radialcontroller_interop_GetIids, + radialcontroller_interop_GetRuntimeClassName, + radialcontroller_interop_GetTrustLevel, + + /* IRadialControllerInterop methods */ + radialcontroller_interop_GetForWindow, +}; + +DEFINE_IINSPECTABLE( radialcontroller_statics, IRadialControllerStatics, struct radialcontroller_statics, IActivationFactory_iface ); + +static const struct IRadialControllerStaticsVtbl radialcontroller_statics_vtbl = +{ + radialcontroller_statics_QueryInterface, + radialcontroller_statics_AddRef, + radialcontroller_statics_Release, + + /* IInspectable methods */ + radialcontroller_statics_GetIids, + radialcontroller_statics_GetRuntimeClassName, + radialcontroller_statics_GetTrustLevel, + + /* IRadialControllerStatics methods */ +}; + +static struct radialcontroller_statics radialcontroller_statics = +{ + {&factory_vtbl}, + {&radialcontroller_interop_vtbl}, + {&radialcontroller_statics_vtbl}, + 1, +}; + +IActivationFactory *radialcontroller_factory = &radialcontroller_statics.IActivationFactory_iface; diff --git a/dlls/windows.ui/radialcontrollerconfiguration.c b/dlls/windows.ui/radialcontrollerconfiguration.c new file mode 100644 index 00000000000..1f0342bed11 --- /dev/null +++ b/dlls/windows.ui/radialcontrollerconfiguration.c @@ -0,0 +1,179 @@ +/* WinRT Windows.UI Implementation + * + * Copyright (C) 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 + */ + +#include "private.h" +#include "initguid.h" +#include "radialcontrollerconfigurationinterop.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(ui); + +struct radialcontrollerconfiguration_statics +{ + IActivationFactory IActivationFactory_iface; + IRadialControllerConfigurationInterop IRadialControllerConfigurationInterop_iface; + IRadialControllerConfigurationStatics IRadialControllerConfigurationStatics_iface; + LONG ref; +}; + +static inline struct radialcontrollerconfiguration_statics *impl_from_IActivationFactory( IActivationFactory *iface ) +{ + return CONTAINING_RECORD( iface, struct radialcontrollerconfiguration_statics, IActivationFactory_iface ); +} + +static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID iid, void **out ) +{ + struct radialcontrollerconfiguration_statics *impl = impl_from_IActivationFactory( iface ); + + TRACE( "iface %p, iid %s, out %p.\n", iface, debugstr_guid( iid ), out ); + + if (IsEqualGUID( iid, &IID_IUnknown ) || + IsEqualGUID( iid, &IID_IInspectable ) || + IsEqualGUID( iid, &IID_IActivationFactory )) + { + *out = &impl->IActivationFactory_iface; + IInspectable_AddRef( *out ); + return S_OK; + } + else if (IsEqualGUID( iid, &IID_IRadialControllerConfigurationInterop )) + { + *out = &impl->IRadialControllerConfigurationInterop_iface; + IInspectable_AddRef( *out ); + return S_OK; + } + else if (IsEqualGUID( iid, &IID_IRadialControllerConfigurationStatics )) + { + *out = &impl->IRadialControllerConfigurationStatics_iface; + IInspectable_AddRef( *out ); + return S_OK; + } + + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI factory_AddRef( IActivationFactory *iface ) +{ + struct radialcontrollerconfiguration_statics *impl = impl_from_IActivationFactory( iface ); + ULONG ref = InterlockedIncrement( &impl->ref ); + TRACE( "iface %p, ref %lu.\n", iface, ref ); + return ref; +} + +static ULONG WINAPI factory_Release( IActivationFactory *iface ) +{ + struct radialcontrollerconfiguration_statics *impl = impl_from_IActivationFactory( iface ); + ULONG ref = InterlockedDecrement( &impl->ref ); + TRACE( "iface %p, ref %lu.\n", iface, ref ); + return ref; +} + +static HRESULT WINAPI 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 factory_GetRuntimeClassName( IActivationFactory *iface, HSTRING *class_name ) +{ + FIXME( "iface %p, class_name %p stub!\n", iface, class_name ); + return E_NOTIMPL; +} + +static HRESULT WINAPI factory_GetTrustLevel( IActivationFactory *iface, TrustLevel *trust_level ) +{ + FIXME( "iface %p, trust_name %p stub!\n", iface, trust_level ); + return E_NOTIMPL; +} + +static HRESULT WINAPI factory_ActivateInstance( IActivationFactory *iface, IInspectable **instance ) +{ + FIXME( "iface %p, instance %p.\n", iface, instance ); + return E_NOTIMPL; +} + +static const struct IActivationFactoryVtbl factory_vtbl = +{ + factory_QueryInterface, + factory_AddRef, + factory_Release, + + /* IInspectable methods */ + factory_GetIids, + factory_GetRuntimeClassName, + factory_GetTrustLevel, + + /* IActivationFactory methods */ + factory_ActivateInstance, +}; + +DEFINE_IINSPECTABLE( radialcontrollerconfiguration_interop, IRadialControllerConfigurationInterop, struct radialcontrollerconfiguration_statics, IActivationFactory_iface ); + +static HRESULT WINAPI radialcontrollerconfiguration_interop_GetForWindow( IRadialControllerConfigurationInterop *iface, HWND window, REFIID riid, void **radialcontrollerconfiguration ) +{ + struct radialcontrollerconfiguration_statics *impl = impl_from_IRadialControllerConfigurationInterop ( iface ); + + TRACE( "(window %p, riid %s, radialcontrollerconfiguration %p)\n", window, debugstr_guid( riid ), radialcontrollerconfiguration ); + + factory_ActivateInstance( &impl->IActivationFactory_iface, (IInspectable **)radialcontrollerconfiguration ); + return S_OK; +} + +static const struct IRadialControllerConfigurationInteropVtbl radialcontrollerconfiguration_interop_vtbl = +{ + radialcontrollerconfiguration_interop_QueryInterface, + radialcontrollerconfiguration_interop_AddRef, + radialcontrollerconfiguration_interop_Release, + + /* IInspectable methods */ + radialcontrollerconfiguration_interop_GetIids, + radialcontrollerconfiguration_interop_GetRuntimeClassName, + radialcontrollerconfiguration_interop_GetTrustLevel, + + /* IRadialControllerConfigurationInterop methods */ + radialcontrollerconfiguration_interop_GetForWindow, +}; + +DEFINE_IINSPECTABLE( radialcontrollerconfiguration_statics, IRadialControllerConfigurationStatics, struct radialcontrollerconfiguration_statics, IActivationFactory_iface ); + +static const struct IRadialControllerConfigurationStaticsVtbl radialcontrollerconfiguration_statics_vtbl = +{ + radialcontrollerconfiguration_statics_QueryInterface, + radialcontrollerconfiguration_statics_AddRef, + radialcontrollerconfiguration_statics_Release, + + /* IInspectable methods */ + radialcontrollerconfiguration_statics_GetIids, + radialcontrollerconfiguration_statics_GetRuntimeClassName, + radialcontrollerconfiguration_statics_GetTrustLevel, + + /* IRadialControllerConfigurationStatics methods */ +}; + +static struct radialcontrollerconfiguration_statics radialcontrollerconfiguration_statics = +{ + {&factory_vtbl}, + {&radialcontrollerconfiguration_interop_vtbl}, + {&radialcontrollerconfiguration_statics_vtbl}, + 1, +}; + +IActivationFactory *radialcontrollerconfiguration_factory = &radialcontrollerconfiguration_statics.IActivationFactory_iface; diff --git a/dlls/windows.ui/radialcontrollermenuitem.c b/dlls/windows.ui/radialcontrollermenuitem.c new file mode 100644 index 00000000000..f679f975f54 --- /dev/null +++ b/dlls/windows.ui/radialcontrollermenuitem.c @@ -0,0 +1,143 @@ +/* WinRT Windows.UI Implementation + * + * Copyright (C) 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 + */ + +#include "private.h" +#include "initguid.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(ui); + +struct radialcontrollermenuitem_statics +{ + IActivationFactory IActivationFactory_iface; + IRadialControllerMenuItemStatics IRadialControllerMenuItemStatics_iface; + LONG ref; +}; + +static inline struct radialcontrollermenuitem_statics *impl_from_IActivationFactory( IActivationFactory *iface ) +{ + return CONTAINING_RECORD( iface, struct radialcontrollermenuitem_statics, IActivationFactory_iface ); +} + +static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID iid, void **out ) +{ + struct radialcontrollermenuitem_statics *impl = impl_from_IActivationFactory( iface ); + + TRACE( "iface %p, iid %s, out %p.\n", iface, debugstr_guid( iid ), out ); + + if (IsEqualGUID( iid, &IID_IUnknown ) || + IsEqualGUID( iid, &IID_IInspectable ) || + IsEqualGUID( iid, &IID_IActivationFactory )) + { + *out = &impl->IActivationFactory_iface; + IInspectable_AddRef( *out ); + return S_OK; + } + else if (IsEqualGUID( iid, &IID_IRadialControllerMenuItemStatics )) + { + *out = &impl->IRadialControllerMenuItemStatics_iface; + IInspectable_AddRef( *out ); + return S_OK; + } + + FIXME( "%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid( iid ) ); + *out = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI factory_AddRef( IActivationFactory *iface ) +{ + struct radialcontrollermenuitem_statics *impl = impl_from_IActivationFactory( iface ); + ULONG ref = InterlockedIncrement( &impl->ref ); + TRACE( "iface %p, ref %lu.\n", iface, ref ); + return ref; +} + +static ULONG WINAPI factory_Release( IActivationFactory *iface ) +{ + struct radialcontrollermenuitem_statics *impl = impl_from_IActivationFactory( iface ); + ULONG ref = InterlockedDecrement( &impl->ref ); + TRACE( "iface %p, ref %lu.\n", iface, ref ); + return ref; +} + +static HRESULT WINAPI 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 factory_GetRuntimeClassName( IActivationFactory *iface, HSTRING *class_name ) +{ + FIXME( "iface %p, class_name %p stub!\n", iface, class_name ); + return E_NOTIMPL; +} + +static HRESULT WINAPI factory_GetTrustLevel( IActivationFactory *iface, TrustLevel *trust_level ) +{ + FIXME( "iface %p, trust_name %p stub!\n", iface, trust_level ); + return E_NOTIMPL; +} + +static HRESULT WINAPI factory_ActivateInstance( IActivationFactory *iface, IInspectable **instance ) +{ + FIXME( "iface %p, instance %p stub!\n", iface, instance ); + return E_NOTIMPL; +} + +static const struct IActivationFactoryVtbl factory_vtbl = +{ + factory_QueryInterface, + factory_AddRef, + factory_Release, + + /* IInspectable methods */ + factory_GetIids, + factory_GetRuntimeClassName, + factory_GetTrustLevel, + + /* IActivationFactory methods */ + factory_ActivateInstance, +}; + +DEFINE_IINSPECTABLE( radialcontrollermenuitem_statics, IRadialControllerMenuItemStatics, struct radialcontrollermenuitem_statics, IActivationFactory_iface ); + +static const struct IRadialControllerMenuItemStaticsVtbl radialcontrollermenuitem_statics_vtbl = +{ + radialcontrollermenuitem_statics_QueryInterface, + radialcontrollermenuitem_statics_AddRef, + radialcontrollermenuitem_statics_Release, + + /* IInspectable methods */ + radialcontrollermenuitem_statics_GetIids, + radialcontrollermenuitem_statics_GetRuntimeClassName, + radialcontrollermenuitem_statics_GetTrustLevel, + + /* IRadialControllerMenuItemStatics methods */ +}; + +static struct radialcontrollermenuitem_statics radialcontrollermenuitem_statics = +{ + {&factory_vtbl}, + {&radialcontrollermenuitem_statics_vtbl}, + 1, +}; + +IActivationFactory *radialcontrollermenuitem_factory = &radialcontrollermenuitem_statics.IActivationFactory_iface;