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

Pads managed by a @/GstAggregor/@ subclass.

This class used to live in gst-plugins-bad and was moved to core.

/Since: 1.14/
-}

#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
       && !defined(__HADDOCK_VERSION__))

module GI.GstBase.Objects.AggregatorPad
    (

-- * Exported types
    AggregatorPad(..)                       ,
    IsAggregatorPad                         ,
    toAggregatorPad                         ,
    noAggregatorPad                         ,


 -- * Methods
-- ** dropBuffer #method:dropBuffer#

#if ENABLE_OVERLOADING
    AggregatorPadDropBufferMethodInfo       ,
#endif
    aggregatorPadDropBuffer                 ,


-- ** hasBuffer #method:hasBuffer#

#if ENABLE_OVERLOADING
    AggregatorPadHasBufferMethodInfo        ,
#endif
    aggregatorPadHasBuffer                  ,


-- ** isEos #method:isEos#

#if ENABLE_OVERLOADING
    AggregatorPadIsEosMethodInfo            ,
#endif
    aggregatorPadIsEos                      ,


-- ** peekBuffer #method:peekBuffer#

#if ENABLE_OVERLOADING
    AggregatorPadPeekBufferMethodInfo       ,
#endif
    aggregatorPadPeekBuffer                 ,


-- ** popBuffer #method:popBuffer#

#if ENABLE_OVERLOADING
    AggregatorPadPopBufferMethodInfo        ,
#endif
    aggregatorPadPopBuffer                  ,




 -- * Properties
-- ** emitSignals #attr:emitSignals#
{- | Enables the emission of signals such as 'GI.GstBase.Objects.AggregatorPad.AggregatorPad'::@/buffer-consumed/@

/Since: 1.16/
-}
#if ENABLE_OVERLOADING
    AggregatorPadEmitSignalsPropertyInfo    ,
#endif
#if ENABLE_OVERLOADING
    aggregatorPadEmitSignals                ,
#endif
    constructAggregatorPadEmitSignals       ,
    getAggregatorPadEmitSignals             ,
    setAggregatorPadEmitSignals             ,




 -- * Signals
-- ** bufferConsumed #signal:bufferConsumed#

    AggregatorPadBufferConsumedCallback     ,
#if ENABLE_OVERLOADING
    AggregatorPadBufferConsumedSignalInfo   ,
#endif
    C_AggregatorPadBufferConsumedCallback   ,
    afterAggregatorPadBufferConsumed        ,
    genClosure_AggregatorPadBufferConsumed  ,
    mk_AggregatorPadBufferConsumedCallback  ,
    noAggregatorPadBufferConsumedCallback   ,
    onAggregatorPadBufferConsumed           ,
    wrap_AggregatorPadBufferConsumedCallback,




    ) 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 qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gst.Objects.Object as Gst.Object
import qualified GI.Gst.Objects.Pad as Gst.Pad
import qualified GI.Gst.Structs.Buffer as Gst.Buffer

-- | Memory-managed wrapper type.
newtype AggregatorPad = AggregatorPad (ManagedPtr AggregatorPad)
foreign import ccall "gst_aggregator_pad_get_type"
    c_gst_aggregator_pad_get_type :: IO GType

instance GObject AggregatorPad where
    gobjectType = c_gst_aggregator_pad_get_type


-- | Type class for types which can be safely cast to `AggregatorPad`, for instance with `toAggregatorPad`.
class (GObject o, O.IsDescendantOf AggregatorPad o) => IsAggregatorPad o
instance (GObject o, O.IsDescendantOf AggregatorPad o) => IsAggregatorPad o

instance O.HasParentTypes AggregatorPad
type instance O.ParentTypes AggregatorPad = '[Gst.Pad.Pad, Gst.Object.Object, GObject.Object.Object]

-- | Cast to `AggregatorPad`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toAggregatorPad :: (MonadIO m, IsAggregatorPad o) => o -> m AggregatorPad
toAggregatorPad = liftIO . unsafeCastTo AggregatorPad

-- | A convenience alias for `Nothing` :: `Maybe` `AggregatorPad`.
noAggregatorPad :: Maybe AggregatorPad
noAggregatorPad = Nothing

