Gooey Documentation
Version 1.0.2
Complete API reference and developer guides
API Reference
gooey.h
Functions
Gooey_Init
functionInitializes the Gooey system with the selected backend. Currently, only the GLPS (OpenGL) backend is supported.
int Gooey_Init();
Return Value
int
gooey_animations.h
Functions
GooeyAnimation_TranslateX
functionAnimates a widget's horizontal position Creates a smooth translation animation along the X-axis from start to end position. The animation speed controls the duration and easing of the movement.
@param[in,out] widget Pointer to the widget to animate @param[in] start Starting X position in pixels @param[in] end Target X position in pixels @param[in] speed Animation speed (pixels per second or normalized 0.0-1.0)
void GooeyAnimation_TranslateX(GooeyWidget * widget, int start, int end, float speed);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyWidget * | widget | |
int | start | |
int | end | |
float | speed |
Return Value
void
GooeyAnimation_TranslateY
functionAnimates a widget's vertical position Creates a smooth translation animation along the Y-axis from start to end position. The animation speed controls the duration and easing of the movement.
@param[in,out] widget Pointer to the widget to animate @param[in] start Starting Y position in pixels @param[in] end Target Y position in pixels @param[in] speed Animation speed (pixels per second or normalized 0.0-1.0)
void GooeyAnimation_TranslateY(GooeyWidget * widget, int start, int end, float speed);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyWidget * | widget | |
int | start | |
int | end | |
float | speed |
Return Value
void
gooey_common.h
Data Types
struct GooeyEvent
structGeneral event structure.
Members
| Type | Name | Description |
|---|---|---|
GooeyEventType | type | |
GooeyMouseData | click | |
GooeyMouseData | mouse_move | |
GooeyMouseData | mouse_scroll | |
GooeyKeyPressData | key_press | |
GooeyDropData | drop_data |
struct GooeyEvent
{
GooeyEventType type;
union
{
GooeyMouseData click;
GooeyMouseData mouse_move;
GooeyMouseData mouse_scroll;
GooeyKeyPressData key_press;
GooeyDropData drop_data;
};
};
typedef GooeyEventType
typedefEnumeration of event types.
typedef enum
{
GOOEY_EVENT_CLICK_PRESS,
GOOEY_EVENT_CLICK_RELEASE,
GOOEY_EVENT_MOUSE_MOVE,
GOOEY_EVENT_MOUSE_SCROLL,
GOOEY_EVENT_KEY_PRESS,
GOOEY_EVENT_KEY_RELEASE,
GOOEY_EVENT_WINDOW_CLOSE,
GOOEY_EVENT_EXPOSE,
GOOEY_EVENT_RESIZE,
GOOEY_EVENT_REDRAWREQ,
GOOEY_EVENT_DROP,
GOOEY_EVENT_VK_ENTER,
GOOEY_EVENT_RESET
} GooeyEventType;
struct GooeyWindow
structInternal definitions for the Gooey GUI library.
typedef struct GooeyWindow GooeyWindow;
typedef state
typedefKeyboard key press event data.
typedef struct
{
unsigned int state;
char value[20];
unsigned long keycode;
} GooeyKeyPressData;
typedef state
typedefFile drop event data.
typedef struct
{
unsigned int state;
char mime[20];
char file_path[1024];
int drop_x;
int drop_y;
} GooeyDropData;
typedef x
typedefMouse event data.
typedef struct
{
int x;
int y;
} GooeyMouseData;
gooey_theme.h
Data Types
typedef base
typedefStructure representing a theme for the Gooey UI. The colors in the theme are stored as unsigned long values representing the color codes (typically in hexadecimal format).
typedef struct
{
unsigned long base; /**< Base window background color */
unsigned long neutral; /**< Neutral color for text */
unsigned long widget_base; /**< Base widget color */
unsigned long primary; /**< Primary color */
unsigned long danger; /**< Danger color */
unsigned long info; /**< Info color */
unsigned long success; /**< Success color */
} GooeyTheme;
Functions
parser_load_theme_from_file
functionStructure representing a theme for the Gooey UI. The colors in the theme are stored as unsigned long values representing the color codes (typically in hexadecimal format).
GooeyTheme parser_load_theme_from_file(const char * filePath, bool * is_theme_loaded);
Parameters
| Type | Name | Description |
|---|---|---|
const char * | filePath | |
bool * | is_theme_loaded |
Return Value
GooeyTheme
gooey_meter.h
Functions
*GooeyMeter_Create
functionCreates a meter widget. Initializes a new GooeyMeter widget at the specified position and size, with an initial value, a label, and an optional icon.
GooeyMeter *GooeyMeter_Create(int x, int y, int width, int height, long initial_value, const char * label, const char * icon_path);
Parameters
| Type | Name | Description |
|---|---|---|
int | x | The x-coordinate of the meter's position. |
int | y | The y-coordinate of the meter's position. |
int | width | The width of the meter. |
int | height | The height of the meter. |
long | initial_value | The initial value displayed by the meter. |
const char * | label | A text label to display with the meter. |
const char * | icon_path | Path to an icon image to display with the meter (can be NULL). |
Return Value
GooeyMeter
GooeyMeter_Update
functionUpdates the value displayed by the meter.
void GooeyMeter_Update(GooeyMeter * meter, long new_value);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyMeter * | meter | The GooeyMeter instance to update. |
long | new_value | The new value to set. |
Return Value
void
gooey_plot.h
Functions
*GooeyPlot_Create
functionCreates a plot widget. Adds a plot widget of the specified type to the given position and size, using the provided plot data.
GooeyPlot *GooeyPlot_Create(GOOEY_PLOT_TYPE plot_type, GooeyPlotData * data, int x, int y, int width, int height);
Parameters
| Type | Name | Description |
|---|---|---|
GOOEY_PLOT_TYPE | plot_type | The type of plot to be created (e.g., LINE, BAR). |
GooeyPlotData * | data | Pointer to the plot data structure. |
int | x | The x-coordinate of the plot's position. |
int | y | The y-coordinate of the plot's position. |
int | width | The width of the plot widget. |
int | height | The height of the plot widget. |
Return Value
GooeyPlot
GooeyPlot_Update
functionUpdates an existing plot with new data. Updates the content of the given plot widget while maintaining its configuration and type.
void GooeyPlot_Update(GooeyPlot * plot, GooeyPlotData * new_data);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyPlot * | plot | Pointer to the plot widget to update. |
GooeyPlotData * | new_data | Pointer to the new data to update the plot with. |
Return Value
void
gooey_label.h
Functions
*GooeyLabel_Create
functionHeader file for the GooeyLabel module. Provides functions for creating, modifying, and rendering text labels within a GooeyWindow.
GooeyLabel *GooeyLabel_Create(const char * text, float font_size, int x, int y);
Parameters
| Type | Name | Description |
|---|---|---|
const char * | text | |
float | font_size | |
int | x | |
int | y |
Return Value
GooeyLabel
GooeyLabel_SetColor
functionSets the text color of a label. Changes the text color of a label to the specified color.
void GooeyLabel_SetColor(GooeyLabel * label, unsigned long color);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyLabel * | label | A pointer to the label whose color is to be changed. |
unsigned long | color | An unsigned long representing the color (e.g., 0xFF0000 for red). |
Return Value
void
GooeyLabel_SetText
functionSets the text of an existing label. Updates the text displayed by a given GooeyLabel.
void GooeyLabel_SetText(GooeyLabel * label, const char * text);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyLabel * | label | The label to update. |
const char * | text | The new text to display on the label. |
Return Value
void
gooey_progressbar.h
Functions
*GooeyProgressBar_Create
functionCreates a progress bar widget. Initializes a new progress bar at the specified position and size, with an initial value.
GooeyProgressBar *GooeyProgressBar_Create(int x, int y, int width, int height, long initial_value);
Parameters
| Type | Name | Description |
|---|---|---|
int | x | The x-coordinate of the progress bar. |
int | y | The y-coordinate of the progress bar. |
int | width | The width of the progress bar. |
int | height | The height of the progress bar. |
long | initial_value | The initial progress value. |
Return Value
GooeyProgressBar
GooeyProgressBar_Update
functionUpdates the value of an existing progress bar. Changes the displayed progress to the new value.
void GooeyProgressBar_Update(GooeyProgressBar * progressbar, long new_value);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyProgressBar * | progressbar | Pointer to the progress bar to update. |
long | new_value | The new progress value. |
Return Value
void
gooey_dropdown.h
Functions
GooeyDropdown_Update
functionHeader file for the GooeyDropdown module. Provides functions to create, handle, and render dropdown menus within a GooeyWindow.
void GooeyDropdown_Update(GooeyDropdown * dropdown, const char ** new_options, int new_num_options);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyDropdown * | dropdown | |
const char ** | new_options | |
int | new_num_options |
Return Value
void
gooey_container.h
Functions
GooeyContainer_AddWidget
functionAdds a widget to a specific container within the window.
void GooeyContainer_AddWidget(GooeyWindow* window, GooeyContainers* container, size_t container_id, void * widget);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyWindow* | window | The target GooeyWindow. |
GooeyContainers* | container | The container to add the widget into. |
size_t | container_id | The ID of the target sub-container. |
void * | widget | Pointer to the widget to add. |
Return Value
void
GooeyContainer_Create
functionCreates a new container with the given position and dimensions.
GooeyContainers* GooeyContainer_Create(int x, int y, int width, int height);
Parameters
| Type | Name | Description |
|---|---|---|
int | x | X-coordinate of the container. |
int | y | Y-coordinate of the container. |
int | width | Width of the container. |
int | height | Height of the container. |
Return Value
GooeyContainers*
GooeyContainer_InsertContainer
functionInserts a sub-container into the given container.
void GooeyContainer_InsertContainer(GooeyContainers * container);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyContainers * | container | Pointer to the parent GooeyContainers. |
Return Value
void
GooeyContainer_SetActiveContainer
functionSets which container is currently active/visible.
void GooeyContainer_SetActiveContainer(GooeyContainers * container, size_t container_id);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyContainers * | container | Pointer to the container set. |
size_t | container_id | ID of the container to activate. |
Return Value
void
gooey_textbox.h
Functions
*GooeyTextbox_GetText
functionGets the current text from the textbox.
const char *GooeyTextbox_GetText(GooeyTextbox * textbox);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyTextbox * | textbox | The textbox to retrieve text from. |
Return Value
const char
GooeyTextbox_Draw
functionDraws the textbox on the specified window. Renders the textbox UI, reflecting its current state and contents.
void GooeyTextbox_Draw(GooeyWindow * win);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyWindow * | win | The window to draw the textbox on. |
Return Value
void
GooeyTextbox_HandleClick
functionHandles click events on the textbox. Detects clicks on the textbox area and activates the textbox for input if clicked.
bool GooeyTextbox_HandleClick(GooeyWindow * win, int x, int y);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyWindow * | win | The window containing the textbox. |
int | x | The x-coordinate of the click. |
int | y | The y-coordinate of the click. |
Return Value
bool
GooeyTextbox_HandleKeyPress
functionProcesses key press events for the textbox. Updates the textbox content based on keyboard input.
void GooeyTextbox_HandleKeyPress(GooeyWindow * win, void * event);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyWindow * | win | The window containing the textbox. |
void * | event | Pointer to the key event to handle. |
Return Value
void
GooeyTextbox_SetText
functionSets the text content of the textbox.
void GooeyTextbox_SetText(GooeyTextbox * textbox, const char * text);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyTextbox * | textbox | The textbox to update. |
const char * | text | The new text to set. |
Return Value
void
gooey_messagebox.h
Functions
GooeyMessageBox_Show
functionDisplays the specified message box window. This function makes the message box visible on the screen. The message box must have been created using `GooeyMessageBox_Create`.
void GooeyMessageBox_Show(GooeyWindow * msgBoxWindow);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyWindow * | msgBoxWindow | A pointer to the message box window to display. |
Return Value
void
gooey_list.h
Functions
GooeyList_AddItem
functionAdds an item to the specified list widget.
void GooeyList_AddItem(GooeyList * list, const char * title, const char * description);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyList * | list | The list widget to which the item will be added. |
const char * | title | The title of the list item. |
const char * | description | The description of the list item. |
Return Value
void
GooeyList_ClearItems
functionClears all items from the specified list widget. Removes all list items from the provided list widget.
void GooeyList_ClearItems(GooeyList * list);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyList * | list | The list widget to be cleared. |
Return Value
void
GooeyList_ShowSeparator
functionToggles the visibility of the separator in a list widget. Enables or disables the visual separator between list items.
void GooeyList_ShowSeparator(GooeyList * list, bool state);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyList * | list | The list widget. |
bool | state | `true` to show the separator, `false` to hide it. |
Return Value
void
GooeyList_UpdateItem
functionUpdates the title and description of a specific item in the list.
void GooeyList_UpdateItem(GooeyList * list, size_t item_index, const char * title, const char * description);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyList * | list | The list widget. |
size_t | item_index | The index of the item to update. |
const char * | title | The new title for the list item. |
const char * | description | The new description for the list item. |
Return Value
void
gooey_canvas.h
Functions
GooeyCanvas_DrawLine
functionDraws a rectangle onto the user-defined canvas. The rectangle can be either filled with a solid color or outlined.
void GooeyCanvas_DrawLine(GooeyCanvas * canvas, int x1, int y1, int x2, int y2, unsigned long color_hex);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyCanvas * | canvas | The user-defined canvas. |
int | x1 | |
int | y1 | |
int | x2 | |
int | y2 | |
unsigned long | color_hex | The color of the rectangle in hexadecimal format. |
Return Value
void
GooeyCanvas_SetForeground
functionDraws an arc onto the user-defined canvas. The arc is drawn within the specified bounding box and between the given angles.
void GooeyCanvas_SetForeground(GooeyCanvas * canvas, unsigned long color_hex);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyCanvas * | canvas | The user-defined canvas. |
unsigned long | color_hex |
Return Value
void
gooey_slider.h
Functions
GooeySlider_GetValue
functionRetrieves the current value of the slider. Returns the current slider value, guaranteed to be within the configured range.
long GooeySlider_GetValue(GooeySlider * slider);
Parameters
| Type | Name | Description |
|---|---|---|
GooeySlider * | slider | The slider instance. |
Return Value
long
GooeySlider_SetValue
functionSets the slider's value. Updates the slider's position and value to the specified value within its range.
void GooeySlider_SetValue(GooeySlider * slider, long value);
Parameters
| Type | Name | Description |
|---|---|---|
GooeySlider * | slider | The slider instance. |
long | value | The new value to set. |
Return Value
void
gooey_tabs.h
Functions
*GooeyTabs_Create
functionCreates a tab widget. Creates a GooeyTabs widget at the specified position with given dimensions. If `is_sidebar` is true, the tabs behave as a sidebar.
GooeyTabs *GooeyTabs_Create(int x, int y, int width, int height, bool is_sidebar);
Parameters
| Type | Name | Description |
|---|---|---|
int | x | The x-coordinate of the tabs widget. |
int | y | The y-coordinate of the tabs widget. |
int | width | The width of the tabs widget. |
int | height | The height of the tabs widget. |
bool | is_sidebar | Whether the tabs should behave as a sidebar. |
Return Value
GooeyTabs
GooeyTabs_AddWidget
functionAdds a widget to a specified tab. Associates a widget with a tab identified by tab_id.
void GooeyTabs_AddWidget(GooeyWindow * window, GooeyTabs * tabs, size_t tab_id, void * widget);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyWindow * | window | The parent window containing the tabs. |
GooeyTabs * | tabs | The tabs widget. |
size_t | tab_id | The index of the tab to add the widget to. |
void * | widget | Pointer to the widget to add. |
Return Value
void
GooeyTabs_InsertTab
functionInserts a new tab with the specified name. Adds a new tab to the tab widget.
void GooeyTabs_InsertTab(GooeyTabs * tab_widget, char * tab_name);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyTabs * | tab_widget | The tab widget to add a tab to. |
char * | tab_name | The name/title of the new tab. |
Return Value
void
GooeyTabs_SetActiveTab
functionSets the active tab. Switches the active tab to the one specified by tab_id.
void GooeyTabs_SetActiveTab(GooeyTabs * tabs, size_t tab_id);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyTabs * | tabs | The tabs widget. |
size_t | tab_id | The index of the tab to activate. |
Return Value
void
gooey_layout.h
Functions
GooeyLayout_AddChild
functionHeader file for the GooeyLayout module. Provides functionality for managing and arranging widgets within a structured layout inside a GooeyWindow.
void GooeyLayout_AddChild(GooeyWindow * window, GooeyLayout * layout, void * widget);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyWindow * | window | |
GooeyLayout * | layout | |
void * | widget |
Return Value
void
GooeyLayout_Build
functionFinalizes and builds the layout. This function applies the layout rules and arranges all child widgets accordingly.
void GooeyLayout_Build(GooeyLayout * layout);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyLayout * | layout | The layout to build. |
Return Value
void
gooey_image.h
Functions
GooeyImage_Damage
functionMarks the image as needing redrawing (damaged).
void GooeyImage_Damage(GooeyImage * image);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyImage * | image | The image widget to damage. |
Return Value
void
GooeyImage_SetImage
functionImage handling functions for the Gooey GUI library. This file contains functions for adding and drawing images in a Gooey window.
void GooeyImage_SetImage(GooeyImage * image, const char * image_path);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyImage * | image | |
const char * | image_path |
Return Value
void
gooey_drop_surface.h
Functions
GooeyDropSurface_Clear
functionHeader file for the GooeyDropSurface module.
void GooeyDropSurface_Clear(GooeyDropSurface * drop_surface);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyDropSurface * | drop_surface |
Return Value
void
gooey_switch.h
Functions
GooeySwitch_GetState
functionRetrieves the current value of the slider. Returns the current slider value, guaranteed to be within the configured range.
bool GooeySwitch_GetState(GooeySwitch * gswitch);
Parameters
| Type | Name | Description |
|---|---|---|
GooeySwitch * | gswitch |
Return Value
bool
GooeySwitch_Toggle
functionSets the slider's value. Updates the slider's position and value to the specified value within its range.
void GooeySwitch_Toggle(GooeySwitch * gswitch);
Parameters
| Type | Name | Description |
|---|---|---|
GooeySwitch * | gswitch |
Return Value
void
gooey_widget.h
Functions
GooeyWidget_MakeVisible
functionSets the visibility state of a widget.
void GooeyWidget_MakeVisible(void* widget, bool state);
Parameters
| Type | Name | Description |
|---|---|---|
void* | widget | Pointer to the widget. |
bool | state | True to make visible, false to hide. |
Return Value
void
GooeyWidget_MoveTo
functionMoves the widget to a new position.
void GooeyWidget_MoveTo(void* widget, int x, int y);
Parameters
| Type | Name | Description |
|---|---|---|
void* | widget | Pointer to the widget. |
int | x | New x-coordinate. |
int | y | New y-coordinate. |
Return Value
void
GooeyWidget_Resize
functionResizes the widget.
void GooeyWidget_Resize(void* widget, int w, int h);
Parameters
| Type | Name | Description |
|---|---|---|
void* | widget | Pointer to the widget. |
int | w | New width. |
int | h | New height. |
Return Value
void
gooey_timers.h
Functions
*GooeyTimer_Create
functionCreates a new timer object.
GooeyTimer *GooeyTimer_Create();
Return Value
GooeyTimer
GooeyTimer_Destroy
functionDestroys the timer and frees its resources.
void GooeyTimer_Destroy(GooeyTimer * timer);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyTimer * | timer | Pointer to the timer to destroy. |
Return Value
void
GooeyTimer_Stop
functionStops the timer if it is running.
void GooeyTimer_Stop(GooeyTimer * timer);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyTimer * | timer | Pointer to the timer to stop. |
Return Value
void
gooey_window.h
Functions
*GooeyTheme_LoadFromFile
functionLoads a theme from the specified file path. This function reads a theme file and returns a `GooeyTheme` object that can be applied to Gooey windows.
GooeyTheme *GooeyTheme_LoadFromFile(const char * theme_path);
Parameters
| Type | Name | Description |
|---|---|---|
const char * | theme_path | The path to the theme file. |
Return Value
GooeyTheme
*GooeyWindow_Create
functionCreates a new Gooey window with the specified title, width, and height. This function initializes and returns a new window. The window can be customized with various properties such as its visibility and theme.
GooeyWindow *GooeyWindow_Create(const char * title, int x, int y, int width, int height, bool visibility);
Parameters
| Type | Name | Description |
|---|---|---|
const char * | title | The title of the window. |
int | x | |
int | y | |
int | width | The width of the window. |
int | height | The height of the window. |
bool | visibility | The initial visibility of the window (visible or hidden). |
Return Value
GooeyWindow
GooeyWindow_Cleanup
functionCleans up the resources associated with Gooey windows. This function deallocates memory and resources for the specified windows and their associated widgets.
void GooeyWindow_Cleanup(int num_windows, GooeyWindow * first_win, ... );
Parameters
| Type | Name | Description |
|---|---|---|
int | num_windows | The number of windows to clean up. |
GooeyWindow * | first_win | The first window to clean up. |
... | |
Return Value
void
GooeyWindow_MakeResizable
functionSets the resizable property of a window. This function determines whether the user can resize the window. If the window is made resizable, the user can adjust its size at runtime.
void GooeyWindow_MakeResizable(GooeyWindow * msgBoxWindow, bool is_resizable);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyWindow * | msgBoxWindow | The window to modify. |
bool | is_resizable | `true` to make the window resizable, `false` to make it fixed-size. |
Return Value
void
GooeyWindow_MakeVisible
functionSets the visibility of a Gooey window. This function controls whether the window is visible or hidden.
void GooeyWindow_MakeVisible(GooeyWindow * win, bool visibility);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyWindow * | win | The window whose visibility is to be set. |
bool | visibility | `true` to make the window visible, `false` to hide it. |
Return Value
void
GooeyWindow_RegisterWidget
functionRegisters a widget with the specified window. This function adds a widget (such as a button, label, or slider) to a window, so it can be rendered and interact with user input.
void GooeyWindow_RegisterWidget(GooeyWindow * win, void * widget);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyWindow * | win | The window to register the widget with. |
void * | widget | The widget to register. |
Return Value
void
GooeyWindow_RequestRedraw
functionRequests a redraw of the window. This function triggers a redraw of the specified window, typically in response to changes that affect its appearance (e.g., updates to the window's content or layout).
void GooeyWindow_RequestRedraw(GooeyWindow * win);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyWindow * | win | The window that requires a redraw. |
Return Value
void
GooeyWindow_Run
functionRuns the Gooey window's event loop. This function starts the main event loop for the specified window, where user input and window events are processed until the window is closed.
void GooeyWindow_Run(int num_windows, GooeyWindow * first_win, ... );
Parameters
| Type | Name | Description |
|---|---|---|
int | num_windows | The number of windows to handle in the event loop. |
GooeyWindow * | first_win | The first window to run in the event loop. |
... | |
Return Value
void
GooeyWindow_SetTheme
functionSets the theme for the specified Gooey window. This function applies the given theme to the window, updating its appearance.
void GooeyWindow_SetTheme(GooeyWindow * win, GooeyTheme * theme);
Parameters
| Type | Name | Description |
|---|---|---|
GooeyWindow * | win | The Gooey window to set the theme for. |
GooeyTheme * | theme | The theme to apply to the window. |
Return Value
void
Guides & Documentation
Gooey - Cross-Platform GUI Library
Gooey - Cross-Platform GUI Library¶
The elegant way to build cross-platform applications with native performance.
What’s new?¶
We’re currently working on implementing animations for widgets.

Screenshots¶


Warning¶
For production code disable address sanitizer, it will cause high memory usage.
Features¶
- Cross-Platform: Write once, build anywhere (Windows, Linux)
- Lightweight: Minimal footprint with maximum functionality
- Customizable: Tailor every aspect of your UI
- Minimal Dependencies: Built with minimal dependencies
- Pure C: Portable code perfect for embedded solutions
- Community Driven: Open-source under GPL v2 license
Quick Start¶
Installation¶
Download the latest release from our GitHub Releases page.
Basic Example¶
#include <Gooey/gooey.h>
int main()
{
Gooey_Init();
GooeyWindow *win = GooeyWindow_Create("My Window", 400, 400, true);
GooeyLabel *label_0 = GooeyLabel_Create("Hello World!", 18.0f, 164, 159);
GooeyWindow_RegisterWidget(win, label_0);
GooeyWindow_Run(1, win);
GooeyWindow_Cleanup(1, win);
return 0;
}
Documentation¶
Explore our comprehensive documentation:
Customize your build¶
You can customize your build by modifying the user_config.h header file in the include/ folder.
#ifndef USER_CONFIG_H
#define USER_CONFIG_H
/*
/$$$$$$ /$$ /$$ /$$$$$$
/$$__ $$ | $$ | $$|_ $$_/
| $$ \__/ /$$$$$$ /$$$$$$ /$$$$$$ /$$ /$$| $$ | $$ | $$
| $$ /$$$$ /$$__ $$ /$$__ $$ /$$__ $$| $$ | $$| $$ | $$ | $$
| $$|_ $$| $$ \ $$| $$ \ $$| $$$$$$$$| $$ | $$| $$ | $$ | $$
| $$ \ $$| $$ | $$| $$ | $$| $$_____/| $$ | $$| $$ | $$ | $$
| $$$$$$/| $$$$$$/| $$$$$$/| $$$$$$$| $$$$$$$| $$$$$$/ /$$$$$$
\______/ \______/ \______/ \_______/ \____ $$ \______/ |______/
/$$ | $$
| $$$$$$/
\______/
* Gooey - A lightweight GUI library for C/C++ applications
*/
/*******************************************************************************
* DEVELOPMENT SETTINGS *
******************************************************************************/
/**
* Project Branch Configuration
* 0 = Production mode (optimized, minimal logging)
* 1 = Debug mode (verbose logging, additional checks)
*/
#define PROJECT_BRANCH 1
/**
* Enable debug overlay for development
* Shows FPS, memory usage, and other debug information
*/
#define ENABLE_DEBUG_OVERLAY 1
/*******************************************************************************
* APPLICATION LAYOUT *
******************************************************************************/
/** Height of the application title bar in pixels */
#define APPBAR_HEIGHT 50
/*******************************************************************************
* SYSTEM RESOURCE LIMITS *
******************************************************************************/
/** Maximum number of timer objects that can be created */
#define MAX_TIMERS 100
/** Maximum number of widgets per window */
#define MAX_WIDGETS 100
/** Maximum number of child items in a menu */
#define MAX_MENU_CHILDREN 10
/** Maximum number of radio buttons in a single group */
#define MAX_RADIO_BUTTONS 10
/** Maximum number of data points in plot widgets */
#define MAX_PLOT_COUNT 100
/** Maximum number of tabs in a tab container */
#define MAX_TABS 50
/** Maximum number of container widgets */
#define MAX_CONTAINER 50
/** Maximum number of switch widgets */
#define MAX_SWITCHES 50
/** Maximum number of context menus */
#define GOOEY_CTXMENU_MAX_ITEMS 20
/*******************************************************************************
* WIDGET FEATURE TOGGLES *
*
* Enable or disable specific widgets to reduce memory footprint or exclude
* unused functionality. Disable widgets you don't need to improve performance.
******************************************************************************/
/** Button widget - Basic clickable button */
#define ENABLE_BUTTON 1
/** Canvas widget - Custom drawing surface */
#define ENABLE_CANVAS 1
/** Checkbox widget - Binary state toggle */
#define ENABLE_CHECKBOX 1
/** Context menu widget - Right-click context menus */
#define ENABLE_CTXMENU 1
/** Drop surface widget - Area for drag-and-drop operations */
#define ENABLE_DROP_SURFACE 1
/** Dropdown widget - Selection from a list of options */
#define ENABLE_DROPDOWN 1
/** Image widget - Display static and animated images (GIF support) */
#define ENABLE_IMAGE 1
/** Label widget - Text display */
#define ENABLE_LABEL 1
/** Layout widget - Container for organizing child widgets */
#define ENABLE_LAYOUT 1
/** List widget - Scrollable list of items */
#define ENABLE_LIST 1
/** Menu widget - Application menu bar */
#define ENABLE_MENU 1
/** Meter widget - Visual gauge display */
#define ENABLE_METER 1
/** Plot widget - Data visualization charts */
#define ENABLE_PLOT 1
/** Progress bar widget - Progress indication */
#define ENABLE_PROGRESSBAR 1
/** Radio button widget - Exclusive selection from multiple options */
#define ENABLE_RADIOBUTTON 1
/** Slider widget - Range selection input */
#define ENABLE_SLIDER 1
/** Tabs widget - Tabbed interface container */
#define ENABLE_TABS 1
/** Textbox widget - Text input field */
#define ENABLE_TEXTBOX 1
/** Container widget - Generic widget container */
#define ENABLE_CONTAINER 1
/** AppBar widget - Application title bar */
#define ENABLE_APPBAR 1
/** Switch widget - Toggle switch control */
#define ENABLE_SWITCH 1
/** WebView widget - Embedded web content (requires additional dependencies) */
#define ENABLE_WEBVIEW 1
/** File dialog widget - Native file open/save dialogs */
#define ENABLE_FDIALOG 1
/*******************************************************************************
* ESP32 SPECIFIC CONFIGURATION *
*
* These settings are specific to ESP32 deployments with TFT displays
******************************************************************************/
/** Enable ESP32 TFT_eSPI display support */
#define TFT_ESPI_ENABLED ESP32
/** Screen rotation for TFT displays (0-3) */
#define TFT_SCREEN_ROTATION 3
/** Enable virtual keyboard for touch input (ESP32 only) */
#define ENABLE_VIRTUAL_KEYBOARD 1
/*******************************************************************************
* PERFORMANCE NOTES *
*
* - Disable unused widgets to reduce memory consumption and improve startup time
* - In production (PROJECT_BRANCH=0), consider disabling ENABLE_DEBUG_OVERLAY
* - Adjust resource limits based on your application's needs to optimize memory
* - ESP32 builds may need lower limits due to constrained memory resources
******************************************************************************/
#endif /* USER_CONFIG_H */
#endif
Building from Source¶
-
Clone the repository:
bash git clone https://github.com/GooeyUI/GooeyGUI.git GooeyGUI cd GooeyGUI -
Get Submodules:
bash git submodule init git submodule update --remote --merge -
Build the library:
bash cmake -S . -B build cd build && make # Install if you encounter missing packages sudo apt install libdrm-dev libgbm-dev libegl-dev libgl-dev libwayland-dev libxkbcommon-dev mesa-utils -
Install (optional):
bash sudo make install - Building a example
bash gcc example.c -o example -L/usr/local/lib/ -lfreetype -lGooeyGUI -lGLPS -lm -I/usr/local/include/ -fsanitize=address,undefined && ./example
Contributing¶
We welcome contributions!
License¶
Gooey is released under the GNU General Public License v2.0.
Community¶
Join our growing community:
Special Thanks¶
To all our contributors who help make Gooey better!
© 2025 Gooey GUI Library | Website