 
 {# enum SourceSmartHomeEndType {underscoreToCase} deriving (Eq, Bounded, Show, Read) #}
 
--- |
+-- | 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.
 --
 sourceLanguageManagerNew :: IO SourceLanguageManager
 sourceLanguageManagerNew = constructNewGObject mkSourceLanguageManager $ liftM castPtr
   {#call unsafe source_language_manager_new#}
 
--- |
+-- | Returns the default 'SourceLanguageManager' instance.
 --
 sourceLanguageManagerGetDefault :: IO SourceLanguageManager
 sourceLanguageManagerGetDefault = makeNewGObject mkSourceLanguageManager $ liftM castPtr
   {#call unsafe source_language_manager_new#}
 
--- |
+-- | 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.
 --
 sourceLanguageManagerSetSearchPath :: SourceLanguageManager -> Maybe [String] -> IO ()
 sourceLanguageManagerSetSearchPath slm dirs =
   maybeWith withUTFStringArray0 dirs $ \dirsPtr -> do
     {#call unsafe source_language_manager_set_search_path#} slm dirsPtr
 
--- |
+-- | Gets the list directories where lm looks for language files.
 --
 sourceLanguageManagerGetSearchPath :: SourceLanguageManager -> IO [String]
 sourceLanguageManagerGetSearchPath slm = do
   dirsPtr <- {#call unsafe source_language_manager_get_search_path#} slm
   liftM (fromMaybe []) $ maybePeek peekUTFStringArray0 dirsPtr
 
--- |
+-- | Returns the ids of the available languages.
 --
 sourceLanguageManagerGetLanguageIds :: SourceLanguageManager -> IO [String]
 sourceLanguageManagerGetLanguageIds slm = do
   idsPtr <- {#call unsafe source_language_manager_get_language_ids#} slm
   liftM (fromMaybe []) $ maybePeek peekUTFStringArray0 idsPtr
 
--- |
+-- | Gets the 'SourceLanguage' identified by the given id in the language manager.
 --
-sourceLanguageManagerGetLanguage :: SourceLanguageManager -> String -> IO (Maybe SourceLanguage)
+sourceLanguageManagerGetLanguage :: SourceLanguageManager 
+                                 -> String  -- ^ @id@      a language id.
+                                 -> IO (Maybe SourceLanguage) -- ^ returns a 'SourceLanguage', or 'Nothing' if there is no language identified by the given id. 
 sourceLanguageManagerGetLanguage slm id = do
   slPtr <- liftM castPtr $
     withUTFString id ({#call unsafe source_language_manager_get_language#} slm)

-- Portability : portable (depends on GHC)
--
module Graphics.UI.Gtk.SourceView.SourceLanguageManager (
  SourceLanguageManager,
  SourceLanguageManagerClass,
  castToSourceLanguageManager,
  sourceLanguageManagerNew,
  sourceLanguageManagerGetDefault,

    then liftM Just $ makeNewGObject mkSourceLanguage $ return slPtr
    else return Nothing

-- | Picks a 'SourceLanguage' for given file name and content type, according to the information in lang
-- files. Either filename or @contentType@ may be 'Nothing'.
--
sourceLanguageManagerGuessLanguage :: SourceLanguageManager 
                                   -> 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@. 
sourceLanguageManagerGuessLanguage slm filename contentType =
  maybeWith withUTFString filename $ \cFilename ->
  maybeWith withUTFString contentType $ \cContentType -> do
