Signed-off-by: Bernhard Kölbl besentv@gmail.com --- v2: Added missing parameters and attributes. This and more incoming patches are part of a bigger branch: https://github.com/besentv/wine-patches/tree/main/windows.media.speech --- include/windows.foundation.collections.idl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
diff --git a/include/windows.foundation.collections.idl b/include/windows.foundation.collections.idl index 876e15336a2..a2d2d75ec4f 100644 --- a/include/windows.foundation.collections.idl +++ b/include/windows.foundation.collections.idl @@ -118,6 +118,26 @@ cpp_quote("#endif") HRESULT IndexOf([in, optional] T element, [out] UINT32 *index, [out, retval] BOOLEAN *value); HRESULT GetMany([in] UINT32 start_index, [in] UINT32 items_size, [out] T *items, [out, retval] UINT32 *value); } + + [ + contract(Windows.Foundation.FoundationContract, 1.0), + uuid(913337e9-11a1-4345-a3a2-4e7f956e222d) + ] + interface IVector<T> : IInspectable + { + HRESULT GetAt([in, optional] UINT32 index, [out, retval] T *value); + [propget] HRESULT Size([out, retval] UINT32 *value); + HRESULT GetView([out, retval] IVectorView<T> **value); + HRESULT IndexOf([in, optional] T element, [out] UINT32 *index, [out, retval] BOOLEAN *value); + HRESULT SetAt([in] UINT32 index, [in, optional] T value); + HRESULT InsertAt([in] UINT32 index, [in, optional] T value); + HRESULT RemoveAt([in] UINT32 index); + HRESULT Append([in, optional] T value); + HRESULT RemoveAtEnd(); + HRESULT Clear(); + HRESULT GetMany([in] UINT32 start_index, [in] UINT32 items_size, [out] T *items, [out, retval] UINT32 *value); + HRESULT ReplaceAll([in] UINT32 count, [in] T *items); + } } #endif }
Signed-off-by: Bernhard Kölbl besentv@gmail.com --- v2: Add missing required interface. --- include/windows.foundation.idl | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
diff --git a/include/windows.foundation.idl b/include/windows.foundation.idl index 292522f2c49..a4ee7303ddb 100644 --- a/include/windows.foundation.idl +++ b/include/windows.foundation.idl @@ -27,6 +27,12 @@ import "windowscontracts.idl"; /* import "ivectorchangedeventargs.idl"; */ import "windows.foundation.collections.idl";
+namespace Windows { + namespace Foundation { + interface IAsyncAction; + } +} + namespace Windows { namespace Foundation { typedef enum PropertyType PropertyType; @@ -36,6 +42,12 @@ namespace Windows { typedef struct DateTime DateTime; typedef struct TimeSpan TimeSpan;
+ [ + contract(Windows.Foundation.FoundationContract, 1.0), + uuid(a4ed5c81-76c9-40bd-8be6-b1d90fb20ae7) + ] + delegate HRESULT AsyncActionCompletedHandler([in] Windows.Foundation.IAsyncAction *action, [in] AsyncStatus status); + [contract(Windows.Foundation.FoundationContract, 1.0)] enum PropertyType { Empty = 0, @@ -128,6 +140,18 @@ namespace Windows { { HRESULT Close(); } + + [ + contract(Windows.Foundation.FoundationContract, 1.0), + uuid(5a648006-843a-4da9-865b-9d26e5dfad7b) + ] + interface IAsyncAction : IInspectable + requires IAsyncInfo + { + [propput] HRESULT Completed([in] Windows.Foundation.AsyncActionCompletedHandler *handler); + [propget] HRESULT Completed([out, retval] Windows.Foundation.AsyncActionCompletedHandler **handler); + HRESULT GetResults(); + } } }
Signed-off-by: Bernhard Kölbl besentv@gmail.com --- Required for other idl files. --- include/windows.foundation.idl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/include/windows.foundation.idl b/include/windows.foundation.idl index a4ee7303ddb..400e8661b04 100644 --- a/include/windows.foundation.idl +++ b/include/windows.foundation.idl @@ -158,9 +158,13 @@ namespace Windows { namespace Windows { namespace Foundation { declare { + interface Windows.Foundation.Collections.IIterable<HSTRING>; + interface Windows.Foundation.Collections.IIterator<HSTRING>; + interface Windows.Foundation.Collections.IVectorView<HSTRING>; + interface Windows.Foundation.Collections.IVector<HSTRING>; + interface Windows.Foundation.Collections.IMapView<HSTRING, Windows.Foundation.Collections.IVectorView<HSTRING>*>; interface Windows.Foundation.AsyncOperationCompletedHandler<boolean>; interface Windows.Foundation.IAsyncOperation<boolean>; - interface Windows.Foundation.Collections.IVectorView<HSTRING>; } } -} +} \ No newline at end of file
Signed-off-by: Bernhard Kölbl besentv@gmail.com --- v2: Fully work out the previous stubs. --- include/windows.globalization.idl | 132 ++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+)
diff --git a/include/windows.globalization.idl b/include/windows.globalization.idl index c08f7bd27d9..03c44703b7e 100644 --- a/include/windows.globalization.idl +++ b/include/windows.globalization.idl @@ -29,9 +29,31 @@ import "windows.foundation.idl"; namespace Windows { namespace Globalization { typedef enum DayOfWeek DayOfWeek; + typedef enum LanguageLayoutDirection LanguageLayoutDirection; + interface ILanguage; + interface ILanguage2; + interface ILanguage3; + interface ILanguageExtensionSubtags; + interface ILanguageFactory; + interface ILanguageStatics; + interface ILanguageStatics2; + interface ILanguageStatics3; + runtimeclass Language; } }
+namespace Windows { + namespace Globalization { + declare{ + interface Windows.Foundation.Collections.IIterable<Windows.Globalization.Language*>; + interface Windows.Foundation.Collections.IIterator<Windows.Globalization.Language*>; + interface Windows.Foundation.Collections.IVectorView<Windows.Globalization.Language*>; + interface Windows.Foundation.Collections.IVector<Windows.Globalization.Language*>; + } + } +} + + namespace Windows { namespace Globalization { [contract(Windows.Foundation.UniversalApiContract, 1.0)] @@ -45,5 +67,115 @@ namespace Windows { Friday = 5, Saturday = 6 }; + + [contract(Windows.Foundation.UniversalApiContract, 6.0)] + enum LanguageLayoutDirection + { + Ltr = 0, + Rtl = 1, + TtbLtr = 2, + TtbRtl = 3, + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Globalization.Language), + uuid(ea79a752-f7c2-4265-b1bd-c4dec4e4f080) + ] + interface ILanguage : IInspectable + { + [propget] HRESULT LanguageTag([out, retval] HSTRING *value); + [propget] HRESULT DisplayName([out, retval] HSTRING *value); + [propget] HRESULT NativeName([out, retval] HSTRING *value); + [propget] HRESULT Script([out, retval] HSTRING *value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 6.0), + exclusiveto(Windows.Globalization.Language), + uuid(6a47e5b5-d94d-4886-a404-a5a5b9d5b494) + ] + interface ILanguage2 : IInspectable + { + [propget] HRESULT LayoutDirection([out, retval] Windows.Globalization.LanguageLayoutDirection *value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 10.0), + exclusiveto(Windows.Globalization.Language), + uuid(c6af3d10-641a-5ba4-bb43-5e12aed75954) + ] + interface ILanguage3 : IInspectable + { + [propget] HRESULT AbbreviatedName([out, retval] HSTRING *value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Globalization.Language), + uuid(7d7daf45-368d-4364-852b-dec927037b85) + ] + interface ILanguageExtensionSubtags : IInspectable + { + HRESULT GetExtensionSubtags([in] HSTRING tag, [out, retval] Windows.Foundation.Collections.IVectorView<HSTRING> **value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Globalization.Language), + uuid(9b0252ac-0c27-44f8-b792-9793fb66c63e) + ] + interface ILanguageFactory : IInspectable + { + HRESULT CreateLanguage([in] HSTRING tag, [out, retval] Windows.Globalization.Language **value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Globalization.Language), + uuid(b23cd557-0865-46d4-89b8-d59be8990f0d) + ] + interface ILanguageStatics : IInspectable + { + HRESULT IsWellFormed([in] HSTRING tag, [out, retval] BOOLEAN *result); + [propget] HRESULT CurrentInputMethodLanguageTag([out, retval] HSTRING *value); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + exclusiveto(Windows.Globalization.Language), + uuid(30199f6e-914b-4b2a-9d6e-e3b0e27dbe4f) + ] + interface ILanguageStatics2 : IInspectable + { + HRESULT TrySetInputMethodLanguageTag([in] HSTRING tag, [out, retval] BOOLEAN *result); + } + + [ + contract(Windows.Foundation.UniversalApiContract, 10.0), + exclusiveto(Windows.Globalization.Language), + uuid(d15ecb5a-71de-5752-9542-fac5b4f27261) + ] + interface ILanguageStatics3 : IInspectable + { + HRESULT GetMuiCompatibleLanguageListFromLanguageTags([in] Windows.Foundation.Collections.IIterable<HSTRING> *tags, [out, retval] Windows.Foundation.Collections.IVector<HSTRING> **result); + } + + [ + activatable(Windows.Globalization.ILanguageFactory, Windows.Foundation.UniversalApiContract, 1.0), + contract(Windows.Foundation.UniversalApiContract, 1.0), + marshaling_behavior(agile), + static(Windows.Globalization.ILanguageStatics, Windows.Foundation.UniversalApiContract, 1.0), + static(Windows.Globalization.ILanguageStatics2, Windows.Foundation.UniversalApiContract, 1.0), + static(Windows.Globalization.ILanguageStatics3, Windows.Foundation.UniversalApiContract, 10.0), + threading(both) + ] + runtimeclass Language + { + [contract(Windows.Foundation.UniversalApiContract, 1.0), default] interface Windows.Globalization.ILanguage; + [contract(Windows.Foundation.UniversalApiContract, 1.0)] interface Windows.Globalization.ILanguageExtensionSubtags; + [contract(Windows.Foundation.UniversalApiContract, 6.0)] interface Windows.Globalization.ILanguage2; + [contract(Windows.Foundation.UniversalApiContract, 10.0)] interface Windows.Globalization.ILanguage3; + } } }
And add ISpeechRecognitionConstraint together with it's dependencies.
Signed-off-by: Bernhard Kölbl besentv@gmail.com --- v2: Only add ISpeechRecognitionConstraint + dependencies. --- include/Makefile.in | 1 + include/windows.media.speechrecognition.idl | 88 +++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 include/windows.media.speechrecognition.idl
diff --git a/include/Makefile.in b/include/Makefile.in index 7fcf5f0ba7b..613c0bd0b37 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -783,6 +783,7 @@ SOURCES = \ windows.h \ windows.media.devices.idl \ windows.media.idl \ + windows.media.speechrecognition.idl \ windows.media.speechsynthesis.idl \ windows.storage.streams.idl \ windows.system.idl \ diff --git a/include/windows.media.speechrecognition.idl b/include/windows.media.speechrecognition.idl new file mode 100644 index 00000000000..65c9d5ef8da --- /dev/null +++ b/include/windows.media.speechrecognition.idl @@ -0,0 +1,88 @@ +/* + * Copyright 2022 Bernhard Kölbl + * + * 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.globalization.idl"; +/*import "windows.phone.idl";*/ +/*import "windows.storage.idl";*/ + +namespace Windows { + namespace Media { + namespace SpeechRecognition { + typedef enum SpeechRecognitionConstraintProbability SpeechRecognitionConstraintProbability; + typedef enum SpeechRecognitionConstraintType SpeechRecognitionConstraintType; + interface ISpeechRecognitionConstraint; + } + } +} + +namespace Windows { + namespace Media { + namespace SpeechRecognition { + declare { + } + } + } +} + +namespace Windows { + namespace Media { + namespace SpeechRecognition { + + [contract(Windows.Foundation.UniversalApiContract, 1.0)] + enum SpeechRecognitionConstraintProbability + { + Default = 0, + Min = 1, + Max = 2, + }; + + [contract(Windows.Foundation.UniversalApiContract, 1.0)] + enum SpeechRecognitionConstraintType + { + Topic = 0, + List = 1, + Grammar = 2, + VoiceCommandDefinition = 3, + }; + + [ + contract(Windows.Foundation.UniversalApiContract, 1.0), + uuid(79ac1628-4d68-43c4-8911-40dc4101b55b) + ] + interface ISpeechRecognitionConstraint : IInspectable + { + [propget] HRESULT IsEnabled([out, retval] boolean *value); + [propput] HRESULT IsEnabled([in] boolean value); + [propget] HRESULT Tag([out, retval] HSTRING *value); + [propput] HRESULT Tag([in] HSTRING value); + [propget] HRESULT Type([out, retval] Windows.Media.SpeechRecognition.SpeechRecognitionConstraintType *value); + [propget] HRESULT Probability([out, retval] Windows.Media.SpeechRecognition.SpeechRecognitionConstraintProbability *value); + [propput] HRESULT Probability([in] Windows.Media.SpeechRecognition.SpeechRecognitionConstraintProbability value); + } + } + } +}
Sorry for missing those, I wanted to help reviewing the speech work and then completely forgot about them.
I'll try to keep an eye on the next ones (or feel free to assign them to me).