Class: GtkSource::GutterLines

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#add_class(line, name) ⇒ nil

Adds the class name to line.

name will be converted to a [aliasGLib.Quark] as part of this process. A faster version of this function is available via [methodGutterLines.add_qclass] for situations where the [aliasGLib.Quark] is known ahead of time.

Parameters:

  • line (Integer)

    a line number starting from zero

  • name (String)

    a class name

Returns:

  • (nil)

#add_qclass(line, qname) ⇒ nil

Adds the class denoted by qname to line.

You may check if a line has qname by calling [methodGutterLines.has_qclass].

You can remove qname by calling [methodGutterLines.remove_qclass].

Parameters:

  • line (Integer)

    a line number starting from zero

  • qname (GLib::Quark)

    a class name as a #GQuark

Returns:

  • (nil)

#bufferGtk::TextBuffer

Gets the [classGtk.TextBuffer] that the GtkSourceGutterLines represents.

Returns:

#firstInteger

Gets the line number (starting from 0) for the first line that is user visible.

Returns:

  • (Integer)

    a line number starting from 0

#get_iter_at_line(iter, line) ⇒ nil

Gets a Gtk::TextIter for the current buffer at line

Parameters:

  • iter (Gtk::TextIter)

    a location for a Gtk::TextIter

  • line (Integer)

    the line number

Returns:

  • (nil)

#get_line_yrange(line, mode, y, height) ⇒ nil

Gets the Y range for a line based on mode.

The value for y is relative to the renderers widget coordinates.

Parameters:

  • line (Integer)

    a line number starting from zero

  • mode (GtkSource::GutterRendererAlignmentMode)

    a Gtk::SourceGutterRendererAlignmentMode

  • y (Integer)

    a location for the Y position in widget coordinates

  • height (Integer)

    the line height based on mode

Returns:

  • (nil)

#has_any_class(line) ⇒ Boolean

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 (Integer)

    a line contained within lines

Returns:

  • (Boolean)

    true if any quark was set for the line

#has_class(line, name) ⇒ Boolean

Checks to see if [methodGutterLines.add_class] was called with the name for line.

A faster version of this function is provided via [methodGutterLines.has_qclass] for situations where the quark is known ahead of time.

Parameters:

  • line (Integer)

    a line number starting from zero

  • name (String)

    a class name that may be converted, to a #GQuark

Returns:

  • (Boolean)

    true if line contains name

#has_qclass(line, qname) ⇒ Boolean

Checks to see if [methodGutterLines.add_qclass] was called with the quark denoted by qname for line.

Parameters:

  • line (Integer)

    a line number starting from zero

  • qname (GLib::Quark)

    a #GQuark containing the class name

Returns:

  • (Boolean)

    true if line contains qname

#is_cursor(line) ⇒ Boolean

Checks to see if line contains the insertion cursor.

Parameters:

  • line (Integer)

    a line number starting from zero

Returns:

  • (Boolean)

    true if the insertion cursor is on line

#is_prelit(line) ⇒ Boolean

Checks to see if line is marked as prelit. Generally, this means the mouse pointer is over the line within the gutter.

Parameters:

  • line (Integer)

    a line number starting from zero

Returns:

  • (Boolean)

    true if the line is prelit

#is_selected(line) ⇒ Boolean

Checks to see if the view had a selection and if that selection overlaps line in some way.

Parameters:

  • line (Integer)

    a line number starting from zero

Returns:

  • (Boolean)

    true if the line contains a selection

#lastInteger

Gets the line number (starting from 0) for the last line that is user visible.

Returns:

  • (Integer)

    a line number starting from 0

#remove_class(line, name) ⇒ nil

Removes the class matching name from line.

A faster version of this function is available via [methodGutterLines.remove_qclass] for situations where the #GQuark is known ahead of time.

Parameters:

  • line (Integer)

    a line number starting from zero

  • name (String)

    a class name

Returns:

  • (nil)

#remove_qclass(line, qname) ⇒ nil

Reverses a call to [methodGutterLines.add_qclass] by removing the [aliasGLib.Quark] matching qname.

Parameters:

  • line (Integer)

    a line number starting from zero

  • qname (GLib::Quark)

    a #GQuark to remove from line

Returns:

  • (nil)

#viewGtk::TextView

Gets the [classGtk.TextView] that the GtkSourceGutterLines represents.

Returns: