Gooey Documentation

Version 1.0.2

Complete API reference and developer guides

37
Header Files
68
Functions
7
Data Types
1
Guides

API Reference

gooey.h

Functions

Gooey_Init

function

Initializes the Gooey system with the selected backend. Currently, only the GLPS (OpenGL) backend is supported.

Signature
int Gooey_Init();

Return Value

int

gooey_animations.h

Functions

GooeyAnimation_TranslateX

function

Animates 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)

Signature
void GooeyAnimation_TranslateX(GooeyWidget * widget, int start, int end, float speed);

Parameters

TypeNameDescription
GooeyWidget *widget
intstart
intend
floatspeed

Return Value

void

GooeyAnimation_TranslateY

function

Animates 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)

Signature
void GooeyAnimation_TranslateY(GooeyWidget * widget, int start, int end, float speed);

Parameters

TypeNameDescription
GooeyWidget *widget
intstart
intend
floatspeed

Return Value

void

gooey_common.h

Data Types

struct GooeyEvent

struct

General event structure.

Members

TypeNameDescription
GooeyEventTypetype
GooeyMouseDataclick
GooeyMouseDatamouse_move
GooeyMouseDatamouse_scroll
GooeyKeyPressDatakey_press
GooeyDropDatadrop_data
Definition
struct GooeyEvent
{
    GooeyEventType type;

    union
    {
        GooeyMouseData click;
        GooeyMouseData mouse_move;
        GooeyMouseData mouse_scroll;
        GooeyKeyPressData key_press;
        GooeyDropData drop_data;
    };
};

typedef GooeyEventType

typedef

Enumeration of event types.

Definition
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

struct

Internal definitions for the Gooey GUI library.

Definition
typedef struct GooeyWindow GooeyWindow;

typedef state

typedef

Keyboard key press event data.

Definition
typedef struct
{
    unsigned int state;
    char value[20];
    unsigned long keycode;
} GooeyKeyPressData;

typedef state

typedef

File drop event data.

Definition
typedef struct
{
    unsigned int state;
    char mime[20];
    char file_path[1024];
    int drop_x;
    int drop_y;
} GooeyDropData;

typedef x

typedef

Mouse event data.

Definition
typedef struct
{
    int x;
    int y;
} GooeyMouseData;

gooey_theme.h

Data Types

typedef base

typedef

Structure 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).

Definition
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

function

Structure 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).

Signature
GooeyTheme parser_load_theme_from_file(const char * filePath, bool * is_theme_loaded);

Parameters

TypeNameDescription
const char *filePath
bool *is_theme_loaded

Return Value

GooeyTheme

gooey_button.h

Functions

GooeyButton_SetHighlight

function

Highlights or unhighlights a button. This function visually indicates whether a button is highlighted, which can be used to show focus or selection.

Signature
void GooeyButton_SetHighlight(GooeyButton * button, bool is_highlighted);

Parameters

TypeNameDescription
GooeyButton *buttonA pointer to the button to modify.
boolis_highlighted`true` to highlight the button; `false` to remove the highlight.

Return Value

void

GooeyButton_SetText

function

Sets the text of the button. This function updates the label text displayed on the button.

Signature
void GooeyButton_SetText(GooeyButton * button, const char * text);

Parameters

TypeNameDescription
GooeyButton *buttonThe button to set the text for.
const char *textThe new text to display on the button.

Return Value

void

gooey_meter.h

Functions

*GooeyMeter_Create

function

Creates a meter widget. Initializes a new GooeyMeter widget at the specified position and size, with an initial value, a label, and an optional icon.

Signature
GooeyMeter *GooeyMeter_Create(int x, int y, int width, int height, long initial_value, const char * label, const char * icon_path);

Parameters

TypeNameDescription
intxThe x-coordinate of the meter's position.
intyThe y-coordinate of the meter's position.
intwidthThe width of the meter.
intheightThe height of the meter.
longinitial_valueThe initial value displayed by the meter.
const char *labelA text label to display with the meter.
const char *icon_pathPath to an icon image to display with the meter (can be NULL).

Return Value

GooeyMeter

GooeyMeter_Update

function

Updates the value displayed by the meter.

Signature
void GooeyMeter_Update(GooeyMeter * meter, long new_value);

Parameters

TypeNameDescription
GooeyMeter *meterThe GooeyMeter instance to update.
longnew_valueThe new value to set.

Return Value

void

