Class AttrIterator

All Implemented Interfaces:
PointerInterface

public class AttrIterator extends Record
A `PangoAttrIterator` is used to iterate through a `PangoAttrList`.

A new iterator is created with [method@Pango.AttrList.get_iterator].
Once the iterator is created, it can be advanced through the style
changes in the text using [method@Pango.AttrIterator.next]. At each
style change, the range of the current style segment and the attributes
currently in effect can be queried.

https://docs.gtk.org/Pango/struct.AttrIterator.html

  • Constructor Details

  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • copy

      public AttrIterator copy()
      Copy a `PangoAttrIterator`.
      Returns:
      the newly allocated `PangoAttrIterator`, which should be freed with [method@Pango.AttrIterator.destroy]
    • destroy

      public void destroy()
      Destroy a `PangoAttrIterator` and free all associated memory.
      Overrides:
      destroy in class Record
    • get

      public Attribute get(int type)
      Find the current attribute of a particular type
      at the iterator location.

      When multiple attributes of the same type overlap,
      the attribute whose range starts closest to the
      current location is used.
      Parameters:
      type - the type of attribute to find
      Returns:
      the current attribute of the given type, or %NULL if no attribute of that type applies to the current location.
    • getAttrs

      public SList getAttrs()
      Gets a list of all attributes at the current position of the
      iterator.
      Returns:
      a list of all attributes for the current range. To free this value, call [method@Pango.Attribute.destroy] on each value and g_slist_free() on the list.
    • next

      public boolean next()
      Advance the iterator until the next change of style.
      Returns:
      %FALSE if the iterator is at the end of the list, otherwise %TRUE
    • range

      public void range(@Nonnull Int start, @Nonnull Int end)
      Get the range of the current segment.

      Note that the stored return values are signed, not unsigned
      like the values in `PangoAttribute`. To deal with this API
      oversight, stored return values that wouldn't fit into
      a signed integer are clamped to %G_MAXINT.
      Parameters:
      start - location to store the start of the range
      end - location to store the end of the range
    • getTypeID

      public static long getTypeID()
    • getParentTypeID

      public static long getParentTypeID()
    • getTypeSize

      public static TypeSystem.TypeSize getTypeSize()
    • getParentTypeSize

      public static TypeSystem.TypeSize getParentTypeSize()
    • getInstanceSize

      public static int getInstanceSize()