CssLocationProtocol

public protocol CssLocationProtocol

Represents a location in a file or other source of data parsed by the CSS engine.

The bytes and line_bytes offsets are meant to be used to programmatically match data. The lines and line_chars offsets can be used for printing the location in a file.

Note that the lines parameter starts from 0 and is increased whenever a CSS line break is encountered. (CSS defines the C character sequences “\r\n”, “\r”, “\n” and “\f” as newlines.) If your document uses different rules for line breaking, you might want run into problems here.

The CssLocationProtocol protocol exposes the methods and properties of an underlying GtkCssLocation 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 CssLocation. Alternatively, use CssLocationRef as a lighweight, unowned reference if you already have an instance you just want to use.

  • ptr

    Untyped pointer to the underlying GtkCssLocation instance.

    Declaration

    Swift

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

    Typed pointer to the underlying GtkCssLocation instance.

    Default Implementation

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

    Declaration

    Swift

    var _ptr: UnsafeMutablePointer<GtkCssLocation>! { get }
  • Required Initialiser for types conforming to CssLocationProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

CssLocation Record: CssLocationProtocol extension (methods and fields)

  • bytes Extension method

    number of bytes parsed since the beginning

    Declaration

    Swift

    @inlinable
    var bytes: gsize { get set }
  • chars Extension method

    number of characters parsed since the beginning

    Declaration

    Swift

    @inlinable
    var chars: gsize { get set }
  • lines Extension method

    number of full lines that have been parsed. If you want to display this as a line number, you need to add 1 to this.

    Declaration

    Swift

    @inlinable
    var lines: gsize { get set }
  • lineBytes Extension method

    Number of bytes parsed since the last line break

    Declaration

    Swift

    @inlinable
    var lineBytes: gsize { get set }
  • lineChars Extension method

    Number of characters parsed since the last line break

    Declaration

    Swift

    @inlinable
    var lineChars: gsize { get set }