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.MarkAttributes

Description

The source mark attributes object.

GtkSourceMarkAttributes is an object specifying attributes used by a [classview] to visually show lines marked with [classmark]s 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 [methodmarkAttributes.set_background]. To check if any custom background color was defined and what color it is, use [methodmarkAttributes.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 [methodmarkAttributes.render_icon] must be called. There are several ways to specify a base for an icon:

  • [methodmarkAttributes.set_icon_name]
  • [methodmarkAttributes.set_gicon]
  • [methodmarkAttributes.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 signalmarkAttributes[queryTooltipText] or signalmarkAttributes[queryTooltipMarkup] where the latter takes precedence.

Synopsis

Exported types

newtype MarkAttributes Source #

Memory-managed wrapper type.

Constructors

MarkAttributes (ManagedPtr MarkAttributes) 

Instances

Instances details
Eq MarkAttributes Source # 
Instance details

Defined in GI.GtkSource.Objects.MarkAttributes

GObject MarkAttributes Source # 
Instance details

Defined in GI.GtkSource.Objects.MarkAttributes

ManagedPtrNewtype MarkAttributes Source # 
Instance details

Defined in GI.GtkSource.Objects.MarkAttributes

TypedObject MarkAttributes Source # 
Instance details

Defined in GI.GtkSource.Objects.MarkAttributes

Methods

glibType :: IO GType

HasParentTypes MarkAttributes Source # 
Instance details

Defined in GI.GtkSource.Objects.MarkAttributes

IsGValue (Maybe MarkAttributes) Source #

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

Instance details

Defined in GI.GtkSource.Objects.MarkAttributes

Methods

gvalueGType_ :: IO GType

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

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

type ParentTypes MarkAttributes Source # 
Instance details

Defined in GI.GtkSource.Objects.MarkAttributes

type ParentTypes MarkAttributes = '[Object]

class (GObject o, IsDescendantOf MarkAttributes o) => IsMarkAttributes o Source #

Type class for types which can be safely cast to MarkAttributes, for instance with toMarkAttributes.

Instances

Instances details
(GObject o, IsDescendantOf MarkAttributes o) => IsMarkAttributes o Source # 
Instance details

Defined in GI.GtkSource.Objects.MarkAttributes

toMarkAttributes :: (MonadIO m, IsMarkAttributes o) => o -> m MarkAttributes Source #

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

Methods

getBackground

markAttributesGetBackground Source #

Arguments

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

attributes: a MarkAttributes.

-> m (Bool, RGBA)

Returns: whether background color for attributes was set.

Stores background color in background.

getGicon

markAttributesGetGicon Source #

Arguments

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

attributes: a MarkAttributes.

-> m Icon

Returns: An icon. The icon belongs to attributes and should not be unreffed.

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

Note that the icon can be Nothing if it wasn't set earlier.

getIconName

markAttributesGetIconName Source #

Arguments

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

attributes: a MarkAttributes.

-> m Text

Returns: An icon name. The string belongs to attributes and should not be freed.

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

Note that the icon name can be Nothing if it wasn't set earlier.

getPixbuf

markAttributesGetPixbuf Source #

Arguments

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

attributes: a MarkAttributes.

-> m Pixbuf

Returns: A pixbuf. The pixbuf belongs to attributes and should not be unreffed.

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

Note that the pixbuf can be Nothing if it wasn't set earlier.

getTooltipMarkup

markAttributesGetTooltipMarkup Source #

Arguments

:: (HasCallStack, MonadIO m, IsMarkAttributes a, IsMark b) 
=> a

attributes: a MarkAttributes.

-> b

mark: a Mark.

-> m Text

Returns: A tooltip. The returned string should be freed by using free when done with it.

Queries for a tooltip by emitting a signalmarkAttributes[queryTooltipMarkup] signal.

The tooltip may contain a markup.

getTooltipText

markAttributesGetTooltipText Source #

Arguments

:: (HasCallStack, MonadIO m, IsMarkAttributes a, IsMark b) 
=> a

attributes: a MarkAttributes.

-> b

mark: a Mark.

-> m Text

Returns: A tooltip. The returned string should be freed by using free when done with it.

Queries for a tooltip by emitting a signalmarkAttributes[queryTooltipText] signal.

The tooltip is a plain text.

new

markAttributesNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m MarkAttributes

Returns: a new source mark attributes.

Creates a new source mark attributes.

renderIcon

markAttributesRenderIcon Source #

Arguments

:: (HasCallStack, MonadIO m, IsMarkAttributes a, IsWidget b) 
=> a

attributes: a MarkAttributes.

-> b

widget: widget of which style settings may be used.

-> Int32

size: size of the rendered icon.

-> m Paintable

Returns: A Paintable. The paintable belongs to attributes and should not be unreffed.

Renders an icon of given size.

The base of the icon is set by the last call to one of:

  • [methodmarkAttributes.set_pixbuf]
  • [methodmarkAttributes.set_gicon]
  • [methodmarkAttributes.set_icon_name]

size cannot be lower than 1.

setBackground

markAttributesSetBackground Source #

Arguments

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

attributes: a MarkAttributes.

-> RGBA

background: a RGBA.

-> m () 

Sets background color to the one given in background.

setGicon

markAttributesSetGicon Source #

Arguments

:: (HasCallStack, MonadIO m, IsMarkAttributes a, IsIcon b) 
=> a

attributes: a MarkAttributes.

-> b

gicon: a Icon to be used.

-> m () 

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

setIconName

markAttributesSetIconName Source #

Arguments

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

attributes: a MarkAttributes.

-> Text

iconName: name of an icon to be used.

-> m () 

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

setPixbuf

markAttributesSetPixbuf Source #

Arguments

:: (HasCallStack, MonadIO m, IsMarkAttributes a, IsPixbuf b) 
=> a

attributes: a MarkAttributes.

-> b

pixbuf: a Pixbuf to be used.

-> m () 

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

Properties

background

A color used for background of a line.

constructMarkAttributesBackground :: (IsMarkAttributes o, MonadIO m) => RGBA -> m (GValueConstruct o) Source #

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

getMarkAttributesBackground :: (MonadIO m, IsMarkAttributes o) => o -> m (Maybe RGBA) Source #

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

get markAttributes #background

setMarkAttributesBackground :: (MonadIO m, IsMarkAttributes o) => o -> RGBA -> m () Source #

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

set markAttributes [ #background := value ]

gicon

A Icon that may be a base of a rendered icon.

constructMarkAttributesGicon :: (IsMarkAttributes o, MonadIO m, IsIcon a) => a -> m (GValueConstruct o) Source #

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

getMarkAttributesGicon :: (MonadIO m, IsMarkAttributes o) => o -> m Icon Source #

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

get markAttributes #gicon

setMarkAttributesGicon :: (MonadIO m, IsMarkAttributes o, IsIcon a) => o -> a -> m () Source #

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

set markAttributes [ #gicon := value ]

iconName

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

constructMarkAttributesIconName :: (IsMarkAttributes o, MonadIO m) => Text -> m (GValueConstruct o) Source #

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

getMarkAttributesIconName :: (MonadIO m, IsMarkAttributes o) => o -> m Text Source #

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

get markAttributes #iconName

setMarkAttributesIconName :: (MonadIO m, IsMarkAttributes o) => o -> Text -> m () Source #

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

set markAttributes [ #iconName := value ]

pixbuf

A Pixbuf that may be a base of a rendered icon.

constructMarkAttributesPixbuf :: (IsMarkAttributes o, MonadIO m, IsPixbuf a) => a -> m (GValueConstruct o) Source #

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

getMarkAttributesPixbuf :: (MonadIO m, IsMarkAttributes o) => o -> m Pixbuf Source #

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

get markAttributes #pixbuf

setMarkAttributesPixbuf :: (MonadIO m, IsMarkAttributes o, IsPixbuf a) => o -> a -> m () Source #

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

set markAttributes [ #pixbuf := value ]

Signals

queryTooltipMarkup

type MarkAttributesQueryTooltipMarkupCallback Source #

Arguments

 = Mark

mark: The Mark.

-> IO Text

Returns: A tooltip. The string should be freed with free when done with it.

The code should connect to this signal to provide a tooltip for given mark. The tooltip can contain a markup.

afterMarkAttributesQueryTooltipMarkup :: (IsMarkAttributes a, MonadIO m) => a -> ((?self :: a) => MarkAttributesQueryTooltipMarkupCallback) -> m SignalHandlerId Source #

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

after markAttributes #queryTooltipMarkup 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.

onMarkAttributesQueryTooltipMarkup :: (IsMarkAttributes a, MonadIO m) => a -> ((?self :: a) => MarkAttributesQueryTooltipMarkupCallback) -> m SignalHandlerId Source #

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

on markAttributes #queryTooltipMarkup callback

queryTooltipText

type MarkAttributesQueryTooltipTextCallback Source #

Arguments

 = Mark

mark: The Mark.

-> IO Text

Returns: A tooltip. The string should be freed with free when done with it.

The code should connect to this signal to provide a tooltip for given mark. The tooltip should be just a plain text.

afterMarkAttributesQueryTooltipText :: (IsMarkAttributes a, MonadIO m) => a -> ((?self :: a) => MarkAttributesQueryTooltipTextCallback) -> m SignalHandlerId Source #

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

after markAttributes #queryTooltipText 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.

onMarkAttributesQueryTooltipText :: (IsMarkAttributes a, MonadIO m) => a -> ((?self :: a) => MarkAttributesQueryTooltipTextCallback) -> m SignalHandlerId Source #

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

on markAttributes #queryTooltipText callback