{- |
Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
License    : LGPL-2.1
Maintainer : Iñaki García Etxebarria (garetxe@gmail.com)

The 'GI.GObject.Structs.TypeValueTable.TypeValueTable' provides the functions required by the 'GI.GObject.Structs.Value.Value'
implementation, to serve as a container for values of a type.
-}

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

module GI.GObject.Structs.TypeValueTable
    (

-- * Exported types
    TypeValueTable(..)                      ,
    newZeroTypeValueTable                   ,
    noTypeValueTable                        ,


 -- * Properties
-- ** collectFormat #attr:collectFormat#
{- | A string format describing how to collect the contents of
 this value bit-by-bit. Each character in the format represents
 an argument to be collected, and the characters themselves indicate
 the type of the argument. Currently supported arguments are:
 - \'i\' - Integers. passed as collect_values[].v_int.
 - \'l\' - Longs. passed as collect_values[].v_long.
 - \'d\' - Doubles. passed as collect_values[].v_double.
 - \'p\' - Pointers. passed as collect_values[].v_pointer.
 It should be noted that for variable argument list construction,
 ANSI C promotes every type smaller than an integer to an int, and
 floats to doubles. So for collection of short int or char, \'i\'
 needs to be used, and for collection of floats \'d\'.
-}
    clearTypeValueTableCollectFormat        ,
    getTypeValueTableCollectFormat          ,
    setTypeValueTableCollectFormat          ,
#if ENABLE_OVERLOADING
    typeValueTable_collectFormat            ,
#endif


-- ** collectValue #attr:collectValue#
{- | /No description available in the introspection data./
-}
    clearTypeValueTableCollectValue         ,
    getTypeValueTableCollectValue           ,
    setTypeValueTableCollectValue           ,
#if ENABLE_OVERLOADING
    typeValueTable_collectValue             ,
#endif


-- ** lcopyFormat #attr:lcopyFormat#
{- | Format description of the arguments to collect for /@lcopyValue@/,
 analogous to /@collectFormat@/. Usually, /@lcopyFormat@/ string consists
 only of \'p\'s to provide @/lcopy_value()/@ with pointers to storage locations.
-}
    clearTypeValueTableLcopyFormat          ,
    getTypeValueTableLcopyFormat            ,
    setTypeValueTableLcopyFormat            ,
#if ENABLE_OVERLOADING
    typeValueTable_lcopyFormat              ,
#endif


-- ** lcopyValue #attr:lcopyValue#
{- | /No description available in the introspection data./
-}
    clearTypeValueTableLcopyValue           ,
    getTypeValueTableLcopyValue             ,
    setTypeValueTableLcopyValue             ,
#if ENABLE_OVERLOADING
    typeValueTable_lcopyValue               ,
#endif


-- ** valueCopy #attr:valueCopy#
{- | /No description available in the introspection data./
-}
    clearTypeValueTableValueCopy            ,
    getTypeValueTableValueCopy              ,
    setTypeValueTableValueCopy              ,
#if ENABLE_OVERLOADING
    typeValueTable_valueCopy                ,
#endif


-- ** valueFree #attr:valueFree#
{- | /No description available in the introspection data./
-}
    clearTypeValueTableValueFree            ,
    getTypeValueTableValueFree              ,
    setTypeValueTableValueFree              ,
#if ENABLE_OVERLOADING
    typeValueTable_valueFree                ,
#endif


-- ** valueInit #attr:valueInit#
{- | /No description available in the introspection data./
-}
    clearTypeValueTableValueInit            ,
    getTypeValueTableValueInit              ,
    setTypeValueTableValueInit              ,
#if ENABLE_OVERLOADING
    typeValueTable_valueInit                ,
#endif


-- ** valuePeekPointer #attr:valuePeekPointer#
{- | /No description available in the introspection data./
-}
    clearTypeValueTableValuePeekPointer     ,
    getTypeValueTableValuePeekPointer       ,
    setTypeValueTableValuePeekPointer       ,
#if ENABLE_OVERLOADING
    typeValueTable_valuePeekPointer         ,
#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.ManagedPtr as B.ManagedPtr
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.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP

import qualified GI.GObject.Callbacks as GObject.Callbacks

-- | Memory-managed wrapper type.
newtype TypeValueTable = TypeValueTable (ManagedPtr TypeValueTable)
instance WrappedPtr TypeValueTable where
    wrappedPtrCalloc = callocBytes 64
    wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 64 >=> wrapPtr TypeValueTable)
    wrappedPtrFree = Just ptr_to_g_free

