Package org.gnome.pango
Class Rectangle
java.lang.Object
org.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
ConstructorsConstructorDescriptionAllocate 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 MemoryLayoutThe memory layout of the native struct.intRead the value of the fieldheight.intRead the value of the fieldwidth.intreadX()Read the value of the fieldx.intreadY()Read the value of the fieldy.voidwriteHeight(int height) Write a value in the fieldheight.voidwriteWidth(int width) Write a value in the fieldwidth.voidwriteX(int x) Write a value in the fieldx.voidwriteY(int y) Write a value in the fieldy.Methods inherited from class org.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 fieldxy- value for the fieldywidth- value for the fieldwidthheight- value for the fieldheightarena- 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 fieldxy- value for the fieldywidth- value for the fieldwidthheight- 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
-