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
nametoline.namewill be converted to a [alias``GLib``.Quark] as part of this process. A faster version of this function is available viaadd_qclassfor 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
qnametoline.You may check if a line has
qnameby callinghas_qclass.You can remove
qnameby callingremove_qclass.- Parameters:
line – a line number starting from zero
qname – a class name as a
Quark
- get_buffer() TextBuffer#
Gets the
TextBufferthat theGtkSourceGutterLinesrepresents.
- get_iter_at_line(line: int) TextIter#
Gets a
TextIterfor 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
yis 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_classwas called with thenameforline.A faster version of this function is provided via
has_qclassfor 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_qclasswas called with the quark denoted byqnameforline.- Parameters:
line – a line number starting from zero
qname – a
Quarkcontaining the class name
- is_cursor(line: int) bool#
Checks to see if
linecontains the insertion cursor.- Parameters:
line – a line number starting from zero
- is_prelit(line: int) bool#
Checks to see if
lineis 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
linein some way.- Parameters:
line – a line number starting from zero