{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Interfaces.DesktopAppInfoLookup
(
DesktopAppInfoLookup(..) ,
noDesktopAppInfoLookup ,
IsDesktopAppInfoLookup ,
toDesktopAppInfoLookup ,
#if defined(ENABLE_OVERLOADING)
ResolveDesktopAppInfoLookupMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
DesktopAppInfoLookupGetDefaultForUriSchemeMethodInfo,
#endif
desktopAppInfoLookupGetDefaultForUriScheme,
) 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.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gio.Interfaces.AppInfo as Gio.AppInfo
newtype DesktopAppInfoLookup = DesktopAppInfoLookup (ManagedPtr DesktopAppInfoLookup)
deriving (DesktopAppInfoLookup -> DesktopAppInfoLookup -> Bool
(DesktopAppInfoLookup -> DesktopAppInfoLookup -> Bool)
-> (DesktopAppInfoLookup -> DesktopAppInfoLookup -> Bool)
-> Eq DesktopAppInfoLookup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DesktopAppInfoLookup -> DesktopAppInfoLookup -> Bool
$c/= :: DesktopAppInfoLookup -> DesktopAppInfoLookup -> Bool
== :: DesktopAppInfoLookup -> DesktopAppInfoLookup -> Bool
$c== :: DesktopAppInfoLookup -> DesktopAppInfoLookup -> Bool
Eq)
noDesktopAppInfoLookup :: Maybe DesktopAppInfoLookup
noDesktopAppInfoLookup :: Maybe DesktopAppInfoLookup
noDesktopAppInfoLookup = Maybe DesktopAppInfoLookup
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList DesktopAppInfoLookup = DesktopAppInfoLookupSignalList
type DesktopAppInfoLookupSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_desktop_app_info_lookup_get_type"
c_g_desktop_app_info_lookup_get_type :: IO GType
instance GObject DesktopAppInfoLookup where
gobjectType :: IO GType
gobjectType = IO GType
c_g_desktop_app_info_lookup_get_type
instance B.GValue.IsGValue DesktopAppInfoLookup where
toGValue :: DesktopAppInfoLookup -> IO GValue
toGValue o :: DesktopAppInfoLookup
o = do
GType
gtype <- IO GType
c_g_desktop_app_info_lookup_get_type
DesktopAppInfoLookup
-> (Ptr DesktopAppInfoLookup -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr DesktopAppInfoLookup
o (GType
-> (GValue -> Ptr DesktopAppInfoLookup -> IO ())
-> Ptr DesktopAppInfoLookup
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr DesktopAppInfoLookup -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO DesktopAppInfoLookup
fromGValue gv :: GValue
gv = do
Ptr DesktopAppInfoLookup
ptr <- GValue -> IO (Ptr DesktopAppInfoLookup)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr DesktopAppInfoLookup)
(ManagedPtr DesktopAppInfoLookup -> DesktopAppInfoLookup)
-> Ptr DesktopAppInfoLookup -> IO DesktopAppInfoLookup
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr DesktopAppInfoLookup -> DesktopAppInfoLookup
DesktopAppInfoLookup Ptr DesktopAppInfoLookup
ptr
class (GObject o, O.IsDescendantOf DesktopAppInfoLookup o) => IsDesktopAppInfoLookup o
instance (GObject o, O.IsDescendantOf DesktopAppInfoLookup o) => IsDesktopAppInfoLookup o
instance O.HasParentTypes DesktopAppInfoLookup
type instance O.ParentTypes DesktopAppInfoLookup = '[GObject.Object.Object]
toDesktopAppInfoLookup :: (MonadIO m, IsDesktopAppInfoLookup o) => o -> m DesktopAppInfoLookup
toDesktopAppInfoLookup :: o -> m DesktopAppInfoLookup
toDesktopAppInfoLookup = IO DesktopAppInfoLookup -> m DesktopAppInfoLookup
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DesktopAppInfoLookup -> m DesktopAppInfoLookup)
-> (o -> IO DesktopAppInfoLookup) -> o -> m DesktopAppInfoLookup
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr DesktopAppInfoLookup -> DesktopAppInfoLookup)
-> o -> IO DesktopAppInfoLookup
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr DesktopAppInfoLookup -> DesktopAppInfoLookup
DesktopAppInfoLookup
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList DesktopAppInfoLookup
type instance O.AttributeList DesktopAppInfoLookup = DesktopAppInfoLookupAttributeList
type DesktopAppInfoLookupAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveDesktopAppInfoLookupMethod (t :: Symbol) (o :: *) :: * where
ResolveDesktopAppInfoLookupMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveDesktopAppInfoLookupMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveDesktopAppInfoLookupMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveDesktopAppInfoLookupMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveDesktopAppInfoLookupMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveDesktopAppInfoLookupMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveDesktopAppInfoLookupMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveDesktopAppInfoLookupMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveDesktopAppInfoLookupMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveDesktopAppInfoLookupMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveDesktopAppInfoLookupMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveDesktopAppInfoLookupMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveDesktopAppInfoLookupMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveDesktopAppInfoLookupMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveDesktopAppInfoLookupMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveDesktopAppInfoLookupMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveDesktopAppInfoLookupMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveDesktopAppInfoLookupMethod "getDefaultForUriScheme" o = DesktopAppInfoLookupGetDefaultForUriSchemeMethodInfo
ResolveDesktopAppInfoLookupMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveDesktopAppInfoLookupMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveDesktopAppInfoLookupMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveDesktopAppInfoLookupMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveDesktopAppInfoLookupMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveDesktopAppInfoLookupMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDesktopAppInfoLookupMethod t DesktopAppInfoLookup, O.MethodInfo info DesktopAppInfoLookup p) => OL.IsLabel t (DesktopAppInfoLookup -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif
foreign import ccall "g_desktop_app_info_lookup_get_default_for_uri_scheme" g_desktop_app_info_lookup_get_default_for_uri_scheme ::
Ptr DesktopAppInfoLookup ->
CString ->
IO (Ptr Gio.AppInfo.AppInfo)
{-# DEPRECATED desktopAppInfoLookupGetDefaultForUriScheme ["The t'GI.Gio.Interfaces.DesktopAppInfoLookup.DesktopAppInfoLookup' interface is deprecated and unused by gio."] #-}
desktopAppInfoLookupGetDefaultForUriScheme ::
(B.CallStack.HasCallStack, MonadIO m, IsDesktopAppInfoLookup a) =>
a
-> T.Text
-> m Gio.AppInfo.AppInfo
desktopAppInfoLookupGetDefaultForUriScheme :: a -> Text -> m AppInfo
desktopAppInfoLookupGetDefaultForUriScheme lookup :: a
lookup uriScheme :: Text
uriScheme = IO AppInfo -> m AppInfo
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AppInfo -> m AppInfo) -> IO AppInfo -> m AppInfo
forall a b. (a -> b) -> a -> b
$ do
Ptr DesktopAppInfoLookup
lookup' <- a -> IO (Ptr DesktopAppInfoLookup)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
lookup
CString
uriScheme' <- Text -> IO CString
textToCString Text
uriScheme
Ptr AppInfo
result <- Ptr DesktopAppInfoLookup -> CString -> IO (Ptr AppInfo)
g_desktop_app_info_lookup_get_default_for_uri_scheme Ptr DesktopAppInfoLookup
lookup' CString
uriScheme'
Text -> Ptr AppInfo -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "desktopAppInfoLookupGetDefaultForUriScheme" Ptr AppInfo
result
AppInfo
result' <- ((ManagedPtr AppInfo -> AppInfo) -> Ptr AppInfo -> IO AppInfo
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr AppInfo -> AppInfo
Gio.AppInfo.AppInfo) Ptr AppInfo
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
lookup
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uriScheme'
AppInfo -> IO AppInfo
forall (m :: * -> *) a. Monad m => a -> m a
return AppInfo
result'
#if defined(ENABLE_OVERLOADING)
data DesktopAppInfoLookupGetDefaultForUriSchemeMethodInfo
instance (signature ~ (T.Text -> m Gio.AppInfo.AppInfo), MonadIO m, IsDesktopAppInfoLookup a) => O.MethodInfo DesktopAppInfoLookupGetDefaultForUriSchemeMethodInfo a signature where
overloadedMethod = desktopAppInfoLookupGetDefaultForUriScheme
#endif