{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Interfaces.Mount
(
Mount(..) ,
IsMount ,
toMount ,
#if defined(ENABLE_OVERLOADING)
ResolveMountMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
MountCanEjectMethodInfo ,
#endif
mountCanEject ,
#if defined(ENABLE_OVERLOADING)
MountCanUnmountMethodInfo ,
#endif
mountCanUnmount ,
#if defined(ENABLE_OVERLOADING)
MountEjectMethodInfo ,
#endif
mountEject ,
#if defined(ENABLE_OVERLOADING)
MountEjectFinishMethodInfo ,
#endif
mountEjectFinish ,
#if defined(ENABLE_OVERLOADING)
MountEjectWithOperationMethodInfo ,
#endif
mountEjectWithOperation ,
#if defined(ENABLE_OVERLOADING)
MountEjectWithOperationFinishMethodInfo ,
#endif
mountEjectWithOperationFinish ,
#if defined(ENABLE_OVERLOADING)
MountGetDefaultLocationMethodInfo ,
#endif
mountGetDefaultLocation ,
#if defined(ENABLE_OVERLOADING)
MountGetDriveMethodInfo ,
#endif
mountGetDrive ,
#if defined(ENABLE_OVERLOADING)
MountGetIconMethodInfo ,
#endif
mountGetIcon ,
#if defined(ENABLE_OVERLOADING)
MountGetNameMethodInfo ,
#endif
mountGetName ,
#if defined(ENABLE_OVERLOADING)
MountGetRootMethodInfo ,
#endif
mountGetRoot ,
#if defined(ENABLE_OVERLOADING)
MountGetSortKeyMethodInfo ,
#endif
mountGetSortKey ,
#if defined(ENABLE_OVERLOADING)
MountGetSymbolicIconMethodInfo ,
#endif
mountGetSymbolicIcon ,
#if defined(ENABLE_OVERLOADING)
MountGetUuidMethodInfo ,
#endif
mountGetUuid ,
#if defined(ENABLE_OVERLOADING)
MountGetVolumeMethodInfo ,
#endif
mountGetVolume ,
#if defined(ENABLE_OVERLOADING)
MountGuessContentTypeMethodInfo ,
#endif
mountGuessContentType ,
#if defined(ENABLE_OVERLOADING)
MountGuessContentTypeFinishMethodInfo ,
#endif
mountGuessContentTypeFinish ,
#if defined(ENABLE_OVERLOADING)
MountGuessContentTypeSyncMethodInfo ,
#endif
mountGuessContentTypeSync ,
#if defined(ENABLE_OVERLOADING)
MountIsShadowedMethodInfo ,
#endif
mountIsShadowed ,
#if defined(ENABLE_OVERLOADING)
MountRemountMethodInfo ,
#endif
mountRemount ,
#if defined(ENABLE_OVERLOADING)
MountRemountFinishMethodInfo ,
#endif
mountRemountFinish ,
#if defined(ENABLE_OVERLOADING)
MountShadowMethodInfo ,
#endif
mountShadow ,
#if defined(ENABLE_OVERLOADING)
MountUnmountMethodInfo ,
#endif
mountUnmount ,
#if defined(ENABLE_OVERLOADING)
MountUnmountFinishMethodInfo ,
#endif
mountUnmountFinish ,
#if defined(ENABLE_OVERLOADING)
MountUnmountWithOperationMethodInfo ,
#endif
mountUnmountWithOperation ,
#if defined(ENABLE_OVERLOADING)
MountUnmountWithOperationFinishMethodInfo,
#endif
mountUnmountWithOperationFinish ,
#if defined(ENABLE_OVERLOADING)
MountUnshadowMethodInfo ,
#endif
mountUnshadow ,
C_MountChangedCallback ,
MountChangedCallback ,
#if defined(ENABLE_OVERLOADING)
MountChangedSignalInfo ,
#endif
afterMountChanged ,
genClosure_MountChanged ,
mk_MountChangedCallback ,
noMountChangedCallback ,
onMountChanged ,
wrap_MountChangedCallback ,
C_MountPreUnmountCallback ,
MountPreUnmountCallback ,
#if defined(ENABLE_OVERLOADING)
MountPreUnmountSignalInfo ,
#endif
afterMountPreUnmount ,
genClosure_MountPreUnmount ,
mk_MountPreUnmountCallback ,
noMountPreUnmountCallback ,
onMountPreUnmount ,
wrap_MountPreUnmountCallback ,
C_MountUnmountedCallback ,
MountUnmountedCallback ,
#if defined(ENABLE_OVERLOADING)
MountUnmountedSignalInfo ,
#endif
afterMountUnmounted ,
genClosure_MountUnmounted ,
mk_MountUnmountedCallback ,
noMountUnmountedCallback ,
onMountUnmounted ,
wrap_MountUnmountedCallback ,
) 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.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import {-# SOURCE #-} qualified GI.Gio.Flags as Gio.Flags
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Drive as Gio.Drive
import {-# SOURCE #-} qualified GI.Gio.Interfaces.File as Gio.File
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Icon as Gio.Icon
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Volume as Gio.Volume
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.MountOperation as Gio.MountOperation
newtype Mount = Mount (SP.ManagedPtr Mount)
deriving (Mount -> Mount -> Bool
(Mount -> Mount -> Bool) -> (Mount -> Mount -> Bool) -> Eq Mount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Mount -> Mount -> Bool
$c/= :: Mount -> Mount -> Bool
== :: Mount -> Mount -> Bool
$c== :: Mount -> Mount -> Bool
Eq)
instance SP.ManagedPtrNewtype Mount where
toManagedPtr :: Mount -> ManagedPtr Mount
toManagedPtr (Mount ManagedPtr Mount
p) = ManagedPtr Mount
p
foreign import ccall "g_mount_get_type"
c_g_mount_get_type :: IO B.Types.GType
instance B.Types.TypedObject Mount where
glibType :: IO GType
glibType = IO GType
c_g_mount_get_type
instance B.Types.GObject Mount
instance B.GValue.IsGValue Mount where
toGValue :: Mount -> IO GValue
toGValue Mount
o = do
GType
gtype <- IO GType
c_g_mount_get_type
Mount -> (Ptr Mount -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Mount
o (GType -> (GValue -> Ptr Mount -> IO ()) -> Ptr Mount -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Mount -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO Mount
fromGValue GValue
gv = do
Ptr Mount
ptr <- GValue -> IO (Ptr Mount)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr Mount)
(ManagedPtr Mount -> Mount) -> Ptr Mount -> IO Mount
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Mount -> Mount
Mount Ptr Mount
ptr
class (SP.GObject o, O.IsDescendantOf Mount o) => IsMount o
instance (SP.GObject o, O.IsDescendantOf Mount o) => IsMount o
instance O.HasParentTypes Mount
type instance O.ParentTypes Mount = '[GObject.Object.Object]
toMount :: (MonadIO m, IsMount o) => o -> m Mount
toMount :: o -> m Mount
toMount = IO Mount -> m Mount
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Mount -> m Mount) -> (o -> IO Mount) -> o -> m Mount
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Mount -> Mount) -> o -> IO Mount
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr Mount -> Mount
Mount
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Mount
type instance O.AttributeList Mount = MountAttributeList
type MountAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveMountMethod (t :: Symbol) (o :: *) :: * where
ResolveMountMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveMountMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveMountMethod "canEject" o = MountCanEjectMethodInfo
ResolveMountMethod "canUnmount" o = MountCanUnmountMethodInfo
ResolveMountMethod "eject" o = MountEjectMethodInfo
ResolveMountMethod "ejectFinish" o = MountEjectFinishMethodInfo
ResolveMountMethod "ejectWithOperation" o = MountEjectWithOperationMethodInfo
ResolveMountMethod "ejectWithOperationFinish" o = MountEjectWithOperationFinishMethodInfo
ResolveMountMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveMountMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveMountMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveMountMethod "guessContentType" o = MountGuessContentTypeMethodInfo
ResolveMountMethod "guessContentTypeFinish" o = MountGuessContentTypeFinishMethodInfo
ResolveMountMethod "guessContentTypeSync" o = MountGuessContentTypeSyncMethodInfo
ResolveMountMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveMountMethod "isShadowed" o = MountIsShadowedMethodInfo
ResolveMountMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveMountMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveMountMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveMountMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveMountMethod "remount" o = MountRemountMethodInfo
ResolveMountMethod "remountFinish" o = MountRemountFinishMethodInfo
ResolveMountMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveMountMethod "shadow" o = MountShadowMethodInfo
ResolveMountMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveMountMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveMountMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveMountMethod "unmount" o = MountUnmountMethodInfo
ResolveMountMethod "unmountFinish" o = MountUnmountFinishMethodInfo
ResolveMountMethod "unmountWithOperation" o = MountUnmountWithOperationMethodInfo
ResolveMountMethod "unmountWithOperationFinish" o = MountUnmountWithOperationFinishMethodInfo
ResolveMountMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveMountMethod "unshadow" o = MountUnshadowMethodInfo
ResolveMountMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveMountMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveMountMethod "getDefaultLocation" o = MountGetDefaultLocationMethodInfo
ResolveMountMethod "getDrive" o = MountGetDriveMethodInfo
ResolveMountMethod "getIcon" o = MountGetIconMethodInfo
ResolveMountMethod "getName" o = MountGetNameMethodInfo
ResolveMountMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveMountMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveMountMethod "getRoot" o = MountGetRootMethodInfo
ResolveMountMethod "getSortKey" o = MountGetSortKeyMethodInfo
ResolveMountMethod "getSymbolicIcon" o = MountGetSymbolicIconMethodInfo
ResolveMountMethod "getUuid" o = MountGetUuidMethodInfo
ResolveMountMethod "getVolume" o = MountGetVolumeMethodInfo
ResolveMountMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveMountMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveMountMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveMountMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveMountMethod t Mount, O.MethodInfo info Mount p) => OL.IsLabel t (Mount -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
foreign import ccall "g_mount_can_eject" g_mount_can_eject ::
Ptr Mount ->
IO CInt
mountCanEject ::
(B.CallStack.HasCallStack, MonadIO m, IsMount a) =>
a
-> m Bool
mountCanEject :: a -> m Bool
mountCanEject a
mount = 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 Mount
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
CInt
result <- Ptr Mount -> IO CInt
g_mount_can_eject Ptr Mount
mount'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
mount
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data MountCanEjectMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsMount a) => O.MethodInfo MountCanEjectMethodInfo a signature where
overloadedMethod = mountCanEject
#endif
foreign import ccall "g_mount_can_unmount" g_mount_can_unmount ::
Ptr Mount ->
IO CInt
mountCanUnmount ::
(B.CallStack.HasCallStack, MonadIO m, IsMount a) =>
a
-> m Bool
mountCanUnmount :: a -> m Bool
mountCanUnmount a
mount = 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 Mount
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
CInt
result <- Ptr Mount -> IO CInt
g_mount_can_unmount Ptr Mount
mount'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
mount
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data MountCanUnmountMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsMount a) => O.MethodInfo MountCanUnmountMethodInfo a signature where
overloadedMethod = mountCanUnmount
#endif
foreign import ccall "g_mount_eject" g_mount_eject ::
Ptr Mount ->
CUInt ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
{-# DEPRECATED mountEject ["(Since version 2.22)","Use 'GI.Gio.Interfaces.Mount.mountEjectWithOperation' instead."] #-}
mountEject ::
(B.CallStack.HasCallStack, MonadIO m, IsMount a, Gio.Cancellable.IsCancellable b) =>
a
-> [Gio.Flags.MountUnmountFlags]
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
mountEject :: a
-> [MountUnmountFlags]
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
mountEject a
mount [MountUnmountFlags]
flags Maybe b
cancellable 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 Mount
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
let flags' :: CUInt
flags' = [MountUnmountFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [MountUnmountFlags]
flags
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_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 userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Mount
-> CUInt
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_mount_eject Ptr Mount
mount' CUInt
flags' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
mount
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 MountEjectMethodInfo
instance (signature ~ ([Gio.Flags.MountUnmountFlags] -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsMount a, Gio.Cancellable.IsCancellable b) => O.MethodInfo MountEjectMethodInfo a signature where
overloadedMethod = mountEject
#endif
foreign import ccall "g_mount_eject_finish" g_mount_eject_finish ::
Ptr Mount ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
{-# DEPRECATED mountEjectFinish ["(Since version 2.22)","Use 'GI.Gio.Interfaces.Mount.mountEjectWithOperationFinish' instead."] #-}
mountEjectFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
mountEjectFinish :: a -> b -> m ()
mountEjectFinish a
mount 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 Mount
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
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 Mount -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
g_mount_eject_finish Ptr Mount
mount' Ptr AsyncResult
result_'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
mount
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 MountEjectFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo MountEjectFinishMethodInfo a signature where
overloadedMethod = mountEjectFinish
#endif
foreign import ccall "g_mount_eject_with_operation" g_mount_eject_with_operation ::
Ptr Mount ->
CUInt ->
Ptr Gio.MountOperation.MountOperation ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
mountEjectWithOperation ::
(B.CallStack.HasCallStack, MonadIO m, IsMount a, Gio.MountOperation.IsMountOperation b, Gio.Cancellable.IsCancellable c) =>
a
-> [Gio.Flags.MountUnmountFlags]
-> Maybe (b)
-> Maybe (c)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
mountEjectWithOperation :: a
-> [MountUnmountFlags]
-> Maybe b
-> Maybe c
-> Maybe AsyncReadyCallback
-> m ()
mountEjectWithOperation a
mount [MountUnmountFlags]
flags Maybe b
mountOperation Maybe c
cancellable 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 Mount
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
let flags' :: CUInt
flags' = [MountUnmountFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [MountUnmountFlags]
flags
Ptr MountOperation
maybeMountOperation <- case Maybe b
mountOperation of
Maybe b
Nothing -> Ptr MountOperation -> IO (Ptr MountOperation)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr MountOperation
forall a. Ptr a
nullPtr
Just b
jMountOperation -> do
Ptr MountOperation
jMountOperation' <- b -> IO (Ptr MountOperation)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jMountOperation
Ptr MountOperation -> IO (Ptr MountOperation)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr MountOperation
jMountOperation'
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
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 userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Mount
-> CUInt
-> Ptr MountOperation
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_mount_eject_with_operation Ptr Mount
mount' CUInt
flags' Ptr MountOperation
maybeMountOperation Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
mount
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
mountOperation b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data MountEjectWithOperationMethodInfo
instance (signature ~ ([Gio.Flags.MountUnmountFlags] -> Maybe (b) -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsMount a, Gio.MountOperation.IsMountOperation b, Gio.Cancellable.IsCancellable c) => O.MethodInfo MountEjectWithOperationMethodInfo a signature where
overloadedMethod = mountEjectWithOperation
#endif
foreign import ccall "g_mount_eject_with_operation_finish" g_mount_eject_with_operation_finish ::
Ptr Mount ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
mountEjectWithOperationFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
mountEjectWithOperationFinish :: a -> b -> m ()
mountEjectWithOperationFinish a
mount 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 Mount
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
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 Mount -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
g_mount_eject_with_operation_finish Ptr Mount
mount' Ptr AsyncResult
result_'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
mount
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 MountEjectWithOperationFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo MountEjectWithOperationFinishMethodInfo a signature where
overloadedMethod = mountEjectWithOperationFinish
#endif
foreign import ccall "g_mount_get_default_location" g_mount_get_default_location ::
Ptr Mount ->
IO (Ptr Gio.File.File)
mountGetDefaultLocation ::
(B.CallStack.HasCallStack, MonadIO m, IsMount a) =>
a
-> m Gio.File.File
mountGetDefaultLocation :: a -> m File
mountGetDefaultLocation a
mount = 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 Mount
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
Ptr File
result <- Ptr Mount -> IO (Ptr File)
g_mount_get_default_location Ptr Mount
mount'
Text -> Ptr File -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"mountGetDefaultLocation" 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
Gio.File.File) Ptr File
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
mount
File -> IO File
forall (m :: * -> *) a. Monad m => a -> m a
return File
result'
#if defined(ENABLE_OVERLOADING)
data MountGetDefaultLocationMethodInfo
instance (signature ~ (m Gio.File.File), MonadIO m, IsMount a) => O.MethodInfo MountGetDefaultLocationMethodInfo a signature where
overloadedMethod = mountGetDefaultLocation
#endif
foreign import ccall "g_mount_get_drive" g_mount_get_drive ::
Ptr Mount ->
IO (Ptr Gio.Drive.Drive)
mountGetDrive ::
(B.CallStack.HasCallStack, MonadIO m, IsMount a) =>
a
-> m (Maybe Gio.Drive.Drive)
mountGetDrive :: a -> m (Maybe Drive)
mountGetDrive a
mount = IO (Maybe Drive) -> m (Maybe Drive)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Drive) -> m (Maybe Drive))
-> IO (Maybe Drive) -> m (Maybe Drive)
forall a b. (a -> b) -> a -> b
$ do
Ptr Mount
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
Ptr Drive
result <- Ptr Mount -> IO (Ptr Drive)
g_mount_get_drive Ptr Mount
mount'
Maybe Drive
maybeResult <- Ptr Drive -> (Ptr Drive -> IO Drive) -> IO (Maybe Drive)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Drive
result ((Ptr Drive -> IO Drive) -> IO (Maybe Drive))
-> (Ptr Drive -> IO Drive) -> IO (Maybe Drive)
forall a b. (a -> b) -> a -> b
$ \Ptr Drive
result' -> do
Drive
result'' <- ((ManagedPtr Drive -> Drive) -> Ptr Drive -> IO Drive
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Drive -> Drive
Gio.Drive.Drive) Ptr Drive
result'
Drive -> IO Drive
forall (m :: * -> *) a. Monad m => a -> m a
return Drive
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
mount
Maybe Drive -> IO (Maybe Drive)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Drive
maybeResult
#if defined(ENABLE_OVERLOADING)
data MountGetDriveMethodInfo
instance (signature ~ (m (Maybe Gio.Drive.Drive)), MonadIO m, IsMount a) => O.MethodInfo MountGetDriveMethodInfo a signature where
overloadedMethod = mountGetDrive
#endif
foreign import ccall "g_mount_get_icon" g_mount_get_icon ::
Ptr Mount ->
IO (Ptr Gio.Icon.Icon)
mountGetIcon ::
(B.CallStack.HasCallStack, MonadIO m, IsMount a) =>
a
-> m Gio.Icon.Icon
mountGetIcon :: a -> m Icon
mountGetIcon a
mount = IO Icon -> m Icon
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Icon -> m Icon) -> IO Icon -> m Icon
forall a b. (a -> b) -> a -> b
$ do
Ptr Mount
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
Ptr Icon
result <- Ptr Mount -> IO (Ptr Icon)
g_mount_get_icon Ptr Mount
mount'
Text -> Ptr Icon -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"mountGetIcon" Ptr Icon
result
Icon
result' <- ((ManagedPtr Icon -> Icon) -> Ptr Icon -> IO Icon
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Icon -> Icon
Gio.Icon.Icon) Ptr Icon
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
mount
Icon -> IO Icon
forall (m :: * -> *) a. Monad m => a -> m a
return Icon
result'
#if defined(ENABLE_OVERLOADING)
data MountGetIconMethodInfo
instance (signature ~ (m Gio.Icon.Icon), MonadIO m, IsMount a) => O.MethodInfo MountGetIconMethodInfo a signature where
overloadedMethod = mountGetIcon
#endif
foreign import ccall "g_mount_get_name" g_mount_get_name ::
Ptr Mount ->
IO CString
mountGetName ::
(B.CallStack.HasCallStack, MonadIO m, IsMount a) =>
a
-> m T.Text
mountGetName :: a -> m Text
mountGetName a
mount = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr Mount
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
CString
result <- Ptr Mount -> IO CString
g_mount_get_name Ptr Mount
mount'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"mountGetName" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
mount
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data MountGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsMount a) => O.MethodInfo MountGetNameMethodInfo a signature where
overloadedMethod = mountGetName
#endif
foreign import ccall "g_mount_get_root" g_mount_get_root ::
Ptr Mount ->
IO (Ptr Gio.File.File)
mountGetRoot ::
(B.CallStack.HasCallStack, MonadIO m, IsMount a) =>
a
-> m Gio.File.File
mountGetRoot :: a -> m File
mountGetRoot a
mount = 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 Mount
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
Ptr File
result <- Ptr Mount -> IO (Ptr File)
g_mount_get_root Ptr Mount
mount'
Text -> Ptr File -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"mountGetRoot" 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
Gio.File.File) Ptr File
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
mount
File -> IO File
forall (m :: * -> *) a. Monad m => a -> m a
return File
result'
#if defined(ENABLE_OVERLOADING)
data MountGetRootMethodInfo
instance (signature ~ (m Gio.File.File), MonadIO m, IsMount a) => O.MethodInfo MountGetRootMethodInfo a signature where
overloadedMethod = mountGetRoot
#endif
foreign import ccall "g_mount_get_sort_key" g_mount_get_sort_key ::
Ptr Mount ->
IO CString
mountGetSortKey ::
(B.CallStack.HasCallStack, MonadIO m, IsMount a) =>
a
-> m (Maybe T.Text)
mountGetSortKey :: a -> m (Maybe Text)
mountGetSortKey a
mount = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
Ptr Mount
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
CString
result <- Ptr Mount -> IO CString
g_mount_get_sort_key Ptr Mount
mount'
Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
result' -> do
Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
mount
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data MountGetSortKeyMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsMount a) => O.MethodInfo MountGetSortKeyMethodInfo a signature where
overloadedMethod = mountGetSortKey
#endif
foreign import ccall "g_mount_get_symbolic_icon" g_mount_get_symbolic_icon ::
Ptr Mount ->
IO (Ptr Gio.Icon.Icon)
mountGetSymbolicIcon ::
(B.CallStack.HasCallStack, MonadIO m, IsMount a) =>
a
-> m Gio.Icon.Icon
mountGetSymbolicIcon :: a -> m Icon
mountGetSymbolicIcon a
mount = IO Icon -> m Icon
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Icon -> m Icon) -> IO Icon -> m Icon
forall a b. (a -> b) -> a -> b
$ do
Ptr Mount
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
Ptr Icon
result <- Ptr Mount -> IO (Ptr Icon)
g_mount_get_symbolic_icon Ptr Mount
mount'
Text -> Ptr Icon -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"mountGetSymbolicIcon" Ptr Icon
result
Icon
result' <- ((ManagedPtr Icon -> Icon) -> Ptr Icon -> IO Icon
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Icon -> Icon
Gio.Icon.Icon) Ptr Icon
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
mount
Icon -> IO Icon
forall (m :: * -> *) a. Monad m => a -> m a
return Icon
result'
#if defined(ENABLE_OVERLOADING)
data MountGetSymbolicIconMethodInfo
instance (signature ~ (m Gio.Icon.Icon), MonadIO m, IsMount a) => O.MethodInfo MountGetSymbolicIconMethodInfo a signature where
overloadedMethod = mountGetSymbolicIcon
#endif
foreign import ccall "g_mount_get_uuid" g_mount_get_uuid ::
Ptr Mount ->
IO CString
mountGetUuid ::
(B.CallStack.HasCallStack, MonadIO m, IsMount a) =>
a
-> m (Maybe T.Text)
mountGetUuid :: a -> m (Maybe Text)
mountGetUuid a
mount = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
Ptr Mount
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
CString
result <- Ptr Mount -> IO CString
g_mount_get_uuid Ptr Mount
mount'
Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
result' -> do
Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
mount
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data MountGetUuidMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsMount a) => O.MethodInfo MountGetUuidMethodInfo a signature where
overloadedMethod = mountGetUuid
#endif
foreign import ccall "g_mount_get_volume" g_mount_get_volume ::
Ptr Mount ->
IO (Ptr Gio.Volume.Volume)
mountGetVolume ::
(B.CallStack.HasCallStack, MonadIO m, IsMount a) =>
a
-> m (Maybe Gio.Volume.Volume)
mountGetVolume :: a -> m (Maybe Volume)
mountGetVolume a
mount = IO (Maybe Volume) -> m (Maybe Volume)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Volume) -> m (Maybe Volume))
-> IO (Maybe Volume) -> m (Maybe Volume)
forall a b. (a -> b) -> a -> b
$ do
Ptr Mount
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
Ptr Volume
result <- Ptr Mount -> IO (Ptr Volume)
g_mount_get_volume Ptr Mount
mount'
Maybe Volume
maybeResult <- Ptr Volume -> (Ptr Volume -> IO Volume) -> IO (Maybe Volume)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Volume
result ((Ptr Volume -> IO Volume) -> IO (Maybe Volume))
-> (Ptr Volume -> IO Volume) -> IO (Maybe Volume)
forall a b. (a -> b) -> a -> b
$ \Ptr Volume
result' -> do
Volume
result'' <- ((ManagedPtr Volume -> Volume) -> Ptr Volume -> IO Volume
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Volume -> Volume
Gio.Volume.Volume) Ptr Volume
result'
Volume -> IO Volume
forall (m :: * -> *) a. Monad m => a -> m a
return Volume
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
mount
Maybe Volume -> IO (Maybe Volume)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Volume
maybeResult
#if defined(ENABLE_OVERLOADING)
data MountGetVolumeMethodInfo
instance (signature ~ (m (Maybe Gio.Volume.Volume)), MonadIO m, IsMount a) => O.MethodInfo MountGetVolumeMethodInfo a signature where
overloadedMethod = mountGetVolume
#endif
foreign import ccall "g_mount_guess_content_type" g_mount_guess_content_type ::
Ptr Mount ->
CInt ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
mountGuessContentType ::
(B.CallStack.HasCallStack, MonadIO m, IsMount a, Gio.Cancellable.IsCancellable b) =>
a
-> Bool
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
mountGuessContentType :: a -> Bool -> Maybe b -> Maybe AsyncReadyCallback -> m ()
mountGuessContentType a
mount Bool
forceRescan Maybe b
cancellable 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 Mount
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
let forceRescan' :: CInt
forceRescan' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
forceRescan
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_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 userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Mount
-> CInt
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_mount_guess_content_type Ptr Mount
mount' CInt
forceRescan' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
mount
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 MountGuessContentTypeMethodInfo
instance (signature ~ (Bool -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsMount a, Gio.Cancellable.IsCancellable b) => O.MethodInfo MountGuessContentTypeMethodInfo a signature where
overloadedMethod = mountGuessContentType
#endif
foreign import ccall "g_mount_guess_content_type_finish" g_mount_guess_content_type_finish ::
Ptr Mount ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr CString)
mountGuessContentTypeFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m [T.Text]
mountGuessContentTypeFinish :: a -> b -> m [Text]
mountGuessContentTypeFinish a
mount b
result_ = IO [Text] -> m [Text]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
Ptr Mount
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
IO [Text] -> IO () -> IO [Text]
forall a b. IO a -> IO b -> IO a
onException (do
Ptr CString
result <- (Ptr (Ptr GError) -> IO (Ptr CString)) -> IO (Ptr CString)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr CString)) -> IO (Ptr CString))
-> (Ptr (Ptr GError) -> IO (Ptr CString)) -> IO (Ptr CString)
forall a b. (a -> b) -> a -> b
$ Ptr Mount
-> Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr CString)
g_mount_guess_content_type_finish Ptr Mount
mount' Ptr AsyncResult
result_'
Text -> Ptr CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"mountGuessContentTypeFinish" Ptr CString
result
[Text]
result' <- HasCallStack => Ptr CString -> IO [Text]
Ptr CString -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr CString
result
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
result
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
mount
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
[Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data MountGuessContentTypeFinishMethodInfo
instance (signature ~ (b -> m [T.Text]), MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo MountGuessContentTypeFinishMethodInfo a signature where
overloadedMethod = mountGuessContentTypeFinish
#endif
foreign import ccall "g_mount_guess_content_type_sync" g_mount_guess_content_type_sync ::
Ptr Mount ->
CInt ->
Ptr Gio.Cancellable.Cancellable ->
Ptr (Ptr GError) ->
IO (Ptr CString)
mountGuessContentTypeSync ::
(B.CallStack.HasCallStack, MonadIO m, IsMount a, Gio.Cancellable.IsCancellable b) =>
a
-> Bool
-> Maybe (b)
-> m [T.Text]
mountGuessContentTypeSync :: a -> Bool -> Maybe b -> m [Text]
mountGuessContentTypeSync a
mount Bool
forceRescan Maybe b
cancellable = IO [Text] -> m [Text]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
Ptr Mount
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
let forceRescan' :: CInt
forceRescan' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
forceRescan
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'
IO [Text] -> IO () -> IO [Text]
forall a b. IO a -> IO b -> IO a
onException (do
Ptr CString
result <- (Ptr (Ptr GError) -> IO (Ptr CString)) -> IO (Ptr CString)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr CString)) -> IO (Ptr CString))
-> (Ptr (Ptr GError) -> IO (Ptr CString)) -> IO (Ptr CString)
forall a b. (a -> b) -> a -> b
$ Ptr Mount
-> CInt -> Ptr Cancellable -> Ptr (Ptr GError) -> IO (Ptr CString)
g_mount_guess_content_type_sync Ptr Mount
mount' CInt
forceRescan' Ptr Cancellable
maybeCancellable
Text -> Ptr CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"mountGuessContentTypeSync" Ptr CString
result
[Text]
result' <- HasCallStack => Ptr CString -> IO [Text]
Ptr CString -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr CString
result
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
result
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
mount
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
[Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result'
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data MountGuessContentTypeSyncMethodInfo
instance (signature ~ (Bool -> Maybe (b) -> m [T.Text]), MonadIO m, IsMount a, Gio.Cancellable.IsCancellable b) => O.MethodInfo MountGuessContentTypeSyncMethodInfo a signature where
overloadedMethod = mountGuessContentTypeSync
#endif
foreign import ccall "g_mount_is_shadowed" g_mount_is_shadowed ::
Ptr Mount ->
IO CInt
mountIsShadowed ::
(B.CallStack.HasCallStack, MonadIO m, IsMount a) =>
a
-> m Bool
mountIsShadowed :: a -> m Bool
mountIsShadowed a
mount = 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 Mount
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
CInt
result <- Ptr Mount -> IO CInt
g_mount_is_shadowed Ptr Mount
mount'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
mount
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data MountIsShadowedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsMount a) => O.MethodInfo MountIsShadowedMethodInfo a signature where
overloadedMethod = mountIsShadowed
#endif
foreign import ccall "g_mount_remount" g_mount_remount ::
Ptr Mount ->
CUInt ->
Ptr Gio.MountOperation.MountOperation ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
mountRemount ::
(B.CallStack.HasCallStack, MonadIO m, IsMount a, Gio.MountOperation.IsMountOperation b, Gio.Cancellable.IsCancellable c) =>
a
-> [Gio.Flags.MountMountFlags]
-> Maybe (b)
-> Maybe (c)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
mountRemount :: a
-> [MountMountFlags]
-> Maybe b
-> Maybe c
-> Maybe AsyncReadyCallback
-> m ()
mountRemount a
mount [MountMountFlags]
flags Maybe b
mountOperation Maybe c
cancellable 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 Mount
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
let flags' :: CUInt
flags' = [MountMountFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [MountMountFlags]
flags
Ptr MountOperation
maybeMountOperation <- case Maybe b
mountOperation of
Maybe b
Nothing -> Ptr MountOperation -> IO (Ptr MountOperation)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr MountOperation
forall a. Ptr a
nullPtr
Just b
jMountOperation -> do
Ptr MountOperation
jMountOperation' <- b -> IO (Ptr MountOperation)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jMountOperation
Ptr MountOperation -> IO (Ptr MountOperation)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr MountOperation
jMountOperation'
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
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 userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Mount
-> CUInt
-> Ptr MountOperation
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_mount_remount Ptr Mount
mount' CUInt
flags' Ptr MountOperation
maybeMountOperation Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
mount
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
mountOperation b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data MountRemountMethodInfo
instance (signature ~ ([Gio.Flags.MountMountFlags] -> Maybe (b) -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsMount a, Gio.MountOperation.IsMountOperation b, Gio.Cancellable.IsCancellable c) => O.MethodInfo MountRemountMethodInfo a signature where
overloadedMethod = mountRemount
#endif
foreign import ccall "g_mount_remount_finish" g_mount_remount_finish ::
Ptr Mount ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
mountRemountFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
mountRemountFinish :: a -> b -> m ()
mountRemountFinish a
mount 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 Mount
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
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 Mount -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
g_mount_remount_finish Ptr Mount
mount' Ptr AsyncResult
result_'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
mount
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 MountRemountFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo MountRemountFinishMethodInfo a signature where
overloadedMethod = mountRemountFinish
#endif
foreign import ccall "g_mount_shadow" g_mount_shadow ::
Ptr Mount ->
IO ()
mountShadow ::
(B.CallStack.HasCallStack, MonadIO m, IsMount a) =>
a
-> m ()
mountShadow :: a -> m ()
mountShadow a
mount = 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 Mount
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
Ptr Mount -> IO ()
g_mount_shadow Ptr Mount
mount'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
mount
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data MountShadowMethodInfo
instance (signature ~ (m ()), MonadIO m, IsMount a) => O.MethodInfo MountShadowMethodInfo a signature where
overloadedMethod = mountShadow
#endif
foreign import ccall "g_mount_unmount" g_mount_unmount ::
Ptr Mount ->
CUInt ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
{-# DEPRECATED mountUnmount ["(Since version 2.22)","Use 'GI.Gio.Interfaces.Mount.mountUnmountWithOperation' instead."] #-}
mountUnmount ::
(B.CallStack.HasCallStack, MonadIO m, IsMount a, Gio.Cancellable.IsCancellable b) =>
a
-> [Gio.Flags.MountUnmountFlags]
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
mountUnmount :: a
-> [MountUnmountFlags]
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
mountUnmount a
mount [MountUnmountFlags]
flags Maybe b
cancellable 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 Mount
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
let flags' :: CUInt
flags' = [MountUnmountFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [MountUnmountFlags]
flags
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_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 userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Mount
-> CUInt
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_mount_unmount Ptr Mount
mount' CUInt
flags' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
mount
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 MountUnmountMethodInfo
instance (signature ~ ([Gio.Flags.MountUnmountFlags] -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsMount a, Gio.Cancellable.IsCancellable b) => O.MethodInfo MountUnmountMethodInfo a signature where
overloadedMethod = mountUnmount
#endif
foreign import ccall "g_mount_unmount_finish" g_mount_unmount_finish ::
Ptr Mount ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
{-# DEPRECATED mountUnmountFinish ["(Since version 2.22)","Use 'GI.Gio.Interfaces.Mount.mountUnmountWithOperationFinish' instead."] #-}
mountUnmountFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
mountUnmountFinish :: a -> b -> m ()
mountUnmountFinish a
mount 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 Mount
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
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 Mount -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
g_mount_unmount_finish Ptr Mount
mount' Ptr AsyncResult
result_'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
mount
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 MountUnmountFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo MountUnmountFinishMethodInfo a signature where
overloadedMethod = mountUnmountFinish
#endif
foreign import ccall "g_mount_unmount_with_operation" g_mount_unmount_with_operation ::
Ptr Mount ->
CUInt ->
Ptr Gio.MountOperation.MountOperation ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
mountUnmountWithOperation ::
(B.CallStack.HasCallStack, MonadIO m, IsMount a, Gio.MountOperation.IsMountOperation b, Gio.Cancellable.IsCancellable c) =>
a
-> [Gio.Flags.MountUnmountFlags]
-> Maybe (b)
-> Maybe (c)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
mountUnmountWithOperation :: a
-> [MountUnmountFlags]
-> Maybe b
-> Maybe c
-> Maybe AsyncReadyCallback
-> m ()
mountUnmountWithOperation a
mount [MountUnmountFlags]
flags Maybe b
mountOperation Maybe c
cancellable 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 Mount
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
let flags' :: CUInt
flags' = [MountUnmountFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [MountUnmountFlags]
flags
Ptr MountOperation
maybeMountOperation <- case Maybe b
mountOperation of
Maybe b
Nothing -> Ptr MountOperation -> IO (Ptr MountOperation)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr MountOperation
forall a. Ptr a
nullPtr
Just b
jMountOperation -> do
Ptr MountOperation
jMountOperation' <- b -> IO (Ptr MountOperation)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jMountOperation
Ptr MountOperation -> IO (Ptr MountOperation)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr MountOperation
jMountOperation'
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
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 userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr Mount
-> CUInt
-> Ptr MountOperation
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_mount_unmount_with_operation Ptr Mount
mount' CUInt
flags' Ptr MountOperation
maybeMountOperation Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
mount
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
mountOperation b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data MountUnmountWithOperationMethodInfo
instance (signature ~ ([Gio.Flags.MountUnmountFlags] -> Maybe (b) -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsMount a, Gio.MountOperation.IsMountOperation b, Gio.Cancellable.IsCancellable c) => O.MethodInfo MountUnmountWithOperationMethodInfo a signature where
overloadedMethod = mountUnmountWithOperation
#endif
foreign import ccall "g_mount_unmount_with_operation_finish" g_mount_unmount_with_operation_finish ::
Ptr Mount ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
mountUnmountWithOperationFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
mountUnmountWithOperationFinish :: a -> b -> m ()
mountUnmountWithOperationFinish a
mount 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 Mount
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
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 Mount -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
g_mount_unmount_with_operation_finish Ptr Mount
mount' Ptr AsyncResult
result_'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
mount
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 MountUnmountWithOperationFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo MountUnmountWithOperationFinishMethodInfo a signature where
overloadedMethod = mountUnmountWithOperationFinish
#endif
foreign import ccall "g_mount_unshadow" g_mount_unshadow ::
Ptr Mount ->
IO ()
mountUnshadow ::
(B.CallStack.HasCallStack, MonadIO m, IsMount a) =>
a
-> m ()
mountUnshadow :: a -> m ()
mountUnshadow a
mount = 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 Mount
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
Ptr Mount -> IO ()
g_mount_unshadow Ptr Mount
mount'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
mount
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data MountUnshadowMethodInfo
instance (signature ~ (m ()), MonadIO m, IsMount a) => O.MethodInfo MountUnshadowMethodInfo a signature where
overloadedMethod = mountUnshadow
#endif
type MountChangedCallback =
IO ()
noMountChangedCallback :: Maybe MountChangedCallback
noMountChangedCallback :: Maybe (IO ())
noMountChangedCallback = Maybe (IO ())
forall a. Maybe a
Nothing
type C_MountChangedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_MountChangedCallback :: C_MountChangedCallback -> IO (FunPtr C_MountChangedCallback)
genClosure_MountChanged :: MonadIO m => MountChangedCallback -> m (GClosure C_MountChangedCallback)
genClosure_MountChanged :: IO () -> m (GClosure C_MountChangedCallback)
genClosure_MountChanged IO ()
cb = IO (GClosure C_MountChangedCallback)
-> m (GClosure C_MountChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_MountChangedCallback)
-> m (GClosure C_MountChangedCallback))
-> IO (GClosure C_MountChangedCallback)
-> m (GClosure C_MountChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_MountChangedCallback
cb' = IO () -> C_MountChangedCallback
wrap_MountChangedCallback IO ()
cb
C_MountChangedCallback -> IO (FunPtr C_MountChangedCallback)
mk_MountChangedCallback C_MountChangedCallback
cb' IO (FunPtr C_MountChangedCallback)
-> (FunPtr C_MountChangedCallback
-> IO (GClosure C_MountChangedCallback))
-> IO (GClosure C_MountChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_MountChangedCallback
-> IO (GClosure C_MountChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_MountChangedCallback ::
MountChangedCallback ->
C_MountChangedCallback
wrap_MountChangedCallback :: IO () -> C_MountChangedCallback
wrap_MountChangedCallback IO ()
_cb Ptr ()
_ Ptr ()
_ = do
IO ()
_cb
onMountChanged :: (IsMount a, MonadIO m) => a -> MountChangedCallback -> m SignalHandlerId
onMountChanged :: a -> IO () -> m SignalHandlerId
onMountChanged a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_MountChangedCallback
cb' = IO () -> C_MountChangedCallback
wrap_MountChangedCallback IO ()
cb
FunPtr C_MountChangedCallback
cb'' <- C_MountChangedCallback -> IO (FunPtr C_MountChangedCallback)
mk_MountChangedCallback C_MountChangedCallback
cb'
a
-> Text
-> FunPtr C_MountChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"changed" FunPtr C_MountChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterMountChanged :: (IsMount a, MonadIO m) => a -> MountChangedCallback -> m SignalHandlerId
afterMountChanged :: a -> IO () -> m SignalHandlerId
afterMountChanged a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_MountChangedCallback
cb' = IO () -> C_MountChangedCallback
wrap_MountChangedCallback IO ()
cb
FunPtr C_MountChangedCallback
cb'' <- C_MountChangedCallback -> IO (FunPtr C_MountChangedCallback)
mk_MountChangedCallback C_MountChangedCallback
cb'
a
-> Text
-> FunPtr C_MountChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"changed" FunPtr C_MountChangedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data MountChangedSignalInfo
instance SignalInfo MountChangedSignalInfo where
type HaskellCallbackType MountChangedSignalInfo = MountChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_MountChangedCallback cb
cb'' <- mk_MountChangedCallback cb'
connectSignalFunPtr obj "changed" cb'' connectMode detail
#endif
type MountPreUnmountCallback =
IO ()
noMountPreUnmountCallback :: Maybe MountPreUnmountCallback
noMountPreUnmountCallback :: Maybe (IO ())
noMountPreUnmountCallback = Maybe (IO ())
forall a. Maybe a
Nothing
type C_MountPreUnmountCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_MountPreUnmountCallback :: C_MountPreUnmountCallback -> IO (FunPtr C_MountPreUnmountCallback)
genClosure_MountPreUnmount :: MonadIO m => MountPreUnmountCallback -> m (GClosure C_MountPreUnmountCallback)
genClosure_MountPreUnmount :: IO () -> m (GClosure C_MountChangedCallback)
genClosure_MountPreUnmount IO ()
cb = IO (GClosure C_MountChangedCallback)
-> m (GClosure C_MountChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_MountChangedCallback)
-> m (GClosure C_MountChangedCallback))
-> IO (GClosure C_MountChangedCallback)
-> m (GClosure C_MountChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_MountChangedCallback
cb' = IO () -> C_MountChangedCallback
wrap_MountPreUnmountCallback IO ()
cb
C_MountChangedCallback -> IO (FunPtr C_MountChangedCallback)
mk_MountPreUnmountCallback C_MountChangedCallback
cb' IO (FunPtr C_MountChangedCallback)
-> (FunPtr C_MountChangedCallback
-> IO (GClosure C_MountChangedCallback))
-> IO (GClosure C_MountChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_MountChangedCallback
-> IO (GClosure C_MountChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_MountPreUnmountCallback ::
MountPreUnmountCallback ->
C_MountPreUnmountCallback
wrap_MountPreUnmountCallback :: IO () -> C_MountChangedCallback
wrap_MountPreUnmountCallback IO ()
_cb Ptr ()
_ Ptr ()
_ = do
IO ()
_cb
onMountPreUnmount :: (IsMount a, MonadIO m) => a -> MountPreUnmountCallback -> m SignalHandlerId
onMountPreUnmount :: a -> IO () -> m SignalHandlerId
onMountPreUnmount a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_MountChangedCallback
cb' = IO () -> C_MountChangedCallback
wrap_MountPreUnmountCallback IO ()
cb
FunPtr C_MountChangedCallback
cb'' <- C_MountChangedCallback -> IO (FunPtr C_MountChangedCallback)
mk_MountPreUnmountCallback C_MountChangedCallback
cb'
a
-> Text
-> FunPtr C_MountChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"pre-unmount" FunPtr C_MountChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterMountPreUnmount :: (IsMount a, MonadIO m) => a -> MountPreUnmountCallback -> m SignalHandlerId
afterMountPreUnmount :: a -> IO () -> m SignalHandlerId
afterMountPreUnmount a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_MountChangedCallback
cb' = IO () -> C_MountChangedCallback
wrap_MountPreUnmountCallback IO ()
cb
FunPtr C_MountChangedCallback
cb'' <- C_MountChangedCallback -> IO (FunPtr C_MountChangedCallback)
mk_MountPreUnmountCallback C_MountChangedCallback
cb'
a
-> Text
-> FunPtr C_MountChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"pre-unmount" FunPtr C_MountChangedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data MountPreUnmountSignalInfo
instance SignalInfo MountPreUnmountSignalInfo where
type HaskellCallbackType MountPreUnmountSignalInfo = MountPreUnmountCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_MountPreUnmountCallback cb
cb'' <- mk_MountPreUnmountCallback cb'
connectSignalFunPtr obj "pre-unmount" cb'' connectMode detail
#endif
type MountUnmountedCallback =
IO ()
noMountUnmountedCallback :: Maybe MountUnmountedCallback
noMountUnmountedCallback :: Maybe (IO ())
noMountUnmountedCallback = Maybe (IO ())
forall a. Maybe a
Nothing
type C_MountUnmountedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_MountUnmountedCallback :: C_MountUnmountedCallback -> IO (FunPtr C_MountUnmountedCallback)
genClosure_MountUnmounted :: MonadIO m => MountUnmountedCallback -> m (GClosure C_MountUnmountedCallback)
genClosure_MountUnmounted :: IO () -> m (GClosure C_MountChangedCallback)
genClosure_MountUnmounted IO ()
cb = IO (GClosure C_MountChangedCallback)
-> m (GClosure C_MountChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_MountChangedCallback)
-> m (GClosure C_MountChangedCallback))
-> IO (GClosure C_MountChangedCallback)
-> m (GClosure C_MountChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_MountChangedCallback
cb' = IO () -> C_MountChangedCallback
wrap_MountUnmountedCallback IO ()
cb
C_MountChangedCallback -> IO (FunPtr C_MountChangedCallback)
mk_MountUnmountedCallback C_MountChangedCallback
cb' IO (FunPtr C_MountChangedCallback)
-> (FunPtr C_MountChangedCallback
-> IO (GClosure C_MountChangedCallback))
-> IO (GClosure C_MountChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_MountChangedCallback
-> IO (GClosure C_MountChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_MountUnmountedCallback ::
MountUnmountedCallback ->
C_MountUnmountedCallback
wrap_MountUnmountedCallback :: IO () -> C_MountChangedCallback
wrap_MountUnmountedCallback IO ()
_cb Ptr ()
_ Ptr ()
_ = do
IO ()
_cb
onMountUnmounted :: (IsMount a, MonadIO m) => a -> MountUnmountedCallback -> m SignalHandlerId
onMountUnmounted :: a -> IO () -> m SignalHandlerId
onMountUnmounted a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_MountChangedCallback
cb' = IO () -> C_MountChangedCallback
wrap_MountUnmountedCallback IO ()
cb
FunPtr C_MountChangedCallback
cb'' <- C_MountChangedCallback -> IO (FunPtr C_MountChangedCallback)
mk_MountUnmountedCallback C_MountChangedCallback
cb'
a
-> Text
-> FunPtr C_MountChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"unmounted" FunPtr C_MountChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterMountUnmounted :: (IsMount a, MonadIO m) => a -> MountUnmountedCallback -> m SignalHandlerId
afterMountUnmounted :: a -> IO () -> m SignalHandlerId
afterMountUnmounted a
obj IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_MountChangedCallback
cb' = IO () -> C_MountChangedCallback
wrap_MountUnmountedCallback IO ()
cb
FunPtr C_MountChangedCallback
cb'' <- C_MountChangedCallback -> IO (FunPtr C_MountChangedCallback)
mk_MountUnmountedCallback C_MountChangedCallback
cb'
a
-> Text
-> FunPtr C_MountChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj Text
"unmounted" FunPtr C_MountChangedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data MountUnmountedSignalInfo
instance SignalInfo MountUnmountedSignalInfo where
type HaskellCallbackType MountUnmountedSignalInfo = MountUnmountedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_MountUnmountedCallback cb
cb'' <- mk_MountUnmountedCallback cb'
connectSignalFunPtr obj "unmounted" cb'' connectMode detail
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Mount = MountSignalList
type MountSignalList = ('[ '("changed", MountChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("preUnmount", MountPreUnmountSignalInfo), '("unmounted", MountUnmountedSignalInfo)] :: [(Symbol, *)])
#endif