Class UIRect

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer

    public class UIRect
    extends Struct
    implements NativeResource
    layout rectangle

    Layout

    
     struct UIrect {
         union {
             int v[4];
             struct {
                 int x;
                 int y;
                 int w;
                 int h;
             };
         };
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • V, X, Y, W, H

        The struct member offsets.
    • Constructor Detail

      • UIRect

        public UIRect​(java.nio.ByteBuffer container)
        Creates a UIRect instance at the current position of the specified ByteBuffer 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
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • v

        public java.nio.IntBuffer v()
        Returns a IntBuffer view of the v field.
      • v

        public int v​(int index)
        Returns the value at the specified index of the v field.
      • x

        public int x()
        Returns the value of the x field.
      • y

        public int y()
        Returns the value of the y field.
      • w

        public int w()
        Returns the value of the w field.
      • h

        public int h()
        Returns the value of the h field.
      • v

        public UIRect v​(java.nio.IntBuffer value)
        Copies the specified IntBuffer to the v field.
      • v

        public UIRect v​(int index,
                        int value)
        Sets the specified value at the specified index of the v field.
      • x

        public UIRect x​(int value)
        Sets the specified value to the x field.
      • y

        public UIRect y​(int value)
        Sets the specified value to the y field.
      • w

        public UIRect w​(int value)
        Sets the specified value to the w field.
      • h

        public UIRect h​(int value)
        Sets the specified value to the h field.
      • set

        public UIRect set​(UIRect src)
        Copies the specified struct data to this struct.
        Parameters:
        src - the source struct
        Returns:
        this struct
      • malloc

        public static UIRect malloc()
        Returns a new UIRect instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static UIRect calloc()
        Returns a new UIRect instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static UIRect create()
        Returns a new UIRect instance allocated with BufferUtils.
      • create

        public static UIRect create​(long address)
        Returns a new UIRect instance for the specified memory address.
      • createSafe

        @Nullable
        public static UIRect createSafe​(long address)
        Like create, but returns null if address is NULL.
      • malloc

        public static UIRect.Buffer malloc​(int capacity)
        Returns a new UIRect.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • calloc

        public static UIRect.Buffer calloc​(int capacity)
        Returns a new UIRect.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • create

        public static UIRect.Buffer create​(long address,
                                           int capacity)
        Create a UIRect.Buffer instance at the specified memory.
        Parameters:
        address - the memory address
        capacity - the buffer capacity
      • createSafe

        @Nullable
        public static UIRect.Buffer createSafe​(long address,
                                               int capacity)
        Like create, but returns null if address is NULL.
      • mallocStack

        public static UIRect mallocStack()
        Returns a new UIRect instance allocated on the thread-local MemoryStack.
      • callocStack

        public static UIRect callocStack()
        Returns a new UIRect instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static UIRect mallocStack​(MemoryStack stack)
        Returns a new UIRect instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static UIRect callocStack​(MemoryStack stack)
        Returns a new UIRect instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • mallocStack

        public static UIRect.Buffer mallocStack​(int capacity)
        Returns a new UIRect.Buffer instance allocated on the thread-local MemoryStack.
        Parameters:
        capacity - the buffer capacity
      • callocStack

        public static UIRect.Buffer callocStack​(int capacity)
        Returns a new UIRect.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
        Parameters:
        capacity - the buffer capacity
      • mallocStack

        public static UIRect.Buffer mallocStack​(int capacity,
                                                MemoryStack stack)
        Returns a new UIRect.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • callocStack

        public static UIRect.Buffer callocStack​(int capacity,
                                                MemoryStack stack)
        Returns a new UIRect.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • nv

        public static java.nio.IntBuffer nv​(long struct)
        Unsafe version of v().
      • nv

        public static int nv​(long struct,
                             int index)
        Unsafe version of v.
      • nx

        public static int nx​(long struct)
        Unsafe version of x().
      • ny

        public static int ny​(long struct)
        Unsafe version of y().
      • nw

        public static int nw​(long struct)
        Unsafe version of w().
      • nh

        public static int nh​(long struct)
        Unsafe version of h().
      • nv

        public static void nv​(long struct,
                              java.nio.IntBuffer value)
        Unsafe version of v.
      • nv

        public static void nv​(long struct,
                              int index,
                              int value)
        Unsafe version of v.
      • nx

        public static void nx​(long struct,
                              int value)
        Unsafe version of x.
      • ny

        public static void ny​(long struct,
                              int value)
        Unsafe version of y.
      • nw

        public static void nw​(long struct,
                              int value)
        Unsafe version of w.
      • nh

        public static void nh​(long struct,
                              int value)
        Unsafe version of h.