From f7a7130e2c9458d90eb369ef41022fc2225cd119 Mon Sep 17 00:00:00 2001 From: Jose Fonseca Date: Thu, 13 Aug 2015 16:10:06 +0100 Subject: d2d1trace: Support d2d1_1/dwrite_1. --- specs/d2d1.py | 666 ++++++++++++++++++++++++++++++++++++++++++++++++++------ specs/dwrite.py | 631 +++++++++++++++++++++++++++++++++++++++++++++++++++-- specs/winapi.py | 5 + 3 files changed, 1215 insertions(+), 87 deletions(-) (limited to 'specs') diff --git a/specs/d2d1.py b/specs/d2d1.py index d08c01a3..dacbea69 100644 --- a/specs/d2d1.py +++ b/specs/d2d1.py @@ -1,5 +1,6 @@ ########################################################################## # +# Copyright 2015 VMware, Inc # Copyright 2011 Jose Fonseca # All Rights Reserved. # @@ -85,6 +86,26 @@ D2D_POINT_2F = Struct("D2D_POINT_2F", [ (FLOAT, "y"), ]) +D2D_POINT_2L = Alias("D2D_POINT_2L", POINT) + +D2D_VECTOR_2F = Struct("D2D_VECTOR_2F", [ + (FLOAT, "x"), + (FLOAT, "y"), +]) + +D2D_VECTOR_3F = Struct("D2D_VECTOR_3F", [ + (FLOAT, "x"), + (FLOAT, "y"), + (FLOAT, "z"), +]) + +D2D_VECTOR_4F = Struct("D2D_VECTOR_4F", [ + (FLOAT, "x"), + (FLOAT, "y"), + (FLOAT, "z"), + (FLOAT, "w"), +]) + D2D_RECT_F = Struct("D2D_RECT_F", [ (FLOAT, "left"), (FLOAT, "top"), @@ -99,6 +120,8 @@ D2D_RECT_U = Struct("D2D_RECT_U", [ (UINT32, "bottom"), ]) +D2D_RECT_L = Alias("D2D_RECT_L", RECT) + D2D_SIZE_F = Struct("D2D_SIZE_F", [ (FLOAT, "width"), (FLOAT, "height"), @@ -119,6 +142,18 @@ D2D_MATRIX_3X2_F = Struct("D2D_MATRIX_3X2_F", [ (FLOAT, "_32"), ]) +D2D_MATRIX_4X3_F = Struct("D2D_MATRIX_4X3_F", [ + (Array(Array(FLOAT, 3), 4), "m"), +]) + +D2D_MATRIX_4X4_F = Struct("D2D_MATRIX_4X4_F", [ + (Array(Array(FLOAT, 4), 4), "m"), +]) + +D2D_MATRIX_5X4_F = Struct("D2D_MATRIX_5X4_F", [ + (Array(Array(FLOAT, 4), 5), "m"), +]) + # @@ -126,6 +161,7 @@ D2D_MATRIX_3X2_F = Struct("D2D_MATRIX_3X2_F", [ # ID2D1Resource = Interface("ID2D1Resource", IUnknown) +ID2D1Image = Interface("ID2D1Image", ID2D1Resource) ID2D1Bitmap = Interface("ID2D1Bitmap", ID2D1Resource) ID2D1GradientStopCollection = Interface("ID2D1GradientStopCollection", ID2D1Resource) ID2D1Brush = Interface("ID2D1Brush", ID2D1Resource) @@ -468,27 +504,27 @@ ID2D1Resource.methods += [ ] ID2D1Bitmap.methods += [ - StdMethod(D2D1_SIZE_F, "GetSize", [], const=True), - StdMethod(D2D1_SIZE_U, "GetPixelSize", [], const=True), - StdMethod(D2D1_PIXEL_FORMAT, "GetPixelFormat", [], const=True), - StdMethod(Void, "GetDpi", [Out(Pointer(FLOAT), "dpiX"), Out(Pointer(FLOAT), "dpiY")], const=True), + StdMethod(D2D1_SIZE_F, "GetSize", [], const=True, sideeffects=False), + StdMethod(D2D1_SIZE_U, "GetPixelSize", [], const=True, sideeffects=False), + StdMethod(D2D1_PIXEL_FORMAT, "GetPixelFormat", [], const=True, sideeffects=False), + StdMethod(Void, "GetDpi", [Out(Pointer(FLOAT), "dpiX"), Out(Pointer(FLOAT), "dpiY")], const=True, sideeffects=False), StdMethod(HRESULT, "CopyFromBitmap", [(Pointer(Const(D2D1_POINT_2U)), "destPoint"), (ObjPointer(ID2D1Bitmap), "bitmap"), (Pointer(Const(D2D1_RECT_U)), "srcRect")]), StdMethod(HRESULT, "CopyFromRenderTarget", [(Pointer(Const(D2D1_POINT_2U)), "destPoint"), (ObjPointer(ID2D1RenderTarget), "renderTarget"), (Pointer(Const(D2D1_RECT_U)), "srcRect")]), StdMethod(HRESULT, "CopyFromMemory", [(Pointer(Const(D2D1_RECT_U)), "dstRect"), (OpaquePointer(Const(Void)), "srcData"), (UINT32, "pitch")]), ] ID2D1GradientStopCollection.methods += [ - StdMethod(UINT32, "GetGradientStopCount", [], const=True), - StdMethod(Void, "GetGradientStops", [Out(Pointer(D2D1_GRADIENT_STOP), "gradientStops"), (UINT, "gradientStopsCount")], const=True), - StdMethod(D2D1_GAMMA, "GetColorInterpolationGamma", [], const=True), - StdMethod(D2D1_EXTEND_MODE, "GetExtendMode", [], const=True), + StdMethod(UINT32, "GetGradientStopCount", [], const=True, sideeffects=False), + StdMethod(Void, "GetGradientStops", [Out(Pointer(D2D1_GRADIENT_STOP), "gradientStops"), (UINT, "gradientStopsCount")], const=True, sideeffects=False), + StdMethod(D2D1_GAMMA, "GetColorInterpolationGamma", [], const=True, sideeffects=False), + StdMethod(D2D1_EXTEND_MODE, "GetExtendMode", [], const=True, sideeffects=False), ] ID2D1Brush.methods += [ StdMethod(Void, "SetOpacity", [(FLOAT, "opacity")]), StdMethod(Void, "SetTransform", [(Pointer(Const(D2D1_MATRIX_3X2_F)), "transform")]), - StdMethod(FLOAT, "GetOpacity", [], const=True), - StdMethod(Void, "GetTransform", [Out(Pointer(D2D1_MATRIX_3X2_F), "transform")], const=True), + StdMethod(FLOAT, "GetOpacity", [], const=True, sideeffects=False), + StdMethod(Void, "GetTransform", [Out(Pointer(D2D1_MATRIX_3X2_F), "transform")], const=True, sideeffects=False), ] ID2D1BitmapBrush.methods += [ @@ -496,22 +532,22 @@ ID2D1BitmapBrush.methods += [ StdMethod(Void, "SetExtendModeY", [(D2D1_EXTEND_MODE, "extendModeY")]), StdMethod(Void, "SetInterpolationMode", [(D2D1_BITMAP_INTERPOLATION_MODE, "interpolationMode")]), StdMethod(Void, "SetBitmap", [(ObjPointer(ID2D1Bitmap), "bitmap")]), - StdMethod(D2D1_EXTEND_MODE, "GetExtendModeX", [], const=True), - StdMethod(D2D1_EXTEND_MODE, "GetExtendModeY", [], const=True), - StdMethod(D2D1_BITMAP_INTERPOLATION_MODE, "GetInterpolationMode", [], const=True), + StdMethod(D2D1_EXTEND_MODE, "GetExtendModeX", [], const=True, sideeffects=False), + StdMethod(D2D1_EXTEND_MODE, "GetExtendModeY", [], const=True, sideeffects=False), + StdMethod(D2D1_BITMAP_INTERPOLATION_MODE, "GetInterpolationMode", [], const=True, sideeffects=False), StdMethod(Void, "GetBitmap", [Out(Pointer(ObjPointer(ID2D1Bitmap)), "bitmap")], const=True), ] ID2D1SolidColorBrush.methods += [ StdMethod(Void, "SetColor", [(Pointer(Const(D2D1_COLOR_F)), "color")]), - StdMethod(D2D1_COLOR_F, "GetColor", [], const=True), + StdMethod(D2D1_COLOR_F, "GetColor", [], const=True, sideeffects=False), ] ID2D1LinearGradientBrush.methods += [ StdMethod(Void, "SetStartPoint", [(D2D1_POINT_2F, "startPoint")]), StdMethod(Void, "SetEndPoint", [(D2D1_POINT_2F, "endPoint")]), - StdMethod(D2D1_POINT_2F, "GetStartPoint", [], const=True), - StdMethod(D2D1_POINT_2F, "GetEndPoint", [], const=True), + StdMethod(D2D1_POINT_2F, "GetStartPoint", [], const=True, sideeffects=False), + StdMethod(D2D1_POINT_2F, "GetEndPoint", [], const=True, sideeffects=False), StdMethod(Void, "GetGradientStopCollection", [Out(Pointer(ObjPointer(ID2D1GradientStopCollection)), "gradientStopCollection")], const=True), ] @@ -520,62 +556,62 @@ ID2D1RadialGradientBrush.methods += [ StdMethod(Void, "SetGradientOriginOffset", [(D2D1_POINT_2F, "gradientOriginOffset")]), StdMethod(Void, "SetRadiusX", [(FLOAT, "radiusX")]), StdMethod(Void, "SetRadiusY", [(FLOAT, "radiusY")]), - StdMethod(D2D1_POINT_2F, "GetCenter", [], const=True), - StdMethod(D2D1_POINT_2F, "GetGradientOriginOffset", [], const=True), - StdMethod(FLOAT, "GetRadiusX", [], const=True), - StdMethod(FLOAT, "GetRadiusY", [], const=True), + StdMethod(D2D1_POINT_2F, "GetCenter", [], const=True, sideeffects=False), + StdMethod(D2D1_POINT_2F, "GetGradientOriginOffset", [], const=True, sideeffects=False), + StdMethod(FLOAT, "GetRadiusX", [], const=True, sideeffects=False), + StdMethod(FLOAT, "GetRadiusY", [], const=True, sideeffects=False), StdMethod(Void, "GetGradientStopCollection", [Out(Pointer(ObjPointer(ID2D1GradientStopCollection)), "gradientStopCollection")], const=True), ] ID2D1StrokeStyle.methods += [ - StdMethod(D2D1_CAP_STYLE, "GetStartCap", [], const=True), - StdMethod(D2D1_CAP_STYLE, "GetEndCap", [], const=True), - StdMethod(D2D1_CAP_STYLE, "GetDashCap", [], const=True), - StdMethod(FLOAT, "GetMiterLimit", [], const=True), - StdMethod(D2D1_LINE_JOIN, "GetLineJoin", [], const=True), - StdMethod(FLOAT, "GetDashOffset", [], const=True), - StdMethod(D2D1_DASH_STYLE, "GetDashStyle", [], const=True), - StdMethod(UINT32, "GetDashesCount", [], const=True), - StdMethod(Void, "GetDashes", [Out(Array(FLOAT, "dashesCount"), "dashes"), (UINT, "dashesCount")], const=True), + StdMethod(D2D1_CAP_STYLE, "GetStartCap", [], const=True, sideeffects=False), + StdMethod(D2D1_CAP_STYLE, "GetEndCap", [], const=True, sideeffects=False), + StdMethod(D2D1_CAP_STYLE, "GetDashCap", [], const=True, sideeffects=False), + StdMethod(FLOAT, "GetMiterLimit", [], const=True, sideeffects=False), + StdMethod(D2D1_LINE_JOIN, "GetLineJoin", [], const=True, sideeffects=False), + StdMethod(FLOAT, "GetDashOffset", [], const=True, sideeffects=False), + StdMethod(D2D1_DASH_STYLE, "GetDashStyle", [], const=True, sideeffects=False), + StdMethod(UINT32, "GetDashesCount", [], const=True, sideeffects=False), + StdMethod(Void, "GetDashes", [Out(Array(FLOAT, "dashesCount"), "dashes"), (UINT, "dashesCount")], const=True, sideeffects=False), ] ID2D1Geometry.methods += [ - StdMethod(HRESULT, "GetBounds", [(Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), Out(Pointer(D2D1_RECT_F), "bounds")], const=True), - StdMethod(HRESULT, "GetWidenedBounds", [(FLOAT, "strokeWidth"), (ObjPointer(ID2D1StrokeStyle), "strokeStyle"), (Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), (FLOAT, "flatteningTolerance"), Out(Pointer(D2D1_RECT_F), "bounds")], const=True), - StdMethod(HRESULT, "StrokeContainsPoint", [(D2D1_POINT_2F, "point"), (FLOAT, "strokeWidth"), (ObjPointer(ID2D1StrokeStyle), "strokeStyle"), (Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), (FLOAT, "flatteningTolerance"), Out(Pointer(BOOL), "contains")], const=True), - StdMethod(HRESULT, "FillContainsPoint", [(D2D1_POINT_2F, "point"), (Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), (FLOAT, "flatteningTolerance"), Out(Pointer(BOOL), "contains")], const=True), - StdMethod(HRESULT, "CompareWithGeometry", [(ObjPointer(ID2D1Geometry), "inputGeometry"), (Pointer(Const(D2D1_MATRIX_3X2_F)), "inputGeometryTransform"), (FLOAT, "flatteningTolerance"), Out(Pointer(D2D1_GEOMETRY_RELATION), "relation")], const=True), - StdMethod(HRESULT, "Simplify", [(D2D1_GEOMETRY_SIMPLIFICATION_OPTION, "simplificationOption"), (Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), (FLOAT, "flatteningTolerance"), (ObjPointer(ID2D1SimplifiedGeometrySink), "geometrySink")], const=True), - StdMethod(HRESULT, "Tessellate", [(Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), (FLOAT, "flatteningTolerance"), (ObjPointer(ID2D1TessellationSink), "tessellationSink")], const=True), - StdMethod(HRESULT, "CombineWithGeometry", [(ObjPointer(ID2D1Geometry), "inputGeometry"), (D2D1_COMBINE_MODE, "combineMode"), (Pointer(Const(D2D1_MATRIX_3X2_F)), "inputGeometryTransform"), (FLOAT, "flatteningTolerance"), (ObjPointer(ID2D1SimplifiedGeometrySink), "geometrySink")], const=True), - StdMethod(HRESULT, "Outline", [(Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), (FLOAT, "flatteningTolerance"), (ObjPointer(ID2D1SimplifiedGeometrySink), "geometrySink")], const=True), - StdMethod(HRESULT, "ComputeArea", [(Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), (FLOAT, "flatteningTolerance"), Out(Pointer(FLOAT), "area")], const=True), - StdMethod(HRESULT, "ComputeLength", [(Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), (FLOAT, "flatteningTolerance"), Out(Pointer(FLOAT), "length")], const=True), - StdMethod(HRESULT, "ComputePointAtLength", [(FLOAT, "length"), (Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), (FLOAT, "flatteningTolerance"), Out(Pointer(D2D1_POINT_2F), "point"), Out(Pointer(D2D1_POINT_2F), "unitTangentVector")], const=True), - StdMethod(HRESULT, "Widen", [(FLOAT, "strokeWidth"), (ObjPointer(ID2D1StrokeStyle), "strokeStyle"), (Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), (FLOAT, "flatteningTolerance"), (ObjPointer(ID2D1SimplifiedGeometrySink), "geometrySink")], const=True), + StdMethod(HRESULT, "GetBounds", [(Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), Out(Pointer(D2D1_RECT_F), "bounds")], const=True, sideeffects=False), + StdMethod(HRESULT, "GetWidenedBounds", [(FLOAT, "strokeWidth"), (ObjPointer(ID2D1StrokeStyle), "strokeStyle"), (Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), (FLOAT, "flatteningTolerance"), Out(Pointer(D2D1_RECT_F), "bounds")], const=True, sideeffects=False), + StdMethod(HRESULT, "StrokeContainsPoint", [(D2D1_POINT_2F, "point"), (FLOAT, "strokeWidth"), (ObjPointer(ID2D1StrokeStyle), "strokeStyle"), (Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), (FLOAT, "flatteningTolerance"), Out(Pointer(BOOL), "contains")], const=True, sideeffects=False), + StdMethod(HRESULT, "FillContainsPoint", [(D2D1_POINT_2F, "point"), (Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), (FLOAT, "flatteningTolerance"), Out(Pointer(BOOL), "contains")], const=True, sideeffects=False), + StdMethod(HRESULT, "CompareWithGeometry", [(ObjPointer(ID2D1Geometry), "inputGeometry"), (Pointer(Const(D2D1_MATRIX_3X2_F)), "inputGeometryTransform"), (FLOAT, "flatteningTolerance"), Out(Pointer(D2D1_GEOMETRY_RELATION), "relation")], const=True, sideeffects=False), + StdMethod(HRESULT, "Simplify", [(D2D1_GEOMETRY_SIMPLIFICATION_OPTION, "simplificationOption"), (Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), (FLOAT, "flatteningTolerance"), (ObjPointer(ID2D1SimplifiedGeometrySink), "geometrySink")], const=True, sideeffects=False), + StdMethod(HRESULT, "Tessellate", [(Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), (FLOAT, "flatteningTolerance"), (ObjPointer(ID2D1TessellationSink), "tessellationSink")], const=True, sideeffects=False), + StdMethod(HRESULT, "CombineWithGeometry", [(ObjPointer(ID2D1Geometry), "inputGeometry"), (D2D1_COMBINE_MODE, "combineMode"), (Pointer(Const(D2D1_MATRIX_3X2_F)), "inputGeometryTransform"), (FLOAT, "flatteningTolerance"), (ObjPointer(ID2D1SimplifiedGeometrySink), "geometrySink")], const=True, sideeffects=False), + StdMethod(HRESULT, "Outline", [(Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), (FLOAT, "flatteningTolerance"), (ObjPointer(ID2D1SimplifiedGeometrySink), "geometrySink")], const=True, sideeffects=False), + StdMethod(HRESULT, "ComputeArea", [(Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), (FLOAT, "flatteningTolerance"), Out(Pointer(FLOAT), "area")], const=True, sideeffects=False), + StdMethod(HRESULT, "ComputeLength", [(Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), (FLOAT, "flatteningTolerance"), Out(Pointer(FLOAT), "length")], const=True, sideeffects=False), + StdMethod(HRESULT, "ComputePointAtLength", [(FLOAT, "length"), (Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), (FLOAT, "flatteningTolerance"), Out(Pointer(D2D1_POINT_2F), "point"), Out(Pointer(D2D1_POINT_2F), "unitTangentVector")], const=True, sideeffects=False), + StdMethod(HRESULT, "Widen", [(FLOAT, "strokeWidth"), (ObjPointer(ID2D1StrokeStyle), "strokeStyle"), (Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), (FLOAT, "flatteningTolerance"), (ObjPointer(ID2D1SimplifiedGeometrySink), "geometrySink")], const=True, sideeffects=False), ] ID2D1RectangleGeometry.methods += [ - StdMethod(Void, "GetRect", [Out(Pointer(D2D1_RECT_F), "rect")], const=True), + StdMethod(Void, "GetRect", [Out(Pointer(D2D1_RECT_F), "rect")], const=True, sideeffects=False), ] ID2D1RoundedRectangleGeometry.methods += [ - StdMethod(Void, "GetRoundedRect", [Out(Pointer(D2D1_ROUNDED_RECT), "roundedRect")], const=True), + StdMethod(Void, "GetRoundedRect", [Out(Pointer(D2D1_ROUNDED_RECT), "roundedRect")], const=True, sideeffects=False), ] ID2D1EllipseGeometry.methods += [ - StdMethod(Void, "GetEllipse", [Out(Pointer(D2D1_ELLIPSE), "ellipse")], const=True), + StdMethod(Void, "GetEllipse", [Out(Pointer(D2D1_ELLIPSE), "ellipse")], const=True, sideeffects=False), ] ID2D1GeometryGroup.methods += [ - StdMethod(D2D1_FILL_MODE, "GetFillMode", [], const=True), - StdMethod(UINT32, "GetSourceGeometryCount", [], const=True), - StdMethod(Void, "GetSourceGeometries", [Out(Array(ObjPointer(ID2D1Geometry), "geometriesCount"), "geometries"), (UINT, "geometriesCount")], const=True), + StdMethod(D2D1_FILL_MODE, "GetFillMode", [], const=True, sideeffects=False), + StdMethod(UINT32, "GetSourceGeometryCount", [], const=True, sideeffects=False), + StdMethod(Void, "GetSourceGeometries", [Out(Array(ObjPointer(ID2D1Geometry), "geometriesCount"), "geometries"), (UINT, "geometriesCount")], const=True, sideeffects=False), ] ID2D1TransformedGeometry.methods += [ StdMethod(Void, "GetSourceGeometry", [Out(Pointer(ObjPointer(ID2D1Geometry)), "sourceGeometry")], const=True), - StdMethod(Void, "GetTransform", [Out(Pointer(D2D1_MATRIX_3X2_F), "transform")], const=True), + StdMethod(Void, "GetTransform", [Out(Pointer(D2D1_MATRIX_3X2_F), "transform")], const=True, sideeffects=False), ] ID2D1SimplifiedGeometrySink.methods += [ @@ -603,9 +639,9 @@ ID2D1TessellationSink.methods += [ ID2D1PathGeometry.methods += [ StdMethod(HRESULT, "Open", [Out(Pointer(ObjPointer(ID2D1GeometrySink)), "geometrySink")]), - StdMethod(HRESULT, "Stream", [(ObjPointer(ID2D1GeometrySink), "geometrySink")], const=True), - StdMethod(HRESULT, "GetSegmentCount", [Out(Pointer(UINT32), "count")], const=True), - StdMethod(HRESULT, "GetFigureCount", [Out(Pointer(UINT32), "count")], const=True), + StdMethod(HRESULT, "Stream", [(ObjPointer(ID2D1GeometrySink), "geometrySink")], const=True, sideeffects=False), + StdMethod(HRESULT, "GetSegmentCount", [Out(Pointer(UINT32), "count")], const=True, sideeffects=False), + StdMethod(HRESULT, "GetFigureCount", [Out(Pointer(UINT32), "count")], const=True, sideeffects=False), ] ID2D1Mesh.methods += [ @@ -613,11 +649,11 @@ ID2D1Mesh.methods += [ ] ID2D1Layer.methods += [ - StdMethod(D2D1_SIZE_F, "GetSize", [], const=True), + StdMethod(D2D1_SIZE_F, "GetSize", [], const=True, sideeffects=False), ] ID2D1DrawingStateBlock.methods += [ - StdMethod(Void, "GetDescription", [Out(Pointer(D2D1_DRAWING_STATE_DESCRIPTION), "stateDescription")], const=True), + StdMethod(Void, "GetDescription", [Out(Pointer(D2D1_DRAWING_STATE_DESCRIPTION), "stateDescription")], const=True, sideeffects=False), StdMethod(Void, "SetDescription", [(Pointer(Const(D2D1_DRAWING_STATE_DESCRIPTION)), "stateDescription")]), StdMethod(Void, "SetTextRenderingParams", [(ObjPointer(IDWriteRenderingParams), "textRenderingParams")]), StdMethod(Void, "GetTextRenderingParams", [Out(Pointer(ObjPointer(IDWriteRenderingParams)), "textRenderingParams")], const=True), @@ -651,32 +687,32 @@ ID2D1RenderTarget.methods += [ StdMethod(Void, "DrawTextLayout", [(D2D1_POINT_2F, "origin"), (ObjPointer(IDWriteTextLayout), "textLayout"), (ObjPointer(ID2D1Brush), "defaultForegroundBrush"), (D2D1_DRAW_TEXT_OPTIONS, "options")]), StdMethod(Void, "DrawGlyphRun", [(D2D1_POINT_2F, "baselineOrigin"), (Pointer(Const(DWRITE_GLYPH_RUN)), "glyphRun"), (ObjPointer(ID2D1Brush), "foregroundBrush"), (DWRITE_MEASURING_MODE, "measuringMode")]), StdMethod(Void, "SetTransform", [(Pointer(Const(D2D1_MATRIX_3X2_F)), "transform")]), - StdMethod(Void, "GetTransform", [Out(Pointer(D2D1_MATRIX_3X2_F), "transform")], const=True), + StdMethod(Void, "GetTransform", [Out(Pointer(D2D1_MATRIX_3X2_F), "transform")], const=True, sideeffects=False), StdMethod(Void, "SetAntialiasMode", [(D2D1_ANTIALIAS_MODE, "antialiasMode")]), - StdMethod(D2D1_ANTIALIAS_MODE, "GetAntialiasMode", [], const=True), + StdMethod(D2D1_ANTIALIAS_MODE, "GetAntialiasMode", [], const=True, sideeffects=False), StdMethod(Void, "SetTextAntialiasMode", [(D2D1_TEXT_ANTIALIAS_MODE, "textAntialiasMode")]), - StdMethod(D2D1_TEXT_ANTIALIAS_MODE, "GetTextAntialiasMode", [], const=True), + StdMethod(D2D1_TEXT_ANTIALIAS_MODE, "GetTextAntialiasMode", [], const=True, sideeffects=False), StdMethod(Void, "SetTextRenderingParams", [(ObjPointer(IDWriteRenderingParams), "textRenderingParams")]), StdMethod(Void, "GetTextRenderingParams", [Out(Pointer(ObjPointer(IDWriteRenderingParams)), "textRenderingParams")], const=True), StdMethod(Void, "SetTags", [(D2D1_TAG, "tag1"), (D2D1_TAG, "tag2")]), - StdMethod(Void, "GetTags", [Out(Pointer(D2D1_TAG), "tag1"), Out(Pointer(D2D1_TAG), "tag2")], const=True), + StdMethod(Void, "GetTags", [Out(Pointer(D2D1_TAG), "tag1"), Out(Pointer(D2D1_TAG), "tag2")], const=True, sideeffects=False), StdMethod(Void, "PushLayer", [(Pointer(Const(D2D1_LAYER_PARAMETERS)), "layerParameters"), (ObjPointer(ID2D1Layer), "layer")]), StdMethod(Void, "PopLayer", []), StdMethod(HRESULT, "Flush", [Out(Pointer(D2D1_TAG), "tag1"), Out(Pointer(D2D1_TAG), "tag2")]), - StdMethod(Void, "SaveDrawingState", [(ObjPointer(ID2D1DrawingStateBlock), "drawingStateBlock")], const=True), + StdMethod(Void, "SaveDrawingState", [(ObjPointer(ID2D1DrawingStateBlock), "drawingStateBlock")], const=True, sideeffects=False), StdMethod(Void, "RestoreDrawingState", [(ObjPointer(ID2D1DrawingStateBlock), "drawingStateBlock")]), StdMethod(Void, "PushAxisAlignedClip", [(Pointer(Const(D2D1_RECT_F)), "clipRect"), (D2D1_ANTIALIAS_MODE, "antialiasMode")]), StdMethod(Void, "PopAxisAlignedClip", []), StdMethod(Void, "Clear", [(Pointer(Const(D2D1_COLOR_F)), "clearColor")]), StdMethod(Void, "BeginDraw", []), StdMethod(HRESULT, "EndDraw", [Out(Pointer(D2D1_TAG), "tag1"), Out(Pointer(D2D1_TAG), "tag2")]), - StdMethod(D2D1_PIXEL_FORMAT, "GetPixelFormat", [], const=True), + StdMethod(D2D1_PIXEL_FORMAT, "GetPixelFormat", [], const=True, sideeffects=False), StdMethod(Void, "SetDpi", [(FLOAT, "dpiX"), (FLOAT, "dpiY")]), - StdMethod(Void, "GetDpi", [Out(Pointer(FLOAT), "dpiX"), Out(Pointer(FLOAT), "dpiY")], const=True), - StdMethod(D2D1_SIZE_F, "GetSize", [], const=True), - StdMethod(D2D1_SIZE_U, "GetPixelSize", [], const=True), - StdMethod(UINT32, "GetMaximumBitmapSize", [], const=True), - StdMethod(BOOL, "IsSupported", [(Pointer(Const(D2D1_RENDER_TARGET_PROPERTIES)), "renderTargetProperties")], const=True), + StdMethod(Void, "GetDpi", [Out(Pointer(FLOAT), "dpiX"), Out(Pointer(FLOAT), "dpiY")], const=True, sideeffects=False), + StdMethod(D2D1_SIZE_F, "GetSize", [], const=True, sideeffects=False), + StdMethod(D2D1_SIZE_U, "GetPixelSize", [], const=True, sideeffects=False), + StdMethod(UINT32, "GetMaximumBitmapSize", [], const=True, sideeffects=False), + StdMethod(BOOL, "IsSupported", [(Pointer(Const(D2D1_RENDER_TARGET_PROPERTIES)), "renderTargetProperties")], const=True, sideeffects=False), ] ID2D1BitmapRenderTarget.methods += [ @@ -686,7 +722,7 @@ ID2D1BitmapRenderTarget.methods += [ ID2D1HwndRenderTarget.methods += [ StdMethod(D2D1_WINDOW_STATE, "CheckWindowState", []), StdMethod(HRESULT, "Resize", [(Pointer(Const(D2D1_SIZE_U)), "pixelSize")]), - StdMethod(HWND, "GetHwnd", [], const=True), + StdMethod(HWND, "GetHwnd", [], const=True, sideeffects=False), ] ID2D1GdiInteropRenderTarget.methods += [ @@ -704,7 +740,7 @@ ID2D1Factory.methods += [ StdMethod(HRESULT, "CreateRectangleGeometry", [(Pointer(Const(D2D1_RECT_F)), "rectangle"), Out(Pointer(ObjPointer(ID2D1RectangleGeometry)), "rectangleGeometry")]), StdMethod(HRESULT, "CreateRoundedRectangleGeometry", [(Pointer(Const(D2D1_ROUNDED_RECT)), "roundedRectangle"), Out(Pointer(ObjPointer(ID2D1RoundedRectangleGeometry)), "roundedRectangleGeometry")]), StdMethod(HRESULT, "CreateEllipseGeometry", [(Pointer(Const(D2D1_ELLIPSE)), "ellipse"), Out(Pointer(ObjPointer(ID2D1EllipseGeometry)), "ellipseGeometry")]), - StdMethod(HRESULT, "CreateGeometryGroup", [(D2D1_FILL_MODE, "fillMode"), (Pointer(ObjPointer(ID2D1Geometry)), "geometries"), (UINT, "geometriesCount"), Out(Pointer(ObjPointer(ID2D1GeometryGroup)), "geometryGroup")]), + StdMethod(HRESULT, "CreateGeometryGroup", [(D2D1_FILL_MODE, "fillMode"), (Array(ObjPointer(ID2D1Geometry), "geometriesCount"), "geometries"), (UINT, "geometriesCount"), Out(Pointer(ObjPointer(ID2D1GeometryGroup)), "geometryGroup")]), StdMethod(HRESULT, "CreateTransformedGeometry", [(ObjPointer(ID2D1Geometry), "sourceGeometry"), (Pointer(Const(D2D1_MATRIX_3X2_F)), "transform"), Out(Pointer(ObjPointer(ID2D1TransformedGeometry)), "transformedGeometry")]), StdMethod(HRESULT, "CreatePathGeometry", [Out(Pointer(ObjPointer(ID2D1PathGeometry)), "pathGeometry")]), StdMethod(HRESULT, "CreateStrokeStyle", [(Pointer(Const(D2D1_STROKE_STYLE_PROPERTIES)), "strokeStyleProperties"), (Pointer(Const(FLOAT)), "dashes"), (UINT, "dashesCount"), Out(Pointer(ObjPointer(ID2D1StrokeStyle)), "strokeStyle")]), @@ -726,3 +762,499 @@ d2d1.addFunctions([ StdFunction(BOOL, "D2D1IsMatrixInvertible", [(Pointer(Const(D2D1_MATRIX_3X2_F)), "matrix")]), StdFunction(BOOL, "D2D1InvertMatrix", [InOut(Pointer(D2D1_MATRIX_3X2_F), "matrix")]), ]) + + + +# +# D2D1.1 +# + + +ID2D1GdiMetafileSink = Interface("ID2D1GdiMetafileSink", IUnknown) +ID2D1GdiMetafile = Interface("ID2D1GdiMetafile", ID2D1Resource) +ID2D1CommandSink = Interface("ID2D1CommandSink", IUnknown) +ID2D1CommandList = Interface("ID2D1CommandList", ID2D1Image) +ID2D1PrintControl = Interface("ID2D1PrintControl", IUnknown) +ID2D1ImageBrush = Interface("ID2D1ImageBrush", ID2D1Brush) +ID2D1BitmapBrush1 = Interface("ID2D1BitmapBrush1", ID2D1BitmapBrush) +ID2D1StrokeStyle1 = Interface("ID2D1StrokeStyle1", ID2D1StrokeStyle) +ID2D1PathGeometry1 = Interface("ID2D1PathGeometry1", ID2D1PathGeometry) +ID2D1Properties = Interface("ID2D1Properties", IUnknown) +ID2D1Effect = Interface("ID2D1Effect", ID2D1Properties) +ID2D1Bitmap1 = Interface("ID2D1Bitmap1", ID2D1Bitmap) +ID2D1ColorContext = Interface("ID2D1ColorContext", ID2D1Resource) +ID2D1GradientStopCollection1 = Interface("ID2D1GradientStopCollection1", ID2D1GradientStopCollection) +ID2D1DrawingStateBlock1 = Interface("ID2D1DrawingStateBlock1", ID2D1DrawingStateBlock) +ID2D1DeviceContext = Interface("ID2D1DeviceContext", ID2D1RenderTarget) +ID2D1Device = Interface("ID2D1Device", ID2D1Resource) +ID2D1Factory1 = Interface("ID2D1Factory1", ID2D1Factory) +ID2D1Multithread = Interface("ID2D1Multithread", IUnknown) + + +D2D1_RECT_L = Alias("D2D1_RECT_L", D2D_RECT_L) +D2D1_POINT_2L = Alias("D2D1_POINT_2L", D2D_POINT_2L) + + +D2D1_PROPERTY_INDEX = FakeEnum(UINT32, [ + "D2D1_INVALID_PROPERTY_INDEX", +]) + +D2D1_PROPERTY_TYPE = Enum("D2D1_PROPERTY_TYPE", [ + "D2D1_PROPERTY_TYPE_UNKNOWN", + "D2D1_PROPERTY_TYPE_STRING", + "D2D1_PROPERTY_TYPE_BOOL", + "D2D1_PROPERTY_TYPE_UINT32", + "D2D1_PROPERTY_TYPE_INT32", + "D2D1_PROPERTY_TYPE_FLOAT", + "D2D1_PROPERTY_TYPE_VECTOR2", + "D2D1_PROPERTY_TYPE_VECTOR3", + "D2D1_PROPERTY_TYPE_VECTOR4", + "D2D1_PROPERTY_TYPE_BLOB", + "D2D1_PROPERTY_TYPE_IUNKNOWN", + "D2D1_PROPERTY_TYPE_ENUM", + "D2D1_PROPERTY_TYPE_ARRAY", + "D2D1_PROPERTY_TYPE_CLSID", + "D2D1_PROPERTY_TYPE_MATRIX_3X2", + "D2D1_PROPERTY_TYPE_MATRIX_4X3", + "D2D1_PROPERTY_TYPE_MATRIX_4X4", + "D2D1_PROPERTY_TYPE_MATRIX_5X4", + "D2D1_PROPERTY_TYPE_COLOR_CONTEXT", + "D2D1_PROPERTY_TYPE_FORCE_DWORD", +]) + +D2D1_PROPERTY = Enum("D2D1_PROPERTY", [ + "D2D1_PROPERTY_CLSID", + "D2D1_PROPERTY_DISPLAYNAME", + "D2D1_PROPERTY_AUTHOR", + "D2D1_PROPERTY_CATEGORY", + "D2D1_PROPERTY_DESCRIPTION", + "D2D1_PROPERTY_INPUTS", + "D2D1_PROPERTY_CACHED", + "D2D1_PROPERTY_PRECISION", + "D2D1_PROPERTY_MIN_INPUTS", + "D2D1_PROPERTY_MAX_INPUTS", + "D2D1_PROPERTY_FORCE_DWORD", +]) + +D2D1_SUBPROPERTY = Enum("D2D1_SUBPROPERTY", [ + "D2D1_SUBPROPERTY_DISPLAYNAME", + "D2D1_SUBPROPERTY_ISREADONLY", + "D2D1_SUBPROPERTY_MIN", + "D2D1_SUBPROPERTY_MAX", + "D2D1_SUBPROPERTY_DEFAULT", + "D2D1_SUBPROPERTY_FIELDS", + "D2D1_SUBPROPERTY_INDEX", + "D2D1_SUBPROPERTY_FORCE_DWORD", +]) + +D2D1_BITMAP_OPTIONS = Enum("D2D1_BITMAP_OPTIONS", [ + "D2D1_BITMAP_OPTIONS_NONE", + "D2D1_BITMAP_OPTIONS_TARGET", + "D2D1_BITMAP_OPTIONS_CANNOT_DRAW", + "D2D1_BITMAP_OPTIONS_CPU_READ", + "D2D1_BITMAP_OPTIONS_GDI_COMPATIBLE", + "D2D1_BITMAP_OPTIONS_FORCE_DWORD", +]) + +D2D1_COMPOSITE_MODE = Enum("D2D1_COMPOSITE_MODE", [ + "D2D1_COMPOSITE_MODE_SOURCE_OVER", + "D2D1_COMPOSITE_MODE_DESTINATION_OVER", + "D2D1_COMPOSITE_MODE_SOURCE_IN", + "D2D1_COMPOSITE_MODE_DESTINATION_IN", + "D2D1_COMPOSITE_MODE_SOURCE_OUT", + "D2D1_COMPOSITE_MODE_DESTINATION_OUT", + "D2D1_COMPOSITE_MODE_SOURCE_ATOP", + "D2D1_COMPOSITE_MODE_DESTINATION_ATOP", + "D2D1_COMPOSITE_MODE_XOR", + "D2D1_COMPOSITE_MODE_PLUS", + "D2D1_COMPOSITE_MODE_SOURCE_COPY", + "D2D1_COMPOSITE_MODE_BOUNDED_SOURCE_COPY", + "D2D1_COMPOSITE_MODE_MASK_INVERT", + "D2D1_COMPOSITE_MODE_FORCE_DWORD", +]) + +D2D1_BUFFER_PRECISION = Enum("D2D1_BUFFER_PRECISION", [ + "D2D1_BUFFER_PRECISION_UNKNOWN", + "D2D1_BUFFER_PRECISION_8BPC_UNORM", + "D2D1_BUFFER_PRECISION_8BPC_UNORM_SRGB", + "D2D1_BUFFER_PRECISION_16BPC_UNORM", + "D2D1_BUFFER_PRECISION_16BPC_FLOAT", + "D2D1_BUFFER_PRECISION_32BPC_FLOAT", + "D2D1_BUFFER_PRECISION_FORCE_DWORD", +]) + +D2D1_MAP_OPTIONS = Enum("D2D1_MAP_OPTIONS", [ + "D2D1_MAP_OPTIONS_NONE", + "D2D1_MAP_OPTIONS_READ", + "D2D1_MAP_OPTIONS_WRITE", + "D2D1_MAP_OPTIONS_DISCARD", + "D2D1_MAP_OPTIONS_FORCE_DWORD", +]) + +D2D1_INTERPOLATION_MODE = Enum("D2D1_INTERPOLATION_MODE", [ + "D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR", + "D2D1_INTERPOLATION_MODE_LINEAR", + "D2D1_INTERPOLATION_MODE_CUBIC", + "D2D1_INTERPOLATION_MODE_MULTI_SAMPLE_LINEAR", + "D2D1_INTERPOLATION_MODE_ANISOTROPIC", + "D2D1_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC", + "D2D1_INTERPOLATION_MODE_FORCE_DWORD", +]) + +D2D1_UNIT_MODE = Enum("D2D1_UNIT_MODE", [ + "D2D1_UNIT_MODE_DIPS", + "D2D1_UNIT_MODE_PIXELS", + "D2D1_UNIT_MODE_FORCE_DWORD", +]) + +D2D1_COLOR_SPACE = Enum("D2D1_COLOR_SPACE", [ + "D2D1_COLOR_SPACE_CUSTOM", + "D2D1_COLOR_SPACE_SRGB", + "D2D1_COLOR_SPACE_SCRGB", + "D2D1_COLOR_SPACE_FORCE_DWORD", +]) + +D2D1_DEVICE_CONTEXT_OPTIONS = Enum("D2D1_DEVICE_CONTEXT_OPTIONS", [ + "D2D1_DEVICE_CONTEXT_OPTIONS_NONE", + "D2D1_DEVICE_CONTEXT_OPTIONS_ENABLE_MULTITHREADED_OPTIMIZATIONS", + "D2D1_DEVICE_CONTEXT_OPTIONS_FORCE_DWORD", +]) + +D2D1_STROKE_TRANSFORM_TYPE = Enum("D2D1_STROKE_TRANSFORM_TYPE", [ + "D2D1_STROKE_TRANSFORM_TYPE_NORMAL", + "D2D1_STROKE_TRANSFORM_TYPE_FIXED", + "D2D1_STROKE_TRANSFORM_TYPE_HAIRLINE", + "D2D1_STROKE_TRANSFORM_TYPE_FORCE_DWORD", +]) + +D2D1_PRIMITIVE_BLEND = Enum("D2D1_PRIMITIVE_BLEND", [ + "D2D1_PRIMITIVE_BLEND_SOURCE_OVER", + "D2D1_PRIMITIVE_BLEND_COPY", + "D2D1_PRIMITIVE_BLEND_MIN", + "D2D1_PRIMITIVE_BLEND_ADD", + "D2D1_PRIMITIVE_BLEND_FORCE_DWORD", +]) + +D2D1_THREADING_MODE = Enum("D2D1_THREADING_MODE", [ + "D2D1_THREADING_MODE_SINGLE_THREADED", + "D2D1_THREADING_MODE_MULTI_THREADED", + "D2D1_THREADING_MODE_FORCE_DWORD", +]) + +D2D1_COLOR_INTERPOLATION_MODE = Enum("D2D1_COLOR_INTERPOLATION_MODE", [ + "D2D1_COLOR_INTERPOLATION_MODE_STRAIGHT", + "D2D1_COLOR_INTERPOLATION_MODE_PREMULTIPLIED", + "D2D1_COLOR_INTERPOLATION_MODE_FORCE_DWORD", +]) + +D2D1_VECTOR_2F = Alias("D2D1_VECTOR_2F", D2D_VECTOR_2F) +D2D1_VECTOR_3F = Alias("D2D1_VECTOR_3F", D2D_VECTOR_3F) +D2D1_VECTOR_4F = Alias("D2D1_VECTOR_4F", D2D_VECTOR_4F) +D2D1_BITMAP_PROPERTIES1 = Struct("D2D1_BITMAP_PROPERTIES1", [ + (D2D1_PIXEL_FORMAT, "pixelFormat"), + (FLOAT, "dpiX"), + (FLOAT, "dpiY"), + (D2D1_BITMAP_OPTIONS, "bitmapOptions"), + (ObjPointer(ID2D1ColorContext), "colorContext"), +]) + +D2D1_MAPPED_RECT = Struct("D2D1_MAPPED_RECT", [ + (UINT32, "pitch"), + (Pointer(BYTE), "bits"), +]) + +D2D1_RENDERING_CONTROLS = Struct("D2D1_RENDERING_CONTROLS", [ + (D2D1_BUFFER_PRECISION, "bufferPrecision"), + (D2D1_SIZE_U, "tileSize"), +]) + +D2D1_EFFECT_INPUT_DESCRIPTION = Struct("D2D1_EFFECT_INPUT_DESCRIPTION", [ + (ObjPointer(ID2D1Effect), "effect"), + (UINT32, "inputIndex"), + (D2D1_RECT_F, "inputRectangle"), +]) + +D2D1_MATRIX_4X3_F = Alias("D2D1_MATRIX_4X3_F", D2D_MATRIX_4X3_F) +D2D1_MATRIX_4X4_F = Alias("D2D1_MATRIX_4X4_F", D2D_MATRIX_4X4_F) +D2D1_MATRIX_5X4_F = Alias("D2D1_MATRIX_5X4_F", D2D_MATRIX_5X4_F) +D2D1_POINT_DESCRIPTION = Struct("D2D1_POINT_DESCRIPTION", [ + (D2D1_POINT_2F, "point"), + (D2D1_POINT_2F, "unitTangentVector"), + (UINT32, "endSegment"), + (UINT32, "endFigure"), + (FLOAT, "lengthToEndSegment"), +]) + +D2D1_IMAGE_BRUSH_PROPERTIES = Struct("D2D1_IMAGE_BRUSH_PROPERTIES", [ + (D2D1_RECT_F, "sourceRectangle"), + (D2D1_EXTEND_MODE, "extendModeX"), + (D2D1_EXTEND_MODE, "extendModeY"), + (D2D1_INTERPOLATION_MODE, "interpolationMode"), +]) + +D2D1_BITMAP_BRUSH_PROPERTIES1 = Struct("D2D1_BITMAP_BRUSH_PROPERTIES1", [ + (D2D1_EXTEND_MODE, "extendModeX"), + (D2D1_EXTEND_MODE, "extendModeY"), + (D2D1_INTERPOLATION_MODE, "interpolationMode"), +]) + +D2D1_STROKE_STYLE_PROPERTIES1 = Struct("D2D1_STROKE_STYLE_PROPERTIES1", [ + (D2D1_CAP_STYLE, "startCap"), + (D2D1_CAP_STYLE, "endCap"), + (D2D1_CAP_STYLE, "dashCap"), + (D2D1_LINE_JOIN, "lineJoin"), + (FLOAT, "miterLimit"), + (D2D1_DASH_STYLE, "dashStyle"), + (FLOAT, "dashOffset"), + (D2D1_STROKE_TRANSFORM_TYPE, "transformType"), +]) + +D2D1_LAYER_OPTIONS1 = Enum("D2D1_LAYER_OPTIONS1", [ + "D2D1_LAYER_OPTIONS1_NONE", + "D2D1_LAYER_OPTIONS1_INITIALIZE_FROM_BACKGROUND", + "D2D1_LAYER_OPTIONS1_IGNORE_ALPHA", + "D2D1_LAYER_OPTIONS1_FORCE_DWORD", +]) + +D2D1_LAYER_PARAMETERS1 = Struct("D2D1_LAYER_PARAMETERS1", [ + (D2D1_RECT_F, "contentBounds"), + (ObjPointer(ID2D1Geometry), "geometricMask"), + (D2D1_ANTIALIAS_MODE, "maskAntialiasMode"), + (D2D1_MATRIX_3X2_F, "maskTransform"), + (FLOAT, "opacity"), + (ObjPointer(ID2D1Brush), "opacityBrush"), + (D2D1_LAYER_OPTIONS1, "layerOptions"), +]) + +D2D1_PRINT_FONT_SUBSET_MODE = Enum("D2D1_PRINT_FONT_SUBSET_MODE", [ + "D2D1_PRINT_FONT_SUBSET_MODE_DEFAULT", + "D2D1_PRINT_FONT_SUBSET_MODE_EACHPAGE", + "D2D1_PRINT_FONT_SUBSET_MODE_NONE", + "D2D1_PRINT_FONT_SUBSET_MODE_FORCE_DWORD", +]) + +D2D1_DRAWING_STATE_DESCRIPTION1 = Struct("D2D1_DRAWING_STATE_DESCRIPTION1", [ + (D2D1_ANTIALIAS_MODE, "antialiasMode"), + (D2D1_TEXT_ANTIALIAS_MODE, "textAntialiasMode"), + (D2D1_TAG, "tag1"), + (D2D1_TAG, "tag2"), + (D2D1_MATRIX_3X2_F, "transform"), + (D2D1_PRIMITIVE_BLEND, "primitiveBlend"), + (D2D1_UNIT_MODE, "unitMode"), +]) + +D2D1_PRINT_CONTROL_PROPERTIES = Struct("D2D1_PRINT_CONTROL_PROPERTIES", [ + (D2D1_PRINT_FONT_SUBSET_MODE, "fontSubset"), + (FLOAT, "rasterDPI"), + (D2D1_COLOR_SPACE, "colorSpace"), +]) + +D2D1_CREATION_PROPERTIES = Struct("D2D1_CREATION_PROPERTIES", [ + (D2D1_THREADING_MODE, "threadingMode"), + (D2D1_DEBUG_LEVEL, "debugLevel"), + (D2D1_DEVICE_CONTEXT_OPTIONS, "options"), +]) + +ID2D1GdiMetafileSink.methods += [ + StdMethod(HRESULT, "ProcessRecord", [(DWORD, "recordType"), (OpaqueBlob(Const(Void), "recordDataSize"), "recordData"), (DWORD, "recordDataSize")]), +] + +ID2D1GdiMetafile.methods += [ + StdMethod(HRESULT, "Stream", [(ObjPointer(ID2D1GdiMetafileSink), "sink")]), + StdMethod(HRESULT, "GetBounds", [Out(Pointer(D2D1_RECT_F), "bounds")]), +] + +ID2D1CommandSink.methods += [ + StdMethod(HRESULT, "BeginDraw", []), + StdMethod(HRESULT, "EndDraw", []), + StdMethod(HRESULT, "SetAntialiasMode", [(D2D1_ANTIALIAS_MODE, "antialiasMode")]), + StdMethod(HRESULT, "SetTags", [(D2D1_TAG, "tag1"), (D2D1_TAG, "tag2")]), + StdMethod(HRESULT, "SetTextAntialiasMode", [(D2D1_TEXT_ANTIALIAS_MODE, "textAntialiasMode")]), + StdMethod(HRESULT, "SetTextRenderingParams", [(ObjPointer(IDWriteRenderingParams), "textRenderingParams")]), + StdMethod(HRESULT, "SetTransform", [(Pointer(Const(D2D1_MATRIX_3X2_F)), "transform")]), + StdMethod(HRESULT, "SetPrimitiveBlend", [(D2D1_PRIMITIVE_BLEND, "primitiveBlend")]), + StdMethod(HRESULT, "SetUnitMode", [(D2D1_UNIT_MODE, "unitMode")]), + StdMethod(HRESULT, "Clear", [(Pointer(Const(D2D1_COLOR_F)), "color")]), + StdMethod(HRESULT, "DrawGlyphRun", [(D2D1_POINT_2F, "baselineOrigin"), (Pointer(Const(DWRITE_GLYPH_RUN)), "glyphRun"), (Pointer(Const(DWRITE_GLYPH_RUN_DESCRIPTION)), "glyphRunDescription"), (ObjPointer(ID2D1Brush), "foregroundBrush"), (DWRITE_MEASURING_MODE, "measuringMode")]), + StdMethod(HRESULT, "DrawLine", [(D2D1_POINT_2F, "point0"), (D2D1_POINT_2F, "point1"), (ObjPointer(ID2D1Brush), "brush"), (FLOAT, "strokeWidth"), (ObjPointer(ID2D1StrokeStyle), "strokeStyle")]), + StdMethod(HRESULT, "DrawGeometry", [(ObjPointer(ID2D1Geometry), "geometry"), (ObjPointer(ID2D1Brush), "brush"), (FLOAT, "strokeWidth"), (ObjPointer(ID2D1StrokeStyle), "strokeStyle")]), + StdMethod(HRESULT, "DrawRectangle", [(Pointer(Const(D2D1_RECT_F)), "rect"), (ObjPointer(ID2D1Brush), "brush"), (FLOAT, "strokeWidth"), (ObjPointer(ID2D1StrokeStyle), "strokeStyle")]), + StdMethod(HRESULT, "DrawBitmap", [(ObjPointer(ID2D1Bitmap), "bitmap"), (Pointer(Const(D2D1_RECT_F)), "destinationRectangle"), (FLOAT, "opacity"), (D2D1_INTERPOLATION_MODE, "interpolationMode"), (Pointer(Const(D2D1_RECT_F)), "sourceRectangle"), (Pointer(Const(D2D1_MATRIX_4X4_F)), "perspectiveTransform")]), + StdMethod(HRESULT, "DrawImage", [(ObjPointer(ID2D1Image), "image"), (Pointer(Const(D2D1_POINT_2F)), "targetOffset"), (Pointer(Const(D2D1_RECT_F)), "imageRectangle"), (D2D1_INTERPOLATION_MODE, "interpolationMode"), (D2D1_COMPOSITE_MODE, "compositeMode")]), + StdMethod(HRESULT, "DrawGdiMetafile", [(ObjPointer(ID2D1GdiMetafile), "gdiMetafile"), (Pointer(Const(D2D1_POINT_2F)), "targetOffset")]), + StdMethod(HRESULT, "FillMesh", [(ObjPointer(ID2D1Mesh), "mesh"), (ObjPointer(ID2D1Brush), "brush")]), + StdMethod(HRESULT, "FillOpacityMask", [(ObjPointer(ID2D1Bitmap), "opacityMask"), (ObjPointer(ID2D1Brush), "brush"), (Pointer(Const(D2D1_RECT_F)), "destinationRectangle"), (Pointer(Const(D2D1_RECT_F)), "sourceRectangle")]), + StdMethod(HRESULT, "FillGeometry", [(ObjPointer(ID2D1Geometry), "geometry"), (ObjPointer(ID2D1Brush), "brush"), (ObjPointer(ID2D1Brush), "opacityBrush")]), + StdMethod(HRESULT, "FillRectangle", [(Pointer(Const(D2D1_RECT_F)), "rect"), (ObjPointer(ID2D1Brush), "brush")]), + StdMethod(HRESULT, "PushAxisAlignedClip", [(Pointer(Const(D2D1_RECT_F)), "clipRect"), (D2D1_ANTIALIAS_MODE, "antialiasMode")]), + StdMethod(HRESULT, "PushLayer", [(Pointer(Const(D2D1_LAYER_PARAMETERS1)), "layerParameters1"), (ObjPointer(ID2D1Layer), "layer")]), + StdMethod(HRESULT, "PopAxisAlignedClip", []), + StdMethod(HRESULT, "PopLayer", []), +] + +ID2D1CommandList.methods += [ + StdMethod(HRESULT, "Stream", [(ObjPointer(ID2D1CommandSink), "sink")]), + StdMethod(HRESULT, "Close", []), +] + +ID2D1PrintControl.methods += [ + StdMethod(HRESULT, "AddPage", [(ObjPointer(ID2D1CommandList), "commandList"), (D2D_SIZE_F, "pageSize"), (Opaque("IStream *"), "pagePrintTicketStream"), Out(Pointer(D2D1_TAG), "tag1"), Out(Pointer(D2D1_TAG), "tag2")]), + StdMethod(HRESULT, "Close", []), +] + +ID2D1ImageBrush.methods += [ + StdMethod(Void, "SetImage", [(ObjPointer(ID2D1Image), "image")]), + StdMethod(Void, "SetExtendModeX", [(D2D1_EXTEND_MODE, "extendModeX")]), + StdMethod(Void, "SetExtendModeY", [(D2D1_EXTEND_MODE, "extendModeY")]), + StdMethod(Void, "SetInterpolationMode", [(D2D1_INTERPOLATION_MODE, "interpolationMode")]), + StdMethod(Void, "SetSourceRectangle", [(Pointer(Const(D2D1_RECT_F)), "sourceRectangle")]), + StdMethod(Void, "GetImage", [(Pointer(ObjPointer(ID2D1Image)), "image")], const=True, sideeffects=False), + StdMethod(D2D1_EXTEND_MODE, "GetExtendModeX", [], const=True, sideeffects=False), + StdMethod(D2D1_EXTEND_MODE, "GetExtendModeY", [], const=True, sideeffects=False), + StdMethod(D2D1_INTERPOLATION_MODE, "GetInterpolationMode", [], const=True, sideeffects=False), + StdMethod(Void, "GetSourceRectangle", [Out(Pointer(D2D1_RECT_F), "sourceRectangle")], const=True, sideeffects=False), +] + +ID2D1BitmapBrush1.methods += [ + StdMethod(Void, "SetInterpolationMode1", [(D2D1_INTERPOLATION_MODE, "interpolationMode")]), + StdMethod(D2D1_INTERPOLATION_MODE, "GetInterpolationMode1", [], const=True, sideeffects=False), +] + +ID2D1StrokeStyle1.methods += [ + StdMethod(D2D1_STROKE_TRANSFORM_TYPE, "GetStrokeTransformType", [], const=True, sideeffects=False), +] + +ID2D1PathGeometry1.methods += [ + StdMethod(HRESULT, "ComputePointAndSegmentAtLength", [(FLOAT, "length"), (UINT32, "startSegment"), (Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), (FLOAT, "flatteningTolerance"), Out(Pointer(D2D1_POINT_DESCRIPTION), "pointDescription")], const=True, sideeffects=False), +] + +ID2D1Properties.methods += [ + StdMethod(UINT32, "GetPropertyCount", [], const=True, sideeffects=False), + StdMethod(HRESULT, "GetPropertyName", [(UINT32, "index"), Out(PWSTR, "name"), (UINT32, "nameCount")], const=True, sideeffects=False), + StdMethod(UINT32, "GetPropertyNameLength", [(UINT32, "index")], const=True, sideeffects=False), + StdMethod(D2D1_PROPERTY_TYPE, "GetType", [(UINT32, "index")], const=True, sideeffects=False), + StdMethod(D2D1_PROPERTY_INDEX, "GetPropertyIndex", [(PCWSTR, "name")], const=True, sideeffects=False), + StdMethod(HRESULT, "SetValueByName", [(PCWSTR, "name"), (D2D1_PROPERTY_TYPE, "type"), (Pointer(Const(BYTE)), "data"), (UINT32, "dataSize")]), + StdMethod(HRESULT, "SetValue", [(UINT32, "index"), (D2D1_PROPERTY_TYPE, "type"), (Pointer(Const(BYTE)), "data"), (UINT32, "dataSize")]), + StdMethod(HRESULT, "GetValueByName", [(PCWSTR, "name"), (D2D1_PROPERTY_TYPE, "type"), Out(Pointer(BYTE), "data"), (UINT32, "dataSize")], const=True, sideeffects=False), + StdMethod(HRESULT, "GetValue", [(UINT32, "index"), (D2D1_PROPERTY_TYPE, "type"), Out(Pointer(BYTE), "data"), (UINT32, "dataSize")], const=True, sideeffects=False), + StdMethod(UINT32, "GetValueSize", [(UINT32, "index")], const=True, sideeffects=False), + StdMethod(HRESULT, "GetSubProperties", [(UINT32, "index"), Out(Pointer(ObjPointer(ID2D1Properties)), "subProperties")], const=True), +] + +ID2D1Effect.methods += [ + StdMethod(Void, "SetInput", [(UINT32, "index"), (ObjPointer(ID2D1Image), "input"), (BOOL, "invalidate")]), + StdMethod(HRESULT, "SetInputCount", [(UINT32, "inputCount")]), + StdMethod(Void, "GetInput", [(UINT32, "index"), Out(Pointer(ObjPointer(ID2D1Image)), "input")], const=True), + StdMethod(UINT32, "GetInputCount", [], const=True, sideeffects=False), + StdMethod(Void, "GetOutput", [(Pointer(ObjPointer(ID2D1Image)), "outputImage")], const=True, sideeffects=False), +] + +ID2D1Bitmap1.methods += [ + StdMethod(Void, "GetColorContext", [(Pointer(ObjPointer(ID2D1ColorContext)), "colorContext")], const=True, sideeffects=False), + StdMethod(D2D1_BITMAP_OPTIONS, "GetOptions", [], const=True, sideeffects=False), + StdMethod(HRESULT, "GetSurface", [(Pointer(ObjPointer(IDXGISurface)), "dxgiSurface")], const=True, sideeffects=False), + StdMethod(HRESULT, "Map", [(D2D1_MAP_OPTIONS, "options"), Out(Pointer(D2D1_MAPPED_RECT), "mappedRect")]), + StdMethod(HRESULT, "Unmap", []), +] + +ID2D1ColorContext.methods += [ + StdMethod(D2D1_COLOR_SPACE, "GetColorSpace", [], const=True, sideeffects=False), + StdMethod(UINT32, "GetProfileSize", [], const=True, sideeffects=False), + StdMethod(HRESULT, "GetProfile", [Out(Pointer(BYTE), "profile"), (UINT32, "profileSize")], const=True, sideeffects=False), +] + +ID2D1GradientStopCollection1.methods += [ + StdMethod(Void, "GetGradientStops1", [Out(Array(D2D1_GRADIENT_STOP, "gradientStopsCount"), "gradientStops"), (UINT32, "gradientStopsCount")], const=True, sideeffects=False), + StdMethod(D2D1_COLOR_SPACE, "GetPreInterpolationSpace", [], const=True, sideeffects=False), + StdMethod(D2D1_COLOR_SPACE, "GetPostInterpolationSpace", [], const=True, sideeffects=False), + StdMethod(D2D1_BUFFER_PRECISION, "GetBufferPrecision", [], const=True, sideeffects=False), + StdMethod(D2D1_COLOR_INTERPOLATION_MODE, "GetColorInterpolationMode", [], const=True, sideeffects=False), +] + +ID2D1DrawingStateBlock1.methods += [ + StdMethod(Void, "GetDescription", [Out(Pointer(D2D1_DRAWING_STATE_DESCRIPTION1), "stateDescription")], const=True, sideeffects=False), + StdMethod(Void, "SetDescription", [(Pointer(Const(D2D1_DRAWING_STATE_DESCRIPTION1)), "stateDescription")]), +] + +ID2D1DeviceContext.methods += [ + StdMethod(HRESULT, "CreateBitmap", [(D2D1_SIZE_U, "size"), (OpaquePointer(Const(Void)), "sourceData"), (UINT32, "pitch"), (Pointer(Const(D2D1_BITMAP_PROPERTIES1)), "bitmapProperties"), Out(Pointer(ObjPointer(ID2D1Bitmap1)), "bitmap")]), + StdMethod(HRESULT, "CreateBitmapFromWicBitmap", [(Opaque("IWICBitmapSource *"), "wicBitmapSource"), (Pointer(Const(D2D1_BITMAP_PROPERTIES1)), "bitmapProperties"), Out(Pointer(ObjPointer(ID2D1Bitmap1)), "bitmap")]), + StdMethod(HRESULT, "CreateColorContext", [(D2D1_COLOR_SPACE, "space"), (Pointer(Const(BYTE)), "profile"), (UINT32, "profileSize"), Out(Pointer(ObjPointer(ID2D1ColorContext)), "colorContext")]), + StdMethod(HRESULT, "CreateColorContextFromFilename", [(PCWSTR, "filename"), Out(Pointer(ObjPointer(ID2D1ColorContext)), "colorContext")]), + StdMethod(HRESULT, "CreateColorContextFromWicColorContext", [(Opaque("IWICColorContext *"), "wicColorContext"), Out(Pointer(ObjPointer(ID2D1ColorContext)), "colorContext")]), + StdMethod(HRESULT, "CreateBitmapFromDxgiSurface", [(ObjPointer(IDXGISurface), "surface"), (Pointer(Const(D2D1_BITMAP_PROPERTIES1)), "bitmapProperties"), Out(Pointer(ObjPointer(ID2D1Bitmap1)), "bitmap")]), + StdMethod(HRESULT, "CreateEffect", [(REFCLSID, "effectId"), Out(Pointer(ObjPointer(ID2D1Effect)), "effect")]), + StdMethod(HRESULT, "CreateGradientStopCollection", [(Pointer(Const(D2D1_GRADIENT_STOP)), "straightAlphaGradientStops"), (UINT32, "straightAlphaGradientStopsCount"), (D2D1_COLOR_SPACE, "preInterpolationSpace"), (D2D1_COLOR_SPACE, "postInterpolationSpace"), (D2D1_BUFFER_PRECISION, "bufferPrecision"), (D2D1_EXTEND_MODE, "extendMode"), (D2D1_COLOR_INTERPOLATION_MODE, "colorInterpolationMode"), Out(Pointer(ObjPointer(ID2D1GradientStopCollection1)), "gradientStopCollection1")]), + StdMethod(HRESULT, "CreateImageBrush", [(ObjPointer(ID2D1Image), "image"), (Pointer(Const(D2D1_IMAGE_BRUSH_PROPERTIES)), "imageBrushProperties"), (Pointer(Const(D2D1_BRUSH_PROPERTIES)), "brushProperties"), Out(Pointer(ObjPointer(ID2D1ImageBrush)), "imageBrush")]), + StdMethod(HRESULT, "CreateBitmapBrush", [(ObjPointer(ID2D1Bitmap), "bitmap"), (Pointer(Const(D2D1_BITMAP_BRUSH_PROPERTIES1)), "bitmapBrushProperties"), (Pointer(Const(D2D1_BRUSH_PROPERTIES)), "brushProperties"), Out(Pointer(ObjPointer(ID2D1BitmapBrush1)), "bitmapBrush")]), + StdMethod(HRESULT, "CreateCommandList", [(Pointer(ObjPointer(ID2D1CommandList)), "commandList")]), + StdMethod(BOOL, "IsDxgiFormatSupported", [(DXGI_FORMAT, "format")], const=True, sideeffects=False), + StdMethod(BOOL, "IsBufferPrecisionSupported", [(D2D1_BUFFER_PRECISION, "bufferPrecision")], const=True, sideeffects=False), + StdMethod(HRESULT, "GetImageLocalBounds", [(ObjPointer(ID2D1Image), "image"), Out(Pointer(D2D1_RECT_F), "localBounds")], const=True, sideeffects=False), + StdMethod(HRESULT, "GetImageWorldBounds", [(ObjPointer(ID2D1Image), "image"), Out(Pointer(D2D1_RECT_F), "worldBounds")], const=True, sideeffects=False), + StdMethod(HRESULT, "GetGlyphRunWorldBounds", [(D2D1_POINT_2F, "baselineOrigin"), (Pointer(Const(DWRITE_GLYPH_RUN)), "glyphRun"), (DWRITE_MEASURING_MODE, "measuringMode"), Out(Pointer(D2D1_RECT_F), "bounds")], const=True, sideeffects=False), + StdMethod(Void, "GetDevice", [(Pointer(ObjPointer(ID2D1Device)), "device")], const=True, sideeffects=False), + StdMethod(Void, "SetTarget", [(ObjPointer(ID2D1Image), "image")]), + StdMethod(Void, "GetTarget", [(Pointer(ObjPointer(ID2D1Image)), "image")], const=True, sideeffects=False), + StdMethod(Void, "SetRenderingControls", [(Pointer(Const(D2D1_RENDERING_CONTROLS)), "renderingControls")]), + StdMethod(Void, "GetRenderingControls", [Out(Pointer(D2D1_RENDERING_CONTROLS), "renderingControls")], const=True, sideeffects=False), + StdMethod(Void, "SetPrimitiveBlend", [(D2D1_PRIMITIVE_BLEND, "primitiveBlend")]), + StdMethod(D2D1_PRIMITIVE_BLEND, "GetPrimitiveBlend", [], const=True, sideeffects=False), + StdMethod(Void, "SetUnitMode", [(D2D1_UNIT_MODE, "unitMode")]), + StdMethod(D2D1_UNIT_MODE, "GetUnitMode", [], const=True, sideeffects=False), + StdMethod(Void, "DrawGlyphRun", [(D2D1_POINT_2F, "baselineOrigin"), (Pointer(Const(DWRITE_GLYPH_RUN)), "glyphRun"), (Pointer(Const(DWRITE_GLYPH_RUN_DESCRIPTION)), "glyphRunDescription"), (ObjPointer(ID2D1Brush), "foregroundBrush"), (DWRITE_MEASURING_MODE, "measuringMode")]), + StdMethod(Void, "DrawImage", [(ObjPointer(ID2D1Image), "image"), (Pointer(Const(D2D1_POINT_2F)), "targetOffset"), (Pointer(Const(D2D1_RECT_F)), "imageRectangle"), (D2D1_INTERPOLATION_MODE, "interpolationMode"), (D2D1_COMPOSITE_MODE, "compositeMode")]), + StdMethod(Void, "DrawGdiMetafile", [(ObjPointer(ID2D1GdiMetafile), "gdiMetafile"), (Pointer(Const(D2D1_POINT_2F)), "targetOffset")]), + StdMethod(Void, "DrawBitmap", [(ObjPointer(ID2D1Bitmap), "bitmap"), (Pointer(Const(D2D1_RECT_F)), "destinationRectangle"), (FLOAT, "opacity"), (D2D1_INTERPOLATION_MODE, "interpolationMode"), (Pointer(Const(D2D1_RECT_F)), "sourceRectangle"), (Pointer(Const(D2D1_MATRIX_4X4_F)), "perspectiveTransform")]), + StdMethod(Void, "PushLayer", [(Pointer(Const(D2D1_LAYER_PARAMETERS1)), "layerParameters"), (ObjPointer(ID2D1Layer), "layer")]), + StdMethod(HRESULT, "InvalidateEffectInputRectangle", [(ObjPointer(ID2D1Effect), "effect"), (UINT32, "input"), (Pointer(Const(D2D1_RECT_F)), "inputRectangle")]), + StdMethod(HRESULT, "GetEffectInvalidRectangleCount", [(ObjPointer(ID2D1Effect), "effect"), Out(Pointer(UINT32), "rectangleCount")]), + StdMethod(HRESULT, "GetEffectInvalidRectangles", [(ObjPointer(ID2D1Effect), "effect"), Out(Pointer(D2D1_RECT_F), "rectangles"), (UINT32, "rectanglesCount")]), + StdMethod(HRESULT, "GetEffectRequiredInputRectangles", [(ObjPointer(ID2D1Effect), "renderEffect"), (Pointer(Const(D2D1_RECT_F)), "renderImageRectangle"), (Pointer(Const(D2D1_EFFECT_INPUT_DESCRIPTION)), "inputDescriptions"), Out(Pointer(D2D1_RECT_F), "requiredInputRects"), (UINT32, "inputCount")]), + StdMethod(Void, "FillOpacityMask", [(ObjPointer(ID2D1Bitmap), "opacityMask"), (ObjPointer(ID2D1Brush), "brush"), (Pointer(Const(D2D1_RECT_F)), "destinationRectangle"), (Pointer(Const(D2D1_RECT_F)), "sourceRectangle")]), +] + +ID2D1Device.methods += [ + StdMethod(HRESULT, "CreateDeviceContext", [(D2D1_DEVICE_CONTEXT_OPTIONS, "options"), Out(Pointer(ObjPointer(ID2D1DeviceContext)), "deviceContext")]), + StdMethod(HRESULT, "CreatePrintControl", [(Opaque("IWICImagingFactory *"), "wicFactory"), (Opaque("IPrintDocumentPackageTarget *"), "documentTarget"), (Pointer(Const(D2D1_PRINT_CONTROL_PROPERTIES)), "printControlProperties"), Out(Pointer(ObjPointer(ID2D1PrintControl)), "printControl")]), + StdMethod(Void, "SetMaximumTextureMemory", [(UINT64, "maximumInBytes")]), + StdMethod(UINT64, "GetMaximumTextureMemory", [], const=True, sideeffects=False), + StdMethod(Void, "ClearResources", [(UINT32, "millisecondsSinceUse")]), +] + +D2D1_PROPERTY_BINDING = Struct("D2D1_PROPERTY_BINDING", []) + +PD2D1_EFFECT_FACTORY = Opaque("PD2D1_EFFECT_FACTORY") + +ID2D1Factory1.methods += [ + StdMethod(HRESULT, "CreateDevice", [(Opaque("IDXGIDevice *"), "dxgiDevice"), Out(Pointer(ObjPointer(ID2D1Device)), "d2dDevice")]), + StdMethod(HRESULT, "CreateStrokeStyle", [(Pointer(Const(D2D1_STROKE_STYLE_PROPERTIES1)), "strokeStyleProperties"), (Pointer(Const(FLOAT)), "dashes"), (UINT32, "dashesCount"), Out(Pointer(ObjPointer(ID2D1StrokeStyle1)), "strokeStyle")]), + StdMethod(HRESULT, "CreatePathGeometry", [(Pointer(ObjPointer(ID2D1PathGeometry1)), "pathGeometry")]), + StdMethod(HRESULT, "CreateDrawingStateBlock", [(Pointer(Const(D2D1_DRAWING_STATE_DESCRIPTION1)), "drawingStateDescription"), (ObjPointer(IDWriteRenderingParams), "textRenderingParams"), Out(Pointer(ObjPointer(ID2D1DrawingStateBlock1)), "drawingStateBlock")]), + StdMethod(HRESULT, "CreateGdiMetafile", [(Opaque("IStream *"), "metafileStream"), Out(Pointer(ObjPointer(ID2D1GdiMetafile)), "metafile")]), + StdMethod(HRESULT, "RegisterEffectFromStream", [(REFCLSID, "classId"), (Opaque("IStream *"), "propertyXml"), (Pointer(Const(D2D1_PROPERTY_BINDING)), "bindings"), (UINT32, "bindingsCount"), (Const(PD2D1_EFFECT_FACTORY), "effectFactory")]), + StdMethod(HRESULT, "RegisterEffectFromString", [(REFCLSID, "classId"), (PCWSTR, "propertyXml"), (Pointer(Const(D2D1_PROPERTY_BINDING)), "bindings"), (UINT32, "bindingsCount"), (Const(PD2D1_EFFECT_FACTORY), "effectFactory")]), + StdMethod(HRESULT, "UnregisterEffect", [(REFCLSID, "classId")]), + StdMethod(HRESULT, "GetRegisteredEffects", [Out(Pointer(CLSID), "effects"), (UINT32, "effectsCount"), Out(Pointer(UINT32), "effectsReturned"), Out(Pointer(UINT32), "effectsRegistered")], const=True, sideeffects=False), + StdMethod(HRESULT, "GetEffectProperties", [(REFCLSID, "effectId"), Out(Pointer(ObjPointer(ID2D1Properties)), "properties")], const=True), +] + +ID2D1Multithread.methods += [ + StdMethod(BOOL, "GetMultithreadProtected", [], const=True, sideeffects=False), + StdMethod(Void, "Enter", []), + StdMethod(Void, "Leave", []), +] + +d2d1.addInterfaces([ + ID2D1Factory1, + ID2D1Multithread, +]) +d2d1.addFunctions([ + StdFunction(HRESULT, "D2D1CreateDevice", [(Opaque("IDXGIDevice *"), "dxgiDevice"), (Pointer(Const(D2D1_CREATION_PROPERTIES)), "creationProperties"), Out(Pointer(ObjPointer(ID2D1Device)), "d2dDevice")]), + StdFunction(HRESULT, "D2D1CreateDeviceContext", [(ObjPointer(IDXGISurface), "dxgiSurface"), (Pointer(Const(D2D1_CREATION_PROPERTIES)), "creationProperties"), Out(Pointer(ObjPointer(ID2D1DeviceContext)), "d2dDeviceContext")]), + StdFunction(D2D1_COLOR_F, "D2D1ConvertColorSpace", [(D2D1_COLOR_SPACE, "sourceColorSpace"), (D2D1_COLOR_SPACE, "destinationColorSpace"), (Pointer(Const(D2D1_COLOR_F)), "color")]), + StdFunction(Void, "D2D1SinCos", [(FLOAT, "angle"), Out(Pointer(FLOAT), "s"), Out(Pointer(FLOAT), "c")]), + StdFunction(FLOAT, "D2D1Tan", [(FLOAT, "angle")]), + StdFunction(FLOAT, "D2D1Vec3Length", [(FLOAT, "x"), (FLOAT, "y"), (FLOAT, "z")]), +]) diff --git a/specs/dwrite.py b/specs/dwrite.py index 1a8aae0e..60e5034c 100644 --- a/specs/dwrite.py +++ b/specs/dwrite.py @@ -267,7 +267,7 @@ IDWriteFontFileEnumerator.methods += [ IDWriteLocalizedStrings.methods += [ StdMethod(UINT32, "GetCount", []), - StdMethod(HRESULT, "FindLocaleName", [(Pointer(Const(WCHAR)), "localeName"), Out(Pointer(UINT32), "index"), Out(Pointer(BOOL), "exists")]), + StdMethod(HRESULT, "FindLocaleName", [(PCWSTR, "localeName"), Out(Pointer(UINT32), "index"), Out(Pointer(BOOL), "exists")]), StdMethod(HRESULT, "GetLocaleNameLength", [(UINT32, "index"), Out(Pointer(UINT32), "length")]), StdMethod(HRESULT, "GetLocaleName", [(UINT32, "index"), Out(Pointer(WCHAR), "localeName"), (UINT32, "size")]), StdMethod(HRESULT, "GetStringLength", [(UINT32, "index"), Out(Pointer(UINT32), "length")]), @@ -277,7 +277,7 @@ IDWriteLocalizedStrings.methods += [ IDWriteFontCollection.methods += [ StdMethod(UINT32, "GetFontFamilyCount", []), StdMethod(HRESULT, "GetFontFamily", [(UINT32, "index"), Out(Pointer(ObjPointer(IDWriteFontFamily)), "fontFamily")]), - StdMethod(HRESULT, "FindFamilyName", [(Pointer(Const(WCHAR)), "familyName"), Out(Pointer(UINT32), "index"), Out(Pointer(BOOL), "exists")]), + StdMethod(HRESULT, "FindFamilyName", [(PCWSTR, "familyName"), Out(Pointer(UINT32), "index"), Out(Pointer(BOOL), "exists")]), StdMethod(HRESULT, "GetFontFromFontFace", [(ObjPointer(IDWriteFontFace), "fontFace"), Out(Pointer(ObjPointer(IDWriteFont)), "font")]), ] @@ -550,9 +550,9 @@ IDWriteTextAnalyzer.methods += [ StdMethod(HRESULT, "AnalyzeBidi", [(ObjPointer(IDWriteTextAnalysisSource), "analysisSource"), (UINT32, "textPosition"), (UINT32, "textLength"), (ObjPointer(IDWriteTextAnalysisSink), "analysisSink")]), StdMethod(HRESULT, "AnalyzeNumberSubstitution", [(ObjPointer(IDWriteTextAnalysisSource), "analysisSource"), (UINT32, "textPosition"), (UINT32, "textLength"), (ObjPointer(IDWriteTextAnalysisSink), "analysisSink")]), StdMethod(HRESULT, "AnalyzeLineBreakpoints", [(ObjPointer(IDWriteTextAnalysisSource), "analysisSource"), (UINT32, "textPosition"), (UINT32, "textLength"), (ObjPointer(IDWriteTextAnalysisSink), "analysisSink")]), - StdMethod(HRESULT, "GetGlyphs", [(Pointer(Const(WCHAR)), "textString"), (UINT32, "textLength"), (ObjPointer(IDWriteFontFace), "fontFace"), (BOOL, "isSideways"), (BOOL, "isRightToLeft"), (Pointer(Const(DWRITE_SCRIPT_ANALYSIS)), "scriptAnalysis"), (Pointer(Const(WCHAR)), "localeName"), (ObjPointer(IDWriteNumberSubstitution), "numberSubstitution"), (OpaquePointer(Pointer(Const(DWRITE_TYPOGRAPHIC_FEATURES))), "features"), (Pointer(Const(UINT32)), "featureRangeLengths"), (UINT32, "featureRanges"), (UINT32, "maxGlyphCount"), Out(Pointer(UINT16), "clusterMap"), Out(Pointer(DWRITE_SHAPING_TEXT_PROPERTIES), "textProps"), Out(Pointer(UINT16), "glyphIndices"), Out(Pointer(DWRITE_SHAPING_GLYPH_PROPERTIES), "glyphProps"), Out(Pointer(UINT32), "actualGlyphCount")]), - StdMethod(HRESULT, "GetGlyphPlacements", [(Array(Const(WCHAR), "textLength"), "textString"), (Array(Const(UINT16), "textLength"), "clusterMap"), (Array(DWRITE_SHAPING_TEXT_PROPERTIES, "textLength"), "textProps"), (UINT32, "textLength"), (Array(Const(UINT16), "glyphCount"), "glyphIndices"), (Array(Const(DWRITE_SHAPING_GLYPH_PROPERTIES), "glyphCount"), "glyphProps"), (UINT32, "glyphCount"), (ObjPointer(IDWriteFontFace), "fontFace"), (FLOAT, "fontEmSize"), (BOOL, "isSideways"), (BOOL, "isRightToLeft"), (Pointer(Const(DWRITE_SCRIPT_ANALYSIS)), "scriptAnalysis"), (LPCWSTR, "localeName"), (Array(Pointer(Const(DWRITE_TYPOGRAPHIC_FEATURES)), "featureRanges"), "features"), (Array(Const(UINT32), "featureRanges"), "featureRangeLengths"), (UINT32, "featureRanges"), Out(Array(FLOAT, "glyphCount"), "glyphAdvances"), Out(Array(DWRITE_GLYPH_OFFSET, "glyphCount"), "glyphOffsets")]), - StdMethod(HRESULT, "GetGdiCompatibleGlyphPlacements", [(Array(Const(WCHAR), "textLength"), "textString"), (Array(Const(UINT16), "textLength"), "clusterMap"), (Array(DWRITE_SHAPING_TEXT_PROPERTIES, "textLength"), "textProps"), (UINT32, "textLength"), (Array(Const(UINT16), "glyphCount"), "glyphIndices"), (Array(Const(DWRITE_SHAPING_GLYPH_PROPERTIES), "glyphCount"), "glyphProps"), (UINT32, "glyphCount"), (ObjPointer(IDWriteFontFace), "fontFace"), (FLOAT, "fontEmSize"), (FLOAT, "pixelsPerDip"), (Pointer(Const(DWRITE_MATRIX)), "transform"), (BOOL, "useGdiNatural"), (BOOL, "isSideways"), (BOOL, "isRightToLeft"), (Pointer(Const(DWRITE_SCRIPT_ANALYSIS)), "scriptAnalysis"), (LPCWSTR, "localeName"), (Array(Pointer(Const(DWRITE_TYPOGRAPHIC_FEATURES)), "featureRanges"), "features"), (Array(Const(UINT32), "featureRanges"), "featureRangeLengths"), (UINT32, "featureRanges"), Out(Array(FLOAT, "glyphCount"), "glyphAdvances"), Out(Array(DWRITE_GLYPH_OFFSET, "glyphCount"), "glyphOffsets")]), + StdMethod(HRESULT, "GetGlyphs", [(String(Const(WCHAR), "textLength", wide=True), "textString"), (UINT32, "textLength"), (ObjPointer(IDWriteFontFace), "fontFace"), (BOOL, "isSideways"), (BOOL, "isRightToLeft"), (Pointer(Const(DWRITE_SCRIPT_ANALYSIS)), "scriptAnalysis"), (PCWSTR, "localeName"), (ObjPointer(IDWriteNumberSubstitution), "numberSubstitution"), (OpaquePointer(Pointer(Const(DWRITE_TYPOGRAPHIC_FEATURES))), "features"), (Pointer(Const(UINT32)), "featureRangeLengths"), (UINT32, "featureRanges"), (UINT32, "maxGlyphCount"), Out(Pointer(UINT16), "clusterMap"), Out(Pointer(DWRITE_SHAPING_TEXT_PROPERTIES), "textProps"), Out(Pointer(UINT16), "glyphIndices"), Out(Pointer(DWRITE_SHAPING_GLYPH_PROPERTIES), "glyphProps"), Out(Pointer(UINT32), "actualGlyphCount")]), + StdMethod(HRESULT, "GetGlyphPlacements", [(String(Const(WCHAR), "textLength", wide=True), "textString"), (Array(Const(UINT16), "textLength"), "clusterMap"), (Array(DWRITE_SHAPING_TEXT_PROPERTIES, "textLength"), "textProps"), (UINT32, "textLength"), (Array(Const(UINT16), "glyphCount"), "glyphIndices"), (Array(Const(DWRITE_SHAPING_GLYPH_PROPERTIES), "glyphCount"), "glyphProps"), (UINT32, "glyphCount"), (ObjPointer(IDWriteFontFace), "fontFace"), (FLOAT, "fontEmSize"), (BOOL, "isSideways"), (BOOL, "isRightToLeft"), (Pointer(Const(DWRITE_SCRIPT_ANALYSIS)), "scriptAnalysis"), (LPCWSTR, "localeName"), (Array(Pointer(Const(DWRITE_TYPOGRAPHIC_FEATURES)), "featureRanges"), "features"), (Array(Const(UINT32), "featureRanges"), "featureRangeLengths"), (UINT32, "featureRanges"), Out(Array(FLOAT, "glyphCount"), "glyphAdvances"), Out(Array(DWRITE_GLYPH_OFFSET, "glyphCount"), "glyphOffsets")]), + StdMethod(HRESULT, "GetGdiCompatibleGlyphPlacements", [(String(Const(WCHAR), "textLength", wide=True), "textString"), (Array(Const(UINT16), "textLength"), "clusterMap"), (Array(DWRITE_SHAPING_TEXT_PROPERTIES, "textLength"), "textProps"), (UINT32, "textLength"), (Array(Const(UINT16), "glyphCount"), "glyphIndices"), (Array(Const(DWRITE_SHAPING_GLYPH_PROPERTIES), "glyphCount"), "glyphProps"), (UINT32, "glyphCount"), (ObjPointer(IDWriteFontFace), "fontFace"), (FLOAT, "fontEmSize"), (FLOAT, "pixelsPerDip"), (Pointer(Const(DWRITE_MATRIX)), "transform"), (BOOL, "useGdiNatural"), (BOOL, "isSideways"), (BOOL, "isRightToLeft"), (Pointer(Const(DWRITE_SCRIPT_ANALYSIS)), "scriptAnalysis"), (LPCWSTR, "localeName"), (Array(Pointer(Const(DWRITE_TYPOGRAPHIC_FEATURES)), "featureRanges"), "features"), (Array(Const(UINT32), "featureRanges"), "featureRangeLengths"), (UINT32, "featureRanges"), Out(Array(FLOAT, "glyphCount"), "glyphAdvances"), Out(Array(DWRITE_GLYPH_OFFSET, "glyphCount"), "glyphOffsets")]), ] DWRITE_GLYPH_RUN = Struct("DWRITE_GLYPH_RUN", [ @@ -567,8 +567,8 @@ DWRITE_GLYPH_RUN = Struct("DWRITE_GLYPH_RUN", [ ]) DWRITE_GLYPH_RUN_DESCRIPTION = Struct("DWRITE_GLYPH_RUN_DESCRIPTION", [ - (Pointer(Const(WCHAR)), "localeName"), - (Pointer(Const(WCHAR)), "string"), + (PCWSTR, "localeName"), + (String(Const(WCHAR), "{self}.stringLength", wide=True), "string"), (UINT32, "stringLength"), (Pointer(Const(UINT16)), "clusterMap"), (UINT32, "textPosition"), @@ -581,7 +581,7 @@ DWRITE_UNDERLINE = Struct("DWRITE_UNDERLINE", [ (FLOAT, "runHeight"), (DWRITE_READING_DIRECTION, "readingDirection"), (DWRITE_FLOW_DIRECTION, "flowDirection"), - (Pointer(Const(WCHAR)), "localeName"), + (PCWSTR, "localeName"), (DWRITE_MEASURING_MODE, "measuringMode"), ]) @@ -591,7 +591,7 @@ DWRITE_STRIKETHROUGH = Struct("DWRITE_STRIKETHROUGH", [ (FLOAT, "offset"), (DWRITE_READING_DIRECTION, "readingDirection"), (DWRITE_FLOW_DIRECTION, "flowDirection"), - (Pointer(Const(WCHAR)), "localeName"), + (PCWSTR, "localeName"), (DWRITE_MEASURING_MODE, "measuringMode"), ]) @@ -670,14 +670,14 @@ IDWriteTextRenderer.methods += [ StdMethod(HRESULT, "DrawGlyphRun", [(OpaquePointer(Void), "clientDrawingContext"), (FLOAT, "baselineOriginX"), (FLOAT, "baselineOriginY"), (DWRITE_MEASURING_MODE, "measuringMode"), (Pointer(Const(DWRITE_GLYPH_RUN)), "glyphRun"), (Pointer(Const(DWRITE_GLYPH_RUN_DESCRIPTION)), "glyphRunDescription"), (ObjPointer(IUnknown), "clientDrawingEffect")]), StdMethod(HRESULT, "DrawUnderline", [(OpaquePointer(Void), "clientDrawingContext"), (FLOAT, "baselineOriginX"), (FLOAT, "baselineOriginY"), (Pointer(Const(DWRITE_UNDERLINE)), "underline"), (ObjPointer(IUnknown), "clientDrawingEffect")]), StdMethod(HRESULT, "DrawStrikethrough", [(OpaquePointer(Void), "clientDrawingContext"), (FLOAT, "baselineOriginX"), (FLOAT, "baselineOriginY"), (Pointer(Const(DWRITE_STRIKETHROUGH)), "strikethrough"), (ObjPointer(IUnknown), "clientDrawingEffect")]), - StdMethod(HRESULT, "DrawInlineObject", [(OpaquePointer(Void), "clientDrawingContext"), (FLOAT, "originX"), (FLOAT, "originY"), (ObjPointer(IDWriteInlineObject), "inlineObject"), (BOOL, "isSideways"), (BOOL, "isRightToLeft"), (ObjPointer(IUnknown), "clientDrawingEffect")]), + StdMethod(HRESULT, "DrawInlineObject", [(OpaquePointer(Void), "clientDrawingContext"), (FLOAT, "originX"), (FLOAT, "originY"), (OpaquePointer(IDWriteInlineObject), "inlineObject"), (BOOL, "isSideways"), (BOOL, "isRightToLeft"), (ObjPointer(IUnknown), "clientDrawingEffect")]), ] IDWriteTextLayout.methods += [ StdMethod(HRESULT, "SetMaxWidth", [(FLOAT, "maxWidth")]), StdMethod(HRESULT, "SetMaxHeight", [(FLOAT, "maxHeight")]), StdMethod(HRESULT, "SetFontCollection", [(ObjPointer(IDWriteFontCollection), "fontCollection"), (DWRITE_TEXT_RANGE, "textRange")]), - StdMethod(HRESULT, "SetFontFamilyName", [(Pointer(Const(WCHAR)), "fontFamilyName"), (DWRITE_TEXT_RANGE, "textRange")]), + StdMethod(HRESULT, "SetFontFamilyName", [(PCWSTR, "fontFamilyName"), (DWRITE_TEXT_RANGE, "textRange")]), StdMethod(HRESULT, "SetFontWeight", [(DWRITE_FONT_WEIGHT, "fontWeight"), (DWRITE_TEXT_RANGE, "textRange")]), StdMethod(HRESULT, "SetFontStyle", [(DWRITE_FONT_STYLE, "fontStyle"), (DWRITE_TEXT_RANGE, "textRange")]), StdMethod(HRESULT, "SetFontStretch", [(DWRITE_FONT_STRETCH, "fontStretch"), (DWRITE_TEXT_RANGE, "textRange")]), @@ -685,9 +685,9 @@ IDWriteTextLayout.methods += [ StdMethod(HRESULT, "SetUnderline", [(BOOL, "hasUnderline"), (DWRITE_TEXT_RANGE, "textRange")]), StdMethod(HRESULT, "SetStrikethrough", [(BOOL, "hasStrikethrough"), (DWRITE_TEXT_RANGE, "textRange")]), StdMethod(HRESULT, "SetDrawingEffect", [(ObjPointer(IUnknown), "drawingEffect"), (DWRITE_TEXT_RANGE, "textRange")]), - StdMethod(HRESULT, "SetInlineObject", [(ObjPointer(IDWriteInlineObject), "inlineObject"), (DWRITE_TEXT_RANGE, "textRange")]), + StdMethod(HRESULT, "SetInlineObject", [(OpaquePointer(IDWriteInlineObject), "inlineObject"), (DWRITE_TEXT_RANGE, "textRange")]), StdMethod(HRESULT, "SetTypography", [(ObjPointer(IDWriteTypography), "typography"), (DWRITE_TEXT_RANGE, "textRange")]), - StdMethod(HRESULT, "SetLocaleName", [(Pointer(Const(WCHAR)), "localeName"), (DWRITE_TEXT_RANGE, "textRange")]), + StdMethod(HRESULT, "SetLocaleName", [(PCWSTR, "localeName"), (DWRITE_TEXT_RANGE, "textRange")]), StdMethod(FLOAT, "GetMaxWidth", []), StdMethod(FLOAT, "GetMaxHeight", []), StdMethod(HRESULT, "GetFontCollection", [(UINT32, "currentPosition"), Out(Pointer(ObjPointer(IDWriteFontCollection)), "fontCollection"), Out(Pointer(DWRITE_TEXT_RANGE), "textRange")]), @@ -700,7 +700,7 @@ IDWriteTextLayout.methods += [ StdMethod(HRESULT, "GetUnderline", [(UINT32, "currentPosition"), Out(Pointer(BOOL), "hasUnderline"), Out(Pointer(DWRITE_TEXT_RANGE), "textRange")]), StdMethod(HRESULT, "GetStrikethrough", [(UINT32, "currentPosition"), Out(Pointer(BOOL), "hasStrikethrough"), Out(Pointer(DWRITE_TEXT_RANGE), "textRange")]), StdMethod(HRESULT, "GetDrawingEffect", [(UINT32, "currentPosition"), Out(Pointer(ObjPointer(IUnknown)), "drawingEffect"), Out(Pointer(DWRITE_TEXT_RANGE), "textRange")]), - StdMethod(HRESULT, "GetInlineObject", [(UINT32, "currentPosition"), Out(Pointer(ObjPointer(IDWriteInlineObject)), "inlineObject"), Out(Pointer(DWRITE_TEXT_RANGE), "textRange")]), + StdMethod(HRESULT, "GetInlineObject", [(UINT32, "currentPosition"), Out(Pointer(OpaquePointer(IDWriteInlineObject)), "inlineObject"), Out(Pointer(DWRITE_TEXT_RANGE), "textRange")]), StdMethod(HRESULT, "GetTypography", [(UINT32, "currentPosition"), Out(Pointer(ObjPointer(IDWriteTypography)), "typography"), Out(Pointer(DWRITE_TEXT_RANGE), "textRange")]), StdMethod(HRESULT, "GetLocaleNameLength", [(UINT32, "currentPosition"), Out(Pointer(UINT32), "nameLength"), Out(Pointer(DWRITE_TEXT_RANGE), "textRange")]), StdMethod(HRESULT, "GetLocaleName", [(UINT32, "currentPosition"), Out(Pointer(WCHAR), "localeName"), (UINT32, "nameSize"), Out(Pointer(DWRITE_TEXT_RANGE), "textRange")]), @@ -750,7 +750,7 @@ IDWriteFactory.methods += [ StdMethod(HRESULT, "CreateCustomFontCollection", [(ObjPointer(IDWriteFontCollectionLoader), "collectionLoader"), (OpaquePointer(Const(Void)), "collectionKey"), (UINT32, "collectionKeySize"), Out(Pointer(ObjPointer(IDWriteFontCollection)), "fontCollection")]), StdMethod(HRESULT, "RegisterFontCollectionLoader", [(ObjPointer(IDWriteFontCollectionLoader), "fontCollectionLoader")]), StdMethod(HRESULT, "UnregisterFontCollectionLoader", [(ObjPointer(IDWriteFontCollectionLoader), "fontCollectionLoader")]), - StdMethod(HRESULT, "CreateFontFileReference", [(Pointer(Const(WCHAR)), "filePath"), (Pointer(Const(FILETIME)), "lastWriteTime"), Out(Pointer(ObjPointer(IDWriteFontFile)), "fontFile")]), + StdMethod(HRESULT, "CreateFontFileReference", [(PCWSTR, "filePath"), (Pointer(Const(FILETIME)), "lastWriteTime"), Out(Pointer(ObjPointer(IDWriteFontFile)), "fontFile")]), StdMethod(HRESULT, "CreateCustomFontFileReference", [(OpaquePointer(Const(Void)), "fontFileReferenceKey"), (UINT32, "fontFileReferenceKeySize"), (ObjPointer(IDWriteFontFileLoader), "fontFileLoader"), Out(Pointer(ObjPointer(IDWriteFontFile)), "fontFile")]), StdMethod(HRESULT, "CreateFontFace", [(DWRITE_FONT_FACE_TYPE, "fontFaceType"), (UINT32, "numberOfFiles"), (Array(Const(ObjPointer(IDWriteFontFile)), "numberOfFiles"), "fontFiles"), (UINT32, "faceIndex"), (DWRITE_FONT_SIMULATIONS, "fontFaceSimulationFlags"), Out(Pointer(ObjPointer(IDWriteFontFace)), "fontFace")]), StdMethod(HRESULT, "CreateRenderingParams", [Out(Pointer(ObjPointer(IDWriteRenderingParams)), "renderingParams")]), @@ -758,14 +758,14 @@ IDWriteFactory.methods += [ StdMethod(HRESULT, "CreateCustomRenderingParams", [(FLOAT, "gamma"), (FLOAT, "enhancedContrast"), (FLOAT, "clearTypeLevel"), (DWRITE_PIXEL_GEOMETRY, "pixelGeometry"), (DWRITE_RENDERING_MODE, "renderingMode"), Out(Pointer(ObjPointer(IDWriteRenderingParams)), "renderingParams")]), StdMethod(HRESULT, "RegisterFontFileLoader", [(ObjPointer(IDWriteFontFileLoader), "fontFileLoader")]), StdMethod(HRESULT, "UnregisterFontFileLoader", [(ObjPointer(IDWriteFontFileLoader), "fontFileLoader")]), - StdMethod(HRESULT, "CreateTextFormat", [(Pointer(Const(WCHAR)), "fontFamilyName"), (ObjPointer(IDWriteFontCollection), "fontCollection"), (DWRITE_FONT_WEIGHT, "fontWeight"), (DWRITE_FONT_STYLE, "fontStyle"), (DWRITE_FONT_STRETCH, "fontStretch"), (FLOAT, "fontSize"), (Pointer(Const(WCHAR)), "localeName"), Out(Pointer(ObjPointer(IDWriteTextFormat)), "textFormat")]), + StdMethod(HRESULT, "CreateTextFormat", [(PCWSTR, "fontFamilyName"), (ObjPointer(IDWriteFontCollection), "fontCollection"), (DWRITE_FONT_WEIGHT, "fontWeight"), (DWRITE_FONT_STYLE, "fontStyle"), (DWRITE_FONT_STRETCH, "fontStretch"), (FLOAT, "fontSize"), (PCWSTR, "localeName"), Out(Pointer(ObjPointer(IDWriteTextFormat)), "textFormat")]), StdMethod(HRESULT, "CreateTypography", [Out(Pointer(ObjPointer(IDWriteTypography)), "typography")]), StdMethod(HRESULT, "GetGdiInterop", [Out(Pointer(ObjPointer(IDWriteGdiInterop)), "gdiInterop")]), - StdMethod(HRESULT, "CreateTextLayout", [(Pointer(Const(WCHAR)), "string"), (UINT32, "stringLength"), (ObjPointer(IDWriteTextFormat), "textFormat"), (FLOAT, "maxWidth"), (FLOAT, "maxHeight"), Out(Pointer(ObjPointer(IDWriteTextLayout)), "textLayout")]), - StdMethod(HRESULT, "CreateGdiCompatibleTextLayout", [(Pointer(Const(WCHAR)), "string"), (UINT32, "stringLength"), (ObjPointer(IDWriteTextFormat), "textFormat"), (FLOAT, "layoutWidth"), (FLOAT, "layoutHeight"), (FLOAT, "pixelsPerDip"), (Pointer(Const(DWRITE_MATRIX)), "transform"), (BOOL, "useGdiNatural"), Out(Pointer(ObjPointer(IDWriteTextLayout)), "textLayout")]), - StdMethod(HRESULT, "CreateEllipsisTrimmingSign", [(ObjPointer(IDWriteTextFormat), "textFormat"), Out(Pointer(ObjPointer(IDWriteInlineObject)), "trimmingSign")]), + StdMethod(HRESULT, "CreateTextLayout", [(String(Const(WCHAR), "stringLength", wide=True), "string"), (UINT32, "stringLength"), (ObjPointer(IDWriteTextFormat), "textFormat"), (FLOAT, "maxWidth"), (FLOAT, "maxHeight"), Out(Pointer(ObjPointer(IDWriteTextLayout)), "textLayout")]), + StdMethod(HRESULT, "CreateGdiCompatibleTextLayout", [(String(Const(WCHAR), "stringLength", wide=True), "string"), (UINT32, "stringLength"), (ObjPointer(IDWriteTextFormat), "textFormat"), (FLOAT, "layoutWidth"), (FLOAT, "layoutHeight"), (FLOAT, "pixelsPerDip"), (Pointer(Const(DWRITE_MATRIX)), "transform"), (BOOL, "useGdiNatural"), Out(Pointer(ObjPointer(IDWriteTextLayout)), "textLayout")]), + StdMethod(HRESULT, "CreateEllipsisTrimmingSign", [(ObjPointer(IDWriteTextFormat), "textFormat"), Out(Pointer(OpaquePointer(IDWriteInlineObject)), "trimmingSign")]), StdMethod(HRESULT, "CreateTextAnalyzer", [Out(Pointer(ObjPointer(IDWriteTextAnalyzer)), "textAnalyzer")]), - StdMethod(HRESULT, "CreateNumberSubstitution", [(DWRITE_NUMBER_SUBSTITUTION_METHOD, "substitutionMethod"), (Pointer(Const(WCHAR)), "localeName"), (BOOL, "ignoreUserOverride"), Out(Pointer(ObjPointer(IDWriteNumberSubstitution)), "numberSubstitution")]), + StdMethod(HRESULT, "CreateNumberSubstitution", [(DWRITE_NUMBER_SUBSTITUTION_METHOD, "substitutionMethod"), (PCWSTR, "localeName"), (BOOL, "ignoreUserOverride"), Out(Pointer(ObjPointer(IDWriteNumberSubstitution)), "numberSubstitution")]), StdMethod(HRESULT, "CreateGlyphRunAnalysis", [(Pointer(Const(DWRITE_GLYPH_RUN)), "glyphRun"), (FLOAT, "pixelsPerDip"), (Pointer(Const(DWRITE_MATRIX)), "transform"), (DWRITE_RENDERING_MODE, "renderingMode"), (DWRITE_MEASURING_MODE, "measuringMode"), (FLOAT, "baselineOriginX"), (FLOAT, "baselineOriginY"), Out(Pointer(ObjPointer(IDWriteGlyphRunAnalysis)), "glyphRunAnalysis")]), ] @@ -776,3 +776,594 @@ dwrite.addInterfaces([ dwrite.addFunctions([ StdFunction(HRESULT, "DWriteCreateFactory", [(DWRITE_FACTORY_TYPE, "factoryType"), (REFIID, "iid"), Out(Pointer(ObjPointer(IUnknown)), "factory")]), ]) + + +# +# dwrite_1 +# + + +DWRITE_PANOSE_FAMILY = Enum("DWRITE_PANOSE_FAMILY", [ + "DWRITE_PANOSE_FAMILY_ANY", + "DWRITE_PANOSE_FAMILY_NO_FIT", + "DWRITE_PANOSE_FAMILY_TEXT_DISPLAY", + "DWRITE_PANOSE_FAMILY_SCRIPT", + "DWRITE_PANOSE_FAMILY_DECORATIVE", + "DWRITE_PANOSE_FAMILY_SYMBOL", + "DWRITE_PANOSE_FAMILY_PICTORIAL", +]) + +DWRITE_PANOSE_SERIF_STYLE = Enum("DWRITE_PANOSE_SERIF_STYLE", [ + "DWRITE_PANOSE_SERIF_STYLE_ANY", + "DWRITE_PANOSE_SERIF_STYLE_NO_FIT", + "DWRITE_PANOSE_SERIF_STYLE_COVE", + "DWRITE_PANOSE_SERIF_STYLE_OBTUSE_COVE", + "DWRITE_PANOSE_SERIF_STYLE_SQUARE_COVE", + "DWRITE_PANOSE_SERIF_STYLE_OBTUSE_SQUARE_COVE", + "DWRITE_PANOSE_SERIF_STYLE_SQUARE", + "DWRITE_PANOSE_SERIF_STYLE_THIN", + "DWRITE_PANOSE_SERIF_STYLE_OVAL", + "DWRITE_PANOSE_SERIF_STYLE_EXAGGERATED", + "DWRITE_PANOSE_SERIF_STYLE_TRIANGLE", + "DWRITE_PANOSE_SERIF_STYLE_NORMAL_SANS", + "DWRITE_PANOSE_SERIF_STYLE_OBTUSE_SANS", + "DWRITE_PANOSE_SERIF_STYLE_PERPENDICULAR_SANS", + "DWRITE_PANOSE_SERIF_STYLE_FLARED", + "DWRITE_PANOSE_SERIF_STYLE_ROUNDED", + "DWRITE_PANOSE_SERIF_STYLE_SCRIPT", + "DWRITE_PANOSE_SERIF_STYLE_PERP_SANS", + "DWRITE_PANOSE_SERIF_STYLE_BONE", +]) + +DWRITE_PANOSE_WEIGHT = Enum("DWRITE_PANOSE_WEIGHT", [ + "DWRITE_PANOSE_WEIGHT_ANY", + "DWRITE_PANOSE_WEIGHT_NO_FIT", + "DWRITE_PANOSE_WEIGHT_VERY_LIGHT", + "DWRITE_PANOSE_WEIGHT_LIGHT", + "DWRITE_PANOSE_WEIGHT_THIN", + "DWRITE_PANOSE_WEIGHT_BOOK", + "DWRITE_PANOSE_WEIGHT_MEDIUM", + "DWRITE_PANOSE_WEIGHT_DEMI", + "DWRITE_PANOSE_WEIGHT_BOLD", + "DWRITE_PANOSE_WEIGHT_HEAVY", + "DWRITE_PANOSE_WEIGHT_BLACK", + "DWRITE_PANOSE_WEIGHT_EXTRA_BLACK", + "DWRITE_PANOSE_WEIGHT_NORD", +]) + +DWRITE_PANOSE_PROPORTION = Enum("DWRITE_PANOSE_PROPORTION", [ + "DWRITE_PANOSE_PROPORTION_ANY", + "DWRITE_PANOSE_PROPORTION_NO_FIT", + "DWRITE_PANOSE_PROPORTION_OLD_STYLE", + "DWRITE_PANOSE_PROPORTION_MODERN", + "DWRITE_PANOSE_PROPORTION_EVEN_WIDTH", + "DWRITE_PANOSE_PROPORTION_EXPANDED", + "DWRITE_PANOSE_PROPORTION_CONDENSED", + "DWRITE_PANOSE_PROPORTION_VERY_EXPANDED", + "DWRITE_PANOSE_PROPORTION_VERY_CONDENSED", + "DWRITE_PANOSE_PROPORTION_MONOSPACED", +]) + +DWRITE_PANOSE_CONTRAST = Enum("DWRITE_PANOSE_CONTRAST", [ + "DWRITE_PANOSE_CONTRAST_ANY", + "DWRITE_PANOSE_CONTRAST_NO_FIT", + "DWRITE_PANOSE_CONTRAST_NONE", + "DWRITE_PANOSE_CONTRAST_VERY_LOW", + "DWRITE_PANOSE_CONTRAST_LOW", + "DWRITE_PANOSE_CONTRAST_MEDIUM_LOW", + "DWRITE_PANOSE_CONTRAST_MEDIUM", + "DWRITE_PANOSE_CONTRAST_MEDIUM_HIGH", + "DWRITE_PANOSE_CONTRAST_HIGH", + "DWRITE_PANOSE_CONTRAST_VERY_HIGH", + "DWRITE_PANOSE_CONTRAST_HORIZONTAL_LOW", + "DWRITE_PANOSE_CONTRAST_HORIZONTAL_MEDIUM", + "DWRITE_PANOSE_CONTRAST_HORIZONTAL_HIGH", + "DWRITE_PANOSE_CONTRAST_BROKEN", +]) + +DWRITE_PANOSE_STROKE_VARIATION = Enum("DWRITE_PANOSE_STROKE_VARIATION", [ + "DWRITE_PANOSE_STROKE_VARIATION_ANY", + "DWRITE_PANOSE_STROKE_VARIATION_NO_FIT", + "DWRITE_PANOSE_STROKE_VARIATION_NO_VARIATION", + "DWRITE_PANOSE_STROKE_VARIATION_GRADUAL_DIAGONAL", + "DWRITE_PANOSE_STROKE_VARIATION_GRADUAL_TRANSITIONAL", + "DWRITE_PANOSE_STROKE_VARIATION_GRADUAL_VERTICAL", + "DWRITE_PANOSE_STROKE_VARIATION_GRADUAL_HORIZONTAL", + "DWRITE_PANOSE_STROKE_VARIATION_RAPID_VERTICAL", + "DWRITE_PANOSE_STROKE_VARIATION_RAPID_HORIZONTAL", + "DWRITE_PANOSE_STROKE_VARIATION_INSTANT_VERTICAL", + "DWRITE_PANOSE_STROKE_VARIATION_INSTANT_HORIZONTAL", +]) + +DWRITE_PANOSE_ARM_STYLE = Enum("DWRITE_PANOSE_ARM_STYLE", [ + "DWRITE_PANOSE_ARM_STYLE_ANY", + "DWRITE_PANOSE_ARM_STYLE_NO_FIT", + "DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_HORIZONTAL", + "DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_WEDGE", + "DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_VERTICAL", + "DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_SINGLE_SERIF", + "DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_DOUBLE_SERIF", + "DWRITE_PANOSE_ARM_STYLE_NONSTRAIGHT_ARMS_HORIZONTAL", + "DWRITE_PANOSE_ARM_STYLE_NONSTRAIGHT_ARMS_WEDGE", + "DWRITE_PANOSE_ARM_STYLE_NONSTRAIGHT_ARMS_VERTICAL", + "DWRITE_PANOSE_ARM_STYLE_NONSTRAIGHT_ARMS_SINGLE_SERIF", + "DWRITE_PANOSE_ARM_STYLE_NONSTRAIGHT_ARMS_DOUBLE_SERIF", + "DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_HORZ", + "DWRITE_PANOSE_ARM_STYLE_STRAIGHT_ARMS_VERT", + "DWRITE_PANOSE_ARM_STYLE_BENT_ARMS_HORZ", + "DWRITE_PANOSE_ARM_STYLE_BENT_ARMS_WEDGE", + "DWRITE_PANOSE_ARM_STYLE_BENT_ARMS_VERT", + "DWRITE_PANOSE_ARM_STYLE_BENT_ARMS_SINGLE_SERIF", + "DWRITE_PANOSE_ARM_STYLE_BENT_ARMS_DOUBLE_SERIF", +]) + +DWRITE_PANOSE_LETTERFORM = Enum("DWRITE_PANOSE_LETTERFORM", [ + "DWRITE_PANOSE_LETTERFORM_ANY", + "DWRITE_PANOSE_LETTERFORM_NO_FIT", + "DWRITE_PANOSE_LETTERFORM_NORMAL_CONTACT", + "DWRITE_PANOSE_LETTERFORM_NORMAL_WEIGHTED", + "DWRITE_PANOSE_LETTERFORM_NORMAL_BOXED", + "DWRITE_PANOSE_LETTERFORM_NORMAL_FLATTENED", + "DWRITE_PANOSE_LETTERFORM_NORMAL_ROUNDED", + "DWRITE_PANOSE_LETTERFORM_NORMAL_OFF_CENTER", + "DWRITE_PANOSE_LETTERFORM_NORMAL_SQUARE", + "DWRITE_PANOSE_LETTERFORM_OBLIQUE_CONTACT", + "DWRITE_PANOSE_LETTERFORM_OBLIQUE_WEIGHTED", + "DWRITE_PANOSE_LETTERFORM_OBLIQUE_BOXED", + "DWRITE_PANOSE_LETTERFORM_OBLIQUE_FLATTENED", + "DWRITE_PANOSE_LETTERFORM_OBLIQUE_ROUNDED", + "DWRITE_PANOSE_LETTERFORM_OBLIQUE_OFF_CENTER", + "DWRITE_PANOSE_LETTERFORM_OBLIQUE_SQUARE", +]) + +DWRITE_PANOSE_MIDLINE = Enum("DWRITE_PANOSE_MIDLINE", [ + "DWRITE_PANOSE_MIDLINE_ANY", + "DWRITE_PANOSE_MIDLINE_NO_FIT", + "DWRITE_PANOSE_MIDLINE_STANDARD_TRIMMED", + "DWRITE_PANOSE_MIDLINE_STANDARD_POINTED", + "DWRITE_PANOSE_MIDLINE_STANDARD_SERIFED", + "DWRITE_PANOSE_MIDLINE_HIGH_TRIMMED", + "DWRITE_PANOSE_MIDLINE_HIGH_POINTED", + "DWRITE_PANOSE_MIDLINE_HIGH_SERIFED", + "DWRITE_PANOSE_MIDLINE_CONSTANT_TRIMMED", + "DWRITE_PANOSE_MIDLINE_CONSTANT_POINTED", + "DWRITE_PANOSE_MIDLINE_CONSTANT_SERIFED", + "DWRITE_PANOSE_MIDLINE_LOW_TRIMMED", + "DWRITE_PANOSE_MIDLINE_LOW_POINTED", + "DWRITE_PANOSE_MIDLINE_LOW_SERIFED", +]) + +DWRITE_PANOSE_XHEIGHT = Enum("DWRITE_PANOSE_XHEIGHT", [ + "DWRITE_PANOSE_XHEIGHT_ANY", + "DWRITE_PANOSE_XHEIGHT_NO_FIT", + "DWRITE_PANOSE_XHEIGHT_CONSTANT_SMALL", + "DWRITE_PANOSE_XHEIGHT_CONSTANT_STANDARD", + "DWRITE_PANOSE_XHEIGHT_CONSTANT_LARGE", + "DWRITE_PANOSE_XHEIGHT_DUCKING_SMALL", + "DWRITE_PANOSE_XHEIGHT_DUCKING_STANDARD", + "DWRITE_PANOSE_XHEIGHT_DUCKING_LARGE", + "DWRITE_PANOSE_XHEIGHT_CONSTANT_STD", + "DWRITE_PANOSE_XHEIGHT_DUCKING_STD", +]) + +DWRITE_PANOSE_TOOL_KIND = Enum("DWRITE_PANOSE_TOOL_KIND", [ + "DWRITE_PANOSE_TOOL_KIND_ANY", + "DWRITE_PANOSE_TOOL_KIND_NO_FIT", + "DWRITE_PANOSE_TOOL_KIND_FLAT_NIB", + "DWRITE_PANOSE_TOOL_KIND_PRESSURE_POINT", + "DWRITE_PANOSE_TOOL_KIND_ENGRAVED", + "DWRITE_PANOSE_TOOL_KIND_BALL", + "DWRITE_PANOSE_TOOL_KIND_BRUSH", + "DWRITE_PANOSE_TOOL_KIND_ROUGH", + "DWRITE_PANOSE_TOOL_KIND_FELT_PEN_BRUSH_TIP", + "DWRITE_PANOSE_TOOL_KIND_WILD_BRUSH", +]) + +DWRITE_PANOSE_SPACING = Enum("DWRITE_PANOSE_SPACING", [ + "DWRITE_PANOSE_SPACING_ANY", + "DWRITE_PANOSE_SPACING_NO_FIT", + "DWRITE_PANOSE_SPACING_PROPORTIONAL_SPACED", + "DWRITE_PANOSE_SPACING_MONOSPACED", +]) + +DWRITE_PANOSE_ASPECT_RATIO = Enum("DWRITE_PANOSE_ASPECT_RATIO", [ + "DWRITE_PANOSE_ASPECT_RATIO_ANY", + "DWRITE_PANOSE_ASPECT_RATIO_NO_FIT", + "DWRITE_PANOSE_ASPECT_RATIO_VERY_CONDENSED", + "DWRITE_PANOSE_ASPECT_RATIO_CONDENSED", + "DWRITE_PANOSE_ASPECT_RATIO_NORMAL", + "DWRITE_PANOSE_ASPECT_RATIO_EXPANDED", + "DWRITE_PANOSE_ASPECT_RATIO_VERY_EXPANDED", +]) + +DWRITE_PANOSE_SCRIPT_TOPOLOGY = Enum("DWRITE_PANOSE_SCRIPT_TOPOLOGY", [ + "DWRITE_PANOSE_SCRIPT_TOPOLOGY_ANY", + "DWRITE_PANOSE_SCRIPT_TOPOLOGY_NO_FIT", + "DWRITE_PANOSE_SCRIPT_TOPOLOGY_ROMAN_DISCONNECTED", + "DWRITE_PANOSE_SCRIPT_TOPOLOGY_ROMAN_TRAILING", + "DWRITE_PANOSE_SCRIPT_TOPOLOGY_ROMAN_CONNECTED", + "DWRITE_PANOSE_SCRIPT_TOPOLOGY_CURSIVE_DISCONNECTED", + "DWRITE_PANOSE_SCRIPT_TOPOLOGY_CURSIVE_TRAILING", + "DWRITE_PANOSE_SCRIPT_TOPOLOGY_CURSIVE_CONNECTED", + "DWRITE_PANOSE_SCRIPT_TOPOLOGY_BLACKLETTER_DISCONNECTED", + "DWRITE_PANOSE_SCRIPT_TOPOLOGY_BLACKLETTER_TRAILING", + "DWRITE_PANOSE_SCRIPT_TOPOLOGY_BLACKLETTER_CONNECTED", +]) + +DWRITE_PANOSE_SCRIPT_FORM = Enum("DWRITE_PANOSE_SCRIPT_FORM", [ + "DWRITE_PANOSE_SCRIPT_FORM_ANY", + "DWRITE_PANOSE_SCRIPT_FORM_NO_FIT", + "DWRITE_PANOSE_SCRIPT_FORM_UPRIGHT_NO_WRAPPING", + "DWRITE_PANOSE_SCRIPT_FORM_UPRIGHT_SOME_WRAPPING", + "DWRITE_PANOSE_SCRIPT_FORM_UPRIGHT_MORE_WRAPPING", + "DWRITE_PANOSE_SCRIPT_FORM_UPRIGHT_EXTREME_WRAPPING", + "DWRITE_PANOSE_SCRIPT_FORM_OBLIQUE_NO_WRAPPING", + "DWRITE_PANOSE_SCRIPT_FORM_OBLIQUE_SOME_WRAPPING", + "DWRITE_PANOSE_SCRIPT_FORM_OBLIQUE_MORE_WRAPPING", + "DWRITE_PANOSE_SCRIPT_FORM_OBLIQUE_EXTREME_WRAPPING", + "DWRITE_PANOSE_SCRIPT_FORM_EXAGGERATED_NO_WRAPPING", + "DWRITE_PANOSE_SCRIPT_FORM_EXAGGERATED_SOME_WRAPPING", + "DWRITE_PANOSE_SCRIPT_FORM_EXAGGERATED_MORE_WRAPPING", + "DWRITE_PANOSE_SCRIPT_FORM_EXAGGERATED_EXTREME_WRAPPING", +]) + +DWRITE_PANOSE_FINIALS = Enum("DWRITE_PANOSE_FINIALS", [ + "DWRITE_PANOSE_FINIALS_ANY", + "DWRITE_PANOSE_FINIALS_NO_FIT", + "DWRITE_PANOSE_FINIALS_NONE_NO_LOOPS", + "DWRITE_PANOSE_FINIALS_NONE_CLOSED_LOOPS", + "DWRITE_PANOSE_FINIALS_NONE_OPEN_LOOPS", + "DWRITE_PANOSE_FINIALS_SHARP_NO_LOOPS", + "DWRITE_PANOSE_FINIALS_SHARP_CLOSED_LOOPS", + "DWRITE_PANOSE_FINIALS_SHARP_OPEN_LOOPS", + "DWRITE_PANOSE_FINIALS_TAPERED_NO_LOOPS", + "DWRITE_PANOSE_FINIALS_TAPERED_CLOSED_LOOPS", + "DWRITE_PANOSE_FINIALS_TAPERED_OPEN_LOOPS", + "DWRITE_PANOSE_FINIALS_ROUND_NO_LOOPS", + "DWRITE_PANOSE_FINIALS_ROUND_CLOSED_LOOPS", + "DWRITE_PANOSE_FINIALS_ROUND_OPEN_LOOPS", +]) + +DWRITE_PANOSE_XASCENT = Enum("DWRITE_PANOSE_XASCENT", [ + "DWRITE_PANOSE_XASCENT_ANY", + "DWRITE_PANOSE_XASCENT_NO_FIT", + "DWRITE_PANOSE_XASCENT_VERY_LOW", + "DWRITE_PANOSE_XASCENT_LOW", + "DWRITE_PANOSE_XASCENT_MEDIUM", + "DWRITE_PANOSE_XASCENT_HIGH", + "DWRITE_PANOSE_XASCENT_VERY_HIGH", +]) + +DWRITE_PANOSE_DECORATIVE_CLASS = Enum("DWRITE_PANOSE_DECORATIVE_CLASS", [ + "DWRITE_PANOSE_DECORATIVE_CLASS_ANY", + "DWRITE_PANOSE_DECORATIVE_CLASS_NO_FIT", + "DWRITE_PANOSE_DECORATIVE_CLASS_DERIVATIVE", + "DWRITE_PANOSE_DECORATIVE_CLASS_NONSTANDARD_TOPOLOGY", + "DWRITE_PANOSE_DECORATIVE_CLASS_NONSTANDARD_ELEMENTS", + "DWRITE_PANOSE_DECORATIVE_CLASS_NONSTANDARD_ASPECT", + "DWRITE_PANOSE_DECORATIVE_CLASS_INITIALS", + "DWRITE_PANOSE_DECORATIVE_CLASS_CARTOON", + "DWRITE_PANOSE_DECORATIVE_CLASS_PICTURE_STEMS", + "DWRITE_PANOSE_DECORATIVE_CLASS_ORNAMENTED", + "DWRITE_PANOSE_DECORATIVE_CLASS_TEXT_AND_BACKGROUND", + "DWRITE_PANOSE_DECORATIVE_CLASS_COLLAGE", + "DWRITE_PANOSE_DECORATIVE_CLASS_MONTAGE", +]) + +DWRITE_PANOSE_ASPECT = Enum("DWRITE_PANOSE_ASPECT", [ + "DWRITE_PANOSE_ASPECT_ANY", + "DWRITE_PANOSE_ASPECT_NO_FIT", + "DWRITE_PANOSE_ASPECT_SUPER_CONDENSED", + "DWRITE_PANOSE_ASPECT_VERY_CONDENSED", + "DWRITE_PANOSE_ASPECT_CONDENSED", + "DWRITE_PANOSE_ASPECT_NORMAL", + "DWRITE_PANOSE_ASPECT_EXTENDED", + "DWRITE_PANOSE_ASPECT_VERY_EXTENDED", + "DWRITE_PANOSE_ASPECT_SUPER_EXTENDED", + "DWRITE_PANOSE_ASPECT_MONOSPACED", +]) + +DWRITE_PANOSE_FILL = Enum("DWRITE_PANOSE_FILL", [ + "DWRITE_PANOSE_FILL_ANY", + "DWRITE_PANOSE_FILL_NO_FIT", + "DWRITE_PANOSE_FILL_STANDARD_SOLID_FILL", + "DWRITE_PANOSE_FILL_NO_FILL", + "DWRITE_PANOSE_FILL_PATTERNED_FILL", + "DWRITE_PANOSE_FILL_COMPLEX_FILL", + "DWRITE_PANOSE_FILL_SHAPED_FILL", + "DWRITE_PANOSE_FILL_DRAWN_DISTRESSED", +]) + +DWRITE_PANOSE_LINING = Enum("DWRITE_PANOSE_LINING", [ + "DWRITE_PANOSE_LINING_ANY", + "DWRITE_PANOSE_LINING_NO_FIT", + "DWRITE_PANOSE_LINING_NONE", + "DWRITE_PANOSE_LINING_INLINE", + "DWRITE_PANOSE_LINING_OUTLINE", + "DWRITE_PANOSE_LINING_ENGRAVED", + "DWRITE_PANOSE_LINING_SHADOW", + "DWRITE_PANOSE_LINING_RELIEF", + "DWRITE_PANOSE_LINING_BACKDROP", +]) + +DWRITE_PANOSE_DECORATIVE_TOPOLOGY = Enum("DWRITE_PANOSE_DECORATIVE_TOPOLOGY", [ + "DWRITE_PANOSE_DECORATIVE_TOPOLOGY_ANY", + "DWRITE_PANOSE_DECORATIVE_TOPOLOGY_NO_FIT", + "DWRITE_PANOSE_DECORATIVE_TOPOLOGY_STANDARD", + "DWRITE_PANOSE_DECORATIVE_TOPOLOGY_SQUARE", + "DWRITE_PANOSE_DECORATIVE_TOPOLOGY_MULTIPLE_SEGMENT", + "DWRITE_PANOSE_DECORATIVE_TOPOLOGY_ART_DECO", + "DWRITE_PANOSE_DECORATIVE_TOPOLOGY_UNEVEN_WEIGHTING", + "DWRITE_PANOSE_DECORATIVE_TOPOLOGY_DIVERSE_ARMS", + "DWRITE_PANOSE_DECORATIVE_TOPOLOGY_DIVERSE_FORMS", + "DWRITE_PANOSE_DECORATIVE_TOPOLOGY_LOMBARDIC_FORMS", + "DWRITE_PANOSE_DECORATIVE_TOPOLOGY_UPPER_CASE_IN_LOWER_CASE", + "DWRITE_PANOSE_DECORATIVE_TOPOLOGY_IMPLIED_TOPOLOGY", + "DWRITE_PANOSE_DECORATIVE_TOPOLOGY_HORSESHOE_E_AND_A", + "DWRITE_PANOSE_DECORATIVE_TOPOLOGY_CURSIVE", + "DWRITE_PANOSE_DECORATIVE_TOPOLOGY_BLACKLETTER", + "DWRITE_PANOSE_DECORATIVE_TOPOLOGY_SWASH_VARIANCE", +]) + +DWRITE_PANOSE_CHARACTER_RANGES = Enum("DWRITE_PANOSE_CHARACTER_RANGES", [ + "DWRITE_PANOSE_CHARACTER_RANGES_ANY", + "DWRITE_PANOSE_CHARACTER_RANGES_NO_FIT", + "DWRITE_PANOSE_CHARACTER_RANGES_EXTENDED_COLLECTION", + "DWRITE_PANOSE_CHARACTER_RANGES_LITERALS", + "DWRITE_PANOSE_CHARACTER_RANGES_NO_LOWER_CASE", + "DWRITE_PANOSE_CHARACTER_RANGES_SMALL_CAPS", +]) + +DWRITE_PANOSE_SYMBOL_KIND = Enum("DWRITE_PANOSE_SYMBOL_KIND", [ + "DWRITE_PANOSE_SYMBOL_KIND_ANY", + "DWRITE_PANOSE_SYMBOL_KIND_NO_FIT", + "DWRITE_PANOSE_SYMBOL_KIND_MONTAGES", + "DWRITE_PANOSE_SYMBOL_KIND_PICTURES", + "DWRITE_PANOSE_SYMBOL_KIND_SHAPES", + "DWRITE_PANOSE_SYMBOL_KIND_SCIENTIFIC", + "DWRITE_PANOSE_SYMBOL_KIND_MUSIC", + "DWRITE_PANOSE_SYMBOL_KIND_EXPERT", + "DWRITE_PANOSE_SYMBOL_KIND_PATTERNS", + "DWRITE_PANOSE_SYMBOL_KIND_BOARDERS", + "DWRITE_PANOSE_SYMBOL_KIND_ICONS", + "DWRITE_PANOSE_SYMBOL_KIND_LOGOS", + "DWRITE_PANOSE_SYMBOL_KIND_INDUSTRY_SPECIFIC", +]) + +DWRITE_PANOSE_SYMBOL_ASPECT_RATIO = Enum("DWRITE_PANOSE_SYMBOL_ASPECT_RATIO", [ + "DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_ANY", + "DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_NO_FIT", + "DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_NO_WIDTH", + "DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_EXCEPTIONALLY_WIDE", + "DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_SUPER_WIDE", + "DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_VERY_WIDE", + "DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_WIDE", + "DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_NORMAL", + "DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_NARROW", + "DWRITE_PANOSE_SYMBOL_ASPECT_RATIO_VERY_NARROW", +]) + +DWRITE_OUTLINE_THRESHOLD = Enum("DWRITE_OUTLINE_THRESHOLD", [ + "DWRITE_OUTLINE_THRESHOLD_ANTIALIASED", + "DWRITE_OUTLINE_THRESHOLD_ALIASED", +]) + +DWRITE_BASELINE = Enum("DWRITE_BASELINE", [ + "DWRITE_BASELINE_DEFAULT", + "DWRITE_BASELINE_ROMAN", + "DWRITE_BASELINE_CENTRAL", + "DWRITE_BASELINE_MATH", + "DWRITE_BASELINE_HANGING", + "DWRITE_BASELINE_IDEOGRAPHIC_BOTTOM", + "DWRITE_BASELINE_IDEOGRAPHIC_TOP", + "DWRITE_BASELINE_MINIMUM", + "DWRITE_BASELINE_MAXIMUM", +]) + +DWRITE_VERTICAL_GLYPH_ORIENTATION = Enum("DWRITE_VERTICAL_GLYPH_ORIENTATION", [ + "DWRITE_VERTICAL_GLYPH_ORIENTATION_DEFAULT", + "DWRITE_VERTICAL_GLYPH_ORIENTATION_STACKED", +]) + +DWRITE_GLYPH_ORIENTATION_ANGLE = Enum("DWRITE_GLYPH_ORIENTATION_ANGLE", [ + "DWRITE_GLYPH_ORIENTATION_ANGLE_0_DEGREES", + "DWRITE_GLYPH_ORIENTATION_ANGLE_90_DEGREES", + "DWRITE_GLYPH_ORIENTATION_ANGLE_180_DEGREES", + "DWRITE_GLYPH_ORIENTATION_ANGLE_270_DEGREES", +]) + +DWRITE_FONT_METRICS1 = Struct("DWRITE_FONT_METRICS1", [ + (INT16, "glyphBoxLeft"), + (INT16, "glyphBoxTop"), + (INT16, "glyphBoxRight"), + (INT16, "glyphBoxBottom"), + (INT16, "subscriptPositionX"), + (INT16, "subscriptPositionY"), + (INT16, "subscriptSizeX"), + (INT16, "subscriptSizeY"), + (INT16, "superscriptPositionX"), + (INT16, "superscriptPositionY"), + (INT16, "superscriptSizeX"), + (INT16, "superscriptSizeY"), + (BOOL, "hasTypographicMetrics"), +]) + +DWRITE_CARET_METRICS = Struct("DWRITE_CARET_METRICS", [ + (INT16, "slopeRise"), + (INT16, "slopeRun"), + (INT16, "offset"), +]) + +DWRITE_UNICODE_RANGE = Struct("DWRITE_UNICODE_RANGE", [ + (UINT32, "first"), + (UINT32, "last"), +]) + +DWRITE_SCRIPT_PROPERTIES = Struct("DWRITE_SCRIPT_PROPERTIES", [ + (UINT32, "isoScriptCode"), + (UINT32, "isoScriptNumber"), + (UINT32, "clusterLookahead"), + (UINT32, "justificationCharacter"), + (UINT32, "restrictCaretToClusters"), + (UINT32, "usesWordDividers"), + (UINT32, "isDiscreteWriting"), + (UINT32, "isBlockWriting"), + (UINT32, "isDistributedWithinCluster"), + (UINT32, "isConnectedWriting"), + (UINT32, "isCursiveWriting"), + (UINT32, "reserved"), +]) + +DWRITE_JUSTIFICATION_OPPORTUNITY = Struct("DWRITE_JUSTIFICATION_OPPORTUNITY", [ + (FLOAT, "expansionMinimum"), + (FLOAT, "expansionMaximum"), + (FLOAT, "compressionMaximum"), + (UINT32, "expansionPriority"), + (UINT32, "compressionPriority"), + (UINT32, "allowResidualExpansion"), + (UINT32, "allowResidualCompression"), + (UINT32, "applyToLeadingEdge"), + (UINT32, "applyToTrailingEdge"), + (UINT32, "reserved"), +]) + +IDWriteFactory1 = Interface("IDWriteFactory1", IDWriteFactory) +IDWriteFontFace1 = Interface("IDWriteFontFace1", IDWriteFontFace) +IDWriteFont1 = Interface("IDWriteFont1", IDWriteFont) +IDWriteRenderingParams1 = Interface("IDWriteRenderingParams1", IDWriteRenderingParams) +IDWriteTextAnalyzer1 = Interface("IDWriteTextAnalyzer1", IDWriteTextAnalyzer) +IDWriteTextAnalysisSource1 = Interface("IDWriteTextAnalysisSource1", IDWriteTextAnalysisSource) +IDWriteTextAnalysisSink1 = Interface("IDWriteTextAnalysisSink1", IDWriteTextAnalysisSink) +IDWriteTextLayout1 = Interface("IDWriteTextLayout1", IDWriteTextLayout) +IDWriteBitmapRenderTarget1 = Interface("IDWriteBitmapRenderTarget1", IDWriteBitmapRenderTarget) + +IDWriteFactory1.methods += [ + StdMethod(HRESULT, "GetEudcFontCollection", [(Pointer(ObjPointer(IDWriteFontCollection)), "fontCollection"), (BOOL, "checkForUpdates")]), + StdMethod(HRESULT, "CreateCustomRenderingParams", [(FLOAT, "gamma"), (FLOAT, "enhancedContrast"), (FLOAT, "enhancedContrastGrayscale"), (FLOAT, "clearTypeLevel"), (DWRITE_PIXEL_GEOMETRY, "pixelGeometry"), (DWRITE_RENDERING_MODE, "renderingMode"), Out(Pointer(ObjPointer(IDWriteRenderingParams1)), "renderingParams")]), +] + +IDWriteFontFace1.methods += [ + StdMethod(Void, "GetMetrics", [Out(Pointer(DWRITE_FONT_METRICS1), "fontMetrics")]), + StdMethod(HRESULT, "GetGdiCompatibleMetrics", [(FLOAT, "emSize"), (FLOAT, "pixelsPerDip"), (Pointer(Const(DWRITE_MATRIX)), "transform"), Out(Pointer(DWRITE_FONT_METRICS1), "fontMetrics")]), + StdMethod(Void, "GetCaretMetrics", [Out(Pointer(DWRITE_CARET_METRICS), "caretMetrics")]), + StdMethod(HRESULT, "GetUnicodeRanges", [(UINT32, "maxRangeCount"), Out(Pointer(DWRITE_UNICODE_RANGE), "unicodeRanges"), Out(Pointer(UINT32), "actualRangeCount")]), + StdMethod(BOOL, "IsMonospacedFont", []), + StdMethod(HRESULT, "GetDesignGlyphAdvances", [(UINT32, "glyphCount"), (Pointer(Const(UINT16)), "glyphIndices"), Out(ObjPointer(INT32), "glyphAdvances"), (BOOL, "isSideways")]), + StdMethod(HRESULT, "GetGdiCompatibleGlyphAdvances", [(FLOAT, "emSize"), (FLOAT, "pixelsPerDip"), (Pointer(Const(DWRITE_MATRIX)), "transform"), (BOOL, "useGdiNatural"), (BOOL, "isSideways"), (UINT32, "glyphCount"), (Pointer(Const(UINT16)), "glyphIndices"), Out(ObjPointer(INT32), "glyphAdvances")]), + StdMethod(HRESULT, "GetKerningPairAdjustments", [(UINT32, "glyphCount"), (Pointer(Const(UINT16)), "glyphIndices"), Out(ObjPointer(INT32), "glyphAdvanceAdjustments")]), + StdMethod(BOOL, "HasKerningPairs", []), + StdMethod(HRESULT, "GetRecommendedRenderingMode", [(FLOAT, "fontEmSize"), (FLOAT, "dpiX"), (FLOAT, "dpiY"), (Pointer(Const(DWRITE_MATRIX)), "transform"), (BOOL, "isSideways"), (DWRITE_OUTLINE_THRESHOLD, "outlineThreshold"), (DWRITE_MEASURING_MODE, "measuringMode"), Out(Pointer(DWRITE_RENDERING_MODE), "renderingMode")]), + StdMethod(HRESULT, "GetVerticalGlyphVariants", [(UINT32, "glyphCount"), (Pointer(Const(UINT16)), "nominalGlyphIndices"), Out(Pointer(UINT16), "verticalGlyphIndices")]), + StdMethod(BOOL, "HasVerticalGlyphVariants", []), +] + + +DWRITE_PANOSE_TEXT = Struct("DWRITE_PANOSE_TEXT", [ + (UINT8, "familyKind"), + (UINT8, "serifStyle"), + (UINT8, "weight"), + (UINT8, "proportion"), + (UINT8, "contrast"), + (UINT8, "strokeVariation"), + (UINT8, "armStyle"), + (UINT8, "letterform"), + (UINT8, "midline"), + (UINT8, "xHeight"), +]) + +DWRITE_PANOSE_SCRIPT = Struct("DWRITE_PANOSE_SCRIPT", [ + (UINT8, "familyKind"), + (UINT8, "toolKind"), + (UINT8, "weight"), + (UINT8, "spacing"), + (UINT8, "aspectRatio"), + (UINT8, "contrast"), + (UINT8, "scriptTopology"), + (UINT8, "scriptForm"), + (UINT8, "finials"), + (UINT8, "xAscent"), +]) + +DWRITE_PANOSE_DECORATIVE = Struct("DWRITE_PANOSE_DECORATIVE", [ + (UINT8, "familyKind"), + (UINT8, "decorativeClass"), + (UINT8, "weight"), + (UINT8, "aspect"), + (UINT8, "contrast"), + (UINT8, "serifVariant"), + (UINT8, "fill"), + (UINT8, "lining"), + (UINT8, "decorativeTopology"), + (UINT8, "characterRange"), +]) + +DWRITE_PANOSE_SYMBOL = Struct("DWRITE_PANOSE_SYMBOL", [ + (UINT8, "familyKind"), + (UINT8, "symbolKind"), + (UINT8, "weight"), + (UINT8, "spacing"), + (UINT8, "aspectRatioAndContrast"), + (UINT8, "aspectRatio94"), + (UINT8, "aspectRatio119"), + (UINT8, "aspectRatio157"), + (UINT8, "aspectRatio163"), + (UINT8, "aspectRatio211"), +]) + +DWRITE_PANOSE = Struct("DWRITE_PANOSE", [ + (UINT8, "familyKind"), + # FIXME +]) + + +IDWriteFont1.methods += [ + StdMethod(Void, "GetMetrics", [Out(Pointer(DWRITE_FONT_METRICS1), "fontMetrics")]), + StdMethod(Void, "GetPanose", [Out(OpaquePointer(DWRITE_PANOSE), "panose")]), + StdMethod(HRESULT, "GetUnicodeRanges", [(UINT32, "maxRangeCount"), Out(Pointer(DWRITE_UNICODE_RANGE), "unicodeRanges"), Out(Pointer(UINT32), "actualRangeCount")]), + StdMethod(BOOL, "IsMonospacedFont", []), +] + +IDWriteRenderingParams1.methods += [ + StdMethod(FLOAT, "GetGrayscaleEnhancedContrast", []), +] + +IDWriteTextAnalyzer1.methods += [ + StdMethod(HRESULT, "ApplyCharacterSpacing", [(FLOAT, "leadingSpacing"), (FLOAT, "trailingSpacing"), (FLOAT, "minimumAdvanceWidth"), (UINT32, "textLength"), (UINT32, "glyphCount"), (Pointer(Const(UINT16)), "clusterMap"), (Pointer(Const(FLOAT)), "glyphAdvances"), (Pointer(Const(DWRITE_GLYPH_OFFSET)), "glyphOffsets"), (Pointer(Const(DWRITE_SHAPING_GLYPH_PROPERTIES)), "glyphProperties"), Out(Pointer(FLOAT), "modifiedGlyphAdvances"), Out(Pointer(DWRITE_GLYPH_OFFSET), "modifiedGlyphOffsets")]), + StdMethod(HRESULT, "GetBaseline", [(ObjPointer(IDWriteFontFace), "fontFace"), (DWRITE_BASELINE, "baseline"), (BOOL, "isVertical"), (BOOL, "isSimulationAllowed"), (DWRITE_SCRIPT_ANALYSIS, "scriptAnalysis"), (PCWSTR, "localeName"), Out(ObjPointer(INT32), "baselineCoordinate"), Out(Pointer(BOOL), "exists")]), + StdMethod(HRESULT, "AnalyzeVerticalGlyphOrientation", [(ObjPointer(IDWriteTextAnalysisSource1), "analysisSource"), (UINT32, "textPosition"), (UINT32, "textLength"), (ObjPointer(IDWriteTextAnalysisSink1), "analysisSink")]), + StdMethod(HRESULT, "GetGlyphOrientationTransform", [(DWRITE_GLYPH_ORIENTATION_ANGLE, "glyphOrientationAngle"), (BOOL, "isSideways"), Out(Pointer(DWRITE_MATRIX), "transform")]), + StdMethod(HRESULT, "GetScriptProperties", [(DWRITE_SCRIPT_ANALYSIS, "scriptAnalysis"), Out(Pointer(DWRITE_SCRIPT_PROPERTIES), "scriptProperties")]), + StdMethod(HRESULT, "GetTextComplexity", [(String(Const(WCHAR), "textLength", wide=True), "textString"), (UINT32, "textLength"), (ObjPointer(IDWriteFontFace), "fontFace"), Out(Pointer(BOOL), "isTextSimple"), Out(Pointer(UINT32), "textLengthRead"), Out(Pointer(UINT16), "glyphIndices")]), + StdMethod(HRESULT, "GetJustificationOpportunities", [(ObjPointer(IDWriteFontFace), "fontFace"), (FLOAT, "fontEmSize"), (DWRITE_SCRIPT_ANALYSIS, "scriptAnalysis"), (UINT32, "textLength"), (UINT32, "glyphCount"), (String(Const(WCHAR), "textLength", wide=True), "textString"), (Pointer(Const(UINT16)), "clusterMap"), (Pointer(Const(DWRITE_SHAPING_GLYPH_PROPERTIES)), "glyphProperties"), Out(Pointer(DWRITE_JUSTIFICATION_OPPORTUNITY), "justificationOpportunities")]), + StdMethod(HRESULT, "JustifyGlyphAdvances", [(FLOAT, "lineWidth"), (UINT32, "glyphCount"), (Pointer(Const(DWRITE_JUSTIFICATION_OPPORTUNITY)), "justificationOpportunities"), (Pointer(Const(FLOAT)), "glyphAdvances"), (Pointer(Const(DWRITE_GLYPH_OFFSET)), "glyphOffsets"), Out(Pointer(FLOAT), "justifiedGlyphAdvances"), Out(Pointer(DWRITE_GLYPH_OFFSET), "justifiedGlyphOffsets")]), + StdMethod(HRESULT, "GetJustifiedGlyphs", [(ObjPointer(IDWriteFontFace), "fontFace"), (FLOAT, "fontEmSize"), (DWRITE_SCRIPT_ANALYSIS, "scriptAnalysis"), (UINT32, "textLength"), (UINT32, "glyphCount"), (UINT32, "maxGlyphCount"), (Pointer(Const(UINT16)), "clusterMap"), (Pointer(Const(UINT16)), "glyphIndices"), (Pointer(Const(FLOAT)), "glyphAdvances"), (Pointer(Const(FLOAT)), "justifiedGlyphAdvances"), (Pointer(Const(DWRITE_GLYPH_OFFSET)), "justifiedGlyphOffsets"), (Pointer(Const(DWRITE_SHAPING_GLYPH_PROPERTIES)), "glyphProperties"), Out(Pointer(UINT32), "actualGlyphCount"), Out(Pointer(UINT16), "modifiedClusterMap"), Out(Pointer(UINT16), "modifiedGlyphIndices"), Out(Pointer(FLOAT), "modifiedGlyphAdvances"), Out(Pointer(DWRITE_GLYPH_OFFSET), "modifiedGlyphOffsets")]), +] + +IDWriteTextAnalysisSource1.methods += [ + StdMethod(HRESULT, "GetVerticalGlyphOrientation", [(UINT32, "textPosition"), Out(Pointer(UINT32), "textLength"), Out(Pointer(DWRITE_VERTICAL_GLYPH_ORIENTATION), "glyphOrientation"), Out(Pointer(UINT8), "bidiLevel")]), +] + +IDWriteTextAnalysisSink1.methods += [ + StdMethod(HRESULT, "SetGlyphOrientation", [(UINT32, "textPosition"), (UINT32, "textLength"), (DWRITE_GLYPH_ORIENTATION_ANGLE, "glyphOrientationAngle"), (UINT8, "adjustedBidiLevel"), (BOOL, "isSideways"), (BOOL, "isRightToLeft")]), +] + +IDWriteTextLayout1.methods += [ + StdMethod(HRESULT, "SetPairKerning", [(BOOL, "isPairKerningEnabled"), (DWRITE_TEXT_RANGE, "textRange")]), + StdMethod(HRESULT, "GetPairKerning", [(UINT32, "currentPosition"), Out(Pointer(BOOL), "isPairKerningEnabled"), Out(Pointer(DWRITE_TEXT_RANGE), "textRange")]), + StdMethod(HRESULT, "SetCharacterSpacing", [(FLOAT, "leadingSpacing"), (FLOAT, "trailingSpacing"), (FLOAT, "minimumAdvanceWidth"), (DWRITE_TEXT_RANGE, "textRange")]), + StdMethod(HRESULT, "GetCharacterSpacing", [(UINT32, "currentPosition"), Out(Pointer(FLOAT), "leadingSpacing"), Out(Pointer(FLOAT), "trailingSpacing"), Out(Pointer(FLOAT), "minimumAdvanceWidth"), Out(Pointer(DWRITE_TEXT_RANGE), "textRange")]), +] + +DWRITE_TEXT_ANTIALIAS_MODE = Enum("DWRITE_TEXT_ANTIALIAS_MODE", [ + "DWRITE_TEXT_ANTIALIAS_MODE_CLEARTYPE", + "DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE", +]) + +IDWriteBitmapRenderTarget1.methods += [ + StdMethod(DWRITE_TEXT_ANTIALIAS_MODE, "GetTextAntialiasMode", []), + StdMethod(HRESULT, "SetTextAntialiasMode", [(DWRITE_TEXT_ANTIALIAS_MODE, "antialiasMode")]), +] + +dwrite.addInterfaces([ + IDWriteFactory1 +]) diff --git a/specs/winapi.py b/specs/winapi.py index 3697f858..445039ff 100644 --- a/specs/winapi.py +++ b/specs/winapi.py @@ -61,6 +61,11 @@ BOOL = Enum("BOOL", [ "TRUE", ]) +PSTR = Alias("PSTR", CString) +PCSTR = Alias("PCSTR", ConstCString) +PWSTR = Alias("PWSTR", WString) +PCWSTR = Alias("PCWSTR", ConstWString) + LPLONG = Pointer(LONG) LPWORD = Pointer(WORD) LPDWORD = Pointer(DWORD) -- cgit v1.2.3