GtkSource.GutterLines¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class GtkSource.GutterLines(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Collected information about visible lines.
The
GtkSourceGutterLines
object is used to collect information about visible lines.Use this from your [signal`GutterRenderer`:py:func:::query-data<GtkSource.GutterLines.signals.query_data>] to collect the necessary information on visible lines. Doing so reduces the number of passes through the text btree allowing
GtkSource.View
to reach more frames-per-second while performing kinetic scrolling.- add_class(line, name)¶
-
Adds the class name to line.
name will be converted to a [alias`GLib`.Quark] as part of this process. A faster version of this function is available via [method`GutterLines`.add_qclass] for situations where the [alias`GLib`.Quark] is known ahead of time.
- add_qclass(line, qname)¶
-
Adds the class denoted by qname to line.
You may check if a line has qname by calling [method`GutterLines`.has_qclass].
You can remove qname by calling [method`GutterLines`.remove_qclass].
- get_buffer()¶
- Returns:
- Return type:
Gets the [class`Gtk`.TextBuffer] that the
GtkSourceGutterLines
represents.
- get_first()¶
- Returns:
a line number starting from 0
- Return type:
Gets the line number (starting from 0) for the first line that is user visible.
- get_iter_at_line(line)¶
- Parameters:
line (
int
) – the line number- Returns:
a location for a
Gtk.TextIter
- Return type:
iter:
Gtk.TextIter
Gets a
Gtk.TextIter
for the current buffer at line
- get_last()¶
- Returns:
a line number starting from 0
- Return type:
Gets the line number (starting from 0) for the last line that is user visible.
- get_line_yrange(line, mode)¶
- Parameters:
line (
int
) – a line number starting from zeromode (
GtkSource.GutterRendererAlignmentMode
) – aGtkSource.GutterRendererAlignmentMode
- Returns:
- y:
a location for the Y position in widget coordinates
- height:
the line height based on mode
- Return type:
Gets the Y range for a line based on mode.
The value for y is relative to the renderers widget coordinates.
- get_view()¶
- Returns:
- Return type:
Gets the [class`Gtk`.TextView] that the
GtkSourceGutterLines
represents.
- has_any_class(line)¶
- Parameters:
line (
int
) – a line contained within self- Returns:
True
if any quark was set for the line- Return type:
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.
New in version 5.6.
- has_class(line, name)¶
- Parameters:
- Returns:
True
if line contains name- Return type:
Checks to see if [method`GutterLines`.add_class] was called with the name for line.
A faster version of this function is provided via [method`GutterLines`.has_qclass] for situations where the quark is known ahead of time.
- has_qclass(line, qname)¶
- Parameters:
- Returns:
True
if line contains qname- Return type:
Checks to see if [method`GutterLines`.add_qclass] was called with the quark denoted by qname for line.
- is_cursor(line)¶
- Parameters:
line (
int
) – a line number starting from zero- Returns:
True
if the insertion cursor is on line- Return type:
Checks to see if line contains the insertion cursor.
- is_prelit(line)¶
- Parameters:
line (
int
) – a line number starting from zero- Returns:
True
if the line is prelit- Return type:
Checks to see if line is marked as prelit. Generally, this means the mouse pointer is over the line within the gutter.
- is_selected(line)¶
- Parameters:
line (
int
) – a line number starting from zero- Returns:
True
if the line contains a selection- Return type:
Checks to see if the view had a selection and if that selection overlaps line in some way.
- remove_class(line, name)¶
-
Removes the class matching name from line.
A faster version of this function is available via [method`GutterLines`.remove_qclass] for situations where the #GQuark is known ahead of time.