{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.DesktopAppInfo
(
#if defined(ENABLE_OVERLOADING)
DesktopAppInfoLaunchUrisAsManagerMethodInfo,
#endif
#if defined(ENABLE_OVERLOADING)
DesktopAppInfoLaunchUrisAsManagerWithFdsMethodInfo,
#endif
DesktopAppInfo(..) ,
IsDesktopAppInfo ,
toDesktopAppInfo ,
noDesktopAppInfo ,
#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)
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.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 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.GLib.Structs.KeyFile as GLib.KeyFile
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AppInfo as Gio.AppInfo
import {-# SOURCE #-} qualified GI.Gio.Objects.AppLaunchContext as Gio.AppLaunchContext
newtype DesktopAppInfo = DesktopAppInfo (ManagedPtr DesktopAppInfo)
deriving (DesktopAppInfo -> DesktopAppInfo -> Bool
(DesktopAppInfo -> DesktopAppInfo -> Bool)
-> (DesktopAppInfo -> DesktopAppInfo -> Bool) -> Eq DesktopAppInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DesktopAppInfo -> DesktopAppInfo -> Bool
$c/= :: DesktopAppInfo -> DesktopAppInfo -> Bool
== :: DesktopAppInfo -> DesktopAppInfo -> Bool
$c== :: DesktopAppInfo -> DesktopAppInfo -> Bool
Eq)
foreign import ccall "g_desktop_app_info_get_type"
c_g_desktop_app_info_get_type :: IO GType
instance GObject DesktopAppInfo where
gobjectType :: IO GType
gobjectType = IO GType
c_g_desktop_app_info_get_type
instance B.GValue.IsGValue DesktopAppInfo where
toGValue :: DesktopAppInfo -> IO GValue
toGValue o :: DesktopAppInfo
o = do
GType
gtype <- IO GType
c_g_desktop_app_info_get_type
DesktopAppInfo -> (Ptr DesktopAppInfo -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr DesktopAppInfo
o (GType
-> (GValue -> Ptr DesktopAppInfo -> IO ())
-> Ptr DesktopAppInfo
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr DesktopAppInfo -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO DesktopAppInfo
fromGValue gv :: GValue
gv = do
Ptr DesktopAppInfo
ptr <- GValue -> IO (Ptr DesktopAppInfo)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr DesktopAppInfo)
(ManagedPtr DesktopAppInfo -> DesktopAppInfo)
-> Ptr DesktopAppInfo -> IO DesktopAppInfo
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr DesktopAppInfo -> DesktopAppInfo
DesktopAppInfo Ptr DesktopAppInfo
ptr
class (GObject o, O.IsDescendantOf DesktopAppInfo o) => IsDesktopAppInfo o
instance (GObject o, O.IsDescendantOf DesktopAppInfo o) => IsDesktopAppInfo o
instance O.HasParentTypes DesktopAppInfo
type instance O.ParentTypes DesktopAppInfo = '[GObject.Object.Object, Gio.AppInfo.AppInfo]
toDesktopAppInfo :: (MonadIO m, IsDesktopAppInfo o) => o -> m DesktopAppInfo
toDesktopAppInfo :: o -> m DesktopAppInfo
toDesktopAppInfo = IO DesktopAppInfo -> m DesktopAppInfo
forall (m :: * -> *) a. MonadIO m => IO a -> m a
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, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr DesktopAppInfo -> DesktopAppInfo
DesktopAppInfo
noDesktopAppInfo :: Maybe DesktopAppInfo
noDesktopAppInfo :: Maybe DesktopAppInfo
noDesktopAppInfo = Maybe DesktopAppInfo
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveDesktopAppInfoMethod (t :: Symbol) (o :: *) :: * 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.MethodInfo 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
#endif
getDesktopAppInfoFilename :: (MonadIO m, IsDesktopAppInfo o) => o -> m (Maybe T.Text)
getDesktopAppInfoFilename :: o -> m (Maybe Text)
getDesktopAppInfoFilename obj :: o
obj = IO (Maybe Text) -> m (Maybe Text)
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
$ o -> String -> IO (Maybe Text)
forall a. GObject a => a -> String -> IO (Maybe Text)
B.Properties.getObjectPropertyString o
obj "filename"
constructDesktopAppInfoFilename :: (IsDesktopAppInfo o) => T.Text -> IO (GValueConstruct o)
constructDesktopAppInfoFilename :: Text -> IO (GValueConstruct o)
constructDesktopAppInfoFilename val :: Text
val = String -> Maybe Text -> IO (GValueConstruct o)
forall o. String -> Maybe Text -> IO (GValueConstruct o)
B.Properties.constructObjectPropertyString "filename" (Text -> Maybe Text
forall a. a -> Maybe a
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
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList DesktopAppInfo
type instance O.AttributeList DesktopAppInfo = DesktopAppInfoAttributeList
type DesktopAppInfoAttributeList = ('[ '("filename", DesktopAppInfoFilenamePropertyInfo)] :: [(Symbol, *)])
#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, *)])
#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 :: Text -> m (Maybe DesktopAppInfo)
desktopAppInfoNew desktopId :: Text
desktopId = IO (Maybe DesktopAppInfo) -> m (Maybe DesktopAppInfo)
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
CString
desktopId' <- Text -> IO CString
textToCString Text
desktopId
Ptr DesktopAppInfo
result <- CString -> IO (Ptr DesktopAppInfo)
g_desktop_app_info_new CString
desktopId'
Maybe DesktopAppInfo
maybeResult <- Ptr DesktopAppInfo
-> (Ptr DesktopAppInfo -> IO DesktopAppInfo)
-> IO (Maybe DesktopAppInfo)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr DesktopAppInfo
result ((Ptr DesktopAppInfo -> IO DesktopAppInfo)
-> IO (Maybe DesktopAppInfo))
-> (Ptr DesktopAppInfo -> IO DesktopAppInfo)
-> IO (Maybe DesktopAppInfo)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr DesktopAppInfo
result' -> do
DesktopAppInfo
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'
DesktopAppInfo -> IO DesktopAppInfo
forall (m :: * -> *) a. Monad m => a -> m a
return DesktopAppInfo
result''
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
desktopId'
Maybe DesktopAppInfo -> IO (Maybe DesktopAppInfo)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe DesktopAppInfo
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 :: String -> m (Maybe DesktopAppInfo)
desktopAppInfoNewFromFilename filename :: String
filename = IO (Maybe DesktopAppInfo) -> m (Maybe DesktopAppInfo)
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
CString
filename' <- String -> IO CString
stringToCString String
filename
Ptr DesktopAppInfo
result <- CString -> IO (Ptr DesktopAppInfo)
g_desktop_app_info_new_from_filename CString
filename'
Maybe DesktopAppInfo
maybeResult <- Ptr DesktopAppInfo
-> (Ptr DesktopAppInfo -> IO DesktopAppInfo)
-> IO (Maybe DesktopAppInfo)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr DesktopAppInfo
result ((Ptr DesktopAppInfo -> IO DesktopAppInfo)
-> IO (Maybe DesktopAppInfo))
-> (Ptr DesktopAppInfo -> IO DesktopAppInfo)
-> IO (Maybe DesktopAppInfo)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr DesktopAppInfo
result' -> do
DesktopAppInfo
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'
DesktopAppInfo -> IO DesktopAppInfo
forall (m :: * -> *) a. Monad m => a -> m a
return DesktopAppInfo
result''
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
filename'
Maybe DesktopAppInfo -> IO (Maybe DesktopAppInfo)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe DesktopAppInfo
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 :: KeyFile -> m (Maybe DesktopAppInfo)
desktopAppInfoNewFromKeyfile keyFile :: KeyFile
keyFile = IO (Maybe DesktopAppInfo) -> m (Maybe DesktopAppInfo)
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
Ptr KeyFile
keyFile' <- KeyFile -> IO (Ptr KeyFile)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr KeyFile
keyFile
Ptr DesktopAppInfo
result <- Ptr KeyFile -> IO (Ptr DesktopAppInfo)
g_desktop_app_info_new_from_keyfile Ptr KeyFile
keyFile'
Maybe DesktopAppInfo
maybeResult <- Ptr DesktopAppInfo
-> (Ptr DesktopAppInfo -> IO DesktopAppInfo)
-> IO (Maybe DesktopAppInfo)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr DesktopAppInfo
result ((Ptr DesktopAppInfo -> IO DesktopAppInfo)
-> IO (Maybe DesktopAppInfo))
-> (Ptr DesktopAppInfo -> IO DesktopAppInfo)
-> IO (Maybe DesktopAppInfo)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr DesktopAppInfo
result' -> do
DesktopAppInfo
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'
DesktopAppInfo -> IO DesktopAppInfo
forall (m :: * -> *) a. Monad m => a -> m a
return DesktopAppInfo
result''
KeyFile -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr KeyFile
keyFile
Maybe DesktopAppInfo -> IO (Maybe DesktopAppInfo)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe DesktopAppInfo
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 :: a -> Text -> m Text
desktopAppInfoGetActionName info :: a
info actionName :: Text
actionName = 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 DesktopAppInfo
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
CString
actionName' <- Text -> IO CString
textToCString Text
actionName
CString
result <- Ptr DesktopAppInfo -> CString -> IO CString
g_desktop_app_info_get_action_name Ptr DesktopAppInfo
info' CString
actionName'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "desktopAppInfoGetActionName" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
info
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
actionName'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoGetActionNameMethodInfo
instance (signature ~ (T.Text -> m T.Text), MonadIO m, IsDesktopAppInfo a) => O.MethodInfo DesktopAppInfoGetActionNameMethodInfo a signature where
overloadedMethod = 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 :: a -> Text -> m Bool
desktopAppInfoGetBoolean info :: a
info key :: Text
key = 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 DesktopAppInfo
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
CString
key' <- Text -> IO CString
textToCString Text
key
CInt
result <- Ptr DesktopAppInfo -> CString -> IO CInt
g_desktop_app_info_get_boolean Ptr DesktopAppInfo
info' CString
key'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
info
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
key'
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoGetBooleanMethodInfo
instance (signature ~ (T.Text -> m Bool), MonadIO m, IsDesktopAppInfo a) => O.MethodInfo DesktopAppInfoGetBooleanMethodInfo a signature where
overloadedMethod = 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 T.Text
desktopAppInfoGetCategories :: a -> m Text
desktopAppInfoGetCategories info :: a
info = 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 DesktopAppInfo
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
CString
result <- Ptr DesktopAppInfo -> IO CString
g_desktop_app_info_get_categories Ptr DesktopAppInfo
info'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "desktopAppInfoGetCategories" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
info
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoGetCategoriesMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDesktopAppInfo a) => O.MethodInfo DesktopAppInfoGetCategoriesMethodInfo a signature where
overloadedMethod = 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 [Char]
desktopAppInfoGetFilename :: a -> m String
desktopAppInfoGetFilename info :: a
info = IO String -> m String
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO String -> m String) -> IO String -> m String
forall a b. (a -> b) -> a -> b
$ do
Ptr DesktopAppInfo
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
CString
result <- Ptr DesktopAppInfo -> IO CString
g_desktop_app_info_get_filename Ptr DesktopAppInfo
info'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "desktopAppInfoGetFilename" CString
result
String
result' <- HasCallStack => CString -> IO String
CString -> IO String
cstringToString CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
info
String -> IO String
forall (m :: * -> *) a. Monad m => a -> m a
return String
result'
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoGetFilenameMethodInfo
instance (signature ~ (m [Char]), MonadIO m, IsDesktopAppInfo a) => O.MethodInfo DesktopAppInfoGetFilenameMethodInfo a signature where
overloadedMethod = 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 T.Text
desktopAppInfoGetGenericName :: a -> m Text
desktopAppInfoGetGenericName info :: a
info = 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 DesktopAppInfo
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
CString
result <- Ptr DesktopAppInfo -> IO CString
g_desktop_app_info_get_generic_name Ptr DesktopAppInfo
info'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "desktopAppInfoGetGenericName" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
info
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoGetGenericNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDesktopAppInfo a) => O.MethodInfo DesktopAppInfoGetGenericNameMethodInfo a signature where
overloadedMethod = 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 :: a -> m Bool
desktopAppInfoGetIsHidden info :: a
info = 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 DesktopAppInfo
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
CInt
result <- Ptr DesktopAppInfo -> IO CInt
g_desktop_app_info_get_is_hidden Ptr DesktopAppInfo
info'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
info
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoGetIsHiddenMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDesktopAppInfo a) => O.MethodInfo DesktopAppInfoGetIsHiddenMethodInfo a signature where
overloadedMethod = 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 :: a -> m [Text]
desktopAppInfoGetKeywords info :: a
info = 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 DesktopAppInfo
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
Ptr CString
result <- Ptr DesktopAppInfo -> IO (Ptr CString)
g_desktop_app_info_get_keywords Ptr DesktopAppInfo
info'
Text -> Ptr CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "desktopAppInfoGetKeywords" 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
info
[Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result'
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoGetKeywordsMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m, IsDesktopAppInfo a) => O.MethodInfo DesktopAppInfoGetKeywordsMethodInfo a signature where
overloadedMethod = 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 :: a -> Text -> m (Maybe Text)
desktopAppInfoGetLocaleString info :: a
info key :: Text
key = IO (Maybe Text) -> m (Maybe Text)
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
Ptr DesktopAppInfo
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
CString
key' <- Text -> IO CString
textToCString Text
key
CString
result <- Ptr DesktopAppInfo -> CString -> IO CString
g_desktop_app_info_get_locale_string Ptr DesktopAppInfo
info' CString
key'
Maybe Text
maybeResult <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull CString
result ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \result' :: CString
result' -> do
Text
result'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result''
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
info
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
key'
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
maybeResult
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoGetLocaleStringMethodInfo
instance (signature ~ (T.Text -> m (Maybe T.Text)), MonadIO m, IsDesktopAppInfo a) => O.MethodInfo DesktopAppInfoGetLocaleStringMethodInfo a signature where
overloadedMethod = 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 :: a -> m Bool
desktopAppInfoGetNodisplay info :: a
info = 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 DesktopAppInfo
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
CInt
result <- Ptr DesktopAppInfo -> IO CInt
g_desktop_app_info_get_nodisplay Ptr DesktopAppInfo
info'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
info
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoGetNodisplayMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsDesktopAppInfo a) => O.MethodInfo DesktopAppInfoGetNodisplayMethodInfo a signature where
overloadedMethod = 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 :: a -> Maybe Text -> m Bool
desktopAppInfoGetShowIn info :: a
info desktopEnv :: Maybe Text
desktopEnv = 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 DesktopAppInfo
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
CString
maybeDesktopEnv <- case Maybe Text
desktopEnv of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jDesktopEnv :: Text
jDesktopEnv -> do
CString
jDesktopEnv' <- Text -> IO CString
textToCString Text
jDesktopEnv
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jDesktopEnv'
CInt
result <- Ptr DesktopAppInfo -> CString -> IO CInt
g_desktop_app_info_get_show_in Ptr DesktopAppInfo
info' CString
maybeDesktopEnv
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
info
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeDesktopEnv
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoGetShowInMethodInfo
instance (signature ~ (Maybe (T.Text) -> m Bool), MonadIO m, IsDesktopAppInfo a) => O.MethodInfo DesktopAppInfoGetShowInMethodInfo a signature where
overloadedMethod = 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 T.Text
desktopAppInfoGetStartupWmClass :: a -> m Text
desktopAppInfoGetStartupWmClass info :: a
info = 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 DesktopAppInfo
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
CString
result <- Ptr DesktopAppInfo -> IO CString
g_desktop_app_info_get_startup_wm_class Ptr DesktopAppInfo
info'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "desktopAppInfoGetStartupWmClass" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
info
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoGetStartupWmClassMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsDesktopAppInfo a) => O.MethodInfo DesktopAppInfoGetStartupWmClassMethodInfo a signature where
overloadedMethod = 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 T.Text
desktopAppInfoGetString :: a -> Text -> m Text
desktopAppInfoGetString info :: a
info key :: Text
key = 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 DesktopAppInfo
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
CString
key' <- Text -> IO CString
textToCString Text
key
CString
result <- Ptr DesktopAppInfo -> CString -> IO CString
g_desktop_app_info_get_string Ptr DesktopAppInfo
info' CString
key'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "desktopAppInfoGetString" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
info
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
key'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoGetStringMethodInfo
instance (signature ~ (T.Text -> m T.Text), MonadIO m, IsDesktopAppInfo a) => O.MethodInfo DesktopAppInfoGetStringMethodInfo a signature where
overloadedMethod = desktopAppInfoGetString
#endif
foreign import ccall "g_desktop_app_info_get_string_list" g_desktop_app_info_get_string_list ::
Ptr DesktopAppInfo ->
CString ->
Ptr Word64 ->
IO (Ptr CString)
desktopAppInfoGetStringList ::
(B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) =>
a
-> T.Text
-> m (([T.Text], Word64))
desktopAppInfoGetStringList :: a -> Text -> m ([Text], Word64)
desktopAppInfoGetStringList info :: a
info key :: Text
key = IO ([Text], Word64) -> m ([Text], Word64)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ([Text], Word64) -> m ([Text], Word64))
-> IO ([Text], Word64) -> m ([Text], Word64)
forall a b. (a -> b) -> a -> b
$ do
Ptr DesktopAppInfo
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
CString
key' <- Text -> IO CString
textToCString Text
key
Ptr Word64
length_ <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
Ptr CString
result <- Ptr DesktopAppInfo -> CString -> Ptr Word64 -> IO (Ptr CString)
g_desktop_app_info_get_string_list Ptr DesktopAppInfo
info' CString
key' Ptr Word64
length_
Text -> Ptr CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "desktopAppInfoGetStringList" Ptr CString
result
[Text]
result' <- HasCallStack => Ptr CString -> IO [Text]
Ptr CString -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr CString
result
(CString -> IO ()) -> Ptr CString -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
result
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
result
Word64
length_' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
length_
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
info
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
key'
Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
length_
([Text], Word64) -> IO ([Text], Word64)
forall (m :: * -> *) a. Monad m => a -> m a
return ([Text]
result', Word64
length_')
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoGetStringListMethodInfo
instance (signature ~ (T.Text -> m (([T.Text], Word64))), MonadIO m, IsDesktopAppInfo a) => O.MethodInfo DesktopAppInfoGetStringListMethodInfo a signature where
overloadedMethod = 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 :: a -> Text -> m Bool
desktopAppInfoHasKey info :: a
info key :: Text
key = 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 DesktopAppInfo
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
CString
key' <- Text -> IO CString
textToCString Text
key
CInt
result <- Ptr DesktopAppInfo -> CString -> IO CInt
g_desktop_app_info_has_key Ptr DesktopAppInfo
info' CString
key'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
info
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
key'
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoHasKeyMethodInfo
instance (signature ~ (T.Text -> m Bool), MonadIO m, IsDesktopAppInfo a) => O.MethodInfo DesktopAppInfoHasKeyMethodInfo a signature where
overloadedMethod = 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 :: a -> Text -> Maybe b -> m ()
desktopAppInfoLaunchAction info :: a
info actionName :: Text
actionName launchContext :: Maybe b
launchContext = 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 DesktopAppInfo
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
CString
actionName' <- Text -> IO CString
textToCString Text
actionName
Ptr AppLaunchContext
maybeLaunchContext <- case Maybe b
launchContext of
Nothing -> Ptr AppLaunchContext -> IO (Ptr AppLaunchContext)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AppLaunchContext
forall a. Ptr a
nullPtr
Just jLaunchContext :: b
jLaunchContext -> do
Ptr AppLaunchContext
jLaunchContext' <- b -> IO (Ptr AppLaunchContext)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jLaunchContext
Ptr AppLaunchContext -> IO (Ptr AppLaunchContext)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr AppLaunchContext
jLaunchContext'
Ptr DesktopAppInfo -> CString -> Ptr AppLaunchContext -> IO ()
g_desktop_app_info_launch_action Ptr DesktopAppInfo
info' CString
actionName' Ptr AppLaunchContext
maybeLaunchContext
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
info
Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
launchContext b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
actionName'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoLaunchActionMethodInfo
instance (signature ~ (T.Text -> Maybe (b) -> m ()), MonadIO m, IsDesktopAppInfo a, Gio.AppLaunchContext.IsAppLaunchContext b) => O.MethodInfo DesktopAppInfoLaunchActionMethodInfo a signature where
overloadedMethod = desktopAppInfoLaunchAction
#endif
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoLaunchUrisAsManagerMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "launchUrisAsManager" DesktopAppInfo) => O.MethodInfo DesktopAppInfoLaunchUrisAsManagerMethodInfo o p where
overloadedMethod = undefined
#endif
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoLaunchUrisAsManagerWithFdsMethodInfo
instance (p ~ (), o ~ O.UnsupportedMethodError "launchUrisAsManagerWithFds" DesktopAppInfo) => O.MethodInfo DesktopAppInfoLaunchUrisAsManagerWithFdsMethodInfo o p where
overloadedMethod = undefined
#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 :: a -> m [Text]
desktopAppInfoListActions info :: a
info = 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 DesktopAppInfo
info' <- a -> IO (Ptr DesktopAppInfo)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
info
Ptr CString
result <- Ptr DesktopAppInfo -> IO (Ptr CString)
g_desktop_app_info_list_actions Ptr DesktopAppInfo
info'
Text -> Ptr CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "desktopAppInfoListActions" 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
info
[Text] -> IO [Text]
forall (m :: * -> *) a. Monad m => a -> m a
return [Text]
result'
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoListActionsMethodInfo
instance (signature ~ (m [T.Text]), MonadIO m, IsDesktopAppInfo a) => O.MethodInfo DesktopAppInfoListActionsMethodInfo a signature where
overloadedMethod = 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 :: Text -> m [DesktopAppInfo]
desktopAppInfoGetImplementations interface :: Text
interface = IO [DesktopAppInfo] -> m [DesktopAppInfo]
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
CString
interface' <- Text -> IO CString
textToCString Text
interface
Ptr (GList (Ptr DesktopAppInfo))
result <- CString -> IO (Ptr (GList (Ptr DesktopAppInfo)))
g_desktop_app_info_get_implementations CString
interface'
[Ptr DesktopAppInfo]
result' <- Ptr (GList (Ptr DesktopAppInfo)) -> IO [Ptr DesktopAppInfo]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr DesktopAppInfo))
result
[DesktopAppInfo]
result'' <- (Ptr DesktopAppInfo -> IO DesktopAppInfo)
-> [Ptr DesktopAppInfo] -> IO [DesktopAppInfo]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((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'
Ptr (GList (Ptr DesktopAppInfo)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr DesktopAppInfo))
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
interface'
[DesktopAppInfo] -> IO [DesktopAppInfo]
forall (m :: * -> *) a. Monad m => a -> m a
return [DesktopAppInfo]
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 :: Text -> m [[Text]]
desktopAppInfoSearch searchString :: Text
searchString = 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
CString
searchString' <- Text -> IO CString
textToCString Text
searchString
Ptr (Ptr CString)
result <- CString -> IO (Ptr (Ptr CString))
g_desktop_app_info_search CString
searchString'
Text -> Ptr (Ptr CString) -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "desktopAppInfoSearch" Ptr (Ptr CString)
result
[Ptr CString]
result' <- Ptr (Ptr CString) -> IO [Ptr CString]
forall a. Ptr (Ptr a) -> IO [Ptr a]
unpackZeroTerminatedPtrArray Ptr (Ptr CString)
result
[[Text]]
result'' <- (Ptr CString -> IO [Text]) -> [Ptr CString] -> IO [[Text]]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM HasCallStack => Ptr CString -> IO [Text]
Ptr CString -> IO [Text]
unpackZeroTerminatedUTF8CArray [Ptr CString]
result'
let freeElemOfResult :: Ptr (Ptr a) -> IO ()
freeElemOfResult e :: 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 (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
(Ptr CString -> IO ()) -> Ptr (Ptr CString) -> IO ()
forall a b. (Ptr a -> IO b) -> Ptr (Ptr a) -> IO ()
mapZeroTerminatedCArray Ptr CString -> IO ()
forall a. Ptr (Ptr a) -> IO ()
freeElemOfResult Ptr (Ptr CString)
result
Ptr (Ptr CString) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr CString)
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
searchString'
[[Text]] -> IO [[Text]]
forall (m :: * -> *) a. Monad m => a -> m a
return [[Text]]
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 :: Text -> m ()
desktopAppInfoSetDesktopEnv desktopEnv :: Text
desktopEnv = 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
desktopEnv' <- Text -> IO CString
textToCString Text
desktopEnv
CString -> IO ()
g_desktop_app_info_set_desktop_env CString
desktopEnv'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
desktopEnv'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
#endif