#if ENABLE_OVERLOADING
type family ResolveAggregatorPadMethod (t :: Symbol) (o :: *) :: * where
    ResolveAggregatorPadMethod "activateMode" o = Gst.Pad.PadActivateModeMethodInfo
    ResolveAggregatorPadMethod "addControlBinding" o = Gst.Object.ObjectAddControlBindingMethodInfo
    ResolveAggregatorPadMethod "addProbe" o = Gst.Pad.PadAddProbeMethodInfo
    ResolveAggregatorPadMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveAggregatorPadMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveAggregatorPadMethod "canLink" o = Gst.Pad.PadCanLinkMethodInfo
    ResolveAggregatorPadMethod "chain" o = Gst.Pad.PadChainMethodInfo
    ResolveAggregatorPadMethod "chainList" o = Gst.Pad.PadChainListMethodInfo
    ResolveAggregatorPadMethod "checkReconfigure" o = Gst.Pad.PadCheckReconfigureMethodInfo
    ResolveAggregatorPadMethod "createStreamId" o = Gst.Pad.PadCreateStreamIdMethodInfo
    ResolveAggregatorPadMethod "defaultError" o = Gst.Object.ObjectDefaultErrorMethodInfo
    ResolveAggregatorPadMethod "dropBuffer" o = AggregatorPadDropBufferMethodInfo
    ResolveAggregatorPadMethod "eventDefault" o = Gst.Pad.PadEventDefaultMethodInfo
    ResolveAggregatorPadMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveAggregatorPadMethod "forward" o = Gst.Pad.PadForwardMethodInfo
    ResolveAggregatorPadMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveAggregatorPadMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveAggregatorPadMethod "hasActiveControlBindings" o = Gst.Object.ObjectHasActiveControlBindingsMethodInfo
    ResolveAggregatorPadMethod "hasAncestor" o = Gst.Object.ObjectHasAncestorMethodInfo
    ResolveAggregatorPadMethod "hasAsAncestor" o = Gst.Object.ObjectHasAsAncestorMethodInfo
    ResolveAggregatorPadMethod "hasAsParent" o = Gst.Object.ObjectHasAsParentMethodInfo
    ResolveAggregatorPadMethod "hasBuffer" o = AggregatorPadHasBufferMethodInfo
    ResolveAggregatorPadMethod "hasCurrentCaps" o = Gst.Pad.PadHasCurrentCapsMethodInfo
    ResolveAggregatorPadMethod "isActive" o = Gst.Pad.PadIsActiveMethodInfo
    ResolveAggregatorPadMethod "isBlocked" o = Gst.Pad.PadIsBlockedMethodInfo
    ResolveAggregatorPadMethod "isBlocking" o = Gst.Pad.PadIsBlockingMethodInfo
    ResolveAggregatorPadMethod "isEos" o = AggregatorPadIsEosMethodInfo
    ResolveAggregatorPadMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveAggregatorPadMethod "isLinked" o = Gst.Pad.PadIsLinkedMethodInfo
    ResolveAggregatorPadMethod "iterateInternalLinks" o = Gst.Pad.PadIterateInternalLinksMethodInfo
    ResolveAggregatorPadMethod "iterateInternalLinksDefault" o = Gst.Pad.PadIterateInternalLinksDefaultMethodInfo
    ResolveAggregatorPadMethod "link" o = Gst.Pad.PadLinkMethodInfo
    ResolveAggregatorPadMethod "linkFull" o = Gst.Pad.PadLinkFullMethodInfo
    ResolveAggregatorPadMethod "linkMaybeGhosting" o = Gst.Pad.PadLinkMaybeGhostingMethodInfo
    ResolveAggregatorPadMethod "linkMaybeGhostingFull" o = Gst.Pad.PadLinkMaybeGhostingFullMethodInfo
    ResolveAggregatorPadMethod "markReconfigure" o = Gst.Pad.PadMarkReconfigureMethodInfo
    ResolveAggregatorPadMethod "needsReconfigure" o = Gst.Pad.PadNeedsReconfigureMethodInfo
    ResolveAggregatorPadMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveAggregatorPadMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveAggregatorPadMethod "pauseTask" o = Gst.Pad.PadPauseTaskMethodInfo
    ResolveAggregatorPadMethod "peekBuffer" o = AggregatorPadPeekBufferMethodInfo
    ResolveAggregatorPadMethod "peerQuery" o = Gst.Pad.PadPeerQueryMethodInfo
    ResolveAggregatorPadMethod "peerQueryAcceptCaps" o = Gst.Pad.PadPeerQueryAcceptCapsMethodInfo
    ResolveAggregatorPadMethod "peerQueryCaps" o = Gst.Pad.PadPeerQueryCapsMethodInfo
    ResolveAggregatorPadMethod "peerQueryConvert" o = Gst.Pad.PadPeerQueryConvertMethodInfo
    ResolveAggregatorPadMethod "peerQueryDuration" o = Gst.Pad.PadPeerQueryDurationMethodInfo
    ResolveAggregatorPadMethod "peerQueryPosition" o = Gst.Pad.PadPeerQueryPositionMethodInfo
    ResolveAggregatorPadMethod "popBuffer" o = AggregatorPadPopBufferMethodInfo
    ResolveAggregatorPadMethod "proxyQueryAcceptCaps" o = Gst.Pad.PadProxyQueryAcceptCapsMethodInfo
    ResolveAggregatorPadMethod "proxyQueryCaps" o = Gst.Pad.PadProxyQueryCapsMethodInfo
    ResolveAggregatorPadMethod "pullRange" o = Gst.Pad.PadPullRangeMethodInfo
    ResolveAggregatorPadMethod "push" o = Gst.Pad.PadPushMethodInfo
    ResolveAggregatorPadMethod "pushEvent" o = Gst.Pad.PadPushEventMethodInfo
    ResolveAggregatorPadMethod "pushList" o = Gst.Pad.PadPushListMethodInfo
    ResolveAggregatorPadMethod "query" o = Gst.Pad.PadQueryMethodInfo
    ResolveAggregatorPadMethod "queryAcceptCaps" o = Gst.Pad.PadQueryAcceptCapsMethodInfo
    ResolveAggregatorPadMethod "queryCaps" o = Gst.Pad.PadQueryCapsMethodInfo
    ResolveAggregatorPadMethod "queryConvert" o = Gst.Pad.PadQueryConvertMethodInfo
    ResolveAggregatorPadMethod "queryDefault" o = Gst.Pad.PadQueryDefaultMethodInfo
    ResolveAggregatorPadMethod "queryDuration" o = Gst.Pad.PadQueryDurationMethodInfo
    ResolveAggregatorPadMethod "queryPosition" o = Gst.Pad.PadQueryPositionMethodInfo
    ResolveAggregatorPadMethod "ref" o = Gst.Object.ObjectRefMethodInfo
    ResolveAggregatorPadMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveAggregatorPadMethod "removeControlBinding" o = Gst.Object.ObjectRemoveControlBindingMethodInfo
    ResolveAggregatorPadMethod "removeProbe" o = Gst.Pad.PadRemoveProbeMethodInfo
    ResolveAggregatorPadMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveAggregatorPadMethod "sendEvent" o = Gst.Pad.PadSendEventMethodInfo
    ResolveAggregatorPadMethod "startTask" o = Gst.Pad.PadStartTaskMethodInfo
    ResolveAggregatorPadMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveAggregatorPadMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveAggregatorPadMethod "stickyEventsForeach" o = Gst.Pad.PadStickyEventsForeachMethodInfo
    ResolveAggregatorPadMethod "stopTask" o = Gst.Pad.PadStopTaskMethodInfo
    ResolveAggregatorPadMethod "storeStickyEvent" o = Gst.Pad.PadStoreStickyEventMethodInfo
    ResolveAggregatorPadMethod "suggestNextSync" o = Gst.Object.ObjectSuggestNextSyncMethodInfo
    ResolveAggregatorPadMethod "syncValues" o = Gst.Object.ObjectSyncValuesMethodInfo
    ResolveAggregatorPadMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveAggregatorPadMethod "unlink" o = Gst.Pad.PadUnlinkMethodInfo
    ResolveAggregatorPadMethod "unparent" o = Gst.Object.ObjectUnparentMethodInfo
    ResolveAggregatorPadMethod "unref" o = Gst.Object.ObjectUnrefMethodInfo
    ResolveAggregatorPadMethod "useFixedCaps" o = Gst.Pad.PadUseFixedCapsMethodInfo
    ResolveAggregatorPadMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveAggregatorPadMethod "getAllowedCaps" o = Gst.Pad.PadGetAllowedCapsMethodInfo
    ResolveAggregatorPadMethod "getControlBinding" o = Gst.Object.ObjectGetControlBindingMethodInfo
    ResolveAggregatorPadMethod "getControlRate" o = Gst.Object.ObjectGetControlRateMethodInfo
    ResolveAggregatorPadMethod "getCurrentCaps" o = Gst.Pad.PadGetCurrentCapsMethodInfo
    ResolveAggregatorPadMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveAggregatorPadMethod "getDirection" o = Gst.Pad.PadGetDirectionMethodInfo
    ResolveAggregatorPadMethod "getElementPrivate" o = Gst.Pad.PadGetElementPrivateMethodInfo
    ResolveAggregatorPadMethod "getGValueArray" o = Gst.Object.ObjectGetGValueArrayMethodInfo
    ResolveAggregatorPadMethod "getLastFlowReturn" o = Gst.Pad.PadGetLastFlowReturnMethodInfo
    ResolveAggregatorPadMethod "getName" o = Gst.Object.ObjectGetNameMethodInfo
    ResolveAggregatorPadMethod "getOffset" o = Gst.Pad.PadGetOffsetMethodInfo
    ResolveAggregatorPadMethod "getPadTemplate" o = Gst.Pad.PadGetPadTemplateMethodInfo
    ResolveAggregatorPadMethod "getPadTemplateCaps" o = Gst.Pad.PadGetPadTemplateCapsMethodInfo
    ResolveAggregatorPadMethod "getParent" o = Gst.Object.ObjectGetParentMethodInfo
    ResolveAggregatorPadMethod "getParentElement" o = Gst.Pad.PadGetParentElementMethodInfo
    ResolveAggregatorPadMethod "getPathString" o = Gst.Object.ObjectGetPathStringMethodInfo
    ResolveAggregatorPadMethod "getPeer" o = Gst.Pad.PadGetPeerMethodInfo
    ResolveAggregatorPadMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveAggregatorPadMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveAggregatorPadMethod "getRange" o = Gst.Pad.PadGetRangeMethodInfo
    ResolveAggregatorPadMethod "getStickyEvent" o = Gst.Pad.PadGetStickyEventMethodInfo
    ResolveAggregatorPadMethod "getStream" o = Gst.Pad.PadGetStreamMethodInfo
    ResolveAggregatorPadMethod "getStreamId" o = Gst.Pad.PadGetStreamIdMethodInfo
    ResolveAggregatorPadMethod "getTaskState" o = Gst.Pad.PadGetTaskStateMethodInfo
    ResolveAggregatorPadMethod "getValue" o = Gst.Object.ObjectGetValueMethodInfo
    ResolveAggregatorPadMethod "setActivateFunctionFull" o = Gst.Pad.PadSetActivateFunctionFullMethodInfo
    ResolveAggregatorPadMethod "setActivatemodeFunctionFull" o = Gst.Pad.PadSetActivatemodeFunctionFullMethodInfo
    ResolveAggregatorPadMethod "setActive" o = Gst.Pad.PadSetActiveMethodInfo
    ResolveAggregatorPadMethod "setChainFunctionFull" o = Gst.Pad.PadSetChainFunctionFullMethodInfo
    ResolveAggregatorPadMethod "setChainListFunctionFull" o = Gst.Pad.PadSetChainListFunctionFullMethodInfo
    ResolveAggregatorPadMethod "setControlBindingDisabled" o = Gst.Object.ObjectSetControlBindingDisabledMethodInfo
    ResolveAggregatorPadMethod "setControlBindingsDisabled" o = Gst.Object.ObjectSetControlBindingsDisabledMethodInfo
    ResolveAggregatorPadMethod "setControlRate" o = Gst.Object.ObjectSetControlRateMethodInfo
    ResolveAggregatorPadMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveAggregatorPadMethod "setElementPrivate" o = Gst.Pad.PadSetElementPrivateMethodInfo
    ResolveAggregatorPadMethod "setEventFullFunctionFull" o = Gst.Pad.PadSetEventFullFunctionFullMethodInfo
    ResolveAggregatorPadMethod "setEventFunctionFull" o = Gst.Pad.PadSetEventFunctionFullMethodInfo
    ResolveAggregatorPadMethod "setGetrangeFunctionFull" o = Gst.Pad.PadSetGetrangeFunctionFullMethodInfo
    ResolveAggregatorPadMethod "setIterateInternalLinksFunctionFull" o = Gst.Pad.PadSetIterateInternalLinksFunctionFullMethodInfo
    ResolveAggregatorPadMethod "setLinkFunctionFull" o = Gst.Pad.PadSetLinkFunctionFullMethodInfo
    ResolveAggregatorPadMethod "setName" o = Gst.Object.ObjectSetNameMethodInfo
    ResolveAggregatorPadMethod "setOffset" o = Gst.Pad.PadSetOffsetMethodInfo
    ResolveAggregatorPadMethod "setParent" o = Gst.Object.ObjectSetParentMethodInfo
    ResolveAggregatorPadMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveAggregatorPadMethod "setQueryFunctionFull" o = Gst.Pad.PadSetQueryFunctionFullMethodInfo
    ResolveAggregatorPadMethod "setUnlinkFunctionFull" o = Gst.Pad.PadSetUnlinkFunctionFullMethodInfo
    ResolveAggregatorPadMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveAggregatorPadMethod t AggregatorPad, O.MethodInfo info AggregatorPad p) => OL.IsLabel t (AggregatorPad -> 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

-- signal AggregatorPad::buffer-consumed
{- |
/No description available in the introspection data./
-}
type AggregatorPadBufferConsumedCallback =
    Gst.Buffer.Buffer
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `AggregatorPadBufferConsumedCallback`@.
noAggregatorPadBufferConsumedCallback :: Maybe AggregatorPadBufferConsumedCallback
noAggregatorPadBufferConsumedCallback = Nothing

-- | Type for the callback on the (unwrapped) C side.
type C_AggregatorPadBufferConsumedCallback =
    Ptr () ->                               -- object
    Ptr Gst.Buffer.Buffer ->
    Ptr () ->                               -- user_data
    IO ()

-- | Generate a function pointer callable from C code, from a `C_AggregatorPadBufferConsumedCallback`.
foreign import ccall "wrapper"
    mk_AggregatorPadBufferConsumedCallback :: C_AggregatorPadBufferConsumedCallback -> IO (FunPtr C_AggregatorPadBufferConsumedCallback)

-- | Wrap the callback into a `GClosure`.
genClosure_AggregatorPadBufferConsumed :: MonadIO m => AggregatorPadBufferConsumedCallback -> m (GClosure C_AggregatorPadBufferConsumedCallback)
genClosure_AggregatorPadBufferConsumed cb = liftIO $ do
    let cb' = wrap_AggregatorPadBufferConsumedCallback cb
    mk_AggregatorPadBufferConsumedCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `AggregatorPadBufferConsumedCallback` into a `C_AggregatorPadBufferConsumedCallback`.
wrap_AggregatorPadBufferConsumedCallback ::
    AggregatorPadBufferConsumedCallback ->
    C_AggregatorPadBufferConsumedCallback
wrap_AggregatorPadBufferConsumedCallback _cb _ object _ = do
    B.ManagedPtr.withTransient Gst.Buffer.Buffer object $ \object' -> do
        _cb  object'


{- |
Connect a signal handler for the “@buffer-consumed@” signal, to be run before the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.on' aggregatorPad #bufferConsumed callback
@
-}
onAggregatorPadBufferConsumed :: (IsAggregatorPad a, MonadIO m) => a -> AggregatorPadBufferConsumedCallback -> m SignalHandlerId
onAggregatorPadBufferConsumed obj cb = liftIO $ do
    let cb' = wrap_AggregatorPadBufferConsumedCallback cb
    cb'' <- mk_AggregatorPadBufferConsumedCallback cb'
    connectSignalFunPtr obj "buffer-consumed" cb'' SignalConnectBefore

{- |
Connect a signal handler for the “@buffer-consumed@” signal, to be run after the default handler.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Signals.after' aggregatorPad #bufferConsumed callback
@
-}
afterAggregatorPadBufferConsumed :: (IsAggregatorPad a, MonadIO m) => a -> AggregatorPadBufferConsumedCallback -> m SignalHandlerId
afterAggregatorPadBufferConsumed obj cb = liftIO $ do
    let cb' = wrap_AggregatorPadBufferConsumedCallback cb
    cb'' <- mk_AggregatorPadBufferConsumedCallback cb'
    connectSignalFunPtr obj "buffer-consumed" cb'' SignalConnectAfter


-- VVV Prop "emit-signals"
   -- Type: TBasicType TBoolean
   -- Flags: [PropertyReadable,PropertyWritable]
   -- Nullable: (Nothing,Nothing)

{- |
Get the value of the “@emit-signals@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.get' aggregatorPad #emitSignals
@
-}
getAggregatorPadEmitSignals :: (MonadIO m, IsAggregatorPad o) => o -> m Bool
getAggregatorPadEmitSignals obj = liftIO $ B.Properties.getObjectPropertyBool obj "emit-signals"

{- |
Set the value of the “@emit-signals@” property.
When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to

@
'Data.GI.Base.Attributes.set' aggregatorPad [ #emitSignals 'Data.GI.Base.Attributes.:=' value ]
@
-}
setAggregatorPadEmitSignals :: (MonadIO m, IsAggregatorPad o) => o -> Bool -> m ()
setAggregatorPadEmitSignals obj val = liftIO $ B.Properties.setObjectPropertyBool obj "emit-signals" val

{- |
Construct a `GValueConstruct` with valid value for the “@emit-signals@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
-}
constructAggregatorPadEmitSignals :: (IsAggregatorPad o) => Bool -> IO (GValueConstruct o)
constructAggregatorPadEmitSignals val = B.Properties.constructObjectPropertyBool "emit-signals" val

#if ENABLE_OVERLOADING
data AggregatorPadEmitSignalsPropertyInfo
instance AttrInfo AggregatorPadEmitSignalsPropertyInfo where
    type AttrAllowedOps AggregatorPadEmitSignalsPropertyInfo = '[ 'AttrSet, 'AttrConstruct, 'AttrGet]
    type AttrSetTypeConstraint AggregatorPadEmitSignalsPropertyInfo = (~) Bool
    type AttrBaseTypeConstraint AggregatorPadEmitSignalsPropertyInfo = IsAggregatorPad
    type AttrGetType AggregatorPadEmitSignalsPropertyInfo = Bool
    type AttrLabel AggregatorPadEmitSignalsPropertyInfo = "emit-signals"
    type AttrOrigin AggregatorPadEmitSignalsPropertyInfo = AggregatorPad
    attrGet _ = getAggregatorPadEmitSignals
    attrSet _ = setAggregatorPadEmitSignals
    attrConstruct _ = constructAggregatorPadEmitSignals
    attrClear _ = undefined
#endif

#if ENABLE_OVERLOADING
instance O.HasAttributeList AggregatorPad
type instance O.AttributeList AggregatorPad = AggregatorPadAttributeList
type AggregatorPadAttributeList = ('[ '("caps", Gst.Pad.PadCapsPropertyInfo), '("direction", Gst.Pad.PadDirectionPropertyInfo), '("emitSignals", AggregatorPadEmitSignalsPropertyInfo), '("name", Gst.Object.ObjectNamePropertyInfo), '("offset", Gst.Pad.PadOffsetPropertyInfo), '("parent", Gst.Object.ObjectParentPropertyInfo), '("template", Gst.Pad.PadTemplatePropertyInfo)] :: [(Symbol, *)])
#endif

