GtkSourceMark

GtkSourceMark — Mark object for GtkSourceBuffer

Functions

Properties

char * category Read / Write / Construct Only

Types and Values

Object Hierarchy

    GObject
    ╰── GtkTextMark
        ╰── GtkSourceMark

Includes

#include <gtksourceview/gtksource.h>

Description

A GtkSourceMark marks a position in the text where you want to display additional info. It is based on GtkTextMark and thus is still valid after the text has changed though its position may change.

GtkSourceMarks are organised in categories which you have to set when you create the mark. Each category can have a priority, a pixbuf and other associated attributes. See gtk_source_view_set_mark_attributes(). The pixbuf will be displayed in the margin at the line where the mark residents if the “show-line-marks” property is set to TRUE. If there are multiple marks in the same line, the pixbufs will be drawn on top of each other. The mark with the highest priority will be drawn on top.

Functions

gtk_source_mark_new ()

GtkSourceMark *
gtk_source_mark_new (const gchar *name,
                     const gchar *category);

Creates a text mark. Add it to a buffer using gtk_text_buffer_add_mark(). If name is NULL, the mark is anonymous; otherwise, the mark can be retrieved by name using gtk_text_buffer_get_mark(). Normally marks are created using the utility function gtk_source_buffer_create_source_mark().

Parameters

name

Name of the GtkSourceMark or NULL.

[nullable]

category

is used to classify marks according to common characteristics (e.g. all the marks representing a bookmark could belong to the "bookmark" category, or all the marks representing a compilation error could belong to "error" category).

 

Returns

a new GtkSourceMark that can be added using gtk_text_buffer_add_mark().

Since: 2.2


gtk_source_mark_get_category ()

const gchar *
gtk_source_mark_get_category (GtkSourceMark *mark);

Returns the mark category.

Parameters

mark

a GtkSourceMark.

 

Returns

the category of the GtkSourceMark.

Since: 2.2


gtk_source_mark_next ()

GtkSourceMark *
gtk_source_mark_next (GtkSourceMark *mark,
                      const gchar *category);

Returns the next GtkSourceMark in the buffer or NULL if the mark was not added to a buffer. If there is no next mark, NULL will be returned.

If category is NULL, looks for marks of any category.

Parameters

mark

a GtkSourceMark.

 

category

a string specifying the mark category, or NULL.

[nullable]

Returns

the next GtkSourceMark, or NULL.

[nullable][transfer none]

Since: 2.2


gtk_source_mark_prev ()

GtkSourceMark *
gtk_source_mark_prev (GtkSourceMark *mark,
                      const gchar *category);

Returns the previous GtkSourceMark in the buffer or NULL if the mark was not added to a buffer. If there is no previous mark, NULL is returned.

If category is NULL, looks for marks of any category

Parameters

mark

a GtkSourceMark.

 

category

a string specifying the mark category, or NULL.

 

Returns

the previous GtkSourceMark, or NULL.

[nullable][transfer none]

Since: 2.2

Types and Values

GtkSourceMark

typedef struct _GtkSourceMark GtkSourceMark;

Property Details

The “category” property

  “category”                 char *

The category of the GtkSourceMark, classifies the mark and controls which pixbuf is used and with which priority it is drawn.

Owner: GtkSourceMark

Flags: Read / Write / Construct Only

Default value: NULL

See Also

GtkSourceBuffer