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

Description

Mark object for [classbuffer].

A GtkSourceMark marks a position in the text where you want to display additional info. It is based on TextMark and thus is still valid after the text has changed though its position may change.

GtkSourceMarks are organized in categories which you have to set when you create the mark. Each category can have a priority, a pixbuf and other associated attributes. See [methodview.set_mark_attributes]. The pixbuf will be displayed in the margin at the line where the mark residents if the [propertyview:show-line-marks] property is set to True. If there are multiple marks in the same line, the pixbufs will be drawn on top of each other. The mark with the highest priority will be drawn on top.

Synopsis

Exported types

newtype Mark Source #

Memory-managed wrapper type.

Constructors

Mark (ManagedPtr Mark) 

Instances

Instances details
Eq Mark Source # 
Instance details

Defined in GI.GtkSource.Objects.Mark

Methods

(==) :: Mark -> Mark -> Bool #

(/=) :: Mark -> Mark -> Bool #

GObject Mark Source # 
Instance details

Defined in GI.GtkSource.Objects.Mark

ManagedPtrNewtype Mark Source # 
Instance details

Defined in GI.GtkSource.Objects.Mark

Methods

toManagedPtr :: Mark -> ManagedPtr Mark

TypedObject Mark Source # 
Instance details

Defined in GI.GtkSource.Objects.Mark

Methods

glibType :: IO GType

HasParentTypes Mark Source # 
Instance details

Defined in GI.GtkSource.Objects.Mark

IsGValue (Maybe Mark) Source #

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

Instance details

Defined in GI.GtkSource.Objects.Mark

Methods

gvalueGType_ :: IO GType

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

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

type ParentTypes Mark Source # 
Instance details

Defined in GI.GtkSource.Objects.Mark

type ParentTypes Mark = '[TextMark, Object]

class (GObject o, IsDescendantOf Mark o) => IsMark o Source #

Type class for types which can be safely cast to Mark, for instance with toMark.

Instances

Instances details
(GObject o, IsDescendantOf Mark o) => IsMark o Source # 
Instance details

Defined in GI.GtkSource.Objects.Mark

toMark :: (MonadIO m, IsMark o) => o -> m Mark Source #

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

Methods

getCategory

markGetCategory Source #

Arguments

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

mark: a Mark.

-> m Text

Returns: the category of the Mark.

Returns the mark category.

new

markNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Maybe Text

name: Name of the Mark or Nothing

-> Text

category: is used to classify marks according to common characteristics (e.g. all the marks representing a bookmark could belong to the "bookmark" category, or all the marks representing a compilation error could belong to "error" category).

-> m Mark

Returns: a new Mark that can be added using textBufferAddMark.

Creates a text mark.

Add it to a buffer using textBufferAddMark. If name is NULL, the mark is anonymous; otherwise, the mark can be retrieved by name using textBufferGetMark. Normally marks are created using the utility function [methodbuffer.create_source_mark].

next

markNext Source #

Arguments

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

mark: a Mark.

-> Maybe Text

category: a string specifying the mark category, or Nothing.

-> m (Maybe Mark)

Returns: the next Mark, or Nothing.

Returns the next GtkSourceMark in the buffer or Nothing if the mark was not added to a buffer.

If there is no next mark, Nothing will be returned.

If category is Nothing, looks for marks of any category.

prev

markPrev Source #

Arguments

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

mark: a Mark.

-> Text

category: a string specifying the mark category, or Nothing.

-> m (Maybe Mark)

Returns: the previous Mark, or Nothing.

Returns the previous GtkSourceMark in the buffer or Nothing if the mark was not added to a buffer.

If there is no previous mark, Nothing is returned.

If category is Nothing, looks for marks of any category

Properties

category

The category of the GtkSourceMark, classifies the mark and controls which pixbuf is used and with which priority it is drawn.

constructMarkCategory :: (IsMark o, MonadIO m) => Text -> m (GValueConstruct o) Source #

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

getMarkCategory :: (MonadIO m, IsMark o) => o -> m Text Source #

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

get mark #category