    {-# LANGUAGE TypeApplications #-}

    -- | Copyright  : Will Thompson and Iñaki García Etxebarria
    -- License    : LGPL-2.1
    -- Maintainer : Iñaki García Etxebarria
    --
    -- The @PangoAttrClass@ structure stores the type and operations for
    -- a particular type of attribute.
    --
    -- The functions in this structure should not be called directly. Instead,
    -- one should use the wrapper functions provided for @PangoAttribute@.

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

    module GI.Pango.Structs.AttrClass
        (

    -- * Exported types
        AttrClass(..)                           ,
        newZeroAttrClass                        ,

     -- * Methods

    #if defined(ENABLE_OVERLOADING)
        ResolveAttrClassMethod                  ,
    #endif

     -- * Properties

    -- ** copy #attr:copy#
    -- | function to duplicate an attribute of this type
    --   (see 'GI.Pango.Structs.Attribute.attributeCopy')

    #if defined(ENABLE_OVERLOADING)
        attrClass_copy                          ,
    #endif
        clearAttrClassCopy                      ,
        getAttrClassCopy                        ,
        setAttrClassCopy                        ,

    -- ** destroy #attr:destroy#
    -- | function to free an attribute of this type
    --   (see 'GI.Pango.Structs.Attribute.attributeDestroy')

    #if defined(ENABLE_OVERLOADING)
        attrClass_destroy                       ,
    #endif
        clearAttrClassDestroy                   ,
        getAttrClassDestroy                     ,
        setAttrClassDestroy                     ,

    -- ** equal #attr:equal#
    -- | function to check two attributes of this type for equality
    --   (see 'GI.Pango.Structs.Attribute.attributeEqual')

    #if defined(ENABLE_OVERLOADING)
        attrClass_equal                         ,
    #endif
        clearAttrClassEqual                     ,
        getAttrClassEqual                       ,
        setAttrClassEqual                       ,

    -- ** type #attr:type#
    -- | the type ID for this attribute

    #if defined(ENABLE_OVERLOADING)
        attrClass_type                          ,
    #endif
        getAttrClassType                        ,
        setAttrClassType                        ,

        ) 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 qualified GI.Pango.Callbacks as Pango.Callbacks
    import {-# SOURCE #-} qualified GI.Pango.Enums as Pango.Enums

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

    #endif

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

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

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

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

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

    -- | Get the value of the “@type@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.get' attrClass #type
    -- @
    getAttrClassType :: MonadIO m => AttrClass -> m Pango.Enums.AttrType
    getAttrClassType :: forall (m :: * -> *). MonadIO m => AttrClass -> m AttrType
    getAttrClassType AttrClass
    s = IO AttrType -> m AttrType
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO AttrType -> m AttrType) -> IO AttrType -> m AttrType
    forall a b. (a -> b) -> a -> b
    $ AttrClass -> (Ptr AttrClass -> IO AttrType) -> IO AttrType
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr AttrClass
    s ((Ptr AttrClass -> IO AttrType) -> IO AttrType)
    -> (Ptr AttrClass -> IO AttrType) -> IO AttrType
    forall a b. (a -> b) -> a -> b
    $ \Ptr AttrClass
    ptr -> do
        val <- Ptr CUInt -> IO CUInt
    forall a. Storable a => Ptr a -> IO a
    peek (Ptr AttrClass
    ptr Ptr AttrClass -> Int -> Ptr CUInt
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    0) :: IO CUInt
        let val' = (Int -> AttrType
    forall a. Enum a => Int -> a
    toEnum (Int -> AttrType) -> (CUInt -> Int) -> CUInt -> AttrType
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . CUInt -> Int
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral) CUInt
    val
        return val'

    -- | Set the value of the “@type@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.set' attrClass [ #type 'Data.GI.Base.Attributes.:=' value ]
    -- @
    setAttrClassType :: MonadIO m => AttrClass -> Pango.Enums.AttrType -> m ()
    setAttrClassType :: forall (m :: * -> *). MonadIO m => AttrClass -> AttrType -> m ()
    setAttrClassType AttrClass
    s AttrType
    val = 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
    $ AttrClass -> (Ptr AttrClass -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr AttrClass
    s ((Ptr AttrClass -> IO ()) -> IO ())
    -> (Ptr AttrClass -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr AttrClass
    ptr -> do
        let val' :: CUInt
    val' = (Int -> CUInt
    forall a b. (Integral a, Num b) => a -> b
    fromIntegral (Int -> CUInt) -> (AttrType -> Int) -> AttrType -> CUInt
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . AttrType -> Int
    forall a. Enum a => a -> Int
    fromEnum) AttrType
    val
        Ptr CUInt -> CUInt -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke (Ptr AttrClass
    ptr Ptr AttrClass -> Int -> Ptr CUInt
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    0) (CUInt
    val' :: CUInt)

    #if defined(ENABLE_OVERLOADING)
    data AttrClassTypeFieldInfo
    instance AttrInfo AttrClassTypeFieldInfo where
        type AttrBaseTypeConstraint AttrClassTypeFieldInfo = (~) AttrClass
        type AttrAllowedOps AttrClassTypeFieldInfo = '[ 'AttrSet, 'AttrGet]
        type AttrSetTypeConstraint AttrClassTypeFieldInfo = (~) Pango.Enums.AttrType
        type AttrTransferTypeConstraint AttrClassTypeFieldInfo = (~)Pango.Enums.AttrType
        type AttrTransferType AttrClassTypeFieldInfo = Pango.Enums.AttrType
        type AttrGetType AttrClassTypeFieldInfo = Pango.Enums.AttrType
        type AttrLabel AttrClassTypeFieldInfo = "type"
        type AttrOrigin AttrClassTypeFieldInfo = AttrClass
        attrGet = getAttrClassType
        attrSet = setAttrClassType
        attrConstruct = undefined
        attrClear = undefined
        attrTransfer _ v = do
            return v
        dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Pango.Structs.AttrClass.type"
            , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Structs-AttrClass.html#g:attr:type"
            })

    attrClass_type :: AttrLabelProxy "type"
    attrClass_type = AttrLabelProxy

    #endif

    -- | Get the value of the “@copy@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.get' attrClass #copy
    -- @
    getAttrClassCopy :: MonadIO m => AttrClass -> m (Maybe Pango.Callbacks.AttrClassCopyFieldCallback)
    getAttrClassCopy :: forall (m :: * -> *).
    MonadIO m =>
    AttrClass -> m (Maybe AttrClassCopyFieldCallback)
    getAttrClassCopy AttrClass
    s = IO (Maybe AttrClassCopyFieldCallback)
    -> m (Maybe AttrClassCopyFieldCallback)
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO (Maybe AttrClassCopyFieldCallback)
     -> m (Maybe AttrClassCopyFieldCallback))
    -> IO (Maybe AttrClassCopyFieldCallback)
    -> m (Maybe AttrClassCopyFieldCallback)
    forall a b. (a -> b) -> a -> b
    $ AttrClass
    -> (Ptr AttrClass -> IO (Maybe AttrClassCopyFieldCallback))
    -> IO (Maybe AttrClassCopyFieldCallback)
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr AttrClass
    s ((Ptr AttrClass -> IO (Maybe AttrClassCopyFieldCallback))
     -> IO (Maybe AttrClassCopyFieldCallback))
    -> (Ptr AttrClass -> IO (Maybe AttrClassCopyFieldCallback))
    -> IO (Maybe AttrClassCopyFieldCallback)
    forall a b. (a -> b) -> a -> b
    $ \Ptr AttrClass
    ptr -> do
        val <- Ptr (FunPtr C_AttrClassCopyFieldCallback)
    -> IO (FunPtr C_AttrClassCopyFieldCallback)
    forall a. Storable a => Ptr a -> IO a
    peek (Ptr AttrClass
    ptr Ptr AttrClass -> Int -> Ptr (FunPtr C_AttrClassCopyFieldCallback)
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    8) :: IO (FunPtr Pango.Callbacks.C_AttrClassCopyFieldCallback)
        result <- SP.convertFunPtrIfNonNull val $ \FunPtr C_AttrClassCopyFieldCallback
    val' -> do
            let val'' :: AttrClassCopyFieldCallback
    val'' = FunPtr C_AttrClassCopyFieldCallback -> AttrClassCopyFieldCallback
    forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    FunPtr C_AttrClassCopyFieldCallback -> Attribute -> m Attribute
    Pango.Callbacks.dynamic_AttrClassCopyFieldCallback FunPtr C_AttrClassCopyFieldCallback
    val'
            AttrClassCopyFieldCallback -> IO AttrClassCopyFieldCallback
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return AttrClassCopyFieldCallback
    val''
        return result

    -- | Set the value of the “@copy@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.set' attrClass [ #copy 'Data.GI.Base.Attributes.:=' value ]
    -- @
    setAttrClassCopy :: MonadIO m => AttrClass -> FunPtr Pango.Callbacks.C_AttrClassCopyFieldCallback -> m ()
    setAttrClassCopy :: forall (m :: * -> *).
    MonadIO m =>
    AttrClass -> FunPtr C_AttrClassCopyFieldCallback -> m ()
    setAttrClassCopy AttrClass
    s FunPtr C_AttrClassCopyFieldCallback
    val = 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
    $ AttrClass -> (Ptr AttrClass -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr AttrClass
    s ((Ptr AttrClass -> IO ()) -> IO ())
    -> (Ptr AttrClass -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr AttrClass
    ptr -> do
        Ptr (FunPtr C_AttrClassCopyFieldCallback)
    -> FunPtr C_AttrClassCopyFieldCallback -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke (Ptr AttrClass
    ptr Ptr AttrClass -> Int -> Ptr (FunPtr C_AttrClassCopyFieldCallback)
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    8) (FunPtr C_AttrClassCopyFieldCallback
    val :: FunPtr Pango.Callbacks.C_AttrClassCopyFieldCallback)

    -- | Set the value of the “@copy@” field to `Nothing`.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.clear' #copy
    -- @
    clearAttrClassCopy :: MonadIO m => AttrClass -> m ()
    clearAttrClassCopy :: forall (m :: * -> *). MonadIO m => AttrClass -> m ()
    clearAttrClassCopy AttrClass
    s = 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
    $ AttrClass -> (Ptr AttrClass -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr AttrClass
    s ((Ptr AttrClass -> IO ()) -> IO ())
    -> (Ptr AttrClass -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr AttrClass
    ptr -> do
        Ptr (FunPtr C_AttrClassCopyFieldCallback)
    -> FunPtr C_AttrClassCopyFieldCallback -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke (Ptr AttrClass
    ptr Ptr AttrClass -> Int -> Ptr (FunPtr C_AttrClassCopyFieldCallback)
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    8) (FunPtr C_AttrClassCopyFieldCallback
    forall a. FunPtr a
    FP.nullFunPtr :: FunPtr Pango.Callbacks.C_AttrClassCopyFieldCallback)

    #if defined(ENABLE_OVERLOADING)
    data AttrClassCopyFieldInfo
    instance AttrInfo AttrClassCopyFieldInfo where
        type AttrBaseTypeConstraint AttrClassCopyFieldInfo = (~) AttrClass
        type AttrAllowedOps AttrClassCopyFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
        type AttrSetTypeConstraint AttrClassCopyFieldInfo = (~) (FunPtr Pango.Callbacks.C_AttrClassCopyFieldCallback)
        type AttrTransferTypeConstraint AttrClassCopyFieldInfo = (~)Pango.Callbacks.AttrClassCopyFieldCallback
        type AttrTransferType AttrClassCopyFieldInfo = (FunPtr Pango.Callbacks.C_AttrClassCopyFieldCallback)
        type AttrGetType AttrClassCopyFieldInfo = Maybe Pango.Callbacks.AttrClassCopyFieldCallback
        type AttrLabel AttrClassCopyFieldInfo = "copy"
        type AttrOrigin AttrClassCopyFieldInfo = AttrClass
        attrGet = getAttrClassCopy
        attrSet = setAttrClassCopy
        attrConstruct = undefined
        attrClear = clearAttrClassCopy
        attrTransfer _ v = do
            Pango.Callbacks.mk_AttrClassCopyFieldCallback (Pango.Callbacks.wrap_AttrClassCopyFieldCallback Nothing v)
        dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Pango.Structs.AttrClass.copy"
            , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Structs-AttrClass.html#g:attr:copy"
            })

    attrClass_copy :: AttrLabelProxy "copy"
    attrClass_copy = AttrLabelProxy

    #endif

    -- | Get the value of the “@destroy@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.get' attrClass #destroy
    -- @
    getAttrClassDestroy :: MonadIO m => AttrClass -> m (Maybe Pango.Callbacks.AttrClassDestroyFieldCallback)
    getAttrClassDestroy :: forall (m :: * -> *).
    MonadIO m =>
    AttrClass -> m (Maybe AttrClassDestroyFieldCallback)
    getAttrClassDestroy AttrClass
    s = IO (Maybe AttrClassDestroyFieldCallback)
    -> m (Maybe AttrClassDestroyFieldCallback)
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO (Maybe AttrClassDestroyFieldCallback)
     -> m (Maybe AttrClassDestroyFieldCallback))
    -> IO (Maybe AttrClassDestroyFieldCallback)
    -> m (Maybe AttrClassDestroyFieldCallback)
    forall a b. (a -> b) -> a -> b
    $ AttrClass
    -> (Ptr AttrClass -> IO (Maybe AttrClassDestroyFieldCallback))
    -> IO (Maybe AttrClassDestroyFieldCallback)
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr AttrClass
    s ((Ptr AttrClass -> IO (Maybe AttrClassDestroyFieldCallback))
     -> IO (Maybe AttrClassDestroyFieldCallback))
    -> (Ptr AttrClass -> IO (Maybe AttrClassDestroyFieldCallback))
    -> IO (Maybe AttrClassDestroyFieldCallback)
    forall a b. (a -> b) -> a -> b
    $ \Ptr AttrClass
    ptr -> do
        val <- Ptr (FunPtr C_AttrClassDestroyFieldCallback)
    -> IO (FunPtr C_AttrClassDestroyFieldCallback)
    forall a. Storable a => Ptr a -> IO a
    peek (Ptr AttrClass
    ptr Ptr AttrClass
    -> Int -> Ptr (FunPtr C_AttrClassDestroyFieldCallback)
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    16) :: IO (FunPtr Pango.Callbacks.C_AttrClassDestroyFieldCallback)
        result <- SP.convertFunPtrIfNonNull val $ \FunPtr C_AttrClassDestroyFieldCallback
    val' -> do
            let val'' :: AttrClassDestroyFieldCallback
    val'' = FunPtr C_AttrClassDestroyFieldCallback
    -> AttrClassDestroyFieldCallback
    forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    FunPtr C_AttrClassDestroyFieldCallback -> Attribute -> m ()
    Pango.Callbacks.dynamic_AttrClassDestroyFieldCallback FunPtr C_AttrClassDestroyFieldCallback
    val'
            AttrClassDestroyFieldCallback -> IO AttrClassDestroyFieldCallback
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return AttrClassDestroyFieldCallback
    val''
        return result

    -- | Set the value of the “@destroy@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.set' attrClass [ #destroy 'Data.GI.Base.Attributes.:=' value ]
    -- @
    setAttrClassDestroy :: MonadIO m => AttrClass -> FunPtr Pango.Callbacks.C_AttrClassDestroyFieldCallback -> m ()
    setAttrClassDestroy :: forall (m :: * -> *).
    MonadIO m =>
    AttrClass -> FunPtr C_AttrClassDestroyFieldCallback -> m ()
    setAttrClassDestroy AttrClass
    s FunPtr C_AttrClassDestroyFieldCallback
    val = 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
    $ AttrClass -> (Ptr AttrClass -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr AttrClass
    s ((Ptr AttrClass -> IO ()) -> IO ())
    -> (Ptr AttrClass -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr AttrClass
    ptr -> do
        Ptr (FunPtr C_AttrClassDestroyFieldCallback)
    -> FunPtr C_AttrClassDestroyFieldCallback -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke (Ptr AttrClass
    ptr Ptr AttrClass
    -> Int -> Ptr (FunPtr C_AttrClassDestroyFieldCallback)
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    16) (FunPtr C_AttrClassDestroyFieldCallback
    val :: FunPtr Pango.Callbacks.C_AttrClassDestroyFieldCallback)

    -- | Set the value of the “@destroy@” field to `Nothing`.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.clear' #destroy
    -- @
    clearAttrClassDestroy :: MonadIO m => AttrClass -> m ()
    clearAttrClassDestroy :: forall (m :: * -> *). MonadIO m => AttrClass -> m ()
    clearAttrClassDestroy AttrClass
    s = 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
    $ AttrClass -> (Ptr AttrClass -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr AttrClass
    s ((Ptr AttrClass -> IO ()) -> IO ())
    -> (Ptr AttrClass -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr AttrClass
    ptr -> do
        Ptr (FunPtr C_AttrClassDestroyFieldCallback)
    -> FunPtr C_AttrClassDestroyFieldCallback -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke (Ptr AttrClass
    ptr Ptr AttrClass
    -> Int -> Ptr (FunPtr C_AttrClassDestroyFieldCallback)
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    16) (FunPtr C_AttrClassDestroyFieldCallback
    forall a. FunPtr a
    FP.nullFunPtr :: FunPtr Pango.Callbacks.C_AttrClassDestroyFieldCallback)

    #if defined(ENABLE_OVERLOADING)
    data AttrClassDestroyFieldInfo
    instance AttrInfo AttrClassDestroyFieldInfo where
        type AttrBaseTypeConstraint AttrClassDestroyFieldInfo = (~) AttrClass
        type AttrAllowedOps AttrClassDestroyFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
        type AttrSetTypeConstraint AttrClassDestroyFieldInfo = (~) (FunPtr Pango.Callbacks.C_AttrClassDestroyFieldCallback)
        type AttrTransferTypeConstraint AttrClassDestroyFieldInfo = (~)Pango.Callbacks.AttrClassDestroyFieldCallback
        type AttrTransferType AttrClassDestroyFieldInfo = (FunPtr Pango.Callbacks.C_AttrClassDestroyFieldCallback)
        type AttrGetType AttrClassDestroyFieldInfo = Maybe Pango.Callbacks.AttrClassDestroyFieldCallback
        type AttrLabel AttrClassDestroyFieldInfo = "destroy"
        type AttrOrigin AttrClassDestroyFieldInfo = AttrClass
        attrGet = getAttrClassDestroy
        attrSet = setAttrClassDestroy
        attrConstruct = undefined
        attrClear = clearAttrClassDestroy
        attrTransfer _ v = do
            Pango.Callbacks.mk_AttrClassDestroyFieldCallback (Pango.Callbacks.wrap_AttrClassDestroyFieldCallback Nothing v)
        dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Pango.Structs.AttrClass.destroy"
            , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Structs-AttrClass.html#g:attr:destroy"
            })

    attrClass_destroy :: AttrLabelProxy "destroy"
    attrClass_destroy = AttrLabelProxy

    #endif

    -- | Get the value of the “@equal@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.get' attrClass #equal
    -- @
    getAttrClassEqual :: MonadIO m => AttrClass -> m (Maybe Pango.Callbacks.AttrClassEqualFieldCallback)
    getAttrClassEqual :: forall (m :: * -> *).
    MonadIO m =>
    AttrClass -> m (Maybe AttrClassEqualFieldCallback)
    getAttrClassEqual AttrClass
    s = IO (Maybe AttrClassEqualFieldCallback)
    -> m (Maybe AttrClassEqualFieldCallback)
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO (Maybe AttrClassEqualFieldCallback)
     -> m (Maybe AttrClassEqualFieldCallback))
    -> IO (Maybe AttrClassEqualFieldCallback)
    -> m (Maybe AttrClassEqualFieldCallback)
    forall a b. (a -> b) -> a -> b
    $ AttrClass
    -> (Ptr AttrClass -> IO (Maybe AttrClassEqualFieldCallback))
    -> IO (Maybe AttrClassEqualFieldCallback)
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr AttrClass
    s ((Ptr AttrClass -> IO (Maybe AttrClassEqualFieldCallback))
     -> IO (Maybe AttrClassEqualFieldCallback))
    -> (Ptr AttrClass -> IO (Maybe AttrClassEqualFieldCallback))
    -> IO (Maybe AttrClassEqualFieldCallback)
    forall a b. (a -> b) -> a -> b
    $ \Ptr AttrClass
    ptr -> do
        val <- Ptr (FunPtr C_AttrClassEqualFieldCallback)
    -> IO (FunPtr C_AttrClassEqualFieldCallback)
    forall a. Storable a => Ptr a -> IO a
    peek (Ptr AttrClass
    ptr Ptr AttrClass -> Int -> Ptr (FunPtr C_AttrClassEqualFieldCallback)
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    24) :: IO (FunPtr Pango.Callbacks.C_AttrClassEqualFieldCallback)
        result <- SP.convertFunPtrIfNonNull val $ \FunPtr C_AttrClassEqualFieldCallback
    val' -> do
            let val'' :: AttrClassEqualFieldCallback
    val'' = FunPtr C_AttrClassEqualFieldCallback -> AttrClassEqualFieldCallback
    forall (m :: * -> *).
    (HasCallStack, MonadIO m) =>
    FunPtr C_AttrClassEqualFieldCallback
    -> Attribute -> Attribute -> m Bool
    Pango.Callbacks.dynamic_AttrClassEqualFieldCallback FunPtr C_AttrClassEqualFieldCallback
    val'
            AttrClassEqualFieldCallback -> IO AttrClassEqualFieldCallback
    forall a. a -> IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return AttrClassEqualFieldCallback
    val''
        return result

    -- | Set the value of the “@equal@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.set' attrClass [ #equal 'Data.GI.Base.Attributes.:=' value ]
    -- @
    setAttrClassEqual :: MonadIO m => AttrClass -> FunPtr Pango.Callbacks.C_AttrClassEqualFieldCallback -> m ()
    setAttrClassEqual :: forall (m :: * -> *).
    MonadIO m =>
    AttrClass -> FunPtr C_AttrClassEqualFieldCallback -> m ()
    setAttrClassEqual AttrClass
    s FunPtr C_AttrClassEqualFieldCallback
    val = 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
    $ AttrClass -> (Ptr AttrClass -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr AttrClass
    s ((Ptr AttrClass -> IO ()) -> IO ())
    -> (Ptr AttrClass -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr AttrClass
    ptr -> do
        Ptr (FunPtr C_AttrClassEqualFieldCallback)
    -> FunPtr C_AttrClassEqualFieldCallback -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke (Ptr AttrClass
    ptr Ptr AttrClass -> Int -> Ptr (FunPtr C_AttrClassEqualFieldCallback)
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    24) (FunPtr C_AttrClassEqualFieldCallback
    val :: FunPtr Pango.Callbacks.C_AttrClassEqualFieldCallback)

    -- | Set the value of the “@equal@” field to `Nothing`.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.clear' #equal
    -- @
    clearAttrClassEqual :: MonadIO m => AttrClass -> m ()
    clearAttrClassEqual :: forall (m :: * -> *). MonadIO m => AttrClass -> m ()
    clearAttrClassEqual AttrClass
    s = 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
    $ AttrClass -> (Ptr AttrClass -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr AttrClass
    s ((Ptr AttrClass -> IO ()) -> IO ())
    -> (Ptr AttrClass -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr AttrClass
    ptr -> do
        Ptr (FunPtr C_AttrClassEqualFieldCallback)
    -> FunPtr C_AttrClassEqualFieldCallback -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke (Ptr AttrClass
    ptr Ptr AttrClass -> Int -> Ptr (FunPtr C_AttrClassEqualFieldCallback)
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    24) (FunPtr C_AttrClassEqualFieldCallback
    forall a. FunPtr a
    FP.nullFunPtr :: FunPtr Pango.Callbacks.C_AttrClassEqualFieldCallback)

    #if defined(ENABLE_OVERLOADING)
    data AttrClassEqualFieldInfo
    instance AttrInfo AttrClassEqualFieldInfo where
        type AttrBaseTypeConstraint AttrClassEqualFieldInfo = (~) AttrClass
        type AttrAllowedOps AttrClassEqualFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
        type AttrSetTypeConstraint AttrClassEqualFieldInfo = (~) (FunPtr Pango.Callbacks.C_AttrClassEqualFieldCallback)
        type AttrTransferTypeConstraint AttrClassEqualFieldInfo = (~)Pango.Callbacks.AttrClassEqualFieldCallback
        type AttrTransferType AttrClassEqualFieldInfo = (FunPtr Pango.Callbacks.C_AttrClassEqualFieldCallback)
        type AttrGetType AttrClassEqualFieldInfo = Maybe Pango.Callbacks.AttrClassEqualFieldCallback
        type AttrLabel AttrClassEqualFieldInfo = "equal"
        type AttrOrigin AttrClassEqualFieldInfo = AttrClass
        attrGet = getAttrClassEqual
        attrSet = setAttrClassEqual
        attrConstruct = undefined
        attrClear = clearAttrClassEqual
        attrTransfer _ v = do
            Pango.Callbacks.mk_AttrClassEqualFieldCallback (Pango.Callbacks.wrap_AttrClassEqualFieldCallback Nothing v)
        dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Pango.Structs.AttrClass.equal"
            , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-pango-1.0.30/docs/GI-Pango-Structs-AttrClass.html#g:attr:equal"
            })

    attrClass_equal :: AttrLabelProxy "equal"
    attrClass_equal = AttrLabelProxy

    #endif

    #if defined(ENABLE_OVERLOADING)
    instance O.HasAttributeList AttrClass
    type instance O.AttributeList AttrClass = AttrClassAttributeList
    type AttrClassAttributeList = ('[ '("type", AttrClassTypeFieldInfo), '("copy", AttrClassCopyFieldInfo), '("destroy", AttrClassDestroyFieldInfo), '("equal", AttrClassEqualFieldInfo)] :: [(Symbol, DK.Type)])
    #endif

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

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

    #endif

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

    #endif