Package org.gnome.pango
Class AttrShape
java.lang.Object
io.github.jwharm.javagi.base.ProxyInstance
org.gnome.pango.AttrShape
- All Implemented Interfaces:
Proxy
The
PangoAttrShape
structure is used to represent attributes which
impose shape restrictions.-
Constructor Summary
ConstructorDescriptionAllocate a new AttrShape.Allocate a new AttrShape.AttrShape
(MemorySegment address) Create a AttrShape proxy instance for the provided memory address.AttrShape
(Attribute attr, Rectangle inkRect, Rectangle logicalRect, MemorySegment data, AttrDataCopyFunc copyFunc, DestroyNotify destroyFunc) Allocate a new AttrShape with the fields set to the provided values.AttrShape
(Attribute attr, Rectangle inkRect, Rectangle logicalRect, MemorySegment data, AttrDataCopyFunc copyFunc, DestroyNotify destroyFunc, Arena arena) Allocate a new AttrShape with the fields set to the provided values. -
Method Summary
Modifier and TypeMethodDescriptionstatic MemoryLayout
The memory layout of the native struct.static Attribute
Create a new shape attribute.static Attribute
newWithData
(Rectangle inkRect, Rectangle logicalRect, @Nullable MemorySegment data, @Nullable AttrDataCopyFunc copyFunc) Creates a new shape attribute.readAttr()
Read the value of the fieldattr
.Read the value of the fieldcopy_func
.readData()
Read the value of the fielddata
.Read the value of the fielddestroy_func
.Read the value of the fieldink_rect
.Read the value of the fieldlogical_rect
.void
Write a value in the fieldattr
.void
writeCopyFunc
(AttrDataCopyFunc copyFunc, Arena _arena) Write a value in the fieldcopy_func
.void
writeData
(MemorySegment data) Write a value in the fielddata
.void
writeDestroyFunc
(DestroyNotify destroyFunc, Arena _arena) Write a value in the fielddestroy_func
.void
writeInkRect
(Rectangle inkRect) Write a value in the fieldink_rect
.void
writeLogicalRect
(Rectangle logicalRect) Write a value in the fieldlogical_rect
.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
AttrShape
Create a AttrShape proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
AttrShape
Allocate a new AttrShape.- Parameters:
arena
- to control the memory allocation scope
-
AttrShape
public AttrShape()Allocate a new AttrShape. The memory is allocated withArena.ofAuto()
. -
AttrShape
public AttrShape(Attribute attr, Rectangle inkRect, Rectangle logicalRect, MemorySegment data, AttrDataCopyFunc copyFunc, DestroyNotify destroyFunc, Arena arena) Allocate a new AttrShape with the fields set to the provided values.- Parameters:
attr
- value for the fieldattr
inkRect
- value for the fieldinkRect
logicalRect
- value for the fieldlogicalRect
data
- value for the fielddata
copyFunc
- value for the fieldcopyFunc
destroyFunc
- value for the fielddestroyFunc
arena
- to control the memory allocation scope
-
AttrShape
public AttrShape(Attribute attr, Rectangle inkRect, Rectangle logicalRect, MemorySegment data, AttrDataCopyFunc copyFunc, DestroyNotify destroyFunc) Allocate a new AttrShape with the fields set to the provided values. The memory is allocated withArena.ofAuto()
.- Parameters:
attr
- value for the fieldattr
inkRect
- value for the fieldinkRect
logicalRect
- value for the fieldlogicalRect
data
- value for the fielddata
copyFunc
- value for the fieldcopyFunc
destroyFunc
- value for the fielddestroyFunc
-
-
Method Details
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readAttr
-
writeAttr
Write a value in the fieldattr
.- Parameters:
attr
- The new value for the fieldattr
-
readInkRect
Read the value of the fieldink_rect
.- Returns:
- The value of the field
ink_rect
-
writeInkRect
Write a value in the fieldink_rect
.- Parameters:
inkRect
- The new value for the fieldink_rect
-
readLogicalRect
Read the value of the fieldlogical_rect
.- Returns:
- The value of the field
logical_rect
-
writeLogicalRect
Write a value in the fieldlogical_rect
.- Parameters:
logicalRect
- The new value for the fieldlogical_rect
-
readData
Read the value of the fielddata
.- Returns:
- The value of the field
data
-
writeData
Write a value in the fielddata
.- Parameters:
data
- The new value for the fielddata
-
readCopyFunc
Read the value of the fieldcopy_func
.- Returns:
- The value of the field
copy_func
-
writeCopyFunc
Write a value in the fieldcopy_func
.- Parameters:
copyFunc
- The new value for the fieldcopy_func
_arena
- to control the memory allocation scope
-
readDestroyFunc
Read the value of the fielddestroy_func
.- Returns:
- The value of the field
destroy_func
-
writeDestroyFunc
Write a value in the fielddestroy_func
.- Parameters:
destroyFunc
- The new value for the fielddestroy_func
_arena
- to control the memory allocation scope
-
new_
Create a new shape attribute.A shape is used to impose a particular ink and logical rectangle on the result of shaping a particular glyph. This might be used, for instance, for embedding a picture or a widget inside a
PangoLayout
.- Parameters:
inkRect
- ink rectangle to assign to each characterlogicalRect
- logical rectangle to assign to each character- Returns:
- the newly allocated
PangoAttribute
, which should be freed withAttribute.destroy()
-
newWithData
public static Attribute newWithData(Rectangle inkRect, Rectangle logicalRect, @Nullable @Nullable MemorySegment data, @Nullable @Nullable AttrDataCopyFunc copyFunc) Creates a new shape attribute.Like
new_(org.gnome.pango.Rectangle, org.gnome.pango.Rectangle)
, but a user data pointer is also provided; this pointer can be accessed when later rendering the glyph.- Parameters:
inkRect
- ink rectangle to assign to each characterlogicalRect
- logical rectangle to assign to each characterdata
- user data pointercopyFunc
- function to copydata
when the attribute is copied. Ifnull
,data
is simply copied as a pointer- Returns:
- the newly allocated
PangoAttribute
, which should be freed withAttribute.destroy()
-