1 deprecated("raygui is not up to date and will be removed in a future version of raylib-d")
2 module raygui;
3 /*******************************************************************************************
4 *
5 *   raygui v2.7 - A simple and easy-to-use immediate-mode gui library
6 *
7 *   DESCRIPTION:
8 *
9 *   raygui is a tools-dev-focused immediate-mode-gui library based on raylib but also
10 *   available as a standalone library, as long as input and drawing functions are provided.
11 *
12 *   Controls provided:
13 *
14 *   # Container/separators Controls
15 *       - WindowBox
16 *       - GroupBox
17 *       - Line
18 *       - Panel
19 *
20 *   # Basic Controls
21 *       - Label
22 *       - Button
23 *       - LabelButton   --> Label
24 *       - ImageButton   --> Button
25 *       - ImageButtonEx --> Button
26 *       - Toggle
27 *       - ToggleGroup   --> Toggle
28 *       - CheckBox
29 *       - ComboBox
30 *       - DropdownBox
31 *       - TextBox
32 *       - TextBoxMulti
33 *       - ValueBox      --> TextBox
34 *       - Spinner       --> Button, ValueBox
35 *       - Slider
36 *       - SliderBar     --> Slider
37 *       - ProgressBar
38 *       - StatusBar
39 *       - ScrollBar
40 *       - ScrollPanel
41 *       - DummyRec
42 *       - Grid
43 *
44 *   # Advance Controls
45 *       - ListView
46 *       - ColorPicker   --> ColorPanel, ColorBarHue
47 *       - MessageBox    --> Window, Label, Button
48 *       - TextInputBox  --> Window, Label, TextBox, Button
49 *
50 *   It also provides a set of functions for styling the controls based on its properties (size, color).
51 *
52 *   CONFIGURATION:
53 *
54 *   #define RAYGUI_IMPLEMENTATION
55 *       Generates the implementation of the library into the included file.
56 *       If not defined, the library is in header only mode and can be included in other headers
57 *       or source files without problems. But only ONE file should hold the implementation.
58 *
59 *   #define RAYGUI_STATIC (defined by default)
60 *       The generated implementation will stay private inside implementation file and all
61 *       internal symbols and functions will only be visible inside that file.
62 *
63 *   #define RAYGUI_STANDALONE
64 *       Avoid raylib.h header inclusion in this file. Data types defined on raylib are defined
65 *       internally in the library and input management and drawing functions must be provided by
66 *       the user (check library implementation for further details).
67 *
68 *   #define RAYGUI_SUPPORT_ICONS
69 *       Includes riconsdata.h header defining a set of 128 icons (binary format) to be used on
70 *       multiple controls and following raygui styles
71 *
72 *
73 *   VERSIONS HISTORY:
74 *       2.7 (20-Feb-2020) Added possible tooltips API
75 *       2.6 (09-Sep-2019) ADDED: GuiTextInputBox()
76 *                         REDESIGNED: GuiListView*(), GuiDropdownBox(), GuiSlider*(), GuiProgressBar(), GuiMessageBox()
77 *                         REVIEWED: GuiTextBox(), GuiSpinner(), GuiValueBox(), GuiLoadStyle()
78 *                         Replaced property INNER_PADDING by TEXT_PADDING, renamed some properties
79 *                         Added 8 new custom styles ready to use
80 *                         Multiple minor tweaks and bugs corrected
81 *       2.5 (28-May-2019) Implemented extended GuiTextBox(), GuiValueBox(), GuiSpinner()
82 *       2.3 (29-Apr-2019) Added rIcons auxiliar library and support for it, multiple controls reviewed
83 *                         Refactor all controls drawing mechanism to use control state
84 *       2.2 (05-Feb-2019) Added GuiScrollBar(), GuiScrollPanel(), reviewed GuiListView(), removed Gui*Ex() controls
85 *       2.1 (26-Dec-2018) Redesign of GuiCheckBox(), GuiComboBox(), GuiDropdownBox(), GuiToggleGroup() > Use combined text string
86 *                         Complete redesign of style system (breaking change)
87 *       2.0 (08-Nov-2018) Support controls guiLock and custom fonts, reviewed GuiComboBox(), GuiListView()...
88 *       1.9 (09-Oct-2018) Controls review: GuiGrid(), GuiTextBox(), GuiTextBoxMulti(), GuiValueBox()...
89 *       1.8 (01-May-2018) Lot of rework and redesign to align with rGuiStyler and rGuiLayout
90 *       1.5 (21-Jun-2017) Working in an improved styles system
91 *       1.4 (15-Jun-2017) Rewritten all GUI functions (removed useless ones)
92 *       1.3 (12-Jun-2017) Redesigned styles system
93 *       1.1 (01-Jun-2017) Complete review of the library
94 *       1.0 (07-Jun-2016) Converted to header-only by Ramon Santamaria.
95 *       0.9 (07-Mar-2016) Reviewed and tested by Albert Martos, Ian Eito, Sergio Martinez and Ramon Santamaria.
96 *       0.8 (27-Aug-2015) Initial release. Implemented by Kevin Gato, Daniel Nicolás and Ramon Santamaria.
97 *
98 *   CONTRIBUTORS:
99 *       Ramon Santamaria:   Supervision, review, redesign, update and maintenance...
100 *       Vlad Adrian:        Complete rewrite of GuiTextBox() to support extended features (2019)
101 *       Sergio Martinez:    Review, testing (2015) and redesign of multiple controls (2018)
102 *       Adria Arranz:       Testing and Implementation of additional controls (2018)
103 *       Jordi Jorba:        Testing and Implementation of additional controls (2018)
104 *       Albert Martos:      Review and testing of the library (2015)
105 *       Ian Eito:           Review and testing of the library (2015)
106 *       Kevin Gato:         Initial implementation of basic components (2014)
107 *       Daniel Nicolas:     Initial implementation of basic components (2014)
108 *
109 *
110 *   LICENSE: zlib/libpng
111 *
112 *   Copyright (c) 2014-2020 Ramon Santamaria (@raysan5)
113 *
114 *   This software is provided "as-is", without any express or implied warranty. In no event
115 *   will the authors be held liable for any damages arising from the use of this software.
116 *
117 *   Permission is granted to anyone to use this software for any purpose, including commercial
118 *   applications, and to alter it and redistribute it freely, subject to the following restrictions:
119 *
120 *     1. The origin of this software must not be misrepresented; you must not claim that you
121 *     wrote the original software. If you use this software in a product, an acknowledgment
122 *     in the product documentation would be appreciated but is not required.
123 *
124 *     2. Altered source versions must be plainly marked as such, and must not be misrepresented
125 *     as being the original software.
126 *
127 *     3. This notice may not be removed or altered from any source distribution.
128 *
129 **********************************************************************************************/
130 
131 import core.stdc.stdlib;
132 import raylib;
133 
134 extern (C):
135 
136 enum RAYGUI_VERSION = "2.6-dev";
137 
138 // Define functions scope to be used internally (static) or externally (extern) to the module including this file
139 
140 // Functions just visible to module including this file
141 
142 // Functions visible from other files (no name mangling of functions in C++)
143 
144 // NOTE: By default any function declared in a C file is extern // Functions visible from other files
145 
146 // We are building raygui as a Win32 shared library (.dll).
147 
148 // We are using raygui as a Win32 shared library (.dll)
149 
150 // Required for: malloc(), calloc(), free()
151 
152 // Allow custom memory allocators
153 
154 alias RAYGUI_MALLOC = malloc;
155 
156 alias RAYGUI_CALLOC = calloc;
157 
158 alias RAYGUI_FREE = free;
159 
160 //----------------------------------------------------------------------------------
161 // Defines and Macros
162 //----------------------------------------------------------------------------------
163 enum NUM_CONTROLS = 16; // Number of standard controls
164 enum NUM_PROPS_DEFAULT = 16; // Number of standard properties
165 enum NUM_PROPS_EXTENDED = 8; // Number of extended properties
166 
167 enum TEXTEDIT_CURSOR_BLINK_FRAMES = 20; // Text edit controls cursor blink timming
168 
169 //----------------------------------------------------------------------------------
170 // Types and Structures Definition
171 // NOTE: Some types are required for RAYGUI_STANDALONE usage
172 //----------------------------------------------------------------------------------
173 
174 // Boolean type
175 
176 // Vector2 type
177 
178 // Vector3 type
179 
180 // Color type, RGBA (32bit)
181 
182 // Rectangle type
183 
184 // TODO: Texture2D type is very coupled to raylib, mostly required by GuiImageButton()
185 // It should be redesigned to be provided by user
186 
187 // OpenGL texture id
188 // Texture base width
189 // Texture base height
190 // Mipmap levels, 1 by default
191 // Data format (PixelFormat type)
192 
193 // Font character info
194 
195 // TODO: Font type is very coupled to raylib, mostly required by GuiLoadStyle()
196 // It should be redesigned to be provided by user
197 
198 // Base size (default chars height)
199 // Number of characters
200 // Characters texture atlas
201 // Characters rectangles in texture
202 // Characters info data
203 
204 // Style property
205 struct GuiStyleProp
206 {
207     ushort controlId;
208     ushort propertyId;
209     int propertyValue;
210 }
211 
212 // Gui control state
213 enum GuiControlState
214 {
215     GUI_STATE_NORMAL = 0,
216     GUI_STATE_FOCUSED = 1,
217     GUI_STATE_PRESSED = 2,
218     GUI_STATE_DISABLED = 3
219 }
220 
221 // Gui control text alignment
222 enum GuiTextAlignment
223 {
224     GUI_TEXT_ALIGN_LEFT = 0,
225     GUI_TEXT_ALIGN_CENTER = 1,
226     GUI_TEXT_ALIGN_RIGHT = 2
227 }
228 
229 // Gui controls
230 enum GuiControl
231 {
232     DEFAULT = 0,
233     LABEL = 1, // LABELBUTTON
234     BUTTON = 2, // IMAGEBUTTON
235     TOGGLE = 3, // TOGGLEGROUP
236     SLIDER = 4, // SLIDERBAR
237     PROGRESSBAR = 5,
238     CHECKBOX = 6,
239     COMBOBOX = 7,
240     DROPDOWNBOX = 8,
241     TEXTBOX = 9, // TEXTBOXMULTI
242     VALUEBOX = 10,
243     SPINNER = 11,
244     LISTVIEW = 12,
245     COLORPICKER = 13,
246     SCROLLBAR = 14,
247     STATUSBAR = 15
248 }
249 
250 // Gui base properties for every control
251 enum GuiControlProperty
252 {
253     BORDER_COLOR_NORMAL = 0,
254     BASE_COLOR_NORMAL = 1,
255     TEXT_COLOR_NORMAL = 2,
256     BORDER_COLOR_FOCUSED = 3,
257     BASE_COLOR_FOCUSED = 4,
258     TEXT_COLOR_FOCUSED = 5,
259     BORDER_COLOR_PRESSED = 6,
260     BASE_COLOR_PRESSED = 7,
261     TEXT_COLOR_PRESSED = 8,
262     BORDER_COLOR_DISABLED = 9,
263     BASE_COLOR_DISABLED = 10,
264     TEXT_COLOR_DISABLED = 11,
265     BORDER_WIDTH = 12,
266     TEXT_PADDING = 13,
267     TEXT_ALIGNMENT = 14,
268     RESERVED = 15
269 }
270 
271 // Gui extended properties depend on control
272 // NOTE: We reserve a fixed size of additional properties per control
273 
274 // DEFAULT properties
275 enum GuiDefaultProperty
276 {
277     TEXT_SIZE = 16,
278     TEXT_SPACING = 17,
279     LINE_COLOR = 18,
280     BACKGROUND_COLOR = 19
281 }
282 
283 // Label
284 //typedef enum { } GuiLabelProperty;
285 
286 // Button
287 //typedef enum { } GuiButtonProperty;
288 
289 // Toggle / ToggleGroup
290 enum GuiToggleProperty
291 {
292     GROUP_PADDING = 16
293 }
294 
295 // Slider / SliderBar
296 enum GuiSliderProperty
297 {
298     SLIDER_WIDTH = 16,
299     SLIDER_PADDING = 17
300 }
301 
302 // ProgressBar
303 enum GuiProgressBarProperty
304 {
305     PROGRESS_PADDING = 16
306 }
307 
308 // CheckBox
309 enum GuiCheckBoxProperty
310 {
311     CHECK_PADDING = 16
312 }
313 
314 // ComboBox
315 enum GuiComboBoxProperty
316 {
317     COMBO_BUTTON_WIDTH = 16,
318     COMBO_BUTTON_PADDING = 17
319 }
320 
321 // DropdownBox
322 enum GuiDropdownBoxProperty
323 {
324     ARROW_PADDING = 16,
325     DROPDOWN_ITEMS_PADDING = 17
326 }
327 
328 // TextBox / TextBoxMulti / ValueBox / Spinner
329 enum GuiTextBoxProperty
330 {
331     TEXT_INNER_PADDING = 16,
332     TEXT_LINES_PADDING = 17,
333     COLOR_SELECTED_FG = 18,
334     COLOR_SELECTED_BG = 19
335 }
336 
337 // Spinner
338 enum GuiSpinnerProperty
339 {
340     SPIN_BUTTON_WIDTH = 16,
341     SPIN_BUTTON_PADDING = 17
342 }
343 
344 // ScrollBar
345 enum GuiScrollBarProperty
346 {
347     ARROWS_SIZE = 16,
348     ARROWS_VISIBLE = 17,
349     SCROLL_SLIDER_PADDING = 18,
350     SCROLL_SLIDER_SIZE = 19,
351     SCROLL_PADDING = 20,
352     SCROLL_SPEED = 21
353 }
354 
355 // ScrollBar side
356 enum GuiScrollBarSide
357 {
358     SCROLLBAR_LEFT_SIDE = 0,
359     SCROLLBAR_RIGHT_SIDE = 1
360 }
361 
362 // ListView
363 enum GuiListViewProperty
364 {
365     LIST_ITEMS_HEIGHT = 16,
366     LIST_ITEMS_PADDING = 17,
367     SCROLLBAR_WIDTH = 18,
368     SCROLLBAR_SIDE = 19
369 }
370 
371 // ColorPicker
372 enum GuiColorPickerProperty
373 {
374     COLOR_SELECTOR_SIZE = 16,
375     HUEBAR_WIDTH = 17, // Right hue bar width
376     HUEBAR_PADDING = 18, // Right hue bar separation from panel
377     HUEBAR_SELECTOR_HEIGHT = 19, // Right hue bar selector height
378     HUEBAR_SELECTOR_OVERFLOW = 20 // Right hue bar selector overflow
379 }
380 
381 //----------------------------------------------------------------------------------
382 // Global Variables Definition
383 //----------------------------------------------------------------------------------
384 // ...
385 
386 //----------------------------------------------------------------------------------
387 // Module Functions Declaration
388 //----------------------------------------------------------------------------------
389 
390 // State modification functions
391 void GuiEnable (); // Enable gui controls (global state)
392 void GuiDisable (); // Disable gui controls (global state)
393 void GuiLock (); // Lock gui controls (global state)
394 void GuiUnlock (); // Unlock gui controls (global state)
395 void GuiFade (float alpha); // Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f
396 void GuiSetState (int state); // Set gui state (global state)
397 int GuiGetState (); // Get gui state (global state)
398 
399 // Font set/get functions
400 void GuiSetFont (Font font); // Set gui custom font (global state)
401 Font GuiGetFont (); // Get gui custom font (global state)
402 
403 // Style set/get functions
404 void GuiSetStyle (int control, int property, int value); // Set one style property
405 int GuiGetStyle (int control, int property); // Get one style property
406 
407 // Tooltips set functions
408 void GuiEnableTooltip (); // Enable gui tooltips
409 void GuiDisableTooltip (); // Disable gui tooltips
410 void GuiSetTooltip (const(char)* tooltip); // Set current tooltip for display
411 void GuiClearTooltip (); // Clear any tooltip registered
412 
413 // Container/separator controls, useful for controls organization
414 bool GuiWindowBox (Rectangle bounds, const(char)* title); // Window Box control, shows a window that can be closed
415 void GuiGroupBox (Rectangle bounds, const(char)* text); // Group Box control with text name
416 void GuiLine (Rectangle bounds, const(char)* text); // Line separator control, could contain text
417 void GuiPanel (Rectangle bounds); // Panel control, useful to group controls
418 Rectangle GuiScrollPanel (Rectangle bounds, Rectangle content, Vector2* scroll); // Scroll Panel control
419 
420 // Basic controls set
421 void GuiLabel (Rectangle bounds, const(char)* text); // Label control, shows text
422 bool GuiButton (Rectangle bounds, const(char)* text); // Button control, returns true when clicked
423 bool GuiLabelButton (Rectangle bounds, const(char)* text); // Label button control, show true when clicked
424 bool GuiImageButton (Rectangle bounds, const(char)* text, Texture2D texture); // Image button control, returns true when clicked
425 bool GuiImageButtonEx (Rectangle bounds, const(char)* text, Texture2D texture, Rectangle texSource); // Image button extended control, returns true when clicked
426 bool GuiToggle (Rectangle bounds, const(char)* text, bool active); // Toggle Button control, returns true when active
427 int GuiToggleGroup (Rectangle bounds, const(char)* text, int active); // Toggle Group control, returns active toggle index
428 bool GuiCheckBox (Rectangle bounds, const(char)* text, bool checked); // Check Box control, returns true when active
429 int GuiComboBox (Rectangle bounds, const(char)* text, int active); // Combo Box control, returns selected item index
430 bool GuiDropdownBox (Rectangle bounds, const(char)* text, int* active, bool editMode); // Dropdown Box control, returns selected item
431 bool GuiSpinner (Rectangle bounds, const(char)* text, int* value, int minValue, int maxValue, bool editMode); // Spinner control, returns selected value
432 bool GuiValueBox (Rectangle bounds, const(char)* text, int* value, int minValue, int maxValue, bool editMode); // Value Box control, updates input text with numbers
433 bool GuiTextBox (Rectangle bounds, char* text, int textSize, bool editMode); // Text Box control, updates input text
434 bool GuiTextBoxMulti (Rectangle bounds, char* text, int textSize, bool editMode); // Text Box control with multiple lines
435 float GuiSlider (Rectangle bounds, const(char)* textLeft, const(char)* textRight, float value, float minValue, float maxValue); // Slider control, returns selected value
436 float GuiSliderBar (Rectangle bounds, const(char)* textLeft, const(char)* textRight, float value, float minValue, float maxValue); // Slider Bar control, returns selected value
437 float GuiProgressBar (Rectangle bounds, const(char)* textLeft, const(char)* textRight, float value, float minValue, float maxValue); // Progress Bar control, shows current progress value
438 void GuiStatusBar (Rectangle bounds, const(char)* text); // Status Bar control, shows info text
439 void GuiDummyRec (Rectangle bounds, const(char)* text); // Dummy control for placeholders
440 int GuiScrollBar (Rectangle bounds, int value, int minValue, int maxValue); // Scroll Bar control
441 Vector2 GuiGrid (Rectangle bounds, float spacing, int subdivs); // Grid control
442 
443 // Advance controls set
444 int GuiListView (Rectangle bounds, const(char)* text, int* scrollIndex, int active); // List View control, returns selected list item index
445 int GuiListViewEx (Rectangle bounds, const(char*)* text, int count, int* focus, int* scrollIndex, int active); // List View with extended parameters
446 int GuiMessageBox (Rectangle bounds, const(char)* title, const(char)* message, const(char)* buttons); // Message Box control, displays a message
447 int GuiTextInputBox (Rectangle bounds, const(char)* title, const(char)* message, const(char)* buttons, char* text); // Text Input Box control, ask for text
448 Color GuiColorPicker (Rectangle bounds, Color color); // Color Picker control (multiple color controls)
449 Color GuiColorPanel (Rectangle bounds, Color color); // Color Panel control
450 float GuiColorBarAlpha (Rectangle bounds, float alpha); // Color Bar Alpha control
451 float GuiColorBarHue (Rectangle bounds, float value); // Color Bar Hue control
452 
453 // Styles loading functions
454 void GuiLoadStyle (const(char)* fileName); // Load style file (.rgs)
455 void GuiLoadStyleDefault (); // Load style default over global style
456 
457 /*
458 typedef GuiStyle (unsigned int *)
459 RAYGUIDEF GuiStyle LoadGuiStyle(const char *fileName);          // Load style from file (.rgs)
460 RAYGUIDEF void UnloadGuiStyle(GuiStyle style);                  // Unload style
461 */
462 
463 const(char)* GuiIconText (int iconId, const(char)* text); // Get text with icon id prepended (if supported)
464 
465 // Gui icons functionality
466 
467 // Get full icons data pointer
468 // Get icon bit data
469 // Set icon bit data
470 
471 // Set icon pixel value
472 // Clear icon pixel value
473 // Check icon pixel value
474 
475 // RAYGUI_H
476 
477 /***********************************************************************************
478 *
479 *   RAYGUI IMPLEMENTATION
480 *
481 ************************************************************************************/
482 
483 // Required for: raygui icons data
484 
485 // Required for: FILE, fopen(), fclose(), fprintf(), feof(), fscanf(), vsprintf()
486 // Required for: strlen() on GuiTextBox()
487 
488 // Required for: va_list, va_start(), vfprintf(), va_end()
489 
490 //----------------------------------------------------------------------------------
491 // Defines and Macros
492 //----------------------------------------------------------------------------------
493 //...
494 
495 //----------------------------------------------------------------------------------
496 // Types and Structures Definition
497 //----------------------------------------------------------------------------------
498 // Gui control property style color element
499 
500 //----------------------------------------------------------------------------------
501 // Global Variables Definition
502 //----------------------------------------------------------------------------------
503 
504 // Gui current font (WARNING: highly coupled to raylib)
505 // Gui lock state (no inputs processed)
506 // Gui element transpacency on drawing
507 
508 // Global gui style array (allocated on heap by default)
509 // NOTE: In raygui we manage a single int array with all the possible style properties.
510 // When a new style is loaded, it loads over the global style... but default gui style
511 // could always be recovered with GuiLoadStyleDefault()
512 
513 // Style loaded flag for lazy style initialization
514 
515 // Tooltips required variables
516 // Gui tooltip currently active (user provided)
517 // Gui tooltips enabled
518 
519 //----------------------------------------------------------------------------------
520 // Standalone Mode Functions Declaration
521 //
522 // NOTE: raygui depend on some raylib input and drawing functions
523 // To use raygui as standalone library, below functions must be defined by the user
524 //----------------------------------------------------------------------------------
525 
526 // Input required functions
527 //-------------------------------------------------------------------------------
528 
529 // -- GuiTextBox(), GuiTextBoxMulti(), GuiValueBox()
530 //-------------------------------------------------------------------------------
531 
532 // Drawing required functions
533 //-------------------------------------------------------------------------------
534 
535 // -- GuiColorPicker()
536 // -- GuiDropdownBox(), GuiScrollBar()
537 // -- GuiImageButtonEx()
538 
539 // -- GuiTextBoxMulti()
540 //-------------------------------------------------------------------------------
541 
542 // Text required functions
543 //-------------------------------------------------------------------------------
544 // -- GuiLoadStyleDefault()
545 // -- GetTextWidth(), GuiTextBoxMulti()
546 // -- GuiDrawText()
547 
548 // -- GuiLoadStyle()
549 // -- GuiLoadStyle()
550 // -- GuiLoadStyle()
551 //-------------------------------------------------------------------------------
552 
553 // raylib functions already implemented in raygui
554 //-------------------------------------------------------------------------------
555 // Returns a Color struct from hexadecimal value
556 // Returns hexadecimal value for a Color
557 // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f
558 // Check if point is inside rectangle
559 // Formatting of text with variables to 'embed'
560 // Split text into multiple strings
561 // Get integer value from text
562 
563 // Draw rectangle filled with color
564 // Draw rectangle outlines
565 // Draw rectangle vertical gradient
566 //-------------------------------------------------------------------------------
567 
568 // RAYGUI_STANDALONE
569 
570 //----------------------------------------------------------------------------------
571 // Module specific Functions Declaration
572 //----------------------------------------------------------------------------------
573 // Convert color data from HSV to RGB
574 // Convert color data from RGB to HSV
575 
576 // Gui get text width using default font
577 // TODO: GetTextSize()
578 
579 // TODO: Consider text icon width here???
580 
581 // Get text bounds considering control bounds
582 
583 // Consider TEXT_PADDING properly, depends on control type and TEXT_ALIGNMENT
584 
585 // NOTE: ValueBox text value always centered, text padding applies to label
586 
587 // TODO: Special cases (no label): COMBOBOX, DROPDOWNBOX, LISTVIEW (scrollbar?)
588 // More special cases (label side): CHECKBOX, SLIDER, VALUEBOX, SPINNER
589 
590 // Get text icon if provided and move text cursor
591 // NOTE: We support up to 999 values for iconId
592 
593 // Maybe we have an icon!
594 
595 // Maximum length for icon value: 3 digits + '\0'
596 
597 // Move text pointer after icon
598 // WARNING: If only icon provided, it could point to EOL character!
599 
600 // Gui draw text using default font
601 
602 // Vertical alignment for pixel perfect
603 
604 // Check text for icon and move cursor
605 
606 // Get text position depending on alignment and iconId
607 //---------------------------------------------------------------------------------
608 
609 // NOTE: We get text size after icon been processed
610 
611 // WARNING: If only icon provided, text could be pointing to eof character!
612 
613 // Check guiTextAlign global variables
614 
615 // NOTE: Make sure we get pixel-perfect coordinates,
616 // In case of decimals we got weird text positioning
617 
618 //---------------------------------------------------------------------------------
619 
620 // Draw text (with icon if available)
621 //---------------------------------------------------------------------------------
622 
623 // NOTE: We consider icon height, probably different than text size
624 
625 //---------------------------------------------------------------------------------
626 
627 // Draw tooltip relatively to bounds
628 
629 //static int tooltipFramesCounter = 0;  // Not possible gets reseted at second function call!
630 
631 // Split controls text into multiple strings
632 // Also check for multiple columns (required by GuiToggleGroup())
633 
634 //----------------------------------------------------------------------------------
635 // Gui Setup Functions Definition
636 //----------------------------------------------------------------------------------
637 
638 // Enable gui global state
639 
640 // Disable gui global state
641 
642 // Lock gui global state
643 
644 // Unlock gui global state
645 
646 // Set gui controls alpha global state
647 
648 // Set gui state (global state)
649 
650 // Get gui state (global state)
651 
652 // Set custom gui font
653 // NOTE: Font loading/unloading is external to raygui
654 
655 // NOTE: If we try to setup a font but default style has not been
656 // lazily loaded before, it will be overwritten, so we need to force
657 // default style loading first
658 
659 // Get custom gui font
660 
661 // Set control style property value
662 
663 // Default properties are propagated to all controls
664 
665 // Get control style property value
666 
667 // Enable gui tooltips
668 
669 // Disable gui tooltips
670 
671 // Set current tooltip for display
672 
673 // Clear any tooltip registered
674 
675 //----------------------------------------------------------------------------------
676 // Gui Controls Functions Definition
677 //----------------------------------------------------------------------------------
678 
679 // Window Box control
680 
681 // NOTE: This define is also used by GuiMessageBox() and GuiTextInputBox()
682 
683 // Update control
684 //--------------------------------------------------------------------
685 // NOTE: Logic is directly managed by button
686 //--------------------------------------------------------------------
687 
688 // Draw control
689 //--------------------------------------------------------------------
690 
691 // Draw window base
692 
693 // Draw window header as status bar
694 
695 // Draw window close button
696 
697 //--------------------------------------------------------------------
698 
699 // Group Box control with text name
700 
701 // Draw control
702 //--------------------------------------------------------------------
703 
704 //--------------------------------------------------------------------
705 
706 // Line control
707 
708 // Draw control
709 //--------------------------------------------------------------------
710 
711 // TODO: Consider text icon
712 
713 // Draw line with embedded text label: "--- text --------------"
714 
715 //--------------------------------------------------------------------
716 
717 // Panel control
718 
719 // Draw control
720 //--------------------------------------------------------------------
721 
722 //--------------------------------------------------------------------
723 
724 // Scroll Panel control
725 
726 // Recheck to account for the other scrollbar being visible
727 
728 // Calculate view area (area without the scrollbars)
729 
730 // Clip view area to the actual content size
731 
732 // TODO: Review!
733 
734 // Update control
735 //--------------------------------------------------------------------
736 
737 // Check button state
738 
739 // Normalize scroll values
740 
741 //--------------------------------------------------------------------
742 
743 // Draw control
744 //--------------------------------------------------------------------
745 // Draw background
746 
747 // Save size of the scrollbar slider
748 
749 // Draw horizontal scrollbar if visible
750 
751 // Change scrollbar slider size to show the diff in size between the content width and the widget width
752 
753 // Draw vertical scrollbar if visible
754 
755 // Change scrollbar slider size to show the diff in size between the content height and the widget height
756 
757 // Draw detail corner rectangle if both scroll bars are visible
758 
759 // TODO: Consider scroll bars side
760 
761 // Set scrollbar slider size back to the way it was before
762 
763 // Draw scrollbar lines depending on current state
764 
765 //--------------------------------------------------------------------
766 
767 // Label control
768 
769 // Update control
770 //--------------------------------------------------------------------
771 // ...
772 //--------------------------------------------------------------------
773 
774 // Draw control
775 //--------------------------------------------------------------------
776 
777 //--------------------------------------------------------------------
778 
779 // Button control, returns true when clicked
780 
781 // Update control
782 //--------------------------------------------------------------------
783 
784 // Check button state
785 
786 //--------------------------------------------------------------------
787 
788 // Draw control
789 //--------------------------------------------------------------------
790 
791 //------------------------------------------------------------------
792 
793 // Label button control
794 
795 // NOTE: We force bounds.width to be all text
796 
797 // Update control
798 //--------------------------------------------------------------------
799 
800 // Check checkbox state
801 
802 //--------------------------------------------------------------------
803 
804 // Draw control
805 //--------------------------------------------------------------------
806 
807 //--------------------------------------------------------------------
808 
809 // Image button control, returns true when clicked
810 
811 // Image button control, returns true when clicked
812 
813 // Update control
814 //--------------------------------------------------------------------
815 
816 // Check button state
817 
818 //--------------------------------------------------------------------
819 
820 // Draw control
821 //--------------------------------------------------------------------
822 
823 //------------------------------------------------------------------
824 
825 // Toggle Button control, returns true when active
826 
827 // Update control
828 //--------------------------------------------------------------------
829 
830 // Check toggle button state
831 
832 //--------------------------------------------------------------------
833 
834 // Draw control
835 //--------------------------------------------------------------------
836 
837 //--------------------------------------------------------------------
838 
839 // Toggle Group control, returns toggled button index
840 
841 // Get substrings items from text (items pointers)
842 
843 // Check Box control, returns true when active
844 
845 // Update control
846 //--------------------------------------------------------------------
847 
848 // Check checkbox state
849 
850 //--------------------------------------------------------------------
851 
852 // Draw control
853 //--------------------------------------------------------------------
854 
855 //--------------------------------------------------------------------
856 
857 // Combo Box control, returns selected item index
858 
859 // Get substrings items from text (items pointers, lengths and count)
860 
861 // Update control
862 //--------------------------------------------------------------------
863 
864 //--------------------------------------------------------------------
865 
866 // Draw control
867 //--------------------------------------------------------------------
868 // Draw combo box main
869 
870 // Draw selector using a custom button
871 // NOTE: BORDER_WIDTH and TEXT_ALIGNMENT forced values
872 
873 //--------------------------------------------------------------------
874 
875 // Dropdown Box control
876 // NOTE: Returns mouse click
877 
878 // Get substrings items from text (items pointers, lengths and count)
879 
880 // Check mouse button pressed
881 
882 // Update control
883 //--------------------------------------------------------------------
884 
885 // Check if mouse has been pressed or released outside limits
886 
887 // Check if already selected item has been pressed again
888 
889 // Check focused and selected item
890 
891 // Update item rectangle y position for next item
892 
893 // Item selected, change to editMode = false
894 
895 //--------------------------------------------------------------------
896 
897 // Draw control
898 //--------------------------------------------------------------------
899 
900 // Draw visible items
901 
902 // Update item rectangle y position for next item
903 
904 // TODO: Avoid this function, use icon instead or 'v'
905 
906 //GuiDrawText("v", RAYGUI_CLITERAL(Rectangle){ bounds.x + bounds.width - GuiGetStyle(DROPDOWNBOX, ARROW_PADDING), bounds.y + bounds.height/2 - 2, 10, 10 },
907 //            GUI_TEXT_ALIGN_CENTER, Fade(GetColor(GuiGetStyle(DROPDOWNBOX, TEXT + (state*3))), guiAlpha));
908 //--------------------------------------------------------------------
909 
910 // Text Box control, updates input text
911 // NOTE 1: Requires static variables: framesCounter
912 // NOTE 2: Returns if KEY_ENTER pressed (useful for data validation)
913 
914 // Required for blinking cursor
915 
916 // Update control
917 //--------------------------------------------------------------------
918 
919 // Only allow keys in range [32..125]
920 
921 // Delete text
922 
923 // Check text alignment to position cursor properly
924 
925 //--------------------------------------------------------------------
926 
927 // Draw control
928 //--------------------------------------------------------------------
929 
930 // Draw blinking cursor
931 
932 //--------------------------------------------------------------------
933 
934 // Spinner control, returns selected value
935 
936 // Update control
937 //--------------------------------------------------------------------
938 
939 // Check spinner state
940 
941 //--------------------------------------------------------------------
942 
943 // Draw control
944 //--------------------------------------------------------------------
945 // TODO: Set Spinner properties for ValueBox
946 
947 // Draw value selector custom buttons
948 // NOTE: BORDER_WIDTH and TEXT_ALIGNMENT forced values
949 
950 // Draw text label if provided
951 
952 //--------------------------------------------------------------------
953 
954 // Value Box control, updates input text with numbers
955 // NOTE: Requires static variables: framesCounter
956 
957 // Required for blinking cursor
958 
959 // Update control
960 //--------------------------------------------------------------------
961 
962 // Only allow keys in range [48..57]
963 
964 // Delete text
965 
966 //--------------------------------------------------------------------
967 
968 // Draw control
969 //--------------------------------------------------------------------
970 
971 // Draw blinking cursor
972 // NOTE: ValueBox internal text is always centered
973 
974 // Draw text label if provided
975 
976 //--------------------------------------------------------------------
977 
978 // Text Box control with multiple lines
979 
980 // Required for blinking cursor
981 
982 // Cursor position, [x, y] values should be updated
983 
984 // Update control
985 //--------------------------------------------------------------------
986 
987 // Introduce characters
988 
989 // TODO: Support Unicode inputs
990 
991 // Delete characters
992 
993 // Calculate cursor position considering text
994 
995 // Exit edit mode
996 
997 // Reset blinking cursor
998 
999 //--------------------------------------------------------------------
1000 
1001 // Draw control
1002 //--------------------------------------------------------------------
1003 
1004 // Draw blinking cursor
1005 
1006 //--------------------------------------------------------------------
1007 
1008 // Slider control with pro parameters
1009 // NOTE: Other GuiSlider*() controls use this one
1010 
1011 // Slider
1012 
1013 // SliderBar
1014 
1015 // Update control
1016 //--------------------------------------------------------------------
1017 
1018 // Get equivalent value and slider position from mousePoint.x
1019 
1020 // Slider
1021 // SliderBar
1022 
1023 // Bar limits check
1024 // Slider
1025 
1026 // SliderBar
1027 
1028 //--------------------------------------------------------------------
1029 
1030 // Draw control
1031 //--------------------------------------------------------------------
1032 
1033 // Draw slider internal bar (depends on state)
1034 
1035 // Draw left/right text if provided
1036 
1037 // TODO: Consider text icon
1038 
1039 // TODO: Consider text icon
1040 
1041 //--------------------------------------------------------------------
1042 
1043 // Slider control extended, returns selected value and has text
1044 
1045 // Slider Bar control extended, returns selected value
1046 
1047 // Progress Bar control extended, shows current progress value
1048 
1049 // Update control
1050 //--------------------------------------------------------------------
1051 
1052 //--------------------------------------------------------------------
1053 
1054 // Draw control
1055 //--------------------------------------------------------------------
1056 
1057 // Draw slider internal progress bar (depends on state)
1058 
1059 // Draw left/right text if provided
1060 
1061 // TODO: Consider text icon
1062 
1063 // TODO: Consider text icon
1064 
1065 //--------------------------------------------------------------------
1066 
1067 // Status Bar control
1068 
1069 // Draw control
1070 //--------------------------------------------------------------------
1071 
1072 //--------------------------------------------------------------------
1073 
1074 // Dummy rectangle control, intended for placeholding
1075 
1076 // Update control
1077 //--------------------------------------------------------------------
1078 
1079 // Check button state
1080 
1081 //--------------------------------------------------------------------
1082 
1083 // Draw control
1084 //--------------------------------------------------------------------
1085 
1086 //------------------------------------------------------------------
1087 
1088 // Scroll Bar control
1089 // TODO: I feel GuiScrollBar could be simplified...
1090 
1091 // Is the scrollbar horizontal or vertical?
1092 
1093 // The size (width or height depending on scrollbar type) of the spinner buttons
1094 
1095 // Arrow buttons [<] [>] [∧] [∨]
1096 
1097 // Actual area of the scrollbar excluding the arrow buttons
1098 
1099 // Slider bar that moves     --[///]-----
1100 
1101 // Normalize value
1102 
1103 // Calculate rectangles for all of the components
1104 
1105 // Make sure the slider won't get outside of the scrollbar
1106 
1107 // Make sure the slider won't get outside of the scrollbar
1108 
1109 // Update control
1110 //--------------------------------------------------------------------
1111 
1112 // Handle mouse wheel
1113 
1114 // Normalize value
1115 
1116 //--------------------------------------------------------------------
1117 
1118 // Draw control
1119 //--------------------------------------------------------------------
1120 // Draw the background
1121 // Draw the scrollbar active area background
1122 
1123 // Draw the slider bar
1124 
1125 // Draw arrows
1126 
1127 // Coordinates for <     0,1,2
1128 
1129 // Coordinates for >     3,4,5
1130 
1131 // Coordinates for ∧     6,7,8
1132 
1133 // Coordinates for ∨     9,10,11
1134 
1135 //--------------------------------------------------------------------
1136 
1137 // List View control
1138 
1139 // List View control with extended parameters
1140 
1141 // Check if we need a scroll bar
1142 
1143 // Define base item rectangle [0]
1144 
1145 // Get items on the list
1146 
1147 // Update control
1148 //--------------------------------------------------------------------
1149 
1150 // Check mouse inside list view
1151 
1152 // Check focused and selected item
1153 
1154 // Update item rectangle y position for next item
1155 
1156 // Reset item rectangle y to [0]
1157 
1158 //--------------------------------------------------------------------
1159 
1160 // Draw control
1161 //--------------------------------------------------------------------
1162 // Draw background
1163 
1164 // Draw visible items
1165 
1166 // Draw item selected
1167 
1168 // Draw item focused
1169 
1170 // Draw item normal
1171 
1172 // Update item rectangle y position for next item
1173 
1174 // Calculate percentage of visible items and apply same percentage to scrollbar
1175 
1176 // Save default slider size
1177 // Save default scroll speed
1178 // Change slider size
1179 // Change scroll speed
1180 
1181 // Reset scroll speed to default
1182 // Reset slider size to default
1183 
1184 //--------------------------------------------------------------------
1185 
1186 // Color Panel control
1187 
1188 // HSV: Saturation
1189 // HSV: Value
1190 
1191 // Update control
1192 //--------------------------------------------------------------------
1193 
1194 // Calculate color from picker
1195 
1196 // Get normalized value on x
1197 // Get normalized value on y
1198 
1199 // NOTE: Vector3ToColor() only available on raylib 1.8.1
1200 
1201 //--------------------------------------------------------------------
1202 
1203 // Draw control
1204 //--------------------------------------------------------------------
1205 
1206 // Draw color picker: selector
1207 
1208 //--------------------------------------------------------------------
1209 
1210 // Color Bar Alpha control
1211 // NOTE: Returns alpha value normalized [0..1]
1212 
1213 // Update control
1214 //--------------------------------------------------------------------
1215 
1216 //selector.x = bounds.x + (int)(((alpha - 0)/(100 - 0))*(bounds.width - 2*GuiGetStyle(SLIDER, BORDER_WIDTH))) - selector.width/2;
1217 
1218 //--------------------------------------------------------------------
1219 
1220 // Draw control
1221 //--------------------------------------------------------------------
1222 
1223 // Draw alpha bar: checked background
1224 
1225 // Draw alpha bar: selector
1226 
1227 //--------------------------------------------------------------------
1228 
1229 // Color Bar Hue control
1230 // NOTE: Returns hue value normalized [0..1]
1231 
1232 // Update control
1233 //--------------------------------------------------------------------
1234 
1235 /*if (IsKeyDown(KEY_UP))
1236 {
1237     hue -= 2.0f;
1238     if (hue <= 0.0f) hue = 0.0f;
1239 }
1240 else if (IsKeyDown(KEY_DOWN))
1241 {
1242     hue += 2.0f;
1243     if (hue >= 360.0f) hue = 360.0f;
1244 }*/
1245 
1246 //--------------------------------------------------------------------
1247 
1248 // Draw control
1249 //--------------------------------------------------------------------
1250 
1251 // Draw hue bar:color bars
1252 
1253 // Draw hue bar: selector
1254 
1255 //--------------------------------------------------------------------
1256 
1257 // TODO: Color GuiColorBarSat() [WHITE->color]
1258 // TODO: Color GuiColorBarValue() [BLACK->color], HSV / HSL
1259 // TODO: float GuiColorBarLuminance() [BLACK->WHITE]
1260 
1261 // Color Picker control
1262 // NOTE: It's divided in multiple controls:
1263 //      Color GuiColorPanel(Rectangle bounds, Color color)
1264 //      float GuiColorBarAlpha(Rectangle bounds, float alpha)
1265 //      float GuiColorBarHue(Rectangle bounds, float value)
1266 // NOTE: bounds define GuiColorPanel() size
1267 
1268 //Rectangle boundsAlpha = { bounds.x, bounds.y + bounds.height + GuiGetStyle(COLORPICKER, BARS_PADDING), bounds.width, GuiGetStyle(COLORPICKER, BARS_THICK) };
1269 
1270 //color.a = (unsigned char)(GuiColorBarAlpha(boundsAlpha, (float)color.a/255.0f)*255.0f);
1271 
1272 // Message Box control
1273 
1274 // Returns clicked button from buttons list, 0 refers to closed window button
1275 
1276 // Draw control
1277 //--------------------------------------------------------------------
1278 
1279 //--------------------------------------------------------------------
1280 
1281 // Text Input Box control, ask for text
1282 
1283 // Used to enable text edit mode
1284 // WARNING: No more than one GuiTextInputBox() should be open at the same time
1285 
1286 // Draw control
1287 //--------------------------------------------------------------------
1288 
1289 // Draw message if available
1290 
1291 //--------------------------------------------------------------------
1292 
1293 // Grid control
1294 // NOTE: Returns grid mouse-hover selected cell
1295 // About drawing lines at subpixel spacing, simple put, not easy solution:
1296 // https://stackoverflow.com/questions/4435450/2d-opengl-drawing-lines-that-dont-exactly-fit-pixel-raster
1297 
1298 // Grid lines alpha amount
1299 
1300 // Update control
1301 //--------------------------------------------------------------------
1302 
1303 //--------------------------------------------------------------------
1304 
1305 // Draw control
1306 //--------------------------------------------------------------------
1307 
1308 // Draw vertical grid lines
1309 
1310 // Draw horizontal grid lines
1311 
1312 //----------------------------------------------------------------------------------
1313 // Styles loading functions
1314 //----------------------------------------------------------------------------------
1315 
1316 // Load raygui style file (.rgs)
1317 
1318 // Try reading the files as text file first
1319 
1320 // Style property: p <control_id> <property_id> <property_value> <property_name>
1321 
1322 // Style font: f <gen_font_size> <charmap_file> <font_file>
1323 
1324 // Load characters from charmap file,
1325 // expected '\n' separated list of integer values
1326 
1327 // DEFAULT control
1328 
1329 // If a DEFAULT property is loaded, it is propagated to all controls
1330 // NOTE: All DEFAULT properties should be defined first in the file
1331 
1332 // Font loading is highly dependant on raylib API to load font data and image
1333 // TODO: Find some mechanism to support it in standalone mode
1334 
1335 // Load custom font if available
1336 
1337 // 0-Normal, 1-SDF
1338 
1339 // Load font white rectangle
1340 
1341 // Load font image parameters
1342 
1343 // Load font recs data
1344 
1345 // Load font chars info data
1346 
1347 // Set font texture source rectangle to be used as white texture to draw shapes
1348 // NOTE: This way, all gui can be draw using a single draw call
1349 
1350 // Load style default over global style
1351 
1352 // We set this variable first to avoid cyclic function calls
1353 // when calling GuiSetStyle() and GuiGetStyle()
1354 
1355 // Initialize default LIGHT style property values
1356 
1357 // WARNING: Some controls use other values
1358 // WARNING: Some controls use other values
1359 // WARNING: Some controls use other values
1360 
1361 // Initialize control-specific property values
1362 // NOTE: Those properties are in default list but require specific values by control type
1363 
1364 // Initialize extended property values
1365 // NOTE: By default, extended property values are initialized to 0
1366 // DEFAULT, shared by all controls
1367 // DEFAULT, shared by all controls
1368 // DEFAULT specific property
1369 // DEFAULT specific property
1370 
1371 // Initialize default font
1372 
1373 // Get text with icon id prepended
1374 // NOTE: Useful to add icons by name id (enum) instead of
1375 // a number that can change between ricon versions
1376 
1377 // Get full icons data pointer
1378 
1379 // Load raygui icons file (.rgi)
1380 // NOTE: In case nameIds are required, they can be requested with loadIconsName,
1381 // they are returned as a guiIconsName[iconsCount][RICON_MAX_NAME_LENGTH],
1382 // guiIconsName[]][] memory should be manually freed!
1383 
1384 // Style File Structure (.rgi)
1385 // ------------------------------------------------------
1386 // Offset  | Size    | Type       | Description
1387 // ------------------------------------------------------
1388 // 0       | 4       | char       | Signature: "rGI "
1389 // 4       | 2       | short      | Version: 100
1390 // 6       | 2       | short      | reserved
1391 
1392 // 8       | 2       | short      | Num icons (N)
1393 // 10      | 2       | short      | Icons size (Options: 16, 32, 64) (S)
1394 
1395 // Icons name id (32 bytes per name id)
1396 // foreach (icon)
1397 // {
1398 //   12+32*i  | 32   | char       | Icon NameId
1399 // }
1400 
1401 // Icons data: One bit per pixel, stored as unsigned int array (depends on icon size)
1402 // S*S pixels/32bit per unsigned int = K unsigned int per icon
1403 // foreach (icon)
1404 // {
1405 //   ...   | K       | unsigned int | Icon Data
1406 // }
1407 
1408 // Read icons data directly over guiIcons data array
1409 
1410 // Draw selected icon using rectangles pixel-by-pixel
1411 
1412 // Get icon bit data
1413 // NOTE: Bit data array grouped as unsigned int (ICON_SIZE*ICON_SIZE/32 elements)
1414 
1415 // Set icon bit data
1416 // NOTE: Data must be provided as unsigned int array (ICON_SIZE*ICON_SIZE/32 elements)
1417 
1418 // Set icon pixel value
1419 
1420 // This logic works for any RICON_SIZE pixels icons,
1421 // For example, in case of 16x16 pixels, every 2 lines fit in one unsigned int data element
1422 
1423 // Clear icon pixel value
1424 
1425 // This logic works for any RICON_SIZE pixels icons,
1426 // For example, in case of 16x16 pixels, every 2 lines fit in one unsigned int data element
1427 
1428 // Check icon pixel value
1429 
1430 // RAYGUI_SUPPORT_ICONS
1431 
1432 //----------------------------------------------------------------------------------
1433 // Module specific Functions Definition
1434 //----------------------------------------------------------------------------------
1435 
1436 // Split controls text into multiple strings
1437 // Also check for multiple columns (required by GuiToggleGroup())
1438 
1439 // NOTE: Current implementation returns a copy of the provided string with '\0' (string end delimiter)
1440 // inserted between strings defined by "delimiter" parameter. No memory is dynamically allocated,
1441 // all used memory is static... it has some limitations:
1442 //      1. Maximum number of possible split strings is set by TEXTSPLIT_MAX_TEXT_ELEMENTS
1443 //      2. Maximum size of text to split is TEXTSPLIT_MAX_TEXT_LENGTH
1444 // NOTE: Those definitions could be externally provided if required
1445 
1446 // Count how many substrings we have on text and point to every one
1447 
1448 // Set an end of string at this point
1449 
1450 // Convert color data from RGB to HSV
1451 // NOTE: Color data should be passed normalized
1452 
1453 // Value
1454 
1455 // Undefined, maybe NAN?
1456 
1457 // NOTE: If max is 0, this divide would cause a crash
1458 // Saturation
1459 
1460 // NOTE: If max is 0, then r = g = b = 0, s = 0, h is undefined
1461 
1462 // Undefined, maybe NAN?
1463 
1464 // NOTE: Comparing float values could not work properly
1465 // Between yellow & magenta
1466 
1467 // Between cyan & yellow
1468 // Between magenta & cyan
1469 
1470 // Convert to degrees
1471 
1472 // Convert color data from HSV to RGB
1473 // NOTE: Color data should be passed normalized
1474 
1475 // NOTE: Comparing float values could not work properly
1476 
1477 // Returns a Color struct from hexadecimal value
1478 
1479 // Returns hexadecimal value for a Color
1480 
1481 // Check if point is inside rectangle
1482 
1483 // Color fade-in or fade-out, alpha goes from 0.0f to 1.0f
1484 
1485 // Formatting of text with variables to 'embed'
1486 
1487 // Draw rectangle filled with color
1488 
1489 // Draw rectangle border lines with color
1490 
1491 // Draw rectangle with vertical gradient fill color
1492 // NOTE: This function is only used by GuiColorPicker()
1493 
1494 // Size of static buffer: TextSplit()
1495 // Size of static pointers array: TextSplit()
1496 
1497 // Split string into multiple strings
1498 
1499 // NOTE: Current implementation returns a copy of the provided string with '\0' (string end delimiter)
1500 // inserted between strings defined by "delimiter" parameter. No memory is dynamically allocated,
1501 // all used memory is static... it has some limitations:
1502 //      1. Maximum number of possible split strings is set by TEXTSPLIT_MAX_SUBSTRINGS_COUNT
1503 //      2. Maximum size of text to split is TEXTSPLIT_MAX_TEXT_BUFFER_LENGTH
1504 
1505 // Count how many substrings we have on text and point to every one
1506 
1507 // Set an end of string at this point
1508 
1509 // Get integer value from text
1510 // NOTE: This function replaces atoi() [stdlib.h]
1511 
1512 // RAYGUI_STANDALONE
1513 
1514 // RAYGUI_IMPLEMENTATION