GtkSourceMark

## GtkSourceMark GtkSourceMark — mark object for GtkSourceBuffer |

## Synopsis

    #include <gtksourceview/gtksourcemark.h>

    struct              GtkSourceMark;
    GtkSourceMark *     gtk_source_mark_new                 (const gchar *name,
                                                             const gchar *category);
    const gchar *       gtk_source_mark_get_category        (GtkSourceMark *mark);
    GtkSourceMark *     gtk_source_mark_next                (GtkSourceMark *mark,
                                                             const gchar *category);
    GtkSourceMark *     gtk_source_mark_prev                (GtkSourceMark *mark,
                                                             const gchar *category);

## Object Hierarchy

      GObject
       +----GtkTextMark
             +----GtkSourceMark

## Properties

      "category"                 gchar*                : Read / Write / Construct Only

## 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 pixbuf and a priority associated using gtk_source_view_set_mark_category_pixbuf and gtk_source_view_set_mark_category_priority. 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.

## Details

### struct GtkSourceMark

    struct GtkSourceMark;

### 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_mark()`.

`name` : | Name of the GtkSourceMark, can be NULL when not using a name
`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.

`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.

`mark` : | a GtkSourceMark.
`category` : | a string specifying the mark category, or `NULL`. [allow-none]
Returns : | the next GtkSourceMark, or `NULL`. [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

`mark` : | a GtkSourceMark.
`category` : | a string specifying the mark category, or `NULL`.
Returns : | the previous GtkSourceMark, or `NULL`. [transfer none]

Since 2.2

## Property Details

### The `"category"` property

      "category"                 gchar*                : Read / Write / Construct Only

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

Default value: NULL

## See Also

GtkSourceBuffer