    {-# LANGUAGE TypeApplications #-}

    -- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
    -- 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.HarfBuzz.Unions.VarIntT
        (

    -- * Exported types
        VarIntT(..)                             ,
        newZeroVarIntT                          ,

     -- * Methods
    -- ** Overloaded methods #method:Overloaded methods#

    #if defined(ENABLE_OVERLOADING)
        ResolveVarIntTMethod                    ,
    #endif

     -- * Properties
    -- ** i32 #attr:i32#
    -- | /No description available in the introspection data./

        getVarIntTI32                           ,
        setVarIntTI32                           ,
    #if defined(ENABLE_OVERLOADING)
        varIntT_i32                             ,
    #endif

    -- ** u32 #attr:u32#
    -- | /No description available in the introspection data./

        getVarIntTU32                           ,
        setVarIntTU32                           ,
    #if defined(ENABLE_OVERLOADING)
        varIntT_u32                             ,
    #endif

        ) 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.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

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

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

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

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

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

    -- | Get the value of the “@u32@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.get' varIntT #u32
    -- @
    getVarIntTU32 :: MonadIO m => VarIntT -> m Word32
    getVarIntTU32 :: VarIntT -> m Word32
    getVarIntTU32 s :: VarIntT
    s = IO Word32 -> m Word32
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
    forall a b. (a -> b) -> a -> b
    $ VarIntT -> (Ptr VarIntT -> IO Word32) -> IO Word32
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr VarIntT
    s ((Ptr VarIntT -> IO Word32) -> IO Word32)
    -> (Ptr VarIntT -> IO Word32) -> IO Word32
    forall a b. (a -> b) -> a -> b
    $ \ptr :: Ptr VarIntT
    ptr -> do
        Word32
    val <- Ptr Word32 -> IO Word32
    forall a. Storable a => Ptr a -> IO a
    peek (Ptr VarIntT
    ptr Ptr VarIntT -> Int -> Ptr Word32
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` 0) :: IO Word32
        Word32 -> IO Word32
    forall (m :: * -> *) a. Monad m => a -> m a
    return Word32
    val

    -- | Set the value of the “@u32@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.set' varIntT [ #u32 'Data.GI.Base.Attributes.:=' value ]
    -- @
    setVarIntTU32 :: MonadIO m => VarIntT -> Word32 -> m ()
    setVarIntTU32 :: VarIntT -> Word32 -> m ()
    setVarIntTU32 s :: VarIntT
    s val :: Word32
    val = IO () -> m ()
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $ VarIntT -> (Ptr VarIntT -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr VarIntT
    s ((Ptr VarIntT -> IO ()) -> IO ())
    -> (Ptr VarIntT -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \ptr :: Ptr VarIntT
    ptr -> do
        Ptr Word32 -> Word32 -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke (Ptr VarIntT
    ptr Ptr VarIntT -> Int -> Ptr Word32
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` 0) (Word32
    val :: Word32)

    #if defined(ENABLE_OVERLOADING)
    data VarIntTU32FieldInfo
    instance AttrInfo VarIntTU32FieldInfo where
        type AttrBaseTypeConstraint VarIntTU32FieldInfo = (~) VarIntT
        type AttrAllowedOps VarIntTU32FieldInfo = '[ 'AttrSet, 'AttrGet]
        type AttrSetTypeConstraint VarIntTU32FieldInfo = (~) Word32
        type AttrTransferTypeConstraint VarIntTU32FieldInfo = (~)Word32
        type AttrTransferType VarIntTU32FieldInfo = Word32
        type AttrGetType VarIntTU32FieldInfo = Word32
        type AttrLabel VarIntTU32FieldInfo = "u32"
        type AttrOrigin VarIntTU32FieldInfo = VarIntT
        attrGet = getVarIntTU32
        attrSet = setVarIntTU32
        attrConstruct = undefined
        attrClear = undefined
        attrTransfer _ v = do
            return v

    varIntT_u32 :: AttrLabelProxy "u32"
    varIntT_u32 = AttrLabelProxy

    #endif

    -- | Get the value of the “@i32@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.get' varIntT #i32
    -- @
    getVarIntTI32 :: MonadIO m => VarIntT -> m Int32
    getVarIntTI32 :: VarIntT -> m Int32
    getVarIntTI32 s :: VarIntT
    s = IO Int32 -> m Int32
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
    forall a b. (a -> b) -> a -> b
    $ VarIntT -> (Ptr VarIntT -> IO Int32) -> IO Int32
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr VarIntT
    s ((Ptr VarIntT -> IO Int32) -> IO Int32)
    -> (Ptr VarIntT -> IO Int32) -> IO Int32
    forall a b. (a -> b) -> a -> b
    $ \ptr :: Ptr VarIntT
    ptr -> do
        Int32
    val <- Ptr Int32 -> IO Int32
    forall a. Storable a => Ptr a -> IO a
    peek (Ptr VarIntT
    ptr Ptr VarIntT -> Int -> Ptr Int32
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` 0) :: IO Int32
        Int32 -> IO Int32
    forall (m :: * -> *) a. Monad m => a -> m a
    return Int32
    val

    -- | Set the value of the “@i32@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.set' varIntT [ #i32 'Data.GI.Base.Attributes.:=' value ]
    -- @
    setVarIntTI32 :: MonadIO m => VarIntT -> Int32 -> m ()
    setVarIntTI32 :: VarIntT -> Int32 -> m ()
    setVarIntTI32 s :: VarIntT
    s val :: Int32
    val = IO () -> m ()
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $ VarIntT -> (Ptr VarIntT -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr VarIntT
    s ((Ptr VarIntT -> IO ()) -> IO ())
    -> (Ptr VarIntT -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \ptr :: Ptr VarIntT
    ptr -> do
        Ptr Int32 -> Int32 -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke (Ptr VarIntT
    ptr Ptr VarIntT -> Int -> Ptr Int32
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` 0) (Int32
    val :: Int32)

    #if defined(ENABLE_OVERLOADING)
    data VarIntTI32FieldInfo
    instance AttrInfo VarIntTI32FieldInfo where
        type AttrBaseTypeConstraint VarIntTI32FieldInfo = (~) VarIntT
        type AttrAllowedOps VarIntTI32FieldInfo = '[ 'AttrSet, 'AttrGet]
        type AttrSetTypeConstraint VarIntTI32FieldInfo = (~) Int32
        type AttrTransferTypeConstraint VarIntTI32FieldInfo = (~)Int32
        type AttrTransferType VarIntTI32FieldInfo = Int32
        type AttrGetType VarIntTI32FieldInfo = Int32
        type AttrLabel VarIntTI32FieldInfo = "i32"
        type AttrOrigin VarIntTI32FieldInfo = VarIntT
        attrGet = getVarIntTI32
        attrSet = setVarIntTI32
        attrConstruct = undefined
        attrClear = undefined
        attrTransfer _ v = do
            return v

    varIntT_i32 :: AttrLabelProxy "i32"
    varIntT_i32 = AttrLabelProxy

    #endif

    -- XXX Skipped attribute for "VarIntT:u16"
    -- Not implemented: Don't know how to unpack C array of type TCArray False 2 (-1) (TBasicType TUInt16)
    -- XXX Skipped attribute for "VarIntT:i16"
    -- Not implemented: Don't know how to unpack C array of type TCArray False 2 (-1) (TBasicType TInt16)
    -- XXX Skipped attribute for "VarIntT:u8"
    -- Not implemented: Don't know how to unpack C array of type TCArray False 4 (-1) (TBasicType TUInt8)
    -- XXX Skipped attribute for "VarIntT:i8"
    -- Not implemented: Don't know how to unpack C array of type TCArray False 4 (-1) (TBasicType TInt8)

    #if defined(ENABLE_OVERLOADING)
    instance O.HasAttributeList VarIntT
    type instance O.AttributeList VarIntT = VarIntTAttributeList
    type VarIntTAttributeList = ('[ '("u32", VarIntTU32FieldInfo), '("i32", VarIntTI32FieldInfo)] :: [(Symbol, *)])
    #endif

    #if defined(ENABLE_OVERLOADING)
    type family ResolveVarIntTMethod (t :: Symbol) (o :: *) :: * where
        ResolveVarIntTMethod l o = O.MethodResolutionFailed l o

    instance (info ~ ResolveVarIntTMethod t VarIntT, O.MethodInfo info VarIntT p) => OL.IsLabel t (VarIntT -> p) where
    #if MIN_VERSION_base(4,10,0)
        fromLabel = O.overloadedMethod @info
    #else
        fromLabel _ = O.overloadedMethod @info
    #endif

    #endif