{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- /No description available in the introspection data./

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.GtkSource.Objects.LanguageManager
    ( 

-- * Exported types
    LanguageManager(..)                     ,
    IsLanguageManager                       ,
    toLanguageManager                       ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [guessLanguage]("GI.GtkSource.Objects.LanguageManager#g:method:guessLanguage"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
-- 
-- ==== Getters
-- [getData]("GI.GObject.Objects.Object#g:method:getData"), [getLanguage]("GI.GtkSource.Objects.LanguageManager#g:method:getLanguage"), [getLanguageIds]("GI.GtkSource.Objects.LanguageManager#g:method:getLanguageIds"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata"), [getSearchPath]("GI.GtkSource.Objects.LanguageManager#g:method:getSearchPath").
-- 
-- ==== Setters
-- [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty"), [setSearchPath]("GI.GtkSource.Objects.LanguageManager#g:method:setSearchPath").

#if defined(ENABLE_OVERLOADING)
    ResolveLanguageManagerMethod            ,
#endif

-- ** getDefault #method:getDefault#

    languageManagerGetDefault               ,


-- ** getLanguage #method:getLanguage#

#if defined(ENABLE_OVERLOADING)
    LanguageManagerGetLanguageMethodInfo    ,
#endif
    languageManagerGetLanguage              ,


-- ** getLanguageIds #method:getLanguageIds#

#if defined(ENABLE_OVERLOADING)
    LanguageManagerGetLanguageIdsMethodInfo ,
#endif
    languageManagerGetLanguageIds           ,


-- ** getSearchPath #method:getSearchPath#

#if defined(ENABLE_OVERLOADING)
    LanguageManagerGetSearchPathMethodInfo  ,
#endif
    languageManagerGetSearchPath            ,


-- ** guessLanguage #method:guessLanguage#

#if defined(ENABLE_OVERLOADING)
    LanguageManagerGuessLanguageMethodInfo  ,
#endif
    languageManagerGuessLanguage            ,


-- ** new #method:new#

    languageManagerNew                      ,


-- ** setSearchPath #method:setSearchPath#

#if defined(ENABLE_OVERLOADING)
    LanguageManagerSetSearchPathMethodInfo  ,
#endif
    languageManagerSetSearchPath            ,




 -- * Properties


-- ** languageIds #attr:languageIds#
-- | /No description available in the introspection data./

#if defined(ENABLE_OVERLOADING)
    LanguageManagerLanguageIdsPropertyInfo  ,
#endif
    getLanguageManagerLanguageIds           ,
#if defined(ENABLE_OVERLOADING)
    languageManagerLanguageIds              ,
#endif


-- ** searchPath #attr:searchPath#
-- | /No description available in the introspection data./

#if defined(ENABLE_OVERLOADING)
    LanguageManagerSearchPathPropertyInfo   ,
#endif
    clearLanguageManagerSearchPath          ,
    constructLanguageManagerSearchPath      ,
    getLanguageManagerSearchPath            ,
#if defined(ENABLE_OVERLOADING)
    languageManagerSearchPath               ,
#endif
    setLanguageManagerSearchPath            ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R

import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.GtkSource.Objects.Language as GtkSource.Language

-- | Memory-managed wrapper type.
newtype LanguageManager = LanguageManager (SP.ManagedPtr LanguageManager)
    deriving (LanguageManager -> LanguageManager -> Bool
(LanguageManager -> LanguageManager -> Bool)
-> (LanguageManager -> LanguageManager -> Bool)
-> Eq LanguageManager
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LanguageManager -> LanguageManager -> Bool
== :: LanguageManager -> LanguageManager -> Bool
$c/= :: LanguageManager -> LanguageManager -> Bool
/= :: LanguageManager -> LanguageManager -> Bool
Eq)

instance SP.ManagedPtrNewtype LanguageManager where
    toManagedPtr :: LanguageManager -> ManagedPtr LanguageManager
toManagedPtr (LanguageManager ManagedPtr LanguageManager
p) = ManagedPtr LanguageManager
p

foreign import ccall "gtk_source_language_manager_get_type"
    c_gtk_source_language_manager_get_type :: IO B.Types.GType

instance B.Types.TypedObject LanguageManager where
    glibType :: IO GType
glibType = IO GType
c_gtk_source_language_manager_get_type

instance B.Types.GObject LanguageManager

-- | Type class for types which can be safely cast to `LanguageManager`, for instance with `toLanguageManager`.
class (SP.GObject o, O.IsDescendantOf LanguageManager o) => IsLanguageManager o
instance (SP.GObject o, O.IsDescendantOf LanguageManager o) => IsLanguageManager o

instance O.HasParentTypes LanguageManager
type instance O.ParentTypes LanguageManager = '[GObject.Object.Object]

-- | Cast to `LanguageManager`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toLanguageManager :: (MIO.MonadIO m, IsLanguageManager o) => o -> m LanguageManager
toLanguageManager :: forall (m :: * -> *) o.
(MonadIO m, IsLanguageManager o) =>
o -> m LanguageManager
toLanguageManager = IO LanguageManager -> m LanguageManager
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO LanguageManager -> m LanguageManager)
-> (o -> IO LanguageManager) -> o -> m LanguageManager
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr LanguageManager -> LanguageManager)
-> o -> IO LanguageManager
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
 ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr LanguageManager -> LanguageManager
LanguageManager

-- | Convert 'LanguageManager' to and from 'Data.GI.Base.GValue.GValue'. See 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue (Maybe LanguageManager) where
    gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_gtk_source_language_manager_get_type
    gvalueSet_ :: Ptr GValue -> Maybe LanguageManager -> IO ()
gvalueSet_ Ptr GValue
gv Maybe LanguageManager
P.Nothing = Ptr GValue -> Ptr LanguageManager -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr LanguageManager
forall a. Ptr a
FP.nullPtr :: FP.Ptr LanguageManager)
    gvalueSet_ Ptr GValue
gv (P.Just LanguageManager
obj) = LanguageManager -> (Ptr LanguageManager -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr LanguageManager
obj (Ptr GValue -> Ptr LanguageManager -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
    gvalueGet_ :: Ptr GValue -> IO (Maybe LanguageManager)
gvalueGet_ Ptr GValue
gv = do
        Ptr LanguageManager
ptr <- Ptr GValue -> IO (Ptr LanguageManager)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr LanguageManager)
        if Ptr LanguageManager
ptr Ptr LanguageManager -> Ptr LanguageManager -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr LanguageManager
forall a. Ptr a
FP.nullPtr
        then LanguageManager -> Maybe LanguageManager
forall a. a -> Maybe a
P.Just (LanguageManager -> Maybe LanguageManager)
-> IO LanguageManager -> IO (Maybe LanguageManager)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr LanguageManager -> LanguageManager)
-> Ptr LanguageManager -> IO LanguageManager
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr LanguageManager -> LanguageManager
LanguageManager Ptr LanguageManager
ptr
        else Maybe LanguageManager -> IO (Maybe LanguageManager)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe LanguageManager
forall a. Maybe a
P.Nothing
        
    

#if defined(ENABLE_OVERLOADING)
type family ResolveLanguageManagerMethod (t :: Symbol) (o :: *) :: * where
    ResolveLanguageManagerMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveLanguageManagerMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveLanguageManagerMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveLanguageManagerMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveLanguageManagerMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveLanguageManagerMethod "guessLanguage" o = LanguageManagerGuessLanguageMethodInfo
    ResolveLanguageManagerMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveLanguageManagerMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveLanguageManagerMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveLanguageManagerMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveLanguageManagerMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveLanguageManagerMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveLanguageManagerMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveLanguageManagerMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveLanguageManagerMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveLanguageManagerMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveLanguageManagerMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveLanguageManagerMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveLanguageManagerMethod "getLanguage" o = LanguageManagerGetLanguageMethodInfo
    ResolveLanguageManagerMethod "getLanguageIds" o = LanguageManagerGetLanguageIdsMethodInfo
    ResolveLanguageManagerMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveLanguageManagerMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveLanguageManagerMethod "getSearchPath" o = LanguageManagerGetSearchPathMethodInfo
    ResolveLanguageManagerMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveLanguageManagerMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveLanguageManagerMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveLanguageManagerMethod "setSearchPath" o = LanguageManagerSetSearchPathMethodInfo
    ResolveLanguageManagerMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveLanguageManagerMethod t LanguageManager, O.OverloadedMethod info LanguageManager p) => OL.IsLabel t (LanguageManager -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod @info
#else
    fromLabel _ = O.overloadedMethod @info
#endif

#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveLanguageManagerMethod t LanguageManager, O.OverloadedMethod info LanguageManager p, R.HasField t LanguageManager p) => R.HasField t LanguageManager p where
    getField = O.overloadedMethod @info

#endif

instance (info ~ ResolveLanguageManagerMethod t LanguageManager, O.OverloadedMethodInfo info LanguageManager) => OL.IsLabel t (O.MethodProxy info LanguageManager) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.MethodProxy
#else
    fromLabel _ = O.MethodProxy
#endif

#endif

-- VVV Prop "language-ids"
   -- Type: TCArray True (-1) (-1) (TBasicType TUTF8)
   -- Flags: [PropertyReadable]
   -- Nullable: (Just True,Nothing)

-- | Get the value of the “@language-ids@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' languageManager #languageIds
-- @
getLanguageManagerLanguageIds :: (MonadIO m, IsLanguageManager o) => o -> m (Maybe [T.Text])
getLanguageManagerLanguageIds :: forall (m :: * -> *) o.
(MonadIO m, IsLanguageManager o) =>
o -> m (Maybe [Text])
getLanguageManagerLanguageIds o
obj = IO (Maybe [Text]) -> m (Maybe [Text])
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe [Text]) -> m (Maybe [Text]))
-> IO (Maybe [Text]) -> m (Maybe [Text])
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe [Text])
forall a. GObject a => a -> String -> IO (Maybe [Text])
B.Properties.getObjectPropertyStringArray o
obj String
"language-ids"

