libui 0.1.0.pre.0-x64-mingw

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