Package org.gnome.pango
Class Rectangle
java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.gnome.pango.Rectangle
- All Implemented Interfaces:
Proxy
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(org.gnome.pango.Glyph, org.gnome.pango.Rectangle, org.gnome.pango.Rectangle)
.)
-
Constructor Summary
ConstructorDescriptionAllocate a new Rectangle.Rectangle
(int x, int y, int width, int height) Allocate a new Rectangle with the fields set to the provided values.Allocate a new Rectangle with the fields set to the provided values.Allocate a new Rectangle.Rectangle
(MemorySegment address) Create a Rectangle proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionstatic MemoryLayout
The memory layout of the native struct.int
Read the value of the fieldheight
.int
Read the value of the fieldwidth
.int
readX()
Read the value of the fieldx
.int
readY()
Read the value of the fieldy
.void
writeHeight
(int height) Write a value in the fieldheight
.void
writeWidth
(int width) Write a value in the fieldwidth
.void
writeX
(int x) Write a value in the fieldx
.void
writeY
(int y) Write a value in the fieldy
.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
Rectangle
Create a Rectangle proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
Rectangle
Allocate a new Rectangle.- Parameters:
arena
- to control the memory allocation scope
-
Rectangle
public Rectangle()Allocate a new Rectangle. The memory is allocated withArena.ofAuto()
. -
Rectangle
Allocate a new Rectangle with the fields set to the provided values.- Parameters:
x
- value for the fieldx
y
- value for the fieldy
width
- value for the fieldwidth
height
- value for the fieldheight
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 withArena.ofAuto()
.- Parameters:
x
- value for the fieldx
y
- value for the fieldy
width
- value for the fieldwidth
height
- value for the fieldheight
-
-
Method Details
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readX
public int readX()Read the value of the fieldx
.- Returns:
- The value of the field
x
-
writeX
public void writeX(int x) Write a value in the fieldx
.- Parameters:
x
- The new value for the fieldx
-
readY
public int readY()Read the value of the fieldy
.- Returns:
- The value of the field
y
-
writeY
public void writeY(int y) Write a value in the fieldy
.- Parameters:
y
- The new value for the fieldy
-
readWidth
public int readWidth()Read the value of the fieldwidth
.- Returns:
- The value of the field
width
-
writeWidth
public void writeWidth(int width) Write a value in the fieldwidth
.- Parameters:
width
- The new value for the fieldwidth
-
readHeight
public int readHeight()Read the value of the fieldheight
.- Returns:
- The value of the field
height
-
writeHeight
public void writeHeight(int height) Write a value in the fieldheight
.- Parameters:
height
- The new value for the fieldheight
-