{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- Structure representing a setting for an t'GI.HarfBuzz.Enums.AatLayoutFeatureTypeT'.

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.HarfBuzz.Structs.AatLayoutFeatureSelectorInfoT
    ( 

-- * Exported types
    AatLayoutFeatureSelectorInfoT(..)       ,
    newZeroAatLayoutFeatureSelectorInfoT    ,


 -- * Methods

#if defined(ENABLE_OVERLOADING)
    ResolveAatLayoutFeatureSelectorInfoTMethod,
#endif



 -- * Properties


-- ** disable #attr:disable#
-- | The value to turn the selector off

#if defined(ENABLE_OVERLOADING)
    aatLayoutFeatureSelectorInfoT_disable   ,
#endif
    getAatLayoutFeatureSelectorInfoTDisable ,
    setAatLayoutFeatureSelectorInfoTDisable ,


-- ** enable #attr:enable#
-- | The value to turn the selector on

#if defined(ENABLE_OVERLOADING)
    aatLayoutFeatureSelectorInfoT_enable    ,
#endif
    getAatLayoutFeatureSelectorInfoTEnable  ,
    setAatLayoutFeatureSelectorInfoTEnable  ,


-- ** nameId #attr:nameId#
-- | The selector\'s name identifier

#if defined(ENABLE_OVERLOADING)
    aatLayoutFeatureSelectorInfoT_nameId    ,
#endif
    getAatLayoutFeatureSelectorInfoTNameId  ,
    setAatLayoutFeatureSelectorInfoTNameId  ,




    ) 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

-- Workaround for https://gitlab.haskell.org/ghc/ghc/-/issues/23392
#if MIN_VERSION_base(4,18,0)
import {-# SOURCE #-} qualified GI.HarfBuzz.Enums as HarfBuzz.Enums

#else
import {-# SOURCE #-} qualified GI.HarfBuzz.Enums as HarfBuzz.Enums

#endif

-- | Memory-managed wrapper type.
newtype AatLayoutFeatureSelectorInfoT = AatLayoutFeatureSelectorInfoT (SP.ManagedPtr AatLayoutFeatureSelectorInfoT)
    deriving (Eq)

instance SP.ManagedPtrNewtype AatLayoutFeatureSelectorInfoT where
    toManagedPtr (AatLayoutFeatureSelectorInfoT p) = p

instance BoxedPtr AatLayoutFeatureSelectorInfoT where
    boxedPtrCopy = \p -> B.ManagedPtr.withManagedPtr p (copyBytes 16 >=> B.ManagedPtr.wrapPtr AatLayoutFeatureSelectorInfoT)
    boxedPtrFree = \x -> SP.withManagedPtr x SP.freeMem
instance CallocPtr AatLayoutFeatureSelectorInfoT where
    boxedPtrCalloc = callocBytes 16


-- | Construct a t'AatLayoutFeatureSelectorInfoT' struct initialized to zero.
newZeroAatLayoutFeatureSelectorInfoT :: MonadIO m => m AatLayoutFeatureSelectorInfoT
newZeroAatLayoutFeatureSelectorInfoT = liftIO $ boxedPtrCalloc >>= wrapPtr AatLayoutFeatureSelectorInfoT

instance tag ~ 'AttrSet => Constructible AatLayoutFeatureSelectorInfoT tag where
    new _ attrs = do
        o <- newZeroAatLayoutFeatureSelectorInfoT
        GI.Attributes.set o attrs
        return o


-- | Get the value of the “@name_id@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' aatLayoutFeatureSelectorInfoT #nameId
-- @
getAatLayoutFeatureSelectorInfoTNameId :: MonadIO m => AatLayoutFeatureSelectorInfoT -> m Word32
getAatLayoutFeatureSelectorInfoTNameId s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 0) :: IO Word32
    return val

-- | Set the value of the “@name_id@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' aatLayoutFeatureSelectorInfoT [ #nameId 'Data.GI.Base.Attributes.:=' value ]
-- @
setAatLayoutFeatureSelectorInfoTNameId :: MonadIO m => AatLayoutFeatureSelectorInfoT -> Word32 -> m ()
setAatLayoutFeatureSelectorInfoTNameId s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 0) (val :: Word32)

#if defined(ENABLE_OVERLOADING)
data AatLayoutFeatureSelectorInfoTNameIdFieldInfo
instance AttrInfo AatLayoutFeatureSelectorInfoTNameIdFieldInfo where
    type AttrBaseTypeConstraint AatLayoutFeatureSelectorInfoTNameIdFieldInfo = (~) AatLayoutFeatureSelectorInfoT
    type AttrAllowedOps AatLayoutFeatureSelectorInfoTNameIdFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint AatLayoutFeatureSelectorInfoTNameIdFieldInfo = (~) Word32
    type AttrTransferTypeConstraint AatLayoutFeatureSelectorInfoTNameIdFieldInfo = (~)Word32
    type AttrTransferType AatLayoutFeatureSelectorInfoTNameIdFieldInfo = Word32
    type AttrGetType AatLayoutFeatureSelectorInfoTNameIdFieldInfo = Word32
    type AttrLabel AatLayoutFeatureSelectorInfoTNameIdFieldInfo = "name_id"
    type AttrOrigin AatLayoutFeatureSelectorInfoTNameIdFieldInfo = AatLayoutFeatureSelectorInfoT
    attrGet = getAatLayoutFeatureSelectorInfoTNameId
    attrSet = setAatLayoutFeatureSelectorInfoTNameId
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer _ v = do
        return v
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.HarfBuzz.Structs.AatLayoutFeatureSelectorInfoT.nameId"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-harfbuzz-0.0.10/docs/GI-HarfBuzz-Structs-AatLayoutFeatureSelectorInfoT.html#g:attr:nameId"
        })

