{-# LANGUAGE ImplicitParams, RankNTypes, 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 ,
MountChangedCallback ,
#if defined(ENABLE_OVERLOADING)
MountChangedSignalInfo ,
#endif
afterMountChanged ,
onMountChanged ,
MountPreUnmountCallback ,
#if defined(ENABLE_OVERLOADING)
MountPreUnmountSignalInfo ,
#endif
afterMountPreUnmount ,
onMountPreUnmount ,
MountUnmountedCallback ,
#if defined(ENABLE_OVERLOADING)
MountUnmountedSignalInfo ,
#endif
afterMountUnmounted ,
onMountUnmounted ,
) 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.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
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.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
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 GHC.Records as R
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Enums as GLib.Enums
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.DateTime as GLib.DateTime
import qualified GI.GLib.Structs.PollFD as GLib.PollFD
import qualified GI.GLib.Structs.Source as GLib.Source
import qualified GI.GLib.Structs.TimeVal as GLib.TimeVal
import qualified GI.GObject.Callbacks as GObject.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import {-# SOURCE #-} qualified GI.Gio.Enums as Gio.Enums
import {-# SOURCE #-} qualified GI.Gio.Flags as Gio.Flags
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AppInfo as Gio.AppInfo
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.Seekable as Gio.Seekable
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Volume as Gio.Volume
import {-# SOURCE #-} qualified GI.Gio.Objects.AppLaunchContext as Gio.AppLaunchContext
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.FileEnumerator as Gio.FileEnumerator
import {-# SOURCE #-} qualified GI.Gio.Objects.FileIOStream as Gio.FileIOStream
import {-# SOURCE #-} qualified GI.Gio.Objects.FileInfo as Gio.FileInfo
import {-# SOURCE #-} qualified GI.Gio.Objects.FileInputStream as Gio.FileInputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.FileMonitor as Gio.FileMonitor
import {-# SOURCE #-} qualified GI.Gio.Objects.FileOutputStream as Gio.FileOutputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.IOStream as Gio.IOStream
import {-# SOURCE #-} qualified GI.Gio.Objects.InputStream as Gio.InputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.MountOperation as Gio.MountOperation
import {-# SOURCE #-} qualified GI.Gio.Objects.OutputStream as Gio.OutputStream
import {-# SOURCE #-} qualified GI.Gio.Structs.FileAttributeInfo as Gio.FileAttributeInfo
import {-# SOURCE #-} qualified GI.Gio.Structs.FileAttributeInfoList as Gio.FileAttributeInfoList
import {-# SOURCE #-} qualified GI.Gio.Structs.FileAttributeMatcher as Gio.FileAttributeMatcher
import {-# SOURCE #-} qualified GI.Gio.Structs.OutputVector as Gio.OutputVector
#else
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
#endif
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
$c== :: Mount -> Mount -> Bool
== :: Mount -> Mount -> Bool
$c/= :: Mount -> Mount -> Bool
/= :: 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
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 :: (MIO.MonadIO m, IsMount o) => o -> m Mount
toMount :: forall (m :: * -> *) o. (MonadIO m, IsMount o) => o -> m Mount
toMount = IO Mount -> m Mount
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.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'
B.ManagedPtr.unsafeCastTo ManagedPtr Mount -> Mount
Mount
instance B.GValue.IsGValue (Maybe Mount) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_mount_get_type
gvalueSet_ :: Ptr GValue -> Maybe Mount -> IO ()
gvalueSet_ Ptr GValue
gv Maybe Mount
P.Nothing = Ptr GValue -> Ptr Mount -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr Mount
forall a. Ptr a
FP.nullPtr :: FP.Ptr Mount)
gvalueSet_ Ptr GValue
gv (P.Just Mount
obj) = Mount -> (Ptr Mount -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Mount
obj (Ptr GValue -> Ptr Mount -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe Mount)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr Mount)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr Mount)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject Mount ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Mount
type instance O.AttributeList Mount = MountAttributeList
type MountAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveMountMethod (t :: Symbol) (o :: DK.Type) :: DK.Type 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.OverloadedMethod 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
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveMountMethod t Mount, O.OverloadedMethod info Mount p, R.HasField t Mount p) => R.HasField t Mount p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveMountMethod t Mount, O.OverloadedMethodInfo info Mount) => OL.IsLabel t (O.MethodProxy info Mount) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsMount a) =>
a -> m Bool
mountCanEject a
mount = IO Bool -> m Bool
forall a. IO a -> m a
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
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
result <- g_mount_can_eject mount'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr mount
return result'
#if defined(ENABLE_OVERLOADING)
data MountCanEjectMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsMount a) => O.OverloadedMethod MountCanEjectMethodInfo a signature where
overloadedMethod = mountCanEject
instance O.OverloadedMethodInfo MountCanEjectMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount.mountCanEject",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsMount a) =>
a -> m Bool
mountCanUnmount a
mount = IO Bool -> m Bool
forall a. IO a -> m a
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
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
result <- g_mount_can_unmount mount'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr mount
return result'
#if defined(ENABLE_OVERLOADING)
data MountCanUnmountMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsMount a) => O.OverloadedMethod MountCanUnmountMethodInfo a signature where
overloadedMethod = mountCanUnmount
instance O.OverloadedMethodInfo MountCanUnmountMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount.mountCanUnmount",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsMount a, IsCancellable b) =>
a
-> [MountUnmountFlags]
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
mountEject a
mount [MountUnmountFlags]
flags Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
let flags' = [MountUnmountFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [MountUnmountFlags]
flags
maybeCancellable <- case cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
maybeCallback <- case callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
g_mount_eject mount' flags' maybeCancellable maybeCallback userData
touchManagedPtr mount
whenJust cancellable touchManagedPtr
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.OverloadedMethod MountEjectMethodInfo a signature where
overloadedMethod = mountEject
instance O.OverloadedMethodInfo MountEjectMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount.mountEject",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsMount a, IsAsyncResult b) =>
a -> b -> m ()
mountEjectFinish a
mount b
result_ = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
result_' <- unsafeManagedPtrCastPtr result_
onException (do
_ <- propagateGError $ g_mount_eject_finish mount' result_'
touchManagedPtr mount
touchManagedPtr result_
return ()
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data MountEjectFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod MountEjectFinishMethodInfo a signature where
overloadedMethod = mountEjectFinish
instance O.OverloadedMethodInfo MountEjectFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount.mountEjectFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#v: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 :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsMount a, IsMountOperation b,
IsCancellable c) =>
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 a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
let flags' = [MountUnmountFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [MountUnmountFlags]
flags
maybeMountOperation <- case mountOperation of
Maybe b
Nothing -> Ptr MountOperation -> IO (Ptr MountOperation)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr MountOperation
forall a. Ptr a
FP.nullPtr
Just b
jMountOperation -> do
jMountOperation' <- b -> IO (Ptr MountOperation)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jMountOperation
return jMountOperation'
maybeCancellable <- case cancellable of
Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just c
jCancellable -> do
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
return jCancellable'
maybeCallback <- case callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
g_mount_eject_with_operation mount' flags' maybeMountOperation maybeCancellable maybeCallback userData
touchManagedPtr mount
whenJust mountOperation touchManagedPtr
whenJust cancellable touchManagedPtr
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.OverloadedMethod MountEjectWithOperationMethodInfo a signature where
overloadedMethod = mountEjectWithOperation
instance O.OverloadedMethodInfo MountEjectWithOperationMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount.mountEjectWithOperation",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsMount a, IsAsyncResult b) =>
a -> b -> m ()
mountEjectWithOperationFinish a
mount b
result_ = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
result_' <- unsafeManagedPtrCastPtr result_
onException (do
_ <- propagateGError $ g_mount_eject_with_operation_finish mount' result_'
touchManagedPtr mount
touchManagedPtr result_
return ()
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data MountEjectWithOperationFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod MountEjectWithOperationFinishMethodInfo a signature where
overloadedMethod = mountEjectWithOperationFinish
instance O.OverloadedMethodInfo MountEjectWithOperationFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount.mountEjectWithOperationFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsMount a) =>
a -> m File
mountGetDefaultLocation a
mount = IO File -> m File
forall a. IO a -> m a
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
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
result <- g_mount_get_default_location mount'
checkUnexpectedReturnNULL "mountGetDefaultLocation" result
result' <- (wrapObject Gio.File.File) result
touchManagedPtr mount
return result'
#if defined(ENABLE_OVERLOADING)
data MountGetDefaultLocationMethodInfo
instance (signature ~ (m Gio.File.File), MonadIO m, IsMount a) => O.OverloadedMethod MountGetDefaultLocationMethodInfo a signature where
overloadedMethod = mountGetDefaultLocation
instance O.OverloadedMethodInfo MountGetDefaultLocationMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount.mountGetDefaultLocation",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsMount a) =>
a -> m (Maybe Drive)
mountGetDrive a
mount = IO (Maybe Drive) -> m (Maybe Drive)
forall a. IO a -> m a
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
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
result <- g_mount_get_drive mount'
maybeResult <- convertIfNonNull result $ \Ptr Drive
result' -> do
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'
return result''
touchManagedPtr mount
return maybeResult
#if defined(ENABLE_OVERLOADING)
data MountGetDriveMethodInfo
instance (signature ~ (m (Maybe Gio.Drive.Drive)), MonadIO m, IsMount a) => O.OverloadedMethod MountGetDriveMethodInfo a signature where
overloadedMethod = mountGetDrive
instance O.OverloadedMethodInfo MountGetDriveMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount.mountGetDrive",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsMount a) =>
a -> m Icon
mountGetIcon a
mount = IO Icon -> m Icon
forall a. IO a -> m a
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
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
result <- g_mount_get_icon mount'
checkUnexpectedReturnNULL "mountGetIcon" result
result' <- (wrapObject Gio.Icon.Icon) result
touchManagedPtr mount
return result'
#if defined(ENABLE_OVERLOADING)
data MountGetIconMethodInfo
instance (signature ~ (m Gio.Icon.Icon), MonadIO m, IsMount a) => O.OverloadedMethod MountGetIconMethodInfo a signature where
overloadedMethod = mountGetIcon
instance O.OverloadedMethodInfo MountGetIconMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount.mountGetIcon",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsMount a) =>
a -> m Text
mountGetName a
mount = IO Text -> m Text
forall a. IO a -> m a
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
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
result <- g_mount_get_name mount'
checkUnexpectedReturnNULL "mountGetName" result
result' <- cstringToText result
freeMem result
touchManagedPtr mount
return result'
#if defined(ENABLE_OVERLOADING)
data MountGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsMount a) => O.OverloadedMethod MountGetNameMethodInfo a signature where
overloadedMethod = mountGetName
instance O.OverloadedMethodInfo MountGetNameMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount.mountGetName",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsMount a) =>
a -> m File
mountGetRoot a
mount = IO File -> m File
forall a. IO a -> m a
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
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
result <- g_mount_get_root mount'
checkUnexpectedReturnNULL "mountGetRoot" result
result' <- (wrapObject Gio.File.File) result
touchManagedPtr mount
return result'
#if defined(ENABLE_OVERLOADING)
data MountGetRootMethodInfo
instance (signature ~ (m Gio.File.File), MonadIO m, IsMount a) => O.OverloadedMethod MountGetRootMethodInfo a signature where
overloadedMethod = mountGetRoot
instance O.OverloadedMethodInfo MountGetRootMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount.mountGetRoot",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsMount a) =>
a -> m (Maybe Text)
mountGetSortKey a
mount = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
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
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
result <- g_mount_get_sort_key mount'
maybeResult <- convertIfNonNull result $ \CString
result' -> do
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
return result''
touchManagedPtr mount
return maybeResult
#if defined(ENABLE_OVERLOADING)
data MountGetSortKeyMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsMount a) => O.OverloadedMethod MountGetSortKeyMethodInfo a signature where
overloadedMethod = mountGetSortKey
instance O.OverloadedMethodInfo MountGetSortKeyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount.mountGetSortKey",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsMount a) =>
a -> m Icon
mountGetSymbolicIcon a
mount = IO Icon -> m Icon
forall a. IO a -> m a
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
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
result <- g_mount_get_symbolic_icon mount'
checkUnexpectedReturnNULL "mountGetSymbolicIcon" result
result' <- (wrapObject Gio.Icon.Icon) result
touchManagedPtr mount
return result'
#if defined(ENABLE_OVERLOADING)
data MountGetSymbolicIconMethodInfo
instance (signature ~ (m Gio.Icon.Icon), MonadIO m, IsMount a) => O.OverloadedMethod MountGetSymbolicIconMethodInfo a signature where
overloadedMethod = mountGetSymbolicIcon
instance O.OverloadedMethodInfo MountGetSymbolicIconMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount.mountGetSymbolicIcon",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsMount a) =>
a -> m (Maybe Text)
mountGetUuid a
mount = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
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
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
result <- g_mount_get_uuid mount'
maybeResult <- convertIfNonNull result $ \CString
result' -> do
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
freeMem result'
return result''
touchManagedPtr mount
return maybeResult
#if defined(ENABLE_OVERLOADING)
data MountGetUuidMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsMount a) => O.OverloadedMethod MountGetUuidMethodInfo a signature where
overloadedMethod = mountGetUuid
instance O.OverloadedMethodInfo MountGetUuidMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount.mountGetUuid",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsMount a) =>
a -> m (Maybe Volume)
mountGetVolume a
mount = IO (Maybe Volume) -> m (Maybe Volume)
forall a. IO a -> m a
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
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
result <- g_mount_get_volume mount'
maybeResult <- convertIfNonNull result $ \Ptr Volume
result' -> do
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'
return result''
touchManagedPtr mount
return maybeResult
#if defined(ENABLE_OVERLOADING)
data MountGetVolumeMethodInfo
instance (signature ~ (m (Maybe Gio.Volume.Volume)), MonadIO m, IsMount a) => O.OverloadedMethod MountGetVolumeMethodInfo a signature where
overloadedMethod = mountGetVolume
instance O.OverloadedMethodInfo MountGetVolumeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount.mountGetVolume",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsMount a, IsCancellable b) =>
a -> Bool -> Maybe b -> Maybe AsyncReadyCallback -> m ()
mountGuessContentType a
mount Bool
forceRescan Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
let forceRescan' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.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
P.fromEnum) Bool
forceRescan
maybeCancellable <- case cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
maybeCallback <- case callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
g_mount_guess_content_type mount' forceRescan' maybeCancellable maybeCallback userData
touchManagedPtr mount
whenJust cancellable touchManagedPtr
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.OverloadedMethod MountGuessContentTypeMethodInfo a signature where
overloadedMethod = mountGuessContentType
instance O.OverloadedMethodInfo MountGuessContentTypeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount.mountGuessContentType",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsMount a, IsAsyncResult b) =>
a -> b -> m [Text]
mountGuessContentTypeFinish a
mount b
result_ = IO [Text] -> m [Text]
forall a. IO a -> m a
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
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
result_' <- unsafeManagedPtrCastPtr result_
onException (do
result <- propagateGError $ g_mount_guess_content_type_finish mount' result_'
checkUnexpectedReturnNULL "mountGuessContentTypeFinish" result
result' <- unpackZeroTerminatedUTF8CArray result
mapZeroTerminatedCArray freeMem result
freeMem result
touchManagedPtr mount
touchManagedPtr result_
return result'
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data MountGuessContentTypeFinishMethodInfo
instance (signature ~ (b -> m [T.Text]), MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod MountGuessContentTypeFinishMethodInfo a signature where
overloadedMethod = mountGuessContentTypeFinish
instance O.OverloadedMethodInfo MountGuessContentTypeFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount.mountGuessContentTypeFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsMount a, IsCancellable b) =>
a -> Bool -> Maybe b -> m [Text]
mountGuessContentTypeSync a
mount Bool
forceRescan Maybe b
cancellable = IO [Text] -> m [Text]
forall a. IO a -> m a
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
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
let forceRescan' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.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
P.fromEnum) Bool
forceRescan
maybeCancellable <- case cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
onException (do
result <- propagateGError $ g_mount_guess_content_type_sync mount' forceRescan' maybeCancellable
checkUnexpectedReturnNULL "mountGuessContentTypeSync" result
result' <- unpackZeroTerminatedUTF8CArray result
mapZeroTerminatedCArray freeMem result
freeMem result
touchManagedPtr mount
whenJust cancellable touchManagedPtr
return result'
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data MountGuessContentTypeSyncMethodInfo
instance (signature ~ (Bool -> Maybe (b) -> m [T.Text]), MonadIO m, IsMount a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod MountGuessContentTypeSyncMethodInfo a signature where
overloadedMethod = mountGuessContentTypeSync
instance O.OverloadedMethodInfo MountGuessContentTypeSyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount.mountGuessContentTypeSync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsMount a) =>
a -> m Bool
mountIsShadowed a
mount = IO Bool -> m Bool
forall a. IO a -> m a
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
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
result <- g_mount_is_shadowed mount'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr mount
return result'
#if defined(ENABLE_OVERLOADING)
data MountIsShadowedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsMount a) => O.OverloadedMethod MountIsShadowedMethodInfo a signature where
overloadedMethod = mountIsShadowed
instance O.OverloadedMethodInfo MountIsShadowedMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount.mountIsShadowed",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#v: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 :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsMount a, IsMountOperation b,
IsCancellable c) =>
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 a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
let flags' = [MountMountFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [MountMountFlags]
flags
maybeMountOperation <- case mountOperation of
Maybe b
Nothing -> Ptr MountOperation -> IO (Ptr MountOperation)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr MountOperation
forall a. Ptr a
FP.nullPtr
Just b
jMountOperation -> do
jMountOperation' <- b -> IO (Ptr MountOperation)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jMountOperation
return jMountOperation'
maybeCancellable <- case cancellable of
Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just c
jCancellable -> do
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
return jCancellable'
maybeCallback <- case callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
g_mount_remount mount' flags' maybeMountOperation maybeCancellable maybeCallback userData
touchManagedPtr mount
whenJust mountOperation touchManagedPtr
whenJust cancellable touchManagedPtr
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.OverloadedMethod MountRemountMethodInfo a signature where
overloadedMethod = mountRemount
instance O.OverloadedMethodInfo MountRemountMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount.mountRemount",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsMount a, IsAsyncResult b) =>
a -> b -> m ()
mountRemountFinish a
mount b
result_ = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
result_' <- unsafeManagedPtrCastPtr result_
onException (do
_ <- propagateGError $ g_mount_remount_finish mount' result_'
touchManagedPtr mount
touchManagedPtr result_
return ()
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data MountRemountFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod MountRemountFinishMethodInfo a signature where
overloadedMethod = mountRemountFinish
instance O.OverloadedMethodInfo MountRemountFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount.mountRemountFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsMount a) =>
a -> m ()
mountShadow a
mount = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
g_mount_shadow mount'
touchManagedPtr mount
return ()
#if defined(ENABLE_OVERLOADING)
data MountShadowMethodInfo
instance (signature ~ (m ()), MonadIO m, IsMount a) => O.OverloadedMethod MountShadowMethodInfo a signature where
overloadedMethod = mountShadow
instance O.OverloadedMethodInfo MountShadowMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount.mountShadow",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsMount a, IsCancellable b) =>
a
-> [MountUnmountFlags]
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
mountUnmount a
mount [MountUnmountFlags]
flags Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
let flags' = [MountUnmountFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [MountUnmountFlags]
flags
maybeCancellable <- case cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
maybeCallback <- case callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
g_mount_unmount mount' flags' maybeCancellable maybeCallback userData
touchManagedPtr mount
whenJust cancellable touchManagedPtr
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.OverloadedMethod MountUnmountMethodInfo a signature where
overloadedMethod = mountUnmount
instance O.OverloadedMethodInfo MountUnmountMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount.mountUnmount",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsMount a, IsAsyncResult b) =>
a -> b -> m ()
mountUnmountFinish a
mount b
result_ = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
result_' <- unsafeManagedPtrCastPtr result_
onException (do
_ <- propagateGError $ g_mount_unmount_finish mount' result_'
touchManagedPtr mount
touchManagedPtr result_
return ()
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data MountUnmountFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod MountUnmountFinishMethodInfo a signature where
overloadedMethod = mountUnmountFinish
instance O.OverloadedMethodInfo MountUnmountFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount.mountUnmountFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#v: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 :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsMount a, IsMountOperation b,
IsCancellable c) =>
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 a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
let flags' = [MountUnmountFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [MountUnmountFlags]
flags
maybeMountOperation <- case mountOperation of
Maybe b
Nothing -> Ptr MountOperation -> IO (Ptr MountOperation)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr MountOperation
forall a. Ptr a
FP.nullPtr
Just b
jMountOperation -> do
jMountOperation' <- b -> IO (Ptr MountOperation)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jMountOperation
return jMountOperation'
maybeCancellable <- case cancellable of
Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just c
jCancellable -> do
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
return jCancellable'
maybeCallback <- case callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
g_mount_unmount_with_operation mount' flags' maybeMountOperation maybeCancellable maybeCallback userData
touchManagedPtr mount
whenJust mountOperation touchManagedPtr
whenJust cancellable touchManagedPtr
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.OverloadedMethod MountUnmountWithOperationMethodInfo a signature where
overloadedMethod = mountUnmountWithOperation
instance O.OverloadedMethodInfo MountUnmountWithOperationMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount.mountUnmountWithOperation",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#v: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 :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsMount a, IsAsyncResult b) =>
a -> b -> m ()
mountUnmountWithOperationFinish a
mount b
result_ = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
result_' <- unsafeManagedPtrCastPtr result_
onException (do
_ <- propagateGError $ g_mount_unmount_with_operation_finish mount' result_'
touchManagedPtr mount
touchManagedPtr result_
return ()
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data MountUnmountWithOperationFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsMount a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod MountUnmountWithOperationFinishMethodInfo a signature where
overloadedMethod = mountUnmountWithOperationFinish
instance O.OverloadedMethodInfo MountUnmountWithOperationFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount.mountUnmountWithOperationFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#v: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 :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsMount a) =>
a -> m ()
mountUnshadow a
mount = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
mount' <- a -> IO (Ptr Mount)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
mount
g_mount_unshadow mount'
touchManagedPtr mount
return ()
#if defined(ENABLE_OVERLOADING)
data MountUnshadowMethodInfo
instance (signature ~ (m ()), MonadIO m, IsMount a) => O.OverloadedMethod MountUnshadowMethodInfo a signature where
overloadedMethod = mountUnshadow
instance O.OverloadedMethodInfo MountUnshadowMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount.mountUnshadow",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#v:mountUnshadow"
})
#endif
type MountChangedCallback =
IO ()
type C_MountChangedCallback =
Ptr Mount ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_MountChangedCallback :: C_MountChangedCallback -> IO (FunPtr C_MountChangedCallback)
wrap_MountChangedCallback ::
GObject a => (a -> MountChangedCallback) ->
C_MountChangedCallback
wrap_MountChangedCallback :: forall a. GObject a => (a -> IO ()) -> C_MountChangedCallback
wrap_MountChangedCallback a -> IO ()
gi'cb Ptr Mount
gi'selfPtr Ptr ()
_ = do
Ptr Mount -> (Mount -> IO ()) -> IO ()
forall o b.
(HasCallStack, GObject o) =>
Ptr o -> (o -> IO b) -> IO b
B.ManagedPtr.withNewObject Ptr Mount
gi'selfPtr ((Mount -> IO ()) -> IO ()) -> (Mount -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Mount
gi'self -> a -> IO ()
gi'cb (Mount -> a
forall a b. Coercible a b => a -> b
Coerce.coerce Mount
gi'self)
onMountChanged :: (IsMount a, MonadIO m) => a -> ((?self :: a) => MountChangedCallback) -> m SignalHandlerId
onMountChanged :: forall a (m :: * -> *).
(IsMount a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
onMountChanged a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
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 wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_MountChangedCallback
wrapped' = (a -> IO ()) -> C_MountChangedCallback
forall a. GObject a => (a -> IO ()) -> C_MountChangedCallback
wrap_MountChangedCallback a -> IO ()
wrapped
wrapped'' <- C_MountChangedCallback -> IO (FunPtr C_MountChangedCallback)
mk_MountChangedCallback C_MountChangedCallback
wrapped'
connectSignalFunPtr obj "changed" wrapped'' SignalConnectBefore Nothing
afterMountChanged :: (IsMount a, MonadIO m) => a -> ((?self :: a) => MountChangedCallback) -> m SignalHandlerId
afterMountChanged :: forall a (m :: * -> *).
(IsMount a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
afterMountChanged a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
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 wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_MountChangedCallback
wrapped' = (a -> IO ()) -> C_MountChangedCallback
forall a. GObject a => (a -> IO ()) -> C_MountChangedCallback
wrap_MountChangedCallback a -> IO ()
wrapped
wrapped'' <- C_MountChangedCallback -> IO (FunPtr C_MountChangedCallback)
mk_MountChangedCallback C_MountChangedCallback
wrapped'
connectSignalFunPtr obj "changed" wrapped'' SignalConnectAfter 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
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount::changed"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#g:signal:changed"})
#endif
type MountPreUnmountCallback =
IO ()
type C_MountPreUnmountCallback =
Ptr Mount ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_MountPreUnmountCallback :: C_MountPreUnmountCallback -> IO (FunPtr C_MountPreUnmountCallback)
wrap_MountPreUnmountCallback ::
GObject a => (a -> MountPreUnmountCallback) ->
C_MountPreUnmountCallback
wrap_MountPreUnmountCallback :: forall a. GObject a => (a -> IO ()) -> C_MountChangedCallback
wrap_MountPreUnmountCallback a -> IO ()
gi'cb Ptr Mount
gi'selfPtr Ptr ()
_ = do
Ptr Mount -> (Mount -> IO ()) -> IO ()
forall o b.
(HasCallStack, GObject o) =>
Ptr o -> (o -> IO b) -> IO b
B.ManagedPtr.withNewObject Ptr Mount
gi'selfPtr ((Mount -> IO ()) -> IO ()) -> (Mount -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Mount
gi'self -> a -> IO ()
gi'cb (Mount -> a
forall a b. Coercible a b => a -> b
Coerce.coerce Mount
gi'self)
onMountPreUnmount :: (IsMount a, MonadIO m) => a -> ((?self :: a) => MountPreUnmountCallback) -> m SignalHandlerId
onMountPreUnmount :: forall a (m :: * -> *).
(IsMount a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
onMountPreUnmount a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
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 wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_MountChangedCallback
wrapped' = (a -> IO ()) -> C_MountChangedCallback
forall a. GObject a => (a -> IO ()) -> C_MountChangedCallback
wrap_MountPreUnmountCallback a -> IO ()
wrapped
wrapped'' <- C_MountChangedCallback -> IO (FunPtr C_MountChangedCallback)
mk_MountPreUnmountCallback C_MountChangedCallback
wrapped'
connectSignalFunPtr obj "pre-unmount" wrapped'' SignalConnectBefore Nothing
afterMountPreUnmount :: (IsMount a, MonadIO m) => a -> ((?self :: a) => MountPreUnmountCallback) -> m SignalHandlerId
afterMountPreUnmount :: forall a (m :: * -> *).
(IsMount a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
afterMountPreUnmount a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
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 wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_MountChangedCallback
wrapped' = (a -> IO ()) -> C_MountChangedCallback
forall a. GObject a => (a -> IO ()) -> C_MountChangedCallback
wrap_MountPreUnmountCallback a -> IO ()
wrapped
wrapped'' <- C_MountChangedCallback -> IO (FunPtr C_MountChangedCallback)
mk_MountPreUnmountCallback C_MountChangedCallback
wrapped'
connectSignalFunPtr obj "pre-unmount" wrapped'' SignalConnectAfter 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
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount::pre-unmount"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#g:signal:preUnmount"})
#endif
type MountUnmountedCallback =
IO ()
type C_MountUnmountedCallback =
Ptr Mount ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_MountUnmountedCallback :: C_MountUnmountedCallback -> IO (FunPtr C_MountUnmountedCallback)
wrap_MountUnmountedCallback ::
GObject a => (a -> MountUnmountedCallback) ->
C_MountUnmountedCallback
wrap_MountUnmountedCallback :: forall a. GObject a => (a -> IO ()) -> C_MountChangedCallback
wrap_MountUnmountedCallback a -> IO ()
gi'cb Ptr Mount
gi'selfPtr Ptr ()
_ = do
Ptr Mount -> (Mount -> IO ()) -> IO ()
forall o b.
(HasCallStack, GObject o) =>
Ptr o -> (o -> IO b) -> IO b
B.ManagedPtr.withNewObject Ptr Mount
gi'selfPtr ((Mount -> IO ()) -> IO ()) -> (Mount -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Mount
gi'self -> a -> IO ()
gi'cb (Mount -> a
forall a b. Coercible a b => a -> b
Coerce.coerce Mount
gi'self)
onMountUnmounted :: (IsMount a, MonadIO m) => a -> ((?self :: a) => MountUnmountedCallback) -> m SignalHandlerId
onMountUnmounted :: forall a (m :: * -> *).
(IsMount a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
onMountUnmounted a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
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 wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_MountChangedCallback
wrapped' = (a -> IO ()) -> C_MountChangedCallback
forall a. GObject a => (a -> IO ()) -> C_MountChangedCallback
wrap_MountUnmountedCallback a -> IO ()
wrapped
wrapped'' <- C_MountChangedCallback -> IO (FunPtr C_MountChangedCallback)
mk_MountUnmountedCallback C_MountChangedCallback
wrapped'
connectSignalFunPtr obj "unmounted" wrapped'' SignalConnectBefore Nothing
afterMountUnmounted :: (IsMount a, MonadIO m) => a -> ((?self :: a) => MountUnmountedCallback) -> m SignalHandlerId
afterMountUnmounted :: forall a (m :: * -> *).
(IsMount a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
afterMountUnmounted a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
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 wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_MountChangedCallback
wrapped' = (a -> IO ()) -> C_MountChangedCallback
forall a. GObject a => (a -> IO ()) -> C_MountChangedCallback
wrap_MountUnmountedCallback a -> IO ()
wrapped
wrapped'' <- C_MountChangedCallback -> IO (FunPtr C_MountChangedCallback)
mk_MountUnmountedCallback C_MountChangedCallback
wrapped'
connectSignalFunPtr obj "unmounted" wrapped'' SignalConnectAfter 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
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.Mount::unmounted"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-Mount.html#g:signal:unmounted"})
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Mount = MountSignalList
type MountSignalList = ('[ '("changed", MountChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("preUnmount", MountPreUnmountSignalInfo), '("unmounted", MountUnmountedSignalInfo)] :: [(Symbol, DK.Type)])
#endif