GutterLines#
Superclasses: Object
Collected information about visible lines.
The GtkSourceGutterLines
object is used to collect information about
visible lines.
Use this from your 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.
Methods#
- class GutterLines
- add_class(line: int, name: str) None #
Adds the class
name
toline
.name
will be converted to a [alias``GLib``.Quark] as part of this process. A faster version of this function is available viaadd_qclass
for situations where the [alias``GLib``.Quark] is known ahead of time.- Parameters:
line – a line number starting from zero
name – a class name
- add_qclass(line: int, qname: int) None #
Adds the class denoted by
qname
toline
.You may check if a line has
qname
by callinghas_qclass
.You can remove
qname
by callingremove_qclass
.- Parameters:
line – a line number starting from zero
qname – a class name as a
Quark
- get_buffer() TextBuffer #
Gets the
TextBuffer
that theGtkSourceGutterLines
represents.
- get_iter_at_line(line: int) TextIter #
Gets a
TextIter
for the current buffer atline
- Parameters:
line – the line number
- get_line_yrange(line: int, mode: GutterRendererAlignmentMode) Tuple[int, int] #
Gets the Y range for a line based on
mode
.The value for
y
is relative to the renderers widget coordinates.- Parameters:
line – a line number starting from zero
mode – a
GutterRendererAlignmentMode
- has_any_class(line: int) bool #
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.
Added in version 5.6.
- Parameters:
line – a line contained within
lines
- has_class(line: int, name: str) bool #
Checks to see if
add_class
was called with thename
forline
.A faster version of this function is provided via
has_qclass
for situations where the quark is known ahead of time.- Parameters:
line – a line number starting from zero
name – a class name that may be converted, to a
Quark
- has_qclass(line: int, qname: int) bool #
Checks to see if
add_qclass
was called with the quark denoted byqname
forline
.- Parameters:
line – a line number starting from zero
qname – a
Quark
containing the class name
- is_cursor(line: int) bool #
Checks to see if
line
contains the insertion cursor.- Parameters:
line – a line number starting from zero
- is_prelit(line: int) bool #
Checks to see if
line
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
- is_selected(line: int) bool #
Checks to see if the view had a selection and if that selection overlaps
line
in some way.- Parameters:
line – a line number starting from zero