{- |
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 GObjectConstructParam struct is an auxiliary
structure used to hand #GParamSpec/#GValue pairs to the @constructor of
a #GObjectClass.
-}

module GI.GObject.Structs.ObjectConstructParam
    ( 

-- * Exported types
    ObjectConstructParam(..)                ,
    noObjectConstructParam                  ,


 -- * Properties
-- ** Pspec
    objectConstructParamReadPspec           ,


-- ** Value
    objectConstructParamReadValue           ,




    ) 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 ObjectConstructParam = ObjectConstructParam (ForeignPtr ObjectConstructParam)
noObjectConstructParam :: Maybe ObjectConstructParam
noObjectConstructParam = Nothing

objectConstructParamReadPspec :: ObjectConstructParam -> IO GParamSpec
objectConstructParamReadPspec s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 0) :: IO (Ptr GParamSpec)
    val' <- newGParamSpecFromPtr val
    return val'

objectConstructParamReadValue :: ObjectConstructParam -> IO GValue
objectConstructParamReadValue s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 8) :: IO (Ptr GValue)
    val' <- (newBoxed GValue) val
    return val'