    {-# LANGUAGE TypeApplications #-}

    -- | Copyright  : Will Thompson and Iñaki García Etxebarria
    -- License    : LGPL-2.1
    -- Maintainer : Iñaki García Etxebarria
    --
    -- /No description available in the introspection data./

    #if !defined(__HADDOCK_VERSION__)
    #define ENABLE_OVERLOADING
    #endif

    module GI.GLib.Structs.TestLogBuffer
        (

    -- * Exported types
        TestLogBuffer(..)                       ,
        newZeroTestLogBuffer                    ,

     -- * Methods
    -- |
    --
    --  === __Click to display all available methods, including inherited ones__
    -- ==== Methods
    -- [free]("GI.GLib.Structs.TestLogBuffer#g:method:free"), [push]("GI.GLib.Structs.TestLogBuffer#g:method:push").
    --
    -- ==== Getters
    -- /None/.
    --
    -- ==== Setters
    -- /None/.

    #if defined(ENABLE_OVERLOADING)
        ResolveTestLogBufferMethod              ,
    #endif

    -- ** free #method:free#

    #if defined(ENABLE_OVERLOADING)
        TestLogBufferFreeMethodInfo             ,
    #endif
        testLogBufferFree                       ,

    -- ** push #method:push#

    #if defined(ENABLE_OVERLOADING)
        TestLogBufferPushMethodInfo             ,
    #endif
        testLogBufferPush                       ,

        ) 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

    -- | Memory-managed wrapper type.
    newtype TestLogBuffer = TestLogBuffer (SP.ManagedPtr TestLogBuffer)
        deriving (TestLogBuffer -> TestLogBuffer -> Bool
    (TestLogBuffer -> TestLogBuffer -> Bool)
    -> (TestLogBuffer -> TestLogBuffer -> Bool) -> Eq TestLogBuffer
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: TestLogBuffer -> TestLogBuffer -> Bool
    == :: TestLogBuffer -> TestLogBuffer -> Bool
    $c/= :: TestLogBuffer -> TestLogBuffer -> Bool
    /= :: TestLogBuffer -> TestLogBuffer -> Bool
    Eq)

    instance SP.ManagedPtrNewtype TestLogBuffer where
        toManagedPtr :: TestLogBuffer -> ManagedPtr TestLogBuffer
    toManagedPtr (TestLogBuffer ManagedPtr TestLogBuffer
    p) = ManagedPtr TestLogBuffer
    p

    instance BoxedPtr TestLogBuffer where
        boxedPtrCopy :: TestLogBuffer -> IO TestLogBuffer
    boxedPtrCopy = \TestLogBuffer
    p -> TestLogBuffer
    -> (Ptr TestLogBuffer -> IO TestLogBuffer) -> IO TestLogBuffer
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    B.ManagedPtr.withManagedPtr TestLogBuffer
    p (Int -> Ptr TestLogBuffer -> IO (Ptr TestLogBuffer)
    forall a. (HasCallStack, CallocPtr a) => Int -> Ptr a -> IO (Ptr a)
    copyBytes Int
    16 (Ptr TestLogBuffer -> IO (Ptr TestLogBuffer))
    -> (Ptr TestLogBuffer -> IO TestLogBuffer)
    -> Ptr TestLogBuffer
    -> IO TestLogBuffer
    forall (m :: * -> *) a b c.
    Monad m =>
    (a -> m b) -> (b -> m c) -> a -> m c
    >=> (ManagedPtr TestLogBuffer -> TestLogBuffer)
    -> Ptr TestLogBuffer -> IO TestLogBuffer
    forall a.
    (HasCallStack, BoxedPtr a) =>
    (ManagedPtr a -> a) -> Ptr a -> IO a
    B.ManagedPtr.wrapPtr ManagedPtr TestLogBuffer -> TestLogBuffer
    TestLogBuffer)
        boxedPtrFree :: TestLogBuffer -> IO ()
    boxedPtrFree = \TestLogBuffer
    x -> TestLogBuffer -> (Ptr TestLogBuffer -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    SP.withManagedPtr TestLogBuffer
    x Ptr TestLogBuffer -> IO ()
    forall a. Ptr a -> IO ()
    SP.freeMem
    instance CallocPtr TestLogBuffer where
        boxedPtrCalloc :: IO (Ptr TestLogBuffer)
    boxedPtrCalloc = Int -> IO (Ptr TestLogBuffer)
    forall a. Int -> IO (Ptr a)
    callocBytes Int
    16

    -- | Construct a `TestLogBuffer` struct initialized to zero.
    newZeroTestLogBuffer :: MonadIO m => m TestLogBuffer
    newZeroTestLogBuffer :: forall (m :: * -> *). MonadIO m => m TestLogBuffer
    newZeroTestLogBuffer = IO TestLogBuffer -> m TestLogBuffer
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO TestLogBuffer -> m TestLogBuffer)
    -> IO TestLogBuffer -> m TestLogBuffer
    forall a b. (a -> b) -> a -> b
    $ IO (Ptr TestLogBuffer)
    forall a. CallocPtr a => IO (Ptr a)
    boxedPtrCalloc IO (Ptr TestLogBuffer)
    -> (Ptr TestLogBuffer -> IO TestLogBuffer) -> IO TestLogBuffer
    forall a b. IO a -> (a -> IO b) -> IO b
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>= (ManagedPtr TestLogBuffer -> TestLogBuffer)
    -> Ptr TestLogBuffer -> IO TestLogBuffer
    forall a.
    (HasCallStack, BoxedPtr a) =>
    (ManagedPtr a -> a) -> Ptr a -> IO a
    wrapPtr ManagedPtr TestLogBuffer -> TestLogBuffer
    TestLogBuffer

    instance tag ~ 'AttrSet => Constructible TestLogBuffer tag where
        new :: forall (m :: * -> *).
    MonadIO m =>
    (ManagedPtr TestLogBuffer -> TestLogBuffer)
    -> [AttrOp TestLogBuffer tag] -> m TestLogBuffer
    new ManagedPtr TestLogBuffer -> TestLogBuffer
    _ [AttrOp TestLogBuffer tag]
    attrs = do
            TestLogBuffer
    o <- m TestLogBuffer
    forall (m :: * -> *). MonadIO m => m TestLogBuffer
    newZeroTestLogBuffer
            TestLogBuffer -> [AttrOp TestLogBuffer 'AttrSet] -> m ()
    forall o (m :: * -> *).
    MonadIO m =>
    o -> [AttrOp o 'AttrSet] -> m ()
    GI.Attributes.set TestLogBuffer
    o [AttrOp TestLogBuffer tag]
    [AttrOp TestLogBuffer 'AttrSet]
    attrs
            TestLogBuffer -> m TestLogBuffer
    forall a. a -> m a
    forall (m :: * -> *) a. Monad m => a -> m a
    return TestLogBuffer
    o

    #if defined(ENABLE_OVERLOADING)
    instance O.HasAttributeList TestLogBuffer
    type instance O.AttributeList TestLogBuffer = TestLogBufferAttributeList
    type TestLogBufferAttributeList = ('[ ] :: [(Symbol, DK.Type)])
    #endif

    -- method TestLogBuffer::free
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "tbuffer"
    --           , argType =
    --               TInterface Name { namespace = "GLib" , name = "TestLogBuffer" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Nothing
    -- throws : False
    -- Skip return : False

    foreign import ccall "g_test_log_buffer_free" g_test_log_buffer_free ::
        Ptr TestLogBuffer ->                    -- tbuffer : TInterface (Name {namespace = "GLib", name = "TestLogBuffer"})
        IO ()

    -- | Internal function for gtester to free test log messages, no ABI guarantees provided.
    testLogBufferFree ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        TestLogBuffer
        -> m ()
    testLogBufferFree :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    TestLogBuffer -> m ()
    testLogBufferFree TestLogBuffer
    tbuffer = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $ do
        Ptr TestLogBuffer
    tbuffer' <- TestLogBuffer -> IO (Ptr TestLogBuffer)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr TestLogBuffer
    tbuffer
        Ptr TestLogBuffer -> IO ()
    g_test_log_buffer_free Ptr TestLogBuffer
    tbuffer'
        TestLogBuffer -> IO ()
    forall a. ManagedPtrNewtype a => a -> IO ()
    touchManagedPtr TestLogBuffer
    tbuffer
        () -> IO ()
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()

    #if defined(ENABLE_OVERLOADING)
    data TestLogBufferFreeMethodInfo
    instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod TestLogBufferFreeMethodInfo TestLogBuffer signature where
        overloadedMethod = testLogBufferFree

    instance O.OverloadedMethodInfo TestLogBufferFreeMethodInfo TestLogBuffer where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.GLib.Structs.TestLogBuffer.testLogBufferFree",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.29/docs/GI-GLib-Structs-TestLogBuffer.html#v:testLogBufferFree"
            })

    #endif

    -- method TestLogBuffer::push
    -- method type : OrdinaryMethod
    -- Args: [ Arg
    --           { argCName = "tbuffer"
    --           , argType =
    --               TInterface Name { namespace = "GLib" , name = "TestLogBuffer" }
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "n_bytes"
    --           , argType = TBasicType TUInt
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       , Arg
    --           { argCName = "bytes"
    --           , argType = TBasicType TUInt8
    --           , direction = DirectionIn
    --           , mayBeNull = False
    --           , argDoc =
    --               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
    --           , argScope = ScopeTypeInvalid
    --           , argClosure = -1
    --           , argDestroy = -1
    --           , argCallerAllocates = False
    --           , argCallbackUserData = False
    --           , transfer = TransferNothing
    --           }
    --       ]
    -- Lengths: []
    -- returnType: Nothing
    -- throws : False
    -- Skip return : False

    foreign import ccall "g_test_log_buffer_push" g_test_log_buffer_push ::
        Ptr TestLogBuffer ->                    -- tbuffer : TInterface (Name {namespace = "GLib", name = "TestLogBuffer"})
        Word32 ->                               -- n_bytes : TBasicType TUInt
        Word8 ->                                -- bytes : TBasicType TUInt8
        IO ()

    -- | Internal function for gtester to decode test log messages, no ABI guarantees provided.
    testLogBufferPush ::
        (B.CallStack.HasCallStack, MonadIO m) =>
        TestLogBuffer
        -> Word32
        -> Word8
        -> m ()
    testLogBufferPush :: forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    TestLogBuffer -> Word32 -> Word8 -> m ()
    testLogBufferPush TestLogBuffer
    tbuffer Word32
    nBytes Word8
    bytes = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $ do
        Ptr TestLogBuffer
    tbuffer' <- TestLogBuffer -> IO (Ptr TestLogBuffer)
    forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
    unsafeManagedPtrGetPtr TestLogBuffer
    tbuffer
        Ptr TestLogBuffer -> Word32 -> Word8 -> IO ()
    g_test_log_buffer_push Ptr TestLogBuffer
    tbuffer' Word32
    nBytes Word8
    bytes
        TestLogBuffer -> IO ()
    forall a. ManagedPtrNewtype a => a -> IO ()
    touchManagedPtr TestLogBuffer
    tbuffer
        () -> IO ()
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return ()

    #if defined(ENABLE_OVERLOADING)
    data TestLogBufferPushMethodInfo
    instance (signature ~ (Word32 -> Word8 -> m ()), MonadIO m) => O.OverloadedMethod TestLogBufferPushMethodInfo TestLogBuffer signature where
        overloadedMethod = testLogBufferPush

    instance O.OverloadedMethodInfo TestLogBufferPushMethodInfo TestLogBuffer where
        overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.GLib.Structs.TestLogBuffer.testLogBufferPush",
            O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.29/docs/GI-GLib-Structs-TestLogBuffer.html#v:testLogBufferPush"
            })

    #endif

    #if defined(ENABLE_OVERLOADING)
    type family ResolveTestLogBufferMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
        ResolveTestLogBufferMethod "free" o = TestLogBufferFreeMethodInfo
        ResolveTestLogBufferMethod "push" o = TestLogBufferPushMethodInfo
        ResolveTestLogBufferMethod l o = O.MethodResolutionFailed l o

    instance (info ~ ResolveTestLogBufferMethod t TestLogBuffer, O.OverloadedMethod info TestLogBuffer p) => OL.IsLabel t (TestLogBuffer -> 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 ~ ResolveTestLogBufferMethod t TestLogBuffer, O.OverloadedMethod info TestLogBuffer p, R.HasField t TestLogBuffer p) => R.HasField t TestLogBuffer p where
        getField = O.overloadedMethod @info

    #endif

    instance (info ~ ResolveTestLogBufferMethod t TestLogBuffer, O.OverloadedMethodInfo info TestLogBuffer) => OL.IsLabel t (O.MethodProxy info TestLogBuffer) where
    #if MIN_VERSION_base(4,10,0)
        fromLabel = O.MethodProxy
    #else
        fromLabel _ = O.MethodProxy
    #endif

    #endif