Class ScriptIter

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class ScriptIter extends ProxyInstance
A PangoScriptIter is used to iterate through a string and identify ranges in different scripts.
  • Constructor Details

    • ScriptIter

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

      public ScriptIter(String text, int length)

      Create a new PangoScriptIter, used to break a string of Unicode text into runs by Unicode script.

      No copy is made of text, so the caller needs to make sure it remains valid until the iterator is freed with free().

      Parameters:
      text - a UTF-8 string
      length - length of text, or -1 if text is nul-terminated
      Since:
      1.4
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the ScriptIter class.
      Returns:
      the GType
    • getMemoryLayout

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

      public void free()
      Frees a PangoScriptIter.
      Since:
      1.4
    • getRange

      public void getRange(@Nullable Out<String> start, @Nullable Out<String> end, @Nullable Out<Script> script)

      Gets information about the range to which this ScriptIter currently points.

      The range is the set of locations p where *start <= p < *end. (That is, it doesn't include the character stored at *end)

      Note that while the type of the script argument is declared as PangoScript, as of Pango 1.18, this function simply returns GUnicodeScript values. Callers must be prepared to handle unknown values.

      Parameters:
      start - location to store start position of the range
      end - location to store end position of the range
      script - location to store script for range
      Since:
      1.4
    • next

      public boolean next()

      Advances a PangoScriptIter to the next range.

      If this ScriptIter is already at the end, it is left unchanged and false is returned.

      Returns:
      true if this ScriptIter was successfully advanced
      Since:
      1.4