TextTagTableProtocol

public protocol TextTagTableProtocol : ObjectProtocol, BuildableProtocol

The collection of tags in a GtkTextBuffer

You may wish to begin by reading the text widget conceptual overview, which gives an overview of all the objects and data types related to the text widget and how they work together.

GtkTextTagTables as GtkBuildable

The GtkTextTagTable implementation of the GtkBuildable interface supports adding tags by specifying “tag” as the “type” attribute of a <child> element.

An example of a UI definition fragment specifying tags:

&lt;object class="GtkTextTagTable"&gt;
 &lt;child type="tag"&gt;
   &lt;object class="GtkTextTag"/&gt;
 &lt;/child&gt;
&lt;/object&gt;

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

  • ptr

    Untyped pointer to the underlying GtkTextTagTable instance.

    Declaration

    Swift

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

    Typed pointer to the underlying GtkTextTagTable instance.

    Default Implementation

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

    Declaration

    Swift

    var text_tag_table_ptr: UnsafeMutablePointer<GtkTextTagTable>! { get }
  • Required Initialiser for types conforming to TextTagTableProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

TextTagTable signals

  • Connect a Swift signal handler to the given, typed TextTagTableSignalName signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func connect(signal s: TextTagTableSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> Int

    Parameters

    signal

    The signal to connect

    flags

    The connection flags to use

    data

    A pointer to user data to provide to the callback

    destroyData

    A GClosureNotify C function to destroy the data pointed to by userData

    handler

    The Swift signal handler (function or callback) to invoke on the given signal

    Return Value

    The signal handler ID (always greater than 0 for successful connections)

  • Connect a C signal handler to the given, typed TextTagTableSignalName signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func connect(signal s: TextTagTableSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> Int

    Parameters

    signal

    The signal to connect

    flags

    The connection flags to use

    data

    A pointer to user data to provide to the callback

    destroyData

    A GClosureNotify C function to destroy the data pointed to by userData

    signalHandler

    The C function to be called on the given signal

    Return Value

    The signal handler ID (always greater than 0 for successful connections)

  • onTagAdded(flags:handler:) Extension method

    Emitted every time a new tag is added in the GtkTextTagTable.

    Note

    This represents the underlying tag-added signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onTagAdded(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextTagTableRef, _ tag: TextTagRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    tag

    the added tag.

    handler

    The signal handler to call Run the given callback whenever the tagAdded signal is emitted

  • tagAddedSignal Extension method

    Typed tag-added signal for using the connect(signal:) methods

    Declaration

    Swift

    static var tagAddedSignal: TextTagTableSignalName { get }
  • onTagChanged(flags:handler:) Extension method

    Emitted every time a tag in the GtkTextTagTable changes.

    Note

    This represents the underlying tag-changed signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onTagChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextTagTableRef, _ tag: TextTagRef, _ sizeChanged: Bool) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    tag

    the changed tag.

    sizeChanged

    whether the change affects the GtkTextView layout.

    handler

    The signal handler to call Run the given callback whenever the tagChanged signal is emitted

  • tagChangedSignal Extension method

    Typed tag-changed signal for using the connect(signal:) methods

    Declaration

    Swift

    static var tagChangedSignal: TextTagTableSignalName { get }
  • onTagRemoved(flags:handler:) Extension method

    Emitted every time a tag is removed from the GtkTextTagTable.

    The tag is still valid by the time the signal is emitted, but it is not associated with a tag table any more.

    Note

    This represents the underlying tag-removed signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onTagRemoved(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextTagTableRef, _ tag: TextTagRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    tag

    the removed tag.

    handler

    The signal handler to call Run the given callback whenever the tagRemoved signal is emitted

  • tagRemovedSignal Extension method

    Typed tag-removed signal for using the connect(signal:) methods

    Declaration

    Swift

    static var tagRemovedSignal: TextTagTableSignalName { get }

TextTagTable Class: TextTagTableProtocol extension (methods and fields)

  • add(tag:) Extension method

    Add a tag to the table.

    The tag is assigned the highest priority in the table.

    tag must not be in a tag table already, and may not have the same name as an already-added tag.

    Declaration

    Swift

    @inlinable
    func add<TextTagT>(tag: TextTagT) -> Bool where TextTagT : TextTagProtocol
  • foreach(func:data:) Extension method

    Calls func on each tag in table, with user data data.

    Note that the table may not be modified while iterating over it (you can’t add/remove tags).

    Declaration

    Swift

    @inlinable
    func foreach(func: @escaping GtkTextTagTableForeach, data: gpointer! = nil)
  • getSize() Extension method

    Returns the size of the table (number of tags)

    Declaration

    Swift

    @inlinable
    func getSize() -> Int
  • lookup(name:) Extension method

    Look up a named tag.

    Declaration

    Swift

    @inlinable
    func lookup(name: UnsafePointer<CChar>!) -> TextTagRef!
  • remove(tag:) Extension method

    Remove a tag from the table.

    If a GtkTextBuffer has table as its tag table, the tag is removed from the buffer. The table’s reference to the tag is removed, so the tag will end up destroyed if you don’t have a reference to it.

    Declaration

    Swift

    @inlinable
    func remove<TextTagT>(tag: TextTagT) where TextTagT : TextTagProtocol
  • size Extension method

    Returns the size of the table (number of tags)

    Declaration

    Swift

    @inlinable
    var size: Int { get }