#if defined(ENABLE_OVERLOADING)
data LanguageManagerLanguageIdsPropertyInfo
instance AttrInfo LanguageManagerLanguageIdsPropertyInfo where
    type AttrAllowedOps LanguageManagerLanguageIdsPropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint LanguageManagerLanguageIdsPropertyInfo = IsLanguageManager
    type AttrSetTypeConstraint LanguageManagerLanguageIdsPropertyInfo = (~) ()
    type AttrTransferTypeConstraint LanguageManagerLanguageIdsPropertyInfo = (~) ()
    type AttrTransferType LanguageManagerLanguageIdsPropertyInfo = ()
    type AttrGetType LanguageManagerLanguageIdsPropertyInfo = (Maybe [T.Text])
    type AttrLabel LanguageManagerLanguageIdsPropertyInfo = "language-ids"
    type AttrOrigin LanguageManagerLanguageIdsPropertyInfo = LanguageManager
    attrGet = getLanguageManagerLanguageIds
    attrSet = undefined
    attrTransfer _ = undefined
    attrConstruct = undefined
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Objects.LanguageManager.languageIds"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-3.0.26/docs/GI-GtkSource-Objects-LanguageManager.html#g:attr:languageIds"
        })
#endif

-- VVV Prop "search-path"
   -- Type: TCArray True (-1) (-1) (TBasicType TUTF8)
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Just False,Just True)