#if ENABLE_OVERLOADING
aggregatorPadEmitSignals :: AttrLabelProxy "emitSignals"
aggregatorPadEmitSignals = AttrLabelProxy

#endif

#if ENABLE_OVERLOADING
data AggregatorPadBufferConsumedSignalInfo
instance SignalInfo AggregatorPadBufferConsumedSignalInfo where
    type HaskellCallbackType AggregatorPadBufferConsumedSignalInfo = AggregatorPadBufferConsumedCallback
    connectSignal _ obj cb connectMode = do
        let cb' = wrap_AggregatorPadBufferConsumedCallback cb
        cb'' <- mk_AggregatorPadBufferConsumedCallback cb'
        connectSignalFunPtr obj "buffer-consumed" cb'' connectMode

type instance O.SignalList AggregatorPad = AggregatorPadSignalList
type AggregatorPadSignalList = ('[ '("bufferConsumed", AggregatorPadBufferConsumedSignalInfo), '("deepNotify", Gst.Object.ObjectDeepNotifySignalInfo), '("linked", Gst.Pad.PadLinkedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("unlinked", Gst.Pad.PadUnlinkedSignalInfo)] :: [(Symbol, *)])

#endif

-- method AggregatorPad::drop_buffer
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "pad", argType = TInterface (Name {namespace = "GstBase", name = "AggregatorPad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the pad where to drop any pending buffer", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gst_aggregator_pad_drop_buffer" gst_aggregator_pad_drop_buffer ::
    Ptr AggregatorPad ->                    -- pad : TInterface (Name {namespace = "GstBase", name = "AggregatorPad"})
    IO CInt

{- |
Drop the buffer currently queued in /@pad@/.
-}
aggregatorPadDropBuffer ::
    (B.CallStack.HasCallStack, MonadIO m, IsAggregatorPad a) =>
    a
    {- ^ /@pad@/: the pad where to drop any pending buffer -}
    -> m Bool
    {- ^ __Returns:__ TRUE if there was a buffer queued in /@pad@/, or FALSE if not. -}
aggregatorPadDropBuffer pad = liftIO $ do
    pad' <- unsafeManagedPtrCastPtr pad
    result <- gst_aggregator_pad_drop_buffer pad'
    let result' = (/= 0) result
    touchManagedPtr pad
    return result'

#if ENABLE_OVERLOADING
data AggregatorPadDropBufferMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAggregatorPad a) => O.MethodInfo AggregatorPadDropBufferMethodInfo a signature where
    overloadedMethod _ = aggregatorPadDropBuffer

#endif

-- method AggregatorPad::has_buffer
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "pad", argType = TInterface (Name {namespace = "GstBase", name = "AggregatorPad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the pad to check the buffer on", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gst_aggregator_pad_has_buffer" gst_aggregator_pad_has_buffer ::
    Ptr AggregatorPad ->                    -- pad : TInterface (Name {namespace = "GstBase", name = "AggregatorPad"})
    IO CInt

{- |
This checks if a pad has a buffer available that will be returned by
a call to 'GI.GstBase.Objects.AggregatorPad.aggregatorPadPeekBuffer' or
'GI.GstBase.Objects.AggregatorPad.aggregatorPadPopBuffer'.

/Since: 1.14.1/
-}
aggregatorPadHasBuffer ::
    (B.CallStack.HasCallStack, MonadIO m, IsAggregatorPad a) =>
    a
    {- ^ /@pad@/: the pad to check the buffer on -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the pad has a buffer available as the next thing. -}
aggregatorPadHasBuffer pad = liftIO $ do
    pad' <- unsafeManagedPtrCastPtr pad
    result <- gst_aggregator_pad_has_buffer pad'
    let result' = (/= 0) result
    touchManagedPtr pad
    return result'

#if ENABLE_OVERLOADING
data AggregatorPadHasBufferMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAggregatorPad a) => O.MethodInfo AggregatorPadHasBufferMethodInfo a signature where
    overloadedMethod _ = aggregatorPadHasBuffer

#endif

-- method AggregatorPad::is_eos
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "pad", argType = TInterface (Name {namespace = "GstBase", name = "AggregatorPad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "an aggregator pad", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gst_aggregator_pad_is_eos" gst_aggregator_pad_is_eos ::
    Ptr AggregatorPad ->                    -- pad : TInterface (Name {namespace = "GstBase", name = "AggregatorPad"})
    IO CInt

{- |
/No description available in the introspection data./
-}
aggregatorPadIsEos ::
    (B.CallStack.HasCallStack, MonadIO m, IsAggregatorPad a) =>
    a
    {- ^ /@pad@/: an aggregator pad -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the pad is EOS, otherwise 'False'. -}
aggregatorPadIsEos pad = liftIO $ do
    pad' <- unsafeManagedPtrCastPtr pad
    result <- gst_aggregator_pad_is_eos pad'
    let result' = (/= 0) result
    touchManagedPtr pad
    return result'

#if ENABLE_OVERLOADING
data AggregatorPadIsEosMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsAggregatorPad a) => O.MethodInfo AggregatorPadIsEosMethodInfo a signature where
    overloadedMethod _ = aggregatorPadIsEos

#endif

-- method AggregatorPad::peek_buffer
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "pad", argType = TInterface (Name {namespace = "GstBase", name = "AggregatorPad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the pad to get buffer from", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "Buffer"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_aggregator_pad_peek_buffer" gst_aggregator_pad_peek_buffer ::
    Ptr AggregatorPad ->                    -- pad : TInterface (Name {namespace = "GstBase", name = "AggregatorPad"})
    IO (Ptr Gst.Buffer.Buffer)

{- |
/No description available in the introspection data./
-}
aggregatorPadPeekBuffer ::
    (B.CallStack.HasCallStack, MonadIO m, IsAggregatorPad a) =>
    a
    {- ^ /@pad@/: the pad to get buffer from -}
    -> m Gst.Buffer.Buffer
    {- ^ __Returns:__ A reference to the buffer in /@pad@/ or
NULL if no buffer was queued. You should unref the buffer after
usage. -}
aggregatorPadPeekBuffer pad = liftIO $ do
    pad' <- unsafeManagedPtrCastPtr pad
    result <- gst_aggregator_pad_peek_buffer pad'
    checkUnexpectedReturnNULL "aggregatorPadPeekBuffer" result
    result' <- (wrapBoxed Gst.Buffer.Buffer) result
    touchManagedPtr pad
    return result'

#if ENABLE_OVERLOADING
data AggregatorPadPeekBufferMethodInfo
instance (signature ~ (m Gst.Buffer.Buffer), MonadIO m, IsAggregatorPad a) => O.MethodInfo AggregatorPadPeekBufferMethodInfo a signature where
    overloadedMethod _ = aggregatorPadPeekBuffer

#endif

-- method AggregatorPad::pop_buffer
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "pad", argType = TInterface (Name {namespace = "GstBase", name = "AggregatorPad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the pad to get buffer from", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "Buffer"}))
-- throws : False
-- Skip return : False

foreign import ccall "gst_aggregator_pad_pop_buffer" gst_aggregator_pad_pop_buffer ::
    Ptr AggregatorPad ->                    -- pad : TInterface (Name {namespace = "GstBase", name = "AggregatorPad"})
    IO (Ptr Gst.Buffer.Buffer)

{- |
Steal the ref to the buffer currently queued in /@pad@/.
-}
aggregatorPadPopBuffer ::
    (B.CallStack.HasCallStack, MonadIO m, IsAggregatorPad a) =>
    a
    {- ^ /@pad@/: the pad to get buffer from -}
    -> m Gst.Buffer.Buffer
    {- ^ __Returns:__ The buffer in /@pad@/ or NULL if no buffer was
  queued. You should unref the buffer after usage. -}
aggregatorPadPopBuffer pad = liftIO $ do
    pad' <- unsafeManagedPtrCastPtr pad
    result <- gst_aggregator_pad_pop_buffer pad'
    checkUnexpectedReturnNULL "aggregatorPadPopBuffer" result
    result' <- (wrapBoxed Gst.Buffer.Buffer) result
    touchManagedPtr pad
    return result'

#if ENABLE_OVERLOADING
data AggregatorPadPopBufferMethodInfo
instance (signature ~ (m Gst.Buffer.Buffer), MonadIO m, IsAggregatorPad a) => O.MethodInfo AggregatorPadPopBufferMethodInfo a signature where
    overloadedMethod _ = aggregatorPadPopBuffer

#endif