Package org.lwjgl.util.yoga
Class YGValue
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.util.yoga.YGValue
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class YGValue extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Layout
struct YGValue { float value; YGUnit unit; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
YGValue.Buffer
An array ofYGValue
structs.
-
Constructor Summary
Constructors Constructor Description YGValue(java.nio.ByteBuffer container)
Creates aYGValue
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 YGValue
calloc()
Returns a newYGValue
instance allocated withmemCalloc
.static YGValue.Buffer
calloc(int capacity)
Returns a newYGValue.Buffer
instance allocated withmemCalloc
.static YGValue
callocStack()
Returns a newYGValue
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static YGValue.Buffer
callocStack(int capacity)
Returns a newYGValue.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static YGValue.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newYGValue.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static YGValue
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newYGValue
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static YGValue
create()
Returns a newYGValue
instance allocated withBufferUtils
.static YGValue.Buffer
create(int capacity)
Returns a newYGValue.Buffer
instance allocated withBufferUtils
.static YGValue
create(long address)
Returns a newYGValue
instance for the specified memory address.static YGValue.Buffer
create(long address, int capacity)
Create aYGValue.Buffer
instance at the specified memory.static YGValue
createSafe(long address)
static YGValue.Buffer
createSafe(long address, int capacity)
static YGValue
malloc()
Returns a newYGValue
instance allocated withmemAlloc
.static YGValue.Buffer
malloc(int capacity)
Returns a newYGValue.Buffer
instance allocated withmemAlloc
.static YGValue
mallocStack()
Returns a newYGValue
instance allocated on the thread-localMemoryStack
.static YGValue.Buffer
mallocStack(int capacity)
Returns a newYGValue.Buffer
instance allocated on the thread-localMemoryStack
.static YGValue.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newYGValue.Buffer
instance allocated on the specifiedMemoryStack
.static YGValue
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newYGValue
instance allocated on the specifiedMemoryStack
.static int
nunit(long struct)
Unsafe version ofunit()
.static void
nunit(long struct, int value)
Unsafe version ofunit
.static float
nvalue(long struct)
Unsafe version ofvalue()
.static void
nvalue(long struct, float value)
Unsafe version ofvalue
.YGValue
set(float value, int unit)
Initializes this struct with the specified values.YGValue
set(YGValue src)
Copies the specified struct data to this struct.int
sizeof()
int
unit()
Returns the value of theunit
field.YGValue
unit(int value)
Sets the specified value to theunit
field.float
value()
Returns the value of thevalue
field.YGValue
value(float value)
Sets the specified value to thevalue
field.
-
-
-
Constructor Detail
-
YGValue
public YGValue(java.nio.ByteBuffer container)
Creates aYGValue
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
-
value
public float value()
Returns the value of thevalue
field.
-
unit
public int unit()
Returns the value of theunit
field.
-
value
public YGValue value(float value)
Sets the specified value to thevalue
field.
-
unit
public YGValue unit(int value)
Sets the specified value to theunit
field.
-
set
public YGValue set(float value, int unit)
Initializes this struct with the specified values.
-
set
public YGValue set(YGValue src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static YGValue malloc()
Returns a newYGValue
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static YGValue calloc()
Returns a newYGValue
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static YGValue create()
Returns a newYGValue
instance allocated withBufferUtils
.
-
create
public static YGValue create(long address)
Returns a newYGValue
instance for the specified memory address.
-
createSafe
@Nullable public static YGValue createSafe(long address)
-
malloc
public static YGValue.Buffer malloc(int capacity)
Returns a newYGValue.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static YGValue.Buffer calloc(int capacity)
Returns a newYGValue.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static YGValue.Buffer create(int capacity)
Returns a newYGValue.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static YGValue.Buffer create(long address, int capacity)
Create aYGValue.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static YGValue.Buffer createSafe(long address, int capacity)
-
mallocStack
public static YGValue mallocStack()
Returns a newYGValue
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static YGValue callocStack()
Returns a newYGValue
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static YGValue mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newYGValue
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static YGValue callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newYGValue
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static YGValue.Buffer mallocStack(int capacity)
Returns a newYGValue.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static YGValue.Buffer callocStack(int capacity)
Returns a newYGValue.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static YGValue.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newYGValue.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static YGValue.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newYGValue.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nvalue
public static float nvalue(long struct)
Unsafe version ofvalue()
.
-
nunit
public static int nunit(long struct)
Unsafe version ofunit()
.
-
nvalue
public static void nvalue(long struct, float value)
Unsafe version ofvalue
.
-
nunit
public static void nunit(long struct, int value)
Unsafe version ofunit
.
-
-