{-# 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 ,
appInfoGetDefaultForUriScheme ,
#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.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import {-# SOURCE #-} qualified GI.Gio.Flags as Gio.Flags
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import {-# SOURCE #-} qualified GI.Gio.Interfaces.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
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
/= :: AppInfo -> AppInfo -> Bool
$c/= :: AppInfo -> AppInfo -> Bool
== :: AppInfo -> AppInfo -> Bool
$c== :: 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
instance B.GValue.IsGValue AppInfo where
toGValue :: AppInfo -> IO GValue
toGValue AppInfo
o = do
GType
gtype <- IO GType
c_g_app_info_get_type
AppInfo -> (Ptr AppInfo -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr AppInfo
o (GType
-> (GValue -> Ptr AppInfo -> IO ()) -> Ptr AppInfo -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr AppInfo -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO AppInfo
fromGValue GValue
gv = do
Ptr AppInfo
ptr <- GValue -> IO (Ptr AppInfo)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr AppInfo)
(ManagedPtr AppInfo -> AppInfo) -> Ptr AppInfo -> IO AppInfo
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr AppInfo -> AppInfo
AppInfo Ptr AppInfo
ptr
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 :: (MonadIO m, IsAppInfo o) => o -> m AppInfo
toAppInfo :: o -> m AppInfo
toAppInfo = IO AppInfo -> m AppInfo
forall (m :: * -> *) a. MonadIO m => IO a -> m a
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'
unsafeCastTo ManagedPtr AppInfo -> AppInfo
AppInfo
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList AppInfo
type instance O.AttributeList AppInfo = AppInfoAttributeList
type AppInfoAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveAppInfoMethod (t :: Symbol) (o :: *) :: * 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.MethodInfo 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
#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 :: a -> Text -> m ()
appInfoAddSupportsType a
appinfo Text
contentType = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr AppInfo
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
CString
contentType' <- Text -> IO CString
textToCString Text
contentType
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr AppInfo -> CString -> Ptr (Ptr GError) -> IO CInt
g_app_info_add_supports_type Ptr AppInfo
appinfo' CString
contentType'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
appinfo
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
contentType'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
contentType'
)
#if defined(ENABLE_OVERLOADING)
data AppInfoAddSupportsTypeMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsAppInfo a) => O.MethodInfo AppInfoAddSupportsTypeMethodInfo a signature where
overloadedMethod = 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 :: a -> m Bool
appInfoCanDelete a
appinfo = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr AppInfo
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
CInt
result <- Ptr AppInfo -> IO CInt
g_app_info_can_delete Ptr AppInfo
appinfo'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
appinfo
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data AppInfoCanDeleteMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAppInfo a) => O.MethodInfo AppInfoCanDeleteMethodInfo a signature where
overloadedMethod = 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 :: a -> m Bool
appInfoCanRemoveSupportsType a
appinfo = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr AppInfo
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
CInt
result <- Ptr AppInfo -> IO CInt
g_app_info_can_remove_supports_type Ptr AppInfo
appinfo'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
appinfo
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data AppInfoCanRemoveSupportsTypeMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAppInfo a) => O.MethodInfo AppInfoCanRemoveSupportsTypeMethodInfo a signature where
overloadedMethod = 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 :: a -> m Bool
appInfoDelete a
appinfo = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr AppInfo
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
CInt
result <- Ptr AppInfo -> IO CInt
g_app_info_delete Ptr AppInfo
appinfo'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
appinfo
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data AppInfoDeleteMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAppInfo a) => O.MethodInfo AppInfoDeleteMethodInfo a signature where
overloadedMethod = 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 :: a -> m AppInfo
appInfoDup a
appinfo = IO AppInfo -> m AppInfo
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
Ptr AppInfo
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
Ptr AppInfo
result <- Ptr AppInfo -> IO (Ptr AppInfo)
g_app_info_dup Ptr AppInfo
appinfo'
Text -> Ptr AppInfo -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"appInfoDup" Ptr AppInfo
result
AppInfo
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
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
appinfo
AppInfo -> IO AppInfo
forall (m :: * -> *) a. Monad m => a -> m a
return AppInfo
result'
#if defined(ENABLE_OVERLOADING)
data AppInfoDupMethodInfo
instance (signature ~ (m AppInfo), MonadIO m, IsAppInfo a) => O.MethodInfo AppInfoDupMethodInfo a signature where
overloadedMethod = 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 :: a -> b -> m Bool
appInfoEqual a
appinfo1 b
appinfo2 = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr AppInfo
appinfo1' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo1
Ptr AppInfo
appinfo2' <- b -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
appinfo2
CInt
result <- Ptr AppInfo -> Ptr AppInfo -> IO CInt
g_app_info_equal Ptr AppInfo
appinfo1' Ptr AppInfo
appinfo2'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
appinfo1
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
appinfo2
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data AppInfoEqualMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsAppInfo a, IsAppInfo b) => O.MethodInfo AppInfoEqualMethodInfo a signature where
overloadedMethod = 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 [Char]
appInfoGetCommandline :: a -> m [Char]
appInfoGetCommandline a
appinfo = IO [Char] -> m [Char]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Char] -> m [Char]) -> IO [Char] -> m [Char]
forall a b. (a -> b) -> a -> b
$ do
Ptr AppInfo
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
CString
result <- Ptr AppInfo -> IO CString
g_app_info_get_commandline Ptr AppInfo
appinfo'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"appInfoGetCommandline" CString
result
[Char]
result' <- HasCallStack => CString -> IO [Char]
CString -> IO [Char]
cstringToString CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
appinfo
[Char] -> IO [Char]
forall (m :: * -> *) a. Monad m => a -> m a
return [Char]
result'
#if defined(ENABLE_OVERLOADING)
data AppInfoGetCommandlineMethodInfo
instance (signature ~ (m [Char]), MonadIO m, IsAppInfo a) => O.MethodInfo AppInfoGetCommandlineMethodInfo a signature where
overloadedMethod = 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 T.Text
appInfoGetDescription :: a -> m Text
appInfoGetDescription a
appinfo = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr AppInfo
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
CString
result <- Ptr AppInfo -> IO CString
g_app_info_get_description Ptr AppInfo
appinfo'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"appInfoGetDescription" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
appinfo
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data AppInfoGetDescriptionMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsAppInfo a) => O.MethodInfo AppInfoGetDescriptionMethodInfo a signature where
overloadedMethod = 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 :: a -> m Text
appInfoGetDisplayName a
appinfo = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr AppInfo
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
CString
result <- Ptr AppInfo -> IO CString
g_app_info_get_display_name Ptr AppInfo
appinfo'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"appInfoGetDisplayName" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
appinfo
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data AppInfoGetDisplayNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsAppInfo a) => O.MethodInfo AppInfoGetDisplayNameMethodInfo a signature where
overloadedMethod = 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 :: a -> m [Char]
appInfoGetExecutable a
appinfo = IO [Char] -> m [Char]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Char] -> m [Char]) -> IO [Char] -> m [Char]
forall a b. (a -> b) -> a -> b
$ do
Ptr AppInfo
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
CString
result <- Ptr AppInfo -> IO CString
g_app_info_get_executable Ptr AppInfo
appinfo'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"appInfoGetExecutable" CString
result
[Char]
result' <- HasCallStack => CString -> IO [Char]
CString -> IO [Char]
cstringToString CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
appinfo
[Char] -> IO [Char]
forall (m :: * -> *) a. Monad m => a -> m a
return [Char]
result'
#if defined(ENABLE_OVERLOADING)
data AppInfoGetExecutableMethodInfo
instance (signature ~ (m [Char]), MonadIO m, IsAppInfo a) => O.MethodInfo AppInfoGetExecutableMethodInfo a signature where
overloadedMethod = 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 :: a -> m (Maybe Icon)
appInfoGetIcon a
appinfo = IO (Maybe Icon) -> m (Maybe Icon)
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
Ptr AppInfo
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
Ptr Icon
result <- Ptr AppInfo -> IO (Ptr Icon)
g_app_info_get_icon Ptr AppInfo
appinfo'
Maybe Icon
maybeResult <- Ptr Icon -> (Ptr Icon -> IO Icon) -> IO (Maybe Icon)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Icon
result ((Ptr Icon -> IO Icon) -> IO (Maybe Icon))
-> (Ptr Icon -> IO Icon) -> IO (Maybe Icon)
forall a b. (a -> b) -> a -> b
$ \Ptr Icon
result' -> do
Icon
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'
Icon -> IO Icon
forall (m :: * -> *) a. Monad m => a -> m a
return Icon
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
appinfo
Maybe Icon -> IO (Maybe Icon)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Icon
maybeResult
#if defined(ENABLE_OVERLOADING)
data AppInfoGetIconMethodInfo
instance (signature ~ (m (Maybe Gio.Icon.Icon)), MonadIO m, IsAppInfo a) => O.MethodInfo AppInfoGetIconMethodInfo a signature where
overloadedMethod = 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 T.Text
appInfoGetId :: a -> m Text
appInfoGetId a
appinfo = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr AppInfo
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
CString
result <- Ptr AppInfo -> IO CString
g_app_info_get_id Ptr AppInfo
appinfo'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"appInfoGetId" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
appinfo
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data AppInfoGetIdMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsAppInfo a) => O.MethodInfo AppInfoGetIdMethodInfo a signature where
overloadedMethod = 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 :: a -> m Text
appInfoGetName a
appinfo = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr AppInfo
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
CString
result <- Ptr AppInfo -> IO CString
g_app_info_get_name Ptr AppInfo
appinfo'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"appInfoGetName" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
appinfo
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data AppInfoGetNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsAppInfo a) => O.MethodInfo AppInfoGetNameMethodInfo a signature where
overloadedMethod = 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 :: a -> m [Text]
appInfoGetSupportedTypes a
appinfo = IO [Text] -> m [Text]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Text] -> m [Text]) -> IO [Text] -> m [Text]
forall a b. (a -> b) -> a -> b
$ do
Ptr AppInfo
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
Ptr CString
result <- Ptr AppInfo -> IO (Ptr CString)
g_app_info_get_supported_types Ptr AppInfo
appinfo'
Text -> Ptr CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"appInfoGetSupportedTypes" Ptr CString
result
[Text]
result' <- HasCallStack => Ptr CString -> IO [Text]
Ptr CString -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
appinfo
[Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result'
#if defined(ENABLE_OVERLOADING)
data AppInfoGetSupportedTypesMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m, IsAppInfo a) => O.MethodInfo AppInfoGetSupportedTypesMethodInfo a signature where
overloadedMethod = 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 :: a -> [b] -> Maybe c -> m ()
appInfoLaunch a
appinfo [b]
files Maybe c
context = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr AppInfo
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
[Ptr File]
files' <- (b -> IO (Ptr File)) -> [b] -> IO [Ptr File]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM b -> IO (Ptr File)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr [b]
files
Ptr (GList (Ptr File))
files'' <- [Ptr File] -> IO (Ptr (GList (Ptr File)))
forall a. [Ptr a] -> IO (Ptr (GList (Ptr a)))
packGList [Ptr File]
files'
Ptr AppLaunchContext
maybeContext <- case Maybe c
context of
Maybe c
Nothing -> Ptr AppLaunchContext -> IO (Ptr AppLaunchContext)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AppLaunchContext
forall a. Ptr a
nullPtr
Just c
jContext -> do
Ptr AppLaunchContext
jContext' <- c -> IO (Ptr AppLaunchContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jContext
Ptr AppLaunchContext -> IO (Ptr AppLaunchContext)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AppLaunchContext
jContext'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr AppInfo
-> Ptr (GList (Ptr File))
-> Ptr AppLaunchContext
-> Ptr (Ptr GError)
-> IO CInt
g_app_info_launch Ptr AppInfo
appinfo' Ptr (GList (Ptr File))
files'' Ptr AppLaunchContext
maybeContext
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
appinfo
(b -> IO ()) -> [b] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [b]
files
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
context c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Ptr (GList (Ptr File)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr File))
files''
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
Ptr (GList (Ptr File)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr File))
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.MethodInfo AppInfoLaunchMethodInfo a signature where
overloadedMethod = 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 :: a -> [Text] -> Maybe b -> m ()
appInfoLaunchUris a
appinfo [Text]
uris Maybe b
context = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr AppInfo
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
[CString]
uris' <- (Text -> IO CString) -> [Text] -> IO [CString]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM Text -> IO CString
textToCString [Text]
uris
Ptr (GList CString)
uris'' <- [CString] -> IO (Ptr (GList CString))
forall a. [Ptr a] -> IO (Ptr (GList (Ptr a)))
packGList [CString]
uris'
Ptr AppLaunchContext
maybeContext <- case Maybe b
context of
Maybe b
Nothing -> Ptr AppLaunchContext -> IO (Ptr AppLaunchContext)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AppLaunchContext
forall a. Ptr a
nullPtr
Just b
jContext -> do
Ptr AppLaunchContext
jContext' <- b -> IO (Ptr AppLaunchContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jContext
Ptr AppLaunchContext -> IO (Ptr AppLaunchContext)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AppLaunchContext
jContext'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr AppInfo
-> Ptr (GList CString)
-> Ptr AppLaunchContext
-> Ptr (Ptr GError)
-> IO CInt
g_app_info_launch_uris Ptr AppInfo
appinfo' Ptr (GList CString)
uris'' Ptr AppLaunchContext
maybeContext
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
appinfo
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
context b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
(CString -> IO ()) -> Ptr (GList CString) -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (GList (Ptr a)) -> IO ()
mapGList CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (GList CString)
uris''
Ptr (GList CString) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList CString)
uris''
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
(CString -> IO ()) -> Ptr (GList CString) -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (GList (Ptr a)) -> IO ()
mapGList CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (GList CString)
uris''
Ptr (GList CString) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList CString)
uris''
)
#if defined(ENABLE_OVERLOADING)
data AppInfoLaunchUrisMethodInfo
instance (signature ~ ([T.Text] -> Maybe (b) -> m ()), MonadIO m, IsAppInfo a, Gio.AppLaunchContext.IsAppLaunchContext b) => O.MethodInfo AppInfoLaunchUrisMethodInfo a signature where
overloadedMethod = 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 :: 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 (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr AppInfo
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
[CString]
uris' <- (Text -> IO CString) -> [Text] -> IO [CString]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM Text -> IO CString
textToCString [Text]
uris
Ptr (GList CString)
uris'' <- [CString] -> IO (Ptr (GList CString))
forall a. [Ptr a] -> IO (Ptr (GList (Ptr a)))
packGList [CString]
uris'
Ptr AppLaunchContext
maybeContext <- case Maybe b
context of
Maybe b
Nothing -> Ptr AppLaunchContext -> IO (Ptr AppLaunchContext)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AppLaunchContext
forall a. Ptr a
nullPtr
Just b
jContext -> do
Ptr AppLaunchContext
jContext' <- b -> IO (Ptr AppLaunchContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jContext
Ptr AppLaunchContext -> IO (Ptr AppLaunchContext)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AppLaunchContext
jContext'
Ptr Cancellable
maybeCancellable <- case Maybe c
cancellable of
Maybe c
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just c
jCancellable -> do
Ptr Cancellable
jCancellable' <- c -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
Ptr AppInfo
-> Ptr (GList CString)
-> Ptr AppLaunchContext
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_app_info_launch_uris_async Ptr AppInfo
appinfo' Ptr (GList CString)
uris'' Ptr AppLaunchContext
maybeContext Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
appinfo
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
context b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe c -> (c -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe c
cancellable c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
(CString -> IO ()) -> Ptr (GList CString) -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (GList (Ptr a)) -> IO ()
mapGList CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (GList CString)
uris''
Ptr (GList CString) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList CString)
uris''
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
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.MethodInfo AppInfoLaunchUrisAsyncMethodInfo a signature where
overloadedMethod = 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 :: a -> b -> m ()
appInfoLaunchUrisFinish a
appinfo b
result_ = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr AppInfo
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
Ptr AsyncResult
result_' <- b -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
result_
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr AppInfo -> Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
g_app_info_launch_uris_finish Ptr AppInfo
appinfo' Ptr AsyncResult
result_'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
appinfo
b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
result_
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data AppInfoLaunchUrisFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsAppInfo a, Gio.AsyncResult.IsAsyncResult b) => O.MethodInfo AppInfoLaunchUrisFinishMethodInfo a signature where
overloadedMethod = 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 :: a -> Text -> m ()
appInfoRemoveSupportsType a
appinfo Text
contentType = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr AppInfo
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
CString
contentType' <- Text -> IO CString
textToCString Text
contentType
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr AppInfo -> CString -> Ptr (Ptr GError) -> IO CInt
g_app_info_remove_supports_type Ptr AppInfo
appinfo' CString
contentType'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
appinfo
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
contentType'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
contentType'
)
#if defined(ENABLE_OVERLOADING)
data AppInfoRemoveSupportsTypeMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsAppInfo a) => O.MethodInfo AppInfoRemoveSupportsTypeMethodInfo a signature where
overloadedMethod = 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 :: a -> [Char] -> m ()
appInfoSetAsDefaultForExtension a
appinfo [Char]
extension = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr AppInfo
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
CString
extension' <- [Char] -> IO CString
stringToCString [Char]
extension
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr AppInfo -> CString -> Ptr (Ptr GError) -> IO CInt
g_app_info_set_as_default_for_extension Ptr AppInfo
appinfo' CString
extension'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
appinfo
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
extension'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
extension'
)
#if defined(ENABLE_OVERLOADING)
data AppInfoSetAsDefaultForExtensionMethodInfo
instance (signature ~ ([Char] -> m ()), MonadIO m, IsAppInfo a) => O.MethodInfo AppInfoSetAsDefaultForExtensionMethodInfo a signature where
overloadedMethod = 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 :: a -> Text -> m ()
appInfoSetAsDefaultForType a
appinfo Text
contentType = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr AppInfo
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
CString
contentType' <- Text -> IO CString
textToCString Text
contentType
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr AppInfo -> CString -> Ptr (Ptr GError) -> IO CInt
g_app_info_set_as_default_for_type Ptr AppInfo
appinfo' CString
contentType'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
appinfo
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
contentType'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
contentType'
)
#if defined(ENABLE_OVERLOADING)
data AppInfoSetAsDefaultForTypeMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsAppInfo a) => O.MethodInfo AppInfoSetAsDefaultForTypeMethodInfo a signature where
overloadedMethod = 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 :: a -> Text -> m ()
appInfoSetAsLastUsedForType a
appinfo Text
contentType = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr AppInfo
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
CString
contentType' <- Text -> IO CString
textToCString Text
contentType
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr AppInfo -> CString -> Ptr (Ptr GError) -> IO CInt
g_app_info_set_as_last_used_for_type Ptr AppInfo
appinfo' CString
contentType'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
appinfo
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
contentType'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
contentType'
)
#if defined(ENABLE_OVERLOADING)
data AppInfoSetAsLastUsedForTypeMethodInfo
instance (signature ~ (T.Text -> m ()), MonadIO m, IsAppInfo a) => O.MethodInfo AppInfoSetAsLastUsedForTypeMethodInfo a signature where
overloadedMethod = 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 :: a -> m Bool
appInfoShouldShow a
appinfo = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr AppInfo
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
CInt
result <- Ptr AppInfo -> IO CInt
g_app_info_should_show Ptr AppInfo
appinfo'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
appinfo
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data AppInfoShouldShowMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAppInfo a) => O.MethodInfo AppInfoShouldShowMethodInfo a signature where
overloadedMethod = 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 :: a -> m Bool
appInfoSupportsFiles a
appinfo = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr AppInfo
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
CInt
result <- Ptr AppInfo -> IO CInt
g_app_info_supports_files Ptr AppInfo
appinfo'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
appinfo
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data AppInfoSupportsFilesMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAppInfo a) => O.MethodInfo AppInfoSupportsFilesMethodInfo a signature where
overloadedMethod = 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 :: a -> m Bool
appInfoSupportsUris a
appinfo = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr AppInfo
appinfo' <- a -> IO (Ptr AppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
CInt
result <- Ptr AppInfo -> IO CInt
g_app_info_supports_uris Ptr AppInfo
appinfo'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
appinfo
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data AppInfoSupportsUrisMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAppInfo a) => O.MethodInfo AppInfoSupportsUrisMethodInfo a signature where
overloadedMethod = 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 :: [Char] -> Maybe Text -> [AppInfoCreateFlags] -> m AppInfo
appInfoCreateFromCommandline [Char]
commandline Maybe Text
applicationName [AppInfoCreateFlags]
flags = IO AppInfo -> m AppInfo
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
CString
commandline' <- [Char] -> IO CString
stringToCString [Char]
commandline
CString
maybeApplicationName <- case Maybe Text
applicationName of
Maybe Text
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just Text
jApplicationName -> do
CString
jApplicationName' <- Text -> IO CString
textToCString Text
jApplicationName
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jApplicationName'
let flags' :: CUInt
flags' = [AppInfoCreateFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [AppInfoCreateFlags]
flags
IO AppInfo -> IO () -> IO AppInfo
forall a b. IO a -> IO b -> IO a
onException (do
Ptr AppInfo
result <- (Ptr (Ptr GError) -> IO (Ptr AppInfo)) -> IO (Ptr AppInfo)
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO (Ptr AppInfo)) -> IO (Ptr AppInfo))
-> (Ptr (Ptr GError) -> IO (Ptr AppInfo)) -> IO (Ptr AppInfo)
forall a b. (a -> b) -> a -> b
$ CString -> CString -> CUInt -> Ptr (Ptr GError) -> IO (Ptr AppInfo)
g_app_info_create_from_commandline CString
commandline' CString
maybeApplicationName CUInt
flags'
Text -> Ptr AppInfo -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"appInfoCreateFromCommandline" Ptr AppInfo
result
AppInfo
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
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
commandline'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeApplicationName
AppInfo -> IO AppInfo
forall (m :: * -> *) a. Monad m => a -> m a
return AppInfo
result'
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
commandline'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
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 :: m [AppInfo]
appInfoGetAll = IO [AppInfo] -> m [AppInfo]
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
Ptr (GList (Ptr AppInfo))
result <- IO (Ptr (GList (Ptr AppInfo)))
g_app_info_get_all
[Ptr AppInfo]
result' <- Ptr (GList (Ptr AppInfo)) -> IO [Ptr AppInfo]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr AppInfo))
result
[AppInfo]
result'' <- (Ptr AppInfo -> IO AppInfo) -> [Ptr AppInfo] -> IO [AppInfo]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((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'
Ptr (GList (Ptr AppInfo)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr AppInfo))
result
[AppInfo] -> IO [AppInfo]
forall (m :: * -> *) a. Monad m => a -> m a
return [AppInfo]
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 :: Text -> m [AppInfo]
appInfoGetAllForType Text
contentType = IO [AppInfo] -> m [AppInfo]
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
CString
contentType' <- Text -> IO CString
textToCString Text
contentType
Ptr (GList (Ptr AppInfo))
result <- CString -> IO (Ptr (GList (Ptr AppInfo)))
g_app_info_get_all_for_type CString
contentType'
[Ptr AppInfo]
result' <- Ptr (GList (Ptr AppInfo)) -> IO [Ptr AppInfo]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr AppInfo))
result
[AppInfo]
result'' <- (Ptr AppInfo -> IO AppInfo) -> [Ptr AppInfo] -> IO [AppInfo]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((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'
Ptr (GList (Ptr AppInfo)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr AppInfo))
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
contentType'
[AppInfo] -> IO [AppInfo]
forall (m :: * -> *) a. Monad m => a -> m a
return [AppInfo]
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 AppInfo
appInfoGetDefaultForType :: Text -> Bool -> m AppInfo
appInfoGetDefaultForType Text
contentType Bool
mustSupportUris = IO AppInfo -> m AppInfo
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
CString
contentType' <- Text -> IO CString
textToCString Text
contentType
let mustSupportUris' :: CInt
mustSupportUris' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
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
fromEnum) Bool
mustSupportUris
Ptr AppInfo
result <- CString -> CInt -> IO (Ptr AppInfo)
g_app_info_get_default_for_type CString
contentType' CInt
mustSupportUris'
Text -> Ptr AppInfo -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"appInfoGetDefaultForType" Ptr AppInfo
result
AppInfo
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
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
contentType'
AppInfo -> IO AppInfo
forall (m :: * -> *) a. Monad m => a -> m a
return AppInfo
result'
#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 AppInfo
appInfoGetDefaultForUriScheme :: Text -> m AppInfo
appInfoGetDefaultForUriScheme Text
uriScheme = IO AppInfo -> m AppInfo
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
CString
uriScheme' <- Text -> IO CString
textToCString Text
uriScheme
Ptr AppInfo
result <- CString -> IO (Ptr AppInfo)
g_app_info_get_default_for_uri_scheme CString
uriScheme'
Text -> Ptr AppInfo -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"appInfoGetDefaultForUriScheme" Ptr AppInfo
result
AppInfo
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
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uriScheme'
AppInfo -> IO AppInfo
forall (m :: * -> *) a. Monad m => a -> m a
return AppInfo
result'
#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 :: Text -> m [AppInfo]
appInfoGetFallbackForType Text
contentType = IO [AppInfo] -> m [AppInfo]
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
CString
contentType' <- Text -> IO CString
textToCString Text
contentType
Ptr (GList (Ptr AppInfo))
result <- CString -> IO (Ptr (GList (Ptr AppInfo)))
g_app_info_get_fallback_for_type CString
contentType'
[Ptr AppInfo]
result' <- Ptr (GList (Ptr AppInfo)) -> IO [Ptr AppInfo]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr AppInfo))
result
[AppInfo]
result'' <- (Ptr AppInfo -> IO AppInfo) -> [Ptr AppInfo] -> IO [AppInfo]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((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'
Ptr (GList (Ptr AppInfo)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr AppInfo))
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
contentType'
[AppInfo] -> IO [AppInfo]
forall (m :: * -> *) a. Monad m => a -> m a
return [AppInfo]
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 :: Text -> m [AppInfo]
appInfoGetRecommendedForType Text
contentType = IO [AppInfo] -> m [AppInfo]
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
CString
contentType' <- Text -> IO CString
textToCString Text
contentType
Ptr (GList (Ptr AppInfo))
result <- CString -> IO (Ptr (GList (Ptr AppInfo)))
g_app_info_get_recommended_for_type CString
contentType'
[Ptr AppInfo]
result' <- Ptr (GList (Ptr AppInfo)) -> IO [Ptr AppInfo]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr AppInfo))
result
[AppInfo]
result'' <- (Ptr AppInfo -> IO AppInfo) -> [Ptr AppInfo] -> IO [AppInfo]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((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'
Ptr (GList (Ptr AppInfo)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr AppInfo))
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
contentType'
[AppInfo] -> IO [AppInfo]
forall (m :: * -> *) a. Monad m => a -> m a
return [AppInfo]
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 :: Text -> Maybe a -> m ()
appInfoLaunchDefaultForUri Text
uri Maybe a
context = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
CString
uri' <- Text -> IO CString
textToCString Text
uri
Ptr AppLaunchContext
maybeContext <- case Maybe a
context of
Maybe a
Nothing -> Ptr AppLaunchContext -> IO (Ptr AppLaunchContext)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AppLaunchContext
forall a. Ptr a
nullPtr
Just a
jContext -> do
Ptr AppLaunchContext
jContext' <- a -> IO (Ptr AppLaunchContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jContext
Ptr AppLaunchContext -> IO (Ptr AppLaunchContext)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AppLaunchContext
jContext'
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ CString -> Ptr AppLaunchContext -> Ptr (Ptr GError) -> IO CInt
g_app_info_launch_default_for_uri CString
uri' Ptr AppLaunchContext
maybeContext
Maybe a -> (a -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe a
context a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uri'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
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 :: Text -> Maybe a -> Maybe b -> Maybe AsyncReadyCallback -> m ()
appInfoLaunchDefaultForUriAsync Text
uri Maybe a
context Maybe b
cancellable Maybe AsyncReadyCallback
callback = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
CString
uri' <- Text -> IO CString
textToCString Text
uri
Ptr AppLaunchContext
maybeContext <- case Maybe a
context of
Maybe a
Nothing -> Ptr AppLaunchContext -> IO (Ptr AppLaunchContext)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AppLaunchContext
forall a. Ptr a
nullPtr
Just a
jContext -> do
Ptr AppLaunchContext
jContext' <- a -> IO (Ptr AppLaunchContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
jContext
Ptr AppLaunchContext -> IO (Ptr AppLaunchContext)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AppLaunchContext
jContext'
Ptr Cancellable
maybeCancellable <- case Maybe b
cancellable of
Maybe b
Nothing -> Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
forall a. Ptr a
nullPtr
Just b
jCancellable -> do
Ptr Cancellable
jCancellable' <- b -> IO (Ptr Cancellable)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jCancellable
Ptr Cancellable -> IO (Ptr Cancellable)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Cancellable
jCancellable'
FunPtr C_AsyncReadyCallback
maybeCallback <- case Maybe AsyncReadyCallback
callback of
Maybe AsyncReadyCallback
Nothing -> FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return (Ptr Any -> FunPtr C_AsyncReadyCallback
forall a b. Ptr a -> FunPtr b
castPtrToFunPtr Ptr Any
forall a. Ptr a
nullPtr)
Just AsyncReadyCallback
jCallback -> do
Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback <- IO (Ptr (FunPtr C_AsyncReadyCallback))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
FunPtr C_AsyncReadyCallback
jCallback' <- C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
Gio.Callbacks.mk_AsyncReadyCallback (Maybe (Ptr (FunPtr C_AsyncReadyCallback))
-> AsyncReadyCallback_WithClosures -> C_AsyncReadyCallback
Gio.Callbacks.wrap_AsyncReadyCallback (Ptr (FunPtr C_AsyncReadyCallback)
-> Maybe (Ptr (FunPtr C_AsyncReadyCallback))
forall a. a -> Maybe a
Just Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback) (AsyncReadyCallback -> AsyncReadyCallback_WithClosures
Gio.Callbacks.drop_closures_AsyncReadyCallback AsyncReadyCallback
jCallback))
Ptr (FunPtr C_AsyncReadyCallback)
-> FunPtr C_AsyncReadyCallback -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (FunPtr C_AsyncReadyCallback)
ptrcallback FunPtr C_AsyncReadyCallback
jCallback'
FunPtr C_AsyncReadyCallback -> IO (FunPtr C_AsyncReadyCallback)
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_AsyncReadyCallback
jCallback'
let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
CString
-> Ptr AppLaunchContext
-> Ptr Cancellable
-> FunPtr C_AsyncReadyCallback
-> Ptr ()
-> IO ()
g_app_info_launch_default_for_uri_async CString
uri' Ptr AppLaunchContext
maybeContext Ptr Cancellable
maybeCancellable FunPtr C_AsyncReadyCallback
maybeCallback Ptr ()
forall a. Ptr a
userData
Maybe a -> (a -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe a
context a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
cancellable b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uri'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
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 :: a -> m ()
appInfoLaunchDefaultForUriFinish a
result_ = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr AsyncResult
result_' <- a -> IO (Ptr AsyncResult)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
result_
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ Ptr AsyncResult -> Ptr (Ptr GError) -> IO CInt
g_app_info_launch_default_for_uri_finish Ptr AsyncResult
result_'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
result_
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
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 :: Text -> m ()
appInfoResetTypeAssociations Text
contentType = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
CString
contentType' <- Text -> IO CString
textToCString Text
contentType
CString -> IO ()
g_app_info_reset_type_associations CString
contentType'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
contentType'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList AppInfo = AppInfoSignalList
type AppInfoSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif