#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gst.Structs.StaticPadTemplate
(
StaticPadTemplate(..) ,
newZeroStaticPadTemplate ,
noStaticPadTemplate ,
#if ENABLE_OVERLOADING
StaticPadTemplateGetMethodInfo ,
#endif
staticPadTemplateGet ,
#if ENABLE_OVERLOADING
StaticPadTemplateGetCapsMethodInfo ,
#endif
staticPadTemplateGetCaps ,
getStaticPadTemplateDirection ,
setStaticPadTemplateDirection ,
#if ENABLE_OVERLOADING
staticPadTemplate_direction ,
#endif
clearStaticPadTemplateNameTemplate ,
getStaticPadTemplateNameTemplate ,
setStaticPadTemplateNameTemplate ,
#if ENABLE_OVERLOADING
staticPadTemplate_nameTemplate ,
#endif
getStaticPadTemplatePresence ,
setStaticPadTemplatePresence ,
#if ENABLE_OVERLOADING
staticPadTemplate_presence ,
#endif
getStaticPadTemplateStaticCaps ,
#if ENABLE_OVERLOADING
staticPadTemplate_staticCaps ,
#endif
) 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.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
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 GHC.OverloadedLabels as OL
import {-# SOURCE #-} qualified GI.Gst.Enums as Gst.Enums
import {-# SOURCE #-} qualified GI.Gst.Objects.PadTemplate as Gst.PadTemplate
import {-# SOURCE #-} qualified GI.Gst.Structs.Caps as Gst.Caps
import {-# SOURCE #-} qualified GI.Gst.Structs.StaticCaps as Gst.StaticCaps
newtype StaticPadTemplate = StaticPadTemplate (ManagedPtr StaticPadTemplate)
instance WrappedPtr StaticPadTemplate where
wrappedPtrCalloc = callocBytes 64
wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 64 >=> wrapPtr StaticPadTemplate)
wrappedPtrFree = Just ptr_to_g_free
newZeroStaticPadTemplate :: MonadIO m => m StaticPadTemplate
newZeroStaticPadTemplate = liftIO $ wrappedPtrCalloc >>= wrapPtr StaticPadTemplate
instance tag ~ 'AttrSet => Constructible StaticPadTemplate tag where
new _ attrs = do
o <- newZeroStaticPadTemplate
GI.Attributes.set o attrs
return o
noStaticPadTemplate :: Maybe StaticPadTemplate
noStaticPadTemplate = Nothing
getStaticPadTemplateNameTemplate :: MonadIO m => StaticPadTemplate -> m (Maybe T.Text)
getStaticPadTemplateNameTemplate s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO CString
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- cstringToText val'
return val''
return result
setStaticPadTemplateNameTemplate :: MonadIO m => StaticPadTemplate -> CString -> m ()
setStaticPadTemplateNameTemplate s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (val :: CString)
clearStaticPadTemplateNameTemplate :: MonadIO m => StaticPadTemplate -> m ()
clearStaticPadTemplateNameTemplate s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (FP.nullPtr :: CString)
#if ENABLE_OVERLOADING
data StaticPadTemplateNameTemplateFieldInfo
instance AttrInfo StaticPadTemplateNameTemplateFieldInfo where
type AttrAllowedOps StaticPadTemplateNameTemplateFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint StaticPadTemplateNameTemplateFieldInfo = (~) CString
type AttrBaseTypeConstraint StaticPadTemplateNameTemplateFieldInfo = (~) StaticPadTemplate
type AttrGetType StaticPadTemplateNameTemplateFieldInfo = Maybe T.Text
type AttrLabel StaticPadTemplateNameTemplateFieldInfo = "name_template"
type AttrOrigin StaticPadTemplateNameTemplateFieldInfo = StaticPadTemplate
attrGet _ = getStaticPadTemplateNameTemplate
attrSet _ = setStaticPadTemplateNameTemplate
attrConstruct = undefined
attrClear _ = clearStaticPadTemplateNameTemplate
staticPadTemplate_nameTemplate :: AttrLabelProxy "nameTemplate"
staticPadTemplate_nameTemplate = AttrLabelProxy
#endif
getStaticPadTemplateDirection :: MonadIO m => StaticPadTemplate -> m Gst.Enums.PadDirection
getStaticPadTemplateDirection s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO CUInt
let val' = (toEnum . fromIntegral) val
return val'
setStaticPadTemplateDirection :: MonadIO m => StaticPadTemplate -> Gst.Enums.PadDirection -> m ()
setStaticPadTemplateDirection s val = liftIO $ withManagedPtr s $ \ptr -> do
let val' = (fromIntegral . fromEnum) val
poke (ptr `plusPtr` 8) (val' :: CUInt)
#if ENABLE_OVERLOADING
data StaticPadTemplateDirectionFieldInfo
instance AttrInfo StaticPadTemplateDirectionFieldInfo where
type AttrAllowedOps StaticPadTemplateDirectionFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint StaticPadTemplateDirectionFieldInfo = (~) Gst.Enums.PadDirection
type AttrBaseTypeConstraint StaticPadTemplateDirectionFieldInfo = (~) StaticPadTemplate
type AttrGetType StaticPadTemplateDirectionFieldInfo = Gst.Enums.PadDirection
type AttrLabel StaticPadTemplateDirectionFieldInfo = "direction"
type AttrOrigin StaticPadTemplateDirectionFieldInfo = StaticPadTemplate
attrGet _ = getStaticPadTemplateDirection
attrSet _ = setStaticPadTemplateDirection
attrConstruct = undefined
attrClear _ = undefined
staticPadTemplate_direction :: AttrLabelProxy "direction"
staticPadTemplate_direction = AttrLabelProxy
#endif
getStaticPadTemplatePresence :: MonadIO m => StaticPadTemplate -> m Gst.Enums.PadPresence
getStaticPadTemplatePresence s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 12) :: IO CUInt
let val' = (toEnum . fromIntegral) val
return val'
setStaticPadTemplatePresence :: MonadIO m => StaticPadTemplate -> Gst.Enums.PadPresence -> m ()
setStaticPadTemplatePresence s val = liftIO $ withManagedPtr s $ \ptr -> do
let val' = (fromIntegral . fromEnum) val
poke (ptr `plusPtr` 12) (val' :: CUInt)
#if ENABLE_OVERLOADING
data StaticPadTemplatePresenceFieldInfo
instance AttrInfo StaticPadTemplatePresenceFieldInfo where
type AttrAllowedOps StaticPadTemplatePresenceFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint StaticPadTemplatePresenceFieldInfo = (~) Gst.Enums.PadPresence
type AttrBaseTypeConstraint StaticPadTemplatePresenceFieldInfo = (~) StaticPadTemplate
type AttrGetType StaticPadTemplatePresenceFieldInfo = Gst.Enums.PadPresence
type AttrLabel StaticPadTemplatePresenceFieldInfo = "presence"
type AttrOrigin StaticPadTemplatePresenceFieldInfo = StaticPadTemplate
attrGet _ = getStaticPadTemplatePresence
attrSet _ = setStaticPadTemplatePresence
attrConstruct = undefined
attrClear _ = undefined
staticPadTemplate_presence :: AttrLabelProxy "presence"
staticPadTemplate_presence = AttrLabelProxy
#endif
getStaticPadTemplateStaticCaps :: MonadIO m => StaticPadTemplate -> m Gst.StaticCaps.StaticCaps
getStaticPadTemplateStaticCaps s = liftIO $ withManagedPtr s $ \ptr -> do
let val = ptr `plusPtr` 16 :: (Ptr Gst.StaticCaps.StaticCaps)
val' <- (newPtr Gst.StaticCaps.StaticCaps) val
return val'
#if ENABLE_OVERLOADING
data StaticPadTemplateStaticCapsFieldInfo
instance AttrInfo StaticPadTemplateStaticCapsFieldInfo where
type AttrAllowedOps StaticPadTemplateStaticCapsFieldInfo = '[ 'AttrGet]
type AttrSetTypeConstraint StaticPadTemplateStaticCapsFieldInfo = (~) (Ptr Gst.StaticCaps.StaticCaps)
type AttrBaseTypeConstraint StaticPadTemplateStaticCapsFieldInfo = (~) StaticPadTemplate
type AttrGetType StaticPadTemplateStaticCapsFieldInfo = Gst.StaticCaps.StaticCaps
type AttrLabel StaticPadTemplateStaticCapsFieldInfo = "static_caps"
type AttrOrigin StaticPadTemplateStaticCapsFieldInfo = StaticPadTemplate
attrGet _ = getStaticPadTemplateStaticCaps
attrSet _ = undefined
attrConstruct = undefined
attrClear _ = undefined
staticPadTemplate_staticCaps :: AttrLabelProxy "staticCaps"
staticPadTemplate_staticCaps = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList StaticPadTemplate
type instance O.AttributeList StaticPadTemplate = StaticPadTemplateAttributeList
type StaticPadTemplateAttributeList = ('[ '("nameTemplate", StaticPadTemplateNameTemplateFieldInfo), '("direction", StaticPadTemplateDirectionFieldInfo), '("presence", StaticPadTemplatePresenceFieldInfo), '("staticCaps", StaticPadTemplateStaticCapsFieldInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "gst_static_pad_template_get" gst_static_pad_template_get ::
Ptr StaticPadTemplate ->
IO (Ptr Gst.PadTemplate.PadTemplate)
staticPadTemplateGet ::
(B.CallStack.HasCallStack, MonadIO m) =>
StaticPadTemplate
-> m (Maybe Gst.PadTemplate.PadTemplate)
staticPadTemplateGet padTemplate = liftIO $ do
padTemplate' <- unsafeManagedPtrGetPtr padTemplate
result <- gst_static_pad_template_get padTemplate'
maybeResult <- convertIfNonNull result $ \result' -> do
result'' <- (newObject Gst.PadTemplate.PadTemplate) result'
return result''
touchManagedPtr padTemplate
return maybeResult
#if ENABLE_OVERLOADING
data StaticPadTemplateGetMethodInfo
instance (signature ~ (m (Maybe Gst.PadTemplate.PadTemplate)), MonadIO m) => O.MethodInfo StaticPadTemplateGetMethodInfo StaticPadTemplate signature where
overloadedMethod _ = staticPadTemplateGet
#endif
foreign import ccall "gst_static_pad_template_get_caps" gst_static_pad_template_get_caps ::
Ptr StaticPadTemplate ->
IO (Ptr Gst.Caps.Caps)
staticPadTemplateGetCaps ::
(B.CallStack.HasCallStack, MonadIO m) =>
StaticPadTemplate
-> m Gst.Caps.Caps
staticPadTemplateGetCaps templ = liftIO $ do
templ' <- unsafeManagedPtrGetPtr templ
result <- gst_static_pad_template_get_caps templ'
checkUnexpectedReturnNULL "staticPadTemplateGetCaps" result
result' <- (wrapBoxed Gst.Caps.Caps) result
touchManagedPtr templ
return result'
#if ENABLE_OVERLOADING
data StaticPadTemplateGetCapsMethodInfo
instance (signature ~ (m Gst.Caps.Caps), MonadIO m) => O.MethodInfo StaticPadTemplateGetCapsMethodInfo StaticPadTemplate signature where
overloadedMethod _ = staticPadTemplateGetCaps
#endif
#if ENABLE_OVERLOADING
type family ResolveStaticPadTemplateMethod (t :: Symbol) (o :: *) :: * where
ResolveStaticPadTemplateMethod "get" o = StaticPadTemplateGetMethodInfo
ResolveStaticPadTemplateMethod "getCaps" o = StaticPadTemplateGetCapsMethodInfo
ResolveStaticPadTemplateMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveStaticPadTemplateMethod t StaticPadTemplate, O.MethodInfo info StaticPadTemplate p) => OL.IsLabel t (StaticPadTemplate -> 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