gi-gtksource-5.0.0: GtkSource bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.GtkSource.Objects.GutterRenderer

Description

Gutter cell renderer.

A GtkSourceGutterRenderer represents a column in a [classgutter]. The column contains one cell for each visible line of the TextBuffer. Due to text wrapping, a cell can thus span multiple lines of the TextView. In this case, [enumgutterRendererAlignmentMode] controls the alignment of the cell.

The gutter renderer is a 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 [classmark]s 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 [methodgutterRenderer.set_alignment_mode].

The cells rendering occurs using 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 [methodgutterRenderer.align_cell] for a given line number with the width and height measurement of the content they width to render.

Synopsis

Exported types

newtype GutterRenderer Source #

Memory-managed wrapper type.

Constructors

GutterRenderer (ManagedPtr GutterRenderer) 

Instances

Instances details
Eq GutterRenderer Source # 
Instance details

Defined in GI.GtkSource.Objects.GutterRenderer

GObject GutterRenderer Source # 
Instance details

Defined in GI.GtkSource.Objects.GutterRenderer

ManagedPtrNewtype GutterRenderer Source # 
Instance details

Defined in GI.GtkSource.Objects.GutterRenderer

TypedObject GutterRenderer Source # 
Instance details

Defined in GI.GtkSource.Objects.GutterRenderer

Methods

glibType :: IO GType

HasParentTypes GutterRenderer Source # 
Instance details

Defined in GI.GtkSource.Objects.GutterRenderer

IsGValue (Maybe GutterRenderer) Source #

Convert GutterRenderer to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.GtkSource.Objects.GutterRenderer

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe GutterRenderer -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe GutterRenderer)

type ParentTypes GutterRenderer Source # 
Instance details

Defined in GI.GtkSource.Objects.GutterRenderer

type ParentTypes GutterRenderer = '[Widget, Object, Accessible, Buildable, ConstraintTarget]

class (GObject o, IsDescendantOf GutterRenderer o) => IsGutterRenderer o Source #

Type class for types which can be safely cast to GutterRenderer, for instance with toGutterRenderer.

Instances

Instances details
(GObject o, IsDescendantOf GutterRenderer o) => IsGutterRenderer o Source # 
Instance details

Defined in GI.GtkSource.Objects.GutterRenderer

toGutterRenderer :: (MonadIO m, IsGutterRenderer o) => o -> m GutterRenderer Source #

Cast to GutterRenderer, for types for which this is known to be safe. For general casts, use castTo.

Methods

Click to display all available methods, including inherited ones

Expand

Methods

actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addTickCallback, alignCell, allocate, bindProperty, bindPropertyFull, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, forceFloating, freezeNotify, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFloating, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, queryActivatable, queueAllocate, queueDraw, queueResize, realize, ref, refSink, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, resetProperty, resetRelation, resetState, runDispose, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unsetStateFlags, updateNextAccessibleSibling, updateProperty, updateRelation, updateState, watchClosure.

Getters

getAccessibleParent, getAccessibleRole, getAlignmentMode, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getAtContext, getBounds, getBuffer, getBuildableId, getCanFocus, getCanTarget, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getFirstAccessibleChild, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextAccessibleSibling, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPlatformState, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getView, getVisible, getWidth, getXalign, getXpad, getYalign, getYpad.

Setters

setAccessibleParent, setAlignmentMode, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDirection, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, setXalign, setXpad, setYalign, setYpad.

activate

gutterRendererActivate Source #

Arguments

:: (HasCallStack, MonadIO m, IsGutterRenderer a) 
=> a

renderer: a GutterRenderer

-> TextIter

iter: a TextIter at the start of the line where the renderer is activated

-> Rectangle

area: a Rectangle of the cell area where the renderer is activated

-> Word32

button: the button that was pressed

-> [ModifierType]

state: a ModifierType

-> Int32

nPresses: the number of button presses

-> m () 

Emits the signalgutterRenderer[activate] signal of the renderer. This is called from [classgutter] and should never have to be called manually.

alignCell

gutterRendererAlignCell Source #

Arguments

:: (HasCallStack, MonadIO m, IsGutterRenderer a) 
=> a

renderer: the GutterRenderer

-> Word32

line: the line number for content

-> Float

width: the width of the content to draw

-> Float

height: the height of the content to draw

-> m (Float, Float) 

Locates where to render content that is width x height based on the renderers alignment and padding.

The location will be placed into x and y and is relative to the renderer's coordinates.

It is encouraged that renderers use this function when snappshotting to ensure consistent placement of their contents.

getAlignmentMode

gutterRendererGetAlignmentMode Source #

Get the alignment mode.

The alignment mode describes the manner in which the renderer is aligned (see [propertygutterRenderer:xalign] and [propertygutterRenderer:yalign]).

getBuffer

gutterRendererGetBuffer Source #

Arguments

:: (HasCallStack, MonadIO m, IsGutterRenderer a) 
=> a

renderer: a GutterRenderer

-> m (Maybe Buffer)

Returns: a TextBuffer or Nothing

Gets the [classbuffer] for which the gutter renderer is drawing.

