#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.GtkSource.Objects.FileLoader
(
FileLoader(..) ,
IsFileLoader ,
toFileLoader ,
noFileLoader ,
#if ENABLE_OVERLOADING
FileLoaderGetBufferMethodInfo ,
#endif
fileLoaderGetBuffer ,
#if ENABLE_OVERLOADING
FileLoaderGetCompressionTypeMethodInfo ,
#endif
fileLoaderGetCompressionType ,
#if ENABLE_OVERLOADING
FileLoaderGetEncodingMethodInfo ,
#endif
fileLoaderGetEncoding ,
#if ENABLE_OVERLOADING
FileLoaderGetFileMethodInfo ,
#endif
fileLoaderGetFile ,
#if ENABLE_OVERLOADING
FileLoaderGetInputStreamMethodInfo ,
#endif
fileLoaderGetInputStream ,
#if ENABLE_OVERLOADING
FileLoaderGetLocationMethodInfo ,
#endif
fileLoaderGetLocation ,
#if ENABLE_OVERLOADING
FileLoaderGetNewlineTypeMethodInfo ,
#endif
fileLoaderGetNewlineType ,
#if ENABLE_OVERLOADING
FileLoaderLoadAsyncMethodInfo ,
#endif
fileLoaderLoadAsync ,
#if ENABLE_OVERLOADING
FileLoaderLoadFinishMethodInfo ,
#endif
fileLoaderLoadFinish ,
fileLoaderNew ,
fileLoaderNewFromStream ,
#if ENABLE_OVERLOADING
FileLoaderSetCandidateEncodingsMethodInfo,
#endif
fileLoaderSetCandidateEncodings ,
#if ENABLE_OVERLOADING
FileLoaderBufferPropertyInfo ,
#endif
constructFileLoaderBuffer ,
#if ENABLE_OVERLOADING
fileLoaderBuffer ,
#endif
getFileLoaderBuffer ,
#if ENABLE_OVERLOADING
FileLoaderFilePropertyInfo ,
#endif
constructFileLoaderFile ,
#if ENABLE_OVERLOADING
fileLoaderFile ,
#endif
getFileLoaderFile ,
#if ENABLE_OVERLOADING
FileLoaderInputStreamPropertyInfo ,
#endif
constructFileLoaderInputStream ,
#if ENABLE_OVERLOADING
fileLoaderInputStream ,
#endif
getFileLoaderInputStream ,
#if ENABLE_OVERLOADING
FileLoaderLocationPropertyInfo ,
#endif
constructFileLoaderLocation ,
#if ENABLE_OVERLOADING
fileLoaderLocation ,
#endif
getFileLoaderLocation ,
) 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.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
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.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 GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Interfaces.File as Gio.File
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.InputStream as Gio.InputStream
import {-# SOURCE #-} qualified GI.GtkSource.Enums as GtkSource.Enums
import {-# SOURCE #-} qualified GI.GtkSource.Objects.Buffer as GtkSource.Buffer
import {-# SOURCE #-} qualified GI.GtkSource.Objects.File as GtkSource.File
import {-# SOURCE #-} qualified GI.GtkSource.Structs.Encoding as GtkSource.Encoding
newtype FileLoader = FileLoader (ManagedPtr FileLoader)
foreign import ccall "gtk_source_file_loader_get_type"
c_gtk_source_file_loader_get_type :: IO GType
instance GObject FileLoader where
gobjectType = c_gtk_source_file_loader_get_type
class (GObject o, O.IsDescendantOf FileLoader o) => IsFileLoader o
instance (GObject o, O.IsDescendantOf FileLoader o) => IsFileLoader o
instance O.HasParentTypes FileLoader
type instance O.ParentTypes FileLoader = '[GObject.Object.Object]
toFileLoader :: (MonadIO m, IsFileLoader o) => o -> m FileLoader
toFileLoader = liftIO . unsafeCastTo FileLoader
noFileLoader :: Maybe FileLoader
noFileLoader = Nothing
#if ENABLE_OVERLOADING
type family ResolveFileLoaderMethod (t :: Symbol) (o :: *) :: * where
ResolveFileLoaderMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveFileLoaderMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveFileLoaderMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveFileLoaderMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveFileLoaderMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveFileLoaderMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveFileLoaderMethod "loadAsync" o = FileLoaderLoadAsyncMethodInfo
ResolveFileLoaderMethod "loadFinish" o = FileLoaderLoadFinishMethodInfo
ResolveFileLoaderMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveFileLoaderMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveFileLoaderMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveFileLoaderMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveFileLoaderMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveFileLoaderMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveFileLoaderMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveFileLoaderMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveFileLoaderMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveFileLoaderMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveFileLoaderMethod "getBuffer" o = FileLoaderGetBufferMethodInfo
ResolveFileLoaderMethod "getCompressionType" o = FileLoaderGetCompressionTypeMethodInfo
ResolveFileLoaderMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveFileLoaderMethod "getEncoding" o = FileLoaderGetEncodingMethodInfo
ResolveFileLoaderMethod "getFile" o = FileLoaderGetFileMethodInfo
ResolveFileLoaderMethod "getInputStream" o = FileLoaderGetInputStreamMethodInfo
ResolveFileLoaderMethod "getLocation" o = FileLoaderGetLocationMethodInfo
ResolveFileLoaderMethod "getNewlineType" o = FileLoaderGetNewlineTypeMethodInfo
ResolveFileLoaderMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveFileLoaderMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveFileLoaderMethod "setCandidateEncodings" o = FileLoaderSetCandidateEncodingsMethodInfo
ResolveFileLoaderMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveFileLoaderMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveFileLoaderMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveFileLoaderMethod t FileLoader, O.MethodInfo info FileLoader p) => OL.IsLabel t (FileLoader -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
getFileLoaderBuffer :: (MonadIO m, IsFileLoader o) => o -> m GtkSource.Buffer.Buffer
getFileLoaderBuffer obj = liftIO $ checkUnexpectedNothing "getFileLoaderBuffer" $ B.Properties.getObjectPropertyObject obj "buffer" GtkSource.Buffer.Buffer
constructFileLoaderBuffer :: (IsFileLoader o, GtkSource.Buffer.IsBuffer a) => a -> IO (GValueConstruct o)
constructFileLoaderBuffer val = B.Properties.constructObjectPropertyObject "buffer" (Just val)
#if ENABLE_OVERLOADING
data FileLoaderBufferPropertyInfo
instance AttrInfo FileLoaderBufferPropertyInfo where
type AttrAllowedOps FileLoaderBufferPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint FileLoaderBufferPropertyInfo = GtkSource.Buffer.IsBuffer
type AttrBaseTypeConstraint FileLoaderBufferPropertyInfo = IsFileLoader
type AttrGetType FileLoaderBufferPropertyInfo = GtkSource.Buffer.Buffer
type AttrLabel FileLoaderBufferPropertyInfo = "buffer"
type AttrOrigin FileLoaderBufferPropertyInfo = FileLoader
attrGet _ = getFileLoaderBuffer
attrSet _ = undefined
attrConstruct _ = constructFileLoaderBuffer
attrClear _ = undefined
#endif
getFileLoaderFile :: (MonadIO m, IsFileLoader o) => o -> m GtkSource.File.File
getFileLoaderFile obj = liftIO $ checkUnexpectedNothing "getFileLoaderFile" $ B.Properties.getObjectPropertyObject obj "file" GtkSource.File.File
constructFileLoaderFile :: (IsFileLoader o, GtkSource.File.IsFile a) => a -> IO (GValueConstruct o)
constructFileLoaderFile val = B.Properties.constructObjectPropertyObject "file" (Just val)
#if ENABLE_OVERLOADING
data FileLoaderFilePropertyInfo
instance AttrInfo FileLoaderFilePropertyInfo where
type AttrAllowedOps FileLoaderFilePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint FileLoaderFilePropertyInfo = GtkSource.File.IsFile
type AttrBaseTypeConstraint FileLoaderFilePropertyInfo = IsFileLoader
type AttrGetType FileLoaderFilePropertyInfo = GtkSource.File.File
type AttrLabel FileLoaderFilePropertyInfo = "file"
type AttrOrigin FileLoaderFilePropertyInfo = FileLoader
attrGet _ = getFileLoaderFile
attrSet _ = undefined
attrConstruct _ = constructFileLoaderFile
attrClear _ = undefined
#endif
getFileLoaderInputStream :: (MonadIO m, IsFileLoader o) => o -> m (Maybe Gio.InputStream.InputStream)
getFileLoaderInputStream obj = liftIO $ B.Properties.getObjectPropertyObject obj "input-stream" Gio.InputStream.InputStream
constructFileLoaderInputStream :: (IsFileLoader o, Gio.InputStream.IsInputStream a) => a -> IO (GValueConstruct o)
constructFileLoaderInputStream val = B.Properties.constructObjectPropertyObject "input-stream" (Just val)
#if ENABLE_OVERLOADING
data FileLoaderInputStreamPropertyInfo
instance AttrInfo FileLoaderInputStreamPropertyInfo where
type AttrAllowedOps FileLoaderInputStreamPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint FileLoaderInputStreamPropertyInfo = Gio.InputStream.IsInputStream
type AttrBaseTypeConstraint FileLoaderInputStreamPropertyInfo = IsFileLoader
type AttrGetType FileLoaderInputStreamPropertyInfo = (Maybe Gio.InputStream.InputStream)
type AttrLabel FileLoaderInputStreamPropertyInfo = "input-stream"
type AttrOrigin FileLoaderInputStreamPropertyInfo = FileLoader
attrGet _ = getFileLoaderInputStream
attrSet _ = undefined
attrConstruct _ = constructFileLoaderInputStream
attrClear _ = undefined
#endif
getFileLoaderLocation :: (MonadIO m, IsFileLoader o) => o -> m (Maybe Gio.File.File)
getFileLoaderLocation obj = liftIO $ B.Properties.getObjectPropertyObject obj "location" Gio.File.File
constructFileLoaderLocation :: (IsFileLoader o, Gio.File.IsFile a) => a -> IO (GValueConstruct o)
constructFileLoaderLocation val = B.Properties.constructObjectPropertyObject "location" (Just val)
#if ENABLE_OVERLOADING
data FileLoaderLocationPropertyInfo
instance AttrInfo FileLoaderLocationPropertyInfo where
type AttrAllowedOps FileLoaderLocationPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint FileLoaderLocationPropertyInfo = Gio.File.IsFile
type AttrBaseTypeConstraint FileLoaderLocationPropertyInfo = IsFileLoader
type AttrGetType FileLoaderLocationPropertyInfo = (Maybe Gio.File.File)
type AttrLabel FileLoaderLocationPropertyInfo = "location"
type AttrOrigin FileLoaderLocationPropertyInfo = FileLoader
attrGet _ = getFileLoaderLocation
attrSet _ = undefined
attrConstruct _ = constructFileLoaderLocation
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList FileLoader
type instance O.AttributeList FileLoader = FileLoaderAttributeList
type FileLoaderAttributeList = ('[ '("buffer", FileLoaderBufferPropertyInfo), '("file", FileLoaderFilePropertyInfo), '("inputStream", FileLoaderInputStreamPropertyInfo), '("location", FileLoaderLocationPropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
fileLoaderBuffer :: AttrLabelProxy "buffer"
fileLoaderBuffer = AttrLabelProxy
fileLoaderFile :: AttrLabelProxy "file"
fileLoaderFile = AttrLabelProxy
fileLoaderInputStream :: AttrLabelProxy "inputStream"
fileLoaderInputStream = AttrLabelProxy
fileLoaderLocation :: AttrLabelProxy "location"
fileLoaderLocation = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList FileLoader = FileLoaderSignalList
type FileLoaderSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_source_file_loader_new" gtk_source_file_loader_new ::
Ptr GtkSource.Buffer.Buffer ->
Ptr GtkSource.File.File ->
IO (Ptr FileLoader)
fileLoaderNew ::
(B.CallStack.HasCallStack, MonadIO m, GtkSource.Buffer.IsBuffer a, GtkSource.File.IsFile b) =>
a
-> b
-> m FileLoader
fileLoaderNew buffer file = liftIO $ do
buffer' <- unsafeManagedPtrCastPtr buffer
file' <- unsafeManagedPtrCastPtr file
result <- gtk_source_file_loader_new buffer' file'
checkUnexpectedReturnNULL "fileLoaderNew" result
result' <- (wrapObject FileLoader) result
touchManagedPtr buffer
touchManagedPtr file
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "gtk_source_file_loader_new_from_stream" gtk_source_file_loader_new_from_stream ::
Ptr GtkSource.Buffer.Buffer ->
Ptr GtkSource.File.File ->
Ptr Gio.InputStream.InputStream ->
IO (Ptr FileLoader)
fileLoaderNewFromStream ::
(B.CallStack.HasCallStack, MonadIO m, GtkSource.Buffer.IsBuffer a, GtkSource.File.IsFile b, Gio.InputStream.IsInputStream c) =>
a
-> b
-> c
-> m FileLoader
fileLoaderNewFromStream buffer file stream = liftIO $ do
buffer' <- unsafeManagedPtrCastPtr buffer
file' <- unsafeManagedPtrCastPtr file
stream' <- unsafeManagedPtrCastPtr stream
result <- gtk_source_file_loader_new_from_stream buffer' file' stream'
checkUnexpectedReturnNULL "fileLoaderNewFromStream" result
result' <- (wrapObject FileLoader) result
touchManagedPtr buffer
touchManagedPtr file
touchManagedPtr stream
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "gtk_source_file_loader_get_buffer" gtk_source_file_loader_get_buffer ::
Ptr FileLoader ->
IO (Ptr GtkSource.Buffer.Buffer)
fileLoaderGetBuffer ::
(B.CallStack.HasCallStack, MonadIO m, IsFileLoader a) =>
a
-> m GtkSource.Buffer.Buffer
fileLoaderGetBuffer loader = liftIO $ do
loader' <- unsafeManagedPtrCastPtr loader
result <- gtk_source_file_loader_get_buffer loader'
checkUnexpectedReturnNULL "fileLoaderGetBuffer" result
result' <- (newObject GtkSource.Buffer.Buffer) result
touchManagedPtr loader
return result'
#if ENABLE_OVERLOADING
data FileLoaderGetBufferMethodInfo
instance (signature ~ (m GtkSource.Buffer.Buffer), MonadIO m, IsFileLoader a) => O.MethodInfo FileLoaderGetBufferMethodInfo a signature where
overloadedMethod _ = fileLoaderGetBuffer
#endif
foreign import ccall "gtk_source_file_loader_get_compression_type" gtk_source_file_loader_get_compression_type ::
Ptr FileLoader ->
IO CUInt
fileLoaderGetCompressionType ::
(B.CallStack.HasCallStack, MonadIO m, IsFileLoader a) =>
a
-> m GtkSource.Enums.CompressionType
fileLoaderGetCompressionType loader = liftIO $ do
loader' <- unsafeManagedPtrCastPtr loader
result <- gtk_source_file_loader_get_compression_type loader'
let result' = (toEnum . fromIntegral) result
touchManagedPtr loader
return result'
#if ENABLE_OVERLOADING
data FileLoaderGetCompressionTypeMethodInfo
instance (signature ~ (m GtkSource.Enums.CompressionType), MonadIO m, IsFileLoader a) => O.MethodInfo FileLoaderGetCompressionTypeMethodInfo a signature where
overloadedMethod _ = fileLoaderGetCompressionType
#endif
foreign import ccall "gtk_source_file_loader_get_encoding" gtk_source_file_loader_get_encoding ::
Ptr FileLoader ->
IO (Ptr GtkSource.Encoding.Encoding)
fileLoaderGetEncoding ::
(B.CallStack.HasCallStack, MonadIO m, IsFileLoader a) =>
a
-> m GtkSource.Encoding.Encoding
fileLoaderGetEncoding loader = liftIO $ do
loader' <- unsafeManagedPtrCastPtr loader
result <- gtk_source_file_loader_get_encoding loader'
checkUnexpectedReturnNULL "fileLoaderGetEncoding" result
result' <- (newBoxed GtkSource.Encoding.Encoding) result
touchManagedPtr loader
return result'
#if ENABLE_OVERLOADING
data FileLoaderGetEncodingMethodInfo
instance (signature ~ (m GtkSource.Encoding.Encoding), MonadIO m, IsFileLoader a) => O.MethodInfo FileLoaderGetEncodingMethodInfo a signature where
overloadedMethod _ = fileLoaderGetEncoding
#endif
foreign import ccall "gtk_source_file_loader_get_file" gtk_source_file_loader_get_file ::
Ptr FileLoader ->
IO (Ptr GtkSource.File.File)
fileLoaderGetFile ::
(B.CallStack.HasCallStack, MonadIO m, IsFileLoader a) =>
a
-> m GtkSource.File.File
fileLoaderGetFile loader = liftIO $ do
loader' <- unsafeManagedPtrCastPtr loader
result <- gtk_source_file_loader_get_file loader'
checkUnexpectedReturnNULL "fileLoaderGetFile" result
result' <- (newObject GtkSource.File.File) result
touchManagedPtr loader
return result'
#if ENABLE_OVERLOADING
data FileLoaderGetFileMethodInfo
instance (signature ~ (m GtkSource.File.File), MonadIO m, IsFileLoader a) => O.MethodInfo FileLoaderGetFileMethodInfo a signature where
overloadedMethod _ = fileLoaderGetFile
#endif
foreign import ccall "gtk_source_file_loader_get_input_stream" gtk_source_file_loader_get_input_stream ::
Ptr FileLoader ->
IO (Ptr Gio.InputStream.InputStream)
fileLoaderGetInputStream ::
(B.CallStack.HasCallStack, MonadIO m, IsFileLoader a) =>
a
-> m (Maybe Gio.InputStream.InputStream)
fileLoaderGetInputStream loader = liftIO $ do
loader' <- unsafeManagedPtrCastPtr loader
result <- gtk_source_file_loader_get_input_stream loader'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newObject Gio.InputStream.InputStream) result'
return result''
touchManagedPtr loader
return maybeResult
#if ENABLE_OVERLOADING
data FileLoaderGetInputStreamMethodInfo
instance (signature ~ (m (Maybe Gio.InputStream.InputStream)), MonadIO m, IsFileLoader a) => O.MethodInfo FileLoaderGetInputStreamMethodInfo a signature where
overloadedMethod _ = fileLoaderGetInputStream
#endif
foreign import ccall "gtk_source_file_loader_get_location" gtk_source_file_loader_get_location ::
Ptr FileLoader ->
IO (Ptr Gio.File.File)
fileLoaderGetLocation ::
(B.CallStack.HasCallStack, MonadIO m, IsFileLoader a) =>
a
-> m (Maybe Gio.File.File)
fileLoaderGetLocation loader = liftIO $ do
loader' <- unsafeManagedPtrCastPtr loader
result <- gtk_source_file_loader_get_location loader'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newObject Gio.File.File) result'
return result''
touchManagedPtr loader
return maybeResult
#if ENABLE_OVERLOADING
data FileLoaderGetLocationMethodInfo
instance (signature ~ (m (Maybe Gio.File.File)), MonadIO m, IsFileLoader a) => O.MethodInfo FileLoaderGetLocationMethodInfo a signature where
overloadedMethod _ = fileLoaderGetLocation
#endif
foreign import ccall "gtk_source_file_loader_get_newline_type" gtk_source_file_loader_get_newline_type ::
Ptr FileLoader ->
IO CUInt
fileLoaderGetNewlineType ::
(B.CallStack.HasCallStack, MonadIO m, IsFileLoader a) =>
a
-> m GtkSource.Enums.NewlineType
fileLoaderGetNewlineType loader = liftIO $ do
loader' <- unsafeManagedPtrCastPtr loader
result <- gtk_source_file_loader_get_newline_type loader'
let result' = (toEnum . fromIntegral) result
touchManagedPtr loader
return result'
#if ENABLE_OVERLOADING
data FileLoaderGetNewlineTypeMethodInfo
instance (signature ~ (m GtkSource.Enums.NewlineType), MonadIO m, IsFileLoader a) => O.MethodInfo FileLoaderGetNewlineTypeMethodInfo a signature where
overloadedMethod _ = fileLoaderGetNewlineType
#endif
foreign import ccall "gtk_source_file_loader_load_async" gtk_source_file_loader_load_async ::
Ptr FileLoader ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_FileProgressCallback ->
Ptr () ->
FunPtr GLib.Callbacks.C_DestroyNotify ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
fileLoaderLoadAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsFileLoader a, Gio.Cancellable.IsCancellable b) =>
a
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.FileProgressCallback)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
fileLoaderLoadAsync loader ioPriority cancellable progressCallback callback = liftIO $ do
loader' <- unsafeManagedPtrCastPtr loader
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
maybeProgressCallback <- case progressCallback of
Nothing -> return (castPtrToFunPtr nullPtr)
Just jProgressCallback -> do
jProgressCallback' <- Gio.Callbacks.mk_FileProgressCallback (Gio.Callbacks.wrap_FileProgressCallback Nothing (Gio.Callbacks.drop_closures_FileProgressCallback jProgressCallback))
return jProgressCallback'
maybeCallback <- case callback of
Nothing -> return (castPtrToFunPtr nullPtr)
Just jCallback -> do
ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let progressCallbackData = castFunPtrToPtr maybeProgressCallback
let progressCallbackNotify = safeFreeFunPtrPtr
let userData = nullPtr
gtk_source_file_loader_load_async loader' ioPriority maybeCancellable maybeProgressCallback progressCallbackData progressCallbackNotify maybeCallback userData
touchManagedPtr loader
whenJust cancellable touchManagedPtr
return ()
#if ENABLE_OVERLOADING
data FileLoaderLoadAsyncMethodInfo
instance (signature ~ (Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.FileProgressCallback) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsFileLoader a, Gio.Cancellable.IsCancellable b) => O.MethodInfo FileLoaderLoadAsyncMethodInfo a signature where
overloadedMethod _ = fileLoaderLoadAsync
#endif
foreign import ccall "gtk_source_file_loader_load_finish" gtk_source_file_loader_load_finish ::
Ptr FileLoader ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
fileLoaderLoadFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsFileLoader a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
fileLoaderLoadFinish loader result_ = liftIO $ do
loader' <- unsafeManagedPtrCastPtr loader
result_' <- unsafeManagedPtrCastPtr result_
onException (do
_ <- propagateGError $ gtk_source_file_loader_load_finish loader' result_'
touchManagedPtr loader
touchManagedPtr result_
return ()
) (do
return ()
)
#if ENABLE_OVERLOADING
data FileLoaderLoadFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsFileLoader a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo FileLoaderLoadFinishMethodInfo a signature where
overloadedMethod _ = fileLoaderLoadFinish
#endif
foreign import ccall "gtk_source_file_loader_set_candidate_encodings" gtk_source_file_loader_set_candidate_encodings ::
Ptr FileLoader ->
Ptr (GSList (Ptr GtkSource.Encoding.Encoding)) ->
IO ()
fileLoaderSetCandidateEncodings ::
(B.CallStack.HasCallStack, MonadIO m, IsFileLoader a) =>
a
-> [GtkSource.Encoding.Encoding]
-> m ()
fileLoaderSetCandidateEncodings loader candidateEncodings = liftIO $ do
loader' <- unsafeManagedPtrCastPtr loader
candidateEncodings' <- mapM unsafeManagedPtrGetPtr candidateEncodings
candidateEncodings'' <- packGSList candidateEncodings'
gtk_source_file_loader_set_candidate_encodings loader' candidateEncodings''
touchManagedPtr loader
mapM_ touchManagedPtr candidateEncodings
g_slist_free candidateEncodings''
return ()
#if ENABLE_OVERLOADING
data FileLoaderSetCandidateEncodingsMethodInfo
instance (signature ~ ([GtkSource.Encoding.Encoding] -> m ()), MonadIO m, IsFileLoader a) => O.MethodInfo FileLoaderSetCandidateEncodingsMethodInfo a signature where
overloadedMethod _ = fileLoaderSetCandidateEncodings
#endif