{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GtkSource.Objects.FileLoader
(
FileLoader(..) ,
IsFileLoader ,
toFileLoader ,
#if defined(ENABLE_OVERLOADING)
ResolveFileLoaderMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
FileLoaderGetBufferMethodInfo ,
#endif
fileLoaderGetBuffer ,
#if defined(ENABLE_OVERLOADING)
FileLoaderGetCompressionTypeMethodInfo ,
#endif
fileLoaderGetCompressionType ,
#if defined(ENABLE_OVERLOADING)
FileLoaderGetEncodingMethodInfo ,
#endif
fileLoaderGetEncoding ,
#if defined(ENABLE_OVERLOADING)
FileLoaderGetFileMethodInfo ,
#endif
fileLoaderGetFile ,
#if defined(ENABLE_OVERLOADING)
FileLoaderGetInputStreamMethodInfo ,
#endif
fileLoaderGetInputStream ,
#if defined(ENABLE_OVERLOADING)
FileLoaderGetLocationMethodInfo ,
#endif
fileLoaderGetLocation ,
#if defined(ENABLE_OVERLOADING)
FileLoaderGetNewlineTypeMethodInfo ,
#endif
fileLoaderGetNewlineType ,
#if defined(ENABLE_OVERLOADING)
FileLoaderLoadAsyncMethodInfo ,
#endif
fileLoaderLoadAsync ,
#if defined(ENABLE_OVERLOADING)
FileLoaderLoadFinishMethodInfo ,
#endif
fileLoaderLoadFinish ,
fileLoaderNew ,
fileLoaderNewFromStream ,
#if defined(ENABLE_OVERLOADING)
FileLoaderSetCandidateEncodingsMethodInfo,
#endif
fileLoaderSetCandidateEncodings ,
#if defined(ENABLE_OVERLOADING)
FileLoaderBufferPropertyInfo ,
#endif
constructFileLoaderBuffer ,
#if defined(ENABLE_OVERLOADING)
fileLoaderBuffer ,
#endif
getFileLoaderBuffer ,
#if defined(ENABLE_OVERLOADING)
FileLoaderFilePropertyInfo ,
#endif
constructFileLoaderFile ,
#if defined(ENABLE_OVERLOADING)
fileLoaderFile ,
#endif
getFileLoaderFile ,
#if defined(ENABLE_OVERLOADING)
FileLoaderInputStreamPropertyInfo ,
#endif
constructFileLoaderInputStream ,
#if defined(ENABLE_OVERLOADING)
fileLoaderInputStream ,
#endif
getFileLoaderInputStream ,
#if defined(ENABLE_OVERLOADING)
FileLoaderLocationPropertyInfo ,
#endif
constructFileLoaderLocation ,
#if defined(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.BasicTypes as B.Types
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.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
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 (SP.ManagedPtr FileLoader)
deriving (FileLoader -> FileLoader -> Bool
(FileLoader -> FileLoader -> Bool)
-> (FileLoader -> FileLoader -> Bool) -> Eq FileLoader
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FileLoader -> FileLoader -> Bool
$c/= :: FileLoader -> FileLoader -> Bool
== :: FileLoader -> FileLoader -> Bool
$c== :: FileLoader -> FileLoader -> Bool
Eq)
instance SP.ManagedPtrNewtype FileLoader where
toManagedPtr :: FileLoader -> ManagedPtr FileLoader
toManagedPtr (FileLoader ManagedPtr FileLoader
p) = ManagedPtr FileLoader
p
foreign import ccall "gtk_source_file_loader_get_type"
c_gtk_source_file_loader_get_type :: IO B.Types.GType
instance B.Types.TypedObject FileLoader where
glibType :: IO GType
glibType = IO GType
c_gtk_source_file_loader_get_type
instance B.Types.GObject FileLoader
instance B.GValue.IsGValue FileLoader where
toGValue :: FileLoader -> IO GValue
toGValue FileLoader
o = do
GType
gtype <- IO GType
c_gtk_source_file_loader_get_type
FileLoader -> (Ptr FileLoader -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr FileLoader
o (GType
-> (GValue -> Ptr FileLoader -> IO ())
-> Ptr FileLoader
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr FileLoader -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO FileLoader
fromGValue GValue
gv = do
Ptr FileLoader
ptr <- GValue -> IO (Ptr FileLoader)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr FileLoader)
(ManagedPtr FileLoader -> FileLoader)
-> Ptr FileLoader -> IO FileLoader
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr FileLoader -> FileLoader
FileLoader Ptr FileLoader
ptr
class (SP.GObject o, O.IsDescendantOf FileLoader o) => IsFileLoader o
instance (SP.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 :: o -> m FileLoader
toFileLoader = IO FileLoader -> m FileLoader
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FileLoader -> m FileLoader)
-> (o -> IO FileLoader) -> o -> m FileLoader
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr FileLoader -> FileLoader) -> o -> IO FileLoader
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr FileLoader -> FileLoader
FileLoader
#if defined(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 "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
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 @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
getFileLoaderBuffer :: (MonadIO m, IsFileLoader o) => o -> m GtkSource.Buffer.Buffer
getFileLoaderBuffer :: o -> m Buffer
getFileLoaderBuffer o
obj = IO Buffer -> m Buffer
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Buffer -> m Buffer) -> IO Buffer -> m Buffer
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe Buffer) -> IO Buffer
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getFileLoaderBuffer" (IO (Maybe Buffer) -> IO Buffer) -> IO (Maybe Buffer) -> IO Buffer
forall a b. (a -> b) -> a -> b
$ o -> String -> (ManagedPtr Buffer -> Buffer) -> IO (Maybe Buffer)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"buffer" ManagedPtr Buffer -> Buffer
GtkSource.Buffer.Buffer
constructFileLoaderBuffer :: (IsFileLoader o, MIO.MonadIO m, GtkSource.Buffer.IsBuffer a) => a -> m (GValueConstruct o)
constructFileLoaderBuffer :: a -> m (GValueConstruct o)
constructFileLoaderBuffer a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"buffer" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
#if defined(ENABLE_OVERLOADING)
data FileLoaderBufferPropertyInfo
instance AttrInfo FileLoaderBufferPropertyInfo where
type AttrAllowedOps FileLoaderBufferPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint FileLoaderBufferPropertyInfo = IsFileLoader
type AttrSetTypeConstraint FileLoaderBufferPropertyInfo = GtkSource.Buffer.IsBuffer
type AttrTransferTypeConstraint FileLoaderBufferPropertyInfo = GtkSource.Buffer.IsBuffer
type AttrTransferType FileLoaderBufferPropertyInfo = GtkSource.Buffer.Buffer
type AttrGetType FileLoaderBufferPropertyInfo = GtkSource.Buffer.Buffer
type AttrLabel FileLoaderBufferPropertyInfo = "buffer"
type AttrOrigin FileLoaderBufferPropertyInfo = FileLoader
attrGet = getFileLoaderBuffer
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo GtkSource.Buffer.Buffer v
attrConstruct = constructFileLoaderBuffer
attrClear = undefined
#endif
getFileLoaderFile :: (MonadIO m, IsFileLoader o) => o -> m GtkSource.File.File
getFileLoaderFile :: o -> m File
getFileLoaderFile o
obj = IO File -> m File
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO File -> m File) -> IO File -> m File
forall a b. (a -> b) -> a -> b
$ Text -> IO (Maybe File) -> IO File
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing Text
"getFileLoaderFile" (IO (Maybe File) -> IO File) -> IO (Maybe File) -> IO File
forall a b. (a -> b) -> a -> b
$ o -> String -> (ManagedPtr File -> File) -> IO (Maybe File)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"file" ManagedPtr File -> File
GtkSource.File.File
constructFileLoaderFile :: (IsFileLoader o, MIO.MonadIO m, GtkSource.File.IsFile a) => a -> m (GValueConstruct o)
constructFileLoaderFile :: a -> m (GValueConstruct o)
constructFileLoaderFile a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"file" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
#if defined(ENABLE_OVERLOADING)
data FileLoaderFilePropertyInfo
instance AttrInfo FileLoaderFilePropertyInfo where
type AttrAllowedOps FileLoaderFilePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint FileLoaderFilePropertyInfo = IsFileLoader
type AttrSetTypeConstraint FileLoaderFilePropertyInfo = GtkSource.File.IsFile
type AttrTransferTypeConstraint FileLoaderFilePropertyInfo = GtkSource.File.IsFile
type AttrTransferType FileLoaderFilePropertyInfo = GtkSource.File.File
type AttrGetType FileLoaderFilePropertyInfo = GtkSource.File.File
type AttrLabel FileLoaderFilePropertyInfo = "file"
type AttrOrigin FileLoaderFilePropertyInfo = FileLoader
attrGet = getFileLoaderFile
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo GtkSource.File.File v
attrConstruct = constructFileLoaderFile
attrClear = undefined
#endif
getFileLoaderInputStream :: (MonadIO m, IsFileLoader o) => o -> m (Maybe Gio.InputStream.InputStream)
getFileLoaderInputStream :: o -> m (Maybe InputStream)
getFileLoaderInputStream o
obj = IO (Maybe InputStream) -> m (Maybe InputStream)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe InputStream) -> m (Maybe InputStream))
-> IO (Maybe InputStream) -> m (Maybe InputStream)
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr InputStream -> InputStream)
-> IO (Maybe InputStream)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"input-stream" ManagedPtr InputStream -> InputStream
Gio.InputStream.InputStream
constructFileLoaderInputStream :: (IsFileLoader o, MIO.MonadIO m, Gio.InputStream.IsInputStream a) => a -> m (GValueConstruct o)
constructFileLoaderInputStream :: a -> m (GValueConstruct o)
constructFileLoaderInputStream a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"input-stream" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
#if defined(ENABLE_OVERLOADING)
data FileLoaderInputStreamPropertyInfo
instance AttrInfo FileLoaderInputStreamPropertyInfo where
type AttrAllowedOps FileLoaderInputStreamPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint FileLoaderInputStreamPropertyInfo = IsFileLoader
type AttrSetTypeConstraint FileLoaderInputStreamPropertyInfo = Gio.InputStream.IsInputStream
type AttrTransferTypeConstraint FileLoaderInputStreamPropertyInfo = Gio.InputStream.IsInputStream
type AttrTransferType FileLoaderInputStreamPropertyInfo = Gio.InputStream.InputStream
type AttrGetType FileLoaderInputStreamPropertyInfo = (Maybe Gio.InputStream.InputStream)
type AttrLabel FileLoaderInputStreamPropertyInfo = "input-stream"
type AttrOrigin FileLoaderInputStreamPropertyInfo = FileLoader
attrGet = getFileLoaderInputStream
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gio.InputStream.InputStream v
attrConstruct = constructFileLoaderInputStream
attrClear = undefined
#endif
getFileLoaderLocation :: (MonadIO m, IsFileLoader o) => o -> m (Maybe Gio.File.File)
getFileLoaderLocation :: o -> m (Maybe File)
getFileLoaderLocation o
obj = IO (Maybe File) -> m (Maybe File)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe File) -> m (Maybe File))
-> IO (Maybe File) -> m (Maybe File)
forall a b. (a -> b) -> a -> b
$ o -> String -> (ManagedPtr File -> File) -> IO (Maybe File)
forall a b.
(GObject a, GObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyObject o
obj String
"location" ManagedPtr File -> File
Gio.File.File
constructFileLoaderLocation :: (IsFileLoader o, MIO.MonadIO m, Gio.File.IsFile a) => a -> m (GValueConstruct o)
constructFileLoaderLocation :: a -> m (GValueConstruct o)
constructFileLoaderLocation a
val = IO (GValueConstruct o) -> m (GValueConstruct o)
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
$ String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject String
"location" (a -> Maybe a
forall a. a -> Maybe a
P.Just a
val)
#if defined(ENABLE_OVERLOADING)
data FileLoaderLocationPropertyInfo
instance AttrInfo FileLoaderLocationPropertyInfo where
type AttrAllowedOps FileLoaderLocationPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint FileLoaderLocationPropertyInfo = IsFileLoader
type AttrSetTypeConstraint FileLoaderLocationPropertyInfo = Gio.File.IsFile
type AttrTransferTypeConstraint FileLoaderLocationPropertyInfo = Gio.File.IsFile
type AttrTransferType FileLoaderLocationPropertyInfo = Gio.File.File
type AttrGetType FileLoaderLocationPropertyInfo = (Maybe Gio.File.File)
type AttrLabel FileLoaderLocationPropertyInfo = "location"
type AttrOrigin FileLoaderLocationPropertyInfo = FileLoader
attrGet = getFileLoaderLocation
attrSet = undefined
attrTransfer _ v = do
unsafeCastTo Gio.File.File v
attrConstruct = constructFileLoaderLocation
attrClear = undefined
#endif
#if defined(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 defined(ENABLE_OVERLOADING)
fileLoaderBuffer :: AttrLabelProxy "buffer"
fileLoaderBuffer = AttrLabelProxy
fileLoaderFile :: AttrLabelProxy "file"
fileLoaderFile = AttrLabelProxy
fileLoaderInputStream :: AttrLabelProxy "inputStream"
fileLoaderInputStream = AttrLabelProxy
fileLoaderLocation :: AttrLabelProxy "location"
fileLoaderLocation = AttrLabelProxy
#endif
#if defined(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 :: a -> b -> m FileLoader
fileLoaderNew a
buffer b
file = IO FileLoader -> m FileLoader
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FileLoader -> m FileLoader) -> IO FileLoader -> m FileLoader
forall a b. (a -> b) -> a -> b
$ do
Ptr Buffer
buffer' <- a -> IO (Ptr Buffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
buffer
Ptr File
file' <- b -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
file
Ptr FileLoader
result <- Ptr Buffer -> Ptr File -> IO (Ptr FileLoader)
gtk_source_file_loader_new Ptr Buffer
buffer' Ptr File
file'
Text -> Ptr FileLoader -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"fileLoaderNew" Ptr FileLoader
result
FileLoader
result' <- ((ManagedPtr FileLoader -> FileLoader)
-> Ptr FileLoader -> IO FileLoader
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr FileLoader -> FileLoader
FileLoader) Ptr FileLoader
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
buffer
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
file
FileLoader -> IO FileLoader
forall (m :: * -> *) a. Monad m => a -> m a
return FileLoader
result'
#if defined(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 :: a -> b -> c -> m FileLoader
fileLoaderNewFromStream a
buffer b
file c
stream = IO FileLoader -> m FileLoader
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FileLoader -> m FileLoader) -> IO FileLoader -> m FileLoader
forall a b. (a -> b) -> a -> b
$ do
Ptr Buffer
buffer' <- a -> IO (Ptr Buffer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
buffer
Ptr File
file' <- b -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
file
Ptr InputStream
stream' <- c -> IO (Ptr InputStream)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
stream
Ptr FileLoader
result <- Ptr Buffer -> Ptr File -> Ptr InputStream -> IO (Ptr FileLoader)
gtk_source_file_loader_new_from_stream Ptr Buffer
buffer' Ptr File
file' Ptr InputStream
stream'
Text -> Ptr FileLoader -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"fileLoaderNewFromStream" Ptr FileLoader
result
FileLoader
result' <- ((ManagedPtr FileLoader -> FileLoader)
-> Ptr FileLoader -> IO FileLoader
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr FileLoader -> FileLoader
FileLoader) Ptr FileLoader
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
buffer
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
file
c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr c
stream
FileLoader -> IO FileLoader
forall (m :: * -> *) a. Monad m => a -> m a
return FileLoader
result'
#if defined(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 :: a -> m Buffer
fileLoaderGetBuffer a
loader = IO Buffer -> m Buffer
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Buffer -> m Buffer) -> IO Buffer -> m Buffer
forall a b. (a -> b) -> a -> b
$ do
Ptr FileLoader
loader' <- a -> IO (Ptr FileLoader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
loader
Ptr Buffer
result <- Ptr FileLoader -> IO (Ptr Buffer)
gtk_source_file_loader_get_buffer Ptr FileLoader
loader'
Text -> Ptr Buffer -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"fileLoaderGetBuffer" Ptr Buffer
result
Buffer
result' <- ((ManagedPtr Buffer -> Buffer) -> Ptr Buffer -> IO Buffer
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Buffer -> Buffer
GtkSource.Buffer.Buffer) Ptr Buffer
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
loader
Buffer -> IO Buffer
forall (m :: * -> *) a. Monad m => a -> m a
return Buffer
result'
#if defined(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 :: a -> m CompressionType
fileLoaderGetCompressionType a
loader = IO CompressionType -> m CompressionType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CompressionType -> m CompressionType)
-> IO CompressionType -> m CompressionType
forall a b. (a -> b) -> a -> b
$ do
Ptr FileLoader
loader' <- a -> IO (Ptr FileLoader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
loader
CUInt
result <- Ptr FileLoader -> IO CUInt
gtk_source_file_loader_get_compression_type Ptr FileLoader
loader'
let result' :: CompressionType
result' = (Int -> CompressionType
forall a. Enum a => Int -> a
toEnum (Int -> CompressionType)
-> (CUInt -> Int) -> CUInt -> CompressionType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
loader
CompressionType -> IO CompressionType
forall (m :: * -> *) a. Monad m => a -> m a
return CompressionType
result'
#if defined(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 :: a -> m Encoding
fileLoaderGetEncoding a
loader = IO Encoding -> m Encoding
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Encoding -> m Encoding) -> IO Encoding -> m Encoding
forall a b. (a -> b) -> a -> b
$ do
Ptr FileLoader
loader' <- a -> IO (Ptr FileLoader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
loader
Ptr Encoding
result <- Ptr FileLoader -> IO (Ptr Encoding)
gtk_source_file_loader_get_encoding Ptr FileLoader
loader'
Text -> Ptr Encoding -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"fileLoaderGetEncoding" Ptr Encoding
result
Encoding
result' <- ((ManagedPtr Encoding -> Encoding) -> Ptr Encoding -> IO Encoding
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr Encoding -> Encoding
GtkSource.Encoding.Encoding) Ptr Encoding
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
loader
Encoding -> IO Encoding
forall (m :: * -> *) a. Monad m => a -> m a
return Encoding
result'
#if defined(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 :: a -> m File
fileLoaderGetFile a
loader = IO File -> m File
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO File -> m File) -> IO File -> m File
forall a b. (a -> b) -> a -> b
$ do
Ptr FileLoader
loader' <- a -> IO (Ptr FileLoader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
loader
Ptr File
result <- Ptr FileLoader -> IO (Ptr File)
gtk_source_file_loader_get_file Ptr FileLoader
loader'
Text -> Ptr File -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"fileLoaderGetFile" Ptr File
result
File
result' <- ((ManagedPtr File -> File) -> Ptr File -> IO File
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr File -> File
GtkSource.File.File) Ptr File
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
loader
File -> IO File
forall (m :: * -> *) a. Monad m => a -> m a
return File
result'
#if defined(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 :: a -> m (Maybe InputStream)
fileLoaderGetInputStream a
loader = IO (Maybe InputStream) -> m (Maybe InputStream)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe InputStream) -> m (Maybe InputStream))
-> IO (Maybe InputStream) -> m (Maybe InputStream)
forall a b. (a -> b) -> a -> b
$ do
Ptr FileLoader
loader' <- a -> IO (Ptr FileLoader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
loader
Ptr InputStream
result <- Ptr FileLoader -> IO (Ptr InputStream)
gtk_source_file_loader_get_input_stream Ptr FileLoader
loader'
Maybe InputStream
maybeResult <- Ptr InputStream
-> (Ptr InputStream -> IO InputStream) -> IO (Maybe InputStream)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr InputStream
result ((Ptr InputStream -> IO InputStream) -> IO (Maybe InputStream))
-> (Ptr InputStream -> IO InputStream) -> IO (Maybe InputStream)
forall a b. (a -> b) -> a -> b
$ \Ptr InputStream
result' -> do
InputStream
result'' <- ((ManagedPtr InputStream -> InputStream)
-> Ptr InputStream -> IO InputStream
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr InputStream -> InputStream
Gio.InputStream.InputStream) Ptr InputStream
result'
InputStream -> IO InputStream
forall (m :: * -> *) a. Monad m => a -> m a
return InputStream
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
loader
Maybe InputStream -> IO (Maybe InputStream)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe InputStream
maybeResult
#if defined(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 :: a -> m (Maybe File)
fileLoaderGetLocation a
loader = IO (Maybe File) -> m (Maybe File)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe File) -> m (Maybe File))
-> IO (Maybe File) -> m (Maybe File)
forall a b. (a -> b) -> a -> b
$ do
Ptr FileLoader
loader' <- a -> IO (Ptr FileLoader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
loader
Ptr File
result <- Ptr FileLoader -> IO (Ptr File)
gtk_source_file_loader_get_location Ptr FileLoader
loader'
Maybe File
maybeResult <- Ptr File -> (Ptr File -> IO File) -> IO (Maybe File)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr File
result ((Ptr File -> IO File) -> IO (Maybe File))
-> (Ptr File -> IO File) -> IO (Maybe File)
forall a b. (a -> b) -> a -> b
$ \Ptr File
result' -> do
File
result'' <- ((ManagedPtr File -> File) -> Ptr File -> IO File
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr File -> File
Gio.File.File) Ptr File
result'
File -> IO File
forall (m :: * -> *) a. Monad m => a -> m a
return File
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
loader
Maybe File -> IO (Maybe File)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe File
maybeResult
#if defined(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 :: a -> m NewlineType
fileLoaderGetNewlineType a
loader = IO NewlineType -> m NewlineType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO NewlineType -> m NewlineType)
-> IO NewlineType -> m NewlineType
forall a b. (a -> b) -> a -> b
$ do
Ptr FileLoader
loader' <- a -> IO (Ptr FileLoader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
loader
CUInt
result <- Ptr FileLoader -> IO CUInt
gtk_source_file_loader_get_newline_type Ptr FileLoader
loader'
let result' :: NewlineType
result' = (Int -> NewlineType
forall a. Enum a => Int -> a
toEnum (Int -> NewlineType) -> (CUInt -> Int) -> CUInt -> NewlineType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
loader
NewlineType -> IO NewlineType
forall (m :: * -> *) a. Monad m => a -> m a
return NewlineType
result'
#if defined(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 :: a
-> Int32
-> Maybe b
-> Maybe FileProgressCallback
-> Maybe AsyncReadyCallback
-> m ()
fileLoaderLoadAsync a
loader Int32
ioPriority Maybe b
cancellable Maybe FileProgressCallback
progressCallback Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr FileLoader
loader' <- a -> IO (Ptr FileLoader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
loader
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_FileProgressCallback
maybeProgressCallback <- case Maybe FileProgressCallback
progressCallback of
Maybe FileProgressCallback
Nothing -> FunPtr C_FileProgressCallback -> IO (FunPtr C_FileProgressCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_FileProgressCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just FileProgressCallback
jProgressCallback -> do
FunPtr C_FileProgressCallback
jProgressCallback' <- C_FileProgressCallback -> IO (FunPtr C_FileProgressCallback)
Gio.Callbacks.mk_FileProgressCallback (Maybe (Ptr (FunPtr C_FileProgressCallback))
-> C_FileProgressCallback -> C_FileProgressCallback
Gio.Callbacks.wrap_FileProgressCallback Maybe (Ptr (FunPtr C_FileProgressCallback))
forall a. Maybe a
Nothing (FileProgressCallback -> C_FileProgressCallback
Gio.Callbacks.drop_closures_FileProgressCallback FileProgressCallback
jProgressCallback))
FunPtr C_FileProgressCallback -> IO (FunPtr C_FileProgressCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_FileProgressCallback
jProgressCallback'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let progressCallbackData :: Ptr ()
progressCallbackData = FunPtr C_FileProgressCallback -> Ptr ()
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_FileProgressCallback
maybeProgressCallback
let progressCallbackNotify :: FunPtr (Ptr a -> IO ())
progressCallbackNotify = FunPtr (Ptr a -> IO ())
forall a. FunPtr (Ptr a -> IO ())
safeFreeFunPtrPtr
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr FileLoader
-> Int32
-> Ptr Cancellable
-> FunPtr C_FileProgressCallback
-> Ptr ()
-> FunPtr C_DestroyNotify
-> FunPtr C_AsyncReadyCallback
-> C_DestroyNotify
gtk_source_file_loader_load_async Ptr FileLoader
loader' Int32
ioPriority Ptr Cancellable
maybeCancellable FunPtr C_FileProgressCallback
maybeProgressCallback Ptr ()
progressCallbackData FunPtr C_DestroyNotify
forall a. FunPtr (Ptr a -> IO ())
progressCallbackNotify FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
loader
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(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 :: a -> b -> m ()
fileLoaderLoadFinish a
loader b
result_ = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr FileLoader
loader' <- a -> IO (Ptr FileLoader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
loader
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr FileLoader -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
gtk_source_file_loader_load_finish Ptr FileLoader
loader' Ptr AsyncResult
result_'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
loader
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(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 :: a -> [Encoding] -> m ()
fileLoaderSetCandidateEncodings a
loader [Encoding]
candidateEncodings = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr FileLoader
loader' <- a -> IO (Ptr FileLoader)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
loader
[Ptr Encoding]
candidateEncodings' <- (Encoding -> IO (Ptr Encoding)) -> [Encoding] -> IO [Ptr Encoding]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM Encoding -> IO (Ptr Encoding)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [Encoding]
candidateEncodings
Ptr (GSList (Ptr Encoding))
candidateEncodings'' <- [Ptr Encoding] -> IO (Ptr (GSList (Ptr Encoding)))
forall a. [Ptr a] -> IO (Ptr (GSList (Ptr a)))
packGSList [Ptr Encoding]
candidateEncodings'
Ptr FileLoader -> Ptr (GSList (Ptr Encoding)) -> IO ()
gtk_source_file_loader_set_candidate_encodings Ptr FileLoader
loader' Ptr (GSList (Ptr Encoding))
candidateEncodings''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
loader
(Encoding -> IO ()) -> [Encoding] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ Encoding -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [Encoding]
candidateEncodings
Ptr (GSList (Ptr Encoding)) -> IO ()
forall a. Ptr (GSList a) -> IO ()
g_slist_free Ptr (GSList (Ptr Encoding))
candidateEncodings''
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FileLoaderSetCandidateEncodingsMethodInfo
instance (signature ~ ([GtkSource.Encoding.Encoding] -> m ()), MonadIO m, IsFileLoader a) => O.MethodInfo FileLoaderSetCandidateEncodingsMethodInfo a signature where
overloadedMethod = fileLoaderSetCandidateEncodings
#endif