diff --git a/src/gui_textbox_extended.h b/src/gui_textbox_extended.h index ff17de4..33cf353 100644 --- a/src/gui_textbox_extended.h +++ b/src/gui_textbox_extended.h @@ -55,31 +55,31 @@ extern "C" { // Prevents name mangling of functions //---------------------------------------------------------------------------------- // Module Functions Declaration //---------------------------------------------------------------------------------- -RAYGUIDEF void GuiTextBoxSetActive(Rectangle bounds); // Sets the active textbox -RAYGUIDEF Rectangle GuiTextBoxGetActive(void); // Get bounds of active textbox +RAYGUIAPI void GuiTextBoxSetActive(Rectangle bounds); // Sets the active textbox +RAYGUIAPI Rectangle GuiTextBoxGetActive(void); // Get bounds of active textbox -RAYGUIDEF void GuiTextBoxSetCursor(int cursor); // Set cursor position of active textbox -RAYGUIDEF int GuiTextBoxGetCursor(void); // Get cursor position of active textbox +RAYGUIAPI void GuiTextBoxSetCursor(int cursor); // Set cursor position of active textbox +RAYGUIAPI int GuiTextBoxGetCursor(void); // Get cursor position of active textbox -RAYGUIDEF void GuiTextBoxSetSelection(int start, int length); // Set selection of active textbox -RAYGUIDEF Vector2 GuiTextBoxGetSelection(void); // Get selection of active textbox (x - selection start y - selection length) +RAYGUIAPI void GuiTextBoxSetSelection(int start, int length); // Set selection of active textbox +RAYGUIAPI Vector2 GuiTextBoxGetSelection(void); // Get selection of active textbox (x - selection start y - selection length) -RAYGUIDEF bool GuiTextBoxIsActive(Rectangle bounds); // Returns true if a textbox control with specified `bounds` is the active textbox -RAYGUIDEF GuiTextBoxState GuiTextBoxGetState(void); // Get state for the active textbox -RAYGUIDEF void GuiTextBoxSetState(GuiTextBoxState state); // Set state for the active textbox (state must be valid else things will break) +RAYGUIAPI bool GuiTextBoxIsActive(Rectangle bounds); // Returns true if a textbox control with specified `bounds` is the active textbox +RAYGUIAPI GuiTextBoxState GuiTextBoxGetState(void); // Get state for the active textbox +RAYGUIAPI void GuiTextBoxSetState(GuiTextBoxState state); // Set state for the active textbox (state must be valid else things will break) -RAYGUIDEF void GuiTextBoxSelectAll(const char *text); // Select all characters in the active textbox (same as pressing `CTRL` + `A`) -RAYGUIDEF void GuiTextBoxCopy(const char *text); // Copy selected text to clipboard from the active textbox (same as pressing `CTRL` + `C`) -RAYGUIDEF void GuiTextBoxPaste(char *text, int textSize); // Paste text from clipboard into the textbox (same as pressing `CTRL` + `V`) -RAYGUIDEF void GuiTextBoxCut(char *text); // Cut selected text in the active textbox and copy it to clipboard (same as pressing `CTRL` + `X`) -RAYGUIDEF int GuiTextBoxDelete(char *text, int length, bool before); // Deletes a character or selection before from the active textbox (depending on `before`). Returns bytes deleted. -RAYGUIDEF int GuiTextBoxGetByteIndex(const char *text, int start, int from, int to); // Get the byte index for a character starting at position `from` with index `start` until position `to`. +RAYGUIAPI void GuiTextBoxSelectAll(const char *text); // Select all characters in the active textbox (same as pressing `CTRL` + `A`) +RAYGUIAPI void GuiTextBoxCopy(const char *text); // Copy selected text to clipboard from the active textbox (same as pressing `CTRL` + `C`) +RAYGUIAPI void GuiTextBoxPaste(char *text, int textSize); // Paste text from clipboard into the textbox (same as pressing `CTRL` + `V`) +RAYGUIAPI void GuiTextBoxCut(char *text); // Cut selected text in the active textbox and copy it to clipboard (same as pressing `CTRL` + `X`) +RAYGUIAPI int GuiTextBoxDelete(char *text, int length, bool before); // Deletes a character or selection before from the active textbox (depending on `before`). Returns bytes deleted. +RAYGUIAPI int GuiTextBoxGetByteIndex(const char *text, int start, int from, int to); // Get the byte index for a character starting at position `from` with index `start` until position `to`. -RAYGUIDEF bool GuiTextBoxEx(Rectangle bounds, char *text, int textSize, bool editMode); +RAYGUIAPI bool GuiTextBoxEx(Rectangle bounds, char *text, int textSize, bool editMode); -RAYGUIDEF static void DrawTextRec(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint); // Draw text using font inside rectangle limits -RAYGUIDEF static void DrawTextRecEx(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint, int selectStart, int selectLength, Color selectTint, Color selectBackTint); // Draw text using font inside rectangle limits with support for text selection -RAYGUIDEF static void DrawTextBoxedSelectable(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint, int selectStart, int selectLength, Color selectTint, Color selectBackTint); // Alias for above +RAYGUIAPI static void DrawTextRec(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint); // Draw text using font inside rectangle limits +RAYGUIAPI static void DrawTextRecEx(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint, int selectStart, int selectLength, Color selectTint, Color selectBackTint); // Draw text using font inside rectangle limits with support for text selection +RAYGUIAPI static void DrawTextBoxedSelectable(Font font, const char *text, Rectangle rec, float fontSize, float spacing, bool wordWrap, Color tint, int selectStart, int selectLength, Color selectTint, Color selectBackTint); // Alias for above #ifdef __cplusplus } @@ -288,27 +288,27 @@ static int EncodeCodepoint(unsigned int c, char out[5]); //---------------------------------------------------------------------------------- // Sets the active textbox (reseting state of the previous active textbox) -RAYGUIDEF void GuiTextBoxSetActive(Rectangle bounds) +RAYGUIAPI void GuiTextBoxSetActive(Rectangle bounds) { guiTextBoxActive = bounds; guiTextBoxState = (GuiTextBoxState){ .cursor = -1, .start = 0, .index = 0, .select = -1 }; } // Gets bounds of active textbox -RAYGUIDEF Rectangle GuiTextBoxGetActive(void) { return guiTextBoxActive; } +RAYGUIAPI Rectangle GuiTextBoxGetActive(void) { return guiTextBoxActive; } // Set cursor position of active textbox -RAYGUIDEF void GuiTextBoxSetCursor(int cursor) +RAYGUIAPI void GuiTextBoxSetCursor(int cursor) { guiTextBoxState.cursor = (cursor < 0) ? -1 : cursor; guiTextBoxState.start = -1; // Mark this to be recalculated } // Get cursor position of active textbox -RAYGUIDEF int GuiTextBoxGetCursor(void) { return guiTextBoxState.cursor; } +RAYGUIAPI int GuiTextBoxGetCursor(void) { return guiTextBoxState.cursor; } // Set selection of active textbox -RAYGUIDEF void GuiTextBoxSetSelection(int start, int length) +RAYGUIAPI void GuiTextBoxSetSelection(int start, int length) { if (start < 0) start = 0; if (length < 0) length = 0; @@ -318,7 +318,7 @@ RAYGUIDEF void GuiTextBoxSetSelection(int start, int length) } // Get selection of active textbox -RAYGUIDEF Vector2 GuiTextBoxGetSelection(void) +RAYGUIAPI Vector2 GuiTextBoxGetSelection(void) { if (guiTextBoxState.select == -1 || guiTextBoxState.select == guiTextBoxState.cursor) return RAYGUI_CLITERAL(Vector2){ 0 }; else if (guiTextBoxState.cursor > guiTextBoxState.select) return RAYGUI_CLITERAL(Vector2){ (float)guiTextBoxState.select, (float)guiTextBoxState.cursor - guiTextBoxState.select }; @@ -327,20 +327,20 @@ RAYGUIDEF Vector2 GuiTextBoxGetSelection(void) } // Returns true if a textbox control with specified `bounds` is the active textbox -RAYGUIDEF bool GuiTextBoxIsActive(Rectangle bounds) +RAYGUIAPI bool GuiTextBoxIsActive(Rectangle bounds) { return (bounds.x == guiTextBoxActive.x && bounds.y == guiTextBoxActive.y && bounds.width == guiTextBoxActive.width && bounds.height == guiTextBoxActive.height); } -RAYGUIDEF GuiTextBoxState GuiTextBoxGetState(void) { return guiTextBoxState; } -RAYGUIDEF void GuiTextBoxSetState(GuiTextBoxState state) +RAYGUIAPI GuiTextBoxState GuiTextBoxGetState(void) { return guiTextBoxState; } +RAYGUIAPI void GuiTextBoxSetState(GuiTextBoxState state) { // NOTE: should we check if state values are valid ?!? guiTextBoxState = state; } -RAYGUIDEF int GuiTextBoxGetByteIndex(const char *text, int start, int from, int to) +RAYGUIAPI int GuiTextBoxGetByteIndex(const char *text, int start, int from, int to) { int i = start, k = from; @@ -357,7 +357,7 @@ RAYGUIDEF int GuiTextBoxGetByteIndex(const char *text, int start, int from, int return i; } -RAYGUIDEF int GuiTextBoxDelete(char *text, int length, bool before) +RAYGUIAPI int GuiTextBoxDelete(char *text, int length, bool before) { if ((guiTextBoxState.cursor != -1) && (text != NULL)) { @@ -417,7 +417,7 @@ RAYGUIDEF int GuiTextBoxDelete(char *text, int length, bool before) return 0; } -RAYGUIDEF void GuiTextBoxSelectAll(const char *text) +RAYGUIAPI void GuiTextBoxSelectAll(const char *text) { guiTextBoxState.cursor = GuiCountCodepointsUntilNewline(text); @@ -429,7 +429,7 @@ RAYGUIDEF void GuiTextBoxSelectAll(const char *text) else guiTextBoxState.select = -1; } -RAYGUIDEF void GuiTextBoxCopy(const char *text) +RAYGUIAPI void GuiTextBoxCopy(const char *text) { if ((text != NULL) && (guiTextBoxState.select != -1) && @@ -459,7 +459,7 @@ RAYGUIDEF void GuiTextBoxCopy(const char *text) // Paste text from clipboard into the active textbox. // `text` is the pointer to the buffer used by the textbox while `textSize` is the text buffer max size -RAYGUIDEF void GuiTextBoxPaste(char *text, int textSize) +RAYGUIAPI void GuiTextBoxPaste(char *text, int textSize) { const char *clipText = GetClipboardText(); // GLFW guaratees this should be UTF8 encoded! int length = strlen(text); @@ -501,7 +501,7 @@ RAYGUIDEF void GuiTextBoxPaste(char *text, int textSize) } } -RAYGUIDEF void GuiTextBoxCut(char* text) +RAYGUIAPI void GuiTextBoxCut(char* text) { if ((text != NULL) && (guiTextBoxState.select != -1) && @@ -541,7 +541,7 @@ RAYGUIDEF void GuiTextBoxCut(char* text) // A text box control supporting text selection, cursor positioning and commonly used keyboard shortcuts. // NOTE 1: Requires static variables: framesCounter // NOTE 2: Returns if KEY_ENTER pressed (useful for data validation) -RAYGUIDEF bool GuiTextBoxEx(Rectangle bounds, char *text, int textSize, bool editMode) +RAYGUIAPI bool GuiTextBoxEx(Rectangle bounds, char *text, int textSize, bool editMode) { // Define the cursor movement/selection speed when movement keys are held/pressed #define TEXTBOX_CURSOR_COOLDOWN 5 diff --git a/src/raygui.h b/src/raygui.h index b274b4f..71c71e6 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -105,10 +105,10 @@ * internally in the library and input management and drawing functions must be provided by * the user (check library implementation for further details). * -* #define RAYGUI_SUPPORT_RICONS -* Includes embedded ricons data (binary format) and definitions (by default 256 16x16 pixels, 2KB) +* #define RAYGUI_NO_RICONS +* Avoid including embedded ricons data (256 icons, 16x16 pixels, 1-bit per pixel, 2KB) * -* #define RAYGUI_SUPPORT_CUSTOM_RICONS +* #define RAYGUI_CUSTOM_RICONS * Includes custom ricons.h header defining a set of custom icons, * this file can be generated using rGuiIcons tool * @@ -187,17 +187,18 @@ #include "raylib.h" #endif -#ifndef RAYGUIDEF - #define RAYGUIDEF // We are building or using rlgl as a static library (or Linux shared library) +// Functions qualifiers/attributes definition +#ifndef RAYGUIAPI + #define RAYGUIAPI // We are defining our functions as 'extern' by default (implicit attribute) #endif -// Define functions scope to be used internally (static) or externally (extern) to the module including this file +// Function qualifiers in case library is build/used as a shared library #if defined(_WIN32) - // Microsoft attibutes to tell compiler that symbols are imported/exported from a .dll + // Microsoft attributes to tell compiler that symbols are imported/exported from a .dll #if defined(BUILD_LIBTYPE_SHARED) - #define RAYGUIDEF __declspec(dllexport) // We are building raygui as a Win32 shared library (.dll) + #define RAYGUIAPI __declspec(dllexport) // We are building this library as a Win32 shared library (.dll) #elif defined(USE_LIBTYPE_SHARED) - #define RAYGUIDEF __declspec(dllimport) // We are using raygui as a Win32 shared library (.dll) + #define RAYGUIAPI __declspec(dllimport) // We are using this library as a Win32 shared library (.dll) #endif #endif @@ -463,87 +464,87 @@ extern "C" { // Prevents name mangling of functions #endif // Global gui state control functions -RAYGUIDEF void GuiEnable(void); // Enable gui controls (global state) -RAYGUIDEF void GuiDisable(void); // Disable gui controls (global state) -RAYGUIDEF void GuiLock(void); // Lock gui controls (global state) -RAYGUIDEF void GuiUnlock(void); // Unlock gui controls (global state) -RAYGUIDEF bool GuiIsLocked(void); // Check if gui is locked (global state) -RAYGUIDEF void GuiFade(float alpha); // Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f -RAYGUIDEF void GuiSetState(int state); // Set gui state (global state) -RAYGUIDEF int GuiGetState(void); // Get gui state (global state) +RAYGUIAPI void GuiEnable(void); // Enable gui controls (global state) +RAYGUIAPI void GuiDisable(void); // Disable gui controls (global state) +RAYGUIAPI void GuiLock(void); // Lock gui controls (global state) +RAYGUIAPI void GuiUnlock(void); // Unlock gui controls (global state) +RAYGUIAPI bool GuiIsLocked(void); // Check if gui is locked (global state) +RAYGUIAPI void GuiFade(float alpha); // Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f +RAYGUIAPI void GuiSetState(int state); // Set gui state (global state) +RAYGUIAPI int GuiGetState(void); // Get gui state (global state) // Font set/get functions -RAYGUIDEF void GuiSetFont(Font font); // Set gui custom font (global state) -RAYGUIDEF Font GuiGetFont(void); // Get gui custom font (global state) +RAYGUIAPI void GuiSetFont(Font font); // Set gui custom font (global state) +RAYGUIAPI Font GuiGetFont(void); // Get gui custom font (global state) // Style set/get functions -RAYGUIDEF void GuiSetStyle(int control, int property, int value); // Set one style property -RAYGUIDEF int GuiGetStyle(int control, int property); // Get one style property +RAYGUIAPI void GuiSetStyle(int control, int property, int value); // Set one style property +RAYGUIAPI int GuiGetStyle(int control, int property); // Get one style property // Container/separator controls, useful for controls organization -RAYGUIDEF bool GuiWindowBox(Rectangle bounds, const char *title); // Window Box control, shows a window that can be closed -RAYGUIDEF void GuiGroupBox(Rectangle bounds, const char *text); // Group Box control with text name -RAYGUIDEF void GuiLine(Rectangle bounds, const char *text); // Line separator control, could contain text -RAYGUIDEF void GuiPanel(Rectangle bounds); // Panel control, useful to group controls -RAYGUIDEF Rectangle GuiScrollPanel(Rectangle bounds, Rectangle content, Vector2 *scroll); // Scroll Panel control +RAYGUIAPI bool GuiWindowBox(Rectangle bounds, const char *title); // Window Box control, shows a window that can be closed +RAYGUIAPI void GuiGroupBox(Rectangle bounds, const char *text); // Group Box control with text name +RAYGUIAPI void GuiLine(Rectangle bounds, const char *text); // Line separator control, could contain text +RAYGUIAPI void GuiPanel(Rectangle bounds); // Panel control, useful to group controls +RAYGUIAPI Rectangle GuiScrollPanel(Rectangle bounds, Rectangle content, Vector2 *scroll); // Scroll Panel control // Basic controls set -RAYGUIDEF void GuiLabel(Rectangle bounds, const char *text); // Label control, shows text -RAYGUIDEF bool GuiButton(Rectangle bounds, const char *text); // Button control, returns true when clicked -RAYGUIDEF bool GuiLabelButton(Rectangle bounds, const char *text); // Label button control, show true when clicked -RAYGUIDEF bool GuiImageButton(Rectangle bounds, const char *text, Texture2D texture); // Image button control, returns true when clicked -RAYGUIDEF bool GuiImageButtonEx(Rectangle bounds, const char *text, Texture2D texture, Rectangle texSource); // Image button extended control, returns true when clicked -RAYGUIDEF bool GuiToggle(Rectangle bounds, const char *text, bool active); // Toggle Button control, returns true when active -RAYGUIDEF int GuiToggleGroup(Rectangle bounds, const char *text, int active); // Toggle Group control, returns active toggle index -RAYGUIDEF bool GuiCheckBox(Rectangle bounds, const char *text, bool checked); // Check Box control, returns true when active -RAYGUIDEF int GuiComboBox(Rectangle bounds, const char *text, int active); // Combo Box control, returns selected item index -RAYGUIDEF bool GuiDropdownBox(Rectangle bounds, const char *text, int *active, bool editMode); // Dropdown Box control, returns selected item -RAYGUIDEF bool GuiSpinner(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode); // Spinner control, returns selected value -RAYGUIDEF bool GuiValueBox(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode); // Value Box control, updates input text with numbers -RAYGUIDEF bool GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode); // Text Box control, updates input text -RAYGUIDEF bool GuiTextBoxMulti(Rectangle bounds, char *text, int textSize, bool editMode); // Text Box control with multiple lines -RAYGUIDEF float GuiSlider(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue); // Slider control, returns selected value -RAYGUIDEF float GuiSliderBar(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue); // Slider Bar control, returns selected value -RAYGUIDEF float GuiProgressBar(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue); // Progress Bar control, shows current progress value -RAYGUIDEF void GuiStatusBar(Rectangle bounds, const char *text); // Status Bar control, shows info text -RAYGUIDEF void GuiDummyRec(Rectangle bounds, const char *text); // Dummy control for placeholders -RAYGUIDEF int GuiScrollBar(Rectangle bounds, int value, int minValue, int maxValue); // Scroll Bar control -RAYGUIDEF Vector2 GuiGrid(Rectangle bounds, float spacing, int subdivs); // Grid control +RAYGUIAPI void GuiLabel(Rectangle bounds, const char *text); // Label control, shows text +RAYGUIAPI bool GuiButton(Rectangle bounds, const char *text); // Button control, returns true when clicked +RAYGUIAPI bool GuiLabelButton(Rectangle bounds, const char *text); // Label button control, show true when clicked +RAYGUIAPI bool GuiImageButton(Rectangle bounds, const char *text, Texture2D texture); // Image button control, returns true when clicked +RAYGUIAPI bool GuiImageButtonEx(Rectangle bounds, const char *text, Texture2D texture, Rectangle texSource); // Image button extended control, returns true when clicked +RAYGUIAPI bool GuiToggle(Rectangle bounds, const char *text, bool active); // Toggle Button control, returns true when active +RAYGUIAPI int GuiToggleGroup(Rectangle bounds, const char *text, int active); // Toggle Group control, returns active toggle index +RAYGUIAPI bool GuiCheckBox(Rectangle bounds, const char *text, bool checked); // Check Box control, returns true when active +RAYGUIAPI int GuiComboBox(Rectangle bounds, const char *text, int active); // Combo Box control, returns selected item index +RAYGUIAPI bool GuiDropdownBox(Rectangle bounds, const char *text, int *active, bool editMode); // Dropdown Box control, returns selected item +RAYGUIAPI bool GuiSpinner(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode); // Spinner control, returns selected value +RAYGUIAPI bool GuiValueBox(Rectangle bounds, const char *text, int *value, int minValue, int maxValue, bool editMode); // Value Box control, updates input text with numbers +RAYGUIAPI bool GuiTextBox(Rectangle bounds, char *text, int textSize, bool editMode); // Text Box control, updates input text +RAYGUIAPI bool GuiTextBoxMulti(Rectangle bounds, char *text, int textSize, bool editMode); // Text Box control with multiple lines +RAYGUIAPI float GuiSlider(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue); // Slider control, returns selected value +RAYGUIAPI float GuiSliderBar(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue); // Slider Bar control, returns selected value +RAYGUIAPI float GuiProgressBar(Rectangle bounds, const char *textLeft, const char *textRight, float value, float minValue, float maxValue); // Progress Bar control, shows current progress value +RAYGUIAPI void GuiStatusBar(Rectangle bounds, const char *text); // Status Bar control, shows info text +RAYGUIAPI void GuiDummyRec(Rectangle bounds, const char *text); // Dummy control for placeholders +RAYGUIAPI int GuiScrollBar(Rectangle bounds, int value, int minValue, int maxValue); // Scroll Bar control +RAYGUIAPI Vector2 GuiGrid(Rectangle bounds, float spacing, int subdivs); // Grid control // Advance controls set -RAYGUIDEF int GuiListView(Rectangle bounds, const char *text, int *scrollIndex, int active); // List View control, returns selected list item index -RAYGUIDEF int GuiListViewEx(Rectangle bounds, const char **text, int count, int *focus, int *scrollIndex, int active); // List View with extended parameters -RAYGUIDEF int GuiMessageBox(Rectangle bounds, const char *title, const char *message, const char *buttons); // Message Box control, displays a message -RAYGUIDEF int GuiTextInputBox(Rectangle bounds, const char *title, const char *message, const char *buttons, char *text); // Text Input Box control, ask for text -RAYGUIDEF Color GuiColorPicker(Rectangle bounds, Color color); // Color Picker control (multiple color controls) -RAYGUIDEF Color GuiColorPanel(Rectangle bounds, Color color); // Color Panel control -RAYGUIDEF float GuiColorBarAlpha(Rectangle bounds, float alpha); // Color Bar Alpha control -RAYGUIDEF float GuiColorBarHue(Rectangle bounds, float value); // Color Bar Hue control +RAYGUIAPI int GuiListView(Rectangle bounds, const char *text, int *scrollIndex, int active); // List View control, returns selected list item index +RAYGUIAPI int GuiListViewEx(Rectangle bounds, const char **text, int count, int *focus, int *scrollIndex, int active); // List View with extended parameters +RAYGUIAPI int GuiMessageBox(Rectangle bounds, const char *title, const char *message, const char *buttons); // Message Box control, displays a message +RAYGUIAPI int GuiTextInputBox(Rectangle bounds, const char *title, const char *message, const char *buttons, char *text); // Text Input Box control, ask for text +RAYGUIAPI Color GuiColorPicker(Rectangle bounds, Color color); // Color Picker control (multiple color controls) +RAYGUIAPI Color GuiColorPanel(Rectangle bounds, Color color); // Color Panel control +RAYGUIAPI float GuiColorBarAlpha(Rectangle bounds, float alpha); // Color Bar Alpha control +RAYGUIAPI float GuiColorBarHue(Rectangle bounds, float value); // Color Bar Hue control // Styles loading functions -RAYGUIDEF void GuiLoadStyle(const char *fileName); // Load style file over global style variable (.rgs) -RAYGUIDEF void GuiLoadStyleDefault(void); // Load style default over global style +RAYGUIAPI void GuiLoadStyle(const char *fileName); // Load style file over global style variable (.rgs) +RAYGUIAPI void GuiLoadStyleDefault(void); // Load style default over global style /* typedef GuiStyle (unsigned int *) -RAYGUIDEF GuiStyle LoadGuiStyle(const char *fileName); // Load style from file (.rgs) -RAYGUIDEF void UnloadGuiStyle(GuiStyle style); // Unload style +RAYGUIAPI GuiStyle LoadGuiStyle(const char *fileName); // Load style from file (.rgs) +RAYGUIAPI void UnloadGuiStyle(GuiStyle style); // Unload style */ -RAYGUIDEF const char *GuiIconText(int iconId, const char *text); // Get text with icon id prepended (if supported) +RAYGUIAPI const char *GuiIconText(int iconId, const char *text); // Get text with icon id prepended (if supported) -#if defined(RAYGUI_SUPPORT_RICONS) +#if !defined(RAYGUI_NO_RICONS) // Gui icons functionality -RAYGUIDEF void GuiDrawIcon(int iconId, Vector2 position, int pixelSize, Color color); +RAYGUIAPI void GuiDrawIcon(int iconId, Vector2 position, int pixelSize, Color color); -RAYGUIDEF unsigned int *GuiGetIcons(void); // Get full icons data pointer -RAYGUIDEF unsigned int *GuiGetIconData(int iconId); // Get icon bit data -RAYGUIDEF void GuiSetIconData(int iconId, unsigned int *data); // Set icon bit data +RAYGUIAPI unsigned int *GuiGetIcons(void); // Get full icons data pointer +RAYGUIAPI unsigned int *GuiGetIconData(int iconId); // Get icon bit data +RAYGUIAPI void GuiSetIconData(int iconId, unsigned int *data); // Set icon bit data -RAYGUIDEF void GuiSetIconPixel(int iconId, int x, int y); // Set icon pixel value -RAYGUIDEF void GuiClearIconPixel(int iconId, int x, int y); // Clear icon pixel value -RAYGUIDEF bool GuiCheckIconPixel(int iconId, int x, int y); // Check icon pixel value +RAYGUIAPI void GuiSetIconPixel(int iconId, int x, int y); // Set icon pixel value +RAYGUIAPI void GuiClearIconPixel(int iconId, int x, int y); // Clear icon pixel value +RAYGUIAPI bool GuiCheckIconPixel(int iconId, int x, int y); // Check icon pixel value #endif #if defined(__cplusplus) @@ -574,9 +575,9 @@ RAYGUIDEF bool GuiCheckIconPixel(int iconId, int x, int y); // Check icon pi #define RAYGUI_CLITERAL(name) (name) #endif -#if defined(RAYGUI_SUPPORT_RICONS) +#if !defined(RAYGUI_NO_RICONS) -#if defined(RAYGUI_SUPPORT_CUSTOM_RICONS) +#if defined(RAYGUI_CUSTOM_RICONS) #define RICONS_IMPLEMENTATION #include "ricons.h" // External icons data provided, it can be generated with rGuiIcons tool @@ -1125,9 +1126,9 @@ static unsigned int guiIcons[RICON_MAX_ICONS*RICON_DATA_ELEMENTS] = { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, // RICON_255 }; -#endif // RAYGUI_SUPPORT_CUSTOM_RICONS +#endif // RAYGUI_CUSTOM_RICONS -#endif // RAYGUI_SUPPORT_RICONS +#endif // !RAYGUI_NO_RICONS #ifndef RICON_SIZE #define RICON_SIZE 0 @@ -1369,10 +1370,10 @@ bool GuiWindowBox(Rectangle bounds, const char *title) int tempTextAlignment = GuiGetStyle(BUTTON, TEXT_ALIGNMENT); GuiSetStyle(BUTTON, BORDER_WIDTH, 1); GuiSetStyle(BUTTON, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER); -#if defined(RAYGUI_SUPPORT_RICONS) - clicked = GuiButton(closeButtonRec, GuiIconText(RICON_CROSS_SMALL, NULL)); -#else +#if defined(RAYGUI_NO_RICONS) clicked = GuiButton(closeButtonRec, "x"); +#else + clicked = GuiButton(closeButtonRec, GuiIconText(RICON_CROSS_SMALL, NULL)); #endif GuiSetStyle(BUTTON, BORDER_WIDTH, tempBorderWidth); GuiSetStyle(BUTTON, TEXT_ALIGNMENT, tempTextAlignment); @@ -2145,12 +2146,12 @@ bool GuiSpinner(Rectangle bounds, const char *text, int *value, int minValue, in GuiSetStyle(BUTTON, BORDER_WIDTH, GuiGetStyle(SPINNER, BORDER_WIDTH)); GuiSetStyle(BUTTON, TEXT_ALIGNMENT, GUI_TEXT_ALIGN_CENTER); -#if defined(RAYGUI_SUPPORT_RICONS) - if (GuiButton(leftButtonBound, GuiIconText(RICON_ARROW_LEFT_FILL, NULL))) tempValue--; - if (GuiButton(rightButtonBound, GuiIconText(RICON_ARROW_RIGHT_FILL, NULL))) tempValue++; -#else +#if defined(RAYGUI_NO_RICONS) if (GuiButton(leftButtonBound, "<")) tempValue--; if (GuiButton(rightButtonBound, ">")) tempValue++; +#else + if (GuiButton(leftButtonBound, GuiIconText(RICON_ARROW_LEFT_FILL, NULL))) tempValue--; + if (GuiButton(rightButtonBound, GuiIconText(RICON_ARROW_RIGHT_FILL, NULL))) tempValue++; #endif GuiSetStyle(BUTTON, TEXT_ALIGNMENT, tempTextAlign); @@ -3626,7 +3627,9 @@ void GuiLoadStyleDefault(void) // a number that can change between ricon versions const char *GuiIconText(int iconId, const char *text) { -#if defined(RAYGUI_SUPPORT_RICONS) +#if defined(RAYGUI_NO_RICONS) + return NULL; +#else static char buffer[1024] = { 0 }; memset(buffer, 0, 1024); @@ -3642,12 +3645,10 @@ const char *GuiIconText(int iconId, const char *text) } return buffer; -#else - return NULL; #endif } -#if defined(RAYGUI_SUPPORT_RICONS) +#if !defined(RAYGUI_NO_RICONS) // Get full icons data pointer unsigned int *GuiGetIcons(void) { return guiIcons; } @@ -3793,7 +3794,7 @@ bool GuiCheckIconPixel(int iconId, int x, int y) return (BIT_CHECK(guiIcons[iconId*8 + y/2], x + (y%2*16))); } -#endif // RAYGUI_SUPPORT_RICONS +#endif // !RAYGUI_NO_RICONS //---------------------------------------------------------------------------------- // Module specific Functions Definition @@ -3842,7 +3843,7 @@ static Rectangle GetTextBounds(int control, Rectangle bounds) // NOTE: We support up to 999 values for iconId static const char *GetTextIcon(const char *text, int *iconId) { -#if defined(RAYGUI_SUPPORT_RICONS) +#if !defined(RAYGUI_NO_RICONS) *iconId = -1; if (text[0] == '#') // Maybe we have an icon! { @@ -3927,7 +3928,7 @@ static void GuiDrawText(const char *text, Rectangle bounds, int alignment, Color // Draw text (with icon if available) //--------------------------------------------------------------------------------- -#if defined(RAYGUI_SUPPORT_RICONS) +#if !defined(RAYGUI_NO_RICONS) if (iconId >= 0) { // NOTE: We consider icon height, probably different than text size