gtksourceview3-0.13.3.1: Binding to the GtkSourceView library.

Maintainerhttp:
Stabilityprovisional
Portabilityportable (depends on GHC)
Safe HaskellNone
LanguageHaskell98

Graphics.UI.Gtk.SourceView.SourceMarkAttributes

Contents

Description

 

Synopsis

Description

SourceMarkAttributes is an object specifying attributes used by a SourceView to visually show lines marked with SourceMarks 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 sourceMarkAttributesSetBackground. To check if any custom background color was defined and what color it is, use sourceMarkAttributesGetBackground.

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 sourceMarkAttributesRenderIcon must be called. There are several ways to specify a base for an icon:

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 queryTooltipText or queryTooltipMarkup where the latter takes precedence.

Types

Methods

sourceMarkAttributesNew :: IO SourceMarkAttributes Source #

Creates a new source mark attributes.

sourceMarkAttributesSetBackground :: SourceMarkAttributesClass attributes => attributes -> Maybe RGBA -> IO () Source #

Sets background color.

sourceMarkAttributesGetBackground :: SourceMarkAttributesClass attributes => attributes -> IO (Maybe RGBA) Source #

Gets background color.

sourceMarkAttributesSetIconName :: (SourceMarkAttributesClass attributes, GlibString iconName) => attributes -> Maybe iconName -> IO () Source #

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

sourceMarkAttributesGetIconName :: (SourceMarkAttributesClass attributes, GlibString iconName) => attributes -> IO (Maybe iconName) Source #

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

sourceMarkAttributesSetPixbuf :: SourceMarkAttributesClass attributes => attributes -> Maybe Pixbuf -> IO () Source #

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

sourceMarkAttributesGetPixbuf :: SourceMarkAttributesClass attributes => attributes -> IO (Maybe Pixbuf) Source #

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

sourceMarkAttributesRenderIcon Source #

Arguments

:: (SourceMarkAttributesClass attributes, WidgetClass widget) 
=> attributes 
-> widget

widget of which style settings may be used.

-> Int

size of the redered icon. Cannot be lower than 1

-> IO (Maybe Pixbuf) 

Renders an icon of given size. The base of the icon is set by the last call to one of: sourceMarkAttributesSetPixbuf, sourceMarkAttributesSetGIcon or sourceMarkAttributessetIconName.

sourceMarkAttributesGetTooltipText :: (SourceMarkAttributesClass attributes, SourceMarkClass mark, GlibString text) => attributes -> mark -> IO (Maybe text) Source #

Queries for a tooltip by emitting a queryTooltipText signal. The tooltip is a plain text.

sourceMarkAttributesGetTooltipMarkup :: (SourceMarkAttributesClass attributes, SourceMarkClass mark, GlibString markup) => attributes -> mark -> IO (Maybe markup) Source #

Queries for a tooltip by emitting a queryTooltipMarkup signal. The tooltip may contain a markup.

Attributes

sourceMarkAttributesBackground :: SourceMarkAttributesClass attributes => Attr attributes (Maybe RGBA) Source #

A color used for background of a line.

sourceMarkAttributesIconName :: (SourceMarkAttributesClass attributes, GlibString iconName) => Attr attributes (Maybe iconName) Source #

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

sourceMarkAttributesPixbuf :: SourceMarkAttributesClass attributes => Attr attributes (Maybe Pixbuf) Source #

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

Signals

queryTooltipMarkup :: (SourceMarkAttributesClass self, GlibString markup) => Signal self (SourceMark -> IO markup) Source #

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

queryTooltipText :: (SourceMarkAttributesClass self, GlibString text) => Signal self (SourceMark -> IO text) Source #

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