#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.GtkSource.Objects.FileSaver
(
FileSaver(..) ,
IsFileSaver ,
toFileSaver ,
noFileSaver ,
#if ENABLE_OVERLOADING
FileSaverGetBufferMethodInfo ,
#endif
fileSaverGetBuffer ,
#if ENABLE_OVERLOADING
FileSaverGetCompressionTypeMethodInfo ,
#endif
fileSaverGetCompressionType ,
#if ENABLE_OVERLOADING
FileSaverGetEncodingMethodInfo ,
#endif
fileSaverGetEncoding ,
#if ENABLE_OVERLOADING
FileSaverGetFileMethodInfo ,
#endif
fileSaverGetFile ,
#if ENABLE_OVERLOADING
FileSaverGetFlagsMethodInfo ,
#endif
fileSaverGetFlags ,
#if ENABLE_OVERLOADING
FileSaverGetLocationMethodInfo ,
#endif
fileSaverGetLocation ,
#if ENABLE_OVERLOADING
FileSaverGetNewlineTypeMethodInfo ,
#endif
fileSaverGetNewlineType ,
fileSaverNew ,
fileSaverNewWithTarget ,
#if ENABLE_OVERLOADING
FileSaverSaveAsyncMethodInfo ,
#endif
fileSaverSaveAsync ,
#if ENABLE_OVERLOADING
FileSaverSaveFinishMethodInfo ,
#endif
fileSaverSaveFinish ,
#if ENABLE_OVERLOADING
FileSaverSetCompressionTypeMethodInfo ,
#endif
fileSaverSetCompressionType ,
#if ENABLE_OVERLOADING
FileSaverSetEncodingMethodInfo ,
#endif
fileSaverSetEncoding ,
#if ENABLE_OVERLOADING
FileSaverSetFlagsMethodInfo ,
#endif
fileSaverSetFlags ,
#if ENABLE_OVERLOADING
FileSaverSetNewlineTypeMethodInfo ,
#endif
fileSaverSetNewlineType ,
#if ENABLE_OVERLOADING
FileSaverBufferPropertyInfo ,
#endif
constructFileSaverBuffer ,
#if ENABLE_OVERLOADING
fileSaverBuffer ,
#endif
getFileSaverBuffer ,
#if ENABLE_OVERLOADING
FileSaverCompressionTypePropertyInfo ,
#endif
constructFileSaverCompressionType ,
#if ENABLE_OVERLOADING
fileSaverCompressionType ,
#endif
getFileSaverCompressionType ,
setFileSaverCompressionType ,
#if ENABLE_OVERLOADING
FileSaverEncodingPropertyInfo ,
#endif
clearFileSaverEncoding ,
constructFileSaverEncoding ,
#if ENABLE_OVERLOADING
fileSaverEncoding ,
#endif
getFileSaverEncoding ,
setFileSaverEncoding ,
#if ENABLE_OVERLOADING
FileSaverFilePropertyInfo ,
#endif
constructFileSaverFile ,
#if ENABLE_OVERLOADING
fileSaverFile ,
#endif
getFileSaverFile ,
#if ENABLE_OVERLOADING
FileSaverFlagsPropertyInfo ,
#endif
constructFileSaverFlags ,
#if ENABLE_OVERLOADING
fileSaverFlags ,
#endif
getFileSaverFlags ,
setFileSaverFlags ,
#if ENABLE_OVERLOADING
FileSaverLocationPropertyInfo ,
#endif
constructFileSaverLocation ,
#if ENABLE_OVERLOADING
fileSaverLocation ,
#endif
getFileSaverLocation ,
#if ENABLE_OVERLOADING
FileSaverNewlineTypePropertyInfo ,
#endif
constructFileSaverNewlineType ,
#if ENABLE_OVERLOADING
fileSaverNewlineType ,
#endif
getFileSaverNewlineType ,
setFileSaverNewlineType ,
) 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 {-# SOURCE #-} qualified GI.GtkSource.Enums as GtkSource.Enums
import {-# SOURCE #-} qualified GI.GtkSource.Flags as GtkSource.Flags
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 FileSaver = FileSaver (ManagedPtr FileSaver)
foreign import ccall "gtk_source_file_saver_get_type"
c_gtk_source_file_saver_get_type :: IO GType
instance GObject FileSaver where
gobjectType = c_gtk_source_file_saver_get_type
class (GObject o, O.IsDescendantOf FileSaver o) => IsFileSaver o
instance (GObject o, O.IsDescendantOf FileSaver o) => IsFileSaver o
instance O.HasParentTypes FileSaver
type instance O.ParentTypes FileSaver = '[GObject.Object.Object]
toFileSaver :: (MonadIO m, IsFileSaver o) => o -> m FileSaver
toFileSaver = liftIO . unsafeCastTo FileSaver
noFileSaver :: Maybe FileSaver
noFileSaver = Nothing
#if ENABLE_OVERLOADING
type family ResolveFileSaverMethod (t :: Symbol) (o :: *) :: * where
ResolveFileSaverMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveFileSaverMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveFileSaverMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveFileSaverMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveFileSaverMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveFileSaverMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveFileSaverMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveFileSaverMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveFileSaverMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveFileSaverMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveFileSaverMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveFileSaverMethod "saveAsync" o = FileSaverSaveAsyncMethodInfo
ResolveFileSaverMethod "saveFinish" o = FileSaverSaveFinishMethodInfo
ResolveFileSaverMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveFileSaverMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveFileSaverMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveFileSaverMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveFileSaverMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveFileSaverMethod "getBuffer" o = FileSaverGetBufferMethodInfo
ResolveFileSaverMethod "getCompressionType" o = FileSaverGetCompressionTypeMethodInfo
ResolveFileSaverMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveFileSaverMethod "getEncoding" o = FileSaverGetEncodingMethodInfo
ResolveFileSaverMethod "getFile" o = FileSaverGetFileMethodInfo
ResolveFileSaverMethod "getFlags" o = FileSaverGetFlagsMethodInfo
ResolveFileSaverMethod "getLocation" o = FileSaverGetLocationMethodInfo
ResolveFileSaverMethod "getNewlineType" o = FileSaverGetNewlineTypeMethodInfo
ResolveFileSaverMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveFileSaverMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveFileSaverMethod "setCompressionType" o = FileSaverSetCompressionTypeMethodInfo
ResolveFileSaverMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveFileSaverMethod "setEncoding" o = FileSaverSetEncodingMethodInfo
ResolveFileSaverMethod "setFlags" o = FileSaverSetFlagsMethodInfo
ResolveFileSaverMethod "setNewlineType" o = FileSaverSetNewlineTypeMethodInfo
ResolveFileSaverMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveFileSaverMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveFileSaverMethod t FileSaver, O.MethodInfo info FileSaver p) => OL.IsLabel t (FileSaver -> 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
getFileSaverBuffer :: (MonadIO m, IsFileSaver o) => o -> m GtkSource.Buffer.Buffer
getFileSaverBuffer obj = liftIO $ checkUnexpectedNothing "getFileSaverBuffer" $ B.Properties.getObjectPropertyObject obj "buffer" GtkSource.Buffer.Buffer
constructFileSaverBuffer :: (IsFileSaver o, GtkSource.Buffer.IsBuffer a) => a -> IO (GValueConstruct o)
constructFileSaverBuffer val = B.Properties.constructObjectPropertyObject "buffer" (Just val)
#if ENABLE_OVERLOADING
data FileSaverBufferPropertyInfo
instance AttrInfo FileSaverBufferPropertyInfo where
type AttrAllowedOps FileSaverBufferPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint FileSaverBufferPropertyInfo = GtkSource.Buffer.IsBuffer
type AttrBaseTypeConstraint FileSaverBufferPropertyInfo = IsFileSaver
type AttrGetType FileSaverBufferPropertyInfo = GtkSource.Buffer.Buffer
type AttrLabel FileSaverBufferPropertyInfo = "buffer"
type AttrOrigin FileSaverBufferPropertyInfo = FileSaver
attrGet _ = getFileSaverBuffer
attrSet _ = undefined
attrConstruct _ = constructFileSaverBuffer
attrClear _ = undefined
#endif
getFileSaverCompressionType :: (MonadIO m, IsFileSaver o) => o -> m GtkSource.Enums.CompressionType
getFileSaverCompressionType obj = liftIO $ B.Properties.getObjectPropertyEnum obj "compression-type"
setFileSaverCompressionType :: (MonadIO m, IsFileSaver o) => o -> GtkSource.Enums.CompressionType -> m ()
setFileSaverCompressionType obj val = liftIO $ B.Properties.setObjectPropertyEnum obj "compression-type" val
constructFileSaverCompressionType :: (IsFileSaver o) => GtkSource.Enums.CompressionType -> IO (GValueConstruct o)
constructFileSaverCompressionType val = B.Properties.constructObjectPropertyEnum "compression-type" val
#if ENABLE_OVERLOADING
data FileSaverCompressionTypePropertyInfo
instance AttrInfo FileSaverCompressionTypePropertyInfo where
type AttrAllowedOps FileSaverCompressionTypePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint FileSaverCompressionTypePropertyInfo = (~) GtkSource.Enums.CompressionType
type AttrBaseTypeConstraint FileSaverCompressionTypePropertyInfo = IsFileSaver
type AttrGetType FileSaverCompressionTypePropertyInfo = GtkSource.Enums.CompressionType
type AttrLabel FileSaverCompressionTypePropertyInfo = "compression-type"
type AttrOrigin FileSaverCompressionTypePropertyInfo = FileSaver
attrGet _ = getFileSaverCompressionType
attrSet _ = setFileSaverCompressionType
attrConstruct _ = constructFileSaverCompressionType
attrClear _ = undefined
#endif
getFileSaverEncoding :: (MonadIO m, IsFileSaver o) => o -> m GtkSource.Encoding.Encoding
getFileSaverEncoding obj = liftIO $ checkUnexpectedNothing "getFileSaverEncoding" $ B.Properties.getObjectPropertyBoxed obj "encoding" GtkSource.Encoding.Encoding
setFileSaverEncoding :: (MonadIO m, IsFileSaver o) => o -> GtkSource.Encoding.Encoding -> m ()
setFileSaverEncoding obj val = liftIO $ B.Properties.setObjectPropertyBoxed obj "encoding" (Just val)
constructFileSaverEncoding :: (IsFileSaver o) => GtkSource.Encoding.Encoding -> IO (GValueConstruct o)
constructFileSaverEncoding val = B.Properties.constructObjectPropertyBoxed "encoding" (Just val)
clearFileSaverEncoding :: (MonadIO m, IsFileSaver o) => o -> m ()
clearFileSaverEncoding obj = liftIO $ B.Properties.setObjectPropertyBoxed obj "encoding" (Nothing :: Maybe GtkSource.Encoding.Encoding)
#if ENABLE_OVERLOADING
data FileSaverEncodingPropertyInfo
instance AttrInfo FileSaverEncodingPropertyInfo where
type AttrAllowedOps FileSaverEncodingPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint FileSaverEncodingPropertyInfo = (~) GtkSource.Encoding.Encoding
type AttrBaseTypeConstraint FileSaverEncodingPropertyInfo = IsFileSaver
type AttrGetType FileSaverEncodingPropertyInfo = GtkSource.Encoding.Encoding
type AttrLabel FileSaverEncodingPropertyInfo = "encoding"
type AttrOrigin FileSaverEncodingPropertyInfo = FileSaver
attrGet _ = getFileSaverEncoding
attrSet _ = setFileSaverEncoding
attrConstruct _ = constructFileSaverEncoding
attrClear _ = clearFileSaverEncoding
#endif
getFileSaverFile :: (MonadIO m, IsFileSaver o) => o -> m GtkSource.File.File
getFileSaverFile obj = liftIO $ checkUnexpectedNothing "getFileSaverFile" $ B.Properties.getObjectPropertyObject obj "file" GtkSource.File.File
constructFileSaverFile :: (IsFileSaver o, GtkSource.File.IsFile a) => a -> IO (GValueConstruct o)
constructFileSaverFile val = B.Properties.constructObjectPropertyObject "file" (Just val)
#if ENABLE_OVERLOADING
data FileSaverFilePropertyInfo
instance AttrInfo FileSaverFilePropertyInfo where
type AttrAllowedOps FileSaverFilePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint FileSaverFilePropertyInfo = GtkSource.File.IsFile
type AttrBaseTypeConstraint FileSaverFilePropertyInfo = IsFileSaver
type AttrGetType FileSaverFilePropertyInfo = GtkSource.File.File
type AttrLabel FileSaverFilePropertyInfo = "file"
type AttrOrigin FileSaverFilePropertyInfo = FileSaver
attrGet _ = getFileSaverFile
attrSet _ = undefined
attrConstruct _ = constructFileSaverFile
attrClear _ = undefined
#endif
getFileSaverFlags :: (MonadIO m, IsFileSaver o) => o -> m [GtkSource.Flags.FileSaverFlags]
getFileSaverFlags obj = liftIO $ B.Properties.getObjectPropertyFlags obj "flags"
setFileSaverFlags :: (MonadIO m, IsFileSaver o) => o -> [GtkSource.Flags.FileSaverFlags] -> m ()
setFileSaverFlags obj val = liftIO $ B.Properties.setObjectPropertyFlags obj "flags" val
constructFileSaverFlags :: (IsFileSaver o) => [GtkSource.Flags.FileSaverFlags] -> IO (GValueConstruct o)
constructFileSaverFlags val = B.Properties.constructObjectPropertyFlags "flags" val
#if ENABLE_OVERLOADING
data FileSaverFlagsPropertyInfo
instance AttrInfo FileSaverFlagsPropertyInfo where
type AttrAllowedOps FileSaverFlagsPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint FileSaverFlagsPropertyInfo = (~) [GtkSource.Flags.FileSaverFlags]
type AttrBaseTypeConstraint FileSaverFlagsPropertyInfo = IsFileSaver
type AttrGetType FileSaverFlagsPropertyInfo = [GtkSource.Flags.FileSaverFlags]
type AttrLabel FileSaverFlagsPropertyInfo = "flags"
type AttrOrigin FileSaverFlagsPropertyInfo = FileSaver
attrGet _ = getFileSaverFlags
attrSet _ = setFileSaverFlags
attrConstruct _ = constructFileSaverFlags
attrClear _ = undefined
#endif
getFileSaverLocation :: (MonadIO m, IsFileSaver o) => o -> m Gio.File.File
getFileSaverLocation obj = liftIO $ checkUnexpectedNothing "getFileSaverLocation" $ B.Properties.getObjectPropertyObject obj "location" Gio.File.File
constructFileSaverLocation :: (IsFileSaver o, Gio.File.IsFile a) => a -> IO (GValueConstruct o)
constructFileSaverLocation val = B.Properties.constructObjectPropertyObject "location" (Just val)
#if ENABLE_OVERLOADING
data FileSaverLocationPropertyInfo
instance AttrInfo FileSaverLocationPropertyInfo where
type AttrAllowedOps FileSaverLocationPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint FileSaverLocationPropertyInfo = Gio.File.IsFile
type AttrBaseTypeConstraint FileSaverLocationPropertyInfo = IsFileSaver
type AttrGetType FileSaverLocationPropertyInfo = Gio.File.File
type AttrLabel FileSaverLocationPropertyInfo = "location"
type AttrOrigin FileSaverLocationPropertyInfo = FileSaver
attrGet _ = getFileSaverLocation
attrSet _ = undefined
attrConstruct _ = constructFileSaverLocation
attrClear _ = undefined
#endif
getFileSaverNewlineType :: (MonadIO m, IsFileSaver o) => o -> m GtkSource.Enums.NewlineType
getFileSaverNewlineType obj = liftIO $ B.Properties.getObjectPropertyEnum obj "newline-type"
setFileSaverNewlineType :: (MonadIO m, IsFileSaver o) => o -> GtkSource.Enums.NewlineType -> m ()
setFileSaverNewlineType obj val = liftIO $ B.Properties.setObjectPropertyEnum obj "newline-type" val
constructFileSaverNewlineType :: (IsFileSaver o) => GtkSource.Enums.NewlineType -> IO (GValueConstruct o)
constructFileSaverNewlineType val = B.Properties.constructObjectPropertyEnum "newline-type" val
#if ENABLE_OVERLOADING
data FileSaverNewlineTypePropertyInfo
instance AttrInfo FileSaverNewlineTypePropertyInfo where
type AttrAllowedOps FileSaverNewlineTypePropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
type AttrSetTypeConstraint FileSaverNewlineTypePropertyInfo = (~) GtkSource.Enums.NewlineType
type AttrBaseTypeConstraint FileSaverNewlineTypePropertyInfo = IsFileSaver
type AttrGetType FileSaverNewlineTypePropertyInfo = GtkSource.Enums.NewlineType
type AttrLabel FileSaverNewlineTypePropertyInfo = "newline-type"
type AttrOrigin FileSaverNewlineTypePropertyInfo = FileSaver
attrGet _ = getFileSaverNewlineType
attrSet _ = setFileSaverNewlineType
attrConstruct _ = constructFileSaverNewlineType
attrClear _ = undefined
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList FileSaver
type instance O.AttributeList FileSaver = FileSaverAttributeList
type FileSaverAttributeList = ('[ '("buffer", FileSaverBufferPropertyInfo), '("compressionType", FileSaverCompressionTypePropertyInfo), '("encoding", FileSaverEncodingPropertyInfo), '("file", FileSaverFilePropertyInfo), '("flags", FileSaverFlagsPropertyInfo), '("location", FileSaverLocationPropertyInfo), '("newlineType", FileSaverNewlineTypePropertyInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
fileSaverBuffer :: AttrLabelProxy "buffer"
fileSaverBuffer = AttrLabelProxy
fileSaverCompressionType :: AttrLabelProxy "compressionType"
fileSaverCompressionType = AttrLabelProxy
fileSaverEncoding :: AttrLabelProxy "encoding"
fileSaverEncoding = AttrLabelProxy
fileSaverFile :: AttrLabelProxy "file"
fileSaverFile = AttrLabelProxy
fileSaverFlags :: AttrLabelProxy "flags"
fileSaverFlags = AttrLabelProxy
fileSaverLocation :: AttrLabelProxy "location"
fileSaverLocation = AttrLabelProxy
fileSaverNewlineType :: AttrLabelProxy "newlineType"
fileSaverNewlineType = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
type instance O.SignalList FileSaver = FileSaverSignalList
type FileSaverSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_source_file_saver_new" gtk_source_file_saver_new ::
Ptr GtkSource.Buffer.Buffer ->
Ptr GtkSource.File.File ->
IO (Ptr FileSaver)
fileSaverNew ::
(B.CallStack.HasCallStack, MonadIO m, GtkSource.Buffer.IsBuffer a, GtkSource.File.IsFile b) =>
a
-> b
-> m FileSaver
fileSaverNew buffer file = liftIO $ do
buffer' <- unsafeManagedPtrCastPtr buffer
file' <- unsafeManagedPtrCastPtr file
result <- gtk_source_file_saver_new buffer' file'
checkUnexpectedReturnNULL "fileSaverNew" result
result' <- (wrapObject FileSaver) result
touchManagedPtr buffer
touchManagedPtr file
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "gtk_source_file_saver_new_with_target" gtk_source_file_saver_new_with_target ::
Ptr GtkSource.Buffer.Buffer ->
Ptr GtkSource.File.File ->
Ptr Gio.File.File ->
IO (Ptr FileSaver)
fileSaverNewWithTarget ::
(B.CallStack.HasCallStack, MonadIO m, GtkSource.Buffer.IsBuffer a, GtkSource.File.IsFile b, Gio.File.IsFile c) =>
a
-> b
-> c
-> m FileSaver
fileSaverNewWithTarget buffer file targetLocation = liftIO $ do
buffer' <- unsafeManagedPtrCastPtr buffer
file' <- unsafeManagedPtrCastPtr file
targetLocation' <- unsafeManagedPtrCastPtr targetLocation
result <- gtk_source_file_saver_new_with_target buffer' file' targetLocation'
checkUnexpectedReturnNULL "fileSaverNewWithTarget" result
result' <- (wrapObject FileSaver) result
touchManagedPtr buffer
touchManagedPtr file
touchManagedPtr targetLocation
return result'
#if ENABLE_OVERLOADING
#endif
foreign import ccall "gtk_source_file_saver_get_buffer" gtk_source_file_saver_get_buffer ::
Ptr FileSaver ->
IO (Ptr GtkSource.Buffer.Buffer)
fileSaverGetBuffer ::
(B.CallStack.HasCallStack, MonadIO m, IsFileSaver a) =>
a
-> m GtkSource.Buffer.Buffer
fileSaverGetBuffer saver = liftIO $ do
saver' <- unsafeManagedPtrCastPtr saver
result <- gtk_source_file_saver_get_buffer saver'
checkUnexpectedReturnNULL "fileSaverGetBuffer" result
result' <- (newObject GtkSource.Buffer.Buffer) result
touchManagedPtr saver
return result'
#if ENABLE_OVERLOADING
data FileSaverGetBufferMethodInfo
instance (signature ~ (m GtkSource.Buffer.Buffer), MonadIO m, IsFileSaver a) => O.MethodInfo FileSaverGetBufferMethodInfo a signature where
overloadedMethod _ = fileSaverGetBuffer
#endif
foreign import ccall "gtk_source_file_saver_get_compression_type" gtk_source_file_saver_get_compression_type ::
Ptr FileSaver ->
IO CUInt
fileSaverGetCompressionType ::
(B.CallStack.HasCallStack, MonadIO m, IsFileSaver a) =>
a
-> m GtkSource.Enums.CompressionType
fileSaverGetCompressionType saver = liftIO $ do
saver' <- unsafeManagedPtrCastPtr saver
result <- gtk_source_file_saver_get_compression_type saver'
let result' = (toEnum . fromIntegral) result
touchManagedPtr saver
return result'
#if ENABLE_OVERLOADING
data FileSaverGetCompressionTypeMethodInfo
instance (signature ~ (m GtkSource.Enums.CompressionType), MonadIO m, IsFileSaver a) => O.MethodInfo FileSaverGetCompressionTypeMethodInfo a signature where
overloadedMethod _ = fileSaverGetCompressionType
#endif
foreign import ccall "gtk_source_file_saver_get_encoding" gtk_source_file_saver_get_encoding ::
Ptr FileSaver ->
IO (Ptr GtkSource.Encoding.Encoding)
fileSaverGetEncoding ::
(B.CallStack.HasCallStack, MonadIO m, IsFileSaver a) =>
a
-> m GtkSource.Encoding.Encoding
fileSaverGetEncoding saver = liftIO $ do
saver' <- unsafeManagedPtrCastPtr saver
result <- gtk_source_file_saver_get_encoding saver'
checkUnexpectedReturnNULL "fileSaverGetEncoding" result
result' <- (newBoxed GtkSource.Encoding.Encoding) result
touchManagedPtr saver
return result'
#if ENABLE_OVERLOADING
data FileSaverGetEncodingMethodInfo
instance (signature ~ (m GtkSource.Encoding.Encoding), MonadIO m, IsFileSaver a) => O.MethodInfo FileSaverGetEncodingMethodInfo a signature where
overloadedMethod _ = fileSaverGetEncoding
#endif
foreign import ccall "gtk_source_file_saver_get_file" gtk_source_file_saver_get_file ::
Ptr FileSaver ->
IO (Ptr GtkSource.File.File)
fileSaverGetFile ::
(B.CallStack.HasCallStack, MonadIO m, IsFileSaver a) =>
a
-> m GtkSource.File.File
fileSaverGetFile saver = liftIO $ do
saver' <- unsafeManagedPtrCastPtr saver
result <- gtk_source_file_saver_get_file saver'
checkUnexpectedReturnNULL "fileSaverGetFile" result
result' <- (newObject GtkSource.File.File) result
touchManagedPtr saver
return result'
#if ENABLE_OVERLOADING
data FileSaverGetFileMethodInfo
instance (signature ~ (m GtkSource.File.File), MonadIO m, IsFileSaver a) => O.MethodInfo FileSaverGetFileMethodInfo a signature where
overloadedMethod _ = fileSaverGetFile
#endif
foreign import ccall "gtk_source_file_saver_get_flags" gtk_source_file_saver_get_flags ::
Ptr FileSaver ->
IO CUInt
fileSaverGetFlags ::
(B.CallStack.HasCallStack, MonadIO m, IsFileSaver a) =>
a
-> m [GtkSource.Flags.FileSaverFlags]
fileSaverGetFlags saver = liftIO $ do
saver' <- unsafeManagedPtrCastPtr saver
result <- gtk_source_file_saver_get_flags saver'
let result' = wordToGFlags result
touchManagedPtr saver
return result'
#if ENABLE_OVERLOADING
data FileSaverGetFlagsMethodInfo
instance (signature ~ (m [GtkSource.Flags.FileSaverFlags]), MonadIO m, IsFileSaver a) => O.MethodInfo FileSaverGetFlagsMethodInfo a signature where
overloadedMethod _ = fileSaverGetFlags
#endif
foreign import ccall "gtk_source_file_saver_get_location" gtk_source_file_saver_get_location ::
Ptr FileSaver ->
IO (Ptr Gio.File.File)
fileSaverGetLocation ::
(B.CallStack.HasCallStack, MonadIO m, IsFileSaver a) =>
a
-> m Gio.File.File
fileSaverGetLocation saver = liftIO $ do
saver' <- unsafeManagedPtrCastPtr saver
result <- gtk_source_file_saver_get_location saver'
checkUnexpectedReturnNULL "fileSaverGetLocation" result
result' <- (newObject Gio.File.File) result
touchManagedPtr saver
return result'
#if ENABLE_OVERLOADING
data FileSaverGetLocationMethodInfo
instance (signature ~ (m Gio.File.File), MonadIO m, IsFileSaver a) => O.MethodInfo FileSaverGetLocationMethodInfo a signature where
overloadedMethod _ = fileSaverGetLocation
#endif
foreign import ccall "gtk_source_file_saver_get_newline_type" gtk_source_file_saver_get_newline_type ::
Ptr FileSaver ->
IO CUInt
fileSaverGetNewlineType ::
(B.CallStack.HasCallStack, MonadIO m, IsFileSaver a) =>
a
-> m GtkSource.Enums.NewlineType
fileSaverGetNewlineType saver = liftIO $ do
saver' <- unsafeManagedPtrCastPtr saver
result <- gtk_source_file_saver_get_newline_type saver'
let result' = (toEnum . fromIntegral) result
touchManagedPtr saver
return result'
#if ENABLE_OVERLOADING
data FileSaverGetNewlineTypeMethodInfo
instance (signature ~ (m GtkSource.Enums.NewlineType), MonadIO m, IsFileSaver a) => O.MethodInfo FileSaverGetNewlineTypeMethodInfo a signature where
overloadedMethod _ = fileSaverGetNewlineType
#endif
foreign import ccall "gtk_source_file_saver_save_async" gtk_source_file_saver_save_async ::
Ptr FileSaver ->
Int32 ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_FileProgressCallback ->
Ptr () ->
FunPtr GLib.Callbacks.C_DestroyNotify ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
fileSaverSaveAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsFileSaver a, Gio.Cancellable.IsCancellable b) =>
a
-> Int32
-> Maybe (b)
-> Maybe (Gio.Callbacks.FileProgressCallback)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
fileSaverSaveAsync saver ioPriority cancellable progressCallback callback = liftIO $ do
saver' <- unsafeManagedPtrCastPtr saver
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_saver_save_async saver' ioPriority maybeCancellable maybeProgressCallback progressCallbackData progressCallbackNotify maybeCallback userData
touchManagedPtr saver
whenJust cancellable touchManagedPtr
return ()
#if ENABLE_OVERLOADING
data FileSaverSaveAsyncMethodInfo
instance (signature ~ (Int32 -> Maybe (b) -> Maybe (Gio.Callbacks.FileProgressCallback) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsFileSaver a, Gio.Cancellable.IsCancellable b) => O.MethodInfo FileSaverSaveAsyncMethodInfo a signature where
overloadedMethod _ = fileSaverSaveAsync
#endif
foreign import ccall "gtk_source_file_saver_save_finish" gtk_source_file_saver_save_finish ::
Ptr FileSaver ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
fileSaverSaveFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsFileSaver a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
fileSaverSaveFinish saver result_ = liftIO $ do
saver' <- unsafeManagedPtrCastPtr saver
result_' <- unsafeManagedPtrCastPtr result_
onException (do
_ <- propagateGError $ gtk_source_file_saver_save_finish saver' result_'
touchManagedPtr saver
touchManagedPtr result_
return ()
) (do
return ()
)
#if ENABLE_OVERLOADING
data FileSaverSaveFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsFileSaver a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo FileSaverSaveFinishMethodInfo a signature where
overloadedMethod _ = fileSaverSaveFinish
#endif
foreign import ccall "gtk_source_file_saver_set_compression_type" gtk_source_file_saver_set_compression_type ::
Ptr FileSaver ->
CUInt ->
IO ()
fileSaverSetCompressionType ::
(B.CallStack.HasCallStack, MonadIO m, IsFileSaver a) =>
a
-> GtkSource.Enums.CompressionType
-> m ()
fileSaverSetCompressionType saver compressionType = liftIO $ do
saver' <- unsafeManagedPtrCastPtr saver
let compressionType' = (fromIntegral . fromEnum) compressionType
gtk_source_file_saver_set_compression_type saver' compressionType'
touchManagedPtr saver
return ()
#if ENABLE_OVERLOADING
data FileSaverSetCompressionTypeMethodInfo
instance (signature ~ (GtkSource.Enums.CompressionType -> m ()), MonadIO m, IsFileSaver a) => O.MethodInfo FileSaverSetCompressionTypeMethodInfo a signature where
overloadedMethod _ = fileSaverSetCompressionType
#endif
foreign import ccall "gtk_source_file_saver_set_encoding" gtk_source_file_saver_set_encoding ::
Ptr FileSaver ->
Ptr GtkSource.Encoding.Encoding ->
IO ()
fileSaverSetEncoding ::
(B.CallStack.HasCallStack, MonadIO m, IsFileSaver a) =>
a
-> Maybe (GtkSource.Encoding.Encoding)
-> m ()
fileSaverSetEncoding saver encoding = liftIO $ do
saver' <- unsafeManagedPtrCastPtr saver
maybeEncoding <- case encoding of
Nothing -> return nullPtr
Just jEncoding -> do
jEncoding' <- unsafeManagedPtrGetPtr jEncoding
return jEncoding'
gtk_source_file_saver_set_encoding saver' maybeEncoding
touchManagedPtr saver
whenJust encoding touchManagedPtr
return ()
#if ENABLE_OVERLOADING
data FileSaverSetEncodingMethodInfo
instance (signature ~ (Maybe (GtkSource.Encoding.Encoding) -> m ()), MonadIO m, IsFileSaver a) => O.MethodInfo FileSaverSetEncodingMethodInfo a signature where
overloadedMethod _ = fileSaverSetEncoding
#endif
foreign import ccall "gtk_source_file_saver_set_flags" gtk_source_file_saver_set_flags ::
Ptr FileSaver ->
CUInt ->
IO ()
fileSaverSetFlags ::
(B.CallStack.HasCallStack, MonadIO m, IsFileSaver a) =>
a
-> [GtkSource.Flags.FileSaverFlags]
-> m ()
fileSaverSetFlags saver flags = liftIO $ do
saver' <- unsafeManagedPtrCastPtr saver
let flags' = gflagsToWord flags
gtk_source_file_saver_set_flags saver' flags'
touchManagedPtr saver
return ()
#if ENABLE_OVERLOADING
data FileSaverSetFlagsMethodInfo
instance (signature ~ ([GtkSource.Flags.FileSaverFlags] -> m ()), MonadIO m, IsFileSaver a) => O.MethodInfo FileSaverSetFlagsMethodInfo a signature where
overloadedMethod _ = fileSaverSetFlags
#endif
foreign import ccall "gtk_source_file_saver_set_newline_type" gtk_source_file_saver_set_newline_type ::
Ptr FileSaver ->
CUInt ->
IO ()
fileSaverSetNewlineType ::
(B.CallStack.HasCallStack, MonadIO m, IsFileSaver a) =>
a
-> GtkSource.Enums.NewlineType
-> m ()
fileSaverSetNewlineType saver newlineType = liftIO $ do
saver' <- unsafeManagedPtrCastPtr saver
let newlineType' = (fromIntegral . fromEnum) newlineType
gtk_source_file_saver_set_newline_type saver' newlineType'
touchManagedPtr saver
return ()
#if ENABLE_OVERLOADING
data FileSaverSetNewlineTypeMethodInfo
instance (signature ~ (GtkSource.Enums.NewlineType -> m ()), MonadIO m, IsFileSaver a) => O.MethodInfo FileSaverSetNewlineTypeMethodInfo a signature where
overloadedMethod _ = fileSaverSetNewlineType
#endif