public class OUI
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
UI_ACTIVE
Item states as returned by
GetState. |
static int |
UI_ANY
Enum values:
|
static int |
UI_BREAK
Child layout flags to pass to
SetLayout. |
static int |
UI_BUTTON0_CAPTURE
Event flags.
|
static int |
UI_BUTTON0_DOWN
Event flags.
|
static int |
UI_BUTTON0_HOT_UP
Event flags.
|
static int |
UI_BUTTON0_UP
Event flags.
|
static int |
UI_BUTTON2_DOWN
Event flags.
|
static int |
UI_CENTER
Child layout flags to pass to
SetLayout. |
static int |
UI_CHAR
Event flags.
|
static int |
UI_COLD
Item states as returned by
GetState. |
static int |
UI_COLUMN
Container flags to pass to
SetBox. |
static int |
UI_DOWN
Child layout flags to pass to
SetLayout. |
static int |
UI_END
Container flags to pass to
SetBox. |
static int |
UI_FILL
Child layout flags to pass to
SetLayout. |
static int |
UI_FLEX
Container flags to pass to
SetBox. |
static int |
UI_FROZEN
Item states as returned by
GetState. |
static int |
UI_HCENTER
Child layout flags to pass to
SetLayout. |
static int |
UI_HFILL
Child layout flags to pass to
SetLayout. |
static int |
UI_HOT
Item states as returned by
GetState. |
static int |
UI_JUSTIFY
Container flags to pass to
SetBox. |
static int |
UI_KEY_DOWN
Event flags.
|
static int |
UI_KEY_UP
Event flags.
|
static int |
UI_LAYOUT
Container flags to pass to
SetBox. |
static int |
UI_LEFT
Child layout flags to pass to
SetLayout. |
static int |
UI_MIDDLE
Container flags to pass to
SetBox. |
static int |
UI_NOWRAP
Container flags to pass to
SetBox. |
static int |
UI_RIGHT
Child layout flags to pass to
SetLayout. |
static int |
UI_ROW
Container flags to pass to
SetBox. |
static int |
UI_SCROLL
Event flags.
|
static int |
UI_START
Container flags to pass to
SetBox. |
static int |
UI_TOP
Child layout flags to pass to
SetLayout. |
static int |
UI_USERMASK
Enum values:
|
static int |
UI_VCENTER
Child layout flags to pass to
SetLayout. |
static int |
UI_VFILL
Child layout flags to pass to
SetLayout. |
static int |
UI_WRAP
Container flags to pass to
SetBox. |
| Modifier and Type | Method and Description |
|---|---|
static long |
nuiAllocHandle(int item,
int size)
Unsafe version of:
AllocHandle |
static int |
nuiContains(int item,
int x,
int y)
Unsafe version of:
Contains |
static void |
nuiDestroyContext(long ctx)
Unsafe version of:
DestroyContext |
static int |
nuiGetButton(int button)
Unsafe version of:
GetButton |
static void |
nuiGetCursor(long __result)
Unsafe version of:
GetCursor |
static void |
nuiGetCursorDelta(long __result)
Unsafe version of:
GetCursorDelta |
static void |
nuiGetCursorStart(long __result)
Unsafe version of:
GetCursorStart |
static void |
nuiGetCursorStartDelta(long __result)
Unsafe version of:
GetCursorStartDelta |
static long |
nuiGetHandler()
Unsafe version of:
GetHandler |
static void |
nuiGetRect(int item,
long __result)
Unsafe version of:
GetRect |
static void |
nuiGetScroll(long __result)
Unsafe version of:
GetScroll |
static void |
nuiSetButton(int button,
int mod,
int enabled)
Unsafe version of:
SetButton |
static void |
nuiSetFrozen(int item,
int enable)
Unsafe version of:
SetFrozen |
static void |
nuiSetHandler(long handler)
Unsafe version of:
SetHandler |
static void |
nuiSetKey(int key,
int mod,
int enabled)
Unsafe version of:
SetKey |
static void |
nuiSetMargins(int item,
short l,
short t,
short r,
short b)
Unsafe version of:
SetMargins |
static java.nio.ByteBuffer |
uiAllocHandle(int item,
int size)
Allocates space for application-dependent context data and assign it as the handle to the item.
|
static int |
uiAppend(int item,
int sibling)
Assigns an item to the same container as another item.
|
static void |
uiBeginLayout()
Clears the item buffer.
|
static void |
uiClearState()
Resets the currently stored hot/active etc.
|
static boolean |
uiContains(int item,
int x,
int y)
Returns 1 if an items absolute rectangle contains a given coordinate, otherwise 0.
|
static long |
uiCreateContext(int item_capacity,
int buffer_capacity)
Creates a new UI context; call
MakeCurrent to make this context the current context. |
static void |
uiDestroyContext(long ctx)
Releases the memory of an UI context created with
CreateContext; if the context is the current context, the current context will be set to NULL. |
static void |
uiEndLayout()
Layout all added items starting from the root item 0.
|
static int |
uiFindItem(int item,
int x,
int y,
int flags,
int mask)
Returns the topmost item containing absolute location
(x,y), starting with item as parent, using a set of flags and masks as filter. |
static int |
uiFirstChild(int item)
Returns the first child item of a container item.
|
static void |
uiFocus(int item)
Sets item as recipient of all keyboard events.
|
static int |
uiGetAllocSize()
Returns the total bytes that have been allocated by
AllocHandle |
static int |
uiGetBox(int item)
Returns the box model as set by
SetBox. |
static boolean |
uiGetButton(int button)
Returns the current state of an application dependent input button as set by
SetButton. |
static int |
uiGetClicks()
Returns the number of chained clicks; 1 is a single click, 2 is a double click, etc.
|
static long |
uiGetContext()
Returns the currently selected context or
NULL. |
static UIVec2 |
uiGetCursor(UIVec2 __result)
Returns the current cursor position in screen coordinates as set by
SetCursor. |
static UIVec2 |
uiGetCursorDelta(UIVec2 __result)
Returns the offset of the cursor relative to the last call to
Process. |
static UIVec2 |
uiGetCursorStart(UIVec2 __result)
Returns the beginning point of a drag operation.
|
static UIVec2 |
uiGetCursorStartDelta(UIVec2 __result)
Returns the offset of the cursor relative to the beginning point of a drag operation.
|
static int |
uiGetEvents(int item)
Returns the event flags for an item as passed to
SetEvents |
static int |
uiGetFlags(int item)
Returns the user-defined flags for an item as passed to
SetFlags |
static int |
uiGetFocusedItem()
Returns the item that is currently focused or -1 for none.
|
static long |
uiGetHandle(int item)
Returns the application-dependent handle of the item as passed to
SetHandle or AllocHandle. |
static UIHandler |
uiGetHandler()
Returns the handler callback as passed to
SetHandler |
static int |
uiGetHeight(int item)
Return the height of the item as set by
SetSize. |
static int |
uiGetHotItem()
Returns the item that is currently under the cursor or -1 for none.
|
static int |
uiGetItemCount()
Returns the total number of allocated items
|
static int |
uiGetKey()
When handling a
KEY_DOWN/KEY_UP event: the key that triggered this event. |
static int |
uiGetLastItemCount()
Returns the number if items that have been allocated in the last frame.
|
static int |
uiGetLayout(int item)
Returns the anchoring behavior as set by
SetLayout. |
static short |
uiGetMarginDown(int item)
Returns the bottom margin of the item as set with
SetMargins. |
static short |
uiGetMarginLeft(int item)
Returns the left margin of the item as set with
SetMargins. |
static short |
uiGetMarginRight(int item)
Returns the right margin of the item as set with
SetMargins. |
static short |
uiGetMarginTop(int item)
Returns the top margin of the item as set with
SetMargins. |
static int |
uiGetModifier()
When handling a keyboard or mouse event: the active modifier keys.
|
static UIRect |
uiGetRect(int item,
UIRect __result)
Returns the items layout rectangle in absolute coordinates.
|
static UIVec2 |
uiGetScroll(UIVec2 __result)
Returns the currently accumulated scroll wheel offsets for this frame
|
static int |
uiGetState(int item)
Returns the current state of the item.
|
static int |
uiGetWidth(int item)
Returns the width of the item as set by
SetSize. |
static int |
uiInsert(int item,
int child)
Assigns an item to a container.
|
static int |
uiInsertBack(int item,
int child)
Inserts child into container item like
Insert, but prepend it to the first child item, effectively putting it in the background. |
static int |
uiInsertFront(int item,
int child)
Same as
Insert. |
static int |
uiItem()
Creates a new UI item and return the new item's ID.
|
static void |
uiMakeCurrent(long ctx)
Selects an UI context as the current context; a context must always be selected before using any of the other UI functions.
|
static int |
uiNextSibling(int item)
Returns an items next sibling in the list of the parent containers children.
|
static void |
uiProcess(int timestamp)
Updates the internal state according to the current cursor position and button states, and call all registered handlers.
|
static int |
uiRecoverItem(int olditem)
When
BeginLayout is called, the most recently declared items are retained. |
static void |
uiRemapItem(int olditem,
int newitem)
In cases where it is important to recover old state over changes in the view, and the built-in remapping fails, the UI declaration can manually remap
old items to new IDs in cases where e.g.
|
static void |
uiSetBox(int item,
int flags)
Sets the box model behavior of the item to one or multiple
UIboxFlags. |
static void |
uiSetButton(int button,
int mod,
boolean enabled)
Sets a mouse or gamepad button as pressed/released button is in the range
0..63 and maps to an application defined input source. |
static void |
uiSetChar(int value)
Sends a single character for text input; the character is usually in the unicode range, but can be application defined.
|
static void |
uiSetCursor(int x,
int y)
Sets the current cursor position (usually belonging to a mouse) to the screen coordinates at
(x,y). |
static void |
uiSetEvents(int item,
int flags) |
static void |
uiSetFlags(int item,
int flags) |
static void |
uiSetFrozen(int item,
boolean enable)
Sets an items state to frozen.
|
static void |
uiSetHandle(int item,
long handle)
Sets the application-dependent handle of an item.
|
static void |
uiSetHandler(UIHandlerI handler)
Sets the global handler callback for interactive items.
|
static void |
uiSetKey(int key,
int mod,
boolean enabled)
Sets a key as down/up; the key can be any application defined
keycode. |
static void |
uiSetLayout(int item,
int flags)
Sets the anchoring behavior of the item to one or multiple
UIlayoutFlags. |
static void |
uiSetMargins(int item,
int l,
int t,
int r,
int b)
Sets the left, top, right and bottom margins of an item.
|
static void |
uiSetScroll(int x,
int y)
Accumulates scroll wheel offsets for the current frame.
|
static void |
uiSetSize(int item,
int w,
int h)
Sets the size of the item.
|
static void |
uiUpdateHotItem()
Updates the current hot item; this only needs to be called if items are kept for more than one frame and
EndLayout is not called. |
public static final int UI_USERMASK
public static final int UI_ANY
public static final int UI_COLD
public static final int UI_HOT
public static final int UI_ACTIVE
public static final int UI_FROZEN
public static final int UI_ROW
SetBox. (UIboxFlags)
ROW - left to rightCOLUMN - top to bottomLAYOUT - free layoutFLEX - flex modelNOWRAP - single-lineWRAP - multi-line, wrap left to rightSTART - justify-content (start, end, center, space-between) at start of row/columnMIDDLE - at center of row/columnEND - at end of row/columnJUSTIFY - insert spacing to stretch across whole row/columnpublic static final int UI_COLUMN
SetBox. (UIboxFlags)
ROW - left to rightCOLUMN - top to bottomLAYOUT - free layoutFLEX - flex modelNOWRAP - single-lineWRAP - multi-line, wrap left to rightSTART - justify-content (start, end, center, space-between) at start of row/columnMIDDLE - at center of row/columnEND - at end of row/columnJUSTIFY - insert spacing to stretch across whole row/columnpublic static final int UI_LAYOUT
SetBox. (UIboxFlags)
ROW - left to rightCOLUMN - top to bottomLAYOUT - free layoutFLEX - flex modelNOWRAP - single-lineWRAP - multi-line, wrap left to rightSTART - justify-content (start, end, center, space-between) at start of row/columnMIDDLE - at center of row/columnEND - at end of row/columnJUSTIFY - insert spacing to stretch across whole row/columnpublic static final int UI_FLEX
SetBox. (UIboxFlags)
ROW - left to rightCOLUMN - top to bottomLAYOUT - free layoutFLEX - flex modelNOWRAP - single-lineWRAP - multi-line, wrap left to rightSTART - justify-content (start, end, center, space-between) at start of row/columnMIDDLE - at center of row/columnEND - at end of row/columnJUSTIFY - insert spacing to stretch across whole row/columnpublic static final int UI_NOWRAP
SetBox. (UIboxFlags)
ROW - left to rightCOLUMN - top to bottomLAYOUT - free layoutFLEX - flex modelNOWRAP - single-lineWRAP - multi-line, wrap left to rightSTART - justify-content (start, end, center, space-between) at start of row/columnMIDDLE - at center of row/columnEND - at end of row/columnJUSTIFY - insert spacing to stretch across whole row/columnpublic static final int UI_WRAP
SetBox. (UIboxFlags)
ROW - left to rightCOLUMN - top to bottomLAYOUT - free layoutFLEX - flex modelNOWRAP - single-lineWRAP - multi-line, wrap left to rightSTART - justify-content (start, end, center, space-between) at start of row/columnMIDDLE - at center of row/columnEND - at end of row/columnJUSTIFY - insert spacing to stretch across whole row/columnpublic static final int UI_START
SetBox. (UIboxFlags)
ROW - left to rightCOLUMN - top to bottomLAYOUT - free layoutFLEX - flex modelNOWRAP - single-lineWRAP - multi-line, wrap left to rightSTART - justify-content (start, end, center, space-between) at start of row/columnMIDDLE - at center of row/columnEND - at end of row/columnJUSTIFY - insert spacing to stretch across whole row/columnpublic static final int UI_MIDDLE
SetBox. (UIboxFlags)
ROW - left to rightCOLUMN - top to bottomLAYOUT - free layoutFLEX - flex modelNOWRAP - single-lineWRAP - multi-line, wrap left to rightSTART - justify-content (start, end, center, space-between) at start of row/columnMIDDLE - at center of row/columnEND - at end of row/columnJUSTIFY - insert spacing to stretch across whole row/columnpublic static final int UI_END
SetBox. (UIboxFlags)
ROW - left to rightCOLUMN - top to bottomLAYOUT - free layoutFLEX - flex modelNOWRAP - single-lineWRAP - multi-line, wrap left to rightSTART - justify-content (start, end, center, space-between) at start of row/columnMIDDLE - at center of row/columnEND - at end of row/columnJUSTIFY - insert spacing to stretch across whole row/columnpublic static final int UI_JUSTIFY
SetBox. (UIboxFlags)
ROW - left to rightCOLUMN - top to bottomLAYOUT - free layoutFLEX - flex modelNOWRAP - single-lineWRAP - multi-line, wrap left to rightSTART - justify-content (start, end, center, space-between) at start of row/columnMIDDLE - at center of row/columnEND - at end of row/columnJUSTIFY - insert spacing to stretch across whole row/columnpublic static final int UI_LEFT
SetLayout. (UIlayoutFlags)
LEFT - anchor to left item or left side of parentTOP - anchor to top item or top side of parentRIGHT - anchor to right item or right side of parentDOWN - anchor to bottom item or bottom side of parentHFILL - anchor to both left and right item or parent bordersVFILL - anchor to both top and bottom item or parent bordersHCENTER - center horizontally, with left margin as offsetVCENTER - center vertically, with top margin as offsetCENTER - center in both directions, with left/top margin as offsetFILL - anchor to all four directionsBREAK -
when wrapping, put this element on a new line.
Wrapping layout code auto-inserts UI_BREAK flags, drawing routines can read them with GetLayout.
public static final int UI_TOP
SetLayout. (UIlayoutFlags)
LEFT - anchor to left item or left side of parentTOP - anchor to top item or top side of parentRIGHT - anchor to right item or right side of parentDOWN - anchor to bottom item or bottom side of parentHFILL - anchor to both left and right item or parent bordersVFILL - anchor to both top and bottom item or parent bordersHCENTER - center horizontally, with left margin as offsetVCENTER - center vertically, with top margin as offsetCENTER - center in both directions, with left/top margin as offsetFILL - anchor to all four directionsBREAK -
when wrapping, put this element on a new line.
Wrapping layout code auto-inserts UI_BREAK flags, drawing routines can read them with GetLayout.
public static final int UI_RIGHT
SetLayout. (UIlayoutFlags)
LEFT - anchor to left item or left side of parentTOP - anchor to top item or top side of parentRIGHT - anchor to right item or right side of parentDOWN - anchor to bottom item or bottom side of parentHFILL - anchor to both left and right item or parent bordersVFILL - anchor to both top and bottom item or parent bordersHCENTER - center horizontally, with left margin as offsetVCENTER - center vertically, with top margin as offsetCENTER - center in both directions, with left/top margin as offsetFILL - anchor to all four directionsBREAK -
when wrapping, put this element on a new line.
Wrapping layout code auto-inserts UI_BREAK flags, drawing routines can read them with GetLayout.
public static final int UI_DOWN
SetLayout. (UIlayoutFlags)
LEFT - anchor to left item or left side of parentTOP - anchor to top item or top side of parentRIGHT - anchor to right item or right side of parentDOWN - anchor to bottom item or bottom side of parentHFILL - anchor to both left and right item or parent bordersVFILL - anchor to both top and bottom item or parent bordersHCENTER - center horizontally, with left margin as offsetVCENTER - center vertically, with top margin as offsetCENTER - center in both directions, with left/top margin as offsetFILL - anchor to all four directionsBREAK -
when wrapping, put this element on a new line.
Wrapping layout code auto-inserts UI_BREAK flags, drawing routines can read them with GetLayout.
public static final int UI_HFILL
SetLayout. (UIlayoutFlags)
LEFT - anchor to left item or left side of parentTOP - anchor to top item or top side of parentRIGHT - anchor to right item or right side of parentDOWN - anchor to bottom item or bottom side of parentHFILL - anchor to both left and right item or parent bordersVFILL - anchor to both top and bottom item or parent bordersHCENTER - center horizontally, with left margin as offsetVCENTER - center vertically, with top margin as offsetCENTER - center in both directions, with left/top margin as offsetFILL - anchor to all four directionsBREAK -
when wrapping, put this element on a new line.
Wrapping layout code auto-inserts UI_BREAK flags, drawing routines can read them with GetLayout.
public static final int UI_VFILL
SetLayout. (UIlayoutFlags)
LEFT - anchor to left item or left side of parentTOP - anchor to top item or top side of parentRIGHT - anchor to right item or right side of parentDOWN - anchor to bottom item or bottom side of parentHFILL - anchor to both left and right item or parent bordersVFILL - anchor to both top and bottom item or parent bordersHCENTER - center horizontally, with left margin as offsetVCENTER - center vertically, with top margin as offsetCENTER - center in both directions, with left/top margin as offsetFILL - anchor to all four directionsBREAK -
when wrapping, put this element on a new line.
Wrapping layout code auto-inserts UI_BREAK flags, drawing routines can read them with GetLayout.
public static final int UI_HCENTER
SetLayout. (UIlayoutFlags)
LEFT - anchor to left item or left side of parentTOP - anchor to top item or top side of parentRIGHT - anchor to right item or right side of parentDOWN - anchor to bottom item or bottom side of parentHFILL - anchor to both left and right item or parent bordersVFILL - anchor to both top and bottom item or parent bordersHCENTER - center horizontally, with left margin as offsetVCENTER - center vertically, with top margin as offsetCENTER - center in both directions, with left/top margin as offsetFILL - anchor to all four directionsBREAK -
when wrapping, put this element on a new line.
Wrapping layout code auto-inserts UI_BREAK flags, drawing routines can read them with GetLayout.
public static final int UI_VCENTER
SetLayout. (UIlayoutFlags)
LEFT - anchor to left item or left side of parentTOP - anchor to top item or top side of parentRIGHT - anchor to right item or right side of parentDOWN - anchor to bottom item or bottom side of parentHFILL - anchor to both left and right item or parent bordersVFILL - anchor to both top and bottom item or parent bordersHCENTER - center horizontally, with left margin as offsetVCENTER - center vertically, with top margin as offsetCENTER - center in both directions, with left/top margin as offsetFILL - anchor to all four directionsBREAK -
when wrapping, put this element on a new line.
Wrapping layout code auto-inserts UI_BREAK flags, drawing routines can read them with GetLayout.
public static final int UI_CENTER
SetLayout. (UIlayoutFlags)
LEFT - anchor to left item or left side of parentTOP - anchor to top item or top side of parentRIGHT - anchor to right item or right side of parentDOWN - anchor to bottom item or bottom side of parentHFILL - anchor to both left and right item or parent bordersVFILL - anchor to both top and bottom item or parent bordersHCENTER - center horizontally, with left margin as offsetVCENTER - center vertically, with top margin as offsetCENTER - center in both directions, with left/top margin as offsetFILL - anchor to all four directionsBREAK -
when wrapping, put this element on a new line.
Wrapping layout code auto-inserts UI_BREAK flags, drawing routines can read them with GetLayout.
public static final int UI_FILL
SetLayout. (UIlayoutFlags)
LEFT - anchor to left item or left side of parentTOP - anchor to top item or top side of parentRIGHT - anchor to right item or right side of parentDOWN - anchor to bottom item or bottom side of parentHFILL - anchor to both left and right item or parent bordersVFILL - anchor to both top and bottom item or parent bordersHCENTER - center horizontally, with left margin as offsetVCENTER - center vertically, with top margin as offsetCENTER - center in both directions, with left/top margin as offsetFILL - anchor to all four directionsBREAK -
when wrapping, put this element on a new line.
Wrapping layout code auto-inserts UI_BREAK flags, drawing routines can read them with GetLayout.
public static final int UI_BREAK
SetLayout. (UIlayoutFlags)
LEFT - anchor to left item or left side of parentTOP - anchor to top item or top side of parentRIGHT - anchor to right item or right side of parentDOWN - anchor to bottom item or bottom side of parentHFILL - anchor to both left and right item or parent bordersVFILL - anchor to both top and bottom item or parent bordersHCENTER - center horizontally, with left margin as offsetVCENTER - center vertically, with top margin as offsetCENTER - center in both directions, with left/top margin as offsetFILL - anchor to all four directionsBREAK -
when wrapping, put this element on a new line.
Wrapping layout code auto-inserts UI_BREAK flags, drawing routines can read them with GetLayout.
public static final int UI_BUTTON0_DOWN
UIevent)
BUTTON0_DOWN - on button 0 downBUTTON0_UP - on button 0 up when this event has a handler, GetState will return ACTIVE as long as button 0 is downBUTTON0_HOT_UP -
on button 0 up while item is hovered when this event has a handler, GetState will return ACTIVE when the cursor is hovering the items
rectangle; this is the behavior expected for buttons
BUTTON0_CAPTURE - item is being captured (button 0 constantly pressed); when this event has a handler, GetState will return ACTIVE as long as button 0 is downBUTTON2_DOWN - on button 2 down (right mouse button, usually triggers context menu)SCROLL - item has received a scrollwheel event the accumulated wheel offset can be queried with GetScrollKEY_DOWN - item is focused and has received a key-down event the respective key can be queried using GetKey and GetModifierKEY_UP - item is focused and has received a key-up event the respective key can be queried using GetKey and GetModifierCHAR - item is focused and has received a character event the respective character can be queried using GetKeypublic static final int UI_BUTTON0_UP
UIevent)
BUTTON0_DOWN - on button 0 downBUTTON0_UP - on button 0 up when this event has a handler, GetState will return ACTIVE as long as button 0 is downBUTTON0_HOT_UP -
on button 0 up while item is hovered when this event has a handler, GetState will return ACTIVE when the cursor is hovering the items
rectangle; this is the behavior expected for buttons
BUTTON0_CAPTURE - item is being captured (button 0 constantly pressed); when this event has a handler, GetState will return ACTIVE as long as button 0 is downBUTTON2_DOWN - on button 2 down (right mouse button, usually triggers context menu)SCROLL - item has received a scrollwheel event the accumulated wheel offset can be queried with GetScrollKEY_DOWN - item is focused and has received a key-down event the respective key can be queried using GetKey and GetModifierKEY_UP - item is focused and has received a key-up event the respective key can be queried using GetKey and GetModifierCHAR - item is focused and has received a character event the respective character can be queried using GetKeypublic static final int UI_BUTTON0_HOT_UP
UIevent)
BUTTON0_DOWN - on button 0 downBUTTON0_UP - on button 0 up when this event has a handler, GetState will return ACTIVE as long as button 0 is downBUTTON0_HOT_UP -
on button 0 up while item is hovered when this event has a handler, GetState will return ACTIVE when the cursor is hovering the items
rectangle; this is the behavior expected for buttons
BUTTON0_CAPTURE - item is being captured (button 0 constantly pressed); when this event has a handler, GetState will return ACTIVE as long as button 0 is downBUTTON2_DOWN - on button 2 down (right mouse button, usually triggers context menu)SCROLL - item has received a scrollwheel event the accumulated wheel offset can be queried with GetScrollKEY_DOWN - item is focused and has received a key-down event the respective key can be queried using GetKey and GetModifierKEY_UP - item is focused and has received a key-up event the respective key can be queried using GetKey and GetModifierCHAR - item is focused and has received a character event the respective character can be queried using GetKeypublic static final int UI_BUTTON0_CAPTURE
UIevent)
BUTTON0_DOWN - on button 0 downBUTTON0_UP - on button 0 up when this event has a handler, GetState will return ACTIVE as long as button 0 is downBUTTON0_HOT_UP -
on button 0 up while item is hovered when this event has a handler, GetState will return ACTIVE when the cursor is hovering the items
rectangle; this is the behavior expected for buttons
BUTTON0_CAPTURE - item is being captured (button 0 constantly pressed); when this event has a handler, GetState will return ACTIVE as long as button 0 is downBUTTON2_DOWN - on button 2 down (right mouse button, usually triggers context menu)SCROLL - item has received a scrollwheel event the accumulated wheel offset can be queried with GetScrollKEY_DOWN - item is focused and has received a key-down event the respective key can be queried using GetKey and GetModifierKEY_UP - item is focused and has received a key-up event the respective key can be queried using GetKey and GetModifierCHAR - item is focused and has received a character event the respective character can be queried using GetKeypublic static final int UI_BUTTON2_DOWN
UIevent)
BUTTON0_DOWN - on button 0 downBUTTON0_UP - on button 0 up when this event has a handler, GetState will return ACTIVE as long as button 0 is downBUTTON0_HOT_UP -
on button 0 up while item is hovered when this event has a handler, GetState will return ACTIVE when the cursor is hovering the items
rectangle; this is the behavior expected for buttons
BUTTON0_CAPTURE - item is being captured (button 0 constantly pressed); when this event has a handler, GetState will return ACTIVE as long as button 0 is downBUTTON2_DOWN - on button 2 down (right mouse button, usually triggers context menu)SCROLL - item has received a scrollwheel event the accumulated wheel offset can be queried with GetScrollKEY_DOWN - item is focused and has received a key-down event the respective key can be queried using GetKey and GetModifierKEY_UP - item is focused and has received a key-up event the respective key can be queried using GetKey and GetModifierCHAR - item is focused and has received a character event the respective character can be queried using GetKeypublic static final int UI_SCROLL
UIevent)
BUTTON0_DOWN - on button 0 downBUTTON0_UP - on button 0 up when this event has a handler, GetState will return ACTIVE as long as button 0 is downBUTTON0_HOT_UP -
on button 0 up while item is hovered when this event has a handler, GetState will return ACTIVE when the cursor is hovering the items
rectangle; this is the behavior expected for buttons
BUTTON0_CAPTURE - item is being captured (button 0 constantly pressed); when this event has a handler, GetState will return ACTIVE as long as button 0 is downBUTTON2_DOWN - on button 2 down (right mouse button, usually triggers context menu)SCROLL - item has received a scrollwheel event the accumulated wheel offset can be queried with GetScrollKEY_DOWN - item is focused and has received a key-down event the respective key can be queried using GetKey and GetModifierKEY_UP - item is focused and has received a key-up event the respective key can be queried using GetKey and GetModifierCHAR - item is focused and has received a character event the respective character can be queried using GetKeypublic static final int UI_KEY_DOWN
UIevent)
BUTTON0_DOWN - on button 0 downBUTTON0_UP - on button 0 up when this event has a handler, GetState will return ACTIVE as long as button 0 is downBUTTON0_HOT_UP -
on button 0 up while item is hovered when this event has a handler, GetState will return ACTIVE when the cursor is hovering the items
rectangle; this is the behavior expected for buttons
BUTTON0_CAPTURE - item is being captured (button 0 constantly pressed); when this event has a handler, GetState will return ACTIVE as long as button 0 is downBUTTON2_DOWN - on button 2 down (right mouse button, usually triggers context menu)SCROLL - item has received a scrollwheel event the accumulated wheel offset can be queried with GetScrollKEY_DOWN - item is focused and has received a key-down event the respective key can be queried using GetKey and GetModifierKEY_UP - item is focused and has received a key-up event the respective key can be queried using GetKey and GetModifierCHAR - item is focused and has received a character event the respective character can be queried using GetKeypublic static final int UI_KEY_UP
UIevent)
BUTTON0_DOWN - on button 0 downBUTTON0_UP - on button 0 up when this event has a handler, GetState will return ACTIVE as long as button 0 is downBUTTON0_HOT_UP -
on button 0 up while item is hovered when this event has a handler, GetState will return ACTIVE when the cursor is hovering the items
rectangle; this is the behavior expected for buttons
BUTTON0_CAPTURE - item is being captured (button 0 constantly pressed); when this event has a handler, GetState will return ACTIVE as long as button 0 is downBUTTON2_DOWN - on button 2 down (right mouse button, usually triggers context menu)SCROLL - item has received a scrollwheel event the accumulated wheel offset can be queried with GetScrollKEY_DOWN - item is focused and has received a key-down event the respective key can be queried using GetKey and GetModifierKEY_UP - item is focused and has received a key-up event the respective key can be queried using GetKey and GetModifierCHAR - item is focused and has received a character event the respective character can be queried using GetKeypublic static final int UI_CHAR
UIevent)
BUTTON0_DOWN - on button 0 downBUTTON0_UP - on button 0 up when this event has a handler, GetState will return ACTIVE as long as button 0 is downBUTTON0_HOT_UP -
on button 0 up while item is hovered when this event has a handler, GetState will return ACTIVE when the cursor is hovering the items
rectangle; this is the behavior expected for buttons
BUTTON0_CAPTURE - item is being captured (button 0 constantly pressed); when this event has a handler, GetState will return ACTIVE as long as button 0 is downBUTTON2_DOWN - on button 2 down (right mouse button, usually triggers context menu)SCROLL - item has received a scrollwheel event the accumulated wheel offset can be queried with GetScrollKEY_DOWN - item is focused and has received a key-down event the respective key can be queried using GetKey and GetModifierKEY_UP - item is focused and has received a key-up event the respective key can be queried using GetKey and GetModifierCHAR - item is focused and has received a character event the respective character can be queried using GetKeypublic static long uiCreateContext(int item_capacity,
int buffer_capacity)
MakeCurrent to make this context the current context.
The context is managed by the client and must be released using DestroyContext.
item_capacity - the maximum number of items that can be declared. 4096 is a good starting value.buffer_capacity - the maximum total size of bytes that can be allocated using AllocHandle; you may pass 0 if you don't need to allocate handles. (1<<20)
is a good starting value.public static void uiMakeCurrent(long ctx)
public static void nuiDestroyContext(long ctx)
DestroyContextpublic static void uiDestroyContext(long ctx)
CreateContext; if the context is the current context, the current context will be set to NULL.public static long uiGetContext()
NULL.public static void uiSetCursor(int x,
int y)
(x,y).public static void nuiGetCursor(long __result)
GetCursorpublic static UIVec2 uiGetCursor(UIVec2 __result)
SetCursor.public static void nuiGetCursorDelta(long __result)
GetCursorDeltapublic static UIVec2 uiGetCursorDelta(UIVec2 __result)
Process.public static void nuiGetCursorStart(long __result)
GetCursorStartpublic static UIVec2 uiGetCursorStart(UIVec2 __result)
public static void nuiGetCursorStartDelta(long __result)
GetCursorStartDeltapublic static UIVec2 uiGetCursorStartDelta(UIVec2 __result)
public static void nuiSetButton(int button,
int mod,
int enabled)
SetButtonpublic static void uiSetButton(int button,
int mod,
boolean enabled)
0..63 and maps to an application defined input source.mod - an application defined set of flags for modifier keysenabled - is 1 for pressed, 0 for releasedpublic static int nuiGetButton(int button)
GetButtonpublic static boolean uiGetButton(int button)
SetButton.public static int uiGetClicks()
public static void nuiSetKey(int key,
int mod,
int enabled)
SetKeypublic static void uiSetKey(int key,
int mod,
boolean enabled)
keycode.
All key events are being buffered until the next call to Process.
mod - an application defined set of flags for modifier keysenabled - 1 for key down, 0 for key uppublic static void uiSetChar(int value)
All char events are being buffered until the next call to Process.
public static void uiSetScroll(int x,
int y)
All offsets are being accumulated until the next call to Process.
public static void nuiGetScroll(long __result)
GetScrollpublic static UIVec2 uiGetScroll(UIVec2 __result)
public static void uiBeginLayout()
uiBeginLayout() should be called before the first UI declaration for this frame to avoid concatenation of the same UI multiple times. After the
call, all previously declared item IDs are invalid, and all application dependent context data has been freed.
uiBeginLayout() must be followed by EndLayout.
public static void uiEndLayout()
After calling uiEndLayout(), no further modifications to the item tree should be done until the next call to BeginLayout. It is safe to
immediately draw the items after a call to uiEndLayout().
This is an O(N) operation for N = number of declared items.
public static void uiUpdateHotItem()
EndLayout is not called.public static void uiProcess(int timestamp)
No further modifications to the item tree should be done until the next call to BeginLayout. Items should be drawn before a call to
uiProcess().
This is an O(N) operation for N = number of declared items.
timestamp - the time in milliseconds relative to the last call to uiProcess() and is used to estimate the threshold for double-clicks after calling
uiProcess().public static void uiClearState()
This should be called when a re-declaration of the UI changes the item indices, to avoid state related glitches because item identities have changed.
public static int uiItem()
public static void nuiSetFrozen(int item,
int enable)
SetFrozenpublic static void uiSetFrozen(int item,
boolean enable)
The UI will not recurse into frozen items when searching for hot or active items; subsequently, frozen items and their child items will not cause mouse
event notifications. The frozen state is not applied recursively; GetState will report COLD for child items. Upon encountering a frozen item, the
drawing routine needs to handle rendering of child items appropriately.
public static void uiSetHandle(int item,
long handle)
handle - an application defined 64-bit handle. If NULL, the item will not be interactive.public static long nuiAllocHandle(int item,
int size)
AllocHandle@Nullable
public static java.nio.ByteBuffer uiAllocHandle(int item,
int size)
The memory of the pointer is managed by the UI context and released upon the next call to BeginLayout.
public static void nuiSetHandler(long handler)
SetHandlerpublic static void uiSetHandler(UIHandlerI handler)
The handler will be called for each item whose event flags are set using SetEvents.
public static void uiSetEvents(int item,
int flags)
flags - designates for which events the handler should be called. One or more of:BUTTON0_DOWN | BUTTON0_UP | BUTTON0_HOT_UP | BUTTON0_CAPTURE | BUTTON2_DOWN | SCROLL | KEY_DOWN | KEY_UP |
CHAR |
public static void uiSetFlags(int item,
int flags)
flags - a user-defined set of flags defined by USERMASKpublic static int uiInsert(int item,
int child)
An item ID of 0 refers to the root item. The function searches for the last item and calls Append on it, which is an O(N) operation for
N siblings. It is usually more efficient to call uiInsert() for the first child, then chain additional siblings using
uiAppend().
public static int uiAppend(int item,
int sibling)
sibling - inserted after itempublic static int uiInsertBack(int item,
int child)
Insert, but prepend it to the first child item, effectively putting it in the background.
It is efficient to call uiInsertBack() repeatedly in cases where drawing or layout order doesn't matter.
public static int uiInsertFront(int item,
int child)
Insert.public static void uiSetSize(int item,
int w,
int h)
A size of 0 indicates the dimension to be dynamic; if the size is set, the item can not expand beyond that size.
public static void uiSetLayout(int item,
int flags)
UIlayoutFlags.public static void uiSetBox(int item,
int flags)
UIboxFlags.public static void nuiSetMargins(int item,
short l,
short t,
short r,
short b)
SetMarginspublic static void uiSetMargins(int item,
int l,
int t,
int r,
int b)
When the item is anchored to the parent or another item, the margin controls the distance from the neighboring element.
public static void uiFocus(int item)
item - if -1, no item will be focusedpublic static int uiFirstChild(int item)
If the item is not a container or does not contain any items, -1 is returned.
item - if 0, the first child item of the root item will be returnedpublic static int uiNextSibling(int item)
If item is 0 or the item is the last child item, -1 will be returned.
public static int uiGetItemCount()
public static int uiGetAllocSize()
AllocHandlepublic static int uiGetState(int item)
public static long uiGetHandle(int item)
SetHandle or AllocHandle.public static int uiGetHotItem()
public static int uiGetFocusedItem()
public static int uiFindItem(int item,
int x,
int y,
int flags,
int mask)
(x,y), starting with item as parent, using a set of flags and masks as filter.
If both flags and mask are ANY, the first topmost item is returned. If mask is ANY, the first topmost item matching
any of flags is returned. otherwise the first item matching (item.flags & flags) == mask is returned. You may combine box, layout,
event and user flags. Frozen items will always be ignored.
public static long nuiGetHandler()
GetHandler@Nullable public static UIHandler uiGetHandler()
SetHandlerpublic static int uiGetEvents(int item)
SetEventspublic static int uiGetFlags(int item)
SetFlagspublic static int uiGetKey()
KEY_DOWN/KEY_UP event: the key that triggered this event.public static int uiGetModifier()
public static void nuiGetRect(int item,
long __result)
GetRectpublic static UIRect uiGetRect(int item, UIRect __result)
If uiGetRect() is called before EndLayout, the values of the returned rectangle are undefined.
public static int nuiContains(int item,
int x,
int y)
Containspublic static boolean uiContains(int item,
int x,
int y)
public static int uiGetWidth(int item)
SetSize.public static int uiGetHeight(int item)
SetSize.public static int uiGetLayout(int item)
SetLayout.public static int uiGetBox(int item)
SetBox.public static short uiGetMarginLeft(int item)
SetMargins.public static short uiGetMarginTop(int item)
SetMargins.public static short uiGetMarginRight(int item)
SetMargins.public static short uiGetMarginDown(int item)
SetMargins.public static int uiRecoverItem(int olditem)
BeginLayout is called, the most recently declared items are retained. When EndLayout completes, it matches the old item hierarchy to the new
one and attempts to map old items to new items as well as possible. When passed an item Id from the previous frame, uiRecoverItem() returns the
item's new assumed Id, or -1 if the item could not be mapped. It is valid to pass -1 as item.public static void uiRemapItem(int olditem,
int newitem)
uiRemapItem() would then be called after creating the
new item using Item.public static int uiGetLastItemCount()
Copyright LWJGL. All Rights Reserved. License terms.