    {-# 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./
    --
    -- /Since: 1.4.2/

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

    module GI.HarfBuzz.Structs.VariationT
        (

    -- * Exported types
        VariationT(..)                          ,
        newZeroVariationT                       ,

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

    #if defined(ENABLE_OVERLOADING)
        ResolveVariationTMethod                 ,
    #endif

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

        getVariationTTag                        ,
        setVariationTTag                        ,
    #if defined(ENABLE_OVERLOADING)
        variationT_tag                          ,
    #endif

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

        getVariationTValue                      ,
        setVariationTValue                      ,
    #if defined(ENABLE_OVERLOADING)
        variationT_value                        ,
    #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 VariationT = VariationT (SP.ManagedPtr VariationT)
        deriving (VariationT -> VariationT -> Bool
    (VariationT -> VariationT -> Bool)
    -> (VariationT -> VariationT -> Bool) -> Eq VariationT
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    /= :: VariationT -> VariationT -> Bool
    $c/= :: VariationT -> VariationT -> Bool
    == :: VariationT -> VariationT -> Bool
    $c== :: VariationT -> VariationT -> Bool
    Eq)

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

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

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

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

    -- | Get the value of the “@tag@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.get' variationT #tag
    -- @
    getVariationTTag :: MonadIO m => VariationT -> m Word32
    getVariationTTag :: VariationT -> m Word32
    getVariationTTag s :: VariationT
    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
    $ VariationT -> (Ptr VariationT -> IO Word32) -> IO Word32
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr VariationT
    s ((Ptr VariationT -> IO Word32) -> IO Word32)
    -> (Ptr VariationT -> IO Word32) -> IO Word32
    forall a b. (a -> b) -> a -> b
    $ \ptr :: Ptr VariationT
    ptr -> do
        Word32
    val <- Ptr Word32 -> IO Word32
    forall a. Storable a => Ptr a -> IO a
    peek (Ptr VariationT
    ptr Ptr VariationT -> 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 “@tag@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.set' variationT [ #tag 'Data.GI.Base.Attributes.:=' value ]
    -- @
    setVariationTTag :: MonadIO m => VariationT -> Word32 -> m ()
    setVariationTTag :: VariationT -> Word32 -> m ()
    setVariationTTag s :: VariationT
    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
    $ VariationT -> (Ptr VariationT -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr VariationT
    s ((Ptr VariationT -> IO ()) -> IO ())
    -> (Ptr VariationT -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \ptr :: Ptr VariationT
    ptr -> do
        Ptr Word32 -> Word32 -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke (Ptr VariationT
    ptr Ptr VariationT -> Int -> Ptr Word32
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` 0) (Word32
    val :: Word32)

    #if defined(ENABLE_OVERLOADING)
    data VariationTTagFieldInfo
    instance AttrInfo VariationTTagFieldInfo where
        type AttrBaseTypeConstraint VariationTTagFieldInfo = (~) VariationT
        type AttrAllowedOps VariationTTagFieldInfo = '[ 'AttrSet, 'AttrGet]
        type AttrSetTypeConstraint VariationTTagFieldInfo = (~) Word32
        type AttrTransferTypeConstraint VariationTTagFieldInfo = (~)Word32
        type AttrTransferType VariationTTagFieldInfo = Word32
        type AttrGetType VariationTTagFieldInfo = Word32
        type AttrLabel VariationTTagFieldInfo = "tag"
        type AttrOrigin VariationTTagFieldInfo = VariationT
        attrGet = getVariationTTag
        attrSet = setVariationTTag
        attrConstruct = undefined
        attrClear = undefined
        attrTransfer _ v = do
            return v

    variationT_tag :: AttrLabelProxy "tag"
    variationT_tag = AttrLabelProxy

    #endif

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

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

    #if defined(ENABLE_OVERLOADING)
    data VariationTValueFieldInfo
    instance AttrInfo VariationTValueFieldInfo where
        type AttrBaseTypeConstraint VariationTValueFieldInfo = (~) VariationT
        type AttrAllowedOps VariationTValueFieldInfo = '[ 'AttrSet, 'AttrGet]
        type AttrSetTypeConstraint VariationTValueFieldInfo = (~) Float
        type AttrTransferTypeConstraint VariationTValueFieldInfo = (~)Float
        type AttrTransferType VariationTValueFieldInfo = Float
        type AttrGetType VariationTValueFieldInfo = Float
        type AttrLabel VariationTValueFieldInfo = "value"
        type AttrOrigin VariationTValueFieldInfo = VariationT
        attrGet = getVariationTValue
        attrSet = setVariationTValue
        attrConstruct = undefined
        attrClear = undefined
        attrTransfer _ v = do
            return v

    variationT_value :: AttrLabelProxy "value"
    variationT_value = AttrLabelProxy

    #endif

    #if defined(ENABLE_OVERLOADING)
    instance O.HasAttributeList VariationT
    type instance O.AttributeList VariationT = VariationTAttributeList
    type VariationTAttributeList = ('[ '("tag", VariationTTagFieldInfo), '("value", VariationTValueFieldInfo)] :: [(Symbol, *)])
    #endif

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

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

    #endif