{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GtkSource.Objects.File
(
File(..) ,
IsFile ,
toFile ,
noFile ,
#if defined(ENABLE_OVERLOADING)
ResolveFileMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
FileCheckFileOnDiskMethodInfo ,
#endif
fileCheckFileOnDisk ,
#if defined(ENABLE_OVERLOADING)
FileGetCompressionTypeMethodInfo ,
#endif
fileGetCompressionType ,
#if defined(ENABLE_OVERLOADING)
FileGetEncodingMethodInfo ,
#endif
fileGetEncoding ,
#if defined(ENABLE_OVERLOADING)
FileGetLocationMethodInfo ,
#endif
fileGetLocation ,
#if defined(ENABLE_OVERLOADING)
FileGetNewlineTypeMethodInfo ,
#endif
fileGetNewlineType ,
#if defined(ENABLE_OVERLOADING)
FileIsDeletedMethodInfo ,
#endif
fileIsDeleted ,
#if defined(ENABLE_OVERLOADING)
FileIsExternallyModifiedMethodInfo ,
#endif
fileIsExternallyModified ,
#if defined(ENABLE_OVERLOADING)
FileIsLocalMethodInfo ,
#endif
fileIsLocal ,
#if defined(ENABLE_OVERLOADING)
FileIsReadonlyMethodInfo ,
#endif
fileIsReadonly ,
fileNew ,
#if defined(ENABLE_OVERLOADING)
FileSetLocationMethodInfo ,
#endif
fileSetLocation ,
#if defined(ENABLE_OVERLOADING)
FileCompressionTypePropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
fileCompressionType ,
#endif
getFileCompressionType ,
#if defined(ENABLE_OVERLOADING)
FileEncodingPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
fileEncoding ,
#endif
getFileEncoding ,
#if defined(ENABLE_OVERLOADING)
FileLocationPropertyInfo ,
#endif
clearFileLocation ,
constructFileLocation ,
#if defined(ENABLE_OVERLOADING)
fileLocation ,
#endif
getFileLocation ,
setFileLocation ,
#if defined(ENABLE_OVERLOADING)
FileNewlineTypePropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
fileNewlineType ,
#endif
getFileNewlineType ,
#if defined(ENABLE_OVERLOADING)
FileReadOnlyPropertyInfo ,
#endif
#if defined(ENABLE_OVERLOADING)
fileReadOnly ,
#endif
getFileReadOnly ,
) 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.GI.Base.Signals as B.Signals
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.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Interfaces.File as Gio.File
import {-# SOURCE #-} qualified GI.GtkSource.Enums as GtkSource.Enums
import {-# SOURCE #-} qualified GI.GtkSource.Structs.Encoding as GtkSource.Encoding
newtype File = File (ManagedPtr File)
deriving (File -> File -> Bool
(File -> File -> Bool) -> (File -> File -> Bool) -> Eq File
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: File -> File -> Bool
$c/= :: File -> File -> Bool
== :: File -> File -> Bool
$c== :: File -> File -> Bool
Eq)
foreign import ccall "gtk_source_file_get_type"
c_gtk_source_file_get_type :: IO GType
instance GObject File where
gobjectType :: IO GType
gobjectType = IO GType
c_gtk_source_file_get_type
instance B.GValue.IsGValue File where
toGValue :: File -> IO GValue
toGValue o :: File
o = do
GType
gtype <- IO GType
c_gtk_source_file_get_type
File -> (Ptr File -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr File
o (GType -> (GValue -> Ptr File -> IO ()) -> Ptr File -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr File -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO File
fromGValue gv :: GValue
gv = do
Ptr File
ptr <- GValue -> IO (Ptr File)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr File)
(ManagedPtr File -> File) -> Ptr File -> IO File
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr File -> File
File Ptr File
ptr
class (GObject o, O.IsDescendantOf File o) => IsFile o
instance (GObject o, O.IsDescendantOf File o) => IsFile o
instance O.HasParentTypes File
type instance O.ParentTypes File = '[GObject.Object.Object]
toFile :: (MonadIO m, IsFile o) => o -> m File
toFile :: o -> m File
toFile = IO File -> m File
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO File -> m File) -> (o -> IO File) -> o -> m File
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr File -> File) -> o -> IO File
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr File -> File
File
noFile :: Maybe File
noFile :: Maybe File
noFile = Maybe File
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveFileMethod (t :: Symbol) (o :: *) :: * where
ResolveFileMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveFileMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveFileMethod "checkFileOnDisk" o = FileCheckFileOnDiskMethodInfo
ResolveFileMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveFileMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveFileMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveFileMethod "isDeleted" o = FileIsDeletedMethodInfo
ResolveFileMethod "isExternallyModified" o = FileIsExternallyModifiedMethodInfo
ResolveFileMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveFileMethod "isLocal" o = FileIsLocalMethodInfo
ResolveFileMethod "isReadonly" o = FileIsReadonlyMethodInfo
ResolveFileMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveFileMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveFileMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveFileMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveFileMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveFileMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveFileMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveFileMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveFileMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveFileMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveFileMethod "getCompressionType" o = FileGetCompressionTypeMethodInfo
ResolveFileMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveFileMethod "getEncoding" o = FileGetEncodingMethodInfo
ResolveFileMethod "getLocation" o = FileGetLocationMethodInfo
ResolveFileMethod "getNewlineType" o = FileGetNewlineTypeMethodInfo
ResolveFileMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveFileMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveFileMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveFileMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveFileMethod "setLocation" o = FileSetLocationMethodInfo
ResolveFileMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveFileMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveFileMethod t File, O.MethodInfo info File p) => OL.IsLabel t (File -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
getFileCompressionType :: (MonadIO m, IsFile o) => o -> m GtkSource.Enums.CompressionType
getFileCompressionType :: o -> m CompressionType
getFileCompressionType obj :: o
obj = 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
$ o -> String -> IO CompressionType
forall a b. (GObject a, Enum b, BoxedEnum b) => a -> String -> IO b
B.Properties.getObjectPropertyEnum o
obj "compression-type"
#if defined(ENABLE_OVERLOADING)
data FileCompressionTypePropertyInfo
instance AttrInfo FileCompressionTypePropertyInfo where
type AttrAllowedOps FileCompressionTypePropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint FileCompressionTypePropertyInfo = IsFile
type AttrSetTypeConstraint FileCompressionTypePropertyInfo = (~) ()
type AttrTransferTypeConstraint FileCompressionTypePropertyInfo = (~) ()
type AttrTransferType FileCompressionTypePropertyInfo = ()
type AttrGetType FileCompressionTypePropertyInfo = GtkSource.Enums.CompressionType
type AttrLabel FileCompressionTypePropertyInfo = "compression-type"
type AttrOrigin FileCompressionTypePropertyInfo = File
attrGet = getFileCompressionType
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
getFileEncoding :: (MonadIO m, IsFile o) => o -> m GtkSource.Encoding.Encoding
getFileEncoding :: o -> m Encoding
getFileEncoding obj :: o
obj = 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
$ Text -> IO (Maybe Encoding) -> IO Encoding
forall a. HasCallStack => Text -> IO (Maybe a) -> IO a
checkUnexpectedNothing "getFileEncoding" (IO (Maybe Encoding) -> IO Encoding)
-> IO (Maybe Encoding) -> IO Encoding
forall a b. (a -> b) -> a -> b
$ o
-> String
-> (ManagedPtr Encoding -> Encoding)
-> IO (Maybe Encoding)
forall a b.
(GObject a, BoxedObject b) =>
a -> String -> (ManagedPtr b -> b) -> IO (Maybe b)
B.Properties.getObjectPropertyBoxed o
obj "encoding" ManagedPtr Encoding -> Encoding
GtkSource.Encoding.Encoding
#if defined(ENABLE_OVERLOADING)
data FileEncodingPropertyInfo
instance AttrInfo FileEncodingPropertyInfo where
type AttrAllowedOps FileEncodingPropertyInfo = '[ 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint FileEncodingPropertyInfo = IsFile
type AttrSetTypeConstraint FileEncodingPropertyInfo = (~) ()
type AttrTransferTypeConstraint FileEncodingPropertyInfo = (~) ()
type AttrTransferType FileEncodingPropertyInfo = ()
type AttrGetType FileEncodingPropertyInfo = GtkSource.Encoding.Encoding
type AttrLabel FileEncodingPropertyInfo = "encoding"
type AttrOrigin FileEncodingPropertyInfo = File
attrGet = getFileEncoding
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
getFileLocation :: (MonadIO m, IsFile o) => o -> m Gio.File.File
getFileLocation :: o -> m File
getFileLocation obj :: 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 "getFileLocation" (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 "location" ManagedPtr File -> File
Gio.File.File
setFileLocation :: (MonadIO m, IsFile o, Gio.File.IsFile a) => o -> a -> m ()
setFileLocation :: o -> a -> m ()
setFileLocation obj :: o
obj val :: a
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe a -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj "location" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
constructFileLocation :: (IsFile o, Gio.File.IsFile a) => a -> IO (GValueConstruct o)
constructFileLocation :: a -> IO (GValueConstruct o)
constructFileLocation val :: a
val = String -> Maybe a -> IO (GValueConstruct o)
forall a o.
GObject a =>
String -> Maybe a -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyObject "location" (a -> Maybe a
forall a. a -> Maybe a
Just a
val)
clearFileLocation :: (MonadIO m, IsFile o) => o -> m ()
clearFileLocation :: o -> m ()
clearFileLocation obj :: o
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ o -> String -> Maybe File -> IO ()
forall a b.
(GObject a, GObject b) =>
a -> String -> Maybe b -> IO ()
B.Properties.setObjectPropertyObject o
obj "location" (Maybe File
forall a. Maybe a
Nothing :: Maybe Gio.File.File)
#if defined(ENABLE_OVERLOADING)
data FileLocationPropertyInfo
instance AttrInfo FileLocationPropertyInfo where
type AttrAllowedOps FileLocationPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint FileLocationPropertyInfo = IsFile
type AttrSetTypeConstraint FileLocationPropertyInfo = Gio.File.IsFile
type AttrTransferTypeConstraint FileLocationPropertyInfo = Gio.File.IsFile
type AttrTransferType FileLocationPropertyInfo = Gio.File.File
type AttrGetType FileLocationPropertyInfo = Gio.File.File
type AttrLabel FileLocationPropertyInfo = "location"
type AttrOrigin FileLocationPropertyInfo = File
attrGet = getFileLocation
attrSet = setFileLocation
attrTransfer _ v = do
unsafeCastTo Gio.File.File v
attrConstruct = constructFileLocation
attrClear = clearFileLocation
#endif
getFileNewlineType :: (MonadIO m, IsFile o) => o -> m GtkSource.Enums.NewlineType
getFileNewlineType :: o -> m NewlineType
getFileNewlineType obj :: o
obj = 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
$ o -> String -> IO NewlineType
forall a b. (GObject a, Enum b, BoxedEnum b) => a -> String -> IO b
B.Properties.getObjectPropertyEnum o
obj "newline-type"
#if defined(ENABLE_OVERLOADING)
data FileNewlineTypePropertyInfo
instance AttrInfo FileNewlineTypePropertyInfo where
type AttrAllowedOps FileNewlineTypePropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint FileNewlineTypePropertyInfo = IsFile
type AttrSetTypeConstraint FileNewlineTypePropertyInfo = (~) ()
type AttrTransferTypeConstraint FileNewlineTypePropertyInfo = (~) ()
type AttrTransferType FileNewlineTypePropertyInfo = ()
type AttrGetType FileNewlineTypePropertyInfo = GtkSource.Enums.NewlineType
type AttrLabel FileNewlineTypePropertyInfo = "newline-type"
type AttrOrigin FileNewlineTypePropertyInfo = File
attrGet = getFileNewlineType
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
getFileReadOnly :: (MonadIO m, IsFile o) => o -> m Bool
getFileReadOnly :: o -> m Bool
getFileReadOnly obj :: o
obj = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ o -> String -> IO Bool
forall a. GObject a => a -> String -> IO Bool
B.Properties.getObjectPropertyBool o
obj "read-only"
#if defined(ENABLE_OVERLOADING)
data FileReadOnlyPropertyInfo
instance AttrInfo FileReadOnlyPropertyInfo where
type AttrAllowedOps FileReadOnlyPropertyInfo = '[ 'AttrGet]
type AttrBaseTypeConstraint FileReadOnlyPropertyInfo = IsFile
type AttrSetTypeConstraint FileReadOnlyPropertyInfo = (~) ()
type AttrTransferTypeConstraint FileReadOnlyPropertyInfo = (~) ()
type AttrTransferType FileReadOnlyPropertyInfo = ()
type AttrGetType FileReadOnlyPropertyInfo = Bool
type AttrLabel FileReadOnlyPropertyInfo = "read-only"
type AttrOrigin FileReadOnlyPropertyInfo = File
attrGet = getFileReadOnly
attrSet = undefined
attrTransfer _ = undefined
attrConstruct = undefined
attrClear = undefined
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList File
type instance O.AttributeList File = FileAttributeList
type FileAttributeList = ('[ '("compressionType", FileCompressionTypePropertyInfo), '("encoding", FileEncodingPropertyInfo), '("location", FileLocationPropertyInfo), '("newlineType", FileNewlineTypePropertyInfo), '("readOnly", FileReadOnlyPropertyInfo)] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
fileCompressionType :: AttrLabelProxy "compressionType"
fileCompressionType = AttrLabelProxy
fileEncoding :: AttrLabelProxy "encoding"
fileEncoding = AttrLabelProxy
fileLocation :: AttrLabelProxy "location"
fileLocation = AttrLabelProxy
fileNewlineType :: AttrLabelProxy "newlineType"
fileNewlineType = AttrLabelProxy
fileReadOnly :: AttrLabelProxy "readOnly"
fileReadOnly = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList File = FileSignalList
type FileSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gtk_source_file_new" gtk_source_file_new ::
IO (Ptr File)
fileNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m File
fileNew :: m File
fileNew = 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 File
result <- IO (Ptr File)
gtk_source_file_new
Text -> Ptr File -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "fileNew" 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
wrapObject ManagedPtr File -> File
File) Ptr File
result
File -> IO File
forall (m :: * -> *) a. Monad m => a -> m a
return File
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "gtk_source_file_check_file_on_disk" gtk_source_file_check_file_on_disk ::
Ptr File ->
IO ()
fileCheckFileOnDisk ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a) =>
a
-> m ()
fileCheckFileOnDisk :: a -> m ()
fileCheckFileOnDisk file :: a
file = 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 File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
Ptr File -> IO ()
gtk_source_file_check_file_on_disk Ptr File
file'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FileCheckFileOnDiskMethodInfo
instance (signature ~ (m ()), MonadIO m, IsFile a) => O.MethodInfo FileCheckFileOnDiskMethodInfo a signature where
overloadedMethod = fileCheckFileOnDisk
#endif
foreign import ccall "gtk_source_file_get_compression_type" gtk_source_file_get_compression_type ::
Ptr File ->
IO CUInt
fileGetCompressionType ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a) =>
a
-> m GtkSource.Enums.CompressionType
fileGetCompressionType :: a -> m CompressionType
fileGetCompressionType file :: a
file = 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 File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
CUInt
result <- Ptr File -> IO CUInt
gtk_source_file_get_compression_type Ptr File
file'
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
file
CompressionType -> IO CompressionType
forall (m :: * -> *) a. Monad m => a -> m a
return CompressionType
result'
#if defined(ENABLE_OVERLOADING)
data FileGetCompressionTypeMethodInfo
instance (signature ~ (m GtkSource.Enums.CompressionType), MonadIO m, IsFile a) => O.MethodInfo FileGetCompressionTypeMethodInfo a signature where
overloadedMethod = fileGetCompressionType
#endif
foreign import ccall "gtk_source_file_get_encoding" gtk_source_file_get_encoding ::
Ptr File ->
IO (Ptr GtkSource.Encoding.Encoding)
fileGetEncoding ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a) =>
a
-> m GtkSource.Encoding.Encoding
fileGetEncoding :: a -> m Encoding
fileGetEncoding file :: a
file = 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 File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
Ptr Encoding
result <- Ptr File -> IO (Ptr Encoding)
gtk_source_file_get_encoding Ptr File
file'
Text -> Ptr Encoding -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "fileGetEncoding" Ptr Encoding
result
Encoding
result' <- ((ManagedPtr Encoding -> Encoding) -> Ptr Encoding -> IO Encoding
forall a.
(HasCallStack, BoxedObject 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
file
Encoding -> IO Encoding
forall (m :: * -> *) a. Monad m => a -> m a
return Encoding
result'
#if defined(ENABLE_OVERLOADING)
data FileGetEncodingMethodInfo
instance (signature ~ (m GtkSource.Encoding.Encoding), MonadIO m, IsFile a) => O.MethodInfo FileGetEncodingMethodInfo a signature where
overloadedMethod = fileGetEncoding
#endif
foreign import ccall "gtk_source_file_get_location" gtk_source_file_get_location ::
Ptr File ->
IO (Ptr Gio.File.File)
fileGetLocation ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a) =>
a
-> m Gio.File.File
fileGetLocation :: a -> m File
fileGetLocation file :: a
file = 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 File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
Ptr File
result <- Ptr File -> IO (Ptr File)
gtk_source_file_get_location Ptr File
file'
Text -> Ptr File -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "fileGetLocation" 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
Gio.File.File) Ptr File
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
File -> IO File
forall (m :: * -> *) a. Monad m => a -> m a
return File
result'
#if defined(ENABLE_OVERLOADING)
data FileGetLocationMethodInfo
instance (signature ~ (m Gio.File.File), MonadIO m, IsFile a) => O.MethodInfo FileGetLocationMethodInfo a signature where
overloadedMethod = fileGetLocation
#endif
foreign import ccall "gtk_source_file_get_newline_type" gtk_source_file_get_newline_type ::
Ptr File ->
IO CUInt
fileGetNewlineType ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a) =>
a
-> m GtkSource.Enums.NewlineType
fileGetNewlineType :: a -> m NewlineType
fileGetNewlineType file :: a
file = 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 File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
CUInt
result <- Ptr File -> IO CUInt
gtk_source_file_get_newline_type Ptr File
file'
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
file
NewlineType -> IO NewlineType
forall (m :: * -> *) a. Monad m => a -> m a
return NewlineType
result'
#if defined(ENABLE_OVERLOADING)
data FileGetNewlineTypeMethodInfo
instance (signature ~ (m GtkSource.Enums.NewlineType), MonadIO m, IsFile a) => O.MethodInfo FileGetNewlineTypeMethodInfo a signature where
overloadedMethod = fileGetNewlineType
#endif
foreign import ccall "gtk_source_file_is_deleted" gtk_source_file_is_deleted ::
Ptr File ->
IO CInt
fileIsDeleted ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a) =>
a
-> m Bool
fileIsDeleted :: a -> m Bool
fileIsDeleted file :: a
file = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
CInt
result <- Ptr File -> IO CInt
gtk_source_file_is_deleted Ptr File
file'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data FileIsDeletedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFile a) => O.MethodInfo FileIsDeletedMethodInfo a signature where
overloadedMethod = fileIsDeleted
#endif
foreign import ccall "gtk_source_file_is_externally_modified" gtk_source_file_is_externally_modified ::
Ptr File ->
IO CInt
fileIsExternallyModified ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a) =>
a
-> m Bool
fileIsExternallyModified :: a -> m Bool
fileIsExternallyModified file :: a
file = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
CInt
result <- Ptr File -> IO CInt
gtk_source_file_is_externally_modified Ptr File
file'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data FileIsExternallyModifiedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFile a) => O.MethodInfo FileIsExternallyModifiedMethodInfo a signature where
overloadedMethod = fileIsExternallyModified
#endif
foreign import ccall "gtk_source_file_is_local" gtk_source_file_is_local ::
Ptr File ->
IO CInt
fileIsLocal ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a) =>
a
-> m Bool
fileIsLocal :: a -> m Bool
fileIsLocal file :: a
file = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
CInt
result <- Ptr File -> IO CInt
gtk_source_file_is_local Ptr File
file'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data FileIsLocalMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFile a) => O.MethodInfo FileIsLocalMethodInfo a signature where
overloadedMethod = fileIsLocal
#endif
foreign import ccall "gtk_source_file_is_readonly" gtk_source_file_is_readonly ::
Ptr File ->
IO CInt
fileIsReadonly ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a) =>
a
-> m Bool
fileIsReadonly :: a -> m Bool
fileIsReadonly file :: a
file = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
CInt
result <- Ptr File -> IO CInt
gtk_source_file_is_readonly Ptr File
file'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data FileIsReadonlyMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsFile a) => O.MethodInfo FileIsReadonlyMethodInfo a signature where
overloadedMethod = fileIsReadonly
#endif
foreign import ccall "gtk_source_file_set_location" gtk_source_file_set_location ::
Ptr File ->
Ptr Gio.File.File ->
IO ()
fileSetLocation ::
(B.CallStack.HasCallStack, MonadIO m, IsFile a, Gio.File.IsFile b) =>
a
-> Maybe (b)
-> m ()
fileSetLocation :: a -> Maybe b -> m ()
fileSetLocation file :: a
file location :: Maybe b
location = 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 File
file' <- a -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
file
Ptr File
maybeLocation <- case Maybe b
location of
Nothing -> Ptr File -> IO (Ptr File)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr File
forall a. Ptr a
nullPtr
Just jLocation :: b
jLocation -> do
Ptr File
jLocation' <- b -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jLocation
Ptr File -> IO (Ptr File)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr File
jLocation'
Ptr File -> Ptr File -> IO ()
gtk_source_file_set_location Ptr File
file' Ptr File
maybeLocation
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
file
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
location b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data FileSetLocationMethodInfo
instance (signature ~ (Maybe (b) -> m ()), MonadIO m, IsFile a, Gio.File.IsFile b) => O.MethodInfo FileSetLocationMethodInfo a signature where
overloadedMethod = fileSetLocation
#endif