|
RMGui 0.15.0
C11 retained-mode UI library: layout kernel, style schema, widget painters, fonts, software framebuffer
|
Declarative schema-3 fields: read-only row metadata and typed accessors. More...
Data Structures | |
| struct | rmgui_style_field_t |
| Read-only row; offset addresses a declared snapshot member. More... | |
| struct | rmgui_style_value_t |
Macros | |
| #define | RMGUI_STYLE_FIELD_LITERAL 0x01u |
| Only literal integer accepted, not a spacing reference. | |
| #define | RMGUI_STYLE_FIELD_PALETTE 0x02u |
| Colour belongs to a desktop indexed sprite palette. | |
Typedefs | |
| typedef int(*) | rmgui_style_visit_fn(void *user, const char *section, const char *name, const rmgui_style_field_t *row, const rmgui_style_value_t *value) |
| A visitor receives scheme first ("", "scheme", NULL), then every schema row once in schema order. | |
Functions | |
| size_t | rmgui_style_schema_field_count (void) |
| Number of schema rows (379), including eleven motion rows per class. | |
| const rmgui_style_field_t * | rmgui_style_schema_field (size_t index) |
| Row at index, NULL if out of range. | |
| const rmgui_style_field_t * | rmgui_style_schema_section_fields (rmgui_style_section_t section, size_t *count) |
| Contiguous rows in a section, NULL with zero count if invalid. | |
| const char * | rmgui_style_schema_section_name (rmgui_style_section_t section) |
| Dashed KDL section spelling, or empty string if invalid. | |
| rmgui_style_section_t | rmgui_style_schema_class_section (rmgui_style_class_t class_id) |
| Template section for class, COUNT if invalid; desktop is not a class. | |
| const char * | rmgui_style_field_name (const rmgui_style_field_t *field) |
| Dashed KDL leaf name. | |
| const rmgui_style_field_t * | rmgui_style_field_reference (const rmgui_style_snapshot_t *style, const rmgui_style_field_t *field) |
| Referenced token row, NULL when literal/invalid. | |
| int | rmgui_style_field_set_reference (rmgui_style_snapshot_t *style, const rmgui_style_field_t *field, const rmgui_style_field_t *token) |
| Link a template metric/colour to matching token, or unlink with token=NULL; 0 on success; -1 and no mutation if incompatible/invalid. | |
| int | rmgui_style_field_int (const rmgui_style_snapshot_t *style, const rmgui_style_field_t *field) |
| Effective integer of an INT/TEXT_STYLE/SPRING row; zero if invalid kind or NULL argument; references read current spacing tokens. | |
| int | rmgui_style_field_set_int (rmgui_style_snapshot_t *style, const rmgui_style_field_t *field, int value) |
| Clamp/store literal integer; unlink even when equal to linked value; returns 1 on semantic change, 0 for unchanged/invalid arguments. | |
| rmgui_color_t | rmgui_style_field_color (const rmgui_style_snapshot_t *style, const rmgui_style_field_t *field) |
| Effective colour of a COLOR row; transparent black for invalid arguments; references read current colour tokens. | |
| int | rmgui_style_field_set_color (rmgui_style_snapshot_t *style, const rmgui_style_field_t *field, rmgui_color_t color) |
| Store literal colour, unlink even when equal to linked value; return 1 on semantic change, 0 for unchanged/invalid arguments. | |
| const rmgui_style_field_t * | rmgui_style_schema_find (const char *section, const char *name) |
| Find a row by section/leaf or exactly one dotted separator. | |
| const rmgui_style_field_t * | rmgui_style_schema_path (const char *path) |
| int | rmgui_style_value_get (const rmgui_style_snapshot_t *snapshot, const rmgui_style_field_t *row, rmgui_style_value_t *out, char *error, size_t error_cap) |
| Read an authored value (preserving references), or scheme when row=NULL. | |
| int | rmgui_style_value_set (rmgui_style_snapshot_t *snapshot, const rmgui_style_field_t *row, const rmgui_style_value_t *value, char *error, size_t error_cap) |
| Store a typed value, or apply a named scheme when row=NULL. | |
| int | rmgui_style_walk (const rmgui_style_snapshot_t *snapshot, rmgui_style_visit_fn visitor, void *user, char *error, size_t error_cap) |
| Validated snapshot/visitor required; 0 succeeds, -1 reports invalid input or visitor refusal. | |
Declarative schema-3 fields: read-only row metadata and typed accessors.
| #define RMGUI_STYLE_FIELD_LITERAL 0x01u |
Only literal integer accepted, not a spacing reference.
| #define RMGUI_STYLE_FIELD_PALETTE 0x02u |
Colour belongs to a desktop indexed sprite palette.
| typedef int(*) rmgui_style_visit_fn(void *user, const char *section, const char *name, const rmgui_style_field_t *row, const rmgui_style_value_t *value) |
A visitor receives scheme first ("", "scheme", NULL), then every schema row once in schema order.
Values are borrowed during the callback; returning nonzero stops the walk. The snapshot must not be mutated during a walk.
Three top-level token groups, twelve class templates, one shell section.
Front-end-neutral tagged value.
Names are borrowed NUL-terminated strings; REFERENCE stores a schema token row, not its effective literal value.
| Enumerator | |
|---|---|
| RMGUI_STYLE_VALUE_INT | |
| RMGUI_STYLE_VALUE_COLOR | |
| RMGUI_STYLE_VALUE_REFERENCE | |
| RMGUI_STYLE_VALUE_TEXT_STYLE | |
| RMGUI_STYLE_VALUE_SPRING | |
| RMGUI_STYLE_VALUE_SCHEME | |
| size_t rmgui_style_schema_field_count | ( | void | ) |
Number of schema rows (379), including eleven motion rows per class.
| const rmgui_style_field_t * rmgui_style_schema_field | ( | size_t | index | ) |
Row at index, NULL if out of range.
| const rmgui_style_field_t * rmgui_style_schema_section_fields | ( | rmgui_style_section_t | section, |
| size_t * | count ) |
Contiguous rows in a section, NULL with zero count if invalid.
| const char * rmgui_style_schema_section_name | ( | rmgui_style_section_t | section | ) |
Dashed KDL section spelling, or empty string if invalid.
| rmgui_style_section_t rmgui_style_schema_class_section | ( | rmgui_style_class_t | class_id | ) |
Template section for class, COUNT if invalid; desktop is not a class.
| const char * rmgui_style_field_name | ( | const rmgui_style_field_t * | field | ) |
Dashed KDL leaf name.
field must be a row of this schema.
| const rmgui_style_field_t * rmgui_style_field_reference | ( | const rmgui_style_snapshot_t * | style, |
| const rmgui_style_field_t * | field ) |
Referenced token row, NULL when literal/invalid.
row must belong to schema.
| int rmgui_style_field_set_reference | ( | rmgui_style_snapshot_t * | style, |
| const rmgui_style_field_t * | field, | ||
| const rmgui_style_field_t * | token ) |
Link a template metric/colour to matching token, or unlink with token=NULL; 0 on success; -1 and no mutation if incompatible/invalid.
| int rmgui_style_field_int | ( | const rmgui_style_snapshot_t * | style, |
| const rmgui_style_field_t * | field ) |
Effective integer of an INT/TEXT_STYLE/SPRING row; zero if invalid kind or NULL argument; references read current spacing tokens.
| int rmgui_style_field_set_int | ( | rmgui_style_snapshot_t * | style, |
| const rmgui_style_field_t * | field, | ||
| int | value ) |
Clamp/store literal integer; unlink even when equal to linked value; returns 1 on semantic change, 0 for unchanged/invalid arguments.
| rmgui_color_t rmgui_style_field_color | ( | const rmgui_style_snapshot_t * | style, |
| const rmgui_style_field_t * | field ) |
Effective colour of a COLOR row; transparent black for invalid arguments; references read current colour tokens.
| int rmgui_style_field_set_color | ( | rmgui_style_snapshot_t * | style, |
| const rmgui_style_field_t * | field, | ||
| rmgui_color_t | color ) |
Store literal colour, unlink even when equal to linked value; return 1 on semantic change, 0 for unchanged/invalid arguments.
| const rmgui_style_field_t * rmgui_style_schema_find | ( | const char * | section, |
| const char * | name ) |
Find a row by section/leaf or exactly one dotted separator.
Dashed names and underscore aliases are accepted; NULL/unknown names return NULL.
| const rmgui_style_field_t * rmgui_style_schema_path | ( | const char * | path | ) |
| int rmgui_style_value_get | ( | const rmgui_style_snapshot_t * | snapshot, |
| const rmgui_style_field_t * | row, | ||
| rmgui_style_value_t * | out, | ||
| char * | error, | ||
| size_t | error_cap ) |
Read an authored value (preserving references), or scheme when row=NULL.
Invalid arguments return -1 with bounded optional error and out unchanged. Returned names and references have static lifetime. Success clears error.
| int rmgui_style_value_set | ( | rmgui_style_snapshot_t * | snapshot, |
| const rmgui_style_field_t * | row, | ||
| const rmgui_style_value_t * | value, | ||
| char * | error, | ||
| size_t | error_cap ) |
Store a typed value, or apply a named scheme when row=NULL.
Wrong kinds, unknown names, incompatible references and out-of-range integers refuse with -1, bounded optional diagnostic and snapshot unchanged; never clamps. Success returns 0 and clears error. Cross-field validation is separate.
| int rmgui_style_walk | ( | const rmgui_style_snapshot_t * | snapshot, |
| rmgui_style_visit_fn | visitor, | ||
| void * | user, | ||
| char * | error, | ||
| size_t | error_cap ) |
Validated snapshot/visitor required; 0 succeeds, -1 reports invalid input or visitor refusal.
The library allocates no memory and never mutates input.