José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 1 | ########################################################################## |
| 2 | # |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 3 | # Copyright 2015 VMware, Inc |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 4 | # Copyright 2011 Jose Fonseca |
| 5 | # All Rights Reserved. |
| 6 | # |
| 7 | # Permission is hereby granted, free of charge, to any person obtaining a copy |
| 8 | # of this software and associated documentation files (the "Software"), to deal |
| 9 | # in the Software without restriction, including without limitation the rights |
| 10 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 11 | # copies of the Software, and to permit persons to whom the Software is |
| 12 | # furnished to do so, subject to the following conditions: |
| 13 | # |
| 14 | # The above copyright notice and this permission notice shall be included in |
| 15 | # all copies or substantial portions of the Software. |
| 16 | # |
| 17 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 18 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 19 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 20 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 21 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 22 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 23 | # THE SOFTWARE. |
| 24 | # |
| 25 | ##########################################################################/ |
| 26 | |
| 27 | |
Piotr Podsiadły | 0b8b019 | 2019-01-03 20:39:55 +0100 | [diff] [blame] | 28 | from .winapi import * |
| 29 | from .dxgi import DXGI_FORMAT, IDXGISurface |
| 30 | from .dwrite import * |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 31 | |
| 32 | |
Jose Fonseca | 25a41c5 | 2015-08-13 20:38:40 +0100 | [diff] [blame] | 33 | |
| 34 | # |
| 35 | # D2D |
| 36 | # |
| 37 | |
| 38 | HRESULT = MAKE_HRESULT(errors = [ |
| 39 | "D2DERR_UNSUPPORTED_PIXEL_FORMAT", |
| 40 | "D2DERR_INSUFFICIENT_BUFFER", |
| 41 | "D2DERR_WRONG_STATE", |
| 42 | "D2DERR_NOT_INITIALIZED", |
| 43 | "D2DERR_UNSUPPORTED_OPERATION", |
| 44 | "D2DERR_SCANNER_FAILED", |
| 45 | "D2DERR_SCREEN_ACCESS_DENIED", |
| 46 | "D2DERR_DISPLAY_STATE_INVALID", |
| 47 | "D2DERR_ZERO_VECTOR", |
| 48 | "D2DERR_INTERNAL_ERROR", |
| 49 | "D2DERR_DISPLAY_FORMAT_NOT_SUPPORTED", |
| 50 | "D2DERR_INVALID_CALL", |
| 51 | "D2DERR_NO_HARDWARE_DEVICE", |
| 52 | "D2DERR_RECREATE_TARGET", |
| 53 | "D2DERR_TOO_MANY_SHADER_ELEMENTS", |
| 54 | "D2DERR_SHADER_COMPILE_FAILED", |
| 55 | "D2DERR_MAX_TEXTURE_SIZE_EXCEEDED", |
| 56 | "D2DERR_UNSUPPORTED_VERSION", |
| 57 | "D2DERR_BAD_NUMBER", |
| 58 | "D2DERR_WRONG_FACTORY", |
| 59 | "D2DERR_LAYER_ALREADY_IN_USE", |
| 60 | "D2DERR_POP_CALL_DID_NOT_MATCH_PUSH", |
| 61 | "D2DERR_WRONG_RESOURCE_DOMAIN", |
| 62 | "D2DERR_PUSH_POP_UNBALANCED", |
| 63 | "D2DERR_RENDER_TARGET_HAS_LAYER_OR_CLIPRECT", |
| 64 | "D2DERR_INCOMPATIBLE_BRUSH_TYPES", |
| 65 | "D2DERR_WIN32_ERROR", |
| 66 | "D2DERR_TARGET_NOT_GDI_COMPATIBLE", |
| 67 | "D2DERR_TEXT_EFFECT_IS_WRONG_TYPE", |
| 68 | "D2DERR_TEXT_RENDERER_NOT_RELEASED", |
| 69 | "D2DERR_EXCEEDS_MAX_BITMAP_SIZE", |
| 70 | ]) |
| 71 | |
| 72 | D3DCOLORVALUE = Struct("D3DCOLORVALUE", [ |
| 73 | (FLOAT, "r"), |
| 74 | (FLOAT, "g"), |
| 75 | (FLOAT, "b"), |
| 76 | (FLOAT, "a"), |
| 77 | ]) |
| 78 | |
| 79 | D2D_POINT_2U = Struct("D2D_POINT_2U", [ |
| 80 | (UINT32, "x"), |
| 81 | (UINT32, "y"), |
| 82 | ]) |
| 83 | |
| 84 | D2D_POINT_2F = Struct("D2D_POINT_2F", [ |
| 85 | (FLOAT, "x"), |
| 86 | (FLOAT, "y"), |
| 87 | ]) |
| 88 | |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 89 | D2D_POINT_2L = Alias("D2D_POINT_2L", POINT) |
| 90 | |
| 91 | D2D_VECTOR_2F = Struct("D2D_VECTOR_2F", [ |
| 92 | (FLOAT, "x"), |
| 93 | (FLOAT, "y"), |
| 94 | ]) |
| 95 | |
| 96 | D2D_VECTOR_3F = Struct("D2D_VECTOR_3F", [ |
| 97 | (FLOAT, "x"), |
| 98 | (FLOAT, "y"), |
| 99 | (FLOAT, "z"), |
| 100 | ]) |
| 101 | |
| 102 | D2D_VECTOR_4F = Struct("D2D_VECTOR_4F", [ |
| 103 | (FLOAT, "x"), |
| 104 | (FLOAT, "y"), |
| 105 | (FLOAT, "z"), |
| 106 | (FLOAT, "w"), |
| 107 | ]) |
| 108 | |
Jose Fonseca | 25a41c5 | 2015-08-13 20:38:40 +0100 | [diff] [blame] | 109 | D2D_RECT_F = Struct("D2D_RECT_F", [ |
| 110 | (FLOAT, "left"), |
| 111 | (FLOAT, "top"), |
| 112 | (FLOAT, "right"), |
| 113 | (FLOAT, "bottom"), |
| 114 | ]) |
| 115 | |
| 116 | D2D_RECT_U = Struct("D2D_RECT_U", [ |
| 117 | (UINT32, "left"), |
| 118 | (UINT32, "top"), |
| 119 | (UINT32, "right"), |
| 120 | (UINT32, "bottom"), |
| 121 | ]) |
| 122 | |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 123 | D2D_RECT_L = Alias("D2D_RECT_L", RECT) |
| 124 | |
Jose Fonseca | 25a41c5 | 2015-08-13 20:38:40 +0100 | [diff] [blame] | 125 | D2D_SIZE_F = Struct("D2D_SIZE_F", [ |
| 126 | (FLOAT, "width"), |
| 127 | (FLOAT, "height"), |
| 128 | ]) |
| 129 | |
| 130 | D2D_SIZE_U = Struct("D2D_SIZE_U", [ |
| 131 | (UINT32, "width"), |
| 132 | (UINT32, "height"), |
| 133 | ]) |
| 134 | |
| 135 | D2D_COLOR_F = Alias("D2D_COLOR_F", D3DCOLORVALUE) |
| 136 | D2D_MATRIX_3X2_F = Struct("D2D_MATRIX_3X2_F", [ |
| 137 | (FLOAT, "_11"), |
| 138 | (FLOAT, "_12"), |
| 139 | (FLOAT, "_21"), |
| 140 | (FLOAT, "_22"), |
| 141 | (FLOAT, "_31"), |
| 142 | (FLOAT, "_32"), |
| 143 | ]) |
| 144 | |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 145 | D2D_MATRIX_4X3_F = Struct("D2D_MATRIX_4X3_F", [ |
| 146 | (Array(Array(FLOAT, 3), 4), "m"), |
| 147 | ]) |
| 148 | |
| 149 | D2D_MATRIX_4X4_F = Struct("D2D_MATRIX_4X4_F", [ |
| 150 | (Array(Array(FLOAT, 4), 4), "m"), |
| 151 | ]) |
| 152 | |
| 153 | D2D_MATRIX_5X4_F = Struct("D2D_MATRIX_5X4_F", [ |
| 154 | (Array(Array(FLOAT, 4), 5), "m"), |
| 155 | ]) |
| 156 | |
Jose Fonseca | 25a41c5 | 2015-08-13 20:38:40 +0100 | [diff] [blame] | 157 | |
| 158 | |
| 159 | # |
| 160 | # D2D1 |
| 161 | # |
| 162 | |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 163 | ID2D1Resource = Interface("ID2D1Resource", IUnknown) |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 164 | ID2D1Image = Interface("ID2D1Image", ID2D1Resource) |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 165 | ID2D1Bitmap = Interface("ID2D1Bitmap", ID2D1Resource) |
| 166 | ID2D1GradientStopCollection = Interface("ID2D1GradientStopCollection", ID2D1Resource) |
| 167 | ID2D1Brush = Interface("ID2D1Brush", ID2D1Resource) |
| 168 | ID2D1BitmapBrush = Interface("ID2D1BitmapBrush", ID2D1Brush) |
| 169 | ID2D1SolidColorBrush = Interface("ID2D1SolidColorBrush", ID2D1Brush) |
| 170 | ID2D1LinearGradientBrush = Interface("ID2D1LinearGradientBrush", ID2D1Brush) |
| 171 | ID2D1RadialGradientBrush = Interface("ID2D1RadialGradientBrush", ID2D1Brush) |
| 172 | ID2D1StrokeStyle = Interface("ID2D1StrokeStyle", ID2D1Resource) |
| 173 | ID2D1Geometry = Interface("ID2D1Geometry", ID2D1Resource) |
| 174 | ID2D1RectangleGeometry = Interface("ID2D1RectangleGeometry", ID2D1Geometry) |
| 175 | ID2D1RoundedRectangleGeometry = Interface("ID2D1RoundedRectangleGeometry", ID2D1Geometry) |
| 176 | ID2D1EllipseGeometry = Interface("ID2D1EllipseGeometry", ID2D1Geometry) |
| 177 | ID2D1GeometryGroup = Interface("ID2D1GeometryGroup", ID2D1Geometry) |
| 178 | ID2D1TransformedGeometry = Interface("ID2D1TransformedGeometry", ID2D1Geometry) |
| 179 | ID2D1GeometrySink = Interface("ID2D1GeometrySink", ID2D1SimplifiedGeometrySink) |
| 180 | ID2D1TessellationSink = Interface("ID2D1TessellationSink", IUnknown) |
| 181 | ID2D1PathGeometry = Interface("ID2D1PathGeometry", ID2D1Geometry) |
| 182 | ID2D1Mesh = Interface("ID2D1Mesh", ID2D1Resource) |
| 183 | ID2D1Layer = Interface("ID2D1Layer", ID2D1Resource) |
| 184 | ID2D1DrawingStateBlock = Interface("ID2D1DrawingStateBlock", ID2D1Resource) |
| 185 | ID2D1RenderTarget = Interface("ID2D1RenderTarget", ID2D1Resource) |
| 186 | ID2D1BitmapRenderTarget = Interface("ID2D1BitmapRenderTarget", ID2D1RenderTarget) |
| 187 | ID2D1HwndRenderTarget = Interface("ID2D1HwndRenderTarget", ID2D1RenderTarget) |
| 188 | ID2D1GdiInteropRenderTarget = Interface("ID2D1GdiInteropRenderTarget", IUnknown) |
| 189 | ID2D1DCRenderTarget = Interface("ID2D1DCRenderTarget", ID2D1RenderTarget) |
| 190 | ID2D1Factory = Interface("ID2D1Factory", IUnknown) |
| 191 | |
| 192 | |
| 193 | D2D1_ALPHA_MODE = Enum("D2D1_ALPHA_MODE", [ |
| 194 | "D2D1_ALPHA_MODE_UNKNOWN", |
| 195 | "D2D1_ALPHA_MODE_PREMULTIPLIED", |
| 196 | "D2D1_ALPHA_MODE_STRAIGHT", |
| 197 | "D2D1_ALPHA_MODE_IGNORE", |
| 198 | ]) |
| 199 | |
| 200 | D2D1_GAMMA = Enum("D2D1_GAMMA", [ |
| 201 | "D2D1_GAMMA_2_2", |
| 202 | "D2D1_GAMMA_1_0", |
| 203 | ]) |
| 204 | |
| 205 | D2D1_OPACITY_MASK_CONTENT = Enum("D2D1_OPACITY_MASK_CONTENT", [ |
| 206 | "D2D1_OPACITY_MASK_CONTENT_GRAPHICS", |
| 207 | "D2D1_OPACITY_MASK_CONTENT_TEXT_NATURAL", |
| 208 | "D2D1_OPACITY_MASK_CONTENT_TEXT_GDI_COMPATIBLE", |
| 209 | ]) |
| 210 | |
| 211 | D2D1_EXTEND_MODE = Enum("D2D1_EXTEND_MODE", [ |
| 212 | "D2D1_EXTEND_MODE_CLAMP", |
| 213 | "D2D1_EXTEND_MODE_WRAP", |
| 214 | "D2D1_EXTEND_MODE_MIRROR", |
| 215 | ]) |
| 216 | |
| 217 | D2D1_ANTIALIAS_MODE = Enum("D2D1_ANTIALIAS_MODE", [ |
| 218 | "D2D1_ANTIALIAS_MODE_PER_PRIMITIVE", |
| 219 | "D2D1_ANTIALIAS_MODE_ALIASED", |
| 220 | ]) |
| 221 | |
| 222 | D2D1_TEXT_ANTIALIAS_MODE = Enum("D2D1_TEXT_ANTIALIAS_MODE", [ |
| 223 | "D2D1_TEXT_ANTIALIAS_MODE_DEFAULT", |
| 224 | "D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE", |
| 225 | "D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE", |
| 226 | "D2D1_TEXT_ANTIALIAS_MODE_ALIASED", |
| 227 | ]) |
| 228 | |
| 229 | D2D1_BITMAP_INTERPOLATION_MODE = Enum("D2D1_BITMAP_INTERPOLATION_MODE", [ |
| 230 | "D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR", |
| 231 | "D2D1_BITMAP_INTERPOLATION_MODE_LINEAR", |
| 232 | ]) |
| 233 | |
Jose Fonseca | 8a4c9af | 2016-05-18 16:25:35 +0100 | [diff] [blame] | 234 | D2D1_DRAW_TEXT_OPTIONS = EnumFlags("D2D1_DRAW_TEXT_OPTIONS", [ |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 235 | "D2D1_DRAW_TEXT_OPTIONS_NONE", |
| 236 | "D2D1_DRAW_TEXT_OPTIONS_NO_SNAP", |
José Fonseca | b63c328 | 2011-10-10 14:18:38 +0100 | [diff] [blame] | 237 | "D2D1_DRAW_TEXT_OPTIONS_CLIP", |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 238 | ]) |
| 239 | |
| 240 | D2D1_PIXEL_FORMAT = Struct("D2D1_PIXEL_FORMAT", [ |
| 241 | (DXGI_FORMAT, "format"), |
| 242 | (D2D1_ALPHA_MODE, "alphaMode"), |
| 243 | ]) |
| 244 | |
| 245 | D2D1_POINT_2U = Alias("D2D1_POINT_2U", D2D_POINT_2U) |
| 246 | D2D1_POINT_2F = Alias("D2D1_POINT_2F", D2D_POINT_2F) |
| 247 | D2D1_RECT_F = Alias("D2D1_RECT_F", D2D_RECT_F) |
| 248 | D2D1_RECT_U = Alias("D2D1_RECT_U", D2D_RECT_U) |
| 249 | D2D1_SIZE_F = Alias("D2D1_SIZE_F", D2D_SIZE_F) |
| 250 | D2D1_SIZE_U = Alias("D2D1_SIZE_U", D2D_SIZE_U) |
| 251 | D2D1_COLOR_F = Alias("D2D1_COLOR_F", D2D_COLOR_F) |
| 252 | D2D1_MATRIX_3X2_F = Alias("D2D1_MATRIX_3X2_F", D2D_MATRIX_3X2_F) |
| 253 | D2D1_TAG = Alias("D2D1_TAG", UINT64) |
| 254 | D2D1_BITMAP_PROPERTIES = Struct("D2D1_BITMAP_PROPERTIES", [ |
| 255 | (D2D1_PIXEL_FORMAT, "pixelFormat"), |
| 256 | (FLOAT, "dpiX"), |
| 257 | (FLOAT, "dpiY"), |
| 258 | ]) |
| 259 | |
| 260 | D2D1_GRADIENT_STOP = Struct("D2D1_GRADIENT_STOP", [ |
| 261 | (FLOAT, "position"), |
| 262 | (D2D1_COLOR_F, "color"), |
| 263 | ]) |
| 264 | |
| 265 | D2D1_BRUSH_PROPERTIES = Struct("D2D1_BRUSH_PROPERTIES", [ |
| 266 | (FLOAT, "opacity"), |
| 267 | (D2D1_MATRIX_3X2_F, "transform"), |
| 268 | ]) |
| 269 | |
| 270 | D2D1_BITMAP_BRUSH_PROPERTIES = Struct("D2D1_BITMAP_BRUSH_PROPERTIES", [ |
| 271 | (D2D1_EXTEND_MODE, "extendModeX"), |
| 272 | (D2D1_EXTEND_MODE, "extendModeY"), |
| 273 | (D2D1_BITMAP_INTERPOLATION_MODE, "interpolationMode"), |
| 274 | ]) |
| 275 | |
| 276 | D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES = Struct("D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES", [ |
| 277 | (D2D1_POINT_2F, "startPoint"), |
| 278 | (D2D1_POINT_2F, "endPoint"), |
| 279 | ]) |
| 280 | |
| 281 | D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES = Struct("D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES", [ |
| 282 | (D2D1_POINT_2F, "center"), |
| 283 | (D2D1_POINT_2F, "gradientOriginOffset"), |
| 284 | (FLOAT, "radiusX"), |
| 285 | (FLOAT, "radiusY"), |
| 286 | ]) |
| 287 | |
| 288 | D2D1_ARC_SIZE = Enum("D2D1_ARC_SIZE", [ |
| 289 | "D2D1_ARC_SIZE_SMALL", |
| 290 | "D2D1_ARC_SIZE_LARGE", |
| 291 | ]) |
| 292 | |
| 293 | D2D1_CAP_STYLE = Enum("D2D1_CAP_STYLE", [ |
| 294 | "D2D1_CAP_STYLE_FLAT", |
| 295 | "D2D1_CAP_STYLE_SQUARE", |
| 296 | "D2D1_CAP_STYLE_ROUND", |
| 297 | "D2D1_CAP_STYLE_TRIANGLE", |
| 298 | ]) |
| 299 | |
| 300 | D2D1_DASH_STYLE = Enum("D2D1_DASH_STYLE", [ |
| 301 | "D2D1_DASH_STYLE_SOLID", |
| 302 | "D2D1_DASH_STYLE_DASH", |
| 303 | "D2D1_DASH_STYLE_DOT", |
| 304 | "D2D1_DASH_STYLE_DASH_DOT", |
| 305 | "D2D1_DASH_STYLE_DASH_DOT_DOT", |
| 306 | "D2D1_DASH_STYLE_CUSTOM", |
| 307 | ]) |
| 308 | |
| 309 | D2D1_LINE_JOIN = Enum("D2D1_LINE_JOIN", [ |
| 310 | "D2D1_LINE_JOIN_MITER", |
| 311 | "D2D1_LINE_JOIN_BEVEL", |
| 312 | "D2D1_LINE_JOIN_ROUND", |
| 313 | "D2D1_LINE_JOIN_MITER_OR_BEVEL", |
| 314 | ]) |
| 315 | |
| 316 | D2D1_COMBINE_MODE = Enum("D2D1_COMBINE_MODE", [ |
| 317 | "D2D1_COMBINE_MODE_UNION", |
| 318 | "D2D1_COMBINE_MODE_INTERSECT", |
| 319 | "D2D1_COMBINE_MODE_XOR", |
| 320 | "D2D1_COMBINE_MODE_EXCLUDE", |
| 321 | ]) |
| 322 | |
| 323 | D2D1_GEOMETRY_RELATION = Enum("D2D1_GEOMETRY_RELATION", [ |
| 324 | "D2D1_GEOMETRY_RELATION_UNKNOWN", |
| 325 | "D2D1_GEOMETRY_RELATION_DISJOINT", |
| 326 | "D2D1_GEOMETRY_RELATION_IS_CONTAINED", |
| 327 | "D2D1_GEOMETRY_RELATION_CONTAINS", |
| 328 | "D2D1_GEOMETRY_RELATION_OVERLAP", |
| 329 | ]) |
| 330 | |
| 331 | D2D1_GEOMETRY_SIMPLIFICATION_OPTION = Enum("D2D1_GEOMETRY_SIMPLIFICATION_OPTION", [ |
| 332 | "D2D1_GEOMETRY_SIMPLIFICATION_OPTION_CUBICS_AND_LINES", |
| 333 | "D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES", |
| 334 | ]) |
| 335 | |
| 336 | D2D1_FIGURE_BEGIN = Enum("D2D1_FIGURE_BEGIN", [ |
| 337 | "D2D1_FIGURE_BEGIN_FILLED", |
| 338 | "D2D1_FIGURE_BEGIN_HOLLOW", |
| 339 | ]) |
| 340 | |
| 341 | D2D1_FIGURE_END = Enum("D2D1_FIGURE_END", [ |
| 342 | "D2D1_FIGURE_END_OPEN", |
| 343 | "D2D1_FIGURE_END_CLOSED", |
| 344 | ]) |
| 345 | |
| 346 | D2D1_BEZIER_SEGMENT = Struct("D2D1_BEZIER_SEGMENT", [ |
| 347 | (D2D1_POINT_2F, "point1"), |
| 348 | (D2D1_POINT_2F, "point2"), |
| 349 | (D2D1_POINT_2F, "point3"), |
| 350 | ]) |
| 351 | |
| 352 | D2D1_TRIANGLE = Struct("D2D1_TRIANGLE", [ |
| 353 | (D2D1_POINT_2F, "point1"), |
| 354 | (D2D1_POINT_2F, "point2"), |
| 355 | (D2D1_POINT_2F, "point3"), |
| 356 | ]) |
| 357 | |
Jose Fonseca | 8a4c9af | 2016-05-18 16:25:35 +0100 | [diff] [blame] | 358 | D2D1_PATH_SEGMENT = EnumFlags("D2D1_PATH_SEGMENT", [ |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 359 | "D2D1_PATH_SEGMENT_NONE", |
| 360 | "D2D1_PATH_SEGMENT_FORCE_UNSTROKED", |
| 361 | "D2D1_PATH_SEGMENT_FORCE_ROUND_LINE_JOIN", |
| 362 | ]) |
| 363 | |
| 364 | D2D1_SWEEP_DIRECTION = Enum("D2D1_SWEEP_DIRECTION", [ |
| 365 | "D2D1_SWEEP_DIRECTION_COUNTER_CLOCKWISE", |
| 366 | "D2D1_SWEEP_DIRECTION_CLOCKWISE", |
| 367 | ]) |
| 368 | |
| 369 | D2D1_FILL_MODE = Enum("D2D1_FILL_MODE", [ |
| 370 | "D2D1_FILL_MODE_ALTERNATE", |
| 371 | "D2D1_FILL_MODE_WINDING", |
| 372 | ]) |
| 373 | |
| 374 | D2D1_ARC_SEGMENT = Struct("D2D1_ARC_SEGMENT", [ |
| 375 | (D2D1_POINT_2F, "point"), |
| 376 | (D2D1_SIZE_F, "size"), |
| 377 | (FLOAT, "rotationAngle"), |
| 378 | (D2D1_SWEEP_DIRECTION, "sweepDirection"), |
| 379 | (D2D1_ARC_SIZE, "arcSize"), |
| 380 | ]) |
| 381 | |
| 382 | D2D1_QUADRATIC_BEZIER_SEGMENT = Struct("D2D1_QUADRATIC_BEZIER_SEGMENT", [ |
| 383 | (D2D1_POINT_2F, "point1"), |
| 384 | (D2D1_POINT_2F, "point2"), |
| 385 | ]) |
| 386 | |
| 387 | D2D1_ELLIPSE = Struct("D2D1_ELLIPSE", [ |
| 388 | (D2D1_POINT_2F, "point"), |
| 389 | (FLOAT, "radiusX"), |
| 390 | (FLOAT, "radiusY"), |
| 391 | ]) |
| 392 | |
| 393 | D2D1_ROUNDED_RECT = Struct("D2D1_ROUNDED_RECT", [ |
| 394 | (D2D1_RECT_F, "rect"), |
| 395 | (FLOAT, "radiusX"), |
| 396 | (FLOAT, "radiusY"), |
| 397 | ]) |
| 398 | |
| 399 | D2D1_STROKE_STYLE_PROPERTIES = Struct("D2D1_STROKE_STYLE_PROPERTIES", [ |
| 400 | (D2D1_CAP_STYLE, "startCap"), |
| 401 | (D2D1_CAP_STYLE, "endCap"), |
| 402 | (D2D1_CAP_STYLE, "dashCap"), |
| 403 | (D2D1_LINE_JOIN, "lineJoin"), |
| 404 | (FLOAT, "miterLimit"), |
| 405 | (D2D1_DASH_STYLE, "dashStyle"), |
| 406 | (FLOAT, "dashOffset"), |
| 407 | ]) |
| 408 | |
Jose Fonseca | 8a4c9af | 2016-05-18 16:25:35 +0100 | [diff] [blame] | 409 | D2D1_LAYER_OPTIONS = EnumFlags("D2D1_LAYER_OPTIONS", [ |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 410 | "D2D1_LAYER_OPTIONS_NONE", |
| 411 | "D2D1_LAYER_OPTIONS_INITIALIZE_FOR_CLEARTYPE", |
| 412 | ]) |
| 413 | |
| 414 | D2D1_LAYER_PARAMETERS = Struct("D2D1_LAYER_PARAMETERS", [ |
| 415 | (D2D1_RECT_F, "contentBounds"), |
José Fonseca | e7cb2b9 | 2012-09-28 08:40:24 +0100 | [diff] [blame] | 416 | (ObjPointer(ID2D1Geometry), "geometricMask"), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 417 | (D2D1_ANTIALIAS_MODE, "maskAntialiasMode"), |
| 418 | (D2D1_MATRIX_3X2_F, "maskTransform"), |
| 419 | (FLOAT, "opacity"), |
José Fonseca | e7cb2b9 | 2012-09-28 08:40:24 +0100 | [diff] [blame] | 420 | (ObjPointer(ID2D1Brush), "opacityBrush"), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 421 | (D2D1_LAYER_OPTIONS, "layerOptions"), |
| 422 | ]) |
| 423 | |
Jose Fonseca | 8a4c9af | 2016-05-18 16:25:35 +0100 | [diff] [blame] | 424 | D2D1_WINDOW_STATE = EnumFlags("D2D1_WINDOW_STATE", [ |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 425 | "D2D1_WINDOW_STATE_NONE", |
| 426 | "D2D1_WINDOW_STATE_OCCLUDED", |
| 427 | ]) |
| 428 | |
| 429 | D2D1_RENDER_TARGET_TYPE = Enum("D2D1_RENDER_TARGET_TYPE", [ |
| 430 | "D2D1_RENDER_TARGET_TYPE_DEFAULT", |
| 431 | "D2D1_RENDER_TARGET_TYPE_SOFTWARE", |
| 432 | "D2D1_RENDER_TARGET_TYPE_HARDWARE", |
| 433 | ]) |
| 434 | |
| 435 | D2D1_FEATURE_LEVEL = Enum("D2D1_FEATURE_LEVEL", [ |
| 436 | "D2D1_FEATURE_LEVEL_DEFAULT", |
| 437 | "D2D1_FEATURE_LEVEL_9", |
| 438 | "D2D1_FEATURE_LEVEL_10", |
| 439 | ]) |
| 440 | |
Jose Fonseca | 8a4c9af | 2016-05-18 16:25:35 +0100 | [diff] [blame] | 441 | D2D1_RENDER_TARGET_USAGE = EnumFlags("D2D1_RENDER_TARGET_USAGE", [ |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 442 | "D2D1_RENDER_TARGET_USAGE_NONE", |
| 443 | "D2D1_RENDER_TARGET_USAGE_FORCE_BITMAP_REMOTING", |
| 444 | "D2D1_RENDER_TARGET_USAGE_GDI_COMPATIBLE", |
| 445 | ]) |
| 446 | |
Jose Fonseca | 8a4c9af | 2016-05-18 16:25:35 +0100 | [diff] [blame] | 447 | D2D1_PRESENT_OPTIONS = EnumFlags("D2D1_PRESENT_OPTIONS", [ |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 448 | "D2D1_PRESENT_OPTIONS_NONE", |
| 449 | "D2D1_PRESENT_OPTIONS_RETAIN_CONTENTS", |
| 450 | "D2D1_PRESENT_OPTIONS_IMMEDIATELY", |
| 451 | ]) |
| 452 | |
| 453 | D2D1_RENDER_TARGET_PROPERTIES = Struct("D2D1_RENDER_TARGET_PROPERTIES", [ |
| 454 | (D2D1_RENDER_TARGET_TYPE, "type"), |
| 455 | (D2D1_PIXEL_FORMAT, "pixelFormat"), |
| 456 | (FLOAT, "dpiX"), |
| 457 | (FLOAT, "dpiY"), |
| 458 | (D2D1_RENDER_TARGET_USAGE, "usage"), |
| 459 | (D2D1_FEATURE_LEVEL, "minLevel"), |
| 460 | ]) |
| 461 | |
| 462 | D2D1_HWND_RENDER_TARGET_PROPERTIES = Struct("D2D1_HWND_RENDER_TARGET_PROPERTIES", [ |
| 463 | (HWND, "hwnd"), |
| 464 | (D2D1_SIZE_U, "pixelSize"), |
| 465 | (D2D1_PRESENT_OPTIONS, "presentOptions"), |
| 466 | ]) |
| 467 | |
Jose Fonseca | 8a4c9af | 2016-05-18 16:25:35 +0100 | [diff] [blame] | 468 | D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS = EnumFlags("D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS", [ |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 469 | "D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_NONE", |
| 470 | "D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS_GDI_COMPATIBLE", |
| 471 | ]) |
| 472 | |
| 473 | D2D1_DRAWING_STATE_DESCRIPTION = Struct("D2D1_DRAWING_STATE_DESCRIPTION", [ |
| 474 | (D2D1_ANTIALIAS_MODE, "antialiasMode"), |
| 475 | (D2D1_TEXT_ANTIALIAS_MODE, "textAntialiasMode"), |
| 476 | (D2D1_TAG, "tag1"), |
| 477 | (D2D1_TAG, "tag2"), |
| 478 | (D2D1_MATRIX_3X2_F, "transform"), |
| 479 | ]) |
| 480 | |
| 481 | D2D1_DC_INITIALIZE_MODE = Enum("D2D1_DC_INITIALIZE_MODE", [ |
| 482 | "D2D1_DC_INITIALIZE_MODE_COPY", |
| 483 | "D2D1_DC_INITIALIZE_MODE_CLEAR", |
| 484 | ]) |
| 485 | |
| 486 | D2D1_DEBUG_LEVEL = Enum("D2D1_DEBUG_LEVEL", [ |
| 487 | "D2D1_DEBUG_LEVEL_NONE", |
| 488 | "D2D1_DEBUG_LEVEL_ERROR", |
| 489 | "D2D1_DEBUG_LEVEL_WARNING", |
| 490 | "D2D1_DEBUG_LEVEL_INFORMATION", |
| 491 | ]) |
| 492 | |
| 493 | D2D1_FACTORY_TYPE = Enum("D2D1_FACTORY_TYPE", [ |
| 494 | "D2D1_FACTORY_TYPE_SINGLE_THREADED", |
| 495 | "D2D1_FACTORY_TYPE_MULTI_THREADED", |
| 496 | ]) |
| 497 | |
| 498 | D2D1_FACTORY_OPTIONS = Struct("D2D1_FACTORY_OPTIONS", [ |
| 499 | (D2D1_DEBUG_LEVEL, "debugLevel"), |
| 500 | ]) |
| 501 | |
| 502 | ID2D1Resource.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 503 | StdMethod(Void, "GetFactory", [Out(Pointer(ObjPointer(ID2D1Factory)), "factory")], const=True), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 504 | ] |
| 505 | |
| 506 | ID2D1Bitmap.methods += [ |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 507 | StdMethod(D2D1_SIZE_F, "GetSize", [], const=True, sideeffects=False), |
| 508 | StdMethod(D2D1_SIZE_U, "GetPixelSize", [], const=True, sideeffects=False), |
| 509 | StdMethod(D2D1_PIXEL_FORMAT, "GetPixelFormat", [], const=True, sideeffects=False), |
| 510 | StdMethod(Void, "GetDpi", [Out(Pointer(FLOAT), "dpiX"), Out(Pointer(FLOAT), "dpiY")], const=True, sideeffects=False), |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 511 | StdMethod(HRESULT, "CopyFromBitmap", [(Pointer(Const(D2D1_POINT_2U)), "destPoint"), (ObjPointer(ID2D1Bitmap), "bitmap"), (Pointer(Const(D2D1_RECT_U)), "srcRect")]), |
| 512 | StdMethod(HRESULT, "CopyFromRenderTarget", [(Pointer(Const(D2D1_POINT_2U)), "destPoint"), (ObjPointer(ID2D1RenderTarget), "renderTarget"), (Pointer(Const(D2D1_RECT_U)), "srcRect")]), |
| 513 | StdMethod(HRESULT, "CopyFromMemory", [(Pointer(Const(D2D1_RECT_U)), "dstRect"), (OpaquePointer(Const(Void)), "srcData"), (UINT32, "pitch")]), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 514 | ] |
| 515 | |
| 516 | ID2D1GradientStopCollection.methods += [ |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 517 | StdMethod(UINT32, "GetGradientStopCount", [], const=True, sideeffects=False), |
| 518 | StdMethod(Void, "GetGradientStops", [Out(Pointer(D2D1_GRADIENT_STOP), "gradientStops"), (UINT, "gradientStopsCount")], const=True, sideeffects=False), |
| 519 | StdMethod(D2D1_GAMMA, "GetColorInterpolationGamma", [], const=True, sideeffects=False), |
| 520 | StdMethod(D2D1_EXTEND_MODE, "GetExtendMode", [], const=True, sideeffects=False), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 521 | ] |
| 522 | |
| 523 | ID2D1Brush.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 524 | StdMethod(Void, "SetOpacity", [(FLOAT, "opacity")]), |
| 525 | StdMethod(Void, "SetTransform", [(Pointer(Const(D2D1_MATRIX_3X2_F)), "transform")]), |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 526 | StdMethod(FLOAT, "GetOpacity", [], const=True, sideeffects=False), |
| 527 | StdMethod(Void, "GetTransform", [Out(Pointer(D2D1_MATRIX_3X2_F), "transform")], const=True, sideeffects=False), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 528 | ] |
| 529 | |
| 530 | ID2D1BitmapBrush.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 531 | StdMethod(Void, "SetExtendModeX", [(D2D1_EXTEND_MODE, "extendModeX")]), |
| 532 | StdMethod(Void, "SetExtendModeY", [(D2D1_EXTEND_MODE, "extendModeY")]), |
| 533 | StdMethod(Void, "SetInterpolationMode", [(D2D1_BITMAP_INTERPOLATION_MODE, "interpolationMode")]), |
| 534 | StdMethod(Void, "SetBitmap", [(ObjPointer(ID2D1Bitmap), "bitmap")]), |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 535 | StdMethod(D2D1_EXTEND_MODE, "GetExtendModeX", [], const=True, sideeffects=False), |
| 536 | StdMethod(D2D1_EXTEND_MODE, "GetExtendModeY", [], const=True, sideeffects=False), |
| 537 | StdMethod(D2D1_BITMAP_INTERPOLATION_MODE, "GetInterpolationMode", [], const=True, sideeffects=False), |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 538 | StdMethod(Void, "GetBitmap", [Out(Pointer(ObjPointer(ID2D1Bitmap)), "bitmap")], const=True), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 539 | ] |
| 540 | |
| 541 | ID2D1SolidColorBrush.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 542 | StdMethod(Void, "SetColor", [(Pointer(Const(D2D1_COLOR_F)), "color")]), |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 543 | StdMethod(D2D1_COLOR_F, "GetColor", [], const=True, sideeffects=False), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 544 | ] |
| 545 | |
| 546 | ID2D1LinearGradientBrush.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 547 | StdMethod(Void, "SetStartPoint", [(D2D1_POINT_2F, "startPoint")]), |
| 548 | StdMethod(Void, "SetEndPoint", [(D2D1_POINT_2F, "endPoint")]), |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 549 | StdMethod(D2D1_POINT_2F, "GetStartPoint", [], const=True, sideeffects=False), |
| 550 | StdMethod(D2D1_POINT_2F, "GetEndPoint", [], const=True, sideeffects=False), |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 551 | StdMethod(Void, "GetGradientStopCollection", [Out(Pointer(ObjPointer(ID2D1GradientStopCollection)), "gradientStopCollection")], const=True), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 552 | ] |
| 553 | |
| 554 | ID2D1RadialGradientBrush.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 555 | StdMethod(Void, "SetCenter", [(D2D1_POINT_2F, "center")]), |
| 556 | StdMethod(Void, "SetGradientOriginOffset", [(D2D1_POINT_2F, "gradientOriginOffset")]), |
| 557 | StdMethod(Void, "SetRadiusX", [(FLOAT, "radiusX")]), |
| 558 | StdMethod(Void, "SetRadiusY", [(FLOAT, "radiusY")]), |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 559 | StdMethod(D2D1_POINT_2F, "GetCenter", [], const=True, sideeffects=False), |
| 560 | StdMethod(D2D1_POINT_2F, "GetGradientOriginOffset", [], const=True, sideeffects=False), |
| 561 | StdMethod(FLOAT, "GetRadiusX", [], const=True, sideeffects=False), |
| 562 | StdMethod(FLOAT, "GetRadiusY", [], const=True, sideeffects=False), |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 563 | StdMethod(Void, "GetGradientStopCollection", [Out(Pointer(ObjPointer(ID2D1GradientStopCollection)), "gradientStopCollection")], const=True), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 564 | ] |
| 565 | |
| 566 | ID2D1StrokeStyle.methods += [ |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 567 | StdMethod(D2D1_CAP_STYLE, "GetStartCap", [], const=True, sideeffects=False), |
| 568 | StdMethod(D2D1_CAP_STYLE, "GetEndCap", [], const=True, sideeffects=False), |
| 569 | StdMethod(D2D1_CAP_STYLE, "GetDashCap", [], const=True, sideeffects=False), |
| 570 | StdMethod(FLOAT, "GetMiterLimit", [], const=True, sideeffects=False), |
| 571 | StdMethod(D2D1_LINE_JOIN, "GetLineJoin", [], const=True, sideeffects=False), |
| 572 | StdMethod(FLOAT, "GetDashOffset", [], const=True, sideeffects=False), |
| 573 | StdMethod(D2D1_DASH_STYLE, "GetDashStyle", [], const=True, sideeffects=False), |
| 574 | StdMethod(UINT32, "GetDashesCount", [], const=True, sideeffects=False), |
| 575 | StdMethod(Void, "GetDashes", [Out(Array(FLOAT, "dashesCount"), "dashes"), (UINT, "dashesCount")], const=True, sideeffects=False), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 576 | ] |
| 577 | |
| 578 | ID2D1Geometry.methods += [ |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 579 | StdMethod(HRESULT, "GetBounds", [(Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), Out(Pointer(D2D1_RECT_F), "bounds")], const=True, sideeffects=False), |
| 580 | 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), |
| 581 | 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), |
| 582 | StdMethod(HRESULT, "FillContainsPoint", [(D2D1_POINT_2F, "point"), (Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), (FLOAT, "flatteningTolerance"), Out(Pointer(BOOL), "contains")], const=True, sideeffects=False), |
| 583 | 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), |
| 584 | StdMethod(HRESULT, "Simplify", [(D2D1_GEOMETRY_SIMPLIFICATION_OPTION, "simplificationOption"), (Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), (FLOAT, "flatteningTolerance"), (ObjPointer(ID2D1SimplifiedGeometrySink), "geometrySink")], const=True, sideeffects=False), |
| 585 | StdMethod(HRESULT, "Tessellate", [(Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), (FLOAT, "flatteningTolerance"), (ObjPointer(ID2D1TessellationSink), "tessellationSink")], const=True, sideeffects=False), |
| 586 | 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), |
| 587 | StdMethod(HRESULT, "Outline", [(Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), (FLOAT, "flatteningTolerance"), (ObjPointer(ID2D1SimplifiedGeometrySink), "geometrySink")], const=True, sideeffects=False), |
| 588 | StdMethod(HRESULT, "ComputeArea", [(Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), (FLOAT, "flatteningTolerance"), Out(Pointer(FLOAT), "area")], const=True, sideeffects=False), |
| 589 | StdMethod(HRESULT, "ComputeLength", [(Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), (FLOAT, "flatteningTolerance"), Out(Pointer(FLOAT), "length")], const=True, sideeffects=False), |
| 590 | 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), |
| 591 | StdMethod(HRESULT, "Widen", [(FLOAT, "strokeWidth"), (ObjPointer(ID2D1StrokeStyle), "strokeStyle"), (Pointer(Const(D2D1_MATRIX_3X2_F)), "worldTransform"), (FLOAT, "flatteningTolerance"), (ObjPointer(ID2D1SimplifiedGeometrySink), "geometrySink")], const=True, sideeffects=False), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 592 | ] |
| 593 | |
| 594 | ID2D1RectangleGeometry.methods += [ |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 595 | StdMethod(Void, "GetRect", [Out(Pointer(D2D1_RECT_F), "rect")], const=True, sideeffects=False), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 596 | ] |
| 597 | |
| 598 | ID2D1RoundedRectangleGeometry.methods += [ |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 599 | StdMethod(Void, "GetRoundedRect", [Out(Pointer(D2D1_ROUNDED_RECT), "roundedRect")], const=True, sideeffects=False), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 600 | ] |
| 601 | |
| 602 | ID2D1EllipseGeometry.methods += [ |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 603 | StdMethod(Void, "GetEllipse", [Out(Pointer(D2D1_ELLIPSE), "ellipse")], const=True, sideeffects=False), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 604 | ] |
| 605 | |
| 606 | ID2D1GeometryGroup.methods += [ |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 607 | StdMethod(D2D1_FILL_MODE, "GetFillMode", [], const=True, sideeffects=False), |
| 608 | StdMethod(UINT32, "GetSourceGeometryCount", [], const=True, sideeffects=False), |
| 609 | StdMethod(Void, "GetSourceGeometries", [Out(Array(ObjPointer(ID2D1Geometry), "geometriesCount"), "geometries"), (UINT, "geometriesCount")], const=True, sideeffects=False), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 610 | ] |
| 611 | |
| 612 | ID2D1TransformedGeometry.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 613 | StdMethod(Void, "GetSourceGeometry", [Out(Pointer(ObjPointer(ID2D1Geometry)), "sourceGeometry")], const=True), |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 614 | StdMethod(Void, "GetTransform", [Out(Pointer(D2D1_MATRIX_3X2_F), "transform")], const=True, sideeffects=False), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 615 | ] |
| 616 | |
| 617 | ID2D1SimplifiedGeometrySink.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 618 | StdMethod(Void, "SetFillMode", [(D2D1_FILL_MODE, "fillMode")]), |
| 619 | StdMethod(Void, "SetSegmentFlags", [(D2D1_PATH_SEGMENT, "vertexFlags")]), |
| 620 | StdMethod(Void, "BeginFigure", [(D2D1_POINT_2F, "startPoint"), (D2D1_FIGURE_BEGIN, "figureBegin")]), |
| 621 | StdMethod(Void, "AddLines", [(Array(Const(D2D1_POINT_2F), "pointsCount"), "points"), (UINT, "pointsCount")]), |
| 622 | StdMethod(Void, "AddBeziers", [(Array(Const(D2D1_BEZIER_SEGMENT), "beziersCount"), "beziers"), (UINT, "beziersCount")]), |
| 623 | StdMethod(Void, "EndFigure", [(D2D1_FIGURE_END, "figureEnd")]), |
| 624 | StdMethod(HRESULT, "Close", []), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 625 | ] |
| 626 | |
| 627 | ID2D1GeometrySink.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 628 | StdMethod(Void, "AddLine", [(D2D1_POINT_2F, "point")]), |
| 629 | StdMethod(Void, "AddBezier", [(Pointer(Const(D2D1_BEZIER_SEGMENT)), "bezier")]), |
| 630 | StdMethod(Void, "AddQuadraticBezier", [(Pointer(Const(D2D1_QUADRATIC_BEZIER_SEGMENT)), "bezier")]), |
| 631 | StdMethod(Void, "AddQuadraticBeziers", [(Array(Const(D2D1_QUADRATIC_BEZIER_SEGMENT), "beziersCount"), "beziers"), (UINT, "beziersCount")]), |
| 632 | StdMethod(Void, "AddArc", [(Pointer(Const(D2D1_ARC_SEGMENT)), "arc")]), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 633 | ] |
| 634 | |
| 635 | ID2D1TessellationSink.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 636 | StdMethod(Void, "AddTriangles", [(Array(Const(D2D1_TRIANGLE), "trianglesCount"), "triangles"), (UINT, "trianglesCount")]), |
| 637 | StdMethod(HRESULT, "Close", []), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 638 | ] |
| 639 | |
| 640 | ID2D1PathGeometry.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 641 | StdMethod(HRESULT, "Open", [Out(Pointer(ObjPointer(ID2D1GeometrySink)), "geometrySink")]), |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 642 | StdMethod(HRESULT, "Stream", [(ObjPointer(ID2D1GeometrySink), "geometrySink")], const=True, sideeffects=False), |
| 643 | StdMethod(HRESULT, "GetSegmentCount", [Out(Pointer(UINT32), "count")], const=True, sideeffects=False), |
| 644 | StdMethod(HRESULT, "GetFigureCount", [Out(Pointer(UINT32), "count")], const=True, sideeffects=False), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 645 | ] |
| 646 | |
| 647 | ID2D1Mesh.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 648 | StdMethod(HRESULT, "Open", [Out(Pointer(ObjPointer(ID2D1TessellationSink)), "tessellationSink")]), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 649 | ] |
| 650 | |
| 651 | ID2D1Layer.methods += [ |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 652 | StdMethod(D2D1_SIZE_F, "GetSize", [], const=True, sideeffects=False), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 653 | ] |
| 654 | |
| 655 | ID2D1DrawingStateBlock.methods += [ |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 656 | StdMethod(Void, "GetDescription", [Out(Pointer(D2D1_DRAWING_STATE_DESCRIPTION), "stateDescription")], const=True, sideeffects=False), |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 657 | StdMethod(Void, "SetDescription", [(Pointer(Const(D2D1_DRAWING_STATE_DESCRIPTION)), "stateDescription")]), |
| 658 | StdMethod(Void, "SetTextRenderingParams", [(ObjPointer(IDWriteRenderingParams), "textRenderingParams")]), |
| 659 | StdMethod(Void, "GetTextRenderingParams", [Out(Pointer(ObjPointer(IDWriteRenderingParams)), "textRenderingParams")], const=True), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 660 | ] |
| 661 | |
| 662 | ID2D1RenderTarget.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 663 | StdMethod(HRESULT, "CreateBitmap", [(D2D1_SIZE_U, "size"), (OpaquePointer(Const(Void)), "srcData"), (UINT32, "pitch"), (Pointer(Const(D2D1_BITMAP_PROPERTIES)), "bitmapProperties"), Out(Pointer(ObjPointer(ID2D1Bitmap)), "bitmap")]), |
| 664 | StdMethod(HRESULT, "CreateBitmapFromWicBitmap", [(Opaque("IWICBitmapSource *"), "wicBitmapSource"), (Pointer(Const(D2D1_BITMAP_PROPERTIES)), "bitmapProperties"), Out(Pointer(ObjPointer(ID2D1Bitmap)), "bitmap")]), |
| 665 | StdMethod(HRESULT, "CreateSharedBitmap", [(REFIID, "riid"), Out(OpaquePointer(Void), "data"), (Pointer(Const(D2D1_BITMAP_PROPERTIES)), "bitmapProperties"), Out(Pointer(ObjPointer(ID2D1Bitmap)), "bitmap")]), |
| 666 | StdMethod(HRESULT, "CreateBitmapBrush", [(ObjPointer(ID2D1Bitmap), "bitmap"), (Pointer(Const(D2D1_BITMAP_BRUSH_PROPERTIES)), "bitmapBrushProperties"), (Pointer(Const(D2D1_BRUSH_PROPERTIES)), "brushProperties"), Out(Pointer(ObjPointer(ID2D1BitmapBrush)), "bitmapBrush")]), |
| 667 | StdMethod(HRESULT, "CreateSolidColorBrush", [(Pointer(Const(D2D1_COLOR_F)), "color"), (Pointer(Const(D2D1_BRUSH_PROPERTIES)), "brushProperties"), Out(Pointer(ObjPointer(ID2D1SolidColorBrush)), "solidColorBrush")]), |
| 668 | StdMethod(HRESULT, "CreateGradientStopCollection", [(Array(Const(D2D1_GRADIENT_STOP), "gradientStopsCount"), "gradientStops"), (UINT, "gradientStopsCount"), (D2D1_GAMMA, "colorInterpolationGamma"), (D2D1_EXTEND_MODE, "extendMode"), Out(Pointer(ObjPointer(ID2D1GradientStopCollection)), "gradientStopCollection")]), |
| 669 | StdMethod(HRESULT, "CreateLinearGradientBrush", [(Pointer(Const(D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES)), "linearGradientBrushProperties"), (Pointer(Const(D2D1_BRUSH_PROPERTIES)), "brushProperties"), (ObjPointer(ID2D1GradientStopCollection), "gradientStopCollection"), Out(Pointer(ObjPointer(ID2D1LinearGradientBrush)), "linearGradientBrush")]), |
| 670 | StdMethod(HRESULT, "CreateRadialGradientBrush", [(Pointer(Const(D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES)), "radialGradientBrushProperties"), (Pointer(Const(D2D1_BRUSH_PROPERTIES)), "brushProperties"), (ObjPointer(ID2D1GradientStopCollection), "gradientStopCollection"), Out(Pointer(ObjPointer(ID2D1RadialGradientBrush)), "radialGradientBrush")]), |
| 671 | StdMethod(HRESULT, "CreateCompatibleRenderTarget", [(Pointer(Const(D2D1_SIZE_F)), "desiredSize"), (Pointer(Const(D2D1_SIZE_U)), "desiredPixelSize"), (Pointer(Const(D2D1_PIXEL_FORMAT)), "desiredFormat"), (D2D1_COMPATIBLE_RENDER_TARGET_OPTIONS, "options"), Out(Pointer(ObjPointer(ID2D1BitmapRenderTarget)), "bitmapRenderTarget")]), |
| 672 | StdMethod(HRESULT, "CreateLayer", [(Pointer(Const(D2D1_SIZE_F)), "size"), Out(Pointer(ObjPointer(ID2D1Layer)), "layer")]), |
| 673 | StdMethod(HRESULT, "CreateMesh", [Out(Pointer(ObjPointer(ID2D1Mesh)), "mesh")]), |
| 674 | StdMethod(Void, "DrawLine", [(D2D1_POINT_2F, "point0"), (D2D1_POINT_2F, "point1"), (ObjPointer(ID2D1Brush), "brush"), (FLOAT, "strokeWidth"), (ObjPointer(ID2D1StrokeStyle), "strokeStyle")]), |
| 675 | StdMethod(Void, "DrawRectangle", [(Pointer(Const(D2D1_RECT_F)), "rect"), (ObjPointer(ID2D1Brush), "brush"), (FLOAT, "strokeWidth"), (ObjPointer(ID2D1StrokeStyle), "strokeStyle")]), |
| 676 | StdMethod(Void, "FillRectangle", [(Pointer(Const(D2D1_RECT_F)), "rect"), (ObjPointer(ID2D1Brush), "brush")]), |
| 677 | StdMethod(Void, "DrawRoundedRectangle", [(Pointer(Const(D2D1_ROUNDED_RECT)), "roundedRect"), (ObjPointer(ID2D1Brush), "brush"), (FLOAT, "strokeWidth"), (ObjPointer(ID2D1StrokeStyle), "strokeStyle")]), |
| 678 | StdMethod(Void, "FillRoundedRectangle", [(Pointer(Const(D2D1_ROUNDED_RECT)), "roundedRect"), (ObjPointer(ID2D1Brush), "brush")]), |
| 679 | StdMethod(Void, "DrawEllipse", [(Pointer(Const(D2D1_ELLIPSE)), "ellipse"), (ObjPointer(ID2D1Brush), "brush"), (FLOAT, "strokeWidth"), (ObjPointer(ID2D1StrokeStyle), "strokeStyle")]), |
| 680 | StdMethod(Void, "FillEllipse", [(Pointer(Const(D2D1_ELLIPSE)), "ellipse"), (ObjPointer(ID2D1Brush), "brush")]), |
| 681 | StdMethod(Void, "DrawGeometry", [(ObjPointer(ID2D1Geometry), "geometry"), (ObjPointer(ID2D1Brush), "brush"), (FLOAT, "strokeWidth"), (ObjPointer(ID2D1StrokeStyle), "strokeStyle")]), |
| 682 | StdMethod(Void, "FillGeometry", [(ObjPointer(ID2D1Geometry), "geometry"), (ObjPointer(ID2D1Brush), "brush"), (ObjPointer(ID2D1Brush), "opacityBrush")]), |
| 683 | StdMethod(Void, "FillMesh", [(ObjPointer(ID2D1Mesh), "mesh"), (ObjPointer(ID2D1Brush), "brush")]), |
| 684 | StdMethod(Void, "FillOpacityMask", [(ObjPointer(ID2D1Bitmap), "opacityMask"), (ObjPointer(ID2D1Brush), "brush"), (D2D1_OPACITY_MASK_CONTENT, "content"), (Pointer(Const(D2D1_RECT_F)), "destinationRectangle"), (Pointer(Const(D2D1_RECT_F)), "sourceRectangle")]), |
| 685 | StdMethod(Void, "DrawBitmap", [(ObjPointer(ID2D1Bitmap), "bitmap"), (Pointer(Const(D2D1_RECT_F)), "destinationRectangle"), (FLOAT, "opacity"), (D2D1_BITMAP_INTERPOLATION_MODE, "interpolationMode"), (Pointer(Const(D2D1_RECT_F)), "sourceRectangle")]), |
José Fonseca | 7417f64 | 2015-01-26 16:01:36 +0000 | [diff] [blame] | 686 | StdMethod(Void, "DrawText", [(String(Const(WCHAR), "stringLength", wide=True), "string"), (UINT, "stringLength"), (ObjPointer(IDWriteTextFormat), "textFormat"), (Pointer(Const(D2D1_RECT_F)), "layoutRect"), (ObjPointer(ID2D1Brush), "defaultForegroundBrush"), (D2D1_DRAW_TEXT_OPTIONS, "options"), (DWRITE_MEASURING_MODE, "measuringMode")]), |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 687 | StdMethod(Void, "DrawTextLayout", [(D2D1_POINT_2F, "origin"), (ObjPointer(IDWriteTextLayout), "textLayout"), (ObjPointer(ID2D1Brush), "defaultForegroundBrush"), (D2D1_DRAW_TEXT_OPTIONS, "options")]), |
| 688 | StdMethod(Void, "DrawGlyphRun", [(D2D1_POINT_2F, "baselineOrigin"), (Pointer(Const(DWRITE_GLYPH_RUN)), "glyphRun"), (ObjPointer(ID2D1Brush), "foregroundBrush"), (DWRITE_MEASURING_MODE, "measuringMode")]), |
| 689 | StdMethod(Void, "SetTransform", [(Pointer(Const(D2D1_MATRIX_3X2_F)), "transform")]), |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 690 | StdMethod(Void, "GetTransform", [Out(Pointer(D2D1_MATRIX_3X2_F), "transform")], const=True, sideeffects=False), |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 691 | StdMethod(Void, "SetAntialiasMode", [(D2D1_ANTIALIAS_MODE, "antialiasMode")]), |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 692 | StdMethod(D2D1_ANTIALIAS_MODE, "GetAntialiasMode", [], const=True, sideeffects=False), |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 693 | StdMethod(Void, "SetTextAntialiasMode", [(D2D1_TEXT_ANTIALIAS_MODE, "textAntialiasMode")]), |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 694 | StdMethod(D2D1_TEXT_ANTIALIAS_MODE, "GetTextAntialiasMode", [], const=True, sideeffects=False), |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 695 | StdMethod(Void, "SetTextRenderingParams", [(ObjPointer(IDWriteRenderingParams), "textRenderingParams")]), |
| 696 | StdMethod(Void, "GetTextRenderingParams", [Out(Pointer(ObjPointer(IDWriteRenderingParams)), "textRenderingParams")], const=True), |
| 697 | StdMethod(Void, "SetTags", [(D2D1_TAG, "tag1"), (D2D1_TAG, "tag2")]), |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 698 | StdMethod(Void, "GetTags", [Out(Pointer(D2D1_TAG), "tag1"), Out(Pointer(D2D1_TAG), "tag2")], const=True, sideeffects=False), |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 699 | StdMethod(Void, "PushLayer", [(Pointer(Const(D2D1_LAYER_PARAMETERS)), "layerParameters"), (ObjPointer(ID2D1Layer), "layer")]), |
| 700 | StdMethod(Void, "PopLayer", []), |
| 701 | StdMethod(HRESULT, "Flush", [Out(Pointer(D2D1_TAG), "tag1"), Out(Pointer(D2D1_TAG), "tag2")]), |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 702 | StdMethod(Void, "SaveDrawingState", [(ObjPointer(ID2D1DrawingStateBlock), "drawingStateBlock")], const=True, sideeffects=False), |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 703 | StdMethod(Void, "RestoreDrawingState", [(ObjPointer(ID2D1DrawingStateBlock), "drawingStateBlock")]), |
| 704 | StdMethod(Void, "PushAxisAlignedClip", [(Pointer(Const(D2D1_RECT_F)), "clipRect"), (D2D1_ANTIALIAS_MODE, "antialiasMode")]), |
| 705 | StdMethod(Void, "PopAxisAlignedClip", []), |
| 706 | StdMethod(Void, "Clear", [(Pointer(Const(D2D1_COLOR_F)), "clearColor")]), |
| 707 | StdMethod(Void, "BeginDraw", []), |
| 708 | StdMethod(HRESULT, "EndDraw", [Out(Pointer(D2D1_TAG), "tag1"), Out(Pointer(D2D1_TAG), "tag2")]), |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 709 | StdMethod(D2D1_PIXEL_FORMAT, "GetPixelFormat", [], const=True, sideeffects=False), |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 710 | StdMethod(Void, "SetDpi", [(FLOAT, "dpiX"), (FLOAT, "dpiY")]), |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 711 | StdMethod(Void, "GetDpi", [Out(Pointer(FLOAT), "dpiX"), Out(Pointer(FLOAT), "dpiY")], const=True, sideeffects=False), |
| 712 | StdMethod(D2D1_SIZE_F, "GetSize", [], const=True, sideeffects=False), |
| 713 | StdMethod(D2D1_SIZE_U, "GetPixelSize", [], const=True, sideeffects=False), |
| 714 | StdMethod(UINT32, "GetMaximumBitmapSize", [], const=True, sideeffects=False), |
| 715 | StdMethod(BOOL, "IsSupported", [(Pointer(Const(D2D1_RENDER_TARGET_PROPERTIES)), "renderTargetProperties")], const=True, sideeffects=False), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 716 | ] |
| 717 | |
| 718 | ID2D1BitmapRenderTarget.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 719 | StdMethod(HRESULT, "GetBitmap", [Out(Pointer(ObjPointer(ID2D1Bitmap)), "bitmap")]), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 720 | ] |
| 721 | |
| 722 | ID2D1HwndRenderTarget.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 723 | StdMethod(D2D1_WINDOW_STATE, "CheckWindowState", []), |
| 724 | StdMethod(HRESULT, "Resize", [(Pointer(Const(D2D1_SIZE_U)), "pixelSize")]), |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 725 | StdMethod(HWND, "GetHwnd", [], const=True, sideeffects=False), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 726 | ] |
| 727 | |
| 728 | ID2D1GdiInteropRenderTarget.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 729 | StdMethod(HRESULT, "GetDC", [(D2D1_DC_INITIALIZE_MODE, "mode"), Out(Pointer(HDC), "hdc")]), |
| 730 | StdMethod(HRESULT, "ReleaseDC", [(Pointer(Const(RECT)), "update")]), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 731 | ] |
| 732 | |
| 733 | ID2D1DCRenderTarget.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 734 | StdMethod(HRESULT, "BindDC", [(Const(HDC), "hDC"), (Pointer(Const(RECT)), "pSubRect")]), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 735 | ] |
| 736 | |
| 737 | ID2D1Factory.methods += [ |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 738 | StdMethod(HRESULT, "ReloadSystemMetrics", []), |
| 739 | StdMethod(Void, "GetDesktopDpi", [Out(Pointer(FLOAT), "dpiX"), Out(Pointer(FLOAT), "dpiY")]), |
| 740 | StdMethod(HRESULT, "CreateRectangleGeometry", [(Pointer(Const(D2D1_RECT_F)), "rectangle"), Out(Pointer(ObjPointer(ID2D1RectangleGeometry)), "rectangleGeometry")]), |
| 741 | StdMethod(HRESULT, "CreateRoundedRectangleGeometry", [(Pointer(Const(D2D1_ROUNDED_RECT)), "roundedRectangle"), Out(Pointer(ObjPointer(ID2D1RoundedRectangleGeometry)), "roundedRectangleGeometry")]), |
| 742 | StdMethod(HRESULT, "CreateEllipseGeometry", [(Pointer(Const(D2D1_ELLIPSE)), "ellipse"), Out(Pointer(ObjPointer(ID2D1EllipseGeometry)), "ellipseGeometry")]), |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 743 | StdMethod(HRESULT, "CreateGeometryGroup", [(D2D1_FILL_MODE, "fillMode"), (Array(ObjPointer(ID2D1Geometry), "geometriesCount"), "geometries"), (UINT, "geometriesCount"), Out(Pointer(ObjPointer(ID2D1GeometryGroup)), "geometryGroup")]), |
José Fonseca | 43aa19f | 2012-11-10 09:29:38 +0000 | [diff] [blame] | 744 | StdMethod(HRESULT, "CreateTransformedGeometry", [(ObjPointer(ID2D1Geometry), "sourceGeometry"), (Pointer(Const(D2D1_MATRIX_3X2_F)), "transform"), Out(Pointer(ObjPointer(ID2D1TransformedGeometry)), "transformedGeometry")]), |
| 745 | StdMethod(HRESULT, "CreatePathGeometry", [Out(Pointer(ObjPointer(ID2D1PathGeometry)), "pathGeometry")]), |
| 746 | StdMethod(HRESULT, "CreateStrokeStyle", [(Pointer(Const(D2D1_STROKE_STYLE_PROPERTIES)), "strokeStyleProperties"), (Pointer(Const(FLOAT)), "dashes"), (UINT, "dashesCount"), Out(Pointer(ObjPointer(ID2D1StrokeStyle)), "strokeStyle")]), |
| 747 | StdMethod(HRESULT, "CreateDrawingStateBlock", [(Pointer(Const(D2D1_DRAWING_STATE_DESCRIPTION)), "drawingStateDescription"), (ObjPointer(IDWriteRenderingParams), "textRenderingParams"), Out(Pointer(ObjPointer(ID2D1DrawingStateBlock)), "drawingStateBlock")]), |
| 748 | StdMethod(HRESULT, "CreateWicBitmapRenderTarget", [(Opaque("IWICBitmap *"), "target"), (Pointer(Const(D2D1_RENDER_TARGET_PROPERTIES)), "renderTargetProperties"), Out(Pointer(ObjPointer(ID2D1RenderTarget)), "renderTarget")]), |
| 749 | StdMethod(HRESULT, "CreateHwndRenderTarget", [(Pointer(Const(D2D1_RENDER_TARGET_PROPERTIES)), "renderTargetProperties"), (Pointer(Const(D2D1_HWND_RENDER_TARGET_PROPERTIES)), "hwndRenderTargetProperties"), Out(Pointer(ObjPointer(ID2D1HwndRenderTarget)), "hwndRenderTarget")]), |
| 750 | StdMethod(HRESULT, "CreateDxgiSurfaceRenderTarget", [(ObjPointer(IDXGISurface), "dxgiSurface"), (Pointer(Const(D2D1_RENDER_TARGET_PROPERTIES)), "renderTargetProperties"), Out(Pointer(ObjPointer(ID2D1RenderTarget)), "renderTarget")]), |
| 751 | StdMethod(HRESULT, "CreateDCRenderTarget", [(Pointer(Const(D2D1_RENDER_TARGET_PROPERTIES)), "renderTargetProperties"), Out(Pointer(ObjPointer(ID2D1DCRenderTarget)), "dcRenderTarget")]), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 752 | ] |
| 753 | |
José Fonseca | 8130193 | 2012-11-11 00:10:20 +0000 | [diff] [blame] | 754 | d2d1 = Module("d2d1") |
| 755 | d2d1.addInterfaces([ |
| 756 | ID2D1Factory |
| 757 | ]) |
José Fonseca | 48412ff | 2012-01-21 00:06:19 +0000 | [diff] [blame] | 758 | d2d1.addFunctions([ |
José Fonseca | e7d7a64 | 2012-11-11 00:17:00 +0000 | [diff] [blame] | 759 | StdFunction(HRESULT, "D2D1CreateFactory", [(D2D1_FACTORY_TYPE, "factoryType"), (REFIID, "riid"), (Pointer(Const(D2D1_FACTORY_OPTIONS)), "pFactoryOptions"), Out(Pointer(ObjPointer(Void)), "ppIFactory")]), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 760 | StdFunction(Void, "D2D1MakeRotateMatrix", [(FLOAT, "angle"), (D2D1_POINT_2F, "center"), Out(Pointer(D2D1_MATRIX_3X2_F), "matrix")]), |
| 761 | StdFunction(Void, "D2D1MakeSkewMatrix", [(FLOAT, "angleX"), (FLOAT, "angleY"), (D2D1_POINT_2F, "center"), Out(Pointer(D2D1_MATRIX_3X2_F), "matrix")]), |
| 762 | StdFunction(BOOL, "D2D1IsMatrixInvertible", [(Pointer(Const(D2D1_MATRIX_3X2_F)), "matrix")]), |
José Fonseca | 5d7fc05 | 2012-11-13 19:53:47 +0000 | [diff] [blame] | 763 | StdFunction(BOOL, "D2D1InvertMatrix", [InOut(Pointer(D2D1_MATRIX_3X2_F), "matrix")]), |
José Fonseca | 31f2b6e | 2011-10-10 01:45:04 +0100 | [diff] [blame] | 764 | ]) |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 765 | |
| 766 | |
| 767 | |
| 768 | # |
| 769 | # D2D1.1 |
| 770 | # |
| 771 | |
| 772 | |
| 773 | ID2D1GdiMetafileSink = Interface("ID2D1GdiMetafileSink", IUnknown) |
| 774 | ID2D1GdiMetafile = Interface("ID2D1GdiMetafile", ID2D1Resource) |
| 775 | ID2D1CommandSink = Interface("ID2D1CommandSink", IUnknown) |
| 776 | ID2D1CommandList = Interface("ID2D1CommandList", ID2D1Image) |
| 777 | ID2D1PrintControl = Interface("ID2D1PrintControl", IUnknown) |
| 778 | ID2D1ImageBrush = Interface("ID2D1ImageBrush", ID2D1Brush) |
| 779 | ID2D1BitmapBrush1 = Interface("ID2D1BitmapBrush1", ID2D1BitmapBrush) |
| 780 | ID2D1StrokeStyle1 = Interface("ID2D1StrokeStyle1", ID2D1StrokeStyle) |
| 781 | ID2D1PathGeometry1 = Interface("ID2D1PathGeometry1", ID2D1PathGeometry) |
| 782 | ID2D1Properties = Interface("ID2D1Properties", IUnknown) |
| 783 | ID2D1Effect = Interface("ID2D1Effect", ID2D1Properties) |
| 784 | ID2D1Bitmap1 = Interface("ID2D1Bitmap1", ID2D1Bitmap) |
| 785 | ID2D1ColorContext = Interface("ID2D1ColorContext", ID2D1Resource) |
| 786 | ID2D1GradientStopCollection1 = Interface("ID2D1GradientStopCollection1", ID2D1GradientStopCollection) |
| 787 | ID2D1DrawingStateBlock1 = Interface("ID2D1DrawingStateBlock1", ID2D1DrawingStateBlock) |
| 788 | ID2D1DeviceContext = Interface("ID2D1DeviceContext", ID2D1RenderTarget) |
| 789 | ID2D1Device = Interface("ID2D1Device", ID2D1Resource) |
| 790 | ID2D1Factory1 = Interface("ID2D1Factory1", ID2D1Factory) |
| 791 | ID2D1Multithread = Interface("ID2D1Multithread", IUnknown) |
| 792 | |
| 793 | |
| 794 | D2D1_RECT_L = Alias("D2D1_RECT_L", D2D_RECT_L) |
| 795 | D2D1_POINT_2L = Alias("D2D1_POINT_2L", D2D_POINT_2L) |
| 796 | |
| 797 | |
| 798 | D2D1_PROPERTY_INDEX = FakeEnum(UINT32, [ |
| 799 | "D2D1_INVALID_PROPERTY_INDEX", |
| 800 | ]) |
| 801 | |
| 802 | D2D1_PROPERTY_TYPE = Enum("D2D1_PROPERTY_TYPE", [ |
| 803 | "D2D1_PROPERTY_TYPE_UNKNOWN", |
| 804 | "D2D1_PROPERTY_TYPE_STRING", |
| 805 | "D2D1_PROPERTY_TYPE_BOOL", |
| 806 | "D2D1_PROPERTY_TYPE_UINT32", |
| 807 | "D2D1_PROPERTY_TYPE_INT32", |
| 808 | "D2D1_PROPERTY_TYPE_FLOAT", |
| 809 | "D2D1_PROPERTY_TYPE_VECTOR2", |
| 810 | "D2D1_PROPERTY_TYPE_VECTOR3", |
| 811 | "D2D1_PROPERTY_TYPE_VECTOR4", |
| 812 | "D2D1_PROPERTY_TYPE_BLOB", |
| 813 | "D2D1_PROPERTY_TYPE_IUNKNOWN", |
| 814 | "D2D1_PROPERTY_TYPE_ENUM", |
| 815 | "D2D1_PROPERTY_TYPE_ARRAY", |
| 816 | "D2D1_PROPERTY_TYPE_CLSID", |
| 817 | "D2D1_PROPERTY_TYPE_MATRIX_3X2", |
| 818 | "D2D1_PROPERTY_TYPE_MATRIX_4X3", |
| 819 | "D2D1_PROPERTY_TYPE_MATRIX_4X4", |
| 820 | "D2D1_PROPERTY_TYPE_MATRIX_5X4", |
| 821 | "D2D1_PROPERTY_TYPE_COLOR_CONTEXT", |
| 822 | "D2D1_PROPERTY_TYPE_FORCE_DWORD", |
| 823 | ]) |
| 824 | |
| 825 | D2D1_PROPERTY = Enum("D2D1_PROPERTY", [ |
| 826 | "D2D1_PROPERTY_CLSID", |
| 827 | "D2D1_PROPERTY_DISPLAYNAME", |
| 828 | "D2D1_PROPERTY_AUTHOR", |
| 829 | "D2D1_PROPERTY_CATEGORY", |
| 830 | "D2D1_PROPERTY_DESCRIPTION", |
| 831 | "D2D1_PROPERTY_INPUTS", |
| 832 | "D2D1_PROPERTY_CACHED", |
| 833 | "D2D1_PROPERTY_PRECISION", |
| 834 | "D2D1_PROPERTY_MIN_INPUTS", |
| 835 | "D2D1_PROPERTY_MAX_INPUTS", |
| 836 | "D2D1_PROPERTY_FORCE_DWORD", |
| 837 | ]) |
| 838 | |
| 839 | D2D1_SUBPROPERTY = Enum("D2D1_SUBPROPERTY", [ |
| 840 | "D2D1_SUBPROPERTY_DISPLAYNAME", |
| 841 | "D2D1_SUBPROPERTY_ISREADONLY", |
| 842 | "D2D1_SUBPROPERTY_MIN", |
| 843 | "D2D1_SUBPROPERTY_MAX", |
| 844 | "D2D1_SUBPROPERTY_DEFAULT", |
| 845 | "D2D1_SUBPROPERTY_FIELDS", |
| 846 | "D2D1_SUBPROPERTY_INDEX", |
| 847 | "D2D1_SUBPROPERTY_FORCE_DWORD", |
| 848 | ]) |
| 849 | |
| 850 | D2D1_BITMAP_OPTIONS = Enum("D2D1_BITMAP_OPTIONS", [ |
| 851 | "D2D1_BITMAP_OPTIONS_NONE", |
| 852 | "D2D1_BITMAP_OPTIONS_TARGET", |
| 853 | "D2D1_BITMAP_OPTIONS_CANNOT_DRAW", |
| 854 | "D2D1_BITMAP_OPTIONS_CPU_READ", |
| 855 | "D2D1_BITMAP_OPTIONS_GDI_COMPATIBLE", |
| 856 | "D2D1_BITMAP_OPTIONS_FORCE_DWORD", |
| 857 | ]) |
| 858 | |
| 859 | D2D1_COMPOSITE_MODE = Enum("D2D1_COMPOSITE_MODE", [ |
| 860 | "D2D1_COMPOSITE_MODE_SOURCE_OVER", |
| 861 | "D2D1_COMPOSITE_MODE_DESTINATION_OVER", |
| 862 | "D2D1_COMPOSITE_MODE_SOURCE_IN", |
| 863 | "D2D1_COMPOSITE_MODE_DESTINATION_IN", |
| 864 | "D2D1_COMPOSITE_MODE_SOURCE_OUT", |
| 865 | "D2D1_COMPOSITE_MODE_DESTINATION_OUT", |
| 866 | "D2D1_COMPOSITE_MODE_SOURCE_ATOP", |
| 867 | "D2D1_COMPOSITE_MODE_DESTINATION_ATOP", |
| 868 | "D2D1_COMPOSITE_MODE_XOR", |
| 869 | "D2D1_COMPOSITE_MODE_PLUS", |
| 870 | "D2D1_COMPOSITE_MODE_SOURCE_COPY", |
| 871 | "D2D1_COMPOSITE_MODE_BOUNDED_SOURCE_COPY", |
| 872 | "D2D1_COMPOSITE_MODE_MASK_INVERT", |
| 873 | "D2D1_COMPOSITE_MODE_FORCE_DWORD", |
| 874 | ]) |
| 875 | |
| 876 | D2D1_BUFFER_PRECISION = Enum("D2D1_BUFFER_PRECISION", [ |
| 877 | "D2D1_BUFFER_PRECISION_UNKNOWN", |
| 878 | "D2D1_BUFFER_PRECISION_8BPC_UNORM", |
| 879 | "D2D1_BUFFER_PRECISION_8BPC_UNORM_SRGB", |
| 880 | "D2D1_BUFFER_PRECISION_16BPC_UNORM", |
| 881 | "D2D1_BUFFER_PRECISION_16BPC_FLOAT", |
| 882 | "D2D1_BUFFER_PRECISION_32BPC_FLOAT", |
| 883 | "D2D1_BUFFER_PRECISION_FORCE_DWORD", |
| 884 | ]) |
| 885 | |
| 886 | D2D1_MAP_OPTIONS = Enum("D2D1_MAP_OPTIONS", [ |
| 887 | "D2D1_MAP_OPTIONS_NONE", |
| 888 | "D2D1_MAP_OPTIONS_READ", |
| 889 | "D2D1_MAP_OPTIONS_WRITE", |
| 890 | "D2D1_MAP_OPTIONS_DISCARD", |
| 891 | "D2D1_MAP_OPTIONS_FORCE_DWORD", |
| 892 | ]) |
| 893 | |
| 894 | D2D1_INTERPOLATION_MODE = Enum("D2D1_INTERPOLATION_MODE", [ |
| 895 | "D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR", |
| 896 | "D2D1_INTERPOLATION_MODE_LINEAR", |
| 897 | "D2D1_INTERPOLATION_MODE_CUBIC", |
| 898 | "D2D1_INTERPOLATION_MODE_MULTI_SAMPLE_LINEAR", |
| 899 | "D2D1_INTERPOLATION_MODE_ANISOTROPIC", |
| 900 | "D2D1_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC", |
| 901 | "D2D1_INTERPOLATION_MODE_FORCE_DWORD", |
| 902 | ]) |
| 903 | |
| 904 | D2D1_UNIT_MODE = Enum("D2D1_UNIT_MODE", [ |
| 905 | "D2D1_UNIT_MODE_DIPS", |
| 906 | "D2D1_UNIT_MODE_PIXELS", |
| 907 | "D2D1_UNIT_MODE_FORCE_DWORD", |
| 908 | ]) |
| 909 | |
| 910 | D2D1_COLOR_SPACE = Enum("D2D1_COLOR_SPACE", [ |
| 911 | "D2D1_COLOR_SPACE_CUSTOM", |
| 912 | "D2D1_COLOR_SPACE_SRGB", |
| 913 | "D2D1_COLOR_SPACE_SCRGB", |
| 914 | "D2D1_COLOR_SPACE_FORCE_DWORD", |
| 915 | ]) |
| 916 | |
| 917 | D2D1_DEVICE_CONTEXT_OPTIONS = Enum("D2D1_DEVICE_CONTEXT_OPTIONS", [ |
| 918 | "D2D1_DEVICE_CONTEXT_OPTIONS_NONE", |
| 919 | "D2D1_DEVICE_CONTEXT_OPTIONS_ENABLE_MULTITHREADED_OPTIMIZATIONS", |
| 920 | "D2D1_DEVICE_CONTEXT_OPTIONS_FORCE_DWORD", |
| 921 | ]) |
| 922 | |
| 923 | D2D1_STROKE_TRANSFORM_TYPE = Enum("D2D1_STROKE_TRANSFORM_TYPE", [ |
| 924 | "D2D1_STROKE_TRANSFORM_TYPE_NORMAL", |
| 925 | "D2D1_STROKE_TRANSFORM_TYPE_FIXED", |
| 926 | "D2D1_STROKE_TRANSFORM_TYPE_HAIRLINE", |
| 927 | "D2D1_STROKE_TRANSFORM_TYPE_FORCE_DWORD", |
| 928 | ]) |
| 929 | |
| 930 | D2D1_PRIMITIVE_BLEND = Enum("D2D1_PRIMITIVE_BLEND", [ |
| 931 | "D2D1_PRIMITIVE_BLEND_SOURCE_OVER", |
| 932 | "D2D1_PRIMITIVE_BLEND_COPY", |
| 933 | "D2D1_PRIMITIVE_BLEND_MIN", |
| 934 | "D2D1_PRIMITIVE_BLEND_ADD", |
| 935 | "D2D1_PRIMITIVE_BLEND_FORCE_DWORD", |
| 936 | ]) |
| 937 | |
| 938 | D2D1_THREADING_MODE = Enum("D2D1_THREADING_MODE", [ |
| 939 | "D2D1_THREADING_MODE_SINGLE_THREADED", |
| 940 | "D2D1_THREADING_MODE_MULTI_THREADED", |
| 941 | "D2D1_THREADING_MODE_FORCE_DWORD", |
| 942 | ]) |
| 943 | |
| 944 | D2D1_COLOR_INTERPOLATION_MODE = Enum("D2D1_COLOR_INTERPOLATION_MODE", [ |
| 945 | "D2D1_COLOR_INTERPOLATION_MODE_STRAIGHT", |
| 946 | "D2D1_COLOR_INTERPOLATION_MODE_PREMULTIPLIED", |
| 947 | "D2D1_COLOR_INTERPOLATION_MODE_FORCE_DWORD", |
| 948 | ]) |
| 949 | |
| 950 | D2D1_VECTOR_2F = Alias("D2D1_VECTOR_2F", D2D_VECTOR_2F) |
| 951 | D2D1_VECTOR_3F = Alias("D2D1_VECTOR_3F", D2D_VECTOR_3F) |
| 952 | D2D1_VECTOR_4F = Alias("D2D1_VECTOR_4F", D2D_VECTOR_4F) |
| 953 | D2D1_BITMAP_PROPERTIES1 = Struct("D2D1_BITMAP_PROPERTIES1", [ |
| 954 | (D2D1_PIXEL_FORMAT, "pixelFormat"), |
| 955 | (FLOAT, "dpiX"), |
| 956 | (FLOAT, "dpiY"), |
| 957 | (D2D1_BITMAP_OPTIONS, "bitmapOptions"), |
| 958 | (ObjPointer(ID2D1ColorContext), "colorContext"), |
| 959 | ]) |
| 960 | |
| 961 | D2D1_MAPPED_RECT = Struct("D2D1_MAPPED_RECT", [ |
| 962 | (UINT32, "pitch"), |
| 963 | (Pointer(BYTE), "bits"), |
| 964 | ]) |
| 965 | |
| 966 | D2D1_RENDERING_CONTROLS = Struct("D2D1_RENDERING_CONTROLS", [ |
| 967 | (D2D1_BUFFER_PRECISION, "bufferPrecision"), |
| 968 | (D2D1_SIZE_U, "tileSize"), |
| 969 | ]) |
| 970 | |
| 971 | D2D1_EFFECT_INPUT_DESCRIPTION = Struct("D2D1_EFFECT_INPUT_DESCRIPTION", [ |
| 972 | (ObjPointer(ID2D1Effect), "effect"), |
| 973 | (UINT32, "inputIndex"), |
| 974 | (D2D1_RECT_F, "inputRectangle"), |
| 975 | ]) |
| 976 | |
| 977 | D2D1_MATRIX_4X3_F = Alias("D2D1_MATRIX_4X3_F", D2D_MATRIX_4X3_F) |
| 978 | D2D1_MATRIX_4X4_F = Alias("D2D1_MATRIX_4X4_F", D2D_MATRIX_4X4_F) |
| 979 | D2D1_MATRIX_5X4_F = Alias("D2D1_MATRIX_5X4_F", D2D_MATRIX_5X4_F) |
| 980 | D2D1_POINT_DESCRIPTION = Struct("D2D1_POINT_DESCRIPTION", [ |
| 981 | (D2D1_POINT_2F, "point"), |
| 982 | (D2D1_POINT_2F, "unitTangentVector"), |
| 983 | (UINT32, "endSegment"), |
| 984 | (UINT32, "endFigure"), |
| 985 | (FLOAT, "lengthToEndSegment"), |
| 986 | ]) |
| 987 | |
| 988 | D2D1_IMAGE_BRUSH_PROPERTIES = Struct("D2D1_IMAGE_BRUSH_PROPERTIES", [ |
| 989 | (D2D1_RECT_F, "sourceRectangle"), |
| 990 | (D2D1_EXTEND_MODE, "extendModeX"), |
| 991 | (D2D1_EXTEND_MODE, "extendModeY"), |
| 992 | (D2D1_INTERPOLATION_MODE, "interpolationMode"), |
| 993 | ]) |
| 994 | |
| 995 | D2D1_BITMAP_BRUSH_PROPERTIES1 = Struct("D2D1_BITMAP_BRUSH_PROPERTIES1", [ |
| 996 | (D2D1_EXTEND_MODE, "extendModeX"), |
| 997 | (D2D1_EXTEND_MODE, "extendModeY"), |
| 998 | (D2D1_INTERPOLATION_MODE, "interpolationMode"), |
| 999 | ]) |
| 1000 | |
| 1001 | D2D1_STROKE_STYLE_PROPERTIES1 = Struct("D2D1_STROKE_STYLE_PROPERTIES1", [ |
| 1002 | (D2D1_CAP_STYLE, "startCap"), |
| 1003 | (D2D1_CAP_STYLE, "endCap"), |
| 1004 | (D2D1_CAP_STYLE, "dashCap"), |
| 1005 | (D2D1_LINE_JOIN, "lineJoin"), |
| 1006 | (FLOAT, "miterLimit"), |
| 1007 | (D2D1_DASH_STYLE, "dashStyle"), |
| 1008 | (FLOAT, "dashOffset"), |
| 1009 | (D2D1_STROKE_TRANSFORM_TYPE, "transformType"), |
| 1010 | ]) |
| 1011 | |
| 1012 | D2D1_LAYER_OPTIONS1 = Enum("D2D1_LAYER_OPTIONS1", [ |
| 1013 | "D2D1_LAYER_OPTIONS1_NONE", |
| 1014 | "D2D1_LAYER_OPTIONS1_INITIALIZE_FROM_BACKGROUND", |
| 1015 | "D2D1_LAYER_OPTIONS1_IGNORE_ALPHA", |
| 1016 | "D2D1_LAYER_OPTIONS1_FORCE_DWORD", |
| 1017 | ]) |
| 1018 | |
| 1019 | D2D1_LAYER_PARAMETERS1 = Struct("D2D1_LAYER_PARAMETERS1", [ |
| 1020 | (D2D1_RECT_F, "contentBounds"), |
| 1021 | (ObjPointer(ID2D1Geometry), "geometricMask"), |
| 1022 | (D2D1_ANTIALIAS_MODE, "maskAntialiasMode"), |
| 1023 | (D2D1_MATRIX_3X2_F, "maskTransform"), |
| 1024 | (FLOAT, "opacity"), |
| 1025 | (ObjPointer(ID2D1Brush), "opacityBrush"), |
| 1026 | (D2D1_LAYER_OPTIONS1, "layerOptions"), |
| 1027 | ]) |
| 1028 | |
| 1029 | D2D1_PRINT_FONT_SUBSET_MODE = Enum("D2D1_PRINT_FONT_SUBSET_MODE", [ |
| 1030 | "D2D1_PRINT_FONT_SUBSET_MODE_DEFAULT", |
| 1031 | "D2D1_PRINT_FONT_SUBSET_MODE_EACHPAGE", |
| 1032 | "D2D1_PRINT_FONT_SUBSET_MODE_NONE", |
| 1033 | "D2D1_PRINT_FONT_SUBSET_MODE_FORCE_DWORD", |
| 1034 | ]) |
| 1035 | |
| 1036 | D2D1_DRAWING_STATE_DESCRIPTION1 = Struct("D2D1_DRAWING_STATE_DESCRIPTION1", [ |
| 1037 | (D2D1_ANTIALIAS_MODE, "antialiasMode"), |
| 1038 | (D2D1_TEXT_ANTIALIAS_MODE, "textAntialiasMode"), |
| 1039 | (D2D1_TAG, "tag1"), |
| 1040 | (D2D1_TAG, "tag2"), |
| 1041 | (D2D1_MATRIX_3X2_F, "transform"), |
| 1042 | (D2D1_PRIMITIVE_BLEND, "primitiveBlend"), |
| 1043 | (D2D1_UNIT_MODE, "unitMode"), |
| 1044 | ]) |
| 1045 | |
| 1046 | D2D1_PRINT_CONTROL_PROPERTIES = Struct("D2D1_PRINT_CONTROL_PROPERTIES", [ |
| 1047 | (D2D1_PRINT_FONT_SUBSET_MODE, "fontSubset"), |
| 1048 | (FLOAT, "rasterDPI"), |
| 1049 | (D2D1_COLOR_SPACE, "colorSpace"), |
| 1050 | ]) |
| 1051 | |
| 1052 | D2D1_CREATION_PROPERTIES = Struct("D2D1_CREATION_PROPERTIES", [ |
| 1053 | (D2D1_THREADING_MODE, "threadingMode"), |
| 1054 | (D2D1_DEBUG_LEVEL, "debugLevel"), |
| 1055 | (D2D1_DEVICE_CONTEXT_OPTIONS, "options"), |
| 1056 | ]) |
| 1057 | |
| 1058 | ID2D1GdiMetafileSink.methods += [ |
| 1059 | StdMethod(HRESULT, "ProcessRecord", [(DWORD, "recordType"), (OpaqueBlob(Const(Void), "recordDataSize"), "recordData"), (DWORD, "recordDataSize")]), |
| 1060 | ] |
| 1061 | |
| 1062 | ID2D1GdiMetafile.methods += [ |
| 1063 | StdMethod(HRESULT, "Stream", [(ObjPointer(ID2D1GdiMetafileSink), "sink")]), |
| 1064 | StdMethod(HRESULT, "GetBounds", [Out(Pointer(D2D1_RECT_F), "bounds")]), |
| 1065 | ] |
| 1066 | |
| 1067 | ID2D1CommandSink.methods += [ |
| 1068 | StdMethod(HRESULT, "BeginDraw", []), |
| 1069 | StdMethod(HRESULT, "EndDraw", []), |
| 1070 | StdMethod(HRESULT, "SetAntialiasMode", [(D2D1_ANTIALIAS_MODE, "antialiasMode")]), |
| 1071 | StdMethod(HRESULT, "SetTags", [(D2D1_TAG, "tag1"), (D2D1_TAG, "tag2")]), |
| 1072 | StdMethod(HRESULT, "SetTextAntialiasMode", [(D2D1_TEXT_ANTIALIAS_MODE, "textAntialiasMode")]), |
| 1073 | StdMethod(HRESULT, "SetTextRenderingParams", [(ObjPointer(IDWriteRenderingParams), "textRenderingParams")]), |
| 1074 | StdMethod(HRESULT, "SetTransform", [(Pointer(Const(D2D1_MATRIX_3X2_F)), "transform")]), |
| 1075 | StdMethod(HRESULT, "SetPrimitiveBlend", [(D2D1_PRIMITIVE_BLEND, "primitiveBlend")]), |
| 1076 | StdMethod(HRESULT, "SetUnitMode", [(D2D1_UNIT_MODE, "unitMode")]), |
| 1077 | StdMethod(HRESULT, "Clear", [(Pointer(Const(D2D1_COLOR_F)), "color")]), |
| 1078 | 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")]), |
| 1079 | StdMethod(HRESULT, "DrawLine", [(D2D1_POINT_2F, "point0"), (D2D1_POINT_2F, "point1"), (ObjPointer(ID2D1Brush), "brush"), (FLOAT, "strokeWidth"), (ObjPointer(ID2D1StrokeStyle), "strokeStyle")]), |
| 1080 | StdMethod(HRESULT, "DrawGeometry", [(ObjPointer(ID2D1Geometry), "geometry"), (ObjPointer(ID2D1Brush), "brush"), (FLOAT, "strokeWidth"), (ObjPointer(ID2D1StrokeStyle), "strokeStyle")]), |
| 1081 | StdMethod(HRESULT, "DrawRectangle", [(Pointer(Const(D2D1_RECT_F)), "rect"), (ObjPointer(ID2D1Brush), "brush"), (FLOAT, "strokeWidth"), (ObjPointer(ID2D1StrokeStyle), "strokeStyle")]), |
| 1082 | 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")]), |
| 1083 | 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")]), |
| 1084 | StdMethod(HRESULT, "DrawGdiMetafile", [(ObjPointer(ID2D1GdiMetafile), "gdiMetafile"), (Pointer(Const(D2D1_POINT_2F)), "targetOffset")]), |
| 1085 | StdMethod(HRESULT, "FillMesh", [(ObjPointer(ID2D1Mesh), "mesh"), (ObjPointer(ID2D1Brush), "brush")]), |
| 1086 | StdMethod(HRESULT, "FillOpacityMask", [(ObjPointer(ID2D1Bitmap), "opacityMask"), (ObjPointer(ID2D1Brush), "brush"), (Pointer(Const(D2D1_RECT_F)), "destinationRectangle"), (Pointer(Const(D2D1_RECT_F)), "sourceRectangle")]), |
| 1087 | StdMethod(HRESULT, "FillGeometry", [(ObjPointer(ID2D1Geometry), "geometry"), (ObjPointer(ID2D1Brush), "brush"), (ObjPointer(ID2D1Brush), "opacityBrush")]), |
| 1088 | StdMethod(HRESULT, "FillRectangle", [(Pointer(Const(D2D1_RECT_F)), "rect"), (ObjPointer(ID2D1Brush), "brush")]), |
| 1089 | StdMethod(HRESULT, "PushAxisAlignedClip", [(Pointer(Const(D2D1_RECT_F)), "clipRect"), (D2D1_ANTIALIAS_MODE, "antialiasMode")]), |
| 1090 | StdMethod(HRESULT, "PushLayer", [(Pointer(Const(D2D1_LAYER_PARAMETERS1)), "layerParameters1"), (ObjPointer(ID2D1Layer), "layer")]), |
| 1091 | StdMethod(HRESULT, "PopAxisAlignedClip", []), |
| 1092 | StdMethod(HRESULT, "PopLayer", []), |
| 1093 | ] |
| 1094 | |
| 1095 | ID2D1CommandList.methods += [ |
| 1096 | StdMethod(HRESULT, "Stream", [(ObjPointer(ID2D1CommandSink), "sink")]), |
| 1097 | StdMethod(HRESULT, "Close", []), |
| 1098 | ] |
| 1099 | |
| 1100 | ID2D1PrintControl.methods += [ |
| 1101 | StdMethod(HRESULT, "AddPage", [(ObjPointer(ID2D1CommandList), "commandList"), (D2D_SIZE_F, "pageSize"), (Opaque("IStream *"), "pagePrintTicketStream"), Out(Pointer(D2D1_TAG), "tag1"), Out(Pointer(D2D1_TAG), "tag2")]), |
| 1102 | StdMethod(HRESULT, "Close", []), |
| 1103 | ] |
| 1104 | |
| 1105 | ID2D1ImageBrush.methods += [ |
| 1106 | StdMethod(Void, "SetImage", [(ObjPointer(ID2D1Image), "image")]), |
| 1107 | StdMethod(Void, "SetExtendModeX", [(D2D1_EXTEND_MODE, "extendModeX")]), |
| 1108 | StdMethod(Void, "SetExtendModeY", [(D2D1_EXTEND_MODE, "extendModeY")]), |
| 1109 | StdMethod(Void, "SetInterpolationMode", [(D2D1_INTERPOLATION_MODE, "interpolationMode")]), |
| 1110 | StdMethod(Void, "SetSourceRectangle", [(Pointer(Const(D2D1_RECT_F)), "sourceRectangle")]), |
Robert Tarasov | 6ccf5bb | 2020-01-10 12:31:25 -0800 | [diff] [blame] | 1111 | StdMethod(Void, "GetImage", [Out(Pointer(ObjPointer(ID2D1Image)), "image")], const=True), |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 1112 | StdMethod(D2D1_EXTEND_MODE, "GetExtendModeX", [], const=True, sideeffects=False), |
| 1113 | StdMethod(D2D1_EXTEND_MODE, "GetExtendModeY", [], const=True, sideeffects=False), |
| 1114 | StdMethod(D2D1_INTERPOLATION_MODE, "GetInterpolationMode", [], const=True, sideeffects=False), |
| 1115 | StdMethod(Void, "GetSourceRectangle", [Out(Pointer(D2D1_RECT_F), "sourceRectangle")], const=True, sideeffects=False), |
| 1116 | ] |
| 1117 | |
| 1118 | ID2D1BitmapBrush1.methods += [ |
| 1119 | StdMethod(Void, "SetInterpolationMode1", [(D2D1_INTERPOLATION_MODE, "interpolationMode")]), |
| 1120 | StdMethod(D2D1_INTERPOLATION_MODE, "GetInterpolationMode1", [], const=True, sideeffects=False), |
| 1121 | ] |
| 1122 | |
| 1123 | ID2D1StrokeStyle1.methods += [ |
| 1124 | StdMethod(D2D1_STROKE_TRANSFORM_TYPE, "GetStrokeTransformType", [], const=True, sideeffects=False), |
| 1125 | ] |
| 1126 | |
| 1127 | ID2D1PathGeometry1.methods += [ |
| 1128 | 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), |
| 1129 | ] |
| 1130 | |
| 1131 | ID2D1Properties.methods += [ |
| 1132 | StdMethod(UINT32, "GetPropertyCount", [], const=True, sideeffects=False), |
| 1133 | StdMethod(HRESULT, "GetPropertyName", [(UINT32, "index"), Out(PWSTR, "name"), (UINT32, "nameCount")], const=True, sideeffects=False), |
| 1134 | StdMethod(UINT32, "GetPropertyNameLength", [(UINT32, "index")], const=True, sideeffects=False), |
| 1135 | StdMethod(D2D1_PROPERTY_TYPE, "GetType", [(UINT32, "index")], const=True, sideeffects=False), |
| 1136 | StdMethod(D2D1_PROPERTY_INDEX, "GetPropertyIndex", [(PCWSTR, "name")], const=True, sideeffects=False), |
| 1137 | StdMethod(HRESULT, "SetValueByName", [(PCWSTR, "name"), (D2D1_PROPERTY_TYPE, "type"), (Pointer(Const(BYTE)), "data"), (UINT32, "dataSize")]), |
| 1138 | StdMethod(HRESULT, "SetValue", [(UINT32, "index"), (D2D1_PROPERTY_TYPE, "type"), (Pointer(Const(BYTE)), "data"), (UINT32, "dataSize")]), |
| 1139 | StdMethod(HRESULT, "GetValueByName", [(PCWSTR, "name"), (D2D1_PROPERTY_TYPE, "type"), Out(Pointer(BYTE), "data"), (UINT32, "dataSize")], const=True, sideeffects=False), |
| 1140 | StdMethod(HRESULT, "GetValue", [(UINT32, "index"), (D2D1_PROPERTY_TYPE, "type"), Out(Pointer(BYTE), "data"), (UINT32, "dataSize")], const=True, sideeffects=False), |
| 1141 | StdMethod(UINT32, "GetValueSize", [(UINT32, "index")], const=True, sideeffects=False), |
| 1142 | StdMethod(HRESULT, "GetSubProperties", [(UINT32, "index"), Out(Pointer(ObjPointer(ID2D1Properties)), "subProperties")], const=True), |
| 1143 | ] |
| 1144 | |
| 1145 | ID2D1Effect.methods += [ |
| 1146 | StdMethod(Void, "SetInput", [(UINT32, "index"), (ObjPointer(ID2D1Image), "input"), (BOOL, "invalidate")]), |
| 1147 | StdMethod(HRESULT, "SetInputCount", [(UINT32, "inputCount")]), |
| 1148 | StdMethod(Void, "GetInput", [(UINT32, "index"), Out(Pointer(ObjPointer(ID2D1Image)), "input")], const=True), |
| 1149 | StdMethod(UINT32, "GetInputCount", [], const=True, sideeffects=False), |
Robert Tarasov | 6ccf5bb | 2020-01-10 12:31:25 -0800 | [diff] [blame] | 1150 | StdMethod(Void, "GetOutput", [Out(Pointer(ObjPointer(ID2D1Image)), "outputImage")], const=True), |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 1151 | ] |
| 1152 | |
| 1153 | ID2D1Bitmap1.methods += [ |
Robert Tarasov | 6ccf5bb | 2020-01-10 12:31:25 -0800 | [diff] [blame] | 1154 | StdMethod(Void, "GetColorContext", [Out(Pointer(ObjPointer(ID2D1ColorContext)), "colorContext")], const=True), |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 1155 | StdMethod(D2D1_BITMAP_OPTIONS, "GetOptions", [], const=True, sideeffects=False), |
Robert Tarasov | 6ccf5bb | 2020-01-10 12:31:25 -0800 | [diff] [blame] | 1156 | StdMethod(HRESULT, "GetSurface", [Out(Pointer(ObjPointer(IDXGISurface)), "dxgiSurface")], const=True), |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 1157 | StdMethod(HRESULT, "Map", [(D2D1_MAP_OPTIONS, "options"), Out(Pointer(D2D1_MAPPED_RECT), "mappedRect")]), |
| 1158 | StdMethod(HRESULT, "Unmap", []), |
| 1159 | ] |
| 1160 | |
| 1161 | ID2D1ColorContext.methods += [ |
| 1162 | StdMethod(D2D1_COLOR_SPACE, "GetColorSpace", [], const=True, sideeffects=False), |
| 1163 | StdMethod(UINT32, "GetProfileSize", [], const=True, sideeffects=False), |
| 1164 | StdMethod(HRESULT, "GetProfile", [Out(Pointer(BYTE), "profile"), (UINT32, "profileSize")], const=True, sideeffects=False), |
| 1165 | ] |
| 1166 | |
| 1167 | ID2D1GradientStopCollection1.methods += [ |
| 1168 | StdMethod(Void, "GetGradientStops1", [Out(Array(D2D1_GRADIENT_STOP, "gradientStopsCount"), "gradientStops"), (UINT32, "gradientStopsCount")], const=True, sideeffects=False), |
| 1169 | StdMethod(D2D1_COLOR_SPACE, "GetPreInterpolationSpace", [], const=True, sideeffects=False), |
| 1170 | StdMethod(D2D1_COLOR_SPACE, "GetPostInterpolationSpace", [], const=True, sideeffects=False), |
| 1171 | StdMethod(D2D1_BUFFER_PRECISION, "GetBufferPrecision", [], const=True, sideeffects=False), |
| 1172 | StdMethod(D2D1_COLOR_INTERPOLATION_MODE, "GetColorInterpolationMode", [], const=True, sideeffects=False), |
| 1173 | ] |
| 1174 | |
| 1175 | ID2D1DrawingStateBlock1.methods += [ |
| 1176 | StdMethod(Void, "GetDescription", [Out(Pointer(D2D1_DRAWING_STATE_DESCRIPTION1), "stateDescription")], const=True, sideeffects=False), |
| 1177 | StdMethod(Void, "SetDescription", [(Pointer(Const(D2D1_DRAWING_STATE_DESCRIPTION1)), "stateDescription")]), |
| 1178 | ] |
| 1179 | |
| 1180 | ID2D1DeviceContext.methods += [ |
| 1181 | StdMethod(HRESULT, "CreateBitmap", [(D2D1_SIZE_U, "size"), (OpaquePointer(Const(Void)), "sourceData"), (UINT32, "pitch"), (Pointer(Const(D2D1_BITMAP_PROPERTIES1)), "bitmapProperties"), Out(Pointer(ObjPointer(ID2D1Bitmap1)), "bitmap")]), |
| 1182 | StdMethod(HRESULT, "CreateBitmapFromWicBitmap", [(Opaque("IWICBitmapSource *"), "wicBitmapSource"), (Pointer(Const(D2D1_BITMAP_PROPERTIES1)), "bitmapProperties"), Out(Pointer(ObjPointer(ID2D1Bitmap1)), "bitmap")]), |
| 1183 | StdMethod(HRESULT, "CreateColorContext", [(D2D1_COLOR_SPACE, "space"), (Pointer(Const(BYTE)), "profile"), (UINT32, "profileSize"), Out(Pointer(ObjPointer(ID2D1ColorContext)), "colorContext")]), |
| 1184 | StdMethod(HRESULT, "CreateColorContextFromFilename", [(PCWSTR, "filename"), Out(Pointer(ObjPointer(ID2D1ColorContext)), "colorContext")]), |
| 1185 | StdMethod(HRESULT, "CreateColorContextFromWicColorContext", [(Opaque("IWICColorContext *"), "wicColorContext"), Out(Pointer(ObjPointer(ID2D1ColorContext)), "colorContext")]), |
| 1186 | StdMethod(HRESULT, "CreateBitmapFromDxgiSurface", [(ObjPointer(IDXGISurface), "surface"), (Pointer(Const(D2D1_BITMAP_PROPERTIES1)), "bitmapProperties"), Out(Pointer(ObjPointer(ID2D1Bitmap1)), "bitmap")]), |
| 1187 | StdMethod(HRESULT, "CreateEffect", [(REFCLSID, "effectId"), Out(Pointer(ObjPointer(ID2D1Effect)), "effect")]), |
| 1188 | 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")]), |
| 1189 | StdMethod(HRESULT, "CreateImageBrush", [(ObjPointer(ID2D1Image), "image"), (Pointer(Const(D2D1_IMAGE_BRUSH_PROPERTIES)), "imageBrushProperties"), (Pointer(Const(D2D1_BRUSH_PROPERTIES)), "brushProperties"), Out(Pointer(ObjPointer(ID2D1ImageBrush)), "imageBrush")]), |
| 1190 | StdMethod(HRESULT, "CreateBitmapBrush", [(ObjPointer(ID2D1Bitmap), "bitmap"), (Pointer(Const(D2D1_BITMAP_BRUSH_PROPERTIES1)), "bitmapBrushProperties"), (Pointer(Const(D2D1_BRUSH_PROPERTIES)), "brushProperties"), Out(Pointer(ObjPointer(ID2D1BitmapBrush1)), "bitmapBrush")]), |
Robert Tarasov | 6ccf5bb | 2020-01-10 12:31:25 -0800 | [diff] [blame] | 1191 | StdMethod(HRESULT, "CreateCommandList", [Out(Pointer(ObjPointer(ID2D1CommandList)), "commandList")]), |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 1192 | StdMethod(BOOL, "IsDxgiFormatSupported", [(DXGI_FORMAT, "format")], const=True, sideeffects=False), |
| 1193 | StdMethod(BOOL, "IsBufferPrecisionSupported", [(D2D1_BUFFER_PRECISION, "bufferPrecision")], const=True, sideeffects=False), |
| 1194 | StdMethod(HRESULT, "GetImageLocalBounds", [(ObjPointer(ID2D1Image), "image"), Out(Pointer(D2D1_RECT_F), "localBounds")], const=True, sideeffects=False), |
| 1195 | StdMethod(HRESULT, "GetImageWorldBounds", [(ObjPointer(ID2D1Image), "image"), Out(Pointer(D2D1_RECT_F), "worldBounds")], const=True, sideeffects=False), |
| 1196 | 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), |
Robert Tarasov | 6ccf5bb | 2020-01-10 12:31:25 -0800 | [diff] [blame] | 1197 | StdMethod(Void, "GetDevice", [Out(Pointer(ObjPointer(ID2D1Device)), "device")], const=True), |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 1198 | StdMethod(Void, "SetTarget", [(ObjPointer(ID2D1Image), "image")]), |
Robert Tarasov | 6ccf5bb | 2020-01-10 12:31:25 -0800 | [diff] [blame] | 1199 | StdMethod(Void, "GetTarget", [Out(Pointer(ObjPointer(ID2D1Image)), "image")], const=True), |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 1200 | StdMethod(Void, "SetRenderingControls", [(Pointer(Const(D2D1_RENDERING_CONTROLS)), "renderingControls")]), |
| 1201 | StdMethod(Void, "GetRenderingControls", [Out(Pointer(D2D1_RENDERING_CONTROLS), "renderingControls")], const=True, sideeffects=False), |
| 1202 | StdMethod(Void, "SetPrimitiveBlend", [(D2D1_PRIMITIVE_BLEND, "primitiveBlend")]), |
| 1203 | StdMethod(D2D1_PRIMITIVE_BLEND, "GetPrimitiveBlend", [], const=True, sideeffects=False), |
| 1204 | StdMethod(Void, "SetUnitMode", [(D2D1_UNIT_MODE, "unitMode")]), |
| 1205 | StdMethod(D2D1_UNIT_MODE, "GetUnitMode", [], const=True, sideeffects=False), |
| 1206 | 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")]), |
| 1207 | 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")]), |
| 1208 | StdMethod(Void, "DrawGdiMetafile", [(ObjPointer(ID2D1GdiMetafile), "gdiMetafile"), (Pointer(Const(D2D1_POINT_2F)), "targetOffset")]), |
| 1209 | 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")]), |
| 1210 | StdMethod(Void, "PushLayer", [(Pointer(Const(D2D1_LAYER_PARAMETERS1)), "layerParameters"), (ObjPointer(ID2D1Layer), "layer")]), |
| 1211 | StdMethod(HRESULT, "InvalidateEffectInputRectangle", [(ObjPointer(ID2D1Effect), "effect"), (UINT32, "input"), (Pointer(Const(D2D1_RECT_F)), "inputRectangle")]), |
| 1212 | StdMethod(HRESULT, "GetEffectInvalidRectangleCount", [(ObjPointer(ID2D1Effect), "effect"), Out(Pointer(UINT32), "rectangleCount")]), |
| 1213 | StdMethod(HRESULT, "GetEffectInvalidRectangles", [(ObjPointer(ID2D1Effect), "effect"), Out(Pointer(D2D1_RECT_F), "rectangles"), (UINT32, "rectanglesCount")]), |
| 1214 | 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")]), |
| 1215 | StdMethod(Void, "FillOpacityMask", [(ObjPointer(ID2D1Bitmap), "opacityMask"), (ObjPointer(ID2D1Brush), "brush"), (Pointer(Const(D2D1_RECT_F)), "destinationRectangle"), (Pointer(Const(D2D1_RECT_F)), "sourceRectangle")]), |
| 1216 | ] |
| 1217 | |
| 1218 | ID2D1Device.methods += [ |
| 1219 | StdMethod(HRESULT, "CreateDeviceContext", [(D2D1_DEVICE_CONTEXT_OPTIONS, "options"), Out(Pointer(ObjPointer(ID2D1DeviceContext)), "deviceContext")]), |
| 1220 | StdMethod(HRESULT, "CreatePrintControl", [(Opaque("IWICImagingFactory *"), "wicFactory"), (Opaque("IPrintDocumentPackageTarget *"), "documentTarget"), (Pointer(Const(D2D1_PRINT_CONTROL_PROPERTIES)), "printControlProperties"), Out(Pointer(ObjPointer(ID2D1PrintControl)), "printControl")]), |
| 1221 | StdMethod(Void, "SetMaximumTextureMemory", [(UINT64, "maximumInBytes")]), |
| 1222 | StdMethod(UINT64, "GetMaximumTextureMemory", [], const=True, sideeffects=False), |
| 1223 | StdMethod(Void, "ClearResources", [(UINT32, "millisecondsSinceUse")]), |
| 1224 | ] |
| 1225 | |
Jose Fonseca | cc9bea9 | 2016-02-01 13:28:54 +0000 | [diff] [blame] | 1226 | PD2D1_PROPERTY_SET_FUNCTION = Opaque("PD2D1_PROPERTY_SET_FUNCTION") |
| 1227 | PD2D1_PROPERTY_GET_FUNCTION = Opaque("PD2D1_PROPERTY_GET_FUNCTION") |
| 1228 | D2D1_PROPERTY_BINDING = Struct("D2D1_PROPERTY_BINDING", [ |
| 1229 | (PCWSTR, "propertyName"), |
| 1230 | (PD2D1_PROPERTY_SET_FUNCTION, "setFunction"), |
| 1231 | (PD2D1_PROPERTY_GET_FUNCTION, "getFunction"), |
| 1232 | ]) |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 1233 | |
| 1234 | PD2D1_EFFECT_FACTORY = Opaque("PD2D1_EFFECT_FACTORY") |
| 1235 | |
| 1236 | ID2D1Factory1.methods += [ |
| 1237 | StdMethod(HRESULT, "CreateDevice", [(Opaque("IDXGIDevice *"), "dxgiDevice"), Out(Pointer(ObjPointer(ID2D1Device)), "d2dDevice")]), |
| 1238 | StdMethod(HRESULT, "CreateStrokeStyle", [(Pointer(Const(D2D1_STROKE_STYLE_PROPERTIES1)), "strokeStyleProperties"), (Pointer(Const(FLOAT)), "dashes"), (UINT32, "dashesCount"), Out(Pointer(ObjPointer(ID2D1StrokeStyle1)), "strokeStyle")]), |
Robert Tarasov | 6ccf5bb | 2020-01-10 12:31:25 -0800 | [diff] [blame] | 1239 | StdMethod(HRESULT, "CreatePathGeometry", [Out(Pointer(ObjPointer(ID2D1PathGeometry1)), "pathGeometry")]), |
Jose Fonseca | f7a7130 | 2015-08-13 16:10:06 +0100 | [diff] [blame] | 1240 | StdMethod(HRESULT, "CreateDrawingStateBlock", [(Pointer(Const(D2D1_DRAWING_STATE_DESCRIPTION1)), "drawingStateDescription"), (ObjPointer(IDWriteRenderingParams), "textRenderingParams"), Out(Pointer(ObjPointer(ID2D1DrawingStateBlock1)), "drawingStateBlock")]), |
| 1241 | StdMethod(HRESULT, "CreateGdiMetafile", [(Opaque("IStream *"), "metafileStream"), Out(Pointer(ObjPointer(ID2D1GdiMetafile)), "metafile")]), |
| 1242 | StdMethod(HRESULT, "RegisterEffectFromStream", [(REFCLSID, "classId"), (Opaque("IStream *"), "propertyXml"), (Pointer(Const(D2D1_PROPERTY_BINDING)), "bindings"), (UINT32, "bindingsCount"), (Const(PD2D1_EFFECT_FACTORY), "effectFactory")]), |
| 1243 | StdMethod(HRESULT, "RegisterEffectFromString", [(REFCLSID, "classId"), (PCWSTR, "propertyXml"), (Pointer(Const(D2D1_PROPERTY_BINDING)), "bindings"), (UINT32, "bindingsCount"), (Const(PD2D1_EFFECT_FACTORY), "effectFactory")]), |
| 1244 | StdMethod(HRESULT, "UnregisterEffect", [(REFCLSID, "classId")]), |
| 1245 | StdMethod(HRESULT, "GetRegisteredEffects", [Out(Pointer(CLSID), "effects"), (UINT32, "effectsCount"), Out(Pointer(UINT32), "effectsReturned"), Out(Pointer(UINT32), "effectsRegistered")], const=True, sideeffects=False), |
| 1246 | StdMethod(HRESULT, "GetEffectProperties", [(REFCLSID, "effectId"), Out(Pointer(ObjPointer(ID2D1Properties)), "properties")], const=True), |
| 1247 | ] |
| 1248 | |
| 1249 | ID2D1Multithread.methods += [ |
| 1250 | StdMethod(BOOL, "GetMultithreadProtected", [], const=True, sideeffects=False), |
| 1251 | StdMethod(Void, "Enter", []), |
| 1252 | StdMethod(Void, "Leave", []), |
| 1253 | ] |
| 1254 | |
| 1255 | d2d1.addInterfaces([ |
| 1256 | ID2D1Factory1, |
| 1257 | ID2D1Multithread, |
| 1258 | ]) |
| 1259 | d2d1.addFunctions([ |
| 1260 | StdFunction(HRESULT, "D2D1CreateDevice", [(Opaque("IDXGIDevice *"), "dxgiDevice"), (Pointer(Const(D2D1_CREATION_PROPERTIES)), "creationProperties"), Out(Pointer(ObjPointer(ID2D1Device)), "d2dDevice")]), |
| 1261 | StdFunction(HRESULT, "D2D1CreateDeviceContext", [(ObjPointer(IDXGISurface), "dxgiSurface"), (Pointer(Const(D2D1_CREATION_PROPERTIES)), "creationProperties"), Out(Pointer(ObjPointer(ID2D1DeviceContext)), "d2dDeviceContext")]), |
| 1262 | StdFunction(D2D1_COLOR_F, "D2D1ConvertColorSpace", [(D2D1_COLOR_SPACE, "sourceColorSpace"), (D2D1_COLOR_SPACE, "destinationColorSpace"), (Pointer(Const(D2D1_COLOR_F)), "color")]), |
| 1263 | StdFunction(Void, "D2D1SinCos", [(FLOAT, "angle"), Out(Pointer(FLOAT), "s"), Out(Pointer(FLOAT), "c")]), |
| 1264 | StdFunction(FLOAT, "D2D1Tan", [(FLOAT, "angle")]), |
| 1265 | StdFunction(FLOAT, "D2D1Vec3Length", [(FLOAT, "x"), (FLOAT, "y"), (FLOAT, "z")]), |
| 1266 | ]) |