Class GutterLines
- All Implemented Interfaces:
Proxy
The GtkSourceGutterLines
object is used to collect information about
visible lines.
Use this from your GutterRenderer::query-data
to collect the
necessary information on visible lines. Doing so reduces the number of
passes through the text btree allowing GtkSourceView to reach more
frames-per-second while performing kinetic scrolling.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
GutterLines.Builder<B extends GutterLines.Builder<B>>
Inner class implementing a builder pattern to construct a GObject with properties.static class
Nested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass
-
Constructor Summary
ConstructorDescriptionGutterLines
(MemorySegment address) Create a GutterLines proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the classname
toline
.void
Adds the class denoted byqname
toline
.protected GutterLines
asParent()
Returns this instance as if it were its parent type.static GutterLines.Builder
<? extends GutterLines.Builder> builder()
AGutterLines.Builder
object constructs aGutterLines
with the specified properties.Gets theTextBuffer
that theGtkSourceGutterLines
represents.int
getFirst()
Gets the line number (starting from 0) for the first line that is user visible.void
getIterAtLine
(TextIter iter, int line) Gets aGtkTextIter
for the current buffer atline
int
getLast()
Gets the line number (starting from 0) for the last line that is user visible.void
getLineYrange
(int line, GutterRendererAlignmentMode mode, Out<Integer> y, Out<Integer> height) Gets the Y range for a line based onmode
.static Type
getType()
Get the GType of the GutterLines classgetView()
Gets theTextView
that theGtkSourceGutterLines
represents.boolean
hasAnyClass
(int line) Checks to see if the line has any GQuark classes set.boolean
boolean
Checks to see ifaddQclass(int, org.gnome.glib.Quark)
was called with the quark denoted byqname
forline
.boolean
isCursor
(int line) Checks to see ifline
contains the insertion cursor.boolean
isPrelit
(int line) Checks to see ifline
is marked as prelit.boolean
isSelected
(int line) Checks to see if the view had a selection and if that selection overlapsline
in some way.void
removeClass
(int line, String name) Removes the class matchingname
fromline
.void
removeQclass
(int line, Quark qname) 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, getMemoryLayout, 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
-
GutterLines
Create a GutterLines proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
-
Method Details
-
getType
-
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. -
addClass
Adds the classname
toline
.name
will be converted to aGLib.Quark
as part of this process. A faster version of this function is available viaaddQclass(int, org.gnome.glib.Quark)
for situations where theGLib.Quark
is known ahead of time.- Parameters:
line
- a line number starting from zeroname
- a class name
-
addQclass
Adds the class denoted byqname
toline
.You may check if a line has
qname
by callinghasQclass(int, org.gnome.glib.Quark)
.You can remove
qname
by callingremoveQclass(int, org.gnome.glib.Quark)
.- Parameters:
line
- a line number starting from zeroqname
- a class name as aGQuark
-
getBuffer
Gets theTextBuffer
that theGtkSourceGutterLines
represents.- Returns:
- a
GtkTextBuffer
-
getFirst
public int getFirst()Gets the line number (starting from 0) for the first line that is user visible.- Returns:
- a line number starting from 0
-
getIterAtLine
Gets aGtkTextIter
for the current buffer atline
- Parameters:
iter
- a location for aGtkTextIter
line
- the line number
-
getLast
public int getLast()Gets the line number (starting from 0) for the last line that is user visible.- Returns:
- a line number starting from 0
-
getLineYrange
public void getLineYrange(int line, GutterRendererAlignmentMode mode, Out<Integer> y, Out<Integer> height) Gets the Y range for a line based onmode
.The value for
y
is relative to the renderers widget coordinates.- Parameters:
line
- a line number starting from zeromode
- aGtkSourceGutterRendererAlignmentMode
y
- a location for the Y position in widget coordinatesheight
- the line height based onmode
-
getView
-
hasAnyClass
public boolean hasAnyClass(int line) Checks to see if the line has any GQuark classes set. This can be used to help renderer implementations avoid work if nothing has been set on the class.- Parameters:
line
- a line contained within this GutterLines- Returns:
true
if any quark was set for the line
-
hasClass
Checks to see ifaddClass(int, java.lang.String)
was called with thename
forline
.A faster version of this function is provided via
hasQclass(int, org.gnome.glib.Quark)
for situations where the quark is known ahead of time.- Parameters:
line
- a line number starting from zeroname
- a class name that may be converted, to aGQuark
- Returns:
true
ifline
containsname
-
hasQclass
Checks to see ifaddQclass(int, org.gnome.glib.Quark)
was called with the quark denoted byqname
forline
.- Parameters:
line
- a line number starting from zeroqname
- aGQuark
containing the class name- Returns:
true
ifline
containsqname
-
isCursor
public boolean isCursor(int line) Checks to see ifline
contains the insertion cursor.- Parameters:
line
- a line number starting from zero- Returns:
true
if the insertion cursor is online
-
isPrelit
public boolean isPrelit(int line) Checks to see ifline
is marked as prelit. Generally, this means the mouse pointer is over the line within the gutter.- Parameters:
line
- a line number starting from zero- Returns:
true
if the line is prelit
-
isSelected
public boolean isSelected(int line) Checks to see if the view had a selection and if that selection overlapsline
in some way.- Parameters:
line
- a line number starting from zero- Returns:
true
if the line contains a selection
-
removeClass
Removes the class matchingname
fromline
.A faster version of this function is available via
removeQclass(int, org.gnome.glib.Quark)
for situations where theGQuark
is known ahead of time.- Parameters:
line
- a line number starting from zeroname
- a class name
-
removeQclass
- Parameters:
line
- a line number starting from zeroqname
- aGQuark
to remove fromline
-
builder
AGutterLines.Builder
object constructs aGutterLines
with the specified properties. Use the variousset...()
methods to set properties, and finish construction withGutterLines.Builder.build()
.
-