Class TabArray

All Implemented Interfaces:
PointerInterface

public class TabArray extends Record
A `PangoTabArray` contains an array of tab stops.

`PangoTabArray` can be used to set tab stops in a `PangoLayout`.
Each tab stop has an alignment, a position, and optionally
a character to use as decimal point.

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

  • Constructor Details

    • TabArray

      public TabArray(PointerContainer pointer)
    • TabArray

      public TabArray(int initial_size, boolean positions_in_pixels)
      Creates an array of @initial_size tab stops.

      Tab stops are specified in pixel units if @positions_in_pixels is %TRUE,
      otherwise in Pango units. All stops are initially at position 0.
      Parameters:
      initial_size - Initial number of tab stops to allocate, can be 0
      positions_in_pixels - whether positions are in pixel units
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • newWithPositionsTabArray

      public static TabArray newWithPositionsTabArray(int size, boolean positions_in_pixels, int first_alignment, int first_position, Object... _elipse)
      Creates a `PangoTabArray` and allows you to specify the alignment
      and position of each tab stop.

      You **must** provide an alignment and position for @size tab stops.
      Parameters:
      size - number of tab stops in the array
      positions_in_pixels - whether positions are in pixel units
      first_alignment - alignment of first tab stop
      first_position - position of first tab stop
      _elipse - additional alignment/position pairs
      Returns:
      the newly allocated `PangoTabArray`, which should be freed with [method@Pango.TabArray.free].
    • copy

      public TabArray copy()
      Copies a `PangoTabArray`.
      Returns:
      the newly allocated `PangoTabArray`, which should be freed with [method@Pango.TabArray.free].
    • free

      public void free()
      Frees a tab array and associated resources.
    • getDecimalPoint

      public byte getDecimalPoint(int tab_index)
      Gets the Unicode character to use as decimal point.

      This is only relevant for tabs with %PANGO_TAB_DECIMAL alignment,
      which align content at the first occurrence of the decimal point
      character.

      The default value of 0 means that Pango will use the
      decimal point according to the current locale.
      Parameters:
      tab_index - the index of a tab stop
      Returns:
    • getPositionsInPixels

      public boolean getPositionsInPixels()
      Returns %TRUE if the tab positions are in pixels,
      %FALSE if they are in Pango units.
      Returns:
      whether positions are in pixels.
    • getSize

      public int getSize()
      Gets the number of tab stops in @tab_array.
      Returns:
      the number of tab stops in the array.
    • getTab

      public void getTab(int tab_index, @Nullable Int alignment, @Nullable Int location)
      Gets the alignment and position of a tab stop.
      Parameters:
      tab_index - tab stop index
      alignment - location to store alignment
      location - location to store tab position
    • resize

      public void resize(int new_size)
      Resizes a tab array.

      You must subsequently initialize any tabs
      that were added as a result of growing the array.
      Parameters:
      new_size - new size of the array
    • setDecimalPoint

      public void setDecimalPoint(int tab_index, byte decimal_point)
      Sets the Unicode character to use as decimal point.

      This is only relevant for tabs with %PANGO_TAB_DECIMAL alignment,
      which align content at the first occurrence of the decimal point
      character.

      By default, Pango uses the decimal point according
      to the current locale.
      Parameters:
      tab_index - the index of a tab stop
      decimal_point - the decimal point to use
    • setPositionsInPixels

      public void setPositionsInPixels(boolean positions_in_pixels)
      Sets whether positions in this array are specified in
      pixels.
      Parameters:
      positions_in_pixels - whether positions are in pixels
    • setTab

      public void setTab(int tab_index, int alignment, int location)
      Sets the alignment and location of a tab stop.
      Parameters:
      tab_index - the index of a tab stop
      alignment - tab alignment
      location - tab location in Pango units
    • sort

      public void sort()
      Utility function to ensure that the tab stops are in increasing order.
    • toStr

      public Str toStr()
      Serializes a `PangoTabArray` to a string.

      No guarantees are made about the format of the string,
      it may change between Pango versions.

      The intended use of this function is testing and
      debugging. The format is not meant as a permanent
      storage format.
      Returns:
      a newly allocated string
    • fromString

      public static TabArray fromString(@Nonnull Str text)
      Deserializes a `PangoTabArray` from a string.

      This is the counterpart to [method@Pango.TabArray.to_string].
      See that functions for details about the format.
      Parameters:
      text - a string
      Returns:
      a new `PangoTabArray`
    • 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()