gooey_plot.h

Functions

*GooeyPlot_Create

function

Creates a plot widget. Adds a plot widget of the specified type to the given position and size, using the provided plot data.

Signature
GooeyPlot *GooeyPlot_Create(GOOEY_PLOT_TYPE plot_type, GooeyPlotData * data, int x, int y, int width, int height);

Parameters

TypeNameDescription
GOOEY_PLOT_TYPEplot_typeThe type of plot to be created (e.g., LINE, BAR).
GooeyPlotData *dataPointer to the plot data structure.
intxThe x-coordinate of the plot's position.
intyThe y-coordinate of the plot's position.
intwidthThe width of the plot widget.
intheightThe height of the plot widget.

Return Value

GooeyPlot

GooeyPlot_Update

function

Updates an existing plot with new data. Updates the content of the given plot widget while maintaining its configuration and type.

Signature
void GooeyPlot_Update(GooeyPlot * plot, GooeyPlotData * new_data);

Parameters

TypeNameDescription
GooeyPlot *plotPointer to the plot widget to update.
GooeyPlotData *new_dataPointer to the new data to update the plot with.

Return Value

void

gooey_label.h

Functions

*GooeyLabel_Create

function

Header file for the GooeyLabel module. Provides functions for creating, modifying, and rendering text labels within a GooeyWindow.

Signature
GooeyLabel *GooeyLabel_Create(const char * text, float font_size, int x, int y);

Parameters

TypeNameDescription
const char *text
floatfont_size
intx
inty

Return Value

GooeyLabel

GooeyLabel_SetColor

function

Sets the text color of a label. Changes the text color of a label to the specified color.

Signature
void GooeyLabel_SetColor(GooeyLabel * label, unsigned long color);

Parameters

TypeNameDescription
GooeyLabel *labelA pointer to the label whose color is to be changed.
unsigned longcolorAn unsigned long representing the color (e.g., 0xFF0000 for red).

Return Value

void

GooeyLabel_SetText

function

Sets the text of an existing label. Updates the text displayed by a given GooeyLabel.

Signature
void GooeyLabel_SetText(GooeyLabel * label, const char * text);

Parameters

TypeNameDescription
GooeyLabel *labelThe label to update.
const char *textThe new text to display on the label.

Return Value

void

gooey_progressbar.h

Functions

*GooeyProgressBar_Create

function

Creates a progress bar widget. Initializes a new progress bar at the specified position and size, with an initial value.

Signature
GooeyProgressBar *GooeyProgressBar_Create(int x, int y, int width, int height, long initial_value);

Parameters

TypeNameDescription
intxThe x-coordinate of the progress bar.
intyThe y-coordinate of the progress bar.
intwidthThe width of the progress bar.
intheightThe height of the progress bar.
longinitial_valueThe initial progress value.

Return Value

GooeyProgressBar

GooeyProgressBar_Update

function

Updates the value of an existing progress bar. Changes the displayed progress to the new value.

Signature
void GooeyProgressBar_Update(GooeyProgressBar * progressbar, long new_value);

Parameters

TypeNameDescription
GooeyProgressBar *progressbarPointer to the progress bar to update.
longnew_valueThe new progress value.

Return Value

void

gooey_dropdown.h

Functions

GooeyDropdown_Update

function

Header file for the GooeyDropdown module. Provides functions to create, handle, and render dropdown menus within a GooeyWindow.

Signature
void GooeyDropdown_Update(GooeyDropdown * dropdown, const char ** new_options, int new_num_options);

Parameters

TypeNameDescription
GooeyDropdown *dropdown
const char **new_options
intnew_num_options

Return Value

void

gooey_container.h

Functions

GooeyContainer_AddWidget

function

Adds a widget to a specific container within the window.

Signature
void GooeyContainer_AddWidget(GooeyWindow* window, GooeyContainers* container, size_t container_id, void * widget);

Parameters

TypeNameDescription
GooeyWindow*windowThe target GooeyWindow.
GooeyContainers*containerThe container to add the widget into.
size_tcontainer_idThe ID of the target sub-container.
void *widgetPointer to the widget to add.

Return Value

void

GooeyContainer_Create

function

Creates a new container with the given position and dimensions.

Signature
GooeyContainers* GooeyContainer_Create(int x, int y, int width, int height);

Parameters

TypeNameDescription
intxX-coordinate of the container.
intyY-coordinate of the container.
intwidthWidth of the container.
intheightHeight of the container.

