{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Interfaces.AppInfo
(
AppInfo(..) ,
IsAppInfo ,
toAppInfo ,
#if defined(ENABLE_OVERLOADING)
ResolveAppInfoMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
AppInfoAddSupportsTypeMethodInfo ,
#endif
appInfoAddSupportsType ,
#if defined(ENABLE_OVERLOADING)
AppInfoCanDeleteMethodInfo ,
#endif
appInfoCanDelete ,
#if defined(ENABLE_OVERLOADING)
AppInfoCanRemoveSupportsTypeMethodInfo ,
#endif
appInfoCanRemoveSupportsType ,
appInfoCreateFromCommandline ,
#if defined(ENABLE_OVERLOADING)
AppInfoDeleteMethodInfo ,
#endif
appInfoDelete ,
#if defined(ENABLE_OVERLOADING)
AppInfoDupMethodInfo ,
#endif
appInfoDup ,
#if defined(ENABLE_OVERLOADING)
AppInfoEqualMethodInfo ,
#endif
appInfoEqual ,
appInfoGetAll ,
appInfoGetAllForType ,
#if defined(ENABLE_OVERLOADING)
AppInfoGetCommandlineMethodInfo ,
#endif
appInfoGetCommandline ,
appInfoGetDefaultForType ,
appInfoGetDefaultForTypeAsync ,
appInfoGetDefaultForTypeFinish ,
appInfoGetDefaultForUriScheme ,
appInfoGetDefaultForUriSchemeAsync ,
appInfoGetDefaultForUriSchemeFinish ,
#if defined(ENABLE_OVERLOADING)
AppInfoGetDescriptionMethodInfo ,
#endif
appInfoGetDescription ,
#if defined(ENABLE_OVERLOADING)
AppInfoGetDisplayNameMethodInfo ,
#endif
appInfoGetDisplayName ,
#if defined(ENABLE_OVERLOADING)
AppInfoGetExecutableMethodInfo ,
#endif
appInfoGetExecutable ,
appInfoGetFallbackForType ,
#if defined(ENABLE_OVERLOADING)
AppInfoGetIconMethodInfo ,
#endif
appInfoGetIcon ,
#if defined(ENABLE_OVERLOADING)
AppInfoGetIdMethodInfo ,
#endif
appInfoGetId ,
#if defined(ENABLE_OVERLOADING)
AppInfoGetNameMethodInfo ,
#endif
appInfoGetName ,
appInfoGetRecommendedForType ,
#if defined(ENABLE_OVERLOADING)
AppInfoGetSupportedTypesMethodInfo ,
#endif
appInfoGetSupportedTypes ,
#if defined(ENABLE_OVERLOADING)
AppInfoLaunchMethodInfo ,
#endif
appInfoLaunch ,
appInfoLaunchDefaultForUri ,
appInfoLaunchDefaultForUriAsync ,
appInfoLaunchDefaultForUriFinish ,
#if defined(ENABLE_OVERLOADING)
AppInfoLaunchUrisMethodInfo ,
#endif
appInfoLaunchUris ,
#if defined(ENABLE_OVERLOADING)
AppInfoLaunchUrisAsyncMethodInfo ,
#endif
appInfoLaunchUrisAsync ,
#if defined(ENABLE_OVERLOADING)
AppInfoLaunchUrisFinishMethodInfo ,
#endif
appInfoLaunchUrisFinish ,
#if defined(ENABLE_OVERLOADING)
AppInfoRemoveSupportsTypeMethodInfo ,
#endif
appInfoRemoveSupportsType ,
appInfoResetTypeAssociations ,
#if defined(ENABLE_OVERLOADING)
AppInfoSetAsDefaultForExtensionMethodInfo,
#endif
appInfoSetAsDefaultForExtension ,
#if defined(ENABLE_OVERLOADING)
AppInfoSetAsDefaultForTypeMethodInfo ,
#endif
appInfoSetAsDefaultForType ,
#if defined(ENABLE_OVERLOADING)
AppInfoSetAsLastUsedForTypeMethodInfo ,
#endif
appInfoSetAsLastUsedForType ,
#if defined(ENABLE_OVERLOADING)
AppInfoShouldShowMethodInfo ,
#endif
appInfoShouldShow ,
#if defined(ENABLE_OVERLOADING)
AppInfoSupportsFilesMethodInfo ,
#endif
appInfoSupportsFiles ,
#if defined(ENABLE_OVERLOADING)
AppInfoSupportsUrisMethodInfo ,
#endif
appInfoSupportsUris ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Enums as GLib.Enums
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.DateTime as GLib.DateTime
import qualified GI.GLib.Structs.PollFD as GLib.PollFD
import qualified GI.GLib.Structs.Source as GLib.Source
import qualified GI.GLib.Structs.TimeVal as GLib.TimeVal
import qualified GI.GObject.Callbacks as GObject.Callbacks
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import {-# SOURCE #-} qualified GI.Gio.Enums as Gio.Enums
import {-# SOURCE #-} qualified GI.Gio.Flags as Gio.Flags
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Drive as Gio.Drive
import {-# SOURCE #-} qualified GI.Gio.Interfaces.File as Gio.File
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Icon as Gio.Icon
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Mount as Gio.Mount
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Seekable as Gio.Seekable
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Volume as Gio.Volume
import {-# SOURCE #-} qualified GI.Gio.Objects.AppLaunchContext as Gio.AppLaunchContext
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import {-# SOURCE #-} qualified GI.Gio.Objects.FileEnumerator as Gio.FileEnumerator
import {-# SOURCE #-} qualified GI.Gio.Objects.FileIOStream as Gio.FileIOStream
import {-# SOURCE #-} qualified GI.Gio.Objects.FileInfo as Gio.FileInfo
import {-# SOURCE #-} qualified GI.Gio.Objects.FileInputStream as Gio.FileInputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.FileMonitor as Gio.FileMonitor
import {-# SOURCE #-} qualified GI.Gio.Objects.FileOutputStream as Gio.FileOutputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.IOStream as Gio.IOStream
import {-# SOURCE #-} qualified GI.Gio.Objects.InputStream as Gio.InputStream
import {-# SOURCE #-} qualified GI.Gio.Objects.MountOperation as Gio.MountOperation
import {-# SOURCE #-} qualified GI.Gio.Objects.OutputStream as Gio.OutputStream
import {-# SOURCE #-} qualified GI.Gio.Structs.FileAttributeInfo as Gio.FileAttributeInfo
import {-# SOURCE #-} qualified GI.Gio.Structs.FileAttributeInfoList as Gio.FileAttributeInfoList
import {-# SOURCE #-} qualified GI.Gio.Structs.FileAttributeMatcher as Gio.FileAttributeMatcher
import {-# SOURCE #-} qualified GI.Gio.Structs.OutputVector as Gio.OutputVector
#else
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import {-# SOURCE #-} qualified GI.Gio.Flags as Gio.Flags
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import {-# SOURCE #-} qualified GI.Gio.Interfaces.File as Gio.File
import {-# SOURCE #-} qualified GI.Gio.Interfaces.Icon as Gio.Icon
import {-# SOURCE #-} qualified GI.Gio.Objects.AppLaunchContext as Gio.AppLaunchContext
import {-# SOURCE #-} qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
#endif
newtype AppInfo = AppInfo (SP.ManagedPtr AppInfo)
deriving (AppInfo -> AppInfo -> Bool
(AppInfo -> AppInfo -> Bool)
-> (AppInfo -> AppInfo -> Bool) -> Eq AppInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AppInfo -> AppInfo -> Bool
== :: AppInfo -> AppInfo -> Bool
$c/= :: AppInfo -> AppInfo -> Bool
/= :: AppInfo -> AppInfo -> Bool
Eq)
instance SP.ManagedPtrNewtype AppInfo where
toManagedPtr :: AppInfo -> ManagedPtr AppInfo
toManagedPtr (AppInfo ManagedPtr AppInfo
p) = ManagedPtr AppInfo
p
foreign import ccall "g_app_info_get_type"
c_g_app_info_get_type :: IO B.Types.GType
instance B.Types.TypedObject AppInfo where
glibType :: IO GType
glibType = IO GType
c_g_app_info_get_type
instance B.Types.GObject AppInfo
class (SP.GObject o, O.IsDescendantOf AppInfo o) => IsAppInfo o
instance (SP.GObject o, O.IsDescendantOf AppInfo o) => IsAppInfo o
instance O.HasParentTypes AppInfo
type instance O.ParentTypes AppInfo = '[GObject.Object.Object]
toAppInfo :: (MIO.MonadIO m, IsAppInfo o) => o -> m AppInfo
toAppInfo :: forall (m :: * -> *) o. (MonadIO m, IsAppInfo o) => o -> m AppInfo
toAppInfo = IO AppInfo -> m AppInfo
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO AppInfo -> m AppInfo) -> (o -> IO AppInfo) -> o -> m AppInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr AppInfo -> AppInfo) -> o -> IO AppInfo
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr AppInfo -> AppInfo
AppInfo
instance B.GValue.IsGValue (Maybe AppInfo) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_app_info_get_type
gvalueSet_ :: Ptr GValue -> Maybe AppInfo -> IO ()
gvalueSet_ Ptr GValue
gv Maybe AppInfo
P.Nothing = Ptr GValue -> Ptr AppInfo -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr AppInfo
forall a. Ptr a
FP.nullPtr :: FP.Ptr AppInfo)
gvalueSet_ Ptr GValue
gv (P.Just AppInfo
obj) = AppInfo -> (Ptr AppInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr AppInfo
obj (Ptr GValue -> Ptr AppInfo -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe AppInfo)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr AppInfo)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr AppInfo)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject AppInfo ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList AppInfo
type instance O.AttributeList AppInfo = AppInfoAttributeList
type AppInfoAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveAppInfoMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveAppInfoMethod "addSupportsType" o = AppInfoAddSupportsTypeMethodInfo
ResolveAppInfoMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveAppInfoMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveAppInfoMethod "canDelete" o = AppInfoCanDeleteMethodInfo
ResolveAppInfoMethod "canRemoveSupportsType" o = AppInfoCanRemoveSupportsTypeMethodInfo
ResolveAppInfoMethod "delete" o = AppInfoDeleteMethodInfo
ResolveAppInfoMethod "dup" o = AppInfoDupMethodInfo
ResolveAppInfoMethod "equal" o = AppInfoEqualMethodInfo
ResolveAppInfoMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveAppInfoMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveAppInfoMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveAppInfoMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveAppInfoMethod "launch" o = AppInfoLaunchMethodInfo
ResolveAppInfoMethod "launchUris" o = AppInfoLaunchUrisMethodInfo
ResolveAppInfoMethod "launchUrisAsync" o = AppInfoLaunchUrisAsyncMethodInfo
ResolveAppInfoMethod "launchUrisFinish" o = AppInfoLaunchUrisFinishMethodInfo
ResolveAppInfoMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveAppInfoMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveAppInfoMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveAppInfoMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveAppInfoMethod "removeSupportsType" o = AppInfoRemoveSupportsTypeMethodInfo
ResolveAppInfoMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveAppInfoMethod "shouldShow" o = AppInfoShouldShowMethodInfo
ResolveAppInfoMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveAppInfoMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveAppInfoMethod "supportsFiles" o = AppInfoSupportsFilesMethodInfo
ResolveAppInfoMethod "supportsUris" o = AppInfoSupportsUrisMethodInfo
ResolveAppInfoMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveAppInfoMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveAppInfoMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveAppInfoMethod "getCommandline" o = AppInfoGetCommandlineMethodInfo
ResolveAppInfoMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveAppInfoMethod "getDescription" o = AppInfoGetDescriptionMethodInfo
ResolveAppInfoMethod "getDisplayName" o = AppInfoGetDisplayNameMethodInfo
ResolveAppInfoMethod "getExecutable" o = AppInfoGetExecutableMethodInfo
ResolveAppInfoMethod "getIcon" o = AppInfoGetIconMethodInfo
ResolveAppInfoMethod "getId" o = AppInfoGetIdMethodInfo
ResolveAppInfoMethod "getName" o = AppInfoGetNameMethodInfo
ResolveAppInfoMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveAppInfoMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveAppInfoMethod "getSupportedTypes" o = AppInfoGetSupportedTypesMethodInfo
ResolveAppInfoMethod "setAsDefaultForExtension" o = AppInfoSetAsDefaultForExtensionMethodInfo
ResolveAppInfoMethod "setAsDefaultForType" o = AppInfoSetAsDefaultForTypeMethodInfo
ResolveAppInfoMethod "setAsLastUsedForType" o = AppInfoSetAsLastUsedForTypeMethodInfo
ResolveAppInfoMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveAppInfoMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveAppInfoMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveAppInfoMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveAppInfoMethod t AppInfo, O.OverloadedMethod info AppInfo p) => OL.IsLabel t (AppInfo -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveAppInfoMethod t AppInfo, O.OverloadedMethod info AppInfo p, R.HasField t AppInfo p) => R.HasField t AppInfo p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveAppInfoMethod t AppInfo, O.OverloadedMethodInfo info AppInfo) => OL.IsLabel t (O.MethodProxy info AppInfo) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
foreign import ccall "g_app_info_add_supports_type" g_app_info_add_supports_type ::
Ptr AppInfo ->
CString ->
Ptr (Ptr GError) ->
IO CInt
appInfoAddSupportsType ::
(B.CallStack.HasCallStack, MonadIO m, IsAppInfo a) =>
a
-> T.Text
-> m ()
appInfoAddSupportsType :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAppInfo a) =>
a -> Text -> m ()
appInfoAddSupportsType a
appinfo Text
contentType = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
contentType' <- textToCString contentType
onException (do
_ <- propagateGError $ g_app_info_add_supports_type appinfo' contentType'
touchManagedPtr appinfo
freeMem contentType'
return ()
) (do
freeMem contentType'
)
#if defined(ENABLE_OVERLOADING)
data AppInfoAddSupportsTypeMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsAppInfo a) => O.OverloadedMethod AppInfoAddSupportsTypeMethodInfo a signature where
overloadedMethod = appInfoAddSupportsType
instance O.OverloadedMethodInfo AppInfoAddSupportsTypeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.AppInfo.appInfoAddSupportsType",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-AppInfo.html#v:appInfoAddSupportsType"
})
#endif
foreign import ccall "g_app_info_can_delete" g_app_info_can_delete ::
Ptr AppInfo ->
IO CInt
appInfoCanDelete ::
(B.CallStack.HasCallStack, MonadIO m, IsAppInfo a) =>
a
-> m Bool
appInfoCanDelete :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAppInfo a) =>
a -> m Bool
appInfoCanDelete a
appinfo = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
result <- g_app_info_can_delete appinfo'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr appinfo
return result'
#if defined(ENABLE_OVERLOADING)
data AppInfoCanDeleteMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAppInfo a) => O.OverloadedMethod AppInfoCanDeleteMethodInfo a signature where
overloadedMethod = appInfoCanDelete
instance O.OverloadedMethodInfo AppInfoCanDeleteMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.AppInfo.appInfoCanDelete",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-AppInfo.html#v:appInfoCanDelete"
})
#endif
foreign import ccall "g_app_info_can_remove_supports_type" g_app_info_can_remove_supports_type ::
Ptr AppInfo ->
IO CInt
appInfoCanRemoveSupportsType ::
(B.CallStack.HasCallStack, MonadIO m, IsAppInfo a) =>
a
-> m Bool
appInfoCanRemoveSupportsType :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAppInfo a) =>
a -> m Bool
appInfoCanRemoveSupportsType a
appinfo = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
result <- g_app_info_can_remove_supports_type appinfo'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr appinfo
return result'
#if defined(ENABLE_OVERLOADING)
data AppInfoCanRemoveSupportsTypeMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAppInfo a) => O.OverloadedMethod AppInfoCanRemoveSupportsTypeMethodInfo a signature where
overloadedMethod = appInfoCanRemoveSupportsType
instance O.OverloadedMethodInfo AppInfoCanRemoveSupportsTypeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.AppInfo.appInfoCanRemoveSupportsType",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-AppInfo.html#v:appInfoCanRemoveSupportsType"
})
#endif
foreign import ccall "g_app_info_delete" g_app_info_delete ::
Ptr AppInfo ->
IO CInt
appInfoDelete ::
(B.CallStack.HasCallStack, MonadIO m, IsAppInfo a) =>
a
-> m Bool
appInfoDelete :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAppInfo a) =>
a -> m Bool
appInfoDelete a
appinfo = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
result <- g_app_info_delete appinfo'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr appinfo
return result'
#if defined(ENABLE_OVERLOADING)
data AppInfoDeleteMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAppInfo a) => O.OverloadedMethod AppInfoDeleteMethodInfo a signature where
overloadedMethod = appInfoDelete
instance O.OverloadedMethodInfo AppInfoDeleteMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.AppInfo.appInfoDelete",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-AppInfo.html#v:appInfoDelete"
})
#endif
foreign import ccall "g_app_info_dup" g_app_info_dup ::
Ptr AppInfo ->
IO (Ptr AppInfo)
appInfoDup ::
(B.CallStack.HasCallStack, MonadIO m, IsAppInfo a) =>
a
-> m AppInfo
appInfoDup :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAppInfo a) =>
a -> m AppInfo
appInfoDup a
appinfo = IO AppInfo -> m AppInfo
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AppInfo -> m AppInfo) -> IO AppInfo -> m AppInfo
forall a b. (a -> b) -> a -> b
$ do
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
result <- g_app_info_dup appinfo'
checkUnexpectedReturnNULL "appInfoDup" result
result' <- (wrapObject AppInfo) result
touchManagedPtr appinfo
return result'
#if defined(ENABLE_OVERLOADING)
data AppInfoDupMethodInfo
instance (signature ~ (m AppInfo), MonadIO m, IsAppInfo a) => O.OverloadedMethod AppInfoDupMethodInfo a signature where
overloadedMethod = appInfoDup
instance O.OverloadedMethodInfo AppInfoDupMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.AppInfo.appInfoDup",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-AppInfo.html#v:appInfoDup"
})
#endif
foreign import ccall "g_app_info_equal" g_app_info_equal ::
Ptr AppInfo ->
Ptr AppInfo ->
IO CInt
appInfoEqual ::
(B.CallStack.HasCallStack, MonadIO m, IsAppInfo a, IsAppInfo b) =>
a
-> b
-> m Bool
appInfoEqual :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsAppInfo a, IsAppInfo b) =>
a -> b -> m Bool
appInfoEqual a
appinfo1 b
appinfo2 = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
appinfo1' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo1
appinfo2' <- unsafeManagedPtrCastPtr appinfo2
result <- g_app_info_equal appinfo1' appinfo2'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr appinfo1
touchManagedPtr appinfo2
return result'
#if defined(ENABLE_OVERLOADING)
data AppInfoEqualMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsAppInfo a, IsAppInfo b) => O.OverloadedMethod AppInfoEqualMethodInfo a signature where
overloadedMethod = appInfoEqual
instance O.OverloadedMethodInfo AppInfoEqualMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.AppInfo.appInfoEqual",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-AppInfo.html#v:appInfoEqual"
})
#endif
foreign import ccall "g_app_info_get_commandline" g_app_info_get_commandline ::
Ptr AppInfo ->
IO CString
appInfoGetCommandline ::
(B.CallStack.HasCallStack, MonadIO m, IsAppInfo a) =>
a
-> m (Maybe [Char])
appInfoGetCommandline :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAppInfo a) =>
a -> m (Maybe String)
appInfoGetCommandline a
appinfo = IO (Maybe String) -> m (Maybe String)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe String) -> m (Maybe String))
-> IO (Maybe String) -> m (Maybe String)
forall a b. (a -> b) -> a -> b
$ do
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
result <- g_app_info_get_commandline appinfo'
maybeResult <- convertIfNonNull result $ \CString
result' -> do
result'' <- HasCallStack => CString -> IO String
CString -> IO String
cstringToString CString
result'
return result''
touchManagedPtr appinfo
return maybeResult
#if defined(ENABLE_OVERLOADING)
data AppInfoGetCommandlineMethodInfo
instance (signature ~ (m (Maybe [Char])), MonadIO m, IsAppInfo a) => O.OverloadedMethod AppInfoGetCommandlineMethodInfo a signature where
overloadedMethod = appInfoGetCommandline
instance O.OverloadedMethodInfo AppInfoGetCommandlineMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.AppInfo.appInfoGetCommandline",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-AppInfo.html#v:appInfoGetCommandline"
})
#endif
foreign import ccall "g_app_info_get_description" g_app_info_get_description ::
Ptr AppInfo ->
IO CString
appInfoGetDescription ::
(B.CallStack.HasCallStack, MonadIO m, IsAppInfo a) =>
a
-> m (Maybe T.Text)
appInfoGetDescription :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAppInfo a) =>
a -> m (Maybe Text)
appInfoGetDescription a
appinfo = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
result <- g_app_info_get_description appinfo'
maybeResult <- convertIfNonNull result $ \CString
result' -> do
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
return result''
touchManagedPtr appinfo
return maybeResult
#if defined(ENABLE_OVERLOADING)
data AppInfoGetDescriptionMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsAppInfo a) => O.OverloadedMethod AppInfoGetDescriptionMethodInfo a signature where
overloadedMethod = appInfoGetDescription
instance O.OverloadedMethodInfo AppInfoGetDescriptionMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.AppInfo.appInfoGetDescription",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-AppInfo.html#v:appInfoGetDescription"
})
#endif
foreign import ccall "g_app_info_get_display_name" g_app_info_get_display_name ::
Ptr AppInfo ->
IO CString
appInfoGetDisplayName ::
(B.CallStack.HasCallStack, MonadIO m, IsAppInfo a) =>
a
-> m T.Text
appInfoGetDisplayName :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAppInfo a) =>
a -> m Text
appInfoGetDisplayName a
appinfo = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
result <- g_app_info_get_display_name appinfo'
checkUnexpectedReturnNULL "appInfoGetDisplayName" result
result' <- cstringToText result
touchManagedPtr appinfo
return result'
#if defined(ENABLE_OVERLOADING)
data AppInfoGetDisplayNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsAppInfo a) => O.OverloadedMethod AppInfoGetDisplayNameMethodInfo a signature where
overloadedMethod = appInfoGetDisplayName
instance O.OverloadedMethodInfo AppInfoGetDisplayNameMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.AppInfo.appInfoGetDisplayName",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-AppInfo.html#v:appInfoGetDisplayName"
})
#endif
foreign import ccall "g_app_info_get_executable" g_app_info_get_executable ::
Ptr AppInfo ->
IO CString
appInfoGetExecutable ::
(B.CallStack.HasCallStack, MonadIO m, IsAppInfo a) =>
a
-> m [Char]
appInfoGetExecutable :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAppInfo a) =>
a -> m String
appInfoGetExecutable a
appinfo = IO String -> m String
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO String -> m String) -> IO String -> m String
forall a b. (a -> b) -> a -> b
$ do
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
result <- g_app_info_get_executable appinfo'
checkUnexpectedReturnNULL "appInfoGetExecutable" result
result' <- cstringToString result
touchManagedPtr appinfo
return result'
#if defined(ENABLE_OVERLOADING)
data AppInfoGetExecutableMethodInfo
instance (signature ~ (m [Char]), MonadIO m, IsAppInfo a) => O.OverloadedMethod AppInfoGetExecutableMethodInfo a signature where
overloadedMethod = appInfoGetExecutable
instance O.OverloadedMethodInfo AppInfoGetExecutableMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.AppInfo.appInfoGetExecutable",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-AppInfo.html#v:appInfoGetExecutable"
})
#endif
foreign import ccall "g_app_info_get_icon" g_app_info_get_icon ::
Ptr AppInfo ->
IO (Ptr Gio.Icon.Icon)
appInfoGetIcon ::
(B.CallStack.HasCallStack, MonadIO m, IsAppInfo a) =>
a
-> m (Maybe Gio.Icon.Icon)
appInfoGetIcon :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAppInfo a) =>
a -> m (Maybe Icon)
appInfoGetIcon a
appinfo = IO (Maybe Icon) -> m (Maybe Icon)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Icon) -> m (Maybe Icon))
-> IO (Maybe Icon) -> m (Maybe Icon)
forall a b. (a -> b) -> a -> b
$ do
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
result <- g_app_info_get_icon appinfo'
maybeResult <- convertIfNonNull result $ \Ptr Icon
result' -> do
result'' <- ((ManagedPtr Icon -> Icon) -> Ptr Icon -> IO Icon
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Icon -> Icon
Gio.Icon.Icon) Ptr Icon
result'
return result''
touchManagedPtr appinfo
return maybeResult
#if defined(ENABLE_OVERLOADING)
data AppInfoGetIconMethodInfo
instance (signature ~ (m (Maybe Gio.Icon.Icon)), MonadIO m, IsAppInfo a) => O.OverloadedMethod AppInfoGetIconMethodInfo a signature where
overloadedMethod = appInfoGetIcon
instance O.OverloadedMethodInfo AppInfoGetIconMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.AppInfo.appInfoGetIcon",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-AppInfo.html#v:appInfoGetIcon"
})
#endif
foreign import ccall "g_app_info_get_id" g_app_info_get_id ::
Ptr AppInfo ->
IO CString
appInfoGetId ::
(B.CallStack.HasCallStack, MonadIO m, IsAppInfo a) =>
a
-> m (Maybe T.Text)
appInfoGetId :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAppInfo a) =>
a -> m (Maybe Text)
appInfoGetId a
appinfo = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ do
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
result <- g_app_info_get_id appinfo'
maybeResult <- convertIfNonNull result $ \CString
result' -> do
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
return result''
touchManagedPtr appinfo
return maybeResult
#if defined(ENABLE_OVERLOADING)
data AppInfoGetIdMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsAppInfo a) => O.OverloadedMethod AppInfoGetIdMethodInfo a signature where
overloadedMethod = appInfoGetId
instance O.OverloadedMethodInfo AppInfoGetIdMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.AppInfo.appInfoGetId",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-AppInfo.html#v:appInfoGetId"
})
#endif
foreign import ccall "g_app_info_get_name" g_app_info_get_name ::
Ptr AppInfo ->
IO CString
appInfoGetName ::
(B.CallStack.HasCallStack, MonadIO m, IsAppInfo a) =>
a
-> m T.Text
appInfoGetName :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAppInfo a) =>
a -> m Text
appInfoGetName a
appinfo = IO Text -> m Text
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
result <- g_app_info_get_name appinfo'
checkUnexpectedReturnNULL "appInfoGetName" result
result' <- cstringToText result
touchManagedPtr appinfo
return result'
#if defined(ENABLE_OVERLOADING)
data AppInfoGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsAppInfo a) => O.OverloadedMethod AppInfoGetNameMethodInfo a signature where
overloadedMethod = appInfoGetName
instance O.OverloadedMethodInfo AppInfoGetNameMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.AppInfo.appInfoGetName",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-AppInfo.html#v:appInfoGetName"
})
#endif
foreign import ccall "g_app_info_get_supported_types" g_app_info_get_supported_types ::
Ptr AppInfo ->
IO (Ptr CString)
appInfoGetSupportedTypes ::
(B.CallStack.HasCallStack, MonadIO m, IsAppInfo a) =>
a
-> m [T.Text]
appInfoGetSupportedTypes :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAppInfo a) =>
a -> m [Text]
appInfoGetSupportedTypes a
appinfo = IO [Text] -> m [Text]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
result <- g_app_info_get_supported_types appinfo'
checkUnexpectedReturnNULL "appInfoGetSupportedTypes" result
result' <- unpackZeroTerminatedUTF8CArray result
touchManagedPtr appinfo
return result'
#if defined(ENABLE_OVERLOADING)
data AppInfoGetSupportedTypesMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m, IsAppInfo a) => O.OverloadedMethod AppInfoGetSupportedTypesMethodInfo a signature where
overloadedMethod = appInfoGetSupportedTypes
instance O.OverloadedMethodInfo AppInfoGetSupportedTypesMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.AppInfo.appInfoGetSupportedTypes",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-AppInfo.html#v:appInfoGetSupportedTypes"
})
#endif
foreign import ccall "g_app_info_launch" g_app_info_launch ::
Ptr AppInfo ->
Ptr (GList (Ptr Gio.File.File)) ->
Ptr Gio.AppLaunchContext.AppLaunchContext ->
Ptr (Ptr GError) ->
IO CInt
appInfoLaunch ::
(B.CallStack.HasCallStack, MonadIO m, IsAppInfo a, Gio.File.IsFile b, Gio.AppLaunchContext.IsAppLaunchContext c) =>
a
-> [b]
-> Maybe (c)
-> m ()
appInfoLaunch :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsAppInfo a, IsFile b,
IsAppLaunchContext c) =>
a -> [b] -> Maybe c -> m ()
appInfoLaunch a
appinfo [b]
files Maybe c
context = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
files' <- mapM unsafeManagedPtrCastPtr files
files'' <- packGList files'
maybeContext <- case context of
Maybe c
Nothing -> Ptr AppLaunchContext -> IO (Ptr AppLaunchContext)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AppLaunchContext
forall a. Ptr a
FP.nullPtr
Just c
jContext -> do
jContext' <- c -> IO (Ptr AppLaunchContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jContext
return jContext'
onException (do
_ <- propagateGError $ g_app_info_launch appinfo' files'' maybeContext
touchManagedPtr appinfo
mapM_ touchManagedPtr files
whenJust context touchManagedPtr
g_list_free files''
return ()
) (do
g_list_free files''
)
#if defined(ENABLE_OVERLOADING)
data AppInfoLaunchMethodInfo
instance (signature ~ ([b] -> Maybe (c) -> m ()), MonadIO m, IsAppInfo a, Gio.File.IsFile b, Gio.AppLaunchContext.IsAppLaunchContext c) => O.OverloadedMethod AppInfoLaunchMethodInfo a signature where
overloadedMethod = appInfoLaunch
instance O.OverloadedMethodInfo AppInfoLaunchMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.AppInfo.appInfoLaunch",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-AppInfo.html#v:appInfoLaunch"
})
#endif
foreign import ccall "g_app_info_launch_uris" g_app_info_launch_uris ::
Ptr AppInfo ->
Ptr (GList CString) ->
Ptr Gio.AppLaunchContext.AppLaunchContext ->
Ptr (Ptr GError) ->
IO CInt
appInfoLaunchUris ::
(B.CallStack.HasCallStack, MonadIO m, IsAppInfo a, Gio.AppLaunchContext.IsAppLaunchContext b) =>
a
-> [T.Text]
-> Maybe (b)
-> m ()
appInfoLaunchUris :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsAppInfo a, IsAppLaunchContext b) =>
a -> [Text] -> Maybe b -> m ()
appInfoLaunchUris a
appinfo [Text]
uris Maybe b
context = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
uris' <- mapM textToCString uris
uris'' <- packGList uris'
maybeContext <- case context of
Maybe b
Nothing -> Ptr AppLaunchContext -> IO (Ptr AppLaunchContext)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AppLaunchContext
forall a. Ptr a
FP.nullPtr
Just b
jContext -> do
jContext' <- b -> IO (Ptr AppLaunchContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jContext
return jContext'
onException (do
_ <- propagateGError $ g_app_info_launch_uris appinfo' uris'' maybeContext
touchManagedPtr appinfo
whenJust context touchManagedPtr
mapGList freeMem uris''
g_list_free uris''
return ()
) (do
mapGList freeMem uris''
g_list_free uris''
)
#if defined(ENABLE_OVERLOADING)
data AppInfoLaunchUrisMethodInfo
instance (signature ~ ([T.Text] -> Maybe (b) -> m ()), MonadIO m, IsAppInfo a, Gio.AppLaunchContext.IsAppLaunchContext b) => O.OverloadedMethod AppInfoLaunchUrisMethodInfo a signature where
overloadedMethod = appInfoLaunchUris
instance O.OverloadedMethodInfo AppInfoLaunchUrisMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.AppInfo.appInfoLaunchUris",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-AppInfo.html#v:appInfoLaunchUris"
})
#endif
foreign import ccall "g_app_info_launch_uris_async" g_app_info_launch_uris_async ::
Ptr AppInfo ->
Ptr (GList CString) ->
Ptr Gio.AppLaunchContext.AppLaunchContext ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
appInfoLaunchUrisAsync ::
(B.CallStack.HasCallStack, MonadIO m, IsAppInfo a, Gio.AppLaunchContext.IsAppLaunchContext b, Gio.Cancellable.IsCancellable c) =>
a
-> [T.Text]
-> Maybe (b)
-> Maybe (c)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
appInfoLaunchUrisAsync :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsAppInfo a, IsAppLaunchContext b,
IsCancellable c) =>
a
-> [Text] -> Maybe b -> Maybe c -> Maybe AsyncReadyCallback -> m ()
appInfoLaunchUrisAsync a
appinfo [Text]
uris Maybe b
context Maybe c
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
uris' <- mapM textToCString uris
uris'' <- packGList uris'
maybeContext <- case context of
Maybe b
Nothing -> Ptr AppLaunchContext -> IO (Ptr AppLaunchContext)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AppLaunchContext
forall a. Ptr a
FP.nullPtr
Just b
jContext -> do
jContext' <- b -> IO (Ptr AppLaunchContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jContext
return jContext'
maybeCancellable <- case cancellable of
Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just c
jCancellable -> do
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
return jCancellable'
maybeCallback <- case callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
g_app_info_launch_uris_async appinfo' uris'' maybeContext maybeCancellable maybeCallback userData
touchManagedPtr appinfo
whenJust context touchManagedPtr
whenJust cancellable touchManagedPtr
mapGList freeMem uris''
g_list_free uris''
return ()
#if defined(ENABLE_OVERLOADING)
data AppInfoLaunchUrisAsyncMethodInfo
instance (signature ~ ([T.Text] -> Maybe (b) -> Maybe (c) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsAppInfo a, Gio.AppLaunchContext.IsAppLaunchContext b, Gio.Cancellable.IsCancellable c) => O.OverloadedMethod AppInfoLaunchUrisAsyncMethodInfo a signature where
overloadedMethod = appInfoLaunchUrisAsync
instance O.OverloadedMethodInfo AppInfoLaunchUrisAsyncMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.AppInfo.appInfoLaunchUrisAsync",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-AppInfo.html#v:appInfoLaunchUrisAsync"
})
#endif
foreign import ccall "g_app_info_launch_uris_finish" g_app_info_launch_uris_finish ::
Ptr AppInfo ->
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
appInfoLaunchUrisFinish ::
(B.CallStack.HasCallStack, MonadIO m, IsAppInfo a, Gio.AsyncResult.IsAsyncResult b) =>
a
-> b
-> m ()
appInfoLaunchUrisFinish :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsAppInfo a, IsAsyncResult b) =>
a -> b -> m ()
appInfoLaunchUrisFinish a
appinfo b
result_ = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
result_' <- unsafeManagedPtrCastPtr result_
onException (do
_ <- propagateGError $ g_app_info_launch_uris_finish appinfo' result_'
touchManagedPtr appinfo
touchManagedPtr result_
return ()
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
data AppInfoLaunchUrisFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsAppInfo a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod AppInfoLaunchUrisFinishMethodInfo a signature where
overloadedMethod = appInfoLaunchUrisFinish
instance O.OverloadedMethodInfo AppInfoLaunchUrisFinishMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.AppInfo.appInfoLaunchUrisFinish",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-AppInfo.html#v:appInfoLaunchUrisFinish"
})
#endif
foreign import ccall "g_app_info_remove_supports_type" g_app_info_remove_supports_type ::
Ptr AppInfo ->
CString ->
Ptr (Ptr GError) ->
IO CInt
appInfoRemoveSupportsType ::
(B.CallStack.HasCallStack, MonadIO m, IsAppInfo a) =>
a
-> T.Text
-> m ()
appInfoRemoveSupportsType :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAppInfo a) =>
a -> Text -> m ()
appInfoRemoveSupportsType a
appinfo Text
contentType = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
contentType' <- textToCString contentType
onException (do
_ <- propagateGError $ g_app_info_remove_supports_type appinfo' contentType'
touchManagedPtr appinfo
freeMem contentType'
return ()
) (do
freeMem contentType'
)
#if defined(ENABLE_OVERLOADING)
data AppInfoRemoveSupportsTypeMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsAppInfo a) => O.OverloadedMethod AppInfoRemoveSupportsTypeMethodInfo a signature where
overloadedMethod = appInfoRemoveSupportsType
instance O.OverloadedMethodInfo AppInfoRemoveSupportsTypeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.AppInfo.appInfoRemoveSupportsType",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-AppInfo.html#v:appInfoRemoveSupportsType"
})
#endif
foreign import ccall "g_app_info_set_as_default_for_extension" g_app_info_set_as_default_for_extension ::
Ptr AppInfo ->
CString ->
Ptr (Ptr GError) ->
IO CInt
appInfoSetAsDefaultForExtension ::
(B.CallStack.HasCallStack, MonadIO m, IsAppInfo a) =>
a
-> [Char]
-> m ()
appInfoSetAsDefaultForExtension :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAppInfo a) =>
a -> String -> m ()
appInfoSetAsDefaultForExtension a
appinfo String
extension = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
extension' <- stringToCString extension
onException (do
_ <- propagateGError $ g_app_info_set_as_default_for_extension appinfo' extension'
touchManagedPtr appinfo
freeMem extension'
return ()
) (do
freeMem extension'
)
#if defined(ENABLE_OVERLOADING)
data AppInfoSetAsDefaultForExtensionMethodInfo
instance (signature ~ ([Char] -> m ()), MonadIO m, IsAppInfo a) => O.OverloadedMethod AppInfoSetAsDefaultForExtensionMethodInfo a signature where
overloadedMethod = appInfoSetAsDefaultForExtension
instance O.OverloadedMethodInfo AppInfoSetAsDefaultForExtensionMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.AppInfo.appInfoSetAsDefaultForExtension",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-AppInfo.html#v:appInfoSetAsDefaultForExtension"
})
#endif
foreign import ccall "g_app_info_set_as_default_for_type" g_app_info_set_as_default_for_type ::
Ptr AppInfo ->
CString ->
Ptr (Ptr GError) ->
IO CInt
appInfoSetAsDefaultForType ::
(B.CallStack.HasCallStack, MonadIO m, IsAppInfo a) =>
a
-> T.Text
-> m ()
appInfoSetAsDefaultForType :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAppInfo a) =>
a -> Text -> m ()
appInfoSetAsDefaultForType a
appinfo Text
contentType = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
contentType' <- textToCString contentType
onException (do
_ <- propagateGError $ g_app_info_set_as_default_for_type appinfo' contentType'
touchManagedPtr appinfo
freeMem contentType'
return ()
) (do
freeMem contentType'
)
#if defined(ENABLE_OVERLOADING)
data AppInfoSetAsDefaultForTypeMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsAppInfo a) => O.OverloadedMethod AppInfoSetAsDefaultForTypeMethodInfo a signature where
overloadedMethod = appInfoSetAsDefaultForType
instance O.OverloadedMethodInfo AppInfoSetAsDefaultForTypeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.AppInfo.appInfoSetAsDefaultForType",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-AppInfo.html#v:appInfoSetAsDefaultForType"
})
#endif
foreign import ccall "g_app_info_set_as_last_used_for_type" g_app_info_set_as_last_used_for_type ::
Ptr AppInfo ->
CString ->
Ptr (Ptr GError) ->
IO CInt
appInfoSetAsLastUsedForType ::
(B.CallStack.HasCallStack, MonadIO m, IsAppInfo a) =>
a
-> T.Text
-> m ()
appInfoSetAsLastUsedForType :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAppInfo a) =>
a -> Text -> m ()
appInfoSetAsLastUsedForType a
appinfo Text
contentType = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
contentType' <- textToCString contentType
onException (do
_ <- propagateGError $ g_app_info_set_as_last_used_for_type appinfo' contentType'
touchManagedPtr appinfo
freeMem contentType'
return ()
) (do
freeMem contentType'
)
#if defined(ENABLE_OVERLOADING)
data AppInfoSetAsLastUsedForTypeMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsAppInfo a) => O.OverloadedMethod AppInfoSetAsLastUsedForTypeMethodInfo a signature where
overloadedMethod = appInfoSetAsLastUsedForType
instance O.OverloadedMethodInfo AppInfoSetAsLastUsedForTypeMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.AppInfo.appInfoSetAsLastUsedForType",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-AppInfo.html#v:appInfoSetAsLastUsedForType"
})
#endif
foreign import ccall "g_app_info_should_show" g_app_info_should_show ::
Ptr AppInfo ->
IO CInt
appInfoShouldShow ::
(B.CallStack.HasCallStack, MonadIO m, IsAppInfo a) =>
a
-> m Bool
appInfoShouldShow :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAppInfo a) =>
a -> m Bool
appInfoShouldShow a
appinfo = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
result <- g_app_info_should_show appinfo'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr appinfo
return result'
#if defined(ENABLE_OVERLOADING)
data AppInfoShouldShowMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAppInfo a) => O.OverloadedMethod AppInfoShouldShowMethodInfo a signature where
overloadedMethod = appInfoShouldShow
instance O.OverloadedMethodInfo AppInfoShouldShowMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.AppInfo.appInfoShouldShow",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-AppInfo.html#v:appInfoShouldShow"
})
#endif
foreign import ccall "g_app_info_supports_files" g_app_info_supports_files ::
Ptr AppInfo ->
IO CInt
appInfoSupportsFiles ::
(B.CallStack.HasCallStack, MonadIO m, IsAppInfo a) =>
a
-> m Bool
appInfoSupportsFiles :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAppInfo a) =>
a -> m Bool
appInfoSupportsFiles a
appinfo = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
result <- g_app_info_supports_files appinfo'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr appinfo
return result'
#if defined(ENABLE_OVERLOADING)
data AppInfoSupportsFilesMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAppInfo a) => O.OverloadedMethod AppInfoSupportsFilesMethodInfo a signature where
overloadedMethod = appInfoSupportsFiles
instance O.OverloadedMethodInfo AppInfoSupportsFilesMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.AppInfo.appInfoSupportsFiles",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-AppInfo.html#v:appInfoSupportsFiles"
})
#endif
foreign import ccall "g_app_info_supports_uris" g_app_info_supports_uris ::
Ptr AppInfo ->
IO CInt
appInfoSupportsUris ::
(B.CallStack.HasCallStack, MonadIO m, IsAppInfo a) =>
a
-> m Bool
appInfoSupportsUris :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAppInfo a) =>
a -> m Bool
appInfoSupportsUris a
appinfo = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
result <- g_app_info_supports_uris appinfo'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr appinfo
return result'
#if defined(ENABLE_OVERLOADING)
data AppInfoSupportsUrisMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAppInfo a) => O.OverloadedMethod AppInfoSupportsUrisMethodInfo a signature where
overloadedMethod = appInfoSupportsUris
instance O.OverloadedMethodInfo AppInfoSupportsUrisMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Interfaces.AppInfo.appInfoSupportsUris",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Interfaces-AppInfo.html#v:appInfoSupportsUris"
})
#endif
foreign import ccall "g_app_info_create_from_commandline" g_app_info_create_from_commandline ::
CString ->
CString ->
CUInt ->
Ptr (Ptr GError) ->
IO (Ptr AppInfo)
appInfoCreateFromCommandline ::
(B.CallStack.HasCallStack, MonadIO m) =>
[Char]
-> Maybe (T.Text)
-> [Gio.Flags.AppInfoCreateFlags]
-> m AppInfo
appInfoCreateFromCommandline :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
String -> Maybe Text -> [AppInfoCreateFlags] -> m AppInfo
appInfoCreateFromCommandline String
commandline Maybe Text
applicationName [AppInfoCreateFlags]
flags = IO AppInfo -> m AppInfo
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AppInfo -> m AppInfo) -> IO AppInfo -> m AppInfo
forall a b. (a -> b) -> a -> b
$ do
commandline' <- String -> IO CString
stringToCString String
commandline
maybeApplicationName <- case applicationName of
Maybe Text
Nothing -> CString -> IO CString
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
FP.nullPtr
Just Text
jApplicationName -> do
jApplicationName' <- Text -> IO CString
textToCString Text
jApplicationName
return jApplicationName'
let flags' = [AppInfoCreateFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [AppInfoCreateFlags]
flags
onException (do
result <- propagateGError $ g_app_info_create_from_commandline commandline' maybeApplicationName flags'
checkUnexpectedReturnNULL "appInfoCreateFromCommandline" result
result' <- (wrapObject AppInfo) result
freeMem commandline'
freeMem maybeApplicationName
return result'
) (do
freeMem commandline'
freeMem maybeApplicationName
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_app_info_get_all" g_app_info_get_all ::
IO (Ptr (GList (Ptr AppInfo)))
appInfoGetAll ::
(B.CallStack.HasCallStack, MonadIO m) =>
m [AppInfo]
appInfoGetAll :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m [AppInfo]
appInfoGetAll = IO [AppInfo] -> m [AppInfo]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [AppInfo] -> m [AppInfo]) -> IO [AppInfo] -> m [AppInfo]
forall a b. (a -> b) -> a -> b
$ do
result <- IO (Ptr (GList (Ptr AppInfo)))
g_app_info_get_all
result' <- unpackGList result
result'' <- mapM (wrapObject AppInfo) result'
g_list_free result
return result''
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_app_info_get_all_for_type" g_app_info_get_all_for_type ::
CString ->
IO (Ptr (GList (Ptr AppInfo)))
appInfoGetAllForType ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m [AppInfo]
appInfoGetAllForType :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m [AppInfo]
appInfoGetAllForType Text
contentType = IO [AppInfo] -> m [AppInfo]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [AppInfo] -> m [AppInfo]) -> IO [AppInfo] -> m [AppInfo]
forall a b. (a -> b) -> a -> b
$ do
contentType' <- Text -> IO CString
textToCString Text
contentType
result <- g_app_info_get_all_for_type contentType'
result' <- unpackGList result
result'' <- mapM (wrapObject AppInfo) result'
g_list_free result
freeMem contentType'
return result''
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_app_info_get_default_for_type" g_app_info_get_default_for_type ::
CString ->
CInt ->
IO (Ptr AppInfo)
appInfoGetDefaultForType ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> Bool
-> m (Maybe AppInfo)
appInfoGetDefaultForType :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> Bool -> m (Maybe AppInfo)
appInfoGetDefaultForType Text
contentType Bool
mustSupportUris = IO (Maybe AppInfo) -> m (Maybe AppInfo)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe AppInfo) -> m (Maybe AppInfo))
-> IO (Maybe AppInfo) -> m (Maybe AppInfo)
forall a b. (a -> b) -> a -> b
$ do
contentType' <- Text -> IO CString
textToCString Text
contentType
let mustSupportUris' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
mustSupportUris
result <- g_app_info_get_default_for_type contentType' mustSupportUris'
maybeResult <- convertIfNonNull result $ \Ptr AppInfo
result' -> do
result'' <- ((ManagedPtr AppInfo -> AppInfo) -> Ptr AppInfo -> IO AppInfo
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr AppInfo -> AppInfo
AppInfo) Ptr AppInfo
result'
return result''
freeMem contentType'
return maybeResult
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_app_info_get_default_for_type_async" g_app_info_get_default_for_type_async ::
CString ->
CInt ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
appInfoGetDefaultForTypeAsync ::
(B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) =>
T.Text
-> Bool
-> Maybe (a)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
appInfoGetDefaultForTypeAsync :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCancellable a) =>
Text -> Bool -> Maybe a -> Maybe AsyncReadyCallback -> m ()
appInfoGetDefaultForTypeAsync Text
contentType Bool
mustSupportUris Maybe a
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
contentType' <- Text -> IO CString
textToCString Text
contentType
let mustSupportUris' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
P.fromEnum) Bool
mustSupportUris
maybeCancellable <- case cancellable of
Maybe a
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just a
jCancellable -> do
jCancellable' <- a -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jCancellable
return jCancellable'
maybeCallback <- case callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
g_app_info_get_default_for_type_async contentType' mustSupportUris' maybeCancellable maybeCallback userData
whenJust cancellable touchManagedPtr
freeMem contentType'
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_app_info_get_default_for_type_finish" g_app_info_get_default_for_type_finish ::
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr AppInfo)
appInfoGetDefaultForTypeFinish ::
(B.CallStack.HasCallStack, MonadIO m, Gio.AsyncResult.IsAsyncResult a) =>
a
-> m AppInfo
appInfoGetDefaultForTypeFinish :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAsyncResult a) =>
a -> m AppInfo
appInfoGetDefaultForTypeFinish a
result_ = IO AppInfo -> m AppInfo
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AppInfo -> m AppInfo) -> IO AppInfo -> m AppInfo
forall a b. (a -> b) -> a -> b
$ do
result_' <- a -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
result_
onException (do
result <- propagateGError $ g_app_info_get_default_for_type_finish result_'
checkUnexpectedReturnNULL "appInfoGetDefaultForTypeFinish" result
result' <- (wrapObject AppInfo) result
touchManagedPtr result_
return result'
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_app_info_get_default_for_uri_scheme" g_app_info_get_default_for_uri_scheme ::
CString ->
IO (Ptr AppInfo)
appInfoGetDefaultForUriScheme ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m (Maybe AppInfo)
appInfoGetDefaultForUriScheme :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m (Maybe AppInfo)
appInfoGetDefaultForUriScheme Text
uriScheme = IO (Maybe AppInfo) -> m (Maybe AppInfo)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe AppInfo) -> m (Maybe AppInfo))
-> IO (Maybe AppInfo) -> m (Maybe AppInfo)
forall a b. (a -> b) -> a -> b
$ do
uriScheme' <- Text -> IO CString
textToCString Text
uriScheme
result <- g_app_info_get_default_for_uri_scheme uriScheme'
maybeResult <- convertIfNonNull result $ \Ptr AppInfo
result' -> do
result'' <- ((ManagedPtr AppInfo -> AppInfo) -> Ptr AppInfo -> IO AppInfo
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr AppInfo -> AppInfo
AppInfo) Ptr AppInfo
result'
return result''
freeMem uriScheme'
return maybeResult
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_app_info_get_default_for_uri_scheme_async" g_app_info_get_default_for_uri_scheme_async ::
CString ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
appInfoGetDefaultForUriSchemeAsync ::
(B.CallStack.HasCallStack, MonadIO m, Gio.Cancellable.IsCancellable a) =>
T.Text
-> Maybe (a)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
appInfoGetDefaultForUriSchemeAsync :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsCancellable a) =>
Text -> Maybe a -> Maybe AsyncReadyCallback -> m ()
appInfoGetDefaultForUriSchemeAsync Text
uriScheme Maybe a
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
uriScheme' <- Text -> IO CString
textToCString Text
uriScheme
maybeCancellable <- case cancellable of
Maybe a
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just a
jCancellable -> do
jCancellable' <- a -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jCancellable
return jCancellable'
maybeCallback <- case callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
g_app_info_get_default_for_uri_scheme_async uriScheme' maybeCancellable maybeCallback userData
whenJust cancellable touchManagedPtr
freeMem uriScheme'
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_app_info_get_default_for_uri_scheme_finish" g_app_info_get_default_for_uri_scheme_finish ::
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO (Ptr AppInfo)
appInfoGetDefaultForUriSchemeFinish ::
(B.CallStack.HasCallStack, MonadIO m, Gio.AsyncResult.IsAsyncResult a) =>
a
-> m AppInfo
appInfoGetDefaultForUriSchemeFinish :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAsyncResult a) =>
a -> m AppInfo
appInfoGetDefaultForUriSchemeFinish a
result_ = IO AppInfo -> m AppInfo
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AppInfo -> m AppInfo) -> IO AppInfo -> m AppInfo
forall a b. (a -> b) -> a -> b
$ do
result_' <- a -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
result_
onException (do
result <- propagateGError $ g_app_info_get_default_for_uri_scheme_finish result_'
checkUnexpectedReturnNULL "appInfoGetDefaultForUriSchemeFinish" result
result' <- (wrapObject AppInfo) result
touchManagedPtr result_
return result'
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_app_info_get_fallback_for_type" g_app_info_get_fallback_for_type ::
CString ->
IO (Ptr (GList (Ptr AppInfo)))
appInfoGetFallbackForType ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m [AppInfo]
appInfoGetFallbackForType :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m [AppInfo]
appInfoGetFallbackForType Text
contentType = IO [AppInfo] -> m [AppInfo]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [AppInfo] -> m [AppInfo]) -> IO [AppInfo] -> m [AppInfo]
forall a b. (a -> b) -> a -> b
$ do
contentType' <- Text -> IO CString
textToCString Text
contentType
result <- g_app_info_get_fallback_for_type contentType'
result' <- unpackGList result
result'' <- mapM (wrapObject AppInfo) result'
g_list_free result
freeMem contentType'
return result''
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_app_info_get_recommended_for_type" g_app_info_get_recommended_for_type ::
CString ->
IO (Ptr (GList (Ptr AppInfo)))
appInfoGetRecommendedForType ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m [AppInfo]
appInfoGetRecommendedForType :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m [AppInfo]
appInfoGetRecommendedForType Text
contentType = IO [AppInfo] -> m [AppInfo]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [AppInfo] -> m [AppInfo]) -> IO [AppInfo] -> m [AppInfo]
forall a b. (a -> b) -> a -> b
$ do
contentType' <- Text -> IO CString
textToCString Text
contentType
result <- g_app_info_get_recommended_for_type contentType'
result' <- unpackGList result
result'' <- mapM (wrapObject AppInfo) result'
g_list_free result
freeMem contentType'
return result''
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_app_info_launch_default_for_uri" g_app_info_launch_default_for_uri ::
CString ->
Ptr Gio.AppLaunchContext.AppLaunchContext ->
Ptr (Ptr GError) ->
IO CInt
appInfoLaunchDefaultForUri ::
(B.CallStack.HasCallStack, MonadIO m, Gio.AppLaunchContext.IsAppLaunchContext a) =>
T.Text
-> Maybe (a)
-> m ()
appInfoLaunchDefaultForUri :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAppLaunchContext a) =>
Text -> Maybe a -> m ()
appInfoLaunchDefaultForUri Text
uri Maybe a
context = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
uri' <- Text -> IO CString
textToCString Text
uri
maybeContext <- case context of
Maybe a
Nothing -> Ptr AppLaunchContext -> IO (Ptr AppLaunchContext)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AppLaunchContext
forall a. Ptr a
FP.nullPtr
Just a
jContext -> do
jContext' <- a -> IO (Ptr AppLaunchContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jContext
return jContext'
onException (do
_ <- propagateGError $ g_app_info_launch_default_for_uri uri' maybeContext
whenJust context touchManagedPtr
freeMem uri'
return ()
) (do
freeMem uri'
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_app_info_launch_default_for_uri_async" g_app_info_launch_default_for_uri_async ::
CString ->
Ptr Gio.AppLaunchContext.AppLaunchContext ->
Ptr Gio.Cancellable.Cancellable ->
FunPtr Gio.Callbacks.C_AsyncReadyCallback ->
Ptr () ->
IO ()
appInfoLaunchDefaultForUriAsync ::
(B.CallStack.HasCallStack, MonadIO m, Gio.AppLaunchContext.IsAppLaunchContext a, Gio.Cancellable.IsCancellable b) =>
T.Text
-> Maybe (a)
-> Maybe (b)
-> Maybe (Gio.Callbacks.AsyncReadyCallback)
-> m ()
appInfoLaunchDefaultForUriAsync :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsAppLaunchContext a, IsCancellable b) =>
Text -> Maybe a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
appInfoLaunchDefaultForUriAsync Text
uri Maybe a
context Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
uri' <- Text -> IO CString
textToCString Text
uri
maybeContext <- case context of
Maybe a
Nothing -> Ptr AppLaunchContext -> IO (Ptr AppLaunchContext)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AppLaunchContext
forall a. Ptr a
FP.nullPtr
Just a
jContext -> do
jContext' <- a -> IO (Ptr AppLaunchContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jContext
return jContext'
maybeCancellable <- case cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
FP.nullPtr
Just b
jCancellable -> do
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
return jCancellable'
maybeCallback <- case callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
forall a. FunPtr a
FP.nullFunPtr
Just AsyncReadyCallback
jCallback -> do
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
poke ptrcallback jCallback'
return jCallback'
let userData = Ptr a
forall a. Ptr a
nullPtr
g_app_info_launch_default_for_uri_async uri' maybeContext maybeCancellable maybeCallback userData
whenJust context touchManagedPtr
whenJust cancellable touchManagedPtr
freeMem uri'
return ()
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_app_info_launch_default_for_uri_finish" g_app_info_launch_default_for_uri_finish ::
Ptr Gio.AsyncResult.AsyncResult ->
Ptr (Ptr GError) ->
IO CInt
appInfoLaunchDefaultForUriFinish ::
(B.CallStack.HasCallStack, MonadIO m, Gio.AsyncResult.IsAsyncResult a) =>
a
-> m ()
appInfoLaunchDefaultForUriFinish :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsAsyncResult a) =>
a -> m ()
appInfoLaunchDefaultForUriFinish a
result_ = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
result_' <- a -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
result_
onException (do
_ <- propagateGError $ g_app_info_launch_default_for_uri_finish result_'
touchManagedPtr result_
return ()
) (do
return ()
)
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_app_info_reset_type_associations" g_app_info_reset_type_associations ::
CString ->
IO ()
appInfoResetTypeAssociations ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m ()
appInfoResetTypeAssociations :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m ()
appInfoResetTypeAssociations Text
contentType = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
contentType' <- Text -> IO CString
textToCString Text
contentType
g_app_info_reset_type_associations contentType'
freeMem contentType'
return ()
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList AppInfo = AppInfoSignalList
type AppInfoSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif