{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- The class of a flags type holds information about its
-- possible values.

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

module GI.GObject.Structs.FlagsClass
    ( 

-- * Exported types
    FlagsClass(..)                          ,
    newZeroFlagsClass                       ,


 -- * Methods

#if defined(ENABLE_OVERLOADING)
    ResolveFlagsClassMethod                 ,
#endif



 -- * Properties


-- ** gTypeClass #attr:gTypeClass#
-- | the parent class

#if defined(ENABLE_OVERLOADING)
    flagsClass_gTypeClass                   ,
#endif
    getFlagsClassGTypeClass                 ,


-- ** mask #attr:mask#
-- | a mask covering all possible values.

#if defined(ENABLE_OVERLOADING)
    flagsClass_mask                         ,
#endif
    getFlagsClassMask                       ,
    setFlagsClassMask                       ,


-- ** nValues #attr:nValues#
-- | the number of possible values.

#if defined(ENABLE_OVERLOADING)
    flagsClass_nValues                      ,
#endif
    getFlagsClassNValues                    ,
    setFlagsClassNValues                    ,


-- ** values #attr:values#
-- | an array of t'GI.GObject.Structs.FlagsValue.FlagsValue' structs describing the
--  individual values.

    clearFlagsClassValues                   ,
#if defined(ENABLE_OVERLOADING)
    flagsClass_values                       ,
#endif
    getFlagsClassValues                     ,
    setFlagsClassValues                     ,




    ) 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
import qualified GHC.Records as R

import {-# SOURCE #-} qualified GI.GObject.Structs.FlagsValue as GObject.FlagsValue
import {-# SOURCE #-} qualified GI.GObject.Structs.TypeClass as GObject.TypeClass

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

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

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


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

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


-- | Get the value of the “@g_type_class@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' flagsClass #gTypeClass
-- @
getFlagsClassGTypeClass :: MonadIO m => FlagsClass -> m GObject.TypeClass.TypeClass
getFlagsClassGTypeClass :: forall (m :: * -> *). MonadIO m => FlagsClass -> m TypeClass
getFlagsClassGTypeClass FlagsClass
s = IO TypeClass -> m TypeClass
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TypeClass -> m TypeClass) -> IO TypeClass -> m TypeClass
forall a b. (a -> b) -> a -> b
$ FlagsClass -> (Ptr FlagsClass -> IO TypeClass) -> IO TypeClass
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr FlagsClass
s ((Ptr FlagsClass -> IO TypeClass) -> IO TypeClass)
-> (Ptr FlagsClass -> IO TypeClass) -> IO TypeClass
forall a b. (a -> b) -> a -> b
$ \Ptr FlagsClass
ptr -> do
    let val :: Ptr TypeClass
val = Ptr FlagsClass
ptr Ptr FlagsClass -> Int -> Ptr TypeClass
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0 :: (Ptr GObject.TypeClass.TypeClass)
    TypeClass
val' <- ((ManagedPtr TypeClass -> TypeClass)
-> Ptr TypeClass -> IO TypeClass
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr TypeClass -> TypeClass
GObject.TypeClass.TypeClass) Ptr TypeClass
val
    TypeClass -> IO TypeClass
forall (m :: * -> *) a. Monad m => a -> m a
return TypeClass
val'

#if defined(ENABLE_OVERLOADING)
data FlagsClassGTypeClassFieldInfo
instance AttrInfo FlagsClassGTypeClassFieldInfo where
    type AttrBaseTypeConstraint FlagsClassGTypeClassFieldInfo = (~) FlagsClass
    type AttrAllowedOps FlagsClassGTypeClassFieldInfo = '[ 'AttrGet]
    type AttrSetTypeConstraint FlagsClassGTypeClassFieldInfo = (~) (Ptr GObject.TypeClass.TypeClass)
    type AttrTransferTypeConstraint FlagsClassGTypeClassFieldInfo = (~)(Ptr GObject.TypeClass.TypeClass)
    type AttrTransferType FlagsClassGTypeClassFieldInfo = (Ptr GObject.TypeClass.TypeClass)
    type AttrGetType FlagsClassGTypeClassFieldInfo = GObject.TypeClass.TypeClass
    type AttrLabel FlagsClassGTypeClassFieldInfo = "g_type_class"
    type AttrOrigin FlagsClassGTypeClassFieldInfo = FlagsClass
    attrGet = getFlagsClassGTypeClass
    attrSet = undefined
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer = undefined