getView

gutterRendererGetView Source #

Arguments

:: (HasCallStack, MonadIO m, IsGutterRenderer a) 
=> a

renderer: a GutterRenderer

-> m View

Returns: a View

Get the view associated to the gutter renderer

getXalign

gutterRendererGetXalign Source #

Arguments

:: (HasCallStack, MonadIO m, IsGutterRenderer a) 
=> a

renderer: a GutterRenderer

-> m Float 

Gets the xalign property.

This may be used to adjust where within the cell rectangle the renderer will draw.

getXpad

gutterRendererGetXpad Source #

Arguments

:: (HasCallStack, MonadIO m, IsGutterRenderer a) 
=> a

renderer: a GutterRenderer

-> m Int32 

Gets the xpad property.

This may be used to adjust the cell rectangle that the renderer will use to draw.

getYalign

gutterRendererGetYalign Source #

Arguments

:: (HasCallStack, MonadIO m, IsGutterRenderer a) 
=> a

renderer: a GutterRenderer

-> m Float 

Gets the yalign property.

This may be used to adjust where within the cell rectangle the renderer will draw.

getYpad

gutterRendererGetYpad Source #

Arguments

:: (HasCallStack, MonadIO m, IsGutterRenderer a) 
=> a

renderer: a GutterRenderer

-> m Int32 

Gets the ypad property.

This may be used to adjust the cell rectangle that the renderer will use to draw.

queryActivatable

gutterRendererQueryActivatable Source #

Arguments

:: (HasCallStack, MonadIO m, IsGutterRenderer a) 
=> a

renderer: a GutterRenderer

-> TextIter

iter: a TextIter at the start of the line to be activated

-> Rectangle

area: a Rectangle of the cell area to be activated

-> m Bool

Returns: True if the renderer can be activated, False otherwise

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.

setAlignmentMode

gutterRendererSetAlignmentMode Source #

Set the alignment mode. The alignment mode describes the manner in which the renderer is aligned (see [propertygutterRenderer:xalign] and [propertygutterRenderer:yalign]).

setXalign

gutterRendererSetXalign Source #

Arguments

:: (HasCallStack, MonadIO m, IsGutterRenderer a) 
=> a

renderer: a GutterRenderer

-> Float

xalign: the Y padding for the drawing cell

-> m () 

Adjusts the xalign property.

This may be used to adjust where within the cell rectangle the renderer will draw.

setXpad

gutterRendererSetXpad Source #

Arguments

:: (HasCallStack, MonadIO m, IsGutterRenderer a) 
=> a

renderer: a GutterRenderer

-> Int32

xpad: the Y padding for the drawing cell

-> m () 

Adjusts the xpad property.

This may be used to adjust the cell rectangle that the renderer will use to draw.

setYalign

gutterRendererSetYalign Source #

Arguments

:: (HasCallStack, MonadIO m, IsGutterRenderer a) 
=> a

renderer: a GutterRenderer

-> Float

yalign: the Y padding for the drawing cell

-> m () 

Adjusts the yalign property.

This may be used to adjust where within the cell rectangle the renderer will draw.

setYpad

gutterRendererSetYpad Source #

Arguments

:: (HasCallStack, MonadIO m, IsGutterRenderer a) 
=> a

renderer: a GutterRenderer

-> Int32

ypad: the Y padding for the drawing cell

-> m () 

Adjusts the ypad property.

This may be used to adjust the cell rectangle that the renderer will use to draw.

Properties

alignmentMode

The alignment mode of the renderer.

This can be used to indicate that in the case a cell spans multiple lines (due to text wrapping) the alignment should work on either the full cell, the first line or the last line.

constructGutterRendererAlignmentMode :: (IsGutterRenderer o, MonadIO m) => GutterRendererAlignmentMode -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “alignment-mode” property. This is rarely needed directly, but it is used by new.

getGutterRendererAlignmentMode :: (MonadIO m, IsGutterRenderer o) => o -> m GutterRendererAlignmentMode Source #

Get the value of the “alignment-mode” property. When overloading is enabled, this is equivalent to

get gutterRenderer #alignmentMode

setGutterRendererAlignmentMode :: (MonadIO m, IsGutterRenderer o) => o -> GutterRendererAlignmentMode -> m () Source #

Set the value of the “alignment-mode” property. When overloading is enabled, this is equivalent to

