GtkSourceGutterLines

GtkSourceGutterLines — Collected information about visible lines

Functions

Types and Values

Object Hierarchy

    GObject
    ╰── GtkSourceGutterLines

Includes

#include <gtksourceview/gtksource.h>

Description

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.

Functions

gtk_source_gutter_lines_add_class ()

void
gtk_source_gutter_lines_add_class (GtkSourceGutterLines *lines,
                                   guint line,
                                   const gchar *name);

Adds the class name to line .

name will be converted to a GQuark as part of this process. A faster version of this function is available via gtk_source_gutter_lines_add_qclass() for situations where the GQuark is known ahead of time.

Parameters

lines

a GtkSourceGutterLines

 

line

a line number starting from zero

 

name

a class name

 

Since: 5.0


gtk_source_gutter_lines_add_qclass ()

void
gtk_source_gutter_lines_add_qclass (GtkSourceGutterLines *lines,
                                    guint line,
                                    GQuark qname);

Adds the class denoted by qname to line .

You may check if a line has qname by calling gtk_source_gutter_lines_has_qclass().

You can remove qname by calling gtk_source_gutter_lines_remove_qclass().

Parameters

lines

a GtkSourceGutterLines

 

line

a line number starting from zero

 

qname

a class name as a GQuark

 

Since: 5.0


gtk_source_gutter_lines_get_buffer ()

GtkTextBuffer *
gtk_source_gutter_lines_get_buffer (GtkSourceGutterLines *lines);

Gets the GtkTextBuffer that the GtkSourceGutterLines represents.

Parameters

Returns

a GtkTextBuffer.

[transfer none][not nullable]

Since: 5.0


gtk_source_gutter_lines_get_first ()

guint
gtk_source_gutter_lines_get_first (GtkSourceGutterLines *lines);

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

Parameters

Returns

a line number starting from 0

Since: 5.0


gtk_source_gutter_lines_get_iter_at_line ()

void
gtk_source_gutter_lines_get_iter_at_line
                               (GtkSourceGutterLines *lines,
                                GtkTextIter *iter,
                                guint line);

Gets a GtkTextIter for the current buffer at line

Parameters

lines

a GtkSourceGutterLines

 

iter

a location for a GtkTextIter.

[out]

line

the line number

 

Since: 5.0


gtk_source_gutter_lines_get_last ()

guint
gtk_source_gutter_lines_get_last (GtkSourceGutterLines *lines);

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

Parameters

Returns

a line number starting from 0

Since: 5.0


gtk_source_gutter_lines_get_line_yrange ()

void
gtk_source_gutter_lines_get_line_yrange
                               (GtkSourceGutterLines *lines,
                                guint line,
                                GtkSourceGutterRendererAlignmentMode mode,
                                gint *y,
                                gint *height);

Gets the Y range for a line based on mode .

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

Parameters

lines

a GtkSourceGutterLines

 

line

a line number starting from zero

 

mode

a GtkSourceGutterRendererAlignmentMode

 

y

a location for the Y position in widget coordinates.

[out]

height

the line height based on mode .

[out]

Since: 5.0


gtk_source_gutter_lines_get_view ()

GtkTextView *
gtk_source_gutter_lines_get_view (GtkSourceGutterLines *lines);

Gets the GtkTextView that the GtkSourceGutterLines represents.

Parameters

Returns

a GtkTextView.

[transfer none][not nullable]

Since: 5.0


gtk_source_gutter_lines_get_yrange ()

void
gtk_source_gutter_lines_get_yrange (GtkSourceGutterLines *lines,
                                    guint line,
                                    guint *line_y,
                                    guint *line_height);

gtk_source_gutter_lines_has_class ()

gboolean
gtk_source_gutter_lines_has_class (GtkSourceGutterLines *lines,
                                   guint line,
                                   const gchar *name);

Checks to see if gtk_source_gutter_lines_add_class() was called with the name for line .

A faster version of this function is provided via gtk_source_gutter_lines_has_qclass() for situations where the quark is known ahead of time.

Parameters

lines

a GtkSourceGutterLines

 

line

a line number starting from zero

 

name

a class name that may be converted, to a GQuark

 

Returns

TRUE if line contains name

Since: 5.0


gtk_source_gutter_lines_has_qclass ()

gboolean
gtk_source_gutter_lines_has_qclass (GtkSourceGutterLines *lines,
                                    guint line,
                                    GQuark qname);

Checks to see if gtk_source_gutter_lines_add_qclass() was called with the quark denoted by qname for line .

Parameters

lines

a GtkSourceGutterLines

 

line

a line number starting from zero

 

qname

a GQuark containing the class name

 

Returns

TRUE if line contains qname

Since: 5.0


gtk_source_gutter_lines_is_cursor ()

gboolean
gtk_source_gutter_lines_is_cursor (GtkSourceGutterLines *lines,
                                   guint line);

Checks to see if line contains the insertion cursor.

Parameters

lines

a GtkSourceGutterLines

 

line

a line number starting from zero

 

Returns

TRUE if the insertion cursor is on line

Since: 5.0


gtk_source_gutter_lines_is_prelit ()

gboolean
gtk_source_gutter_lines_is_prelit (GtkSourceGutterLines *lines,
                                   guint line);

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

Parameters

lines

a GtkSourceGutterLines

 

line

a line number starting from zero

 

Returns

TRUE if the line is prelit

Since: 5.0


gtk_source_gutter_lines_is_selected ()

gboolean
gtk_source_gutter_lines_is_selected (GtkSourceGutterLines *lines,
                                     guint line);

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

Parameters

lines

a GtkSourceGutterLines

 

line

a line number starting from zero

 

Returns

TRUE if the line contains a selection

Since: 5.0


gtk_source_gutter_lines_remove_class ()

void
gtk_source_gutter_lines_remove_class (GtkSourceGutterLines *lines,
                                      guint line,
                                      const gchar *name);

Removes the class matching name from line .

A faster version of this function is available via gtk_source_gutter_lines_remove_qclass() for situations where the GQuark is known ahead of time.

Parameters

lines

a GtkSourceGutterLines

 

line

a line number starting from zero

 

name

a class name

 

Since: 5.0


gtk_source_gutter_lines_remove_qclass ()

void
gtk_source_gutter_lines_remove_qclass (GtkSourceGutterLines *lines,
                                       guint line,
                                       GQuark qname);

Reverses a call to gtk_source_gutter_lines_add_qclass() by removing the GQuark matching qname .

Parameters

lines

a GtkSourceGutterLines

 

line

a line number starting from zero

 

qname

a GQuark to remove from line

 

Since: 5.0

Types and Values

GtkSourceGutterLines

typedef struct _GtkSourceGutterLines GtkSourceGutterLines;