blend2d-bindings 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/ChangeLog +26 -0
- data/LICENSE.txt +21 -0
- data/README.md +41 -0
- data/examples/test.rb +46 -0
- data/examples/util/setup_blend2d.rb +46 -0
- data/lib/blend2d.rb +95 -0
- data/lib/blend2d_api.rb +255 -0
- data/lib/blend2d_array.rb +319 -0
- data/lib/blend2d_bitarray.rb +275 -0
- data/lib/blend2d_bitset.rb +311 -0
- data/lib/blend2d_context.rb +1613 -0
- data/lib/blend2d_filesystem.rb +211 -0
- data/lib/blend2d_font.rb +281 -0
- data/lib/blend2d_fontdata.rb +209 -0
- data/lib/blend2d_fontdefs.rb +552 -0
- data/lib/blend2d_fontface.rb +345 -0
- data/lib/blend2d_fontfeaturesettings.rb +210 -0
- data/lib/blend2d_fontmanager.rb +187 -0
- data/lib/blend2d_fontvariationsettings.rb +210 -0
- data/lib/blend2d_format.rb +112 -0
- data/lib/blend2d_geometry.rb +424 -0
- data/lib/blend2d_glyphbuffer.rb +141 -0
- data/lib/blend2d_glyphrun.rb +101 -0
- data/lib/blend2d_gradient.rb +429 -0
- data/lib/blend2d_image.rb +291 -0
- data/lib/blend2d_imagecodec.rb +219 -0
- data/lib/blend2d_imagedecoder.rb +168 -0
- data/lib/blend2d_imageencoder.rb +159 -0
- data/lib/blend2d_matrix.rb +132 -0
- data/lib/blend2d_object.rb +326 -0
- data/lib/blend2d_path.rb +511 -0
- data/lib/blend2d_pattern.rb +202 -0
- data/lib/blend2d_pixelconverter.rb +109 -0
- data/lib/blend2d_random.rb +77 -0
- data/lib/blend2d_rgba.rb +95 -0
- data/lib/blend2d_runtime.rb +259 -0
- data/lib/blend2d_string.rb +245 -0
- data/lib/blend2d_var.rb +294 -0
- data/lib/libblend2d.aarch64.so +0 -0
- data/lib/libblend2d.arm64.dylib +0 -0
- data/lib/libblend2d.dll +0 -0
- data/lib/libblend2d.x86_64.dylib +0 -0
- data/lib/libblend2d.x86_64.so +0 -0
- metadata +99 -0
data/lib/blend2d_path.rb
ADDED
@@ -0,0 +1,511 @@
|
|
1
|
+
# Ruby-Blend2D : Yet another Blend2D wrapper for Ruby
|
2
|
+
#
|
3
|
+
# * https://github.com/vaiorabbit/blend2d-bindings
|
4
|
+
#
|
5
|
+
# [NOTICE] Autogenerated. Do not edit.
|
6
|
+
|
7
|
+
require 'ffi'
|
8
|
+
require_relative 'blend2d_array'
|
9
|
+
require_relative 'blend2d_geometry'
|
10
|
+
require_relative 'blend2d_object'
|
11
|
+
|
12
|
+
module Blend2D
|
13
|
+
extend FFI::Library
|
14
|
+
# Define/Macro
|
15
|
+
|
16
|
+
|
17
|
+
# Enum
|
18
|
+
|
19
|
+
BL_PATH_CMD_MOVE = 0
|
20
|
+
BL_PATH_CMD_ON = 1
|
21
|
+
BL_PATH_CMD_QUAD = 2
|
22
|
+
BL_PATH_CMD_CONIC = 3
|
23
|
+
BL_PATH_CMD_CUBIC = 4
|
24
|
+
BL_PATH_CMD_CLOSE = 5
|
25
|
+
BL_PATH_CMD_WEIGHT = 6
|
26
|
+
BL_PATH_CMD_MAX_VALUE = 6
|
27
|
+
BL_PATH_CMD_FORCE_UINT = -1
|
28
|
+
BL_PATH_CMD_PRESERVE = -1
|
29
|
+
BL_PATH_NO_FLAGS = 0
|
30
|
+
BL_PATH_FLAG_EMPTY = 1
|
31
|
+
BL_PATH_FLAG_MULTIPLE = 2
|
32
|
+
BL_PATH_FLAG_QUADS = 4
|
33
|
+
BL_PATH_FLAG_CONICS = 8
|
34
|
+
BL_PATH_FLAG_CUBICS = 16
|
35
|
+
BL_PATH_FLAG_INVALID = 1073741824
|
36
|
+
BL_PATH_FLAG_DIRTY = -2147483648
|
37
|
+
BL_PATH_FLAG_FORCE_UINT = -1
|
38
|
+
BL_PATH_REVERSE_MODE_COMPLETE = 0
|
39
|
+
BL_PATH_REVERSE_MODE_SEPARATE = 1
|
40
|
+
BL_PATH_REVERSE_MODE_MAX_VALUE = 1
|
41
|
+
BL_PATH_REVERSE_MODE_FORCE_UINT = -1
|
42
|
+
BL_STROKE_JOIN_MITER_CLIP = 0
|
43
|
+
BL_STROKE_JOIN_MITER_BEVEL = 1
|
44
|
+
BL_STROKE_JOIN_MITER_ROUND = 2
|
45
|
+
BL_STROKE_JOIN_BEVEL = 3
|
46
|
+
BL_STROKE_JOIN_ROUND = 4
|
47
|
+
BL_STROKE_JOIN_MAX_VALUE = 4
|
48
|
+
BL_STROKE_JOIN_FORCE_UINT = -1
|
49
|
+
BL_STROKE_CAP_POSITION_START = 0
|
50
|
+
BL_STROKE_CAP_POSITION_END = 1
|
51
|
+
BL_STROKE_CAP_POSITION_MAX_VALUE = 1
|
52
|
+
BL_STROKE_CAP_POSITION_FORCE_UINT = -1
|
53
|
+
BL_STROKE_CAP_BUTT = 0
|
54
|
+
BL_STROKE_CAP_SQUARE = 1
|
55
|
+
BL_STROKE_CAP_ROUND = 2
|
56
|
+
BL_STROKE_CAP_ROUND_REV = 3
|
57
|
+
BL_STROKE_CAP_TRIANGLE = 4
|
58
|
+
BL_STROKE_CAP_TRIANGLE_REV = 5
|
59
|
+
BL_STROKE_CAP_MAX_VALUE = 5
|
60
|
+
BL_STROKE_CAP_FORCE_UINT = -1
|
61
|
+
BL_STROKE_TRANSFORM_ORDER_AFTER = 0
|
62
|
+
BL_STROKE_TRANSFORM_ORDER_BEFORE = 1
|
63
|
+
BL_STROKE_TRANSFORM_ORDER_MAX_VALUE = 1
|
64
|
+
BL_STROKE_TRANSFORM_ORDER_FORCE_UINT = -1
|
65
|
+
BL_FLATTEN_MODE_DEFAULT = 0
|
66
|
+
BL_FLATTEN_MODE_RECURSIVE = 1
|
67
|
+
BL_FLATTEN_MODE_MAX_VALUE = 1
|
68
|
+
BL_FLATTEN_MODE_FORCE_UINT = -1
|
69
|
+
BL_OFFSET_MODE_DEFAULT = 0
|
70
|
+
BL_OFFSET_MODE_ITERATIVE = 1
|
71
|
+
BL_OFFSET_MODE_MAX_VALUE = 1
|
72
|
+
BL_OFFSET_MODE_FORCE_UINT = -1
|
73
|
+
|
74
|
+
# Typedef
|
75
|
+
|
76
|
+
|
77
|
+
class BLPathView < FFI::Struct
|
78
|
+
layout(
|
79
|
+
:commandData, :pointer,
|
80
|
+
:vertexData, :pointer,
|
81
|
+
:size, :ulong,
|
82
|
+
)
|
83
|
+
end
|
84
|
+
|
85
|
+
class BLStrokeOptionsCore_Contents_Content < FFI::Struct
|
86
|
+
layout(
|
87
|
+
:startCap, :uchar,
|
88
|
+
:endCap, :uchar,
|
89
|
+
:join, :uchar,
|
90
|
+
:transformOrder, :uchar,
|
91
|
+
:reserved, [:uchar, 4],
|
92
|
+
)
|
93
|
+
end
|
94
|
+
|
95
|
+
class BLStrokeOptionsCore_Contents < FFI::Union
|
96
|
+
layout(
|
97
|
+
:content, BLStrokeOptionsCore_Contents_Content,
|
98
|
+
:caps, [:uchar, 2],
|
99
|
+
:hints, :ulong_long,
|
100
|
+
)
|
101
|
+
end
|
102
|
+
|
103
|
+
class BLStrokeOptionsCore < FFI::Struct
|
104
|
+
layout(
|
105
|
+
:contents, BLStrokeOptionsCore_Contents,
|
106
|
+
:width, :double,
|
107
|
+
:miterLimit, :double,
|
108
|
+
:dashOffset, :double,
|
109
|
+
:dashArray, BLArrayCore,
|
110
|
+
)
|
111
|
+
end
|
112
|
+
|
113
|
+
class BLPathImpl_Contents_Content < FFI::Struct
|
114
|
+
layout(
|
115
|
+
:commandData, :pointer,
|
116
|
+
:vertexData, :pointer,
|
117
|
+
:size, :ulong,
|
118
|
+
)
|
119
|
+
end
|
120
|
+
|
121
|
+
class BLPathImpl_Contents < FFI::Union
|
122
|
+
layout(
|
123
|
+
:content, BLPathImpl_Contents_Content,
|
124
|
+
:view, BLPathView,
|
125
|
+
)
|
126
|
+
end
|
127
|
+
|
128
|
+
class BLPathImpl < FFI::Struct
|
129
|
+
layout(
|
130
|
+
:contents, BLPathImpl_Contents,
|
131
|
+
:capacity, :ulong,
|
132
|
+
:flags, :uint,
|
133
|
+
)
|
134
|
+
end
|
135
|
+
|
136
|
+
typedef :int, :BLPathCmd
|
137
|
+
typedef :int, :BLPathCmdExtra
|
138
|
+
typedef :int, :BLPathFlags
|
139
|
+
typedef :int, :BLPathReverseMode
|
140
|
+
typedef :int, :BLStrokeJoin
|
141
|
+
typedef :int, :BLStrokeCapPosition
|
142
|
+
typedef :int, :BLStrokeCap
|
143
|
+
typedef :int, :BLStrokeTransformOrder
|
144
|
+
typedef :int, :BLFlattenMode
|
145
|
+
typedef :int, :BLOffsetMode
|
146
|
+
callback :BLPathSinkFunc, [:pointer, :pointer, :pointer], :uint
|
147
|
+
callback :BLPathStrokeSinkFunc, [:pointer, :pointer, :pointer, :ulong_long, :ulong_long, :pointer], :uint
|
148
|
+
|
149
|
+
# Struct
|
150
|
+
|
151
|
+
class BLApproximationOptions < FFI::Struct
|
152
|
+
layout(
|
153
|
+
:flattenMode, :uchar,
|
154
|
+
:offsetMode, :uchar,
|
155
|
+
:reservedFlags, [:uchar, 6],
|
156
|
+
:flattenTolerance, :double,
|
157
|
+
:simplifyTolerance, :double,
|
158
|
+
:offsetParameter, :double,
|
159
|
+
)
|
160
|
+
def flattenMode = self[:flattenMode]
|
161
|
+
def flattenMode=(v) self[:flattenMode] = v end
|
162
|
+
def offsetMode = self[:offsetMode]
|
163
|
+
def offsetMode=(v) self[:offsetMode] = v end
|
164
|
+
def reservedFlags = self[:reservedFlags]
|
165
|
+
def reservedFlags=(v) self[:reservedFlags] = v end
|
166
|
+
def flattenTolerance = self[:flattenTolerance]
|
167
|
+
def flattenTolerance=(v) self[:flattenTolerance] = v end
|
168
|
+
def simplifyTolerance = self[:simplifyTolerance]
|
169
|
+
def simplifyTolerance=(v) self[:simplifyTolerance] = v end
|
170
|
+
def offsetParameter = self[:offsetParameter]
|
171
|
+
def offsetParameter=(v) self[:offsetParameter] = v end
|
172
|
+
def self.create_as(_flattenMode_, _offsetMode_, _reservedFlags_, _flattenTolerance_, _simplifyTolerance_, _offsetParameter_)
|
173
|
+
instance = BLApproximationOptions.new
|
174
|
+
instance[:flattenMode] = _flattenMode_
|
175
|
+
instance[:offsetMode] = _offsetMode_
|
176
|
+
instance[:reservedFlags] = _reservedFlags_
|
177
|
+
instance[:flattenTolerance] = _flattenTolerance_
|
178
|
+
instance[:simplifyTolerance] = _simplifyTolerance_
|
179
|
+
instance[:offsetParameter] = _offsetParameter_
|
180
|
+
instance
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
class BLPathCore < FFI::Struct
|
185
|
+
layout(
|
186
|
+
:_d, BLObjectDetail,
|
187
|
+
)
|
188
|
+
def _d = self[:_d]
|
189
|
+
def _d=(v) self[:_d] = v end
|
190
|
+
def init() = blPathInit(self)
|
191
|
+
def self.create()
|
192
|
+
instance = BLPathCore.new
|
193
|
+
blPathInit(instance)
|
194
|
+
instance
|
195
|
+
end
|
196
|
+
def initMove(other) = blPathInitMove(self, other)
|
197
|
+
def initWeak(other) = blPathInitWeak(self, other)
|
198
|
+
def destroy() = blPathDestroy(self)
|
199
|
+
def reset() = blPathReset(self)
|
200
|
+
def getSize() = blPathGetSize(self)
|
201
|
+
def getCapacity() = blPathGetCapacity(self)
|
202
|
+
def getCommandData() = blPathGetCommandData(self)
|
203
|
+
def getVertexData() = blPathGetVertexData(self)
|
204
|
+
def clear() = blPathClear(self)
|
205
|
+
def shrink() = blPathShrink(self)
|
206
|
+
def reserve(n) = blPathReserve(self, n)
|
207
|
+
def modifyOp(op, n, cmdDataOut, vtxDataOut) = blPathModifyOp(self, op, n, cmdDataOut, vtxDataOut)
|
208
|
+
def assignMove(other) = blPathAssignMove(self, other)
|
209
|
+
def assignWeak(other) = blPathAssignWeak(self, other)
|
210
|
+
def assignDeep(other) = blPathAssignDeep(self, other)
|
211
|
+
def setVertexAt(index, cmd, x, y) = blPathSetVertexAt(self, index, cmd, x, y)
|
212
|
+
def moveTo(x0, y0) = blPathMoveTo(self, x0, y0)
|
213
|
+
def lineTo(x1, y1) = blPathLineTo(self, x1, y1)
|
214
|
+
def polyTo(poly, count) = blPathPolyTo(self, poly, count)
|
215
|
+
def quadTo(x1, y1, x2, y2) = blPathQuadTo(self, x1, y1, x2, y2)
|
216
|
+
def conicTo(x1, y1, x2, y2, w) = blPathConicTo(self, x1, y1, x2, y2, w)
|
217
|
+
def cubicTo(x1, y1, x2, y2, x3, y3) = blPathCubicTo(self, x1, y1, x2, y2, x3, y3)
|
218
|
+
def smoothQuadTo(x2, y2) = blPathSmoothQuadTo(self, x2, y2)
|
219
|
+
def smoothCubicTo(x2, y2, x3, y3) = blPathSmoothCubicTo(self, x2, y2, x3, y3)
|
220
|
+
def arcTo(x, y, rx, ry, start, sweep, forceMoveTo) = blPathArcTo(self, x, y, rx, ry, start, sweep, forceMoveTo)
|
221
|
+
def arcQuadrantTo(x1, y1, x2, y2) = blPathArcQuadrantTo(self, x1, y1, x2, y2)
|
222
|
+
def ellipticArcTo(rx, ry, xAxisRotation, largeArcFlag, sweepFlag, x1, y1) = blPathEllipticArcTo(self, rx, ry, xAxisRotation, largeArcFlag, sweepFlag, x1, y1)
|
223
|
+
def close() = blPathClose(self)
|
224
|
+
def addGeometry(geometryType, geometryData, m, dir) = blPathAddGeometry(self, geometryType, geometryData, m, dir)
|
225
|
+
def addBoxI(box, dir) = blPathAddBoxI(self, box, dir)
|
226
|
+
def addBoxD(box, dir) = blPathAddBoxD(self, box, dir)
|
227
|
+
def addRectI(rect, dir) = blPathAddRectI(self, rect, dir)
|
228
|
+
def addRectD(rect, dir) = blPathAddRectD(self, rect, dir)
|
229
|
+
def addPath(other, range) = blPathAddPath(self, other, range)
|
230
|
+
def addTranslatedPath(other, range, p) = blPathAddTranslatedPath(self, other, range, p)
|
231
|
+
def addTransformedPath(other, range, m) = blPathAddTransformedPath(self, other, range, m)
|
232
|
+
def addReversedPath(other, range, reverseMode) = blPathAddReversedPath(self, other, range, reverseMode)
|
233
|
+
def addStrokedPath(other, range, options, approx) = blPathAddStrokedPath(self, other, range, options, approx)
|
234
|
+
def removeRange(range) = blPathRemoveRange(self, range)
|
235
|
+
def translate(range, p) = blPathTranslate(self, range, p)
|
236
|
+
def transform(range, m) = blPathTransform(self, range, m)
|
237
|
+
def fitTo(range, rect, fitFlags) = blPathFitTo(self, range, rect, fitFlags)
|
238
|
+
def equals(b) = blPathEquals(a, b)
|
239
|
+
def getInfoFlags(flagsOut) = blPathGetInfoFlags(self, flagsOut)
|
240
|
+
def getControlBox(boxOut) = blPathGetControlBox(self, boxOut)
|
241
|
+
def getBoundingBox(boxOut) = blPathGetBoundingBox(self, boxOut)
|
242
|
+
def getFigureRange(index, rangeOut) = blPathGetFigureRange(self, index, rangeOut)
|
243
|
+
def getLastVertex(vtxOut) = blPathGetLastVertex(self, vtxOut)
|
244
|
+
def getClosestVertex(p, maxDistance, indexOut, distanceOut) = blPathGetClosestVertex(self, p, maxDistance, indexOut, distanceOut)
|
245
|
+
def hitTest(p, fillRule) = blPathHitTest(self, p, fillRule)
|
246
|
+
def strokeToSink(range, strokeOptions, approximationOptions, a, b, c, sink, userData) = blPathStrokeToSink(self, range, strokeOptions, approximationOptions, a, b, c, sink, userData)
|
247
|
+
end
|
248
|
+
|
249
|
+
|
250
|
+
# Function
|
251
|
+
|
252
|
+
def self.setup_path_symbols(output_error = false)
|
253
|
+
symbols = [
|
254
|
+
:blPathInit,
|
255
|
+
:blPathInitMove,
|
256
|
+
:blPathInitWeak,
|
257
|
+
:blPathDestroy,
|
258
|
+
:blPathReset,
|
259
|
+
:blPathGetSize,
|
260
|
+
:blPathGetCapacity,
|
261
|
+
:blPathGetCommandData,
|
262
|
+
:blPathGetVertexData,
|
263
|
+
:blPathClear,
|
264
|
+
:blPathShrink,
|
265
|
+
:blPathReserve,
|
266
|
+
:blPathModifyOp,
|
267
|
+
:blPathAssignMove,
|
268
|
+
:blPathAssignWeak,
|
269
|
+
:blPathAssignDeep,
|
270
|
+
:blPathSetVertexAt,
|
271
|
+
:blPathMoveTo,
|
272
|
+
:blPathLineTo,
|
273
|
+
:blPathPolyTo,
|
274
|
+
:blPathQuadTo,
|
275
|
+
:blPathConicTo,
|
276
|
+
:blPathCubicTo,
|
277
|
+
:blPathSmoothQuadTo,
|
278
|
+
:blPathSmoothCubicTo,
|
279
|
+
:blPathArcTo,
|
280
|
+
:blPathArcQuadrantTo,
|
281
|
+
:blPathEllipticArcTo,
|
282
|
+
:blPathClose,
|
283
|
+
:blPathAddGeometry,
|
284
|
+
:blPathAddBoxI,
|
285
|
+
:blPathAddBoxD,
|
286
|
+
:blPathAddRectI,
|
287
|
+
:blPathAddRectD,
|
288
|
+
:blPathAddPath,
|
289
|
+
:blPathAddTranslatedPath,
|
290
|
+
:blPathAddTransformedPath,
|
291
|
+
:blPathAddReversedPath,
|
292
|
+
:blPathAddStrokedPath,
|
293
|
+
:blPathRemoveRange,
|
294
|
+
:blPathTranslate,
|
295
|
+
:blPathTransform,
|
296
|
+
:blPathFitTo,
|
297
|
+
:blPathEquals,
|
298
|
+
:blPathGetInfoFlags,
|
299
|
+
:blPathGetControlBox,
|
300
|
+
:blPathGetBoundingBox,
|
301
|
+
:blPathGetFigureRange,
|
302
|
+
:blPathGetLastVertex,
|
303
|
+
:blPathGetClosestVertex,
|
304
|
+
:blPathHitTest,
|
305
|
+
:blStrokeOptionsInit,
|
306
|
+
:blStrokeOptionsInitMove,
|
307
|
+
:blStrokeOptionsInitWeak,
|
308
|
+
:blStrokeOptionsDestroy,
|
309
|
+
:blStrokeOptionsReset,
|
310
|
+
:blStrokeOptionsEquals,
|
311
|
+
:blStrokeOptionsAssignMove,
|
312
|
+
:blStrokeOptionsAssignWeak,
|
313
|
+
:blPathStrokeToSink,
|
314
|
+
]
|
315
|
+
apis = {
|
316
|
+
:blPathInit => :blPathInit,
|
317
|
+
:blPathInitMove => :blPathInitMove,
|
318
|
+
:blPathInitWeak => :blPathInitWeak,
|
319
|
+
:blPathDestroy => :blPathDestroy,
|
320
|
+
:blPathReset => :blPathReset,
|
321
|
+
:blPathGetSize => :blPathGetSize,
|
322
|
+
:blPathGetCapacity => :blPathGetCapacity,
|
323
|
+
:blPathGetCommandData => :blPathGetCommandData,
|
324
|
+
:blPathGetVertexData => :blPathGetVertexData,
|
325
|
+
:blPathClear => :blPathClear,
|
326
|
+
:blPathShrink => :blPathShrink,
|
327
|
+
:blPathReserve => :blPathReserve,
|
328
|
+
:blPathModifyOp => :blPathModifyOp,
|
329
|
+
:blPathAssignMove => :blPathAssignMove,
|
330
|
+
:blPathAssignWeak => :blPathAssignWeak,
|
331
|
+
:blPathAssignDeep => :blPathAssignDeep,
|
332
|
+
:blPathSetVertexAt => :blPathSetVertexAt,
|
333
|
+
:blPathMoveTo => :blPathMoveTo,
|
334
|
+
:blPathLineTo => :blPathLineTo,
|
335
|
+
:blPathPolyTo => :blPathPolyTo,
|
336
|
+
:blPathQuadTo => :blPathQuadTo,
|
337
|
+
:blPathConicTo => :blPathConicTo,
|
338
|
+
:blPathCubicTo => :blPathCubicTo,
|
339
|
+
:blPathSmoothQuadTo => :blPathSmoothQuadTo,
|
340
|
+
:blPathSmoothCubicTo => :blPathSmoothCubicTo,
|
341
|
+
:blPathArcTo => :blPathArcTo,
|
342
|
+
:blPathArcQuadrantTo => :blPathArcQuadrantTo,
|
343
|
+
:blPathEllipticArcTo => :blPathEllipticArcTo,
|
344
|
+
:blPathClose => :blPathClose,
|
345
|
+
:blPathAddGeometry => :blPathAddGeometry,
|
346
|
+
:blPathAddBoxI => :blPathAddBoxI,
|
347
|
+
:blPathAddBoxD => :blPathAddBoxD,
|
348
|
+
:blPathAddRectI => :blPathAddRectI,
|
349
|
+
:blPathAddRectD => :blPathAddRectD,
|
350
|
+
:blPathAddPath => :blPathAddPath,
|
351
|
+
:blPathAddTranslatedPath => :blPathAddTranslatedPath,
|
352
|
+
:blPathAddTransformedPath => :blPathAddTransformedPath,
|
353
|
+
:blPathAddReversedPath => :blPathAddReversedPath,
|
354
|
+
:blPathAddStrokedPath => :blPathAddStrokedPath,
|
355
|
+
:blPathRemoveRange => :blPathRemoveRange,
|
356
|
+
:blPathTranslate => :blPathTranslate,
|
357
|
+
:blPathTransform => :blPathTransform,
|
358
|
+
:blPathFitTo => :blPathFitTo,
|
359
|
+
:blPathEquals => :blPathEquals,
|
360
|
+
:blPathGetInfoFlags => :blPathGetInfoFlags,
|
361
|
+
:blPathGetControlBox => :blPathGetControlBox,
|
362
|
+
:blPathGetBoundingBox => :blPathGetBoundingBox,
|
363
|
+
:blPathGetFigureRange => :blPathGetFigureRange,
|
364
|
+
:blPathGetLastVertex => :blPathGetLastVertex,
|
365
|
+
:blPathGetClosestVertex => :blPathGetClosestVertex,
|
366
|
+
:blPathHitTest => :blPathHitTest,
|
367
|
+
:blStrokeOptionsInit => :blStrokeOptionsInit,
|
368
|
+
:blStrokeOptionsInitMove => :blStrokeOptionsInitMove,
|
369
|
+
:blStrokeOptionsInitWeak => :blStrokeOptionsInitWeak,
|
370
|
+
:blStrokeOptionsDestroy => :blStrokeOptionsDestroy,
|
371
|
+
:blStrokeOptionsReset => :blStrokeOptionsReset,
|
372
|
+
:blStrokeOptionsEquals => :blStrokeOptionsEquals,
|
373
|
+
:blStrokeOptionsAssignMove => :blStrokeOptionsAssignMove,
|
374
|
+
:blStrokeOptionsAssignWeak => :blStrokeOptionsAssignWeak,
|
375
|
+
:blPathStrokeToSink => :blPathStrokeToSink,
|
376
|
+
}
|
377
|
+
args = {
|
378
|
+
:blPathInit => [:pointer],
|
379
|
+
:blPathInitMove => [:pointer, :pointer],
|
380
|
+
:blPathInitWeak => [:pointer, :pointer],
|
381
|
+
:blPathDestroy => [:pointer],
|
382
|
+
:blPathReset => [:pointer],
|
383
|
+
:blPathGetSize => [:pointer],
|
384
|
+
:blPathGetCapacity => [:pointer],
|
385
|
+
:blPathGetCommandData => [:pointer],
|
386
|
+
:blPathGetVertexData => [:pointer],
|
387
|
+
:blPathClear => [:pointer],
|
388
|
+
:blPathShrink => [:pointer],
|
389
|
+
:blPathReserve => [:pointer, :ulong_long],
|
390
|
+
:blPathModifyOp => [:pointer, :int, :ulong_long, :pointer, :pointer],
|
391
|
+
:blPathAssignMove => [:pointer, :pointer],
|
392
|
+
:blPathAssignWeak => [:pointer, :pointer],
|
393
|
+
:blPathAssignDeep => [:pointer, :pointer],
|
394
|
+
:blPathSetVertexAt => [:pointer, :ulong_long, :uint, :double, :double],
|
395
|
+
:blPathMoveTo => [:pointer, :double, :double],
|
396
|
+
:blPathLineTo => [:pointer, :double, :double],
|
397
|
+
:blPathPolyTo => [:pointer, :pointer, :ulong_long],
|
398
|
+
:blPathQuadTo => [:pointer, :double, :double, :double, :double],
|
399
|
+
:blPathConicTo => [:pointer, :double, :double, :double, :double, :double],
|
400
|
+
:blPathCubicTo => [:pointer, :double, :double, :double, :double, :double, :double],
|
401
|
+
:blPathSmoothQuadTo => [:pointer, :double, :double],
|
402
|
+
:blPathSmoothCubicTo => [:pointer, :double, :double, :double, :double],
|
403
|
+
:blPathArcTo => [:pointer, :double, :double, :double, :double, :double, :double, :bool],
|
404
|
+
:blPathArcQuadrantTo => [:pointer, :double, :double, :double, :double],
|
405
|
+
:blPathEllipticArcTo => [:pointer, :double, :double, :double, :bool, :bool, :double, :double],
|
406
|
+
:blPathClose => [:pointer],
|
407
|
+
:blPathAddGeometry => [:pointer, :int, :pointer, :pointer, :int],
|
408
|
+
:blPathAddBoxI => [:pointer, :pointer, :int],
|
409
|
+
:blPathAddBoxD => [:pointer, :pointer, :int],
|
410
|
+
:blPathAddRectI => [:pointer, :pointer, :int],
|
411
|
+
:blPathAddRectD => [:pointer, :pointer, :int],
|
412
|
+
:blPathAddPath => [:pointer, :pointer, :pointer],
|
413
|
+
:blPathAddTranslatedPath => [:pointer, :pointer, :pointer, :pointer],
|
414
|
+
:blPathAddTransformedPath => [:pointer, :pointer, :pointer, :pointer],
|
415
|
+
:blPathAddReversedPath => [:pointer, :pointer, :pointer, :int],
|
416
|
+
:blPathAddStrokedPath => [:pointer, :pointer, :pointer, :pointer, :pointer],
|
417
|
+
:blPathRemoveRange => [:pointer, :pointer],
|
418
|
+
:blPathTranslate => [:pointer, :pointer, :pointer],
|
419
|
+
:blPathTransform => [:pointer, :pointer, :pointer],
|
420
|
+
:blPathFitTo => [:pointer, :pointer, :pointer, :uint],
|
421
|
+
:blPathEquals => [:pointer, :pointer],
|
422
|
+
:blPathGetInfoFlags => [:pointer, :pointer],
|
423
|
+
:blPathGetControlBox => [:pointer, :pointer],
|
424
|
+
:blPathGetBoundingBox => [:pointer, :pointer],
|
425
|
+
:blPathGetFigureRange => [:pointer, :ulong_long, :pointer],
|
426
|
+
:blPathGetLastVertex => [:pointer, :pointer],
|
427
|
+
:blPathGetClosestVertex => [:pointer, :pointer, :double, :pointer, :pointer],
|
428
|
+
:blPathHitTest => [:pointer, :pointer, :int],
|
429
|
+
:blStrokeOptionsInit => [:pointer],
|
430
|
+
:blStrokeOptionsInitMove => [:pointer, :pointer],
|
431
|
+
:blStrokeOptionsInitWeak => [:pointer, :pointer],
|
432
|
+
:blStrokeOptionsDestroy => [:pointer],
|
433
|
+
:blStrokeOptionsReset => [:pointer],
|
434
|
+
:blStrokeOptionsEquals => [:pointer, :pointer],
|
435
|
+
:blStrokeOptionsAssignMove => [:pointer, :pointer],
|
436
|
+
:blStrokeOptionsAssignWeak => [:pointer, :pointer],
|
437
|
+
:blPathStrokeToSink => [:pointer, :pointer, :pointer, :pointer, :pointer, :pointer, :pointer, :BLPathStrokeSinkFunc, :pointer],
|
438
|
+
}
|
439
|
+
retvals = {
|
440
|
+
:blPathInit => :uint,
|
441
|
+
:blPathInitMove => :uint,
|
442
|
+
:blPathInitWeak => :uint,
|
443
|
+
:blPathDestroy => :uint,
|
444
|
+
:blPathReset => :uint,
|
445
|
+
:blPathGetSize => :ulong_long,
|
446
|
+
:blPathGetCapacity => :ulong_long,
|
447
|
+
:blPathGetCommandData => :pointer,
|
448
|
+
:blPathGetVertexData => :pointer,
|
449
|
+
:blPathClear => :uint,
|
450
|
+
:blPathShrink => :uint,
|
451
|
+
:blPathReserve => :uint,
|
452
|
+
:blPathModifyOp => :uint,
|
453
|
+
:blPathAssignMove => :uint,
|
454
|
+
:blPathAssignWeak => :uint,
|
455
|
+
:blPathAssignDeep => :uint,
|
456
|
+
:blPathSetVertexAt => :uint,
|
457
|
+
:blPathMoveTo => :uint,
|
458
|
+
:blPathLineTo => :uint,
|
459
|
+
:blPathPolyTo => :uint,
|
460
|
+
:blPathQuadTo => :uint,
|
461
|
+
:blPathConicTo => :uint,
|
462
|
+
:blPathCubicTo => :uint,
|
463
|
+
:blPathSmoothQuadTo => :uint,
|
464
|
+
:blPathSmoothCubicTo => :uint,
|
465
|
+
:blPathArcTo => :uint,
|
466
|
+
:blPathArcQuadrantTo => :uint,
|
467
|
+
:blPathEllipticArcTo => :uint,
|
468
|
+
:blPathClose => :uint,
|
469
|
+
:blPathAddGeometry => :uint,
|
470
|
+
:blPathAddBoxI => :uint,
|
471
|
+
:blPathAddBoxD => :uint,
|
472
|
+
:blPathAddRectI => :uint,
|
473
|
+
:blPathAddRectD => :uint,
|
474
|
+
:blPathAddPath => :uint,
|
475
|
+
:blPathAddTranslatedPath => :uint,
|
476
|
+
:blPathAddTransformedPath => :uint,
|
477
|
+
:blPathAddReversedPath => :uint,
|
478
|
+
:blPathAddStrokedPath => :uint,
|
479
|
+
:blPathRemoveRange => :uint,
|
480
|
+
:blPathTranslate => :uint,
|
481
|
+
:blPathTransform => :uint,
|
482
|
+
:blPathFitTo => :uint,
|
483
|
+
:blPathEquals => :bool,
|
484
|
+
:blPathGetInfoFlags => :uint,
|
485
|
+
:blPathGetControlBox => :uint,
|
486
|
+
:blPathGetBoundingBox => :uint,
|
487
|
+
:blPathGetFigureRange => :uint,
|
488
|
+
:blPathGetLastVertex => :uint,
|
489
|
+
:blPathGetClosestVertex => :uint,
|
490
|
+
:blPathHitTest => :int,
|
491
|
+
:blStrokeOptionsInit => :uint,
|
492
|
+
:blStrokeOptionsInitMove => :uint,
|
493
|
+
:blStrokeOptionsInitWeak => :uint,
|
494
|
+
:blStrokeOptionsDestroy => :uint,
|
495
|
+
:blStrokeOptionsReset => :uint,
|
496
|
+
:blStrokeOptionsEquals => :bool,
|
497
|
+
:blStrokeOptionsAssignMove => :uint,
|
498
|
+
:blStrokeOptionsAssignWeak => :uint,
|
499
|
+
:blPathStrokeToSink => :uint,
|
500
|
+
}
|
501
|
+
symbols.each do |sym|
|
502
|
+
begin
|
503
|
+
attach_function apis[sym], sym, args[sym], retvals[sym]
|
504
|
+
rescue FFI::NotFoundError => error
|
505
|
+
$stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
|
506
|
+
end
|
507
|
+
end
|
508
|
+
end
|
509
|
+
|
510
|
+
end
|
511
|
+
|