-- | Construct a `TypeValueTable` struct initialized to zero.
newZeroTypeValueTable :: MonadIO m => m TypeValueTable
newZeroTypeValueTable = liftIO $ wrappedPtrCalloc >>= wrapPtr TypeValueTable

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


-- | A convenience alias for `Nothing` :: `Maybe` `TypeValueTable`.
noTypeValueTable :: Maybe TypeValueTable
noTypeValueTable = Nothing

{- |
Get the value of the “@value_init@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' typeValueTable #valueInit
@
-}
getTypeValueTableValueInit :: MonadIO m => TypeValueTable -> m (Maybe GObject.Callbacks.TypeValueTableValueInitFieldCallback)
getTypeValueTableValueInit s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 0) :: IO (FunPtr GObject.Callbacks.C_TypeValueTableValueInitFieldCallback)
    result <- SP.convertFunPtrIfNonNull val $ \val' -> do
        let val'' = GObject.Callbacks.dynamic_TypeValueTableValueInitFieldCallback val'
        return val''
    return result

{- |
Set the value of the “@value_init@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' typeValueTable [ #valueInit 'Data.GI.Base.Attributes.:=' value ]
@
-}
setTypeValueTableValueInit :: MonadIO m => TypeValueTable -> FunPtr GObject.Callbacks.C_TypeValueTableValueInitFieldCallback -> m ()
setTypeValueTableValueInit s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 0) (val :: FunPtr GObject.Callbacks.C_TypeValueTableValueInitFieldCallback)

{- |
Set the value of the “@value_init@” 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' #valueInit
@
-}
clearTypeValueTableValueInit :: MonadIO m => TypeValueTable -> m ()
clearTypeValueTableValueInit s = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 0) (FP.nullFunPtr :: FunPtr GObject.Callbacks.C_TypeValueTableValueInitFieldCallback)

#if ENABLE_OVERLOADING
data TypeValueTableValueInitFieldInfo
instance AttrInfo TypeValueTableValueInitFieldInfo where
    type AttrAllowedOps TypeValueTableValueInitFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint TypeValueTableValueInitFieldInfo = (~) (FunPtr GObject.Callbacks.C_TypeValueTableValueInitFieldCallback)
    type AttrBaseTypeConstraint TypeValueTableValueInitFieldInfo = (~) TypeValueTable
    type AttrGetType TypeValueTableValueInitFieldInfo = Maybe GObject.Callbacks.TypeValueTableValueInitFieldCallback
    type AttrLabel TypeValueTableValueInitFieldInfo = "value_init"
    type AttrOrigin TypeValueTableValueInitFieldInfo = TypeValueTable
    attrGet _ = getTypeValueTableValueInit
    attrSet _ = setTypeValueTableValueInit
    attrConstruct = undefined
    attrClear _ = clearTypeValueTableValueInit

typeValueTable_valueInit :: AttrLabelProxy "valueInit"
typeValueTable_valueInit = AttrLabelProxy

#endif


{- |
Get the value of the “@value_free@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' typeValueTable #valueFree
@
-}
getTypeValueTableValueFree :: MonadIO m => TypeValueTable -> m (Maybe GObject.Callbacks.TypeValueTableValueFreeFieldCallback)
getTypeValueTableValueFree s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 8) :: IO (FunPtr GObject.Callbacks.C_TypeValueTableValueFreeFieldCallback)
    result <- SP.convertFunPtrIfNonNull val $ \val' -> do
        let val'' = GObject.Callbacks.dynamic_TypeValueTableValueFreeFieldCallback val'
        return val''
    return result

{- |
Set the value of the “@value_free@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' typeValueTable [ #valueFree 'Data.GI.Base.Attributes.:=' value ]
@
-}
setTypeValueTableValueFree :: MonadIO m => TypeValueTable -> FunPtr GObject.Callbacks.C_TypeValueTableValueFreeFieldCallback -> m ()
setTypeValueTableValueFree s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 8) (val :: FunPtr GObject.Callbacks.C_TypeValueTableValueFreeFieldCallback)

{- |
Set the value of the “@value_free@” 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' #valueFree
@
-}
clearTypeValueTableValueFree :: MonadIO m => TypeValueTable -> m ()
clearTypeValueTableValueFree s = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 8) (FP.nullFunPtr :: FunPtr GObject.Callbacks.C_TypeValueTableValueFreeFieldCallback)

#if ENABLE_OVERLOADING
data TypeValueTableValueFreeFieldInfo
instance AttrInfo TypeValueTableValueFreeFieldInfo where
    type AttrAllowedOps TypeValueTableValueFreeFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint TypeValueTableValueFreeFieldInfo = (~) (FunPtr GObject.Callbacks.C_TypeValueTableValueFreeFieldCallback)
    type AttrBaseTypeConstraint TypeValueTableValueFreeFieldInfo = (~) TypeValueTable
    type AttrGetType TypeValueTableValueFreeFieldInfo = Maybe GObject.Callbacks.TypeValueTableValueFreeFieldCallback
    type AttrLabel TypeValueTableValueFreeFieldInfo = "value_free"
    type AttrOrigin TypeValueTableValueFreeFieldInfo = TypeValueTable
    attrGet _ = getTypeValueTableValueFree
    attrSet _ = setTypeValueTableValueFree
    attrConstruct = undefined
    attrClear _ = clearTypeValueTableValueFree

typeValueTable_valueFree :: AttrLabelProxy "valueFree"
typeValueTable_valueFree = AttrLabelProxy

#endif


{- |
Get the value of the “@value_copy@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' typeValueTable #valueCopy
@
-}
getTypeValueTableValueCopy :: MonadIO m => TypeValueTable -> m (Maybe GObject.Callbacks.TypeValueTableValueCopyFieldCallback)
getTypeValueTableValueCopy s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 16) :: IO (FunPtr GObject.Callbacks.C_TypeValueTableValueCopyFieldCallback)
    result <- SP.convertFunPtrIfNonNull val $ \val' -> do
        let val'' = GObject.Callbacks.dynamic_TypeValueTableValueCopyFieldCallback val'
        return val''
    return result

{- |
Set the value of the “@value_copy@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' typeValueTable [ #valueCopy 'Data.GI.Base.Attributes.:=' value ]
@
-}
setTypeValueTableValueCopy :: MonadIO m => TypeValueTable -> FunPtr GObject.Callbacks.C_TypeValueTableValueCopyFieldCallback -> m ()
setTypeValueTableValueCopy s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 16) (val :: FunPtr GObject.Callbacks.C_TypeValueTableValueCopyFieldCallback)

{- |
Set the value of the “@value_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' #valueCopy
@
-}
clearTypeValueTableValueCopy :: MonadIO m => TypeValueTable -> m ()
clearTypeValueTableValueCopy s = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 16) (FP.nullFunPtr :: FunPtr GObject.Callbacks.C_TypeValueTableValueCopyFieldCallback)

#if ENABLE_OVERLOADING
data TypeValueTableValueCopyFieldInfo
instance AttrInfo TypeValueTableValueCopyFieldInfo where
    type AttrAllowedOps TypeValueTableValueCopyFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint TypeValueTableValueCopyFieldInfo = (~) (FunPtr GObject.Callbacks.C_TypeValueTableValueCopyFieldCallback)
    type AttrBaseTypeConstraint TypeValueTableValueCopyFieldInfo = (~) TypeValueTable
    type AttrGetType TypeValueTableValueCopyFieldInfo = Maybe GObject.Callbacks.TypeValueTableValueCopyFieldCallback
    type AttrLabel TypeValueTableValueCopyFieldInfo = "value_copy"
    type AttrOrigin TypeValueTableValueCopyFieldInfo = TypeValueTable
    attrGet _ = getTypeValueTableValueCopy
    attrSet _ = setTypeValueTableValueCopy
    attrConstruct = undefined
    attrClear _ = clearTypeValueTableValueCopy

typeValueTable_valueCopy :: AttrLabelProxy "valueCopy"
typeValueTable_valueCopy = AttrLabelProxy

#endif


{- |
Get the value of the “@value_peek_pointer@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' typeValueTable #valuePeekPointer
@
-}
getTypeValueTableValuePeekPointer :: MonadIO m => TypeValueTable -> m (Maybe GObject.Callbacks.TypeValueTableValuePeekPointerFieldCallback)
getTypeValueTableValuePeekPointer s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 24) :: IO (FunPtr GObject.Callbacks.C_TypeValueTableValuePeekPointerFieldCallback)
    result <- SP.convertFunPtrIfNonNull val $ \val' -> do
        let val'' = GObject.Callbacks.dynamic_TypeValueTableValuePeekPointerFieldCallback val'
        return val''
    return result

