gtksourceview2-0.12.2: Binding to the GtkSourceView library.

Portabilityportable (depends on GHC)
Stabilityprovisional
Maintainergtk2hs-users@lists.sourceforge.net

Graphics.UI.Gtk.SourceView.SourceLanguageManager

Contents

Description

 

Synopsis

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

Methods

sourceLanguageManagerNew :: IO SourceLanguageManager

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.

sourceLanguageManagerSetSearchPath :: SourceLanguageManagerClass slm => slm -> Maybe [String] -> IO ()

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]

Gets the list directories where lm looks for language files.

sourceLanguageManagerGetLanguageIds :: SourceLanguageManagerClass slm => slm -> IO [String]

Returns the ids of the available languages.

sourceLanguageManagerGetLanguage

Arguments

:: SourceLanguageManagerClass slm 
=> slm 
-> String

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

sourceLanguageManagerGuessLanguage

Arguments

:: SourceLanguageManagerClass slm 
=> slm 
-> Maybe String

filename a filename in Glib filename encoding, or Nothing.

-> Maybe String

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

List of the ids of the available languages.

sourceLanguageManagerSearchPath :: SourceLanguageManagerClass slm => ReadWriteAttr slm [String] (Maybe [String])

List of directories where the language specification files (.lang) are located.