-- | Get the value of the “@search-path@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' languageManager #searchPath
-- @
getLanguageManagerSearchPath :: (MonadIO m, IsLanguageManager o) => o -> m [T.Text]
getLanguageManagerSearchPath :: forall (m :: * -> *) o.
(MonadIO m, IsLanguageManager o) =>
o -> m [Text]
getLanguageManagerSearchPath o
obj = IO [Text] -> m [Text]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe [Text]) -> IO [Text]
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getLanguageManagerSearchPath" (IO (Maybe [Text]) -> IO [Text]) -> IO (Maybe [Text]) -> IO [Text]
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe [Text])
forall a. GObject a => a -> String -> IO (Maybe [Text])
B.Properties.getObjectPropertyStringArray o
obj String
"search-path"

-- | Set the value of the “@search-path@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' languageManager [ #searchPath 'Data.GI.Base.Attributes.:=' value ]
-- @
setLanguageManagerSearchPath :: (MonadIO m, IsLanguageManager o) => o -> [T.Text] -> m ()
setLanguageManagerSearchPath :: forall (m :: * -> *) o.
(MonadIO m, IsLanguageManager o) =>
o -> [Text] -> m ()
setLanguageManagerSearchPath o
obj [Text]
val = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    o -> String -> Maybe [Text] -> IO ()
forall a. GObject a => a -> String -> Maybe [Text] -> IO ()
B.Properties.setObjectPropertyStringArray o
obj String
"search-path" ([Text] -> Maybe [Text]
forall a. a -> Maybe a
Just [Text]
val)

-- | Construct a `GValueConstruct` with valid value for the “@search-path@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructLanguageManagerSearchPath :: (IsLanguageManager o, MIO.MonadIO m) => [T.Text] -> m (GValueConstruct o)
constructLanguageManagerSearchPath :: forall o (m :: * -> *).
(IsLanguageManager o, MonadIO m) =>
[Text] -> m (GValueConstruct o)
constructLanguageManagerSearchPath [Text]
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
    IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe [Text] -> IO (GValueConstruct o)
