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:
<object class="GtkTextTagTable">
<child type="tag">
<object class="GtkTextTag"/>
</child>
</object>
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.
-
Untyped pointer to the underlying
GtkTextTagTableinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
text_tag_table_ptrDefault implementationTyped pointer to the underlying
GtkTextTagTableinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkTextTagTableinstance.Declaration
Swift
var text_tag_table_ptr: UnsafeMutablePointer<GtkTextTagTable>! { get } -
Required Initialiser for types conforming to
TextTagTableProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
connect(signal:Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
TextTagTableSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: TextTagTableSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatahandlerThe 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(signal:Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
TextTagTableSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: TextTagTableSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatasignalHandlerThe C function to be called on the given signal
Return Value
The signal handler ID (always greater than 0 for successful connections)
-
onTagAdded(flags:Extension methodhandler: ) Emitted every time a new tag is added in the
GtkTextTagTable.Note
This represents the underlyingtag-addedsignalDeclaration
Swift
@discardableResult @inlinable func onTagAdded(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextTagTableRef, _ tag: TextTagRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
tagthe added tag.
handlerThe signal handler to call Run the given callback whenever the
tagAddedsignal is emitted -
tagAddedSignalExtension methodTyped
tag-addedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var tagAddedSignal: TextTagTableSignalName { get } -
onTagChanged(flags:Extension methodhandler: ) Emitted every time a tag in the
GtkTextTagTablechanges.Note
This represents the underlyingtag-changedsignalDeclaration
Swift
@discardableResult @inlinable func onTagChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextTagTableRef, _ tag: TextTagRef, _ sizeChanged: Bool) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
tagthe changed tag.
sizeChangedwhether the change affects the
GtkTextViewlayout.handlerThe signal handler to call Run the given callback whenever the
tagChangedsignal is emitted -
tagChangedSignalExtension methodTyped
tag-changedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var tagChangedSignal: TextTagTableSignalName { get } -
onTagRemoved(flags:Extension methodhandler: ) Emitted every time a tag is removed from the
GtkTextTagTable.The
tagis still valid by the time the signal is emitted, but it is not associated with a tag table any more.Note
This represents the underlyingtag-removedsignalDeclaration
Swift
@discardableResult @inlinable func onTagRemoved(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: TextTagTableRef, _ tag: TextTagRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
tagthe removed tag.
handlerThe signal handler to call Run the given callback whenever the
tagRemovedsignal is emitted -
tagRemovedSignalExtension methodTyped
tag-removedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var tagRemovedSignal: TextTagTableSignalName { get }
-
add(tag:Extension method) Add a tag to the table.
The tag is assigned the highest priority in the table.
tagmust 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:Extension methoddata: ) Calls
funcon each tag intable, with user datadata.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 methodReturns 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
GtkTextBufferhastableas 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 -
sizeExtension methodReturns the size of the table (number of tags)
Declaration
Swift
@inlinable var size: Int { get }
View on GitHub
Install in Dash
TextTagTableProtocol Protocol Reference