Needed for mingw Firefox build.
It looks like CoreDispatcher was added as a forward declaration for `ICompositionObject`: https://searchfox.org/mozilla-central/source/taskcluster/scripts/misc/mingw-...
However, just having `interface ICoreDispatcher;` alone does not generate the IUnknown methods. I don't know if commenting out the functions is acceptable.
From: Mohamad Al-Jaf mohamadaljaf@gmail.com
Needed for mingw Firefox build. --- include/Makefile.in | 1 + include/windows.ui.core.idl | 68 +++++++++++++++++++++++++++ include/windows.ui.viewmanagement.idl | 2 +- 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 include/windows.ui.core.idl
diff --git a/include/Makefile.in b/include/Makefile.in index 9bde0bcceb0..f0c0da3ed93 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -836,6 +836,7 @@ SOURCES = \ windows.system.profile.systemmanufacturers.idl \ windows.system.threading.idl \ windows.system.userprofile.idl \ + windows.ui.core.idl \ windows.ui.idl \ windows.ui.viewmanagement.idl \ windowscontracts.idl \ diff --git a/include/windows.ui.core.idl b/include/windows.ui.core.idl new file mode 100644 index 00000000000..945b689576d --- /dev/null +++ b/include/windows.ui.core.idl @@ -0,0 +1,68 @@ +/* + * Copyright (C) 2023 Mohamad Al-Jaf + * + * 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 + +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"; */ +/* import "windows.ui.input.idl"; */ +/* import "windows.ui.input.inking.idl"; */ +/* import "windows.ui.input.inking.core.idl"; */ +/* import "windows.ui.popups.idl"; */ + +namespace Windows.UI.Core { + interface ICoreAcceleratorKeys; + interface ICoreDispatcher; + + runtimeclass CoreDispatcher; + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.UI.Core.CoreDispatcher), + uuid(60db2fa8-b705-4fde-a7d6-ebbb1891d39e) + ] + interface ICoreDispatcher : IInspectable + requires Windows.UI.Core.ICoreAcceleratorKeys + { + /* [propget] HRESULT HasThreadAccess([out, retval] boolean *value); */ + /* HRESULT ProcessEvents([in] Windows.UI.Core.CoreProcessEventsOption options); */ + /* HRESULT RunAsync([in] Windows.UI.Core.CoreDispatcherPriority priority, [in] Windows.UI.Core.DispatchedHandler *callback, + [out, retval] Windows.Foundation.IAsyncAction **action); */ + /* HRESULT RunIdleAsync([in] Windows.UI.Core.IdleDispatchedHandler *callback, [out, retval] Windows.Foundation.IAsyncAction **action); */ + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile) + ] + runtimeclass CoreDispatcher + { + [default] interface Windows.UI.Core.ICoreDispatcher; + interface Windows.UI.Core.ICoreAcceleratorKeys; + [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.UI.Core.ICoreDispatcherWithTaskPriority; + [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.UI.Core.ICoreDispatcher2; + } +} diff --git a/include/windows.ui.viewmanagement.idl b/include/windows.ui.viewmanagement.idl index dcfa83aa74d..b98d34ff685 100644 --- a/include/windows.ui.viewmanagement.idl +++ b/include/windows.ui.viewmanagement.idl @@ -28,7 +28,7 @@ import "windows.foundation.idl"; import "windows.devices.enumeration.idl"; /* import "windows.phone.idl"; */ import "windows.ui.idl"; -/* import "windows.ui.core.idl"; */ +import "windows.ui.core.idl"; /* import "windows.ui.popups.idl"; */ /* import "windows.ui.windowmanagement.idl"; */
I think it's best not to comment methods. They may be used to generate UUIDs, as part of the interface signature. If we need to add more types for that, so be it.
In this case it doesn't seem to bad, with just a couple of enums, delegates and a runtimeclass to add.