forall o. String -> Maybe [Text] -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyStringArray String
"search-path" ([Text] -> Maybe [Text]
forall a. a -> Maybe a
P.Just [Text]
val)

-- | Set the value of the “@search-path@” property to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #searchPath
-- @
clearLanguageManagerSearchPath :: (MonadIO m, IsLanguageManager o) => o -> m ()
clearLanguageManagerSearchPath :: forall (m :: * -> *) o.
(MonadIO m, IsLanguageManager o) =>
o -> m ()
clearLanguageManagerSearchPath o
obj = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe [Text] -> IO ()
forall a. GObject a => a -> String -> Maybe [Text] -> IO ()
B.Properties.setObjectPropertyStringArray o
obj String
"search-path" (Maybe [Text]
forall a. Maybe a
Nothing :: Maybe [T.Text])

#if defined(ENABLE_OVERLOADING)
data LanguageManagerSearchPathPropertyInfo
instance AttrInfo LanguageManagerSearchPathPropertyInfo where
    type AttrAllowedOps LanguageManagerSearchPathPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint LanguageManagerSearchPathPropertyInfo = IsLanguageManager
    type AttrSetTypeConstraint LanguageManagerSearchPathPropertyInfo = (~) [T.Text]
    type AttrTransferTypeConstraint LanguageManagerSearchPathPropertyInfo = (~) [T.Text]
    type AttrTransferType LanguageManagerSearchPathPropertyInfo = [T.Text]
    type AttrGetType LanguageManagerSearchPathPropertyInfo = [T.Text]
    type AttrLabel LanguageManagerSearchPathPropertyInfo = "search-path"
    type AttrOrigin LanguageManagerSearchPathPropertyInfo = LanguageManager
    attrGet = getLanguageManagerSearchPath
    attrSet = setLanguageManagerSearchPath
    attrTransfer _ v = do
        return v
    attrConstruct = constructLanguageManagerSearchPath
    attrClear = clearLanguageManagerSearchPath
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Objects.LanguageManager.searchPath"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-3.0.26/docs/GI-GtkSource-Objects-LanguageManager.html#g:attr:searchPath"
        })
#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList LanguageManager
type instance O.AttributeList LanguageManager = LanguageManagerAttributeList
type LanguageManagerAttributeList = ('[ '("languageIds", LanguageManagerLanguageIdsPropertyInfo), '("searchPath", LanguageManagerSearchPathPropertyInfo)] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING)
languageManagerLanguageIds :: AttrLabelProxy "languageIds"
languageManagerLanguageIds = AttrLabelProxy

languageManagerSearchPath :: AttrLabelProxy "searchPath"
languageManagerSearchPath = AttrLabelProxy

#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList LanguageManager = LanguageManagerSignalList
type LanguageManagerSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

#endif

-- method LanguageManager::new
-- method type : Constructor
-- Args: []
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "GtkSource" , name = "LanguageManager" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_language_manager_new" gtk_source_language_manager_new :: 
    IO (Ptr LanguageManager)

-- | Creates a new language manager. If you do not need more than one language
-- manager or a private language manager instance then use
-- 'GI.GtkSource.Objects.LanguageManager.languageManagerGetDefault' instead.
languageManagerNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m LanguageManager
    -- ^ __Returns:__ a new t'GI.GtkSource.Objects.LanguageManager.LanguageManager'.
languageManagerNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
m LanguageManager
languageManagerNew  = IO LanguageManager -> m LanguageManager
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO LanguageManager -> m LanguageManager)
-> IO LanguageManager -> m LanguageManager
forall a b. (a -> b) -> a -> b
$ do
    Ptr LanguageManager
result <- IO (Ptr LanguageManager)
gtk_source_language_manager_new
    Text -> Ptr LanguageManager -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"languageManagerNew" Ptr LanguageManager
result
    LanguageManager
