libui 0.1.3.pre-x64-mingw-ucrt

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/libui/ffi.rb ADDED
@@ -0,0 +1,647 @@
1
+ require 'fiddle/import'
2
+ require_relative 'fiddle_patch'
3
+
4
+ module LibUI
5
+ module FFI
6
+ extend Fiddle::Importer
7
+ extend FiddlePatch
8
+
9
+ begin
10
+ dlload LibUI.ffi_lib
11
+ rescue LoadError
12
+ raise LoadError, 'Could not find libui shared library'
13
+ end
14
+
15
+ class << self
16
+ attr_reader :func_map
17
+
18
+ def try_extern(signature, *opts)
19
+ extern(signature, *opts)
20
+ rescue StandardError => e
21
+ warn "#{e.class.name}: #{e.message}"
22
+ end
23
+
24
+ def ffi_methods
25
+ @ffi_methods ||= func_map.each_key.to_a
26
+ end
27
+ end
28
+
29
+ typealias('uint32_t', 'unsigned int')
30
+
31
+ InitOptions = struct [
32
+ 'size_t Size'
33
+ ]
34
+
35
+ # https://github.com/andlabs/libui/blob/master/ui.h
36
+ # keep same order
37
+
38
+ try_extern 'const char *uiInit(uiInitOptions *options)'
39
+ try_extern 'void uiUninit(void)'
40
+ try_extern 'void uiFreeInitError(const char *err)'
41
+
42
+ try_extern 'void uiMain(void)'
43
+ try_extern 'void uiMainSteps(void)'
44
+ try_extern 'int uiMainStep(int wait)'
45
+ try_extern 'void uiQuit(void)'
46
+ try_extern 'void uiQueueMain(void (*f)(void *data), void *data)'
47
+ try_extern 'void uiTimer(int milliseconds, int (*f)(void *data), void *data)'
48
+ try_extern 'void uiOnShouldQuit(int (*f)(void *data), void *data)'
49
+ try_extern 'void uiFreeText(char *text)'
50
+
51
+ Control = struct [
52
+ 'uint32_t Signature',
53
+ 'uint32_t OSSignature',
54
+ 'uint32_t TypeSignature',
55
+ 'void (*Destroy)(uiControl *)',
56
+ 'uintptr_t (*Handle)(uiControl *)',
57
+ 'uiControl *(*Parent)(uiControl *)',
58
+ 'void (*SetParent)(uiControl *, uiControl *)',
59
+ 'int (*Toplevel)(uiControl *)',
60
+ 'int (*Visible)(uiControl *)',
61
+ 'void (*Show)(uiControl *)',
62
+ 'void (*Hide)(uiControl *)',
63
+ 'int (*Enabled)(uiControl *)',
64
+ 'void (*Enable)(uiControl *)',
65
+ 'void (*Disable)(uiControl *)'
66
+ ]
67
+
68
+ try_extern 'void uiControlDestroy(uiControl *c)'
69
+ try_extern 'uintptr_t uiControlHandle(uiControl *c)'
70
+ try_extern 'uiControl *uiControlParent(uiControl *c)'
71
+ try_extern 'void uiControlSetParent(uiControl *c, uiControl *parent)'
72
+ try_extern 'int uiControlToplevel(uiControl *c)'
73
+ try_extern 'int uiControlVisible(uiControl *c)'
74
+ try_extern 'void uiControlShow(uiControl *c)'
75
+ try_extern 'void uiControlHide(uiControl *c)'
76
+ try_extern 'int uiControlEnabled(uiControl *c)'
77
+ try_extern 'void uiControlEnable(uiControl *c)'
78
+ try_extern 'void uiControlDisable(uiControl *c)'
79
+
80
+ try_extern 'uiControl *uiAllocControl(size_t n, uint32_t OSsig, uint32_t typesig, const char *typenamestr)'
81
+ try_extern 'void uiFreeControl(uiControl *c)'
82
+
83
+ try_extern 'void uiControlVerifySetParent(uiControl *c, uiControl *parent)'
84
+ try_extern 'int uiControlEnabledToUser(uiControl *c)'
85
+
86
+ try_extern 'void uiUserBugCannotSetParentOnToplevel(const char *type)'
87
+
88
+ # uiWindow
89
+
90
+ try_extern 'char *uiWindowTitle(uiWindow *w)'
91
+ try_extern 'void uiWindowSetTitle(uiWindow *w, const char *title)'
92
+ try_extern 'void uiWindowPosition(uiWindow *w, int *x, int *y)'
93
+ try_extern 'void uiWindowSetPosition(uiWindow *w, int x, int y)'
94
+ try_extern 'void uiWindowOnPositionChanged(uiWindow *w, void (*f)(uiWindow *sender, void *senderData), void *data)'
95
+ try_extern 'void uiWindowContentSize(uiWindow *w, int *width, int *height)'
96
+ try_extern 'void uiWindowSetContentSize(uiWindow *w, int width, int height)'
97
+ try_extern 'int uiWindowFullscreen(uiWindow *w)'
98
+ try_extern 'void uiWindowSetFullscreen(uiWindow *w, int fullscreen)'
99
+ try_extern 'void uiWindowOnContentSizeChanged(uiWindow *w, void (*f)(uiWindow *sender, void *senderData), void *data)'
100
+ try_extern 'void uiWindowOnClosing(uiWindow *w, int (*f)(uiWindow *sender, void *senderData), void *data)'
101
+ try_extern 'void uiWindowOnFocusChanged(uiWindow *w, void (*f)(uiWindow *sender, void *senderData), void *data)'
102
+ try_extern 'int uiWindowFocused(uiWindow *w)'
103
+ try_extern 'int uiWindowBorderless(uiWindow *w)'
104
+ try_extern 'void uiWindowSetBorderless(uiWindow *w, int borderless)'
105
+ try_extern 'void uiWindowSetChild(uiWindow *w, uiControl *child)'
106
+ try_extern 'int uiWindowMargined(uiWindow *w)'
107
+ try_extern 'void uiWindowSetMargined(uiWindow *w, int margined)'
108
+ try_extern 'int uiWindowResizeable(uiWindow *w)'
109
+ try_extern 'void uiWindowSetResizeable(uiWindow *w, int resizeable)'
110
+ try_extern 'uiWindow *uiNewWindow(const char *title, int width, int height, int hasMenubar)'
111
+
112
+ # uiButton
113
+
114
+ try_extern 'char *uiButtonText(uiButton *b)'
115
+ try_extern 'void uiButtonSetText(uiButton *b, const char *text)'
116
+ try_extern 'void uiButtonOnClicked(uiButton *b, void (*f)(uiButton *sender, void *senderData), void *data)'
117
+ try_extern 'uiButton *uiNewButton(const char *text)'
118
+
119
+ # uiBox
120
+
121
+ try_extern 'void uiBoxAppend(uiBox *b, uiControl *child, int stretchy)'
122
+ try_extern 'int uiBoxNumChildren(uiBox *b)'
123
+ try_extern 'void uiBoxDelete(uiBox *b, int index)'
124
+ try_extern 'int uiBoxPadded(uiBox *b)'
125
+ try_extern 'void uiBoxSetPadded(uiBox *b, int padded)'
126
+ try_extern 'uiBox *uiNewHorizontalBox(void)'
127
+ try_extern 'uiBox *uiNewVerticalBox(void)'
128
+
129
+ # uiCheckbox
130
+
131
+ try_extern 'char *uiCheckboxText(uiCheckbox *c)'
132
+ try_extern 'void uiCheckboxSetText(uiCheckbox *c, const char *text)'
133
+ try_extern 'void uiCheckboxOnToggled(uiCheckbox *c, void (*f)(uiCheckbox *sender, void *senderData), void *data)'
134
+ try_extern 'int uiCheckboxChecked(uiCheckbox *c)'
135
+ try_extern 'void uiCheckboxSetChecked(uiCheckbox *c, int checked)'
136
+ try_extern 'uiCheckbox *uiNewCheckbox(const char *text)'
137
+
138
+ # uiEntry
139
+
140
+ try_extern 'char *uiEntryText(uiEntry *e)'
141
+ try_extern 'void uiEntrySetText(uiEntry *e, const char *text)'
142
+ try_extern 'void uiEntryOnChanged(uiEntry *e, void (*f)(uiEntry *sender, void *senderData), void *data)'
143
+ try_extern 'int uiEntryReadOnly(uiEntry *e)'
144
+ try_extern 'void uiEntrySetReadOnly(uiEntry *e, int readonly)'
145
+ try_extern 'uiEntry *uiNewEntry(void)'
146
+ try_extern 'uiEntry *uiNewPasswordEntry(void)'
147
+ try_extern 'uiEntry *uiNewSearchEntry(void)'
148
+
149
+ # uiLabel
150
+
151
+ try_extern 'char *uiLabelText(uiLabel *l)'
152
+ try_extern 'void uiLabelSetText(uiLabel *l, const char *text)'
153
+ try_extern 'uiLabel *uiNewLabel(const char *text)'
154
+
155
+ # uiTab
156
+
157
+ try_extern 'void uiTabAppend(uiTab *t, const char *name, uiControl *c)'
158
+ try_extern 'void uiTabInsertAt(uiTab *t, const char *name, int index, uiControl *c)'
159
+ try_extern 'void uiTabDelete(uiTab *t, int index)'
160
+ try_extern 'int uiTabNumPages(uiTab *t)'
161
+ try_extern 'int uiTabMargined(uiTab *t, int index)'
162
+ try_extern 'void uiTabSetMargined(uiTab *t, int index, int margined)'
163
+ try_extern 'uiTab *uiNewTab(void)'
164
+
165
+ # uiGroup
166
+
167
+ try_extern 'char *uiGroupTitle(uiGroup *g)'
168
+ try_extern 'void uiGroupSetTitle(uiGroup *g, const char *title)'
169
+ try_extern 'void uiGroupSetChild(uiGroup *g, uiControl *c)'
170
+ try_extern 'int uiGroupMargined(uiGroup *g)'
171
+ try_extern 'void uiGroupSetMargined(uiGroup *g, int margined)'
172
+ try_extern 'uiGroup *uiNewGroup(const char *title)'
173
+
174
+ # uiSpinbox
175
+
176
+ try_extern 'int uiSpinboxValue(uiSpinbox *s)'
177
+ try_extern 'void uiSpinboxSetValue(uiSpinbox *s, int value)'
178
+ try_extern 'void uiSpinboxOnChanged(uiSpinbox *s, void (*f)(uiSpinbox *sender, void *senderData), void *data)'
179
+ try_extern 'uiSpinbox *uiNewSpinbox(int min, int max)'
180
+
181
+ # uiSlider
182
+
183
+ try_extern 'int uiSliderValue(uiSlider *s)'
184
+ try_extern 'void uiSliderSetValue(uiSlider *s, int value)'
185
+ try_extern 'int uiSliderHasToolTip(uiSlider *s)'
186
+ try_extern 'void uiSliderSetHasToolTip(uiSlider *s, int hasToolTip)'
187
+ try_extern 'void uiSliderOnChanged(uiSlider *s, void (*f)(uiSlider *sender, void *senderData), void *data)'
188
+ try_extern 'void uiSliderOnReleased(uiSlider *s, void (*f)(uiSlider *sender, void *senderData), void *data)'
189
+ try_extern 'void uiSliderSetRange(uiSlider *s, int min, int max)'
190
+ try_extern 'uiSlider *uiNewSlider(int min, int max)'
191
+
192
+ # uiProgressBar
193
+
194
+ try_extern 'int uiProgressBarValue(uiProgressBar *p)'
195
+ try_extern 'void uiProgressBarSetValue(uiProgressBar *p, int n)'
196
+ try_extern 'uiProgressBar *uiNewProgressBar(void)'
197
+
198
+ # uiSeparator
199
+
200
+ try_extern 'uiSeparator *uiNewHorizontalSeparator(void)'
201
+ try_extern 'uiSeparator *uiNewVerticalSeparator(void)'
202
+
203
+ # uiCombobox
204
+
205
+ try_extern 'void uiComboboxAppend(uiCombobox *c, const char *text)'
206
+ try_extern 'void uiComboboxInsertAt(uiCombobox *c, int index, const char *text)'
207
+ try_extern 'void uiComboboxDelete(uiCombobox *c, int index)'
208
+ try_extern 'void uiComboboxClear(uiCombobox *c)'
209
+ try_extern 'int uiComboboxNumItems(uiCombobox *c)'
210
+ try_extern 'int uiComboboxSelected(uiCombobox *c)'
211
+ try_extern 'void uiComboboxSetSelected(uiCombobox *c, int index)'
212
+ try_extern 'void uiComboboxOnSelected(uiCombobox *c, void (*f)(uiCombobox *sender, void *senderData), void *data)'
213
+ try_extern 'uiCombobox *uiNewCombobox(void)'
214
+
215
+ # uiEditableCombobox
216
+
217
+ try_extern 'void uiEditableComboboxAppend(uiEditableCombobox *c, const char *text)'
218
+ try_extern 'char *uiEditableComboboxText(uiEditableCombobox *c)'
219
+ try_extern 'void uiEditableComboboxSetText(uiEditableCombobox *c, const char *text)'
220
+ try_extern 'void uiEditableComboboxOnChanged(uiEditableCombobox *c, void (*f)(uiEditableCombobox *sender, void *senderData), void *data)'
221
+ try_extern 'uiEditableCombobox *uiNewEditableCombobox(void)'
222
+
223
+ # uiRadioButtons
224
+
225
+ try_extern 'void uiRadioButtonsAppend(uiRadioButtons *r, const char *text)'
226
+ try_extern 'int uiRadioButtonsSelected(uiRadioButtons *r)'
227
+ try_extern 'void uiRadioButtonsSetSelected(uiRadioButtons *r, int index)'
228
+ try_extern 'void uiRadioButtonsOnSelected(uiRadioButtons *r, void (*f)(uiRadioButtons *sender, void *senderData), void *data)'
229
+ try_extern 'uiRadioButtons *uiNewRadioButtons(void)'
230
+
231
+ # uiDateTimePicker
232
+
233
+ # time.h
234
+ TM = if Fiddle::WINDOWS
235
+ struct [
236
+ 'int tm_sec',
237
+ 'int tm_min',
238
+ 'int tm_hour',
239
+ 'int tm_mday',
240
+ 'int tm_mon',
241
+ 'int tm_year',
242
+ 'int tm_wday',
243
+ 'int tm_yday',
244
+ 'int tm_isdst'
245
+ ]
246
+ else # The GNU C Library (glibc)
247
+ struct [
248
+ 'int tm_sec',
249
+ 'int tm_min',
250
+ 'int tm_hour',
251
+ 'int tm_mday',
252
+ 'int tm_mon',
253
+ 'int tm_year',
254
+ 'int tm_wday',
255
+ 'int tm_yday',
256
+ 'int tm_isdst',
257
+ 'long tm_gmtoff',
258
+ 'const char *tm_zone'
259
+ ]
260
+ end
261
+
262
+ try_extern 'void uiDateTimePickerTime(uiDateTimePicker *d, struct tm *time)'
263
+ try_extern 'void uiDateTimePickerSetTime(uiDateTimePicker *d, const struct tm *time)'
264
+ try_extern 'void uiDateTimePickerOnChanged(uiDateTimePicker *d, void (*f)(uiDateTimePicker *sender, void *senderData), void *data)'
265
+ try_extern 'uiDateTimePicker *uiNewDateTimePicker(void)'
266
+ try_extern 'uiDateTimePicker *uiNewDatePicker(void)'
267
+ try_extern 'uiDateTimePicker *uiNewTimePicker(void)'
268
+
269
+ # uiMultilineEntry
270
+
271
+ try_extern 'char *uiMultilineEntryText(uiMultilineEntry *e)'
272
+ try_extern 'void uiMultilineEntrySetText(uiMultilineEntry *e, const char *text)'
273
+ try_extern 'void uiMultilineEntryAppend(uiMultilineEntry *e, const char *text)'
274
+ try_extern 'void uiMultilineEntryOnChanged(uiMultilineEntry *e, void (*f)(uiMultilineEntry *sender, void *senderData), void *data)'
275
+ try_extern 'int uiMultilineEntryReadOnly(uiMultilineEntry *e)'
276
+ try_extern 'void uiMultilineEntrySetReadOnly(uiMultilineEntry *e, int readonly)'
277
+ try_extern 'uiMultilineEntry *uiNewMultilineEntry(void)'
278
+ try_extern 'uiMultilineEntry *uiNewNonWrappingMultilineEntry(void)'
279
+
280
+ # uiMenuItem
281
+
282
+ try_extern 'void uiMenuItemEnable(uiMenuItem *m)'
283
+ try_extern 'void uiMenuItemDisable(uiMenuItem *m)'
284
+ try_extern 'void uiMenuItemOnClicked(uiMenuItem *m, void (*f)(uiMenuItem *sender, uiWindow *window, void *senderData), void *data)'
285
+ try_extern 'int uiMenuItemChecked(uiMenuItem *m)'
286
+ try_extern 'void uiMenuItemSetChecked(uiMenuItem *m, int checked)'
287
+
288
+ # uiMenu
289
+
290
+ try_extern 'uiMenuItem *uiMenuAppendItem(uiMenu *m, const char *name)'
291
+ try_extern 'uiMenuItem *uiMenuAppendCheckItem(uiMenu *m, const char *name)'
292
+ try_extern 'uiMenuItem *uiMenuAppendQuitItem(uiMenu *m)'
293
+ try_extern 'uiMenuItem *uiMenuAppendPreferencesItem(uiMenu *m)'
294
+ try_extern 'uiMenuItem *uiMenuAppendAboutItem(uiMenu *m)'
295
+ try_extern 'void uiMenuAppendSeparator(uiMenu *m)'
296
+ try_extern 'uiMenu *uiNewMenu(const char *name)'
297
+
298
+ try_extern 'char *uiOpenFile(uiWindow *parent)'
299
+ try_extern 'char *uiOpenFolder(uiWindow *parent)'
300
+ try_extern 'char *uiSaveFile(uiWindow *parent)'
301
+ try_extern 'void uiMsgBox(uiWindow *parent, const char *title, const char *description)'
302
+ try_extern 'void uiMsgBoxError(uiWindow *parent, const char *title, const char *description)'
303
+
304
+ # uiArea
305
+
306
+ AreaHandler = struct [
307
+ 'void (*Draw)(uiAreaHandler *, uiArea *, uiAreaDrawParams *)',
308
+ 'void (*MouseEvent)(uiAreaHandler *, uiArea *, uiAreaMouseEvent *)',
309
+ 'void (*MouseCrossed)(uiAreaHandler *, uiArea *, int left)',
310
+ 'void (*DragBroken)(uiAreaHandler *, uiArea *)',
311
+ 'int (*KeyEvent)(uiAreaHandler *, uiArea *, uiAreaKeyEvent *)'
312
+ ]
313
+
314
+ typealias 'uiWindowResizeEdge', 'int'
315
+
316
+ try_extern 'void uiAreaSetSize(uiArea *a, int width, int height)'
317
+ try_extern 'void uiAreaQueueRedrawAll(uiArea *a)'
318
+ try_extern 'void uiAreaScrollTo(uiArea *a, double x, double y, double width, double height)'
319
+ try_extern 'void uiAreaBeginUserWindowMove(uiArea *a)'
320
+ try_extern 'void uiAreaBeginUserWindowResize(uiArea *a, uiWindowResizeEdge edge)'
321
+ try_extern 'uiArea *uiNewArea(uiAreaHandler *ah)'
322
+ try_extern 'uiArea *uiNewScrollingArea(uiAreaHandler *ah, int width, int height)'
323
+
324
+ AreaDrawParams = struct [
325
+ 'uiDrawContext *Context',
326
+ 'double AreaWidth',
327
+ 'double AreaHeight',
328
+ 'double ClipX',
329
+ 'double ClipY',
330
+ 'double ClipWidth',
331
+ 'double ClipHeight'
332
+ ]
333
+ typealias 'uiDrawBrushType', 'int'
334
+ typealias 'uiDrawLineCap', 'int'
335
+ typealias 'uiDrawLineJoin', 'int'
336
+ typealias 'uiDrawFillMode', 'int'
337
+
338
+ DrawMatrix = struct [
339
+ 'double M11',
340
+ 'double M12',
341
+ 'double M21',
342
+ 'double M22',
343
+ 'double M31',
344
+ 'double M32'
345
+ ]
346
+
347
+ DrawBrush = struct [
348
+ 'uiDrawBrushType Type',
349
+ 'double R',
350
+ 'double G',
351
+ 'double B',
352
+ 'double A',
353
+ 'double X0',
354
+ 'double Y0',
355
+ 'double X1',
356
+ 'double Y1',
357
+ 'double OuterRadius',
358
+ 'uiDrawBrushGradientStop *Stops',
359
+ 'size_t NumStops'
360
+ ]
361
+
362
+ DrawBrushGradientStop = struct [
363
+ 'double Pos',
364
+ 'double R',
365
+ 'double G',
366
+ 'double B',
367
+ 'double A'
368
+ ]
369
+
370
+ DrawStrokeParams = struct [
371
+ 'uiDrawLineCap Cap',
372
+ 'uiDrawLineJoin Join',
373
+ 'double Thickness',
374
+ 'double MiterLimit',
375
+ 'double *Dashes',
376
+ 'size_t NumDashes',
377
+ 'double DashPhase'
378
+ ]
379
+
380
+ # uiDrawPath
381
+ try_extern 'uiDrawPath *uiDrawNewPath(uiDrawFillMode fillMode)'
382
+ try_extern 'void uiDrawFreePath(uiDrawPath *p)'
383
+ try_extern 'void uiDrawPathNewFigure(uiDrawPath *p, double x, double y)'
384
+ try_extern 'void uiDrawPathNewFigureWithArc(uiDrawPath *p, double xCenter, double yCenter, double radius, double startAngle, double sweep, int negative)'
385
+ try_extern 'void uiDrawPathLineTo(uiDrawPath *p, double x, double y)'
386
+ try_extern 'void uiDrawPathArcTo(uiDrawPath *p, double xCenter, double yCenter, double radius, double startAngle, double sweep, int negative)'
387
+ try_extern 'void uiDrawPathBezierTo(uiDrawPath *p, double c1x, double c1y, double c2x, double c2y, double endX, double endY)'
388
+ try_extern 'void uiDrawPathCloseFigure(uiDrawPath *p)'
389
+ try_extern 'void uiDrawPathAddRectangle(uiDrawPath *p, double x, double y, double width, double height)'
390
+ try_extern 'int uiDrawPathEnded(uiDrawPath *p)'
391
+ try_extern 'void uiDrawPathEnd(uiDrawPath *p)'
392
+ try_extern 'void uiDrawStroke(uiDrawContext *c, uiDrawPath *path, uiDrawBrush *b, uiDrawStrokeParams *p)'
393
+ try_extern 'void uiDrawFill(uiDrawContext *c, uiDrawPath *path, uiDrawBrush *b)'
394
+
395
+ # uiDrawMatrix
396
+ try_extern 'void uiDrawMatrixSetIdentity(uiDrawMatrix *m)'
397
+ try_extern 'void uiDrawMatrixTranslate(uiDrawMatrix *m, double x, double y)'
398
+ try_extern 'void uiDrawMatrixScale(uiDrawMatrix *m, double xCenter, double yCenter, double x, double y)'
399
+ try_extern 'void uiDrawMatrixRotate(uiDrawMatrix *m, double x, double y, double amount)'
400
+ try_extern 'void uiDrawMatrixSkew(uiDrawMatrix *m, double x, double y, double xamount, double yamount)'
401
+ try_extern 'void uiDrawMatrixMultiply(uiDrawMatrix *dest, uiDrawMatrix *src)'
402
+ try_extern 'int uiDrawMatrixInvertible(uiDrawMatrix *m)'
403
+ try_extern 'int uiDrawMatrixInvert(uiDrawMatrix *m)'
404
+ try_extern 'void uiDrawMatrixTransformPoint(uiDrawMatrix *m, double *x, double *y)'
405
+ try_extern 'void uiDrawMatrixTransformSize(uiDrawMatrix *m, double *x, double *y)'
406
+
407
+ try_extern 'void uiDrawTransform(uiDrawContext *c, uiDrawMatrix *m)'
408
+ try_extern 'void uiDrawClip(uiDrawContext *c, uiDrawPath *path)'
409
+ try_extern 'void uiDrawSave(uiDrawContext *c)'
410
+ try_extern 'void uiDrawRestore(uiDrawContext *c)'
411
+
412
+ # uiAttribute
413
+ try_extern 'void uiFreeAttribute(uiAttribute *a)'
414
+
415
+ typealias 'uiAttributeType', 'int'
416
+
417
+ try_extern 'uiAttributeType uiAttributeGetType(const uiAttribute *a)'
418
+ try_extern 'uiAttribute *uiNewFamilyAttribute(const char *family)'
419
+ try_extern 'const char *uiAttributeFamily(const uiAttribute *a)'
420
+ try_extern 'uiAttribute *uiNewSizeAttribute(double size)'
421
+ try_extern 'double uiAttributeSize(const uiAttribute *a)'
422
+
423
+ typealias 'uiTextWeight', 'int'
424
+
425
+ try_extern 'uiAttribute *uiNewWeightAttribute(uiTextWeight weight)'
426
+ try_extern 'uiTextWeight uiAttributeWeight(const uiAttribute *a)'
427
+
428
+ typealias 'uiTextItalic', 'int'
429
+
430
+ try_extern 'uiAttribute *uiNewItalicAttribute(uiTextItalic italic)'
431
+ try_extern 'uiTextItalic uiAttributeItalic(const uiAttribute *a)'
432
+
433
+ typealias 'uiTextStretch', 'int'
434
+
435
+ try_extern 'uiAttribute *uiNewStretchAttribute(uiTextStretch stretch)'
436
+ try_extern 'uiTextStretch uiAttributeStretch(const uiAttribute *a)'
437
+ try_extern 'uiAttribute *uiNewColorAttribute(double r, double g, double b, double a)'
438
+ try_extern 'void uiAttributeColor(const uiAttribute *a, double *r, double *g, double *b, double *alpha)'
439
+ try_extern 'uiAttribute *uiNewBackgroundAttribute(double r, double g, double b, double a)'
440
+
441
+ typealias 'uiUnderline', 'int'
442
+
443
+ try_extern 'uiAttribute *uiNewUnderlineAttribute(uiUnderline u)'
444
+ try_extern 'uiUnderline uiAttributeUnderline(const uiAttribute *a)'
445
+
446
+ typealias 'uiUnderlineColor', 'int'
447
+
448
+ try_extern 'uiAttribute *uiNewUnderlineColorAttribute(uiUnderlineColor u, double r, double g, double b, double a)'
449
+ try_extern 'void uiAttributeUnderlineColor(const uiAttribute *a, uiUnderlineColor *u, double *r, double *g, double *b, double *alpha)'
450
+
451
+ # uiOpenTypeFeatures
452
+
453
+ typealias 'uiOpenTypeFeaturesForEachFunc', 'void*'
454
+
455
+ try_extern 'uiOpenTypeFeatures *uiNewOpenTypeFeatures(void)'
456
+ try_extern 'void uiFreeOpenTypeFeatures(uiOpenTypeFeatures *otf)'
457
+ try_extern 'uiOpenTypeFeatures *uiOpenTypeFeaturesClone(const uiOpenTypeFeatures *otf)'
458
+ try_extern 'void uiOpenTypeFeaturesAdd(uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t value)'
459
+ try_extern 'void uiOpenTypeFeaturesRemove(uiOpenTypeFeatures *otf, char a, char b, char c, char d)'
460
+ try_extern 'int uiOpenTypeFeaturesGet(const uiOpenTypeFeatures *otf, char a, char b, char c, char d, uint32_t *value)'
461
+ try_extern 'void uiOpenTypeFeaturesForEach(const uiOpenTypeFeatures *otf, uiOpenTypeFeaturesForEachFunc f, void *data)'
462
+ try_extern 'uiAttribute *uiNewFeaturesAttribute(const uiOpenTypeFeatures *otf)'
463
+ try_extern 'const uiOpenTypeFeatures *uiAttributeFeatures(const uiAttribute *a)'
464
+
465
+ # uiAttributedString
466
+
467
+ typealias 'uiAttributedStringForEachAttributeFunc', 'void*'
468
+
469
+ try_extern 'uiAttributedString *uiNewAttributedString(const char *initialString)'
470
+ try_extern 'void uiFreeAttributedString(uiAttributedString *s)'
471
+ try_extern 'const char *uiAttributedStringString(const uiAttributedString *s)'
472
+ try_extern 'size_t uiAttributedStringLen(const uiAttributedString *s)'
473
+ try_extern 'void uiAttributedStringAppendUnattributed(uiAttributedString *s, const char *str)'
474
+ try_extern 'void uiAttributedStringInsertAtUnattributed(uiAttributedString *s, const char *str, size_t at)'
475
+ try_extern 'void uiAttributedStringDelete(uiAttributedString *s, size_t start, size_t end)'
476
+ try_extern 'void uiAttributedStringSetAttribute(uiAttributedString *s, uiAttribute *a, size_t start, size_t end)'
477
+ try_extern 'void uiAttributedStringForEachAttribute(const uiAttributedString *s, uiAttributedStringForEachAttributeFunc f, void *data)'
478
+ try_extern 'size_t uiAttributedStringNumGraphemes(uiAttributedString *s)'
479
+ try_extern 'size_t uiAttributedStringByteIndexToGrapheme(uiAttributedString *s, size_t pos)'
480
+ try_extern 'size_t uiAttributedStringGraphemeToByteIndex(uiAttributedString *s, size_t pos)'
481
+
482
+ # uiFont
483
+
484
+ FontDescriptor = struct [
485
+ 'char *Family',
486
+ 'double Size',
487
+ 'uiTextWeight Weight',
488
+ 'uiTextItalic Italic',
489
+ 'uiTextStretch Stretch'
490
+ ]
491
+
492
+ try_extern 'void uiLoadControlFont(uiFontDescriptor *f)'
493
+ try_extern 'void uiFreeFontDescriptor(uiFontDescriptor *desc)'
494
+
495
+ typealias 'uiDrawTextAlign', 'int'
496
+
497
+ DrawTextLayoutParams = struct [
498
+ 'uiAttributedString *String',
499
+ 'uiFontDescriptor *DefaultFont',
500
+ 'double Width',
501
+ 'uiDrawTextAlign Align'
502
+ ]
503
+
504
+ try_extern 'uiDrawTextLayout *uiDrawNewTextLayout(uiDrawTextLayoutParams *params)'
505
+ try_extern 'void uiDrawFreeTextLayout(uiDrawTextLayout *tl)'
506
+ try_extern 'void uiDrawText(uiDrawContext *c, uiDrawTextLayout *tl, double x, double y)'
507
+ try_extern 'void uiDrawTextLayoutExtents(uiDrawTextLayout *tl, double *width, double *height)'
508
+
509
+ # uiFontButton
510
+
511
+ try_extern 'void uiFontButtonFont(uiFontButton *b, uiFontDescriptor *desc)'
512
+ try_extern 'void uiFontButtonOnChanged(uiFontButton *b, void (*f)(uiFontButton *sender, void *senderData), void *data)'
513
+ try_extern 'uiFontButton *uiNewFontButton(void)'
514
+ try_extern 'void uiFreeFontButtonFont(uiFontDescriptor *desc)'
515
+
516
+ typealias 'uiModifiers', 'int'
517
+
518
+ AreaMouseEvent = struct [
519
+ 'double X',
520
+ 'double Y',
521
+ 'double AreaWidth',
522
+ 'double AreaHeight',
523
+ 'int Down',
524
+ 'int Up',
525
+ 'int Count',
526
+ 'uiModifiers Modifiers',
527
+ 'uint64_t Held1To64'
528
+ ]
529
+
530
+ typealias 'uiExtKey', 'int'
531
+
532
+ AreaKeyEvent = struct [
533
+ 'char Key',
534
+ 'uiExtKey ExtKey',
535
+ 'uiModifiers Modifier',
536
+ 'uiModifiers Modifiers',
537
+ 'int Up'
538
+ ]
539
+
540
+ # uiColorButton
541
+
542
+ try_extern 'void uiColorButtonColor(uiColorButton *b, double *r, double *g, double *bl, double *a)'
543
+ try_extern 'void uiColorButtonSetColor(uiColorButton *b, double r, double g, double bl, double a)'
544
+ try_extern 'void uiColorButtonOnChanged(uiColorButton *b, void (*f)(uiColorButton *sender, void *senderData), void *data)'
545
+ try_extern 'uiColorButton *uiNewColorButton(void)'
546
+
547
+ # uiForm
548
+
549
+ try_extern 'void uiFormAppend(uiForm *f, const char *label, uiControl *c, int stretchy)'
550
+ try_extern 'int uiFormNumChildren(uiForm *f)'
551
+ try_extern 'void uiFormDelete(uiForm *f, int index)'
552
+ try_extern 'int uiFormPadded(uiForm *f)'
553
+ try_extern 'void uiFormSetPadded(uiForm *f, int padded)'
554
+ try_extern 'uiForm *uiNewForm(void)'
555
+
556
+ typealias 'uiAlign', 'int'
557
+
558
+ typealias 'uiAt', 'int'
559
+
560
+ # uiGrid
561
+
562
+ try_extern 'void uiGridAppend(uiGrid *g, uiControl *c, int left, int top, int xspan, int yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign)'
563
+ try_extern 'void uiGridInsertAt(uiGrid *g, uiControl *c, uiControl *existing, uiAt at, int xspan, int yspan, int hexpand, uiAlign halign, int vexpand, uiAlign valign)'
564
+ try_extern 'int uiGridPadded(uiGrid *g)'
565
+ try_extern 'void uiGridSetPadded(uiGrid *g, int padded)'
566
+ try_extern 'uiGrid *uiNewGrid(void)'
567
+
568
+ # uiImage
569
+
570
+ try_extern 'uiImage *uiNewImage(double width, double height)'
571
+ try_extern 'void uiFreeImage(uiImage *i)'
572
+ try_extern 'void uiImageAppend(uiImage *i, void *pixels, int pixelWidth, int pixelHeight, int byteStride)'
573
+
574
+ # uiTable
575
+ try_extern 'void uiFreeTableValue(uiTableValue *v)'
576
+
577
+ typealias 'uiTableValueType', 'int'
578
+
579
+ try_extern 'uiTableValueType uiTableValueGetType(const uiTableValue *v)'
580
+ try_extern 'uiTableValue *uiNewTableValueString(const char *str)'
581
+ try_extern 'const char *uiTableValueString(const uiTableValue *v)'
582
+ try_extern 'uiTableValue *uiNewTableValueImage(uiImage *img)'
583
+ try_extern 'uiImage *uiTableValueImage(const uiTableValue *v)'
584
+ try_extern 'uiTableValue *uiNewTableValueInt(int i)'
585
+ try_extern 'int uiTableValueInt(const uiTableValue *v)'
586
+ try_extern 'uiTableValue *uiNewTableValueColor(double r, double g, double b, double a)'
587
+ try_extern 'void uiTableValueColor(const uiTableValue *v, double *r, double *g, double *b, double *a)'
588
+
589
+ TableModelHandler = struct [
590
+ 'int (*NumColumns)(uiTableModelHandler *, uiTableModel *)',
591
+ 'uiTableValueType (*ColumnType)(uiTableModelHandler *, uiTableModel *, int)',
592
+ 'int (*NumRows)(uiTableModelHandler *, uiTableModel *)',
593
+ 'uiTableValue *(*CellValue)(uiTableModelHandler *mh, uiTableModel *m, int row, int column)',
594
+ 'void (*SetCellValue)(uiTableModelHandler *, uiTableModel *, int, int, const uiTableValue *)'
595
+ ]
596
+
597
+ try_extern 'uiTableModel *uiNewTableModel(uiTableModelHandler *mh)'
598
+ try_extern 'void uiFreeTableModel(uiTableModel *m)'
599
+ try_extern 'void uiTableModelRowInserted(uiTableModel *m, int newIndex)'
600
+ try_extern 'void uiTableModelRowChanged(uiTableModel *m, int index)'
601
+ try_extern 'void uiTableModelRowDeleted(uiTableModel *m, int oldIndex)'
602
+
603
+ TableTextColumnOptionalParams = struct [
604
+ 'int ColorModelColumn'
605
+ ]
606
+
607
+ TableParams = struct [
608
+ 'uiTableModel *Model',
609
+ 'int RowBackgroundColorModelColumn'
610
+ ]
611
+
612
+ try_extern 'void uiTableAppendTextColumn(uiTable *t, const char *name, int textModelColumn, int textEditableModelColumn, uiTableTextColumnOptionalParams *textParams)'
613
+ try_extern 'void uiTableAppendImageColumn(uiTable *t, const char *name, int imageModelColumn)'
614
+ try_extern 'void uiTableAppendImageTextColumn(uiTable *t, const char *name, int imageModelColumn, int textModelColumn, int textEditableModelColumn, uiTableTextColumnOptionalParams *textParams)'
615
+ try_extern 'void uiTableAppendCheckboxColumn(uiTable *t, const char *name, int checkboxModelColumn, int checkboxEditableModelColumn)'
616
+ try_extern 'void uiTableAppendCheckboxTextColumn(uiTable *t, const char *name, int checkboxModelColumn, int checkboxEditableModelColumn, int textModelColumn, int textEditableModelColumn, uiTableTextColumnOptionalParams *textParams)'
617
+ try_extern 'void uiTableAppendProgressBarColumn(uiTable *t, const char *name, int progressModelColumn)'
618
+ try_extern 'void uiTableAppendButtonColumn(uiTable *t, const char *name, int buttonModelColumn, int buttonClickableModelColumn)'
619
+ try_extern 'int uiTableHeaderVisible(uiTable *t)'
620
+ try_extern 'void uiTableHeaderSetVisible(uiTable *t, int visible)'
621
+ try_extern 'uiTable *uiNewTable(uiTableParams *params)'
622
+ try_extern 'void uiTableOnRowClicked(uiTable *t, void (*f)(uiTable *t, int row, void *data), void *data)'
623
+ try_extern 'void uiTableOnRowDoubleClicked(uiTable *t, void (*f)(uiTable *t, int row, void *data), void *data)'
624
+
625
+ typealias 'uiSortIndicator', 'int'
626
+
627
+ try_extern 'void uiTableHeaderSetSortIndicator(uiTable *t, int column, uiSortIndicator indicator)'
628
+ try_extern 'uiSortIndicator uiTableHeaderSortIndicator(uiTable *t, int column)'
629
+ try_extern 'void uiTableHeaderOnClicked(uiTable *t, void (*f)(uiTable *sender, int column, void *senderData), void *data)'
630
+ try_extern 'int uiTableColumnWidth(uiTable *t, int column)'
631
+ try_extern 'void uiTableColumnSetWidth(uiTable *t, int column, int width)'
632
+
633
+ typealias 'uiTableSelectionMode', 'int'
634
+
635
+ try_extern 'uiTableSelectionMode uiTableGetSelectionMode(uiTable *t)'
636
+ try_extern 'void uiTableSetSelectionMode(uiTable *t, uiTableSelectionMode mode)'
637
+ try_extern 'void uiTableOnSelectionChanged(uiTable *t, void (*f)(uiTable *t, void *data), void *data)'
638
+ try_extern 'uiTableSelection* uiTableGetSelection(uiTable *t)'
639
+ try_extern 'void uiTableSetSelection(uiTable *t, uiTableSelection *sel)'
640
+ try_extern 'void uiFreeTableSelection(uiTableSelection* s)'
641
+
642
+ TableSelection = struct [
643
+ 'int NumRows',
644
+ 'int *Rows'
645
+ ]
646
+ end
647
+ end