Enum Class Direction

java.lang.Object
java.lang.Enum<Direction>
org.gnome.pango.Direction
All Implemented Interfaces:
Serializable, Comparable<Direction>, Constable, Enumeration

@Generated("org.javagi.JavaGI") public enum Direction extends Enum<Direction> implements Enumeration

PangoDirection represents a direction in the Unicode bidirectional algorithm.

Not every value in this enumeration makes sense for every usage of PangoDirection; for example, the return value of Pango.unicharDirection(int) and Pango.findBaseDir(String, int) cannot be PANGO_DIRECTION_WEAK_LTR or PANGO_DIRECTION_WEAK_RTL, since every character is either neutral or has a strong direction; on the other hand PANGO_DIRECTION_NEUTRAL doesn't make sense to pass to Pango.itemizeWithBaseDir(Context, Direction, String, int, int, AttrList, AttrIterator).

The PANGO_DIRECTION_TTB_LTR, PANGO_DIRECTION_TTB_RTL values come from an earlier interpretation of this enumeration as the writing direction of a block of text and are no longer used. See PangoGravity for how vertical text is handled in Pango.

If you are interested in text direction, you should really use fribidi directly. PangoDirection is only retained because it is used in some public apis.

  • Enum Constant Details

    • LTR

      public static final Direction LTR
      A strong left-to-right direction
    • RTL

      public static final Direction RTL
      A strong right-to-left direction
    • TTB_LTR

      public static final Direction TTB_LTR
      Deprecated value; treated the same as PANGO_DIRECTION_RTL.
    • TTB_RTL

      public static final Direction TTB_RTL
      Deprecated value; treated the same as PANGO_DIRECTION_LTR
    • WEAK_LTR

      public static final Direction WEAK_LTR
      A weak left-to-right direction
    • WEAK_RTL

      public static final Direction WEAK_RTL
      A weak right-to-left direction
    • NEUTRAL

      public static final Direction NEUTRAL
      No direction specified
  • Method Details

    • values

      public static Direction[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Direction valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • of

      public static Direction of(int value)
      Create a new Direction for the provided value
      Parameters:
      value - the enum value
      Returns:
      the enum for the provided value
    • getValue

      public int getValue()
      Get the numeric value of this enum
      Specified by:
      getValue in interface Enumeration
      Returns:
      the enum value
    • of

      public static Direction of(MemorySegment address)
      Create a new Direction for the value in the provided memory address.
      Parameters:
      address - the memory address holding a enum value
      Returns:
      the enum for the value in the provided memory address
    • getType

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