raylib-bindings 0.1.4 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/raygui.rb CHANGED
@@ -1,743 +1,795 @@
1
- # Yet another raylib wrapper for Ruby
2
- #
3
- # * https://github.com/vaiorabbit/raylib-bindings
4
- #
5
- # [NOTICE] Autogenerated. Do not edit.
6
-
7
- require 'ffi'
8
-
9
- module Raylib
10
- extend FFI::Library
11
-
12
- # Define/Macro
13
-
14
- RAYGUI_VERSION = "3.2"
15
- SCROLLBAR_LEFT_SIDE = 0
16
- SCROLLBAR_RIGHT_SIDE = 1
17
-
18
- # Enum
19
-
20
- STATE_NORMAL = 0
21
- STATE_FOCUSED = 1
22
- STATE_PRESSED = 2
23
- STATE_DISABLED = 3
24
- TEXT_ALIGN_LEFT = 0
25
- TEXT_ALIGN_CENTER = 1
26
- TEXT_ALIGN_RIGHT = 2
27
- DEFAULT = 0
28
- LABEL = 1 # Used also for: LABELBUTTON
29
- BUTTON = 2
30
- TOGGLE = 3 # Used also for: TOGGLEGROUP
31
- SLIDER = 4 # Used also for: SLIDERBAR
32
- PROGRESSBAR = 5
33
- CHECKBOX = 6
34
- COMBOBOX = 7
35
- DROPDOWNBOX = 8
36
- TEXTBOX = 9 # Used also for: TEXTBOXMULTI
37
- VALUEBOX = 10
38
- SPINNER = 11 # Uses: BUTTON, VALUEBOX
39
- LISTVIEW = 12
40
- COLORPICKER = 13
41
- SCROLLBAR = 14
42
- STATUSBAR = 15
43
- BORDER_COLOR_NORMAL = 0
44
- BASE_COLOR_NORMAL = 1
45
- TEXT_COLOR_NORMAL = 2
46
- BORDER_COLOR_FOCUSED = 3
47
- BASE_COLOR_FOCUSED = 4
48
- TEXT_COLOR_FOCUSED = 5
49
- BORDER_COLOR_PRESSED = 6
50
- BASE_COLOR_PRESSED = 7
51
- TEXT_COLOR_PRESSED = 8
52
- BORDER_COLOR_DISABLED = 9
53
- BASE_COLOR_DISABLED = 10
54
- TEXT_COLOR_DISABLED = 11
55
- BORDER_WIDTH = 12
56
- TEXT_PADDING = 13
57
- TEXT_ALIGNMENT = 14
58
- RESERVED = 15
59
- TEXT_SIZE = 16 # Text size (glyphs max height)
60
- TEXT_SPACING = 17 # Text spacing between glyphs
61
- LINE_COLOR = 18 # Line control color
62
- BACKGROUND_COLOR = 19 # Background color
63
- GROUP_PADDING = 16 # ToggleGroup separation between toggles
64
- SLIDER_WIDTH = 16 # Slider size of internal bar
65
- SLIDER_PADDING = 17 # Slider/SliderBar internal bar padding
66
- PROGRESS_PADDING = 16 # ProgressBar internal padding
67
- ARROWS_SIZE = 16
68
- ARROWS_VISIBLE = 17
69
- SCROLL_SLIDER_PADDING = 18 # (SLIDERBAR, SLIDER_PADDING)
70
- SCROLL_SLIDER_SIZE = 19
71
- SCROLL_PADDING = 20
72
- SCROLL_SPEED = 21
73
- CHECK_PADDING = 16 # CheckBox internal check padding
74
- COMBO_BUTTON_WIDTH = 16 # ComboBox right button width
75
- COMBO_BUTTON_SPACING = 17 # ComboBox button separation
76
- ARROW_PADDING = 16 # DropdownBox arrow separation from border and items
77
- DROPDOWN_ITEMS_SPACING = 17 # DropdownBox items separation
78
- TEXT_INNER_PADDING = 16 # TextBox/TextBoxMulti/ValueBox/Spinner inner text padding
79
- TEXT_LINES_SPACING = 17 # TextBoxMulti lines separation
80
- SPIN_BUTTON_WIDTH = 16 # Spinner left/right buttons width
81
- SPIN_BUTTON_SPACING = 17 # Spinner buttons separation
82
- LIST_ITEMS_HEIGHT = 16 # ListView items height
83
- LIST_ITEMS_SPACING = 17 # ListView items separation
84
- SCROLLBAR_WIDTH = 18 # ListView scrollbar size (usually width)
85
- SCROLLBAR_SIDE = 19 # ListView scrollbar side (0-left, 1-right)
86
- COLOR_SELECTOR_SIZE = 16
87
- HUEBAR_WIDTH = 17 # ColorPicker right hue bar width
88
- HUEBAR_PADDING = 18 # ColorPicker right hue bar separation from panel
89
- HUEBAR_SELECTOR_HEIGHT = 19 # ColorPicker right hue bar selector height
90
- HUEBAR_SELECTOR_OVERFLOW = 20 # ColorPicker right hue bar selector overflow
91
- ICON_NONE = 0
92
- ICON_FOLDER_FILE_OPEN = 1
93
- ICON_FILE_SAVE_CLASSIC = 2
94
- ICON_FOLDER_OPEN = 3
95
- ICON_FOLDER_SAVE = 4
96
- ICON_FILE_OPEN = 5
97
- ICON_FILE_SAVE = 6
98
- ICON_FILE_EXPORT = 7
99
- ICON_FILE_ADD = 8
100
- ICON_FILE_DELETE = 9
101
- ICON_FILETYPE_TEXT = 10
102
- ICON_FILETYPE_AUDIO = 11
103
- ICON_FILETYPE_IMAGE = 12
104
- ICON_FILETYPE_PLAY = 13
105
- ICON_FILETYPE_VIDEO = 14
106
- ICON_FILETYPE_INFO = 15
107
- ICON_FILE_COPY = 16
108
- ICON_FILE_CUT = 17
109
- ICON_FILE_PASTE = 18
110
- ICON_CURSOR_HAND = 19
111
- ICON_CURSOR_POINTER = 20
112
- ICON_CURSOR_CLASSIC = 21
113
- ICON_PENCIL = 22
114
- ICON_PENCIL_BIG = 23
115
- ICON_BRUSH_CLASSIC = 24
116
- ICON_BRUSH_PAINTER = 25
117
- ICON_WATER_DROP = 26
118
- ICON_COLOR_PICKER = 27
119
- ICON_RUBBER = 28
120
- ICON_COLOR_BUCKET = 29
121
- ICON_TEXT_T = 30
122
- ICON_TEXT_A = 31
123
- ICON_SCALE = 32
124
- ICON_RESIZE = 33
125
- ICON_FILTER_POINT = 34
126
- ICON_FILTER_BILINEAR = 35
127
- ICON_CROP = 36
128
- ICON_CROP_ALPHA = 37
129
- ICON_SQUARE_TOGGLE = 38
130
- ICON_SYMMETRY = 39
131
- ICON_SYMMETRY_HORIZONTAL = 40
132
- ICON_SYMMETRY_VERTICAL = 41
133
- ICON_LENS = 42
134
- ICON_LENS_BIG = 43
135
- ICON_EYE_ON = 44
136
- ICON_EYE_OFF = 45
137
- ICON_FILTER_TOP = 46
138
- ICON_FILTER = 47
139
- ICON_TARGET_POINT = 48
140
- ICON_TARGET_SMALL = 49
141
- ICON_TARGET_BIG = 50
142
- ICON_TARGET_MOVE = 51
143
- ICON_CURSOR_MOVE = 52
144
- ICON_CURSOR_SCALE = 53
145
- ICON_CURSOR_SCALE_RIGHT = 54
146
- ICON_CURSOR_SCALE_LEFT = 55
147
- ICON_UNDO = 56
148
- ICON_REDO = 57
149
- ICON_REREDO = 58
150
- ICON_MUTATE = 59
151
- ICON_ROTATE = 60
152
- ICON_REPEAT = 61
153
- ICON_SHUFFLE = 62
154
- ICON_EMPTYBOX = 63
155
- ICON_TARGET = 64
156
- ICON_TARGET_SMALL_FILL = 65
157
- ICON_TARGET_BIG_FILL = 66
158
- ICON_TARGET_MOVE_FILL = 67
159
- ICON_CURSOR_MOVE_FILL = 68
160
- ICON_CURSOR_SCALE_FILL = 69
161
- ICON_CURSOR_SCALE_RIGHT_FILL = 70
162
- ICON_CURSOR_SCALE_LEFT_FILL = 71
163
- ICON_UNDO_FILL = 72
164
- ICON_REDO_FILL = 73
165
- ICON_REREDO_FILL = 74
166
- ICON_MUTATE_FILL = 75
167
- ICON_ROTATE_FILL = 76
168
- ICON_REPEAT_FILL = 77
169
- ICON_SHUFFLE_FILL = 78
170
- ICON_EMPTYBOX_SMALL = 79
171
- ICON_BOX = 80
172
- ICON_BOX_TOP = 81
173
- ICON_BOX_TOP_RIGHT = 82
174
- ICON_BOX_RIGHT = 83
175
- ICON_BOX_BOTTOM_RIGHT = 84
176
- ICON_BOX_BOTTOM = 85
177
- ICON_BOX_BOTTOM_LEFT = 86
178
- ICON_BOX_LEFT = 87
179
- ICON_BOX_TOP_LEFT = 88
180
- ICON_BOX_CENTER = 89
181
- ICON_BOX_CIRCLE_MASK = 90
182
- ICON_POT = 91
183
- ICON_ALPHA_MULTIPLY = 92
184
- ICON_ALPHA_CLEAR = 93
185
- ICON_DITHERING = 94
186
- ICON_MIPMAPS = 95
187
- ICON_BOX_GRID = 96
188
- ICON_GRID = 97
189
- ICON_BOX_CORNERS_SMALL = 98
190
- ICON_BOX_CORNERS_BIG = 99
191
- ICON_FOUR_BOXES = 100
192
- ICON_GRID_FILL = 101
193
- ICON_BOX_MULTISIZE = 102
194
- ICON_ZOOM_SMALL = 103
195
- ICON_ZOOM_MEDIUM = 104
196
- ICON_ZOOM_BIG = 105
197
- ICON_ZOOM_ALL = 106
198
- ICON_ZOOM_CENTER = 107
199
- ICON_BOX_DOTS_SMALL = 108
200
- ICON_BOX_DOTS_BIG = 109
201
- ICON_BOX_CONCENTRIC = 110
202
- ICON_BOX_GRID_BIG = 111
203
- ICON_OK_TICK = 112
204
- ICON_CROSS = 113
205
- ICON_ARROW_LEFT = 114
206
- ICON_ARROW_RIGHT = 115
207
- ICON_ARROW_DOWN = 116
208
- ICON_ARROW_UP = 117
209
- ICON_ARROW_LEFT_FILL = 118
210
- ICON_ARROW_RIGHT_FILL = 119
211
- ICON_ARROW_DOWN_FILL = 120
212
- ICON_ARROW_UP_FILL = 121
213
- ICON_AUDIO = 122
214
- ICON_FX = 123
215
- ICON_WAVE = 124
216
- ICON_WAVE_SINUS = 125
217
- ICON_WAVE_SQUARE = 126
218
- ICON_WAVE_TRIANGULAR = 127
219
- ICON_CROSS_SMALL = 128
220
- ICON_PLAYER_PREVIOUS = 129
221
- ICON_PLAYER_PLAY_BACK = 130
222
- ICON_PLAYER_PLAY = 131
223
- ICON_PLAYER_PAUSE = 132
224
- ICON_PLAYER_STOP = 133
225
- ICON_PLAYER_NEXT = 134
226
- ICON_PLAYER_RECORD = 135
227
- ICON_MAGNET = 136
228
- ICON_LOCK_CLOSE = 137
229
- ICON_LOCK_OPEN = 138
230
- ICON_CLOCK = 139
231
- ICON_TOOLS = 140
232
- ICON_GEAR = 141
233
- ICON_GEAR_BIG = 142
234
- ICON_BIN = 143
235
- ICON_HAND_POINTER = 144
236
- ICON_LASER = 145
237
- ICON_COIN = 146
238
- ICON_EXPLOSION = 147
239
- ICON_1UP = 148
240
- ICON_PLAYER = 149
241
- ICON_PLAYER_JUMP = 150
242
- ICON_KEY = 151
243
- ICON_DEMON = 152
244
- ICON_TEXT_POPUP = 153
245
- ICON_GEAR_EX = 154
246
- ICON_CRACK = 155
247
- ICON_CRACK_POINTS = 156
248
- ICON_STAR = 157
249
- ICON_DOOR = 158
250
- ICON_EXIT = 159
251
- ICON_MODE_2D = 160
252
- ICON_MODE_3D = 161
253
- ICON_CUBE = 162
254
- ICON_CUBE_FACE_TOP = 163
255
- ICON_CUBE_FACE_LEFT = 164
256
- ICON_CUBE_FACE_FRONT = 165
257
- ICON_CUBE_FACE_BOTTOM = 166
258
- ICON_CUBE_FACE_RIGHT = 167
259
- ICON_CUBE_FACE_BACK = 168
260
- ICON_CAMERA = 169
261
- ICON_SPECIAL = 170
262
- ICON_LINK_NET = 171
263
- ICON_LINK_BOXES = 172
264
- ICON_LINK_MULTI = 173
265
- ICON_LINK = 174
266
- ICON_LINK_BROKE = 175
267
- ICON_TEXT_NOTES = 176
268
- ICON_NOTEBOOK = 177
269
- ICON_SUITCASE = 178
270
- ICON_SUITCASE_ZIP = 179
271
- ICON_MAILBOX = 180
272
- ICON_MONITOR = 181
273
- ICON_PRINTER = 182
274
- ICON_PHOTO_CAMERA = 183
275
- ICON_PHOTO_CAMERA_FLASH = 184
276
- ICON_HOUSE = 185
277
- ICON_HEART = 186
278
- ICON_CORNER = 187
279
- ICON_VERTICAL_BARS = 188
280
- ICON_VERTICAL_BARS_FILL = 189
281
- ICON_LIFE_BARS = 190
282
- ICON_INFO = 191
283
- ICON_CROSSLINE = 192
284
- ICON_HELP = 193
285
- ICON_FILETYPE_ALPHA = 194
286
- ICON_FILETYPE_HOME = 195
287
- ICON_LAYERS_VISIBLE = 196
288
- ICON_LAYERS = 197
289
- ICON_WINDOW = 198
290
- ICON_HIDPI = 199
291
- ICON_FILETYPE_BINARY = 200
292
- ICON_HEX = 201
293
- ICON_SHIELD = 202
294
- ICON_FILE_NEW = 203
295
- ICON_FOLDER_ADD = 204
296
- ICON_ALARM = 205
297
- ICON_CPU = 206
298
- ICON_ROM = 207
299
- ICON_STEP_OVER = 208
300
- ICON_STEP_INTO = 209
301
- ICON_STEP_OUT = 210
302
- ICON_RESTART = 211
303
- ICON_BREAKPOINT_ON = 212
304
- ICON_BREAKPOINT_OFF = 213
305
- ICON_BURGER_MENU = 214
306
- ICON_CASE_SENSITIVE = 215
307
- ICON_REG_EXP = 216
308
- ICON_FOLDER = 217
309
- ICON_FILE = 218
310
- ICON_219 = 219
311
- ICON_220 = 220
312
- ICON_221 = 221
313
- ICON_222 = 222
314
- ICON_223 = 223
315
- ICON_224 = 224
316
- ICON_225 = 225
317
- ICON_226 = 226
318
- ICON_227 = 227
319
- ICON_228 = 228
320
- ICON_229 = 229
321
- ICON_230 = 230
322
- ICON_231 = 231
323
- ICON_232 = 232
324
- ICON_233 = 233
325
- ICON_234 = 234
326
- ICON_235 = 235
327
- ICON_236 = 236
328
- ICON_237 = 237
329
- ICON_238 = 238
330
- ICON_239 = 239
331
- ICON_240 = 240
332
- ICON_241 = 241
333
- ICON_242 = 242
334
- ICON_243 = 243
335
- ICON_244 = 244
336
- ICON_245 = 245
337
- ICON_246 = 246
338
- ICON_247 = 247
339
- ICON_248 = 248
340
- ICON_249 = 249
341
- ICON_250 = 250
342
- ICON_251 = 251
343
- ICON_252 = 252
344
- ICON_253 = 253
345
- ICON_254 = 254
346
- ICON_255 = 255
347
-
348
- # Typedef
349
-
350
- typedef :int, :GuiState
351
- typedef :int, :GuiTextAlignment
352
- typedef :int, :GuiControl
353
- typedef :int, :GuiControlProperty
354
- typedef :int, :GuiDefaultProperty
355
- typedef :int, :GuiToggleProperty
356
- typedef :int, :GuiSliderProperty
357
- typedef :int, :GuiProgressBarProperty
358
- typedef :int, :GuiScrollBarProperty
359
- typedef :int, :GuiCheckBoxProperty
360
- typedef :int, :GuiComboBoxProperty
361
- typedef :int, :GuiDropdownBoxProperty
362
- typedef :int, :GuiTextBoxProperty
363
- typedef :int, :GuiSpinnerProperty
364
- typedef :int, :GuiListViewProperty
365
- typedef :int, :GuiColorPickerProperty
366
- typedef :int, :GuiIconName
367
-
368
- # Struct
369
-
370
- # Style property
371
- class GuiStyleProp < FFI::Struct
372
- layout(
373
- :controlId, :ushort,
374
- :propertyId, :ushort,
375
- :propertyValue, :uint,
376
- )
377
- end
378
-
379
-
380
- # Function
381
-
382
- def self.setup_raygui_symbols(output_error = false)
383
- entries = [
384
-
385
- # GuiEnable : Enable gui controls (global state)
386
- # @return [void]
387
- [:GuiEnable, :GuiEnable, [], :void],
388
-
389
- # GuiDisable : Disable gui controls (global state)
390
- # @return [void]
391
- [:GuiDisable, :GuiDisable, [], :void],
392
-
393
- # GuiLock : Lock gui controls (global state)
394
- # @return [void]
395
- [:GuiLock, :GuiLock, [], :void],
396
-
397
- # GuiUnlock : Unlock gui controls (global state)
398
- # @return [void]
399
- [:GuiUnlock, :GuiUnlock, [], :void],
400
-
401
- # GuiIsLocked : Check if gui is locked (global state)
402
- # @return [bool]
403
- [:GuiIsLocked, :GuiIsLocked, [], :bool],
404
-
405
- # GuiFade : Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f
406
- # @param alpha [float]
407
- # @return [void]
408
- [:GuiFade, :GuiFade, [:float], :void],
409
-
410
- # GuiSetState : Set gui state (global state)
411
- # @param state [int]
412
- # @return [void]
413
- [:GuiSetState, :GuiSetState, [:int], :void],
414
-
415
- # GuiGetState : Get gui state (global state)
416
- # @return [int]
417
- [:GuiGetState, :GuiGetState, [], :int],
418
-
419
- # GuiSetFont : Set gui custom font (global state)
420
- # @param font [Font]
421
- # @return [void]
422
- [:GuiSetFont, :GuiSetFont, [Font.by_value], :void],
423
-
424
- # GuiGetFont : Get gui custom font (global state)
425
- # @return [Font]
426
- [:GuiGetFont, :GuiGetFont, [], Font.by_value],
427
-
428
- # GuiSetStyle : Set one style property
429
- # @param control [int]
430
- # @param property [int]
431
- # @param value [int]
432
- # @return [void]
433
- [:GuiSetStyle, :GuiSetStyle, [:int, :int, :int], :void],
434
-
435
- # GuiGetStyle : Get one style property
436
- # @param control [int]
437
- # @param property [int]
438
- # @return [int]
439
- [:GuiGetStyle, :GuiGetStyle, [:int, :int], :int],
440
-
441
- # GuiWindowBox : Window Box control, shows a window that can be closed
442
- # @param bounds [Rectangle]
443
- # @param title [const char *]
444
- # @return [bool]
445
- [:GuiWindowBox, :GuiWindowBox, [Rectangle.by_value, :pointer], :bool],
446
-
447
- # GuiGroupBox : Group Box control with text name
448
- # @param bounds [Rectangle]
449
- # @param text [const char *]
450
- # @return [void]
451
- [:GuiGroupBox, :GuiGroupBox, [Rectangle.by_value, :pointer], :void],
452
-
453
- # GuiLine : Line separator control, could contain text
454
- # @param bounds [Rectangle]
455
- # @param text [const char *]
456
- # @return [void]
457
- [:GuiLine, :GuiLine, [Rectangle.by_value, :pointer], :void],
458
-
459
- # GuiPanel : Panel control, useful to group controls
460
- # @param bounds [Rectangle]
461
- # @param text [const char *]
462
- # @return [void]
463
- [:GuiPanel, :GuiPanel, [Rectangle.by_value, :pointer], :void],
464
-
465
- # GuiTabBar : Tab Bar control, returns TAB to be closed or -1
466
- # @param bounds [Rectangle]
467
- # @param text [const char **]
468
- # @param count [int]
469
- # @param active [int *]
470
- # @return [int]
471
- [:GuiTabBar, :GuiTabBar, [Rectangle.by_value, :pointer, :int, :pointer], :int],
472
-
473
- # GuiScrollPanel : Scroll Panel control
474
- # @param bounds [Rectangle]
475
- # @param text [const char *]
476
- # @param content [Rectangle]
477
- # @param scroll [Vector2 *]
478
- # @return [Rectangle]
479
- [:GuiScrollPanel, :GuiScrollPanel, [Rectangle.by_value, :pointer, Rectangle.by_value, :pointer], Rectangle.by_value],
480
-
481
- # GuiLabel : Label control, shows text
482
- # @param bounds [Rectangle]
483
- # @param text [const char *]
484
- # @return [void]
485
- [:GuiLabel, :GuiLabel, [Rectangle.by_value, :pointer], :void],
486
-
487
- # GuiButton : Button control, returns true when clicked
488
- # @param bounds [Rectangle]
489
- # @param text [const char *]
490
- # @return [bool]
491
- [:GuiButton, :GuiButton, [Rectangle.by_value, :pointer], :bool],
492
-
493
- # GuiLabelButton : Label button control, show true when clicked
494
- # @param bounds [Rectangle]
495
- # @param text [const char *]
496
- # @return [bool]
497
- [:GuiLabelButton, :GuiLabelButton, [Rectangle.by_value, :pointer], :bool],
498
-
499
- # GuiToggle : Toggle Button control, returns true when active
500
- # @param bounds [Rectangle]
501
- # @param text [const char *]
502
- # @param active [bool]
503
- # @return [bool]
504
- [:GuiToggle, :GuiToggle, [Rectangle.by_value, :pointer, :bool], :bool],
505
-
506
- # GuiToggleGroup : Toggle Group control, returns active toggle index
507
- # @param bounds [Rectangle]
508
- # @param text [const char *]
509
- # @param active [int]
510
- # @return [int]
511
- [:GuiToggleGroup, :GuiToggleGroup, [Rectangle.by_value, :pointer, :int], :int],
512
-
513
- # GuiCheckBox : Check Box control, returns true when active
514
- # @param bounds [Rectangle]
515
- # @param text [const char *]
516
- # @param checked [bool]
517
- # @return [bool]
518
- [:GuiCheckBox, :GuiCheckBox, [Rectangle.by_value, :pointer, :bool], :bool],
519
-
520
- # GuiComboBox : Combo Box control, returns selected item index
521
- # @param bounds [Rectangle]
522
- # @param text [const char *]
523
- # @param active [int]
524
- # @return [int]
525
- [:GuiComboBox, :GuiComboBox, [Rectangle.by_value, :pointer, :int], :int],
526
-
527
- # GuiDropdownBox : Dropdown Box control, returns selected item
528
- # @param bounds [Rectangle]
529
- # @param text [const char *]
530
- # @param active [int *]
531
- # @param editMode [bool]
532
- # @return [bool]
533
- [:GuiDropdownBox, :GuiDropdownBox, [Rectangle.by_value, :pointer, :pointer, :bool], :bool],
534
-
535
- # GuiSpinner : Spinner control, returns selected value
536
- # @param bounds [Rectangle]
537
- # @param text [const char *]
538
- # @param value [int *]
539
- # @param minValue [int]
540
- # @param maxValue [int]
541
- # @param editMode [bool]
542
- # @return [bool]
543
- [:GuiSpinner, :GuiSpinner, [Rectangle.by_value, :pointer, :pointer, :int, :int, :bool], :bool],
544
-
545
- # GuiValueBox : Value Box control, updates input text with numbers
546
- # @param bounds [Rectangle]
547
- # @param text [const char *]
548
- # @param value [int *]
549
- # @param minValue [int]
550
- # @param maxValue [int]
551
- # @param editMode [bool]
552
- # @return [bool]
553
- [:GuiValueBox, :GuiValueBox, [Rectangle.by_value, :pointer, :pointer, :int, :int, :bool], :bool],
554
-
555
- # GuiTextBox : Text Box control, updates input text
556
- # @param bounds [Rectangle]
557
- # @param text [char *]
558
- # @param textSize [int]
559
- # @param editMode [bool]
560
- # @return [bool]
561
- [:GuiTextBox, :GuiTextBox, [Rectangle.by_value, :pointer, :int, :bool], :bool],
562
-
563
- # GuiTextBoxMulti : Text Box control with multiple lines
564
- # @param bounds [Rectangle]
565
- # @param text [char *]
566
- # @param textSize [int]
567
- # @param editMode [bool]
568
- # @return [bool]
569
- [:GuiTextBoxMulti, :GuiTextBoxMulti, [Rectangle.by_value, :pointer, :int, :bool], :bool],
570
-
571
- # GuiSlider : Slider control, returns selected value
572
- # @param bounds [Rectangle]
573
- # @param textLeft [const char *]
574
- # @param textRight [const char *]
575
- # @param value [float]
576
- # @param minValue [float]
577
- # @param maxValue [float]
578
- # @return [float]
579
- [:GuiSlider, :GuiSlider, [Rectangle.by_value, :pointer, :pointer, :float, :float, :float], :float],
580
-
581
- # GuiSliderBar : Slider Bar control, returns selected value
582
- # @param bounds [Rectangle]
583
- # @param textLeft [const char *]
584
- # @param textRight [const char *]
585
- # @param value [float]
586
- # @param minValue [float]
587
- # @param maxValue [float]
588
- # @return [float]
589
- [:GuiSliderBar, :GuiSliderBar, [Rectangle.by_value, :pointer, :pointer, :float, :float, :float], :float],
590
-
591
- # GuiProgressBar : Progress Bar control, shows current progress value
592
- # @param bounds [Rectangle]
593
- # @param textLeft [const char *]
594
- # @param textRight [const char *]
595
- # @param value [float]
596
- # @param minValue [float]
597
- # @param maxValue [float]
598
- # @return [float]
599
- [:GuiProgressBar, :GuiProgressBar, [Rectangle.by_value, :pointer, :pointer, :float, :float, :float], :float],
600
-
601
- # GuiStatusBar : Status Bar control, shows info text
602
- # @param bounds [Rectangle]
603
- # @param text [const char *]
604
- # @return [void]
605
- [:GuiStatusBar, :GuiStatusBar, [Rectangle.by_value, :pointer], :void],
606
-
607
- # GuiDummyRec : Dummy control for placeholders
608
- # @param bounds [Rectangle]
609
- # @param text [const char *]
610
- # @return [void]
611
- [:GuiDummyRec, :GuiDummyRec, [Rectangle.by_value, :pointer], :void],
612
-
613
- # GuiGrid : Grid control, returns mouse cell position
614
- # @param bounds [Rectangle]
615
- # @param text [const char *]
616
- # @param spacing [float]
617
- # @param subdivs [int]
618
- # @return [Vector2]
619
- [:GuiGrid, :GuiGrid, [Rectangle.by_value, :pointer, :float, :int], Vector2.by_value],
620
-
621
- # GuiListView : List View control, returns selected list item index
622
- # @param bounds [Rectangle]
623
- # @param text [const char *]
624
- # @param scrollIndex [int *]
625
- # @param active [int]
626
- # @return [int]
627
- [:GuiListView, :GuiListView, [Rectangle.by_value, :pointer, :pointer, :int], :int],
628
-
629
- # GuiListViewEx : List View with extended parameters
630
- # @param bounds [Rectangle]
631
- # @param text [const char **]
632
- # @param count [int]
633
- # @param focus [int *]
634
- # @param scrollIndex [int *]
635
- # @param active [int]
636
- # @return [int]
637
- [:GuiListViewEx, :GuiListViewEx, [Rectangle.by_value, :pointer, :int, :pointer, :pointer, :int], :int],
638
-
639
- # GuiMessageBox : Message Box control, displays a message
640
- # @param bounds [Rectangle]
641
- # @param title [const char *]
642
- # @param message [const char *]
643
- # @param buttons [const char *]
644
- # @return [int]
645
- [:GuiMessageBox, :GuiMessageBox, [Rectangle.by_value, :pointer, :pointer, :pointer], :int],
646
-
647
- # GuiTextInputBox : Text Input Box control, ask for text, supports secret
648
- # @param bounds [Rectangle]
649
- # @param title [const char *]
650
- # @param message [const char *]
651
- # @param buttons [const char *]
652
- # @param text [char *]
653
- # @param textMaxSize [int]
654
- # @param secretViewActive [int *]
655
- # @return [int]
656
- [:GuiTextInputBox, :GuiTextInputBox, [Rectangle.by_value, :pointer, :pointer, :pointer, :pointer, :int, :pointer], :int],
657
-
658
- # GuiColorPicker : Color Picker control (multiple color controls)
659
- # @param bounds [Rectangle]
660
- # @param text [const char *]
661
- # @param color [Color]
662
- # @return [Color]
663
- [:GuiColorPicker, :GuiColorPicker, [Rectangle.by_value, :pointer, Color.by_value], Color.by_value],
664
-
665
- # GuiColorPanel : Color Panel control
666
- # @param bounds [Rectangle]
667
- # @param text [const char *]
668
- # @param color [Color]
669
- # @return [Color]
670
- [:GuiColorPanel, :GuiColorPanel, [Rectangle.by_value, :pointer, Color.by_value], Color.by_value],
671
-
672
- # GuiColorBarAlpha : Color Bar Alpha control
673
- # @param bounds [Rectangle]
674
- # @param text [const char *]
675
- # @param alpha [float]
676
- # @return [float]
677
- [:GuiColorBarAlpha, :GuiColorBarAlpha, [Rectangle.by_value, :pointer, :float], :float],
678
-
679
- # GuiColorBarHue : Color Bar Hue control
680
- # @param bounds [Rectangle]
681
- # @param text [const char *]
682
- # @param value [float]
683
- # @return [float]
684
- [:GuiColorBarHue, :GuiColorBarHue, [Rectangle.by_value, :pointer, :float], :float],
685
-
686
- # GuiLoadStyle : Load style file over global style variable (.rgs)
687
- # @param fileName [const char *]
688
- # @return [void]
689
- [:GuiLoadStyle, :GuiLoadStyle, [:pointer], :void],
690
-
691
- # GuiLoadStyleDefault : Load style default over global style
692
- # @return [void]
693
- [:GuiLoadStyleDefault, :GuiLoadStyleDefault, [], :void],
694
-
695
- # GuiEnableTooltip : Enable gui tooltips (global state)
696
- # @return [void]
697
- [:GuiEnableTooltip, :GuiEnableTooltip, [], :void],
698
-
699
- # GuiDisableTooltip : Disable gui tooltips (global state)
700
- # @return [void]
701
- [:GuiDisableTooltip, :GuiDisableTooltip, [], :void],
702
-
703
- # GuiSetTooltip : Set tooltip string
704
- # @param tooltip [const char *]
705
- # @return [void]
706
- [:GuiSetTooltip, :GuiSetTooltip, [:pointer], :void],
707
-
708
- # GuiIconText : Get text with icon id prepended (if supported)
709
- # @param iconId [int]
710
- # @param text [const char *]
711
- # @return [const char *]
712
- [:GuiIconText, :GuiIconText, [:int, :pointer], :pointer],
713
-
714
- # GuiGetIcons : Get raygui icons data pointer
715
- # @return [unsigned int *]
716
- [:GuiGetIcons, :GuiGetIcons, [], :pointer],
717
-
718
- # GuiLoadIcons : Load raygui icons file (.rgi) into internal icons data
719
- # @param fileName [const char *]
720
- # @param loadIconsName [bool]
721
- # @return [char **]
722
- [:GuiLoadIcons, :GuiLoadIcons, [:pointer, :bool], :pointer],
723
-
724
- # GuiDrawIcon :
725
- # @param iconId [int]
726
- # @param posX [int]
727
- # @param posY [int]
728
- # @param pixelSize [int]
729
- # @param color [Color]
730
- # @return [void]
731
- [:GuiDrawIcon, :GuiDrawIcon, [:int, :int, :int, :int, Color.by_value], :void],
732
- ]
733
- entries.each do |entry|
734
- begin
735
- attach_function entry[0], entry[1], entry[2], entry[3]
736
- rescue FFI::NotFoundError => error
737
- $stderr.puts("[Warning] Failed to import #{entry[0]} (#{error}).") if output_error
738
- end
739
- end
740
- end
741
-
742
- end
743
-
1
+ # Yet another raylib wrapper for Ruby
2
+ #
3
+ # * https://github.com/vaiorabbit/raylib-bindings
4
+ #
5
+ # [NOTICE] Autogenerated. Do not edit.
6
+
7
+ require 'ffi'
8
+
9
+ module Raylib
10
+ extend FFI::Library
11
+
12
+ # Define/Macro
13
+
14
+ RAYGUI_VERSION = "3.2"
15
+ SCROLLBAR_LEFT_SIDE = 0
16
+ SCROLLBAR_RIGHT_SIDE = 1
17
+
18
+ # Enum
19
+
20
+ # enum GuiState
21
+ # Gui control state
22
+ STATE_NORMAL = 0
23
+ STATE_FOCUSED = 1
24
+ STATE_PRESSED = 2
25
+ STATE_DISABLED = 3
26
+
27
+ # enum GuiTextAlignment
28
+ # Gui control text alignment
29
+ TEXT_ALIGN_LEFT = 0
30
+ TEXT_ALIGN_CENTER = 1
31
+ TEXT_ALIGN_RIGHT = 2
32
+
33
+ # enum GuiControl
34
+ # Gui controls
35
+ DEFAULT = 0
36
+ LABEL = 1 # Used also for: LABELBUTTON
37
+ BUTTON = 2
38
+ TOGGLE = 3 # Used also for: TOGGLEGROUP
39
+ SLIDER = 4 # Used also for: SLIDERBAR
40
+ PROGRESSBAR = 5
41
+ CHECKBOX = 6
42
+ COMBOBOX = 7
43
+ DROPDOWNBOX = 8
44
+ TEXTBOX = 9 # Used also for: TEXTBOXMULTI
45
+ VALUEBOX = 10
46
+ SPINNER = 11 # Uses: BUTTON, VALUEBOX
47
+ LISTVIEW = 12
48
+ COLORPICKER = 13
49
+ SCROLLBAR = 14
50
+ STATUSBAR = 15
51
+
52
+ # enum GuiControlProperty
53
+ # Gui base properties for every control
54
+ BORDER_COLOR_NORMAL = 0
55
+ BASE_COLOR_NORMAL = 1
56
+ TEXT_COLOR_NORMAL = 2
57
+ BORDER_COLOR_FOCUSED = 3
58
+ BASE_COLOR_FOCUSED = 4
59
+ TEXT_COLOR_FOCUSED = 5
60
+ BORDER_COLOR_PRESSED = 6
61
+ BASE_COLOR_PRESSED = 7
62
+ TEXT_COLOR_PRESSED = 8
63
+ BORDER_COLOR_DISABLED = 9
64
+ BASE_COLOR_DISABLED = 10
65
+ TEXT_COLOR_DISABLED = 11
66
+ BORDER_WIDTH = 12
67
+ TEXT_PADDING = 13
68
+ TEXT_ALIGNMENT = 14
69
+ RESERVED = 15
70
+
71
+ # enum GuiDefaultProperty
72
+ # DEFAULT extended properties
73
+ TEXT_SIZE = 16 # Text size (glyphs max height)
74
+ TEXT_SPACING = 17 # Text spacing between glyphs
75
+ LINE_COLOR = 18 # Line control color
76
+ BACKGROUND_COLOR = 19 # Background color
77
+
78
+ # enum GuiToggleProperty
79
+ # Toggle/ToggleGroup
80
+ GROUP_PADDING = 16 # ToggleGroup separation between toggles
81
+
82
+ # enum GuiSliderProperty
83
+ # Slider/SliderBar
84
+ SLIDER_WIDTH = 16 # Slider size of internal bar
85
+ SLIDER_PADDING = 17 # Slider/SliderBar internal bar padding
86
+
87
+ # enum GuiProgressBarProperty
88
+ # ProgressBar
89
+ PROGRESS_PADDING = 16 # ProgressBar internal padding
90
+
91
+ # enum GuiScrollBarProperty
92
+ # ScrollBar
93
+ ARROWS_SIZE = 16
94
+ ARROWS_VISIBLE = 17
95
+ SCROLL_SLIDER_PADDING = 18 # (SLIDERBAR, SLIDER_PADDING)
96
+ SCROLL_SLIDER_SIZE = 19
97
+ SCROLL_PADDING = 20
98
+ SCROLL_SPEED = 21
99
+
100
+ # enum GuiCheckBoxProperty
101
+ # CheckBox
102
+ CHECK_PADDING = 16 # CheckBox internal check padding
103
+
104
+ # enum GuiComboBoxProperty
105
+ # ComboBox
106
+ COMBO_BUTTON_WIDTH = 16 # ComboBox right button width
107
+ COMBO_BUTTON_SPACING = 17 # ComboBox button separation
108
+
109
+ # enum GuiDropdownBoxProperty
110
+ # DropdownBox
111
+ ARROW_PADDING = 16 # DropdownBox arrow separation from border and items
112
+ DROPDOWN_ITEMS_SPACING = 17 # DropdownBox items separation
113
+
114
+ # enum GuiTextBoxProperty
115
+ # TextBox/TextBoxMulti/ValueBox/Spinner
116
+ TEXT_INNER_PADDING = 16 # TextBox/TextBoxMulti/ValueBox/Spinner inner text padding
117
+ TEXT_LINES_SPACING = 17 # TextBoxMulti lines separation
118
+
119
+ # enum GuiSpinnerProperty
120
+ # Spinner
121
+ SPIN_BUTTON_WIDTH = 16 # Spinner left/right buttons width
122
+ SPIN_BUTTON_SPACING = 17 # Spinner buttons separation
123
+
124
+ # enum GuiListViewProperty
125
+ # ListView
126
+ LIST_ITEMS_HEIGHT = 16 # ListView items height
127
+ LIST_ITEMS_SPACING = 17 # ListView items separation
128
+ SCROLLBAR_WIDTH = 18 # ListView scrollbar size (usually width)
129
+ SCROLLBAR_SIDE = 19 # ListView scrollbar side (0-left, 1-right)
130
+
131
+ # enum GuiColorPickerProperty
132
+ # ColorPicker
133
+ COLOR_SELECTOR_SIZE = 16
134
+ HUEBAR_WIDTH = 17 # ColorPicker right hue bar width
135
+ HUEBAR_PADDING = 18 # ColorPicker right hue bar separation from panel
136
+ HUEBAR_SELECTOR_HEIGHT = 19 # ColorPicker right hue bar selector height
137
+ HUEBAR_SELECTOR_OVERFLOW = 20 # ColorPicker right hue bar selector overflow
138
+
139
+ # enum GuiIconName
140
+ #
141
+ ICON_NONE = 0
142
+ ICON_FOLDER_FILE_OPEN = 1
143
+ ICON_FILE_SAVE_CLASSIC = 2
144
+ ICON_FOLDER_OPEN = 3
145
+ ICON_FOLDER_SAVE = 4
146
+ ICON_FILE_OPEN = 5
147
+ ICON_FILE_SAVE = 6
148
+ ICON_FILE_EXPORT = 7
149
+ ICON_FILE_ADD = 8
150
+ ICON_FILE_DELETE = 9
151
+ ICON_FILETYPE_TEXT = 10
152
+ ICON_FILETYPE_AUDIO = 11
153
+ ICON_FILETYPE_IMAGE = 12
154
+ ICON_FILETYPE_PLAY = 13
155
+ ICON_FILETYPE_VIDEO = 14
156
+ ICON_FILETYPE_INFO = 15
157
+ ICON_FILE_COPY = 16
158
+ ICON_FILE_CUT = 17
159
+ ICON_FILE_PASTE = 18
160
+ ICON_CURSOR_HAND = 19
161
+ ICON_CURSOR_POINTER = 20
162
+ ICON_CURSOR_CLASSIC = 21
163
+ ICON_PENCIL = 22
164
+ ICON_PENCIL_BIG = 23
165
+ ICON_BRUSH_CLASSIC = 24
166
+ ICON_BRUSH_PAINTER = 25
167
+ ICON_WATER_DROP = 26
168
+ ICON_COLOR_PICKER = 27
169
+ ICON_RUBBER = 28
170
+ ICON_COLOR_BUCKET = 29
171
+ ICON_TEXT_T = 30
172
+ ICON_TEXT_A = 31
173
+ ICON_SCALE = 32
174
+ ICON_RESIZE = 33
175
+ ICON_FILTER_POINT = 34
176
+ ICON_FILTER_BILINEAR = 35
177
+ ICON_CROP = 36
178
+ ICON_CROP_ALPHA = 37
179
+ ICON_SQUARE_TOGGLE = 38
180
+ ICON_SYMMETRY = 39
181
+ ICON_SYMMETRY_HORIZONTAL = 40
182
+ ICON_SYMMETRY_VERTICAL = 41
183
+ ICON_LENS = 42
184
+ ICON_LENS_BIG = 43
185
+ ICON_EYE_ON = 44
186
+ ICON_EYE_OFF = 45
187
+ ICON_FILTER_TOP = 46
188
+ ICON_FILTER = 47
189
+ ICON_TARGET_POINT = 48
190
+ ICON_TARGET_SMALL = 49
191
+ ICON_TARGET_BIG = 50
192
+ ICON_TARGET_MOVE = 51
193
+ ICON_CURSOR_MOVE = 52
194
+ ICON_CURSOR_SCALE = 53
195
+ ICON_CURSOR_SCALE_RIGHT = 54
196
+ ICON_CURSOR_SCALE_LEFT = 55
197
+ ICON_UNDO = 56
198
+ ICON_REDO = 57
199
+ ICON_REREDO = 58
200
+ ICON_MUTATE = 59
201
+ ICON_ROTATE = 60
202
+ ICON_REPEAT = 61
203
+ ICON_SHUFFLE = 62
204
+ ICON_EMPTYBOX = 63
205
+ ICON_TARGET = 64
206
+ ICON_TARGET_SMALL_FILL = 65
207
+ ICON_TARGET_BIG_FILL = 66
208
+ ICON_TARGET_MOVE_FILL = 67
209
+ ICON_CURSOR_MOVE_FILL = 68
210
+ ICON_CURSOR_SCALE_FILL = 69
211
+ ICON_CURSOR_SCALE_RIGHT_FILL = 70
212
+ ICON_CURSOR_SCALE_LEFT_FILL = 71
213
+ ICON_UNDO_FILL = 72
214
+ ICON_REDO_FILL = 73
215
+ ICON_REREDO_FILL = 74
216
+ ICON_MUTATE_FILL = 75
217
+ ICON_ROTATE_FILL = 76
218
+ ICON_REPEAT_FILL = 77
219
+ ICON_SHUFFLE_FILL = 78
220
+ ICON_EMPTYBOX_SMALL = 79
221
+ ICON_BOX = 80
222
+ ICON_BOX_TOP = 81
223
+ ICON_BOX_TOP_RIGHT = 82
224
+ ICON_BOX_RIGHT = 83
225
+ ICON_BOX_BOTTOM_RIGHT = 84
226
+ ICON_BOX_BOTTOM = 85
227
+ ICON_BOX_BOTTOM_LEFT = 86
228
+ ICON_BOX_LEFT = 87
229
+ ICON_BOX_TOP_LEFT = 88
230
+ ICON_BOX_CENTER = 89
231
+ ICON_BOX_CIRCLE_MASK = 90
232
+ ICON_POT = 91
233
+ ICON_ALPHA_MULTIPLY = 92
234
+ ICON_ALPHA_CLEAR = 93
235
+ ICON_DITHERING = 94
236
+ ICON_MIPMAPS = 95
237
+ ICON_BOX_GRID = 96
238
+ ICON_GRID = 97
239
+ ICON_BOX_CORNERS_SMALL = 98
240
+ ICON_BOX_CORNERS_BIG = 99
241
+ ICON_FOUR_BOXES = 100
242
+ ICON_GRID_FILL = 101
243
+ ICON_BOX_MULTISIZE = 102
244
+ ICON_ZOOM_SMALL = 103
245
+ ICON_ZOOM_MEDIUM = 104
246
+ ICON_ZOOM_BIG = 105
247
+ ICON_ZOOM_ALL = 106
248
+ ICON_ZOOM_CENTER = 107
249
+ ICON_BOX_DOTS_SMALL = 108
250
+ ICON_BOX_DOTS_BIG = 109
251
+ ICON_BOX_CONCENTRIC = 110
252
+ ICON_BOX_GRID_BIG = 111
253
+ ICON_OK_TICK = 112
254
+ ICON_CROSS = 113
255
+ ICON_ARROW_LEFT = 114
256
+ ICON_ARROW_RIGHT = 115
257
+ ICON_ARROW_DOWN = 116
258
+ ICON_ARROW_UP = 117
259
+ ICON_ARROW_LEFT_FILL = 118
260
+ ICON_ARROW_RIGHT_FILL = 119
261
+ ICON_ARROW_DOWN_FILL = 120
262
+ ICON_ARROW_UP_FILL = 121
263
+ ICON_AUDIO = 122
264
+ ICON_FX = 123
265
+ ICON_WAVE = 124
266
+ ICON_WAVE_SINUS = 125
267
+ ICON_WAVE_SQUARE = 126
268
+ ICON_WAVE_TRIANGULAR = 127
269
+ ICON_CROSS_SMALL = 128
270
+ ICON_PLAYER_PREVIOUS = 129
271
+ ICON_PLAYER_PLAY_BACK = 130
272
+ ICON_PLAYER_PLAY = 131
273
+ ICON_PLAYER_PAUSE = 132
274
+ ICON_PLAYER_STOP = 133
275
+ ICON_PLAYER_NEXT = 134
276
+ ICON_PLAYER_RECORD = 135
277
+ ICON_MAGNET = 136
278
+ ICON_LOCK_CLOSE = 137
279
+ ICON_LOCK_OPEN = 138
280
+ ICON_CLOCK = 139
281
+ ICON_TOOLS = 140
282
+ ICON_GEAR = 141
283
+ ICON_GEAR_BIG = 142
284
+ ICON_BIN = 143
285
+ ICON_HAND_POINTER = 144
286
+ ICON_LASER = 145
287
+ ICON_COIN = 146
288
+ ICON_EXPLOSION = 147
289
+ ICON_1UP = 148
290
+ ICON_PLAYER = 149
291
+ ICON_PLAYER_JUMP = 150
292
+ ICON_KEY = 151
293
+ ICON_DEMON = 152
294
+ ICON_TEXT_POPUP = 153
295
+ ICON_GEAR_EX = 154
296
+ ICON_CRACK = 155
297
+ ICON_CRACK_POINTS = 156
298
+ ICON_STAR = 157
299
+ ICON_DOOR = 158
300
+ ICON_EXIT = 159
301
+ ICON_MODE_2D = 160
302
+ ICON_MODE_3D = 161
303
+ ICON_CUBE = 162
304
+ ICON_CUBE_FACE_TOP = 163
305
+ ICON_CUBE_FACE_LEFT = 164
306
+ ICON_CUBE_FACE_FRONT = 165
307
+ ICON_CUBE_FACE_BOTTOM = 166
308
+ ICON_CUBE_FACE_RIGHT = 167
309
+ ICON_CUBE_FACE_BACK = 168
310
+ ICON_CAMERA = 169
311
+ ICON_SPECIAL = 170
312
+ ICON_LINK_NET = 171
313
+ ICON_LINK_BOXES = 172
314
+ ICON_LINK_MULTI = 173
315
+ ICON_LINK = 174
316
+ ICON_LINK_BROKE = 175
317
+ ICON_TEXT_NOTES = 176
318
+ ICON_NOTEBOOK = 177
319
+ ICON_SUITCASE = 178
320
+ ICON_SUITCASE_ZIP = 179
321
+ ICON_MAILBOX = 180
322
+ ICON_MONITOR = 181
323
+ ICON_PRINTER = 182
324
+ ICON_PHOTO_CAMERA = 183
325
+ ICON_PHOTO_CAMERA_FLASH = 184
326
+ ICON_HOUSE = 185
327
+ ICON_HEART = 186
328
+ ICON_CORNER = 187
329
+ ICON_VERTICAL_BARS = 188
330
+ ICON_VERTICAL_BARS_FILL = 189
331
+ ICON_LIFE_BARS = 190
332
+ ICON_INFO = 191
333
+ ICON_CROSSLINE = 192
334
+ ICON_HELP = 193
335
+ ICON_FILETYPE_ALPHA = 194
336
+ ICON_FILETYPE_HOME = 195
337
+ ICON_LAYERS_VISIBLE = 196
338
+ ICON_LAYERS = 197
339
+ ICON_WINDOW = 198
340
+ ICON_HIDPI = 199
341
+ ICON_FILETYPE_BINARY = 200
342
+ ICON_HEX = 201
343
+ ICON_SHIELD = 202
344
+ ICON_FILE_NEW = 203
345
+ ICON_FOLDER_ADD = 204
346
+ ICON_ALARM = 205
347
+ ICON_CPU = 206
348
+ ICON_ROM = 207
349
+ ICON_STEP_OVER = 208
350
+ ICON_STEP_INTO = 209
351
+ ICON_STEP_OUT = 210
352
+ ICON_RESTART = 211
353
+ ICON_BREAKPOINT_ON = 212
354
+ ICON_BREAKPOINT_OFF = 213
355
+ ICON_BURGER_MENU = 214
356
+ ICON_CASE_SENSITIVE = 215
357
+ ICON_REG_EXP = 216
358
+ ICON_FOLDER = 217
359
+ ICON_FILE = 218
360
+ ICON_219 = 219
361
+ ICON_220 = 220
362
+ ICON_221 = 221
363
+ ICON_222 = 222
364
+ ICON_223 = 223
365
+ ICON_224 = 224
366
+ ICON_225 = 225
367
+ ICON_226 = 226
368
+ ICON_227 = 227
369
+ ICON_228 = 228
370
+ ICON_229 = 229
371
+ ICON_230 = 230
372
+ ICON_231 = 231
373
+ ICON_232 = 232
374
+ ICON_233 = 233
375
+ ICON_234 = 234
376
+ ICON_235 = 235
377
+ ICON_236 = 236
378
+ ICON_237 = 237
379
+ ICON_238 = 238
380
+ ICON_239 = 239
381
+ ICON_240 = 240
382
+ ICON_241 = 241
383
+ ICON_242 = 242
384
+ ICON_243 = 243
385
+ ICON_244 = 244
386
+ ICON_245 = 245
387
+ ICON_246 = 246
388
+ ICON_247 = 247
389
+ ICON_248 = 248
390
+ ICON_249 = 249
391
+ ICON_250 = 250
392
+ ICON_251 = 251
393
+ ICON_252 = 252
394
+ ICON_253 = 253
395
+ ICON_254 = 254
396
+ ICON_255 = 255
397
+
398
+
399
+ # Typedef
400
+
401
+ typedef :int, :GuiState
402
+ typedef :int, :GuiTextAlignment
403
+ typedef :int, :GuiControl
404
+ typedef :int, :GuiControlProperty
405
+ typedef :int, :GuiDefaultProperty
406
+ typedef :int, :GuiToggleProperty
407
+ typedef :int, :GuiSliderProperty
408
+ typedef :int, :GuiProgressBarProperty
409
+ typedef :int, :GuiScrollBarProperty
410
+ typedef :int, :GuiCheckBoxProperty
411
+ typedef :int, :GuiComboBoxProperty
412
+ typedef :int, :GuiDropdownBoxProperty
413
+ typedef :int, :GuiTextBoxProperty
414
+ typedef :int, :GuiSpinnerProperty
415
+ typedef :int, :GuiListViewProperty
416
+ typedef :int, :GuiColorPickerProperty
417
+ typedef :int, :GuiIconName
418
+
419
+ # Struct
420
+
421
+ # Style property
422
+ class GuiStyleProp < FFI::Struct
423
+ layout(
424
+ :controlId, :ushort,
425
+ :propertyId, :ushort,
426
+ :propertyValue, :uint,
427
+ )
428
+ end
429
+
430
+
431
+ # Function
432
+
433
+ def self.setup_raygui_symbols
434
+ entries = [
435
+
436
+ # GuiEnable : Enable gui controls (global state)
437
+ # @return [void]
438
+ [:GuiEnable, :GuiEnable, [], :void],
439
+
440
+ # GuiDisable : Disable gui controls (global state)
441
+ # @return [void]
442
+ [:GuiDisable, :GuiDisable, [], :void],
443
+
444
+ # GuiLock : Lock gui controls (global state)
445
+ # @return [void]
446
+ [:GuiLock, :GuiLock, [], :void],
447
+
448
+ # GuiUnlock : Unlock gui controls (global state)
449
+ # @return [void]
450
+ [:GuiUnlock, :GuiUnlock, [], :void],
451
+
452
+ # GuiIsLocked : Check if gui is locked (global state)
453
+ # @return [bool]
454
+ [:GuiIsLocked, :GuiIsLocked, [], :bool],
455
+
456
+ # GuiFade : Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f
457
+ # @param alpha [float]
458
+ # @return [void]
459
+ [:GuiFade, :GuiFade, [:float], :void],
460
+
461
+ # GuiSetState : Set gui state (global state)
462
+ # @param state [int]
463
+ # @return [void]
464
+ [:GuiSetState, :GuiSetState, [:int], :void],
465
+
466
+ # GuiGetState : Get gui state (global state)
467
+ # @return [int]
468
+ [:GuiGetState, :GuiGetState, [], :int],
469
+
470
+ # GuiSetFont : Set gui custom font (global state)
471
+ # @param font [Font]
472
+ # @return [void]
473
+ [:GuiSetFont, :GuiSetFont, [Font.by_value], :void],
474
+
475
+ # GuiGetFont : Get gui custom font (global state)
476
+ # @return [Font]
477
+ [:GuiGetFont, :GuiGetFont, [], Font.by_value],
478
+
479
+ # GuiSetStyle : Set one style property
480
+ # @param control [int]
481
+ # @param property [int]
482
+ # @param value [int]
483
+ # @return [void]
484
+ [:GuiSetStyle, :GuiSetStyle, [:int, :int, :int], :void],
485
+
486
+ # GuiGetStyle : Get one style property
487
+ # @param control [int]
488
+ # @param property [int]
489
+ # @return [int]
490
+ [:GuiGetStyle, :GuiGetStyle, [:int, :int], :int],
491
+
492
+ # GuiWindowBox : Window Box control, shows a window that can be closed
493
+ # @param bounds [Rectangle]
494
+ # @param title [const char *]
495
+ # @return [bool]
496
+ [:GuiWindowBox, :GuiWindowBox, [Rectangle.by_value, :pointer], :bool],
497
+
498
+ # GuiGroupBox : Group Box control with text name
499
+ # @param bounds [Rectangle]
500
+ # @param text [const char *]
501
+ # @return [void]
502
+ [:GuiGroupBox, :GuiGroupBox, [Rectangle.by_value, :pointer], :void],
503
+
504
+ # GuiLine : Line separator control, could contain text
505
+ # @param bounds [Rectangle]
506
+ # @param text [const char *]
507
+ # @return [void]
508
+ [:GuiLine, :GuiLine, [Rectangle.by_value, :pointer], :void],
509
+
510
+ # GuiPanel : Panel control, useful to group controls
511
+ # @param bounds [Rectangle]
512
+ # @param text [const char *]
513
+ # @return [void]
514
+ [:GuiPanel, :GuiPanel, [Rectangle.by_value, :pointer], :void],
515
+
516
+ # GuiTabBar : Tab Bar control, returns TAB to be closed or -1
517
+ # @param bounds [Rectangle]
518
+ # @param text [const char **]
519
+ # @param count [int]
520
+ # @param active [int *]
521
+ # @return [int]
522
+ [:GuiTabBar, :GuiTabBar, [Rectangle.by_value, :pointer, :int, :pointer], :int],
523
+
524
+ # GuiScrollPanel : Scroll Panel control
525
+ # @param bounds [Rectangle]
526
+ # @param text [const char *]
527
+ # @param content [Rectangle]
528
+ # @param scroll [Vector2 *]
529
+ # @return [Rectangle]
530
+ [:GuiScrollPanel, :GuiScrollPanel, [Rectangle.by_value, :pointer, Rectangle.by_value, :pointer], Rectangle.by_value],
531
+
532
+ # GuiLabel : Label control, shows text
533
+ # @param bounds [Rectangle]
534
+ # @param text [const char *]
535
+ # @return [void]
536
+ [:GuiLabel, :GuiLabel, [Rectangle.by_value, :pointer], :void],
537
+
538
+ # GuiButton : Button control, returns true when clicked
539
+ # @param bounds [Rectangle]
540
+ # @param text [const char *]
541
+ # @return [bool]
542
+ [:GuiButton, :GuiButton, [Rectangle.by_value, :pointer], :bool],
543
+
544
+ # GuiLabelButton : Label button control, show true when clicked
545
+ # @param bounds [Rectangle]
546
+ # @param text [const char *]
547
+ # @return [bool]
548
+ [:GuiLabelButton, :GuiLabelButton, [Rectangle.by_value, :pointer], :bool],
549
+
550
+ # GuiToggle : Toggle Button control, returns true when active
551
+ # @param bounds [Rectangle]
552
+ # @param text [const char *]
553
+ # @param active [bool]
554
+ # @return [bool]
555
+ [:GuiToggle, :GuiToggle, [Rectangle.by_value, :pointer, :bool], :bool],
556
+
557
+ # GuiToggleGroup : Toggle Group control, returns active toggle index
558
+ # @param bounds [Rectangle]
559
+ # @param text [const char *]
560
+ # @param active [int]
561
+ # @return [int]
562
+ [:GuiToggleGroup, :GuiToggleGroup, [Rectangle.by_value, :pointer, :int], :int],
563
+
564
+ # GuiCheckBox : Check Box control, returns true when active
565
+ # @param bounds [Rectangle]
566
+ # @param text [const char *]
567
+ # @param checked [bool]
568
+ # @return [bool]
569
+ [:GuiCheckBox, :GuiCheckBox, [Rectangle.by_value, :pointer, :bool], :bool],
570
+
571
+ # GuiComboBox : Combo Box control, returns selected item index
572
+ # @param bounds [Rectangle]
573
+ # @param text [const char *]
574
+ # @param active [int]
575
+ # @return [int]
576
+ [:GuiComboBox, :GuiComboBox, [Rectangle.by_value, :pointer, :int], :int],
577
+
578
+ # GuiDropdownBox : Dropdown Box control, returns selected item
579
+ # @param bounds [Rectangle]
580
+ # @param text [const char *]
581
+ # @param active [int *]
582
+ # @param editMode [bool]
583
+ # @return [bool]
584
+ [:GuiDropdownBox, :GuiDropdownBox, [Rectangle.by_value, :pointer, :pointer, :bool], :bool],
585
+
586
+ # GuiSpinner : Spinner control, returns selected value
587
+ # @param bounds [Rectangle]
588
+ # @param text [const char *]
589
+ # @param value [int *]
590
+ # @param minValue [int]
591
+ # @param maxValue [int]
592
+ # @param editMode [bool]
593
+ # @return [bool]
594
+ [:GuiSpinner, :GuiSpinner, [Rectangle.by_value, :pointer, :pointer, :int, :int, :bool], :bool],
595
+
596
+ # GuiValueBox : Value Box control, updates input text with numbers
597
+ # @param bounds [Rectangle]
598
+ # @param text [const char *]
599
+ # @param value [int *]
600
+ # @param minValue [int]
601
+ # @param maxValue [int]
602
+ # @param editMode [bool]
603
+ # @return [bool]
604
+ [:GuiValueBox, :GuiValueBox, [Rectangle.by_value, :pointer, :pointer, :int, :int, :bool], :bool],
605
+
606
+ # GuiTextBox : Text Box control, updates input text
607
+ # @param bounds [Rectangle]
608
+ # @param text [char *]
609
+ # @param textSize [int]
610
+ # @param editMode [bool]
611
+ # @return [bool]
612
+ [:GuiTextBox, :GuiTextBox, [Rectangle.by_value, :pointer, :int, :bool], :bool],
613
+
614
+ # GuiTextBoxMulti : Text Box control with multiple lines
615
+ # @param bounds [Rectangle]
616
+ # @param text [char *]
617
+ # @param textSize [int]
618
+ # @param editMode [bool]
619
+ # @return [bool]
620
+ [:GuiTextBoxMulti, :GuiTextBoxMulti, [Rectangle.by_value, :pointer, :int, :bool], :bool],
621
+
622
+ # GuiSlider : Slider control, returns selected value
623
+ # @param bounds [Rectangle]
624
+ # @param textLeft [const char *]
625
+ # @param textRight [const char *]
626
+ # @param value [float]
627
+ # @param minValue [float]
628
+ # @param maxValue [float]
629
+ # @return [float]
630
+ [:GuiSlider, :GuiSlider, [Rectangle.by_value, :pointer, :pointer, :float, :float, :float], :float],
631
+
632
+ # GuiSliderBar : Slider Bar control, returns selected value
633
+ # @param bounds [Rectangle]
634
+ # @param textLeft [const char *]
635
+ # @param textRight [const char *]
636
+ # @param value [float]
637
+ # @param minValue [float]
638
+ # @param maxValue [float]
639
+ # @return [float]
640
+ [:GuiSliderBar, :GuiSliderBar, [Rectangle.by_value, :pointer, :pointer, :float, :float, :float], :float],
641
+
642
+ # GuiProgressBar : Progress Bar control, shows current progress value
643
+ # @param bounds [Rectangle]
644
+ # @param textLeft [const char *]
645
+ # @param textRight [const char *]
646
+ # @param value [float]
647
+ # @param minValue [float]
648
+ # @param maxValue [float]
649
+ # @return [float]
650
+ [:GuiProgressBar, :GuiProgressBar, [Rectangle.by_value, :pointer, :pointer, :float, :float, :float], :float],
651
+
652
+ # GuiStatusBar : Status Bar control, shows info text
653
+ # @param bounds [Rectangle]
654
+ # @param text [const char *]
655
+ # @return [void]
656
+ [:GuiStatusBar, :GuiStatusBar, [Rectangle.by_value, :pointer], :void],
657
+
658
+ # GuiDummyRec : Dummy control for placeholders
659
+ # @param bounds [Rectangle]
660
+ # @param text [const char *]
661
+ # @return [void]
662
+ [:GuiDummyRec, :GuiDummyRec, [Rectangle.by_value, :pointer], :void],
663
+
664
+ # GuiGrid : Grid control, returns mouse cell position
665
+ # @param bounds [Rectangle]
666
+ # @param text [const char *]
667
+ # @param spacing [float]
668
+ # @param subdivs [int]
669
+ # @return [Vector2]
670
+ [:GuiGrid, :GuiGrid, [Rectangle.by_value, :pointer, :float, :int], Vector2.by_value],
671
+
672
+ # GuiListView : List View control, returns selected list item index
673
+ # @param bounds [Rectangle]
674
+ # @param text [const char *]
675
+ # @param scrollIndex [int *]
676
+ # @param active [int]
677
+ # @return [int]
678
+ [:GuiListView, :GuiListView, [Rectangle.by_value, :pointer, :pointer, :int], :int],
679
+
680
+ # GuiListViewEx : List View with extended parameters
681
+ # @param bounds [Rectangle]
682
+ # @param text [const char **]
683
+ # @param count [int]
684
+ # @param focus [int *]
685
+ # @param scrollIndex [int *]
686
+ # @param active [int]
687
+ # @return [int]
688
+ [:GuiListViewEx, :GuiListViewEx, [Rectangle.by_value, :pointer, :int, :pointer, :pointer, :int], :int],
689
+
690
+ # GuiMessageBox : Message Box control, displays a message
691
+ # @param bounds [Rectangle]
692
+ # @param title [const char *]
693
+ # @param message [const char *]
694
+ # @param buttons [const char *]
695
+ # @return [int]
696
+ [:GuiMessageBox, :GuiMessageBox, [Rectangle.by_value, :pointer, :pointer, :pointer], :int],
697
+
698
+ # GuiTextInputBox : Text Input Box control, ask for text, supports secret
699
+ # @param bounds [Rectangle]
700
+ # @param title [const char *]
701
+ # @param message [const char *]
702
+ # @param buttons [const char *]
703
+ # @param text [char *]
704
+ # @param textMaxSize [int]
705
+ # @param secretViewActive [int *]
706
+ # @return [int]
707
+ [:GuiTextInputBox, :GuiTextInputBox, [Rectangle.by_value, :pointer, :pointer, :pointer, :pointer, :int, :pointer], :int],
708
+
709
+ # GuiColorPicker : Color Picker control (multiple color controls)
710
+ # @param bounds [Rectangle]
711
+ # @param text [const char *]
712
+ # @param color [Color]
713
+ # @return [Color]
714
+ [:GuiColorPicker, :GuiColorPicker, [Rectangle.by_value, :pointer, Color.by_value], Color.by_value],
715
+
716
+ # GuiColorPanel : Color Panel control
717
+ # @param bounds [Rectangle]
718
+ # @param text [const char *]
719
+ # @param color [Color]
720
+ # @return [Color]
721
+ [:GuiColorPanel, :GuiColorPanel, [Rectangle.by_value, :pointer, Color.by_value], Color.by_value],
722
+
723
+ # GuiColorBarAlpha : Color Bar Alpha control
724
+ # @param bounds [Rectangle]
725
+ # @param text [const char *]
726
+ # @param alpha [float]
727
+ # @return [float]
728
+ [:GuiColorBarAlpha, :GuiColorBarAlpha, [Rectangle.by_value, :pointer, :float], :float],
729
+
730
+ # GuiColorBarHue : Color Bar Hue control
731
+ # @param bounds [Rectangle]
732
+ # @param text [const char *]
733
+ # @param value [float]
734
+ # @return [float]
735
+ [:GuiColorBarHue, :GuiColorBarHue, [Rectangle.by_value, :pointer, :float], :float],
736
+
737
+ # GuiLoadStyle : Load style file over global style variable (.rgs)
738
+ # @param fileName [const char *]
739
+ # @return [void]
740
+ [:GuiLoadStyle, :GuiLoadStyle, [:pointer], :void],
741
+
742
+ # GuiLoadStyleDefault : Load style default over global style
743
+ # @return [void]
744
+ [:GuiLoadStyleDefault, :GuiLoadStyleDefault, [], :void],
745
+
746
+ # GuiEnableTooltip : Enable gui tooltips (global state)
747
+ # @return [void]
748
+ [:GuiEnableTooltip, :GuiEnableTooltip, [], :void],
749
+
750
+ # GuiDisableTooltip : Disable gui tooltips (global state)
751
+ # @return [void]
752
+ [:GuiDisableTooltip, :GuiDisableTooltip, [], :void],
753
+
754
+ # GuiSetTooltip : Set tooltip string
755
+ # @param tooltip [const char *]
756
+ # @return [void]
757
+ [:GuiSetTooltip, :GuiSetTooltip, [:pointer], :void],
758
+
759
+ # GuiIconText : Get text with icon id prepended (if supported)
760
+ # @param iconId [int]
761
+ # @param text [const char *]
762
+ # @return [const char *]
763
+ [:GuiIconText, :GuiIconText, [:int, :pointer], :pointer],
764
+
765
+ # GuiGetIcons : Get raygui icons data pointer
766
+ # @return [unsigned int *]
767
+ [:GuiGetIcons, :GuiGetIcons, [], :pointer],
768
+
769
+ # GuiLoadIcons : Load raygui icons file (.rgi) into internal icons data
770
+ # @param fileName [const char *]
771
+ # @param loadIconsName [bool]
772
+ # @return [char **]
773
+ [:GuiLoadIcons, :GuiLoadIcons, [:pointer, :bool], :pointer],
774
+
775
+ # GuiDrawIcon
776
+ # @param iconId [int]
777
+ # @param posX [int]
778
+ # @param posY [int]
779
+ # @param pixelSize [int]
780
+ # @param color [Color]
781
+ # @return [void]
782
+ [:GuiDrawIcon, :GuiDrawIcon, [:int, :int, :int, :int, Color.by_value], :void],
783
+
784
+ # GuiSetIconScale : Set icon drawing size
785
+ # @param scale [int]
786
+ # @return [void]
787
+ [:GuiSetIconScale, :GuiSetIconScale, [:int], :void],
788
+ ]
789
+ entries.each do |entry|
790
+ attach_function entry[0], entry[1], entry[2], entry[3]
791
+ rescue FFI::NotFoundError => e
792
+ warn "[Warning] Failed to import #{entry[0]} (#{e})."
793
+ end
794
+ end
795
+ end