[PATCH 5/5] widl: Support WinRT runtimeclass type parsing.

Zebediah Figura (she/her) zfigura at codeweavers.com
Tue Jan 19 11:51:34 CST 2021


On 1/19/21 11:39 AM, Rémi Bernon wrote:
> On 1/19/21 6:32 PM, Zebediah Figura (she/her) wrote:
>>
>>
>> On 1/19/21 7:04 AM, Rémi Bernon wrote:
>>> Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
>>> ---
>>>   include/windows.media.speechsynthesis.idl |  25 ++
>>>   tools/widl/expr.c                         |   1 +
>>>   tools/widl/header.c                       |  61 ++++-
>>>   tools/widl/parser.l                       |   1 +
>>>   tools/widl/parser.y                       | 269 +++++++++++++---------
>>>   tools/widl/typegen.c                      |   4 +
>>>   tools/widl/typelib.c                      |   1 +
>>>   tools/widl/typetree.c                     |  17 ++
>>>   tools/widl/typetree.h                     |  24 ++
>>>   tools/widl/widltypes.h                    |   7 +
>>>   10 files changed, 296 insertions(+), 114 deletions(-)
>>>
>>> diff --git a/include/windows.media.speechsynthesis.idl
>>> b/include/windows.media.speechsynthesis.idl
>>> index 7a1de5fcba6..90bc9f279c6 100644
>>> --- a/include/windows.media.speechsynthesis.idl
>>> +++ b/include/windows.media.speechsynthesis.idl
>>> @@ -29,6 +29,8 @@ namespace Windows {
>>>               typedef enum VoiceGender VoiceGender;
>>>               interface IInstalledVoicesStatic;
>>>               interface IVoiceInformation;
>>> +            runtimeclass VoiceInformation;
>>> +            runtimeclass SpeechSynthesizer;
>>>           }
>>>       }
>>>   }
>>> @@ -42,6 +44,29 @@ namespace Windows {
>>>                   Male   = 0,
>>>                   Female = 1
>>>               };
>>> +
>>> +            [
>>> +                contract(Windows.Foundation.UniversalApiContract, 1.0),
>>> +               
>>> exclusiveto(Windows.Media.SpeechSynthesis.VoiceInformation),
>>> +                uuid(b127d6a4-1291-4604-aa9c-83134083352c)
>>> +            ]
>>> +            interface IVoiceInformation : IInspectable
>>> +            {
>>> +                [propget] HRESULT DisplayName([out] [retval]
>>> HSTRING* value);
>>> +                [propget] HRESULT Id([out] [retval] HSTRING* value);
>>> +                [propget] HRESULT Language([out] [retval] HSTRING*
>>> value);
>>> +                [propget] HRESULT Description([out] [retval]
>>> HSTRING* value);
>>> +                [propget] HRESULT Gender([out] [retval] VoiceGender*
>>> value);
>>> +            }
>>> +
>>> +            [
>>> +                contract(Windows.Foundation.UniversalApiContract, 1.0),
>>> +                marshaling_behavior(agile)
>>> +            ]
>>> +            runtimeclass VoiceInformation
>>> +            {
>>> +                [default] interface IVoiceInformation;
>>> +            }
>>>           }
>>>       }
>>>   }
>>
>> Does this need to be part of this patch?
>>
> Not necessarily part of it, do you mean move it to a separate patch?
> 
> It's there to illustrate the new features the widl changes enable, and
> make sure widl can parse and generate a proper header. Also it makes it
> possible to diff the generated headers on every widl change.
> 
> With that in mind I agree that it'd perhaps be better to move the new
> attributes parsing support after runtimeclass can be parsed, adding them
> to the idl iteratively, but I didn't want to add the runtimeclass
> without the attributes it's supposed to have.

I guess it seems to me that the IDL would demonstrate it just as well in
a separate patch. Granted, it's nitpicking anyway.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20210119/434f83b2/attachment.sig>


More information about the wine-devel mailing list