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