{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Interfaces.Volume
(
Volume(..) ,
noVolume ,
IsVolume ,
toVolume ,
#if defined(ENABLE_OVERLOADING)
ResolveVolumeMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
VolumeCanEjectMethodInfo ,
#endif
volumeCanEject ,
#if defined(ENABLE_OVERLOADING)
VolumeCanMountMethodInfo ,
#endif
volumeCanMount ,
#if defined(ENABLE_OVERLOADING)
VolumeEjectMethodInfo ,
#endif
volumeEject ,
#if defined(ENABLE_OVERLOADING)
VolumeEjectFinishMethodInfo ,
#endif
volumeEjectFinish ,
#if defined(ENABLE_OVERLOADING)
VolumeEjectWithOperationMethodInfo ,
#endif
volumeEjectWithOperation ,
#if defined(ENABLE_OVERLOADING)
VolumeEjectWithOperationFinishMethodInfo,
#endif
volumeEjectWithOperationFinish ,
#if defined(ENABLE_OVERLOADING)
VolumeEnumerateIdentifiersMethodInfo ,
#endif
volumeEnumerateIdentifiers ,
#if defined(ENABLE_OVERLOADING)
VolumeGetActivationRootMethodInfo ,
#endif
volumeGetActivationRoot ,
#if defined(ENABLE_OVERLOADING)
VolumeGetDriveMethodInfo ,
#endif
volumeGetDrive ,
#if defined(ENABLE_OVERLOADING)
VolumeGetIconMethodInfo ,
#endif
volumeGetIcon ,
#if defined(ENABLE_OVERLOADING)
VolumeGetIdentifierMethodInfo ,
#endif
volumeGetIdentifier ,
#if defined(ENABLE_OVERLOADING)
VolumeGetMountMethodInfo ,
#endif
volumeGetMount ,
#if defined(ENABLE_OVERLOADING)
VolumeGetNameMethodInfo ,
#endif
volumeGetName ,
#if defined(ENABLE_OVERLOADING)
VolumeGetSortKeyMethodInfo ,
#endif
volumeGetSortKey ,
#if defined(ENABLE_OVERLOADING)
VolumeGetSymbolicIconMethodInfo ,
#endif
volumeGetSymbolicIcon ,
#if defined(ENABLE_OVERLOADING)
VolumeGetUuidMethodInfo ,
#endif
volumeGetUuid ,
#if defined(ENABLE_OVERLOADING)
VolumeMountMethodInfo ,
#endif
volumeMount ,
#if defined(ENABLE_OVERLOADING)
VolumeMountFinishMethodInfo ,
#endif
volumeMountFinish ,
#if defined(ENABLE_OVERLOADING)
VolumeShouldAutomountMethodInfo ,
#endif
volumeShouldAutomount ,
C_VolumeChangedCallback ,
VolumeChangedCallback ,
#if defined(ENABLE_OVERLOADING)
VolumeChangedSignalInfo ,
#endif
afterVolumeChanged ,
genClosure_VolumeChanged ,
mk_VolumeChangedCallback ,
noVolumeChangedCallback ,
onVolumeChanged ,
wrap_VolumeChangedCallback ,
C_VolumeRemovedCallback ,
VolumeRemovedCallback ,
#if defined(ENABLE_OVERLOADING)
VolumeRemovedSignalInfo ,
#endif
afterVolumeRemoved ,
genClosure_VolumeRemoved ,
mk_VolumeRemovedCallback ,
noVolumeRemovedCallback ,
onVolumeRemoved ,
wrap_VolumeRemovedCallback ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.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.Mount as Gio.Mount
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.MountOperation as Gio.MountOperation
newtype Volume = Volume (ManagedPtr Volume)
deriving (Volume -> Volume -> Bool
(Volume -> Volume -> Bool)
-> (Volume -> Volume -> Bool) -> Eq Volume
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Volume -> Volume -> Bool
$c/= :: Volume -> Volume -> Bool
== :: Volume -> Volume -> Bool
$c== :: Volume -> Volume -> Bool
Eq)
noVolume :: Maybe Volume
noVolume :: Maybe Volume
noVolume = Maybe Volume
forall a. Maybe a
Nothing
type VolumeChangedCallback =
IO ()
noVolumeChangedCallback :: Maybe VolumeChangedCallback
noVolumeChangedCallback :: Maybe VolumeChangedCallback
noVolumeChangedCallback = Maybe VolumeChangedCallback
forall a. Maybe a
Nothing
type C_VolumeChangedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_VolumeChangedCallback :: C_VolumeChangedCallback -> IO (FunPtr C_VolumeChangedCallback)
genClosure_VolumeChanged :: MonadIO m => VolumeChangedCallback -> m (GClosure C_VolumeChangedCallback)
genClosure_VolumeChanged :: VolumeChangedCallback -> m (GClosure C_VolumeChangedCallback)
genClosure_VolumeChanged cb :: VolumeChangedCallback
cb = IO (GClosure C_VolumeChangedCallback)
-> m (GClosure C_VolumeChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_VolumeChangedCallback)
-> m (GClosure C_VolumeChangedCallback))
-> IO (GClosure C_VolumeChangedCallback)
-> m (GClosure C_VolumeChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_VolumeChangedCallback
cb' = VolumeChangedCallback -> C_VolumeChangedCallback
wrap_VolumeChangedCallback VolumeChangedCallback
cb
C_VolumeChangedCallback -> IO (FunPtr C_VolumeChangedCallback)
mk_VolumeChangedCallback C_VolumeChangedCallback
cb' IO (FunPtr C_VolumeChangedCallback)
-> (FunPtr C_VolumeChangedCallback
-> IO (GClosure C_VolumeChangedCallback))
-> IO (GClosure C_VolumeChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_VolumeChangedCallback
-> IO (GClosure C_VolumeChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_VolumeChangedCallback ::
VolumeChangedCallback ->
C_VolumeChangedCallback
wrap_VolumeChangedCallback :: VolumeChangedCallback -> C_VolumeChangedCallback
wrap_VolumeChangedCallback _cb :: VolumeChangedCallback
_cb _ _ = do
VolumeChangedCallback
_cb
onVolumeChanged :: (IsVolume a, MonadIO m) => a -> VolumeChangedCallback -> m SignalHandlerId
onVolumeChanged :: a -> VolumeChangedCallback -> m SignalHandlerId
onVolumeChanged obj :: a
obj cb :: VolumeChangedCallback
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_VolumeChangedCallback
cb' = VolumeChangedCallback -> C_VolumeChangedCallback
wrap_VolumeChangedCallback VolumeChangedCallback
cb
FunPtr C_VolumeChangedCallback
cb'' <- C_VolumeChangedCallback -> IO (FunPtr C_VolumeChangedCallback)
mk_VolumeChangedCallback C_VolumeChangedCallback
cb'
a
-> Text
-> FunPtr C_VolumeChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "changed" FunPtr C_VolumeChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterVolumeChanged :: (IsVolume a, MonadIO m) => a -> VolumeChangedCallback -> m SignalHandlerId
afterVolumeChanged :: a -> VolumeChangedCallback -> m SignalHandlerId
afterVolumeChanged obj :: a
obj cb :: VolumeChangedCallback
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_VolumeChangedCallback
cb' = VolumeChangedCallback -> C_VolumeChangedCallback
wrap_VolumeChangedCallback VolumeChangedCallback
cb
FunPtr C_VolumeChangedCallback
cb'' <- C_VolumeChangedCallback -> IO (FunPtr C_VolumeChangedCallback)
mk_VolumeChangedCallback C_VolumeChangedCallback
cb'
a
-> Text
-> FunPtr C_VolumeChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "changed" FunPtr C_VolumeChangedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data VolumeChangedSignalInfo
instance SignalInfo VolumeChangedSignalInfo where
type HaskellCallbackType VolumeChangedSignalInfo = VolumeChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_VolumeChangedCallback cb
cb'' <- mk_VolumeChangedCallback cb'
connectSignalFunPtr obj "changed" cb'' connectMode detail
#endif
type VolumeRemovedCallback =
IO ()
noVolumeRemovedCallback :: Maybe VolumeRemovedCallback
noVolumeRemovedCallback :: Maybe VolumeChangedCallback
noVolumeRemovedCallback = Maybe VolumeChangedCallback
forall a. Maybe a
Nothing
type C_VolumeRemovedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_VolumeRemovedCallback :: C_VolumeRemovedCallback -> IO (FunPtr C_VolumeRemovedCallback)
genClosure_VolumeRemoved :: MonadIO m => VolumeRemovedCallback -> m (GClosure C_VolumeRemovedCallback)
genClosure_VolumeRemoved :: VolumeChangedCallback -> m (GClosure C_VolumeChangedCallback)
genClosure_VolumeRemoved cb :: VolumeChangedCallback
cb = IO (GClosure C_VolumeChangedCallback)
-> m (GClosure C_VolumeChangedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_VolumeChangedCallback)
-> m (GClosure C_VolumeChangedCallback))
-> IO (GClosure C_VolumeChangedCallback)
-> m (GClosure C_VolumeChangedCallback)
forall a b. (a -> b) -> a -> b
$ do
let cb' :: C_VolumeChangedCallback
cb' = VolumeChangedCallback -> C_VolumeChangedCallback
wrap_VolumeRemovedCallback VolumeChangedCallback
cb
C_VolumeChangedCallback -> IO (FunPtr C_VolumeChangedCallback)
mk_VolumeRemovedCallback C_VolumeChangedCallback
cb' IO (FunPtr C_VolumeChangedCallback)
-> (FunPtr C_VolumeChangedCallback
-> IO (GClosure C_VolumeChangedCallback))
-> IO (GClosure C_VolumeChangedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_VolumeChangedCallback
-> IO (GClosure C_VolumeChangedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure
wrap_VolumeRemovedCallback ::
VolumeRemovedCallback ->
C_VolumeRemovedCallback
wrap_VolumeRemovedCallback :: VolumeChangedCallback -> C_VolumeChangedCallback
wrap_VolumeRemovedCallback _cb :: VolumeChangedCallback
_cb _ _ = do
VolumeChangedCallback
_cb
onVolumeRemoved :: (IsVolume a, MonadIO m) => a -> VolumeRemovedCallback -> m SignalHandlerId
onVolumeRemoved :: a -> VolumeChangedCallback -> m SignalHandlerId
onVolumeRemoved obj :: a
obj cb :: VolumeChangedCallback
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_VolumeChangedCallback
cb' = VolumeChangedCallback -> C_VolumeChangedCallback
wrap_VolumeRemovedCallback VolumeChangedCallback
cb
FunPtr C_VolumeChangedCallback
cb'' <- C_VolumeChangedCallback -> IO (FunPtr C_VolumeChangedCallback)
mk_VolumeRemovedCallback C_VolumeChangedCallback
cb'
a
-> Text
-> FunPtr C_VolumeChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "removed" FunPtr C_VolumeChangedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing
afterVolumeRemoved :: (IsVolume a, MonadIO m) => a -> VolumeRemovedCallback -> m SignalHandlerId
afterVolumeRemoved :: a -> VolumeChangedCallback -> m SignalHandlerId
afterVolumeRemoved obj :: a
obj cb :: VolumeChangedCallback
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_VolumeChangedCallback
cb' = VolumeChangedCallback -> C_VolumeChangedCallback
wrap_VolumeRemovedCallback VolumeChangedCallback
cb
FunPtr C_VolumeChangedCallback
cb'' <- C_VolumeChangedCallback -> IO (FunPtr C_VolumeChangedCallback)
mk_VolumeRemovedCallback C_VolumeChangedCallback
cb'
a
-> Text
-> FunPtr C_VolumeChangedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "removed" FunPtr C_VolumeChangedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
data VolumeRemovedSignalInfo
instance SignalInfo VolumeRemovedSignalInfo where
type HaskellCallbackType VolumeRemovedSignalInfo = VolumeRemovedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_VolumeRemovedCallback cb
cb'' <- mk_VolumeRemovedCallback cb'
connectSignalFunPtr obj "removed" cb'' connectMode detail
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Volume = VolumeSignalList
type VolumeSignalList = ('[ '("changed", VolumeChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("removed", VolumeRemovedSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_volume_get_type"
c_g_volume_get_type :: IO GType
instance GObject Volume where
gobjectType :: IO GType
gobjectType = IO GType
c_g_volume_get_type
instance B.GValue.IsGValue Volume where
toGValue :: Volume -> IO GValue
toGValue o :: Volume
o = do
GType
gtype <- IO GType
c_g_volume_get_type
Volume -> (Ptr Volume -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Volume
o (GType
-> (GValue -> Ptr Volume -> VolumeChangedCallback)
-> Ptr Volume
-> IO GValue
forall a.
GType -> (GValue -> a -> VolumeChangedCallback) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Volume -> VolumeChangedCallback
forall a. GObject a => GValue -> Ptr a -> VolumeChangedCallback
B.GValue.set_object)
fromGValue :: GValue -> IO Volume
fromGValue gv :: GValue
gv = do
Ptr Volume
ptr <- GValue -> IO (Ptr Volume)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr Volume)
(ManagedPtr Volume -> Volume) -> Ptr Volume -> IO Volume
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Volume -> Volume
Volume Ptr Volume
ptr
class (GObject o, O.IsDescendantOf Volume o) => IsVolume o
instance (GObject o, O.IsDescendantOf Volume o) => IsVolume o
instance O.HasParentTypes Volume
type instance O.ParentTypes Volume = '[GObject.Object.Object]
toVolume :: (MonadIO m, IsVolume o) => o -> m Volume
toVolume :: o -> m Volume
toVolume = IO Volume -> m Volume
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Volume -> m Volume) -> (o -> IO Volume) -> o -> m Volume
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Volume -> Volume) -> o -> IO Volume
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr Volume -> Volume
Volume
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Volume
type instance O.AttributeList Volume = VolumeAttributeList
type VolumeAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveVolumeMethod (t :: Symbol) (o :: *) :: * where
ResolveVolumeMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveVolumeMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveVolumeMethod "canEject" o = VolumeCanEjectMethodInfo
ResolveVolumeMethod "canMount" o = VolumeCanMountMethodInfo
ResolveVolumeMethod "eject" o = VolumeEjectMethodInfo
ResolveVolumeMethod "ejectFinish" o = VolumeEjectFinishMethodInfo
ResolveVolumeMethod "ejectWithOperation" o = VolumeEjectWithOperationMethodInfo
ResolveVolumeMethod "ejectWithOperationFinish" o = VolumeEjectWithOperationFinishMethodInfo
ResolveVolumeMethod "enumerateIdentifiers" o = VolumeEnumerateIdentifiersMethodInfo
ResolveVolumeMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveVolumeMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveVolumeMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveVolumeMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveVolumeMethod "mount" o = VolumeMountMethodInfo
ResolveVolumeMethod "mountFinish" o = VolumeMountFinishMethodInfo
ResolveVolumeMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveVolumeMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveVolumeMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveVolumeMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveVolumeMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveVolumeMethod "shouldAutomount" o = VolumeShouldAutomountMethodInfo
ResolveVolumeMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveVolumeMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveVolumeMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveVolumeMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveVolumeMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveVolumeMethod "getActivationRoot" o = VolumeGetActivationRootMethodInfo
ResolveVolumeMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveVolumeMethod "getDrive" o = VolumeGetDriveMethodInfo
ResolveVolumeMethod "getIcon" o = VolumeGetIconMethodInfo
ResolveVolumeMethod "getIdentifier" o = VolumeGetIdentifierMethodInfo
ResolveVolumeMethod "getMount" o = VolumeGetMountMethodInfo
ResolveVolumeMethod "getName" o = VolumeGetNameMethodInfo
ResolveVolumeMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveVolumeMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveVolumeMethod "getSortKey" o = VolumeGetSortKeyMethodInfo
ResolveVolumeMethod "getSymbolicIcon" o = VolumeGetSymbolicIconMethodInfo
ResolveVolumeMethod "getUuid" o = VolumeGetUuidMethodInfo
ResolveVolumeMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveVolumeMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveVolumeMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveVolumeMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveVolumeMethod t Volume, O.MethodInfo info Volume p) => OL.IsLabel t (Volume -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
foreign import ccall "g_volume_can_eject" g_volume_can_eject ::
Ptr Volume ->
IO CInt
volumeCanEject ::
(B.CallStack.HasCallStack, MonadIO m, IsVolume a) =>
a
-> m Bool
volumeCanEject :: a -> m Bool
volumeCanEject volume :: a
volume = 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 Volume
volume' <- a -> IO (Ptr Volume)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
volume
CInt
result <- Ptr Volume -> IO CInt
g_volume_can_eject Ptr Volume
volume'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> VolumeChangedCallback
forall a. ManagedPtrNewtype a => a -> VolumeChangedCallback
touchManagedPtr a
volume
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data VolumeCanEjectMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsVolume a) => O.MethodInfo VolumeCanEjectMethodInfo a signature where
overloadedMethod = volumeCanEject
#endif
foreign import ccall "g_volume_can_mount" g_volume_can_mount ::
Ptr Volume ->
IO CInt
volumeCanMount ::
(B.CallStack.HasCallStack, MonadIO m, IsVolume a) =>
a
-> m Bool
volumeCanMount :: a -> m Bool
volumeCanMount volume :: a
volume = 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 Volume
volume' <- a -> IO (Ptr Volume)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
volume
CInt
result <- Ptr Volume -> IO CInt
g_volume_can_mount Ptr Volume
volume'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> VolumeChangedCallback
forall a. ManagedPtrNewtype a => a -> VolumeChangedCallback
touchManagedPtr a
volume
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data VolumeCanMountMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsVolume a) => O.MethodInfo VolumeCanMountMethodInfo a signature where
overloadedMethod = volumeCanMount
#endif
foreign import ccall "g_volume_eject" g_volume_eject ::
Ptr Volume ->
CUInt ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
{-# DEPRECATED volumeEject ["(Since version 2.22)","Use 'GI.Gio.Interfaces.Volume.volumeEjectWithOperation' instead."] #-}
volumeEject ::
(B.CallStack.HasCallStack, MonadIO m, IsVolume a, Gio.Cancellable.IsCancellable b) =>
a
-> [Gio.Flags.MountUnmountFlags]
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
volumeEject :: a
-> [MountUnmountFlags]
-> Maybe b
-> Maybe AsyncReadyCallback
-> m ()
volumeEject volume :: a
volume flags :: [MountUnmountFlags]
flags cancellable :: Maybe b
cancellable callback :: Maybe AsyncReadyCallback
callback = VolumeChangedCallback -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (VolumeChangedCallback -> m ()) -> VolumeChangedCallback -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Volume
volume' <- a -> IO (Ptr Volume)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
volume
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
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: 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
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 jCallback :: 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 -> VolumeChangedCallback
forall a. Storable a => Ptr a -> a -> VolumeChangedCallback
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 Volume
-> CUInt
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> VolumeChangedCallback
g_volume_eject Ptr Volume
volume' CUInt
flags' Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> VolumeChangedCallback
forall a. ManagedPtrNewtype a => a -> VolumeChangedCallback
touchManagedPtr a
volume
Maybe b -> (b -> VolumeChangedCallback) -> VolumeChangedCallback
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> VolumeChangedCallback
forall a. ManagedPtrNewtype a => a -> VolumeChangedCallback
touchManagedPtr
() -> VolumeChangedCallback
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data VolumeEjectMethodInfo
instance (signature ~ ([Gio.Flags.MountUnmountFlags] -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsVolume a, Gio.Cancellable.IsCancellable b) => O.MethodInfo VolumeEjectMethodInfo a signature where
overloadedMethod = volumeEject
#endif
foreign import ccall "g_volume_eject_finish" g_volume_eject_finish ::
Ptr Volume ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
{-# DEPRECATED volumeEjectFinish ["(Since version 2.22)","Use 'GI.Gio.Interfaces.Volume.volumeEjectWithOperationFinish' instead."] #-}
volumeEjectFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsVolume a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
volumeEjectFinish :: a -> b -> m ()
volumeEjectFinish volume :: a
volume result_ :: b
result_ = VolumeChangedCallback -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (VolumeChangedCallback -> m ()) -> VolumeChangedCallback -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Volume
volume' <- a -> IO (Ptr Volume)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
volume
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
VolumeChangedCallback
-> VolumeChangedCallback -> VolumeChangedCallback
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 Volume -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
g_volume_eject_finish Ptr Volume
volume' Ptr AsyncResult
result_'
a -> VolumeChangedCallback
forall a. ManagedPtrNewtype a => a -> VolumeChangedCallback
touchManagedPtr a
volume
b -> VolumeChangedCallback
forall a. ManagedPtrNewtype a => a -> VolumeChangedCallback
touchManagedPtr b
result_
() -> VolumeChangedCallback
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> VolumeChangedCallback
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data VolumeEjectFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsVolume a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo VolumeEjectFinishMethodInfo a signature where
overloadedMethod = volumeEjectFinish
#endif
foreign import ccall "g_volume_eject_with_operation" g_volume_eject_with_operation ::
Ptr Volume ->
CUInt ->
Ptr Gio.MountOperation.MountOperation ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
volumeEjectWithOperation ::
(B.CallStack.HasCallStack, MonadIO m, IsVolume a, Gio.MountOperation.IsMountOperation b, Gio.Cancellable.IsCancellable c) =>
a
-> [Gio.Flags.MountUnmountFlags]
-> Maybe (b)
-> Maybe (c)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
volumeEjectWithOperation :: a
-> [MountUnmountFlags]
-> Maybe b
-> Maybe c
-> Maybe AsyncReadyCallback
-> m ()
volumeEjectWithOperation volume :: a
volume flags :: [MountUnmountFlags]
flags mountOperation :: Maybe b
mountOperation cancellable :: Maybe c
cancellable callback :: Maybe AsyncReadyCallback
callback = VolumeChangedCallback -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (VolumeChangedCallback -> m ()) -> VolumeChangedCallback -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Volume
volume' <- a -> IO (Ptr Volume)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
volume
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
Nothing -> Ptr MountOperation -> IO (Ptr MountOperation)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr MountOperation
forall a. Ptr a
nullPtr
Just jMountOperation :: 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
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: 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
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 jCallback :: 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 -> VolumeChangedCallback
forall a. Storable a => Ptr a -> a -> VolumeChangedCallback
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 Volume
-> CUInt
-> Ptr MountOperation
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> VolumeChangedCallback
g_volume_eject_with_operation Ptr Volume
volume' CUInt
flags' Ptr MountOperation
maybeMountOperation Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> VolumeChangedCallback
forall a. ManagedPtrNewtype a => a -> VolumeChangedCallback
touchManagedPtr a
volume
Maybe b -> (b -> VolumeChangedCallback) -> VolumeChangedCallback
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
mountOperation b -> VolumeChangedCallback
forall a. ManagedPtrNewtype a => a -> VolumeChangedCallback
touchManagedPtr
Maybe c -> (c -> VolumeChangedCallback) -> VolumeChangedCallback
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> VolumeChangedCallback
forall a. ManagedPtrNewtype a => a -> VolumeChangedCallback
touchManagedPtr
() -> VolumeChangedCallback
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data VolumeEjectWithOperationMethodInfo
instance (signature ~ ([Gio.Flags.MountUnmountFlags] -> Maybe (b) -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsVolume a, Gio.MountOperation.IsMountOperation b, Gio.Cancellable.IsCancellable c) => O.MethodInfo VolumeEjectWithOperationMethodInfo a signature where
overloadedMethod = volumeEjectWithOperation
#endif
foreign import ccall "g_volume_eject_with_operation_finish" g_volume_eject_with_operation_finish ::
Ptr Volume ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
volumeEjectWithOperationFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsVolume a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
volumeEjectWithOperationFinish :: a -> b -> m ()
volumeEjectWithOperationFinish volume :: a
volume result_ :: b
result_ = VolumeChangedCallback -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (VolumeChangedCallback -> m ()) -> VolumeChangedCallback -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Volume
volume' <- a -> IO (Ptr Volume)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
volume
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
VolumeChangedCallback
-> VolumeChangedCallback -> VolumeChangedCallback
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 Volume -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
g_volume_eject_with_operation_finish Ptr Volume
volume' Ptr AsyncResult
result_'
a -> VolumeChangedCallback
forall a. ManagedPtrNewtype a => a -> VolumeChangedCallback
touchManagedPtr a
volume
b -> VolumeChangedCallback
forall a. ManagedPtrNewtype a => a -> VolumeChangedCallback
touchManagedPtr b
result_
() -> VolumeChangedCallback
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> VolumeChangedCallback
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data VolumeEjectWithOperationFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsVolume a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo VolumeEjectWithOperationFinishMethodInfo a signature where
overloadedMethod = volumeEjectWithOperationFinish
#endif
foreign import ccall "g_volume_enumerate_identifiers" g_volume_enumerate_identifiers ::
Ptr Volume ->
IO (Ptr CString)
volumeEnumerateIdentifiers ::
(B.CallStack.HasCallStack, MonadIO m, IsVolume a) =>
a
-> m [T.Text]
volumeEnumerateIdentifiers :: a -> m [Text]
volumeEnumerateIdentifiers volume :: a
volume = 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 Volume
volume' <- a -> IO (Ptr Volume)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
volume
Ptr CString
result <- Ptr Volume -> IO (Ptr CString)
g_volume_enumerate_identifiers Ptr Volume
volume'
Text -> Ptr CString -> VolumeChangedCallback
forall a. HasCallStack => Text -> Ptr a -> VolumeChangedCallback
checkUnexpectedReturnNULL "volumeEnumerateIdentifiers" Ptr CString
result
[Text]
result' <- HasCallStack => Ptr CString -> IO [Text]
Ptr CString -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr CString
result
(CString -> VolumeChangedCallback)
-> Ptr CString -> VolumeChangedCallback
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> VolumeChangedCallback
mapZeroTerminatedCArray CString -> VolumeChangedCallback
forall a. Ptr a -> VolumeChangedCallback
freeMem Ptr CString
result
Ptr CString -> VolumeChangedCallback
forall a. Ptr a -> VolumeChangedCallback
freeMem Ptr CString
result
a -> VolumeChangedCallback
forall a. ManagedPtrNewtype a => a -> VolumeChangedCallback
touchManagedPtr a
volume
[Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result'
#if defined(ENABLE_OVERLOADING)
data VolumeEnumerateIdentifiersMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m, IsVolume a) => O.MethodInfo VolumeEnumerateIdentifiersMethodInfo a signature where
overloadedMethod = volumeEnumerateIdentifiers
#endif
foreign import ccall "g_volume_get_activation_root" g_volume_get_activation_root ::
Ptr Volume ->
IO (Ptr Gio.File.File)
volumeGetActivationRoot ::
(B.CallStack.HasCallStack, MonadIO m, IsVolume a) =>
a
-> m (Maybe Gio.File.File)
volumeGetActivationRoot :: a -> m (Maybe File)
volumeGetActivationRoot volume :: a
volume = IO (Maybe File) -> m (Maybe File)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe File) -> m (Maybe File))
-> IO (Maybe File) -> m (Maybe File)
forall a b. (a -> b) -> a -> b
$ do
Ptr Volume
volume' <- a -> IO (Ptr Volume)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
volume
Ptr File
result <- Ptr Volume -> IO (Ptr File)
g_volume_get_activation_root Ptr Volume
volume'
Maybe File
maybeResult <- Ptr File -> (Ptr File -> IO File) -> IO (Maybe File)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr File
result ((Ptr File -> IO File) -> IO (Maybe File))
-> (Ptr File -> IO File) -> IO (Maybe File)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr File
result' -> do
File
result'' <- ((ManagedPtr File -> File) -> Ptr File -> IO File
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr File -> File
Gio.File.File) Ptr File
result'
File -> IO File
forall (m :: * -> *) a. Monad m => a -> m a
return File
result''
a -> VolumeChangedCallback
forall a. ManagedPtrNewtype a => a -> VolumeChangedCallback
touchManagedPtr a
volume
Maybe File -> IO (Maybe File)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe File
maybeResult
#if defined(ENABLE_OVERLOADING)
data VolumeGetActivationRootMethodInfo
instance (signature ~ (m (Maybe Gio.File.File)), MonadIO m, IsVolume a) => O.MethodInfo VolumeGetActivationRootMethodInfo a signature where
overloadedMethod = volumeGetActivationRoot
#endif
foreign import ccall "g_volume_get_drive" g_volume_get_drive ::
Ptr Volume ->
IO (Ptr Gio.Drive.Drive)
volumeGetDrive ::
(B.CallStack.HasCallStack, MonadIO m, IsVolume a) =>
a
-> m (Maybe Gio.Drive.Drive)
volumeGetDrive :: a -> m (Maybe Drive)
volumeGetDrive volume :: a
volume = 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 Volume
volume' <- a -> IO (Ptr Volume)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
volume
Ptr Drive
result <- Ptr Volume -> IO (Ptr Drive)
g_volume_get_drive Ptr Volume
volume'
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
$ \result' :: 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 -> VolumeChangedCallback
forall a. ManagedPtrNewtype a => a -> VolumeChangedCallback
touchManagedPtr a
volume
Maybe Drive -> IO (Maybe Drive)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Drive
maybeResult
#if defined(ENABLE_OVERLOADING)
data VolumeGetDriveMethodInfo
instance (signature ~ (m (Maybe Gio.Drive.Drive)), MonadIO m, IsVolume a) => O.MethodInfo VolumeGetDriveMethodInfo a signature where
overloadedMethod = volumeGetDrive
#endif
foreign import ccall "g_volume_get_icon" g_volume_get_icon ::
Ptr Volume ->
IO (Ptr Gio.Icon.Icon)
volumeGetIcon ::
(B.CallStack.HasCallStack, MonadIO m, IsVolume a) =>
a
-> m Gio.Icon.Icon
volumeGetIcon :: a -> m Icon
volumeGetIcon volume :: a
volume = 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 Volume
volume' <- a -> IO (Ptr Volume)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
volume
Ptr Icon
result <- Ptr Volume -> IO (Ptr Icon)
g_volume_get_icon Ptr Volume
volume'
Text -> Ptr Icon -> VolumeChangedCallback
forall a. HasCallStack => Text -> Ptr a -> VolumeChangedCallback
checkUnexpectedReturnNULL "volumeGetIcon" 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 -> VolumeChangedCallback
forall a. ManagedPtrNewtype a => a -> VolumeChangedCallback
touchManagedPtr a
volume
Icon -> IO Icon
forall (m :: * -> *) a. Monad m => a -> m a
return Icon
result'
#if defined(ENABLE_OVERLOADING)
data VolumeGetIconMethodInfo
instance (signature ~ (m Gio.Icon.Icon), MonadIO m, IsVolume a) => O.MethodInfo VolumeGetIconMethodInfo a signature where
overloadedMethod = volumeGetIcon
#endif
foreign import ccall "g_volume_get_identifier" g_volume_get_identifier ::
Ptr Volume ->
CString ->
IO CString
volumeGetIdentifier ::
(B.CallStack.HasCallStack, MonadIO m, IsVolume a) =>
a
-> T.Text
-> m (Maybe T.Text)
volumeGetIdentifier :: a -> Text -> m (Maybe Text)
volumeGetIdentifier volume :: a
volume kind :: Text
kind = 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 Volume
volume' <- a -> IO (Ptr Volume)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
volume
CString
kind' <- Text -> IO CString
textToCString Text
kind
CString
result <- Ptr Volume -> CString -> IO CString
g_volume_get_identifier Ptr Volume
volume' CString
kind'
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
$ \result' :: CString
result' -> do
Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
CString -> VolumeChangedCallback
forall a. Ptr a -> VolumeChangedCallback
freeMem CString
result'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
a -> VolumeChangedCallback
forall a. ManagedPtrNewtype a => a -> VolumeChangedCallback
touchManagedPtr a
volume
CString -> VolumeChangedCallback
forall a. Ptr a -> VolumeChangedCallback
freeMem CString
kind'
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data VolumeGetIdentifierMethodInfo
instance (signature ~ (T.Text -> m (Maybe T.Text)), MonadIO m, IsVolume a) => O.MethodInfo VolumeGetIdentifierMethodInfo a signature where
overloadedMethod = volumeGetIdentifier
#endif
foreign import ccall "g_volume_get_mount" g_volume_get_mount ::
Ptr Volume ->
IO (Ptr Gio.Mount.Mount)
volumeGetMount ::
(B.CallStack.HasCallStack, MonadIO m, IsVolume a) =>
a
-> m (Maybe Gio.Mount.Mount)
volumeGetMount :: a -> m (Maybe Mount)
volumeGetMount volume :: a
volume = IO (Maybe Mount) -> m (Maybe Mount)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Mount) -> m (Maybe Mount))
-> IO (Maybe Mount) -> m (Maybe Mount)
forall a b. (a -> b) -> a -> b
$ do
Ptr Volume
volume' <- a -> IO (Ptr Volume)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
volume
Ptr Mount
result <- Ptr Volume -> IO (Ptr Mount)
g_volume_get_mount Ptr Volume
volume'
Maybe Mount
maybeResult <- Ptr Mount -> (Ptr Mount -> IO Mount) -> IO (Maybe Mount)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Mount
result ((Ptr Mount -> IO Mount) -> IO (Maybe Mount))
-> (Ptr Mount -> IO Mount) -> IO (Maybe Mount)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr Mount
result' -> do
Mount
result'' <- ((ManagedPtr Mount -> Mount) -> Ptr Mount -> IO Mount
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Mount -> Mount
Gio.Mount.Mount) Ptr Mount
result'
Mount -> IO Mount
forall (m :: * -> *) a. Monad m => a -> m a
return Mount
result''
a -> VolumeChangedCallback
forall a. ManagedPtrNewtype a => a -> VolumeChangedCallback
touchManagedPtr a
volume
Maybe Mount -> IO (Maybe Mount)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Mount
maybeResult
#if defined(ENABLE_OVERLOADING)
data VolumeGetMountMethodInfo
instance (signature ~ (m (Maybe Gio.Mount.Mount)), MonadIO m, IsVolume a) => O.MethodInfo VolumeGetMountMethodInfo a signature where
overloadedMethod = volumeGetMount
#endif
foreign import ccall "g_volume_get_name" g_volume_get_name ::
Ptr Volume ->
IO CString
volumeGetName ::
(B.CallStack.HasCallStack, MonadIO m, IsVolume a) =>
a
-> m T.Text
volumeGetName :: a -> m Text
volumeGetName volume :: a
volume = 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 Volume
volume' <- a -> IO (Ptr Volume)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
volume
CString
result <- Ptr Volume -> IO CString
g_volume_get_name Ptr Volume
volume'
Text -> CString -> VolumeChangedCallback
forall a. HasCallStack => Text -> Ptr a -> VolumeChangedCallback
checkUnexpectedReturnNULL "volumeGetName" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> VolumeChangedCallback
forall a. Ptr a -> VolumeChangedCallback
freeMem CString
result
a -> VolumeChangedCallback
forall a. ManagedPtrNewtype a => a -> VolumeChangedCallback
touchManagedPtr a
volume
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data VolumeGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsVolume a) => O.MethodInfo VolumeGetNameMethodInfo a signature where
overloadedMethod = volumeGetName
#endif
foreign import ccall "g_volume_get_sort_key" g_volume_get_sort_key ::
Ptr Volume ->
IO CString
volumeGetSortKey ::
(B.CallStack.HasCallStack, MonadIO m, IsVolume a) =>
a
-> m (Maybe T.Text)
volumeGetSortKey :: a -> m (Maybe Text)
volumeGetSortKey volume :: a
volume = 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 Volume
volume' <- a -> IO (Ptr Volume)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
volume
CString
result <- Ptr Volume -> IO CString
g_volume_get_sort_key Ptr Volume
volume'
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
$ \result' :: 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 -> VolumeChangedCallback
forall a. ManagedPtrNewtype a => a -> VolumeChangedCallback
touchManagedPtr a
volume
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data VolumeGetSortKeyMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsVolume a) => O.MethodInfo VolumeGetSortKeyMethodInfo a signature where
overloadedMethod = volumeGetSortKey
#endif
foreign import ccall "g_volume_get_symbolic_icon" g_volume_get_symbolic_icon ::
Ptr Volume ->
IO (Ptr Gio.Icon.Icon)
volumeGetSymbolicIcon ::
(B.CallStack.HasCallStack, MonadIO m, IsVolume a) =>
a
-> m Gio.Icon.Icon
volumeGetSymbolicIcon :: a -> m Icon
volumeGetSymbolicIcon volume :: a
volume = 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 Volume
volume' <- a -> IO (Ptr Volume)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
volume
Ptr Icon
result <- Ptr Volume -> IO (Ptr Icon)
g_volume_get_symbolic_icon Ptr Volume
volume'
Text -> Ptr Icon -> VolumeChangedCallback
forall a. HasCallStack => Text -> Ptr a -> VolumeChangedCallback
checkUnexpectedReturnNULL "volumeGetSymbolicIcon" 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 -> VolumeChangedCallback
forall a. ManagedPtrNewtype a => a -> VolumeChangedCallback
touchManagedPtr a
volume
Icon -> IO Icon
forall (m :: * -> *) a. Monad m => a -> m a
return Icon
result'
#if defined(ENABLE_OVERLOADING)
data VolumeGetSymbolicIconMethodInfo
instance (signature ~ (m Gio.Icon.Icon), MonadIO m, IsVolume a) => O.MethodInfo VolumeGetSymbolicIconMethodInfo a signature where
overloadedMethod = volumeGetSymbolicIcon
#endif
foreign import ccall "g_volume_get_uuid" g_volume_get_uuid ::
Ptr Volume ->
IO CString
volumeGetUuid ::
(B.CallStack.HasCallStack, MonadIO m, IsVolume a) =>
a
-> m (Maybe T.Text)
volumeGetUuid :: a -> m (Maybe Text)
volumeGetUuid volume :: a
volume = 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 Volume
volume' <- a -> IO (Ptr Volume)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
volume
CString
result <- Ptr Volume -> IO CString
g_volume_get_uuid Ptr Volume
volume'
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
$ \result' :: CString
result' -> do
Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
CString -> VolumeChangedCallback
forall a. Ptr a -> VolumeChangedCallback
freeMem CString
result'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
a -> VolumeChangedCallback
forall a. ManagedPtrNewtype a => a -> VolumeChangedCallback
touchManagedPtr a
volume
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data VolumeGetUuidMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsVolume a) => O.MethodInfo VolumeGetUuidMethodInfo a signature where
overloadedMethod = volumeGetUuid
#endif
foreign import ccall "g_volume_mount" g_volume_mount ::
Ptr Volume ->
CUInt ->
Ptr Gio.MountOperation.MountOperation ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
volumeMount ::
(B.CallStack.HasCallStack, MonadIO m, IsVolume a, Gio.MountOperation.IsMountOperation b, Gio.Cancellable.IsCancellable c) =>
a
-> [Gio.Flags.MountMountFlags]
-> Maybe (b)
-> Maybe (c)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
volumeMount :: a
-> [MountMountFlags]
-> Maybe b
-> Maybe c
-> Maybe AsyncReadyCallback
-> m ()
volumeMount volume :: a
volume flags :: [MountMountFlags]
flags mountOperation :: Maybe b
mountOperation cancellable :: Maybe c
cancellable callback :: Maybe AsyncReadyCallback
callback = VolumeChangedCallback -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (VolumeChangedCallback -> m ()) -> VolumeChangedCallback -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Volume
volume' <- a -> IO (Ptr Volume)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
volume
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
Nothing -> Ptr MountOperation -> IO (Ptr MountOperation)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr MountOperation
forall a. Ptr a
nullPtr
Just jMountOperation :: 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
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just jCancellable :: 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
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 jCallback :: 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 -> VolumeChangedCallback
forall a. Storable a => Ptr a -> a -> VolumeChangedCallback
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 Volume
-> CUInt
-> Ptr MountOperation
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> VolumeChangedCallback
g_volume_mount Ptr Volume
volume' CUInt
flags' Ptr MountOperation
maybeMountOperation Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> VolumeChangedCallback
forall a. ManagedPtrNewtype a => a -> VolumeChangedCallback
touchManagedPtr a
volume
Maybe b -> (b -> VolumeChangedCallback) -> VolumeChangedCallback
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
mountOperation b -> VolumeChangedCallback
forall a. ManagedPtrNewtype a => a -> VolumeChangedCallback
touchManagedPtr
Maybe c -> (c -> VolumeChangedCallback) -> VolumeChangedCallback
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> VolumeChangedCallback
forall a. ManagedPtrNewtype a => a -> VolumeChangedCallback
touchManagedPtr
() -> VolumeChangedCallback
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data VolumeMountMethodInfo
instance (signature ~ ([Gio.Flags.MountMountFlags] -> Maybe (b) -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsVolume a, Gio.MountOperation.IsMountOperation b, Gio.Cancellable.IsCancellable c) => O.MethodInfo VolumeMountMethodInfo a signature where
overloadedMethod = volumeMount
#endif
foreign import ccall "g_volume_mount_finish" g_volume_mount_finish ::
Ptr Volume ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
volumeMountFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsVolume a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
volumeMountFinish :: a -> b -> m ()
volumeMountFinish volume :: a
volume result_ :: b
result_ = VolumeChangedCallback -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (VolumeChangedCallback -> m ()) -> VolumeChangedCallback -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Volume
volume' <- a -> IO (Ptr Volume)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
volume
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
VolumeChangedCallback
-> VolumeChangedCallback -> VolumeChangedCallback
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 Volume -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
g_volume_mount_finish Ptr Volume
volume' Ptr AsyncResult
result_'
a -> VolumeChangedCallback
forall a. ManagedPtrNewtype a => a -> VolumeChangedCallback
touchManagedPtr a
volume
b -> VolumeChangedCallback
forall a. ManagedPtrNewtype a => a -> VolumeChangedCallback
touchManagedPtr b
result_
() -> VolumeChangedCallback
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> VolumeChangedCallback
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data VolumeMountFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsVolume a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo VolumeMountFinishMethodInfo a signature where
overloadedMethod = volumeMountFinish
#endif
foreign import ccall "g_volume_should_automount" g_volume_should_automount ::
Ptr Volume ->
IO CInt
volumeShouldAutomount ::
(B.CallStack.HasCallStack, MonadIO m, IsVolume a) =>
a
-> m Bool
volumeShouldAutomount :: a -> m Bool
volumeShouldAutomount volume :: a
volume = 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 Volume
volume' <- a -> IO (Ptr Volume)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
volume
CInt
result <- Ptr Volume -> IO CInt
g_volume_should_automount Ptr Volume
volume'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> VolumeChangedCallback
forall a. ManagedPtrNewtype a => a -> VolumeChangedCallback
touchManagedPtr a
volume
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data VolumeShouldAutomountMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsVolume a) => O.MethodInfo VolumeShouldAutomountMethodInfo a signature where
overloadedMethod = volumeShouldAutomount
#endif