:right-sidebar: True GutterLines =================================================================== .. currentmodule:: gi.repository.GtkSource .. class:: GutterLines(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.GObject.Object` Collected information about visible lines. The ``GtkSourceGutterLines`` object is used to collect information about visible lines. Use this from your :obj:`~gi.repository.GtkSource.GutterRenderer.signals.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 ------- .. rst-class:: interim-class .. class:: GutterLines :no-index: .. method:: add_class(line: int, name: str) -> None 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 :obj:`~gi.repository.GutterLines.add_qclass` for situations where the [alias``GLib``\.Quark] is known ahead of time. :param line: a line number starting from zero :param name: a class name .. method:: add_qclass(line: int, qname: int) -> None Adds the class denoted by ``qname`` to ``line``\. You may check if a line has ``qname`` by calling :obj:`~gi.repository.GutterLines.has_qclass`\. You can remove ``qname`` by calling :obj:`~gi.repository.GutterLines.remove_qclass`\. :param line: a line number starting from zero :param qname: a class name as a :obj:`~gi.repository.GLib.Quark` .. method:: get_buffer() -> ~gi.repository.Gtk.TextBuffer Gets the :obj:`~gi.repository.Gtk.TextBuffer` that the ``GtkSourceGutterLines`` represents. .. method:: get_first() -> int Gets the line number (starting from 0) for the first line that is user visible. .. method:: get_iter_at_line(line: int) -> ~gi.repository.Gtk.TextIter Gets a :obj:`~gi.repository.Gtk.TextIter` for the current buffer at ``line`` :param line: the line number .. method:: get_last() -> int Gets the line number (starting from 0) for the last line that is user visible. .. method:: get_line_yrange(line: int, mode: ~gi.repository.GtkSource.GutterRendererAlignmentMode) -> ~typing.Tuple[int, int] Gets the Y range for a line based on ``mode``\. The value for ``y`` is relative to the renderers widget coordinates. :param line: a line number starting from zero :param mode: a :obj:`~gi.repository.GtkSource.GutterRendererAlignmentMode` .. method:: get_view() -> ~gi.repository.Gtk.TextView Gets the :obj:`~gi.repository.Gtk.TextView` that the ``GtkSourceGutterLines`` represents. .. method:: 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. .. versionadded:: 5.6 :param line: a line contained within ``lines`` .. method:: has_class(line: int, name: str) -> bool Checks to see if :obj:`~gi.repository.GutterLines.add_class` was called with the ``name`` for ``line``\. A faster version of this function is provided via :obj:`~gi.repository.GutterLines.has_qclass` for situations where the quark is known ahead of time. :param line: a line number starting from zero :param name: a class name that may be converted, to a :obj:`~gi.repository.GLib.Quark` .. method:: has_qclass(line: int, qname: int) -> bool Checks to see if :obj:`~gi.repository.GutterLines.add_qclass` was called with the quark denoted by ``qname`` for ``line``\. :param line: a line number starting from zero :param qname: a :obj:`~gi.repository.GLib.Quark` containing the class name .. method:: is_cursor(line: int) -> bool Checks to see if ``line`` contains the insertion cursor. :param line: a line number starting from zero .. method:: 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. :param line: a line number starting from zero .. method:: is_selected(line: int) -> bool Checks to see if the view had a selection and if that selection overlaps ``line`` in some way. :param line: a line number starting from zero .. method:: remove_class(line: int, name: str) -> None Removes the class matching ``name`` from ``line``\. A faster version of this function is available via :obj:`~gi.repository.GutterLines.remove_qclass` for situations where the :obj:`~gi.repository.GLib.Quark` is known ahead of time. :param line: a line number starting from zero :param name: a class name .. method:: remove_qclass(line: int, qname: int) -> None Reverses a call to :obj:`~gi.repository.GutterLines.add_qclass` by removing the [alias``GLib``\.Quark] matching ``qname``\. :param line: a line number starting from zero :param qname: a :obj:`~gi.repository.GLib.Quark` to remove from ``line``