Improve D2D1 types generation and other helper methods.

This commit is contained in:
Amer Koleci
2022-12-06 10:57:28 +01:00
parent a67fab7cae
commit c1d457d5fd
56 changed files with 733 additions and 508 deletions

View File

@@ -173,9 +173,9 @@ public unsafe partial struct ID2D1DeviceContext : ID2D1DeviceContext.Interface,
/// <inheritdoc cref="ID2D1RenderTarget.DrawLine" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(15)]
public void DrawLine(System.Drawing.PointF point0, System.Drawing.PointF point1, ID2D1Brush* brush, float strokeWidth, ID2D1StrokeStyle* strokeStyle)
public void DrawLine(Vector2 point0, Vector2 point1, ID2D1Brush* brush, float strokeWidth, ID2D1StrokeStyle* strokeStyle)
{
((delegate* unmanaged[Stdcall]<ID2D1DeviceContext*, System.Drawing.PointF, System.Drawing.PointF, ID2D1Brush*, float, ID2D1StrokeStyle*, void>)(lpVtbl[15]))((ID2D1DeviceContext*)Unsafe.AsPointer(ref this), point0, point1, brush, strokeWidth, strokeStyle);
((delegate* unmanaged[Stdcall]<ID2D1DeviceContext*, Vector2, Vector2, ID2D1Brush*, float, ID2D1StrokeStyle*, void>)(lpVtbl[15]))((ID2D1DeviceContext*)Unsafe.AsPointer(ref this), point0, point1, brush, strokeWidth, strokeStyle);
}
/// <inheritdoc cref="ID2D1RenderTarget.DrawRectangle" />
@@ -277,17 +277,17 @@ public unsafe partial struct ID2D1DeviceContext : ID2D1DeviceContext.Interface,
/// <inheritdoc cref="ID2D1RenderTarget.DrawTextLayout" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(28)]
public void DrawTextLayout(System.Drawing.PointF origin, Graphics.DirectWrite.IDWriteTextLayout* textLayout, ID2D1Brush* defaultFillBrush, DrawTextOptions options)
public void DrawTextLayout(Vector2 origin, Graphics.DirectWrite.IDWriteTextLayout* textLayout, ID2D1Brush* defaultFillBrush, DrawTextOptions options)
{
((delegate* unmanaged[Stdcall]<ID2D1DeviceContext*, System.Drawing.PointF, Graphics.DirectWrite.IDWriteTextLayout*, ID2D1Brush*, DrawTextOptions, void>)(lpVtbl[28]))((ID2D1DeviceContext*)Unsafe.AsPointer(ref this), origin, textLayout, defaultFillBrush, options);
((delegate* unmanaged[Stdcall]<ID2D1DeviceContext*, Vector2, Graphics.DirectWrite.IDWriteTextLayout*, ID2D1Brush*, DrawTextOptions, void>)(lpVtbl[28]))((ID2D1DeviceContext*)Unsafe.AsPointer(ref this), origin, textLayout, defaultFillBrush, options);
}
/// <inheritdoc cref="ID2D1RenderTarget.DrawGlyphRun" />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(29)]
public void DrawGlyphRun(System.Drawing.PointF baselineOrigin, Graphics.DirectWrite.GlyphRun* glyphRun, ID2D1Brush* foregroundBrush, Graphics.DirectWrite.MeasuringMode measuringMode)
public void DrawGlyphRun(Vector2 baselineOrigin, Graphics.DirectWrite.GlyphRun* glyphRun, ID2D1Brush* foregroundBrush, Graphics.DirectWrite.MeasuringMode measuringMode)
{
((delegate* unmanaged[Stdcall]<ID2D1DeviceContext*, System.Drawing.PointF, Graphics.DirectWrite.GlyphRun*, ID2D1Brush*, Graphics.DirectWrite.MeasuringMode, void>)(lpVtbl[29]))((ID2D1DeviceContext*)Unsafe.AsPointer(ref this), baselineOrigin, glyphRun, foregroundBrush, measuringMode);
((delegate* unmanaged[Stdcall]<ID2D1DeviceContext*, Vector2, Graphics.DirectWrite.GlyphRun*, ID2D1Brush*, Graphics.DirectWrite.MeasuringMode, void>)(lpVtbl[29]))((ID2D1DeviceContext*)Unsafe.AsPointer(ref this), baselineOrigin, glyphRun, foregroundBrush, measuringMode);
}
/// <inheritdoc cref="ID2D1RenderTarget.SetTransform" />
@@ -632,9 +632,9 @@ public unsafe partial struct ID2D1DeviceContext : ID2D1DeviceContext.Interface,
/// <include file='../Direct2D.xml' path='doc/member[@name="ID2D1DeviceContext::GetGlyphRunWorldBounds"]/*' />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(72)]
public HResult GetGlyphRunWorldBounds(System.Drawing.PointF baselineOrigin, Graphics.DirectWrite.GlyphRun* glyphRun, Graphics.DirectWrite.MeasuringMode measuringMode, Common.RectF* bounds)
public HResult GetGlyphRunWorldBounds(Vector2 baselineOrigin, Graphics.DirectWrite.GlyphRun* glyphRun, Graphics.DirectWrite.MeasuringMode measuringMode, Common.RectF* bounds)
{
return ((delegate* unmanaged[Stdcall]<ID2D1DeviceContext*, System.Drawing.PointF, Graphics.DirectWrite.GlyphRun*, Graphics.DirectWrite.MeasuringMode, Common.RectF*, int>)(lpVtbl[72]))((ID2D1DeviceContext*)Unsafe.AsPointer(ref this), baselineOrigin, glyphRun, measuringMode, bounds);
return ((delegate* unmanaged[Stdcall]<ID2D1DeviceContext*, Vector2, Graphics.DirectWrite.GlyphRun*, Graphics.DirectWrite.MeasuringMode, Common.RectF*, int>)(lpVtbl[72]))((ID2D1DeviceContext*)Unsafe.AsPointer(ref this), baselineOrigin, glyphRun, measuringMode, bounds);
}
/// <include file='../Direct2D.xml' path='doc/member[@name="ID2D1DeviceContext::GetDevice"]/*' />
@@ -712,25 +712,25 @@ public unsafe partial struct ID2D1DeviceContext : ID2D1DeviceContext.Interface,
/// <include file='../Direct2D.xml' path='doc/member[@name="ID2D1DeviceContext::DrawGlyphRun"]/*' />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(82)]
public void DrawGlyphRun(System.Drawing.PointF baselineOrigin, Graphics.DirectWrite.GlyphRun* glyphRun, Graphics.DirectWrite.GlyphRunDescription* glyphRunDescription, ID2D1Brush* foregroundBrush, Graphics.DirectWrite.MeasuringMode measuringMode)
public void DrawGlyphRun(Vector2 baselineOrigin, Graphics.DirectWrite.GlyphRun* glyphRun, Graphics.DirectWrite.GlyphRunDescription* glyphRunDescription, ID2D1Brush* foregroundBrush, Graphics.DirectWrite.MeasuringMode measuringMode)
{
((delegate* unmanaged[Stdcall]<ID2D1DeviceContext*, System.Drawing.PointF, Graphics.DirectWrite.GlyphRun*, Graphics.DirectWrite.GlyphRunDescription*, ID2D1Brush*, Graphics.DirectWrite.MeasuringMode, void>)(lpVtbl[82]))((ID2D1DeviceContext*)Unsafe.AsPointer(ref this), baselineOrigin, glyphRun, glyphRunDescription, foregroundBrush, measuringMode);
((delegate* unmanaged[Stdcall]<ID2D1DeviceContext*, Vector2, Graphics.DirectWrite.GlyphRun*, Graphics.DirectWrite.GlyphRunDescription*, ID2D1Brush*, Graphics.DirectWrite.MeasuringMode, void>)(lpVtbl[82]))((ID2D1DeviceContext*)Unsafe.AsPointer(ref this), baselineOrigin, glyphRun, glyphRunDescription, foregroundBrush, measuringMode);
}
/// <include file='../Direct2D.xml' path='doc/member[@name="ID2D1DeviceContext::DrawImage"]/*' />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(83)]
public void DrawImage(ID2D1Image* image, System.Drawing.PointF* targetOffset, Common.RectF* imageRectangle, InterpolationMode interpolationMode, Common.CompositeMode compositeMode)
public void DrawImage(ID2D1Image* image, Vector2* targetOffset, Common.RectF* imageRectangle, InterpolationMode interpolationMode, Common.CompositeMode compositeMode)
{
((delegate* unmanaged[Stdcall]<ID2D1DeviceContext*, ID2D1Image*, System.Drawing.PointF*, Common.RectF*, InterpolationMode, Common.CompositeMode, void>)(lpVtbl[83]))((ID2D1DeviceContext*)Unsafe.AsPointer(ref this), image, targetOffset, imageRectangle, interpolationMode, compositeMode);
((delegate* unmanaged[Stdcall]<ID2D1DeviceContext*, ID2D1Image*, Vector2*, Common.RectF*, InterpolationMode, Common.CompositeMode, void>)(lpVtbl[83]))((ID2D1DeviceContext*)Unsafe.AsPointer(ref this), image, targetOffset, imageRectangle, interpolationMode, compositeMode);
}
/// <include file='../Direct2D.xml' path='doc/member[@name="ID2D1DeviceContext::DrawGdiMetafile"]/*' />
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[VtblIndex(84)]
public void DrawGdiMetafile(ID2D1GdiMetafile* gdiMetafile, System.Drawing.PointF* targetOffset)
public void DrawGdiMetafile(ID2D1GdiMetafile* gdiMetafile, Vector2* targetOffset)
{
((delegate* unmanaged[Stdcall]<ID2D1DeviceContext*, ID2D1GdiMetafile*, System.Drawing.PointF*, void>)(lpVtbl[84]))((ID2D1DeviceContext*)Unsafe.AsPointer(ref this), gdiMetafile, targetOffset);
((delegate* unmanaged[Stdcall]<ID2D1DeviceContext*, ID2D1GdiMetafile*, Vector2*, void>)(lpVtbl[84]))((ID2D1DeviceContext*)Unsafe.AsPointer(ref this), gdiMetafile, targetOffset);
}
/// <include file='../Direct2D.xml' path='doc/member[@name="ID2D1DeviceContext::DrawBitmap"]/*' />
@@ -837,7 +837,7 @@ public unsafe partial struct ID2D1DeviceContext : ID2D1DeviceContext.Interface,
HResult GetImageWorldBounds(ID2D1Image* image, Common.RectF* worldBounds);
[VtblIndex(72)]
HResult GetGlyphRunWorldBounds(System.Drawing.PointF baselineOrigin, Graphics.DirectWrite.GlyphRun* glyphRun, Graphics.DirectWrite.MeasuringMode measuringMode, Common.RectF* bounds);
HResult GetGlyphRunWorldBounds(Vector2 baselineOrigin, Graphics.DirectWrite.GlyphRun* glyphRun, Graphics.DirectWrite.MeasuringMode measuringMode, Common.RectF* bounds);
[VtblIndex(73)]
void GetDevice(ID2D1Device** device);
@@ -867,13 +867,13 @@ public unsafe partial struct ID2D1DeviceContext : ID2D1DeviceContext.Interface,
UnitMode GetUnitMode();
[VtblIndex(82)]
void DrawGlyphRun(System.Drawing.PointF baselineOrigin, Graphics.DirectWrite.GlyphRun* glyphRun, Graphics.DirectWrite.GlyphRunDescription* glyphRunDescription, ID2D1Brush* foregroundBrush, Graphics.DirectWrite.MeasuringMode measuringMode);
void DrawGlyphRun(Vector2 baselineOrigin, Graphics.DirectWrite.GlyphRun* glyphRun, Graphics.DirectWrite.GlyphRunDescription* glyphRunDescription, ID2D1Brush* foregroundBrush, Graphics.DirectWrite.MeasuringMode measuringMode);
[VtblIndex(83)]
void DrawImage(ID2D1Image* image, System.Drawing.PointF* targetOffset, Common.RectF* imageRectangle, InterpolationMode interpolationMode, Common.CompositeMode compositeMode);
void DrawImage(ID2D1Image* image, Vector2* targetOffset, Common.RectF* imageRectangle, InterpolationMode interpolationMode, Common.CompositeMode compositeMode);
[VtblIndex(84)]
void DrawGdiMetafile(ID2D1GdiMetafile* gdiMetafile, System.Drawing.PointF* targetOffset);
void DrawGdiMetafile(ID2D1GdiMetafile* gdiMetafile, Vector2* targetOffset);
[VtblIndex(85)]
void DrawBitmap(ID2D1Bitmap* bitmap, Common.RectF* destinationRectangle, float opacity, InterpolationMode interpolationMode, Common.RectF* sourceRectangle, Matrix4x4* perspectiveTransform);