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