gtksource.gutter_renderer

Module for [GutterRenderer] class

Types 3

Gutter cell renderer.

A [gtksource.gutter_renderer.GutterRenderer] represents a column in a class@Gutter. The column contains one cell for each visible line of the [gtk.text_buffer.TextBuffer]. Due to text wrapping, a cell can thus span multiple lines of the [gtk.text_view.TextView]. In this case, enum@GutterRendererAlignmentMode controls the alignment of the cell.

The gutter renderer is a [gtk.widget.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 [gtksource.gutter_renderer.GutterRenderer.setAlignmentMode].

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 [gtksource.gutter_renderer.GutterRenderer.alignCell] for a given line number with the width and height measurement of the content they width to render.

Methods
GType _gType() @property
GutterRenderer self()Returns `this`, for use in `with` statements.
GutterRendererGidBuilder builder()Get builder for [gtksource.gutter_renderer.GutterRenderer] Returns: New builder object
gtksource.types.GutterRendererAlignmentMode alignmentMode() @propertyGet `alignmentMode` property. Returns: The alignment mode of the renderer.
void alignmentMode(gtksource.types.GutterRendererAlignmentMode propval) @propertySet `alignmentMode` property. Params: propval = The alignment mode of the renderer.
gtksource.gutter_lines.GutterLines lines() @propertyGet `lines` property. Returns: Contains information about the lines to be rendered.
gtk.text_view.TextView view() @propertyGet `view` property. Returns: The view on which the renderer is placed.
float xalign() @propertyGet `xalign` property. Returns: The horizontal alignment of the renderer.
void xalign(float propval) @propertySet `xalign` property. Params: propval = The horizontal alignment of the renderer.
int xpad() @propertyGet `xpad` property. Returns: The left and right padding of the renderer.
void xpad(int propval) @propertySet `xpad` property. Params: propval = The left and right padding of the renderer.
float yalign() @propertyGet `yalign` property. Returns: The vertical alignment of the renderer.
void yalign(float propval) @propertySet `yalign` property. Params: propval = The vertical alignment of the renderer.
int ypad() @propertyGet `ypad` property. Returns: The top and bottom padding of the renderer.
void ypad(int propval) @propertySet `ypad` property. Params: propval = The top and bottom padding of the renderer.
void activate(gtk.text_iter.TextIter iter, gdk.rectangle.Rectangle area, uint button, gdk.types.ModifierType state, int nPresses)Emits the `signalGutterRenderer::activate` signal of the renderer. This is called from `classGutter` and should never have to be called manually.
void alignCell(uint line, float width, float height, out float x, out float y)Locates where to render content that is width x height based on the renderers alignment and padding.
gtksource.buffer.Buffer getBuffer()Gets the `classBuffer` for which the gutter renderer is drawing. Returns: a #GtkTextBuffer or null
gtksource.view.View getView()Get the view associated to the gutter renderer Returns: a #GtkSourceView
float getXalign()Gets the `xalign` property.
int getXpad()Gets the `xpad` property.
float getYalign()Gets the `yalign` property.
int getYpad()Gets the `ypad` property.
bool queryActivatable(gtk.text_iter.TextIter iter, gdk.rectangle.Rectangle area)Get whether the renderer is activatable at the location provided. This is called from `classGutter` to determine whether a renderer is activatable using the mouse pointer.
void setAlignmentMode(gtksource.types.GutterRendererAlignmentMode mode)Set the alignment mode. The alignment mode describes the manner in which the renderer is aligned (see `propertyGutterRenderer:xalign` and `propertyGutterRenderer:yalign`).
void setXalign(float xalign)Adjusts the `xalign` property.
void setXpad(int xpad)Adjusts the `xpad` property.
void setYalign(float yalign)Adjusts the `yalign` property.
void setYpad(int ypad)Adjusts the `ypad` property.
gulong connectActivate(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == gtk.text_iter.TextIter))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == gdk.rectangle.Rectangle))) && (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] == uint))) && (Parameters!T.length < 4 || (ParameterStorageClassTuple!T[3] == ParameterStorageClass.none && is(Parameters!T[3] == gdk.types.ModifierType))) && (Parameters!T.length < 5 || (ParameterStorageClassTuple!T[4] == ParameterStorageClass.none && is(Parameters!T[4] == int))) && (Parameters!T.length < 6 || (ParameterStorageClassTuple!T[5] == ParameterStorageClass.none && is(Parameters!T[5] : gtksource.gutter_renderer.GutterRenderer))) && Parameters!T.length < 7)Connect to `Activate` signal.
gulong connectQueryActivatable(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == bool) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == gtk.text_iter.TextIter))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == gdk.rectangle.Rectangle))) && (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] : gtksource.gutter_renderer.GutterRenderer))) && Parameters!T.length < 4)Connect to `QueryActivatable` signal.
gulong connectQueryData(T)(T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gobject.object.ObjectWrap))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == uint))) && (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] : gtksource.gutter_renderer.GutterRenderer))) && Parameters!T.length < 4)Connect to `QueryData` signal.
Constructors
this(void * ptr, Flag!"Take" take)
Methods
T alignmentMode(gtksource.types.GutterRendererAlignmentMode propval)Set `alignmentMode` property. Params: propval = The alignment mode of the renderer.
T xalign(float propval)Set `xalign` property. Params: propval = The horizontal alignment of the renderer.
T xpad(int propval)Set `xpad` property. Params: propval = The left and right padding of the renderer. Returns: Builder instance for fluent chaining
T yalign(float propval)Set `yalign` property. Params: propval = The vertical alignment of the renderer.
T ypad(int propval)Set `ypad` property. Params: propval = The top and bottom padding of the renderer. Returns: Builder instance for fluent chaining

Fluent builder for [gtksource.gutter_renderer.GutterRenderer]