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

This structure is used to provide the type system with the information
required to initialize and destruct (finalize) a parameter's class and
instances thereof.
The initialized structure is passed to the g_param_type_register_static()
The type system will perform a deep copy of this structure, so its memory
does not need to be persistent across invocation of
g_param_type_register_static().
-}

module GI.GObject.Structs.ParamSpecTypeInfo
    ( 

-- * Exported types
    ParamSpecTypeInfo(..)                   ,
    noParamSpecTypeInfo                     ,


 -- * Properties
-- ** InstanceSize
    paramSpecTypeInfoReadInstanceSize       ,


-- ** NPreallocs
    paramSpecTypeInfoReadNPreallocs         ,


-- ** ValueType
    paramSpecTypeInfoReadValueType          ,




    ) 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 ParamSpecTypeInfo = ParamSpecTypeInfo (ForeignPtr ParamSpecTypeInfo)
noParamSpecTypeInfo :: Maybe ParamSpecTypeInfo
noParamSpecTypeInfo = Nothing

paramSpecTypeInfoReadInstanceSize :: ParamSpecTypeInfo -> IO Word16
paramSpecTypeInfoReadInstanceSize s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 0) :: IO Word16
    return val

paramSpecTypeInfoReadNPreallocs :: ParamSpecTypeInfo -> IO Word16
paramSpecTypeInfoReadNPreallocs s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 2) :: IO Word16
    return val

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

paramSpecTypeInfoReadValueType :: ParamSpecTypeInfo -> IO GType
paramSpecTypeInfoReadValueType s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 16) :: IO CGType
    let val' = GType val
    return val'

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

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

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

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