Class GutterLines
- All Implemented Interfaces:
Proxy
Collected information about visible lines.
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
Nested ClassesModifier and TypeClassDescriptionstatic classGutterLines.Builder<B extends GutterLines.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static classNested classes/interfaces inherited from class GObject
GObject.NotifyCallback, GObject.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new GutterLines.GutterLines(MemorySegment address) Create a GutterLines instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the classnametoline.voidAdds the class denoted byqnametoline.protected GutterLinesasParent()Return this instance as if it were its parent type.static GutterLines.Builder<? extends GutterLines.Builder> builder()AGutterLines.Builderobject constructs aGutterLineswith the specified properties.Gets theTextBufferthat theGtkSourceGutterLinesrepresents.intgetFirst()Gets the line number (starting from 0) for the first line that is user visible.voidgetIterAtLine(TextIter iter, int line) Gets aGtkTextIterfor the current buffer atlineintgetLast()Gets the line number (starting from 0) for the last line that is user visible.voidgetLineExtent(int line, GutterRendererAlignmentMode mode, Out<Double> y, Out<Double> height) Gets the Y range for a line based onmode.voidgetLineYrange(int line, GutterRendererAlignmentMode mode, Out<Integer> y, Out<Integer> height) Gets the Y range for a line based onmode.static MemoryLayoutThe memory layout of the native struct.static @Nullable TypegetType()Get the GType of the GutterLines class.getView()Gets theTextViewthat theGtkSourceGutterLinesrepresents.booleanhasAnyClass(int line) Checks to see if the line has any GQuark classes set.booleanbooleanbooleanisCursor(int line) Checks to see iflinecontains the insertion cursor.booleanisPrelit(int line) Checks to see iflineis marked as prelit.booleanisSelected(int line) Checks to see if the view had a selection and if that selection overlapslinein some way.voidremoveClass(int line, String name) Removes the class matchingnamefromline.voidremoveQclass(int line, Quark qname) Methods inherited from class 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, 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, withPropertiesMethods inherited from class TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
GutterLines
Create a GutterLines instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
GutterLines
public GutterLines()Create a new GutterLines.
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Return this instance as if it were its parent type. Comparable to the Javasuperkeyword, but ensures the parent typeclass is also used in native code. -
addClass
Adds the class
nametoline.namewill be converted to aGLib.Quarkas part of this process. A faster version of this function is available viaaddQclass(int, Quark)for situations where theGLib.Quarkis known ahead of time.- Parameters:
line- a line number starting from zeroname- a class name
-
addQclass
Adds the class denoted by
qnametoline.You may check if a line has
qnameby callinghasQclass(int, Quark).You can remove
qnameby callingremoveQclass(int, Quark).- Parameters:
line- a line number starting from zeroqname- a class name as aGQuark
-
getBuffer
Gets theTextBufferthat theGtkSourceGutterLinesrepresents.- 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 aGtkTextIterfor the current buffer atline- Parameters:
iter- a location for aGtkTextIterline- 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
-
getLineExtent
public void getLineExtent(int line, GutterRendererAlignmentMode mode, Out<Double> y, Out<Double> height) Gets the Y range for a line based on
mode.The value for
yis relative to the renderers widget coordinates.- Parameters:
line- a line number starting from zeromode- aGtkSourceGutterRendererAlignmentModey- a location for the Y position in widget coordinatesheight- the line height based onmode- Since:
- 5.18
-
getLineYrange
public void getLineYrange(int line, GutterRendererAlignmentMode mode, Out<Integer> y, Out<Integer> height) Gets the Y range for a line based on
mode.The value for
yis relative to the renderers widget coordinates.- Parameters:
line- a line number starting from zeromode- aGtkSourceGutterRendererAlignmentModey- 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:
trueif any quark was set for the line- Since:
- 5.6
-
hasClass
Checks to see if
addClass(int, String)was called with thenameforline.A faster version of this function is provided via
hasQclass(int, 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:
trueiflinecontainsname
-
hasQclass
- Parameters:
line- a line number starting from zeroqname- aGQuarkcontaining the class name- Returns:
trueiflinecontainsqname
-
isCursor
public boolean isCursor(int line) Checks to see iflinecontains the insertion cursor.- Parameters:
line- a line number starting from zero- Returns:
trueif the insertion cursor is online
-
isPrelit
public boolean isPrelit(int line) Checks to see iflineis 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:
trueif the line is prelit
-
isSelected
public boolean isSelected(int line) Checks to see if the view had a selection and if that selection overlapslinein some way.- Parameters:
line- a line number starting from zero- Returns:
trueif the line contains a selection
-
removeClass
Removes the class matching
namefromline.A faster version of this function is available via
removeQclass(int, Quark)for situations where theGQuarkis known ahead of time.- Parameters:
line- a line number starting from zeroname- a class name
-
removeQclass
- Parameters:
line- a line number starting from zeroqname- aGQuarkto remove fromline
-
builder
AGutterLines.Builderobject constructs aGutterLineswith the specified properties. Use the variousset...()methods to set properties, and finish construction withGutterLines.Builder.build().- Returns:
- the builder object
-