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 |
Synopsis
- checkVersion :: (HasCallStack, MonadIO m) => Word32 -> Word32 -> Word32 -> m Bool
- finalize :: (HasCallStack, MonadIO m) => m ()
- getMajorVersion :: (HasCallStack, MonadIO m) => m Word32
- getMicroVersion :: (HasCallStack, MonadIO m) => m Word32
- getMinorVersion :: (HasCallStack, MonadIO m) => m Word32
- init :: (HasCallStack, MonadIO m) => m ()
- schedulerAdd :: (HasCallStack, MonadIO m) => SchedulerCallback -> m Word64
- schedulerAddFull :: (HasCallStack, MonadIO m) => SchedulerCallback -> m Word64
- schedulerRemove :: (HasCallStack, MonadIO m) => Word64 -> m ()
- utilsEscapeSearchText :: (HasCallStack, MonadIO m) => Text -> m Text
- utilsUnescapeSearchText :: (HasCallStack, MonadIO m) => Text -> m Text
Methods
checkVersion
:: (HasCallStack, MonadIO m) | |
=> Word32 |
|
-> Word32 |
|
-> Word32 |
|
-> m Bool | Returns: |
Like GTK_SOURCE_CHECK_VERSION, but the check for gtk_source_check_version is at runtime instead of compile time. This is useful for compiling against older versions of GtkSourceView, but using features from newer versions.
finalize
finalize :: (HasCallStack, MonadIO m) => m () Source #
Free the resources allocated by GtkSourceView. For example it unrefs the singleton objects.
It is not mandatory to call this function, it's just to be friendlier to
memory debugging tools. This function is meant to be called at the end of
main()
. It can be called several times.
getMajorVersion
:: (HasCallStack, MonadIO m) | |
=> m Word32 | Returns: the major version number of the GtkSourceView library |
Returns the major version number of the GtkSourceView library. (e.g. in GtkSourceView version 3.20.0 this is 3.)
This function is in the library, so it represents the GtkSourceView library
your code is running against. Contrast with the MAJOR_VERSION
macro, which represents the major version of the GtkSourceView headers you
have included when compiling your code.
getMicroVersion
:: (HasCallStack, MonadIO m) | |
=> m Word32 | Returns: the micro version number of the GtkSourceView library |
Returns the micro version number of the GtkSourceView library. (e.g. in GtkSourceView version 3.20.0 this is 0.)
This function is in the library, so it represents the GtkSourceView library
your code is running against. Contrast with the MICRO_VERSION
macro, which represents the micro version of the GtkSourceView headers you
have included when compiling your code.
getMinorVersion
:: (HasCallStack, MonadIO m) | |
=> m Word32 | Returns: the minor version number of the GtkSourceView library |
Returns the minor version number of the GtkSourceView library. (e.g. in GtkSourceView version 3.20.0 this is 20.)
This function is in the library, so it represents the GtkSourceView library
your code is running against. Contrast with the MINOR_VERSION
macro, which represents the minor version of the GtkSourceView headers you
have included when compiling your code.
init
init :: (HasCallStack, MonadIO m) => m () Source #
Initializes the GtkSourceView library (e.g. for the internationalization).
This function can be called several times, but is meant to be called at the
beginning of main()
, before any other GtkSourceView function call.
schedulerAdd
:: (HasCallStack, MonadIO m) | |
=> SchedulerCallback |
|
-> m Word64 |
Simplified version of [funcschedulerAddFull
].
Since: 5.2
schedulerAddFull
:: (HasCallStack, MonadIO m) | |
=> SchedulerCallback |
|
-> m Word64 |
Adds a new callback that will be executed as time permits on the main thread.
This is useful when you need to do a lot of background work but want to do it incrementally.
callback
will be provided a deadline that it should complete it's work by
(or near) and can be checked using getMonotonicTime
for comparison.
Use [funcschedulerRemove
] to remove the handler.
Since: 5.2
schedulerRemove
:: (HasCallStack, MonadIO m) | |
=> Word64 |
|
-> m () |
Removes a scheduler callback previously registered with
[funcschedulerAdd
] or [funcschedulerAddFull
].
Since: 5.2
utilsEscapeSearchText
utilsEscapeSearchText Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m Text | Returns: the escaped |
Use this function to escape the following characters: \n
, \r
, \t
and \
.
For a regular expression search, use regexEscapeString
instead.
One possible use case is to take the TextBuffer
's selection and put it in a
search entry. The selection can contain tabulations, newlines, etc. So it's
better to escape those special characters to better fit in the search entry.
See also: [funcutilsUnescapeSearchText
].
<warning> Warning: the escape and unescape functions are not reciprocal! For example, escape (unescape (\)) = \. So avoid cycles such as: search entry -> unescape -> search settings -> escape -> search entry. The original search entry text may be modified. </warning>
utilsUnescapeSearchText
utilsUnescapeSearchText Source #
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m Text | Returns: the unescaped |
Use this function before [methodsearchSettings
.set_search_text], to
unescape the following sequences of characters: \n
, \r
, \t
and \\
.
The purpose is to easily write those characters in a search entry.
Note that unescaping the search text is not needed for regular expression searches.
See also: [funcutilsEscapeSearchText
].