Top Fields Constructors Methods
org.lwjgl.nanovg

public Class OUI

extends Object
Class Inheritance
Imports
javax.annotation.*, java.nio.*, org.lwjgl.system.*

Field Summary

Modifier and TypeField and Description
public static final int
UI_ACTIVE

Item states as returned by GetState.

public static final int
UI_ANY

Enum values:

  • USERMASK - these bits, starting at bit 24, can be safely assigned by the application, e.g. as item types, other event types, drop targets, etc.

    They can be set and queried using SetFlags and GetFlags.

  • ANY - a special mask passed to FindItem
public static final int
UI_BREAK

Child layout flags to pass to SetLayout.

public static final int
UI_BUTTON0_CAPTURE

Event flags.

public static final int
UI_BUTTON0_DOWN

Event flags.

public static final int
UI_BUTTON0_HOT_UP

Event flags.

public static final int
UI_BUTTON0_UP

Event flags.

public static final int
UI_BUTTON2_DOWN

Event flags.

public static final int
UI_CENTER

Child layout flags to pass to SetLayout.

public static final int
UI_CHAR

Event flags.

public static final int
UI_COLD

Item states as returned by GetState.

public static final int
UI_COLUMN

Container flags to pass to SetBox.

public static final int
UI_DOWN

Child layout flags to pass to SetLayout.

public static final int
UI_END

Container flags to pass to SetBox.

public static final int
UI_FILL

Child layout flags to pass to SetLayout.

public static final int
UI_FLEX

Container flags to pass to SetBox.

public static final int
UI_FROZEN

Item states as returned by GetState.

public static final int
UI_HCENTER

Child layout flags to pass to SetLayout.

public static final int
UI_HFILL

Child layout flags to pass to SetLayout.

public static final int
UI_HOT

Item states as returned by GetState.

public static final int
UI_JUSTIFY

Container flags to pass to SetBox.

public static final int
UI_KEY_DOWN

Event flags.

public static final int
UI_KEY_UP

Event flags.

public static final int
UI_LAYOUT

Container flags to pass to SetBox.

public static final int
UI_LEFT

Child layout flags to pass to SetLayout.

public static final int
UI_MIDDLE

Container flags to pass to SetBox.

public static final int
UI_NOWRAP

Container flags to pass to SetBox.

public static final int
UI_RIGHT

Child layout flags to pass to SetLayout.

public static final int
UI_ROW

Container flags to pass to SetBox.

public static final int
UI_SCROLL

Event flags.

public static final int
UI_START

Container flags to pass to SetBox.

public static final int
UI_TOP

Child layout flags to pass to SetLayout.

public static final int
UI_USERMASK

Enum values:

  • USERMASK - these bits, starting at bit 24, can be safely assigned by the application, e.g. as item types, other event types, drop targets, etc.

    They can be set and queried using SetFlags and GetFlags.

  • ANY - a special mask passed to FindItem
public static final int
UI_VCENTER

Child layout flags to pass to SetLayout.

public static final int
UI_VFILL

Child layout flags to pass to SetLayout.

public static final int
UI_WRAP

Container flags to pass to SetBox.

Constructor Summary

AccessConstructor and Description
protected
OUI()

Method Summary

Modifier and TypeMethod and Description
public static native long
nuiAllocHandle(int item, int size)

Unsafe version of: AllocHandle

public static native int
nuiContains(int item, int x, int y)

Unsafe version of: Contains

public static native void
nuiDestroyContext(long ctx)

Unsafe version of: DestroyContext

public static native int
nuiGetButton(int button)

Unsafe version of: GetButton

public static native void
nuiGetCursor(long __result)

Unsafe version of: GetCursor

public static native void
nuiGetCursorDelta(long __result)

Unsafe version of: GetCursorDelta

public static native void
nuiGetCursorStart(long __result)

Unsafe version of: GetCursorStart

public static native void
nuiGetCursorStartDelta(long __result)

Unsafe version of: GetCursorStartDelta

public static native long
nuiGetHandler()

Unsafe version of: GetHandler

public static native void
nuiGetRect(int item, long __result)

Unsafe version of: GetRect

public static native void
nuiGetScroll(long __result)

Unsafe version of: GetScroll

public static native void
nuiSetButton(int button, int mod, int enabled)

Unsafe version of: SetButton

public static native void
nuiSetFrozen(int item, int enable)

Unsafe version of: SetFrozen

public static native void
nuiSetHandler(long handler)

Unsafe version of: SetHandler

public static native void
nuiSetKey(int key, int mod, int enabled)

Unsafe version of: SetKey

public static native void
nuiSetMargins(int item, short l, short t, short r, short b)

Unsafe version of: SetMargins

public static ByteBuffer
uiAllocHandle(int item, int size)

Allocates space for application-dependent context data and assign it as the handle to the item.

public static native int
uiAppend(int item, int
inserted after item
sibling
)

Assigns an item to the same container as another item.

public static native void
uiBeginLayout()

Clears the item buffer.

public static native void
uiClearState()

Resets the currently stored hot/active etc. handles.

public static boolean
uiContains(int item, int x, int y)

Returns 1 if an items absolute rectangle contains a given coordinate, otherwise 0.

public static native long
uiCreateContext(int
the maximum number of items that can be declared. 4096 is a good starting value.
item_capacity
,
int
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.
buffer_capacity
)

Creates a new UI context; call MakeCurrent to make this context the current context.

public 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.

public static native void
uiEndLayout()

Layout all added items starting from the root item 0.

public static native 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.

public static native int
uiFirstChild(int
if 0, the first child item of the root item will be returned
item
)

Returns the first child item of a container item.

public static native void
uiFocus(int
if -1, no item will be focused
item
)

Sets item as recipient of all keyboard events.

