libui-ng
A portable GUI library for C
|
A control that represents a top-level window. More...
#include <ui.h>
Public Member Functions | |
char * | uiWindowTitle (uiWindow *w) |
Returns the window title. More... | |
void | uiWindowSetTitle (uiWindow *w, const char *title) |
Sets the window title. More... | |
void | uiWindowPosition (uiWindow *w, int *x, int *y) |
Gets the window position. More... | |
void | uiWindowSetPosition (uiWindow *w, int x, int y) |
Moves the window to the specified position. More... | |
void | uiWindowOnPositionChanged (uiWindow *w, void(*f)(uiWindow *sender, void *senderData), void *data) |
Registers a callback for when the window moved. More... | |
void | uiWindowContentSize (uiWindow *w, int *width, int *height) |
Gets the window content size. More... | |
void | uiWindowSetContentSize (uiWindow *w, int width, int height) |
Sets the window content size. More... | |
int | uiWindowFullscreen (uiWindow *w) |
Returns whether or not the window is full screen. More... | |
void | uiWindowSetFullscreen (uiWindow *w, int fullscreen) |
Sets whether or not the window is full screen. More... | |
void | uiWindowOnContentSizeChanged (uiWindow *w, void(*f)(uiWindow *sender, void *senderData), void *data) |
Registers a callback for when the window content size is changed. More... | |
void | uiWindowOnClosing (uiWindow *w, int(*f)(uiWindow *sender, void *senderData), void *data) |
Registers a callback for when the window is to be closed. More... | |
void | uiWindowOnFocusChanged (uiWindow *w, void(*f)(uiWindow *sender, void *senderData), void *data) |
Registers a callback for when the window focus changes. More... | |
int | uiWindowFocused (uiWindow *w) |
Returns whether or not the window is focused. More... | |
int | uiWindowBorderless (uiWindow *w) |
Returns whether or not the window is borderless. More... | |
void | uiWindowSetBorderless (uiWindow *w, int borderless) |
Sets whether or not the window is borderless. More... | |
void | uiWindowSetChild (uiWindow *w, uiControl *child) |
Sets the window's child. More... | |
int | uiWindowMargined (uiWindow *w) |
Returns whether or not the window has a margin. More... | |
void | uiWindowSetMargined (uiWindow *w, int margined) |
Sets whether or not the window has a margin. More... | |
int | uiWindowResizeable (uiWindow *w) |
Returns whether or not the window is user resizeable. More... | |
void | uiWindowSetResizeable (uiWindow *w, int resizeable) |
Sets whether or not the window is user resizeable. More... | |
uiWindow * | uiNewWindow (const char *title, int width, int height, int hasMenubar) |
Creates a new uiWindow. More... | |
Public Member Functions inherited from uiControl | |
void | uiControlDestroy (uiControl *c) |
Dispose and free all allocated resources. 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... | |
Additional Inherited Members | |
Public Attributes inherited from uiControl | |
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 *) |
A control that represents a top-level window.
A window contains exactly one child control that occupied the entire window.
uiWindow * uiNewWindow | ( | const char * | title, |
int | width, | ||
int | height, | ||
int | hasMenubar | ||
) |
int uiWindowBorderless | ( | uiWindow * | w | ) |
Returns whether or not the window is borderless.
w | uiWindow instance. |
TRUE
if window is borderless, FALSE
otherwise. [Default: TODO
] void uiWindowContentSize | ( | uiWindow * | w, |
int * | width, | ||
int * | height | ||
) |
Gets the window content size.
w | uiWindow instance. | |
[out] | width | Window content width. |
[out] | height | Window content height. |
int uiWindowFocused | ( | uiWindow * | w | ) |
Returns whether or not the window is focused.
w | uiWindow instance. |
TRUE
if window is focused, FALSE
otherwise. int uiWindowFullscreen | ( | uiWindow * | w | ) |
Returns whether or not the window is full screen.
w | uiWindow instance. |
TRUE
if full screen, FALSE
otherwise. [Default: FALSE
] int uiWindowMargined | ( | uiWindow * | w | ) |
Returns whether or not the window has a margin.
w | uiWindow instance. |
TRUE
if window has a margin, FALSE
otherwise. [Default: TODO
] Registers a callback for when the window is to be closed.
w | uiWindow instance. |
f | Callback function.sender Back reference to the instance that triggered the callback.senderData User data registered with the sender instance.Return: TRUE to destroys the window.FALSE to abort closing and keep the window alive and visible. |
data | User data to be passed to the callback. |
void uiWindowOnContentSizeChanged | ( | uiWindow * | w, |
void(*)(uiWindow *sender, void *senderData) | f, | ||
void * | data | ||
) |
Registers a callback for when the window content size is changed.
w | uiWindow instance. |
f | Callback function.sender Back reference to the instance that triggered the callback.senderData User data registered with the sender instance. |
data | User data to be passed to the callback. |
void uiWindowOnFocusChanged | ( | uiWindow * | w, |
void(*)(uiWindow *sender, void *senderData) | f, | ||
void * | data | ||
) |
Registers a callback for when the window focus changes.
w | uiWindow instance. |
f | Callback function.sender Back reference to the instance that triggered the callback.senderData User data registered with the sender instance. |
data | User data to be passed to the callback. |
void uiWindowOnPositionChanged | ( | uiWindow * | w, |
void(*)(uiWindow *sender, void *senderData) | f, | ||
void * | data | ||
) |
Registers a callback for when the window moved.
w | uiWindow instance. |
f | Callback function.sender Back reference to the instance that triggered the callback.senderData User data registered with the sender instance. |
data | User data to be passed to the callback. |
void uiWindowPosition | ( | uiWindow * | w, |
int * | x, | ||
int * | y | ||
) |
Gets the window position.
Coordinates are measured from the top left corner of the screen.
w | uiWindow instance. | |
[out] | x | X position of the window. |
[out] | y | Y position of the window. |
int uiWindowResizeable | ( | uiWindow * | w | ) |
Returns whether or not the window is user resizeable.
w | uiWindow instance. |
TRUE
if window is resizable, FALSE
otherwise. [Default: TRUE
] void uiWindowSetBorderless | ( | uiWindow * | w, |
int | borderless | ||
) |
Sets whether or not the window is borderless.
w | uiWindow instance. |
borderless | TRUE to make window borderless, FALSE otherwise. |
Sets the window's child.
w | uiWindow instance. |
child | Control to be made child. |
void uiWindowSetContentSize | ( | uiWindow * | w, |
int | width, | ||
int | height | ||
) |
Sets the window content size.
w | uiWindow instance. |
width | Window content width to set. |
height | Window content height to set. |
void uiWindowSetFullscreen | ( | uiWindow * | w, |
int | fullscreen | ||
) |
Sets whether or not the window is full screen.
w | uiWindow instance. |
fullscreen | TRUE to make window full screen, FALSE otherwise. |
void uiWindowSetMargined | ( | uiWindow * | w, |
int | margined | ||
) |
Sets whether or not the window has a margin.
The margin size is determined by the OS defaults.
w | uiWindow instance. |
margined | TRUE to set a window margin, FALSE otherwise. |
void uiWindowSetPosition | ( | uiWindow * | w, |
int | x, | ||
int | y | ||
) |
Moves the window to the specified position.
Coordinates are measured from the top left corner of the screen.
w | uiWindow instance. |
x | New x position of the window. |
y | New y position of the window. |
void uiWindowSetResizeable | ( | uiWindow * | w, |
int | resizeable | ||
) |
Sets whether or not the window is user resizeable.
w | uiWindow instance. |
resizeable | TRUE to make window resizable, FALSE otherwise. |
void uiWindowSetTitle | ( | uiWindow * | w, |
const char * | title | ||
) |
Sets the window title.
w | uiWindow instance. |
title | Window title text. A valid, NUL terminated UTF-8 string.Data is copied internally. Ownership is not transferred. |
char * uiWindowTitle | ( | uiWindow * | w | ) |
Returns the window title.
w | uiWindow instance. |
NUL
terminated UTF-8 string.uiFreeText()
.