[PATCH 1/5] include: Add windows.foundation.metadata.idl.

Rémi Bernon rbernon at codeweavers.com
Wed Apr 20 08:32:28 CDT 2022


Hi Zhiyi,

On 4/20/22 09:04, Zhiyi Zhang wrote:
> +namespace Windows
> +{
> +    namespace Foundation
> +    {
> +        apicontract FoundationContract;
> +    }
> +}
> +
> +namespace Windows
> +{
> +    namespace Foundation
> +    {
> +        namespace Metadata
> +        {
> +            typedef enum GCPressureAmount GCPressureAmount;
> +
> +            interface IApiInformationStatics;
> +
> +            runtimeclass ApiInformation;
> +        }
> +    }
> +}
> +
> +namespace Windows
> +{
> +    namespace Foundation
> +    {
> +        namespace Metadata
> +        {
> +            [
> +                contract(Windows.Foundation.FoundationContract, 1.0)
> +            ]
> +            enum GCPressureAmount
> +            {
> +                Low    = 0,
> +                Medium = 1,
> +                High   = 2
> +            };
> +
> +            [
> +                contract(Windows.Foundation.FoundationContract, 1.0),
> +                exclusiveto(Windows.Foundation.Metadata.ApiInformation),
> +                uuid(997439fe-f681-4a11-b416-c13a47e8ba36)
> +            ]
> +            interface IApiInformationStatics : IInspectable
> +            {
> +                HRESULT IsTypePresent([in] HSTRING type_name, [out, retval] boolean *value);
> +                [overload("IsMethodPresent")] HRESULT IsMethodPresent([in] HSTRING type_name, [in] HSTRING method_name, [out, retval] boolean *value);
> +                [overload("IsMethodPresent")] HRESULT IsMethodPresentWithArity([in] HSTRING type_name, [in] HSTRING method_name, [in] UINT32 parameter_count, [out, retval] boolean *value);
> +                HRESULT IsEventPresent([in] HSTRING type_name, [in] HSTRING event_name, [out, retval] boolean *value);
> +                HRESULT IsPropertyPresent([in] HSTRING type_name, [in] HSTRING property_name, [out, retval] boolean *value);
> +                HRESULT IsReadOnlyPropertyPresent([in] HSTRING type_name, [in] HSTRING property_name, [out, retval] boolean *value);
> +                HRESULT IsWriteablePropertyPresent([in] HSTRING type_name, [in] HSTRING property_name, [out, retval] boolean *value);
> +                HRESULT IsEnumNamedValuePresent([in] HSTRING enum_type_name, [in] HSTRING value_name, [out, retval] boolean *value);
> +                [overload("IsApiContractPresent")] HRESULT IsApiContractPresentByMajor([in] HSTRING contract_name, [in] UINT16 major_version, [out, retval] boolean *value);
> +                [overload("IsApiContractPresent")] HRESULT IsApiContractPresentByMajorAndMinor([in] HSTRING contract_name, [in] UINT16 major_version, [in] UINT16 minor_version, [out, retval] boolean *value);
> +            }
> +
> +            [
> +                contract(Windows.Foundation.FoundationContract, 1.0),
> +                marshaling_behavior(agile),
> +                static(Windows.Foundation.Metadata.IApiInformationStatics, Windows.Foundation.FoundationContract, 1.0),
> +                threading(both)
> +            ]
> +            runtimeclass ApiInformation
> +            {
> +            }
> +        }
> +    }
> +}


FWIW you can use nested namespace declarations now, like:

namespace Windows.Foundation.Metadata {

   ...

}

I think it helps reducing the indentation overhead for these files, 
which already have very long lines.

I also don't think we need to open and close the namespaces for the 
forward declarations, or to forward declare everything (like 
FoundationContract for instance). The SDK IDLs does it but more likely 
because these files are generated, and I now think it only makes it 
unnecessarily verbose.

Cheers,
-- 
Rémi Bernon <rbernon at codeweavers.com>



More information about the wine-devel mailing list