public static native int
uiGetAllocSize()

Returns the total bytes that have been allocated by AllocHandle

public static native int
uiGetBox(int item)

Returns the box model as set by SetBox.

public static boolean

Returns:

1 if the button has been set to pressed, 0 for released
uiGetButton
(int button)

Returns the current state of an application dependent input button as set by SetButton.

public static native int
uiGetClicks()

Returns the number of chained clicks; 1 is a single click, 2 is a double click, etc.

public static native long
uiGetContext()

Returns the currently selected context or NULL.

public static UIVec2
uiGetCursor(UIVec2 __result)

Returns the current cursor position in screen coordinates as set by SetCursor.

public static UIVec2
uiGetCursorDelta(UIVec2 __result)

Returns the offset of the cursor relative to the last call to Process.

public static UIVec2
uiGetCursorStart(UIVec2 __result)

Returns the beginning point of a drag operation.

public static UIVec2
uiGetCursorStartDelta(UIVec2 __result)

Returns the offset of the cursor relative to the beginning point of a drag operation.

public static native int
uiGetEvents(int item)

Returns the event flags for an item as passed to SetEvents

public static native int
uiGetFlags(int item)

Returns the user-defined flags for an item as passed to SetFlags

public static native int
uiGetFocusedItem()

Returns the item that is currently focused or -1 for none.

public static native long
uiGetHandle(int item)

Returns the application-dependent handle of the item as passed to SetHandle or AllocHandle.

public static UIHandler
uiGetHandler()

Returns the handler callback as passed to SetHandler

public static native int
uiGetHeight(int item)

Return the height of the item as set by SetSize.

public static native int
uiGetHotItem()

Returns the item that is currently under the cursor or -1 for none.

public static native int
uiGetItemCount()

Returns the total number of allocated items

public static native int
uiGetKey()

When handling a KEY_DOWN/KEY_UP event: the key that triggered this event.

public static native int
uiGetLastItemCount()

Returns the number if items that have been allocated in the last frame.

public static native int
uiGetLayout(int item)

Returns the anchoring behavior as set by SetLayout.

public static native short
uiGetMarginDown(int item)

Returns the bottom margin of the item as set with SetMargins.

public static native short
uiGetMarginLeft(int item)

Returns the left margin of the item as set with SetMargins.

public static native short
uiGetMarginRight(int item)

Returns the right margin of the item as set with SetMargins.

public static native short
uiGetMarginTop(int item)

Returns the top margin of the item as set with SetMargins.

public static native int
uiGetModifier()

When handling a keyboard or mouse event: the active modifier keys.

public static UIRect
uiGetRect(int item, UIRect __result)

Returns the items layout rectangle in absolute coordinates.

public static UIVec2
uiGetScroll(UIVec2 __result)

Returns the currently accumulated scroll wheel offsets for this frame

public static native int
uiGetState(int item)

Returns the current state of the item.

public static native int
uiGetWidth(int item)

Returns the width of the item as set by SetSize.

public static native int

Returns:

the child item ID if the container has already added items
uiInsert
(int item, int child)

Assigns an item to a container.

public static native 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.

public static native int
uiInsertFront(int item, int child)

Same as Insert.

public static native int
uiItem()

Creates a new UI item and return the new item's ID.

public static native 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.

public static native int
uiNextSibling(int item)

Returns an items next sibling in the list of the parent containers children.

public static native void
uiProcess(int
the time in milliseconds relative to the last call to uiProcess() and is used to estimate the threshold for double-clicks after calling uiProcess().
timestamp
)

Updates the internal state according to the current cursor position and button states, and call all registered handlers.

public static native int
uiRecoverItem(int olditem)

When BeginLayout is called, the most recently declared items are retained.

public static native 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. the previous item ID has been temporarily saved; uiRemapItem() would then be called after creating the new item using Item.

public static native void
uiSetBox(int item, int flags)

Sets the box model behavior of the item to one or multiple UIboxFlags.

public static void
uiSetButton(int button, int
an application defined set of flags for modifier keys
mod
,
boolean
is 1 for pressed, 0 for released
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.

public static native void
uiSetChar(int value)

Sends a single character for text input; the character is usually in the unicode range, but can be application defined.

public static native void
uiSetCursor(int x, int y)

Sets the current cursor position (usually belonging to a mouse) to the screen coordinates at (x,y).

public static native void
uiSetEvents(int item, int
designates for which events the handler should be called. One or more of:
BUTTON0_DOWNBUTTON0_UPBUTTON0_HOT_UPBUTTON0_CAPTUREBUTTON2_DOWNSCROLLKEY_DOWNKEY_UP
CHAR
flags
)

public static native void
uiSetFlags(int item, int
a user-defined set of flags defined by USERMASK
flags
)

public static void
uiSetFrozen(int item, boolean enable)

Sets an items state to frozen.

public static native void
uiSetHandle(int item, long
an application defined 64-bit handle. If NULL, the item will not be interactive.
handle
)

Sets the application-dependent handle of an item.

public static void
uiSetHandler(UIHandlerI handler)

Sets the global handler callback for interactive items.

public static void
uiSetKey(int key, int
an application defined set of flags for modifier keys
mod
,
boolean
1 for key down, 0 for key up
enabled
)

Sets a key as down/up; the key can be any application defined keycode.

public static native void
uiSetLayout(int item, int flags)

Sets the anchoring behavior of the item to one or multiple UIlayoutFlags.

public static void
uiSetMargins(int item, int l, int t, int r, int b)

Sets the left, top, right and bottom margins of an item.

public static native void
uiSetScroll(int x, int y)

Accumulates scroll wheel offsets for the current frame.

public static native void
uiSetSize(int item, int w, int h)

Sets the size of the item.

public static native 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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait