AttributeProtocol

public protocol AttributeProtocol

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 [methodPango.Attribute.init]. By default, an attribute will have an all-inclusive range of [0,G_MAXUINT].

The AttributeProtocol protocol exposes the methods and properties of an underlying PangoAttribute instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see Attribute. Alternatively, use AttributeRef as a lighweight, unowned reference if you already have an instance you just want to use.

  • ptr

    Untyped pointer to the underlying PangoAttribute instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • attribute_ptr Default implementation

    Typed pointer to the underlying PangoAttribute instance.

    Default Implementation

    Return the stored, untyped pointer as a typed pointer to the PangoAttribute instance.

    Declaration

    Swift

    var attribute_ptr: UnsafeMutablePointer<PangoAttribute>! { get }
  • Required Initialiser for types conforming to AttributeProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

Attribute Record: AttributeProtocol extension (methods and fields)

  • asColor() Extension method

    Returns the attribute cast to PangoAttrColor.

    This is mainly useful for language bindings.

    Declaration

    Swift

    @inlinable
    func asColor() -> Pango.AttrColorRef!
  • asFloat() Extension method

    Returns the attribute cast to PangoAttrFloat.

    This is mainly useful for language bindings.

    Declaration

    Swift

    @inlinable
    func asFloat() -> Pango.AttrFloatRef!
  • asFontDesc() Extension method

    Returns the attribute cast to PangoAttrFontDesc.

    This is mainly useful for language bindings.

    Declaration

    Swift

    @inlinable
    func asFontDesc() -> Pango.AttrFontDescRef!
  • asFontFeatures() Extension method

    Returns the attribute cast to PangoAttrFontFeatures.

    This is mainly useful for language bindings.

    Declaration

    Swift

    @inlinable
    func asFontFeatures() -> Pango.AttrFontFeaturesRef!
  • asInt() Extension method

    Returns the attribute cast to PangoAttrInt.

    This is mainly useful for language bindings.

    Declaration

    Swift

    @inlinable
    func asInt() -> Pango.AttrIntRef!
  • asLanguage() Extension method

    Returns the attribute cast to PangoAttrLanguage.

    This is mainly useful for language bindings.

    Declaration

    Swift

    @inlinable
    func asLanguage() -> Pango.AttrLanguageRef!
  • asShape() Extension method

    Returns the attribute cast to PangoAttrShape.

    This is mainly useful for language bindings.

    Declaration

    Swift

    @inlinable
    func asShape() -> Pango.AttrShapeRef!
  • asSize() Extension method

    Returns the attribute cast to PangoAttrSize.

    This is mainly useful for language bindings.

    Declaration

    Swift

    @inlinable
    func asSize() -> Pango.AttrSizeRef!
  • asString() Extension method

    Returns the attribute cast to PangoAttrString.

    This is mainly useful for language bindings.

    Declaration

    Swift

    @inlinable
    func asString() -> Pango.AttrStringRef!
  • copy() Extension method

    Make a copy of an attribute.

    Declaration

    Swift

    @inlinable
    func copy() -> Pango.AttributeRef!
  • destroy() Extension method

    Destroy a PangoAttribute and free all associated memory.

    Declaration

    Swift

    @inlinable
    func destroy()
  • equal(attr2:) Extension method

    Compare two attributes for equality.

    This compares only the actual value of the two attributes and not the ranges that the attributes apply to.

    Declaration

    Swift

    @inlinable
    func equal<AttributeT>(attr2: AttributeT) -> Bool where AttributeT : AttributeProtocol
  • init_(klass:) Extension method

    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.

    Declaration

    Swift

    @inlinable
    func init_<AttrClassT>(klass: AttrClassT) where AttrClassT : AttrClassProtocol
  • klass Extension method

    the class structure holding information about the type of the attribute

    Declaration

    Swift

    @inlinable
    var klass: AttrClassRef! { get set }
  • startIndex Extension method

    the start index of the range (in bytes).

    Declaration

    Swift

    @inlinable
    var startIndex: guint { get set }
  • endIndex Extension method

    end index of the range (in bytes). The character at this index is not included in the range.

    Declaration

    Swift

    @inlinable
    var endIndex: guint { get set }