{-# LANGUAGE ImplicitParams, RankNTypes, TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Objects.AppInfoMonitor
(
AppInfoMonitor(..) ,
IsAppInfoMonitor ,
toAppInfoMonitor ,
#if defined(ENABLE_OVERLOADING)
ResolveAppInfoMonitorMethod ,
#endif
appInfoMonitorGet ,
AppInfoMonitorChangedCallback ,
#if defined(ENABLE_OVERLOADING)
AppInfoMonitorChangedSignalInfo ,
#endif
afterAppInfoMonitorChanged ,
onAppInfoMonitorChanged ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.GObject.Objects.Object as GObject.Object
#else
import qualified GI.GObject.Objects.Object as GObject.Object
#endif
newtype AppInfoMonitor = AppInfoMonitor (SP.ManagedPtr AppInfoMonitor)
deriving (AppInfoMonitor -> AppInfoMonitor -> Bool
(AppInfoMonitor -> AppInfoMonitor -> Bool)
-> (AppInfoMonitor -> AppInfoMonitor -> Bool) -> Eq AppInfoMonitor
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AppInfoMonitor -> AppInfoMonitor -> Bool
== :: AppInfoMonitor -> AppInfoMonitor -> Bool
$c/= :: AppInfoMonitor -> AppInfoMonitor -> Bool
/= :: AppInfoMonitor -> AppInfoMonitor -> Bool
Eq)
instance SP.ManagedPtrNewtype AppInfoMonitor where
toManagedPtr :: AppInfoMonitor -> ManagedPtr AppInfoMonitor
toManagedPtr (AppInfoMonitor ManagedPtr AppInfoMonitor
p) = ManagedPtr AppInfoMonitor
p
foreign import ccall "g_app_info_monitor_get_type"
c_g_app_info_monitor_get_type :: IO B.Types.GType
instance B.Types.TypedObject AppInfoMonitor where
glibType :: IO GType
glibType = IO GType
c_g_app_info_monitor_get_type
instance B.Types.GObject AppInfoMonitor
class (SP.GObject o, O.IsDescendantOf AppInfoMonitor o) => IsAppInfoMonitor o
instance (SP.GObject o, O.IsDescendantOf AppInfoMonitor o) => IsAppInfoMonitor o
instance O.HasParentTypes AppInfoMonitor
type instance O.ParentTypes AppInfoMonitor = '[GObject.Object.Object]
toAppInfoMonitor :: (MIO.MonadIO m, IsAppInfoMonitor o) => o -> m AppInfoMonitor
toAppInfoMonitor :: forall (m :: * -> *) o.
(MonadIO m, IsAppInfoMonitor o) =>
o -> m AppInfoMonitor
toAppInfoMonitor = IO AppInfoMonitor -> m AppInfoMonitor
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO AppInfoMonitor -> m AppInfoMonitor)
-> (o -> IO AppInfoMonitor) -> o -> m AppInfoMonitor
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr AppInfoMonitor -> AppInfoMonitor)
-> o -> IO AppInfoMonitor
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr AppInfoMonitor -> AppInfoMonitor
AppInfoMonitor
instance B.GValue.IsGValue (Maybe AppInfoMonitor) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_g_app_info_monitor_get_type
gvalueSet_ :: Ptr GValue -> Maybe AppInfoMonitor -> IO ()
gvalueSet_ Ptr GValue
gv Maybe AppInfoMonitor
P.Nothing = Ptr GValue -> Ptr AppInfoMonitor -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr AppInfoMonitor
forall a. Ptr a
FP.nullPtr :: FP.Ptr AppInfoMonitor)
gvalueSet_ Ptr GValue
gv (P.Just AppInfoMonitor
obj) = AppInfoMonitor -> (Ptr AppInfoMonitor -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr AppInfoMonitor
obj (Ptr GValue -> Ptr AppInfoMonitor -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe AppInfoMonitor)
gvalueGet_ Ptr GValue
gv = do
ptr <- Ptr GValue -> IO (Ptr AppInfoMonitor)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr AppInfoMonitor)
if ptr /= FP.nullPtr
then P.Just <$> B.ManagedPtr.newObject AppInfoMonitor ptr
else return P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveAppInfoMonitorMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveAppInfoMonitorMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveAppInfoMonitorMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveAppInfoMonitorMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveAppInfoMonitorMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveAppInfoMonitorMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveAppInfoMonitorMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveAppInfoMonitorMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveAppInfoMonitorMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveAppInfoMonitorMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveAppInfoMonitorMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveAppInfoMonitorMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveAppInfoMonitorMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveAppInfoMonitorMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveAppInfoMonitorMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveAppInfoMonitorMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveAppInfoMonitorMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveAppInfoMonitorMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveAppInfoMonitorMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveAppInfoMonitorMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveAppInfoMonitorMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveAppInfoMonitorMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveAppInfoMonitorMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveAppInfoMonitorMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveAppInfoMonitorMethod t AppInfoMonitor, O.OverloadedMethod info AppInfoMonitor p) => OL.IsLabel t (AppInfoMonitor -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveAppInfoMonitorMethod t AppInfoMonitor, O.OverloadedMethod info AppInfoMonitor p, R.HasField t AppInfoMonitor p) => R.HasField t AppInfoMonitor p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveAppInfoMonitorMethod t AppInfoMonitor, O.OverloadedMethodInfo info AppInfoMonitor) => OL.IsLabel t (O.MethodProxy info AppInfoMonitor) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
type AppInfoMonitorChangedCallback =
IO ()
type C_AppInfoMonitorChangedCallback =
Ptr AppInfoMonitor ->
Ptr () ->
IO ()
foreign import ccall "wrapper"
mk_AppInfoMonitorChangedCallback :: C_AppInfoMonitorChangedCallback -> IO (FunPtr C_AppInfoMonitorChangedCallback)
wrap_AppInfoMonitorChangedCallback ::
GObject a => (a -> AppInfoMonitorChangedCallback) ->
C_AppInfoMonitorChangedCallback
wrap_AppInfoMonitorChangedCallback :: forall a.
GObject a =>
(a -> IO ()) -> C_AppInfoMonitorChangedCallback
wrap_AppInfoMonitorChangedCallback a -> IO ()
gi'cb Ptr AppInfoMonitor
gi'selfPtr Ptr ()
_ = do
Ptr AppInfoMonitor -> (AppInfoMonitor -> IO ()) -> IO ()
forall o b.
(HasCallStack, GObject o) =>
Ptr o -> (o -> IO b) -> IO b
B.ManagedPtr.withNewObject Ptr AppInfoMonitor
gi'selfPtr ((AppInfoMonitor -> IO ()) -> IO ())
-> (AppInfoMonitor -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \AppInfoMonitor
gi'self -> a -> IO ()
gi'cb (AppInfoMonitor -> a
forall a b. Coercible a b => a -> b
Coerce.coerce AppInfoMonitor
gi'self)
onAppInfoMonitorChanged :: (IsAppInfoMonitor a, MonadIO m) => a -> ((?self :: a) => AppInfoMonitorChangedCallback) -> m SignalHandlerId
onAppInfoMonitorChanged :: forall a (m :: * -> *).
(IsAppInfoMonitor a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
onAppInfoMonitorChanged a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_AppInfoMonitorChangedCallback
wrapped' = (a -> IO ()) -> C_AppInfoMonitorChangedCallback
forall a.
GObject a =>
(a -> IO ()) -> C_AppInfoMonitorChangedCallback
wrap_AppInfoMonitorChangedCallback a -> IO ()
wrapped
wrapped'' <- C_AppInfoMonitorChangedCallback
-> IO (FunPtr C_AppInfoMonitorChangedCallback)
mk_AppInfoMonitorChangedCallback C_AppInfoMonitorChangedCallback
wrapped'
connectSignalFunPtr obj "changed" wrapped'' SignalConnectBefore Nothing
afterAppInfoMonitorChanged :: (IsAppInfoMonitor a, MonadIO m) => a -> ((?self :: a) => AppInfoMonitorChangedCallback) -> m SignalHandlerId
afterAppInfoMonitorChanged :: forall a (m :: * -> *).
(IsAppInfoMonitor a, MonadIO m) =>
a -> ((?self::a) => IO ()) -> m SignalHandlerId
afterAppInfoMonitorChanged a
obj (?self::a) => IO ()
cb = IO SignalHandlerId -> m SignalHandlerId
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
let wrapped :: a -> IO ()
wrapped a
self = let ?self = a
?self::a
self in IO ()
(?self::a) => IO ()
cb
let wrapped' :: C_AppInfoMonitorChangedCallback
wrapped' = (a -> IO ()) -> C_AppInfoMonitorChangedCallback
forall a.
GObject a =>
(a -> IO ()) -> C_AppInfoMonitorChangedCallback
wrap_AppInfoMonitorChangedCallback a -> IO ()
wrapped
wrapped'' <- C_AppInfoMonitorChangedCallback
-> IO (FunPtr C_AppInfoMonitorChangedCallback)
mk_AppInfoMonitorChangedCallback C_AppInfoMonitorChangedCallback
wrapped'
connectSignalFunPtr obj "changed" wrapped'' SignalConnectAfter Nothing
#if defined(ENABLE_OVERLOADING)
data AppInfoMonitorChangedSignalInfo
instance SignalInfo AppInfoMonitorChangedSignalInfo where
type HaskellCallbackType AppInfoMonitorChangedSignalInfo = AppInfoMonitorChangedCallback
connectSignal obj cb connectMode detail = do
let cb' = wrap_AppInfoMonitorChangedCallback cb
cb'' <- mk_AppInfoMonitorChangedCallback cb'
connectSignalFunPtr obj "changed" cb'' connectMode detail
dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.Gio.Objects.AppInfoMonitor::changed"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-gio-2.0.35/docs/GI-Gio-Objects-AppInfoMonitor.html#g:signal:changed"})
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList AppInfoMonitor
type instance O.AttributeList AppInfoMonitor = AppInfoMonitorAttributeList
type AppInfoMonitorAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList AppInfoMonitor = AppInfoMonitorSignalList
type AppInfoMonitorSignalList = ('[ '("changed", AppInfoMonitorChangedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "g_app_info_monitor_get" g_app_info_monitor_get ::
IO (Ptr AppInfoMonitor)
appInfoMonitorGet ::
(B.CallStack.HasCallStack, MonadIO m) =>
m AppInfoMonitor
appInfoMonitorGet :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m AppInfoMonitor
appInfoMonitorGet = IO AppInfoMonitor -> m AppInfoMonitor
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO AppInfoMonitor -> m AppInfoMonitor)
-> IO AppInfoMonitor -> m AppInfoMonitor
forall a b. (a -> b) -> a -> b
$ do
result <- IO (Ptr AppInfoMonitor)
g_app_info_monitor_get
checkUnexpectedReturnNULL "appInfoMonitorGet" result
result' <- (wrapObject AppInfoMonitor) result
return result'
#if defined(ENABLE_OVERLOADING)
#endif