Gama C Library
Gama C API Documentation
widgets.h File Reference

Master header for Gama UI widgets and theme management. More...

#include "widgets/button.h"
#include "widgets/frame.h"
#include "widgets/joystick.h"
#include "widgets/scale.h"
#include "widgets/switch.h"

Go to the source code of this file.

Data Structures

struct  gmwThemeCache
 Structure containing all widget themes for caching purposes. More...

Macros

#define GAMA_MAX_THEME_CACHE_SIZE   10
 Defines the maximum number of widget theme states that can be cached.

Functions

gmwThemeCachegmw_save ()
 Saves the current widget themes to the theme cache.
void gmw_restore ()
 Restores the previous widget themes from the theme cache.

Variables

gmwThemeCache _theme_cache [GAMA_MAX_THEME_CACHE_SIZE]
short gm_theme_cache_index = -1

Detailed Description

Master header for Gama UI widgets and theme management.

This file includes all individual widget headers and defines a mechanism for caching and restoring widget themes, allowing for easy styling changes and scoped theme modifications.

Macro Definition Documentation

◆ GAMA_MAX_THEME_CACHE_SIZE

#define GAMA_MAX_THEME_CACHE_SIZE   10

Defines the maximum number of widget theme states that can be cached.

Function Documentation

◆ gmw_restore()

void gmw_restore ( )

Restores the previous widget themes from the theme cache.

This function pops the last saved theme state from the stack and applies it to the global widget themes.

◆ gmw_save()

gmwThemeCache * gmw_save ( )

Saves the current widget themes to the theme cache.

This function pushes the current state of all widget themes onto a stack. This is useful for temporarily changing themes and then restoring them later.

Returns
A pointer to the saved theme cache entry, or NULL if the cache is full.

Variable Documentation

◆ _theme_cache

◆ gm_theme_cache_index

short gm_theme_cache_index = -1