{- |
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 #GTypeValueTable provides the functions required by the #GValue
implementation, to serve as a container for values of a type.
-}

module GI.GObject.Structs.TypeValueTable
    ( 

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


 -- * Properties
-- ** CollectFormat
    typeValueTableReadCollectFormat         ,


-- ** LcopyFormat
    typeValueTableReadLcopyFormat           ,




    ) where

import Prelude ()
import Data.GI.Base.ShortPrelude

import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map

import GI.GObject.Types
import GI.GObject.Callbacks

newtype TypeValueTable = TypeValueTable (ForeignPtr TypeValueTable)
noTypeValueTable :: Maybe TypeValueTable
noTypeValueTable = Nothing

-- XXX Skipped getter for "TypeValueTable:value_init" :: Not implemented: "Wrapping foreign callbacks is not supported yet"

-- XXX Skipped getter for "TypeValueTable:value_free" :: Not implemented: "Wrapping foreign callbacks is not supported yet"

-- XXX Skipped getter for "TypeValueTable:value_copy" :: Not implemented: "Wrapping foreign callbacks is not supported yet"

typeValueTableReadCollectFormat :: TypeValueTable -> IO T.Text
typeValueTableReadCollectFormat s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 32) :: IO CString
    val' <- cstringToText val
    return val'

-- XXX Skipped getter for "TypeValueTable:collect_value" :: Not implemented: "Wrapping foreign callbacks is not supported yet"

typeValueTableReadLcopyFormat :: TypeValueTable -> IO T.Text
typeValueTableReadLcopyFormat s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 48) :: IO CString
    val' <- cstringToText val
    return val'

-- XXX Skipped getter for "TypeValueTable:lcopy_value" :: Not implemented: "Wrapping foreign callbacks is not supported yet"