|
libGumball 0.0.1
C23-Based, libGimbal-powered UI Library
|
Go to the source code of this file.
Macros | |
| #define | GUM_update(obj) |
| #define | GUM_add_child(self, child) |
| #define | GUM_remove_child(self, child) |
| #define | GUM_get_child_at(self, index) |
| #define | GUM_unref(obj) |
| #define | GUM_connect(emitter, signal, callback, ...) |
| #define | GUM_userData() |
| #define | GUM_draw(...) |
| #define | GUM_draw_disable(obj) |
| #define | GUM_draw_enable(obj) |
| #define | GUM_draw_disableAll(obj) |
| #define | GUM_draw_enableAll(obj) |
| #define | GUM_property(obj, name, ...) |
| #define | GUM_setProperty(obj, name, ...) |
gumball_common is a collection of macros that are common to all elements in libGumball.
| #define GUM_update | ( | obj | ) |
Takes in a UI element, updates it and all of its children.
| #define GUM_add_child | ( | self, | |
| child ) |
Takes in two UI elements, adds the second one as a child of the first.
| #define GUM_remove_child | ( | self, | |
| child ) |
Takes in two UI elements, removes the second one as a child of the first.
| #define GUM_get_child_at | ( | self, | |
| index ) |
Takes in a UI element and an index, returns the child of that element at that index as a GblObject that you can cast to the appropriate type.
Example:
| #define GUM_unref | ( | obj | ) |
Decrements the reference count of a UI element, freeing it if it reaches zero.
Also recursively unrefs all of its children.
| #define GUM_connect | ( | emitter, | |
| signal, | |||
| callback, | |||
| ... ) |
Connects an element's (typically a GUM_Button) signal to a callback. The callback should take in a pointer to the UI element type that emitted the signal, and return void. Optionally takes in userdata (a void* of whatever you want to pass in). See GUM_Button for signal names
})
| #define GUM_userData | ( | ) |
Inside a callback connected to a signal, returns the userdata that was passed in.
| #define GUM_draw | ( | ... | ) |
Draws all the UI elements in the draw queue.
Drawable elements are added to the draw queue when they are created Elements are drawn from z-index 0 to z-index 255, with 255 being the front If two elements have the same z-index, they are drawn in the order they were created (or enabled!) Optionally takes in a GUM_Renderer if your backend needs one (defaults to nullptr)
| #define GUM_draw_disable | ( | obj | ) |
Disables drawing for a given element.
| #define GUM_draw_enable | ( | obj | ) |
Enables drawing for a given element.
| #define GUM_draw_disableAll | ( | obj | ) |
Disables drawing for a given element and all of its children.
| #define GUM_draw_enableAll | ( | obj | ) |
Enables drawing for a given element and all of its children.
| #define GUM_property | ( | obj, | |
| name, | |||
| ... ) |
Looks up the property of an element by name, storing its value in the pointer passed as a variadic argument.
| #define GUM_setProperty | ( | obj, | |
| name, | |||
| ... ) |
Sets the property with the given name to the value given by the pointer passed through the variadic argument list.