module GI.Gst.Structs.AllocationParams
(
AllocationParams(..) ,
newZeroAllocationParams ,
noAllocationParams ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
AllocationParamsCopyMethodInfo ,
#endif
allocationParamsCopy ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
AllocationParamsFreeMethodInfo ,
#endif
allocationParamsFree ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
AllocationParamsInitMethodInfo ,
#endif
allocationParamsInit ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
allocationParams_align ,
#endif
getAllocationParamsAlign ,
setAllocationParamsAlign ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
allocationParams_flags ,
#endif
getAllocationParamsFlags ,
setAllocationParamsFlags ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
allocationParams_padding ,
#endif
getAllocationParamsPadding ,
setAllocationParamsPadding ,
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
allocationParams_prefix ,
#endif
getAllocationParamsPrefix ,
setAllocationParamsPrefix ,
) 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.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.Gst.Flags as Gst.Flags
newtype AllocationParams = AllocationParams (ManagedPtr AllocationParams)
foreign import ccall "gst_allocation_params_get_type" c_gst_allocation_params_get_type ::
IO GType
instance BoxedObject AllocationParams where
boxedType _ = c_gst_allocation_params_get_type
newZeroAllocationParams :: MonadIO m => m AllocationParams
newZeroAllocationParams = liftIO $ callocBoxedBytes 64 >>= wrapBoxed AllocationParams
instance tag ~ 'AttrSet => Constructible AllocationParams tag where
new _ attrs = do
o <- newZeroAllocationParams
GI.Attributes.set o attrs
return o
noAllocationParams :: Maybe AllocationParams
noAllocationParams = Nothing
getAllocationParamsFlags :: MonadIO m => AllocationParams -> m [Gst.Flags.MemoryFlags]
getAllocationParamsFlags s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO CUInt
let val' = wordToGFlags val
return val'
setAllocationParamsFlags :: MonadIO m => AllocationParams -> [Gst.Flags.MemoryFlags] -> m ()
setAllocationParamsFlags s val = liftIO $ withManagedPtr s $ \ptr -> do
let val' = gflagsToWord val
poke (ptr `plusPtr` 0) (val' :: CUInt)
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data AllocationParamsFlagsFieldInfo
instance AttrInfo AllocationParamsFlagsFieldInfo where
type AttrAllowedOps AllocationParamsFlagsFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint AllocationParamsFlagsFieldInfo = (~) [Gst.Flags.MemoryFlags]
type AttrBaseTypeConstraint AllocationParamsFlagsFieldInfo = (~) AllocationParams
type AttrGetType AllocationParamsFlagsFieldInfo = [Gst.Flags.MemoryFlags]
type AttrLabel AllocationParamsFlagsFieldInfo = "flags"
type AttrOrigin AllocationParamsFlagsFieldInfo = AllocationParams
attrGet _ = getAllocationParamsFlags
attrSet _ = setAllocationParamsFlags
attrConstruct = undefined
attrClear _ = undefined
allocationParams_flags :: AttrLabelProxy "flags"
allocationParams_flags = AttrLabelProxy
#endif
getAllocationParamsAlign :: MonadIO m => AllocationParams -> m Word64
getAllocationParamsAlign s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO Word64
return val
setAllocationParamsAlign :: MonadIO m => AllocationParams -> Word64 -> m ()
setAllocationParamsAlign s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (val :: Word64)
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data AllocationParamsAlignFieldInfo
instance AttrInfo AllocationParamsAlignFieldInfo where
type AttrAllowedOps AllocationParamsAlignFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint AllocationParamsAlignFieldInfo = (~) Word64
type AttrBaseTypeConstraint AllocationParamsAlignFieldInfo = (~) AllocationParams
type AttrGetType AllocationParamsAlignFieldInfo = Word64
type AttrLabel AllocationParamsAlignFieldInfo = "align"
type AttrOrigin AllocationParamsAlignFieldInfo = AllocationParams
attrGet _ = getAllocationParamsAlign
attrSet _ = setAllocationParamsAlign
attrConstruct = undefined
attrClear _ = undefined
allocationParams_align :: AttrLabelProxy "align"
allocationParams_align = AttrLabelProxy
#endif
getAllocationParamsPrefix :: MonadIO m => AllocationParams -> m Word64
getAllocationParamsPrefix s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 16) :: IO Word64
return val
setAllocationParamsPrefix :: MonadIO m => AllocationParams -> Word64 -> m ()
setAllocationParamsPrefix s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (val :: Word64)
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data AllocationParamsPrefixFieldInfo
instance AttrInfo AllocationParamsPrefixFieldInfo where
type AttrAllowedOps AllocationParamsPrefixFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint AllocationParamsPrefixFieldInfo = (~) Word64
type AttrBaseTypeConstraint AllocationParamsPrefixFieldInfo = (~) AllocationParams
type AttrGetType AllocationParamsPrefixFieldInfo = Word64
type AttrLabel AllocationParamsPrefixFieldInfo = "prefix"
type AttrOrigin AllocationParamsPrefixFieldInfo = AllocationParams
attrGet _ = getAllocationParamsPrefix
attrSet _ = setAllocationParamsPrefix
attrConstruct = undefined
attrClear _ = undefined
allocationParams_prefix :: AttrLabelProxy "prefix"
allocationParams_prefix = AttrLabelProxy
#endif
getAllocationParamsPadding :: MonadIO m => AllocationParams -> m Word64
getAllocationParamsPadding s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 24) :: IO Word64
return val
setAllocationParamsPadding :: MonadIO m => AllocationParams -> Word64 -> m ()
setAllocationParamsPadding s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 24) (val :: Word64)
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data AllocationParamsPaddingFieldInfo
instance AttrInfo AllocationParamsPaddingFieldInfo where
type AttrAllowedOps AllocationParamsPaddingFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint AllocationParamsPaddingFieldInfo = (~) Word64
type AttrBaseTypeConstraint AllocationParamsPaddingFieldInfo = (~) AllocationParams
type AttrGetType AllocationParamsPaddingFieldInfo = Word64
type AttrLabel AllocationParamsPaddingFieldInfo = "padding"
type AttrOrigin AllocationParamsPaddingFieldInfo = AllocationParams
attrGet _ = getAllocationParamsPadding
attrSet _ = setAllocationParamsPadding
attrConstruct = undefined
attrClear _ = undefined
allocationParams_padding :: AttrLabelProxy "padding"
allocationParams_padding = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
instance O.HasAttributeList AllocationParams
type instance O.AttributeList AllocationParams = AllocationParamsAttributeList
type AllocationParamsAttributeList = ('[ '("flags", AllocationParamsFlagsFieldInfo), '("align", AllocationParamsAlignFieldInfo), '("prefix", AllocationParamsPrefixFieldInfo), '("padding", AllocationParamsPaddingFieldInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gst_allocation_params_copy" gst_allocation_params_copy ::
Ptr AllocationParams ->
IO (Ptr AllocationParams)
allocationParamsCopy ::
(B.CallStack.HasCallStack, MonadIO m) =>
AllocationParams
-> m AllocationParams
allocationParamsCopy params = liftIO $ do
params' <- unsafeManagedPtrGetPtr params
result <- gst_allocation_params_copy params'
checkUnexpectedReturnNULL "allocationParamsCopy" result
result' <- (wrapBoxed AllocationParams) result
touchManagedPtr params
return result'
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data AllocationParamsCopyMethodInfo
instance (signature ~ (m AllocationParams), MonadIO m) => O.MethodInfo AllocationParamsCopyMethodInfo AllocationParams signature where
overloadedMethod _ = allocationParamsCopy
#endif
foreign import ccall "gst_allocation_params_free" gst_allocation_params_free ::
Ptr AllocationParams ->
IO ()
allocationParamsFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
AllocationParams
-> m ()
allocationParamsFree params = liftIO $ do
params' <- B.ManagedPtr.disownBoxed params
gst_allocation_params_free params'
touchManagedPtr params
return ()
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data AllocationParamsFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo AllocationParamsFreeMethodInfo AllocationParams signature where
overloadedMethod _ = allocationParamsFree
#endif
foreign import ccall "gst_allocation_params_init" gst_allocation_params_init ::
Ptr AllocationParams ->
IO ()
allocationParamsInit ::
(B.CallStack.HasCallStack, MonadIO m) =>
AllocationParams
-> m ()
allocationParamsInit params = liftIO $ do
params' <- unsafeManagedPtrGetPtr params
gst_allocation_params_init params'
touchManagedPtr params
return ()
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
data AllocationParamsInitMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo AllocationParamsInitMethodInfo AllocationParams signature where
overloadedMethod _ = allocationParamsInit
#endif
#if defined(ENABLE_OVERLOADING) && !defined(__HADDOCK_VERSION__)
type family ResolveAllocationParamsMethod (t :: Symbol) (o :: *) :: * where
ResolveAllocationParamsMethod "copy" o = AllocationParamsCopyMethodInfo
ResolveAllocationParamsMethod "free" o = AllocationParamsFreeMethodInfo
ResolveAllocationParamsMethod "init" o = AllocationParamsInitMethodInfo
ResolveAllocationParamsMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveAllocationParamsMethod t AllocationParams, O.MethodInfo info AllocationParams p) => O.IsLabelProxy t (AllocationParams -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveAllocationParamsMethod t AllocationParams, O.MethodInfo info AllocationParams p) => O.IsLabel t (AllocationParams -> 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