{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.DesktopAppInfo
(
DesktopAppInfo(..) ,
IsDesktopAppInfo ,
toDesktopAppInfo ,
#if defined(ENABLE_OVERLOADING)
ResolveDesktopAppInfoMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
DesktopAppInfoGetActionNameMethodInfo ,
#endif
desktopAppInfoGetActionName ,
#if defined(ENABLE_OVERLOADING)
DesktopAppInfoGetBooleanMethodInfo ,
#endif
desktopAppInfoGetBoolean ,
#if defined(ENABLE_OVERLOADING)
DesktopAppInfoGetCategoriesMethodInfo ,
#endif
desktopAppInfoGetCategories ,
#if defined(ENABLE_OVERLOADING)
DesktopAppInfoGetFilenameMethodInfo ,
#endif
desktopAppInfoGetFilename ,
#if defined(ENABLE_OVERLOADING)
DesktopAppInfoGetGenericNameMethodInfo ,
#endif
desktopAppInfoGetGenericName ,
desktopAppInfoGetImplementations ,
#if defined(ENABLE_OVERLOADING)
DesktopAppInfoGetIsHiddenMethodInfo ,
#endif
desktopAppInfoGetIsHidden ,
#if defined(ENABLE_OVERLOADING)
DesktopAppInfoGetKeywordsMethodInfo ,
#endif
desktopAppInfoGetKeywords ,
#if defined(ENABLE_OVERLOADING)
DesktopAppInfoGetLocaleStringMethodInfo ,
#endif
desktopAppInfoGetLocaleString ,
#if defined(ENABLE_OVERLOADING)
DesktopAppInfoGetNodisplayMethodInfo ,
#endif
desktopAppInfoGetNodisplay ,
#if defined(ENABLE_OVERLOADING)
DesktopAppInfoGetShowInMethodInfo ,
#endif
desktopAppInfoGetShowIn ,
#if defined(ENABLE_OVERLOADING)
DesktopAppInfoGetStartupWmClassMethodInfo,
#endif
desktopAppInfoGetStartupWmClass ,
#if defined(ENABLE_OVERLOADING)
DesktopAppInfoGetStringMethodInfo ,
#endif
desktopAppInfoGetString ,
#if defined(ENABLE_OVERLOADING)
DesktopAppInfoGetStringListMethodInfo ,
#endif
desktopAppInfoGetStringList ,
#if defined(ENABLE_OVERLOADING)
DesktopAppInfoHasKeyMethodInfo ,
#endif
desktopAppInfoHasKey ,
#if defined(ENABLE_OVERLOADING)
DesktopAppInfoLaunchActionMethodInfo ,
#endif
desktopAppInfoLaunchAction ,
#if defined(ENABLE_OVERLOADING)
DesktopAppInfoLaunchUrisAsManagerMethodInfo,
#endif
desktopAppInfoLaunchUrisAsManager ,
#if defined(ENABLE_OVERLOADING)
DesktopAppInfoLaunchUrisAsManagerWithFdsMethodInfo,
#endif
desktopAppInfoLaunchUrisAsManagerWithFds,
#if defined(ENABLE_OVERLOADING)
DesktopAppInfoListActionsMethodInfo ,
#endif
desktopAppInfoListActions ,
desktopAppInfoNew ,
desktopAppInfoNewFromFilename ,
desktopAppInfoNewFromKeyfile ,
desktopAppInfoSearch ,
desktopAppInfoSetDesktopEnv ,
#if defined(ENABLE_OVERLOADING)
DesktopAppInfoFilenamePropertyInfo ,
#endif
constructDesktopAppInfoFilename ,
#if defined(ENABLE_OVERLOADING)
desktopAppInfoFilename ,
#endif
getDesktopAppInfoFilename ,
) 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.Flags as GLib.Flags
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.DateTime as GLib.DateTime
import qualified GI.GLib.Structs.KeyFile as GLib.KeyFile
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.AppInfo as Gio.AppInfo
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.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Flags as GLib.Flags
import qualified GI.GLib.Structs.KeyFile as GLib.KeyFile
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AppInfo as Gio.AppInfo
import {-# SOURCE #-} qualified GI.Gio.Objects.AppLaunchContext as Gio.AppLaunchContext
#endif
newtype DesktopAppInfo = DesktopAppInfo (SP.ManagedPtr DesktopAppInfo)
deriving (DesktopAppInfo -> DesktopAppInfo -> Bool
(DesktopAppInfo -> DesktopAppInfo -> Bool)
-> (DesktopAppInfo -> DesktopAppInfo -> Bool) -> Eq DesktopAppInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DesktopAppInfo -> DesktopAppInfo -> Bool
== :: DesktopAppInfo -> DesktopAppInfo -> Bool
$c/= :: DesktopAppInfo -> DesktopAppInfo -> Bool
/= :: DesktopAppInfo -> DesktopAppInfo -> Bool
Eq)
instance SP.ManagedPtrNewtype DesktopAppInfo where
toManagedPtr :: DesktopAppInfo -> ManagedPtr DesktopAppInfo
toManagedPtr (DesktopAppInfo ManagedPtr DesktopAppInfo
p) = ManagedPtr DesktopAppInfo
p
foreign import ccall "g_desktop_app_info_get_type"
c_g_desktop_app_info_get_type :: IO B.Types.GType
instance B.Types.TypedObject DesktopAppInfo where
glibType :: IO GType
glibType = IO GType
c_g_desktop_app_info_get_type
instance B.Types.GObject DesktopAppInfo
class (SP.GObject o, O.IsDescendantOf DesktopAppInfo o) => IsDesktopAppInfo o
instance (SP.GObject o, O.IsDescendantOf DesktopAppInfo o) => IsDesktopAppInfo o
instance O.HasParentTypes DesktopAppInfo
type instance O.ParentTypes DesktopAppInfo = '[GObject.Object.Object, Gio.AppInfo.AppInfo]
toDesktopAppInfo :: (MIO.MonadIO m, IsDesktopAppInfo o) => o -> m DesktopAppInfo
toDesktopAppInfo :: forall (m :: * -> *) o.
(MonadIO m, IsDesktopAppInfo o) =>
o -> m DesktopAppInfo
toDesktopAppInfo = IO DesktopAppInfo -> m DesktopAppInfo
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO DesktopAppInfo -> m DesktopAppInfo)
-> (o -> IO DesktopAppInfo) -> o -> m DesktopAppInfo
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr DesktopAppInfo -> DesktopAppInfo)
-> o -> IO DesktopAppInfo
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr DesktopAppInfo -> DesktopAppInfo
DesktopAppInfo
instance B.GValue.IsGValue (Maybe DesktopAppInfo) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_desktop_app_info_get_type
gvalueSet_ :: Ptr GValue -> Maybe DesktopAppInfo -> IO ()
gvalueSet_ Ptr GValue
gv Maybe DesktopAppInfo
P.Nothing = Ptr GValue -> Ptr DesktopAppInfo -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr DesktopAppInfo
forall a. Ptr a
FP.nullPtr :: FP.Ptr DesktopAppInfo)
gvalueSet_ Ptr GValue
gv (P.Just DesktopAppInfo
obj) = DesktopAppInfo -> (Ptr DesktopAppInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr DesktopAppInfo
obj (Ptr GValue -> Ptr DesktopAppInfo -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe DesktopAppInfo)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr DesktopAppInfo)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr DesktopAppInfo)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject DesktopAppInfo ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveDesktopAppInfoMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveDesktopAppInfoMethod "addSupportsType" o = Gio.AppInfo.AppInfoAddSupportsTypeMethodInfo
ResolveDesktopAppInfoMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDesktopAppInfoMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDesktopAppInfoMethod "canDelete" o = Gio.AppInfo.AppInfoCanDeleteMethodInfo
ResolveDesktopAppInfoMethod "canRemoveSupportsType" o = Gio.AppInfo.AppInfoCanRemoveSupportsTypeMethodInfo
ResolveDesktopAppInfoMethod "delete" o = Gio.AppInfo.AppInfoDeleteMethodInfo
ResolveDesktopAppInfoMethod "dup" o = Gio.AppInfo.AppInfoDupMethodInfo
ResolveDesktopAppInfoMethod "equal" o = Gio.AppInfo.AppInfoEqualMethodInfo
ResolveDesktopAppInfoMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDesktopAppInfoMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDesktopAppInfoMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveDesktopAppInfoMethod "hasKey" o = DesktopAppInfoHasKeyMethodInfo
ResolveDesktopAppInfoMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDesktopAppInfoMethod "launch" o = Gio.AppInfo.AppInfoLaunchMethodInfo
ResolveDesktopAppInfoMethod "launchAction" o = DesktopAppInfoLaunchActionMethodInfo
ResolveDesktopAppInfoMethod "launchUris" o = Gio.AppInfo.AppInfoLaunchUrisMethodInfo
ResolveDesktopAppInfoMethod "launchUrisAsManager" o = DesktopAppInfoLaunchUrisAsManagerMethodInfo
ResolveDesktopAppInfoMethod "launchUrisAsManagerWithFds" o = DesktopAppInfoLaunchUrisAsManagerWithFdsMethodInfo
ResolveDesktopAppInfoMethod "launchUrisAsync" o = Gio.AppInfo.AppInfoLaunchUrisAsyncMethodInfo
ResolveDesktopAppInfoMethod "launchUrisFinish" o = Gio.AppInfo.AppInfoLaunchUrisFinishMethodInfo
ResolveDesktopAppInfoMethod "listActions" o = DesktopAppInfoListActionsMethodInfo
ResolveDesktopAppInfoMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDesktopAppInfoMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDesktopAppInfoMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveDesktopAppInfoMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDesktopAppInfoMethod "removeSupportsType" o = Gio.AppInfo.AppInfoRemoveSupportsTypeMethodInfo
ResolveDesktopAppInfoMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDesktopAppInfoMethod "shouldShow" o = Gio.AppInfo.AppInfoShouldShowMethodInfo
ResolveDesktopAppInfoMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDesktopAppInfoMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDesktopAppInfoMethod "supportsFiles" o = Gio.AppInfo.AppInfoSupportsFilesMethodInfo
ResolveDesktopAppInfoMethod "supportsUris" o = Gio.AppInfo.AppInfoSupportsUrisMethodInfo
ResolveDesktopAppInfoMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDesktopAppInfoMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveDesktopAppInfoMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDesktopAppInfoMethod "getActionName" o = DesktopAppInfoGetActionNameMethodInfo
ResolveDesktopAppInfoMethod "getBoolean" o = DesktopAppInfoGetBooleanMethodInfo
ResolveDesktopAppInfoMethod "getCategories" o = DesktopAppInfoGetCategoriesMethodInfo
ResolveDesktopAppInfoMethod "getCommandline" o = Gio.AppInfo.AppInfoGetCommandlineMethodInfo
ResolveDesktopAppInfoMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDesktopAppInfoMethod "getDescription" o = Gio.AppInfo.AppInfoGetDescriptionMethodInfo
ResolveDesktopAppInfoMethod "getDisplayName" o = Gio.AppInfo.AppInfoGetDisplayNameMethodInfo
ResolveDesktopAppInfoMethod "getExecutable" o = Gio.AppInfo.AppInfoGetExecutableMethodInfo
ResolveDesktopAppInfoMethod "getFilename" o = DesktopAppInfoGetFilenameMethodInfo
ResolveDesktopAppInfoMethod "getGenericName" o = DesktopAppInfoGetGenericNameMethodInfo
ResolveDesktopAppInfoMethod "getIcon" o = Gio.AppInfo.AppInfoGetIconMethodInfo
ResolveDesktopAppInfoMethod "getId" o = Gio.AppInfo.AppInfoGetIdMethodInfo
ResolveDesktopAppInfoMethod "getIsHidden" o = DesktopAppInfoGetIsHiddenMethodInfo
ResolveDesktopAppInfoMethod "getKeywords" o = DesktopAppInfoGetKeywordsMethodInfo
ResolveDesktopAppInfoMethod "getLocaleString" o = DesktopAppInfoGetLocaleStringMethodInfo
ResolveDesktopAppInfoMethod "getName" o = Gio.AppInfo.AppInfoGetNameMethodInfo
ResolveDesktopAppInfoMethod "getNodisplay" o = DesktopAppInfoGetNodisplayMethodInfo
ResolveDesktopAppInfoMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDesktopAppInfoMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDesktopAppInfoMethod "getShowIn" o = DesktopAppInfoGetShowInMethodInfo
ResolveDesktopAppInfoMethod "getStartupWmClass" o = DesktopAppInfoGetStartupWmClassMethodInfo
ResolveDesktopAppInfoMethod "getString" o = DesktopAppInfoGetStringMethodInfo
ResolveDesktopAppInfoMethod "getStringList" o = DesktopAppInfoGetStringListMethodInfo
ResolveDesktopAppInfoMethod "getSupportedTypes" o = Gio.AppInfo.AppInfoGetSupportedTypesMethodInfo
ResolveDesktopAppInfoMethod "setAsDefaultForExtension" o = Gio.AppInfo.AppInfoSetAsDefaultForExtensionMethodInfo
ResolveDesktopAppInfoMethod "setAsDefaultForType" o = Gio.AppInfo.AppInfoSetAsDefaultForTypeMethodInfo
ResolveDesktopAppInfoMethod "setAsLastUsedForType" o = Gio.AppInfo.AppInfoSetAsLastUsedForTypeMethodInfo
ResolveDesktopAppInfoMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDesktopAppInfoMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveDesktopAppInfoMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDesktopAppInfoMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDesktopAppInfoMethod t DesktopAppInfo, O.OverloadedMethod info DesktopAppInfo p) => OL.IsLabel t (DesktopAppInfo -> 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 ~ ResolveDesktopAppInfoMethod t DesktopAppInfo, O.OverloadedMethod info DesktopAppInfo p, R.HasField t DesktopAppInfo p) => R.HasField t DesktopAppInfo p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveDesktopAppInfoMethod t DesktopAppInfo, O.OverloadedMethodInfo info DesktopAppInfo) => OL.IsLabel t (O.MethodProxy info DesktopAppInfo) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
getDesktopAppInfoFilename :: (MonadIO m, IsDesktopAppInfo o) => o -> m (Maybe T.Text)
getDesktopAppInfoFilename :: forall (m :: * -> *) o.
(MonadIO m, IsDesktopAppInfo o) =>
o -> m (Maybe Text)
getDesktopAppInfoFilename o
obj = IO (Maybe Text) -> m (Maybe Text)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj String
"filename"
constructDesktopAppInfoFilename :: (IsDesktopAppInfo o, MIO.MonadIO m) => T.Text -> m (GValueConstruct o)
constructDesktopAppInfoFilename :: forall o (m :: * -> *).
(IsDesktopAppInfo o, MonadIO m) =>
Text -> m (GValueConstruct o)
constructDesktopAppInfoFilename Text
val = IO (GValueConstruct o) -> m (GValueConstruct o)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> m (GValueConstruct o))
-> IO (GValueConstruct o) -> m (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ do
IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a. IO a -> IO a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO (GValueConstruct o) -> IO (GValueConstruct o))
-> IO (GValueConstruct o) -> IO (GValueConstruct o)
forall a b. (a -> b) -> a -> b
$ String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString String
"filename" (Text -> Maybe Text
forall a. a -> Maybe a
P.Just Text
val)
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoFilenamePropertyInfo
instance AttrInfo DesktopAppInfoFilenamePropertyInfo where
type AttrAllowedOps DesktopAppInfoFilenamePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
type AttrBaseTypeConstraint DesktopAppInfoFilenamePropertyInfo = IsDesktopAppInfo
type AttrSetTypeConstraint DesktopAppInfoFilenamePropertyInfo = (~) T.Text
type AttrTransferTypeConstraint DesktopAppInfoFilenamePropertyInfo = (~) T.Text
type AttrTransferType DesktopAppInfoFilenamePropertyInfo = T.Text
type AttrGetType DesktopAppInfoFilenamePropertyInfo = (Maybe T.Text)
type AttrLabel DesktopAppInfoFilenamePropertyInfo = "filename"
type AttrOrigin DesktopAppInfoFilenamePropertyInfo = DesktopAppInfo
attrGet = getDesktopAppInfoFilename
attrSet = undefined
attrTransfer _ v = do
return v
attrConstruct = constructDesktopAppInfoFilename
attrClear = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DesktopAppInfo.filename"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-DesktopAppInfo.html#g:attr:filename"
})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList DesktopAppInfo
type instance O.AttributeList DesktopAppInfo = DesktopAppInfoAttributeList
type DesktopAppInfoAttributeList = ('[ '("filename", DesktopAppInfoFilenamePropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
desktopAppInfoFilename :: AttrLabelProxy "filename"
desktopAppInfoFilename = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList DesktopAppInfo = DesktopAppInfoSignalList
type DesktopAppInfoSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "g_desktop_app_info_new" g_desktop_app_info_new ::
CString ->
IO (Ptr DesktopAppInfo)
desktopAppInfoNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m (Maybe DesktopAppInfo)
desktopAppInfoNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m (Maybe DesktopAppInfo)
desktopAppInfoNew Text
desktopId = IO (Maybe DesktopAppInfo) -> m (Maybe DesktopAppInfo)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe DesktopAppInfo) -> m (Maybe DesktopAppInfo))
-> IO (Maybe DesktopAppInfo) -> m (Maybe DesktopAppInfo)
forall a b. (a -> b) -> a -> b
$ do
desktopId' <- Text -> IO CString
textToCString Text
desktopId
result <- g_desktop_app_info_new desktopId'
maybeResult <- convertIfNonNull result $ \Ptr DesktopAppInfo
result' -> do
result'' <- ((ManagedPtr DesktopAppInfo -> DesktopAppInfo)
-> Ptr DesktopAppInfo -> IO DesktopAppInfo
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr DesktopAppInfo -> DesktopAppInfo
DesktopAppInfo) Ptr DesktopAppInfo
result'
return result''
freeMem desktopId'
return maybeResult
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_desktop_app_info_new_from_filename" g_desktop_app_info_new_from_filename ::
CString ->
IO (Ptr DesktopAppInfo)
desktopAppInfoNewFromFilename ::
(B.CallStack.HasCallStack, MonadIO m) =>
[Char]
-> m (Maybe DesktopAppInfo)
desktopAppInfoNewFromFilename :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
String -> m (Maybe DesktopAppInfo)
desktopAppInfoNewFromFilename String
filename = IO (Maybe DesktopAppInfo) -> m (Maybe DesktopAppInfo)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe DesktopAppInfo) -> m (Maybe DesktopAppInfo))
-> IO (Maybe DesktopAppInfo) -> m (Maybe DesktopAppInfo)
forall a b. (a -> b) -> a -> b
$ do
filename' <- String -> IO CString
stringToCString String
filename
result <- g_desktop_app_info_new_from_filename filename'
maybeResult <- convertIfNonNull result $ \Ptr DesktopAppInfo
result' -> do
result'' <- ((ManagedPtr DesktopAppInfo -> DesktopAppInfo)
-> Ptr DesktopAppInfo -> IO DesktopAppInfo
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr DesktopAppInfo -> DesktopAppInfo
DesktopAppInfo) Ptr DesktopAppInfo
result'
return result''
freeMem filename'
return maybeResult
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_desktop_app_info_new_from_keyfile" g_desktop_app_info_new_from_keyfile ::
Ptr GLib.KeyFile.KeyFile ->
IO (Ptr DesktopAppInfo)
desktopAppInfoNewFromKeyfile ::
(B.CallStack.HasCallStack, MonadIO m) =>
GLib.KeyFile.KeyFile
-> m (Maybe DesktopAppInfo)
desktopAppInfoNewFromKeyfile :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
KeyFile -> m (Maybe DesktopAppInfo)
desktopAppInfoNewFromKeyfile KeyFile
keyFile = IO (Maybe DesktopAppInfo) -> m (Maybe DesktopAppInfo)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe DesktopAppInfo) -> m (Maybe DesktopAppInfo))
-> IO (Maybe DesktopAppInfo) -> m (Maybe DesktopAppInfo)
forall a b. (a -> b) -> a -> b
$ do
keyFile' <- KeyFile -> IO (Ptr KeyFile)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr KeyFile
keyFile
result <- g_desktop_app_info_new_from_keyfile keyFile'
maybeResult <- convertIfNonNull result $ \Ptr DesktopAppInfo
result' -> do
result'' <- ((ManagedPtr DesktopAppInfo -> DesktopAppInfo)
-> Ptr DesktopAppInfo -> IO DesktopAppInfo
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr DesktopAppInfo -> DesktopAppInfo
DesktopAppInfo) Ptr DesktopAppInfo
result'
return result''
touchManagedPtr keyFile
return maybeResult
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_desktop_app_info_get_action_name" g_desktop_app_info_get_action_name ::
Ptr DesktopAppInfo ->
CString ->
IO CString
desktopAppInfoGetActionName ::
(B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a
-> T.Text
-> m T.Text
desktopAppInfoGetActionName :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a -> Text -> m Text
desktopAppInfoGetActionName a
info Text
actionName = 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
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
actionName' <- textToCString actionName
result <- g_desktop_app_info_get_action_name info' actionName'
checkUnexpectedReturnNULL "desktopAppInfoGetActionName" result
result' <- cstringToText result
freeMem result
touchManagedPtr info
freeMem actionName'
return result'
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoGetActionNameMethodInfo
instance (signature ~ (T.Text -> m T.Text), MonadIO m, IsDesktopAppInfo a) => O.OverloadedMethod DesktopAppInfoGetActionNameMethodInfo a signature where
overloadedMethod = desktopAppInfoGetActionName
instance O.OverloadedMethodInfo DesktopAppInfoGetActionNameMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DesktopAppInfo.desktopAppInfoGetActionName",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-DesktopAppInfo.html#v:desktopAppInfoGetActionName"
})
#endif
foreign import ccall "g_desktop_app_info_get_boolean" g_desktop_app_info_get_boolean ::
Ptr DesktopAppInfo ->
CString ->
IO CInt
desktopAppInfoGetBoolean ::
(B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a
-> T.Text
-> m Bool
desktopAppInfoGetBoolean :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a -> Text -> m Bool
desktopAppInfoGetBoolean a
info Text
key = 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
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
key' <- textToCString key
result <- g_desktop_app_info_get_boolean info' key'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr info
freeMem key'
return result'
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoGetBooleanMethodInfo
instance (signature ~ (T.Text -> m Bool), MonadIO m, IsDesktopAppInfo a) => O.OverloadedMethod DesktopAppInfoGetBooleanMethodInfo a signature where
overloadedMethod = desktopAppInfoGetBoolean
instance O.OverloadedMethodInfo DesktopAppInfoGetBooleanMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DesktopAppInfo.desktopAppInfoGetBoolean",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-DesktopAppInfo.html#v:desktopAppInfoGetBoolean"
})
#endif
foreign import ccall "g_desktop_app_info_get_categories" g_desktop_app_info_get_categories ::
Ptr DesktopAppInfo ->
IO CString
desktopAppInfoGetCategories ::
(B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a
-> m (Maybe T.Text)
desktopAppInfoGetCategories :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a -> m (Maybe Text)
desktopAppInfoGetCategories a
info = 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
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
result <- g_desktop_app_info_get_categories info'
maybeResult <- convertIfNonNull result $ \CString
result' -> do
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
return result''
touchManagedPtr info
return maybeResult
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoGetCategoriesMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsDesktopAppInfo a) => O.OverloadedMethod DesktopAppInfoGetCategoriesMethodInfo a signature where
overloadedMethod = desktopAppInfoGetCategories
instance O.OverloadedMethodInfo DesktopAppInfoGetCategoriesMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DesktopAppInfo.desktopAppInfoGetCategories",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-DesktopAppInfo.html#v:desktopAppInfoGetCategories"
})
#endif
foreign import ccall "g_desktop_app_info_get_filename" g_desktop_app_info_get_filename ::
Ptr DesktopAppInfo ->
IO CString
desktopAppInfoGetFilename ::
(B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a
-> m (Maybe [Char])
desktopAppInfoGetFilename :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a -> m (Maybe String)
desktopAppInfoGetFilename a
info = 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
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
result <- g_desktop_app_info_get_filename info'
maybeResult <- convertIfNonNull result $ \CString
result' -> do
result'' <- HasCallStack => CString -> IO String
CString -> IO String
cstringToString CString
result'
return result''
touchManagedPtr info
return maybeResult
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoGetFilenameMethodInfo
instance (signature ~ (m (Maybe [Char])), MonadIO m, IsDesktopAppInfo a) => O.OverloadedMethod DesktopAppInfoGetFilenameMethodInfo a signature where
overloadedMethod = desktopAppInfoGetFilename
instance O.OverloadedMethodInfo DesktopAppInfoGetFilenameMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DesktopAppInfo.desktopAppInfoGetFilename",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-DesktopAppInfo.html#v:desktopAppInfoGetFilename"
})
#endif
foreign import ccall "g_desktop_app_info_get_generic_name" g_desktop_app_info_get_generic_name ::
Ptr DesktopAppInfo ->
IO CString
desktopAppInfoGetGenericName ::
(B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a
-> m (Maybe T.Text)
desktopAppInfoGetGenericName :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a -> m (Maybe Text)
desktopAppInfoGetGenericName a
info = 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
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
result <- g_desktop_app_info_get_generic_name info'
maybeResult <- convertIfNonNull result $ \CString
result' -> do
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
return result''
touchManagedPtr info
return maybeResult
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoGetGenericNameMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsDesktopAppInfo a) => O.OverloadedMethod DesktopAppInfoGetGenericNameMethodInfo a signature where
overloadedMethod = desktopAppInfoGetGenericName
instance O.OverloadedMethodInfo DesktopAppInfoGetGenericNameMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DesktopAppInfo.desktopAppInfoGetGenericName",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-DesktopAppInfo.html#v:desktopAppInfoGetGenericName"
})
#endif
foreign import ccall "g_desktop_app_info_get_is_hidden" g_desktop_app_info_get_is_hidden ::
Ptr DesktopAppInfo ->
IO CInt
desktopAppInfoGetIsHidden ::
(B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a
-> m Bool
desktopAppInfoGetIsHidden :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a -> m Bool
desktopAppInfoGetIsHidden a
info = 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
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
result <- g_desktop_app_info_get_is_hidden info'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr info
return result'
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoGetIsHiddenMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDesktopAppInfo a) => O.OverloadedMethod DesktopAppInfoGetIsHiddenMethodInfo a signature where
overloadedMethod = desktopAppInfoGetIsHidden
instance O.OverloadedMethodInfo DesktopAppInfoGetIsHiddenMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DesktopAppInfo.desktopAppInfoGetIsHidden",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-DesktopAppInfo.html#v:desktopAppInfoGetIsHidden"
})
#endif
foreign import ccall "g_desktop_app_info_get_keywords" g_desktop_app_info_get_keywords ::
Ptr DesktopAppInfo ->
IO (Ptr CString)
desktopAppInfoGetKeywords ::
(B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a
-> m [T.Text]
desktopAppInfoGetKeywords :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a -> m [Text]
desktopAppInfoGetKeywords a
info = 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
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
result <- g_desktop_app_info_get_keywords info'
checkUnexpectedReturnNULL "desktopAppInfoGetKeywords" result
result' <- unpackZeroTerminatedUTF8CArray result
touchManagedPtr info
return result'
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoGetKeywordsMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m, IsDesktopAppInfo a) => O.OverloadedMethod DesktopAppInfoGetKeywordsMethodInfo a signature where
overloadedMethod = desktopAppInfoGetKeywords
instance O.OverloadedMethodInfo DesktopAppInfoGetKeywordsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DesktopAppInfo.desktopAppInfoGetKeywords",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-DesktopAppInfo.html#v:desktopAppInfoGetKeywords"
})
#endif
foreign import ccall "g_desktop_app_info_get_locale_string" g_desktop_app_info_get_locale_string ::
Ptr DesktopAppInfo ->
CString ->
IO CString
desktopAppInfoGetLocaleString ::
(B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a
-> T.Text
-> m (Maybe T.Text)
desktopAppInfoGetLocaleString :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a -> Text -> m (Maybe Text)
desktopAppInfoGetLocaleString a
info Text
key = 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
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
key' <- textToCString key
result <- g_desktop_app_info_get_locale_string info' key'
maybeResult <- convertIfNonNull result $ \CString
result' -> do
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
freeMem result'
return result''
touchManagedPtr info
freeMem key'
return maybeResult
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoGetLocaleStringMethodInfo
instance (signature ~ (T.Text -> m (Maybe T.Text)), MonadIO m, IsDesktopAppInfo a) => O.OverloadedMethod DesktopAppInfoGetLocaleStringMethodInfo a signature where
overloadedMethod = desktopAppInfoGetLocaleString
instance O.OverloadedMethodInfo DesktopAppInfoGetLocaleStringMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DesktopAppInfo.desktopAppInfoGetLocaleString",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-DesktopAppInfo.html#v:desktopAppInfoGetLocaleString"
})
#endif
foreign import ccall "g_desktop_app_info_get_nodisplay" g_desktop_app_info_get_nodisplay ::
Ptr DesktopAppInfo ->
IO CInt
desktopAppInfoGetNodisplay ::
(B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a
-> m Bool
desktopAppInfoGetNodisplay :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a -> m Bool
desktopAppInfoGetNodisplay a
info = 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
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
result <- g_desktop_app_info_get_nodisplay info'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr info
return result'
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoGetNodisplayMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDesktopAppInfo a) => O.OverloadedMethod DesktopAppInfoGetNodisplayMethodInfo a signature where
overloadedMethod = desktopAppInfoGetNodisplay
instance O.OverloadedMethodInfo DesktopAppInfoGetNodisplayMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DesktopAppInfo.desktopAppInfoGetNodisplay",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-DesktopAppInfo.html#v:desktopAppInfoGetNodisplay"
})
#endif
foreign import ccall "g_desktop_app_info_get_show_in" g_desktop_app_info_get_show_in ::
Ptr DesktopAppInfo ->
CString ->
IO CInt
desktopAppInfoGetShowIn ::
(B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a
-> Maybe (T.Text)
-> m Bool
desktopAppInfoGetShowIn :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a -> Maybe Text -> m Bool
desktopAppInfoGetShowIn a
info Maybe Text
desktopEnv = 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
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
maybeDesktopEnv <- case desktopEnv 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
jDesktopEnv -> do
jDesktopEnv' <- Text -> IO CString
textToCString Text
jDesktopEnv
return jDesktopEnv'
result <- g_desktop_app_info_get_show_in info' maybeDesktopEnv
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr info
freeMem maybeDesktopEnv
return result'
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoGetShowInMethodInfo
instance (signature ~ (Maybe (T.Text) -> m Bool), MonadIO m, IsDesktopAppInfo a) => O.OverloadedMethod DesktopAppInfoGetShowInMethodInfo a signature where
overloadedMethod = desktopAppInfoGetShowIn
instance O.OverloadedMethodInfo DesktopAppInfoGetShowInMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DesktopAppInfo.desktopAppInfoGetShowIn",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-DesktopAppInfo.html#v:desktopAppInfoGetShowIn"
})
#endif
foreign import ccall "g_desktop_app_info_get_startup_wm_class" g_desktop_app_info_get_startup_wm_class ::
Ptr DesktopAppInfo ->
IO CString
desktopAppInfoGetStartupWmClass ::
(B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a
-> m (Maybe T.Text)
desktopAppInfoGetStartupWmClass :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a -> m (Maybe Text)
desktopAppInfoGetStartupWmClass a
info = 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
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
result <- g_desktop_app_info_get_startup_wm_class info'
maybeResult <- convertIfNonNull result $ \CString
result' -> do
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
return result''
touchManagedPtr info
return maybeResult
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoGetStartupWmClassMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsDesktopAppInfo a) => O.OverloadedMethod DesktopAppInfoGetStartupWmClassMethodInfo a signature where
overloadedMethod = desktopAppInfoGetStartupWmClass
instance O.OverloadedMethodInfo DesktopAppInfoGetStartupWmClassMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DesktopAppInfo.desktopAppInfoGetStartupWmClass",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-DesktopAppInfo.html#v:desktopAppInfoGetStartupWmClass"
})
#endif
foreign import ccall "g_desktop_app_info_get_string" g_desktop_app_info_get_string ::
Ptr DesktopAppInfo ->
CString ->
IO CString
desktopAppInfoGetString ::
(B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a
-> T.Text
-> m (Maybe T.Text)
desktopAppInfoGetString :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a -> Text -> m (Maybe Text)
desktopAppInfoGetString a
info Text
key = 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
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
key' <- textToCString key
result <- g_desktop_app_info_get_string info' key'
maybeResult <- convertIfNonNull result $ \CString
result' -> do
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
freeMem result'
return result''
touchManagedPtr info
freeMem key'
return maybeResult
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoGetStringMethodInfo
instance (signature ~ (T.Text -> m (Maybe T.Text)), MonadIO m, IsDesktopAppInfo a) => O.OverloadedMethod DesktopAppInfoGetStringMethodInfo a signature where
overloadedMethod = desktopAppInfoGetString
instance O.OverloadedMethodInfo DesktopAppInfoGetStringMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DesktopAppInfo.desktopAppInfoGetString",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-DesktopAppInfo.html#v:desktopAppInfoGetString"
})
#endif
foreign import ccall "g_desktop_app_info_get_string_list" g_desktop_app_info_get_string_list ::
Ptr DesktopAppInfo ->
CString ->
Ptr FCT.CSize ->
IO (Ptr CString)
desktopAppInfoGetStringList ::
(B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a
-> T.Text
-> m (([T.Text], FCT.CSize))
desktopAppInfoGetStringList :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a -> Text -> m ([Text], CSize)
desktopAppInfoGetStringList a
info Text
key = IO ([Text], CSize) -> m ([Text], CSize)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ([Text], CSize) -> m ([Text], CSize))
-> IO ([Text], CSize) -> m ([Text], CSize)
forall a b. (a -> b) -> a -> b
$ do
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
key' <- textToCString key
length_ <- allocMem :: IO (Ptr FCT.CSize)
result <- g_desktop_app_info_get_string_list info' key' length_
checkUnexpectedReturnNULL "desktopAppInfoGetStringList" result
result' <- unpackZeroTerminatedUTF8CArray result
mapZeroTerminatedCArray freeMem result
freeMem result
length_' <- peek length_
touchManagedPtr info
freeMem key'
freeMem length_
return (result', length_')
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoGetStringListMethodInfo
instance (signature ~ (T.Text -> m (([T.Text], FCT.CSize))), MonadIO m, IsDesktopAppInfo a) => O.OverloadedMethod DesktopAppInfoGetStringListMethodInfo a signature where
overloadedMethod = desktopAppInfoGetStringList
instance O.OverloadedMethodInfo DesktopAppInfoGetStringListMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DesktopAppInfo.desktopAppInfoGetStringList",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-DesktopAppInfo.html#v:desktopAppInfoGetStringList"
})
#endif
foreign import ccall "g_desktop_app_info_has_key" g_desktop_app_info_has_key ::
Ptr DesktopAppInfo ->
CString ->
IO CInt
desktopAppInfoHasKey ::
(B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a
-> T.Text
-> m Bool
desktopAppInfoHasKey :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a -> Text -> m Bool
desktopAppInfoHasKey a
info Text
key = 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
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
key' <- textToCString key
result <- g_desktop_app_info_has_key info' key'
let result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
touchManagedPtr info
freeMem key'
return result'
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoHasKeyMethodInfo
instance (signature ~ (T.Text -> m Bool), MonadIO m, IsDesktopAppInfo a) => O.OverloadedMethod DesktopAppInfoHasKeyMethodInfo a signature where
overloadedMethod = desktopAppInfoHasKey
instance O.OverloadedMethodInfo DesktopAppInfoHasKeyMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DesktopAppInfo.desktopAppInfoHasKey",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-DesktopAppInfo.html#v:desktopAppInfoHasKey"
})
#endif
foreign import ccall "g_desktop_app_info_launch_action" g_desktop_app_info_launch_action ::
Ptr DesktopAppInfo ->
CString ->
Ptr Gio.AppLaunchContext.AppLaunchContext ->
IO ()
desktopAppInfoLaunchAction ::
(B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a, Gio.AppLaunchContext.IsAppLaunchContext b) =>
a
-> T.Text
-> Maybe (b)
-> m ()
desktopAppInfoLaunchAction :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDesktopAppInfo a,
IsAppLaunchContext b) =>
a -> Text -> Maybe b -> m ()
desktopAppInfoLaunchAction a
info Text
actionName Maybe b
launchContext = 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
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
actionName' <- textToCString actionName
maybeLaunchContext <- case launchContext 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
jLaunchContext -> do
jLaunchContext' <- b -> IO (Ptr AppLaunchContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jLaunchContext
return jLaunchContext'
g_desktop_app_info_launch_action info' actionName' maybeLaunchContext
touchManagedPtr info
whenJust launchContext touchManagedPtr
freeMem actionName'
return ()
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoLaunchActionMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> m ()), MonadIO m, IsDesktopAppInfo a, Gio.AppLaunchContext.IsAppLaunchContext b) => O.OverloadedMethod DesktopAppInfoLaunchActionMethodInfo a signature where
overloadedMethod = desktopAppInfoLaunchAction
instance O.OverloadedMethodInfo DesktopAppInfoLaunchActionMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DesktopAppInfo.desktopAppInfoLaunchAction",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-DesktopAppInfo.html#v:desktopAppInfoLaunchAction"
})
#endif
foreign import ccall "g_desktop_app_info_launch_uris_as_manager" g_desktop_app_info_launch_uris_as_manager ::
Ptr DesktopAppInfo ->
Ptr (GList CString) ->
Ptr Gio.AppLaunchContext.AppLaunchContext ->
CUInt ->
FunPtr GLib.Callbacks.C_SpawnChildSetupFunc ->
Ptr () ->
FunPtr Gio.Callbacks.C_DesktopAppLaunchCallback ->
Ptr () ->
Ptr (Ptr GError) ->
IO CInt
desktopAppInfoLaunchUrisAsManager ::
(B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a, Gio.AppLaunchContext.IsAppLaunchContext b) =>
a
-> [T.Text]
-> Maybe (b)
-> [GLib.Flags.SpawnFlags]
-> Maybe (GLib.Callbacks.SpawnChildSetupFunc)
-> Maybe (Gio.Callbacks.DesktopAppLaunchCallback)
-> m ()
desktopAppInfoLaunchUrisAsManager :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDesktopAppInfo a,
IsAppLaunchContext b) =>
a
-> [Text]
-> Maybe b
-> [SpawnFlags]
-> Maybe SpawnChildSetupFunc
-> Maybe DesktopAppLaunchCallback
-> m ()
desktopAppInfoLaunchUrisAsManager a
appinfo [Text]
uris Maybe b
launchContext [SpawnFlags]
spawnFlags Maybe SpawnChildSetupFunc
userSetup Maybe DesktopAppLaunchCallback
pidCallback = 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 DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
uris' <- mapM textToCString uris
uris'' <- packGList uris'
maybeLaunchContext <- case launchContext 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
jLaunchContext -> do
jLaunchContext' <- b -> IO (Ptr AppLaunchContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jLaunchContext
return jLaunchContext'
let spawnFlags' = [SpawnFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [SpawnFlags]
spawnFlags
maybeUserSetup <- case userSetup of
Maybe SpawnChildSetupFunc
Nothing -> FunPtr SpawnChildSetupFunc -> IO (FunPtr SpawnChildSetupFunc)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr SpawnChildSetupFunc
forall a. FunPtr a
FP.nullFunPtr
Just SpawnChildSetupFunc
jUserSetup -> do
ptruserSetup <- IO (Ptr (FunPtr SpawnChildSetupFunc))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr GLib.Callbacks.C_SpawnChildSetupFunc))
jUserSetup' <- GLib.Callbacks.mk_SpawnChildSetupFunc (GLib.Callbacks.wrap_SpawnChildSetupFunc (Just ptruserSetup) jUserSetup)
poke ptruserSetup jUserSetup'
return jUserSetup'
maybePidCallback <- case pidCallback of
Maybe DesktopAppLaunchCallback
Nothing -> FunPtr C_DesktopAppLaunchCallback
-> IO (FunPtr C_DesktopAppLaunchCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_DesktopAppLaunchCallback
forall a. FunPtr a
FP.nullFunPtr
Just DesktopAppLaunchCallback
jPidCallback -> do
jPidCallback' <- C_DesktopAppLaunchCallback
-> IO (FunPtr C_DesktopAppLaunchCallback)
Gio.Callbacks.mk_DesktopAppLaunchCallback (Maybe (Ptr (FunPtr C_DesktopAppLaunchCallback))
-> DesktopAppLaunchCallback_WithClosures
-> C_DesktopAppLaunchCallback
Gio.Callbacks.wrap_DesktopAppLaunchCallback Maybe (Ptr (FunPtr C_DesktopAppLaunchCallback))
forall a. Maybe a
Nothing (DesktopAppLaunchCallback -> DesktopAppLaunchCallback_WithClosures
Gio.Callbacks.drop_closures_DesktopAppLaunchCallback DesktopAppLaunchCallback
jPidCallback))
return jPidCallback'
let userSetupData = Ptr a
forall a. Ptr a
nullPtr
let pidCallbackData = Ptr a
forall a. Ptr a
nullPtr
onException (do
_ <- propagateGError $ g_desktop_app_info_launch_uris_as_manager appinfo' uris'' maybeLaunchContext spawnFlags' maybeUserSetup userSetupData maybePidCallback pidCallbackData
safeFreeFunPtr $ castFunPtrToPtr maybePidCallback
touchManagedPtr appinfo
whenJust launchContext touchManagedPtr
mapGList freeMem uris''
g_list_free uris''
return ()
) (do
safeFreeFunPtr $ castFunPtrToPtr maybePidCallback
mapGList freeMem uris''
g_list_free uris''
)
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoLaunchUrisAsManagerMethodInfo
instance (signature ~ ([T.Text] -> Maybe (b) -> [GLib.Flags.SpawnFlags] -> Maybe (GLib.Callbacks.SpawnChildSetupFunc) -> Maybe (Gio.Callbacks.DesktopAppLaunchCallback) -> m ()), MonadIO m, IsDesktopAppInfo a, Gio.AppLaunchContext.IsAppLaunchContext b) => O.OverloadedMethod DesktopAppInfoLaunchUrisAsManagerMethodInfo a signature where
overloadedMethod = desktopAppInfoLaunchUrisAsManager
instance O.OverloadedMethodInfo DesktopAppInfoLaunchUrisAsManagerMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DesktopAppInfo.desktopAppInfoLaunchUrisAsManager",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-DesktopAppInfo.html#v:desktopAppInfoLaunchUrisAsManager"
})
#endif
foreign import ccall "g_desktop_app_info_launch_uris_as_manager_with_fds" g_desktop_app_info_launch_uris_as_manager_with_fds ::
Ptr DesktopAppInfo ->
Ptr (GList CString) ->
Ptr Gio.AppLaunchContext.AppLaunchContext ->
CUInt ->
FunPtr GLib.Callbacks.C_SpawnChildSetupFunc ->
Ptr () ->
FunPtr Gio.Callbacks.C_DesktopAppLaunchCallback ->
Ptr () ->
Int32 ->
Int32 ->
Int32 ->
Ptr (Ptr GError) ->
IO CInt
desktopAppInfoLaunchUrisAsManagerWithFds ::
(B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a, Gio.AppLaunchContext.IsAppLaunchContext b) =>
a
-> [T.Text]
-> Maybe (b)
-> [GLib.Flags.SpawnFlags]
-> Maybe (GLib.Callbacks.SpawnChildSetupFunc)
-> Maybe (Gio.Callbacks.DesktopAppLaunchCallback)
-> Int32
-> Int32
-> Int32
-> m ()
desktopAppInfoLaunchUrisAsManagerWithFds :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsDesktopAppInfo a,
IsAppLaunchContext b) =>
a
-> [Text]
-> Maybe b
-> [SpawnFlags]
-> Maybe SpawnChildSetupFunc
-> Maybe DesktopAppLaunchCallback
-> Int32
-> Int32
-> Int32
-> m ()
desktopAppInfoLaunchUrisAsManagerWithFds a
appinfo [Text]
uris Maybe b
launchContext [SpawnFlags]
spawnFlags Maybe SpawnChildSetupFunc
userSetup Maybe DesktopAppLaunchCallback
pidCallback Int32
stdinFd Int32
stdoutFd Int32
stderrFd = 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 DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
appinfo
uris' <- mapM textToCString uris
uris'' <- packGList uris'
maybeLaunchContext <- case launchContext 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
jLaunchContext -> do
jLaunchContext' <- b -> IO (Ptr AppLaunchContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jLaunchContext
return jLaunchContext'
let spawnFlags' = [SpawnFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [SpawnFlags]
spawnFlags
maybeUserSetup <- case userSetup of
Maybe SpawnChildSetupFunc
Nothing -> FunPtr SpawnChildSetupFunc -> IO (FunPtr SpawnChildSetupFunc)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr SpawnChildSetupFunc
forall a. FunPtr a
FP.nullFunPtr
Just SpawnChildSetupFunc
jUserSetup -> do
ptruserSetup <- IO (Ptr (FunPtr SpawnChildSetupFunc))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (FunPtr GLib.Callbacks.C_SpawnChildSetupFunc))
jUserSetup' <- GLib.Callbacks.mk_SpawnChildSetupFunc (GLib.Callbacks.wrap_SpawnChildSetupFunc (Just ptruserSetup) jUserSetup)
poke ptruserSetup jUserSetup'
return jUserSetup'
maybePidCallback <- case pidCallback of
Maybe DesktopAppLaunchCallback
Nothing -> FunPtr C_DesktopAppLaunchCallback
-> IO (FunPtr C_DesktopAppLaunchCallback)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return FunPtr C_DesktopAppLaunchCallback
forall a. FunPtr a
FP.nullFunPtr
Just DesktopAppLaunchCallback
jPidCallback -> do
jPidCallback' <- C_DesktopAppLaunchCallback
-> IO (FunPtr C_DesktopAppLaunchCallback)
Gio.Callbacks.mk_DesktopAppLaunchCallback (Maybe (Ptr (FunPtr C_DesktopAppLaunchCallback))
-> DesktopAppLaunchCallback_WithClosures
-> C_DesktopAppLaunchCallback
Gio.Callbacks.wrap_DesktopAppLaunchCallback Maybe (Ptr (FunPtr C_DesktopAppLaunchCallback))
forall a. Maybe a
Nothing (DesktopAppLaunchCallback -> DesktopAppLaunchCallback_WithClosures
Gio.Callbacks.drop_closures_DesktopAppLaunchCallback DesktopAppLaunchCallback
jPidCallback))
return jPidCallback'
let userSetupData = Ptr a
forall a. Ptr a
nullPtr
let pidCallbackData = Ptr a
forall a. Ptr a
nullPtr
onException (do
_ <- propagateGError $ g_desktop_app_info_launch_uris_as_manager_with_fds appinfo' uris'' maybeLaunchContext spawnFlags' maybeUserSetup userSetupData maybePidCallback pidCallbackData stdinFd stdoutFd stderrFd
safeFreeFunPtr $ castFunPtrToPtr maybePidCallback
touchManagedPtr appinfo
whenJust launchContext touchManagedPtr
mapGList freeMem uris''
g_list_free uris''
return ()
) (do
safeFreeFunPtr $ castFunPtrToPtr maybePidCallback
mapGList freeMem uris''
g_list_free uris''
)
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoLaunchUrisAsManagerWithFdsMethodInfo
instance (signature ~ ([T.Text] -> Maybe (b) -> [GLib.Flags.SpawnFlags] -> Maybe (GLib.Callbacks.SpawnChildSetupFunc) -> Maybe (Gio.Callbacks.DesktopAppLaunchCallback) -> Int32 -> Int32 -> Int32 -> m ()), MonadIO m, IsDesktopAppInfo a, Gio.AppLaunchContext.IsAppLaunchContext b) => O.OverloadedMethod DesktopAppInfoLaunchUrisAsManagerWithFdsMethodInfo a signature where
overloadedMethod = desktopAppInfoLaunchUrisAsManagerWithFds
instance O.OverloadedMethodInfo DesktopAppInfoLaunchUrisAsManagerWithFdsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DesktopAppInfo.desktopAppInfoLaunchUrisAsManagerWithFds",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-DesktopAppInfo.html#v:desktopAppInfoLaunchUrisAsManagerWithFds"
})
#endif
foreign import ccall "g_desktop_app_info_list_actions" g_desktop_app_info_list_actions ::
Ptr DesktopAppInfo ->
IO (Ptr CString)
desktopAppInfoListActions ::
(B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a
-> m [T.Text]
desktopAppInfoListActions :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a -> m [Text]
desktopAppInfoListActions a
info = 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
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
result <- g_desktop_app_info_list_actions info'
checkUnexpectedReturnNULL "desktopAppInfoListActions" result
result' <- unpackZeroTerminatedUTF8CArray result
touchManagedPtr info
return result'
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoListActionsMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m, IsDesktopAppInfo a) => O.OverloadedMethod DesktopAppInfoListActionsMethodInfo a signature where
overloadedMethod = desktopAppInfoListActions
instance O.OverloadedMethodInfo DesktopAppInfoListActionsMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.DesktopAppInfo.desktopAppInfoListActions",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-DesktopAppInfo.html#v:desktopAppInfoListActions"
})
#endif
foreign import ccall "g_desktop_app_info_get_implementations" g_desktop_app_info_get_implementations ::
CString ->
IO (Ptr (GList (Ptr DesktopAppInfo)))
desktopAppInfoGetImplementations ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m [DesktopAppInfo]
desktopAppInfoGetImplementations :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m [DesktopAppInfo]
desktopAppInfoGetImplementations Text
interface = IO [DesktopAppInfo] -> m [DesktopAppInfo]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [DesktopAppInfo] -> m [DesktopAppInfo])
-> IO [DesktopAppInfo] -> m [DesktopAppInfo]
forall a b. (a -> b) -> a -> b
$ do
interface' <- Text -> IO CString
textToCString Text
interface
result <- g_desktop_app_info_get_implementations interface'
result' <- unpackGList result
result'' <- mapM (wrapObject DesktopAppInfo) result'
g_list_free result
freeMem interface'
return result''
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_desktop_app_info_search" g_desktop_app_info_search ::
CString ->
IO (Ptr (Ptr CString))
desktopAppInfoSearch ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m [[T.Text]]
desktopAppInfoSearch :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Text -> m [[Text]]
desktopAppInfoSearch Text
searchString = 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
searchString' <- Text -> IO CString
textToCString Text
searchString
result <- g_desktop_app_info_search searchString'
checkUnexpectedReturnNULL "desktopAppInfoSearch" result
result' <- unpackZeroTerminatedPtrArray result
result'' <- mapM unpackZeroTerminatedUTF8CArray result'
let freeElemOfResult Ptr (Ptr a)
e = (Ptr a -> IO ()) -> Ptr (Ptr a) -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray Ptr a -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr a)
e IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Ptr (Ptr a) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr a)
e
mapZeroTerminatedCArray freeElemOfResult result
freeMem result
freeMem searchString'
return result''
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_desktop_app_info_set_desktop_env" g_desktop_app_info_set_desktop_env ::
CString ->
IO ()
{-# DEPRECATED desktopAppInfoSetDesktopEnv ["(Since version 2.42)","do not use this API. Since 2.42 the value of the","@XDG_CURRENT_DESKTOP@ environment variable will be used."] #-}
desktopAppInfoSetDesktopEnv ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m ()
desktopAppInfoSetDesktopEnv :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Text -> m ()
desktopAppInfoSetDesktopEnv Text
desktopEnv = 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
desktopEnv' <- Text -> IO CString
textToCString Text
desktopEnv
g_desktop_app_info_set_desktop_env desktopEnv'
freeMem desktopEnv'
return ()
#if defined(ENABLE_OVERLOADING)
#endif