result' <- ((ManagedPtr LanguageManager -> LanguageManager)
-> Ptr LanguageManager -> IO LanguageManager
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr LanguageManager -> LanguageManager
LanguageManager) Ptr LanguageManager
result
    LanguageManager -> IO LanguageManager
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return LanguageManager
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method LanguageManager::get_language
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "lm"
--           , argType =
--               TInterface
--                 Name { namespace = "GtkSource" , name = "LanguageManager" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceLanguageManager."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "id"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a language id." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "GtkSource" , name = "Language" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_language_manager_get_language" gtk_source_language_manager_get_language :: 
    Ptr LanguageManager ->                  -- lm : TInterface (Name {namespace = "GtkSource", name = "LanguageManager"})
    CString ->                              -- id : TBasicType TUTF8
    IO (Ptr GtkSource.Language.Language)

-- | Gets the t'GI.GtkSource.Objects.Language.Language' identified by the given /@id@/ in the language
-- manager.
languageManagerGetLanguage ::
    (B.CallStack.HasCallStack, MonadIO m, IsLanguageManager a) =>
    a
    -- ^ /@lm@/: a t'GI.GtkSource.Objects.LanguageManager.LanguageManager'.
    -> T.Text
    -- ^ /@id@/: a language id.
    -> m (Maybe GtkSource.Language.Language)
    -- ^ __Returns:__ a t'GI.GtkSource.Objects.Language.Language', or 'P.Nothing'
    -- if there is no language identified by the given /@id@/. Return value is
    -- owned by /@lm@/ and should not be freed.
languageManagerGetLanguage :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsLanguageManager a) =>
a -> Text -> m (Maybe Language)
languageManagerGetLanguage a
lm Text
id = IO (Maybe Language) -> m (Maybe Language)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Language) -> m (Maybe Language))
-> IO (Maybe Language) -> m (Maybe Language)
forall a b. (a -> b) -> a -> b
$ do
    Ptr LanguageManager
lm' <- a -> IO (Ptr LanguageManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
lm
    CString
id' <- Text -> IO CString
textToCString Text
id
    Ptr Language
result <- Ptr LanguageManager -> CString -> IO (Ptr Language)
gtk_source_language_manager_get_language Ptr LanguageManager
lm' CString
id'
    Maybe Language
maybeResult <- Ptr Language
-> (Ptr Language -> IO Language) -> IO (Maybe Language)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Language
result ((Ptr Language -> IO Language) -> IO (Maybe Language))
-> (Ptr Language -> IO Language) -> IO (Maybe Language)
forall a b. (a -> b) -> a -> b
$ \Ptr Language
result' -> do
        Language
result'' <- ((ManagedPtr Language -> Language) -> Ptr Language -> IO Language
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Language -> Language
GtkSource.Language.Language) Ptr Language
result'
        Language -> IO Language
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Language
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
lm
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
id'
    Maybe Language -> IO (Maybe Language)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Language
maybeResult

#if defined(ENABLE_OVERLOADING)
data LanguageManagerGetLanguageMethodInfo
instance (signature ~ (T.Text -> m (Maybe GtkSource.Language.Language)), MonadIO m, IsLanguageManager a) => O.OverloadedMethod LanguageManagerGetLanguageMethodInfo a signature where
    overloadedMethod = languageManagerGetLanguage

instance O.OverloadedMethodInfo LanguageManagerGetLanguageMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Objects.LanguageManager.languageManagerGetLanguage",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-3.0.26/docs/GI-GtkSource-Objects-LanguageManager.html#v:languageManagerGetLanguage"
        })


#endif

-- method LanguageManager::get_language_ids
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "lm"
--           , argType =
--               TInterface
--                 Name { namespace = "GtkSource" , name = "LanguageManager" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceLanguageManager."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TCArray True (-1) (-1) (TBasicType TUTF8))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_language_manager_get_language_ids" gtk_source_language_manager_get_language_ids :: 
    Ptr LanguageManager ->                  -- lm : TInterface (Name {namespace = "GtkSource", name = "LanguageManager"})
    IO (Ptr CString)

-- | Returns the ids of the available languages.
languageManagerGetLanguageIds ::
    (B.CallStack.HasCallStack, MonadIO m, IsLanguageManager a) =>
    a
    -- ^ /@lm@/: a t'GI.GtkSource.Objects.LanguageManager.LanguageManager'.
    -> m (Maybe [T.Text])
    -- ^ __Returns:__ 
    -- a 'P.Nothing'-terminated array of strings containing the ids of the available
    -- languages or 'P.Nothing' if no language is available.
    -- The array is sorted alphabetically according to the language name.
    -- The array is owned by /@lm@/ and must not be modified.
languageManagerGetLanguageIds :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsLanguageManager a) =>
a -> m (Maybe [Text])
languageManagerGetLanguageIds a
lm = IO (Maybe [Text]) -> m (Maybe [Text])
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe [Text]) -> m (Maybe [Text]))
-> IO (Maybe [Text]) -> m (Maybe [Text])
forall a b. (a -> b) -> a -> b
$ do
    Ptr LanguageManager
lm' <- a -> IO (Ptr LanguageManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
lm
    Ptr CString
result <- Ptr LanguageManager -> IO (Ptr CString)
gtk_source_language_manager_get_language_ids Ptr LanguageManager
lm'
    Maybe [Text]