Return Value

GooeyContainers*

GooeyContainer_InsertContainer

function

Inserts a sub-container into the given container.

Signature
void GooeyContainer_InsertContainer(GooeyContainers * container);

Parameters

TypeNameDescription
GooeyContainers *containerPointer to the parent GooeyContainers.

Return Value

void

GooeyContainer_SetActiveContainer

function

Sets which container is currently active/visible.

Signature
void GooeyContainer_SetActiveContainer(GooeyContainers * container, size_t container_id);

Parameters

TypeNameDescription
GooeyContainers *containerPointer to the container set.
size_tcontainer_idID of the container to activate.

Return Value

void

gooey_textbox.h

Functions

*GooeyTextbox_GetText

function

Gets the current text from the textbox.

Signature
const char *GooeyTextbox_GetText(GooeyTextbox * textbox);

Parameters

TypeNameDescription
GooeyTextbox *textboxThe textbox to retrieve text from.

Return Value

const char

GooeyTextbox_Draw

function

Draws the textbox on the specified window. Renders the textbox UI, reflecting its current state and contents.

Signature
void GooeyTextbox_Draw(GooeyWindow * win);

Parameters

TypeNameDescription
GooeyWindow *winThe window to draw the textbox on.

Return Value

void

GooeyTextbox_HandleClick

function

Handles click events on the textbox. Detects clicks on the textbox area and activates the textbox for input if clicked.

Signature
bool GooeyTextbox_HandleClick(GooeyWindow * win, int x, int y);

Parameters

TypeNameDescription
GooeyWindow *winThe window containing the textbox.
intxThe x-coordinate of the click.
intyThe y-coordinate of the click.

Return Value

bool

GooeyTextbox_HandleKeyPress

function

Processes key press events for the textbox. Updates the textbox content based on keyboard input.

Signature
void GooeyTextbox_HandleKeyPress(GooeyWindow * win, void * event);

Parameters

TypeNameDescription
GooeyWindow *winThe window containing the textbox.
void *eventPointer to the key event to handle.

Return Value

void

GooeyTextbox_SetText

function

Sets the text content of the textbox.

Signature
void GooeyTextbox_SetText(GooeyTextbox * textbox, const char * text);

Parameters

TypeNameDescription
GooeyTextbox *textboxThe textbox to update.
const char *textThe new text to set.

Return Value

void

gooey_messagebox.h

Functions

GooeyMessageBox_Show

function

