Package org.lwjgl.nuklear
Class NkStyleItem
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.nuklear.NkStyleItem
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class NkStyleItem extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Member documentation
type
– the style type. One of:STYLE_ITEM_COLOR
STYLE_ITEM_IMAGE
data
– the style data
Layout
struct nk_style_item { enum nk_style_item_type type;
union nk_style_item_data
data; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NkStyleItem.Buffer
An array ofNkStyleItem
structs.
-
Constructor Summary
Constructors Constructor Description NkStyleItem(java.nio.ByteBuffer container)
Creates aNkStyleItem
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NkStyleItem
calloc()
Returns a newNkStyleItem
instance allocated withmemCalloc
.static NkStyleItem.Buffer
calloc(int capacity)
Returns a newNkStyleItem.Buffer
instance allocated withmemCalloc
.static NkStyleItem
callocStack()
Returns a newNkStyleItem
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static NkStyleItem.Buffer
callocStack(int capacity)
Returns a newNkStyleItem.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static NkStyleItem.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkStyleItem.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static NkStyleItem
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkStyleItem
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static NkStyleItem
create()
Returns a newNkStyleItem
instance allocated withBufferUtils
.static NkStyleItem.Buffer
create(int capacity)
Returns a newNkStyleItem.Buffer
instance allocated withBufferUtils
.static NkStyleItem
create(long address)
Returns a newNkStyleItem
instance for the specified memory address.static NkStyleItem.Buffer
create(long address, int capacity)
Create aNkStyleItem.Buffer
instance at the specified memory.static NkStyleItem
createSafe(long address)
static NkStyleItem.Buffer
createSafe(long address, int capacity)
NkStyleItemData
data()
Returns aNkStyleItemData
view of thedata
field.NkStyleItem
data(java.util.function.Consumer<NkStyleItemData> consumer)
Passes thedata
field to the specifiedConsumer
.NkStyleItem
data(NkStyleItemData value)
Copies the specifiedNkStyleItemData
to thedata
field.static NkStyleItem
malloc()
Returns a newNkStyleItem
instance allocated withmemAlloc
.static NkStyleItem.Buffer
malloc(int capacity)
Returns a newNkStyleItem.Buffer
instance allocated withmemAlloc
.static NkStyleItem
mallocStack()
Returns a newNkStyleItem
instance allocated on the thread-localMemoryStack
.static NkStyleItem.Buffer
mallocStack(int capacity)
Returns a newNkStyleItem.Buffer
instance allocated on the thread-localMemoryStack
.static NkStyleItem.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkStyleItem.Buffer
instance allocated on the specifiedMemoryStack
.static NkStyleItem
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkStyleItem
instance allocated on the specifiedMemoryStack
.static NkStyleItemData
ndata(long struct)
Unsafe version ofdata()
.static void
ndata(long struct, NkStyleItemData value)
Unsafe version ofdata
.static int
ntype(long struct)
Unsafe version oftype()
.static void
ntype(long struct, int value)
Unsafe version oftype
.NkStyleItem
set(int type, NkStyleItemData data)
Initializes this struct with the specified values.NkStyleItem
set(NkStyleItem src)
Copies the specified struct data to this struct.int
sizeof()
int
type()
Returns the value of thetype
field.NkStyleItem
type(int value)
Sets the specified value to thetype
field.
-
-
-
Constructor Detail
-
NkStyleItem
public NkStyleItem(java.nio.ByteBuffer container)
Creates aNkStyleItem
instance at the current position of the specifiedByteBuffer
container. Changes to the buffer's content will be visible to the struct instance and vice versa.The created instance holds a strong reference to the container object.
-
-
Method Detail
-
sizeof
public int sizeof()
- Specified by:
sizeof
in classorg.lwjgl.system.Struct
-
type
public int type()
Returns the value of thetype
field.
-
data
public NkStyleItemData data()
Returns aNkStyleItemData
view of thedata
field.
-
type
public NkStyleItem type(int value)
Sets the specified value to thetype
field.
-
data
public NkStyleItem data(NkStyleItemData value)
Copies the specifiedNkStyleItemData
to thedata
field.
-
data
public NkStyleItem data(java.util.function.Consumer<NkStyleItemData> consumer)
Passes thedata
field to the specifiedConsumer
.
-
set
public NkStyleItem set(int type, NkStyleItemData data)
Initializes this struct with the specified values.
-
set
public NkStyleItem set(NkStyleItem src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static NkStyleItem malloc()
Returns a newNkStyleItem
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static NkStyleItem calloc()
Returns a newNkStyleItem
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static NkStyleItem create()
Returns a newNkStyleItem
instance allocated withBufferUtils
.
-
create
public static NkStyleItem create(long address)
Returns a newNkStyleItem
instance for the specified memory address.
-
createSafe
@Nullable public static NkStyleItem createSafe(long address)
-
malloc
public static NkStyleItem.Buffer malloc(int capacity)
Returns a newNkStyleItem.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static NkStyleItem.Buffer calloc(int capacity)
Returns a newNkStyleItem.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static NkStyleItem.Buffer create(int capacity)
Returns a newNkStyleItem.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static NkStyleItem.Buffer create(long address, int capacity)
Create aNkStyleItem.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static NkStyleItem.Buffer createSafe(long address, int capacity)
-
mallocStack
public static NkStyleItem mallocStack()
Returns a newNkStyleItem
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static NkStyleItem callocStack()
Returns a newNkStyleItem
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static NkStyleItem mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkStyleItem
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static NkStyleItem callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newNkStyleItem
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static NkStyleItem.Buffer mallocStack(int capacity)
Returns a newNkStyleItem.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static NkStyleItem.Buffer callocStack(int capacity)
Returns a newNkStyleItem.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static NkStyleItem.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkStyleItem.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static NkStyleItem.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newNkStyleItem.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
ntype
public static int ntype(long struct)
Unsafe version oftype()
.
-
ndata
public static NkStyleItemData ndata(long struct)
Unsafe version ofdata()
.
-
ntype
public static void ntype(long struct, int value)
Unsafe version oftype
.
-
ndata
public static void ndata(long struct, NkStyleItemData value)
Unsafe version ofdata
.
-
-