maybeResult <- Ptr CString -> (Ptr CString -> IO [Text]) -> IO (Maybe [Text])
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr CString
result ((Ptr CString -> IO [Text]) -> IO (Maybe [Text]))
-> (Ptr CString -> IO [Text]) -> IO (Maybe [Text])
forall a b. (a -> b) -> a -> b
$ \Ptr CString
result' -> do
        [Text]
result'' <- HasCallStack => Ptr CString -> IO [Text]
Ptr CString -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr CString
result'
        [Text] -> IO [Text]
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
lm
    Maybe [Text] -> IO (Maybe [Text])
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe [Text]
maybeResult

#if defined(ENABLE_OVERLOADING)
data LanguageManagerGetLanguageIdsMethodInfo
instance (signature ~ (m (Maybe [T.Text])), MonadIO m, IsLanguageManager a) => O.OverloadedMethod LanguageManagerGetLanguageIdsMethodInfo a signature where
    overloadedMethod = languageManagerGetLanguageIds

instance O.OverloadedMethodInfo LanguageManagerGetLanguageIdsMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Objects.LanguageManager.languageManagerGetLanguageIds",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-3.0.26/docs/GI-GtkSource-Objects-LanguageManager.html#v:languageManagerGetLanguageIds"
        })


#endif

-- method LanguageManager::get_search_path
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "lm"
--           , argType =
--               TInterface
--                 Name { namespace = "GtkSource" , name = "LanguageManager" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceLanguageManager."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TCArray True (-1) (-1) (TBasicType TUTF8))
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_language_manager_get_search_path" gtk_source_language_manager_get_search_path :: 
    Ptr LanguageManager ->                  -- lm : TInterface (Name {namespace = "GtkSource", name = "LanguageManager"})
    IO (Ptr CString)

-- | Gets the list directories where /@lm@/ looks for language files.
languageManagerGetSearchPath ::
    (B.CallStack.HasCallStack, MonadIO m, IsLanguageManager a) =>
    a
    -- ^ /@lm@/: a t'GI.GtkSource.Objects.LanguageManager.LanguageManager'.
    -> m [T.Text]
    -- ^ __Returns:__ 'P.Nothing'-terminated array
    -- containg a list of language files directories.
    -- The array is owned by /@lm@/ and must not be modified.
languageManagerGetSearchPath :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsLanguageManager a) =>
a -> m [Text]
languageManagerGetSearchPath a
lm = IO [Text] -> m [Text]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
    Ptr LanguageManager
lm' <- a -> IO (Ptr LanguageManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
lm
    Ptr CString
result <- Ptr LanguageManager -> IO (Ptr CString)
gtk_source_language_manager_get_search_path Ptr LanguageManager
lm'
    Text -> Ptr CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"languageManagerGetSearchPath" Ptr CString
result
    [Text]
result' <- HasCallStack => Ptr CString -> IO [Text]
Ptr CString -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr CString
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
lm
    [Text] -> IO [Text]
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result'

#if defined(ENABLE_OVERLOADING)
data LanguageManagerGetSearchPathMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m, IsLanguageManager a) => O.OverloadedMethod LanguageManagerGetSearchPathMethodInfo a signature where
    overloadedMethod = languageManagerGetSearchPath

instance O.OverloadedMethodInfo LanguageManagerGetSearchPathMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Objects.LanguageManager.languageManagerGetSearchPath",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-3.0.26/docs/GI-GtkSource-Objects-LanguageManager.html#v:languageManagerGetSearchPath"
        })


#endif

