|
libui-ng
A portable GUI library for C
|
Base class for GUI controls providing common methods. More...
#include <ui.h>
Public Member Functions | |
| void | uiControlDestroy (uiControl *c) |
| Dispose and free all allocated resources. More... | |
| void | uiControlOnDestroyed (uiControl *c, void(*f)(uiControl *c, void *data), void *data) |
| Registers a function to be called when the control is destroyed. More... | |
| uintptr_t | uiControlHandle (uiControl *c) |
| Returns the control's OS-level handle. More... | |
| uiControl * | uiControlParent (uiControl *c) |
| Returns the parent control. More... | |
| void | uiControlSetParent (uiControl *c, uiControl *parent) |
| Sets the control's parent. More... | |
| int | uiControlToplevel (uiControl *c) |
| Returns whether or not the control is a top level control. More... | |
| int | uiControlVisible (uiControl *c) |
| Returns whether or not the control is visible. More... | |
| void | uiControlShow (uiControl *c) |
| Shows the control. More... | |
| void | uiControlHide (uiControl *c) |
| Hides the control. More... | |
| int | uiControlEnabled (uiControl *c) |
| Returns whether or not the control is enabled. More... | |
| void | uiControlEnable (uiControl *c) |
| Enables the control. More... | |
| void | uiControlDisable (uiControl *c) |
| Disables the control. More... | |
| uiControl * | uiAllocControl (size_t n, uint32_t OSsig, uint32_t typesig, const char *typenamestr) |
| Allocates a uiControl. More... | |
| void | uiFreeControl (uiControl *c) |
| Frees the memory associated with the control reference. More... | |
| void | uiControlVerifySetParent (uiControl *c, uiControl *parent) |
Makes sure the control's parent can be set to parent. More... | |
| int | uiControlEnabledToUser (uiControl *c) |
| Returns whether or not the control can be interacted with by the user. More... | |
Public Attributes | |
| uint32_t | Signature |
| uint32_t | OSSignature |
| uint32_t | TypeSignature |
| void(* | Destroy )(uiControl *) |
| uintptr_t(* | Handle )(uiControl *) |
| uiControl *(* | Parent )(uiControl *) |
| void(* | SetParent )(uiControl *, uiControl *) |
| int(* | Toplevel )(uiControl *) |
| int(* | Visible )(uiControl *) |
| void(* | Show )(uiControl *) |
| void(* | Hide )(uiControl *) |
| int(* | Enabled )(uiControl *) |
| void(* | Enable )(uiControl *) |
| void(* | Disable )(uiControl *) |
Base class for GUI controls providing common methods.
| uiControl * uiAllocControl | ( | size_t | n, |
| uint32_t | OSsig, | ||
| uint32_t | typesig, | ||
| const char * | typenamestr | ||
| ) |
| void uiControlDestroy | ( | uiControl * | c | ) |
Dispose and free all allocated resources.
The platform specific APIs that actually destroy a control (and its children) are called. If called from a user callback, destruction is deferred to the main event loop so the native event handler can finish first. The control is hidden and notification callbacks are suppressed immediately. Outside a user callback, destruction remains synchronous.
| c | uiControl instance. |
| int uiControlEnabled | ( | uiControl * | c | ) |
Returns whether or not the control is enabled.
Defaults to true.
| c | uiControl instance. |
| int uiControlEnabledToUser | ( | uiControl * | c | ) |
Returns whether or not the control can be interacted with by the user.
Checks if the control and all it's parents are enabled to make sure it can be interacted with by the user.
| c | uiControl instance. |
TRUE if enabled, FALSE otherwise. | uintptr_t uiControlHandle | ( | uiControl * | c | ) |
| void uiControlHide | ( | uiControl * | c | ) |
Hides the control.
| c | uiControl instance. |
Registers a function to be called when the control is destroyed.
The function is called from uiFreeControl(), after platform resources have been released and immediately before the control's storage is freed. It is also called for a child destroyed as part of destroying its parent. Calling this function again replaces the previous function; pass NULL for f to remove it.
| c | uiControl instance. |
| f | Function to call, or NULL to remove the current function. |
| data | Data to pass to f. |
Returns the parent control.
| c | uiControl instance. |
NULL if detached. | int uiControlToplevel | ( | uiControl * | c | ) |
Returns whether or not the control is a top level control.
| c | uiControl instance. |
TRUE if top level control, FALSE otherwise. | int uiControlVisible | ( | uiControl * | c | ) |
Returns whether or not the control is visible.
| c | uiControl instance. |
TRUE if visible, FALSE otherwise. | void uiFreeControl | ( | uiControl * | c | ) |
Frees the memory associated with the control reference.
| c | uiControl instance. |
| void(* uiControl::Destroy) (uiControl *) |
| void(* uiControl::Disable) (uiControl *) |
| void(* uiControl::Enable) (uiControl *) |
| int(* uiControl::Enabled) (uiControl *) |
| uintptr_t(* uiControl::Handle) (uiControl *) |
| void(* uiControl::Hide) (uiControl *) |
| uint32_t uiControl::OSSignature |
| void(* uiControl::Show) (uiControl *) |
| uint32_t uiControl::Signature |
| int(* uiControl::Toplevel) (uiControl *) |
| uint32_t uiControl::TypeSignature |
| int(* uiControl::Visible) (uiControl *) |