aatLayoutFeatureSelectorInfoT_nameId :: AttrLabelProxy "nameId"
aatLayoutFeatureSelectorInfoT_nameId = AttrLabelProxy

#endif


-- | Get the value of the “@enable@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' aatLayoutFeatureSelectorInfoT #enable
-- @
getAatLayoutFeatureSelectorInfoTEnable :: MonadIO m => AatLayoutFeatureSelectorInfoT -> m HarfBuzz.Enums.AatLayoutFeatureSelectorT
getAatLayoutFeatureSelectorInfoTEnable s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 4) :: IO CUInt
    let val' = (toEnum . fromIntegral) val
    return val'

-- | Set the value of the “@enable@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' aatLayoutFeatureSelectorInfoT [ #enable 'Data.GI.Base.Attributes.:=' value ]
-- @
setAatLayoutFeatureSelectorInfoTEnable :: MonadIO m => AatLayoutFeatureSelectorInfoT -> HarfBuzz.Enums.AatLayoutFeatureSelectorT -> m ()
setAatLayoutFeatureSelectorInfoTEnable s val = liftIO $ withManagedPtr s $ \ptr -> do
    let val' = (fromIntegral . fromEnum) val
    poke (ptr `plusPtr` 4) (val' :: CUInt)

#if defined(ENABLE_OVERLOADING)
data AatLayoutFeatureSelectorInfoTEnableFieldInfo
instance AttrInfo AatLayoutFeatureSelectorInfoTEnableFieldInfo where
    type AttrBaseTypeConstraint AatLayoutFeatureSelectorInfoTEnableFieldInfo = (~) AatLayoutFeatureSelectorInfoT
    type AttrAllowedOps AatLayoutFeatureSelectorInfoTEnableFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint AatLayoutFeatureSelectorInfoTEnableFieldInfo = (~) HarfBuzz.Enums.AatLayoutFeatureSelectorT
    type AttrTransferTypeConstraint AatLayoutFeatureSelectorInfoTEnableFieldInfo = (~)HarfBuzz.Enums.AatLayoutFeatureSelectorT
    type AttrTransferType AatLayoutFeatureSelectorInfoTEnableFieldInfo = HarfBuzz.Enums.AatLayoutFeatureSelectorT
    type AttrGetType AatLayoutFeatureSelectorInfoTEnableFieldInfo = HarfBuzz.Enums.AatLayoutFeatureSelectorT
    type AttrLabel AatLayoutFeatureSelectorInfoTEnableFieldInfo = "enable"
    type AttrOrigin AatLayoutFeatureSelectorInfoTEnableFieldInfo = AatLayoutFeatureSelectorInfoT
    attrGet = getAatLayoutFeatureSelectorInfoTEnable
    attrSet = setAatLayoutFeatureSelectorInfoTEnable
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer _ v = do
        return v
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.HarfBuzz.Structs.AatLayoutFeatureSelectorInfoT.enable"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-harfbuzz-0.0.10/docs/GI-HarfBuzz-Structs-AatLayoutFeatureSelectorInfoT.html#g:attr:enable"
        })

