{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.OSTree.Objects.RepoFinderAvahi
(
RepoFinderAvahi(..) ,
IsRepoFinderAvahi ,
toRepoFinderAvahi ,
#if defined(ENABLE_OVERLOADING)
ResolveRepoFinderAvahiMethod ,
#endif
repoFinderAvahiNew ,
#if defined(ENABLE_OVERLOADING)
RepoFinderAvahiStartMethodInfo ,
#endif
repoFinderAvahiStart ,
#if defined(ENABLE_OVERLOADING)
RepoFinderAvahiStopMethodInfo ,
#endif
repoFinderAvahiStop ,
) 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 GI.GLib.Structs.MainContext as GLib.MainContext
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.OSTree.Interfaces.RepoFinder as OSTree.RepoFinder
newtype RepoFinderAvahi = RepoFinderAvahi (SP.ManagedPtr RepoFinderAvahi)
deriving (RepoFinderAvahi -> RepoFinderAvahi -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RepoFinderAvahi -> RepoFinderAvahi -> Bool
$c/= :: RepoFinderAvahi -> RepoFinderAvahi -> Bool
== :: RepoFinderAvahi -> RepoFinderAvahi -> Bool
$c== :: RepoFinderAvahi -> RepoFinderAvahi -> Bool
Eq)
instance SP.ManagedPtrNewtype RepoFinderAvahi where
toManagedPtr :: RepoFinderAvahi -> ManagedPtr RepoFinderAvahi
toManagedPtr (RepoFinderAvahi ManagedPtr RepoFinderAvahi
p) = ManagedPtr RepoFinderAvahi
p
foreign import ccall "ostree_repo_finder_avahi_get_type"
c_ostree_repo_finder_avahi_get_type :: IO B.Types.GType
instance B.Types.TypedObject RepoFinderAvahi where
glibType :: IO GType
glibType = IO GType
c_ostree_repo_finder_avahi_get_type
instance B.Types.GObject RepoFinderAvahi
class (SP.GObject o, O.IsDescendantOf RepoFinderAvahi o) => IsRepoFinderAvahi o
instance (SP.GObject o, O.IsDescendantOf RepoFinderAvahi o) => IsRepoFinderAvahi o
instance O.HasParentTypes RepoFinderAvahi
type instance O.ParentTypes RepoFinderAvahi = '[GObject.Object.Object, OSTree.RepoFinder.RepoFinder]
toRepoFinderAvahi :: (MIO.MonadIO m, IsRepoFinderAvahi o) => o -> m RepoFinderAvahi
toRepoFinderAvahi :: forall (m :: * -> *) o.
(MonadIO m, IsRepoFinderAvahi o) =>
o -> m RepoFinderAvahi
toRepoFinderAvahi = forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr RepoFinderAvahi -> RepoFinderAvahi
RepoFinderAvahi
instance B.GValue.IsGValue (Maybe RepoFinderAvahi) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_ostree_repo_finder_avahi_get_type
gvalueSet_ :: Ptr GValue -> Maybe RepoFinderAvahi -> IO ()
gvalueSet_ Ptr GValue
gv Maybe RepoFinderAvahi
P.Nothing = forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (forall a. Ptr a
FP.nullPtr :: FP.Ptr RepoFinderAvahi)
gvalueSet_ Ptr GValue
gv (P.Just RepoFinderAvahi
obj) = forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr RepoFinderAvahi
obj (forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe RepoFinderAvahi)
gvalueGet_ Ptr GValue
gv = do
Ptr RepoFinderAvahi
ptr <- forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr RepoFinderAvahi)
if Ptr RepoFinderAvahi
ptr forall a. Eq a => a -> a -> Bool
/= forall a. Ptr a
FP.nullPtr
then forall a. a -> Maybe a
P.Just forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr RepoFinderAvahi -> RepoFinderAvahi
RepoFinderAvahi Ptr RepoFinderAvahi
ptr
else forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveRepoFinderAvahiMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveRepoFinderAvahiMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveRepoFinderAvahiMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveRepoFinderAvahiMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveRepoFinderAvahiMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveRepoFinderAvahiMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveRepoFinderAvahiMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveRepoFinderAvahiMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveRepoFinderAvahiMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveRepoFinderAvahiMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveRepoFinderAvahiMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveRepoFinderAvahiMethod "resolveAsync" o = OSTree.RepoFinder.RepoFinderResolveAsyncMethodInfo
ResolveRepoFinderAvahiMethod "resolveFinish" o = OSTree.RepoFinder.RepoFinderResolveFinishMethodInfo
ResolveRepoFinderAvahiMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveRepoFinderAvahiMethod "start" o = RepoFinderAvahiStartMethodInfo
ResolveRepoFinderAvahiMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveRepoFinderAvahiMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveRepoFinderAvahiMethod "stop" o = RepoFinderAvahiStopMethodInfo
ResolveRepoFinderAvahiMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveRepoFinderAvahiMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveRepoFinderAvahiMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveRepoFinderAvahiMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveRepoFinderAvahiMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveRepoFinderAvahiMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveRepoFinderAvahiMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveRepoFinderAvahiMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveRepoFinderAvahiMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveRepoFinderAvahiMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveRepoFinderAvahiMethod t RepoFinderAvahi, O.OverloadedMethod info RepoFinderAvahi p) => OL.IsLabel t (RepoFinderAvahi -> 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 ~ ResolveRepoFinderAvahiMethod t RepoFinderAvahi, O.OverloadedMethod info RepoFinderAvahi p, R.HasField t RepoFinderAvahi p) => R.HasField t RepoFinderAvahi p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveRepoFinderAvahiMethod t RepoFinderAvahi, O.OverloadedMethodInfo info RepoFinderAvahi) => OL.IsLabel t (O.MethodProxy info RepoFinderAvahi) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList RepoFinderAvahi
type instance O.AttributeList RepoFinderAvahi = RepoFinderAvahiAttributeList
type RepoFinderAvahiAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList RepoFinderAvahi = RepoFinderAvahiSignalList
type RepoFinderAvahiSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "ostree_repo_finder_avahi_new" ostree_repo_finder_avahi_new ::
Ptr GLib.MainContext.MainContext ->
IO (Ptr RepoFinderAvahi)
repoFinderAvahiNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
Maybe (GLib.MainContext.MainContext)
-> m RepoFinderAvahi
repoFinderAvahiNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Maybe MainContext -> m RepoFinderAvahi
repoFinderAvahiNew Maybe MainContext
context = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr MainContext
maybeContext <- case Maybe MainContext
context of
Maybe MainContext
Nothing -> forall (m :: * -> *) a. Monad m => a -> m a
return forall a. Ptr a
nullPtr
Just MainContext
jContext -> do
Ptr MainContext
jContext' <- forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MainContext
jContext
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr MainContext
jContext'
Ptr RepoFinderAvahi
result <- Ptr MainContext -> IO (Ptr RepoFinderAvahi)
ostree_repo_finder_avahi_new Ptr MainContext
maybeContext
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"repoFinderAvahiNew" Ptr RepoFinderAvahi
result
RepoFinderAvahi
result' <- (forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr RepoFinderAvahi -> RepoFinderAvahi
RepoFinderAvahi) Ptr RepoFinderAvahi
result
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe MainContext
context forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
forall (m :: * -> *) a. Monad m => a -> m a
return RepoFinderAvahi
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "ostree_repo_finder_avahi_start" ostree_repo_finder_avahi_start ::
Ptr RepoFinderAvahi ->
Ptr (Ptr GError) ->
IO ()
repoFinderAvahiStart ::
(B.CallStack.HasCallStack, MonadIO m, IsRepoFinderAvahi a) =>
a
-> m ()
repoFinderAvahiStart :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepoFinderAvahi a) =>
a -> m ()
repoFinderAvahiStart a
self = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr RepoFinderAvahi
self' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
forall a b. IO a -> IO b -> IO a
onException (do
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError forall a b. (a -> b) -> a -> b
$ Ptr RepoFinderAvahi -> Ptr (Ptr GError) -> IO ()
ostree_repo_finder_avahi_start Ptr RepoFinderAvahi
self'
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data RepoFinderAvahiStartMethodInfo
instance (signature ~ (m ()), MonadIO m, IsRepoFinderAvahi a) => O.OverloadedMethod RepoFinderAvahiStartMethodInfo a signature where
overloadedMethod = repoFinderAvahiStart
instance O.OverloadedMethodInfo RepoFinderAvahiStartMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.OSTree.Objects.RepoFinderAvahi.repoFinderAvahiStart",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.16/docs/GI-OSTree-Objects-RepoFinderAvahi.html#v:repoFinderAvahiStart"
})
#endif
foreign import ccall "ostree_repo_finder_avahi_stop" ostree_repo_finder_avahi_stop ::
Ptr RepoFinderAvahi ->
IO ()
repoFinderAvahiStop ::
(B.CallStack.HasCallStack, MonadIO m, IsRepoFinderAvahi a) =>
a
-> m ()
repoFinderAvahiStop :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsRepoFinderAvahi a) =>
a -> m ()
repoFinderAvahiStop a
self = forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
Ptr RepoFinderAvahi
self' <- forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr RepoFinderAvahi -> IO ()
ostree_repo_finder_avahi_stop Ptr RepoFinderAvahi
self'
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RepoFinderAvahiStopMethodInfo
instance (signature ~ (m ()), MonadIO m, IsRepoFinderAvahi a) => O.OverloadedMethod RepoFinderAvahiStopMethodInfo a signature where
overloadedMethod = repoFinderAvahiStop
instance O.OverloadedMethodInfo RepoFinderAvahiStopMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.OSTree.Objects.RepoFinderAvahi.repoFinderAvahiStop",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-ostree-1.0.16/docs/GI-OSTree-Objects-RepoFinderAvahi.html#v:repoFinderAvahiStop"
})
#endif