[PATCH 4/5] d2d1: Add the ID2D1Bitmap interface.

Nikolay Sivov bunglehead at gmail.com
Wed May 14 01:26:20 CDT 2014


On 5/14/2014 09:56, Henri Verbeet wrote:
> +[
> +    local,
> +    object,
> +    uuid(a2296057-ea42-4099-983b-539fb6505426)
> +]
> +interface ID2D1Bitmap : ID2D1Image
> +{
> +    D2D1_SIZE_F GetSize();
> +    D2D1_SIZE_U GetPixelSize();
> +    D2D1_PIXEL_FORMAT GetPixelFormat();
> +    void GetDpi(
> +        [out] float *dpi_x,
> +        [out] float *dpi_y
> +    );
> +    HRESULT CopyFromBitmap(
> +        [in, optional] const D2D1_POINT_2U *dst_point,
> +        [in] ID2D1Bitmap *bitmap,
> +        [in, optional] const D2D1_RECT_U *src_rect
> +    );
> +    HRESULT CopyFromRenderTarget(
> +        [in, optional] const D2D1_POINT_2U *dst_point,
> +        [in] ID2D1RenderTarget *render_target,
> +        [in, optional] const D2D1_RECT_U *src_rect
> +    );
> +    HRESULT CopyFromMemory(
> +        [in, optional] const D2D1_RECT_U *dst_rect,
> +        [in] const void *src_data,
> +        [in] UINT32 pitch
> +    );
> +}
> +
>
I don't think it makes sense to match msdn here regarding [optional] 
attribute, and that's why:

- 'optional' without 'defaultvalue' has no effect on headers, as far as 
I can see;
- you can't mix 'optional' with required arguments like that, midl will 
refuse to process such idl,
   optional arguments should be at the end of arguments list only;
- msdn says that it only applies to VARIANT and VARIANT* types, not sure 
about that, probably
   it's meant to talk about typelib generation only. And we don't need a 
typelib for d2d1 anyway.

It makes sense imo to eventually make widl more midl-compliant adding 
similar consistency checks,
like 'optional' position, also duplicated guids in typelibs come to mind.

It's up to you to keep it as it is, just pointing out potential problems.



More information about the wine-devel mailing list