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 |
Collected information about visible lines.
The GtkSourceGutterLines
object is used to collect information about
visible lines.
Use this from your signalgutterRenderer
[queryData] to collect the
necessary information on visible lines. Doing so reduces the number of
passes through the text btree allowing GtkSourceView to reach more
frames-per-second while performing kinetic scrolling.
Synopsis
- newtype GutterLines = GutterLines (ManagedPtr GutterLines)
- class (GObject o, IsDescendantOf GutterLines o) => IsGutterLines o
- toGutterLines :: (MonadIO m, IsGutterLines o) => o -> m GutterLines
- gutterLinesAddClass :: (HasCallStack, MonadIO m, IsGutterLines a) => a -> Word32 -> Text -> m ()
- gutterLinesAddQclass :: (HasCallStack, MonadIO m, IsGutterLines a) => a -> Word32 -> Word32 -> m ()
- gutterLinesGetBuffer :: (HasCallStack, MonadIO m, IsGutterLines a) => a -> m TextBuffer
- gutterLinesGetFirst :: (HasCallStack, MonadIO m, IsGutterLines a) => a -> m Word32
- gutterLinesGetIterAtLine :: (HasCallStack, MonadIO m, IsGutterLines a) => a -> Word32 -> m TextIter
- gutterLinesGetLast :: (HasCallStack, MonadIO m, IsGutterLines a) => a -> m Word32
- gutterLinesGetLineYrange :: (HasCallStack, MonadIO m, IsGutterLines a) => a -> Word32 -> GutterRendererAlignmentMode -> m (Int32, Int32)
- gutterLinesGetView :: (HasCallStack, MonadIO m, IsGutterLines a) => a -> m TextView
- gutterLinesHasAnyClass :: (HasCallStack, MonadIO m, IsGutterLines a) => a -> Word32 -> m Bool
- gutterLinesHasClass :: (HasCallStack, MonadIO m, IsGutterLines a) => a -> Word32 -> Text -> m Bool
- gutterLinesHasQclass :: (HasCallStack, MonadIO m, IsGutterLines a) => a -> Word32 -> Word32 -> m Bool
- gutterLinesIsCursor :: (HasCallStack, MonadIO m, IsGutterLines a) => a -> Word32 -> m Bool
- gutterLinesIsPrelit :: (HasCallStack, MonadIO m, IsGutterLines a) => a -> Word32 -> m Bool
- gutterLinesIsSelected :: (HasCallStack, MonadIO m, IsGutterLines a) => a -> Word32 -> m Bool
- gutterLinesRemoveClass :: (HasCallStack, MonadIO m, IsGutterLines a) => a -> Word32 -> Text -> m ()
- gutterLinesRemoveQclass :: (HasCallStack, MonadIO m, IsGutterLines a) => a -> Word32 -> Word32 -> m ()
Exported types
newtype GutterLines Source #
Memory-managed wrapper type.
GutterLines (ManagedPtr GutterLines) |
Instances
Eq GutterLines Source # | |
Defined in GI.GtkSource.Objects.GutterLines (==) :: GutterLines -> GutterLines -> Bool # (/=) :: GutterLines -> GutterLines -> Bool # | |
GObject GutterLines Source # | |
Defined in GI.GtkSource.Objects.GutterLines | |
ManagedPtrNewtype GutterLines Source # | |
Defined in GI.GtkSource.Objects.GutterLines toManagedPtr :: GutterLines -> ManagedPtr GutterLines | |
TypedObject GutterLines Source # | |
Defined in GI.GtkSource.Objects.GutterLines | |
HasParentTypes GutterLines Source # | |
Defined in GI.GtkSource.Objects.GutterLines | |
IsGValue (Maybe GutterLines) Source # | Convert |
Defined in GI.GtkSource.Objects.GutterLines gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe GutterLines -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe GutterLines) | |
type ParentTypes GutterLines Source # | |
Defined in GI.GtkSource.Objects.GutterLines type ParentTypes GutterLines = '[Object] |
class (GObject o, IsDescendantOf GutterLines o) => IsGutterLines o Source #
Type class for types which can be safely cast to GutterLines
, for instance with toGutterLines
.
Instances
(GObject o, IsDescendantOf GutterLines o) => IsGutterLines o Source # | |
Defined in GI.GtkSource.Objects.GutterLines |
toGutterLines :: (MonadIO m, IsGutterLines o) => o -> m GutterLines Source #
Cast to GutterLines
, 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
addClass, addQclass, bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, hasAnyClass, hasClass, hasQclass, isCursor, isFloating, isPrelit, isSelected, notify, notifyByPspec, ref, refSink, removeClass, removeQclass, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getBuffer, getData, getFirst, getIterAtLine, getLast, getLineYrange, getProperty, getQdata, getView.
Setters
addClass
:: (HasCallStack, MonadIO m, IsGutterLines a) | |
=> a |
|
-> Word32 |
|
-> Text |
|
-> m () |
Adds the class name
to line
.
name
will be converted to a [aliasgLib
.Quark] as part of this process. A
faster version of this function is available via
[methodgutterLines
.add_qclass] for situations where the [aliasgLib
.Quark] is
known ahead of time.
addQclass
:: (HasCallStack, MonadIO m, IsGutterLines a) | |
=> a |
|
-> Word32 |
|
-> Word32 |
|
-> m () |
Adds the class denoted by qname
to line
.
You may check if a line has qname
by calling
[methodgutterLines
.has_qclass].
You can remove qname
by calling
[methodgutterLines
.remove_qclass].
getBuffer
:: (HasCallStack, MonadIO m, IsGutterLines a) | |
=> a |
|
-> m TextBuffer | Returns: a |
Gets the TextBuffer
that the GtkSourceGutterLines
represents.
getFirst
:: (HasCallStack, MonadIO m, IsGutterLines a) | |
=> a |
|
-> m Word32 | Returns: a line number starting from 0 |
Gets the line number (starting from 0) for the first line that is user visible.
getIterAtLine
gutterLinesGetIterAtLine Source #
:: (HasCallStack, MonadIO m, IsGutterLines a) | |
=> a |
|
-> Word32 |
|
-> m TextIter |
Gets a TextIter
for the current buffer at line
getLast
:: (HasCallStack, MonadIO m, IsGutterLines a) | |
=> a |
|
-> m Word32 | Returns: a line number starting from 0 |
Gets the line number (starting from 0) for the last line that is user visible.
getLineYrange
gutterLinesGetLineYrange Source #
:: (HasCallStack, MonadIO m, IsGutterLines a) | |
=> a |
|
-> Word32 |
|
-> GutterRendererAlignmentMode |
|
-> m (Int32, Int32) |
Gets the Y range for a line based on mode
.
The value for y
is relative to the renderers widget coordinates.
getView
:: (HasCallStack, MonadIO m, IsGutterLines a) | |
=> a |
|
-> m TextView | Returns: a |
Gets the TextView
that the GtkSourceGutterLines
represents.
hasAnyClass
gutterLinesHasAnyClass Source #
:: (HasCallStack, MonadIO m, IsGutterLines a) | |
=> a |
|
-> Word32 |
|
-> m Bool | Returns: |
Checks to see if the line has any GQuark classes set. This can be used to help renderer implementations avoid work if nothing has been set on the class.
Since: 5.6
hasClass
:: (HasCallStack, MonadIO m, IsGutterLines a) | |
=> a |
|
-> Word32 |
|
-> Text |
|
-> m Bool | Returns: |
Checks to see if [methodgutterLines
.add_class] was called with
the name
for line
.
A faster version of this function is provided via
[methodgutterLines
.has_qclass] for situations where the quark
is known ahead of time.
hasQclass
:: (HasCallStack, MonadIO m, IsGutterLines a) | |
=> a |
|
-> Word32 |
|
-> Word32 |
|
-> m Bool | Returns: |
Checks to see if [methodgutterLines
.add_qclass] was called with
the quark denoted by qname
for line
.
isCursor
:: (HasCallStack, MonadIO m, IsGutterLines a) | |
=> a |
|
-> Word32 |
|
-> m Bool | Returns: |
Checks to see if line
contains the insertion cursor.
isPrelit
:: (HasCallStack, MonadIO m, IsGutterLines a) | |
=> a |
|
-> Word32 |
|
-> m Bool | Returns: |
Checks to see if line
is marked as prelit. Generally, this means
the mouse pointer is over the line within the gutter.
isSelected
gutterLinesIsSelected Source #
:: (HasCallStack, MonadIO m, IsGutterLines a) | |
=> a |
|
-> Word32 |
|
-> m Bool | Returns: |
Checks to see if the view had a selection and if that selection overlaps
line
in some way.
removeClass
gutterLinesRemoveClass Source #
:: (HasCallStack, MonadIO m, IsGutterLines a) | |
=> a |
|
-> Word32 |
|
-> Text |
|
-> m () |
Removes the class matching name
from line
.
A faster version of this function is available via
[methodgutterLines
.remove_qclass] for situations where the
GQuark
is known ahead of time.
removeQclass
gutterLinesRemoveQclass Source #
:: (HasCallStack, MonadIO m, IsGutterLines a) | |
=> a |
|
-> Word32 |
|
-> Word32 |
|
-> m () |
Reverses a call to [methodgutterLines
.add_qclass] by removing
the [aliasgLib
.Quark] matching qname
.