{- |
Set the value of the “@value_peek_pointer@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' typeValueTable [ #valuePeekPointer 'Data.GI.Base.Attributes.:=' value ]
@
-}
setTypeValueTableValuePeekPointer :: MonadIO m => TypeValueTable -> FunPtr GObject.Callbacks.C_TypeValueTableValuePeekPointerFieldCallback -> m ()
setTypeValueTableValuePeekPointer s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 24) (val :: FunPtr GObject.Callbacks.C_TypeValueTableValuePeekPointerFieldCallback)

{- |
Set the value of the “@value_peek_pointer@” 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' #valuePeekPointer
@
-}
clearTypeValueTableValuePeekPointer :: MonadIO m => TypeValueTable -> m ()
clearTypeValueTableValuePeekPointer s = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 24) (FP.nullFunPtr :: FunPtr GObject.Callbacks.C_TypeValueTableValuePeekPointerFieldCallback)

#if ENABLE_OVERLOADING
data TypeValueTableValuePeekPointerFieldInfo
instance AttrInfo TypeValueTableValuePeekPointerFieldInfo where
    type AttrAllowedOps TypeValueTableValuePeekPointerFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint TypeValueTableValuePeekPointerFieldInfo = (~) (FunPtr GObject.Callbacks.C_TypeValueTableValuePeekPointerFieldCallback)
    type AttrBaseTypeConstraint TypeValueTableValuePeekPointerFieldInfo = (~) TypeValueTable
    type AttrGetType TypeValueTableValuePeekPointerFieldInfo = Maybe GObject.Callbacks.TypeValueTableValuePeekPointerFieldCallback
    type AttrLabel TypeValueTableValuePeekPointerFieldInfo = "value_peek_pointer"
    type AttrOrigin TypeValueTableValuePeekPointerFieldInfo = TypeValueTable
    attrGet _ = getTypeValueTableValuePeekPointer
    attrSet _ = setTypeValueTableValuePeekPointer
    attrConstruct = undefined
    attrClear _ = clearTypeValueTableValuePeekPointer

typeValueTable_valuePeekPointer :: AttrLabelProxy "valuePeekPointer"
typeValueTable_valuePeekPointer = AttrLabelProxy

#endif


{- |
Get the value of the “@collect_format@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' typeValueTable #collectFormat
@
-}
getTypeValueTableCollectFormat :: MonadIO m => TypeValueTable -> m (Maybe T.Text)
getTypeValueTableCollectFormat s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 32) :: IO CString
    result <- SP.convertIfNonNull val $ \val' -> do
        val'' <- cstringToText val'
        return val''
    return result

{- |
Set the value of the “@collect_format@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' typeValueTable [ #collectFormat 'Data.GI.Base.Attributes.:=' value ]
@
-}
setTypeValueTableCollectFormat :: MonadIO m => TypeValueTable -> CString -> m ()
setTypeValueTableCollectFormat s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 32) (val :: CString)

{- |
Set the value of the “@collect_format@” 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' #collectFormat
@
-}
clearTypeValueTableCollectFormat :: MonadIO m => TypeValueTable -> m ()
clearTypeValueTableCollectFormat s = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 32) (FP.nullPtr :: CString)

#if ENABLE_OVERLOADING
data TypeValueTableCollectFormatFieldInfo
instance AttrInfo TypeValueTableCollectFormatFieldInfo where
    type AttrAllowedOps TypeValueTableCollectFormatFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint TypeValueTableCollectFormatFieldInfo = (~) CString
    type AttrBaseTypeConstraint TypeValueTableCollectFormatFieldInfo = (~) TypeValueTable
    type AttrGetType TypeValueTableCollectFormatFieldInfo = Maybe T.Text
    type AttrLabel TypeValueTableCollectFormatFieldInfo = "collect_format"
    type AttrOrigin TypeValueTableCollectFormatFieldInfo = TypeValueTable
    attrGet _ = getTypeValueTableCollectFormat
    attrSet _ = setTypeValueTableCollectFormat
    attrConstruct = undefined
    attrClear _ = clearTypeValueTableCollectFormat

typeValueTable_collectFormat :: AttrLabelProxy "collectFormat"
typeValueTable_collectFormat = AttrLabelProxy

#endif


{- |
Get the value of the “@collect_value@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' typeValueTable #collectValue
@
-}
getTypeValueTableCollectValue :: MonadIO m => TypeValueTable -> m (Maybe GObject.Callbacks.TypeValueTableCollectValueFieldCallback)
getTypeValueTableCollectValue s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 40) :: IO (FunPtr GObject.Callbacks.C_TypeValueTableCollectValueFieldCallback)
    result <- SP.convertFunPtrIfNonNull val $ \val' -> do
        let val'' = GObject.Callbacks.dynamic_TypeValueTableCollectValueFieldCallback val'
        return val''
    return result

{- |
Set the value of the “@collect_value@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' typeValueTable [ #collectValue 'Data.GI.Base.Attributes.:=' value ]
@
-}
setTypeValueTableCollectValue :: MonadIO m => TypeValueTable -> FunPtr GObject.Callbacks.C_TypeValueTableCollectValueFieldCallback -> m ()
setTypeValueTableCollectValue s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 40) (val :: FunPtr GObject.Callbacks.C_TypeValueTableCollectValueFieldCallback)

{- |
Set the value of the “@collect_value@” 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' #collectValue
@
-}
clearTypeValueTableCollectValue :: MonadIO m => TypeValueTable -> m ()
clearTypeValueTableCollectValue s = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 40) (FP.nullFunPtr :: FunPtr GObject.Callbacks.C_TypeValueTableCollectValueFieldCallback)

#if ENABLE_OVERLOADING
data TypeValueTableCollectValueFieldInfo
instance AttrInfo TypeValueTableCollectValueFieldInfo where
    type AttrAllowedOps TypeValueTableCollectValueFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint TypeValueTableCollectValueFieldInfo = (~) (FunPtr GObject.Callbacks.C_TypeValueTableCollectValueFieldCallback)
    type AttrBaseTypeConstraint TypeValueTableCollectValueFieldInfo = (~) TypeValueTable
    type AttrGetType TypeValueTableCollectValueFieldInfo = Maybe GObject.Callbacks.TypeValueTableCollectValueFieldCallback
    type AttrLabel TypeValueTableCollectValueFieldInfo = "collect_value"
    type AttrOrigin TypeValueTableCollectValueFieldInfo = TypeValueTable
    attrGet _ = getTypeValueTableCollectValue
    attrSet _ = setTypeValueTableCollectValue
    attrConstruct = undefined
    attrClear _ = clearTypeValueTableCollectValue

typeValueTable_collectValue :: AttrLabelProxy "collectValue"
typeValueTable_collectValue = AttrLabelProxy

#endif


{- |
Get the value of the “@lcopy_format@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' typeValueTable #lcopyFormat
@
-}
getTypeValueTableLcopyFormat :: MonadIO m => TypeValueTable -> m (Maybe T.Text)
getTypeValueTableLcopyFormat s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 48) :: IO CString
    result <- SP.convertIfNonNull val $ \val' -> do
        val'' <- cstringToText val'
        return val''
    return result

{- |
Set the value of the “@lcopy_format@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' typeValueTable [ #lcopyFormat 'Data.GI.Base.Attributes.:=' value ]
@
-}
setTypeValueTableLcopyFormat :: MonadIO m => TypeValueTable -> CString -> m ()
setTypeValueTableLcopyFormat s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 48) (val :: CString)

{- |
Set the value of the “@lcopy_format@” 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' #lcopyFormat
@
-}
clearTypeValueTableLcopyFormat :: MonadIO m => TypeValueTable -> m ()
clearTypeValueTableLcopyFormat s = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 48) (FP.nullPtr :: CString)

#if ENABLE_OVERLOADING
data TypeValueTableLcopyFormatFieldInfo
instance AttrInfo TypeValueTableLcopyFormatFieldInfo where
    type AttrAllowedOps TypeValueTableLcopyFormatFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint TypeValueTableLcopyFormatFieldInfo = (~) CString
    type AttrBaseTypeConstraint TypeValueTableLcopyFormatFieldInfo = (~) TypeValueTable
    type AttrGetType TypeValueTableLcopyFormatFieldInfo = Maybe T.Text
    type AttrLabel TypeValueTableLcopyFormatFieldInfo = "lcopy_format"
    type AttrOrigin TypeValueTableLcopyFormatFieldInfo = TypeValueTable
    attrGet _ = getTypeValueTableLcopyFormat
    attrSet _ = setTypeValueTableLcopyFormat
    attrConstruct = undefined
    attrClear _ = clearTypeValueTableLcopyFormat

typeValueTable_lcopyFormat :: AttrLabelProxy "lcopyFormat"
typeValueTable_lcopyFormat = AttrLabelProxy

#endif


{- |
Get the value of the “@lcopy_value@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' typeValueTable #lcopyValue
@
-}
getTypeValueTableLcopyValue :: MonadIO m => TypeValueTable -> m (Maybe GObject.Callbacks.TypeValueTableLcopyValueFieldCallback)
getTypeValueTableLcopyValue s = liftIO $ withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 56) :: IO (FunPtr GObject.Callbacks.C_TypeValueTableLcopyValueFieldCallback)
    result <- SP.convertFunPtrIfNonNull val $ \val' -> do
        let val'' = GObject.Callbacks.dynamic_TypeValueTableLcopyValueFieldCallback val'
        return val''
    return result

{- |
Set the value of the “@lcopy_value@” field.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' typeValueTable [ #lcopyValue 'Data.GI.Base.Attributes.:=' value ]
@
-}
setTypeValueTableLcopyValue :: MonadIO m => TypeValueTable -> FunPtr GObject.Callbacks.C_TypeValueTableLcopyValueFieldCallback -> m ()
setTypeValueTableLcopyValue s val = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 56) (val :: FunPtr GObject.Callbacks.C_TypeValueTableLcopyValueFieldCallback)

{- |
Set the value of the “@lcopy_value@” 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' #lcopyValue
@
-}
clearTypeValueTableLcopyValue :: MonadIO m => TypeValueTable -> m ()
clearTypeValueTableLcopyValue s = liftIO $ withManagedPtr s $ \ptr -> do
    poke (ptr `plusPtr` 56) (FP.nullFunPtr :: FunPtr GObject.Callbacks.C_TypeValueTableLcopyValueFieldCallback)

#if ENABLE_OVERLOADING
data TypeValueTableLcopyValueFieldInfo
instance AttrInfo TypeValueTableLcopyValueFieldInfo where
    type AttrAllowedOps TypeValueTableLcopyValueFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
    type AttrSetTypeConstraint TypeValueTableLcopyValueFieldInfo = (~) (FunPtr GObject.Callbacks.C_TypeValueTableLcopyValueFieldCallback)
    type AttrBaseTypeConstraint TypeValueTableLcopyValueFieldInfo = (~) TypeValueTable
    type AttrGetType TypeValueTableLcopyValueFieldInfo = Maybe GObject.Callbacks.TypeValueTableLcopyValueFieldCallback
    type AttrLabel TypeValueTableLcopyValueFieldInfo = "lcopy_value"
    type AttrOrigin TypeValueTableLcopyValueFieldInfo = TypeValueTable
    attrGet _ = getTypeValueTableLcopyValue
    attrSet _ = setTypeValueTableLcopyValue
    attrConstruct = undefined
    attrClear _ = clearTypeValueTableLcopyValue

typeValueTable_lcopyValue :: AttrLabelProxy "lcopyValue"
typeValueTable_lcopyValue = AttrLabelProxy

#endif



#if ENABLE_OVERLOADING
instance O.HasAttributeList TypeValueTable
type instance O.AttributeList TypeValueTable = TypeValueTableAttributeList
type TypeValueTableAttributeList = ('[ '("valueInit", TypeValueTableValueInitFieldInfo), '("valueFree", TypeValueTableValueFreeFieldInfo), '("valueCopy", TypeValueTableValueCopyFieldInfo), '("valuePeekPointer", TypeValueTableValuePeekPointerFieldInfo), '("collectFormat", TypeValueTableCollectFormatFieldInfo), '("collectValue", TypeValueTableCollectValueFieldInfo), '("lcopyFormat", TypeValueTableLcopyFormatFieldInfo), '("lcopyValue", TypeValueTableLcopyValueFieldInfo)] :: [(Symbol, *)])
#endif

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

instance (info ~ ResolveTypeValueTableMethod t TypeValueTable, O.MethodInfo info TypeValueTable p) => O.IsLabelProxy t (TypeValueTable -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveTypeValueTableMethod t TypeValueTable, O.MethodInfo info TypeValueTable p) => O.IsLabel t (TypeValueTable -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif

#endif