Class AttrShape

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class AttrShape extends ProxyInstance
The PangoAttrShape structure is used to represent attributes which impose shape restrictions.
  • Constructor Details

    • AttrShape

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

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

      public AttrShape()
      Allocate a new AttrShape. The memory is allocated with Arena.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 field attr
      inkRect - value for the field inkRect
      logicalRect - value for the field logicalRect
      data - value for the field data
      copyFunc - value for the field copyFunc
      destroyFunc - value for the field destroyFunc
      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 with Arena.ofAuto().
      Parameters:
      attr - value for the field attr
      inkRect - value for the field inkRect
      logicalRect - value for the field logicalRect
      data - value for the field data
      copyFunc - value for the field copyFunc
      destroyFunc - value for the field destroyFunc
  • Method Details

    • getMemoryLayout

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

      public @Nullable Attribute readAttr()
      Read the value of the field attr.
      Returns:
      The value of the field attr
    • writeAttr

      public void writeAttr(@Nullable Attribute attr)
      Write a value in the field attr.
      Parameters:
      attr - The new value for the field attr
    • readInkRect

      public @Nullable Rectangle readInkRect()
      Read the value of the field ink_rect.
      Returns:
      The value of the field ink_rect
    • writeInkRect

      public void writeInkRect(@Nullable Rectangle inkRect)
      Write a value in the field ink_rect.
      Parameters:
      inkRect - The new value for the field ink_rect
    • readLogicalRect

      public @Nullable Rectangle readLogicalRect()
      Read the value of the field logical_rect.
      Returns:
      The value of the field logical_rect
    • writeLogicalRect

      public void writeLogicalRect(@Nullable Rectangle logicalRect)
      Write a value in the field logical_rect.
      Parameters:
      logicalRect - The new value for the field logical_rect
    • readData

      public MemorySegment readData()
      Read the value of the field data.
      Returns:
      The value of the field data
    • writeData

      public void writeData(MemorySegment data)
      Write a value in the field data.
      Parameters:
      data - The new value for the field data
    • readCopyFunc

      public @Nullable AttrDataCopyFunc readCopyFunc()
      Read the value of the field copy_func.
      Returns:
      The value of the field copy_func
    • writeCopyFunc

      public void writeCopyFunc(@Nullable AttrDataCopyFunc copyFunc, Arena _arena)
      Write a value in the field copy_func.
      Parameters:
      copyFunc - The new value for the field copy_func
      _arena - to control the memory allocation scope
    • readDestroyFunc

      public @Nullable DestroyNotify readDestroyFunc()
      Read the value of the field destroy_func.
      Returns:
      The value of the field destroy_func
    • writeDestroyFunc

      public void writeDestroyFunc(@Nullable DestroyNotify destroyFunc, Arena _arena)
      Write a value in the field destroy_func.
      Parameters:
      destroyFunc - The new value for the field destroy_func
      _arena - to control the memory allocation scope
    • new_

      public static Attribute new_(Rectangle inkRect, Rectangle logicalRect)

      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 character
      logicalRect - logical rectangle to assign to each character
      Returns:
      the newly allocated PangoAttribute, which should be freed with Attribute.destroy()
    • newWithData

      public static Attribute newWithData(Rectangle inkRect, Rectangle logicalRect, @Nullable MemorySegment data, @Nullable AttrDataCopyFunc copyFunc)

      Creates a new shape attribute.

      Like new_(Rectangle, 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 character
      logicalRect - logical rectangle to assign to each character
      data - user data pointer
      copyFunc - function to copy data when the attribute is copied. If null, data is simply copied as a pointer
      Returns:
      the newly allocated PangoAttribute, which should be freed with Attribute.destroy()
      Since:
      1.8