flagsClass_gTypeClass :: AttrLabelProxy "gTypeClass"
flagsClass_gTypeClass = AttrLabelProxy

#endif


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

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

#if defined(ENABLE_OVERLOADING)
data FlagsClassMaskFieldInfo
instance AttrInfo FlagsClassMaskFieldInfo where
    type AttrBaseTypeConstraint FlagsClassMaskFieldInfo = (~) FlagsClass
    type AttrAllowedOps FlagsClassMaskFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint FlagsClassMaskFieldInfo = (~) Word32
    type AttrTransferTypeConstraint FlagsClassMaskFieldInfo = (~)Word32
    type AttrTransferType FlagsClassMaskFieldInfo = Word32
    type AttrGetType FlagsClassMaskFieldInfo = Word32
    type AttrLabel FlagsClassMaskFieldInfo = "mask"
    type AttrOrigin FlagsClassMaskFieldInfo = FlagsClass
    attrGet = getFlagsClassMask
    attrSet = setFlagsClassMask
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer _ v = do
        return v

flagsClass_mask :: AttrLabelProxy "mask"
flagsClass_mask = AttrLabelProxy

#endif


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

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

#if defined(ENABLE_OVERLOADING)
data FlagsClassNValuesFieldInfo
instance AttrInfo FlagsClassNValuesFieldInfo where
    type AttrBaseTypeConstraint FlagsClassNValuesFieldInfo = (~) FlagsClass
    type AttrAllowedOps FlagsClassNValuesFieldInfo = '[ 'AttrSet, 'AttrGet]
    type AttrSetTypeConstraint FlagsClassNValuesFieldInfo = (~) Word32
    type AttrTransferTypeConstraint FlagsClassNValuesFieldInfo = (~)Word32
    type AttrTransferType FlagsClassNValuesFieldInfo = Word32
    type AttrGetType FlagsClassNValuesFieldInfo = Word32
    type AttrLabel FlagsClassNValuesFieldInfo = "n_values"
    type AttrOrigin FlagsClassNValuesFieldInfo = FlagsClass
    attrGet = getFlagsClassNValues
    attrSet = setFlagsClassNValues
    attrConstruct = undefined
    attrClear = undefined
    attrTransfer _ v = do
        return v

flagsClass_nValues :: AttrLabelProxy "nValues"
flagsClass_nValues = AttrLabelProxy

#endif


-- | Get the value of the “@values@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' flagsClass #values
-- @
getFlagsClassValues :: MonadIO m => FlagsClass -> m (Maybe GObject.FlagsValue.FlagsValue)
getFlagsClassValues :: forall (m :: * -> *).
MonadIO m =>
FlagsClass -> m (Maybe FlagsValue)
getFlagsClassValues FlagsClass
s = IO (Maybe FlagsValue) -> m (Maybe FlagsValue)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe FlagsValue) -> m (Maybe FlagsValue))
-> IO (Maybe FlagsValue) -> m (Maybe FlagsValue)
forall a b. (a -> b) -> a -> b
$ FlagsClass
-> (Ptr FlagsClass -> IO (Maybe FlagsValue))
-> IO (Maybe FlagsValue)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr FlagsClass
s ((Ptr FlagsClass -> IO (Maybe FlagsValue))
 -> IO (Maybe FlagsValue))
-> (Ptr FlagsClass -> IO (Maybe FlagsValue))
-> IO (Maybe FlagsValue)
forall a b. (a -> b) -> a -> b
$ \Ptr FlagsClass
ptr -> do
    Ptr FlagsValue
