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

Description

 
Synopsis

Methods

checkVersion

checkVersion Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Word32

major: the major version to check

-> Word32

minor: the minor version to check

-> Word32

micro: the micro version to check

-> m Bool

Returns: True if the version of the GtkSourceView currently loaded is the same as or newer than the passed-in version.

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

getMajorVersion Source #

Arguments

:: (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

getMicroVersion Source #

Arguments

:: (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

getMinorVersion Source #

Arguments

:: (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

schedulerAdd Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> SchedulerCallback

callback: the callback to execute

-> m Word64 

Simplified version of [funcschedulerAddFull].

Since: 5.2

schedulerAddFull

schedulerAddFull Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> SchedulerCallback

callback: the callback to execute

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

schedulerRemove Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Word64

handlerId: the handler id

-> m () 

Removes a scheduler callback previously registered with [funcschedulerAdd] or [funcschedulerAddFull].

Since: 5.2

utilsEscapeSearchText

utilsEscapeSearchText Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

text: the text to escape.

-> m Text

Returns: the escaped text.

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 #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

text: the text to unescape.

-> m Text

Returns: the unescaped text.

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