Package org.lwjgl.system.windows
Class RECT
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.system.windows.RECT
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,NativeResource
,Pointer
public class RECT extends Struct implements NativeResource
Defines the coordinates of the upper-left and lower-right corners of a rectangle.Member documentation
left
– the x-coordinate of the upper-left corner of the rectangletop
– the y-coordinate of the upper-left corner of the rectangleright
– the x-coordinate of the lower-right corner of the rectanglebottom
– the y-coordinate of the lower-right corner of the rectangle
Layout
struct RECT { LONG left; LONG top; LONG right; LONG bottom; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RECT.Buffer
An array ofRECT
structs.-
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
BOTTOM
LEFT
RIGHTThe struct member offsets.static int
SIZEOF
The struct size in bytes.static int
TOP
The struct member offsets.-
Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
-
-
Constructor Summary
Constructors Constructor Description RECT(java.nio.ByteBuffer container)
Creates aRECT
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
bottom()
Returns the value of thebottom
field.RECT
bottom(int value)
Sets the specified value to thebottom
field.static RECT
calloc()
Returns a newRECT
instance allocated withmemCalloc
.static RECT.Buffer
calloc(int capacity)
Returns a newRECT.Buffer
instance allocated withmemCalloc
.static RECT
callocStack()
Returns a newRECT
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static RECT.Buffer
callocStack(int capacity)
Returns a newRECT.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static RECT.Buffer
callocStack(int capacity, MemoryStack stack)
Returns a newRECT.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static RECT
callocStack(MemoryStack stack)
Returns a newRECT
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static RECT
create()
Returns a newRECT
instance allocated withBufferUtils
.static RECT.Buffer
create(int capacity)
Returns a newRECT.Buffer
instance allocated withBufferUtils
.static RECT
create(long address)
Returns a newRECT
instance for the specified memory address.static RECT.Buffer
create(long address, int capacity)
Create aRECT.Buffer
instance at the specified memory.static RECT
createSafe(long address)
static RECT.Buffer
createSafe(long address, int capacity)
int
left()
Returns the value of theleft
field.RECT
left(int value)
Sets the specified value to theleft
field.static RECT
malloc()
Returns a newRECT
instance allocated withmemAlloc
.static RECT.Buffer
malloc(int capacity)
Returns a newRECT.Buffer
instance allocated withmemAlloc
.static RECT
mallocStack()
Returns a newRECT
instance allocated on the thread-localMemoryStack
.static RECT.Buffer
mallocStack(int capacity)
Returns a newRECT.Buffer
instance allocated on the thread-localMemoryStack
.static RECT.Buffer
mallocStack(int capacity, MemoryStack stack)
Returns a newRECT.Buffer
instance allocated on the specifiedMemoryStack
.static RECT
mallocStack(MemoryStack stack)
Returns a newRECT
instance allocated on the specifiedMemoryStack
.static int
nbottom(long struct)
Unsafe version ofbottom()
.static void
nbottom(long struct, int value)
Unsafe version ofbottom
.static int
nleft(long struct)
Unsafe version ofleft()
.static void
nleft(long struct, int value)
Unsafe version ofleft
.static int
nright(long struct)
Unsafe version ofright()
.static void
nright(long struct, int value)
Unsafe version ofright
.static int
ntop(long struct)
Unsafe version oftop()
.static void
ntop(long struct, int value)
Unsafe version oftop
.int
right()
Returns the value of theright
field.RECT
right(int value)
Sets the specified value to theright
field.RECT
set(int left, int top, int right, int bottom)
Initializes this struct with the specified values.RECT
set(RECT src)
Copies the specified struct data to this struct.int
sizeof()
Returnssizeof(struct)
.int
top()
Returns the value of thetop
field.RECT
top(int value)
Sets the specified value to thetop
field.-
Methods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
-
-
-
-
Constructor Detail
-
RECT
public RECT(java.nio.ByteBuffer container)
Creates aRECT
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()
Description copied from class:Struct
Returnssizeof(struct)
.
-
left
public int left()
Returns the value of theleft
field.
-
top
public int top()
Returns the value of thetop
field.
-
right
public int right()
Returns the value of theright
field.
-
bottom
public int bottom()
Returns the value of thebottom
field.
-
left
public RECT left(int value)
Sets the specified value to theleft
field.
-
top
public RECT top(int value)
Sets the specified value to thetop
field.
-
right
public RECT right(int value)
Sets the specified value to theright
field.
-
bottom
public RECT bottom(int value)
Sets the specified value to thebottom
field.
-
set
public RECT set(int left, int top, int right, int bottom)
Initializes this struct with the specified values.
-
set
public RECT set(RECT src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static RECT malloc()
Returns a newRECT
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static RECT calloc()
Returns a newRECT
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static RECT create()
Returns a newRECT
instance allocated withBufferUtils
.
-
create
public static RECT create(long address)
Returns a newRECT
instance for the specified memory address.
-
createSafe
@Nullable public static RECT createSafe(long address)
-
malloc
public static RECT.Buffer malloc(int capacity)
Returns a newRECT.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static RECT.Buffer calloc(int capacity)
Returns a newRECT.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static RECT.Buffer create(int capacity)
Returns a newRECT.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static RECT.Buffer create(long address, int capacity)
Create aRECT.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static RECT.Buffer createSafe(long address, int capacity)
-
mallocStack
public static RECT mallocStack()
Returns a newRECT
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static RECT callocStack()
Returns a newRECT
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static RECT mallocStack(MemoryStack stack)
Returns a newRECT
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static RECT callocStack(MemoryStack stack)
Returns a newRECT
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static RECT.Buffer mallocStack(int capacity)
Returns a newRECT.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static RECT.Buffer callocStack(int capacity)
Returns a newRECT.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static RECT.Buffer mallocStack(int capacity, MemoryStack stack)
Returns a newRECT.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static RECT.Buffer callocStack(int capacity, MemoryStack stack)
Returns a newRECT.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nleft
public static int nleft(long struct)
Unsafe version ofleft()
.
-
ntop
public static int ntop(long struct)
Unsafe version oftop()
.
-
nright
public static int nright(long struct)
Unsafe version ofright()
.
-
nbottom
public static int nbottom(long struct)
Unsafe version ofbottom()
.
-
nleft
public static void nleft(long struct, int value)
Unsafe version ofleft
.
-
ntop
public static void ntop(long struct, int value)
Unsafe version oftop
.
-
nright
public static void nright(long struct, int value)
Unsafe version ofright
.
-
nbottom
public static void nbottom(long struct, int value)
Unsafe version ofbottom
.
-
-