aatLayoutFeatureSelectorInfoT_enable :: AttrLabelProxy "enable"
aatLayoutFeatureSelectorInfoT_enable = AttrLabelProxy

#endif


-- | Get the value of the “@disable@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' aatLayoutFeatureSelectorInfoT #disable
-- @
getAatLayoutFeatureSelectorInfoTDisable :: MonadIO m => AatLayoutFeatureSelectorInfoT -> m HarfBuzz.Enums.AatLayoutFeatureSelectorT
getAatLayoutFeatureSelectorInfoTDisable s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 8) :: IO CUInt
    let val' = (toEnum . fromIntegral) val
    return val'

-- | Set the value of the “@disable@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' aatLayoutFeatureSelectorInfoT [ #disable 'Data.GI.Base.Attributes.:=' value ]
-- @
setAatLayoutFeatureSelectorInfoTDisable :: MonadIO m => AatLayoutFeatureSelectorInfoT -> HarfBuzz.Enums.AatLayoutFeatureSelectorT -> m ()
setAatLayoutFeatureSelectorInfoTDisable s val = liftIO $ withManagedPtr s $ \ptr -> do
    let val' = (fromIntegral . fromEnum) val
    poke (ptr `plusPtr` 8) (val' :: CUInt)

#if defined(ENABLE_OVERLOADING)
data AatLayoutFeatureSelectorInfoTDisableFieldInfo
instance AttrInfo AatLayoutFeatureSelectorInfoTDisableFieldInfo where
    type AttrBaseTypeConstraint AatLayoutFeatureSelectorInfoTDisableFieldInfo = (~) AatLayoutFeatureSelectorInfoT
    type AttrAllowedOps AatLayoutFeatureSelectorInfoTDisableFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint AatLayoutFeatureSelectorInfoTDisableFieldInfo = (~) HarfBuzz.Enums.AatLayoutFeatureSelectorT
    type AttrTransferTypeConstraint AatLayoutFeatureSelectorInfoTDisableFieldInfo = (~)HarfBuzz.Enums.AatLayoutFeatureSelectorT
    type AttrTransferType AatLayoutFeatureSelectorInfoTDisableFieldInfo = HarfBuzz.Enums.AatLayoutFeatureSelectorT
    type AttrGetType AatLayoutFeatureSelectorInfoTDisableFieldInfo = HarfBuzz.Enums.AatLayoutFeatureSelectorT
    type AttrLabel AatLayoutFeatureSelectorInfoTDisableFieldInfo = "disable"
    type AttrOrigin AatLayoutFeatureSelectorInfoTDisableFieldInfo = AatLayoutFeatureSelectorInfoT
    attrGet = getAatLayoutFeatureSelectorInfoTDisable
    attrSet = setAatLayoutFeatureSelectorInfoTDisable
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer _ v = do
        return v
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.HarfBuzz.Structs.AatLayoutFeatureSelectorInfoT.disable"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-harfbuzz-0.0.10/docs/GI-HarfBuzz-Structs-AatLayoutFeatureSelectorInfoT.html#g:attr:disable"
        })

aatLayoutFeatureSelectorInfoT_disable :: AttrLabelProxy "disable"
aatLayoutFeatureSelectorInfoT_disable = AttrLabelProxy

#endif



#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList AatLayoutFeatureSelectorInfoT
type instance O.AttributeList AatLayoutFeatureSelectorInfoT = AatLayoutFeatureSelectorInfoTAttributeList
type AatLayoutFeatureSelectorInfoTAttributeList = ('[ '("nameId", AatLayoutFeatureSelectorInfoTNameIdFieldInfo), '("enable", AatLayoutFeatureSelectorInfoTEnableFieldInfo), '("disable", AatLayoutFeatureSelectorInfoTDisableFieldInfo)] :: [(Symbol, DK.Type)])
#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveAatLayoutFeatureSelectorInfoTMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolveAatLayoutFeatureSelectorInfoTMethod l o = O.MethodResolutionFailed l o

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

#endif

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

#endif


