module GI.Gio.Interfaces.Drive
(
Drive(..) ,
noDrive ,
IsDrive ,
toDrive ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveCanEjectMethodInfo ,
#endif
driveCanEject ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveCanPollForMediaMethodInfo ,
#endif
driveCanPollForMedia ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveCanStartMethodInfo ,
#endif
driveCanStart ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveCanStartDegradedMethodInfo ,
#endif
driveCanStartDegraded ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveCanStopMethodInfo ,
#endif
driveCanStop ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveEjectMethodInfo ,
#endif
driveEject ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveEjectFinishMethodInfo ,
#endif
driveEjectFinish ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveEjectWithOperationMethodInfo ,
#endif
driveEjectWithOperation ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveEjectWithOperationFinishMethodInfo ,
#endif
driveEjectWithOperationFinish ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveEnumerateIdentifiersMethodInfo ,
#endif
driveEnumerateIdentifiers ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveGetIconMethodInfo ,
#endif
driveGetIcon ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveGetIdentifierMethodInfo ,
#endif
driveGetIdentifier ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveGetNameMethodInfo ,
#endif
driveGetName ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveGetSortKeyMethodInfo ,
#endif
driveGetSortKey ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveGetStartStopTypeMethodInfo ,
#endif
driveGetStartStopType ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveGetSymbolicIconMethodInfo ,
#endif
driveGetSymbolicIcon ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveGetVolumesMethodInfo ,
#endif
driveGetVolumes ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveHasMediaMethodInfo ,
#endif
driveHasMedia ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveHasVolumesMethodInfo ,
#endif
driveHasVolumes ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveIsMediaCheckAutomaticMethodInfo ,
#endif
driveIsMediaCheckAutomatic ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveIsMediaRemovableMethodInfo ,
#endif
driveIsMediaRemovable ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveIsRemovableMethodInfo ,
#endif
driveIsRemovable ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DrivePollForMediaMethodInfo ,
#endif
drivePollForMedia ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DrivePollForMediaFinishMethodInfo ,
#endif
drivePollForMediaFinish ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveStartMethodInfo ,
#endif
driveStart ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveStartFinishMethodInfo ,
#endif
driveStartFinish ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveStopMethodInfo ,
#endif
driveStop ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveStopFinishMethodInfo ,
#endif
driveStopFinish ,
C_DriveChangedCallback ,
DriveChangedCallback ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveChangedSignalInfo ,
#endif
afterDriveChanged ,
genClosure_DriveChanged ,
mk_DriveChangedCallback ,
noDriveChangedCallback ,
onDriveChanged ,
wrap_DriveChangedCallback ,
C_DriveDisconnectedCallback ,
DriveDisconnectedCallback ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveDisconnectedSignalInfo ,
#endif
afterDriveDisconnected ,
genClosure_DriveDisconnected ,
mk_DriveDisconnectedCallback ,
noDriveDisconnectedCallback ,
onDriveDisconnected ,
wrap_DriveDisconnectedCallback ,
C_DriveEjectButtonCallback ,
DriveEjectButtonCallback ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveEjectButtonSignalInfo ,
#endif
afterDriveEjectButton ,
genClosure_DriveEjectButton ,
mk_DriveEjectButtonCallback ,
noDriveEjectButtonCallback ,
onDriveEjectButton ,
wrap_DriveEjectButtonCallback ,
C_DriveStopButtonCallback ,
DriveStopButtonCallback ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
DriveStopButtonSignalInfo ,
#endif
afterDriveStopButton ,
genClosure_DriveStopButton ,
mk_DriveStopButtonCallback ,
noDriveStopButtonCallback ,
onDriveStopButton ,
wrap_DriveStopButtonCallback ,
) 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.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Enums as Gio.Enums
import qualified GI.Gio.Flags as Gio.Flags
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Interfaces.Icon as Gio.Icon
import qualified GI.Gio.Interfaces.Volume as Gio.Volume
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.MountOperation as Gio.MountOperation
newtype Drive = Drive (ManagedPtr Drive)
noDrive :: Maybe Drive
noDrive = Nothing
type DriveChangedCallback =
IO ()
noDriveChangedCallback :: Maybe DriveChangedCallback
noDriveChangedCallback = Nothing
type C_DriveChangedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_DriveChangedCallback :: C_DriveChangedCallback -> IO (FunPtr C_DriveChangedCallback)
genClosure_DriveChanged :: DriveChangedCallback -> IO Closure
genClosure_DriveChanged cb = do
let cb' = wrap_DriveChangedCallback cb
mk_DriveChangedCallback cb' >>= newCClosure
wrap_DriveChangedCallback ::
DriveChangedCallback ->
Ptr () ->
Ptr () ->
IO ()
wrap_DriveChangedCallback _cb _ _ = do
_cb
onDriveChanged :: (IsDrive a, MonadIO m) => a -> DriveChangedCallback -> m SignalHandlerId
onDriveChanged obj cb = liftIO $ do
let cb' = wrap_DriveChangedCallback cb
cb'' <- mk_DriveChangedCallback cb'
connectSignalFunPtr obj "changed" cb'' SignalConnectBefore
afterDriveChanged :: (IsDrive a, MonadIO m) => a -> DriveChangedCallback -> m SignalHandlerId
afterDriveChanged obj cb = liftIO $ do
let cb' = wrap_DriveChangedCallback cb
cb'' <- mk_DriveChangedCallback cb'
connectSignalFunPtr obj "changed" cb'' SignalConnectAfter
type DriveDisconnectedCallback =
IO ()
noDriveDisconnectedCallback :: Maybe DriveDisconnectedCallback
noDriveDisconnectedCallback = Nothing
type C_DriveDisconnectedCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_DriveDisconnectedCallback :: C_DriveDisconnectedCallback -> IO (FunPtr C_DriveDisconnectedCallback)
genClosure_DriveDisconnected :: DriveDisconnectedCallback -> IO Closure
genClosure_DriveDisconnected cb = do
let cb' = wrap_DriveDisconnectedCallback cb
mk_DriveDisconnectedCallback cb' >>= newCClosure
wrap_DriveDisconnectedCallback ::
DriveDisconnectedCallback ->
Ptr () ->
Ptr () ->
IO ()
wrap_DriveDisconnectedCallback _cb _ _ = do
_cb
onDriveDisconnected :: (IsDrive a, MonadIO m) => a -> DriveDisconnectedCallback -> m SignalHandlerId
onDriveDisconnected obj cb = liftIO $ do
let cb' = wrap_DriveDisconnectedCallback cb
cb'' <- mk_DriveDisconnectedCallback cb'
connectSignalFunPtr obj "disconnected" cb'' SignalConnectBefore
afterDriveDisconnected :: (IsDrive a, MonadIO m) => a -> DriveDisconnectedCallback -> m SignalHandlerId
afterDriveDisconnected obj cb = liftIO $ do
let cb' = wrap_DriveDisconnectedCallback cb
cb'' <- mk_DriveDisconnectedCallback cb'
connectSignalFunPtr obj "disconnected" cb'' SignalConnectAfter
type DriveEjectButtonCallback =
IO ()
noDriveEjectButtonCallback :: Maybe DriveEjectButtonCallback
noDriveEjectButtonCallback = Nothing
type C_DriveEjectButtonCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_DriveEjectButtonCallback :: C_DriveEjectButtonCallback -> IO (FunPtr C_DriveEjectButtonCallback)
genClosure_DriveEjectButton :: DriveEjectButtonCallback -> IO Closure
genClosure_DriveEjectButton cb = do
let cb' = wrap_DriveEjectButtonCallback cb
mk_DriveEjectButtonCallback cb' >>= newCClosure
wrap_DriveEjectButtonCallback ::
DriveEjectButtonCallback ->
Ptr () ->
Ptr () ->
IO ()
wrap_DriveEjectButtonCallback _cb _ _ = do
_cb
onDriveEjectButton :: (IsDrive a, MonadIO m) => a -> DriveEjectButtonCallback -> m SignalHandlerId
onDriveEjectButton obj cb = liftIO $ do
let cb' = wrap_DriveEjectButtonCallback cb
cb'' <- mk_DriveEjectButtonCallback cb'
connectSignalFunPtr obj "eject-button" cb'' SignalConnectBefore
afterDriveEjectButton :: (IsDrive a, MonadIO m) => a -> DriveEjectButtonCallback -> m SignalHandlerId
afterDriveEjectButton obj cb = liftIO $ do
let cb' = wrap_DriveEjectButtonCallback cb
cb'' <- mk_DriveEjectButtonCallback cb'
connectSignalFunPtr obj "eject-button" cb'' SignalConnectAfter
type DriveStopButtonCallback =
IO ()
noDriveStopButtonCallback :: Maybe DriveStopButtonCallback
noDriveStopButtonCallback = Nothing
type C_DriveStopButtonCallback =
Ptr () ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_DriveStopButtonCallback :: C_DriveStopButtonCallback -> IO (FunPtr C_DriveStopButtonCallback)
genClosure_DriveStopButton :: DriveStopButtonCallback -> IO Closure
genClosure_DriveStopButton cb = do
let cb' = wrap_DriveStopButtonCallback cb
mk_DriveStopButtonCallback cb' >>= newCClosure
wrap_DriveStopButtonCallback ::
DriveStopButtonCallback ->
Ptr () ->
Ptr () ->
IO ()
wrap_DriveStopButtonCallback _cb _ _ = do
_cb
onDriveStopButton :: (IsDrive a, MonadIO m) => a -> DriveStopButtonCallback -> m SignalHandlerId
onDriveStopButton obj cb = liftIO $ do
let cb' = wrap_DriveStopButtonCallback cb
cb'' <- mk_DriveStopButtonCallback cb'
connectSignalFunPtr obj "stop-button" cb'' SignalConnectBefore
afterDriveStopButton :: (IsDrive a, MonadIO m) => a -> DriveStopButtonCallback -> m SignalHandlerId
afterDriveStopButton obj cb = liftIO $ do
let cb' = wrap_DriveStopButtonCallback cb
cb'' <- mk_DriveStopButtonCallback cb'
connectSignalFunPtr obj "stop-button" cb'' SignalConnectAfter
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DriveChangedSignalInfo
instance SignalInfo DriveChangedSignalInfo where
type HaskellCallbackType DriveChangedSignalInfo = DriveChangedCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_DriveChangedCallback cb
cb'' <- mk_DriveChangedCallback cb'
connectSignalFunPtr obj "changed" cb'' connectMode
data DriveDisconnectedSignalInfo
instance SignalInfo DriveDisconnectedSignalInfo where
type HaskellCallbackType DriveDisconnectedSignalInfo = DriveDisconnectedCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_DriveDisconnectedCallback cb
cb'' <- mk_DriveDisconnectedCallback cb'
connectSignalFunPtr obj "disconnected" cb'' connectMode
data DriveEjectButtonSignalInfo
instance SignalInfo DriveEjectButtonSignalInfo where
type HaskellCallbackType DriveEjectButtonSignalInfo = DriveEjectButtonCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_DriveEjectButtonCallback cb
cb'' <- mk_DriveEjectButtonCallback cb'
connectSignalFunPtr obj "eject-button" cb'' connectMode
data DriveStopButtonSignalInfo
instance SignalInfo DriveStopButtonSignalInfo where
type HaskellCallbackType DriveStopButtonSignalInfo = DriveStopButtonCallback
connectSignal _ obj cb connectMode = do
let cb' = wrap_DriveStopButtonCallback cb
cb'' <- mk_DriveStopButtonCallback cb'
connectSignalFunPtr obj "stop-button" cb'' connectMode
type instance O.SignalList Drive = DriveSignalList
type DriveSignalList = ('[ '("changed", DriveChangedSignalInfo), '("disconnected", DriveDisconnectedSignalInfo), '("ejectButton", DriveEjectButtonSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("stopButton", DriveStopButtonSignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_drive_get_type"
c_g_drive_get_type :: IO GType
instance GObject Drive where
gobjectType _ = c_g_drive_get_type
class GObject o => IsDrive o
#if MIN_VERSION_base(4,9,0)
instance (GObject a, O.UnknownAncestorError Drive a) =>
IsDrive a
#endif
instance IsDrive Drive
instance GObject.Object.IsObject Drive
toDrive :: (MonadIO m, IsDrive o) => o -> m Drive
toDrive = liftIO . unsafeCastTo Drive
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
instance O.HasAttributeList Drive
type instance O.AttributeList Drive = DriveAttributeList
type DriveAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type family ResolveDriveMethod (t :: Symbol) (o :: *) :: * where
ResolveDriveMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDriveMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDriveMethod "canEject" o = DriveCanEjectMethodInfo
ResolveDriveMethod "canPollForMedia" o = DriveCanPollForMediaMethodInfo
ResolveDriveMethod "canStart" o = DriveCanStartMethodInfo
ResolveDriveMethod "canStartDegraded" o = DriveCanStartDegradedMethodInfo
ResolveDriveMethod "canStop" o = DriveCanStopMethodInfo
ResolveDriveMethod "eject" o = DriveEjectMethodInfo
ResolveDriveMethod "ejectFinish" o = DriveEjectFinishMethodInfo
ResolveDriveMethod "ejectWithOperation" o = DriveEjectWithOperationMethodInfo
ResolveDriveMethod "ejectWithOperationFinish" o = DriveEjectWithOperationFinishMethodInfo
ResolveDriveMethod "enumerateIdentifiers" o = DriveEnumerateIdentifiersMethodInfo
ResolveDriveMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDriveMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDriveMethod "hasMedia" o = DriveHasMediaMethodInfo
ResolveDriveMethod "hasVolumes" o = DriveHasVolumesMethodInfo
ResolveDriveMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDriveMethod "isMediaCheckAutomatic" o = DriveIsMediaCheckAutomaticMethodInfo
ResolveDriveMethod "isMediaRemovable" o = DriveIsMediaRemovableMethodInfo
ResolveDriveMethod "isRemovable" o = DriveIsRemovableMethodInfo
ResolveDriveMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDriveMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDriveMethod "pollForMedia" o = DrivePollForMediaMethodInfo
ResolveDriveMethod "pollForMediaFinish" o = DrivePollForMediaFinishMethodInfo
ResolveDriveMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveDriveMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDriveMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
ResolveDriveMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
ResolveDriveMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDriveMethod "start" o = DriveStartMethodInfo
ResolveDriveMethod "startFinish" o = DriveStartFinishMethodInfo
ResolveDriveMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDriveMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDriveMethod "stop" o = DriveStopMethodInfo
ResolveDriveMethod "stopFinish" o = DriveStopFinishMethodInfo
ResolveDriveMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDriveMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveDriveMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDriveMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDriveMethod "getIcon" o = DriveGetIconMethodInfo
ResolveDriveMethod "getIdentifier" o = DriveGetIdentifierMethodInfo
ResolveDriveMethod "getName" o = DriveGetNameMethodInfo
ResolveDriveMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDriveMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDriveMethod "getSortKey" o = DriveGetSortKeyMethodInfo
ResolveDriveMethod "getStartStopType" o = DriveGetStartStopTypeMethodInfo
ResolveDriveMethod "getSymbolicIcon" o = DriveGetSymbolicIconMethodInfo
ResolveDriveMethod "getVolumes" o = DriveGetVolumesMethodInfo
ResolveDriveMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDriveMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDriveMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDriveMethod t Drive, O.MethodInfo info Drive p) => O.IsLabelProxy t (Drive -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveDriveMethod t Drive, O.MethodInfo info Drive p) => O.IsLabel t (Drive -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
#endif
foreign import ccall "g_drive_can_eject" g_drive_can_eject ::
Ptr Drive ->
IO CInt
driveCanEject ::
(B.CallStack.HasCallStack, MonadIO m, IsDrive a) =>
a
-> m Bool
driveCanEject drive = liftIO $ do
drive' <- unsafeManagedPtrCastPtr drive
result <- g_drive_can_eject drive'
let result' = (/= 0) result
touchManagedPtr drive
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DriveCanEjectMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDrive a) => O.MethodInfo DriveCanEjectMethodInfo a signature where
overloadedMethod _ = driveCanEject
#endif
foreign import ccall "g_drive_can_poll_for_media" g_drive_can_poll_for_media ::
Ptr Drive ->
IO CInt
driveCanPollForMedia ::
(B.CallStack.HasCallStack, MonadIO m, IsDrive a) =>
a
-> m Bool
driveCanPollForMedia drive = liftIO $ do
drive' <- unsafeManagedPtrCastPtr drive
result <- g_drive_can_poll_for_media drive'
let result' = (/= 0) result
touchManagedPtr drive
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DriveCanPollForMediaMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDrive a) => O.MethodInfo DriveCanPollForMediaMethodInfo a signature where
overloadedMethod _ = driveCanPollForMedia
#endif
foreign import ccall "g_drive_can_start" g_drive_can_start ::
Ptr Drive ->
IO CInt
driveCanStart ::
(B.CallStack.HasCallStack, MonadIO m, IsDrive a) =>
a
-> m Bool
driveCanStart drive = liftIO $ do
drive' <- unsafeManagedPtrCastPtr drive
result <- g_drive_can_start drive'
let result' = (/= 0) result
touchManagedPtr drive
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DriveCanStartMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDrive a) => O.MethodInfo DriveCanStartMethodInfo a signature where
overloadedMethod _ = driveCanStart
#endif
foreign import ccall "g_drive_can_start_degraded" g_drive_can_start_degraded ::
Ptr Drive ->
IO CInt
driveCanStartDegraded ::
(B.CallStack.HasCallStack, MonadIO m, IsDrive a) =>
a
-> m Bool
driveCanStartDegraded drive = liftIO $ do
drive' <- unsafeManagedPtrCastPtr drive
result <- g_drive_can_start_degraded drive'
let result' = (/= 0) result
touchManagedPtr drive
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DriveCanStartDegradedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDrive a) => O.MethodInfo DriveCanStartDegradedMethodInfo a signature where
overloadedMethod _ = driveCanStartDegraded
#endif
foreign import ccall "g_drive_can_stop" g_drive_can_stop ::
Ptr Drive ->
IO CInt
driveCanStop ::
(B.CallStack.HasCallStack, MonadIO m, IsDrive a) =>
a
-> m Bool
driveCanStop drive = liftIO $ do
drive' <- unsafeManagedPtrCastPtr drive
result <- g_drive_can_stop drive'
let result' = (/= 0) result
touchManagedPtr drive
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DriveCanStopMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDrive a) => O.MethodInfo DriveCanStopMethodInfo a signature where
overloadedMethod _ = driveCanStop
#endif
foreign import ccall "g_drive_eject" g_drive_eject ::
Ptr Drive ->
CUInt ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
driveEject ::
(B.CallStack.HasCallStack, MonadIO m, IsDrive a, Gio.Cancellable.IsCancellable b) =>
a
-> [Gio.Flags.MountUnmountFlags]
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
driveEject drive flags cancellable callback = liftIO $ do
drive' <- unsafeManagedPtrCastPtr drive
let flags' = gflagsToWord flags
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
maybeCallback <- case callback of
Nothing -> return (castPtrToFunPtr nullPtr)
Just jCallback -> do
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = nullPtr
g_drive_eject drive' flags' maybeCancellable maybeCallback userData
touchManagedPtr drive
whenJust cancellable touchManagedPtr
return ()
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DriveEjectMethodInfo
instance (signature ~ ([Gio.Flags.MountUnmountFlags] -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsDrive a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DriveEjectMethodInfo a signature where
overloadedMethod _ = driveEject
#endif
foreign import ccall "g_drive_eject_finish" g_drive_eject_finish ::
Ptr Drive ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
driveEjectFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsDrive a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
driveEjectFinish drive result_ = liftIO $ do
drive' <- unsafeManagedPtrCastPtr drive
result_' <- unsafeManagedPtrCastPtr result_
onException (do
_ <- propagateGError $ g_drive_eject_finish drive' result_'
touchManagedPtr drive
touchManagedPtr result_
return ()
) (do
return ()
)
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DriveEjectFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsDrive a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo DriveEjectFinishMethodInfo a signature where
overloadedMethod _ = driveEjectFinish
#endif
foreign import ccall "g_drive_eject_with_operation" g_drive_eject_with_operation ::
Ptr Drive ->
CUInt ->
Ptr Gio.MountOperation.MountOperation ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
driveEjectWithOperation ::
(B.CallStack.HasCallStack, MonadIO m, IsDrive a, Gio.MountOperation.IsMountOperation b, Gio.Cancellable.IsCancellable c) =>
a
-> [Gio.Flags.MountUnmountFlags]
-> Maybe (b)
-> Maybe (c)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
driveEjectWithOperation drive flags mountOperation cancellable callback = liftIO $ do
drive' <- unsafeManagedPtrCastPtr drive
let flags' = gflagsToWord flags
maybeMountOperation <- case mountOperation of
Nothing -> return nullPtr
Just jMountOperation -> do
jMountOperation' <- unsafeManagedPtrCastPtr jMountOperation
return jMountOperation'
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
maybeCallback <- case callback of
Nothing -> return (castPtrToFunPtr nullPtr)
Just jCallback -> do
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = nullPtr
g_drive_eject_with_operation drive' flags' maybeMountOperation maybeCancellable maybeCallback userData
touchManagedPtr drive
whenJust mountOperation touchManagedPtr
whenJust cancellable touchManagedPtr
return ()
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DriveEjectWithOperationMethodInfo
instance (signature ~ ([Gio.Flags.MountUnmountFlags] -> Maybe (b) -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsDrive a, Gio.MountOperation.IsMountOperation b, Gio.Cancellable.IsCancellable c) => O.MethodInfo DriveEjectWithOperationMethodInfo a signature where
overloadedMethod _ = driveEjectWithOperation
#endif
foreign import ccall "g_drive_eject_with_operation_finish" g_drive_eject_with_operation_finish ::
Ptr Drive ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
driveEjectWithOperationFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsDrive a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
driveEjectWithOperationFinish drive result_ = liftIO $ do
drive' <- unsafeManagedPtrCastPtr drive
result_' <- unsafeManagedPtrCastPtr result_
onException (do
_ <- propagateGError $ g_drive_eject_with_operation_finish drive' result_'
touchManagedPtr drive
touchManagedPtr result_
return ()
) (do
return ()
)
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DriveEjectWithOperationFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsDrive a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo DriveEjectWithOperationFinishMethodInfo a signature where
overloadedMethod _ = driveEjectWithOperationFinish
#endif
foreign import ccall "g_drive_enumerate_identifiers" g_drive_enumerate_identifiers ::
Ptr Drive ->
IO (Ptr CString)
driveEnumerateIdentifiers ::
(B.CallStack.HasCallStack, MonadIO m, IsDrive a) =>
a
-> m [T.Text]
driveEnumerateIdentifiers drive = liftIO $ do
drive' <- unsafeManagedPtrCastPtr drive
result <- g_drive_enumerate_identifiers drive'
checkUnexpectedReturnNULL "driveEnumerateIdentifiers" result
result' <- unpackZeroTerminatedUTF8CArray result
mapZeroTerminatedCArray freeMem result
freeMem result
touchManagedPtr drive
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DriveEnumerateIdentifiersMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m, IsDrive a) => O.MethodInfo DriveEnumerateIdentifiersMethodInfo a signature where
overloadedMethod _ = driveEnumerateIdentifiers
#endif
foreign import ccall "g_drive_get_icon" g_drive_get_icon ::
Ptr Drive ->
IO (Ptr Gio.Icon.Icon)
driveGetIcon ::
(B.CallStack.HasCallStack, MonadIO m, IsDrive a) =>
a
-> m Gio.Icon.Icon
driveGetIcon drive = liftIO $ do
drive' <- unsafeManagedPtrCastPtr drive
result <- g_drive_get_icon drive'
checkUnexpectedReturnNULL "driveGetIcon" result
result' <- (wrapObject Gio.Icon.Icon) result
touchManagedPtr drive
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DriveGetIconMethodInfo
instance (signature ~ (m Gio.Icon.Icon), MonadIO m, IsDrive a) => O.MethodInfo DriveGetIconMethodInfo a signature where
overloadedMethod _ = driveGetIcon
#endif
foreign import ccall "g_drive_get_identifier" g_drive_get_identifier ::
Ptr Drive ->
CString ->
IO CString
driveGetIdentifier ::
(B.CallStack.HasCallStack, MonadIO m, IsDrive a) =>
a
-> T.Text
-> m T.Text
driveGetIdentifier drive kind = liftIO $ do
drive' <- unsafeManagedPtrCastPtr drive
kind' <- textToCString kind
result <- g_drive_get_identifier drive' kind'
checkUnexpectedReturnNULL "driveGetIdentifier" result
result' <- cstringToText result
freeMem result
touchManagedPtr drive
freeMem kind'
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DriveGetIdentifierMethodInfo
instance (signature ~ (T.Text -> m T.Text), MonadIO m, IsDrive a) => O.MethodInfo DriveGetIdentifierMethodInfo a signature where
overloadedMethod _ = driveGetIdentifier
#endif
foreign import ccall "g_drive_get_name" g_drive_get_name ::
Ptr Drive ->
IO CString
driveGetName ::
(B.CallStack.HasCallStack, MonadIO m, IsDrive a) =>
a
-> m T.Text
driveGetName drive = liftIO $ do
drive' <- unsafeManagedPtrCastPtr drive
result <- g_drive_get_name drive'
checkUnexpectedReturnNULL "driveGetName" result
result' <- cstringToText result
freeMem result
touchManagedPtr drive
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DriveGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDrive a) => O.MethodInfo DriveGetNameMethodInfo a signature where
overloadedMethod _ = driveGetName
#endif
foreign import ccall "g_drive_get_sort_key" g_drive_get_sort_key ::
Ptr Drive ->
IO CString
driveGetSortKey ::
(B.CallStack.HasCallStack, MonadIO m, IsDrive a) =>
a
-> m T.Text
driveGetSortKey drive = liftIO $ do
drive' <- unsafeManagedPtrCastPtr drive
result <- g_drive_get_sort_key drive'
checkUnexpectedReturnNULL "driveGetSortKey" result
result' <- cstringToText result
touchManagedPtr drive
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DriveGetSortKeyMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDrive a) => O.MethodInfo DriveGetSortKeyMethodInfo a signature where
overloadedMethod _ = driveGetSortKey
#endif
foreign import ccall "g_drive_get_start_stop_type" g_drive_get_start_stop_type ::
Ptr Drive ->
IO CUInt
driveGetStartStopType ::
(B.CallStack.HasCallStack, MonadIO m, IsDrive a) =>
a
-> m Gio.Enums.DriveStartStopType
driveGetStartStopType drive = liftIO $ do
drive' <- unsafeManagedPtrCastPtr drive
result <- g_drive_get_start_stop_type drive'
let result' = (toEnum . fromIntegral) result
touchManagedPtr drive
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DriveGetStartStopTypeMethodInfo
instance (signature ~ (m Gio.Enums.DriveStartStopType), MonadIO m, IsDrive a) => O.MethodInfo DriveGetStartStopTypeMethodInfo a signature where
overloadedMethod _ = driveGetStartStopType
#endif
foreign import ccall "g_drive_get_symbolic_icon" g_drive_get_symbolic_icon ::
Ptr Drive ->
IO (Ptr Gio.Icon.Icon)
driveGetSymbolicIcon ::
(B.CallStack.HasCallStack, MonadIO m, IsDrive a) =>
a
-> m Gio.Icon.Icon
driveGetSymbolicIcon drive = liftIO $ do
drive' <- unsafeManagedPtrCastPtr drive
result <- g_drive_get_symbolic_icon drive'
checkUnexpectedReturnNULL "driveGetSymbolicIcon" result
result' <- (wrapObject Gio.Icon.Icon) result
touchManagedPtr drive
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DriveGetSymbolicIconMethodInfo
instance (signature ~ (m Gio.Icon.Icon), MonadIO m, IsDrive a) => O.MethodInfo DriveGetSymbolicIconMethodInfo a signature where
overloadedMethod _ = driveGetSymbolicIcon
#endif
foreign import ccall "g_drive_get_volumes" g_drive_get_volumes ::
Ptr Drive ->
IO (Ptr (GList (Ptr Gio.Volume.Volume)))
driveGetVolumes ::
(B.CallStack.HasCallStack, MonadIO m, IsDrive a) =>
a
-> m [Gio.Volume.Volume]
driveGetVolumes drive = liftIO $ do
drive' <- unsafeManagedPtrCastPtr drive
result <- g_drive_get_volumes drive'
result' <- unpackGList result
result'' <- mapM (wrapObject Gio.Volume.Volume) result'
g_list_free result
touchManagedPtr drive
return result''
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DriveGetVolumesMethodInfo
instance (signature ~ (m [Gio.Volume.Volume]), MonadIO m, IsDrive a) => O.MethodInfo DriveGetVolumesMethodInfo a signature where
overloadedMethod _ = driveGetVolumes
#endif
foreign import ccall "g_drive_has_media" g_drive_has_media ::
Ptr Drive ->
IO CInt
driveHasMedia ::
(B.CallStack.HasCallStack, MonadIO m, IsDrive a) =>
a
-> m Bool
driveHasMedia drive = liftIO $ do
drive' <- unsafeManagedPtrCastPtr drive
result <- g_drive_has_media drive'
let result' = (/= 0) result
touchManagedPtr drive
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DriveHasMediaMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDrive a) => O.MethodInfo DriveHasMediaMethodInfo a signature where
overloadedMethod _ = driveHasMedia
#endif
foreign import ccall "g_drive_has_volumes" g_drive_has_volumes ::
Ptr Drive ->
IO CInt
driveHasVolumes ::
(B.CallStack.HasCallStack, MonadIO m, IsDrive a) =>
a
-> m Bool
driveHasVolumes drive = liftIO $ do
drive' <- unsafeManagedPtrCastPtr drive
result <- g_drive_has_volumes drive'
let result' = (/= 0) result
touchManagedPtr drive
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DriveHasVolumesMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDrive a) => O.MethodInfo DriveHasVolumesMethodInfo a signature where
overloadedMethod _ = driveHasVolumes
#endif
foreign import ccall "g_drive_is_media_check_automatic" g_drive_is_media_check_automatic ::
Ptr Drive ->
IO CInt
driveIsMediaCheckAutomatic ::
(B.CallStack.HasCallStack, MonadIO m, IsDrive a) =>
a
-> m Bool
driveIsMediaCheckAutomatic drive = liftIO $ do
drive' <- unsafeManagedPtrCastPtr drive
result <- g_drive_is_media_check_automatic drive'
let result' = (/= 0) result
touchManagedPtr drive
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DriveIsMediaCheckAutomaticMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDrive a) => O.MethodInfo DriveIsMediaCheckAutomaticMethodInfo a signature where
overloadedMethod _ = driveIsMediaCheckAutomatic
#endif
foreign import ccall "g_drive_is_media_removable" g_drive_is_media_removable ::
Ptr Drive ->
IO CInt
driveIsMediaRemovable ::
(B.CallStack.HasCallStack, MonadIO m, IsDrive a) =>
a
-> m Bool
driveIsMediaRemovable drive = liftIO $ do
drive' <- unsafeManagedPtrCastPtr drive
result <- g_drive_is_media_removable drive'
let result' = (/= 0) result
touchManagedPtr drive
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DriveIsMediaRemovableMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDrive a) => O.MethodInfo DriveIsMediaRemovableMethodInfo a signature where
overloadedMethod _ = driveIsMediaRemovable
#endif
foreign import ccall "g_drive_is_removable" g_drive_is_removable ::
Ptr Drive ->
IO CInt
driveIsRemovable ::
(B.CallStack.HasCallStack, MonadIO m, IsDrive a) =>
a
-> m Bool
driveIsRemovable drive = liftIO $ do
drive' <- unsafeManagedPtrCastPtr drive
result <- g_drive_is_removable drive'
let result' = (/= 0) result
touchManagedPtr drive
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DriveIsRemovableMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDrive a) => O.MethodInfo DriveIsRemovableMethodInfo a signature where
overloadedMethod _ = driveIsRemovable
#endif
foreign import ccall "g_drive_poll_for_media" g_drive_poll_for_media ::
Ptr Drive ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
drivePollForMedia ::
(B.CallStack.HasCallStack, MonadIO m, IsDrive a, Gio.Cancellable.IsCancellable b) =>
a
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
drivePollForMedia drive cancellable callback = liftIO $ do
drive' <- unsafeManagedPtrCastPtr drive
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
maybeCallback <- case callback of
Nothing -> return (castPtrToFunPtr nullPtr)
Just jCallback -> do
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = nullPtr
g_drive_poll_for_media drive' maybeCancellable maybeCallback userData
touchManagedPtr drive
whenJust cancellable touchManagedPtr
return ()
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DrivePollForMediaMethodInfo
instance (signature ~ (Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsDrive a, Gio.Cancellable.IsCancellable b) => O.MethodInfo DrivePollForMediaMethodInfo a signature where
overloadedMethod _ = drivePollForMedia
#endif
foreign import ccall "g_drive_poll_for_media_finish" g_drive_poll_for_media_finish ::
Ptr Drive ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
drivePollForMediaFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsDrive a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
drivePollForMediaFinish drive result_ = liftIO $ do
drive' <- unsafeManagedPtrCastPtr drive
result_' <- unsafeManagedPtrCastPtr result_
onException (do
_ <- propagateGError $ g_drive_poll_for_media_finish drive' result_'
touchManagedPtr drive
touchManagedPtr result_
return ()
) (do
return ()
)
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DrivePollForMediaFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsDrive a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo DrivePollForMediaFinishMethodInfo a signature where
overloadedMethod _ = drivePollForMediaFinish
#endif
foreign import ccall "g_drive_start" g_drive_start ::
Ptr Drive ->
CUInt ->
Ptr Gio.MountOperation.MountOperation ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
driveStart ::
(B.CallStack.HasCallStack, MonadIO m, IsDrive a, Gio.MountOperation.IsMountOperation b, Gio.Cancellable.IsCancellable c) =>
a
-> [Gio.Flags.DriveStartFlags]
-> Maybe (b)
-> Maybe (c)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
driveStart drive flags mountOperation cancellable callback = liftIO $ do
drive' <- unsafeManagedPtrCastPtr drive
let flags' = gflagsToWord flags
maybeMountOperation <- case mountOperation of
Nothing -> return nullPtr
Just jMountOperation -> do
jMountOperation' <- unsafeManagedPtrCastPtr jMountOperation
return jMountOperation'
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
maybeCallback <- case callback of
Nothing -> return (castPtrToFunPtr nullPtr)
Just jCallback -> do
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = nullPtr
g_drive_start drive' flags' maybeMountOperation maybeCancellable maybeCallback userData
touchManagedPtr drive
whenJust mountOperation touchManagedPtr
whenJust cancellable touchManagedPtr
return ()
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DriveStartMethodInfo
instance (signature ~ ([Gio.Flags.DriveStartFlags] -> Maybe (b) -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsDrive a, Gio.MountOperation.IsMountOperation b, Gio.Cancellable.IsCancellable c) => O.MethodInfo DriveStartMethodInfo a signature where
overloadedMethod _ = driveStart
#endif
foreign import ccall "g_drive_start_finish" g_drive_start_finish ::
Ptr Drive ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
driveStartFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsDrive a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
driveStartFinish drive result_ = liftIO $ do
drive' <- unsafeManagedPtrCastPtr drive
result_' <- unsafeManagedPtrCastPtr result_
onException (do
_ <- propagateGError $ g_drive_start_finish drive' result_'
touchManagedPtr drive
touchManagedPtr result_
return ()
) (do
return ()
)
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DriveStartFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsDrive a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo DriveStartFinishMethodInfo a signature where
overloadedMethod _ = driveStartFinish
#endif
foreign import ccall "g_drive_stop" g_drive_stop ::
Ptr Drive ->
CUInt ->
Ptr Gio.MountOperation.MountOperation ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
driveStop ::
(B.CallStack.HasCallStack, MonadIO m, IsDrive a, Gio.MountOperation.IsMountOperation b, Gio.Cancellable.IsCancellable c) =>
a
-> [Gio.Flags.MountUnmountFlags]
-> Maybe (b)
-> Maybe (c)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
driveStop drive flags mountOperation cancellable callback = liftIO $ do
drive' <- unsafeManagedPtrCastPtr drive
let flags' = gflagsToWord flags
maybeMountOperation <- case mountOperation of
Nothing -> return nullPtr
Just jMountOperation -> do
jMountOperation' <- unsafeManagedPtrCastPtr jMountOperation
return jMountOperation'
maybeCancellable <- case cancellable of
Nothing -> return nullPtr
Just jCancellable -> do
jCancellable' <- unsafeManagedPtrCastPtr jCancellable
return jCancellable'
ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
maybeCallback <- case callback of
Nothing -> return (castPtrToFunPtr nullPtr)
Just jCallback -> do
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = nullPtr
g_drive_stop drive' flags' maybeMountOperation maybeCancellable maybeCallback userData
touchManagedPtr drive
whenJust mountOperation touchManagedPtr
whenJust cancellable touchManagedPtr
return ()
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DriveStopMethodInfo
instance (signature ~ ([Gio.Flags.MountUnmountFlags] -> Maybe (b) -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsDrive a, Gio.MountOperation.IsMountOperation b, Gio.Cancellable.IsCancellable c) => O.MethodInfo DriveStopMethodInfo a signature where
overloadedMethod _ = driveStop
#endif
foreign import ccall "g_drive_stop_finish" g_drive_stop_finish ::
Ptr Drive ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
driveStopFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsDrive a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
driveStopFinish drive result_ = liftIO $ do
drive' <- unsafeManagedPtrCastPtr drive
result_' <- unsafeManagedPtrCastPtr result_
onException (do
_ <- propagateGError $ g_drive_stop_finish drive' result_'
touchManagedPtr drive
touchManagedPtr result_
return ()
) (do
return ()
)
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data DriveStopFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsDrive a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo DriveStopFinishMethodInfo a signature where
overloadedMethod _ = driveStopFinish
#endif