-- method LanguageManager::guess_language
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "lm"
--           , argType =
--               TInterface
--                 Name { namespace = "GtkSource" , name = "LanguageManager" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceLanguageManager."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "filename"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "a filename in Glib filename encoding, or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "content_type"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a content type (as in GIO API), or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "GtkSource" , name = "Language" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_language_manager_guess_language" gtk_source_language_manager_guess_language :: 
    Ptr LanguageManager ->                  -- lm : TInterface (Name {namespace = "GtkSource", name = "LanguageManager"})
    CString ->                              -- filename : TBasicType TUTF8
    CString ->                              -- content_type : TBasicType TUTF8
    IO (Ptr GtkSource.Language.Language)

-- | Picks a t'GI.GtkSource.Objects.Language.Language' for given file name and content type,
-- according to the information in lang files. Either /@filename@/ or
-- /@contentType@/ may be 'P.Nothing'. This function can be used as follows:
-- 
-- \<informalexample>\<programlisting>
--   GtkSourceLanguage *lang;
--   lang = gtk_source_language_manager_guess_language (filename, NULL);
--   gtk_source_buffer_set_language (buffer, lang);
-- \<\/programlisting>\<\/informalexample>
-- 
-- or
-- 
-- \<informalexample>\<programlisting>
--   GtkSourceLanguage *lang = NULL;
--   gboolean result_uncertain;
--   gchar *content_type;
-- 
--   content_type = g_content_type_guess (filename, NULL, 0, &result_uncertain);
--   if (result_uncertain)
--     {
--       g_free (content_type);
--       content_type = NULL;
--     }
-- 
--   lang = gtk_source_language_manager_guess_language (manager, filename, content_type);
--   gtk_source_buffer_set_language (buffer, lang);
-- 
--   g_free (content_type);
-- \<\/programlisting>\<\/informalexample>
-- 
-- etc. Use 'GI.GtkSource.Objects.Language.languageGetMimeTypes' and 'GI.GtkSource.Objects.Language.languageGetGlobs'
-- if you need full control over file -> language mapping.
-- 
-- /Since: 2.4/
languageManagerGuessLanguage ::
    (B.CallStack.HasCallStack, MonadIO m, IsLanguageManager a) =>
    a
    -- ^ /@lm@/: a t'GI.GtkSource.Objects.LanguageManager.LanguageManager'.
    -> Maybe (T.Text)
    -- ^ /@filename@/: a filename in Glib filename encoding, or 'P.Nothing'.
    -> Maybe (T.Text)
    -- ^ /@contentType@/: a content type (as in GIO API), or 'P.Nothing'.
    -> m (Maybe GtkSource.Language.Language)
    -- ^ __Returns:__ a t'GI.GtkSource.Objects.Language.Language', or 'P.Nothing' if there
    -- is no suitable language for given /@filename@/ and\/or /@contentType@/. Return
    -- value is owned by /@lm@/ and should not be freed.
languageManagerGuessLanguage :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsLanguageManager a) =>
a -> Maybe Text -> Maybe Text -> m (Maybe Language)
languageManagerGuessLanguage a
lm Maybe Text
filename Maybe Text
contentType = IO (Maybe Language) -> m (Maybe Language)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Language) -> m (Maybe Language))
-> IO (Maybe Language) -> m (Maybe Language)
forall a b. (a -> b) -> a -> b
$ do
    Ptr LanguageManager
lm' <- a -> IO (Ptr LanguageManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
lm
    CString
maybeFilename <- case Maybe Text
filename of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
        Just Text
jFilename -> do
            CString
jFilename' <- Text -> IO CString
textToCString Text
jFilename
            CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jFilename'
    CString
maybeContentType <- case Maybe Text
contentType of
        Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
        Just Text
jContentType -> do
            CString
jContentType' <- Text -> IO CString
textToCString Text
jContentType
            CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jContentType'
    Ptr Language
result <- Ptr LanguageManager -> CString -> CString -> IO (Ptr Language)
gtk_source_language_manager_guess_language Ptr LanguageManager
lm' CString
maybeFilename CString
maybeContentType
    Maybe Language
maybeResult <- Ptr Language
-> (Ptr Language -> IO Language) -> IO (Maybe Language)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Language
result ((Ptr Language -> IO Language) -> IO (Maybe Language))
-> (Ptr Language -> IO Language) -> IO (Maybe Language)
forall a b. (a -> b) -> a -> b
$ \Ptr Language
result' -> do
        Language
result'' <- ((ManagedPtr Language -> Language) -> Ptr Language -> IO Language
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Language -> Language
GtkSource.Language.Language) Ptr Language
result'
        Language -> IO Language
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Language
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
lm
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeFilename
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeContentType
    Maybe Language -> IO (Maybe Language)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Language
maybeResult

#if defined(ENABLE_OVERLOADING)
data LanguageManagerGuessLanguageMethodInfo
instance (signature ~ (Maybe (T.Text) -> Maybe (T.Text) -> m (Maybe GtkSource.Language.Language)), MonadIO m, IsLanguageManager a) => O.OverloadedMethod LanguageManagerGuessLanguageMethodInfo a signature where
    overloadedMethod = languageManagerGuessLanguage

instance O.OverloadedMethodInfo LanguageManagerGuessLanguageMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Objects.LanguageManager.languageManagerGuessLanguage",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-3.0.26/docs/GI-GtkSource-Objects-LanguageManager.html#v:languageManagerGuessLanguage"
        })


#endif

