raylib-spinel 0.1.0

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/raygui_ffi.rb ADDED
@@ -0,0 +1,714 @@
1
+ # raygui_ffi.rb — raygui bindings for Spinel AOT.
2
+ #
3
+ # raygui is compiled into lib/raygui_adapter.o (see raygui_adapter.c) and linked
4
+ # into the scenes that need it; every control is a float/pointer rl_ shim.
5
+ # Loaded by `require "raylib-spinel/raygui"`. Under CRuby the raylib-bindings
6
+ # gem already binds raygui, so that require is a no-op.
7
+
8
+ module Raylib
9
+
10
+ # Boolean -> int at the FFI boundary. A plain `flag ? 1 : 0` is only safe
11
+ # when flag is a boolean: Integer 0 is truthy in Ruby, so a caller that
12
+ # already normalised to 0/1 (or handed a C int back in) would flip to 1.
13
+ def self.int_flag(flag)
14
+ return 0 if flag == false || flag.nil? || flag == 0
15
+ 1
16
+ end
17
+ ffi_lib "raylib"
18
+ # No flags of our own: this TU includes no raylib-family header, and the
19
+ # carried C gets its include paths from [native] pkg_config in spin.toml.
20
+ # The (empty) line stays so this file keeps the same anchor shape as the
21
+ # other *_ffi.rb files (the generators splice against a
22
+ # `ffi_cflags "..."` line being present).
23
+ ffi_cflags ""
24
+
25
+ # Global state
26
+ ffi_func :rl_GuiLock, [], :void
27
+ ffi_func :rl_GuiUnlock, [], :void
28
+ ffi_func :rl_GuiEnable, [], :void
29
+ ffi_func :rl_GuiDisable, [], :void
30
+ ffi_func :rl_GuiSetAlpha, [:float], :void
31
+ ffi_func :rl_GuiSetState, [:int], :void
32
+ ffi_func :rl_GuiSetStyle, %i[int int int], :void
33
+ ffi_func :rl_GuiGetStyle, %i[int int], :int
34
+ ffi_func :rl_GuiSetFont, [:ptr], :void
35
+ ffi_func :rl_GuiLoadStyle, [:str], :void
36
+ ffi_func :rl_GuiLoadStyleDefault, [], :void
37
+
38
+ # Controls
39
+ ffi_func :rl_GuiButton, %i[float float float float str], :int
40
+ ffi_func :rl_GuiLabel, %i[float float float float str], :int
41
+ ffi_func :rl_GuiLabelButton, %i[float float float float str], :int
42
+ ffi_func :rl_GuiGroupBox, %i[float float float float str], :int
43
+ ffi_func :rl_GuiLine, %i[float float float float str], :int
44
+ ffi_func :rl_GuiPanel, %i[float float float float str], :int
45
+ ffi_func :rl_GuiStatusBar, %i[float float float float str], :int
46
+ ffi_func :rl_GuiDummyRec, %i[float float float float str], :int
47
+ ffi_func :rl_GuiCheckBox, %i[float float float float str ptr], :int
48
+ ffi_func :rl_GuiComboBox, %i[float float float float str ptr], :int
49
+ ffi_func :rl_GuiDropdownBox, %i[float float float float str ptr int], :int
50
+ ffi_func :rl_GuiSpinner, %i[float float float float str ptr int int int], :int
51
+ ffi_func :rl_GuiValueBox, %i[float float float float str ptr int int int], :int
52
+ ffi_func :rl_GuiSlider, %i[float float float float str str ptr float float], :int
53
+ ffi_func :rl_GuiSliderBar, %i[float float float float str str ptr float float], :int
54
+ ffi_func :rl_GuiProgressBar, %i[float float float float str str ptr float float], :int
55
+ ffi_func :rl_GuiWindowBox, %i[float float float float str], :int
56
+ ffi_func :rl_GuiMessageBox, %i[float float float float str str str ptr], :int
57
+ ffi_func :rl_GuiListView, %i[float float float float str ptr ptr], :int
58
+ ffi_func :rl_GuiColorPicker, %i[float float float float str ptr], :int
59
+ ffi_func :rl_GuiGrid, %i[float float float float str float int ptr], :int
60
+
61
+ # Value-returning variants (updated value read back via GetFloat/GetInt).
62
+ ffi_func :rl_GuiCheckBoxValue, %i[float float float float str int], :int
63
+ ffi_func :rl_GuiSliderBarValue, %i[float float float float str str float float float], :int
64
+ ffi_func :rl_GuiSliderValue, %i[float float float float str str float float float], :int
65
+ ffi_func :rl_GuiSpinnerValue, %i[float float float float str int int int int], :int
66
+ ffi_func :rl_GuiDropdownBoxValue, %i[float float float float str int int], :int
67
+ ffi_func :rl_GuiComboBoxValue, %i[float float float float str int], :int
68
+ ffi_func :rl_GuiListViewValue, %i[float float float float str int int], :int
69
+ ffi_func :rl_Gui_GetFloat, [], :float
70
+ ffi_func :rl_GuiToggleGroupValue, %i[float float float float str int], :int
71
+ ffi_func :rl_GuiToggleValue, %i[float float float float str int], :int
72
+ ffi_func :rl_GuiTabBarValue, %i[float float float float str int int], :int
73
+ ffi_func :rl_GuiListViewExValue, %i[float float float float str int int int int int], :int
74
+ ffi_func :rl_GuiColorBarHueValue, %i[float float float float str float], :int
75
+ ffi_func :rl_GuiToggleSliderValue, %i[float float float float str int], :int
76
+ ffi_func :rl_GuiColorBarAlphaValue, %i[float float float float str float], :int
77
+ ffi_func :rl_Gui_GetInt, [], :int
78
+ ffi_func :rl_GuiTextBoxFloat, %i[float float float float str int], :int
79
+ ffi_func :rl_GuiScrollPanel, %i[float float float float str ptr ptr ptr], :int
80
+ ffi_func :rl_GuiToggleGroup, %i[float float float float str ptr], :int
81
+ ffi_func :rl_GuiToggleSlider, %i[float float float float str ptr], :int
82
+ ffi_func :rl_GuiColorBarAlpha, %i[float float float float str ptr], :int
83
+ ffi_func :rl_GuiColorPickerSet, %i[int int int int], :void
84
+ ffi_func :rl_GuiColorPickerValue, %i[float float float float str], :int
85
+ ffi_func :rl_Gui_GetColorR, [], :int
86
+ ffi_func :rl_Gui_GetColorG, [], :int
87
+ ffi_func :rl_Gui_GetColorB, [], :int
88
+ ffi_func :rl_Gui_GetColorA, [], :int
89
+ ffi_func :rl_GuiValueBoxValue, %i[float float float float str int int int int], :int
90
+ ffi_func :rl_GuiIconText, %i[int str], :str
91
+ ffi_func :rl_GuiProgressBarValue, %i[float float float float str str float float float], :int
92
+
93
+ # Extended surface (coverage completion): global state, tooltips, metrics,
94
+ # icons, text buffers/lists and the HSV colour controls.
95
+ ffi_func :rl_GuiIsLocked, [], :int
96
+ ffi_func :rl_GuiGetState, [], :int
97
+ ffi_func :rl_GuiEnableTooltip, [], :void
98
+ ffi_func :rl_GuiDisableTooltip, [], :void
99
+ ffi_func :rl_GuiSetTooltip, [:str], :void
100
+ ffi_func :rl_GuiSetIconScale, [:int], :void
101
+ ffi_func :rl_GuiGetTextWidth, [:str], :int
102
+ ffi_func :rl_GuiGetFont, [], :ptr
103
+ ffi_func :rl_GuiGetIcons, [], :ptr
104
+ ffi_func :rl_GuiLoadIcons, %i[str int], :ptr
105
+ ffi_func :rl_GuiLoadIconsFromMemory, %i[ptr int int], :ptr
106
+ ffi_func :rl_GuiLoadStyleFromMemory, %i[ptr int], :void
107
+ ffi_func :rl_GuiDrawIcon, %i[int int int int ptr], :void
108
+ ffi_func :rl_GuiToggle, %i[float float float float str ptr], :int
109
+ ffi_func :rl_GuiValueBoxFloat, %i[float float float float str ptr ptr int], :int
110
+ ffi_func :rl_GuiColorBarHue, %i[float float float float str ptr], :int
111
+ ffi_func :rl_GuiColorPanel, %i[float float float float str ptr], :int
112
+ ffi_func :rl_GuiColorPanelHSV, %i[float float float float str ptr], :int
113
+ ffi_func :rl_GuiColorPickerHSV, %i[float float float float str ptr], :int
114
+ ffi_func :rl_GuiTextBox, %i[float float float float ptr int int], :int
115
+ ffi_func :rl_GuiTextInputBox, %i[float float float float str str ptr int str ptr ptr], :int
116
+ ffi_func :rl_GuiListViewEx, %i[float float float float str int int ptr ptr ptr], :int
117
+ ffi_func :rl_GuiTabBar, %i[float float float float str ptr ptr], :int
118
+ ffi_func :rl_GuiTabBarEx, %i[float float float float ptr int ptr ptr ptr], :int
119
+ ffi_func :rl_Gui_GetText, [], :str
120
+ ffi_func :rl_Gui_GetInt2, [], :int
121
+ ffi_func :rl_Gui_GetInt3, [], :int
122
+ ffi_func :rl_Gui_SetHsv, %i[float float float], :void
123
+ ffi_func :rl_Gui_GetHsvH, [], :float
124
+ ffi_func :rl_Gui_GetHsvS, [], :float
125
+ ffi_func :rl_Gui_GetHsvV, [], :float
126
+
127
+ # PascalCase surface (matches the gem's Gui* names).
128
+ def self.GuiLock = Raylib.rl_GuiLock
129
+ def self.GuiUnlock = Raylib.rl_GuiUnlock
130
+ def self.GuiEnable = Raylib.rl_GuiEnable
131
+ def self.GuiDisable = Raylib.rl_GuiDisable
132
+ def self.GuiSetAlpha(alpha) = Raylib.rl_GuiSetAlpha(alpha)
133
+ def self.GuiSetState(state) = Raylib.rl_GuiSetState(state)
134
+ def self.GuiSetStyle(control, property, value) = Raylib.rl_GuiSetStyle(control, property, value)
135
+ def self.GuiGetStyle(control, property) = Raylib.rl_GuiGetStyle(control, property)
136
+ def self.GuiSetFont(font) = Raylib.rl_GuiSetFont(font)
137
+ def self.GuiLoadStyle(file) = Raylib.rl_GuiLoadStyle(file)
138
+ def self.GuiLoadStyleDefault = Raylib.rl_GuiLoadStyleDefault
139
+
140
+ # raygui 4.x shapes, as the gem binds them: `Rectangle bounds` first, then
141
+ # the control's own parameters. State the control writes back (checked/
142
+ # active/value/scroll/view) is a pointer carrier: an FFI::MemoryPointer in
143
+ # gem code, an Integer address, a struct view (coerced), or nil. The value
144
+ # shims (GuiCheckBoxValue, GuiSliderBarValue, ...) below are unchanged.
145
+ def self.GuiButton(a1, a2) = Raylib.rl_GuiButton(a1.x, a1.y, a1.width, a1.height, Raylib.ptr_addr(a2))
146
+ def self.GuiLabel(a1, a2) = Raylib.rl_GuiLabel(a1.x, a1.y, a1.width, a1.height, Raylib.ptr_addr(a2))
147
+ def self.GuiLabelButton(a1, a2) = Raylib.rl_GuiLabelButton(a1.x, a1.y, a1.width, a1.height, Raylib.ptr_addr(a2))
148
+ def self.GuiGroupBox(a1, a2) = Raylib.rl_GuiGroupBox(a1.x, a1.y, a1.width, a1.height, Raylib.ptr_addr(a2))
149
+ def self.GuiLine(a1, a2) = Raylib.rl_GuiLine(a1.x, a1.y, a1.width, a1.height, Raylib.ptr_addr(a2))
150
+ def self.GuiPanel(a1, a2) = Raylib.rl_GuiPanel(a1.x, a1.y, a1.width, a1.height, Raylib.ptr_addr(a2))
151
+ def self.GuiStatusBar(a1, a2) = Raylib.rl_GuiStatusBar(a1.x, a1.y, a1.width, a1.height, Raylib.ptr_addr(a2))
152
+ def self.GuiCheckBox(a1, a2, a3) = Raylib.rl_GuiCheckBox(a1.x, a1.y, a1.width, a1.height, Raylib.ptr_addr(a2), Raylib.ptr_addr(a3))
153
+ def self.GuiComboBox(a1, a2, a3) = Raylib.rl_GuiComboBox(a1.x, a1.y, a1.width, a1.height, Raylib.ptr_addr(a2), Raylib.ptr_addr(a3))
154
+ def self.GuiDropdownBox(a1, a2, a3, a4) = Raylib.rl_GuiDropdownBox(a1.x, a1.y, a1.width, a1.height, Raylib.ptr_addr(a2), Raylib.ptr_addr(a3), Raylib.int_flag(a4))
155
+ def self.GuiSpinner(a1, a2, a3, a4, a5, a6) = Raylib.rl_GuiSpinner(a1.x, a1.y, a1.width, a1.height, Raylib.ptr_addr(a2), Raylib.ptr_addr(a3), a4, a5, Raylib.int_flag(a6))
156
+ def self.GuiValueBox(a1, a2, a3, a4, a5, a6) = Raylib.rl_GuiValueBox(a1.x, a1.y, a1.width, a1.height, Raylib.ptr_addr(a2), Raylib.ptr_addr(a3), a4, a5, Raylib.int_flag(a6))
157
+ def self.GuiSlider(a1, a2, a3, a4, a5, a6) = Raylib.rl_GuiSlider(a1.x, a1.y, a1.width, a1.height, Raylib.ptr_addr(a2), Raylib.ptr_addr(a3), Raylib.ptr_addr(a4), a5, a6)
158
+ def self.GuiSliderBar(a1, a2, a3, a4, a5, a6) = Raylib.rl_GuiSliderBar(a1.x, a1.y, a1.width, a1.height, Raylib.ptr_addr(a2), Raylib.ptr_addr(a3), Raylib.ptr_addr(a4), a5, a6)
159
+ def self.GuiProgressBar(a1, a2, a3, a4, a5, a6) = Raylib.rl_GuiProgressBar(a1.x, a1.y, a1.width, a1.height, Raylib.ptr_addr(a2), Raylib.ptr_addr(a3), Raylib.ptr_addr(a4), a5, a6)
160
+ def self.GuiWindowBox(a1, a2) = Raylib.rl_GuiWindowBox(a1.x, a1.y, a1.width, a1.height, Raylib.ptr_addr(a2))
161
+ def self.GuiMessageBox(a1, a2, a3, a4, a5) = Raylib.rl_GuiMessageBox(a1.x, a1.y, a1.width, a1.height, Raylib.ptr_addr(a2), Raylib.ptr_addr(a3), Raylib.ptr_addr(a4), Raylib.ptr_addr(a5))
162
+ def self.GuiListView(a1, a2, a3, a4) = Raylib.rl_GuiListView(a1.x, a1.y, a1.width, a1.height, Raylib.ptr_addr(a2), Raylib.ptr_addr(a3), Raylib.ptr_addr(a4))
163
+ def self.GuiColorPicker(a1, a2, a3) = Raylib.rl_GuiColorPicker(a1.x, a1.y, a1.width, a1.height, Raylib.ptr_addr(a2), Raylib.color_addr(a3))
164
+ def self.GuiGrid(a1, a2, a3, a4, a5) = Raylib.rl_GuiGrid(a1.x, a1.y, a1.width, a1.height, Raylib.ptr_addr(a2), a3, a4, Raylib.vector2_addr(a5))
165
+
166
+ # raygui 4.x shapes for the widgets converted later (pointer state written
167
+ # back); the *Value helpers below keep the scalar scene-facing form.
168
+ def self.GuiToggle(bounds, text, active) = Raylib.rl_GuiToggle(bounds.x, bounds.y, bounds.width, bounds.height, text, Raylib.ptr_addr(active))
169
+ def self.GuiToggleGroup(bounds, text, active) = Raylib.rl_GuiToggleGroup(bounds.x, bounds.y, bounds.width, bounds.height, text, Raylib.ptr_addr(active))
170
+ def self.GuiToggleSlider(bounds, text, active) = Raylib.rl_GuiToggleSlider(bounds.x, bounds.y, bounds.width, bounds.height, text, Raylib.ptr_addr(active))
171
+ def self.GuiTabBar(bounds, text, hscroll, active) = Raylib.rl_GuiTabBar(bounds.x, bounds.y, bounds.width, bounds.height, text, Raylib.ptr_addr(hscroll), Raylib.ptr_addr(active))
172
+ def self.GuiTabBarEx(bounds, text, count, hscroll, active, focus) = Raylib.rl_GuiTabBarEx(bounds.x, bounds.y, bounds.width, bounds.height, Raylib.ptr_addr(text), count, Raylib.ptr_addr(hscroll), Raylib.ptr_addr(active), Raylib.ptr_addr(focus))
173
+ def self.GuiValueBoxFloat(bounds, text, text_value, value, edit) = Raylib.rl_GuiValueBoxFloat(bounds.x, bounds.y, bounds.width, bounds.height, text, Raylib.ptr_addr(text_value), Raylib.ptr_addr(value), Raylib.int_flag(edit))
174
+ def self.GuiColorBarAlpha(bounds, text, alpha) = Raylib.rl_GuiColorBarAlpha(bounds.x, bounds.y, bounds.width, bounds.height, text, Raylib.ptr_addr(alpha))
175
+ def self.GuiColorBarHue(bounds, text, value) = Raylib.rl_GuiColorBarHue(bounds.x, bounds.y, bounds.width, bounds.height, text, Raylib.ptr_addr(value))
176
+ def self.GuiColorPickerHSV(bounds, text, color_hsv) = Raylib.rl_GuiColorPickerHSV(bounds.x, bounds.y, bounds.width, bounds.height, text, Raylib.vector3_addr(color_hsv))
177
+ def self.GuiColorPanelHSV(bounds, text, color_hsv) = Raylib.rl_GuiColorPanelHSV(bounds.x, bounds.y, bounds.width, bounds.height, text, Raylib.vector3_addr(color_hsv))
178
+ def self.GuiColorPanel(bounds, text, color) = Raylib.rl_GuiColorPanel(bounds.x, bounds.y, bounds.width, bounds.height, text, Raylib.color_addr(color))
179
+ def self.GuiListViewEx(bounds, text, count, scroll, active, focus) = Raylib.rl_GuiListViewEx(bounds.x, bounds.y, bounds.width, bounds.height, text, count, text.bytesize, Raylib.ptr_addr(scroll), Raylib.ptr_addr(active), Raylib.ptr_addr(focus))
180
+ def self.GuiDummyRec(bounds, text) = Raylib.rl_GuiDummyRec(bounds.x, bounds.y, bounds.width, bounds.height, text)
181
+
182
+ # Value-returning helpers: run the control, then read the updated value.
183
+ def self.GuiCheckBoxValue(x, y, w, h, text, checked)
184
+ r = Raylib.rl_GuiCheckBoxValue(x, y, w, h, text, Raylib.int_flag(checked))
185
+ [r, Raylib.rl_Gui_GetInt]
186
+ end
187
+ def self.GuiSliderBarValue(x, y, w, h, l, r, value, lo, hi)
188
+ res = Raylib.rl_GuiSliderBarValue(x, y, w, h, l, r, value, lo, hi)
189
+ [res, Raylib.rl_Gui_GetFloat]
190
+ end
191
+ def self.GuiSliderValue(x, y, w, h, l, r, value, lo, hi)
192
+ res = Raylib.rl_GuiSliderValue(x, y, w, h, l, r, value, lo, hi)
193
+ [res, Raylib.rl_Gui_GetFloat]
194
+ end
195
+ def self.GuiSpinnerValue(x, y, w, h, text, value, lo, hi, edit)
196
+ # `edit` is a Ruby boolean; the :int FFI slot wants 0/1 (as GuiCheckBoxValue
197
+ # does for `checked`). Handing a bare bool to an int slot is CRuby's
198
+ # TypeError "no implicit conversion of false into Integer".
199
+ res = Raylib.rl_GuiSpinnerValue(x, y, w, h, text, value, lo, hi,
200
+ Raylib.int_flag(edit))
201
+ [res, Raylib.rl_Gui_GetInt]
202
+ end
203
+ def self.GuiDropdownBoxValue(x, y, w, h, text, active, edit)
204
+ res = Raylib.rl_GuiDropdownBoxValue(x, y, w, h, text, active,
205
+ Raylib.int_flag(edit))
206
+ [res, Raylib.rl_Gui_GetInt]
207
+ end
208
+ def self.GuiComboBoxValue(x, y, w, h, text, active)
209
+ res = Raylib.rl_GuiComboBoxValue(x, y, w, h, text, active)
210
+ [res, Raylib.rl_Gui_GetInt]
211
+ end
212
+ def self.GuiListViewValue(x, y, w, h, text, scroll, active)
213
+ res = Raylib.rl_GuiListViewValue(x, y, w, h, text, scroll, active)
214
+ [res, Raylib.rl_Gui_GetInt]
215
+ end
216
+
217
+ def self.GuiTextBoxFloat(x, y, w, h, text, edit) = Raylib.rl_GuiTextBoxFloat(x, y, w, h, text, Raylib.int_flag(edit))
218
+ def self.GuiScrollPanel(bounds, text, content, scroll, view) = Raylib.rl_GuiScrollPanel(bounds.x, bounds.y, bounds.width, bounds.height, text, Raylib.rectangle_addr(content), Raylib.vector2_addr(scroll), Raylib.rectangle_addr(view))
219
+ def self.GuiIconText(icon, text) = Raylib.rl_GuiIconText(icon, text)
220
+
221
+ def self.GuiValueBoxValue(x, y, w, h, text, value, lo, hi, edit)
222
+ res = Raylib.rl_GuiValueBoxValue(x, y, w, h, text, value, lo, hi,
223
+ Raylib.int_flag(edit))
224
+ [res, Raylib.rl_Gui_GetInt]
225
+ end
226
+ def self.GuiToggleGroupValue(x, y, w, h, text, active)
227
+ res = Raylib.rl_GuiToggleGroupValue(x, y, w, h, text, active)
228
+ [res, Raylib.rl_Gui_GetInt]
229
+ end
230
+ def self.GuiToggleSliderValue(x, y, w, h, text, active)
231
+ res = Raylib.rl_GuiToggleSliderValue(x, y, w, h, text, active)
232
+ [res, Raylib.rl_Gui_GetInt]
233
+ end
234
+ def self.GuiColorBarAlphaValue(x, y, w, h, text, alpha)
235
+ res = Raylib.rl_GuiColorBarAlphaValue(x, y, w, h, text, alpha)
236
+ [res, Raylib.rl_Gui_GetFloat]
237
+ end
238
+ def self.GuiColorPickerSet(r, g, b, a) = Raylib.rl_GuiColorPickerSet(r, g, b, a)
239
+ def self.GuiColorPickerValue(x, y, w, h, text) = Raylib.rl_GuiColorPickerValue(x, y, w, h, text)
240
+ def self.GuiProgressBarValue(x, y, w, h, l, r, value, lo, hi)
241
+ res = Raylib.rl_GuiProgressBarValue(x, y, w, h, l, r, value, lo, hi)
242
+ [res, Raylib.rl_Gui_GetFloat]
243
+ end
244
+
245
+ # Extended surface (coverage completion).
246
+ def self.GuiIsLocked = Raylib.rl_GuiIsLocked != 0
247
+ def self.GuiGetState = Raylib.rl_GuiGetState
248
+ def self.GuiEnableTooltip = Raylib.rl_GuiEnableTooltip
249
+ def self.GuiDisableTooltip = Raylib.rl_GuiDisableTooltip
250
+ def self.GuiSetTooltip(text) = Raylib.rl_GuiSetTooltip(text)
251
+ def self.GuiSetIconScale(scale) = Raylib.rl_GuiSetIconScale(scale)
252
+ def self.GuiGetTextWidth(text) = Raylib.rl_GuiGetTextWidth(text)
253
+ def self.GuiGetFont = Raylib.rl_GuiGetFont
254
+ def self.GuiGetIcons = Raylib.rl_GuiGetIcons
255
+ def self.GuiLoadIcons(file_name, load_names)
256
+ Raylib.rl_GuiLoadIcons(file_name, Raylib.int_flag(load_names))
257
+ end
258
+ def self.GuiLoadIconsFromMemory(data, data_size, load_names)
259
+ Raylib.rl_GuiLoadIconsFromMemory(data, data_size, Raylib.int_flag(load_names))
260
+ end
261
+ def self.GuiLoadStyleFromMemory(data, data_size)
262
+ Raylib.rl_GuiLoadStyleFromMemory(data, data_size)
263
+ end
264
+ def self.GuiDrawIcon(icon_id, x, y, pixel_size, color)
265
+ Raylib.rl_GuiDrawIcon(icon_id, x, y, pixel_size, color)
266
+ end
267
+ def self.GuiTextBox(bounds, text, text_size, edit) = Raylib.rl_GuiTextBox(bounds.x, bounds.y, bounds.width, bounds.height, Raylib.ptr_addr(text), text_size, Raylib.int_flag(edit))
268
+ def self.GuiTextInputBox(bounds, title, message, text, text_size, btns, active, secret)
269
+ # coerce at the boundary: the delegate's parameters are untyped, and a raw
270
+ # forward lets the inference mistype the slots (B4)
271
+ Raylib.rl_GuiTextInputBox(bounds.x, bounds.y, bounds.width, bounds.height,
272
+ title.to_s, message.to_s, Raylib.ptr_addr(text),
273
+ text_size.to_i, btns.to_s,
274
+ Raylib.ptr_addr(active), Raylib.ptr_addr(secret))
275
+ end
276
+ def self.GuiGetText = Raylib.rl_Gui_GetText
277
+
278
+ # Value-returning variants (control result + updated value(s)).
279
+ def self.GuiSetColorHSV(h, s, v) = Raylib.rl_Gui_SetHsv(h, s, v)
280
+
281
+ # raygui control + style property constants (raygui 5.0)
282
+ DEFAULT = 0
283
+ LABEL = 1
284
+ BUTTON = 2
285
+ TOGGLE = 3
286
+ SLIDER = 4
287
+ PROGRESSBAR = 5
288
+ CHECKBOX = 6
289
+ COMBOBOX = 7
290
+ DROPDOWNBOX = 8
291
+ TEXTBOX = 9
292
+ VALUEBOX = 10
293
+ TABBAR = 11
294
+ LISTVIEW = 12
295
+ COLORPICKER = 13
296
+ SCROLLBAR = 14
297
+ STATUSBAR = 15
298
+
299
+ BORDER_COLOR_NORMAL = 0
300
+ BASE_COLOR_NORMAL = 1
301
+ TEXT_COLOR_NORMAL = 2
302
+ BORDER_COLOR_FOCUSED = 3
303
+ BASE_COLOR_FOCUSED = 4
304
+ TEXT_COLOR_FOCUSED = 5
305
+ BORDER_COLOR_PRESSED = 6
306
+ BASE_COLOR_PRESSED = 7
307
+ TEXT_COLOR_PRESSED = 8
308
+ BORDER_WIDTH = 12
309
+ TEXT_PADDING = 13
310
+ TEXT_ALIGNMENT = 14
311
+
312
+ TEXT_SIZE = 16
313
+ TEXT_SPACING = 17
314
+ LINE_COLOR = 18
315
+ BACKGROUND_COLOR = 19
316
+ TEXT_LINE_SPACING = 20
317
+ TEXT_ALIGNMENT_VERTICAL = 21
318
+ TEXT_WRAP_MODE = 22
319
+ RAYGUI_VERSION_MAJOR = 5
320
+ RAYGUI_VERSION_MINOR = 1
321
+ RAYGUI_VERSION_PATCH = 0
322
+ RAYGUI_VERSION = "5.1-dev"
323
+ SCROLLBAR_LEFT_SIDE = 0
324
+ SCROLLBAR_RIGHT_SIDE = 1
325
+ RESULT_NONE = 0
326
+ RESULT_PRESSED = 1
327
+ RESULT_CHANGED = 2
328
+ RESULT_TAB_CLOSE = 4
329
+ STATE_NORMAL = 0
330
+ STATE_FOCUSED = 1
331
+ STATE_PRESSED = 2
332
+ STATE_DISABLED = 3
333
+ TEXT_ALIGN_LEFT = 0
334
+ TEXT_ALIGN_CENTER = 1
335
+ TEXT_ALIGN_RIGHT = 2
336
+ TEXT_ALIGN_TOP = 0
337
+ TEXT_ALIGN_MIDDLE = 1
338
+ TEXT_ALIGN_BOTTOM = 2
339
+ TEXT_WRAP_NONE = 0
340
+ TEXT_WRAP_CHAR = 1
341
+ TEXT_WRAP_WORD = 2
342
+ BORDER_COLOR_DISABLED = 9
343
+ BASE_COLOR_DISABLED = 10
344
+ TEXT_COLOR_DISABLED = 11
345
+ BASEPROP16 = 15
346
+ EXTPROP08 = 23
347
+ GROUP_PADDING = 16
348
+ GROUP_WIDTH_FULL = 17
349
+ SLIDER_WIDTH = 16
350
+ SLIDER_PADDING = 17
351
+ PROGRESS_PADDING = 16
352
+ PROGRESS_SIDE = 17
353
+ ARROWS_SIZE = 16
354
+ ARROWS_VISIBLE = 17
355
+ SCROLL_SLIDER_PADDING = 18
356
+ SCROLL_SLIDER_SIZE = 19
357
+ SCROLL_PADDING = 20
358
+ SCROLL_SPEED = 21
359
+ CHECK_PADDING = 16
360
+ COMBO_BUTTON_WIDTH = 16
361
+ COMBO_BUTTON_SPACING = 17
362
+ ARROW_PADDING = 16
363
+ DROPDOWN_ITEMS_SPACING = 17
364
+ DROPDOWN_ARROW_HIDDEN = 18
365
+ DROPDOWN_ROLL_UP = 19
366
+ DROPDOWN_MAX_HEIGHT = 20
367
+ TEXT_READONLY = 16
368
+ SPINNER_BUTTON_WIDTH = 16
369
+ SPINNER_BUTTON_SPACING = 17
370
+ TAB_ITEMS_WIDTH = 16
371
+ TAB_CLOSE_BUTTON = 17
372
+ TAB_LINE_SIDE = 18
373
+ LIST_ITEMS_HEIGHT = 16
374
+ LIST_ITEMS_SPACING = 17
375
+ SCROLLBAR_WIDTH = 18
376
+ SCROLLBAR_SIDE = 19
377
+ LIST_ITEMS_BORDER_NORMAL = 20
378
+ LIST_ITEMS_BORDER_WIDTH = 21
379
+ COLOR_SELECTOR_SIZE = 16
380
+ HUEBAR_WIDTH = 17
381
+ HUEBAR_PADDING = 18
382
+ HUEBAR_SELECTOR_HEIGHT = 19
383
+ HUEBAR_SELECTOR_OVERFLOW = 20
384
+ ICON_NONE = 0
385
+ ICON_FOLDER_FILE_OPEN = 1
386
+ ICON_FILE_SAVE_CLASSIC = 2
387
+ ICON_FOLDER_OPEN = 3
388
+ ICON_FOLDER_SAVE = 4
389
+ ICON_FILE_OPEN = 5
390
+ ICON_FILE_SAVE = 6
391
+ ICON_FILE_EXPORT = 7
392
+ ICON_FILE_ADD = 8
393
+ ICON_FILE_DELETE = 9
394
+ ICON_FILETYPE_TEXT = 10
395
+ ICON_FILETYPE_AUDIO = 11
396
+ ICON_FILETYPE_IMAGE = 12
397
+ ICON_FILETYPE_PLAY = 13
398
+ ICON_FILETYPE_VIDEO = 14
399
+ ICON_FILETYPE_INFO = 15
400
+ ICON_FILE_COPY = 16
401
+ ICON_FILE_CUT = 17
402
+ ICON_FILE_PASTE = 18
403
+ ICON_CURSOR_HAND = 19
404
+ ICON_CURSOR_POINTER = 20
405
+ ICON_CURSOR_CLASSIC = 21
406
+ ICON_PENCIL = 22
407
+ ICON_PENCIL_BIG = 23
408
+ ICON_BRUSH_CLASSIC = 24
409
+ ICON_BRUSH_PAINTER = 25
410
+ ICON_WATER_DROP = 26
411
+ ICON_COLOR_PICKER = 27
412
+ ICON_RUBBER = 28
413
+ ICON_COLOR_BUCKET = 29
414
+ ICON_TEXT_T = 30
415
+ ICON_TEXT_A = 31
416
+ ICON_SCALE = 32
417
+ ICON_RESIZE = 33
418
+ ICON_FILTER_POINT = 34
419
+ ICON_FILTER_BILINEAR = 35
420
+ ICON_CROP = 36
421
+ ICON_CROP_ALPHA = 37
422
+ ICON_SQUARE_TOGGLE = 38
423
+ ICON_SYMMETRY = 39
424
+ ICON_SYMMETRY_HORIZONTAL = 40
425
+ ICON_SYMMETRY_VERTICAL = 41
426
+ ICON_LENS = 42
427
+ ICON_LENS_BIG = 43
428
+ ICON_EYE_ON = 44
429
+ ICON_EYE_OFF = 45
430
+ ICON_FILTER_TOP = 46
431
+ ICON_FILTER = 47
432
+ ICON_TARGET_POINT = 48
433
+ ICON_TARGET_SMALL = 49
434
+ ICON_TARGET_BIG = 50
435
+ ICON_TARGET_MOVE = 51
436
+ ICON_CURSOR_MOVE = 52
437
+ ICON_CURSOR_SCALE = 53
438
+ ICON_CURSOR_SCALE_RIGHT = 54
439
+ ICON_CURSOR_SCALE_LEFT = 55
440
+ ICON_UNDO = 56
441
+ ICON_REDO = 57
442
+ ICON_REREDO = 58
443
+ ICON_MUTATE = 59
444
+ ICON_ROTATE = 60
445
+ ICON_REPEAT = 61
446
+ ICON_SHUFFLE = 62
447
+ ICON_EMPTYBOX = 63
448
+ ICON_TARGET = 64
449
+ ICON_TARGET_SMALL_FILL = 65
450
+ ICON_TARGET_BIG_FILL = 66
451
+ ICON_TARGET_MOVE_FILL = 67
452
+ ICON_CURSOR_MOVE_FILL = 68
453
+ ICON_CURSOR_SCALE_FILL = 69
454
+ ICON_CURSOR_SCALE_RIGHT_FILL = 70
455
+ ICON_CURSOR_SCALE_LEFT_FILL = 71
456
+ ICON_UNDO_FILL = 72
457
+ ICON_REDO_FILL = 73
458
+ ICON_REREDO_FILL = 74
459
+ ICON_MUTATE_FILL = 75
460
+ ICON_ROTATE_FILL = 76
461
+ ICON_REPEAT_FILL = 77
462
+ ICON_SHUFFLE_FILL = 78
463
+ ICON_EMPTYBOX_SMALL = 79
464
+ ICON_BOX = 80
465
+ ICON_BOX_TOP = 81
466
+ ICON_BOX_TOP_RIGHT = 82
467
+ ICON_BOX_RIGHT = 83
468
+ ICON_BOX_BOTTOM_RIGHT = 84
469
+ ICON_BOX_BOTTOM = 85
470
+ ICON_BOX_BOTTOM_LEFT = 86
471
+ ICON_BOX_LEFT = 87
472
+ ICON_BOX_TOP_LEFT = 88
473
+ ICON_BOX_CENTER = 89
474
+ ICON_BOX_CIRCLE_MASK = 90
475
+ ICON_POT = 91
476
+ ICON_ALPHA_MULTIPLY = 92
477
+ ICON_ALPHA_CLEAR = 93
478
+ ICON_DITHERING = 94
479
+ ICON_MIPMAPS = 95
480
+ ICON_BOX_GRID = 96
481
+ ICON_GRID = 97
482
+ ICON_BOX_CORNERS_SMALL = 98
483
+ ICON_BOX_CORNERS_BIG = 99
484
+ ICON_FOUR_BOXES = 100
485
+ ICON_GRID_FILL = 101
486
+ ICON_BOX_MULTISIZE = 102
487
+ ICON_ZOOM_SMALL = 103
488
+ ICON_ZOOM_MEDIUM = 104
489
+ ICON_ZOOM_BIG = 105
490
+ ICON_ZOOM_ALL = 106
491
+ ICON_ZOOM_CENTER = 107
492
+ ICON_BOX_DOTS_SMALL = 108
493
+ ICON_BOX_DOTS_BIG = 109
494
+ ICON_BOX_CONCENTRIC = 110
495
+ ICON_BOX_GRID_BIG = 111
496
+ ICON_OK_TICK = 112
497
+ ICON_CROSS = 113
498
+ ICON_ARROW_LEFT = 114
499
+ ICON_ARROW_RIGHT = 115
500
+ ICON_ARROW_DOWN = 116
501
+ ICON_ARROW_UP = 117
502
+ ICON_ARROW_LEFT_FILL = 118
503
+ ICON_ARROW_RIGHT_FILL = 119
504
+ ICON_ARROW_DOWN_FILL = 120
505
+ ICON_ARROW_UP_FILL = 121
506
+ ICON_AUDIO = 122
507
+ ICON_FX = 123
508
+ ICON_WAVE = 124
509
+ ICON_WAVE_SINUS = 125
510
+ ICON_WAVE_SQUARE = 126
511
+ ICON_WAVE_TRIANGULAR = 127
512
+ ICON_CROSS_SMALL = 128
513
+ ICON_PLAYER_PREVIOUS = 129
514
+ ICON_PLAYER_PLAY_BACK = 130
515
+ ICON_PLAYER_PLAY = 131
516
+ ICON_PLAYER_PAUSE = 132
517
+ ICON_PLAYER_STOP = 133
518
+ ICON_PLAYER_NEXT = 134
519
+ ICON_PLAYER_RECORD = 135
520
+ ICON_MAGNET = 136
521
+ ICON_LOCK_CLOSE = 137
522
+ ICON_LOCK_OPEN = 138
523
+ ICON_CLOCK = 139
524
+ ICON_TOOLS = 140
525
+ ICON_GEAR = 141
526
+ ICON_GEAR_BIG = 142
527
+ ICON_BIN = 143
528
+ ICON_HAND_POINTER = 144
529
+ ICON_LASER = 145
530
+ ICON_COIN = 146
531
+ ICON_EXPLOSION = 147
532
+ ICON_1UP = 148
533
+ ICON_PLAYER = 149
534
+ ICON_PLAYER_JUMP = 150
535
+ ICON_KEY = 151
536
+ ICON_DEMON = 152
537
+ ICON_TEXT_POPUP = 153
538
+ ICON_GEAR_EX = 154
539
+ ICON_CRACK = 155
540
+ ICON_CRACK_POINTS = 156
541
+ ICON_STAR = 157
542
+ ICON_DOOR = 158
543
+ ICON_EXIT = 159
544
+ ICON_MODE_2D = 160
545
+ ICON_MODE_3D = 161
546
+ ICON_CUBE = 162
547
+ ICON_CUBE_FACE_TOP = 163
548
+ ICON_CUBE_FACE_LEFT = 164
549
+ ICON_CUBE_FACE_FRONT = 165
550
+ ICON_CUBE_FACE_BOTTOM = 166
551
+ ICON_CUBE_FACE_RIGHT = 167
552
+ ICON_CUBE_FACE_BACK = 168
553
+ ICON_CAMERA = 169
554
+ ICON_SPECIAL = 170
555
+ ICON_LINK_NET = 171
556
+ ICON_LINK_BOXES = 172
557
+ ICON_LINK_MULTI = 173
558
+ ICON_LINK = 174
559
+ ICON_LINK_BROKE = 175
560
+ ICON_TEXT_NOTES = 176
561
+ ICON_NOTEBOOK = 177
562
+ ICON_SUITCASE = 178
563
+ ICON_SUITCASE_ZIP = 179
564
+ ICON_MAILBOX = 180
565
+ ICON_MONITOR = 181
566
+ ICON_PRINTER = 182
567
+ ICON_PHOTO_CAMERA = 183
568
+ ICON_PHOTO_CAMERA_FLASH = 184
569
+ ICON_HOUSE = 185
570
+ ICON_HEART = 186
571
+ ICON_CORNER = 187
572
+ ICON_VERTICAL_BARS = 188
573
+ ICON_VERTICAL_BARS_FILL = 189
574
+ ICON_LIFE_BARS = 190
575
+ ICON_INFO = 191
576
+ ICON_CROSSLINE = 192
577
+ ICON_HELP = 193
578
+ ICON_FILETYPE_ALPHA = 194
579
+ ICON_FILETYPE_HOME = 195
580
+ ICON_LAYERS_VISIBLE = 196
581
+ ICON_LAYERS = 197
582
+ ICON_WINDOW = 198
583
+ ICON_HIDPI = 199
584
+ ICON_FILETYPE_BINARY = 200
585
+ ICON_HEX = 201
586
+ ICON_SHIELD = 202
587
+ ICON_FILE_NEW = 203
588
+ ICON_FOLDER_ADD = 204
589
+ ICON_ALARM = 205
590
+ ICON_CPU = 206
591
+ ICON_ROM = 207
592
+ ICON_STEP_OVER = 208
593
+ ICON_STEP_INTO = 209
594
+ ICON_STEP_OUT = 210
595
+ ICON_RESTART = 211
596
+ ICON_BREAKPOINT_ON = 212
597
+ ICON_BREAKPOINT_OFF = 213
598
+ ICON_BURGER_MENU = 214
599
+ ICON_CASE_SENSITIVE = 215
600
+ ICON_REG_EXP = 216
601
+ ICON_FOLDER = 217
602
+ ICON_FILE = 218
603
+ ICON_SAND_TIMER = 219
604
+ ICON_WARNING = 220
605
+ ICON_HELP_BOX = 221
606
+ ICON_INFO_BOX = 222
607
+ ICON_PRIORITY = 223
608
+ ICON_LAYERS_ISO = 224
609
+ ICON_LAYERS2 = 225
610
+ ICON_MLAYERS = 226
611
+ ICON_MAPS = 227
612
+ ICON_HOT = 228
613
+ ICON_LABEL = 229
614
+ ICON_NAME_ID = 230
615
+ ICON_SLICING = 231
616
+ ICON_MANUAL_CONTROL = 232
617
+ ICON_COLLISION = 233
618
+ ICON_CIRCLE_ADD = 234
619
+ ICON_CIRCLE_ADD_FILL = 235
620
+ ICON_CIRCLE_WARNING = 236
621
+ ICON_CIRCLE_WARNING_FILL = 237
622
+ ICON_BOX_MORE = 238
623
+ ICON_BOX_MORE_FILL = 239
624
+ ICON_BOX_MINUS = 240
625
+ ICON_BOX_MINUS_FILL = 241
626
+ ICON_UNION = 242
627
+ ICON_INTERSECTION = 243
628
+ ICON_DIFFERENCE = 244
629
+ ICON_SPHERE = 245
630
+ ICON_CYLINDER = 246
631
+ ICON_CONE = 247
632
+ ICON_ELLIPSOID = 248
633
+ ICON_CAPSULE = 249
634
+ ICON_FILETYPE_FONT = 250
635
+ ICON_FILETYPE_3D = 251
636
+ ICON_FILETYPE_CODE_XML = 252
637
+ ICON_FILETYPE_CODE_C = 253
638
+ ICON_FILETYPE_CODE_PYTHON = 254
639
+ ICON_FILETYPE_CODE_JS = 255
640
+ ICON_FILETYPE_ICON = 256
641
+
642
+ # ====== generated: snake_case aliases (MRI gem naming, tools/gen_raygui_aliases.py) ======
643
+ class << self
644
+ alias_method :gui_enable, :GuiEnable
645
+ alias_method :gui_disable, :GuiDisable
646
+ alias_method :gui_lock, :GuiLock
647
+ alias_method :gui_unlock, :GuiUnlock
648
+ alias_method :gui_set_alpha, :GuiSetAlpha
649
+ alias_method :gui_set_state, :GuiSetState
650
+ alias_method :gui_set_font, :GuiSetFont
651
+ alias_method :gui_set_style, :GuiSetStyle
652
+ alias_method :gui_get_style, :GuiGetStyle
653
+ alias_method :gui_load_style, :GuiLoadStyle
654
+ alias_method :gui_load_style_default, :GuiLoadStyleDefault
655
+ alias_method :gui_icon_text, :GuiIconText
656
+ alias_method :gui_window_box, :GuiWindowBox
657
+ alias_method :gui_group_box, :GuiGroupBox
658
+ alias_method :gui_line, :GuiLine
659
+ alias_method :gui_panel, :GuiPanel
660
+ alias_method :gui_scroll_panel, :GuiScrollPanel
661
+ alias_method :gui_label, :GuiLabel
662
+ alias_method :gui_button, :GuiButton
663
+ alias_method :gui_label_button, :GuiLabelButton
664
+ alias_method :gui_check_box, :GuiCheckBox
665
+ alias_method :gui_combo_box, :GuiComboBox
666
+ alias_method :gui_dropdown_box, :GuiDropdownBox
667
+ alias_method :gui_spinner, :GuiSpinner
668
+ alias_method :gui_value_box, :GuiValueBox
669
+ alias_method :gui_slider, :GuiSlider
670
+ alias_method :gui_slider_bar, :GuiSliderBar
671
+ alias_method :gui_progress_bar, :GuiProgressBar
672
+ alias_method :gui_status_bar, :GuiStatusBar
673
+ alias_method :gui_grid, :GuiGrid
674
+ alias_method :gui_list_view, :GuiListView
675
+ alias_method :gui_message_box, :GuiMessageBox
676
+ alias_method :gui_color_picker, :GuiColorPicker
677
+ end
678
+
679
+ # ====== generated: snake_case aliases (MRI gem naming, tools/gen_raygui_aliases.py) ======
680
+ class << self
681
+ alias_method :gui_is_locked, :GuiIsLocked
682
+ alias_method :gui_get_state, :GuiGetState
683
+ alias_method :gui_get_font, :GuiGetFont
684
+ alias_method :gui_load_style_from_memory, :GuiLoadStyleFromMemory
685
+ alias_method :gui_enable_tooltip, :GuiEnableTooltip
686
+ alias_method :gui_disable_tooltip, :GuiDisableTooltip
687
+ alias_method :gui_set_tooltip, :GuiSetTooltip
688
+ alias_method :gui_set_icon_scale, :GuiSetIconScale
689
+ alias_method :gui_get_icons, :GuiGetIcons
690
+ alias_method :gui_load_icons, :GuiLoadIcons
691
+ alias_method :gui_load_icons_from_memory, :GuiLoadIconsFromMemory
692
+ alias_method :gui_draw_icon, :GuiDrawIcon
693
+ alias_method :gui_get_text_width, :GuiGetTextWidth
694
+ alias_method :gui_toggle, :GuiToggle
695
+ alias_method :gui_value_box_float, :GuiValueBoxFloat
696
+ alias_method :gui_text_box, :GuiTextBox
697
+ alias_method :gui_list_view_ex, :GuiListViewEx
698
+ alias_method :gui_tab_bar, :GuiTabBar
699
+ alias_method :gui_tab_bar_ex, :GuiTabBarEx
700
+ alias_method :gui_text_input_box, :GuiTextInputBox
701
+ alias_method :gui_color_panel, :GuiColorPanel
702
+ alias_method :gui_color_bar_hue, :GuiColorBarHue
703
+ alias_method :gui_color_picker_hsv, :GuiColorPickerHSV
704
+ alias_method :gui_color_panel_hsv, :GuiColorPanelHSV
705
+ end
706
+
707
+ # ====== generated: snake_case aliases (MRI gem naming, tools/gen_raygui_aliases.py) ======
708
+ class << self
709
+ alias_method :gui_toggle_group, :GuiToggleGroup
710
+ alias_method :gui_toggle_slider, :GuiToggleSlider
711
+ alias_method :gui_dummy_rec, :GuiDummyRec
712
+ alias_method :gui_color_bar_alpha, :GuiColorBarAlpha
713
+ end
714
+ end