packages feed

gi-gst-0.1.6.13: GI/Gst/Structs/ValueTable.hs


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

VTable for the #GValue @type.
-}

module GI.Gst.Structs.ValueTable
    ( 

-- * Exported types
    ValueTable(..)                          ,
    newZeroValueTable                       ,
    noValueTable                            ,


 -- * Properties
-- ** Type
    valueTableReadType                      ,




    ) 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.Gst.Types
import GI.Gst.Callbacks

newtype ValueTable = ValueTable (ForeignPtr ValueTable)
-- | Construct a `ValueTable` struct initialized to zero.
newZeroValueTable :: MonadIO m => m ValueTable
newZeroValueTable = liftIO $ callocBytes 64 >>= wrapPtr ValueTable

noValueTable :: Maybe ValueTable
noValueTable = Nothing

valueTableReadType :: ValueTable -> IO GType
valueTableReadType s = withManagedPtr s $ \ptr -> do
    val <- peek (ptr `plusPtr` 0) :: IO CGType
    let val' = GType val
    return val'

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

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

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

type family ResolveValueTableMethod (t :: Symbol) (o :: *) :: * where
    ResolveValueTableMethod l o = MethodResolutionFailed l o

instance (info ~ ResolveValueTableMethod t ValueTable, MethodInfo info ValueTable p) => IsLabelProxy t (ValueTable -> p) where
    fromLabelProxy _ = overloadedMethod (MethodProxy :: MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveValueTableMethod t ValueTable, MethodInfo info ValueTable p) => IsLabel t (ValueTable -> p) where
    fromLabel _ = overloadedMethod (MethodProxy :: MethodProxy info)
#endif