Displays 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`.

Signature
void GooeyMessageBox_Show(GooeyWindow * msgBoxWindow);

Parameters

TypeNameDescription
GooeyWindow *msgBoxWindowA pointer to the message box window to display.

Return Value

void

gooey_list.h

Functions

GooeyList_AddItem

function

Adds an item to the specified list widget.

Signature
void GooeyList_AddItem(GooeyList * list, const char * title, const char * description);

Parameters

TypeNameDescription
GooeyList *listThe list widget to which the item will be added.
const char *titleThe title of the list item.
const char *descriptionThe description of the list item.

Return Value

void

GooeyList_ClearItems

function

Clears all items from the specified list widget. Removes all list items from the provided list widget.

Signature
void GooeyList_ClearItems(GooeyList * list);

Parameters

TypeNameDescription
GooeyList *listThe list widget to be cleared.

Return Value

void

GooeyList_ShowSeparator

function

Toggles the visibility of the separator in a list widget. Enables or disables the visual separator between list items.

Signature
void GooeyList_ShowSeparator(GooeyList * list, bool state);

Parameters

TypeNameDescription
GooeyList *listThe list widget.
boolstate`true` to show the separator, `false` to hide it.

Return Value

void

GooeyList_UpdateItem

function

Updates the title and description of a specific item in the list.

Signature
void GooeyList_UpdateItem(GooeyList * list, size_t item_index, const char * title, const char * description);

Parameters

TypeNameDescription
GooeyList *listThe list widget.
size_titem_indexThe index of the item to update.
const char *titleThe new title for the list item.
const char *descriptionThe new description for the list item.

Return Value

void

gooey_canvas.h

Functions

GooeyCanvas_DrawLine

function

Draws a rectangle onto the user-defined canvas. The rectangle can be either filled with a solid color or outlined.

Signature
void GooeyCanvas_DrawLine(GooeyCanvas * canvas, int x1, int y1, int x2, int y2, unsigned long color_hex);

Parameters

TypeNameDescription
GooeyCanvas *canvasThe user-defined canvas.
intx1
inty1
intx2
inty2
unsigned longcolor_hexThe color of the rectangle in hexadecimal format.

Return Value

void

GooeyCanvas_SetForeground

function

Draws an arc onto the user-defined canvas. The arc is drawn within the specified bounding box and between the given angles.

Signature
void GooeyCanvas_SetForeground(GooeyCanvas * canvas, unsigned long color_hex);

Parameters

TypeNameDescription
GooeyCanvas *canvasThe user-defined canvas.
unsigned longcolor_hex

Return Value

void

gooey_slider.h

Functions

GooeySlider_GetValue

function

Retrieves the current value of the slider. Returns the current slider value, guaranteed to be within the configured range.

Signature
long GooeySlider_GetValue(GooeySlider * slider);

Parameters

TypeNameDescription
GooeySlider *sliderThe slider instance.

Return Value

long

GooeySlider_SetValue

function

Sets the slider's value. Updates the slider's position and value to the specified value within its range.

Signature
void GooeySlider_SetValue(GooeySlider * slider, long value);

Parameters

TypeNameDescription
GooeySlider *sliderThe slider instance.
longvalueThe new value to set.

Return Value

void

gooey_tabs.h

Functions

*GooeyTabs_Create

function

Creates 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.

Signature
GooeyTabs *GooeyTabs_Create(int x, int y, int width, int height, bool is_sidebar);

Parameters

TypeNameDescription
intxThe x-coordinate of the tabs widget.
intyThe y-coordinate of the tabs widget.
intwidthThe width of the tabs widget.
intheightThe height of the tabs widget.
boolis_sidebarWhether the tabs should behave as a sidebar.

Return Value

GooeyTabs

GooeyTabs_AddWidget

function

Adds a widget to a specified tab. Associates a widget with a tab identified by tab_id.

Signature
void GooeyTabs_AddWidget(GooeyWindow * window, GooeyTabs * tabs, size_t tab_id, void * widget);

Parameters

TypeNameDescription
GooeyWindow *windowThe parent window containing the tabs.
GooeyTabs *tabsThe tabs widget.
size_ttab_idThe index of the tab to add the widget to.
void *widgetPointer to the widget to add.

Return Value

void

GooeyTabs_InsertTab

function

Inserts a new tab with the specified name. Adds a new tab to the tab widget.

Signature
void GooeyTabs_InsertTab(GooeyTabs * tab_widget, char * tab_name);

Parameters

TypeNameDescription
GooeyTabs *tab_widgetThe tab widget to add a tab to.
char *tab_nameThe name/title of the new tab.

Return Value

void

GooeyTabs_SetActiveTab

function

Sets the active tab. Switches the active tab to the one specified by tab_id.

Signature
void GooeyTabs_SetActiveTab(GooeyTabs * tabs, size_t tab_id);

Parameters

TypeNameDescription
GooeyTabs *tabsThe tabs widget.
size_ttab_idThe index of the tab to activate.

Return Value

void

GooeyTabs_Sidebar_Close

function

Closes the sidebar tabs (if tabs are in sidebar mode).

Signature
void GooeyTabs_Sidebar_Close(GooeyTabs * tabs_widget);

Parameters

TypeNameDescription
GooeyTabs *tabs_widgetThe tabs widget.

Return Value

void

GooeyTabs_Sidebar_Open

function

Opens the sidebar tabs (if tabs are in sidebar mode).

Signature
void GooeyTabs_Sidebar_Open(GooeyTabs * tabs_widget);

Parameters

TypeNameDescription
GooeyTabs *tabs_widgetThe tabs widget.

Return Value

void

gooey_layout.h

Functions

GooeyLayout_AddChild

function

Header file for the GooeyLayout module. Provides functionality for managing and arranging widgets within a structured layout inside a GooeyWindow.

Signature
void GooeyLayout_AddChild(GooeyWindow * window, GooeyLayout * layout, void * widget);

Parameters

TypeNameDescription
GooeyWindow *window
GooeyLayout *layout
void *widget

Return Value

void

GooeyLayout_Build

function

Finalizes and builds the layout. This function applies the layout rules and arranges all child widgets accordingly.

Signature
void GooeyLayout_Build(GooeyLayout * layout);

Parameters

TypeNameDescription
GooeyLayout *layoutThe layout to build.

Return Value

void

gooey_menu.h

Functions

*GooeyMenu_AddChild

function

Adds a child menu item to the window's menu. Creates a submenu or a category inside the main menu.

Signature
GooeyMenuChild *GooeyMenu_AddChild(GooeyWindow * win, char * title, void* user_data);

Parameters

TypeNameDescription
GooeyWindow *winThe window to which the menu child will be added.
char *titleThe title of the menu child.
void*user_data

Return Value

GooeyMenuChild

*GooeyMenu_Set

function

Header file for the Gooey menu system. Provides functions to create and manage menus and menu items within a Gooey window.

Signature
GooeyMenu *GooeyMenu_Set(GooeyWindow * win);

Parameters

TypeNameDescription
GooeyWindow *win

Return Value

GooeyMenu

gooey_image.h

Functions

GooeyImage_Damage

function

Marks the image as needing redrawing (damaged).

Signature
void GooeyImage_Damage(GooeyImage * image);

Parameters

TypeNameDescription
GooeyImage *imageThe image widget to damage.

Return Value

void

GooeyImage_SetImage

function

Image handling functions for the Gooey GUI library. This file contains functions for adding and drawing images in a Gooey window.

Signature
void GooeyImage_SetImage(GooeyImage * image, const char * image_path);

Parameters

TypeNameDescription
GooeyImage *image
const char *image_path

Return Value

void

gooey_drop_surface.h

Functions

GooeyDropSurface_Clear

function

Header file for the GooeyDropSurface module.

Signature
void GooeyDropSurface_Clear(GooeyDropSurface * drop_surface);

Parameters

TypeNameDescription
GooeyDropSurface *drop_surface

Return Value

void

gooey_radiobutton.h

Functions

*GooeyRadioButtonGroup_Create

function

Creates a new radio button group. Allows grouping of multiple radio buttons, ensuring single selection.

Signature
GooeyRadioButtonGroup *GooeyRadioButtonGroup_Create();

Return Value

GooeyRadioButtonGroup

GooeyRadioButtonGroup_Draw

function

Draws all radio buttons in the group on the window. Renders the visual state of each radio button, reflecting selection.

Signature
void GooeyRadioButtonGroup_Draw(GooeyWindow * win);

Parameters

TypeNameDescription
GooeyWindow *winThe window on which to draw the group.

Return Value

void

GooeyRadioButtonGroup_HandleClick

function

Handles click events for a group of radio buttons. Ensures that only one radio button in the group is selected at a time.

Signature
bool GooeyRadioButtonGroup_HandleClick(GooeyWindow * win, int x, int y);

Parameters

TypeNameDescription
GooeyWindow *winThe window containing the radio button group.
intxThe x-coordinate of the click event.
intyThe y-coordinate of the click event.

Return Value

bool

GooeyRadioButton_HandleClick

function

Handles a click event on radio buttons within a window. Checks if a radio button was clicked and triggers the appropriate callback.

Signature
bool GooeyRadioButton_HandleClick(GooeyWindow * win, int x, int y);

Parameters

TypeNameDescription
GooeyWindow *winThe window containing the radio buttons.
intxThe x-coordinate of the click event.
intyThe y-coordinate of the click event.

Return Value

bool

gooey_switch.h

Functions

GooeySwitch_GetState

function

Retrieves the current value of the slider. Returns the current slider value, guaranteed to be within the configured range.

Signature
bool GooeySwitch_GetState(GooeySwitch * gswitch);

Parameters

TypeNameDescription
GooeySwitch *gswitch

Return Value

bool

GooeySwitch_Toggle

function

Sets the slider's value. Updates the slider's position and value to the specified value within its range.

Signature
void GooeySwitch_Toggle(GooeySwitch * gswitch);

Parameters

TypeNameDescription
GooeySwitch *gswitch

Return Value

void

gooey_widget.h

Functions

GooeyWidget_MakeVisible

function

Sets the visibility state of a widget.

Signature
void GooeyWidget_MakeVisible(void* widget, bool state);

Parameters

TypeNameDescription
void*widgetPointer to the widget.
boolstateTrue to make visible, false to hide.

Return Value

void

GooeyWidget_MoveTo

function

Moves the widget to a new position.

Signature
void GooeyWidget_MoveTo(void* widget, int x, int y);

Parameters

TypeNameDescription
void*widgetPointer to the widget.
intxNew x-coordinate.
intyNew y-coordinate.

Return Value

void

GooeyWidget_Resize

function

Resizes the widget.

Signature
void GooeyWidget_Resize(void* widget, int w, int h);

Parameters

TypeNameDescription
void*widgetPointer to the widget.
intwNew width.
inthNew height.

Return Value

void

gooey_timers.h

Functions

*GooeyTimer_Create

function

Creates a new timer object.

Signature
GooeyTimer *GooeyTimer_Create();

Return Value

GooeyTimer

GooeyTimer_Destroy

function

Destroys the timer and frees its resources.

Signature
void GooeyTimer_Destroy(GooeyTimer * timer);

Parameters

TypeNameDescription
GooeyTimer *timerPointer to the timer to destroy.

Return Value

void

GooeyTimer_Stop

function

Stops the timer if it is running.

Signature
void GooeyTimer_Stop(GooeyTimer * timer);

Parameters

TypeNameDescription
GooeyTimer *timerPointer to the timer to stop.

Return Value

void

gooey_window.h

Functions

*GooeyTheme_LoadFromFile

function

Loads 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.

Signature
GooeyTheme *GooeyTheme_LoadFromFile(const char * theme_path);

Parameters

TypeNameDescription
const char *theme_pathThe path to the theme file.

Return Value

GooeyTheme

*GooeyWindow_Create

function

Creates 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.

Signature
GooeyWindow *GooeyWindow_Create(const char * title, int x, int y, int width, int height, bool visibility);

Parameters

TypeNameDescription
const char *titleThe title of the window.
intx
inty
intwidthThe width of the window.
intheightThe height of the window.
boolvisibilityThe initial visibility of the window (visible or hidden).

Return Value

GooeyWindow

GooeyWindow_Cleanup

function

Cleans up the resources associated with Gooey windows. This function deallocates memory and resources for the specified windows and their associated widgets.

Signature
void GooeyWindow_Cleanup(int num_windows, GooeyWindow * first_win, ... );

Parameters

TypeNameDescription
intnum_windowsThe number of windows to clean up.
GooeyWindow *first_winThe first window to clean up.
...

Return Value

void

GooeyWindow_MakeResizable

function

Sets 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.

Signature
void GooeyWindow_MakeResizable(GooeyWindow * msgBoxWindow, bool is_resizable);

Parameters

TypeNameDescription
GooeyWindow *msgBoxWindowThe window to modify.
boolis_resizable`true` to make the window resizable, `false` to make it fixed-size.

Return Value

void

GooeyWindow_MakeVisible

function

Sets the visibility of a Gooey window. This function controls whether the window is visible or hidden.

Signature
void GooeyWindow_MakeVisible(GooeyWindow * win, bool visibility);

Parameters

TypeNameDescription
GooeyWindow *winThe window whose visibility is to be set.
boolvisibility`true` to make the window visible, `false` to hide it.

Return Value

void

GooeyWindow_RegisterWidget

function

Registers 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.

Signature
void GooeyWindow_RegisterWidget(GooeyWindow * win, void * widget);

Parameters

TypeNameDescription
GooeyWindow *winThe window to register the widget with.
void *widgetThe widget to register.

Return Value

void

GooeyWindow_RequestRedraw

function

Requests 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).

Signature
void GooeyWindow_RequestRedraw(GooeyWindow * win);

Parameters

TypeNameDescription
GooeyWindow *winThe window that requires a redraw.

Return Value

void

GooeyWindow_Run

function

Runs 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.

Signature
void GooeyWindow_Run(int num_windows, GooeyWindow * first_win, ... );

Parameters

TypeNameDescription
intnum_windowsThe number of windows to handle in the event loop.
GooeyWindow *first_winThe first window to run in the event loop.
...

Return Value

void

GooeyWindow_SetTheme

function

Sets the theme for the specified Gooey window. This function applies the given theme to the window, updating its appearance.

Signature
void GooeyWindow_SetTheme(GooeyWindow * win, GooeyTheme * theme);

Parameters

TypeNameDescription
GooeyWindow *winThe Gooey window to set the theme for.
GooeyTheme *themeThe 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

  1. Clone the repository:
    bash git clone https://github.com/GooeyUI/GooeyGUI.git GooeyGUI cd GooeyGUI

  2. Get Submodules:
    bash git submodule init git submodule update --remote --merge

  3. 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

  4. Install (optional):
    bash sudo make install

  5. 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