gtksourceview2-0.12.1: Binding to the GtkSourceView library.Source codeContentsIndex
Graphics.UI.Gtk.SourceView.SourceLanguageManager
Portabilityportable (depends on GHC)
Stabilityprovisional
Maintainergtk2hs-users@lists.sourceforge.net
Contents
Description
Types
Methods
Attributes
Description
Synopsis
data SourceLanguageManager
class GObjectClass o => SourceLanguageManagerClass o
castToSourceLanguageManager :: GObjectClass obj => obj -> SourceLanguageManager
sourceLanguageManagerNew :: IO SourceLanguageManager
sourceLanguageManagerGetDefault :: IO SourceLanguageManager
sourceLanguageManagerSetSearchPath :: SourceLanguageManagerClass slm => slm -> Maybe [String] -> IO ()
sourceLanguageManagerGetSearchPath :: SourceLanguageManagerClass slm => slm -> IO [String]
sourceLanguageManagerGetLanguageIds :: SourceLanguageManagerClass slm => slm -> IO [String]
sourceLanguageManagerGetLanguage :: SourceLanguageManagerClass slm => slm -> String -> IO (Maybe SourceLanguage)
sourceLanguageManagerGuessLanguage :: SourceLanguageManagerClass slm => slm -> Maybe String -> Maybe String -> IO (Maybe SourceLanguage)
sourceLanguageManagerLanguageIds :: SourceLanguageManagerClass slm => ReadAttr slm [String]
sourceLanguageManagerSearchPath :: SourceLanguageManagerClass slm => ReadWriteAttr slm [String] (Maybe [String])
Description
SourceLanguageManager is an object which processes language description files and creates and stores SourceLanguage objects, and provides API to access them. Use sourceLanguageManagerGetDefault to retrieve the default instance of SourceLanguageManager, and sourceLanguageManagerGuessLanguage to get a SourceLanguage for given file name and content type.
Types
data SourceLanguageManager Source
show/hide Instances
class GObjectClass o => SourceLanguageManagerClass o Source
show/hide Instances
Methods
castToSourceLanguageManager :: GObjectClass obj => obj -> SourceLanguageManagerSource
sourceLanguageManagerNew :: IO SourceLanguageManagerSource
Creates a new language manager. If you do not need more than one language manager or a private language manager instance then use sourceLanguageManagerGetDefault instead.
sourceLanguageManagerGetDefault :: IO SourceLanguageManagerSource
Returns the default SourceLanguageManager instance.
sourceLanguageManagerSetSearchPath :: SourceLanguageManagerClass slm => slm -> Maybe [String] -> IO ()Source

Sets the list of directories where the lm looks for language files. If dirs is Nothing, the search path is reset to default.

Note

At the moment this function can be called only before the language files are loaded for the first time. In practice to set a custom search path for a SourceLanguageManager, you have to call this function right after creating it.

sourceLanguageManagerGetSearchPath :: SourceLanguageManagerClass slm => slm -> IO [String]Source
Gets the list directories where lm looks for language files.
sourceLanguageManagerGetLanguageIds :: SourceLanguageManagerClass slm => slm -> IO [String]Source
Returns the ids of the available languages.
sourceLanguageManagerGetLanguageSource
:: SourceLanguageManagerClass slm
=> slm
-> Stringid a language id.
-> IO (Maybe SourceLanguage)returns a SourceLanguage, or Nothing if there is no language identified by the given id.
Gets the SourceLanguage identified by the given id in the language manager.
sourceLanguageManagerGuessLanguageSource
:: SourceLanguageManagerClass slm
=> slm
-> Maybe Stringfilename a filename in Glib filename encoding, or Nothing.
-> Maybe StringcontentType a content type (as in GIO API), or Nothing.
-> IO (Maybe SourceLanguage)returns a SourceLanguage, or Nothing if there is no suitable language for given filename and/or contentType.
Picks a SourceLanguage for given file name and content type, according to the information in lang files. Either filename or contentType may be Nothing.
Attributes
sourceLanguageManagerLanguageIds :: SourceLanguageManagerClass slm => ReadAttr slm [String]Source
List of the ids of the available languages.
sourceLanguageManagerSearchPath :: SourceLanguageManagerClass slm => ReadWriteAttr slm [String] (Maybe [String])Source
List of directories where the language specification files (.lang) are located.
Produced by Haddock version 2.6.1