Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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:
- [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 signalmarkAttributes
[queryTooltipText] or
signalmarkAttributes
[queryTooltipMarkup] where the latter
takes precedence.
Synopsis
- newtype MarkAttributes = MarkAttributes (ManagedPtr MarkAttributes)
- class (GObject o, IsDescendantOf MarkAttributes o) => IsMarkAttributes o
- toMarkAttributes :: (MonadIO m, IsMarkAttributes o) => o -> m MarkAttributes
- markAttributesGetBackground :: (HasCallStack, MonadIO m, IsMarkAttributes a) => a -> m (Bool, RGBA)
- markAttributesGetGicon :: (HasCallStack, MonadIO m, IsMarkAttributes a) => a -> m Icon
- markAttributesGetIconName :: (HasCallStack, MonadIO m, IsMarkAttributes a) => a -> m Text
- markAttributesGetPixbuf :: (HasCallStack, MonadIO m, IsMarkAttributes a) => a -> m Pixbuf
- markAttributesGetTooltipMarkup :: (HasCallStack, MonadIO m, IsMarkAttributes a, IsMark b) => a -> b -> m Text
- markAttributesGetTooltipText :: (HasCallStack, MonadIO m, IsMarkAttributes a, IsMark b) => a -> b -> m Text
- markAttributesNew :: (HasCallStack, MonadIO m) => m MarkAttributes
- markAttributesRenderIcon :: (HasCallStack, MonadIO m, IsMarkAttributes a, IsWidget b) => a -> b -> Int32 -> m Paintable
- markAttributesSetBackground :: (HasCallStack, MonadIO m, IsMarkAttributes a) => a -> RGBA -> m ()
- markAttributesSetGicon :: (HasCallStack, MonadIO m, IsMarkAttributes a, IsIcon b) => a -> b -> m ()
- markAttributesSetIconName :: (HasCallStack, MonadIO m, IsMarkAttributes a) => a -> Text -> m ()
- markAttributesSetPixbuf :: (HasCallStack, MonadIO m, IsMarkAttributes a, IsPixbuf b) => a -> b -> m ()
- constructMarkAttributesBackground :: (IsMarkAttributes o, MonadIO m) => RGBA -> m (GValueConstruct o)
- getMarkAttributesBackground :: (MonadIO m, IsMarkAttributes o) => o -> m (Maybe RGBA)
- setMarkAttributesBackground :: (MonadIO m, IsMarkAttributes o) => o -> RGBA -> m ()
- constructMarkAttributesGicon :: (IsMarkAttributes o, MonadIO m, IsIcon a) => a -> m (GValueConstruct o)
- getMarkAttributesGicon :: (MonadIO m, IsMarkAttributes o) => o -> m Icon
- setMarkAttributesGicon :: (MonadIO m, IsMarkAttributes o, IsIcon a) => o -> a -> m ()
- constructMarkAttributesIconName :: (IsMarkAttributes o, MonadIO m) => Text -> m (GValueConstruct o)
- getMarkAttributesIconName :: (MonadIO m, IsMarkAttributes o) => o -> m Text
- setMarkAttributesIconName :: (MonadIO m, IsMarkAttributes o) => o -> Text -> m ()
- constructMarkAttributesPixbuf :: (IsMarkAttributes o, MonadIO m, IsPixbuf a) => a -> m (GValueConstruct o)
- getMarkAttributesPixbuf :: (MonadIO m, IsMarkAttributes o) => o -> m Pixbuf
- setMarkAttributesPixbuf :: (MonadIO m, IsMarkAttributes o, IsPixbuf a) => o -> a -> m ()
- type MarkAttributesQueryTooltipMarkupCallback = Mark -> IO Text
- afterMarkAttributesQueryTooltipMarkup :: (IsMarkAttributes a, MonadIO m) => a -> ((?self :: a) => MarkAttributesQueryTooltipMarkupCallback) -> m SignalHandlerId
- onMarkAttributesQueryTooltipMarkup :: (IsMarkAttributes a, MonadIO m) => a -> ((?self :: a) => MarkAttributesQueryTooltipMarkupCallback) -> m SignalHandlerId
- type MarkAttributesQueryTooltipTextCallback = Mark -> IO Text
- afterMarkAttributesQueryTooltipText :: (IsMarkAttributes a, MonadIO m) => a -> ((?self :: a) => MarkAttributesQueryTooltipTextCallback) -> m SignalHandlerId
- onMarkAttributesQueryTooltipText :: (IsMarkAttributes a, MonadIO m) => a -> ((?self :: a) => MarkAttributesQueryTooltipTextCallback) -> m SignalHandlerId
Exported types
newtype MarkAttributes Source #
Memory-managed wrapper type.
MarkAttributes (ManagedPtr MarkAttributes) |
Instances
Eq MarkAttributes Source # | |
Defined in GI.GtkSource.Objects.MarkAttributes (==) :: MarkAttributes -> MarkAttributes -> Bool # (/=) :: MarkAttributes -> MarkAttributes -> Bool # | |
GObject MarkAttributes Source # | |
Defined in GI.GtkSource.Objects.MarkAttributes | |
ManagedPtrNewtype MarkAttributes Source # | |
Defined in GI.GtkSource.Objects.MarkAttributes toManagedPtr :: MarkAttributes -> ManagedPtr MarkAttributes | |
TypedObject MarkAttributes Source # | |
Defined in GI.GtkSource.Objects.MarkAttributes | |
HasParentTypes MarkAttributes Source # | |
Defined in GI.GtkSource.Objects.MarkAttributes | |
IsGValue (Maybe MarkAttributes) Source # | Convert |
Defined in GI.GtkSource.Objects.MarkAttributes gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe MarkAttributes -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe MarkAttributes) | |
type ParentTypes MarkAttributes Source # | |
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
(GObject o, IsDescendantOf MarkAttributes o) => IsMarkAttributes o Source # | |
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
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, renderIcon, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getBackground, getData, getGicon, getIconName, getPixbuf, getProperty, getQdata, getTooltipMarkup, getTooltipText.
Setters
setBackground, setData, setDataFull, setGicon, setIconName, setPixbuf, setProperty.
getBackground
markAttributesGetBackground Source #
:: (HasCallStack, MonadIO m, IsMarkAttributes a) | |
=> a |
|
-> m (Bool, RGBA) | Returns: whether background color for |
Stores background color in background
.
getGicon
markAttributesGetGicon Source #
:: (HasCallStack, MonadIO m, IsMarkAttributes a) | |
=> a |
|
-> m Icon | Returns: An icon. The icon belongs to |
getIconName
markAttributesGetIconName Source #
:: (HasCallStack, MonadIO m, IsMarkAttributes a) | |
=> a |
|
-> m Text | Returns: An icon name. The string belongs to |
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 #
:: (HasCallStack, MonadIO m, IsMarkAttributes a) | |
=> a |
|
-> m Pixbuf | Returns: A pixbuf. The pixbuf belongs to |
getTooltipMarkup
markAttributesGetTooltipMarkup Source #
:: (HasCallStack, MonadIO m, IsMarkAttributes a, IsMark b) | |
=> a |
|
-> b |
|
-> m Text | Returns: A tooltip. The returned string should be freed by
using |
Queries for a tooltip by emitting a signalmarkAttributes
[queryTooltipMarkup] signal.
The tooltip may contain a markup.
getTooltipText
markAttributesGetTooltipText Source #
:: (HasCallStack, MonadIO m, IsMarkAttributes a, IsMark b) | |
=> a |
|
-> b |
|
-> m Text | Returns: A tooltip. The returned string should be freed by
using |
Queries for a tooltip by emitting a signalmarkAttributes
[queryTooltipText] signal.
The tooltip is a plain text.
new
:: (HasCallStack, MonadIO m) | |
=> m MarkAttributes | Returns: a new source mark attributes. |
Creates a new source mark attributes.
renderIcon
markAttributesRenderIcon Source #
:: (HasCallStack, MonadIO m, IsMarkAttributes a, IsWidget b) | |
=> a |
|
-> b |
|
-> Int32 |
|
-> m Paintable | Returns: A |
Renders an icon of given size.
The base of the icon is set by the last call to one of:
- [method
markAttributes
.set_pixbuf] - [method
markAttributes
.set_gicon] - [method
markAttributes
.set_icon_name]
size
cannot be lower than 1.
setBackground
markAttributesSetBackground Source #
:: (HasCallStack, MonadIO m, IsMarkAttributes a) | |
=> a |
|
-> RGBA |
|
-> m () |
Sets background color to the one given in background
.
setGicon
markAttributesSetGicon Source #
:: (HasCallStack, MonadIO m, IsMarkAttributes a, IsIcon b) | |
=> a |
|
-> b |
|
-> m () |
Sets an icon to be used as a base for rendered icon.
setIconName
markAttributesSetIconName Source #
:: (HasCallStack, MonadIO m, IsMarkAttributes a) | |
=> a |
|
-> Text |
|
-> m () |
Sets a name of an icon to be used as a base for rendered icon.
setPixbuf
markAttributesSetPixbuf Source #
:: (HasCallStack, MonadIO m, IsMarkAttributes a, IsPixbuf b) | |
=> a |
|
-> b |
|
-> 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 #
= Mark |
|
-> IO Text | Returns: A tooltip. The string should be freed with
|
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 #
= Mark |
|
-> IO Text | Returns: A tooltip. The string should be freed with
|
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