MarkAttributes

open class MarkAttributes(pointer: <Error class: unknown class><<Error class: unknown class>>)

The source mark attributes object.

GtkSourceMarkAttributes 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 method@MarkAttributes.set_background. To check if any custom background color was defined and what color it is, use method@MarkAttributes.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 method@MarkAttributes.render_icon must be called. There are several ways to specify a base for an icon:

  • method@MarkAttributes.set_icon_name

  • method@MarkAttributes.set_gicon

  • method@MarkAttributes.set_pixbuf

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.

Skipped during bindings generation

  • method background: Property has no getter

  • signal query-tooltip-markup: Signal query-tooltip-markup is ignored

  • signal query-tooltip-text: Signal query-tooltip-text is ignored

Constructors

Link copied to clipboard
constructor()

Creates a new source mark attributes.

constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open var gicon: <Error class: unknown class>

A #GIcon that may be a base of a rendered icon.

Link copied to clipboard
val gtksourceMarkAttributesPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open var iconName: String

An icon name that may be a base of a rendered icon.

Link copied to clipboard
open var pixbuf: <Error class: unknown class>

A #GdkPixbuf that may be a base of a rendered icon.

Functions

Link copied to clipboard
open fun getBackground(background: <Error class: unknown class>): Boolean

Stores background color in @background.

Link copied to clipboard
open fun getGicon(): <Error class: unknown class>

Gets a iface@Gio.Icon to be used as a base for rendered icon.

Link copied to clipboard
open fun getIconName(): String

Gets a name of an icon to be used as a base for rendered icon.

Link copied to clipboard
open fun getPixbuf(): <Error class: unknown class>

Gets a class@GdkPixbuf.Pixbuf to be used as a base for rendered icon.

Link copied to clipboard
open fun getTooltipMarkup(mark: Mark): String

Queries for a tooltip by emitting a signal@MarkAttributes::query-tooltip-markup signal.

Link copied to clipboard
open fun getTooltipText(mark: Mark): String

Queries for a tooltip by emitting a signal@MarkAttributes::query-tooltip-text signal.

Link copied to clipboard
open fun renderIcon(widget: <Error class: unknown class>, size: Int): <Error class: unknown class>

Renders an icon of given size.

Link copied to clipboard
open fun setBackground(background: <Error class: unknown class>)

Sets background color to the one given in @background.

Link copied to clipboard
open fun setGicon(gicon: <Error class: unknown class>)

Sets an icon to be used as a base for rendered icon.

Link copied to clipboard
open fun setIconName(iconName: String)

Sets a name of an icon to be used as a base for rendered icon.

Link copied to clipboard
open fun setPixbuf(pixbuf: <Error class: unknown class>)

Sets a pixbuf to be used as a base for rendered icon.