Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: PangoAttrIterator

[18:7] extends: object

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.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • PangoAttrIterator (Handle = null)

    Creates a new AttrIterator by wrapping a native handle or another wrapper.

    • @p Handle is the native handle or another wrapper whose handle to adopt.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • copy ()

    Copy a PangoAttrIterator.

    • @r the newly allocated PangoAttrIterator, which should be freed with [method@Pango.AttrIterator.destroy].
  • destroy ()

    Destroy a PangoAttrIterator and free all associated memory.

    • @r None.
  • get (string 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.

    • @p type is the type of attribute to find.
    • @r the current attribute of the given type, or %NULL if no attribute of that type applies to the current location..
  • get_attrs ()

    Gets a list of all attributes at the current position of the iterator.

    • @r 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 ()

    Advance the iterator until the next change of style.

    • @r %FALSE if the iterator is at the end of the list, otherwise %TRUE.
  • range ()

    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.

    • @p start is location to store the start of the range.
    • @p end is location to store the end of the range.
    • @r None.
  • attrs ()

    Returns get_attrs as an Aussom list of wrapper objects. This companion method materializes the full collection up front; use get_attrs() when lazy or change-notify access is required.

    • @r An Aussom list of elements.