gtksource.mark_attributes

Module for [MarkAttributes] class

Types 3

The source mark attributes object.

[gtksource.mark_attributes.MarkAttributes] is an object specifying attributes used by a class@View to visually show lines marked with class@Marks 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 [gtksource.mark_attributes.MarkAttributes.setBackground]. To check if any custom background color was defined and what color it is, use [gtksource.mark_attributes.MarkAttributes.getBackground].

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 [gtksource.mark_attributes.MarkAttributes.renderIcon] must be called. There are several ways to specify a base for an icon:

  • [gtksource.mark_attributes.MarkAttributes.setIconName]
  • [gtksource.mark_attributes.MarkAttributes.setGicon]
  • [gtksource.mark_attributes.MarkAttributes.setPixbuf]

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 signal@MarkAttributes::query-tooltip-text or signal@MarkAttributes::query-tooltip-markup where the latter takes precedence.

Methods
GType _gType() @property
MarkAttributes self()Returns `this`, for use in `with` statements.
MarkAttributesGidBuilder builder()Get builder for [gtksource.mark_attributes.MarkAttributes] Returns: New builder object
gdk.rgba.RGBA background() @propertyGet `background` property. Returns: A color used for background of a line.
void background(gdk.rgba.RGBA propval) @propertySet `background` property. Params: propval = A color used for background of a line.
gio.icon.Icon gicon() @propertyGet `gicon` property. Returns: A #GIcon that may be a base of a rendered icon.
void gicon(gio.icon.Icon propval) @propertySet `gicon` property. Params: propval = A #GIcon that may be a base of a rendered icon.
string iconName() @propertyGet `iconName` property. Returns: An icon name that may be a base of a rendered icon.
void iconName(string propval) @propertySet `iconName` property. Params: propval = An icon name that may be a base of a rendered icon.
gdkpixbuf.pixbuf.Pixbuf pixbuf() @propertyGet `pixbuf` property. Returns: A #GdkPixbuf that may be a base of a rendered icon.
void pixbuf(gdkpixbuf.pixbuf.Pixbuf propval) @propertySet `pixbuf` property. Params: propval = A #GdkPixbuf that may be a base of a rendered icon.
bool getBackground(out gdk.rgba.RGBA background)Stores background color in background.
gio.icon.Icon getGicon()Gets a [gio.icon.Icon] to be used as a base for rendered icon.
string getIconName()Gets a name of an icon to be used as a base for rendered icon.
gdkpixbuf.pixbuf.Pixbuf getPixbuf()Gets a [gdkpixbuf.pixbuf.Pixbuf] to be used as a base for rendered icon.
string getTooltipMarkup(gtksource.mark.Mark mark)Queries for a tooltip by emitting a `signalMarkAttributes::query-tooltip-markup` signal.
string getTooltipText(gtksource.mark.Mark mark)Queries for a tooltip by emitting a `signalMarkAttributes::query-tooltip-text` signal.
gdk.paintable.Paintable renderIcon(gtk.widget.Widget widget, int size)Renders an icon of given size.
void setBackground(gdk.rgba.RGBA background)Sets background color to the one given in background.
void setGicon(gio.icon.Icon gicon)Sets an icon to be used as a base for rendered icon.
void setIconName(string iconName)Sets a name of an icon to be used as a base for rendered icon.
void setPixbuf(gdkpixbuf.pixbuf.Pixbuf pixbuf)Sets a pixbuf to be used as a base for rendered icon.
gulong connectQueryTooltipMarkup(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == string) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtksource.mark.Mark))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gtksource.mark_attributes.MarkAttributes))) && Parameters!T.length < 3)Connect to `QueryTooltipMarkup` signal.
gulong connectQueryTooltipText(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == string) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtksource.mark.Mark))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gtksource.mark_attributes.MarkAttributes))) && Parameters!T.length < 3)Connect to `QueryTooltipText` signal.
Constructors
this(void * ptr, Flag!"Take" take)
this()Creates a new source mark attributes. Returns: a new source mark attributes.
Methods
T background(gdk.rgba.RGBA propval)Set `background` property. Params: propval = A color used for background of a line. Returns: Builder instance for fluent chaining
T gicon(gio.icon.Icon propval)Set `gicon` property. Params: propval = A #GIcon that may be a base of a rendered icon. Returns: Builder instance for fluent chaining
T iconName(string propval)Set `iconName` property. Params: propval = An icon name that may be a base of a rendered icon. Returns: Builder instance for fluent chaining
T pixbuf(gdkpixbuf.pixbuf.Pixbuf propval)Set `pixbuf` property. Params: propval = A #GdkPixbuf that may be a base of a rendered icon. Returns: Builder instance for fluent chaining

Fluent builder for [gtksource.mark_attributes.MarkAttributes]