-- | Copyright : Will Thompson and Iñaki García Etxebarria -- License : LGPL-2.1 -- Maintainer : Iñaki García Etxebarria #if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__)) #define ENABLE_OVERLOADING #endif module GI.Gio.Functions ( -- * Methods -- ** busGet #method:busGet# busGet , -- ** busGetFinish #method:busGetFinish# busGetFinish , -- ** busGetSync #method:busGetSync# busGetSync , -- ** busOwnName #method:busOwnName# busOwnName , -- ** busOwnNameOnConnection #method:busOwnNameOnConnection# busOwnNameOnConnection , -- ** busUnownName #method:busUnownName# busUnownName , -- ** busUnwatchName #method:busUnwatchName# busUnwatchName , -- ** busWatchName #method:busWatchName# busWatchName , -- ** busWatchNameOnConnection #method:busWatchNameOnConnection# busWatchNameOnConnection , -- ** contentTypeCanBeExecutable #method:contentTypeCanBeExecutable# contentTypeCanBeExecutable , -- ** contentTypeEquals #method:contentTypeEquals# contentTypeEquals , -- ** contentTypeFromMimeType #method:contentTypeFromMimeType# contentTypeFromMimeType , -- ** contentTypeGetDescription #method:contentTypeGetDescription# contentTypeGetDescription , -- ** contentTypeGetGenericIconName #method:contentTypeGetGenericIconName# contentTypeGetGenericIconName , -- ** contentTypeGetIcon #method:contentTypeGetIcon# contentTypeGetIcon , -- ** contentTypeGetMimeDirs #method:contentTypeGetMimeDirs# contentTypeGetMimeDirs , -- ** contentTypeGetMimeType #method:contentTypeGetMimeType# contentTypeGetMimeType , -- ** contentTypeGetSymbolicIcon #method:contentTypeGetSymbolicIcon# contentTypeGetSymbolicIcon , -- ** contentTypeGuess #method:contentTypeGuess# contentTypeGuess , -- ** contentTypeGuessForTree #method:contentTypeGuessForTree# contentTypeGuessForTree , -- ** contentTypeIsA #method:contentTypeIsA# contentTypeIsA , -- ** contentTypeIsMimeType #method:contentTypeIsMimeType# contentTypeIsMimeType , -- ** contentTypeIsUnknown #method:contentTypeIsUnknown# contentTypeIsUnknown , -- ** contentTypeSetMimeDirs #method:contentTypeSetMimeDirs# contentTypeSetMimeDirs , -- ** contentTypesGetRegistered #method:contentTypesGetRegistered# contentTypesGetRegistered , -- ** dbusAddressEscapeValue #method:dbusAddressEscapeValue# dbusAddressEscapeValue , -- ** dbusAddressGetForBusSync #method:dbusAddressGetForBusSync# dbusAddressGetForBusSync , -- ** dbusAddressGetStream #method:dbusAddressGetStream# dbusAddressGetStream , -- ** dbusAddressGetStreamFinish #method:dbusAddressGetStreamFinish# dbusAddressGetStreamFinish , -- ** dbusAddressGetStreamSync #method:dbusAddressGetStreamSync# dbusAddressGetStreamSync , -- ** dbusEscapeObjectPath #method:dbusEscapeObjectPath# dbusEscapeObjectPath , -- ** dbusEscapeObjectPathBytestring #method:dbusEscapeObjectPathBytestring# dbusEscapeObjectPathBytestring , -- ** dbusGenerateGuid #method:dbusGenerateGuid# dbusGenerateGuid , -- ** dbusGvalueToGvariant #method:dbusGvalueToGvariant# dbusGvalueToGvariant , -- ** dbusGvariantToGvalue #method:dbusGvariantToGvalue# dbusGvariantToGvalue , -- ** dbusIsAddress #method:dbusIsAddress# dbusIsAddress , -- ** dbusIsErrorName #method:dbusIsErrorName# dbusIsErrorName , -- ** dbusIsGuid #method:dbusIsGuid# dbusIsGuid , -- ** dbusIsInterfaceName #method:dbusIsInterfaceName# dbusIsInterfaceName , -- ** dbusIsMemberName #method:dbusIsMemberName# dbusIsMemberName , -- ** dbusIsName #method:dbusIsName# dbusIsName , -- ** dbusIsSupportedAddress #method:dbusIsSupportedAddress# dbusIsSupportedAddress , -- ** dbusIsUniqueName #method:dbusIsUniqueName# dbusIsUniqueName , -- ** dbusUnescapeObjectPath #method:dbusUnescapeObjectPath# dbusUnescapeObjectPath , -- ** ioErrorFromErrno #method:ioErrorFromErrno# ioErrorFromErrno , -- ** ioErrorFromFileError #method:ioErrorFromFileError# ioErrorFromFileError , -- ** ioErrorQuark #method:ioErrorQuark# ioErrorQuark , -- ** ioModulesScanAllInDirectory #method:ioModulesScanAllInDirectory# ioModulesScanAllInDirectory , -- ** ioModulesScanAllInDirectoryWithScope #method:ioModulesScanAllInDirectoryWithScope# ioModulesScanAllInDirectoryWithScope , -- ** ioSchedulerCancelAllJobs #method:ioSchedulerCancelAllJobs# ioSchedulerCancelAllJobs , -- ** ioSchedulerPushJob #method:ioSchedulerPushJob# ioSchedulerPushJob , -- ** keyfileSettingsBackendNew #method:keyfileSettingsBackendNew# keyfileSettingsBackendNew , -- ** memorySettingsBackendNew #method:memorySettingsBackendNew# memorySettingsBackendNew , -- ** networkingInit #method:networkingInit# networkingInit , -- ** nullSettingsBackendNew #method:nullSettingsBackendNew# nullSettingsBackendNew , -- ** pollableSourceNew #method:pollableSourceNew# pollableSourceNew , -- ** pollableSourceNewFull #method:pollableSourceNewFull# pollableSourceNewFull , -- ** pollableStreamRead #method:pollableStreamRead# pollableStreamRead , -- ** pollableStreamWrite #method:pollableStreamWrite# pollableStreamWrite , -- ** pollableStreamWriteAll #method:pollableStreamWriteAll# pollableStreamWriteAll , -- ** resourcesEnumerateChildren #method:resourcesEnumerateChildren# resourcesEnumerateChildren , -- ** resourcesGetInfo #method:resourcesGetInfo# resourcesGetInfo , -- ** resourcesLookupData #method:resourcesLookupData# resourcesLookupData , -- ** resourcesOpenStream #method:resourcesOpenStream# resourcesOpenStream , -- ** resourcesRegister #method:resourcesRegister# resourcesRegister , -- ** resourcesUnregister #method:resourcesUnregister# resourcesUnregister , -- ** simpleAsyncReportGerrorInIdle #method:simpleAsyncReportGerrorInIdle# simpleAsyncReportGerrorInIdle , -- ** unixIsMountPathSystemInternal #method:unixIsMountPathSystemInternal# unixIsMountPathSystemInternal , -- ** unixIsSystemDevicePath #method:unixIsSystemDevicePath# unixIsSystemDevicePath , -- ** unixIsSystemFsType #method:unixIsSystemFsType# unixIsSystemFsType , -- ** unixMountAt #method:unixMountAt# unixMountAt , -- ** unixMountCompare #method:unixMountCompare# unixMountCompare , -- ** unixMountCopy #method:unixMountCopy# unixMountCopy , -- ** unixMountFor #method:unixMountFor# unixMountFor , -- ** unixMountFree #method:unixMountFree# unixMountFree , -- ** unixMountGetDevicePath #method:unixMountGetDevicePath# unixMountGetDevicePath , -- ** unixMountGetFsType #method:unixMountGetFsType# unixMountGetFsType , -- ** unixMountGetMountPath #method:unixMountGetMountPath# unixMountGetMountPath , -- ** unixMountGetOptions #method:unixMountGetOptions# unixMountGetOptions , -- ** unixMountGetRootPath #method:unixMountGetRootPath# unixMountGetRootPath , -- ** unixMountGuessCanEject #method:unixMountGuessCanEject# unixMountGuessCanEject , -- ** unixMountGuessIcon #method:unixMountGuessIcon# unixMountGuessIcon , -- ** unixMountGuessName #method:unixMountGuessName# unixMountGuessName , -- ** unixMountGuessShouldDisplay #method:unixMountGuessShouldDisplay# unixMountGuessShouldDisplay , -- ** unixMountGuessSymbolicIcon #method:unixMountGuessSymbolicIcon# unixMountGuessSymbolicIcon , -- ** unixMountIsReadonly #method:unixMountIsReadonly# unixMountIsReadonly , -- ** unixMountIsSystemInternal #method:unixMountIsSystemInternal# unixMountIsSystemInternal , -- ** unixMountPointsChangedSince #method:unixMountPointsChangedSince# unixMountPointsChangedSince , -- ** unixMountPointsGet #method:unixMountPointsGet# unixMountPointsGet , -- ** unixMountsChangedSince #method:unixMountsChangedSince# unixMountsChangedSince , -- ** unixMountsGet #method:unixMountsGet# unixMountsGet , ) where import Data.GI.Base.ShortPrelude import qualified Data.GI.Base.ShortPrelude as SP import qualified Data.GI.Base.Overloading as O import qualified Prelude as P import qualified Data.GI.Base.Attributes as GI.Attributes import qualified Data.GI.Base.BasicTypes as B.Types import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr import qualified Data.GI.Base.GArray as B.GArray import qualified Data.GI.Base.GClosure as B.GClosure import qualified Data.GI.Base.GError as B.GError import qualified Data.GI.Base.GHashTable as B.GHT import qualified Data.GI.Base.GVariant as B.GVariant import qualified Data.GI.Base.GValue as B.GValue import qualified Data.GI.Base.GParamSpec as B.GParamSpec import qualified Data.GI.Base.CallStack as B.CallStack import qualified Data.GI.Base.Properties as B.Properties import qualified Data.GI.Base.Signals as B.Signals import qualified Control.Monad.IO.Class as MIO import qualified Data.Coerce as Coerce import qualified Data.Text as T import qualified Data.Kind as DK import qualified Data.ByteString.Char8 as B import qualified Data.Map as Map import qualified Foreign.Ptr as FP import qualified GHC.OverloadedLabels as OL import qualified GHC.Records as R import qualified GI.GLib.Callbacks as GLib.Callbacks import qualified GI.GLib.Enums as GLib.Enums import qualified GI.GLib.Structs.Bytes as GLib.Bytes import qualified GI.GLib.Structs.Source as GLib.Source import qualified GI.GLib.Structs.VariantType as GLib.VariantType import qualified GI.GObject.Objects.Object as GObject.Object import qualified GI.Gio.Callbacks as Gio.Callbacks import {-# SOURCE #-} qualified GI.Gio.Enums as Gio.Enums import {-# SOURCE #-} qualified GI.Gio.Flags as Gio.Flags import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult 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.Objects.Cancellable as Gio.Cancellable import {-# SOURCE #-} qualified GI.Gio.Objects.DBusConnection as Gio.DBusConnection import {-# SOURCE #-} qualified GI.Gio.Objects.IOStream as Gio.IOStream import {-# SOURCE #-} qualified GI.Gio.Objects.InputStream as Gio.InputStream import {-# SOURCE #-} qualified GI.Gio.Objects.OutputStream as Gio.OutputStream import {-# SOURCE #-} qualified GI.Gio.Objects.SettingsBackend as Gio.SettingsBackend import {-# SOURCE #-} qualified GI.Gio.Structs.IOModuleScope as Gio.IOModuleScope import {-# SOURCE #-} qualified GI.Gio.Structs.Resource as Gio.Resource import {-# SOURCE #-} qualified GI.Gio.Structs.UnixMountEntry as Gio.UnixMountEntry import {-# SOURCE #-} qualified GI.Gio.Structs.UnixMountPoint as Gio.UnixMountPoint -- function unix_mounts_get -- Args: [ Arg -- { argCName = "time_read" -- , argType = TBasicType TUInt64 -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "guint64 to contain a timestamp, or %NULL" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just -- (TGList -- (TInterface Name { namespace = "Gio" , name = "UnixMountEntry" })) -- throws : False -- Skip return : False foreign import ccall "g_unix_mounts_get" g_unix_mounts_get :: Ptr Word64 -> -- time_read : TBasicType TUInt64 IO (Ptr (GList (Ptr Gio.UnixMountEntry.UnixMountEntry))) -- | Gets a t'GI.GLib.Structs.List.List' of t'GI.Gio.Structs.UnixMountEntry.UnixMountEntry' containing the unix mounts. -- If /@timeRead@/ is set, it will be filled with the mount -- timestamp, allowing for checking if the mounts have changed -- with 'GI.Gio.Functions.unixMountsChangedSince'. unixMountsGet :: (B.CallStack.HasCallStack, MonadIO m) => m (([Gio.UnixMountEntry.UnixMountEntry], Word64)) -- ^ __Returns:__ -- a t'GI.GLib.Structs.List.List' of the UNIX mounts. unixMountsGet :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m ([UnixMountEntry], Word64) unixMountsGet = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr Word64 timeRead <- forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr Word64) Ptr (GList (Ptr UnixMountEntry)) result <- Ptr Word64 -> IO (Ptr (GList (Ptr UnixMountEntry))) g_unix_mounts_get Ptr Word64 timeRead [Ptr UnixMountEntry] result' <- forall a. Ptr (GList (Ptr a)) -> IO [Ptr a] unpackGList Ptr (GList (Ptr UnixMountEntry)) result [UnixMountEntry] result'' <- forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM (forall a. (HasCallStack, GBoxed a) => (ManagedPtr a -> a) -> Ptr a -> IO a wrapBoxed ManagedPtr UnixMountEntry -> UnixMountEntry Gio.UnixMountEntry.UnixMountEntry) [Ptr UnixMountEntry] result' forall a. Ptr (GList a) -> IO () g_list_free Ptr (GList (Ptr UnixMountEntry)) result Word64 timeRead' <- forall a. Storable a => Ptr a -> IO a peek Ptr Word64 timeRead forall a. Ptr a -> IO () freeMem Ptr Word64 timeRead forall (m :: * -> *) a. Monad m => a -> m a return ([UnixMountEntry] result'', Word64 timeRead') -- function unix_mounts_changed_since -- Args: [ Arg -- { argCName = "time" -- , argType = TBasicType TUInt64 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "guint64 to contain a timestamp." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_unix_mounts_changed_since" g_unix_mounts_changed_since :: Word64 -> -- time : TBasicType TUInt64 IO CInt -- | Checks if the unix mounts have changed since a given unix time. unixMountsChangedSince :: (B.CallStack.HasCallStack, MonadIO m) => Word64 -- ^ /@time@/: guint64 to contain a timestamp. -> m Bool -- ^ __Returns:__ 'P.True' if the mounts have changed since /@time@/. unixMountsChangedSince :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Word64 -> m Bool unixMountsChangedSince Word64 time = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CInt result <- Word64 -> IO CInt g_unix_mounts_changed_since Word64 time let result' :: Bool result' = (forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function unix_mount_points_get -- Args: [ Arg -- { argCName = "time_read" -- , argType = TBasicType TUInt64 -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "guint64 to contain a timestamp." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just -- (TGList -- (TInterface Name { namespace = "Gio" , name = "UnixMountPoint" })) -- throws : False -- Skip return : False foreign import ccall "g_unix_mount_points_get" g_unix_mount_points_get :: Ptr Word64 -> -- time_read : TBasicType TUInt64 IO (Ptr (GList (Ptr Gio.UnixMountPoint.UnixMountPoint))) -- | Gets a t'GI.GLib.Structs.List.List' of t'GI.Gio.Structs.UnixMountPoint.UnixMountPoint' containing the unix mount points. -- If /@timeRead@/ is set, it will be filled with the mount timestamp, -- allowing for checking if the mounts have changed with -- 'GI.Gio.Functions.unixMountPointsChangedSince'. unixMountPointsGet :: (B.CallStack.HasCallStack, MonadIO m) => m (([Gio.UnixMountPoint.UnixMountPoint], Word64)) -- ^ __Returns:__ -- a t'GI.GLib.Structs.List.List' of the UNIX mountpoints. unixMountPointsGet :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m ([UnixMountPoint], Word64) unixMountPointsGet = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr Word64 timeRead <- forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr Word64) Ptr (GList (Ptr UnixMountPoint)) result <- Ptr Word64 -> IO (Ptr (GList (Ptr UnixMountPoint))) g_unix_mount_points_get Ptr Word64 timeRead [Ptr UnixMountPoint] result' <- forall a. Ptr (GList (Ptr a)) -> IO [Ptr a] unpackGList Ptr (GList (Ptr UnixMountPoint)) result [UnixMountPoint] result'' <- forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM (forall a. (HasCallStack, GBoxed a) => (ManagedPtr a -> a) -> Ptr a -> IO a wrapBoxed ManagedPtr UnixMountPoint -> UnixMountPoint Gio.UnixMountPoint.UnixMountPoint) [Ptr UnixMountPoint] result' forall a. Ptr (GList a) -> IO () g_list_free Ptr (GList (Ptr UnixMountPoint)) result Word64 timeRead' <- forall a. Storable a => Ptr a -> IO a peek Ptr Word64 timeRead forall a. Ptr a -> IO () freeMem Ptr Word64 timeRead forall (m :: * -> *) a. Monad m => a -> m a return ([UnixMountPoint] result'', Word64 timeRead') -- function unix_mount_points_changed_since -- Args: [ Arg -- { argCName = "time" -- , argType = TBasicType TUInt64 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "guint64 to contain a timestamp." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_unix_mount_points_changed_since" g_unix_mount_points_changed_since :: Word64 -> -- time : TBasicType TUInt64 IO CInt -- | Checks if the unix mount points have changed since a given unix time. unixMountPointsChangedSince :: (B.CallStack.HasCallStack, MonadIO m) => Word64 -- ^ /@time@/: guint64 to contain a timestamp. -> m Bool -- ^ __Returns:__ 'P.True' if the mount points have changed since /@time@/. unixMountPointsChangedSince :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Word64 -> m Bool unixMountPointsChangedSince Word64 time = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CInt result <- Word64 -> IO CInt g_unix_mount_points_changed_since Word64 time let result' :: Bool result' = (forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function unix_mount_is_system_internal -- Args: [ Arg -- { argCName = "mount_entry" -- , argType = -- TInterface Name { namespace = "Gio" , name = "UnixMountEntry" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GUnixMount." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_unix_mount_is_system_internal" g_unix_mount_is_system_internal :: Ptr Gio.UnixMountEntry.UnixMountEntry -> -- mount_entry : TInterface (Name {namespace = "Gio", name = "UnixMountEntry"}) IO CInt -- | Checks if a Unix mount is a system mount. This is the Boolean OR of -- 'GI.Gio.Functions.unixIsSystemFsType', 'GI.Gio.Functions.unixIsSystemDevicePath' and -- 'GI.Gio.Functions.unixIsMountPathSystemInternal' on /@mountEntry@/’s properties. -- -- The definition of what a ‘system’ mount entry is may change over time as new -- file system types and device paths are ignored. unixMountIsSystemInternal :: (B.CallStack.HasCallStack, MonadIO m) => Gio.UnixMountEntry.UnixMountEntry -- ^ /@mountEntry@/: a @/GUnixMount/@. -> m Bool -- ^ __Returns:__ 'P.True' if the unix mount is for a system path. unixMountIsSystemInternal :: forall (m :: * -> *). (HasCallStack, MonadIO m) => UnixMountEntry -> m Bool unixMountIsSystemInternal UnixMountEntry mountEntry = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr UnixMountEntry mountEntry' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr UnixMountEntry mountEntry CInt result <- Ptr UnixMountEntry -> IO CInt g_unix_mount_is_system_internal Ptr UnixMountEntry mountEntry' let result' :: Bool result' = (forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr UnixMountEntry mountEntry forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function unix_mount_is_readonly -- Args: [ Arg -- { argCName = "mount_entry" -- , argType = -- TInterface Name { namespace = "Gio" , name = "UnixMountEntry" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GUnixMount." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_unix_mount_is_readonly" g_unix_mount_is_readonly :: Ptr Gio.UnixMountEntry.UnixMountEntry -> -- mount_entry : TInterface (Name {namespace = "Gio", name = "UnixMountEntry"}) IO CInt -- | Checks if a unix mount is mounted read only. unixMountIsReadonly :: (B.CallStack.HasCallStack, MonadIO m) => Gio.UnixMountEntry.UnixMountEntry -- ^ /@mountEntry@/: a @/GUnixMount/@. -> m Bool -- ^ __Returns:__ 'P.True' if /@mountEntry@/ is read only. unixMountIsReadonly :: forall (m :: * -> *). (HasCallStack, MonadIO m) => UnixMountEntry -> m Bool unixMountIsReadonly UnixMountEntry mountEntry = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr UnixMountEntry mountEntry' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr UnixMountEntry mountEntry CInt result <- Ptr UnixMountEntry -> IO CInt g_unix_mount_is_readonly Ptr UnixMountEntry mountEntry' let result' :: Bool result' = (forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr UnixMountEntry mountEntry forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function unix_mount_guess_symbolic_icon -- Args: [ Arg -- { argCName = "mount_entry" -- , argType = -- TInterface Name { namespace = "Gio" , name = "UnixMountEntry" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GUnixMountEntry" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "Gio" , name = "Icon" }) -- throws : False -- Skip return : False foreign import ccall "g_unix_mount_guess_symbolic_icon" g_unix_mount_guess_symbolic_icon :: Ptr Gio.UnixMountEntry.UnixMountEntry -> -- mount_entry : TInterface (Name {namespace = "Gio", name = "UnixMountEntry"}) IO (Ptr Gio.Icon.Icon) -- | Guesses the symbolic icon of a Unix mount. -- -- /Since: 2.34/ unixMountGuessSymbolicIcon :: (B.CallStack.HasCallStack, MonadIO m) => Gio.UnixMountEntry.UnixMountEntry -- ^ /@mountEntry@/: a t'GI.Gio.Structs.UnixMountEntry.UnixMountEntry' -> m Gio.Icon.Icon -- ^ __Returns:__ a t'GI.Gio.Interfaces.Icon.Icon' unixMountGuessSymbolicIcon :: forall (m :: * -> *). (HasCallStack, MonadIO m) => UnixMountEntry -> m Icon unixMountGuessSymbolicIcon UnixMountEntry mountEntry = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr UnixMountEntry mountEntry' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr UnixMountEntry mountEntry Ptr Icon result <- Ptr UnixMountEntry -> IO (Ptr Icon) g_unix_mount_guess_symbolic_icon Ptr UnixMountEntry mountEntry' forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "unixMountGuessSymbolicIcon" Ptr Icon result Icon result' <- (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 forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr UnixMountEntry mountEntry forall (m :: * -> *) a. Monad m => a -> m a return Icon result' -- function unix_mount_guess_should_display -- Args: [ Arg -- { argCName = "mount_entry" -- , argType = -- TInterface Name { namespace = "Gio" , name = "UnixMountEntry" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GUnixMountEntry" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_unix_mount_guess_should_display" g_unix_mount_guess_should_display :: Ptr Gio.UnixMountEntry.UnixMountEntry -> -- mount_entry : TInterface (Name {namespace = "Gio", name = "UnixMountEntry"}) IO CInt -- | Guesses whether a Unix mount should be displayed in the UI. unixMountGuessShouldDisplay :: (B.CallStack.HasCallStack, MonadIO m) => Gio.UnixMountEntry.UnixMountEntry -- ^ /@mountEntry@/: a t'GI.Gio.Structs.UnixMountEntry.UnixMountEntry' -> m Bool -- ^ __Returns:__ 'P.True' if /@mountEntry@/ is deemed to be displayable. unixMountGuessShouldDisplay :: forall (m :: * -> *). (HasCallStack, MonadIO m) => UnixMountEntry -> m Bool unixMountGuessShouldDisplay UnixMountEntry mountEntry = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr UnixMountEntry mountEntry' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr UnixMountEntry mountEntry CInt result <- Ptr UnixMountEntry -> IO CInt g_unix_mount_guess_should_display Ptr UnixMountEntry mountEntry' let result' :: Bool result' = (forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr UnixMountEntry mountEntry forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function unix_mount_guess_name -- Args: [ Arg -- { argCName = "mount_entry" -- , argType = -- TInterface Name { namespace = "Gio" , name = "UnixMountEntry" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GUnixMountEntry" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "g_unix_mount_guess_name" g_unix_mount_guess_name :: Ptr Gio.UnixMountEntry.UnixMountEntry -> -- mount_entry : TInterface (Name {namespace = "Gio", name = "UnixMountEntry"}) IO CString -- | Guesses the name of a Unix mount. -- The result is a translated string. unixMountGuessName :: (B.CallStack.HasCallStack, MonadIO m) => Gio.UnixMountEntry.UnixMountEntry -- ^ /@mountEntry@/: a t'GI.Gio.Structs.UnixMountEntry.UnixMountEntry' -> m T.Text -- ^ __Returns:__ A newly allocated string that must -- be freed with 'GI.GLib.Functions.free' unixMountGuessName :: forall (m :: * -> *). (HasCallStack, MonadIO m) => UnixMountEntry -> m Text unixMountGuessName UnixMountEntry mountEntry = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr UnixMountEntry mountEntry' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr UnixMountEntry mountEntry CString result <- Ptr UnixMountEntry -> IO CString g_unix_mount_guess_name Ptr UnixMountEntry mountEntry' forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "unixMountGuessName" CString result Text result' <- HasCallStack => CString -> IO Text cstringToText CString result forall a. Ptr a -> IO () freeMem CString result forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr UnixMountEntry mountEntry forall (m :: * -> *) a. Monad m => a -> m a return Text result' -- function unix_mount_guess_icon -- Args: [ Arg -- { argCName = "mount_entry" -- , argType = -- TInterface Name { namespace = "Gio" , name = "UnixMountEntry" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GUnixMountEntry" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "Gio" , name = "Icon" }) -- throws : False -- Skip return : False foreign import ccall "g_unix_mount_guess_icon" g_unix_mount_guess_icon :: Ptr Gio.UnixMountEntry.UnixMountEntry -> -- mount_entry : TInterface (Name {namespace = "Gio", name = "UnixMountEntry"}) IO (Ptr Gio.Icon.Icon) -- | Guesses the icon of a Unix mount. unixMountGuessIcon :: (B.CallStack.HasCallStack, MonadIO m) => Gio.UnixMountEntry.UnixMountEntry -- ^ /@mountEntry@/: a t'GI.Gio.Structs.UnixMountEntry.UnixMountEntry' -> m Gio.Icon.Icon -- ^ __Returns:__ a t'GI.Gio.Interfaces.Icon.Icon' unixMountGuessIcon :: forall (m :: * -> *). (HasCallStack, MonadIO m) => UnixMountEntry -> m Icon unixMountGuessIcon UnixMountEntry mountEntry = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr UnixMountEntry mountEntry' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr UnixMountEntry mountEntry Ptr Icon result <- Ptr UnixMountEntry -> IO (Ptr Icon) g_unix_mount_guess_icon Ptr UnixMountEntry mountEntry' forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "unixMountGuessIcon" Ptr Icon result Icon result' <- (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 forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr UnixMountEntry mountEntry forall (m :: * -> *) a. Monad m => a -> m a return Icon result' -- function unix_mount_guess_can_eject -- Args: [ Arg -- { argCName = "mount_entry" -- , argType = -- TInterface Name { namespace = "Gio" , name = "UnixMountEntry" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GUnixMountEntry" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_unix_mount_guess_can_eject" g_unix_mount_guess_can_eject :: Ptr Gio.UnixMountEntry.UnixMountEntry -> -- mount_entry : TInterface (Name {namespace = "Gio", name = "UnixMountEntry"}) IO CInt -- | Guesses whether a Unix mount can be ejected. unixMountGuessCanEject :: (B.CallStack.HasCallStack, MonadIO m) => Gio.UnixMountEntry.UnixMountEntry -- ^ /@mountEntry@/: a t'GI.Gio.Structs.UnixMountEntry.UnixMountEntry' -> m Bool -- ^ __Returns:__ 'P.True' if /@mountEntry@/ is deemed to be ejectable. unixMountGuessCanEject :: forall (m :: * -> *). (HasCallStack, MonadIO m) => UnixMountEntry -> m Bool unixMountGuessCanEject UnixMountEntry mountEntry = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr UnixMountEntry mountEntry' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr UnixMountEntry mountEntry CInt result <- Ptr UnixMountEntry -> IO CInt g_unix_mount_guess_can_eject Ptr UnixMountEntry mountEntry' let result' :: Bool result' = (forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr UnixMountEntry mountEntry forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function unix_mount_get_root_path -- Args: [ Arg -- { argCName = "mount_entry" -- , argType = -- TInterface Name { namespace = "Gio" , name = "UnixMountEntry" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GUnixMountEntry." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "g_unix_mount_get_root_path" g_unix_mount_get_root_path :: Ptr Gio.UnixMountEntry.UnixMountEntry -> -- mount_entry : TInterface (Name {namespace = "Gio", name = "UnixMountEntry"}) IO CString -- | Gets the root of the mount within the filesystem. This is useful e.g. for -- mounts created by bind operation, or btrfs subvolumes. -- -- For example, the root path is equal to \"\/\" for mount created by -- \"mount \/dev\/sda1 \/mnt\/foo\" and \"\/bar\" for -- \"mount --bind \/mnt\/foo\/bar \/mnt\/bar\". -- -- /Since: 2.60/ unixMountGetRootPath :: (B.CallStack.HasCallStack, MonadIO m) => Gio.UnixMountEntry.UnixMountEntry -- ^ /@mountEntry@/: a t'GI.Gio.Structs.UnixMountEntry.UnixMountEntry'. -> m (Maybe T.Text) -- ^ __Returns:__ a string containing the root, or 'P.Nothing' if not supported. unixMountGetRootPath :: forall (m :: * -> *). (HasCallStack, MonadIO m) => UnixMountEntry -> m (Maybe Text) unixMountGetRootPath UnixMountEntry mountEntry = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr UnixMountEntry mountEntry' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr UnixMountEntry mountEntry CString result <- Ptr UnixMountEntry -> IO CString g_unix_mount_get_root_path Ptr UnixMountEntry mountEntry' Maybe Text maybeResult <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b) convertIfNonNull CString result forall a b. (a -> b) -> a -> b $ \CString result' -> do Text result'' <- HasCallStack => CString -> IO Text cstringToText CString result' forall (m :: * -> *) a. Monad m => a -> m a return Text result'' forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr UnixMountEntry mountEntry forall (m :: * -> *) a. Monad m => a -> m a return Maybe Text maybeResult -- function unix_mount_get_options -- Args: [ Arg -- { argCName = "mount_entry" -- , argType = -- TInterface Name { namespace = "Gio" , name = "UnixMountEntry" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GUnixMountEntry." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "g_unix_mount_get_options" g_unix_mount_get_options :: Ptr Gio.UnixMountEntry.UnixMountEntry -> -- mount_entry : TInterface (Name {namespace = "Gio", name = "UnixMountEntry"}) IO CString -- | Gets a comma-separated list of mount options for the unix mount. For example, -- @rw,relatime,seclabel,data=ordered@. -- -- This is similar to 'GI.Gio.Structs.UnixMountPoint.unixMountPointGetOptions', but it takes -- a t'GI.Gio.Structs.UnixMountEntry.UnixMountEntry' as an argument. -- -- /Since: 2.58/ unixMountGetOptions :: (B.CallStack.HasCallStack, MonadIO m) => Gio.UnixMountEntry.UnixMountEntry -- ^ /@mountEntry@/: a t'GI.Gio.Structs.UnixMountEntry.UnixMountEntry'. -> m (Maybe T.Text) -- ^ __Returns:__ a string containing the options, or 'P.Nothing' if not -- available. unixMountGetOptions :: forall (m :: * -> *). (HasCallStack, MonadIO m) => UnixMountEntry -> m (Maybe Text) unixMountGetOptions UnixMountEntry mountEntry = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr UnixMountEntry mountEntry' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr UnixMountEntry mountEntry CString result <- Ptr UnixMountEntry -> IO CString g_unix_mount_get_options Ptr UnixMountEntry mountEntry' Maybe Text maybeResult <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b) convertIfNonNull CString result forall a b. (a -> b) -> a -> b $ \CString result' -> do Text result'' <- HasCallStack => CString -> IO Text cstringToText CString result' forall (m :: * -> *) a. Monad m => a -> m a return Text result'' forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr UnixMountEntry mountEntry forall (m :: * -> *) a. Monad m => a -> m a return Maybe Text maybeResult -- function unix_mount_get_mount_path -- Args: [ Arg -- { argCName = "mount_entry" -- , argType = -- TInterface Name { namespace = "Gio" , name = "UnixMountEntry" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "input #GUnixMountEntry to get the mount path for." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TFileName) -- throws : False -- Skip return : False foreign import ccall "g_unix_mount_get_mount_path" g_unix_mount_get_mount_path :: Ptr Gio.UnixMountEntry.UnixMountEntry -> -- mount_entry : TInterface (Name {namespace = "Gio", name = "UnixMountEntry"}) IO CString -- | Gets the mount path for a unix mount. unixMountGetMountPath :: (B.CallStack.HasCallStack, MonadIO m) => Gio.UnixMountEntry.UnixMountEntry -- ^ /@mountEntry@/: input t'GI.Gio.Structs.UnixMountEntry.UnixMountEntry' to get the mount path for. -> m [Char] -- ^ __Returns:__ the mount path for /@mountEntry@/. unixMountGetMountPath :: forall (m :: * -> *). (HasCallStack, MonadIO m) => UnixMountEntry -> m [Char] unixMountGetMountPath UnixMountEntry mountEntry = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr UnixMountEntry mountEntry' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr UnixMountEntry mountEntry CString result <- Ptr UnixMountEntry -> IO CString g_unix_mount_get_mount_path Ptr UnixMountEntry mountEntry' forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "unixMountGetMountPath" CString result [Char] result' <- HasCallStack => CString -> IO [Char] cstringToString CString result forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr UnixMountEntry mountEntry forall (m :: * -> *) a. Monad m => a -> m a return [Char] result' -- function unix_mount_get_fs_type -- Args: [ Arg -- { argCName = "mount_entry" -- , argType = -- TInterface Name { namespace = "Gio" , name = "UnixMountEntry" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GUnixMount." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "g_unix_mount_get_fs_type" g_unix_mount_get_fs_type :: Ptr Gio.UnixMountEntry.UnixMountEntry -> -- mount_entry : TInterface (Name {namespace = "Gio", name = "UnixMountEntry"}) IO CString -- | Gets the filesystem type for the unix mount. unixMountGetFsType :: (B.CallStack.HasCallStack, MonadIO m) => Gio.UnixMountEntry.UnixMountEntry -- ^ /@mountEntry@/: a @/GUnixMount/@. -> m T.Text -- ^ __Returns:__ a string containing the file system type. unixMountGetFsType :: forall (m :: * -> *). (HasCallStack, MonadIO m) => UnixMountEntry -> m Text unixMountGetFsType UnixMountEntry mountEntry = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr UnixMountEntry mountEntry' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr UnixMountEntry mountEntry CString result <- Ptr UnixMountEntry -> IO CString g_unix_mount_get_fs_type Ptr UnixMountEntry mountEntry' forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "unixMountGetFsType" CString result Text result' <- HasCallStack => CString -> IO Text cstringToText CString result forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr UnixMountEntry mountEntry forall (m :: * -> *) a. Monad m => a -> m a return Text result' -- function unix_mount_get_device_path -- Args: [ Arg -- { argCName = "mount_entry" -- , argType = -- TInterface Name { namespace = "Gio" , name = "UnixMountEntry" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GUnixMount." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TFileName) -- throws : False -- Skip return : False foreign import ccall "g_unix_mount_get_device_path" g_unix_mount_get_device_path :: Ptr Gio.UnixMountEntry.UnixMountEntry -> -- mount_entry : TInterface (Name {namespace = "Gio", name = "UnixMountEntry"}) IO CString -- | Gets the device path for a unix mount. unixMountGetDevicePath :: (B.CallStack.HasCallStack, MonadIO m) => Gio.UnixMountEntry.UnixMountEntry -- ^ /@mountEntry@/: a @/GUnixMount/@. -> m [Char] -- ^ __Returns:__ a string containing the device path. unixMountGetDevicePath :: forall (m :: * -> *). (HasCallStack, MonadIO m) => UnixMountEntry -> m [Char] unixMountGetDevicePath UnixMountEntry mountEntry = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr UnixMountEntry mountEntry' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr UnixMountEntry mountEntry CString result <- Ptr UnixMountEntry -> IO CString g_unix_mount_get_device_path Ptr UnixMountEntry mountEntry' forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "unixMountGetDevicePath" CString result [Char] result' <- HasCallStack => CString -> IO [Char] cstringToString CString result forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr UnixMountEntry mountEntry forall (m :: * -> *) a. Monad m => a -> m a return [Char] result' -- function unix_mount_free -- Args: [ Arg -- { argCName = "mount_entry" -- , argType = -- TInterface Name { namespace = "Gio" , name = "UnixMountEntry" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GUnixMountEntry." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_unix_mount_free" g_unix_mount_free :: Ptr Gio.UnixMountEntry.UnixMountEntry -> -- mount_entry : TInterface (Name {namespace = "Gio", name = "UnixMountEntry"}) IO () -- | Frees a unix mount. unixMountFree :: (B.CallStack.HasCallStack, MonadIO m) => Gio.UnixMountEntry.UnixMountEntry -- ^ /@mountEntry@/: a t'GI.Gio.Structs.UnixMountEntry.UnixMountEntry'. -> m () unixMountFree :: forall (m :: * -> *). (HasCallStack, MonadIO m) => UnixMountEntry -> m () unixMountFree UnixMountEntry mountEntry = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr UnixMountEntry mountEntry' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr UnixMountEntry mountEntry Ptr UnixMountEntry -> IO () g_unix_mount_free Ptr UnixMountEntry mountEntry' forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr UnixMountEntry mountEntry forall (m :: * -> *) a. Monad m => a -> m a return () -- function unix_mount_for -- Args: [ Arg -- { argCName = "file_path" -- , argType = TBasicType TFileName -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "file path on some unix mount." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "time_read" -- , argType = TBasicType TUInt64 -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "guint64 to contain a timestamp." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface Name { namespace = "Gio" , name = "UnixMountEntry" }) -- throws : False -- Skip return : False foreign import ccall "g_unix_mount_for" g_unix_mount_for :: CString -> -- file_path : TBasicType TFileName Ptr Word64 -> -- time_read : TBasicType TUInt64 IO (Ptr Gio.UnixMountEntry.UnixMountEntry) -- | Gets a t'GI.Gio.Structs.UnixMountEntry.UnixMountEntry' for a given file path. If /@timeRead@/ -- is set, it will be filled with a unix timestamp for checking -- if the mounts have changed since with 'GI.Gio.Functions.unixMountsChangedSince'. -- -- If more mounts have the same mount path, the last matching mount -- is returned. -- -- This will return 'P.Nothing' if looking up the mount entry fails, if -- /@filePath@/ doesn’t exist or there is an I\/O error. -- -- /Since: 2.52/ unixMountFor :: (B.CallStack.HasCallStack, MonadIO m) => [Char] -- ^ /@filePath@/: file path on some unix mount. -> m ((Maybe Gio.UnixMountEntry.UnixMountEntry, Word64)) -- ^ __Returns:__ a t'GI.Gio.Structs.UnixMountEntry.UnixMountEntry'. unixMountFor :: forall (m :: * -> *). (HasCallStack, MonadIO m) => [Char] -> m (Maybe UnixMountEntry, Word64) unixMountFor [Char] filePath = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString filePath' <- [Char] -> IO CString stringToCString [Char] filePath Ptr Word64 timeRead <- forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr Word64) Ptr UnixMountEntry result <- CString -> Ptr Word64 -> IO (Ptr UnixMountEntry) g_unix_mount_for CString filePath' Ptr Word64 timeRead Maybe UnixMountEntry maybeResult <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b) convertIfNonNull Ptr UnixMountEntry result forall a b. (a -> b) -> a -> b $ \Ptr UnixMountEntry result' -> do UnixMountEntry result'' <- (forall a. (HasCallStack, GBoxed a) => (ManagedPtr a -> a) -> Ptr a -> IO a wrapBoxed ManagedPtr UnixMountEntry -> UnixMountEntry Gio.UnixMountEntry.UnixMountEntry) Ptr UnixMountEntry result' forall (m :: * -> *) a. Monad m => a -> m a return UnixMountEntry result'' Word64 timeRead' <- forall a. Storable a => Ptr a -> IO a peek Ptr Word64 timeRead forall a. Ptr a -> IO () freeMem CString filePath' forall a. Ptr a -> IO () freeMem Ptr Word64 timeRead forall (m :: * -> *) a. Monad m => a -> m a return (Maybe UnixMountEntry maybeResult, Word64 timeRead') -- function unix_mount_copy -- Args: [ Arg -- { argCName = "mount_entry" -- , argType = -- TInterface Name { namespace = "Gio" , name = "UnixMountEntry" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GUnixMountEntry." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface Name { namespace = "Gio" , name = "UnixMountEntry" }) -- throws : False -- Skip return : False foreign import ccall "g_unix_mount_copy" g_unix_mount_copy :: Ptr Gio.UnixMountEntry.UnixMountEntry -> -- mount_entry : TInterface (Name {namespace = "Gio", name = "UnixMountEntry"}) IO (Ptr Gio.UnixMountEntry.UnixMountEntry) -- | Makes a copy of /@mountEntry@/. -- -- /Since: 2.54/ unixMountCopy :: (B.CallStack.HasCallStack, MonadIO m) => Gio.UnixMountEntry.UnixMountEntry -- ^ /@mountEntry@/: a t'GI.Gio.Structs.UnixMountEntry.UnixMountEntry'. -> m Gio.UnixMountEntry.UnixMountEntry -- ^ __Returns:__ a new t'GI.Gio.Structs.UnixMountEntry.UnixMountEntry' unixMountCopy :: forall (m :: * -> *). (HasCallStack, MonadIO m) => UnixMountEntry -> m UnixMountEntry unixMountCopy UnixMountEntry mountEntry = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr UnixMountEntry mountEntry' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr UnixMountEntry mountEntry Ptr UnixMountEntry result <- Ptr UnixMountEntry -> IO (Ptr UnixMountEntry) g_unix_mount_copy Ptr UnixMountEntry mountEntry' forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "unixMountCopy" Ptr UnixMountEntry result UnixMountEntry result' <- (forall a. (HasCallStack, GBoxed a) => (ManagedPtr a -> a) -> Ptr a -> IO a wrapBoxed ManagedPtr UnixMountEntry -> UnixMountEntry Gio.UnixMountEntry.UnixMountEntry) Ptr UnixMountEntry result forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr UnixMountEntry mountEntry forall (m :: * -> *) a. Monad m => a -> m a return UnixMountEntry result' -- function unix_mount_compare -- Args: [ Arg -- { argCName = "mount1" -- , argType = -- TInterface Name { namespace = "Gio" , name = "UnixMountEntry" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "first #GUnixMountEntry to compare." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "mount2" -- , argType = -- TInterface Name { namespace = "Gio" , name = "UnixMountEntry" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "second #GUnixMountEntry to compare." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TInt) -- throws : False -- Skip return : False foreign import ccall "g_unix_mount_compare" g_unix_mount_compare :: Ptr Gio.UnixMountEntry.UnixMountEntry -> -- mount1 : TInterface (Name {namespace = "Gio", name = "UnixMountEntry"}) Ptr Gio.UnixMountEntry.UnixMountEntry -> -- mount2 : TInterface (Name {namespace = "Gio", name = "UnixMountEntry"}) IO Int32 -- | Compares two unix mounts. unixMountCompare :: (B.CallStack.HasCallStack, MonadIO m) => Gio.UnixMountEntry.UnixMountEntry -- ^ /@mount1@/: first t'GI.Gio.Structs.UnixMountEntry.UnixMountEntry' to compare. -> Gio.UnixMountEntry.UnixMountEntry -- ^ /@mount2@/: second t'GI.Gio.Structs.UnixMountEntry.UnixMountEntry' to compare. -> m Int32 -- ^ __Returns:__ 1, 0 or -1 if /@mount1@/ is greater than, equal to, -- or less than /@mount2@/, respectively. unixMountCompare :: forall (m :: * -> *). (HasCallStack, MonadIO m) => UnixMountEntry -> UnixMountEntry -> m Int32 unixMountCompare UnixMountEntry mount1 UnixMountEntry mount2 = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr UnixMountEntry mount1' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr UnixMountEntry mount1 Ptr UnixMountEntry mount2' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr UnixMountEntry mount2 Int32 result <- Ptr UnixMountEntry -> Ptr UnixMountEntry -> IO Int32 g_unix_mount_compare Ptr UnixMountEntry mount1' Ptr UnixMountEntry mount2' forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr UnixMountEntry mount1 forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr UnixMountEntry mount2 forall (m :: * -> *) a. Monad m => a -> m a return Int32 result -- function unix_mount_at -- Args: [ Arg -- { argCName = "mount_path" -- , argType = TBasicType TFileName -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "path for a possible unix mount." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "time_read" -- , argType = TBasicType TUInt64 -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "guint64 to contain a timestamp." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface Name { namespace = "Gio" , name = "UnixMountEntry" }) -- throws : False -- Skip return : False foreign import ccall "g_unix_mount_at" g_unix_mount_at :: CString -> -- mount_path : TBasicType TFileName Ptr Word64 -> -- time_read : TBasicType TUInt64 IO (Ptr Gio.UnixMountEntry.UnixMountEntry) -- | Gets a t'GI.Gio.Structs.UnixMountEntry.UnixMountEntry' for a given mount path. If /@timeRead@/ -- is set, it will be filled with a unix timestamp for checking -- if the mounts have changed since with 'GI.Gio.Functions.unixMountsChangedSince'. -- -- If more mounts have the same mount path, the last matching mount -- is returned. -- -- This will return 'P.Nothing' if there is no mount point at /@mountPath@/. unixMountAt :: (B.CallStack.HasCallStack, MonadIO m) => [Char] -- ^ /@mountPath@/: path for a possible unix mount. -> m ((Maybe Gio.UnixMountEntry.UnixMountEntry, Word64)) -- ^ __Returns:__ a t'GI.Gio.Structs.UnixMountEntry.UnixMountEntry'. unixMountAt :: forall (m :: * -> *). (HasCallStack, MonadIO m) => [Char] -> m (Maybe UnixMountEntry, Word64) unixMountAt [Char] mountPath = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString mountPath' <- [Char] -> IO CString stringToCString [Char] mountPath Ptr Word64 timeRead <- forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr Word64) Ptr UnixMountEntry result <- CString -> Ptr Word64 -> IO (Ptr UnixMountEntry) g_unix_mount_at CString mountPath' Ptr Word64 timeRead Maybe UnixMountEntry maybeResult <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b) convertIfNonNull Ptr UnixMountEntry result forall a b. (a -> b) -> a -> b $ \Ptr UnixMountEntry result' -> do UnixMountEntry result'' <- (forall a. (HasCallStack, GBoxed a) => (ManagedPtr a -> a) -> Ptr a -> IO a wrapBoxed ManagedPtr UnixMountEntry -> UnixMountEntry Gio.UnixMountEntry.UnixMountEntry) Ptr UnixMountEntry result' forall (m :: * -> *) a. Monad m => a -> m a return UnixMountEntry result'' Word64 timeRead' <- forall a. Storable a => Ptr a -> IO a peek Ptr Word64 timeRead forall a. Ptr a -> IO () freeMem CString mountPath' forall a. Ptr a -> IO () freeMem Ptr Word64 timeRead forall (m :: * -> *) a. Monad m => a -> m a return (Maybe UnixMountEntry maybeResult, Word64 timeRead') -- function unix_is_system_fs_type -- Args: [ Arg -- { argCName = "fs_type" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a file system type, e.g. `procfs` or `tmpfs`" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_unix_is_system_fs_type" g_unix_is_system_fs_type :: CString -> -- fs_type : TBasicType TUTF8 IO CInt -- | Determines if /@fsType@/ is considered a type of file system which is only -- used in implementation of the OS. This is primarily used for hiding -- mounted volumes that are intended as APIs for programs to read, and system -- administrators at a shell; rather than something that should, for example, -- appear in a GUI. For example, the Linux @\/proc@ filesystem. -- -- The list of file system types considered ‘system’ ones may change over time. -- -- /Since: 2.56/ unixIsSystemFsType :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@fsType@/: a file system type, e.g. @procfs@ or @tmpfs@ -> m Bool -- ^ __Returns:__ 'P.True' if /@fsType@/ is considered an implementation detail of the OS. unixIsSystemFsType :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m Bool unixIsSystemFsType Text fsType = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString fsType' <- Text -> IO CString textToCString Text fsType CInt result <- CString -> IO CInt g_unix_is_system_fs_type CString fsType' let result' :: Bool result' = (forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result forall a. Ptr a -> IO () freeMem CString fsType' forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function unix_is_system_device_path -- Args: [ Arg -- { argCName = "device_path" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a device path, e.g. `/dev/loop0` or `nfsd`" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_unix_is_system_device_path" g_unix_is_system_device_path :: CString -> -- device_path : TBasicType TUTF8 IO CInt -- | Determines if /@devicePath@/ is considered a block device path which is only -- used in implementation of the OS. This is primarily used for hiding -- mounted volumes that are intended as APIs for programs to read, and system -- administrators at a shell; rather than something that should, for example, -- appear in a GUI. For example, the Linux @\/proc@ filesystem. -- -- The list of device paths considered ‘system’ ones may change over time. -- -- /Since: 2.56/ unixIsSystemDevicePath :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@devicePath@/: a device path, e.g. @\/dev\/loop0@ or @nfsd@ -> m Bool -- ^ __Returns:__ 'P.True' if /@devicePath@/ is considered an implementation detail of -- the OS. unixIsSystemDevicePath :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m Bool unixIsSystemDevicePath Text devicePath = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString devicePath' <- Text -> IO CString textToCString Text devicePath CInt result <- CString -> IO CInt g_unix_is_system_device_path CString devicePath' let result' :: Bool result' = (forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result forall a. Ptr a -> IO () freeMem CString devicePath' forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function unix_is_mount_path_system_internal -- Args: [ Arg -- { argCName = "mount_path" -- , argType = TBasicType TFileName -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a mount path, e.g. `/media/disk` or `/usr`" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_unix_is_mount_path_system_internal" g_unix_is_mount_path_system_internal :: CString -> -- mount_path : TBasicType TFileName IO CInt -- | Determines if /@mountPath@/ is considered an implementation of the -- OS. This is primarily used for hiding mountable and mounted volumes -- that only are used in the OS and has little to no relevance to the -- casual user. unixIsMountPathSystemInternal :: (B.CallStack.HasCallStack, MonadIO m) => [Char] -- ^ /@mountPath@/: a mount path, e.g. @\/media\/disk@ or @\/usr@ -> m Bool -- ^ __Returns:__ 'P.True' if /@mountPath@/ is considered an implementation detail -- of the OS. unixIsMountPathSystemInternal :: forall (m :: * -> *). (HasCallStack, MonadIO m) => [Char] -> m Bool unixIsMountPathSystemInternal [Char] mountPath = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString mountPath' <- [Char] -> IO CString stringToCString [Char] mountPath CInt result <- CString -> IO CInt g_unix_is_mount_path_system_internal CString mountPath' let result' :: Bool result' = (forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result forall a. Ptr a -> IO () freeMem CString mountPath' forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function simple_async_report_gerror_in_idle -- Args: [ Arg -- { argCName = "object" -- , argType = -- TInterface Name { namespace = "GObject" , name = "Object" } -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "a #GObject, or %NULL" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "callback" -- , argType = -- TInterface Name { namespace = "Gio" , name = "AsyncReadyCallback" } -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "a #GAsyncReadyCallback." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeAsync -- , argClosure = 2 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "user_data" -- , argType = TBasicType TPtr -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "user data passed to @callback." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "error" -- , argType = TError -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the #GError to report" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_simple_async_report_gerror_in_idle" g_simple_async_report_gerror_in_idle :: Ptr GObject.Object.Object -> -- object : TInterface (Name {namespace = "GObject", name = "Object"}) FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}) Ptr () -> -- user_data : TBasicType TPtr Ptr GError -> -- error : TError IO () {-# DEPRECATED simpleAsyncReportGerrorInIdle ["(Since version 2.46)","Use 'GI.Gio.Objects.Task.taskReportError'."] #-} -- | Reports an error in an idle function. Similar to -- @/g_simple_async_report_error_in_idle()/@, but takes a t'GError' rather -- than building a new one. simpleAsyncReportGerrorInIdle :: (B.CallStack.HasCallStack, MonadIO m, GObject.Object.IsObject a) => Maybe (a) -- ^ /@object@/: a t'GI.GObject.Objects.Object.Object', or 'P.Nothing' -> Maybe (Gio.Callbacks.AsyncReadyCallback) -- ^ /@callback@/: a t'GI.Gio.Callbacks.AsyncReadyCallback'. -> GError -- ^ /@error@/: the t'GError' to report -> m () simpleAsyncReportGerrorInIdle :: forall (m :: * -> *) a. (HasCallStack, MonadIO m, IsObject a) => Maybe a -> Maybe AsyncReadyCallback -> GError -> m () simpleAsyncReportGerrorInIdle Maybe a object Maybe AsyncReadyCallback callback GError error_ = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr Object maybeObject <- case Maybe a object of Maybe a Nothing -> forall (m :: * -> *) a. Monad m => a -> m a return forall a. Ptr a nullPtr Just a jObject -> do Ptr Object jObject' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a jObject forall (m :: * -> *) a. Monad m => a -> m a return Ptr Object jObject' FunPtr C_AsyncReadyCallback maybeCallback <- case Maybe AsyncReadyCallback callback of Maybe AsyncReadyCallback Nothing -> forall (m :: * -> *) a. Monad m => a -> m a return (forall a b. Ptr a -> FunPtr b castPtrToFunPtr forall a. Ptr a nullPtr) Just AsyncReadyCallback jCallback -> do Ptr (FunPtr C_AsyncReadyCallback) ptrcallback <- 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 -> C_AsyncReadyCallback Gio.Callbacks.wrap_AsyncReadyCallback (forall a. a -> Maybe a Just Ptr (FunPtr C_AsyncReadyCallback) ptrcallback) AsyncReadyCallback jCallback) forall a. Storable a => Ptr a -> a -> IO () poke Ptr (FunPtr C_AsyncReadyCallback) ptrcallback FunPtr C_AsyncReadyCallback jCallback' forall (m :: * -> *) a. Monad m => a -> m a return FunPtr C_AsyncReadyCallback jCallback' Ptr GError error_' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr GError error_ let userData :: Ptr a userData = forall a. Ptr a nullPtr Ptr Object -> FunPtr C_AsyncReadyCallback -> Ptr () -> Ptr GError -> IO () g_simple_async_report_gerror_in_idle Ptr Object maybeObject FunPtr C_AsyncReadyCallback maybeCallback forall a. Ptr a userData Ptr GError error_' forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe a object forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr GError error_ forall (m :: * -> *) a. Monad m => a -> m a return () -- function resources_unregister -- Args: [ Arg -- { argCName = "resource" -- , argType = -- TInterface Name { namespace = "Gio" , name = "Resource" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A #GResource" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_resources_unregister" g_resources_unregister :: Ptr Gio.Resource.Resource -> -- resource : TInterface (Name {namespace = "Gio", name = "Resource"}) IO () -- | Unregisters the resource from the process-global set of resources. -- -- /Since: 2.32/ resourcesUnregister :: (B.CallStack.HasCallStack, MonadIO m) => Gio.Resource.Resource -- ^ /@resource@/: A t'GI.Gio.Structs.Resource.Resource' -> m () resourcesUnregister :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Resource -> m () resourcesUnregister Resource resource = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr Resource resource' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Resource resource Ptr Resource -> IO () g_resources_unregister Ptr Resource resource' forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Resource resource forall (m :: * -> *) a. Monad m => a -> m a return () -- function resources_register -- Args: [ Arg -- { argCName = "resource" -- , argType = -- TInterface Name { namespace = "Gio" , name = "Resource" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A #GResource" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_resources_register" g_resources_register :: Ptr Gio.Resource.Resource -> -- resource : TInterface (Name {namespace = "Gio", name = "Resource"}) IO () -- | Registers the resource with the process-global set of resources. -- Once a resource is registered the files in it can be accessed -- with the global resource lookup functions like 'GI.Gio.Functions.resourcesLookupData'. -- -- /Since: 2.32/ resourcesRegister :: (B.CallStack.HasCallStack, MonadIO m) => Gio.Resource.Resource -- ^ /@resource@/: A t'GI.Gio.Structs.Resource.Resource' -> m () resourcesRegister :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Resource -> m () resourcesRegister Resource resource = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr Resource resource' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Resource resource Ptr Resource -> IO () g_resources_register Ptr Resource resource' forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr Resource resource forall (m :: * -> *) a. Monad m => a -> m a return () -- function resources_open_stream -- Args: [ Arg -- { argCName = "path" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A pathname inside the resource" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "lookup_flags" -- , argType = -- TInterface -- Name { namespace = "Gio" , name = "ResourceLookupFlags" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A #GResourceLookupFlags" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "Gio" , name = "InputStream" }) -- throws : True -- Skip return : False foreign import ccall "g_resources_open_stream" g_resources_open_stream :: CString -> -- path : TBasicType TUTF8 CUInt -> -- lookup_flags : TInterface (Name {namespace = "Gio", name = "ResourceLookupFlags"}) Ptr (Ptr GError) -> -- error IO (Ptr Gio.InputStream.InputStream) -- | Looks for a file at the specified /@path@/ in the set of -- globally registered resources and returns a t'GI.Gio.Objects.InputStream.InputStream' -- that lets you read the data. -- -- /@lookupFlags@/ controls the behaviour of the lookup. -- -- /Since: 2.32/ resourcesOpenStream :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@path@/: A pathname inside the resource -> [Gio.Flags.ResourceLookupFlags] -- ^ /@lookupFlags@/: A t'GI.Gio.Flags.ResourceLookupFlags' -> m Gio.InputStream.InputStream -- ^ __Returns:__ t'GI.Gio.Objects.InputStream.InputStream' or 'P.Nothing' on error. -- Free the returned object with 'GI.GObject.Objects.Object.objectUnref' /(Can throw 'Data.GI.Base.GError.GError')/ resourcesOpenStream :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> [ResourceLookupFlags] -> m InputStream resourcesOpenStream Text path [ResourceLookupFlags] lookupFlags = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString path' <- Text -> IO CString textToCString Text path let lookupFlags' :: CUInt lookupFlags' = forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [ResourceLookupFlags] lookupFlags forall a b. IO a -> IO b -> IO a onException (do Ptr InputStream result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a propagateGError forall a b. (a -> b) -> a -> b $ CString -> CUInt -> Ptr (Ptr GError) -> IO (Ptr InputStream) g_resources_open_stream CString path' CUInt lookupFlags' forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "resourcesOpenStream" Ptr InputStream result InputStream result' <- (forall a b. (HasCallStack, GObject a, GObject b) => (ManagedPtr a -> a) -> Ptr b -> IO a wrapObject ManagedPtr InputStream -> InputStream Gio.InputStream.InputStream) Ptr InputStream result forall a. Ptr a -> IO () freeMem CString path' forall (m :: * -> *) a. Monad m => a -> m a return InputStream result' ) (do forall a. Ptr a -> IO () freeMem CString path' ) -- function resources_lookup_data -- Args: [ Arg -- { argCName = "path" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A pathname inside the resource" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "lookup_flags" -- , argType = -- TInterface -- Name { namespace = "Gio" , name = "ResourceLookupFlags" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A #GResourceLookupFlags" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "GLib" , name = "Bytes" }) -- throws : True -- Skip return : False foreign import ccall "g_resources_lookup_data" g_resources_lookup_data :: CString -> -- path : TBasicType TUTF8 CUInt -> -- lookup_flags : TInterface (Name {namespace = "Gio", name = "ResourceLookupFlags"}) Ptr (Ptr GError) -> -- error IO (Ptr GLib.Bytes.Bytes) -- | Looks for a file at the specified /@path@/ in the set of -- globally registered resources and returns a t'GI.GLib.Structs.Bytes.Bytes' that -- lets you directly access the data in memory. -- -- The data is always followed by a zero byte, so you -- can safely use the data as a C string. However, that byte -- is not included in the size of the GBytes. -- -- For uncompressed resource files this is a pointer directly into -- the resource bundle, which is typically in some readonly data section -- in the program binary. For compressed files we allocate memory on -- the heap and automatically uncompress the data. -- -- /@lookupFlags@/ controls the behaviour of the lookup. -- -- /Since: 2.32/ resourcesLookupData :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@path@/: A pathname inside the resource -> [Gio.Flags.ResourceLookupFlags] -- ^ /@lookupFlags@/: A t'GI.Gio.Flags.ResourceLookupFlags' -> m GLib.Bytes.Bytes -- ^ __Returns:__ t'GI.GLib.Structs.Bytes.Bytes' or 'P.Nothing' on error. -- Free the returned object with 'GI.GLib.Structs.Bytes.bytesUnref' /(Can throw 'Data.GI.Base.GError.GError')/ resourcesLookupData :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> [ResourceLookupFlags] -> m Bytes resourcesLookupData Text path [ResourceLookupFlags] lookupFlags = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString path' <- Text -> IO CString textToCString Text path let lookupFlags' :: CUInt lookupFlags' = forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [ResourceLookupFlags] lookupFlags forall a b. IO a -> IO b -> IO a onException (do Ptr Bytes result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a propagateGError forall a b. (a -> b) -> a -> b $ CString -> CUInt -> Ptr (Ptr GError) -> IO (Ptr Bytes) g_resources_lookup_data CString path' CUInt lookupFlags' forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "resourcesLookupData" Ptr Bytes result Bytes result' <- (forall a. (HasCallStack, GBoxed a) => (ManagedPtr a -> a) -> Ptr a -> IO a wrapBoxed ManagedPtr Bytes -> Bytes GLib.Bytes.Bytes) Ptr Bytes result forall a. Ptr a -> IO () freeMem CString path' forall (m :: * -> *) a. Monad m => a -> m a return Bytes result' ) (do forall a. Ptr a -> IO () freeMem CString path' ) -- function resources_get_info -- Args: [ Arg -- { argCName = "path" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A pathname inside the resource" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "lookup_flags" -- , argType = -- TInterface -- Name { namespace = "Gio" , name = "ResourceLookupFlags" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A #GResourceLookupFlags" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "size" -- , argType = TBasicType TUInt32 -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "a location to place the length of the contents of the file,\n or %NULL if the length is not needed" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "flags" -- , argType = TBasicType TUInt32 -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "a location to place the #GResourceFlags about the file,\n or %NULL if the flags are not needed" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "g_resources_get_info" g_resources_get_info :: CString -> -- path : TBasicType TUTF8 CUInt -> -- lookup_flags : TInterface (Name {namespace = "Gio", name = "ResourceLookupFlags"}) Ptr Word32 -> -- size : TBasicType TUInt32 Ptr Word32 -> -- flags : TBasicType TUInt32 Ptr (Ptr GError) -> -- error IO CInt -- | Looks for a file at the specified /@path@/ in the set of -- globally registered resources and if found returns information about it. -- -- /@lookupFlags@/ controls the behaviour of the lookup. -- -- /Since: 2.32/ resourcesGetInfo :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@path@/: A pathname inside the resource -> [Gio.Flags.ResourceLookupFlags] -- ^ /@lookupFlags@/: A t'GI.Gio.Flags.ResourceLookupFlags' -> m ((Word32, Word32)) -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ resourcesGetInfo :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> [ResourceLookupFlags] -> m (Word32, Word32) resourcesGetInfo Text path [ResourceLookupFlags] lookupFlags = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString path' <- Text -> IO CString textToCString Text path let lookupFlags' :: CUInt lookupFlags' = forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [ResourceLookupFlags] lookupFlags Ptr Word32 size <- forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr Word32) Ptr Word32 flags <- forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr Word32) forall a b. IO a -> IO b -> IO a onException (do CInt _ <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a propagateGError forall a b. (a -> b) -> a -> b $ CString -> CUInt -> Ptr Word32 -> Ptr Word32 -> Ptr (Ptr GError) -> IO CInt g_resources_get_info CString path' CUInt lookupFlags' Ptr Word32 size Ptr Word32 flags Word32 size' <- forall a. Storable a => Ptr a -> IO a peek Ptr Word32 size Word32 flags' <- forall a. Storable a => Ptr a -> IO a peek Ptr Word32 flags forall a. Ptr a -> IO () freeMem CString path' forall a. Ptr a -> IO () freeMem Ptr Word32 size forall a. Ptr a -> IO () freeMem Ptr Word32 flags forall (m :: * -> *) a. Monad m => a -> m a return (Word32 size', Word32 flags') ) (do forall a. Ptr a -> IO () freeMem CString path' forall a. Ptr a -> IO () freeMem Ptr Word32 size forall a. Ptr a -> IO () freeMem Ptr Word32 flags ) -- function resources_enumerate_children -- Args: [ Arg -- { argCName = "path" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A pathname inside the resource" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "lookup_flags" -- , argType = -- TInterface -- Name { namespace = "Gio" , name = "ResourceLookupFlags" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A #GResourceLookupFlags" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TCArray True (-1) (-1) (TBasicType TUTF8)) -- throws : True -- Skip return : False foreign import ccall "g_resources_enumerate_children" g_resources_enumerate_children :: CString -> -- path : TBasicType TUTF8 CUInt -> -- lookup_flags : TInterface (Name {namespace = "Gio", name = "ResourceLookupFlags"}) Ptr (Ptr GError) -> -- error IO (Ptr CString) -- | Returns all the names of children at the specified /@path@/ in the set of -- globally registered resources. -- The return result is a 'P.Nothing' terminated list of strings which should -- be released with 'GI.GLib.Functions.strfreev'. -- -- /@lookupFlags@/ controls the behaviour of the lookup. -- -- /Since: 2.32/ resourcesEnumerateChildren :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@path@/: A pathname inside the resource -> [Gio.Flags.ResourceLookupFlags] -- ^ /@lookupFlags@/: A t'GI.Gio.Flags.ResourceLookupFlags' -> m [T.Text] -- ^ __Returns:__ an array of constant strings /(Can throw 'Data.GI.Base.GError.GError')/ resourcesEnumerateChildren :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> [ResourceLookupFlags] -> m [Text] resourcesEnumerateChildren Text path [ResourceLookupFlags] lookupFlags = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString path' <- Text -> IO CString textToCString Text path let lookupFlags' :: CUInt lookupFlags' = forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [ResourceLookupFlags] lookupFlags forall a b. IO a -> IO b -> IO a onException (do Ptr CString result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a propagateGError forall a b. (a -> b) -> a -> b $ CString -> CUInt -> Ptr (Ptr GError) -> IO (Ptr CString) g_resources_enumerate_children CString path' CUInt lookupFlags' forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "resourcesEnumerateChildren" Ptr CString result [Text] result' <- HasCallStack => Ptr CString -> IO [Text] unpackZeroTerminatedUTF8CArray Ptr CString result forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO () mapZeroTerminatedCArray forall a. Ptr a -> IO () freeMem Ptr CString result forall a. Ptr a -> IO () freeMem Ptr CString result forall a. Ptr a -> IO () freeMem CString path' forall (m :: * -> *) a. Monad m => a -> m a return [Text] result' ) (do forall a. Ptr a -> IO () freeMem CString path' ) -- function pollable_stream_write_all -- Args: [ Arg -- { argCName = "stream" -- , argType = -- TInterface Name { namespace = "Gio" , name = "OutputStream" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GOutputStream." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "buffer" -- , argType = TCArray False (-1) 2 (TBasicType TUInt8) -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the buffer\n containing the data to write." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "count" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the number of bytes to write" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "blocking" -- , argType = TBasicType TBoolean -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "whether to do blocking I/O" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "bytes_written" -- , argType = TBasicType TUInt32 -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "location to store the number of bytes that was\n written to the stream" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "cancellable" -- , argType = -- TInterface Name { namespace = "Gio" , name = "Cancellable" } -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just "optional #GCancellable object, %NULL to ignore." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "count" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the number of bytes to write" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "g_pollable_stream_write_all" g_pollable_stream_write_all :: Ptr Gio.OutputStream.OutputStream -> -- stream : TInterface (Name {namespace = "Gio", name = "OutputStream"}) Ptr Word8 -> -- buffer : TCArray False (-1) 2 (TBasicType TUInt8) Word32 -> -- count : TBasicType TUInt32 CInt -> -- blocking : TBasicType TBoolean Ptr Word32 -> -- bytes_written : TBasicType TUInt32 Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) Ptr (Ptr GError) -> -- error IO CInt -- | Tries to write /@count@/ bytes to /@stream@/, as with -- 'GI.Gio.Objects.OutputStream.outputStreamWriteAll', but using 'GI.Gio.Functions.pollableStreamWrite' -- rather than 'GI.Gio.Objects.OutputStream.outputStreamWrite'. -- -- On a successful write of /@count@/ bytes, 'P.True' is returned, and -- /@bytesWritten@/ is set to /@count@/. -- -- If there is an error during the operation (including -- 'GI.Gio.Enums.IOErrorEnumWouldBlock' in the non-blocking case), 'P.False' is -- returned and /@error@/ is set to indicate the error status, -- /@bytesWritten@/ is updated to contain the number of bytes written -- into the stream before the error occurred. -- -- As with 'GI.Gio.Functions.pollableStreamWrite', if /@blocking@/ is 'P.False', then -- /@stream@/ must be a t'GI.Gio.Interfaces.PollableOutputStream.PollableOutputStream' for which -- 'GI.Gio.Interfaces.PollableOutputStream.pollableOutputStreamCanPoll' returns 'P.True' or else the -- behavior is undefined. If /@blocking@/ is 'P.True', then /@stream@/ does not -- need to be a t'GI.Gio.Interfaces.PollableOutputStream.PollableOutputStream'. -- -- /Since: 2.34/ pollableStreamWriteAll :: (B.CallStack.HasCallStack, MonadIO m, Gio.OutputStream.IsOutputStream a, Gio.Cancellable.IsCancellable b) => a -- ^ /@stream@/: a t'GI.Gio.Objects.OutputStream.OutputStream'. -> ByteString -- ^ /@buffer@/: the buffer -- containing the data to write. -> Bool -- ^ /@blocking@/: whether to do blocking I\/O -> Maybe (b) -- ^ /@cancellable@/: optional t'GI.Gio.Objects.Cancellable.Cancellable' object, 'P.Nothing' to ignore. -> m (Word32) -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ pollableStreamWriteAll :: forall (m :: * -> *) a b. (HasCallStack, MonadIO m, IsOutputStream a, IsCancellable b) => a -> ByteString -> Bool -> Maybe b -> m Word32 pollableStreamWriteAll a stream ByteString buffer Bool blocking Maybe b cancellable = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do let count :: Word32 count = forall a b. (Integral a, Num b) => a -> b fromIntegral forall a b. (a -> b) -> a -> b $ ByteString -> Int B.length ByteString buffer Ptr OutputStream stream' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a stream Ptr Word8 buffer' <- ByteString -> IO (Ptr Word8) packByteString ByteString buffer let blocking' :: CInt blocking' = (forall a b. (Integral a, Num b) => a -> b P.fromIntegral forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. Enum a => a -> Int P.fromEnum) Bool blocking Ptr Word32 bytesWritten <- forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr Word32) Ptr Cancellable maybeCancellable <- case Maybe b cancellable of Maybe b Nothing -> forall (m :: * -> *) a. Monad m => a -> m a return forall a. Ptr a nullPtr Just b jCancellable -> do Ptr Cancellable jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr b jCancellable forall (m :: * -> *) a. Monad m => a -> m a return Ptr Cancellable jCancellable' forall a b. IO a -> IO b -> IO a onException (do CInt _ <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a propagateGError forall a b. (a -> b) -> a -> b $ Ptr OutputStream -> Ptr Word8 -> Word32 -> CInt -> Ptr Word32 -> Ptr Cancellable -> Ptr (Ptr GError) -> IO CInt g_pollable_stream_write_all Ptr OutputStream stream' Ptr Word8 buffer' Word32 count CInt blocking' Ptr Word32 bytesWritten Ptr Cancellable maybeCancellable Word32 bytesWritten' <- forall a. Storable a => Ptr a -> IO a peek Ptr Word32 bytesWritten forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a stream forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe b cancellable forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr forall a. Ptr a -> IO () freeMem Ptr Word8 buffer' forall a. Ptr a -> IO () freeMem Ptr Word32 bytesWritten forall (m :: * -> *) a. Monad m => a -> m a return Word32 bytesWritten' ) (do forall a. Ptr a -> IO () freeMem Ptr Word8 buffer' forall a. Ptr a -> IO () freeMem Ptr Word32 bytesWritten ) -- function pollable_stream_write -- Args: [ Arg -- { argCName = "stream" -- , argType = -- TInterface Name { namespace = "Gio" , name = "OutputStream" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GOutputStream." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "buffer" -- , argType = TCArray False (-1) 2 (TBasicType TUInt8) -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the buffer\n containing the data to write." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "count" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the number of bytes to write" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "blocking" -- , argType = TBasicType TBoolean -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "whether to do blocking I/O" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cancellable" -- , argType = -- TInterface Name { namespace = "Gio" , name = "Cancellable" } -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just "optional #GCancellable object, %NULL to ignore." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "count" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the number of bytes to write" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- returnType: Just (TBasicType TInt32) -- throws : True -- Skip return : False foreign import ccall "g_pollable_stream_write" g_pollable_stream_write :: Ptr Gio.OutputStream.OutputStream -> -- stream : TInterface (Name {namespace = "Gio", name = "OutputStream"}) Ptr Word8 -> -- buffer : TCArray False (-1) 2 (TBasicType TUInt8) Word32 -> -- count : TBasicType TUInt32 CInt -> -- blocking : TBasicType TBoolean Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) Ptr (Ptr GError) -> -- error IO Int32 -- | Tries to write to /@stream@/, as with 'GI.Gio.Objects.OutputStream.outputStreamWrite' (if -- /@blocking@/ is 'P.True') or 'GI.Gio.Interfaces.PollableOutputStream.pollableOutputStreamWriteNonblocking' -- (if /@blocking@/ is 'P.False'). This can be used to more easily share -- code between blocking and non-blocking implementations of a method. -- -- If /@blocking@/ is 'P.False', then /@stream@/ must be a -- t'GI.Gio.Interfaces.PollableOutputStream.PollableOutputStream' for which -- 'GI.Gio.Interfaces.PollableOutputStream.pollableOutputStreamCanPoll' returns 'P.True' or else the -- behavior is undefined. If /@blocking@/ is 'P.True', then /@stream@/ does not -- need to be a t'GI.Gio.Interfaces.PollableOutputStream.PollableOutputStream'. -- -- /Since: 2.34/ pollableStreamWrite :: (B.CallStack.HasCallStack, MonadIO m, Gio.OutputStream.IsOutputStream a, Gio.Cancellable.IsCancellable b) => a -- ^ /@stream@/: a t'GI.Gio.Objects.OutputStream.OutputStream'. -> ByteString -- ^ /@buffer@/: the buffer -- containing the data to write. -> Bool -- ^ /@blocking@/: whether to do blocking I\/O -> Maybe (b) -- ^ /@cancellable@/: optional t'GI.Gio.Objects.Cancellable.Cancellable' object, 'P.Nothing' to ignore. -> m Int32 -- ^ __Returns:__ the number of bytes written, or -1 on error. /(Can throw 'Data.GI.Base.GError.GError')/ pollableStreamWrite :: forall (m :: * -> *) a b. (HasCallStack, MonadIO m, IsOutputStream a, IsCancellable b) => a -> ByteString -> Bool -> Maybe b -> m Int32 pollableStreamWrite a stream ByteString buffer Bool blocking Maybe b cancellable = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do let count :: Word32 count = forall a b. (Integral a, Num b) => a -> b fromIntegral forall a b. (a -> b) -> a -> b $ ByteString -> Int B.length ByteString buffer Ptr OutputStream stream' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a stream Ptr Word8 buffer' <- ByteString -> IO (Ptr Word8) packByteString ByteString buffer let blocking' :: CInt blocking' = (forall a b. (Integral a, Num b) => a -> b P.fromIntegral forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. Enum a => a -> Int P.fromEnum) Bool blocking Ptr Cancellable maybeCancellable <- case Maybe b cancellable of Maybe b Nothing -> forall (m :: * -> *) a. Monad m => a -> m a return forall a. Ptr a nullPtr Just b jCancellable -> do Ptr Cancellable jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr b jCancellable forall (m :: * -> *) a. Monad m => a -> m a return Ptr Cancellable jCancellable' forall a b. IO a -> IO b -> IO a onException (do Int32 result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a propagateGError forall a b. (a -> b) -> a -> b $ Ptr OutputStream -> Ptr Word8 -> Word32 -> CInt -> Ptr Cancellable -> Ptr (Ptr GError) -> IO Int32 g_pollable_stream_write Ptr OutputStream stream' Ptr Word8 buffer' Word32 count CInt blocking' Ptr Cancellable maybeCancellable forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a stream forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe b cancellable forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr forall a. Ptr a -> IO () freeMem Ptr Word8 buffer' forall (m :: * -> *) a. Monad m => a -> m a return Int32 result ) (do forall a. Ptr a -> IO () freeMem Ptr Word8 buffer' ) -- function pollable_stream_read -- Args: [ Arg -- { argCName = "stream" -- , argType = -- TInterface Name { namespace = "Gio" , name = "InputStream" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GInputStream" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "buffer" -- , argType = TCArray False (-1) 2 (TBasicType TUInt8) -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a buffer to\n read data into" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "count" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the number of bytes to read" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "blocking" -- , argType = TBasicType TBoolean -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "whether to do blocking I/O" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cancellable" -- , argType = -- TInterface Name { namespace = "Gio" , name = "Cancellable" } -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just "optional #GCancellable object, %NULL to ignore." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [ Arg -- { argCName = "count" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the number of bytes to read" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- returnType: Just (TBasicType TInt32) -- throws : True -- Skip return : False foreign import ccall "g_pollable_stream_read" g_pollable_stream_read :: Ptr Gio.InputStream.InputStream -> -- stream : TInterface (Name {namespace = "Gio", name = "InputStream"}) Ptr Word8 -> -- buffer : TCArray False (-1) 2 (TBasicType TUInt8) Word32 -> -- count : TBasicType TUInt32 CInt -> -- blocking : TBasicType TBoolean Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) Ptr (Ptr GError) -> -- error IO Int32 -- | Tries to read from /@stream@/, as with 'GI.Gio.Objects.InputStream.inputStreamRead' (if -- /@blocking@/ is 'P.True') or 'GI.Gio.Interfaces.PollableInputStream.pollableInputStreamReadNonblocking' -- (if /@blocking@/ is 'P.False'). This can be used to more easily share -- code between blocking and non-blocking implementations of a method. -- -- If /@blocking@/ is 'P.False', then /@stream@/ must be a -- t'GI.Gio.Interfaces.PollableInputStream.PollableInputStream' for which 'GI.Gio.Interfaces.PollableInputStream.pollableInputStreamCanPoll' -- returns 'P.True', or else the behavior is undefined. If /@blocking@/ is -- 'P.True', then /@stream@/ does not need to be a t'GI.Gio.Interfaces.PollableInputStream.PollableInputStream'. -- -- /Since: 2.34/ pollableStreamRead :: (B.CallStack.HasCallStack, MonadIO m, Gio.InputStream.IsInputStream a, Gio.Cancellable.IsCancellable b) => a -- ^ /@stream@/: a t'GI.Gio.Objects.InputStream.InputStream' -> ByteString -- ^ /@buffer@/: a buffer to -- read data into -> Bool -- ^ /@blocking@/: whether to do blocking I\/O -> Maybe (b) -- ^ /@cancellable@/: optional t'GI.Gio.Objects.Cancellable.Cancellable' object, 'P.Nothing' to ignore. -> m Int32 -- ^ __Returns:__ the number of bytes read, or -1 on error. /(Can throw 'Data.GI.Base.GError.GError')/ pollableStreamRead :: forall (m :: * -> *) a b. (HasCallStack, MonadIO m, IsInputStream a, IsCancellable b) => a -> ByteString -> Bool -> Maybe b -> m Int32 pollableStreamRead a stream ByteString buffer Bool blocking Maybe b cancellable = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do let count :: Word32 count = forall a b. (Integral a, Num b) => a -> b fromIntegral forall a b. (a -> b) -> a -> b $ ByteString -> Int B.length ByteString buffer Ptr InputStream stream' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a stream Ptr Word8 buffer' <- ByteString -> IO (Ptr Word8) packByteString ByteString buffer let blocking' :: CInt blocking' = (forall a b. (Integral a, Num b) => a -> b P.fromIntegral forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. Enum a => a -> Int P.fromEnum) Bool blocking Ptr Cancellable maybeCancellable <- case Maybe b cancellable of Maybe b Nothing -> forall (m :: * -> *) a. Monad m => a -> m a return forall a. Ptr a nullPtr Just b jCancellable -> do Ptr Cancellable jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr b jCancellable forall (m :: * -> *) a. Monad m => a -> m a return Ptr Cancellable jCancellable' forall a b. IO a -> IO b -> IO a onException (do Int32 result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a propagateGError forall a b. (a -> b) -> a -> b $ Ptr InputStream -> Ptr Word8 -> Word32 -> CInt -> Ptr Cancellable -> Ptr (Ptr GError) -> IO Int32 g_pollable_stream_read Ptr InputStream stream' Ptr Word8 buffer' Word32 count CInt blocking' Ptr Cancellable maybeCancellable forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a stream forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe b cancellable forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr forall a. Ptr a -> IO () freeMem Ptr Word8 buffer' forall (m :: * -> *) a. Monad m => a -> m a return Int32 result ) (do forall a. Ptr a -> IO () freeMem Ptr Word8 buffer' ) -- function pollable_source_new_full -- Args: [ Arg -- { argCName = "pollable_stream" -- , argType = -- TInterface Name { namespace = "GObject" , name = "Object" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the stream associated with the\n new source" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "child_source" -- , argType = -- TInterface Name { namespace = "GLib" , name = "Source" } -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "optional child source to attach" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cancellable" -- , argType = -- TInterface Name { namespace = "Gio" , name = "Cancellable" } -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "optional #GCancellable to attach" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "GLib" , name = "Source" }) -- throws : False -- Skip return : False foreign import ccall "g_pollable_source_new_full" g_pollable_source_new_full :: Ptr GObject.Object.Object -> -- pollable_stream : TInterface (Name {namespace = "GObject", name = "Object"}) Ptr GLib.Source.Source -> -- child_source : TInterface (Name {namespace = "GLib", name = "Source"}) Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) IO (Ptr GLib.Source.Source) -- | Utility method for t'GI.Gio.Interfaces.PollableInputStream.PollableInputStream' and t'GI.Gio.Interfaces.PollableOutputStream.PollableOutputStream' -- implementations. Creates a new t'GI.GLib.Structs.Source.Source', as with -- 'GI.Gio.Functions.pollableSourceNew', but also attaching /@childSource@/ (with a -- dummy callback), and /@cancellable@/, if they are non-'P.Nothing'. -- -- /Since: 2.34/ pollableSourceNewFull :: (B.CallStack.HasCallStack, MonadIO m, GObject.Object.IsObject a, Gio.Cancellable.IsCancellable b) => a -- ^ /@pollableStream@/: the stream associated with the -- new source -> Maybe (GLib.Source.Source) -- ^ /@childSource@/: optional child source to attach -> Maybe (b) -- ^ /@cancellable@/: optional t'GI.Gio.Objects.Cancellable.Cancellable' to attach -> m GLib.Source.Source -- ^ __Returns:__ the new t'GI.GLib.Structs.Source.Source'. pollableSourceNewFull :: forall (m :: * -> *) a b. (HasCallStack, MonadIO m, IsObject a, IsCancellable b) => a -> Maybe Source -> Maybe b -> m Source pollableSourceNewFull a pollableStream Maybe Source childSource Maybe b cancellable = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr Object pollableStream' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a pollableStream Ptr Source maybeChildSource <- case Maybe Source childSource of Maybe Source Nothing -> forall (m :: * -> *) a. Monad m => a -> m a return forall a. Ptr a nullPtr Just Source jChildSource -> do Ptr Source jChildSource' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr Source jChildSource forall (m :: * -> *) a. Monad m => a -> m a return Ptr Source jChildSource' Ptr Cancellable maybeCancellable <- case Maybe b cancellable of Maybe b Nothing -> forall (m :: * -> *) a. Monad m => a -> m a return forall a. Ptr a nullPtr Just b jCancellable -> do Ptr Cancellable jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr b jCancellable forall (m :: * -> *) a. Monad m => a -> m a return Ptr Cancellable jCancellable' Ptr Source result <- Ptr Object -> Ptr Source -> Ptr Cancellable -> IO (Ptr Source) g_pollable_source_new_full Ptr Object pollableStream' Ptr Source maybeChildSource Ptr Cancellable maybeCancellable forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "pollableSourceNewFull" Ptr Source result Source result' <- (forall a. (HasCallStack, GBoxed a) => (ManagedPtr a -> a) -> Ptr a -> IO a wrapBoxed ManagedPtr Source -> Source GLib.Source.Source) Ptr Source result forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a pollableStream forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe Source childSource forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe b cancellable forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr forall (m :: * -> *) a. Monad m => a -> m a return Source result' -- function pollable_source_new -- Args: [ Arg -- { argCName = "pollable_stream" -- , argType = -- TInterface Name { namespace = "GObject" , name = "Object" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the stream associated with the new source" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "GLib" , name = "Source" }) -- throws : False -- Skip return : False foreign import ccall "g_pollable_source_new" g_pollable_source_new :: Ptr GObject.Object.Object -> -- pollable_stream : TInterface (Name {namespace = "GObject", name = "Object"}) IO (Ptr GLib.Source.Source) -- | Utility method for t'GI.Gio.Interfaces.PollableInputStream.PollableInputStream' and t'GI.Gio.Interfaces.PollableOutputStream.PollableOutputStream' -- implementations. Creates a new t'GI.GLib.Structs.Source.Source' that expects a callback of -- type t'GI.Gio.Callbacks.PollableSourceFunc'. The new source does not actually do -- anything on its own; use 'GI.GLib.Structs.Source.sourceAddChildSource' to add other -- sources to it to cause it to trigger. -- -- /Since: 2.28/ pollableSourceNew :: (B.CallStack.HasCallStack, MonadIO m, GObject.Object.IsObject a) => a -- ^ /@pollableStream@/: the stream associated with the new source -> m GLib.Source.Source -- ^ __Returns:__ the new t'GI.GLib.Structs.Source.Source'. pollableSourceNew :: forall (m :: * -> *) a. (HasCallStack, MonadIO m, IsObject a) => a -> m Source pollableSourceNew a pollableStream = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr Object pollableStream' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a pollableStream Ptr Source result <- Ptr Object -> IO (Ptr Source) g_pollable_source_new Ptr Object pollableStream' forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "pollableSourceNew" Ptr Source result Source result' <- (forall a. (HasCallStack, GBoxed a) => (ManagedPtr a -> a) -> Ptr a -> IO a wrapBoxed ManagedPtr Source -> Source GLib.Source.Source) Ptr Source result forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a pollableStream forall (m :: * -> *) a. Monad m => a -> m a return Source result' -- function null_settings_backend_new -- Args: [] -- Lengths: [] -- returnType: Just -- (TInterface Name { namespace = "Gio" , name = "SettingsBackend" }) -- throws : False -- Skip return : False foreign import ccall "g_null_settings_backend_new" g_null_settings_backend_new :: IO (Ptr Gio.SettingsBackend.SettingsBackend) -- | Creates a readonly t'GI.Gio.Objects.SettingsBackend.SettingsBackend'. -- -- This backend does not allow changes to settings, so all settings -- will always have their default values. -- -- /Since: 2.28/ nullSettingsBackendNew :: (B.CallStack.HasCallStack, MonadIO m) => m Gio.SettingsBackend.SettingsBackend -- ^ __Returns:__ a newly created t'GI.Gio.Objects.SettingsBackend.SettingsBackend' nullSettingsBackendNew :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m SettingsBackend nullSettingsBackendNew = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr SettingsBackend result <- IO (Ptr SettingsBackend) g_null_settings_backend_new forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "nullSettingsBackendNew" Ptr SettingsBackend result SettingsBackend result' <- (forall a b. (HasCallStack, GObject a, GObject b) => (ManagedPtr a -> a) -> Ptr b -> IO a wrapObject ManagedPtr SettingsBackend -> SettingsBackend Gio.SettingsBackend.SettingsBackend) Ptr SettingsBackend result forall (m :: * -> *) a. Monad m => a -> m a return SettingsBackend result' -- function networking_init -- Args: [] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_networking_init" g_networking_init :: IO () -- | Initializes the platform networking libraries (eg, on Windows, this -- calls @/WSAStartup()/@). GLib will call this itself if it is needed, so -- you only need to call it if you directly call system networking -- functions (without calling any GLib networking functions first). -- -- /Since: 2.36/ networkingInit :: (B.CallStack.HasCallStack, MonadIO m) => m () networkingInit :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m () networkingInit = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do IO () g_networking_init forall (m :: * -> *) a. Monad m => a -> m a return () -- function memory_settings_backend_new -- Args: [] -- Lengths: [] -- returnType: Just -- (TInterface Name { namespace = "Gio" , name = "SettingsBackend" }) -- throws : False -- Skip return : False foreign import ccall "g_memory_settings_backend_new" g_memory_settings_backend_new :: IO (Ptr Gio.SettingsBackend.SettingsBackend) -- | Creates a memory-backed t'GI.Gio.Objects.SettingsBackend.SettingsBackend'. -- -- This backend allows changes to settings, but does not write them -- to any backing storage, so the next time you run your application, -- the memory backend will start out with the default values again. -- -- /Since: 2.28/ memorySettingsBackendNew :: (B.CallStack.HasCallStack, MonadIO m) => m Gio.SettingsBackend.SettingsBackend -- ^ __Returns:__ a newly created t'GI.Gio.Objects.SettingsBackend.SettingsBackend' memorySettingsBackendNew :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m SettingsBackend memorySettingsBackendNew = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr SettingsBackend result <- IO (Ptr SettingsBackend) g_memory_settings_backend_new forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "memorySettingsBackendNew" Ptr SettingsBackend result SettingsBackend result' <- (forall a b. (HasCallStack, GObject a, GObject b) => (ManagedPtr a -> a) -> Ptr b -> IO a wrapObject ManagedPtr SettingsBackend -> SettingsBackend Gio.SettingsBackend.SettingsBackend) Ptr SettingsBackend result forall (m :: * -> *) a. Monad m => a -> m a return SettingsBackend result' -- function keyfile_settings_backend_new -- Args: [ Arg -- { argCName = "filename" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the filename of the keyfile" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "root_path" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the path under which all settings keys appear" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "root_group" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "the group name corresponding to\n @root_path, or %NULL" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface Name { namespace = "Gio" , name = "SettingsBackend" }) -- throws : False -- Skip return : False foreign import ccall "g_keyfile_settings_backend_new" g_keyfile_settings_backend_new :: CString -> -- filename : TBasicType TUTF8 CString -> -- root_path : TBasicType TUTF8 CString -> -- root_group : TBasicType TUTF8 IO (Ptr Gio.SettingsBackend.SettingsBackend) -- | Creates a keyfile-backed t'GI.Gio.Objects.SettingsBackend.SettingsBackend'. -- -- The filename of the keyfile to use is given by /@filename@/. -- -- All settings read to or written from the backend must fall under the -- path given in /@rootPath@/ (which must start and end with a slash and -- not contain two consecutive slashes). /@rootPath@/ may be \"\/\". -- -- If /@rootGroup@/ is non-'P.Nothing' then it specifies the name of the keyfile -- group used for keys that are written directly below /@rootPath@/. For -- example, if /@rootPath@/ is \"\/apps\/example\/\" and /@rootGroup@/ is -- \"toplevel\", then settings the key \"\/apps\/example\/enabled\" to a value -- of 'P.True' will cause the following to appear in the keyfile: -- -- > -- > [toplevel] -- > enabled=true -- -- -- If /@rootGroup@/ is 'P.Nothing' then it is not permitted to store keys -- directly below the /@rootPath@/. -- -- For keys not stored directly below /@rootPath@/ (ie: in a sub-path), -- the name of the subpath (with the final slash stripped) is used as -- the name of the keyfile group. To continue the example, if -- \"\/apps\/example\/profiles\/default\/font-size\" were set to -- 12 then the following would appear in the keyfile: -- -- > -- > [profiles/default] -- > font-size=12 -- -- -- The backend will refuse writes (and return writability as being -- 'P.False') for keys outside of /@rootPath@/ and, in the event that -- /@rootGroup@/ is 'P.Nothing', also for keys directly under /@rootPath@/. -- Writes will also be refused if the backend detects that it has the -- inability to rewrite the keyfile (ie: the containing directory is not -- writable). -- -- There is no checking done for your key namespace clashing with the -- syntax of the key file format. For example, if you have \'[\' or \']\' -- characters in your path names or \'=\' in your key names you may be in -- trouble. -- -- The backend reads default values from a keyfile called @defaults@ in -- the directory specified by the @/GKeyfileSettingsBackend:defaults-dir/@ property, -- and a list of locked keys from a text file with the name @locks@ in -- the same location. keyfileSettingsBackendNew :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@filename@/: the filename of the keyfile -> T.Text -- ^ /@rootPath@/: the path under which all settings keys appear -> Maybe (T.Text) -- ^ /@rootGroup@/: the group name corresponding to -- /@rootPath@/, or 'P.Nothing' -> m Gio.SettingsBackend.SettingsBackend -- ^ __Returns:__ a keyfile-backed t'GI.Gio.Objects.SettingsBackend.SettingsBackend' keyfileSettingsBackendNew :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> Text -> Maybe Text -> m SettingsBackend keyfileSettingsBackendNew Text filename Text rootPath Maybe Text rootGroup = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString filename' <- Text -> IO CString textToCString Text filename CString rootPath' <- Text -> IO CString textToCString Text rootPath CString maybeRootGroup <- case Maybe Text rootGroup of Maybe Text Nothing -> forall (m :: * -> *) a. Monad m => a -> m a return forall a. Ptr a nullPtr Just Text jRootGroup -> do CString jRootGroup' <- Text -> IO CString textToCString Text jRootGroup forall (m :: * -> *) a. Monad m => a -> m a return CString jRootGroup' Ptr SettingsBackend result <- CString -> CString -> CString -> IO (Ptr SettingsBackend) g_keyfile_settings_backend_new CString filename' CString rootPath' CString maybeRootGroup forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "keyfileSettingsBackendNew" Ptr SettingsBackend result SettingsBackend result' <- (forall a b. (HasCallStack, GObject a, GObject b) => (ManagedPtr a -> a) -> Ptr b -> IO a wrapObject ManagedPtr SettingsBackend -> SettingsBackend Gio.SettingsBackend.SettingsBackend) Ptr SettingsBackend result forall a. Ptr a -> IO () freeMem CString filename' forall a. Ptr a -> IO () freeMem CString rootPath' forall a. Ptr a -> IO () freeMem CString maybeRootGroup forall (m :: * -> *) a. Monad m => a -> m a return SettingsBackend result' -- function io_scheduler_push_job -- Args: [ Arg -- { argCName = "job_func" -- , argType = -- TInterface Name { namespace = "Gio" , name = "IOSchedulerJobFunc" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GIOSchedulerJobFunc." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeNotified -- , argClosure = 1 -- , argDestroy = 2 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "user_data" -- , argType = TBasicType TPtr -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "data to pass to @job_func" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "notify" -- , argType = -- TInterface Name { namespace = "GLib" , name = "DestroyNotify" } -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "a #GDestroyNotify for @user_data, or %NULL" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeAsync -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "io_priority" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "the [I/O priority][io-priority]\nof the request." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cancellable" -- , argType = -- TInterface Name { namespace = "Gio" , name = "Cancellable" } -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just "optional #GCancellable object, %NULL to ignore." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_io_scheduler_push_job" g_io_scheduler_push_job :: FunPtr Gio.Callbacks.C_IOSchedulerJobFunc -> -- job_func : TInterface (Name {namespace = "Gio", name = "IOSchedulerJobFunc"}) Ptr () -> -- user_data : TBasicType TPtr FunPtr GLib.Callbacks.C_DestroyNotify -> -- notify : TInterface (Name {namespace = "GLib", name = "DestroyNotify"}) Int32 -> -- io_priority : TBasicType TInt Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) IO () {-# DEPRECATED ioSchedulerPushJob ["use t'GI.GLib.Structs.ThreadPool.ThreadPool' or 'GI.Gio.Objects.Task.taskRunInThread'"] #-} -- | Schedules the I\/O job to run in another thread. -- -- /@notify@/ will be called on /@userData@/ after /@jobFunc@/ has returned, -- regardless whether the job was cancelled or has run to completion. -- -- If /@cancellable@/ is not 'P.Nothing', it can be used to cancel the I\/O job -- by calling 'GI.Gio.Objects.Cancellable.cancellableCancel' or by calling -- 'GI.Gio.Functions.ioSchedulerCancelAllJobs'. ioSchedulerPushJob :: (B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) => Gio.Callbacks.IOSchedulerJobFunc -- ^ /@jobFunc@/: a t'GI.Gio.Callbacks.IOSchedulerJobFunc'. -> Int32 -- ^ /@ioPriority@/: the [I\/O priority][io-priority] -- of the request. -> Maybe (a) -- ^ /@cancellable@/: optional t'GI.Gio.Objects.Cancellable.Cancellable' object, 'P.Nothing' to ignore. -> m () ioSchedulerPushJob :: forall (m :: * -> *) a. (HasCallStack, MonadIO m, IsCancellable a) => IOSchedulerJobFunc -> Int32 -> Maybe a -> m () ioSchedulerPushJob IOSchedulerJobFunc jobFunc Int32 ioPriority Maybe a cancellable = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do FunPtr C_IOSchedulerJobFunc jobFunc' <- C_IOSchedulerJobFunc -> IO (FunPtr C_IOSchedulerJobFunc) Gio.Callbacks.mk_IOSchedulerJobFunc (Maybe (Ptr (FunPtr C_IOSchedulerJobFunc)) -> IOSchedulerJobFunc -> C_IOSchedulerJobFunc Gio.Callbacks.wrap_IOSchedulerJobFunc forall a. Maybe a Nothing IOSchedulerJobFunc jobFunc) Ptr Cancellable maybeCancellable <- case Maybe a cancellable of Maybe a Nothing -> forall (m :: * -> *) a. Monad m => a -> m a return forall a. Ptr a nullPtr Just a jCancellable -> do Ptr Cancellable jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a jCancellable forall (m :: * -> *) a. Monad m => a -> m a return Ptr Cancellable jCancellable' let userData :: Ptr () userData = forall a b. FunPtr a -> Ptr b castFunPtrToPtr FunPtr C_IOSchedulerJobFunc jobFunc' let notify :: FunPtr (Ptr a -> IO ()) notify = forall a. FunPtr (Ptr a -> IO ()) SP.safeFreeFunPtrPtr FunPtr C_IOSchedulerJobFunc -> Ptr () -> FunPtr C_DestroyNotify -> Int32 -> Ptr Cancellable -> IO () g_io_scheduler_push_job FunPtr C_IOSchedulerJobFunc jobFunc' Ptr () userData forall a. FunPtr (Ptr a -> IO ()) notify Int32 ioPriority Ptr Cancellable maybeCancellable forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe a cancellable forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr forall (m :: * -> *) a. Monad m => a -> m a return () -- function io_scheduler_cancel_all_jobs -- Args: [] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_io_scheduler_cancel_all_jobs" g_io_scheduler_cancel_all_jobs :: IO () {-# DEPRECATED ioSchedulerCancelAllJobs ["You should never call this function, since you don\\'t","know how other libraries in your program might be making use of","gioscheduler."] #-} -- | Cancels all cancellable I\/O jobs. -- -- A job is cancellable if a t'GI.Gio.Objects.Cancellable.Cancellable' was passed into -- 'GI.Gio.Functions.ioSchedulerPushJob'. ioSchedulerCancelAllJobs :: (B.CallStack.HasCallStack, MonadIO m) => m () ioSchedulerCancelAllJobs :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m () ioSchedulerCancelAllJobs = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do IO () g_io_scheduler_cancel_all_jobs forall (m :: * -> *) a. Monad m => a -> m a return () -- function io_modules_scan_all_in_directory_with_scope -- Args: [ Arg -- { argCName = "dirname" -- , argType = TBasicType TFileName -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "pathname for a directory containing modules\n to scan." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "scope" -- , argType = -- TInterface Name { namespace = "Gio" , name = "IOModuleScope" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a scope to use when scanning the modules" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_io_modules_scan_all_in_directory_with_scope" g_io_modules_scan_all_in_directory_with_scope :: CString -> -- dirname : TBasicType TFileName Ptr Gio.IOModuleScope.IOModuleScope -> -- scope : TInterface (Name {namespace = "Gio", name = "IOModuleScope"}) IO () -- | Scans all the modules in the specified directory, ensuring that -- any extension point implemented by a module is registered. -- -- This may not actually load and initialize all the types in each -- module, some modules may be lazily loaded and initialized when -- an extension point it implements is used with e.g. -- 'GI.Gio.Structs.IOExtensionPoint.iOExtensionPointGetExtensions' or -- 'GI.Gio.Structs.IOExtensionPoint.iOExtensionPointGetExtensionByName'. -- -- If you need to guarantee that all types are loaded in all the modules, -- use @/g_io_modules_load_all_in_directory()/@. -- -- /Since: 2.30/ ioModulesScanAllInDirectoryWithScope :: (B.CallStack.HasCallStack, MonadIO m) => [Char] -- ^ /@dirname@/: pathname for a directory containing modules -- to scan. -> Gio.IOModuleScope.IOModuleScope -- ^ /@scope@/: a scope to use when scanning the modules -> m () ioModulesScanAllInDirectoryWithScope :: forall (m :: * -> *). (HasCallStack, MonadIO m) => [Char] -> IOModuleScope -> m () ioModulesScanAllInDirectoryWithScope [Char] dirname IOModuleScope scope = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString dirname' <- [Char] -> IO CString stringToCString [Char] dirname Ptr IOModuleScope scope' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr IOModuleScope scope CString -> Ptr IOModuleScope -> IO () g_io_modules_scan_all_in_directory_with_scope CString dirname' Ptr IOModuleScope scope' forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr IOModuleScope scope forall a. Ptr a -> IO () freeMem CString dirname' forall (m :: * -> *) a. Monad m => a -> m a return () -- function io_modules_scan_all_in_directory -- Args: [ Arg -- { argCName = "dirname" -- , argType = TBasicType TFileName -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "pathname for a directory containing modules\n to scan." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_io_modules_scan_all_in_directory" g_io_modules_scan_all_in_directory :: CString -> -- dirname : TBasicType TFileName IO () -- | Scans all the modules in the specified directory, ensuring that -- any extension point implemented by a module is registered. -- -- This may not actually load and initialize all the types in each -- module, some modules may be lazily loaded and initialized when -- an extension point it implements is used with e.g. -- 'GI.Gio.Structs.IOExtensionPoint.iOExtensionPointGetExtensions' or -- 'GI.Gio.Structs.IOExtensionPoint.iOExtensionPointGetExtensionByName'. -- -- If you need to guarantee that all types are loaded in all the modules, -- use @/g_io_modules_load_all_in_directory()/@. -- -- /Since: 2.24/ ioModulesScanAllInDirectory :: (B.CallStack.HasCallStack, MonadIO m) => [Char] -- ^ /@dirname@/: pathname for a directory containing modules -- to scan. -> m () ioModulesScanAllInDirectory :: forall (m :: * -> *). (HasCallStack, MonadIO m) => [Char] -> m () ioModulesScanAllInDirectory [Char] dirname = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString dirname' <- [Char] -> IO CString stringToCString [Char] dirname CString -> IO () g_io_modules_scan_all_in_directory CString dirname' forall a. Ptr a -> IO () freeMem CString dirname' forall (m :: * -> *) a. Monad m => a -> m a return () -- function io_error_quark -- Args: [] -- Lengths: [] -- returnType: Just (TBasicType TUInt32) -- throws : False -- Skip return : False foreign import ccall "g_io_error_quark" g_io_error_quark :: IO Word32 -- | Gets the GIO Error Quark. ioErrorQuark :: (B.CallStack.HasCallStack, MonadIO m) => m Word32 -- ^ __Returns:__ a @/GQuark/@. ioErrorQuark :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Word32 ioErrorQuark = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Word32 result <- IO Word32 g_io_error_quark forall (m :: * -> *) a. Monad m => a -> m a return Word32 result -- function io_error_from_file_error -- Args: [ Arg -- { argCName = "file_error" -- , argType = -- TInterface Name { namespace = "GLib" , name = "FileError" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GFileError." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "Gio" , name = "IOErrorEnum" }) -- throws : False -- Skip return : False foreign import ccall "g_io_error_from_file_error" g_io_error_from_file_error :: CUInt -> -- file_error : TInterface (Name {namespace = "GLib", name = "FileError"}) IO CUInt -- | Converts t'GI.GLib.Enums.FileError' error codes into GIO error codes. -- -- /Since: 2.74/ ioErrorFromFileError :: (B.CallStack.HasCallStack, MonadIO m) => GLib.Enums.FileError -- ^ /@fileError@/: a t'GI.GLib.Enums.FileError'. -> m Gio.Enums.IOErrorEnum -- ^ __Returns:__ t'GI.Gio.Enums.IOErrorEnum' value for the given t'GI.GLib.Enums.FileError' error value. ioErrorFromFileError :: forall (m :: * -> *). (HasCallStack, MonadIO m) => FileError -> m IOErrorEnum ioErrorFromFileError FileError fileError = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do let fileError' :: CUInt fileError' = (forall a b. (Integral a, Num b) => a -> b fromIntegral forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. Enum a => a -> Int fromEnum) FileError fileError CUInt result <- CUInt -> IO CUInt g_io_error_from_file_error CUInt fileError' let result' :: IOErrorEnum result' = (forall a. Enum a => Int -> a toEnum forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a b. (Integral a, Num b) => a -> b fromIntegral) CUInt result forall (m :: * -> *) a. Monad m => a -> m a return IOErrorEnum result' -- function io_error_from_errno -- Args: [ Arg -- { argCName = "err_no" -- , argType = TBasicType TInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "Error number as defined in errno.h." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "Gio" , name = "IOErrorEnum" }) -- throws : False -- Skip return : False foreign import ccall "g_io_error_from_errno" g_io_error_from_errno :: Int32 -> -- err_no : TBasicType TInt IO CUInt -- | Converts errno.h error codes into GIO error codes. The fallback -- value 'GI.Gio.Enums.IOErrorEnumFailed' is returned for error codes not currently -- handled (but note that future GLib releases may return a more -- specific value instead). -- -- As @/errno/@ is global and may be modified by intermediate function -- calls, you should save its value as soon as the call which sets it ioErrorFromErrno :: (B.CallStack.HasCallStack, MonadIO m) => Int32 -- ^ /@errNo@/: Error number as defined in errno.h. -> m Gio.Enums.IOErrorEnum -- ^ __Returns:__ t'GI.Gio.Enums.IOErrorEnum' value for the given errno.h error number. ioErrorFromErrno :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Int32 -> m IOErrorEnum ioErrorFromErrno Int32 errNo = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CUInt result <- Int32 -> IO CUInt g_io_error_from_errno Int32 errNo let result' :: IOErrorEnum result' = (forall a. Enum a => Int -> a toEnum forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a b. (Integral a, Num b) => a -> b fromIntegral) CUInt result forall (m :: * -> *) a. Monad m => a -> m a return IOErrorEnum result' -- function dbus_unescape_object_path -- Args: [ Arg -- { argCName = "s" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the string to unescape" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TCArray True (-1) (-1) (TBasicType TUInt8)) -- throws : False -- Skip return : False foreign import ccall "g_dbus_unescape_object_path" g_dbus_unescape_object_path :: CString -> -- s : TBasicType TUTF8 IO (Ptr Word8) -- | Unescapes an string that was previously escaped with -- 'GI.Gio.Functions.dbusEscapeObjectPath'. If the string is in a format that could -- not have been returned by 'GI.Gio.Functions.dbusEscapeObjectPath', this function -- returns 'P.Nothing'. -- -- Encoding alphanumeric characters which do not need to be -- encoded is not allowed (e.g @_63@ is not valid, the string -- should contain @c@ instead). -- -- /Since: 2.68/ dbusUnescapeObjectPath :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@s@/: the string to unescape -> m (Maybe ByteString) -- ^ __Returns:__ an -- unescaped version of /@s@/, or 'P.Nothing' if /@s@/ is not a string returned -- from 'GI.Gio.Functions.dbusEscapeObjectPath'. Free with 'GI.GLib.Functions.free'. dbusUnescapeObjectPath :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m (Maybe ByteString) dbusUnescapeObjectPath Text s = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString s' <- Text -> IO CString textToCString Text s Ptr Word8 result <- CString -> IO (Ptr Word8) g_dbus_unescape_object_path CString s' Maybe ByteString maybeResult <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b) convertIfNonNull Ptr Word8 result forall a b. (a -> b) -> a -> b $ \Ptr Word8 result' -> do ByteString result'' <- Ptr Word8 -> IO ByteString unpackZeroTerminatedByteString Ptr Word8 result' forall (m :: * -> *) a. Monad m => a -> m a return ByteString result'' forall a. Ptr a -> IO () freeMem CString s' forall (m :: * -> *) a. Monad m => a -> m a return Maybe ByteString maybeResult -- function dbus_is_unique_name -- Args: [ Arg -- { argCName = "string" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The string to check." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_dbus_is_unique_name" g_dbus_is_unique_name :: CString -> -- string : TBasicType TUTF8 IO CInt -- | Checks if /@string@/ is a valid D-Bus unique bus name. -- -- /Since: 2.26/ dbusIsUniqueName :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@string@/: The string to check. -> m Bool -- ^ __Returns:__ 'P.True' if valid, 'P.False' otherwise. dbusIsUniqueName :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m Bool dbusIsUniqueName Text string = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString string' <- Text -> IO CString textToCString Text string CInt result <- CString -> IO CInt g_dbus_is_unique_name CString string' let result' :: Bool result' = (forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result forall a. Ptr a -> IO () freeMem CString string' forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function dbus_is_supported_address -- Args: [ Arg -- { argCName = "string" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A string." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : True -- Skip return : False foreign import ccall "g_dbus_is_supported_address" g_dbus_is_supported_address :: CString -> -- string : TBasicType TUTF8 Ptr (Ptr GError) -> -- error IO CInt -- | Like 'GI.Gio.Functions.dbusIsAddress' but also checks if the library supports the -- transports in /@string@/ and that key\/value pairs for each transport -- are valid. See the specification of the -- <https://dbus.freedesktop.org/doc/dbus-specification.html#addresses D-Bus address format>. -- -- /Since: 2.26/ dbusIsSupportedAddress :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@string@/: A string. -> m () -- ^ /(Can throw 'Data.GI.Base.GError.GError')/ dbusIsSupportedAddress :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m () dbusIsSupportedAddress Text string = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString string' <- Text -> IO CString textToCString Text string forall a b. IO a -> IO b -> IO a onException (do CInt _ <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a propagateGError forall a b. (a -> b) -> a -> b $ CString -> Ptr (Ptr GError) -> IO CInt g_dbus_is_supported_address CString string' forall a. Ptr a -> IO () freeMem CString string' forall (m :: * -> *) a. Monad m => a -> m a return () ) (do forall a. Ptr a -> IO () freeMem CString string' ) -- function dbus_is_name -- Args: [ Arg -- { argCName = "string" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The string to check." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_dbus_is_name" g_dbus_is_name :: CString -> -- string : TBasicType TUTF8 IO CInt -- | Checks if /@string@/ is a valid D-Bus bus name (either unique or well-known). -- -- /Since: 2.26/ dbusIsName :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@string@/: The string to check. -> m Bool -- ^ __Returns:__ 'P.True' if valid, 'P.False' otherwise. dbusIsName :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m Bool dbusIsName Text string = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString string' <- Text -> IO CString textToCString Text string CInt result <- CString -> IO CInt g_dbus_is_name CString string' let result' :: Bool result' = (forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result forall a. Ptr a -> IO () freeMem CString string' forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function dbus_is_member_name -- Args: [ Arg -- { argCName = "string" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The string to check." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_dbus_is_member_name" g_dbus_is_member_name :: CString -> -- string : TBasicType TUTF8 IO CInt -- | Checks if /@string@/ is a valid D-Bus member (e.g. signal or method) name. -- -- /Since: 2.26/ dbusIsMemberName :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@string@/: The string to check. -> m Bool -- ^ __Returns:__ 'P.True' if valid, 'P.False' otherwise. dbusIsMemberName :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m Bool dbusIsMemberName Text string = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString string' <- Text -> IO CString textToCString Text string CInt result <- CString -> IO CInt g_dbus_is_member_name CString string' let result' :: Bool result' = (forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result forall a. Ptr a -> IO () freeMem CString string' forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function dbus_is_interface_name -- Args: [ Arg -- { argCName = "string" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The string to check." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_dbus_is_interface_name" g_dbus_is_interface_name :: CString -> -- string : TBasicType TUTF8 IO CInt -- | Checks if /@string@/ is a valid D-Bus interface name. -- -- /Since: 2.26/ dbusIsInterfaceName :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@string@/: The string to check. -> m Bool -- ^ __Returns:__ 'P.True' if valid, 'P.False' otherwise. dbusIsInterfaceName :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m Bool dbusIsInterfaceName Text string = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString string' <- Text -> IO CString textToCString Text string CInt result <- CString -> IO CInt g_dbus_is_interface_name CString string' let result' :: Bool result' = (forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result forall a. Ptr a -> IO () freeMem CString string' forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function dbus_is_guid -- Args: [ Arg -- { argCName = "string" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The string to check." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_dbus_is_guid" g_dbus_is_guid :: CString -> -- string : TBasicType TUTF8 IO CInt -- | Checks if /@string@/ is a D-Bus GUID. -- -- See the documentation for 'GI.Gio.Functions.dbusGenerateGuid' for more information about -- the format of a GUID. -- -- /Since: 2.26/ dbusIsGuid :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@string@/: The string to check. -> m Bool -- ^ __Returns:__ 'P.True' if /@string@/ is a GUID, 'P.False' otherwise. dbusIsGuid :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m Bool dbusIsGuid Text string = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString string' <- Text -> IO CString textToCString Text string CInt result <- CString -> IO CInt g_dbus_is_guid CString string' let result' :: Bool result' = (forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result forall a. Ptr a -> IO () freeMem CString string' forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function dbus_is_error_name -- Args: [ Arg -- { argCName = "string" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The string to check." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_dbus_is_error_name" g_dbus_is_error_name :: CString -> -- string : TBasicType TUTF8 IO CInt -- | Check whether /@string@/ is a valid D-Bus error name. -- -- This function returns the same result as 'GI.Gio.Functions.dbusIsInterfaceName', -- because D-Bus error names are defined to have exactly the -- same syntax as interface names. -- -- /Since: 2.70/ dbusIsErrorName :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@string@/: The string to check. -> m Bool -- ^ __Returns:__ 'P.True' if valid, 'P.False' otherwise. dbusIsErrorName :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m Bool dbusIsErrorName Text string = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString string' <- Text -> IO CString textToCString Text string CInt result <- CString -> IO CInt g_dbus_is_error_name CString string' let result' :: Bool result' = (forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result forall a. Ptr a -> IO () freeMem CString string' forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function dbus_is_address -- Args: [ Arg -- { argCName = "string" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A string." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_dbus_is_address" g_dbus_is_address :: CString -> -- string : TBasicType TUTF8 IO CInt -- | Checks if /@string@/ is a -- <https://dbus.freedesktop.org/doc/dbus-specification.html#addresses D-Bus address>. -- -- This doesn\'t check if /@string@/ is actually supported by t'GI.Gio.Objects.DBusServer.DBusServer' -- or t'GI.Gio.Objects.DBusConnection.DBusConnection' - use 'GI.Gio.Functions.dbusIsSupportedAddress' to do more -- checks. -- -- /Since: 2.26/ dbusIsAddress :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@string@/: A string. -> m Bool -- ^ __Returns:__ 'P.True' if /@string@/ is a valid D-Bus address, 'P.False' otherwise. dbusIsAddress :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m Bool dbusIsAddress Text string = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString string' <- Text -> IO CString textToCString Text string CInt result <- CString -> IO CInt g_dbus_is_address CString string' let result' :: Bool result' = (forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result forall a. Ptr a -> IO () freeMem CString string' forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function dbus_gvariant_to_gvalue -- Args: [ Arg -- { argCName = "value" -- , argType = TVariant -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A #GVariant." , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "out_gvalue" -- , argType = TGValue -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "Return location pointing to a zero-filled (uninitialized) #GValue." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = True -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_dbus_gvariant_to_gvalue" g_dbus_gvariant_to_gvalue :: Ptr GVariant -> -- value : TVariant Ptr GValue -> -- out_gvalue : TGValue IO () -- | Converts a t'GVariant' to a t'GI.GObject.Structs.Value.Value'. If /@value@/ is floating, it is consumed. -- -- The rules specified in the 'GI.Gio.Functions.dbusGvalueToGvariant' function are -- used - this function is essentially its reverse form. So, a t'GVariant' -- containing any basic or string array type will be converted to a t'GI.GObject.Structs.Value.Value' -- containing a basic value or string array. Any other t'GVariant' (handle, -- variant, tuple, dict entry) will be converted to a t'GI.GObject.Structs.Value.Value' containing that -- t'GVariant'. -- -- The conversion never fails - a valid t'GI.GObject.Structs.Value.Value' is always returned in -- /@outGvalue@/. -- -- /Since: 2.30/ dbusGvariantToGvalue :: (B.CallStack.HasCallStack, MonadIO m) => GVariant -- ^ /@value@/: A t'GVariant'. -> m (GValue) dbusGvariantToGvalue :: forall (m :: * -> *). (HasCallStack, MonadIO m) => GVariant -> m GValue dbusGvariantToGvalue GVariant value = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr GVariant value' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr GVariant value Ptr GValue outGvalue <- forall a. Int -> IO (Ptr a) SP.callocBytes Int 20 :: IO (Ptr GValue) Ptr GVariant -> Ptr GValue -> IO () g_dbus_gvariant_to_gvalue Ptr GVariant value' Ptr GValue outGvalue GValue outGvalue' <- Ptr GValue -> IO GValue B.GValue.wrapGValuePtr Ptr GValue outGvalue forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr GVariant value forall (m :: * -> *) a. Monad m => a -> m a return GValue outGvalue' -- function dbus_gvalue_to_gvariant -- Args: [ Arg -- { argCName = "gvalue" -- , argType = TGValue -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A #GValue to convert to a #GVariant" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "type" -- , argType = -- TInterface Name { namespace = "GLib" , name = "VariantType" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A #GVariantType" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just TVariant -- throws : False -- Skip return : False foreign import ccall "g_dbus_gvalue_to_gvariant" g_dbus_gvalue_to_gvariant :: Ptr GValue -> -- gvalue : TGValue Ptr GLib.VariantType.VariantType -> -- type : TInterface (Name {namespace = "GLib", name = "VariantType"}) IO (Ptr GVariant) -- | Converts a t'GI.GObject.Structs.Value.Value' to a t'GVariant' of the type indicated by the /@type@/ -- parameter. -- -- The conversion is using the following rules: -- -- * @G_TYPE_STRING@: \'s\', \'o\', \'g\' or \'ay\' -- * @G_TYPE_STRV@: \'as\', \'ao\' or \'aay\' -- * @G_TYPE_BOOLEAN@: \'b\' -- * @G_TYPE_UCHAR@: \'y\' -- * @G_TYPE_INT@: \'i\', \'n\' -- * @G_TYPE_UINT@: \'u\', \'q\' -- * @G_TYPE_INT64@: \'x\' -- * @G_TYPE_UINT64@: \'t\' -- * @G_TYPE_DOUBLE@: \'d\' -- * @G_TYPE_VARIANT@: Any t'GI.GLib.Structs.VariantType.VariantType' -- -- -- This can fail if e.g. /@gvalue@/ is of type @/G_TYPE_STRING/@ and /@type@/ -- is \'i\', i.e. @/G_VARIANT_TYPE_INT32/@. It will also fail for any t'GType' -- (including e.g. @/G_TYPE_OBJECT/@ and @/G_TYPE_BOXED/@ derived-types) not -- in the table above. -- -- Note that if /@gvalue@/ is of type @/G_TYPE_VARIANT/@ and its value is -- 'P.Nothing', the empty t'GVariant' instance (never 'P.Nothing') for /@type@/ is -- returned (e.g. 0 for scalar types, the empty string for string types, -- \'\/\' for object path types, the empty array for any array type and so on). -- -- See the 'GI.Gio.Functions.dbusGvariantToGvalue' function for how to convert a -- t'GVariant' to a t'GI.GObject.Structs.Value.Value'. -- -- /Since: 2.30/ dbusGvalueToGvariant :: (B.CallStack.HasCallStack, MonadIO m) => GValue -- ^ /@gvalue@/: A t'GI.GObject.Structs.Value.Value' to convert to a t'GVariant' -> GLib.VariantType.VariantType -- ^ /@type@/: A t'GI.GLib.Structs.VariantType.VariantType' -> m GVariant -- ^ __Returns:__ A t'GVariant' (never floating) of -- t'GI.GLib.Structs.VariantType.VariantType' /@type@/ holding the data from /@gvalue@/ or an empty t'GVariant' -- in case of failure. Free with 'GI.GLib.Structs.Variant.variantUnref'. dbusGvalueToGvariant :: forall (m :: * -> *). (HasCallStack, MonadIO m) => GValue -> VariantType -> m GVariant dbusGvalueToGvariant GValue gvalue VariantType type_ = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr GValue gvalue' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr GValue gvalue Ptr VariantType type_' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a) unsafeManagedPtrGetPtr VariantType type_ Ptr GVariant result <- Ptr GValue -> Ptr VariantType -> IO (Ptr GVariant) g_dbus_gvalue_to_gvariant Ptr GValue gvalue' Ptr VariantType type_' forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "dbusGvalueToGvariant" Ptr GVariant result GVariant result' <- Ptr GVariant -> IO GVariant B.GVariant.wrapGVariantPtr Ptr GVariant result forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr GValue gvalue forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr VariantType type_ forall (m :: * -> *) a. Monad m => a -> m a return GVariant result' -- function dbus_generate_guid -- Args: [] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "g_dbus_generate_guid" g_dbus_generate_guid :: IO CString -- | Generate a D-Bus GUID that can be used with -- e.g. 'GI.Gio.Objects.DBusConnection.dBusConnectionNew'. -- -- See the -- <https://dbus.freedesktop.org/doc/dbus-specification.html#uuids D-Bus specification> -- regarding what strings are valid D-Bus GUIDs. The specification refers to -- these as ‘UUIDs’ whereas GLib (for historical reasons) refers to them as -- ‘GUIDs’. The terms are interchangeable. -- -- Note that D-Bus GUIDs do not follow -- <https://datatracker.ietf.org/doc/html/rfc4122 RFC 4122>. -- -- /Since: 2.26/ dbusGenerateGuid :: (B.CallStack.HasCallStack, MonadIO m) => m T.Text -- ^ __Returns:__ A valid D-Bus GUID. Free with 'GI.GLib.Functions.free'. dbusGenerateGuid :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m Text dbusGenerateGuid = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString result <- IO CString g_dbus_generate_guid forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "dbusGenerateGuid" CString result Text result' <- HasCallStack => CString -> IO Text cstringToText CString result forall a. Ptr a -> IO () freeMem CString result forall (m :: * -> *) a. Monad m => a -> m a return Text result' -- function dbus_escape_object_path_bytestring -- Args: [ Arg -- { argCName = "bytes" -- , argType = TCArray True (-1) (-1) (TBasicType TUInt8) -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the string of bytes to escape" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "g_dbus_escape_object_path_bytestring" g_dbus_escape_object_path_bytestring :: Ptr Word8 -> -- bytes : TCArray True (-1) (-1) (TBasicType TUInt8) IO CString -- | Escapes /@bytes@/ for use in a D-Bus object path component. -- /@bytes@/ is an array of zero or more nonzero bytes in an -- unspecified encoding, followed by a single zero byte. -- -- The escaping method consists of replacing all non-alphanumeric -- characters (see @/g_ascii_isalnum()/@) with their hexadecimal value -- preceded by an underscore (@_@). For example: -- @foo.bar.baz@ will become @foo_2ebar_2ebaz@. -- -- This method is appropriate to use when the input is nearly -- a valid object path component but is not when your input -- is far from being a valid object path component. -- Other escaping algorithms are also valid to use with -- D-Bus object paths. -- -- This can be reversed with 'GI.Gio.Functions.dbusUnescapeObjectPath'. -- -- /Since: 2.68/ dbusEscapeObjectPathBytestring :: (B.CallStack.HasCallStack, MonadIO m) => ByteString -- ^ /@bytes@/: the string of bytes to escape -> m T.Text -- ^ __Returns:__ an escaped version of /@bytes@/. Free with 'GI.GLib.Functions.free'. dbusEscapeObjectPathBytestring :: forall (m :: * -> *). (HasCallStack, MonadIO m) => ByteString -> m Text dbusEscapeObjectPathBytestring ByteString bytes = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr Word8 bytes' <- ByteString -> IO (Ptr Word8) packZeroTerminatedByteString ByteString bytes CString result <- Ptr Word8 -> IO CString g_dbus_escape_object_path_bytestring Ptr Word8 bytes' forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "dbusEscapeObjectPathBytestring" CString result Text result' <- HasCallStack => CString -> IO Text cstringToText CString result forall a. Ptr a -> IO () freeMem CString result forall a. Ptr a -> IO () freeMem Ptr Word8 bytes' forall (m :: * -> *) a. Monad m => a -> m a return Text result' -- function dbus_escape_object_path -- Args: [ Arg -- { argCName = "s" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the string to escape" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "g_dbus_escape_object_path" g_dbus_escape_object_path :: CString -> -- s : TBasicType TUTF8 IO CString -- | This is a language binding friendly version of 'GI.Gio.Functions.dbusEscapeObjectPathBytestring'. -- -- /Since: 2.68/ dbusEscapeObjectPath :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@s@/: the string to escape -> m T.Text -- ^ __Returns:__ an escaped version of /@s@/. Free with 'GI.GLib.Functions.free'. dbusEscapeObjectPath :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m Text dbusEscapeObjectPath Text s = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString s' <- Text -> IO CString textToCString Text s CString result <- CString -> IO CString g_dbus_escape_object_path CString s' forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "dbusEscapeObjectPath" CString result Text result' <- HasCallStack => CString -> IO Text cstringToText CString result forall a. Ptr a -> IO () freeMem CString result forall a. Ptr a -> IO () freeMem CString s' forall (m :: * -> *) a. Monad m => a -> m a return Text result' -- function dbus_address_get_stream_sync -- Args: [ Arg -- { argCName = "address" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A valid D-Bus address." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "out_guid" -- , argType = TBasicType TUTF8 -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "%NULL or return location to store the GUID extracted from @address, if any." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- , Arg -- { argCName = "cancellable" -- , argType = -- TInterface Name { namespace = "Gio" , name = "Cancellable" } -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "A #GCancellable or %NULL." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "Gio" , name = "IOStream" }) -- throws : True -- Skip return : False foreign import ccall "g_dbus_address_get_stream_sync" g_dbus_address_get_stream_sync :: CString -> -- address : TBasicType TUTF8 Ptr CString -> -- out_guid : TBasicType TUTF8 Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) Ptr (Ptr GError) -> -- error IO (Ptr Gio.IOStream.IOStream) -- | Synchronously connects to an endpoint specified by /@address@/ and -- sets up the connection so it is in a state to run the client-side -- of the D-Bus authentication conversation. /@address@/ must be in the -- <https://dbus.freedesktop.org/doc/dbus-specification.html#addresses D-Bus address format>. -- -- A server is not required to set a GUID, so /@outGuid@/ may be set to 'P.Nothing' -- even on success. -- -- This is a synchronous failable function. See -- 'GI.Gio.Functions.dbusAddressGetStream' for the asynchronous version. -- -- /Since: 2.26/ dbusAddressGetStreamSync :: (B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) => T.Text -- ^ /@address@/: A valid D-Bus address. -> Maybe (a) -- ^ /@cancellable@/: A t'GI.Gio.Objects.Cancellable.Cancellable' or 'P.Nothing'. -> m ((Gio.IOStream.IOStream, Maybe T.Text)) -- ^ __Returns:__ A t'GI.Gio.Objects.IOStream.IOStream' or 'P.Nothing' if /@error@/ is set. /(Can throw 'Data.GI.Base.GError.GError')/ dbusAddressGetStreamSync :: forall (m :: * -> *) a. (HasCallStack, MonadIO m, IsCancellable a) => Text -> Maybe a -> m (IOStream, Maybe Text) dbusAddressGetStreamSync Text address Maybe a cancellable = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString address' <- Text -> IO CString textToCString Text address Ptr CString outGuid <- forall a. Storable a => IO (Ptr a) callocMem :: IO (Ptr CString) Ptr Cancellable maybeCancellable <- case Maybe a cancellable of Maybe a Nothing -> forall (m :: * -> *) a. Monad m => a -> m a return forall a. Ptr a nullPtr Just a jCancellable -> do Ptr Cancellable jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a jCancellable forall (m :: * -> *) a. Monad m => a -> m a return Ptr Cancellable jCancellable' forall a b. IO a -> IO b -> IO a onException (do Ptr IOStream result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a propagateGError forall a b. (a -> b) -> a -> b $ CString -> Ptr CString -> Ptr Cancellable -> Ptr (Ptr GError) -> IO (Ptr IOStream) g_dbus_address_get_stream_sync CString address' Ptr CString outGuid Ptr Cancellable maybeCancellable forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "dbusAddressGetStreamSync" Ptr IOStream result IOStream result' <- (forall a b. (HasCallStack, GObject a, GObject b) => (ManagedPtr a -> a) -> Ptr b -> IO a wrapObject ManagedPtr IOStream -> IOStream Gio.IOStream.IOStream) Ptr IOStream result CString outGuid' <- forall a. Storable a => Ptr a -> IO a peek Ptr CString outGuid Maybe Text maybeOutGuid' <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b) convertIfNonNull CString outGuid' forall a b. (a -> b) -> a -> b $ \CString outGuid'' -> do Text outGuid''' <- HasCallStack => CString -> IO Text cstringToText CString outGuid'' forall (m :: * -> *) a. Monad m => a -> m a return Text outGuid''' forall a. Ptr a -> IO () freeMem CString outGuid' forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe a cancellable forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr forall a. Ptr a -> IO () freeMem CString address' forall a. Ptr a -> IO () freeMem Ptr CString outGuid forall (m :: * -> *) a. Monad m => a -> m a return (IOStream result', Maybe Text maybeOutGuid') ) (do forall a. Ptr a -> IO () freeMem CString address' forall a. Ptr a -> IO () freeMem Ptr CString outGuid ) -- function dbus_address_get_stream_finish -- Args: [ Arg -- { argCName = "res" -- , argType = -- TInterface Name { namespace = "Gio" , name = "AsyncResult" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "A #GAsyncResult obtained from the GAsyncReadyCallback passed to g_dbus_address_get_stream()." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "out_guid" -- , argType = TBasicType TUTF8 -- , direction = DirectionOut -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "%NULL or return location to store the GUID extracted from @address, if any." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "Gio" , name = "IOStream" }) -- throws : True -- Skip return : False foreign import ccall "g_dbus_address_get_stream_finish" g_dbus_address_get_stream_finish :: Ptr Gio.AsyncResult.AsyncResult -> -- res : TInterface (Name {namespace = "Gio", name = "AsyncResult"}) Ptr CString -> -- out_guid : TBasicType TUTF8 Ptr (Ptr GError) -> -- error IO (Ptr Gio.IOStream.IOStream) -- | Finishes an operation started with 'GI.Gio.Functions.dbusAddressGetStream'. -- -- A server is not required to set a GUID, so /@outGuid@/ may be set to 'P.Nothing' -- even on success. -- -- /Since: 2.26/ dbusAddressGetStreamFinish :: (B.CallStack.HasCallStack, MonadIO m, Gio.AsyncResult.IsAsyncResult a) => a -- ^ /@res@/: A t'GI.Gio.Interfaces.AsyncResult.AsyncResult' obtained from the GAsyncReadyCallback passed to 'GI.Gio.Functions.dbusAddressGetStream'. -> m ((Gio.IOStream.IOStream, Maybe T.Text)) -- ^ __Returns:__ A t'GI.Gio.Objects.IOStream.IOStream' or 'P.Nothing' if /@error@/ is set. /(Can throw 'Data.GI.Base.GError.GError')/ dbusAddressGetStreamFinish :: forall (m :: * -> *) a. (HasCallStack, MonadIO m, IsAsyncResult a) => a -> m (IOStream, Maybe Text) dbusAddressGetStreamFinish a res = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr AsyncResult res' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a res Ptr CString outGuid <- forall a. Storable a => IO (Ptr a) callocMem :: IO (Ptr CString) forall a b. IO a -> IO b -> IO a onException (do Ptr IOStream result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a propagateGError forall a b. (a -> b) -> a -> b $ Ptr AsyncResult -> Ptr CString -> Ptr (Ptr GError) -> IO (Ptr IOStream) g_dbus_address_get_stream_finish Ptr AsyncResult res' Ptr CString outGuid forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "dbusAddressGetStreamFinish" Ptr IOStream result IOStream result' <- (forall a b. (HasCallStack, GObject a, GObject b) => (ManagedPtr a -> a) -> Ptr b -> IO a wrapObject ManagedPtr IOStream -> IOStream Gio.IOStream.IOStream) Ptr IOStream result CString outGuid' <- forall a. Storable a => Ptr a -> IO a peek Ptr CString outGuid Maybe Text maybeOutGuid' <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b) convertIfNonNull CString outGuid' forall a b. (a -> b) -> a -> b $ \CString outGuid'' -> do Text outGuid''' <- HasCallStack => CString -> IO Text cstringToText CString outGuid'' forall (m :: * -> *) a. Monad m => a -> m a return Text outGuid''' forall a. Ptr a -> IO () freeMem CString outGuid' forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a res forall a. Ptr a -> IO () freeMem Ptr CString outGuid forall (m :: * -> *) a. Monad m => a -> m a return (IOStream result', Maybe Text maybeOutGuid') ) (do forall a. Ptr a -> IO () freeMem Ptr CString outGuid ) -- function dbus_address_get_stream -- Args: [ Arg -- { argCName = "address" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A valid D-Bus address." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cancellable" -- , argType = -- TInterface Name { namespace = "Gio" , name = "Cancellable" } -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "A #GCancellable or %NULL." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "callback" -- , argType = -- TInterface Name { namespace = "Gio" , name = "AsyncReadyCallback" } -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "A #GAsyncReadyCallback to call when the request is satisfied." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeAsync -- , argClosure = 3 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "user_data" -- , argType = TBasicType TPtr -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "Data to pass to @callback." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_dbus_address_get_stream" g_dbus_address_get_stream :: CString -> -- address : TBasicType TUTF8 Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}) Ptr () -> -- user_data : TBasicType TPtr IO () -- | Asynchronously connects to an endpoint specified by /@address@/ and -- sets up the connection so it is in a state to run the client-side -- of the D-Bus authentication conversation. /@address@/ must be in the -- <https://dbus.freedesktop.org/doc/dbus-specification.html#addresses D-Bus address format>. -- -- When the operation is finished, /@callback@/ will be invoked. You can -- then call 'GI.Gio.Functions.dbusAddressGetStreamFinish' to get the result of -- the operation. -- -- This is an asynchronous failable function. See -- 'GI.Gio.Functions.dbusAddressGetStreamSync' for the synchronous version. -- -- /Since: 2.26/ dbusAddressGetStream :: (B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) => T.Text -- ^ /@address@/: A valid D-Bus address. -> Maybe (a) -- ^ /@cancellable@/: A t'GI.Gio.Objects.Cancellable.Cancellable' or 'P.Nothing'. -> Maybe (Gio.Callbacks.AsyncReadyCallback) -- ^ /@callback@/: A t'GI.Gio.Callbacks.AsyncReadyCallback' to call when the request is satisfied. -> m () dbusAddressGetStream :: forall (m :: * -> *) a. (HasCallStack, MonadIO m, IsCancellable a) => Text -> Maybe a -> Maybe AsyncReadyCallback -> m () dbusAddressGetStream Text address Maybe a cancellable Maybe AsyncReadyCallback callback = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString address' <- Text -> IO CString textToCString Text address Ptr Cancellable maybeCancellable <- case Maybe a cancellable of Maybe a Nothing -> forall (m :: * -> *) a. Monad m => a -> m a return forall a. Ptr a nullPtr Just a jCancellable -> do Ptr Cancellable jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a jCancellable forall (m :: * -> *) a. Monad m => a -> m a return Ptr Cancellable jCancellable' FunPtr C_AsyncReadyCallback maybeCallback <- case Maybe AsyncReadyCallback callback of Maybe AsyncReadyCallback Nothing -> forall (m :: * -> *) a. Monad m => a -> m a return (forall a b. Ptr a -> FunPtr b castPtrToFunPtr forall a. Ptr a nullPtr) Just AsyncReadyCallback jCallback -> do Ptr (FunPtr C_AsyncReadyCallback) ptrcallback <- 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 -> C_AsyncReadyCallback Gio.Callbacks.wrap_AsyncReadyCallback (forall a. a -> Maybe a Just Ptr (FunPtr C_AsyncReadyCallback) ptrcallback) AsyncReadyCallback jCallback) forall a. Storable a => Ptr a -> a -> IO () poke Ptr (FunPtr C_AsyncReadyCallback) ptrcallback FunPtr C_AsyncReadyCallback jCallback' forall (m :: * -> *) a. Monad m => a -> m a return FunPtr C_AsyncReadyCallback jCallback' let userData :: Ptr a userData = forall a. Ptr a nullPtr CString -> Ptr Cancellable -> FunPtr C_AsyncReadyCallback -> C_DestroyNotify g_dbus_address_get_stream CString address' Ptr Cancellable maybeCancellable FunPtr C_AsyncReadyCallback maybeCallback forall a. Ptr a userData forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe a cancellable forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr forall a. Ptr a -> IO () freeMem CString address' forall (m :: * -> *) a. Monad m => a -> m a return () -- function dbus_address_get_for_bus_sync -- Args: [ Arg -- { argCName = "bus_type" -- , argType = -- TInterface Name { namespace = "Gio" , name = "BusType" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GBusType" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cancellable" -- , argType = -- TInterface Name { namespace = "Gio" , name = "Cancellable" } -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "a #GCancellable or %NULL" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : True -- Skip return : False foreign import ccall "g_dbus_address_get_for_bus_sync" g_dbus_address_get_for_bus_sync :: CInt -> -- bus_type : TInterface (Name {namespace = "Gio", name = "BusType"}) Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) Ptr (Ptr GError) -> -- error IO CString -- | Synchronously looks up the D-Bus address for the well-known message -- bus instance specified by /@busType@/. This may involve using various -- platform specific mechanisms. -- -- The returned address will be in the -- <https://dbus.freedesktop.org/doc/dbus-specification.html#addresses D-Bus address format>. -- -- /Since: 2.26/ dbusAddressGetForBusSync :: (B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) => Gio.Enums.BusType -- ^ /@busType@/: a t'GI.Gio.Enums.BusType' -> Maybe (a) -- ^ /@cancellable@/: a t'GI.Gio.Objects.Cancellable.Cancellable' or 'P.Nothing' -> m T.Text -- ^ __Returns:__ a valid D-Bus address string for /@busType@/ or -- 'P.Nothing' if /@error@/ is set /(Can throw 'Data.GI.Base.GError.GError')/ dbusAddressGetForBusSync :: forall (m :: * -> *) a. (HasCallStack, MonadIO m, IsCancellable a) => BusType -> Maybe a -> m Text dbusAddressGetForBusSync BusType busType Maybe a cancellable = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do let busType' :: CInt busType' = (forall a b. (Integral a, Num b) => a -> b fromIntegral forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. Enum a => a -> Int fromEnum) BusType busType Ptr Cancellable maybeCancellable <- case Maybe a cancellable of Maybe a Nothing -> forall (m :: * -> *) a. Monad m => a -> m a return forall a. Ptr a nullPtr Just a jCancellable -> do Ptr Cancellable jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a jCancellable forall (m :: * -> *) a. Monad m => a -> m a return Ptr Cancellable jCancellable' forall a b. IO a -> IO b -> IO a onException (do CString result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a propagateGError forall a b. (a -> b) -> a -> b $ CInt -> Ptr Cancellable -> Ptr (Ptr GError) -> IO CString g_dbus_address_get_for_bus_sync CInt busType' Ptr Cancellable maybeCancellable forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "dbusAddressGetForBusSync" CString result Text result' <- HasCallStack => CString -> IO Text cstringToText CString result forall a. Ptr a -> IO () freeMem CString result forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe a cancellable forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr forall (m :: * -> *) a. Monad m => a -> m a return Text result' ) (do forall (m :: * -> *) a. Monad m => a -> m a return () ) -- function dbus_address_escape_value -- Args: [ Arg -- { argCName = "string" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "an unescaped string to be included in a D-Bus address\n as the value in a key-value pair" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "g_dbus_address_escape_value" g_dbus_address_escape_value :: CString -> -- string : TBasicType TUTF8 IO CString -- | Escape /@string@/ so it can appear in a D-Bus address as the value -- part of a key-value pair. -- -- For instance, if /@string@/ is @\/run\/bus-for-:0@, -- this function would return @\/run\/bus-for-%3A0@, -- which could be used in a D-Bus address like -- @unix:nonce-tcp:host=127.0.0.1,port=42,noncefile=\/run\/bus-for-%3A0@. -- -- /Since: 2.36/ dbusAddressEscapeValue :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@string@/: an unescaped string to be included in a D-Bus address -- as the value in a key-value pair -> m T.Text -- ^ __Returns:__ a copy of /@string@/ with all -- non-optionally-escaped bytes escaped dbusAddressEscapeValue :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m Text dbusAddressEscapeValue Text string = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString string' <- Text -> IO CString textToCString Text string CString result <- CString -> IO CString g_dbus_address_escape_value CString string' forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "dbusAddressEscapeValue" CString result Text result' <- HasCallStack => CString -> IO Text cstringToText CString result forall a. Ptr a -> IO () freeMem CString result forall a. Ptr a -> IO () freeMem CString string' forall (m :: * -> *) a. Monad m => a -> m a return Text result' -- function content_types_get_registered -- Args: [] -- Lengths: [] -- returnType: Just (TGList (TBasicType TUTF8)) -- throws : False -- Skip return : False foreign import ccall "g_content_types_get_registered" g_content_types_get_registered :: IO (Ptr (GList CString)) -- | Gets a list of strings containing all the registered content types -- known to the system. The list and its data should be freed using -- @g_list_free_full (list, g_free)@. contentTypesGetRegistered :: (B.CallStack.HasCallStack, MonadIO m) => m [T.Text] -- ^ __Returns:__ list of the registered -- content types contentTypesGetRegistered :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m [Text] contentTypesGetRegistered = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr (GList CString) result <- IO (Ptr (GList CString)) g_content_types_get_registered [CString] result' <- forall a. Ptr (GList (Ptr a)) -> IO [Ptr a] unpackGList Ptr (GList CString) result [Text] result'' <- forall (t :: * -> *) (m :: * -> *) a b. (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) mapM HasCallStack => CString -> IO Text cstringToText [CString] result' forall a b. (Ptr a -> IO b) -> Ptr (GList (Ptr a)) -> IO () mapGList forall a. Ptr a -> IO () freeMem Ptr (GList CString) result forall a. Ptr (GList a) -> IO () g_list_free Ptr (GList CString) result forall (m :: * -> *) a. Monad m => a -> m a return [Text] result'' -- function content_type_set_mime_dirs -- Args: [ Arg -- { argCName = "dirs" -- , argType = TCArray True (-1) (-1) (TBasicType TUTF8) -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "%NULL-terminated list of\n directories to load MIME data from, including any `mime/` subdirectory,\n and with the first directory to try listed first" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_content_type_set_mime_dirs" g_content_type_set_mime_dirs :: Ptr CString -> -- dirs : TCArray True (-1) (-1) (TBasicType TUTF8) IO () -- | Set the list of directories used by GIO to load the MIME database. -- If /@dirs@/ is 'P.Nothing', the directories used are the default: -- -- - the @mime@ subdirectory of the directory in @$XDG_DATA_HOME@ -- - the @mime@ subdirectory of every directory in @$XDG_DATA_DIRS@ -- -- This function is intended to be used when writing tests that depend on -- information stored in the MIME database, in order to control the data. -- -- Typically, in case your tests use 'GI.GLib.Constants.TEST_OPTION_ISOLATE_DIRS', but they -- depend on the system’s MIME database, you should call this function -- with /@dirs@/ set to 'P.Nothing' before calling @/g_test_init()/@, for instance: -- -- -- === /C code/ -- > -- > // Load MIME data from the system -- > g_content_type_set_mime_dirs (NULL); -- > // Isolate the environment -- > g_test_init (&argc, &argv, G_TEST_OPTION_ISOLATE_DIRS, NULL); -- > -- > … -- > -- > return g_test_run (); -- -- -- /Since: 2.60/ contentTypeSetMimeDirs :: (B.CallStack.HasCallStack, MonadIO m) => Maybe ([T.Text]) -- ^ /@dirs@/: 'P.Nothing'-terminated list of -- directories to load MIME data from, including any @mime\/@ subdirectory, -- and with the first directory to try listed first -> m () contentTypeSetMimeDirs :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Maybe [Text] -> m () contentTypeSetMimeDirs Maybe [Text] dirs = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr CString maybeDirs <- case Maybe [Text] dirs of Maybe [Text] Nothing -> forall (m :: * -> *) a. Monad m => a -> m a return forall a. Ptr a nullPtr Just [Text] jDirs -> do Ptr CString jDirs' <- [Text] -> IO (Ptr CString) packZeroTerminatedUTF8CArray [Text] jDirs forall (m :: * -> *) a. Monad m => a -> m a return Ptr CString jDirs' Ptr CString -> IO () g_content_type_set_mime_dirs Ptr CString maybeDirs forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO () mapZeroTerminatedCArray forall a. Ptr a -> IO () freeMem Ptr CString maybeDirs forall a. Ptr a -> IO () freeMem Ptr CString maybeDirs forall (m :: * -> *) a. Monad m => a -> m a return () -- function content_type_is_unknown -- Args: [ Arg -- { argCName = "type" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a content type string" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_content_type_is_unknown" g_content_type_is_unknown :: CString -> -- type : TBasicType TUTF8 IO CInt -- | Checks if the content type is the generic \"unknown\" type. -- On UNIX this is the \"application\/octet-stream\" mimetype, -- while on win32 it is \"*\" and on OSX it is a dynamic type -- or octet-stream. contentTypeIsUnknown :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@type@/: a content type string -> m Bool -- ^ __Returns:__ 'P.True' if the type is the unknown type. contentTypeIsUnknown :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m Bool contentTypeIsUnknown Text type_ = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString type_' <- Text -> IO CString textToCString Text type_ CInt result <- CString -> IO CInt g_content_type_is_unknown CString type_' let result' :: Bool result' = (forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result forall a. Ptr a -> IO () freeMem CString type_' forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function content_type_is_mime_type -- Args: [ Arg -- { argCName = "type" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a content type string" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "mime_type" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a mime type string" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_content_type_is_mime_type" g_content_type_is_mime_type :: CString -> -- type : TBasicType TUTF8 CString -> -- mime_type : TBasicType TUTF8 IO CInt -- | Determines if /@type@/ is a subset of /@mimeType@/. -- Convenience wrapper around 'GI.Gio.Functions.contentTypeIsA'. -- -- /Since: 2.52/ contentTypeIsMimeType :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@type@/: a content type string -> T.Text -- ^ /@mimeType@/: a mime type string -> m Bool -- ^ __Returns:__ 'P.True' if /@type@/ is a kind of /@mimeType@/, -- 'P.False' otherwise. contentTypeIsMimeType :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> Text -> m Bool contentTypeIsMimeType Text type_ Text mimeType = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString type_' <- Text -> IO CString textToCString Text type_ CString mimeType' <- Text -> IO CString textToCString Text mimeType CInt result <- CString -> CString -> IO CInt g_content_type_is_mime_type CString type_' CString mimeType' let result' :: Bool result' = (forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result forall a. Ptr a -> IO () freeMem CString type_' forall a. Ptr a -> IO () freeMem CString mimeType' forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function content_type_is_a -- Args: [ Arg -- { argCName = "type" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a content type string" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "supertype" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a content type string" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_content_type_is_a" g_content_type_is_a :: CString -> -- type : TBasicType TUTF8 CString -> -- supertype : TBasicType TUTF8 IO CInt -- | Determines if /@type@/ is a subset of /@supertype@/. contentTypeIsA :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@type@/: a content type string -> T.Text -- ^ /@supertype@/: a content type string -> m Bool -- ^ __Returns:__ 'P.True' if /@type@/ is a kind of /@supertype@/, -- 'P.False' otherwise. contentTypeIsA :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> Text -> m Bool contentTypeIsA Text type_ Text supertype = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString type_' <- Text -> IO CString textToCString Text type_ CString supertype' <- Text -> IO CString textToCString Text supertype CInt result <- CString -> CString -> IO CInt g_content_type_is_a CString type_' CString supertype' let result' :: Bool result' = (forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result forall a. Ptr a -> IO () freeMem CString type_' forall a. Ptr a -> IO () freeMem CString supertype' forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function content_type_guess_for_tree -- Args: [ Arg -- { argCName = "root" -- , argType = TInterface Name { namespace = "Gio" , name = "File" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the root of the tree to guess a type for" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TCArray True (-1) (-1) (TBasicType TUTF8)) -- throws : False -- Skip return : False foreign import ccall "g_content_type_guess_for_tree" g_content_type_guess_for_tree :: Ptr Gio.File.File -> -- root : TInterface (Name {namespace = "Gio", name = "File"}) IO (Ptr CString) -- | Tries to guess the type of the tree with root /@root@/, by -- looking at the files it contains. The result is an array -- of content types, with the best guess coming first. -- -- The types returned all have the form x-content\/foo, e.g. -- x-content\/audio-cdda (for audio CDs) or x-content\/image-dcf -- (for a camera memory card). See the -- <http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec shared-mime-info> -- specification for more on x-content types. -- -- This function is useful in the implementation of -- 'GI.Gio.Interfaces.Mount.mountGuessContentType'. -- -- /Since: 2.18/ contentTypeGuessForTree :: (B.CallStack.HasCallStack, MonadIO m, Gio.File.IsFile a) => a -- ^ /@root@/: the root of the tree to guess a type for -> m [T.Text] -- ^ __Returns:__ an 'P.Nothing'-terminated -- array of zero or more content types. Free with 'GI.GLib.Functions.strfreev' contentTypeGuessForTree :: forall (m :: * -> *) a. (HasCallStack, MonadIO m, IsFile a) => a -> m [Text] contentTypeGuessForTree a root = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr File root' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a root Ptr CString result <- Ptr File -> IO (Ptr CString) g_content_type_guess_for_tree Ptr File root' forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "contentTypeGuessForTree" Ptr CString result [Text] result' <- HasCallStack => Ptr CString -> IO [Text] unpackZeroTerminatedUTF8CArray Ptr CString result forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO () mapZeroTerminatedCArray forall a. Ptr a -> IO () freeMem Ptr CString result forall a. Ptr a -> IO () freeMem Ptr CString result forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a root forall (m :: * -> *) a. Monad m => a -> m a return [Text] result' -- function content_type_guess -- Args: [ Arg -- { argCName = "filename" -- , argType = TBasicType TFileName -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "a path, or %NULL" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "data" -- , argType = TCArray False (-1) 2 (TBasicType TUInt8) -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "a stream of data, or %NULL" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "data_size" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the size of @data" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "result_uncertain" -- , argType = TBasicType TBoolean -- , direction = DirectionOut -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "return location for the certainty\n of the result, or %NULL" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferEverything -- } -- ] -- Lengths: [ Arg -- { argCName = "data_size" -- , argType = TBasicType TUInt32 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the size of @data" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "g_content_type_guess" g_content_type_guess :: CString -> -- filename : TBasicType TFileName Ptr Word8 -> -- data : TCArray False (-1) 2 (TBasicType TUInt8) Word32 -> -- data_size : TBasicType TUInt32 Ptr CInt -> -- result_uncertain : TBasicType TBoolean IO CString -- | Guesses the content type based on example data. If the function is -- uncertain, /@resultUncertain@/ will be set to 'P.True'. Either /@filename@/ -- or /@data@/ may be 'P.Nothing', in which case the guess will be based solely -- on the other argument. contentTypeGuess :: (B.CallStack.HasCallStack, MonadIO m) => Maybe ([Char]) -- ^ /@filename@/: a path, or 'P.Nothing' -> Maybe (ByteString) -- ^ /@data@/: a stream of data, or 'P.Nothing' -> m ((T.Text, Bool)) -- ^ __Returns:__ a string indicating a guessed content type for the -- given data. Free with 'GI.GLib.Functions.free' contentTypeGuess :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Maybe [Char] -> Maybe ByteString -> m (Text, Bool) contentTypeGuess Maybe [Char] filename Maybe ByteString data_ = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do let dataSize :: Word32 dataSize = case Maybe ByteString data_ of Maybe ByteString Nothing -> Word32 0 Just ByteString jData_ -> forall a b. (Integral a, Num b) => a -> b fromIntegral forall a b. (a -> b) -> a -> b $ ByteString -> Int B.length ByteString jData_ CString maybeFilename <- case Maybe [Char] filename of Maybe [Char] Nothing -> forall (m :: * -> *) a. Monad m => a -> m a return forall a. Ptr a nullPtr Just [Char] jFilename -> do CString jFilename' <- [Char] -> IO CString stringToCString [Char] jFilename forall (m :: * -> *) a. Monad m => a -> m a return CString jFilename' Ptr Word8 maybeData_ <- case Maybe ByteString data_ of Maybe ByteString Nothing -> forall (m :: * -> *) a. Monad m => a -> m a return forall a. Ptr a nullPtr Just ByteString jData_ -> do Ptr Word8 jData_' <- ByteString -> IO (Ptr Word8) packByteString ByteString jData_ forall (m :: * -> *) a. Monad m => a -> m a return Ptr Word8 jData_' Ptr CInt resultUncertain <- forall a. Storable a => IO (Ptr a) allocMem :: IO (Ptr CInt) CString result <- CString -> Ptr Word8 -> Word32 -> Ptr CInt -> IO CString g_content_type_guess CString maybeFilename Ptr Word8 maybeData_ Word32 dataSize Ptr CInt resultUncertain forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "contentTypeGuess" CString result Text result' <- HasCallStack => CString -> IO Text cstringToText CString result forall a. Ptr a -> IO () freeMem CString result CInt resultUncertain' <- forall a. Storable a => Ptr a -> IO a peek Ptr CInt resultUncertain let resultUncertain'' :: Bool resultUncertain'' = (forall a. Eq a => a -> a -> Bool /= CInt 0) CInt resultUncertain' forall a. Ptr a -> IO () freeMem CString maybeFilename forall a. Ptr a -> IO () freeMem Ptr Word8 maybeData_ forall a. Ptr a -> IO () freeMem Ptr CInt resultUncertain forall (m :: * -> *) a. Monad m => a -> m a return (Text result', Bool resultUncertain'') -- function content_type_get_symbolic_icon -- Args: [ Arg -- { argCName = "type" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a content type string" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "Gio" , name = "Icon" }) -- throws : False -- Skip return : False foreign import ccall "g_content_type_get_symbolic_icon" g_content_type_get_symbolic_icon :: CString -> -- type : TBasicType TUTF8 IO (Ptr Gio.Icon.Icon) -- | Gets the symbolic icon for a content type. -- -- /Since: 2.34/ contentTypeGetSymbolicIcon :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@type@/: a content type string -> m Gio.Icon.Icon -- ^ __Returns:__ symbolic t'GI.Gio.Interfaces.Icon.Icon' corresponding to the content type. -- Free the returned object with 'GI.GObject.Objects.Object.objectUnref' contentTypeGetSymbolicIcon :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m Icon contentTypeGetSymbolicIcon Text type_ = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString type_' <- Text -> IO CString textToCString Text type_ Ptr Icon result <- CString -> IO (Ptr Icon) g_content_type_get_symbolic_icon CString type_' forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "contentTypeGetSymbolicIcon" Ptr Icon result Icon result' <- (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 forall a. Ptr a -> IO () freeMem CString type_' forall (m :: * -> *) a. Monad m => a -> m a return Icon result' -- function content_type_get_mime_type -- Args: [ Arg -- { argCName = "type" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a content type string" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "g_content_type_get_mime_type" g_content_type_get_mime_type :: CString -> -- type : TBasicType TUTF8 IO CString -- | Gets the mime type for the content type, if one is registered. contentTypeGetMimeType :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@type@/: a content type string -> m (Maybe T.Text) -- ^ __Returns:__ the registered mime type for the -- given /@type@/, or 'P.Nothing' if unknown; free with 'GI.GLib.Functions.free'. contentTypeGetMimeType :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m (Maybe Text) contentTypeGetMimeType Text type_ = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString type_' <- Text -> IO CString textToCString Text type_ CString result <- CString -> IO CString g_content_type_get_mime_type CString type_' Maybe Text maybeResult <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b) convertIfNonNull CString result forall a b. (a -> b) -> a -> b $ \CString result' -> do Text result'' <- HasCallStack => CString -> IO Text cstringToText CString result' forall a. Ptr a -> IO () freeMem CString result' forall (m :: * -> *) a. Monad m => a -> m a return Text result'' forall a. Ptr a -> IO () freeMem CString type_' forall (m :: * -> *) a. Monad m => a -> m a return Maybe Text maybeResult -- function content_type_get_mime_dirs -- Args: [] -- Lengths: [] -- returnType: Just (TCArray True (-1) (-1) (TBasicType TUTF8)) -- throws : False -- Skip return : False foreign import ccall "g_content_type_get_mime_dirs" g_content_type_get_mime_dirs :: IO (Ptr CString) -- | Get the list of directories which MIME data is loaded from. See -- 'GI.Gio.Functions.contentTypeSetMimeDirs' for details. -- -- /Since: 2.60/ contentTypeGetMimeDirs :: (B.CallStack.HasCallStack, MonadIO m) => m [T.Text] -- ^ __Returns:__ 'P.Nothing'-terminated list of -- directories to load MIME data from, including any @mime\/@ subdirectory, -- and with the first directory to try listed first contentTypeGetMimeDirs :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m [Text] contentTypeGetMimeDirs = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr CString result <- IO (Ptr CString) g_content_type_get_mime_dirs forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "contentTypeGetMimeDirs" Ptr CString result [Text] result' <- HasCallStack => Ptr CString -> IO [Text] unpackZeroTerminatedUTF8CArray Ptr CString result forall (m :: * -> *) a. Monad m => a -> m a return [Text] result' -- function content_type_get_icon -- Args: [ Arg -- { argCName = "type" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a content type string" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TInterface Name { namespace = "Gio" , name = "Icon" }) -- throws : False -- Skip return : False foreign import ccall "g_content_type_get_icon" g_content_type_get_icon :: CString -> -- type : TBasicType TUTF8 IO (Ptr Gio.Icon.Icon) -- | Gets the icon for a content type. contentTypeGetIcon :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@type@/: a content type string -> m Gio.Icon.Icon -- ^ __Returns:__ t'GI.Gio.Interfaces.Icon.Icon' corresponding to the content type. Free the returned -- object with 'GI.GObject.Objects.Object.objectUnref' contentTypeGetIcon :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m Icon contentTypeGetIcon Text type_ = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString type_' <- Text -> IO CString textToCString Text type_ Ptr Icon result <- CString -> IO (Ptr Icon) g_content_type_get_icon CString type_' forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "contentTypeGetIcon" Ptr Icon result Icon result' <- (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 forall a. Ptr a -> IO () freeMem CString type_' forall (m :: * -> *) a. Monad m => a -> m a return Icon result' -- function content_type_get_generic_icon_name -- Args: [ Arg -- { argCName = "type" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a content type string" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "g_content_type_get_generic_icon_name" g_content_type_get_generic_icon_name :: CString -> -- type : TBasicType TUTF8 IO CString -- | Gets the generic icon name for a content type. -- -- See the -- <http://www.freedesktop.org/wiki/Specifications/shared-mime-info-spec shared-mime-info> -- specification for more on the generic icon name. -- -- /Since: 2.34/ contentTypeGetGenericIconName :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@type@/: a content type string -> m (Maybe T.Text) -- ^ __Returns:__ the registered generic icon name for the given /@type@/, -- or 'P.Nothing' if unknown. Free with 'GI.GLib.Functions.free' contentTypeGetGenericIconName :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m (Maybe Text) contentTypeGetGenericIconName Text type_ = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString type_' <- Text -> IO CString textToCString Text type_ CString result <- CString -> IO CString g_content_type_get_generic_icon_name CString type_' Maybe Text maybeResult <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b) convertIfNonNull CString result forall a b. (a -> b) -> a -> b $ \CString result' -> do Text result'' <- HasCallStack => CString -> IO Text cstringToText CString result' forall a. Ptr a -> IO () freeMem CString result' forall (m :: * -> *) a. Monad m => a -> m a return Text result'' forall a. Ptr a -> IO () freeMem CString type_' forall (m :: * -> *) a. Monad m => a -> m a return Maybe Text maybeResult -- function content_type_get_description -- Args: [ Arg -- { argCName = "type" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a content type string" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "g_content_type_get_description" g_content_type_get_description :: CString -> -- type : TBasicType TUTF8 IO CString -- | Gets the human readable description of the content type. contentTypeGetDescription :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@type@/: a content type string -> m T.Text -- ^ __Returns:__ a short description of the content type /@type@/. Free the -- returned string with 'GI.GLib.Functions.free' contentTypeGetDescription :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m Text contentTypeGetDescription Text type_ = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString type_' <- Text -> IO CString textToCString Text type_ CString result <- CString -> IO CString g_content_type_get_description CString type_' forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "contentTypeGetDescription" CString result Text result' <- HasCallStack => CString -> IO Text cstringToText CString result forall a. Ptr a -> IO () freeMem CString result forall a. Ptr a -> IO () freeMem CString type_' forall (m :: * -> *) a. Monad m => a -> m a return Text result' -- function content_type_from_mime_type -- Args: [ Arg -- { argCName = "mime_type" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a mime type string" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "g_content_type_from_mime_type" g_content_type_from_mime_type :: CString -> -- mime_type : TBasicType TUTF8 IO CString -- | Tries to find a content type based on the mime type name. -- -- /Since: 2.18/ contentTypeFromMimeType :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@mimeType@/: a mime type string -> m (Maybe T.Text) -- ^ __Returns:__ Newly allocated string with content type or -- 'P.Nothing'. Free with 'GI.GLib.Functions.free' contentTypeFromMimeType :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m (Maybe Text) contentTypeFromMimeType Text mimeType = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString mimeType' <- Text -> IO CString textToCString Text mimeType CString result <- CString -> IO CString g_content_type_from_mime_type CString mimeType' Maybe Text maybeResult <- forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b) convertIfNonNull CString result forall a b. (a -> b) -> a -> b $ \CString result' -> do Text result'' <- HasCallStack => CString -> IO Text cstringToText CString result' forall a. Ptr a -> IO () freeMem CString result' forall (m :: * -> *) a. Monad m => a -> m a return Text result'' forall a. Ptr a -> IO () freeMem CString mimeType' forall (m :: * -> *) a. Monad m => a -> m a return Maybe Text maybeResult -- function content_type_equals -- Args: [ Arg -- { argCName = "type1" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a content type string" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "type2" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a content type string" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_content_type_equals" g_content_type_equals :: CString -> -- type1 : TBasicType TUTF8 CString -> -- type2 : TBasicType TUTF8 IO CInt -- | Compares two content types for equality. contentTypeEquals :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@type1@/: a content type string -> T.Text -- ^ /@type2@/: a content type string -> m Bool -- ^ __Returns:__ 'P.True' if the two strings are identical or equivalent, -- 'P.False' otherwise. contentTypeEquals :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> Text -> m Bool contentTypeEquals Text type1 Text type2 = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString type1' <- Text -> IO CString textToCString Text type1 CString type2' <- Text -> IO CString textToCString Text type2 CInt result <- CString -> CString -> IO CInt g_content_type_equals CString type1' CString type2' let result' :: Bool result' = (forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result forall a. Ptr a -> IO () freeMem CString type1' forall a. Ptr a -> IO () freeMem CString type2' forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function content_type_can_be_executable -- Args: [ Arg -- { argCName = "type" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a content type string" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_content_type_can_be_executable" g_content_type_can_be_executable :: CString -> -- type : TBasicType TUTF8 IO CInt -- | Checks if a content type can be executable. Note that for instance -- things like text files can be executables (i.e. scripts and batch files). contentTypeCanBeExecutable :: (B.CallStack.HasCallStack, MonadIO m) => T.Text -- ^ /@type@/: a content type string -> m Bool -- ^ __Returns:__ 'P.True' if the file type corresponds to a type that -- can be executable, 'P.False' otherwise. contentTypeCanBeExecutable :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m Bool contentTypeCanBeExecutable Text type_ = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do CString type_' <- Text -> IO CString textToCString Text type_ CInt result <- CString -> IO CInt g_content_type_can_be_executable CString type_' let result' :: Bool result' = (forall a. Eq a => a -> a -> Bool /= CInt 0) CInt result forall a. Ptr a -> IO () freeMem CString type_' forall (m :: * -> *) a. Monad m => a -> m a return Bool result' -- function bus_watch_name_on_connection -- Args: [ Arg -- { argCName = "connection" -- , argType = -- TInterface Name { namespace = "Gio" , name = "DBusConnection" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "A #GDBusConnection." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "name" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The name (well-known or unique) to watch." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "flags" -- , argType = -- TInterface -- Name { namespace = "Gio" , name = "BusNameWatcherFlags" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "Flags from the #GBusNameWatcherFlags enumeration." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "name_appeared_closure" -- , argType = TGClosure Nothing -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just "#GClosure to invoke when @name is known\nto exist or %NULL." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "name_vanished_closure" -- , argType = TGClosure Nothing -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "#GClosure to invoke when @name is known\nto not exist or %NULL." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "g_bus_watch_name_on_connection_with_closures" g_bus_watch_name_on_connection_with_closures :: Ptr Gio.DBusConnection.DBusConnection -> -- connection : TInterface (Name {namespace = "Gio", name = "DBusConnection"}) CString -> -- name : TBasicType TUTF8 CUInt -> -- flags : TInterface (Name {namespace = "Gio", name = "BusNameWatcherFlags"}) Ptr (GClosure ()) -> -- name_appeared_closure : TGClosure Nothing Ptr (GClosure ()) -> -- name_vanished_closure : TGClosure Nothing IO Word32 -- | Version of @/g_bus_watch_name_on_connection()/@ using closures instead of callbacks for -- easier binding in other languages. -- -- /Since: 2.26/ busWatchNameOnConnection :: (B.CallStack.HasCallStack, MonadIO m, Gio.DBusConnection.IsDBusConnection a) => a -- ^ /@connection@/: A t'GI.Gio.Objects.DBusConnection.DBusConnection'. -> T.Text -- ^ /@name@/: The name (well-known or unique) to watch. -> [Gio.Flags.BusNameWatcherFlags] -- ^ /@flags@/: Flags from the t'GI.Gio.Flags.BusNameWatcherFlags' enumeration. -> Maybe (GClosure b) -- ^ /@nameAppearedClosure@/: t'GI.GObject.Structs.Closure.Closure' to invoke when /@name@/ is known -- to exist or 'P.Nothing'. -> Maybe (GClosure c) -- ^ /@nameVanishedClosure@/: t'GI.GObject.Structs.Closure.Closure' to invoke when /@name@/ is known -- to not exist or 'P.Nothing'. -> m Word32 -- ^ __Returns:__ An identifier (never 0) that can be used with -- 'GI.Gio.Functions.busUnwatchName' to stop watching the name. busWatchNameOnConnection :: forall (m :: * -> *) a b c. (HasCallStack, MonadIO m, IsDBusConnection a) => a -> Text -> [BusNameWatcherFlags] -> Maybe (GClosure b) -> Maybe (GClosure c) -> m Word32 busWatchNameOnConnection a connection Text name [BusNameWatcherFlags] flags Maybe (GClosure b) nameAppearedClosure Maybe (GClosure c) nameVanishedClosure = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr DBusConnection connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a connection CString name' <- Text -> IO CString textToCString Text name let flags' :: CUInt flags' = forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [BusNameWatcherFlags] flags Ptr (GClosure ()) maybeNameAppearedClosure <- case Maybe (GClosure b) nameAppearedClosure of Maybe (GClosure b) Nothing -> forall (m :: * -> *) a. Monad m => a -> m a return forall a. Ptr a nullPtr Just GClosure b jNameAppearedClosure -> do Ptr (GClosure ()) jNameAppearedClosure' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr GClosure b jNameAppearedClosure forall (m :: * -> *) a. Monad m => a -> m a return Ptr (GClosure ()) jNameAppearedClosure' Ptr (GClosure ()) maybeNameVanishedClosure <- case Maybe (GClosure c) nameVanishedClosure of Maybe (GClosure c) Nothing -> forall (m :: * -> *) a. Monad m => a -> m a return forall a. Ptr a nullPtr Just GClosure c jNameVanishedClosure -> do Ptr (GClosure ()) jNameVanishedClosure' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr GClosure c jNameVanishedClosure forall (m :: * -> *) a. Monad m => a -> m a return Ptr (GClosure ()) jNameVanishedClosure' Word32 result <- Ptr DBusConnection -> CString -> CUInt -> Ptr (GClosure ()) -> Ptr (GClosure ()) -> IO Word32 g_bus_watch_name_on_connection_with_closures Ptr DBusConnection connection' CString name' CUInt flags' Ptr (GClosure ()) maybeNameAppearedClosure Ptr (GClosure ()) maybeNameVanishedClosure forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a connection forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe (GClosure b) nameAppearedClosure forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe (GClosure c) nameVanishedClosure forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr forall a. Ptr a -> IO () freeMem CString name' forall (m :: * -> *) a. Monad m => a -> m a return Word32 result -- function bus_watch_name -- Args: [ Arg -- { argCName = "bus_type" -- , argType = -- TInterface Name { namespace = "Gio" , name = "BusType" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The type of bus to watch a name on." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "name" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "The name (well-known or unique) to watch." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "flags" -- , argType = -- TInterface -- Name { namespace = "Gio" , name = "BusNameWatcherFlags" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "Flags from the #GBusNameWatcherFlags enumeration." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "name_appeared_closure" -- , argType = TGClosure Nothing -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just "#GClosure to invoke when @name is known\nto exist or %NULL." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "name_vanished_closure" -- , argType = TGClosure Nothing -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "#GClosure to invoke when @name is known\nto not exist or %NULL." -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "g_bus_watch_name_with_closures" g_bus_watch_name_with_closures :: CInt -> -- bus_type : TInterface (Name {namespace = "Gio", name = "BusType"}) CString -> -- name : TBasicType TUTF8 CUInt -> -- flags : TInterface (Name {namespace = "Gio", name = "BusNameWatcherFlags"}) Ptr (GClosure ()) -> -- name_appeared_closure : TGClosure Nothing Ptr (GClosure ()) -> -- name_vanished_closure : TGClosure Nothing IO Word32 -- | Version of @/g_bus_watch_name()/@ using closures instead of callbacks for -- easier binding in other languages. -- -- /Since: 2.26/ busWatchName :: (B.CallStack.HasCallStack, MonadIO m) => Gio.Enums.BusType -- ^ /@busType@/: The type of bus to watch a name on. -> T.Text -- ^ /@name@/: The name (well-known or unique) to watch. -> [Gio.Flags.BusNameWatcherFlags] -- ^ /@flags@/: Flags from the t'GI.Gio.Flags.BusNameWatcherFlags' enumeration. -> Maybe (GClosure a) -- ^ /@nameAppearedClosure@/: t'GI.GObject.Structs.Closure.Closure' to invoke when /@name@/ is known -- to exist or 'P.Nothing'. -> Maybe (GClosure b) -- ^ /@nameVanishedClosure@/: t'GI.GObject.Structs.Closure.Closure' to invoke when /@name@/ is known -- to not exist or 'P.Nothing'. -> m Word32 -- ^ __Returns:__ An identifier (never 0) that can be used with -- 'GI.Gio.Functions.busUnwatchName' to stop watching the name. busWatchName :: forall (m :: * -> *) a b. (HasCallStack, MonadIO m) => BusType -> Text -> [BusNameWatcherFlags] -> Maybe (GClosure a) -> Maybe (GClosure b) -> m Word32 busWatchName BusType busType Text name [BusNameWatcherFlags] flags Maybe (GClosure a) nameAppearedClosure Maybe (GClosure b) nameVanishedClosure = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do let busType' :: CInt busType' = (forall a b. (Integral a, Num b) => a -> b fromIntegral forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. Enum a => a -> Int fromEnum) BusType busType CString name' <- Text -> IO CString textToCString Text name let flags' :: CUInt flags' = forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [BusNameWatcherFlags] flags Ptr (GClosure ()) maybeNameAppearedClosure <- case Maybe (GClosure a) nameAppearedClosure of Maybe (GClosure a) Nothing -> forall (m :: * -> *) a. Monad m => a -> m a return forall a. Ptr a nullPtr Just GClosure a jNameAppearedClosure -> do Ptr (GClosure ()) jNameAppearedClosure' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr GClosure a jNameAppearedClosure forall (m :: * -> *) a. Monad m => a -> m a return Ptr (GClosure ()) jNameAppearedClosure' Ptr (GClosure ()) maybeNameVanishedClosure <- case Maybe (GClosure b) nameVanishedClosure of Maybe (GClosure b) Nothing -> forall (m :: * -> *) a. Monad m => a -> m a return forall a. Ptr a nullPtr Just GClosure b jNameVanishedClosure -> do Ptr (GClosure ()) jNameVanishedClosure' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr GClosure b jNameVanishedClosure forall (m :: * -> *) a. Monad m => a -> m a return Ptr (GClosure ()) jNameVanishedClosure' Word32 result <- CInt -> CString -> CUInt -> Ptr (GClosure ()) -> Ptr (GClosure ()) -> IO Word32 g_bus_watch_name_with_closures CInt busType' CString name' CUInt flags' Ptr (GClosure ()) maybeNameAppearedClosure Ptr (GClosure ()) maybeNameVanishedClosure forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe (GClosure a) nameAppearedClosure forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe (GClosure b) nameVanishedClosure forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr forall a. Ptr a -> IO () freeMem CString name' forall (m :: * -> *) a. Monad m => a -> m a return Word32 result -- function bus_unwatch_name -- Args: [ Arg -- { argCName = "watcher_id" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "An identifier obtained from g_bus_watch_name()" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_bus_unwatch_name" g_bus_unwatch_name :: Word32 -> -- watcher_id : TBasicType TUInt IO () -- | Stops watching a name. -- -- Note that there may still be D-Bus traffic to process (relating to watching -- and unwatching the name) in the current thread-default t'GI.GLib.Structs.MainContext.MainContext' after -- this function has returned. You should continue to iterate the t'GI.GLib.Structs.MainContext.MainContext' -- until the t'GI.GLib.Callbacks.DestroyNotify' function passed to @/g_bus_watch_name()/@ is called, in -- order to avoid memory leaks through callbacks queued on the t'GI.GLib.Structs.MainContext.MainContext' -- after it’s stopped being iterated. -- -- /Since: 2.26/ busUnwatchName :: (B.CallStack.HasCallStack, MonadIO m) => Word32 -- ^ /@watcherId@/: An identifier obtained from @/g_bus_watch_name()/@ -> m () busUnwatchName :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Word32 -> m () busUnwatchName Word32 watcherId = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Word32 -> IO () g_bus_unwatch_name Word32 watcherId forall (m :: * -> *) a. Monad m => a -> m a return () -- function bus_unown_name -- Args: [ Arg -- { argCName = "owner_id" -- , argType = TBasicType TUInt -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "an identifier obtained from g_bus_own_name()" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_bus_unown_name" g_bus_unown_name :: Word32 -> -- owner_id : TBasicType TUInt IO () -- | Stops owning a name. -- -- Note that there may still be D-Bus traffic to process (relating to owning -- and unowning the name) in the current thread-default t'GI.GLib.Structs.MainContext.MainContext' after -- this function has returned. You should continue to iterate the t'GI.GLib.Structs.MainContext.MainContext' -- until the t'GI.GLib.Callbacks.DestroyNotify' function passed to @/g_bus_own_name()/@ is called, in -- order to avoid memory leaks through callbacks queued on the t'GI.GLib.Structs.MainContext.MainContext' -- after it’s stopped being iterated. -- -- /Since: 2.26/ busUnownName :: (B.CallStack.HasCallStack, MonadIO m) => Word32 -- ^ /@ownerId@/: an identifier obtained from @/g_bus_own_name()/@ -> m () busUnownName :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Word32 -> m () busUnownName Word32 ownerId = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Word32 -> IO () g_bus_unown_name Word32 ownerId forall (m :: * -> *) a. Monad m => a -> m a return () -- function bus_own_name_on_connection -- Args: [ Arg -- { argCName = "connection" -- , argType = -- TInterface Name { namespace = "Gio" , name = "DBusConnection" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GDBusConnection" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "name" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the well-known name to own" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "flags" -- , argType = -- TInterface Name { namespace = "Gio" , name = "BusNameOwnerFlags" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "a set of flags from the #GBusNameOwnerFlags enumeration" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "name_acquired_closure" -- , argType = TGClosure Nothing -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just "#GClosure to invoke when @name is\n acquired or %NULL" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "name_lost_closure" -- , argType = TGClosure Nothing -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just "#GClosure to invoke when @name is lost\n or %NULL" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "g_bus_own_name_on_connection_with_closures" g_bus_own_name_on_connection_with_closures :: Ptr Gio.DBusConnection.DBusConnection -> -- connection : TInterface (Name {namespace = "Gio", name = "DBusConnection"}) CString -> -- name : TBasicType TUTF8 CUInt -> -- flags : TInterface (Name {namespace = "Gio", name = "BusNameOwnerFlags"}) Ptr (GClosure ()) -> -- name_acquired_closure : TGClosure Nothing Ptr (GClosure ()) -> -- name_lost_closure : TGClosure Nothing IO Word32 -- | Version of @/g_bus_own_name_on_connection()/@ using closures instead of -- callbacks for easier binding in other languages. -- -- /Since: 2.26/ busOwnNameOnConnection :: (B.CallStack.HasCallStack, MonadIO m, Gio.DBusConnection.IsDBusConnection a) => a -- ^ /@connection@/: a t'GI.Gio.Objects.DBusConnection.DBusConnection' -> T.Text -- ^ /@name@/: the well-known name to own -> [Gio.Flags.BusNameOwnerFlags] -- ^ /@flags@/: a set of flags from the t'GI.Gio.Flags.BusNameOwnerFlags' enumeration -> Maybe (GClosure b) -- ^ /@nameAcquiredClosure@/: t'GI.GObject.Structs.Closure.Closure' to invoke when /@name@/ is -- acquired or 'P.Nothing' -> Maybe (GClosure c) -- ^ /@nameLostClosure@/: t'GI.GObject.Structs.Closure.Closure' to invoke when /@name@/ is lost -- or 'P.Nothing' -> m Word32 -- ^ __Returns:__ an identifier (never 0) that can be used with -- 'GI.Gio.Functions.busUnownName' to stop owning the name. busOwnNameOnConnection :: forall (m :: * -> *) a b c. (HasCallStack, MonadIO m, IsDBusConnection a) => a -> Text -> [BusNameOwnerFlags] -> Maybe (GClosure b) -> Maybe (GClosure c) -> m Word32 busOwnNameOnConnection a connection Text name [BusNameOwnerFlags] flags Maybe (GClosure b) nameAcquiredClosure Maybe (GClosure c) nameLostClosure = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr DBusConnection connection' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a connection CString name' <- Text -> IO CString textToCString Text name let flags' :: CUInt flags' = forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [BusNameOwnerFlags] flags Ptr (GClosure ()) maybeNameAcquiredClosure <- case Maybe (GClosure b) nameAcquiredClosure of Maybe (GClosure b) Nothing -> forall (m :: * -> *) a. Monad m => a -> m a return forall a. Ptr a nullPtr Just GClosure b jNameAcquiredClosure -> do Ptr (GClosure ()) jNameAcquiredClosure' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr GClosure b jNameAcquiredClosure forall (m :: * -> *) a. Monad m => a -> m a return Ptr (GClosure ()) jNameAcquiredClosure' Ptr (GClosure ()) maybeNameLostClosure <- case Maybe (GClosure c) nameLostClosure of Maybe (GClosure c) Nothing -> forall (m :: * -> *) a. Monad m => a -> m a return forall a. Ptr a nullPtr Just GClosure c jNameLostClosure -> do Ptr (GClosure ()) jNameLostClosure' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr GClosure c jNameLostClosure forall (m :: * -> *) a. Monad m => a -> m a return Ptr (GClosure ()) jNameLostClosure' Word32 result <- Ptr DBusConnection -> CString -> CUInt -> Ptr (GClosure ()) -> Ptr (GClosure ()) -> IO Word32 g_bus_own_name_on_connection_with_closures Ptr DBusConnection connection' CString name' CUInt flags' Ptr (GClosure ()) maybeNameAcquiredClosure Ptr (GClosure ()) maybeNameLostClosure forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a connection forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe (GClosure b) nameAcquiredClosure forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe (GClosure c) nameLostClosure forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr forall a. Ptr a -> IO () freeMem CString name' forall (m :: * -> *) a. Monad m => a -> m a return Word32 result -- function bus_own_name -- Args: [ Arg -- { argCName = "bus_type" -- , argType = -- TInterface Name { namespace = "Gio" , name = "BusType" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the type of bus to own a name on" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "name" -- , argType = TBasicType TUTF8 -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "the well-known name to own" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "flags" -- , argType = -- TInterface Name { namespace = "Gio" , name = "BusNameOwnerFlags" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just "a set of flags from the #GBusNameOwnerFlags enumeration" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "bus_acquired_closure" -- , argType = TGClosure Nothing -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "#GClosure to invoke when connected to\n the bus of type @bus_type or %NULL" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "name_acquired_closure" -- , argType = TGClosure Nothing -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just "#GClosure to invoke when @name is\n acquired or %NULL" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "name_lost_closure" -- , argType = TGClosure Nothing -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just "#GClosure to invoke when @name is lost or\n %NULL" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just (TBasicType TUInt) -- throws : False -- Skip return : False foreign import ccall "g_bus_own_name_with_closures" g_bus_own_name_with_closures :: CInt -> -- bus_type : TInterface (Name {namespace = "Gio", name = "BusType"}) CString -> -- name : TBasicType TUTF8 CUInt -> -- flags : TInterface (Name {namespace = "Gio", name = "BusNameOwnerFlags"}) Ptr (GClosure ()) -> -- bus_acquired_closure : TGClosure Nothing Ptr (GClosure ()) -> -- name_acquired_closure : TGClosure Nothing Ptr (GClosure ()) -> -- name_lost_closure : TGClosure Nothing IO Word32 -- | Version of @/g_bus_own_name()/@ using closures instead of callbacks for -- easier binding in other languages. -- -- /Since: 2.26/ busOwnName :: (B.CallStack.HasCallStack, MonadIO m) => Gio.Enums.BusType -- ^ /@busType@/: the type of bus to own a name on -> T.Text -- ^ /@name@/: the well-known name to own -> [Gio.Flags.BusNameOwnerFlags] -- ^ /@flags@/: a set of flags from the t'GI.Gio.Flags.BusNameOwnerFlags' enumeration -> Maybe (GClosure a) -- ^ /@busAcquiredClosure@/: t'GI.GObject.Structs.Closure.Closure' to invoke when connected to -- the bus of type /@busType@/ or 'P.Nothing' -> Maybe (GClosure b) -- ^ /@nameAcquiredClosure@/: t'GI.GObject.Structs.Closure.Closure' to invoke when /@name@/ is -- acquired or 'P.Nothing' -> Maybe (GClosure c) -- ^ /@nameLostClosure@/: t'GI.GObject.Structs.Closure.Closure' to invoke when /@name@/ is lost or -- 'P.Nothing' -> m Word32 -- ^ __Returns:__ an identifier (never 0) that can be used with -- 'GI.Gio.Functions.busUnownName' to stop owning the name. busOwnName :: forall (m :: * -> *) a b c. (HasCallStack, MonadIO m) => BusType -> Text -> [BusNameOwnerFlags] -> Maybe (GClosure a) -> Maybe (GClosure b) -> Maybe (GClosure c) -> m Word32 busOwnName BusType busType Text name [BusNameOwnerFlags] flags Maybe (GClosure a) busAcquiredClosure Maybe (GClosure b) nameAcquiredClosure Maybe (GClosure c) nameLostClosure = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do let busType' :: CInt busType' = (forall a b. (Integral a, Num b) => a -> b fromIntegral forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. Enum a => a -> Int fromEnum) BusType busType CString name' <- Text -> IO CString textToCString Text name let flags' :: CUInt flags' = forall b a. (Num b, IsGFlag a) => [a] -> b gflagsToWord [BusNameOwnerFlags] flags Ptr (GClosure ()) maybeBusAcquiredClosure <- case Maybe (GClosure a) busAcquiredClosure of Maybe (GClosure a) Nothing -> forall (m :: * -> *) a. Monad m => a -> m a return forall a. Ptr a nullPtr Just GClosure a jBusAcquiredClosure -> do Ptr (GClosure ()) jBusAcquiredClosure' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr GClosure a jBusAcquiredClosure forall (m :: * -> *) a. Monad m => a -> m a return Ptr (GClosure ()) jBusAcquiredClosure' Ptr (GClosure ()) maybeNameAcquiredClosure <- case Maybe (GClosure b) nameAcquiredClosure of Maybe (GClosure b) Nothing -> forall (m :: * -> *) a. Monad m => a -> m a return forall a. Ptr a nullPtr Just GClosure b jNameAcquiredClosure -> do Ptr (GClosure ()) jNameAcquiredClosure' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr GClosure b jNameAcquiredClosure forall (m :: * -> *) a. Monad m => a -> m a return Ptr (GClosure ()) jNameAcquiredClosure' Ptr (GClosure ()) maybeNameLostClosure <- case Maybe (GClosure c) nameLostClosure of Maybe (GClosure c) Nothing -> forall (m :: * -> *) a. Monad m => a -> m a return forall a. Ptr a nullPtr Just GClosure c jNameLostClosure -> do Ptr (GClosure ()) jNameLostClosure' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr GClosure c jNameLostClosure forall (m :: * -> *) a. Monad m => a -> m a return Ptr (GClosure ()) jNameLostClosure' Word32 result <- CInt -> CString -> CUInt -> Ptr (GClosure ()) -> Ptr (GClosure ()) -> Ptr (GClosure ()) -> IO Word32 g_bus_own_name_with_closures CInt busType' CString name' CUInt flags' Ptr (GClosure ()) maybeBusAcquiredClosure Ptr (GClosure ()) maybeNameAcquiredClosure Ptr (GClosure ()) maybeNameLostClosure forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe (GClosure a) busAcquiredClosure forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe (GClosure b) nameAcquiredClosure forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe (GClosure c) nameLostClosure forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr forall a. Ptr a -> IO () freeMem CString name' forall (m :: * -> *) a. Monad m => a -> m a return Word32 result -- function bus_get_sync -- Args: [ Arg -- { argCName = "bus_type" -- , argType = -- TInterface Name { namespace = "Gio" , name = "BusType" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GBusType" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cancellable" -- , argType = -- TInterface Name { namespace = "Gio" , name = "Cancellable" } -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "a #GCancellable or %NULL" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface Name { namespace = "Gio" , name = "DBusConnection" }) -- throws : True -- Skip return : False foreign import ccall "g_bus_get_sync" g_bus_get_sync :: CInt -> -- bus_type : TInterface (Name {namespace = "Gio", name = "BusType"}) Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) Ptr (Ptr GError) -> -- error IO (Ptr Gio.DBusConnection.DBusConnection) -- | Synchronously connects to the message bus specified by /@busType@/. -- Note that the returned object may shared with other callers, -- e.g. if two separate parts of a process calls this function with -- the same /@busType@/, they will share the same object. -- -- This is a synchronous failable function. See 'GI.Gio.Functions.busGet' and -- 'GI.Gio.Functions.busGetFinish' for the asynchronous version. -- -- The returned object is a singleton, that is, shared with other -- callers of 'GI.Gio.Functions.busGet' and 'GI.Gio.Functions.busGetSync' for /@busType@/. In the -- event that you need a private message bus connection, use -- 'GI.Gio.Functions.dbusAddressGetForBusSync' and -- 'GI.Gio.Objects.DBusConnection.dBusConnectionNewForAddress' with -- G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT and -- G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION flags. -- -- Note that the returned t'GI.Gio.Objects.DBusConnection.DBusConnection' object will (usually) have -- the [DBusConnection:exitOnClose]("GI.Gio.Objects.DBusConnection#g:attr:exitOnClose") property set to 'P.True'. -- -- /Since: 2.26/ busGetSync :: (B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) => Gio.Enums.BusType -- ^ /@busType@/: a t'GI.Gio.Enums.BusType' -> Maybe (a) -- ^ /@cancellable@/: a t'GI.Gio.Objects.Cancellable.Cancellable' or 'P.Nothing' -> m Gio.DBusConnection.DBusConnection -- ^ __Returns:__ a t'GI.Gio.Objects.DBusConnection.DBusConnection' or 'P.Nothing' if /@error@/ is set. -- Free with 'GI.GObject.Objects.Object.objectUnref'. /(Can throw 'Data.GI.Base.GError.GError')/ busGetSync :: forall (m :: * -> *) a. (HasCallStack, MonadIO m, IsCancellable a) => BusType -> Maybe a -> m DBusConnection busGetSync BusType busType Maybe a cancellable = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do let busType' :: CInt busType' = (forall a b. (Integral a, Num b) => a -> b fromIntegral forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. Enum a => a -> Int fromEnum) BusType busType Ptr Cancellable maybeCancellable <- case Maybe a cancellable of Maybe a Nothing -> forall (m :: * -> *) a. Monad m => a -> m a return forall a. Ptr a nullPtr Just a jCancellable -> do Ptr Cancellable jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a jCancellable forall (m :: * -> *) a. Monad m => a -> m a return Ptr Cancellable jCancellable' forall a b. IO a -> IO b -> IO a onException (do Ptr DBusConnection result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a propagateGError forall a b. (a -> b) -> a -> b $ CInt -> Ptr Cancellable -> Ptr (Ptr GError) -> IO (Ptr DBusConnection) g_bus_get_sync CInt busType' Ptr Cancellable maybeCancellable forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "busGetSync" Ptr DBusConnection result DBusConnection result' <- (forall a b. (HasCallStack, GObject a, GObject b) => (ManagedPtr a -> a) -> Ptr b -> IO a wrapObject ManagedPtr DBusConnection -> DBusConnection Gio.DBusConnection.DBusConnection) Ptr DBusConnection result forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe a cancellable forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr forall (m :: * -> *) a. Monad m => a -> m a return DBusConnection result' ) (do forall (m :: * -> *) a. Monad m => a -> m a return () ) -- function bus_get_finish -- Args: [ Arg -- { argCName = "res" -- , argType = -- TInterface Name { namespace = "Gio" , name = "AsyncResult" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = -- Just -- "a #GAsyncResult obtained from the #GAsyncReadyCallback passed\n to g_bus_get()" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Just -- (TInterface Name { namespace = "Gio" , name = "DBusConnection" }) -- throws : True -- Skip return : False foreign import ccall "g_bus_get_finish" g_bus_get_finish :: Ptr Gio.AsyncResult.AsyncResult -> -- res : TInterface (Name {namespace = "Gio", name = "AsyncResult"}) Ptr (Ptr GError) -> -- error IO (Ptr Gio.DBusConnection.DBusConnection) -- | Finishes an operation started with 'GI.Gio.Functions.busGet'. -- -- The returned object is a singleton, that is, shared with other -- callers of 'GI.Gio.Functions.busGet' and 'GI.Gio.Functions.busGetSync' for /@busType@/. In the -- event that you need a private message bus connection, use -- 'GI.Gio.Functions.dbusAddressGetForBusSync' and -- 'GI.Gio.Objects.DBusConnection.dBusConnectionNewForAddress' with -- G_DBUS_CONNECTION_FLAGS_AUTHENTICATION_CLIENT and -- G_DBUS_CONNECTION_FLAGS_MESSAGE_BUS_CONNECTION flags. -- -- Note that the returned t'GI.Gio.Objects.DBusConnection.DBusConnection' object will (usually) have -- the [DBusConnection:exitOnClose]("GI.Gio.Objects.DBusConnection#g:attr:exitOnClose") property set to 'P.True'. -- -- /Since: 2.26/ busGetFinish :: (B.CallStack.HasCallStack, MonadIO m, Gio.AsyncResult.IsAsyncResult a) => a -- ^ /@res@/: a t'GI.Gio.Interfaces.AsyncResult.AsyncResult' obtained from the t'GI.Gio.Callbacks.AsyncReadyCallback' passed -- to 'GI.Gio.Functions.busGet' -> m Gio.DBusConnection.DBusConnection -- ^ __Returns:__ a t'GI.Gio.Objects.DBusConnection.DBusConnection' or 'P.Nothing' if /@error@/ is set. -- Free with 'GI.GObject.Objects.Object.objectUnref'. /(Can throw 'Data.GI.Base.GError.GError')/ busGetFinish :: forall (m :: * -> *) a. (HasCallStack, MonadIO m, IsAsyncResult a) => a -> m DBusConnection busGetFinish a res = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do Ptr AsyncResult res' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a res forall a b. IO a -> IO b -> IO a onException (do Ptr DBusConnection result <- forall a. (Ptr (Ptr GError) -> IO a) -> IO a propagateGError forall a b. (a -> b) -> a -> b $ Ptr AsyncResult -> Ptr (Ptr GError) -> IO (Ptr DBusConnection) g_bus_get_finish Ptr AsyncResult res' forall a. HasCallStack => Text -> Ptr a -> IO () checkUnexpectedReturnNULL Text "busGetFinish" Ptr DBusConnection result DBusConnection result' <- (forall a b. (HasCallStack, GObject a, GObject b) => (ManagedPtr a -> a) -> Ptr b -> IO a wrapObject ManagedPtr DBusConnection -> DBusConnection Gio.DBusConnection.DBusConnection) Ptr DBusConnection result forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr a res forall (m :: * -> *) a. Monad m => a -> m a return DBusConnection result' ) (do forall (m :: * -> *) a. Monad m => a -> m a return () ) -- function bus_get -- Args: [ Arg -- { argCName = "bus_type" -- , argType = -- TInterface Name { namespace = "Gio" , name = "BusType" } -- , direction = DirectionIn -- , mayBeNull = False -- , argDoc = -- Documentation -- { rawDocText = Just "a #GBusType" , sinceVersion = Nothing } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "cancellable" -- , argType = -- TInterface Name { namespace = "Gio" , name = "Cancellable" } -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "a #GCancellable or %NULL" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "callback" -- , argType = -- TInterface Name { namespace = "Gio" , name = "AsyncReadyCallback" } -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = -- Just "a #GAsyncReadyCallback to call when the request is satisfied" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeAsync -- , argClosure = 3 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- , Arg -- { argCName = "user_data" -- , argType = TBasicType TPtr -- , direction = DirectionIn -- , mayBeNull = True -- , argDoc = -- Documentation -- { rawDocText = Just "the data to pass to @callback" -- , sinceVersion = Nothing -- } -- , argScope = ScopeTypeInvalid -- , argClosure = -1 -- , argDestroy = -1 -- , argCallerAllocates = False -- , transfer = TransferNothing -- } -- ] -- Lengths: [] -- returnType: Nothing -- throws : False -- Skip return : False foreign import ccall "g_bus_get" g_bus_get :: CInt -> -- bus_type : TInterface (Name {namespace = "Gio", name = "BusType"}) Ptr Gio.Cancellable.Cancellable -> -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"}) FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"}) Ptr () -> -- user_data : TBasicType TPtr IO () -- | Asynchronously connects to the message bus specified by /@busType@/. -- -- When the operation is finished, /@callback@/ will be invoked. You can -- then call 'GI.Gio.Functions.busGetFinish' to get the result of the operation. -- -- This is an asynchronous failable function. See 'GI.Gio.Functions.busGetSync' for -- the synchronous version. -- -- /Since: 2.26/ busGet :: (B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) => Gio.Enums.BusType -- ^ /@busType@/: a t'GI.Gio.Enums.BusType' -> Maybe (a) -- ^ /@cancellable@/: a t'GI.Gio.Objects.Cancellable.Cancellable' or 'P.Nothing' -> Maybe (Gio.Callbacks.AsyncReadyCallback) -- ^ /@callback@/: a t'GI.Gio.Callbacks.AsyncReadyCallback' to call when the request is satisfied -> m () busGet :: forall (m :: * -> *) a. (HasCallStack, MonadIO m, IsCancellable a) => BusType -> Maybe a -> Maybe AsyncReadyCallback -> m () busGet BusType busType Maybe a cancellable Maybe AsyncReadyCallback callback = forall (m :: * -> *) a. MonadIO m => IO a -> m a liftIO forall a b. (a -> b) -> a -> b $ do let busType' :: CInt busType' = (forall a b. (Integral a, Num b) => a -> b fromIntegral forall b c a. (b -> c) -> (a -> b) -> a -> c . forall a. Enum a => a -> Int fromEnum) BusType busType Ptr Cancellable maybeCancellable <- case Maybe a cancellable of Maybe a Nothing -> forall (m :: * -> *) a. Monad m => a -> m a return forall a. Ptr a nullPtr Just a jCancellable -> do Ptr Cancellable jCancellable' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b) unsafeManagedPtrCastPtr a jCancellable forall (m :: * -> *) a. Monad m => a -> m a return Ptr Cancellable jCancellable' FunPtr C_AsyncReadyCallback maybeCallback <- case Maybe AsyncReadyCallback callback of Maybe AsyncReadyCallback Nothing -> forall (m :: * -> *) a. Monad m => a -> m a return (forall a b. Ptr a -> FunPtr b castPtrToFunPtr forall a. Ptr a nullPtr) Just AsyncReadyCallback jCallback -> do Ptr (FunPtr C_AsyncReadyCallback) ptrcallback <- 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 -> C_AsyncReadyCallback Gio.Callbacks.wrap_AsyncReadyCallback (forall a. a -> Maybe a Just Ptr (FunPtr C_AsyncReadyCallback) ptrcallback) AsyncReadyCallback jCallback) forall a. Storable a => Ptr a -> a -> IO () poke Ptr (FunPtr C_AsyncReadyCallback) ptrcallback FunPtr C_AsyncReadyCallback jCallback' forall (m :: * -> *) a. Monad m => a -> m a return FunPtr C_AsyncReadyCallback jCallback' let userData :: Ptr a userData = forall a. Ptr a nullPtr CInt -> Ptr Cancellable -> FunPtr C_AsyncReadyCallback -> C_DestroyNotify g_bus_get CInt busType' Ptr Cancellable maybeCancellable FunPtr C_AsyncReadyCallback maybeCallback forall a. Ptr a userData forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m () whenJust Maybe a cancellable forall a. ManagedPtrNewtype a => a -> IO () touchManagedPtr forall (m :: * -> *) a. Monad m => a -> m a return ()