{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.OSTree.Objects.RepoFinderConfig
(
RepoFinderConfig(..) ,
IsRepoFinderConfig ,
toRepoFinderConfig ,
#if defined(ENABLE_OVERLOADING)
ResolveRepoFinderConfigMethod ,
#endif
repoFinderConfigNew ,
) 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.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.KeyFile as GLib.KeyFile
import qualified GI.GLib.Structs.String as GLib.String
import qualified GI.GLib.Structs.VariantDict as GLib.VariantDict
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Flags as Gio.Flags
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Interfaces.File as Gio.File
import qualified GI.Gio.Interfaces.Initable as Gio.Initable
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Gio.Objects.FileInfo as Gio.FileInfo
import qualified GI.Gio.Objects.InputStream as Gio.InputStream
import qualified GI.Gio.Objects.OutputStream as Gio.OutputStream
import qualified GI.OSTree.Callbacks as OSTree.Callbacks
import {-# SOURCE #-} qualified GI.OSTree.Enums as OSTree.Enums
import {-# SOURCE #-} qualified GI.OSTree.Flags as OSTree.Flags
import {-# SOURCE #-} qualified GI.OSTree.Interfaces.RepoFinder as OSTree.RepoFinder
import {-# SOURCE #-} qualified GI.OSTree.Interfaces.Sign as OSTree.Sign
import {-# SOURCE #-} qualified GI.OSTree.Objects.AsyncProgress as OSTree.AsyncProgress
import {-# SOURCE #-} qualified GI.OSTree.Objects.ContentWriter as OSTree.ContentWriter
import {-# SOURCE #-} qualified GI.OSTree.Objects.GpgVerifyResult as OSTree.GpgVerifyResult
import {-# SOURCE #-} qualified GI.OSTree.Objects.MutableTree as OSTree.MutableTree
import {-# SOURCE #-} qualified GI.OSTree.Objects.Repo as OSTree.Repo
import {-# SOURCE #-} qualified GI.OSTree.Objects.RepoFile as OSTree.RepoFile
import {-# SOURCE #-} qualified GI.OSTree.Objects.SePolicy as OSTree.SePolicy
import {-# SOURCE #-} qualified GI.OSTree.Structs.CollectionRef as OSTree.CollectionRef
import {-# SOURCE #-} qualified GI.OSTree.Structs.Remote as OSTree.Remote
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoCheckoutAtOptions as OSTree.RepoCheckoutAtOptions
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoCommitModifier as OSTree.RepoCommitModifier
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoDevInoCache as OSTree.RepoDevInoCache
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoFinderResult as OSTree.RepoFinderResult
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoPruneOptions as OSTree.RepoPruneOptions
import {-# SOURCE #-} qualified GI.OSTree.Structs.RepoTransactionStats as OSTree.RepoTransactionStats
#else
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.OSTree.Interfaces.RepoFinder as OSTree.RepoFinder
#endif
newtype RepoFinderConfig = RepoFinderConfig (SP.ManagedPtr RepoFinderConfig)
deriving (RepoFinderConfig -> RepoFinderConfig -> Bool
(RepoFinderConfig -> RepoFinderConfig -> Bool)
-> (RepoFinderConfig -> RepoFinderConfig -> Bool)
-> Eq RepoFinderConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RepoFinderConfig -> RepoFinderConfig -> Bool
== :: RepoFinderConfig -> RepoFinderConfig -> Bool
$c/= :: RepoFinderConfig -> RepoFinderConfig -> Bool
/= :: RepoFinderConfig -> RepoFinderConfig -> Bool
Eq)
instance SP.ManagedPtrNewtype RepoFinderConfig where
toManagedPtr :: RepoFinderConfig -> ManagedPtr RepoFinderConfig
toManagedPtr (RepoFinderConfig ManagedPtr RepoFinderConfig
p) = ManagedPtr RepoFinderConfig
p
foreign import ccall "ostree_repo_finder_config_get_type"
c_ostree_repo_finder_config_get_type :: IO B.Types.GType
instance B.Types.TypedObject RepoFinderConfig where
glibType :: IO GType
glibType = IO GType
c_ostree_repo_finder_config_get_type
instance B.Types.GObject RepoFinderConfig
class (SP.GObject o, O.IsDescendantOf RepoFinderConfig o) => IsRepoFinderConfig o
instance (SP.GObject o, O.IsDescendantOf RepoFinderConfig o) => IsRepoFinderConfig o
instance O.HasParentTypes RepoFinderConfig
type instance O.ParentTypes RepoFinderConfig = '[GObject.Object.Object, OSTree.RepoFinder.RepoFinder]
toRepoFinderConfig :: (MIO.MonadIO m, IsRepoFinderConfig o) => o -> m RepoFinderConfig
toRepoFinderConfig :: forall (m :: * -> *) o.
(MonadIO m, IsRepoFinderConfig o) =>
o -> m RepoFinderConfig
toRepoFinderConfig = IO RepoFinderConfig -> m RepoFinderConfig
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO RepoFinderConfig -> m RepoFinderConfig)
-> (o -> IO RepoFinderConfig) -> o -> m RepoFinderConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr RepoFinderConfig -> RepoFinderConfig)
-> o -> IO RepoFinderConfig
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr RepoFinderConfig -> RepoFinderConfig
RepoFinderConfig
instance B.GValue.IsGValue (Maybe RepoFinderConfig) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_ostree_repo_finder_config_get_type
gvalueSet_ :: Ptr GValue -> Maybe RepoFinderConfig -> IO ()
gvalueSet_ Ptr GValue
gv Maybe RepoFinderConfig
P.Nothing = Ptr GValue -> Ptr RepoFinderConfig -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr RepoFinderConfig
forall a. Ptr a
FP.nullPtr :: FP.Ptr RepoFinderConfig)
gvalueSet_ Ptr GValue
gv (P.Just RepoFinderConfig
obj) = RepoFinderConfig -> (Ptr RepoFinderConfig -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr RepoFinderConfig
obj (Ptr GValue -> Ptr RepoFinderConfig -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe RepoFinderConfig)
gvalueGet_ Ptr GValue
gv = do
Ptr RepoFinderConfig
ptr <- Ptr GValue -> IO (Ptr RepoFinderConfig)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr RepoFinderConfig)
if Ptr RepoFinderConfig
ptr Ptr RepoFinderConfig -> Ptr RepoFinderConfig -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr RepoFinderConfig
forall a. Ptr a
FP.nullPtr
then RepoFinderConfig -> Maybe RepoFinderConfig
forall a. a -> Maybe a
P.Just (RepoFinderConfig -> Maybe RepoFinderConfig)
-> IO RepoFinderConfig -> IO (Maybe RepoFinderConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr RepoFinderConfig -> RepoFinderConfig)
-> Ptr RepoFinderConfig -> IO RepoFinderConfig
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr RepoFinderConfig -> RepoFinderConfig
RepoFinderConfig Ptr RepoFinderConfig
ptr
else Maybe RepoFinderConfig -> IO (Maybe RepoFinderConfig)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe RepoFinderConfig
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveRepoFinderConfigMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveRepoFinderConfigMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveRepoFinderConfigMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveRepoFinderConfigMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveRepoFinderConfigMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveRepoFinderConfigMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveRepoFinderConfigMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveRepoFinderConfigMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveRepoFinderConfigMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveRepoFinderConfigMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveRepoFinderConfigMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveRepoFinderConfigMethod "resolveAsync" o = OSTree.RepoFinder.RepoFinderResolveAsyncMethodInfo
ResolveRepoFinderConfigMethod "resolveFinish" o = OSTree.RepoFinder.RepoFinderResolveFinishMethodInfo
ResolveRepoFinderConfigMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveRepoFinderConfigMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveRepoFinderConfigMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveRepoFinderConfigMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveRepoFinderConfigMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveRepoFinderConfigMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveRepoFinderConfigMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveRepoFinderConfigMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveRepoFinderConfigMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveRepoFinderConfigMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveRepoFinderConfigMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveRepoFinderConfigMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveRepoFinderConfigMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveRepoFinderConfigMethod t RepoFinderConfig, O.OverloadedMethod info RepoFinderConfig p) => OL.IsLabel t (RepoFinderConfig -> 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 ~ ResolveRepoFinderConfigMethod t RepoFinderConfig, O.OverloadedMethod info RepoFinderConfig p, R.HasField t RepoFinderConfig p) => R.HasField t RepoFinderConfig p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveRepoFinderConfigMethod t RepoFinderConfig, O.OverloadedMethodInfo info RepoFinderConfig) => OL.IsLabel t (O.MethodProxy info RepoFinderConfig) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList RepoFinderConfig
type instance O.AttributeList RepoFinderConfig = RepoFinderConfigAttributeList
type RepoFinderConfigAttributeList = ('[ ] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList RepoFinderConfig = RepoFinderConfigSignalList
type RepoFinderConfigSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "ostree_repo_finder_config_new" ostree_repo_finder_config_new ::
IO (Ptr RepoFinderConfig)
repoFinderConfigNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m RepoFinderConfig
repoFinderConfigNew :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
m RepoFinderConfig
repoFinderConfigNew = IO RepoFinderConfig -> m RepoFinderConfig
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO RepoFinderConfig -> m RepoFinderConfig)
-> IO RepoFinderConfig -> m RepoFinderConfig
forall a b. (a -> b) -> a -> b
$ do
Ptr RepoFinderConfig
result <- IO (Ptr RepoFinderConfig)
ostree_repo_finder_config_new
Text -> Ptr RepoFinderConfig -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"repoFinderConfigNew" Ptr RepoFinderConfig
result
RepoFinderConfig
result' <- ((ManagedPtr RepoFinderConfig -> RepoFinderConfig)
-> Ptr RepoFinderConfig -> IO RepoFinderConfig
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr RepoFinderConfig -> RepoFinderConfig
RepoFinderConfig) Ptr RepoFinderConfig
result
RepoFinderConfig -> IO RepoFinderConfig
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return RepoFinderConfig
result'
#if defined(ENABLE_OVERLOADING)
#endif