Class Rectangle

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class Rectangle extends ProxyInstance

The PangoRectangle structure represents a rectangle.

PangoRectangle is frequently used to represent the logical or ink extents of a single glyph or section of text. (See, for instance, Font.getGlyphExtents(Glyph, Rectangle, Rectangle).)

  • Constructor Summary

    Constructors
    Constructor
    Description
    Allocate a new Rectangle.
    Rectangle(int x, int y, int width, int height)
    Allocate a new Rectangle with the fields set to the provided values.
    Rectangle(int x, int y, int width, int height, Arena arena)
    Allocate a new Rectangle with the fields set to the provided values.
    Allocate a new Rectangle.
    Create a Rectangle proxy instance for the provided memory address.
  • Method Summary

    Modifier and Type
    Method
    Description
    The memory layout of the native struct.
    int
    Read the value of the field height.
    int
    Read the value of the field width.
    int
    Read the value of the field x.
    int
    Read the value of the field y.
    void
    writeHeight(int height)
    Write a value in the field height.
    void
    writeWidth(int width)
    Write a value in the field width.
    void
    writeX(int x)
    Write a value in the field x.
    void
    writeY(int y)
    Write a value in the field y.

    Methods inherited from class ProxyInstance

    equals, handle, hashCode

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Rectangle

      public Rectangle(MemorySegment address)
      Create a Rectangle proxy instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • Rectangle

      public Rectangle(Arena arena)
      Allocate a new Rectangle.
      Parameters:
      arena - to control the memory allocation scope
    • Rectangle

      public Rectangle()
      Allocate a new Rectangle. The memory is allocated with Arena.ofAuto().
    • Rectangle

      public Rectangle(int x, int y, int width, int height, Arena arena)
      Allocate a new Rectangle with the fields set to the provided values.
      Parameters:
      x - value for the field x
      y - value for the field y
      width - value for the field width
      height - value for the field height
      arena - to control the memory allocation scope
    • Rectangle

      public Rectangle(int x, int y, int width, int height)
      Allocate a new Rectangle with the fields set to the provided values. The memory is allocated with Arena.ofAuto().
      Parameters:
      x - value for the field x
      y - value for the field y
      width - value for the field width
      height - value for the field height
  • Method Details

    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • readX

      public int readX()
      Read the value of the field x.
      Returns:
      The value of the field x
    • writeX

      public void writeX(int x)
      Write a value in the field x.
      Parameters:
      x - The new value for the field x
    • readY

      public int readY()
      Read the value of the field y.
      Returns:
      The value of the field y
    • writeY

      public void writeY(int y)
      Write a value in the field y.
      Parameters:
      y - The new value for the field y
    • readWidth

      public int readWidth()
      Read the value of the field width.
      Returns:
      The value of the field width
    • writeWidth

      public void writeWidth(int width)
      Write a value in the field width.
      Parameters:
      width - The new value for the field width
    • readHeight

      public int readHeight()
      Read the value of the field height.
      Returns:
      The value of the field height
    • writeHeight

      public void writeHeight(int height)
      Write a value in the field height.
      Parameters:
      height - The new value for the field height