GutterRenderer

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

Gutter cell renderer.

A GtkSourceGutterRenderer represents a column in a class@Gutter. The column contains one cell for each visible line of the class@Gtk.TextBuffer. Due to text wrapping, a cell can thus span multiple lines of the class@Gtk.TextView. In this case, enum@GutterRendererAlignmentMode controls the alignment of the cell.

The gutter renderer is a class@Gtk.Widget and is measured using the normal widget measurement facilities. The width of the gutter will be determined by the measurements of the gutter renderers.

The width of a gutter renderer generally takes into account the entire text buffer. For instance, to display the line numbers, if the buffer contains 100 lines, the gutter renderer will always set its width such as three digits can be printed, even if only the first 20 lines are shown. Another strategy is to take into account only the visible lines. In this case, only two digits are necessary to display the line numbers of the first 20 lines. To take another example, the gutter renderer for class@Marks doesn't need to take into account the text buffer to announce its width. It only depends on the icons size displayed in the gutter column.

When the available size to render a cell is greater than the required size to render the cell contents, the cell contents can be aligned horizontally and vertically with method@GutterRenderer.set_alignment_mode.

The cells rendering occurs using vfunc@Gtk.Widget.snapshot. Implementations should use gtk_source_gutter_renderer_get_lines() to retrieve information about the lines to be rendered. To help with aligning content which takes into account the padding and alignment of a cell, implementations may call method@GutterRenderer.align_cell for a given line number with the width and height measurement of the content they width to render.

Skipped during bindings generation

  • parameter x: x: Out parameter is not supported

  • method lines: Property has no getter nor setter

Inheritors

Constructors

Link copied to clipboard
constructor(pointer: <Error class: unknown class><<Error class: unknown class>>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The alignment mode of the renderer.

Link copied to clipboard
open val gtkAccessiblePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open val gtkBuildablePointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open val gtkConstraintTargetPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
val gtksourceGutterRendererPointer: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open val view: View

The view on which the renderer is placed.

Link copied to clipboard
open var xalign: Float

The horizontal alignment of the renderer.

Link copied to clipboard
open var xpad: Int

The left and right padding of the renderer.

Link copied to clipboard
open var yalign: Float

The vertical alignment of the renderer.

Link copied to clipboard
open var ypad: Int

The top and bottom padding of the renderer.

Functions

Link copied to clipboard
open fun activate_(iter: <Error class: unknown class>, area: <Error class: unknown class>, button: <Error class: unknown class>, state: <Error class: unknown class>, nPresses: Int)

Emits the signal@GutterRenderer::activate signal of the renderer. This is called from class@Gutter and should never have to be called manually.

Link copied to clipboard
fun connectActivate(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (<Error class: unknown class>, <Error class: unknown class>, <Error class: unknown class>, <Error class: unknown class>, nPresses: Int) -> Unit): <Error class: unknown class>

The signal is emitted when the renderer is activated.

Link copied to clipboard
fun connectQueryActivatable(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (<Error class: unknown class>, <Error class: unknown class>) -> Boolean): <Error class: unknown class>

The signal is emitted when the renderer can possibly be activated.

Link copied to clipboard
fun connectQueryData(connectFlags: <Error class: unknown class> = ConnectFlags(0u), handler: (<Error class: unknown class>, <Error class: unknown class>) -> Unit): <Error class: unknown class>
Link copied to clipboard

Get the alignment mode.

Link copied to clipboard
open fun getBuffer(): Buffer?

Gets the class@Buffer for which the gutter renderer is drawing.

Link copied to clipboard
open fun getView(): View

Get the view associated to the gutter renderer

Link copied to clipboard
open fun getXalign(): Float

Gets the xalign property.

Link copied to clipboard
open fun getXpad(): Int

Gets the xpad property.

Link copied to clipboard
open fun getYalign(): Float

Gets the yalign property.

Link copied to clipboard
open fun getYpad(): Int

Gets the ypad property.

Link copied to clipboard
open fun queryActivatable(iter: <Error class: unknown class>, area: <Error class: unknown class>): Boolean

Get whether the renderer is activatable at the location provided. This is called from class@Gutter to determine whether a renderer is activatable using the mouse pointer.

Link copied to clipboard

Set the alignment mode. The alignment mode describes the manner in which the renderer is aligned (see property@GutterRenderer:xalign and property@GutterRenderer:yalign).

Link copied to clipboard
open fun setXalign(xalign: Float)

Adjusts the xalign property.

Link copied to clipboard
open fun setXpad(xpad: Int)

Adjusts the xpad property.

Link copied to clipboard
open fun setYalign(yalign: Float)

Adjusts the yalign property.

Link copied to clipboard
open fun setYpad(ypad: Int)

Adjusts the ypad property.