gtksourceview2-0.13.0.0: Binding to the GtkSourceView library.

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

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 Source

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, GlibFilePath fp) => slm -> Maybe [fp] -> 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, GlibFilePath fp) => slm -> IO [fp] Source

Gets the list directories where lm looks for language files.

sourceLanguageManagerGetLanguageIds :: (SourceLanguageManagerClass slm, GlibString string) => slm -> IO [string] Source

Returns the ids of the available languages.

sourceLanguageManagerGetLanguage Source

Arguments

:: (SourceLanguageManagerClass slm, GlibString string) 
=> 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 Source

Arguments

:: (SourceLanguageManagerClass slm, GlibFilePath fp, GlibString string) 
=> slm 
-> Maybe fp

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, GlibString string) => ReadAttr slm [string] Source

List of the ids of the available languages.

sourceLanguageManagerSearchPath :: (SourceLanguageManagerClass slm, GlibString string) => ReadWriteAttr slm [string] (Maybe [string]) Source

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