Class Mark
- All Implemented Interfaces:
Proxy
Buffer
.
A GtkSourceMark
marks a position in the text where you want to display
additional info. It is based on TextMark
and thus is still valid after
the text has changed though its position may change.
GtkSourceMark
s are organized in categories which you have to set
when you create the mark. Each category can have a priority, a pixbuf and
other associated attributes. See View.setMarkAttributes(java.lang.String, org.gnome.gtksourceview.MarkAttributes, int)
.
The pixbuf will be displayed in the margin at the line where the mark
residents if the View:show-line-marks
property is set to true
. If
there are multiple marks in the same line, the pixbufs will be drawn on top
of each other. The mark with the highest priority will be drawn on top.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Mark.Builder<B extends Mark.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.static class
Nested classes/interfaces inherited from class org.gnome.gtk.TextMark
TextMark.TextMarkClass
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
-
Constructor Summary
ConstructorDescriptionCreates a text mark.Mark
(MemorySegment address) Create a Mark proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected Mark
asParent()
Returns this instance as if it were its parent type.static Mark.Builder
<? extends Mark.Builder> builder()
AMark.Builder
object constructs aMark
with the specified properties.Returns the mark category.static MemoryLayout
The memory layout of the native struct.static Type
getType()
Get the GType of the Mark classReturns the nextGtkSourceMark
in the buffer ornull
if the mark was not added to a buffer.Returns the previousGtkSourceMark
in the buffer ornull
if the mark was not added to a buffer.Methods inherited from class org.gnome.gtk.TextMark
getBuffer, getDeleted, getLeftGravity, getName, getVisible, setVisible
Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newInstance, newInstance, newv, notify_, notify_, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withProperties
Methods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, getPrivate, readGClass, writeGClass
Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
Mark
Create a Mark proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
Mark
Creates a text mark.Add it to a buffer using
TextBuffer.addMark(org.gnome.gtk.TextMark, org.gnome.gtk.TextIter)
. If name is NULL, the mark is anonymous; otherwise, the mark can be retrieved by name usingTextBuffer.getMark(java.lang.String)
. Normally marks are created using the utility functionBuffer.createSourceMark(java.lang.String, java.lang.String, org.gnome.gtk.TextIter)
.- Parameters:
name
- Name of theGtkSourceMark
ornull
category
- is used to classify marks according to common characteristics (e.g. all the marks representing a bookmark could belong to the "bookmark" category, or all the marks representing a compilation error could belong to "error" category).
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuper
keyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()
doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName()
. This will call the native function pointer of this virtual method in the typeclass of the parent type. -
getCategory
-
next
Returns the nextGtkSourceMark
in the buffer ornull
if the mark was not added to a buffer.If there is no next mark,
null
will be returned.If
category
isnull
, looks for marks of any category.- Parameters:
category
- a string specifying the mark category, ornull
.- Returns:
- the next
GtkSourceMark
, ornull
.
-
prev
Returns the previousGtkSourceMark
in the buffer ornull
if the mark was not added to a buffer.If there is no previous mark,
null
is returned.If
category
isnull
, looks for marks of any category- Parameters:
category
- a string specifying the mark category, ornull
.- Returns:
- the previous
GtkSourceMark
, ornull
.
-
builder
AMark.Builder
object constructs aMark
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withMark.Builder.build()
.
-