val <- Ptr (Ptr FlagsValue) -> IO (Ptr FlagsValue)
forall a. Storable a => Ptr a -> IO a
peek (Ptr FlagsClass
ptr Ptr FlagsClass -> Int -> Ptr (Ptr FlagsValue)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) :: IO (Ptr GObject.FlagsValue.FlagsValue)
    Maybe FlagsValue
result <- Ptr FlagsValue
-> (Ptr FlagsValue -> IO FlagsValue) -> IO (Maybe FlagsValue)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull Ptr FlagsValue
val ((Ptr FlagsValue -> IO FlagsValue) -> IO (Maybe FlagsValue))
-> (Ptr FlagsValue -> IO FlagsValue) -> IO (Maybe FlagsValue)
forall a b. (a -> b) -> a -> b
$ \Ptr FlagsValue
val' -> do
        FlagsValue
val'' <- ((ManagedPtr FlagsValue -> FlagsValue)
-> Ptr FlagsValue -> IO FlagsValue
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr FlagsValue -> FlagsValue
GObject.FlagsValue.FlagsValue) Ptr FlagsValue
val'
        FlagsValue -> IO FlagsValue
forall (m :: * -> *) a. Monad m => a -> m a
return FlagsValue
val''
    Maybe FlagsValue -> IO (Maybe FlagsValue)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe FlagsValue
result

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

-- | Set the value of the “@values@” 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' #values
-- @
clearFlagsClassValues :: MonadIO m => FlagsClass -> m ()
clearFlagsClassValues :: forall (m :: * -> *). MonadIO m => FlagsClass -> m ()
clearFlagsClassValues FlagsClass
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ FlagsClass -> (Ptr FlagsClass -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr FlagsClass
s ((Ptr FlagsClass -> IO ()) -> IO ())
-> (Ptr FlagsClass -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr FlagsClass
ptr -> do
    Ptr (Ptr FlagsValue) -> Ptr FlagsValue -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr FlagsClass
ptr Ptr FlagsClass -> Int -> Ptr (Ptr FlagsValue)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) (Ptr FlagsValue
forall a. Ptr a
FP.nullPtr :: Ptr GObject.FlagsValue.FlagsValue)

#if defined(ENABLE_OVERLOADING)
data FlagsClassValuesFieldInfo
instance AttrInfo FlagsClassValuesFieldInfo where
    type AttrBaseTypeConstraint FlagsClassValuesFieldInfo = (~) FlagsClass
    type AttrAllowedOps FlagsClassValuesFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint FlagsClassValuesFieldInfo = (~) (Ptr GObject.FlagsValue.FlagsValue)
    type AttrTransferTypeConstraint FlagsClassValuesFieldInfo = (~)(Ptr GObject.FlagsValue.FlagsValue)
    type AttrTransferType FlagsClassValuesFieldInfo = (Ptr GObject.FlagsValue.FlagsValue)
    type AttrGetType FlagsClassValuesFieldInfo = Maybe GObject.FlagsValue.FlagsValue
    type AttrLabel FlagsClassValuesFieldInfo = "values"
    type AttrOrigin FlagsClassValuesFieldInfo = FlagsClass
    attrGet = getFlagsClassValues
    attrSet = setFlagsClassValues
    attrConstruct = undefined
    attrClear = clearFlagsClassValues
    attrTransfer _ v = do
        return v

flagsClass_values :: AttrLabelProxy "values"
flagsClass_values = AttrLabelProxy

#endif



#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList FlagsClass
type instance O.AttributeList FlagsClass = FlagsClassAttributeList
type FlagsClassAttributeList = ('[ '("gTypeClass", FlagsClassGTypeClassFieldInfo), '("mask", FlagsClassMaskFieldInfo), '("nValues", FlagsClassNValuesFieldInfo), '("values", FlagsClassValuesFieldInfo)] :: [(Symbol, *)])
#endif

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

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

#endif

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

#endif