-- method LanguageManager::set_search_path
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "lm"
--           , argType =
--               TInterface
--                 Name { namespace = "GtkSource" , name = "LanguageManager" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GtkSourceLanguageManager."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "dirs"
--           , argType = TCArray True (-1) (-1) (TBasicType TUTF8)
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "\na %NULL-terminated array of strings or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_language_manager_set_search_path" gtk_source_language_manager_set_search_path :: 
    Ptr LanguageManager ->                  -- lm : TInterface (Name {namespace = "GtkSource", name = "LanguageManager"})
    Ptr CString ->                          -- dirs : TCArray True (-1) (-1) (TBasicType TUTF8)
    IO ()

-- | Sets the list of directories where the /@lm@/ looks for
-- language files.
-- If /@dirs@/ is 'P.Nothing', the search path is reset to default.
-- 
-- \<note>
--   \<para>
--     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 t'GI.GtkSource.Objects.LanguageManager.LanguageManager',
--     you have to call this function right after creating it.
--   \<\/para>
-- \<\/note>
languageManagerSetSearchPath ::
    (B.CallStack.HasCallStack, MonadIO m, IsLanguageManager a) =>
    a
    -- ^ /@lm@/: a t'GI.GtkSource.Objects.LanguageManager.LanguageManager'.
    -> Maybe ([T.Text])
    -- ^ /@dirs@/: 
    -- a 'P.Nothing'-terminated array of strings or 'P.Nothing'.
    -> m ()
languageManagerSetSearchPath :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsLanguageManager a) =>
a -> Maybe [Text] -> m ()
languageManagerSetSearchPath a
lm Maybe [Text]
dirs = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr LanguageManager
lm' <- a -> IO (Ptr LanguageManager)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
lm
    Ptr CString
maybeDirs <- case Maybe [Text]
dirs of
        Maybe [Text]
Nothing -> Ptr CString -> IO (Ptr CString)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
forall a. Ptr a
nullPtr
        Just [Text]
jDirs -> do
            Ptr CString
jDirs' <- [Text] -> IO (Ptr CString)
packZeroTerminatedUTF8CArray [Text]
jDirs
            Ptr CString -> IO (Ptr CString)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr CString
jDirs'
    Ptr LanguageManager -> Ptr CString -> IO ()
gtk_source_language_manager_set_search_path Ptr LanguageManager
lm' Ptr CString
maybeDirs
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
lm
    (CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeDirs
    Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
maybeDirs
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data LanguageManagerSetSearchPathMethodInfo
instance (signature ~ (Maybe ([T.Text]) -> m ()), MonadIO m, IsLanguageManager a) => O.OverloadedMethod LanguageManagerSetSearchPathMethodInfo a signature where
    overloadedMethod = languageManagerSetSearchPath

instance O.OverloadedMethodInfo LanguageManagerSetSearchPathMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.GtkSource.Objects.LanguageManager.languageManagerSetSearchPath",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gtksource-3.0.26/docs/GI-GtkSource-Objects-LanguageManager.html#v:languageManagerSetSearchPath"
        })


#endif

-- method LanguageManager::get_default
-- method type : MemberFunction
-- Args: []
-- Lengths: []
-- returnType: Just
--               (TInterface
--                  Name { namespace = "GtkSource" , name = "LanguageManager" })
-- throws : False
-- Skip return : False

foreign import ccall "gtk_source_language_manager_get_default" gtk_source_language_manager_get_default :: 
    IO (Ptr LanguageManager)

-- | Returns the default t'GI.GtkSource.Objects.LanguageManager.LanguageManager' instance.
languageManagerGetDefault ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m LanguageManager
    -- ^ __Returns:__ a t'GI.GtkSource.Objects.LanguageManager.LanguageManager'.
    -- Return value is owned by GtkSourceView library and must not be unref\'ed.
languageManagerGetDefault :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
m LanguageManager
languageManagerGetDefault  = IO LanguageManager -> m LanguageManager
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO LanguageManager -> m LanguageManager)
-> IO LanguageManager -> m LanguageManager
forall a b. (a -> b) -> a -> b
$ do
    Ptr LanguageManager
result <- IO (Ptr LanguageManager)
gtk_source_language_manager_get_default
    Text -> Ptr LanguageManager -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"languageManagerGetDefault" Ptr LanguageManager
result
    LanguageManager
result' <- ((ManagedPtr LanguageManager -> LanguageManager)
-> Ptr LanguageManager -> IO LanguageManager
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr LanguageManager -> LanguageManager
LanguageManager) Ptr LanguageManager
result
    LanguageManager -> IO LanguageManager
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return LanguageManager
result'

#if defined(ENABLE_OVERLOADING)
#endif