{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GLib.Structs.TestSuite
(
TestSuite(..) ,
#if defined(ENABLE_OVERLOADING)
ResolveTestSuiteMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
TestSuiteAddMethodInfo ,
#endif
testSuiteAdd ,
#if defined(ENABLE_OVERLOADING)
TestSuiteAddSuiteMethodInfo ,
#endif
testSuiteAddSuite ,
) 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 {-# SOURCE #-} qualified GI.GLib.Structs.TestCase as GLib.TestCase
newtype TestSuite = TestSuite (SP.ManagedPtr TestSuite)
deriving (TestSuite -> TestSuite -> Bool
(TestSuite -> TestSuite -> Bool)
-> (TestSuite -> TestSuite -> Bool) -> Eq TestSuite
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TestSuite -> TestSuite -> Bool
$c/= :: TestSuite -> TestSuite -> Bool
== :: TestSuite -> TestSuite -> Bool
$c== :: TestSuite -> TestSuite -> Bool
Eq)
instance SP.ManagedPtrNewtype TestSuite where
toManagedPtr :: TestSuite -> ManagedPtr TestSuite
toManagedPtr (TestSuite ManagedPtr TestSuite
p) = ManagedPtr TestSuite
p
instance BoxedPtr TestSuite where
boxedPtrCopy :: TestSuite -> IO TestSuite
boxedPtrCopy = TestSuite -> IO TestSuite
forall (m :: * -> *) a. Monad m => a -> m a
return
boxedPtrFree :: TestSuite -> IO ()
boxedPtrFree = \TestSuite
_x -> () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList TestSuite
type instance O.AttributeList TestSuite = TestSuiteAttributeList
type TestSuiteAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "g_test_suite_add" g_test_suite_add ::
Ptr TestSuite ->
Ptr GLib.TestCase.TestCase ->
IO ()
testSuiteAdd ::
(B.CallStack.HasCallStack, MonadIO m) =>
TestSuite
-> GLib.TestCase.TestCase
-> m ()
testSuiteAdd :: TestSuite -> TestCase -> m ()
testSuiteAdd TestSuite
suite TestCase
testCase = 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 TestSuite
suite' <- TestSuite -> IO (Ptr TestSuite)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TestSuite
suite
Ptr TestCase
testCase' <- TestCase -> IO (Ptr TestCase)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TestCase
testCase
Ptr TestSuite -> Ptr TestCase -> IO ()
g_test_suite_add Ptr TestSuite
suite' Ptr TestCase
testCase'
TestSuite -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TestSuite
suite
TestCase -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TestCase
testCase
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TestSuiteAddMethodInfo
instance (signature ~ (GLib.TestCase.TestCase -> m ()), MonadIO m) => O.MethodInfo TestSuiteAddMethodInfo TestSuite signature where
overloadedMethod = testSuiteAdd
#endif
foreign import ccall "g_test_suite_add_suite" g_test_suite_add_suite ::
Ptr TestSuite ->
Ptr TestSuite ->
IO ()
testSuiteAddSuite ::
(B.CallStack.HasCallStack, MonadIO m) =>
TestSuite
-> TestSuite
-> m ()
testSuiteAddSuite :: TestSuite -> TestSuite -> m ()
testSuiteAddSuite TestSuite
suite TestSuite
nestedsuite = 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 TestSuite
suite' <- TestSuite -> IO (Ptr TestSuite)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TestSuite
suite
Ptr TestSuite
nestedsuite' <- TestSuite -> IO (Ptr TestSuite)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TestSuite
nestedsuite
Ptr TestSuite -> Ptr TestSuite -> IO ()
g_test_suite_add_suite Ptr TestSuite
suite' Ptr TestSuite
nestedsuite'
TestSuite -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TestSuite
suite
TestSuite -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TestSuite
nestedsuite
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data TestSuiteAddSuiteMethodInfo
instance (signature ~ (TestSuite -> m ()), MonadIO m) => O.MethodInfo TestSuiteAddSuiteMethodInfo TestSuite signature where
overloadedMethod = testSuiteAddSuite
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveTestSuiteMethod (t :: Symbol) (o :: *) :: * where
ResolveTestSuiteMethod "add" o = TestSuiteAddMethodInfo
ResolveTestSuiteMethod "addSuite" o = TestSuiteAddSuiteMethodInfo
ResolveTestSuiteMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveTestSuiteMethod t TestSuite, O.MethodInfo info TestSuite p) => OL.IsLabel t (TestSuite -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif