Top | Description | Object Hierarchy | Properties | Signals | ![]() |
![]() |
![]() |
![]() |
#include <gtksourceview/gtksource.h> GtkSourceMarkAttributes; GtkSourceMarkAttributes * gtk_source_mark_attributes_new (void
); void gtk_source_mark_attributes_set_background (GtkSourceMarkAttributes *attributes
,const GdkRGBA *background
); gboolean gtk_source_mark_attributes_get_background (GtkSourceMarkAttributes *attributes
,GdkRGBA *background
); void gtk_source_mark_attributes_set_stock_id (GtkSourceMarkAttributes *attributes
,const gchar *stock_id
); const gchar * gtk_source_mark_attributes_get_stock_id (GtkSourceMarkAttributes *attributes
); void gtk_source_mark_attributes_set_icon_name (GtkSourceMarkAttributes *attributes
,const gchar *icon_name
); const gchar * gtk_source_mark_attributes_get_icon_name (GtkSourceMarkAttributes *attributes
); void gtk_source_mark_attributes_set_gicon (GtkSourceMarkAttributes *attributes
,GIcon *gicon
); GIcon * gtk_source_mark_attributes_get_gicon (GtkSourceMarkAttributes *attributes
); void gtk_source_mark_attributes_set_pixbuf (GtkSourceMarkAttributes *attributes
,const GdkPixbuf *pixbuf
); const GdkPixbuf * gtk_source_mark_attributes_get_pixbuf (GtkSourceMarkAttributes *attributes
); const GdkPixbuf * gtk_source_mark_attributes_render_icon (GtkSourceMarkAttributes *attributes
,GtkWidget *widget
,gint size
); gchar * gtk_source_mark_attributes_get_tooltip_text (GtkSourceMarkAttributes *attributes
,GtkSourceMark *mark
); gchar * gtk_source_mark_attributes_get_tooltip_markup (GtkSourceMarkAttributes *attributes
,GtkSourceMark *mark
);
"background" GdkRGBA* : Read / Write "gicon" GIcon* : Read / Write "icon-name" gchar* : Read / Write "pixbuf" GdkPixbuf* : Read / Write "stock-id" gchar* : Read / Write
GtkSourceMarkAttributes is an object specifying attributes used by a GtkSourceView to visually show lines marked with GtkSourceMarks of a specific category. It allows you to define a background color of a line, an icon shown in gutter and tooltips.
The background color is used as a background of a line where a mark is placed
and it can be set with gtk_source_mark_attributes_set_background()
. To check
if any custom background color was defined and what color it is, use
gtk_source_mark_attributes_get_background()
.
An icon is a graphic element which is shown in the gutter of a view. An
example use is showing a red filled circle in a debugger to show that a
breakpoint was set in certain line. To get an icon that will be placed in
a gutter, first a base for it must be specified and then
gtk_source_mark_attributes_render_icon()
must be called.
There are several ways to specify a base for an icon:
Using any of the above functions overrides the one used earlier. But note that a getter counterpart of earlier used function can still return some value, but it is just not used when rendering the proper icon.
To provide meaningful tooltips for a given mark of a category, you should connect to "query-tooltip-text" or "query-tooltip-markup" where the latter takes precedence.
GtkSourceMarkAttributes * gtk_source_mark_attributes_new
(void
);
Creates a new source mark attributes.
Returns : |
a new source mark attributes. [transfer full] |
void gtk_source_mark_attributes_set_background (GtkSourceMarkAttributes *attributes
,const GdkRGBA *background
);
Sets background color to the one given in background
.
|
a GtkSourceMarkAttributes. |
|
a GdkRGBA. |
gboolean gtk_source_mark_attributes_get_background (GtkSourceMarkAttributes *attributes
,GdkRGBA *background
);
Stores background color in background
.
|
a GtkSourceMarkAttributes. |
|
a GdkRGBA. [out caller-allocates] |
Returns : |
whether background color for attributes was set. |
void gtk_source_mark_attributes_set_stock_id (GtkSourceMarkAttributes *attributes
,const gchar *stock_id
);
gtk_source_mark_attributes_set_stock_id
has been deprecated since version 3.10 and should not be used in newly-written code. Don't use this function.
Sets stock id to be used as a base for rendered icon.
|
a GtkSourceMarkAttributes. |
|
a stock id. |
const gchar * gtk_source_mark_attributes_get_stock_id
(GtkSourceMarkAttributes *attributes
);
gtk_source_mark_attributes_get_stock_id
has been deprecated since version 3.10 and should not be used in newly-written code. Don't use this function.
Gets a stock id of an icon used by this attributes. Note that the stock id can
be NULL
if it wasn't set earlier.
|
a GtkSourceMarkAttributes. |
Returns : |
Stock id. Returned string is owned by attributes and
shouldn't be freed. [transfer none]
|
void gtk_source_mark_attributes_set_icon_name (GtkSourceMarkAttributes *attributes
,const gchar *icon_name
);
Sets a name of an icon to be used as a base for rendered icon.
|
a GtkSourceMarkAttributes. |
|
name of an icon to be used. |
const gchar * gtk_source_mark_attributes_get_icon_name
(GtkSourceMarkAttributes *attributes
);
Gets a name of an icon to be used as a base for rendered icon. Note that the
icon name can be NULL
if it wasn't set earlier.
|
a GtkSourceMarkAttributes. |
Returns : |
An icon name. The string belongs to attributes and
should not be freed. [transfer none]
|
void gtk_source_mark_attributes_set_gicon (GtkSourceMarkAttributes *attributes
,GIcon *gicon
);
Sets an icon to be used as a base for rendered icon.
|
a GtkSourceMarkAttributes. |
|
a GIcon to be used. |
GIcon * gtk_source_mark_attributes_get_gicon
(GtkSourceMarkAttributes *attributes
);
Gets a GIcon to be used as a base for rendered icon. Note that the icon can
be NULL
if it wasn't set earlier.
|
a GtkSourceMarkAttributes. |
Returns : |
An icon. The icon belongs to attributes and should
not be unreffed. [transfer none]
|
void gtk_source_mark_attributes_set_pixbuf (GtkSourceMarkAttributes *attributes
,const GdkPixbuf *pixbuf
);
Sets a pixbuf to be used as a base for rendered icon.
|
a GtkSourceMarkAttributes. |
|
a GdkPixbuf to be used. |
const GdkPixbuf * gtk_source_mark_attributes_get_pixbuf
(GtkSourceMarkAttributes *attributes
);
Gets a GdkPixbuf to be used as a base for rendered icon. Note that the
pixbuf can be NULL
if it wasn't set earlier.
|
a GtkSourceMarkAttributes. |
Returns : |
A pixbuf. The pixbuf belongs to attributes and
should not be unreffed. [transfer none]
|
const GdkPixbuf * gtk_source_mark_attributes_render_icon (GtkSourceMarkAttributes *attributes
,GtkWidget *widget
,gint size
);
Renders an icon of given size. The base of the icon is set by the last call
to one of: gtk_source_mark_attributes_set_pixbuf()
,
gtk_source_mark_attributes_set_gicon()
,
gtk_source_mark_attributes_set_icon_name()
or
gtk_source_mark_attributes_set_stock_id()
. size
cannot be lower than 1.
|
a GtkSourceMarkAttributes. |
|
widget of which style settings may be used. |
|
size of the rendered icon. |
Returns : |
A rendered pixbuf. The pixbuf belongs to attributes
and should not be unreffed. [transfer none]
|
gchar * gtk_source_mark_attributes_get_tooltip_text (GtkSourceMarkAttributes *attributes
,GtkSourceMark *mark
);
Queries for a tooltip by emitting a "query-tooltip-text" signal. The tooltip is a plain text.
|
a GtkSourceMarkAttributes. |
|
a GtkSourceMark. |
Returns : |
A tooltip. The returned string should be freed by
using g_free() when done with it. [transfer full]
|
gchar * gtk_source_mark_attributes_get_tooltip_markup (GtkSourceMarkAttributes *attributes
,GtkSourceMark *mark
);
Queries for a tooltip by emitting a "query-tooltip-markup" signal. The tooltip may contain a markup.
|
a GtkSourceMarkAttributes. |
|
a GtkSourceMark. |
Returns : |
A tooltip. The returned string should be freed by
using g_free() when done with it. [transfer full]
|
"background"
property"background" GdkRGBA* : Read / Write
A color used for background of a line.
"icon-name"
property"icon-name" gchar* : Read / Write
An icon name that may be a base of a rendered icon.
Default value: NULL
"pixbuf"
property"pixbuf" GdkPixbuf* : Read / Write
A GdkPixbuf that may be a base of a rendered icon.
"stock-id"
property"stock-id" gchar* : Read / Write
GtkSourceMarkAttributes:stock-id
has been deprecated since version 3.10 and should not be used in newly-written code. Don't use this property.
A stock id that may be a base of a rendered icon.
Default value: NULL
"query-tooltip-markup"
signalgchar* user_function (GtkSourceMarkAttributes *attributes,
GtkSourceMark *mark,
gpointer user_data) : Run Last
The code should connect to this signal to provide a tooltip for given
mark
. The tooltip can contain a markup.
|
The GtkSourceMarkAttributes which emits the signal. |
|
The GtkSourceMark. |
|
user data set when the signal handler was connected. |
Returns : |
A tooltip. The string should be freed with
g_free() when done with it. [transfer full]
|
"query-tooltip-text"
signalgchar* user_function (GtkSourceMarkAttributes *attributes,
GtkSourceMark *mark,
gpointer user_data) : Run Last
The code should connect to this signal to provide a tooltip for given
mark
. The tooltip should be just a plain text.
|
The GtkSourceMarkAttributes which emits the signal. |
|
The GtkSourceMark. |
|
user data set when the signal handler was connected. |
Returns : |
A tooltip. The string should be freed with
g_free() when done with it. [transfer full]
|