{- | Copyright : Will Thompson, Iñaki García Etxebarria and Jonas Platte License : LGPL-2.1 Maintainer : Iñaki García Etxebarria (garetxe@gmail.com) 'GI.Gio.Objects.DesktopAppInfo.DesktopAppInfo' is an implementation of 'GI.Gio.Interfaces.AppInfo.AppInfo' based on desktop files. Note that @\<gio\/gdesktopappinfo.h>@ belongs to the UNIX-specific GIO interfaces, thus you have to use the @gio-unix-2.0.pc@ pkg-config file when using it. -} module GI.Gio.Objects.DesktopAppInfo ( #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) DesktopAppInfoLaunchUrisAsManagerMethodInfo, #endif -- * Exported types DesktopAppInfo(..) , IsDesktopAppInfo , toDesktopAppInfo , noDesktopAppInfo , -- * Methods -- ** getActionName #method:getActionName# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) DesktopAppInfoGetActionNameMethodInfo , #endif desktopAppInfoGetActionName , -- ** getBoolean #method:getBoolean# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) DesktopAppInfoGetBooleanMethodInfo , #endif desktopAppInfoGetBoolean , -- ** getCategories #method:getCategories# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) DesktopAppInfoGetCategoriesMethodInfo , #endif desktopAppInfoGetCategories , -- ** getFilename #method:getFilename# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) DesktopAppInfoGetFilenameMethodInfo , #endif desktopAppInfoGetFilename , -- ** getGenericName #method:getGenericName# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) DesktopAppInfoGetGenericNameMethodInfo , #endif desktopAppInfoGetGenericName , -- ** getImplementations #method:getImplementations# desktopAppInfoGetImplementations , -- ** getIsHidden #method:getIsHidden# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) DesktopAppInfoGetIsHiddenMethodInfo , #endif desktopAppInfoGetIsHidden , -- ** getKeywords #method:getKeywords# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) DesktopAppInfoGetKeywordsMethodInfo , #endif desktopAppInfoGetKeywords , -- ** getNodisplay #method:getNodisplay# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) DesktopAppInfoGetNodisplayMethodInfo , #endif desktopAppInfoGetNodisplay , -- ** getShowIn #method:getShowIn# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) DesktopAppInfoGetShowInMethodInfo , #endif desktopAppInfoGetShowIn , -- ** getStartupWmClass #method:getStartupWmClass# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) DesktopAppInfoGetStartupWmClassMethodInfo, #endif desktopAppInfoGetStartupWmClass , -- ** getString #method:getString# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) DesktopAppInfoGetStringMethodInfo , #endif desktopAppInfoGetString , -- ** hasKey #method:hasKey# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) DesktopAppInfoHasKeyMethodInfo , #endif desktopAppInfoHasKey , -- ** launchAction #method:launchAction# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) DesktopAppInfoLaunchActionMethodInfo , #endif desktopAppInfoLaunchAction , -- ** listActions #method:listActions# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) DesktopAppInfoListActionsMethodInfo , #endif desktopAppInfoListActions , -- ** new #method:new# desktopAppInfoNew , -- ** newFromFilename #method:newFromFilename# desktopAppInfoNewFromFilename , -- ** newFromKeyfile #method:newFromKeyfile# desktopAppInfoNewFromKeyfile , -- ** search #method:search# desktopAppInfoSearch , -- ** setDesktopEnv #method:setDesktopEnv# desktopAppInfoSetDesktopEnv , -- * Properties -- ** filename #attr:filename# #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) DesktopAppInfoFilenamePropertyInfo , #endif constructDesktopAppInfoFilename , #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) 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.GError as B.GError import qualified Data.GI.Base.GVariant as B.GVariant import qualified Data.GI.Base.GParamSpec as B.GParamSpec import qualified Data.GI.Base.CallStack as B.CallStack 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 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) foreign import ccall "g_desktop_app_info_get_type" c_g_desktop_app_info_get_type :: IO GType instance GObject DesktopAppInfo where gobjectType _ = c_g_desktop_app_info_get_type class GObject o => IsDesktopAppInfo o #if MIN_VERSION_base(4,9,0) instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError DesktopAppInfo a) => IsDesktopAppInfo a #endif instance IsDesktopAppInfo DesktopAppInfo instance GObject.Object.IsObject DesktopAppInfo instance Gio.AppInfo.IsAppInfo DesktopAppInfo toDesktopAppInfo :: (MonadIO m, IsDesktopAppInfo o) => o -> m DesktopAppInfo toDesktopAppInfo = liftIO . unsafeCastTo DesktopAppInfo noDesktopAppInfo :: Maybe DesktopAppInfo noDesktopAppInfo = Nothing #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) 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 "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 "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 "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo ResolveDesktopAppInfoMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo 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 "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 "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 "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo ResolveDesktopAppInfoMethod l o = O.MethodResolutionFailed l o instance (info ~ ResolveDesktopAppInfoMethod t DesktopAppInfo, O.MethodInfo info DesktopAppInfo p) => O.IsLabelProxy t (DesktopAppInfo -> p) where fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info) #if MIN_VERSION_base(4,9,0) instance (info ~ ResolveDesktopAppInfoMethod t DesktopAppInfo, O.MethodInfo info DesktopAppInfo p) => O.IsLabel t (DesktopAppInfo -> p) where #if MIN_VERSION_base(4,10,0) fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info) #else fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info) #endif #endif #endif -- VVV Prop "filename" -- Type: TBasicType TUTF8 -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly] -- Nullable: (Nothing,Nothing) getDesktopAppInfoFilename :: (MonadIO m, IsDesktopAppInfo o) => o -> m (Maybe T.Text) getDesktopAppInfoFilename obj = liftIO $ getObjectPropertyString obj "filename" constructDesktopAppInfoFilename :: (IsDesktopAppInfo o) => T.Text -> IO (GValueConstruct o) constructDesktopAppInfoFilename val = constructObjectPropertyString "filename" (Just val) #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data DesktopAppInfoFilenamePropertyInfo instance AttrInfo DesktopAppInfoFilenamePropertyInfo where type AttrAllowedOps DesktopAppInfoFilenamePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear] type AttrSetTypeConstraint DesktopAppInfoFilenamePropertyInfo = (~) T.Text type AttrBaseTypeConstraint DesktopAppInfoFilenamePropertyInfo = IsDesktopAppInfo type AttrGetType DesktopAppInfoFilenamePropertyInfo = (Maybe T.Text) type AttrLabel DesktopAppInfoFilenamePropertyInfo = "filename" type AttrOrigin DesktopAppInfoFilenamePropertyInfo = DesktopAppInfo attrGet _ = getDesktopAppInfoFilename attrSet _ = undefined attrConstruct _ = constructDesktopAppInfoFilename attrClear _ = undefined #endif #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) instance O.HasAttributeList DesktopAppInfo type instance O.AttributeList DesktopAppInfo = DesktopAppInfoAttributeList type DesktopAppInfoAttributeList = ('[ '("filename", DesktopAppInfoFilenamePropertyInfo)] :: [(Symbol, *)]) #endif #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) desktopAppInfoFilename :: AttrLabelProxy "filename" desktopAppInfoFilename = AttrLabelProxy #endif #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) type instance O.SignalList DesktopAppInfo = DesktopAppInfoSignalList type DesktopAppInfoSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)]) #endif -- method DesktopAppInfo::new -- method type : Constructor -- Args : [Arg {argCName = "desktop_id", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the desktop file id", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"})) -- throws : False -- Skip return : False foreign import ccall "g_desktop_app_info_new" g_desktop_app_info_new :: CString -> -- desktop_id : TBasicType TUTF8 IO (Ptr DesktopAppInfo) {- | Creates a new 'GI.Gio.Objects.DesktopAppInfo.DesktopAppInfo' based on a desktop file id. A desktop file id is the basename of the desktop file, including the .desktop extension. GIO is looking for a desktop file with this name in the @applications@ subdirectories of the XDG data directories (i.e. the directories specified in the @XDG_DATA_HOME@ and @XDG_DATA_DIRS@ environment variables). GIO also supports the prefix-to-subdirectory mapping that is described in the <http://standards.freedesktop.org/menu-spec/latest/ Menu Spec> (i.e. a desktop id of kde-foo.desktop will match @\/usr\/share\/applications\/kde\/foo.desktop@). -} desktopAppInfoNew :: (B.CallStack.HasCallStack, MonadIO m) => T.Text {- ^ /@desktopId@/: the desktop file id -} -> m DesktopAppInfo {- ^ __Returns:__ a new 'GI.Gio.Objects.DesktopAppInfo.DesktopAppInfo', or 'Nothing' if no desktop file with that id -} desktopAppInfoNew desktopId = liftIO $ do desktopId' <- textToCString desktopId result <- g_desktop_app_info_new desktopId' checkUnexpectedReturnNULL "desktopAppInfoNew" result result' <- (wrapObject DesktopAppInfo) result freeMem desktopId' return result' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) #endif -- method DesktopAppInfo::new_from_filename -- method type : Constructor -- Args : [Arg {argCName = "filename", argType = TBasicType TFileName, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the path of a desktop file, in the GLib\n filename encoding", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"})) -- throws : False -- Skip return : False foreign import ccall "g_desktop_app_info_new_from_filename" g_desktop_app_info_new_from_filename :: CString -> -- filename : TBasicType TFileName IO (Ptr DesktopAppInfo) {- | Creates a new 'GI.Gio.Objects.DesktopAppInfo.DesktopAppInfo'. -} desktopAppInfoNewFromFilename :: (B.CallStack.HasCallStack, MonadIO m) => [Char] {- ^ /@filename@/: the path of a desktop file, in the GLib filename encoding -} -> m DesktopAppInfo {- ^ __Returns:__ a new 'GI.Gio.Objects.DesktopAppInfo.DesktopAppInfo' or 'Nothing' on error. -} desktopAppInfoNewFromFilename filename = liftIO $ do filename' <- stringToCString filename result <- g_desktop_app_info_new_from_filename filename' checkUnexpectedReturnNULL "desktopAppInfoNewFromFilename" result result' <- (wrapObject DesktopAppInfo) result freeMem filename' return result' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) #endif -- method DesktopAppInfo::new_from_keyfile -- method type : Constructor -- Args : [Arg {argCName = "key_file", argType = TInterface (Name {namespace = "GLib", name = "KeyFile"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an opened #GKeyFile", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"})) -- throws : False -- Skip return : False foreign import ccall "g_desktop_app_info_new_from_keyfile" g_desktop_app_info_new_from_keyfile :: Ptr GLib.KeyFile.KeyFile -> -- key_file : TInterface (Name {namespace = "GLib", name = "KeyFile"}) IO (Ptr DesktopAppInfo) {- | Creates a new 'GI.Gio.Objects.DesktopAppInfo.DesktopAppInfo'. @since 2.18 -} desktopAppInfoNewFromKeyfile :: (B.CallStack.HasCallStack, MonadIO m) => GLib.KeyFile.KeyFile {- ^ /@keyFile@/: an opened 'GI.GLib.Structs.KeyFile.KeyFile' -} -> m DesktopAppInfo {- ^ __Returns:__ a new 'GI.Gio.Objects.DesktopAppInfo.DesktopAppInfo' or 'Nothing' on error. -} desktopAppInfoNewFromKeyfile keyFile = liftIO $ do keyFile' <- unsafeManagedPtrGetPtr keyFile result <- g_desktop_app_info_new_from_keyfile keyFile' checkUnexpectedReturnNULL "desktopAppInfoNewFromKeyfile" result result' <- (wrapObject DesktopAppInfo) result touchManagedPtr keyFile return result' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) #endif -- method DesktopAppInfo::get_action_name -- method type : OrdinaryMethod -- Args : [Arg {argCName = "info", argType = TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GDesktopAppInfo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "action_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the name of the action as from\n g_desktop_app_info_list_actions()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "g_desktop_app_info_get_action_name" g_desktop_app_info_get_action_name :: Ptr DesktopAppInfo -> -- info : TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}) CString -> -- action_name : TBasicType TUTF8 IO CString {- | Gets the user-visible display name of the \"additional application action\" specified by /@actionName@/. This corresponds to the \"Name\" key within the keyfile group for the action. @since 2.38 -} desktopAppInfoGetActionName :: (B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) => a {- ^ /@info@/: a 'GI.Gio.Objects.DesktopAppInfo.DesktopAppInfo' -} -> T.Text {- ^ /@actionName@/: the name of the action as from 'GI.Gio.Objects.DesktopAppInfo.desktopAppInfoListActions' -} -> m T.Text {- ^ __Returns:__ the locale-specific action name -} desktopAppInfoGetActionName info actionName = liftIO $ do info' <- unsafeManagedPtrCastPtr 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) && !defined(__HADDOCK_VERSION__) data DesktopAppInfoGetActionNameMethodInfo instance (signature ~ (T.Text -> m T.Text), MonadIO m, IsDesktopAppInfo a) => O.MethodInfo DesktopAppInfoGetActionNameMethodInfo a signature where overloadedMethod _ = desktopAppInfoGetActionName #endif -- method DesktopAppInfo::get_boolean -- method type : OrdinaryMethod -- Args : [Arg {argCName = "info", argType = TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GDesktopAppInfo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "key", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the key to look up", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_desktop_app_info_get_boolean" g_desktop_app_info_get_boolean :: Ptr DesktopAppInfo -> -- info : TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}) CString -> -- key : TBasicType TUTF8 IO CInt {- | Looks up a boolean value in the keyfile backing /@info@/. The /@key@/ is looked up in the \"Desktop Entry\" group. @since 2.36 -} desktopAppInfoGetBoolean :: (B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) => a {- ^ /@info@/: a 'GI.Gio.Objects.DesktopAppInfo.DesktopAppInfo' -} -> T.Text {- ^ /@key@/: the key to look up -} -> m Bool {- ^ __Returns:__ the boolean value, or 'False' if the key is not found -} desktopAppInfoGetBoolean info key = liftIO $ do info' <- unsafeManagedPtrCastPtr info key' <- textToCString key result <- g_desktop_app_info_get_boolean info' key' let result' = (/= 0) result touchManagedPtr info freeMem key' return result' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data DesktopAppInfoGetBooleanMethodInfo instance (signature ~ (T.Text -> m Bool), MonadIO m, IsDesktopAppInfo a) => O.MethodInfo DesktopAppInfoGetBooleanMethodInfo a signature where overloadedMethod _ = desktopAppInfoGetBoolean #endif -- method DesktopAppInfo::get_categories -- method type : OrdinaryMethod -- Args : [Arg {argCName = "info", argType = TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GDesktopAppInfo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "g_desktop_app_info_get_categories" g_desktop_app_info_get_categories :: Ptr DesktopAppInfo -> -- info : TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}) IO CString {- | Gets the categories from the desktop file. -} desktopAppInfoGetCategories :: (B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) => a {- ^ /@info@/: a 'GI.Gio.Objects.DesktopAppInfo.DesktopAppInfo' -} -> m T.Text {- ^ __Returns:__ The unparsed Categories key from the desktop file; i.e. no attempt is made to split it by \';\' or validate it. -} desktopAppInfoGetCategories info = liftIO $ do info' <- unsafeManagedPtrCastPtr info result <- g_desktop_app_info_get_categories info' checkUnexpectedReturnNULL "desktopAppInfoGetCategories" result result' <- cstringToText result touchManagedPtr info return result' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data DesktopAppInfoGetCategoriesMethodInfo instance (signature ~ (m T.Text), MonadIO m, IsDesktopAppInfo a) => O.MethodInfo DesktopAppInfoGetCategoriesMethodInfo a signature where overloadedMethod _ = desktopAppInfoGetCategories #endif -- method DesktopAppInfo::get_filename -- method type : OrdinaryMethod -- Args : [Arg {argCName = "info", argType = TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GDesktopAppInfo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TBasicType TFileName) -- throws : False -- Skip return : False foreign import ccall "g_desktop_app_info_get_filename" g_desktop_app_info_get_filename :: Ptr DesktopAppInfo -> -- info : TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}) IO CString {- | When /@info@/ was created from a known filename, return it. In some situations such as the 'GI.Gio.Objects.DesktopAppInfo.DesktopAppInfo' returned from 'GI.Gio.Objects.DesktopAppInfo.desktopAppInfoNewFromKeyfile', this function will return 'Nothing'. @since 2.24 -} desktopAppInfoGetFilename :: (B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) => a {- ^ /@info@/: a 'GI.Gio.Objects.DesktopAppInfo.DesktopAppInfo' -} -> m [Char] {- ^ __Returns:__ The full path to the file for /@info@/, or 'Nothing' if not known. -} desktopAppInfoGetFilename info = liftIO $ do info' <- unsafeManagedPtrCastPtr info result <- g_desktop_app_info_get_filename info' checkUnexpectedReturnNULL "desktopAppInfoGetFilename" result result' <- cstringToString result touchManagedPtr info return result' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data DesktopAppInfoGetFilenameMethodInfo instance (signature ~ (m [Char]), MonadIO m, IsDesktopAppInfo a) => O.MethodInfo DesktopAppInfoGetFilenameMethodInfo a signature where overloadedMethod _ = desktopAppInfoGetFilename #endif -- method DesktopAppInfo::get_generic_name -- method type : OrdinaryMethod -- Args : [Arg {argCName = "info", argType = TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GDesktopAppInfo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "g_desktop_app_info_get_generic_name" g_desktop_app_info_get_generic_name :: Ptr DesktopAppInfo -> -- info : TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}) IO CString {- | Gets the generic name from the destkop file. -} desktopAppInfoGetGenericName :: (B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) => a {- ^ /@info@/: a 'GI.Gio.Objects.DesktopAppInfo.DesktopAppInfo' -} -> m T.Text {- ^ __Returns:__ The value of the GenericName key -} desktopAppInfoGetGenericName info = liftIO $ do info' <- unsafeManagedPtrCastPtr info result <- g_desktop_app_info_get_generic_name info' checkUnexpectedReturnNULL "desktopAppInfoGetGenericName" result result' <- cstringToText result touchManagedPtr info return result' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data DesktopAppInfoGetGenericNameMethodInfo instance (signature ~ (m T.Text), MonadIO m, IsDesktopAppInfo a) => O.MethodInfo DesktopAppInfoGetGenericNameMethodInfo a signature where overloadedMethod _ = desktopAppInfoGetGenericName #endif -- method DesktopAppInfo::get_is_hidden -- method type : OrdinaryMethod -- Args : [Arg {argCName = "info", argType = TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GDesktopAppInfo.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_desktop_app_info_get_is_hidden" g_desktop_app_info_get_is_hidden :: Ptr DesktopAppInfo -> -- info : TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}) IO CInt {- | A desktop file is hidden if the Hidden key in it is set to True. -} desktopAppInfoGetIsHidden :: (B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) => a {- ^ /@info@/: a 'GI.Gio.Objects.DesktopAppInfo.DesktopAppInfo'. -} -> m Bool {- ^ __Returns:__ 'True' if hidden, 'False' otherwise. -} desktopAppInfoGetIsHidden info = liftIO $ do info' <- unsafeManagedPtrCastPtr info result <- g_desktop_app_info_get_is_hidden info' let result' = (/= 0) result touchManagedPtr info return result' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data DesktopAppInfoGetIsHiddenMethodInfo instance (signature ~ (m Bool), MonadIO m, IsDesktopAppInfo a) => O.MethodInfo DesktopAppInfoGetIsHiddenMethodInfo a signature where overloadedMethod _ = desktopAppInfoGetIsHidden #endif -- method DesktopAppInfo::get_keywords -- method type : OrdinaryMethod -- Args : [Arg {argCName = "info", argType = TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GDesktopAppInfo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TCArray True (-1) (-1) (TBasicType TUTF8)) -- throws : False -- Skip return : False foreign import ccall "g_desktop_app_info_get_keywords" g_desktop_app_info_get_keywords :: Ptr DesktopAppInfo -> -- info : TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}) IO (Ptr CString) {- | Gets the keywords from the desktop file. @since 2.32 -} desktopAppInfoGetKeywords :: (B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) => a {- ^ /@info@/: a 'GI.Gio.Objects.DesktopAppInfo.DesktopAppInfo' -} -> m [T.Text] {- ^ __Returns:__ The value of the Keywords key -} desktopAppInfoGetKeywords info = liftIO $ do info' <- unsafeManagedPtrCastPtr info result <- g_desktop_app_info_get_keywords info' checkUnexpectedReturnNULL "desktopAppInfoGetKeywords" result result' <- unpackZeroTerminatedUTF8CArray result touchManagedPtr info return result' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data DesktopAppInfoGetKeywordsMethodInfo instance (signature ~ (m [T.Text]), MonadIO m, IsDesktopAppInfo a) => O.MethodInfo DesktopAppInfoGetKeywordsMethodInfo a signature where overloadedMethod _ = desktopAppInfoGetKeywords #endif -- method DesktopAppInfo::get_nodisplay -- method type : OrdinaryMethod -- Args : [Arg {argCName = "info", argType = TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GDesktopAppInfo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_desktop_app_info_get_nodisplay" g_desktop_app_info_get_nodisplay :: Ptr DesktopAppInfo -> -- info : TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}) IO CInt {- | Gets the value of the NoDisplay key, which helps determine if the application info should be shown in menus. See 'GI.GLib.Constants.KEY_FILE_DESKTOP_KEY_NO_DISPLAY' and 'GI.Gio.Interfaces.AppInfo.appInfoShouldShow'. @since 2.30 -} desktopAppInfoGetNodisplay :: (B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) => a {- ^ /@info@/: a 'GI.Gio.Objects.DesktopAppInfo.DesktopAppInfo' -} -> m Bool {- ^ __Returns:__ The value of the NoDisplay key -} desktopAppInfoGetNodisplay info = liftIO $ do info' <- unsafeManagedPtrCastPtr info result <- g_desktop_app_info_get_nodisplay info' let result' = (/= 0) result touchManagedPtr info return result' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data DesktopAppInfoGetNodisplayMethodInfo instance (signature ~ (m Bool), MonadIO m, IsDesktopAppInfo a) => O.MethodInfo DesktopAppInfoGetNodisplayMethodInfo a signature where overloadedMethod _ = desktopAppInfoGetNodisplay #endif -- method DesktopAppInfo::get_show_in -- method type : OrdinaryMethod -- Args : [Arg {argCName = "info", argType = TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GDesktopAppInfo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "desktop_env", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a string specifying a desktop name", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_desktop_app_info_get_show_in" g_desktop_app_info_get_show_in :: Ptr DesktopAppInfo -> -- info : TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}) CString -> -- desktop_env : TBasicType TUTF8 IO CInt {- | Checks if the application info should be shown in menus that list available applications for a specific name of the desktop, based on the @OnlyShowIn@ and @NotShowIn@ keys. /@desktopEnv@/ should typically be given as 'Nothing', in which case the @XDG_CURRENT_DESKTOP@ environment variable is consulted. If you want to override the default mechanism then you may specify /@desktopEnv@/, but this is not recommended. Note that 'GI.Gio.Interfaces.AppInfo.appInfoShouldShow' for /@info@/ will include this check (with 'Nothing' for /@desktopEnv@/) as well as additional checks. @since 2.30 -} desktopAppInfoGetShowIn :: (B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) => a {- ^ /@info@/: a 'GI.Gio.Objects.DesktopAppInfo.DesktopAppInfo' -} -> Maybe (T.Text) {- ^ /@desktopEnv@/: a string specifying a desktop name -} -> m Bool {- ^ __Returns:__ 'True' if the /@info@/ should be shown in /@desktopEnv@/ according to the @OnlyShowIn@ and @NotShowIn@ keys, 'False' otherwise. -} desktopAppInfoGetShowIn info desktopEnv = liftIO $ do info' <- unsafeManagedPtrCastPtr info maybeDesktopEnv <- case desktopEnv of Nothing -> return nullPtr Just jDesktopEnv -> do jDesktopEnv' <- textToCString jDesktopEnv return jDesktopEnv' result <- g_desktop_app_info_get_show_in info' maybeDesktopEnv let result' = (/= 0) result touchManagedPtr info freeMem maybeDesktopEnv return result' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data DesktopAppInfoGetShowInMethodInfo instance (signature ~ (Maybe (T.Text) -> m Bool), MonadIO m, IsDesktopAppInfo a) => O.MethodInfo DesktopAppInfoGetShowInMethodInfo a signature where overloadedMethod _ = desktopAppInfoGetShowIn #endif -- method DesktopAppInfo::get_startup_wm_class -- method type : OrdinaryMethod -- Args : [Arg {argCName = "info", argType = TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GDesktopAppInfo that supports startup notify", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "g_desktop_app_info_get_startup_wm_class" g_desktop_app_info_get_startup_wm_class :: Ptr DesktopAppInfo -> -- info : TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}) IO CString {- | Retrieves the StartupWMClass field from /@info@/. This represents the WM_CLASS property of the main window of the application, if launched through /@info@/. @since 2.34 -} desktopAppInfoGetStartupWmClass :: (B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) => a {- ^ /@info@/: a 'GI.Gio.Objects.DesktopAppInfo.DesktopAppInfo' that supports startup notify -} -> m T.Text {- ^ __Returns:__ the startup WM class, or 'Nothing' if none is set in the desktop file. -} desktopAppInfoGetStartupWmClass info = liftIO $ do info' <- unsafeManagedPtrCastPtr info result <- g_desktop_app_info_get_startup_wm_class info' checkUnexpectedReturnNULL "desktopAppInfoGetStartupWmClass" result result' <- cstringToText result touchManagedPtr info return result' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data DesktopAppInfoGetStartupWmClassMethodInfo instance (signature ~ (m T.Text), MonadIO m, IsDesktopAppInfo a) => O.MethodInfo DesktopAppInfoGetStartupWmClassMethodInfo a signature where overloadedMethod _ = desktopAppInfoGetStartupWmClass #endif -- method DesktopAppInfo::get_string -- method type : OrdinaryMethod -- Args : [Arg {argCName = "info", argType = TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GDesktopAppInfo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "key", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the key to look up", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TBasicType TUTF8) -- throws : False -- Skip return : False foreign import ccall "g_desktop_app_info_get_string" g_desktop_app_info_get_string :: Ptr DesktopAppInfo -> -- info : TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}) CString -> -- key : TBasicType TUTF8 IO CString {- | Looks up a string value in the keyfile backing /@info@/. The /@key@/ is looked up in the \"Desktop Entry\" group. @since 2.36 -} desktopAppInfoGetString :: (B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) => a {- ^ /@info@/: a 'GI.Gio.Objects.DesktopAppInfo.DesktopAppInfo' -} -> T.Text {- ^ /@key@/: the key to look up -} -> m T.Text {- ^ __Returns:__ a newly allocated string, or 'Nothing' if the key is not found -} desktopAppInfoGetString info key = liftIO $ do info' <- unsafeManagedPtrCastPtr info key' <- textToCString key result <- g_desktop_app_info_get_string info' key' checkUnexpectedReturnNULL "desktopAppInfoGetString" result result' <- cstringToText result freeMem result touchManagedPtr info freeMem key' return result' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data DesktopAppInfoGetStringMethodInfo instance (signature ~ (T.Text -> m T.Text), MonadIO m, IsDesktopAppInfo a) => O.MethodInfo DesktopAppInfoGetStringMethodInfo a signature where overloadedMethod _ = desktopAppInfoGetString #endif -- method DesktopAppInfo::has_key -- method type : OrdinaryMethod -- Args : [Arg {argCName = "info", argType = TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GDesktopAppInfo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "key", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the key to look up", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TBasicType TBoolean) -- throws : False -- Skip return : False foreign import ccall "g_desktop_app_info_has_key" g_desktop_app_info_has_key :: Ptr DesktopAppInfo -> -- info : TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}) CString -> -- key : TBasicType TUTF8 IO CInt {- | Returns whether /@key@/ exists in the \"Desktop Entry\" group of the keyfile backing /@info@/. @since 2.36 -} desktopAppInfoHasKey :: (B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) => a {- ^ /@info@/: a 'GI.Gio.Objects.DesktopAppInfo.DesktopAppInfo' -} -> T.Text {- ^ /@key@/: the key to look up -} -> m Bool {- ^ __Returns:__ 'True' if the /@key@/ exists -} desktopAppInfoHasKey info key = liftIO $ do info' <- unsafeManagedPtrCastPtr info key' <- textToCString key result <- g_desktop_app_info_has_key info' key' let result' = (/= 0) result touchManagedPtr info freeMem key' return result' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data DesktopAppInfoHasKeyMethodInfo instance (signature ~ (T.Text -> m Bool), MonadIO m, IsDesktopAppInfo a) => O.MethodInfo DesktopAppInfoHasKeyMethodInfo a signature where overloadedMethod _ = desktopAppInfoHasKey #endif -- method DesktopAppInfo::launch_action -- method type : OrdinaryMethod -- Args : [Arg {argCName = "info", argType = TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GDesktopAppInfo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "action_name", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the name of the action as from\n g_desktop_app_info_list_actions()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "launch_context", argType = TInterface (Name {namespace = "Gio", name = "AppLaunchContext"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GAppLaunchContext", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "g_desktop_app_info_launch_action" g_desktop_app_info_launch_action :: Ptr DesktopAppInfo -> -- info : TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}) CString -> -- action_name : TBasicType TUTF8 Ptr Gio.AppLaunchContext.AppLaunchContext -> -- launch_context : TInterface (Name {namespace = "Gio", name = "AppLaunchContext"}) IO () {- | Activates the named application action. You may only call this function on action names that were returned from 'GI.Gio.Objects.DesktopAppInfo.desktopAppInfoListActions'. Note that if the main entry of the desktop file indicates that the application supports startup notification, and /@launchContext@/ is non-'Nothing', then startup notification will be used when activating the action (and as such, invocation of the action on the receiving side must signal the end of startup notification when it is completed). This is the expected behaviour of applications declaring additional actions, as per the desktop file specification. As with 'GI.Gio.Interfaces.AppInfo.appInfoLaunch' there is no way to detect failures that occur while using this function. @since 2.38 -} desktopAppInfoLaunchAction :: (B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a, Gio.AppLaunchContext.IsAppLaunchContext b) => a {- ^ /@info@/: a 'GI.Gio.Objects.DesktopAppInfo.DesktopAppInfo' -} -> T.Text {- ^ /@actionName@/: the name of the action as from 'GI.Gio.Objects.DesktopAppInfo.desktopAppInfoListActions' -} -> Maybe (b) {- ^ /@launchContext@/: a 'GI.Gio.Objects.AppLaunchContext.AppLaunchContext' -} -> m () desktopAppInfoLaunchAction info actionName launchContext = liftIO $ do info' <- unsafeManagedPtrCastPtr info actionName' <- textToCString actionName maybeLaunchContext <- case launchContext of Nothing -> return nullPtr Just jLaunchContext -> do jLaunchContext' <- unsafeManagedPtrCastPtr jLaunchContext return jLaunchContext' g_desktop_app_info_launch_action info' actionName' maybeLaunchContext touchManagedPtr info whenJust launchContext touchManagedPtr freeMem actionName' return () #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) 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 -- XXX Could not generate method DesktopAppInfo::launch_uris_as_manager -- Error was : Bad introspection data: "Closure not found! Callable\n { returnType = Just (TBasicType TBoolean)\n , returnMayBeNull = False\n , returnTransfer = TransferNothing\n , returnDocumentation =\n Documentation\n { rawDocText = Just \"%TRUE on successful launch, %FALSE otherwise.\"\n , sinceVersion = Nothing\n }\n , args =\n [ Arg\n { argCName = \"appinfo\"\n , argType =\n TInterface Name { namespace = \"Gio\" , name = \"DesktopAppInfo\" }\n , direction = DirectionIn\n , mayBeNull = False\n , argDoc =\n Documentation\n { rawDocText = Just \"a #GDesktopAppInfo\" , sinceVersion = Nothing }\n , argScope = ScopeTypeInvalid\n , argClosure = -1\n , argDestroy = -1\n , argCallerAllocates = False\n , transfer = TransferNothing\n }\n , Arg\n { argCName = \"uris\"\n , argType = TGList (TBasicType TUTF8)\n , direction = DirectionIn\n , mayBeNull = False\n , argDoc =\n Documentation\n { rawDocText = Just \"List of URIs\" , sinceVersion = Nothing }\n , argScope = ScopeTypeInvalid\n , argClosure = -1\n , argDestroy = -1\n , argCallerAllocates = False\n , transfer = TransferNothing\n }\n , Arg\n { argCName = \"launch_context\"\n , argType =\n TInterface Name { namespace = \"Gio\" , name = \"AppLaunchContext\" }\n , direction = DirectionIn\n , mayBeNull = True\n , argDoc =\n Documentation\n { rawDocText = Just \"a #GAppLaunchContext\"\n , sinceVersion = Nothing\n }\n , argScope = ScopeTypeInvalid\n , argClosure = -1\n , argDestroy = -1\n , argCallerAllocates = False\n , transfer = TransferNothing\n }\n , Arg\n { argCName = \"spawn_flags\"\n , argType =\n TInterface Name { namespace = \"GLib\" , name = \"SpawnFlags\" }\n , direction = DirectionIn\n , mayBeNull = False\n , argDoc =\n Documentation\n { rawDocText = Just \"#GSpawnFlags, used for each process\"\n , sinceVersion = Nothing\n }\n , argScope = ScopeTypeInvalid\n , argClosure = -1\n , argDestroy = -1\n , argCallerAllocates = False\n , transfer = TransferNothing\n }\n , Arg\n { argCName = \"user_setup\"\n , argType =\n TInterface\n Name { namespace = \"GLib\" , name = \"SpawnChildSetupFunc\" }\n , direction = DirectionIn\n , mayBeNull = True\n , argDoc =\n Documentation\n { rawDocText =\n Just \"a #GSpawnChildSetupFunc, used once\\n for each process.\"\n , sinceVersion = Nothing\n }\n , argScope = ScopeTypeCall\n , argClosure = 5\n , argDestroy = -1\n , argCallerAllocates = False\n , transfer = TransferNothing\n }\n , Arg\n { argCName = \"user_setup_data\"\n , argType = TBasicType TPtr\n , direction = DirectionIn\n , mayBeNull = True\n , argDoc =\n Documentation\n { rawDocText = Just \"User data for @user_setup\"\n , sinceVersion = Nothing\n }\n , argScope = ScopeTypeInvalid\n , argClosure = 4\n , argDestroy = -1\n , argCallerAllocates = False\n , transfer = TransferNothing\n }\n , Arg\n { argCName = \"pid_callback\"\n , argType =\n TInterface\n Name { namespace = \"Gio\" , name = \"DesktopAppLaunchCallback\" }\n , direction = DirectionIn\n , mayBeNull = True\n , argDoc =\n Documentation\n { rawDocText = Just \"Callback for child processes\"\n , sinceVersion = Nothing\n }\n , argScope = ScopeTypeCall\n , argClosure = 7\n , argDestroy = -1\n , argCallerAllocates = False\n , transfer = TransferNothing\n }\n , Arg\n { argCName = \"pid_callback_data\"\n , argType = TBasicType TPtr\n , direction = DirectionIn\n , mayBeNull = True\n , argDoc =\n Documentation\n { rawDocText = Just \"User data for @callback\"\n , sinceVersion = Nothing\n }\n , argScope = ScopeTypeInvalid\n , argClosure = 6\n , argDestroy = -1\n , argCallerAllocates = False\n , transfer = TransferNothing\n }\n ]\n , skipReturn = False\n , callableThrows = True\n , callableDeprecated = Nothing\n , callableDocumentation =\n Documentation\n { rawDocText =\n Just\n \"This function performs the equivalent of g_app_info_launch_uris(),\\nbut is intended primarily for operating system components that\\nlaunch applications. Ordinary applications should use\\ng_app_info_launch_uris().\\n\\nIf the application is launched via traditional UNIX fork()/exec()\\nthen @spawn_flags, @user_setup and @user_setup_data are used for the\\ncall to g_spawn_async(). Additionally, @pid_callback (with\\n@pid_callback_data) will be called to inform about the PID of the\\ncreated process.\\n\\nIf application launching occurs via some other mechanism (eg: D-Bus\\nactivation) then @spawn_flags, @user_setup, @user_setup_data,\\n@pid_callback and @pid_callback_data are ignored.\"\n , sinceVersion = Nothing\n }\n }\nfromList\n [ ( 5\n , Arg\n { argCName = \"user_setup\"\n , argType =\n TInterface\n Name { namespace = \"GLib\" , name = \"SpawnChildSetupFunc\" }\n , direction = DirectionIn\n , mayBeNull = True\n , argDoc =\n Documentation\n { rawDocText =\n Just \"a #GSpawnChildSetupFunc, used once\\n for each process.\"\n , sinceVersion = Nothing\n }\n , argScope = ScopeTypeCall\n , argClosure = 5\n , argDestroy = -1\n , argCallerAllocates = False\n , transfer = TransferNothing\n }\n )\n , ( 7\n , Arg\n { argCName = \"pid_callback\"\n , argType =\n TInterface\n Name { namespace = \"Gio\" , name = \"DesktopAppLaunchCallback\" }\n , direction = DirectionIn\n , mayBeNull = True\n , argDoc =\n Documentation\n { rawDocText = Just \"Callback for child processes\"\n , sinceVersion = Nothing\n }\n , argScope = ScopeTypeCall\n , argClosure = 7\n , argDestroy = -1\n , argCallerAllocates = False\n , transfer = TransferNothing\n }\n )\n ]\n4" #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) -- XXX: Dummy instance, since code generation failed. -- Please file a bug at http://github.com/haskell-gi/haskell-gi. data DesktopAppInfoLaunchUrisAsManagerMethodInfo instance (p ~ (), o ~ O.MethodResolutionFailed "launchUrisAsManager" DesktopAppInfo) => O.MethodInfo DesktopAppInfoLaunchUrisAsManagerMethodInfo o p where overloadedMethod _ = undefined #endif -- method DesktopAppInfo::list_actions -- method type : OrdinaryMethod -- Args : [Arg {argCName = "info", argType = TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GDesktopAppInfo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TCArray True (-1) (-1) (TBasicType TUTF8)) -- throws : False -- Skip return : False foreign import ccall "g_desktop_app_info_list_actions" g_desktop_app_info_list_actions :: Ptr DesktopAppInfo -> -- info : TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}) IO (Ptr CString) {- | Returns the list of \"additional application actions\" supported on the desktop file, as per the desktop file specification. As per the specification, this is the list of actions that are explicitly listed in the \"Actions\" key of the [Desktop Entry] group. @since 2.38 -} desktopAppInfoListActions :: (B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfo a) => a {- ^ /@info@/: a 'GI.Gio.Objects.DesktopAppInfo.DesktopAppInfo' -} -> m [T.Text] {- ^ __Returns:__ a list of strings, always non-'Nothing' -} desktopAppInfoListActions info = liftIO $ do info' <- unsafeManagedPtrCastPtr info result <- g_desktop_app_info_list_actions info' checkUnexpectedReturnNULL "desktopAppInfoListActions" result result' <- unpackZeroTerminatedUTF8CArray result touchManagedPtr info return result' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) data DesktopAppInfoListActionsMethodInfo instance (signature ~ (m [T.Text]), MonadIO m, IsDesktopAppInfo a) => O.MethodInfo DesktopAppInfoListActionsMethodInfo a signature where overloadedMethod _ = desktopAppInfoListActions #endif -- method DesktopAppInfo::get_implementations -- method type : MemberFunction -- Args : [Arg {argCName = "interface", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the name of the interface", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TGList (TInterface (Name {namespace = "Gio", name = "DesktopAppInfo"}))) -- throws : False -- Skip return : False foreign import ccall "g_desktop_app_info_get_implementations" g_desktop_app_info_get_implementations :: CString -> -- interface : TBasicType TUTF8 IO (Ptr (GList (Ptr DesktopAppInfo))) {- | Gets all applications that implement /@interface@/. An application implements an interface if that interface is listed in the Implements= line of the desktop file of the application. @since 2.42 -} desktopAppInfoGetImplementations :: (B.CallStack.HasCallStack, MonadIO m) => T.Text {- ^ /@interface@/: the name of the interface -} -> m [DesktopAppInfo] {- ^ __Returns:__ a list of 'GI.Gio.Objects.DesktopAppInfo.DesktopAppInfo' objects. -} desktopAppInfoGetImplementations interface = liftIO $ do interface' <- textToCString 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) && !defined(__HADDOCK_VERSION__) #endif -- method DesktopAppInfo::search -- method type : MemberFunction -- Args : [Arg {argCName = "search_string", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the search string to use", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Just (TCArray True (-1) (-1) (TCArray True (-1) (-1) (TBasicType TUTF8))) -- throws : False -- Skip return : False foreign import ccall "g_desktop_app_info_search" g_desktop_app_info_search :: CString -> -- search_string : TBasicType TUTF8 IO (Ptr (Ptr CString)) {- | Searches desktop files for ones that match /@searchString@/. The return value is an array of strvs. Each strv contains a list of applications that matched /@searchString@/ with an equal score. The outer list is sorted by score so that the first strv contains the best-matching applications, and so on. The algorithm for determining matches is undefined and may change at any time. -} desktopAppInfoSearch :: (B.CallStack.HasCallStack, MonadIO m) => T.Text {- ^ /@searchString@/: the search string to use -} -> m [[T.Text]] {- ^ __Returns:__ a list of strvs. Free each item with 'GI.GLib.Functions.strfreev' and free the outer list with 'GI.GLib.Functions.free'. -} desktopAppInfoSearch searchString = liftIO $ do searchString' <- textToCString searchString result <- g_desktop_app_info_search searchString' checkUnexpectedReturnNULL "desktopAppInfoSearch" result result' <- unpackZeroTerminatedPtrArray result result'' <- mapM unpackZeroTerminatedUTF8CArray result' let freeElemOfResult e = mapZeroTerminatedCArray freeMem e >> freeMem e mapZeroTerminatedCArray freeElemOfResult result freeMem result freeMem searchString' return result'' #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) #endif -- method DesktopAppInfo::set_desktop_env -- method type : MemberFunction -- Args : [Arg {argCName = "desktop_env", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a string specifying what desktop this is", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}] -- Lengths : [] -- returnType : Nothing -- throws : False -- Skip return : False foreign import ccall "g_desktop_app_info_set_desktop_env" g_desktop_app_info_set_desktop_env :: CString -> -- desktop_env : TBasicType TUTF8 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."] #-} {- | Sets the name of the desktop that the application is running in. This is used by 'GI.Gio.Interfaces.AppInfo.appInfoShouldShow' and 'GI.Gio.Objects.DesktopAppInfo.desktopAppInfoGetShowIn' to evaluate the @OnlyShowIn@ and @NotShowIn@ desktop entry fields. Should be called only once; subsequent calls are ignored. -} desktopAppInfoSetDesktopEnv :: (B.CallStack.HasCallStack, MonadIO m) => T.Text {- ^ /@desktopEnv@/: a string specifying what desktop this is -} -> m () desktopAppInfoSetDesktopEnv desktopEnv = liftIO $ do desktopEnv' <- textToCString desktopEnv g_desktop_app_info_set_desktop_env desktopEnv' freeMem desktopEnv' return () #if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__) #endif