Class Attribute

All Implemented Interfaces:
PointerInterface

public class Attribute extends Record
The `PangoAttribute` structure represents the common portions of all
attributes.

Particular types of attributes include this structure as their initial
portion. The common portion of the attribute holds the range to which
the value in the type-specific part of the attribute applies and should
be initialized using [method@Pango.Attribute.init]. By default, an attribute
will have an all-inclusive range of [0,%G_MAXUINT].

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

  • Field Details

    • KLASS

      public static final String KLASS
      the class structure holding information about the type of the attribute
      See Also:
    • START_INDEX

      public static final String START_INDEX
      the start index of the range (in bytes).
      See Also:
    • END_INDEX

      public static final String END_INDEX
      end index of the range (in bytes). The character at this index
      is not included in the range.
      See Also:
  • Constructor Details

    • Attribute

      public Attribute(PointerContainer pointer)
    • Attribute

      public Attribute()
  • Method Details

    • getClassHandler

      public static ClassHandler getClassHandler()
    • setFieldKlass

      public void setFieldKlass(AttrClass klass)
      the class structure holding information about the type of the attribute
    • getFieldKlass

      public AttrClass getFieldKlass()
      the class structure holding information about the type of the attribute
    • setFieldStartIndex

      public void setFieldStartIndex(int start_index)
      the start index of the range (in bytes).
    • getFieldStartIndex

      public int getFieldStartIndex()
      the start index of the range (in bytes).
    • setFieldEndIndex

      public void setFieldEndIndex(int end_index)
      end index of the range (in bytes). The character at this index
      is not included in the range.
    • getFieldEndIndex

      public int getFieldEndIndex()
      end index of the range (in bytes). The character at this index
      is not included in the range.
    • asColor

      public AttrColor asColor()
      Returns the attribute cast to `PangoAttrColor`.

      This is mainly useful for language bindings.
      Returns:
      The attribute as `PangoAttrColor`, or %NULL if it's not a color attribute
    • asFloat

      public AttrFloat asFloat()
      Returns the attribute cast to `PangoAttrFloat`.

      This is mainly useful for language bindings.
      Returns:
      The attribute as `PangoAttrFloat`, or %NULL if it's not a floating point attribute
    • asFontDesc

      public AttrFontDesc asFontDesc()
      Returns the attribute cast to `PangoAttrFontDesc`.

      This is mainly useful for language bindings.
      Returns:
      The attribute as `PangoAttrFontDesc`, or %NULL if it's not a font description attribute
    • asFontFeatures

      public AttrFontFeatures asFontFeatures()
      Returns the attribute cast to `PangoAttrFontFeatures`.

      This is mainly useful for language bindings.
      Returns:
      The attribute as `PangoAttrFontFeatures`, or %NULL if it's not a font features attribute
    • asInt

      public AttrInt asInt()
      Returns the attribute cast to `PangoAttrInt`.

      This is mainly useful for language bindings.
      Returns:
      The attribute as `PangoAttrInt`, or %NULL if it's not an integer attribute
    • asLanguage

      public AttrLanguage asLanguage()
      Returns the attribute cast to `PangoAttrLanguage`.

      This is mainly useful for language bindings.
      Returns:
      The attribute as `PangoAttrLanguage`, or %NULL if it's not a language attribute
    • asShape

      public AttrShape asShape()
      Returns the attribute cast to `PangoAttrShape`.

      This is mainly useful for language bindings.
      Returns:
      The attribute as `PangoAttrShape`, or %NULL if it's not a shape attribute
    • asSize

      public AttrSize asSize()
      Returns the attribute cast to `PangoAttrSize`.

      This is mainly useful for language bindings.
      Returns:
      The attribute as `PangoAttrSize`, or NULL if it's not a size attribute
    • asString

      public AttrString asString()
      Returns the attribute cast to `PangoAttrString`.

      This is mainly useful for language bindings.
      Returns:
      The attribute as `PangoAttrString`, or %NULL if it's not a string attribute
    • copy

      public Attribute copy()
      Make a copy of an attribute.
      Returns:
      the newly allocated `PangoAttribute`, which should be freed with [method@Pango.Attribute.destroy].
    • destroy

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

      public boolean equal(@Nonnull Attribute attr2)
      Compare two attributes for equality.

      This compares only the actual value of the two
      attributes and not the ranges that the attributes
      apply to.
      Parameters:
      attr2 - another `PangoAttribute`
      Returns:
      %TRUE if the two attributes have the same value
    • init

      public void init(@Nonnull AttrClass klass)
      Initializes @attr's klass to @klass, it's start_index to
      %PANGO_ATTR_INDEX_FROM_TEXT_BEGINNING and end_index to
      %PANGO_ATTR_INDEX_TO_TEXT_END such that the attribute applies
      to the entire text by default.
      Parameters:
      klass - a `PangoAttrClass`
    • 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()