Portability | portable (depends on GHC) |
---|---|
Stability | provisional |
Maintainer | gtk2hs-users@lists.sourceforge.net |
Safe Haskell | None |
- 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
class GObjectClass o => SourceLanguageManagerClass o Source
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 | |
-> String |
|
-> IO (Maybe SourceLanguage) | returns a |
Gets the SourceLanguage
identified by the given id in the language manager.
sourceLanguageManagerGuessLanguageSource
:: SourceLanguageManagerClass slm | |
=> slm | |
-> Maybe String |
|
-> Maybe String |
|
-> IO (Maybe SourceLanguage) | returns a |
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.