{-# 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.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 Control.Monad.IO.Class as MIO
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GI.GLib.Structs.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
(RepoFinderAvahi -> RepoFinderAvahi -> Bool)
-> (RepoFinderAvahi -> RepoFinderAvahi -> Bool)
-> Eq RepoFinderAvahi
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
instance B.GValue.IsGValue RepoFinderAvahi where
toGValue :: RepoFinderAvahi -> IO GValue
toGValue RepoFinderAvahi
o = do
GType
gtype <- IO GType
c_ostree_repo_finder_avahi_get_type
RepoFinderAvahi -> (Ptr RepoFinderAvahi -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr RepoFinderAvahi
o (GType
-> (GValue -> Ptr RepoFinderAvahi -> IO ())
-> Ptr RepoFinderAvahi
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr RepoFinderAvahi -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
fromGValue :: GValue -> IO RepoFinderAvahi
fromGValue GValue
gv = do
Ptr RepoFinderAvahi
ptr <- GValue -> IO (Ptr RepoFinderAvahi)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr RepoFinderAvahi)
(ManagedPtr RepoFinderAvahi -> RepoFinderAvahi)
-> Ptr RepoFinderAvahi -> IO RepoFinderAvahi
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
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 :: (MonadIO m, IsRepoFinderAvahi o) => o -> m RepoFinderAvahi
toRepoFinderAvahi :: o -> m RepoFinderAvahi
toRepoFinderAvahi = IO RepoFinderAvahi -> m RepoFinderAvahi
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RepoFinderAvahi -> m RepoFinderAvahi)
-> (o -> IO RepoFinderAvahi) -> o -> m RepoFinderAvahi
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr RepoFinderAvahi -> RepoFinderAvahi)
-> o -> IO RepoFinderAvahi
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr RepoFinderAvahi -> RepoFinderAvahi
RepoFinderAvahi
#if defined(ENABLE_OVERLOADING)
type family ResolveRepoFinderAvahiMethod (t :: Symbol) (o :: *) :: * 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.MethodInfo 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
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList RepoFinderAvahi
type instance O.AttributeList RepoFinderAvahi = RepoFinderAvahiAttributeList
type RepoFinderAvahiAttributeList = ('[ ] :: [(Symbol, *)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList RepoFinderAvahi = RepoFinderAvahiSignalList
type RepoFinderAvahiSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])
#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) =>
GLib.MainContext.MainContext
-> m RepoFinderAvahi
repoFinderAvahiNew :: MainContext -> m RepoFinderAvahi
repoFinderAvahiNew MainContext
context = IO RepoFinderAvahi -> m RepoFinderAvahi
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RepoFinderAvahi -> m RepoFinderAvahi)
-> IO RepoFinderAvahi -> m RepoFinderAvahi
forall a b. (a -> b) -> a -> b
$ do
Ptr MainContext
context' <- MainContext -> IO (Ptr MainContext)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MainContext
context
Ptr RepoFinderAvahi
result <- Ptr MainContext -> IO (Ptr RepoFinderAvahi)
ostree_repo_finder_avahi_new Ptr MainContext
context'
Text -> Ptr RepoFinderAvahi -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"repoFinderAvahiNew" Ptr RepoFinderAvahi
result
RepoFinderAvahi
result' <- ((ManagedPtr RepoFinderAvahi -> RepoFinderAvahi)
-> Ptr RepoFinderAvahi -> IO RepoFinderAvahi
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr RepoFinderAvahi -> RepoFinderAvahi
RepoFinderAvahi) Ptr RepoFinderAvahi
result
MainContext -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MainContext
context
RepoFinderAvahi -> IO RepoFinderAvahi
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 :: a -> m ()
repoFinderAvahiStart a
self = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr RepoFinderAvahi
self' <- a -> IO (Ptr RepoFinderAvahi)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
(Ptr (Ptr GError) -> IO ()) -> IO ()
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO ()) -> IO ())
-> (Ptr (Ptr GError) -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ Ptr RepoFinderAvahi -> Ptr (Ptr GError) -> IO ()
ostree_repo_finder_avahi_start Ptr RepoFinderAvahi
self'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
) (do
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
)
#if defined(ENABLE_OVERLOADING)
data RepoFinderAvahiStartMethodInfo
instance (signature ~ (m ()), MonadIO m, IsRepoFinderAvahi a) => O.MethodInfo RepoFinderAvahiStartMethodInfo a signature where
overloadedMethod = 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 :: a -> m ()
repoFinderAvahiStop a
self = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr RepoFinderAvahi
self' <- a -> IO (Ptr RepoFinderAvahi)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
Ptr RepoFinderAvahi -> IO ()
ostree_repo_finder_avahi_stop Ptr RepoFinderAvahi
self'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data RepoFinderAvahiStopMethodInfo
instance (signature ~ (m ()), MonadIO m, IsRepoFinderAvahi a) => O.MethodInfo RepoFinderAvahiStopMethodInfo a signature where
overloadedMethod = repoFinderAvahiStop
#endif