set gutterRenderer [ #alignmentMode := value ]

lines

Contains information about the lines to be rendered.

It should be used by GutterRenderer implementations from Widget.snapshot().

getGutterRendererLines :: (MonadIO m, IsGutterRenderer o) => o -> m (Maybe GutterLines) Source #

Get the value of the “lines” property. When overloading is enabled, this is equivalent to

get gutterRenderer #lines

view

The view on which the renderer is placed.

getGutterRendererView :: (MonadIO m, IsGutterRenderer o) => o -> m (Maybe TextView) Source #

Get the value of the “view” property. When overloading is enabled, this is equivalent to

get gutterRenderer #view

xalign

The horizontal alignment of the renderer.

Set to 0 for a left alignment. 1 for a right alignment. And 0.5 for centering the cells. A value lower than 0 doesn't modify the alignment.

constructGutterRendererXalign :: (IsGutterRenderer o, MonadIO m) => Float -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “xalign” property. This is rarely needed directly, but it is used by new.

getGutterRendererXalign :: (MonadIO m, IsGutterRenderer o) => o -> m Float Source #

Get the value of the “xalign” property. When overloading is enabled, this is equivalent to

get gutterRenderer #xalign

setGutterRendererXalign :: (MonadIO m, IsGutterRenderer o) => o -> Float -> m () Source #

Set the value of the “xalign” property. When overloading is enabled, this is equivalent to

set gutterRenderer [ #xalign := value ]

xpad

The left and right padding of the renderer.

constructGutterRendererXpad :: (IsGutterRenderer o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “xpad” property. This is rarely needed directly, but it is used by new.

getGutterRendererXpad :: (MonadIO m, IsGutterRenderer o) => o -> m Int32 Source #

Get the value of the “xpad” property. When overloading is enabled, this is equivalent to

get gutterRenderer #xpad

setGutterRendererXpad :: (MonadIO m, IsGutterRenderer o) => o -> Int32 -> m () Source #

Set the value of the “xpad” property. When overloading is enabled, this is equivalent to

set gutterRenderer [ #xpad := value ]

yalign

The vertical alignment of the renderer.

Set to 0 for a top alignment. 1 for a bottom alignment. And 0.5 for centering the cells. A value lower than 0 doesn't modify the alignment.

constructGutterRendererYalign :: (IsGutterRenderer o, MonadIO m) => Float -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “yalign” property. This is rarely needed directly, but it is used by new.

getGutterRendererYalign :: (MonadIO m, IsGutterRenderer o) => o -> m Float Source #

Get the value of the “yalign” property. When overloading is enabled, this is equivalent to

get gutterRenderer #yalign

setGutterRendererYalign :: (MonadIO m, IsGutterRenderer o) => o -> Float -> m () Source #

Set the value of the “yalign” property. When overloading is enabled, this is equivalent to

set gutterRenderer [ #yalign := value ]

ypad

The top and bottom padding of the renderer.

constructGutterRendererYpad :: (IsGutterRenderer o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “ypad” property. This is rarely needed directly, but it is used by new.

getGutterRendererYpad :: (MonadIO m, IsGutterRenderer o) => o -> m Int32 Source #

Get the value of the “ypad” property. When overloading is enabled, this is equivalent to

get gutterRenderer #ypad

setGutterRendererYpad :: (MonadIO m, IsGutterRenderer o) => o -> Int32 -> m () Source #

Set the value of the “ypad” property. When overloading is enabled, this is equivalent to

set gutterRenderer [ #ypad := value ]

Signals

activate

type GutterRendererActivateCallback Source #

Arguments

 = TextIter

iter: a TextIter

-> Rectangle

area: a Rectangle

-> Word32

button: the button that was pressed

-> [ModifierType]

state: a ModifierType of state

-> Int32

nPresses: the number of button presses

-> IO () 

The signal is emitted when the renderer is activated.

afterGutterRendererActivate :: (IsGutterRenderer a, MonadIO m) => a -> ((?self :: a) => GutterRendererActivateCallback) -> m SignalHandlerId Source #

Connect a signal handler for the activate signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after gutterRenderer #activate callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onGutterRendererActivate :: (IsGutterRenderer a, MonadIO m) => a -> ((?self :: a) => GutterRendererActivateCallback) -> m SignalHandlerId Source #

Connect a signal handler for the activate signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on gutterRenderer #activate callback

queryActivatable

type GutterRendererQueryActivatableCallback Source #

Arguments

 = TextIter

iter: a TextIter

-> Rectangle

area: a Rectangle

-> IO Bool 

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

afterGutterRendererQueryActivatable :: (IsGutterRenderer a, MonadIO m) => a -> ((?self :: a) => GutterRendererQueryActivatableCallback) -> m SignalHandlerId Source #

Connect a signal handler for the queryActivatable signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after gutterRenderer #queryActivatable callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onGutterRendererQueryActivatable :: (IsGutterRenderer a, MonadIO m) => a -> ((?self :: a) => GutterRendererQueryActivatableCallback) -> m SignalHandlerId Source #

Connect a signal handler for the queryActivatable signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on gutterRenderer #queryActivatable callback

queryData

type GutterRendererQueryDataCallback = Object -> Word32 -> IO () Source #

No description available in the introspection data.

afterGutterRendererQueryData :: (IsGutterRenderer a, MonadIO m) => a -> ((?self :: a) => GutterRendererQueryDataCallback) -> m SignalHandlerId Source #

Connect a signal handler for the queryData signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after gutterRenderer #queryData callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onGutterRendererQueryData :: (IsGutterRenderer a, MonadIO m) => a -> ((?self :: a) => GutterRendererQueryDataCallback) -> m SignalHandlerId Source #

Connect a signal handler for the queryData signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on gutterRenderer #queryData callback