TextMarkProtocol
public protocol TextMarkProtocol : ObjectProtocol
A GtkTextMark is a position in a GtkTextbuffer that is preserved
across modifications.
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.
A GtkTextMark is like a bookmark in a text buffer; it preserves
a position in the text. You can convert the mark to an iterator using
[methodGtk.TextBuffer.get_iter_at_mark]. Unlike iterators, marks remain
valid across buffer mutations, because their behavior is defined when
text is inserted or deleted. When text containing a mark is deleted,
the mark remains in the position originally occupied by the deleted
text. When text is inserted at a mark, a mark with “left gravity” will
be moved to the beginning of the newly-inserted text, and a mark with
“right gravity” will be moved to the end.
Note that “left” and “right” here refer to logical direction (left is the toward the start of the buffer); in some languages such as Hebrew the logically-leftmost text is not actually on the left when displayed.
Marks are reference counted, but the reference count only controls
the validity of the memory; marks can be deleted from the buffer at
any time with [methodGtk.TextBuffer.delete_mark]. Once deleted from
the buffer, a mark is essentially useless.
Marks optionally have names; these can be convenient to avoid passing
the GtkTextMark object around.
Marks are typically created using the [methodGtk.TextBuffer.create_mark]
function.
The TextMarkProtocol protocol exposes the methods and properties of an underlying GtkTextMark 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 TextMark.
Alternatively, use TextMarkRef as a lighweight, unowned reference if you already have an instance you just want to use.
-
Untyped pointer to the underlying
GtkTextMarkinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
text_mark_ptrDefault implementationTyped pointer to the underlying
GtkTextMarkinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GtkTextMarkinstance.Declaration
Swift
var text_mark_ptr: UnsafeMutablePointer<GtkTextMark>! { get } -
Required Initialiser for types conforming to
TextMarkProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
TextMarkPropertyNamesource property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: TextMarkPropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocolParameters
source_propertythe source property to bind
targetthe target object to bind to
target_propertythe target property to bind to
flagsthe flags to pass to the
Bindingtransform_fromValueTransformerto use for forward transformationtransform_toValueTransformerto use for backwards transformationReturn Value
binding reference or
nilin case of an error -
get(property:Extension method) Get the value of a TextMark property
Declaration
Swift
@inlinable func get(property: TextMarkPropertyName) -> GLibObject.ValueParameters
propertythe property to get the value for
Return Value
the value of the named property
-
set(property:Extension methodvalue: ) Set the value of a TextMark property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: TextMarkPropertyName, value v: GLibObject.Value)Parameters
propertythe property to get the value for
Return Value
the value of the named property
-
getBuffer()Extension methodGets the buffer this mark is located inside.
Returns
nilif the mark is deleted.Declaration
Swift
@inlinable func getBuffer() -> TextBufferRef! -
getDeleted()Extension methodReturns
trueif the mark has been removed from its buffer.See [method
Gtk.TextBuffer.add_mark] for a way to add it to a buffer again.Declaration
Swift
@inlinable func getDeleted() -> Bool -
getLeftGravity()Extension methodDetermines whether the mark has left gravity.
Declaration
Swift
@inlinable func getLeftGravity() -> Bool -
getName()Extension methodReturns the mark name.
Returns
nilfor anonymous marks.Declaration
Swift
@inlinable func getName() -> String! -
getVisible()Extension methodReturns
trueif the mark is visible.A cursor is displayed for visible marks.
Declaration
Swift
@inlinable func getVisible() -> Bool -
setVisible(setting:Extension method) Undocumented
Declaration
Swift
@inlinable func setVisible(setting: Bool) -
bufferExtension methodGets the buffer this mark is located inside.
Returns
nilif the mark is deleted.Declaration
Swift
@inlinable var buffer: TextBufferRef! { get } -
deletedExtension methodReturns
trueif the mark has been removed from its buffer.See [method
Gtk.TextBuffer.add_mark] for a way to add it to a buffer again.Declaration
Swift
@inlinable var deleted: Bool { get } -
leftGravityExtension methodDetermines whether the mark has left gravity.
Declaration
Swift
@inlinable var leftGravity: Bool { get } -
nameExtension methodThe name of the mark or
nilif the mark is anonymous.Declaration
Swift
@inlinable var name: String! { get } -
visibleExtension methodReturns
trueif the mark is visible.A cursor is displayed for visible marks.
Declaration
Swift
@inlinable var visible: Bool { get nonmutating set } -
parentInstanceExtension methodUndocumented
Declaration
Swift
@inlinable var parentInstance: GObject { get }
View on GitHub
Install in Dash
TextMarkProtocol Protocol Reference