1 module bindbc.raylib.bind.gui;
2 
3 import bindbc.raylib.types;
4 
5 version (BindRaylib_Static) {
6    extern (C) @nogc nothrow {
7       // TODO:
8    }
9 } else {
10    extern (C) @nogc nothrow {
11       // Global gui modification functions
12       /**
13        * Enable gui controls (global state)
14        */
15       alias pGuiEnable = void function();
16       /**
17        * Disable gui controls (global state)
18        */
19       alias pGuiDisable = void function();
20       /**
21        * Lock gui controls (global state)
22        */
23       alias pGuiLock = void function();
24       /**
25        * Unlock gui controls (global state)
26        */
27       alias pGuiUnlock = void function();
28       /**
29        * Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f
30        */
31       alias pGuiFade = void function(float alpha);
32 
33       /**
34        * Set gui state (global state)
35        */
36       alias pGuiSetState = void function(int state);
37       /**
38        * Get gui state (global state)
39        */
40       alias pGuiGetState = int function();
41 
42       /**
43        * Set gui custom font (global state)
44        */
45       alias pGuiSetFont = void function(Font font);
46       /**
47        * Get gui custom font (global state)
48        */
49       alias pGuiGetFont = Font function();
50 
51       // Style set/get functions
52       /**
53        * Set one style property
54        */
55       alias pGuiSetStyle = void function(int control, int property, int value);
56       /**
57        * Get one style property
58        */
59       alias pGuiGetStyle = int function(int control, int property);
60 
61       // Container/separator controls, useful for controls organization
62       /**
63        * Window Box control, shows a window that can be closed
64        */
65       alias pGuiWindowBox = bool function(Rectangle bounds, const(char)* title);
66       /**
67        * Group Box control with text name
68        */
69       alias pGuiGroupBox = void function(Rectangle bounds, const(char)* text);
70       /**
71        * Line separator control, could contain text
72        */
73       alias pGuiLine = void function(Rectangle bounds, const(char)* text);
74       /**
75        * Panel control, useful to group controls
76        */
77       alias pGuiPanel = void function(Rectangle bounds);
78       /**
79        * Scroll Panel control
80        */
81       alias pGuiScrollPanel = Rectangle function(Rectangle bounds, Rectangle content, Vector2* scroll);
82 
83       // Basic controls set
84       /**
85        * Label control, shows text
86        */
87       alias pGuiLabel = void function(Rectangle bounds, const(char)* text);
88       /**
89        * Button control, returns true when clicked
90        */
91       alias pGuiButton = bool function(Rectangle bounds, const(char)* text);
92       /**
93        * Label button control, show true when clicked
94        */
95       alias pGuiLabelButton = bool function(Rectangle bounds, const(char)* text);
96       /**
97        * Image button control, returns true when clicked
98        */
99       alias pGuiImageButton = bool function(Rectangle bounds, const(char)* text, Texture2D texture);
100       /**
101        * Image button extended control, returns true when clicked
102        */
103       alias pGuiImageButtonEx = bool function(Rectangle bounds, const(char)* text, Texture2D texture, Rectangle texSource);
104       /**
105        * Toggle Button control, returns true when active
106        */
107       alias pGuiToggle = bool function(Rectangle bounds, const(char)* text, bool active);
108       /**
109        * Toggle Group control, returns active toggle index
110        */
111       alias pGuiToggleGroup = int function(Rectangle bounds, const(char)* text, int active);
112       /**
113        * Check Box control, returns true when active
114        */
115       alias pGuiCheckBox = bool function(Rectangle bounds, const(char)* text, bool checked);
116       /**
117        * Combo Box control, returns selected item index
118        */
119       alias pGuiComboBox = int function(Rectangle bounds, const(char)* text, int active);
120       /**
121        * Dropdown Box control, returns selected item
122        */
123       alias pGuiDropdownBox = bool function(Rectangle bounds, const(char)* text, int* active, bool editMode);
124       /**
125        * Spinner control, returns selected value
126        */
127       alias pGuiSpinner = bool function(Rectangle bounds, const(char)* text, int* value, int minValue, int maxValue, bool editMode);
128       /**
129        * Value Box control, updates input text with numbers
130        */
131       alias pGuiValueBox = bool function(Rectangle bounds, const(char)* text, int* value, int minValue, int maxValue, bool editMode);
132       /**
133        * Text Box control, updates input text
134        */
135       alias pGuiTextBox = bool function(Rectangle bounds, char* text, int textSize, bool editMode);
136       /**
137        * Text Box control with multiple lines
138        */
139       alias pGuiTextBoxMulti = bool function(Rectangle bounds, char* text, int textSize, bool editMode);
140       /**
141        * Slider control, returns selected value
142        */
143       alias pGuiSlider = float function(Rectangle bounds, const(char)* textLeft, const(char)* textRight, float value,
144             float minValue, float maxValue);
145       /**
146        * Slider Bar control, returns selected value
147        */
148       alias pGuiSliderBar = float function(Rectangle bounds, const(char)* textLeft, const(char)* textRight, float value,
149             float minValue, float maxValue);
150       /**
151        * Progress Bar control, shows current progress value
152        */
153       alias pGuiProgressBar = float function(Rectangle bounds, const(char)* textLeft, const(char)* textRight,
154             float value, float minValue, float maxValue);
155       /**
156        * Status Bar control, shows info text
157        */
158       alias pGuiStatusBar = void function(Rectangle bounds, const(char)* text);
159       /**
160        * Dummy control for placeholders
161        */
162       alias pGuiDummyRec = void function(Rectangle bounds, const(char)* text);
163       /**
164        * Scroll Bar control
165        */
166       alias pGuiScrollBar = int function(Rectangle bounds, int value, int minValue, int maxValue);
167       /**
168        * Grid control
169        */
170       alias pGuiGrid = Vector2 function(Rectangle bounds, float spacing, int subdivs);
171 
172       // Advance controls set
173       /**
174        * List View control, returns selected list item index
175        */
176       alias pGuiListView = int function(Rectangle bounds, const(char)* text, int* scrollIndex, int active);
177       /**
178        * List View with extended parameters
179        */
180       alias pGuiListViewEx = int function(Rectangle bounds, const(char)** text, int count, int* focus, int* scrollIndex, int active);
181       /**
182        * Message Box control, displays a message
183        */
184       alias pGuiMessageBox = int function(Rectangle bounds, const(char)* title, const(char)* message, const(char)* buttons);
185       /**
186        * Text Input Box control, ask for text
187        */
188       alias pGuiTextInputBox = int function(Rectangle bounds, const(char)* title, const(char)* message, const(char)* buttons, char* text);
189       /**
190        * Color Picker control
191        */
192       alias pGuiColorPicker = Color function(Rectangle bounds, Color color);
193 
194       // Styles loading functions
195       /**
196        * Load style file (.rgs)
197        */
198       alias pGuiLoadStyle = void function(const(char)* fileName);
199       /**
200        * Load style default over global style
201        */
202       alias pGuiLoadStyleDefault = void function();
203       /**
204        * Get text with icon id prepended (if supported)
205        */
206       alias pGuiIconText = const(char)* function(int iconId, const(char)* text);
207 
208       alias pGuiDrawIcon = void function(int iconId, Vector2 position, int pixelSize, Color color);
209       /**
210        * Get full icons data pointer
211        */
212       alias pGuiGetIcons = uint* function();
213       /**
214        * Get icon bit data
215        */
216       alias pGuiGetIconData = uint* function(int iconId);
217       /**
218        * Set icon bit data
219        */
220       alias pGuiSetIconData = void function(int iconId, uint* data);
221       /**
222        * Set icon pixel value
223        */
224       alias pGuiSetIconPixel = void function(int iconId, int x, int y);
225       /**
226        * Clear icon pixel value
227        */
228       alias pGuiClearIconPixel = void function(int iconId, int x, int y);
229       /**
230        * Check icon pixel value
231        */
232       alias pGuiCheckIconPixel = bool function(int iconId, int x, int y);
233 
234       alias pGuiColorBarAlpha = float function(Rectangle bounds, float alpha);
235    }
236 
237    __gshared {
238       pGuiEnable GuiEnable;
239       pGuiDisable GuiDisable;
240       pGuiLock GuiLock;
241       pGuiUnlock GuiUnlock;
242       pGuiFade GuiFade;
243       pGuiSetState GuiSetState;
244       pGuiGetState GuiGetState;
245       pGuiSetFont GuiSetFont;
246       pGuiGetFont GuiGetFont;
247       pGuiSetStyle GuiSetStyle;
248       pGuiGetStyle GuiGetStyle;
249       pGuiWindowBox GuiWindowBox;
250       pGuiGroupBox GuiGroupBox;
251       pGuiLine GuiLine;
252       pGuiPanel GuiPanel;
253       pGuiScrollPanel GuiScrollPanel;
254       pGuiLabel GuiLabel;
255       pGuiButton GuiButton;
256       pGuiLabelButton GuiLabelButton;
257       pGuiImageButton GuiImageButton;
258       pGuiImageButtonEx GuiImageButtonEx;
259       pGuiToggle GuiToggle;
260       pGuiToggleGroup GuiToggleGroup;
261       pGuiCheckBox GuiCheckBox;
262       pGuiComboBox GuiComboBox;
263       pGuiDropdownBox GuiDropdownBox;
264       pGuiSpinner GuiSpinner;
265       pGuiValueBox GuiValueBox;
266       pGuiTextBox GuiTextBox;
267       pGuiTextBoxMulti GuiTextBoxMulti;
268       pGuiSlider GuiSlider;
269       pGuiSliderBar GuiSliderBar;
270       pGuiProgressBar GuiProgressBar;
271       pGuiStatusBar GuiStatusBar;
272       pGuiDummyRec GuiDummyRec;
273       pGuiScrollBar GuiScrollBar;
274       pGuiGrid GuiGrid;
275       pGuiListView GuiListView;
276       pGuiListViewEx GuiListViewEx;
277       pGuiMessageBox GuiMessageBox;
278       pGuiTextInputBox GuiTextInputBox;
279       pGuiColorPicker GuiColorPicker;
280       pGuiLoadStyle GuiLoadStyle;
281       pGuiLoadStyleDefault GuiLoadStyleDefault;
282       pGuiIconText GuiIconText;
283 
284       pGuiDrawIcon       GuiDrawIcon       ;
285       pGuiGetIcons       GuiGetIcons       ;
286       pGuiGetIconData    GuiGetIconData    ;
287       pGuiSetIconData    GuiSetIconData    ;
288       pGuiSetIconPixel   GuiSetIconPixel   ;
289       pGuiClearIconPixel GuiClearIconPixel ;
290       pGuiCheckIconPixel GuiCheckIconPixel ;
291       pGuiColorBarAlpha  GuiColorBarAlpha;
292    }
293 }