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

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

module GI.Gst.Callbacks
    (

 -- * Signals
-- ** BufferForeachMetaFunc #signal:BufferForeachMetaFunc#

    BufferForeachMetaFunc                   ,
    BufferForeachMetaFunc_WithClosures      ,
    C_BufferForeachMetaFunc                 ,
    drop_closures_BufferForeachMetaFunc     ,
    dynamic_BufferForeachMetaFunc           ,
    genClosure_BufferForeachMetaFunc        ,
    mk_BufferForeachMetaFunc                ,
    noBufferForeachMetaFunc                 ,
    noBufferForeachMetaFunc_WithClosures    ,
    wrap_BufferForeachMetaFunc              ,


-- ** BufferListFunc #signal:BufferListFunc#

    BufferListFunc                          ,
    BufferListFunc_WithClosures             ,
    C_BufferListFunc                        ,
    drop_closures_BufferListFunc            ,
    dynamic_BufferListFunc                  ,
    genClosure_BufferListFunc               ,
    mk_BufferListFunc                       ,
    noBufferListFunc                        ,
    noBufferListFunc_WithClosures           ,
    wrap_BufferListFunc                     ,


-- ** BusFunc #signal:BusFunc#

    BusFunc                                 ,
    BusFunc_WithClosures                    ,
    C_BusFunc                               ,
    drop_closures_BusFunc                   ,
    dynamic_BusFunc                         ,
    genClosure_BusFunc                      ,
    mk_BusFunc                              ,
    noBusFunc                               ,
    noBusFunc_WithClosures                  ,
    wrap_BusFunc                            ,


-- ** BusSyncHandler #signal:BusSyncHandler#

    BusSyncHandler                          ,
    BusSyncHandler_WithClosures             ,
    C_BusSyncHandler                        ,
    drop_closures_BusSyncHandler            ,
    dynamic_BusSyncHandler                  ,
    genClosure_BusSyncHandler               ,
    mk_BusSyncHandler                       ,
    noBusSyncHandler                        ,
    noBusSyncHandler_WithClosures           ,
    wrap_BusSyncHandler                     ,


-- ** CapsFilterMapFunc #signal:CapsFilterMapFunc#

    C_CapsFilterMapFunc                     ,
    CapsFilterMapFunc                       ,
    CapsFilterMapFunc_WithClosures          ,
    drop_closures_CapsFilterMapFunc         ,
    dynamic_CapsFilterMapFunc               ,
    genClosure_CapsFilterMapFunc            ,
    mk_CapsFilterMapFunc                    ,
    noCapsFilterMapFunc                     ,
    noCapsFilterMapFunc_WithClosures        ,
    wrap_CapsFilterMapFunc                  ,


-- ** CapsForeachFunc #signal:CapsForeachFunc#

    C_CapsForeachFunc                       ,
    CapsForeachFunc                         ,
    CapsForeachFunc_WithClosures            ,
    drop_closures_CapsForeachFunc           ,
    dynamic_CapsForeachFunc                 ,
    genClosure_CapsForeachFunc              ,
    mk_CapsForeachFunc                      ,
    noCapsForeachFunc                       ,
    noCapsForeachFunc_WithClosures          ,
    wrap_CapsForeachFunc                    ,


-- ** CapsMapFunc #signal:CapsMapFunc#

    C_CapsMapFunc                           ,
    CapsMapFunc                             ,
    CapsMapFunc_WithClosures                ,
    drop_closures_CapsMapFunc               ,
    dynamic_CapsMapFunc                     ,
    genClosure_CapsMapFunc                  ,
    mk_CapsMapFunc                          ,
    noCapsMapFunc                           ,
    noCapsMapFunc_WithClosures              ,
    wrap_CapsMapFunc                        ,


-- ** ClockCallback #signal:ClockCallback#

    C_ClockCallback                         ,
    ClockCallback                           ,
    ClockCallback_WithClosures              ,
    drop_closures_ClockCallback             ,
    dynamic_ClockCallback                   ,
    genClosure_ClockCallback                ,
    mk_ClockCallback                        ,
    noClockCallback                         ,
    noClockCallback_WithClosures            ,
    wrap_ClockCallback                      ,


-- ** ControlBindingConvert #signal:ControlBindingConvert#

    C_ControlBindingConvert                 ,
    ControlBindingConvert                   ,
    dynamic_ControlBindingConvert           ,
    genClosure_ControlBindingConvert        ,
    mk_ControlBindingConvert                ,
    noControlBindingConvert                 ,
    wrap_ControlBindingConvert              ,


-- ** ControlSourceGetValue #signal:ControlSourceGetValue#

    C_ControlSourceGetValue                 ,
    ControlSourceGetValue                   ,
    dynamic_ControlSourceGetValue           ,
    genClosure_ControlSourceGetValue        ,
    mk_ControlSourceGetValue                ,
    noControlSourceGetValue                 ,
    wrap_ControlSourceGetValue              ,


-- ** ControlSourceGetValueArray #signal:ControlSourceGetValueArray#

    C_ControlSourceGetValueArray            ,
    ControlSourceGetValueArray              ,
    dynamic_ControlSourceGetValueArray      ,
    genClosure_ControlSourceGetValueArray   ,
    mk_ControlSourceGetValueArray           ,
    noControlSourceGetValueArray            ,
    wrap_ControlSourceGetValueArray         ,


-- ** DebugFuncPtr #signal:DebugFuncPtr#

    C_DebugFuncPtr                          ,
    DebugFuncPtr                            ,
    dynamic_DebugFuncPtr                    ,
    genClosure_DebugFuncPtr                 ,
    mk_DebugFuncPtr                         ,
    noDebugFuncPtr                          ,
    wrap_DebugFuncPtr                       ,


-- ** ElementCallAsyncFunc #signal:ElementCallAsyncFunc#

    C_ElementCallAsyncFunc                  ,
    ElementCallAsyncFunc                    ,
    ElementCallAsyncFunc_WithClosures       ,
    drop_closures_ElementCallAsyncFunc      ,
    dynamic_ElementCallAsyncFunc            ,
    genClosure_ElementCallAsyncFunc         ,
    mk_ElementCallAsyncFunc                 ,
    noElementCallAsyncFunc                  ,
    noElementCallAsyncFunc_WithClosures     ,
    wrap_ElementCallAsyncFunc               ,


-- ** ElementForeachPadFunc #signal:ElementForeachPadFunc#

    C_ElementForeachPadFunc                 ,
    ElementForeachPadFunc                   ,
    ElementForeachPadFunc_WithClosures      ,
    drop_closures_ElementForeachPadFunc     ,
    dynamic_ElementForeachPadFunc           ,
    genClosure_ElementForeachPadFunc        ,
    mk_ElementForeachPadFunc                ,
    noElementForeachPadFunc                 ,
    noElementForeachPadFunc_WithClosures    ,
    wrap_ElementForeachPadFunc              ,


-- ** IteratorCopyFunction #signal:IteratorCopyFunction#

    C_IteratorCopyFunction                  ,
    IteratorCopyFunction                    ,
    dynamic_IteratorCopyFunction            ,
    genClosure_IteratorCopyFunction         ,
    mk_IteratorCopyFunction                 ,
    noIteratorCopyFunction                  ,
    wrap_IteratorCopyFunction               ,


-- ** IteratorFoldFunction #signal:IteratorFoldFunction#

    C_IteratorFoldFunction                  ,
    IteratorFoldFunction                    ,
    IteratorFoldFunction_WithClosures       ,
    drop_closures_IteratorFoldFunction      ,
    dynamic_IteratorFoldFunction            ,
    genClosure_IteratorFoldFunction         ,
    mk_IteratorFoldFunction                 ,
    noIteratorFoldFunction                  ,
    noIteratorFoldFunction_WithClosures     ,
    wrap_IteratorFoldFunction               ,


-- ** IteratorForeachFunction #signal:IteratorForeachFunction#

    C_IteratorForeachFunction               ,
    IteratorForeachFunction                 ,
    IteratorForeachFunction_WithClosures    ,
    drop_closures_IteratorForeachFunction   ,
    dynamic_IteratorForeachFunction         ,
    genClosure_IteratorForeachFunction      ,
    mk_IteratorForeachFunction              ,
    noIteratorForeachFunction               ,
    noIteratorForeachFunction_WithClosures  ,
    wrap_IteratorForeachFunction            ,


-- ** IteratorFreeFunction #signal:IteratorFreeFunction#

    C_IteratorFreeFunction                  ,
    IteratorFreeFunction                    ,
    dynamic_IteratorFreeFunction            ,
    genClosure_IteratorFreeFunction         ,
    mk_IteratorFreeFunction                 ,
    noIteratorFreeFunction                  ,
    wrap_IteratorFreeFunction               ,


-- ** IteratorItemFunction #signal:IteratorItemFunction#

    C_IteratorItemFunction                  ,
    IteratorItemFunction                    ,
    dynamic_IteratorItemFunction            ,
    genClosure_IteratorItemFunction         ,
    mk_IteratorItemFunction                 ,
    noIteratorItemFunction                  ,
    wrap_IteratorItemFunction               ,


-- ** IteratorNextFunction #signal:IteratorNextFunction#

    C_IteratorNextFunction                  ,
    IteratorNextFunction                    ,
    dynamic_IteratorNextFunction            ,
    genClosure_IteratorNextFunction         ,
    mk_IteratorNextFunction                 ,
    noIteratorNextFunction                  ,
    wrap_IteratorNextFunction               ,


-- ** IteratorResyncFunction #signal:IteratorResyncFunction#

    C_IteratorResyncFunction                ,
    IteratorResyncFunction                  ,
    dynamic_IteratorResyncFunction          ,
    genClosure_IteratorResyncFunction       ,
    mk_IteratorResyncFunction               ,
    noIteratorResyncFunction                ,
    wrap_IteratorResyncFunction             ,


-- ** LogFunction #signal:LogFunction#

    C_LogFunction                           ,
    LogFunction                             ,
    LogFunction_WithClosures                ,
    drop_closures_LogFunction               ,
    dynamic_LogFunction                     ,
    genClosure_LogFunction                  ,
    mk_LogFunction                          ,
    noLogFunction                           ,
    noLogFunction_WithClosures              ,
    wrap_LogFunction                        ,


-- ** MemoryCopyFunction #signal:MemoryCopyFunction#

    C_MemoryCopyFunction                    ,
    MemoryCopyFunction                      ,
    dynamic_MemoryCopyFunction              ,
    genClosure_MemoryCopyFunction           ,
    mk_MemoryCopyFunction                   ,
    noMemoryCopyFunction                    ,
    wrap_MemoryCopyFunction                 ,


-- ** MemoryIsSpanFunction #signal:MemoryIsSpanFunction#

    C_MemoryIsSpanFunction                  ,
    MemoryIsSpanFunction                    ,
    dynamic_MemoryIsSpanFunction            ,
    genClosure_MemoryIsSpanFunction         ,
    mk_MemoryIsSpanFunction                 ,
    noMemoryIsSpanFunction                  ,
    wrap_MemoryIsSpanFunction               ,


-- ** MemoryMapFullFunction #signal:MemoryMapFullFunction#

    C_MemoryMapFullFunction                 ,
    MemoryMapFullFunction                   ,
    dynamic_MemoryMapFullFunction           ,
    genClosure_MemoryMapFullFunction        ,
    mk_MemoryMapFullFunction                ,
    noMemoryMapFullFunction                 ,
    wrap_MemoryMapFullFunction              ,


-- ** MemoryMapFunction #signal:MemoryMapFunction#

    C_MemoryMapFunction                     ,
    MemoryMapFunction                       ,
    dynamic_MemoryMapFunction               ,
    genClosure_MemoryMapFunction            ,
    mk_MemoryMapFunction                    ,
    noMemoryMapFunction                     ,
    wrap_MemoryMapFunction                  ,


-- ** MemoryShareFunction #signal:MemoryShareFunction#

    C_MemoryShareFunction                   ,
    MemoryShareFunction                     ,
    dynamic_MemoryShareFunction             ,
    genClosure_MemoryShareFunction          ,
    mk_MemoryShareFunction                  ,
    noMemoryShareFunction                   ,
    wrap_MemoryShareFunction                ,


-- ** MemoryUnmapFullFunction #signal:MemoryUnmapFullFunction#

    C_MemoryUnmapFullFunction               ,
    MemoryUnmapFullFunction                 ,
    dynamic_MemoryUnmapFullFunction         ,
    genClosure_MemoryUnmapFullFunction      ,
    mk_MemoryUnmapFullFunction              ,
    noMemoryUnmapFullFunction               ,
    wrap_MemoryUnmapFullFunction            ,


-- ** MemoryUnmapFunction #signal:MemoryUnmapFunction#

    C_MemoryUnmapFunction                   ,
    MemoryUnmapFunction                     ,
    dynamic_MemoryUnmapFunction             ,
    genClosure_MemoryUnmapFunction          ,
    mk_MemoryUnmapFunction                  ,
    noMemoryUnmapFunction                   ,
    wrap_MemoryUnmapFunction                ,


-- ** MetaFreeFunction #signal:MetaFreeFunction#

    C_MetaFreeFunction                      ,
    MetaFreeFunction                        ,
    dynamic_MetaFreeFunction                ,
    genClosure_MetaFreeFunction             ,
    mk_MetaFreeFunction                     ,
    noMetaFreeFunction                      ,
    wrap_MetaFreeFunction                   ,


-- ** MetaInitFunction #signal:MetaInitFunction#

    C_MetaInitFunction                      ,
    MetaInitFunction                        ,
    dynamic_MetaInitFunction                ,
    genClosure_MetaInitFunction             ,
    mk_MetaInitFunction                     ,
    noMetaInitFunction                      ,
    wrap_MetaInitFunction                   ,


-- ** MetaTransformFunction #signal:MetaTransformFunction#

    C_MetaTransformFunction                 ,
    MetaTransformFunction                   ,
    dynamic_MetaTransformFunction           ,
    genClosure_MetaTransformFunction        ,
    mk_MetaTransformFunction                ,
    noMetaTransformFunction                 ,
    wrap_MetaTransformFunction              ,


-- ** MiniObjectDisposeFunction #signal:MiniObjectDisposeFunction#

    C_MiniObjectDisposeFunction             ,
    MiniObjectDisposeFunction               ,
    dynamic_MiniObjectDisposeFunction       ,
    genClosure_MiniObjectDisposeFunction    ,
    mk_MiniObjectDisposeFunction            ,
    noMiniObjectDisposeFunction             ,
    wrap_MiniObjectDisposeFunction          ,


-- ** MiniObjectFreeFunction #signal:MiniObjectFreeFunction#

    C_MiniObjectFreeFunction                ,
    MiniObjectFreeFunction                  ,
    dynamic_MiniObjectFreeFunction          ,
    genClosure_MiniObjectFreeFunction       ,
    mk_MiniObjectFreeFunction               ,
    noMiniObjectFreeFunction                ,
    wrap_MiniObjectFreeFunction             ,


-- ** MiniObjectNotify #signal:MiniObjectNotify#

    C_MiniObjectNotify                      ,
    MiniObjectNotify                        ,
    MiniObjectNotify_WithClosures           ,
    drop_closures_MiniObjectNotify          ,
    dynamic_MiniObjectNotify                ,
    genClosure_MiniObjectNotify             ,
    mk_MiniObjectNotify                     ,
    noMiniObjectNotify                      ,
    noMiniObjectNotify_WithClosures         ,
    wrap_MiniObjectNotify                   ,


-- ** PadActivateFunction #signal:PadActivateFunction#

    C_PadActivateFunction                   ,
    PadActivateFunction                     ,
    dynamic_PadActivateFunction             ,
    genClosure_PadActivateFunction          ,
    mk_PadActivateFunction                  ,
    noPadActivateFunction                   ,
    wrap_PadActivateFunction                ,


-- ** PadActivateModeFunction #signal:PadActivateModeFunction#

    C_PadActivateModeFunction               ,
    PadActivateModeFunction                 ,
    dynamic_PadActivateModeFunction         ,
    genClosure_PadActivateModeFunction      ,
    mk_PadActivateModeFunction              ,
    noPadActivateModeFunction               ,
    wrap_PadActivateModeFunction            ,


-- ** PadChainFunction #signal:PadChainFunction#

    C_PadChainFunction                      ,
    PadChainFunction                        ,
    dynamic_PadChainFunction                ,
    genClosure_PadChainFunction             ,
    mk_PadChainFunction                     ,
    noPadChainFunction                      ,
    wrap_PadChainFunction                   ,


-- ** PadChainListFunction #signal:PadChainListFunction#

    C_PadChainListFunction                  ,
    PadChainListFunction                    ,
    dynamic_PadChainListFunction            ,
    genClosure_PadChainListFunction         ,
    mk_PadChainListFunction                 ,
    noPadChainListFunction                  ,
    wrap_PadChainListFunction               ,


-- ** PadEventFullFunction #signal:PadEventFullFunction#

    C_PadEventFullFunction                  ,
    PadEventFullFunction                    ,
    dynamic_PadEventFullFunction            ,
    genClosure_PadEventFullFunction         ,
    mk_PadEventFullFunction                 ,
    noPadEventFullFunction                  ,
    wrap_PadEventFullFunction               ,


-- ** PadEventFunction #signal:PadEventFunction#

    C_PadEventFunction                      ,
    PadEventFunction                        ,
    dynamic_PadEventFunction                ,
    genClosure_PadEventFunction             ,
    mk_PadEventFunction                     ,
    noPadEventFunction                      ,
    wrap_PadEventFunction                   ,


-- ** PadForwardFunction #signal:PadForwardFunction#

    C_PadForwardFunction                    ,
    PadForwardFunction                      ,
    PadForwardFunction_WithClosures         ,
    drop_closures_PadForwardFunction        ,
    dynamic_PadForwardFunction              ,
    genClosure_PadForwardFunction           ,
    mk_PadForwardFunction                   ,
    noPadForwardFunction                    ,
    noPadForwardFunction_WithClosures       ,
    wrap_PadForwardFunction                 ,


-- ** PadGetRangeFunction #signal:PadGetRangeFunction#

    C_PadGetRangeFunction                   ,
    PadGetRangeFunction                     ,
    dynamic_PadGetRangeFunction             ,
    genClosure_PadGetRangeFunction          ,
    mk_PadGetRangeFunction                  ,
    noPadGetRangeFunction                   ,
    wrap_PadGetRangeFunction                ,


-- ** PadIterIntLinkFunction #signal:PadIterIntLinkFunction#

    C_PadIterIntLinkFunction                ,
    PadIterIntLinkFunction                  ,
    dynamic_PadIterIntLinkFunction          ,
    genClosure_PadIterIntLinkFunction       ,
    mk_PadIterIntLinkFunction               ,
    noPadIterIntLinkFunction                ,
    wrap_PadIterIntLinkFunction             ,


-- ** PadLinkFunction #signal:PadLinkFunction#

    C_PadLinkFunction                       ,
    PadLinkFunction                         ,
    dynamic_PadLinkFunction                 ,
    genClosure_PadLinkFunction              ,
    mk_PadLinkFunction                      ,
    noPadLinkFunction                       ,
    wrap_PadLinkFunction                    ,


-- ** PadProbeCallback #signal:PadProbeCallback#

    C_PadProbeCallback                      ,
    PadProbeCallback                        ,
    PadProbeCallback_WithClosures           ,
    drop_closures_PadProbeCallback          ,
    dynamic_PadProbeCallback                ,
    genClosure_PadProbeCallback             ,
    mk_PadProbeCallback                     ,
    noPadProbeCallback                      ,
    noPadProbeCallback_WithClosures         ,
    wrap_PadProbeCallback                   ,


-- ** PadQueryFunction #signal:PadQueryFunction#

    C_PadQueryFunction                      ,
    PadQueryFunction                        ,
    dynamic_PadQueryFunction                ,
    genClosure_PadQueryFunction             ,
    mk_PadQueryFunction                     ,
    noPadQueryFunction                      ,
    wrap_PadQueryFunction                   ,


-- ** PadStickyEventsForeachFunction #signal:PadStickyEventsForeachFunction#

    C_PadStickyEventsForeachFunction        ,
    PadStickyEventsForeachFunction          ,
    PadStickyEventsForeachFunction_WithClosures,
    drop_closures_PadStickyEventsForeachFunction,
    dynamic_PadStickyEventsForeachFunction  ,
    genClosure_PadStickyEventsForeachFunction,
    mk_PadStickyEventsForeachFunction       ,
    noPadStickyEventsForeachFunction        ,
    noPadStickyEventsForeachFunction_WithClosures,
    wrap_PadStickyEventsForeachFunction     ,


-- ** PadUnlinkFunction #signal:PadUnlinkFunction#

    C_PadUnlinkFunction                     ,
    PadUnlinkFunction                       ,
    dynamic_PadUnlinkFunction               ,
    genClosure_PadUnlinkFunction            ,
    mk_PadUnlinkFunction                    ,
    noPadUnlinkFunction                     ,
    wrap_PadUnlinkFunction                  ,


-- ** PluginFeatureFilter #signal:PluginFeatureFilter#

    C_PluginFeatureFilter                   ,
    PluginFeatureFilter                     ,
    PluginFeatureFilter_WithClosures        ,
    drop_closures_PluginFeatureFilter       ,
    dynamic_PluginFeatureFilter             ,
    genClosure_PluginFeatureFilter          ,
    mk_PluginFeatureFilter                  ,
    noPluginFeatureFilter                   ,
    noPluginFeatureFilter_WithClosures      ,
    wrap_PluginFeatureFilter                ,


-- ** PluginFilter #signal:PluginFilter#

    C_PluginFilter                          ,
    PluginFilter                            ,
    PluginFilter_WithClosures               ,
    drop_closures_PluginFilter              ,
    dynamic_PluginFilter                    ,
    genClosure_PluginFilter                 ,
    mk_PluginFilter                         ,
    noPluginFilter                          ,
    noPluginFilter_WithClosures             ,
    wrap_PluginFilter                       ,


-- ** PluginInitFullFunc #signal:PluginInitFullFunc#

    C_PluginInitFullFunc                    ,
    PluginInitFullFunc                      ,
    PluginInitFullFunc_WithClosures         ,
    drop_closures_PluginInitFullFunc        ,
    dynamic_PluginInitFullFunc              ,
    genClosure_PluginInitFullFunc           ,
    mk_PluginInitFullFunc                   ,
    noPluginInitFullFunc                    ,
    noPluginInitFullFunc_WithClosures       ,
    wrap_PluginInitFullFunc                 ,


-- ** PluginInitFunc #signal:PluginInitFunc#

    C_PluginInitFunc                        ,
    PluginInitFunc                          ,
    dynamic_PluginInitFunc                  ,
    genClosure_PluginInitFunc               ,
    mk_PluginInitFunc                       ,
    noPluginInitFunc                        ,
    wrap_PluginInitFunc                     ,


-- ** PromiseChangeFunc #signal:PromiseChangeFunc#

    C_PromiseChangeFunc                     ,
    PromiseChangeFunc                       ,
    PromiseChangeFunc_WithClosures          ,
    drop_closures_PromiseChangeFunc         ,
    dynamic_PromiseChangeFunc               ,
    genClosure_PromiseChangeFunc            ,
    mk_PromiseChangeFunc                    ,
    noPromiseChangeFunc                     ,
    noPromiseChangeFunc_WithClosures        ,
    wrap_PromiseChangeFunc                  ,


-- ** StructureFilterMapFunc #signal:StructureFilterMapFunc#

    C_StructureFilterMapFunc                ,
    StructureFilterMapFunc                  ,
    StructureFilterMapFunc_WithClosures     ,
    drop_closures_StructureFilterMapFunc    ,
    dynamic_StructureFilterMapFunc          ,
    genClosure_StructureFilterMapFunc       ,
    mk_StructureFilterMapFunc               ,
    noStructureFilterMapFunc                ,
    noStructureFilterMapFunc_WithClosures   ,
    wrap_StructureFilterMapFunc             ,


-- ** StructureForeachFunc #signal:StructureForeachFunc#

    C_StructureForeachFunc                  ,
    StructureForeachFunc                    ,
    StructureForeachFunc_WithClosures       ,
    drop_closures_StructureForeachFunc      ,
    dynamic_StructureForeachFunc            ,
    genClosure_StructureForeachFunc         ,
    mk_StructureForeachFunc                 ,
    noStructureForeachFunc                  ,
    noStructureForeachFunc_WithClosures     ,
    wrap_StructureForeachFunc               ,


-- ** StructureMapFunc #signal:StructureMapFunc#

    C_StructureMapFunc                      ,
    StructureMapFunc                        ,
    StructureMapFunc_WithClosures           ,
    drop_closures_StructureMapFunc          ,
    dynamic_StructureMapFunc                ,
    genClosure_StructureMapFunc             ,
    mk_StructureMapFunc                     ,
    noStructureMapFunc                      ,
    noStructureMapFunc_WithClosures         ,
    wrap_StructureMapFunc                   ,


-- ** TagForeachFunc #signal:TagForeachFunc#

    C_TagForeachFunc                        ,
    TagForeachFunc                          ,
    TagForeachFunc_WithClosures             ,
    drop_closures_TagForeachFunc            ,
    dynamic_TagForeachFunc                  ,
    genClosure_TagForeachFunc               ,
    mk_TagForeachFunc                       ,
    noTagForeachFunc                        ,
    noTagForeachFunc_WithClosures           ,
    wrap_TagForeachFunc                     ,


-- ** TagMergeFunc #signal:TagMergeFunc#

    C_TagMergeFunc                          ,
    TagMergeFunc                            ,
    dynamic_TagMergeFunc                    ,
    genClosure_TagMergeFunc                 ,
    mk_TagMergeFunc                         ,
    noTagMergeFunc                          ,
    wrap_TagMergeFunc                       ,


-- ** TaskFunction #signal:TaskFunction#

    C_TaskFunction                          ,
    TaskFunction                            ,
    TaskFunction_WithClosures               ,
    drop_closures_TaskFunction              ,
    dynamic_TaskFunction                    ,
    genClosure_TaskFunction                 ,
    mk_TaskFunction                         ,
    noTaskFunction                          ,
    noTaskFunction_WithClosures             ,
    wrap_TaskFunction                       ,


-- ** TaskPoolFunction #signal:TaskPoolFunction#

    C_TaskPoolFunction                      ,
    TaskPoolFunction                        ,
    TaskPoolFunction_WithClosures           ,
    drop_closures_TaskPoolFunction          ,
    dynamic_TaskPoolFunction                ,
    genClosure_TaskPoolFunction             ,
    mk_TaskPoolFunction                     ,
    noTaskPoolFunction                      ,
    noTaskPoolFunction_WithClosures         ,
    wrap_TaskPoolFunction                   ,


-- ** TaskThreadFunc #signal:TaskThreadFunc#

    C_TaskThreadFunc                        ,
    TaskThreadFunc                          ,
    TaskThreadFunc_WithClosures             ,
    drop_closures_TaskThreadFunc            ,
    dynamic_TaskThreadFunc                  ,
    genClosure_TaskThreadFunc               ,
    mk_TaskThreadFunc                       ,
    noTaskThreadFunc                        ,
    noTaskThreadFunc_WithClosures           ,
    wrap_TaskThreadFunc                     ,


-- ** TypeFindFunction #signal:TypeFindFunction#

    C_TypeFindFunction                      ,
    TypeFindFunction                        ,
    TypeFindFunction_WithClosures           ,
    drop_closures_TypeFindFunction          ,
    dynamic_TypeFindFunction                ,
    genClosure_TypeFindFunction             ,
    mk_TypeFindFunction                     ,
    noTypeFindFunction                      ,
    noTypeFindFunction_WithClosures         ,
    wrap_TypeFindFunction                   ,


-- ** TypeFindGetLengthFieldCallback #signal:TypeFindGetLengthFieldCallback#

    C_TypeFindGetLengthFieldCallback        ,
    TypeFindGetLengthFieldCallback          ,
    dynamic_TypeFindGetLengthFieldCallback  ,
    genClosure_TypeFindGetLengthFieldCallback,
    mk_TypeFindGetLengthFieldCallback       ,
    noTypeFindGetLengthFieldCallback        ,
    wrap_TypeFindGetLengthFieldCallback     ,


-- ** TypeFindPeekFieldCallback #signal:TypeFindPeekFieldCallback#

    C_TypeFindPeekFieldCallback             ,
    TypeFindPeekFieldCallback               ,
    dynamic_TypeFindPeekFieldCallback       ,
    genClosure_TypeFindPeekFieldCallback    ,
    mk_TypeFindPeekFieldCallback            ,
    noTypeFindPeekFieldCallback             ,
    wrap_TypeFindPeekFieldCallback          ,


-- ** TypeFindSuggestFieldCallback #signal:TypeFindSuggestFieldCallback#

    C_TypeFindSuggestFieldCallback          ,
    TypeFindSuggestFieldCallback            ,
    dynamic_TypeFindSuggestFieldCallback    ,
    genClosure_TypeFindSuggestFieldCallback ,
    mk_TypeFindSuggestFieldCallback         ,
    noTypeFindSuggestFieldCallback          ,
    wrap_TypeFindSuggestFieldCallback       ,


-- ** ValueCompareFunc #signal:ValueCompareFunc#

    C_ValueCompareFunc                      ,
    ValueCompareFunc                        ,
    dynamic_ValueCompareFunc                ,
    genClosure_ValueCompareFunc             ,
    mk_ValueCompareFunc                     ,
    noValueCompareFunc                      ,
    wrap_ValueCompareFunc                   ,


-- ** ValueDeserializeFunc #signal:ValueDeserializeFunc#

    C_ValueDeserializeFunc                  ,
    ValueDeserializeFunc                    ,
    dynamic_ValueDeserializeFunc            ,
    genClosure_ValueDeserializeFunc         ,
    mk_ValueDeserializeFunc                 ,
    noValueDeserializeFunc                  ,
    wrap_ValueDeserializeFunc               ,


-- ** ValueSerializeFunc #signal:ValueSerializeFunc#

    C_ValueSerializeFunc                    ,
    ValueSerializeFunc                      ,
    dynamic_ValueSerializeFunc              ,
    genClosure_ValueSerializeFunc           ,
    mk_ValueSerializeFunc                   ,
    noValueSerializeFunc                    ,
    wrap_ValueSerializeFunc                 ,




    ) 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.GLib.Structs.Thread as GLib.Thread
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gst.Enums as Gst.Enums
import {-# SOURCE #-} qualified GI.Gst.Flags as Gst.Flags
import {-# SOURCE #-} qualified GI.Gst.Objects.Bus as Gst.Bus
import {-# SOURCE #-} qualified GI.Gst.Objects.Clock as Gst.Clock
import {-# SOURCE #-} qualified GI.Gst.Objects.ControlBinding as Gst.ControlBinding
import {-# SOURCE #-} qualified GI.Gst.Objects.ControlSource as Gst.ControlSource
import {-# SOURCE #-} qualified GI.Gst.Objects.Element as Gst.Element
import {-# SOURCE #-} qualified GI.Gst.Objects.Object as Gst.Object
import {-# SOURCE #-} qualified GI.Gst.Objects.Pad as Gst.Pad
import {-# SOURCE #-} qualified GI.Gst.Objects.Plugin as Gst.Plugin
import {-# SOURCE #-} qualified GI.Gst.Objects.PluginFeature as Gst.PluginFeature
import {-# SOURCE #-} qualified GI.Gst.Objects.Task as Gst.Task
import {-# SOURCE #-} qualified GI.Gst.Structs.Buffer as Gst.Buffer
import {-# SOURCE #-} qualified GI.Gst.Structs.BufferList as Gst.BufferList
import {-# SOURCE #-} qualified GI.Gst.Structs.Caps as Gst.Caps
import {-# SOURCE #-} qualified GI.Gst.Structs.CapsFeatures as Gst.CapsFeatures
import {-# SOURCE #-} qualified GI.Gst.Structs.DebugCategory as Gst.DebugCategory
import {-# SOURCE #-} qualified GI.Gst.Structs.DebugMessage as Gst.DebugMessage
import {-# SOURCE #-} qualified GI.Gst.Structs.Event as Gst.Event
import {-# SOURCE #-} qualified GI.Gst.Structs.Iterator as Gst.Iterator
import {-# SOURCE #-} qualified GI.Gst.Structs.MapInfo as Gst.MapInfo
import {-# SOURCE #-} qualified GI.Gst.Structs.Memory as Gst.Memory
import {-# SOURCE #-} qualified GI.Gst.Structs.Message as Gst.Message
import {-# SOURCE #-} qualified GI.Gst.Structs.Meta as Gst.Meta
import {-# SOURCE #-} qualified GI.Gst.Structs.MiniObject as Gst.MiniObject
import {-# SOURCE #-} qualified GI.Gst.Structs.PadProbeInfo as Gst.PadProbeInfo
import {-# SOURCE #-} qualified GI.Gst.Structs.Promise as Gst.Promise
import {-# SOURCE #-} qualified GI.Gst.Structs.Query as Gst.Query
import {-# SOURCE #-} qualified GI.Gst.Structs.Structure as Gst.Structure
import {-# SOURCE #-} qualified GI.Gst.Structs.TagList as Gst.TagList
import {-# SOURCE #-} qualified GI.Gst.Structs.TypeFind as Gst.TypeFind

-- callback ValueSerializeFunc
--          -> Callable {returnType = Just (TBasicType TUTF8), returnMayBeNull = False, returnTransfer = TransferEverything, returnDocumentation = Documentation {rawDocText = Just "the string representation of the value", sinceVersion = Nothing}, args = [Arg {argCName = "value1", argType = TInterface (Name {namespace = "GObject", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GValue", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Used by gst_value_serialize() to obtain a non-binary form of the #GValue.\n\nFree-function: g_free", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_ValueSerializeFunc =
    Ptr GValue ->
    IO CString

-- Args : [Arg {argCName = "value1", argType = TInterface (Name {namespace = "GObject", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GValue", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUTF8)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_ValueSerializeFunc :: FunPtr C_ValueSerializeFunc -> C_ValueSerializeFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_ValueSerializeFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_ValueSerializeFunc
    -> GValue
    {- ^ /@value1@/: a 'GI.GObject.Structs.Value.Value' -}
    -> m T.Text
    {- ^ __Returns:__ the string representation of the value -}
dynamic_ValueSerializeFunc __funPtr value1 = liftIO $ do
    value1' <- unsafeManagedPtrGetPtr value1
    result <- (__dynamic_C_ValueSerializeFunc __funPtr) value1'
    checkUnexpectedReturnNULL "valueSerializeFunc" result
    result' <- cstringToText result
    freeMem result
    touchManagedPtr value1
    return result'

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

{- |
Used by 'GI.Gst.Functions.valueSerialize' to obtain a non-binary form of the 'GI.GObject.Structs.Value.Value'.

Free-function: g_free
-}
type ValueSerializeFunc =
    GValue
    {- ^ /@value1@/: a 'GI.GObject.Structs.Value.Value' -}
    -> IO T.Text
    {- ^ __Returns:__ the string representation of the value -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `ValueSerializeFunc`@.
noValueSerializeFunc :: Maybe ValueSerializeFunc
noValueSerializeFunc = Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_ValueSerializeFunc :: MonadIO m => ValueSerializeFunc -> m (GClosure C_ValueSerializeFunc)
genClosure_ValueSerializeFunc cb = liftIO $ do
    let cb' = wrap_ValueSerializeFunc Nothing cb
    mk_ValueSerializeFunc cb' >>= B.GClosure.newGClosure


-- | Wrap a `ValueSerializeFunc` into a `C_ValueSerializeFunc`.
wrap_ValueSerializeFunc ::
    Maybe (Ptr (FunPtr C_ValueSerializeFunc)) ->
    ValueSerializeFunc ->
    C_ValueSerializeFunc
wrap_ValueSerializeFunc funptrptr _cb value1 = do
    B.ManagedPtr.withTransient GValue value1 $ \value1' -> do
        result <- _cb  value1'
        maybeReleaseFunPtr funptrptr
        result' <- textToCString result
        return result'


-- callback ValueDeserializeFunc
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE for success", sinceVersion = Nothing}, args = [Arg {argCName = "dest", argType = TInterface (Name {namespace = "GObject", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GValue", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "s", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a string", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Used by gst_value_deserialize() to parse a non-binary form into the #GValue.", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_ValueDeserializeFunc =
    Ptr GValue ->
    CString ->
    IO CInt

-- Args : [Arg {argCName = "dest", argType = TInterface (Name {namespace = "GObject", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GValue", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "s", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a string", 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 "dynamic" __dynamic_C_ValueDeserializeFunc :: FunPtr C_ValueDeserializeFunc -> C_ValueDeserializeFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_ValueDeserializeFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_ValueDeserializeFunc
    -> GValue
    {- ^ /@dest@/: a 'GI.GObject.Structs.Value.Value' -}
    -> T.Text
    {- ^ /@s@/: a string -}
    -> m Bool
    {- ^ __Returns:__ 'True' for success -}
dynamic_ValueDeserializeFunc __funPtr dest s = liftIO $ do
    dest' <- unsafeManagedPtrGetPtr dest
    s' <- textToCString s
    result <- (__dynamic_C_ValueDeserializeFunc __funPtr) dest' s'
    let result' = (/= 0) result
    touchManagedPtr dest
    freeMem s'
    return result'

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

{- |
Used by 'GI.Gst.Functions.valueDeserialize' to parse a non-binary form into the 'GI.GObject.Structs.Value.Value'.
-}
type ValueDeserializeFunc =
    GValue
    {- ^ /@dest@/: a 'GI.GObject.Structs.Value.Value' -}
    -> T.Text
    {- ^ /@s@/: a string -}
    -> IO Bool
    {- ^ __Returns:__ 'True' for success -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `ValueDeserializeFunc`@.
noValueDeserializeFunc :: Maybe ValueDeserializeFunc
noValueDeserializeFunc = Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_ValueDeserializeFunc :: MonadIO m => ValueDeserializeFunc -> m (GClosure C_ValueDeserializeFunc)
genClosure_ValueDeserializeFunc cb = liftIO $ do
    let cb' = wrap_ValueDeserializeFunc Nothing cb
    mk_ValueDeserializeFunc cb' >>= B.GClosure.newGClosure


-- | Wrap a `ValueDeserializeFunc` into a `C_ValueDeserializeFunc`.
wrap_ValueDeserializeFunc ::
    Maybe (Ptr (FunPtr C_ValueDeserializeFunc)) ->
    ValueDeserializeFunc ->
    C_ValueDeserializeFunc
wrap_ValueDeserializeFunc funptrptr _cb dest s = do
    B.ManagedPtr.withTransient GValue dest $ \dest' -> do
        s' <- cstringToText s
        result <- _cb  dest' s'
        maybeReleaseFunPtr funptrptr
        let result' = (fromIntegral . fromEnum) result
        return result'


-- callback ValueCompareFunc
--          -> Callable {returnType = Just (TBasicType TInt), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "one of GST_VALUE_LESS_THAN, GST_VALUE_EQUAL, GST_VALUE_GREATER_THAN\nor GST_VALUE_UNORDERED", sinceVersion = Nothing}, args = [Arg {argCName = "value1", argType = TInterface (Name {namespace = "GObject", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "first value for comparison", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value2", argType = TInterface (Name {namespace = "GObject", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "second value for comparison", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Used together with gst_value_compare() to compare #GValue items.", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_ValueCompareFunc =
    Ptr GValue ->
    Ptr GValue ->
    IO Int32

-- Args : [Arg {argCName = "value1", argType = TInterface (Name {namespace = "GObject", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "first value for comparison", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value2", argType = TInterface (Name {namespace = "GObject", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "second value for comparison", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_ValueCompareFunc :: FunPtr C_ValueCompareFunc -> C_ValueCompareFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_ValueCompareFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_ValueCompareFunc
    -> GValue
    {- ^ /@value1@/: first value for comparison -}
    -> GValue
    {- ^ /@value2@/: second value for comparison -}
    -> m Int32
    {- ^ __Returns:__ one of GST_VALUE_LESS_THAN, GST_VALUE_EQUAL, GST_VALUE_GREATER_THAN
or GST_VALUE_UNORDERED -}
dynamic_ValueCompareFunc __funPtr value1 value2 = liftIO $ do
    value1' <- unsafeManagedPtrGetPtr value1
    value2' <- unsafeManagedPtrGetPtr value2
    result <- (__dynamic_C_ValueCompareFunc __funPtr) value1' value2'
    touchManagedPtr value1
    touchManagedPtr value2
    return result

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

{- |
Used together with 'GI.Gst.Functions.valueCompare' to compare 'GI.GObject.Structs.Value.Value' items.
-}
type ValueCompareFunc =
    GValue
    {- ^ /@value1@/: first value for comparison -}
    -> GValue
    {- ^ /@value2@/: second value for comparison -}
    -> IO Int32
    {- ^ __Returns:__ one of GST_VALUE_LESS_THAN, GST_VALUE_EQUAL, GST_VALUE_GREATER_THAN
or GST_VALUE_UNORDERED -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `ValueCompareFunc`@.
noValueCompareFunc :: Maybe ValueCompareFunc
noValueCompareFunc = Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_ValueCompareFunc :: MonadIO m => ValueCompareFunc -> m (GClosure C_ValueCompareFunc)
genClosure_ValueCompareFunc cb = liftIO $ do
    let cb' = wrap_ValueCompareFunc Nothing cb
    mk_ValueCompareFunc cb' >>= B.GClosure.newGClosure


-- | Wrap a `ValueCompareFunc` into a `C_ValueCompareFunc`.
wrap_ValueCompareFunc ::
    Maybe (Ptr (FunPtr C_ValueCompareFunc)) ->
    ValueCompareFunc ->
    C_ValueCompareFunc
wrap_ValueCompareFunc funptrptr _cb value1 value2 = do
    B.ManagedPtr.withTransient GValue value1 $ \value1' -> do
        B.ManagedPtr.withTransient GValue value2 $ \value2' -> do
            result <- _cb  value1' value2'
            maybeReleaseFunPtr funptrptr
            return result


-- callback TypeFindSuggestFieldCallback
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "probability", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "caps", argType = TInterface (Name {namespace = "Gst", name = "Caps"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_TypeFindSuggestFieldCallback =
    Ptr () ->
    Word32 ->
    Ptr Gst.Caps.Caps ->
    IO ()

-- Args : [Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "probability", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "caps", argType = TInterface (Name {namespace = "Gst", name = "Caps"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_TypeFindSuggestFieldCallback :: FunPtr C_TypeFindSuggestFieldCallback -> C_TypeFindSuggestFieldCallback

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_TypeFindSuggestFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_TypeFindSuggestFieldCallback
    -> Ptr ()
    -> Word32
    -> Gst.Caps.Caps
    -> m ()
dynamic_TypeFindSuggestFieldCallback __funPtr data_ probability caps = liftIO $ do
    caps' <- unsafeManagedPtrGetPtr caps
    (__dynamic_C_TypeFindSuggestFieldCallback __funPtr) data_ probability caps'
    touchManagedPtr caps
    return ()

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

{- |
/No description available in the introspection data./
-}
type TypeFindSuggestFieldCallback =
    Ptr ()
    -> Word32
    -> Gst.Caps.Caps
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `TypeFindSuggestFieldCallback`@.
noTypeFindSuggestFieldCallback :: Maybe TypeFindSuggestFieldCallback
noTypeFindSuggestFieldCallback = Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_TypeFindSuggestFieldCallback :: MonadIO m => TypeFindSuggestFieldCallback -> m (GClosure C_TypeFindSuggestFieldCallback)
genClosure_TypeFindSuggestFieldCallback cb = liftIO $ do
    let cb' = wrap_TypeFindSuggestFieldCallback Nothing cb
    mk_TypeFindSuggestFieldCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `TypeFindSuggestFieldCallback` into a `C_TypeFindSuggestFieldCallback`.
wrap_TypeFindSuggestFieldCallback ::
    Maybe (Ptr (FunPtr C_TypeFindSuggestFieldCallback)) ->
    TypeFindSuggestFieldCallback ->
    C_TypeFindSuggestFieldCallback
wrap_TypeFindSuggestFieldCallback funptrptr _cb data_ probability caps = do
    B.ManagedPtr.withTransient Gst.Caps.Caps caps $ \caps' -> do
        _cb  data_ probability caps'
        maybeReleaseFunPtr funptrptr


-- callback TypeFindPeekFieldCallback
--          -> Callable {returnType = Just (TBasicType TUInt8), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "offset", argType = TBasicType TInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "size", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_TypeFindPeekFieldCallback =
    Ptr () ->
    Int64 ->
    Word32 ->
    IO Word8

-- Args : [Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "offset", argType = TBasicType TInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "size", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUInt8)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_TypeFindPeekFieldCallback :: FunPtr C_TypeFindPeekFieldCallback -> C_TypeFindPeekFieldCallback

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_TypeFindPeekFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_TypeFindPeekFieldCallback
    -> Ptr ()
    -> Int64
    -> Word32
    -> m Word8
dynamic_TypeFindPeekFieldCallback __funPtr data_ offset size = liftIO $ do
    result <- (__dynamic_C_TypeFindPeekFieldCallback __funPtr) data_ offset size
    return result

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

{- |
/No description available in the introspection data./
-}
type TypeFindPeekFieldCallback =
    Ptr ()
    -> Int64
    -> Word32
    -> IO Word8

-- | A convenience synonym for @`Nothing` :: `Maybe` `TypeFindPeekFieldCallback`@.
noTypeFindPeekFieldCallback :: Maybe TypeFindPeekFieldCallback
noTypeFindPeekFieldCallback = Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_TypeFindPeekFieldCallback :: MonadIO m => TypeFindPeekFieldCallback -> m (GClosure C_TypeFindPeekFieldCallback)
genClosure_TypeFindPeekFieldCallback cb = liftIO $ do
    let cb' = wrap_TypeFindPeekFieldCallback Nothing cb
    mk_TypeFindPeekFieldCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `TypeFindPeekFieldCallback` into a `C_TypeFindPeekFieldCallback`.
wrap_TypeFindPeekFieldCallback ::
    Maybe (Ptr (FunPtr C_TypeFindPeekFieldCallback)) ->
    TypeFindPeekFieldCallback ->
    C_TypeFindPeekFieldCallback
wrap_TypeFindPeekFieldCallback funptrptr _cb data_ offset size = do
    result <- _cb  data_ offset size
    maybeReleaseFunPtr funptrptr
    return result


-- callback TypeFindGetLengthFieldCallback
--          -> Callable {returnType = Just (TBasicType TUInt64), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_TypeFindGetLengthFieldCallback =
    Ptr () ->
    IO Word64

-- Args : [Arg {argCName = "data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TUInt64)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_TypeFindGetLengthFieldCallback :: FunPtr C_TypeFindGetLengthFieldCallback -> C_TypeFindGetLengthFieldCallback

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_TypeFindGetLengthFieldCallback ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_TypeFindGetLengthFieldCallback
    -> Ptr ()
    -> m Word64
dynamic_TypeFindGetLengthFieldCallback __funPtr data_ = liftIO $ do
    result <- (__dynamic_C_TypeFindGetLengthFieldCallback __funPtr) data_
    return result

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

{- |
/No description available in the introspection data./
-}
type TypeFindGetLengthFieldCallback =
    Ptr ()
    -> IO Word64

-- | A convenience synonym for @`Nothing` :: `Maybe` `TypeFindGetLengthFieldCallback`@.
noTypeFindGetLengthFieldCallback :: Maybe TypeFindGetLengthFieldCallback
noTypeFindGetLengthFieldCallback = Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_TypeFindGetLengthFieldCallback :: MonadIO m => TypeFindGetLengthFieldCallback -> m (GClosure C_TypeFindGetLengthFieldCallback)
genClosure_TypeFindGetLengthFieldCallback cb = liftIO $ do
    let cb' = wrap_TypeFindGetLengthFieldCallback Nothing cb
    mk_TypeFindGetLengthFieldCallback cb' >>= B.GClosure.newGClosure


-- | Wrap a `TypeFindGetLengthFieldCallback` into a `C_TypeFindGetLengthFieldCallback`.
wrap_TypeFindGetLengthFieldCallback ::
    Maybe (Ptr (FunPtr C_TypeFindGetLengthFieldCallback)) ->
    TypeFindGetLengthFieldCallback ->
    C_TypeFindGetLengthFieldCallback
wrap_TypeFindGetLengthFieldCallback funptrptr _cb data_ = do
    result <- _cb  data_
    maybeReleaseFunPtr funptrptr
    return result


-- callback TypeFindFunction
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "find", argType = TInterface (Name {namespace = "Gst", name = "TypeFind"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GstTypeFind structure", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional data to pass to the function", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "A function that will be called by typefinding.", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_TypeFindFunction =
    Ptr Gst.TypeFind.TypeFind ->
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "find", argType = TInterface (Name {namespace = "Gst", name = "TypeFind"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "A #GstTypeFind structure", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "optional data to pass to the function", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_TypeFindFunction :: FunPtr C_TypeFindFunction -> C_TypeFindFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_TypeFindFunction ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_TypeFindFunction
    -> Gst.TypeFind.TypeFind
    {- ^ /@find@/: A 'GI.Gst.Structs.TypeFind.TypeFind' structure -}
    -> Ptr ()
    {- ^ /@userData@/: optional data to pass to the function -}
    -> m ()
dynamic_TypeFindFunction __funPtr find userData = liftIO $ do
    find' <- unsafeManagedPtrGetPtr find
    (__dynamic_C_TypeFindFunction __funPtr) find' userData
    touchManagedPtr find
    return ()

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

{- |
A function that will be called by typefinding.
-}
type TypeFindFunction =
    Gst.TypeFind.TypeFind
    {- ^ /@find@/: A 'GI.Gst.Structs.TypeFind.TypeFind' structure -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `TypeFindFunction`@.
noTypeFindFunction :: Maybe TypeFindFunction
noTypeFindFunction = Nothing

{- |
A function that will be called by typefinding.
-}
type TypeFindFunction_WithClosures =
    Gst.TypeFind.TypeFind
    {- ^ /@find@/: A 'GI.Gst.Structs.TypeFind.TypeFind' structure -}
    -> Ptr ()
    {- ^ /@userData@/: optional data to pass to the function -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `TypeFindFunction_WithClosures`@.
noTypeFindFunction_WithClosures :: Maybe TypeFindFunction_WithClosures
noTypeFindFunction_WithClosures = Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_TypeFindFunction :: TypeFindFunction -> TypeFindFunction_WithClosures
drop_closures_TypeFindFunction _f find _ = _f find

-- | Wrap the callback into a `GClosure`.
genClosure_TypeFindFunction :: MonadIO m => TypeFindFunction -> m (GClosure C_TypeFindFunction)
genClosure_TypeFindFunction cb = liftIO $ do
    let cb' = drop_closures_TypeFindFunction cb
    let cb'' = wrap_TypeFindFunction Nothing cb'
    mk_TypeFindFunction cb'' >>= B.GClosure.newGClosure


-- | Wrap a `TypeFindFunction` into a `C_TypeFindFunction`.
wrap_TypeFindFunction ::
    Maybe (Ptr (FunPtr C_TypeFindFunction)) ->
    TypeFindFunction_WithClosures ->
    C_TypeFindFunction
wrap_TypeFindFunction funptrptr _cb find userData = do
    find' <- (newPtr Gst.TypeFind.TypeFind) find
    _cb  find' userData
    maybeReleaseFunPtr funptrptr


-- callback TaskThreadFunc
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "task", argType = TInterface (Name {namespace = "Gst", name = "Task"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The #GstTask", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "thread", argType = TInterface (Name {namespace = "GLib", name = "Thread"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The #GThread", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Custom GstTask thread callback functions that can be installed.", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_TaskThreadFunc =
    Ptr Gst.Task.Task ->
    Ptr GLib.Thread.Thread ->
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "task", argType = TInterface (Name {namespace = "Gst", name = "Task"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The #GstTask", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "thread", argType = TInterface (Name {namespace = "GLib", name = "Thread"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The #GThread", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_TaskThreadFunc :: FunPtr C_TaskThreadFunc -> C_TaskThreadFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_TaskThreadFunc ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.Task.IsTask a) =>
    FunPtr C_TaskThreadFunc
    -> a
    {- ^ /@task@/: The 'GI.Gst.Objects.Task.Task' -}
    -> GLib.Thread.Thread
    {- ^ /@thread@/: The 'GI.GLib.Structs.Thread.Thread' -}
    -> Ptr ()
    {- ^ /@userData@/: user data -}
    -> m ()
dynamic_TaskThreadFunc __funPtr task thread userData = liftIO $ do
    task' <- unsafeManagedPtrCastPtr task
    thread' <- unsafeManagedPtrGetPtr thread
    (__dynamic_C_TaskThreadFunc __funPtr) task' thread' userData
    touchManagedPtr task
    touchManagedPtr thread
    return ()

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

{- |
Custom GstTask thread callback functions that can be installed.
-}
type TaskThreadFunc =
    Gst.Task.Task
    {- ^ /@task@/: The 'GI.Gst.Objects.Task.Task' -}
    -> GLib.Thread.Thread
    {- ^ /@thread@/: The 'GI.GLib.Structs.Thread.Thread' -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `TaskThreadFunc`@.
noTaskThreadFunc :: Maybe TaskThreadFunc
noTaskThreadFunc = Nothing

{- |
Custom GstTask thread callback functions that can be installed.
-}
type TaskThreadFunc_WithClosures =
    Gst.Task.Task
    {- ^ /@task@/: The 'GI.Gst.Objects.Task.Task' -}
    -> GLib.Thread.Thread
    {- ^ /@thread@/: The 'GI.GLib.Structs.Thread.Thread' -}
    -> Ptr ()
    {- ^ /@userData@/: user data -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `TaskThreadFunc_WithClosures`@.
noTaskThreadFunc_WithClosures :: Maybe TaskThreadFunc_WithClosures
noTaskThreadFunc_WithClosures = Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_TaskThreadFunc :: TaskThreadFunc -> TaskThreadFunc_WithClosures
drop_closures_TaskThreadFunc _f task thread _ = _f task thread

-- | Wrap the callback into a `GClosure`.
genClosure_TaskThreadFunc :: MonadIO m => TaskThreadFunc -> m (GClosure C_TaskThreadFunc)
genClosure_TaskThreadFunc cb = liftIO $ do
    let cb' = drop_closures_TaskThreadFunc cb
    let cb'' = wrap_TaskThreadFunc Nothing cb'
    mk_TaskThreadFunc cb'' >>= B.GClosure.newGClosure


-- | Wrap a `TaskThreadFunc` into a `C_TaskThreadFunc`.
wrap_TaskThreadFunc ::
    Maybe (Ptr (FunPtr C_TaskThreadFunc)) ->
    TaskThreadFunc_WithClosures ->
    C_TaskThreadFunc
wrap_TaskThreadFunc funptrptr _cb task thread userData = do
    task' <- (newObject Gst.Task.Task) task
    B.ManagedPtr.withTransient GLib.Thread.Thread thread $ \thread' -> do
        _cb  task' thread' userData
        maybeReleaseFunPtr funptrptr


-- callback TaskPoolFunction
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data for the task function", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 0, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Task function, see gst_task_pool_push().", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_TaskPoolFunction =
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data for the task function", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 0, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_TaskPoolFunction :: FunPtr C_TaskPoolFunction -> C_TaskPoolFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_TaskPoolFunction ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_TaskPoolFunction
    -> Ptr ()
    {- ^ /@userData@/: user data for the task function -}
    -> m ()
dynamic_TaskPoolFunction __funPtr userData = liftIO $ do
    (__dynamic_C_TaskPoolFunction __funPtr) userData
    return ()

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

{- |
Task function, see 'GI.Gst.Objects.TaskPool.taskPoolPush'.
-}
type TaskPoolFunction =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `TaskPoolFunction`@.
noTaskPoolFunction :: Maybe TaskPoolFunction
noTaskPoolFunction = Nothing

{- |
Task function, see 'GI.Gst.Objects.TaskPool.taskPoolPush'.
-}
type TaskPoolFunction_WithClosures =
    Ptr ()
    {- ^ /@userData@/: user data for the task function -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `TaskPoolFunction_WithClosures`@.
noTaskPoolFunction_WithClosures :: Maybe TaskPoolFunction_WithClosures
noTaskPoolFunction_WithClosures = Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_TaskPoolFunction :: TaskPoolFunction -> TaskPoolFunction_WithClosures
drop_closures_TaskPoolFunction _f _ = _f

-- | Wrap the callback into a `GClosure`.
genClosure_TaskPoolFunction :: MonadIO m => TaskPoolFunction -> m (GClosure C_TaskPoolFunction)
genClosure_TaskPoolFunction cb = liftIO $ do
    let cb' = drop_closures_TaskPoolFunction cb
    let cb'' = wrap_TaskPoolFunction Nothing cb'
    mk_TaskPoolFunction cb'' >>= B.GClosure.newGClosure


-- | Wrap a `TaskPoolFunction` into a `C_TaskPoolFunction`.
wrap_TaskPoolFunction ::
    Maybe (Ptr (FunPtr C_TaskPoolFunction)) ->
    TaskPoolFunction_WithClosures ->
    C_TaskPoolFunction
wrap_TaskPoolFunction funptrptr _cb userData = do
    _cb  userData
    maybeReleaseFunPtr funptrptr


-- callback TaskFunction
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data passed to the function", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 0, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "A function that will repeatedly be called in the thread created by\na #GstTask.", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_TaskFunction =
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data passed to the function", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 0, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_TaskFunction :: FunPtr C_TaskFunction -> C_TaskFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_TaskFunction ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_TaskFunction
    -> Ptr ()
    {- ^ /@userData@/: user data passed to the function -}
    -> m ()
dynamic_TaskFunction __funPtr userData = liftIO $ do
    (__dynamic_C_TaskFunction __funPtr) userData
    return ()

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

{- |
A function that will repeatedly be called in the thread created by
a 'GI.Gst.Objects.Task.Task'.
-}
type TaskFunction =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `TaskFunction`@.
noTaskFunction :: Maybe TaskFunction
noTaskFunction = Nothing

{- |
A function that will repeatedly be called in the thread created by
a 'GI.Gst.Objects.Task.Task'.
-}
type TaskFunction_WithClosures =
    Ptr ()
    {- ^ /@userData@/: user data passed to the function -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `TaskFunction_WithClosures`@.
noTaskFunction_WithClosures :: Maybe TaskFunction_WithClosures
noTaskFunction_WithClosures = Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_TaskFunction :: TaskFunction -> TaskFunction_WithClosures
drop_closures_TaskFunction _f _ = _f

-- | Wrap the callback into a `GClosure`.
genClosure_TaskFunction :: MonadIO m => TaskFunction -> m (GClosure C_TaskFunction)
genClosure_TaskFunction cb = liftIO $ do
    let cb' = drop_closures_TaskFunction cb
    let cb'' = wrap_TaskFunction Nothing cb'
    mk_TaskFunction cb'' >>= B.GClosure.newGClosure


-- | Wrap a `TaskFunction` into a `C_TaskFunction`.
wrap_TaskFunction ::
    Maybe (Ptr (FunPtr C_TaskFunction)) ->
    TaskFunction_WithClosures ->
    C_TaskFunction
wrap_TaskFunction funptrptr _cb userData = do
    _cb  userData
    maybeReleaseFunPtr funptrptr


-- callback TagMergeFunc
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "dest", argType = TInterface (Name {namespace = "GObject", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the destination #GValue", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "src", argType = TInterface (Name {namespace = "GObject", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the source #GValue", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "A function for merging multiple values of a tag used when registering\ntags.", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_TagMergeFunc =
    Ptr GValue ->
    Ptr GValue ->
    IO ()

-- Args : [Arg {argCName = "dest", argType = TInterface (Name {namespace = "GObject", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the destination #GValue", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "src", argType = TInterface (Name {namespace = "GObject", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the source #GValue", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_TagMergeFunc :: FunPtr C_TagMergeFunc -> C_TagMergeFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_TagMergeFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_TagMergeFunc
    -> GValue
    {- ^ /@dest@/: the destination 'GI.GObject.Structs.Value.Value' -}
    -> GValue
    {- ^ /@src@/: the source 'GI.GObject.Structs.Value.Value' -}
    -> m ()
dynamic_TagMergeFunc __funPtr dest src = liftIO $ do
    dest' <- unsafeManagedPtrGetPtr dest
    src' <- unsafeManagedPtrGetPtr src
    (__dynamic_C_TagMergeFunc __funPtr) dest' src'
    touchManagedPtr dest
    touchManagedPtr src
    return ()

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

{- |
A function for merging multiple values of a tag used when registering
tags.
-}
type TagMergeFunc =
    GValue
    {- ^ /@dest@/: the destination 'GI.GObject.Structs.Value.Value' -}
    -> GValue
    {- ^ /@src@/: the source 'GI.GObject.Structs.Value.Value' -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `TagMergeFunc`@.
noTagMergeFunc :: Maybe TagMergeFunc
noTagMergeFunc = Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_TagMergeFunc :: MonadIO m => TagMergeFunc -> m (GClosure C_TagMergeFunc)
genClosure_TagMergeFunc cb = liftIO $ do
    let cb' = wrap_TagMergeFunc Nothing cb
    mk_TagMergeFunc cb' >>= B.GClosure.newGClosure


-- | Wrap a `TagMergeFunc` into a `C_TagMergeFunc`.
wrap_TagMergeFunc ::
    Maybe (Ptr (FunPtr C_TagMergeFunc)) ->
    TagMergeFunc ->
    C_TagMergeFunc
wrap_TagMergeFunc funptrptr _cb dest src = do
    B.ManagedPtr.withTransient GValue dest $ \dest' -> do
        B.ManagedPtr.withTransient GValue src $ \src' -> do
            _cb  dest' src'
            maybeReleaseFunPtr funptrptr


-- callback TagForeachFunc
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "list", argType = TInterface (Name {namespace = "Gst", name = "TagList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstTagList", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "tag", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a name of a tag in @list", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "A function that will be called in gst_tag_list_foreach(). The function may\nnot modify the tag list.", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_TagForeachFunc =
    Ptr Gst.TagList.TagList ->
    CString ->
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "list", argType = TInterface (Name {namespace = "Gst", name = "TagList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstTagList", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "tag", argType = TBasicType TUTF8, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a name of a tag in @list", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_TagForeachFunc :: FunPtr C_TagForeachFunc -> C_TagForeachFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_TagForeachFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_TagForeachFunc
    -> Gst.TagList.TagList
    {- ^ /@list@/: the 'GI.Gst.Structs.TagList.TagList' -}
    -> T.Text
    {- ^ /@tag@/: a name of a tag in /@list@/ -}
    -> Ptr ()
    {- ^ /@userData@/: user data -}
    -> m ()
dynamic_TagForeachFunc __funPtr list tag userData = liftIO $ do
    list' <- unsafeManagedPtrGetPtr list
    tag' <- textToCString tag
    (__dynamic_C_TagForeachFunc __funPtr) list' tag' userData
    touchManagedPtr list
    freeMem tag'
    return ()

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

{- |
A function that will be called in 'GI.Gst.Structs.TagList.tagListForeach'. The function may
not modify the tag list.
-}
type TagForeachFunc =
    Gst.TagList.TagList
    {- ^ /@list@/: the 'GI.Gst.Structs.TagList.TagList' -}
    -> T.Text
    {- ^ /@tag@/: a name of a tag in /@list@/ -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `TagForeachFunc`@.
noTagForeachFunc :: Maybe TagForeachFunc
noTagForeachFunc = Nothing

{- |
A function that will be called in 'GI.Gst.Structs.TagList.tagListForeach'. The function may
not modify the tag list.
-}
type TagForeachFunc_WithClosures =
    Gst.TagList.TagList
    {- ^ /@list@/: the 'GI.Gst.Structs.TagList.TagList' -}
    -> T.Text
    {- ^ /@tag@/: a name of a tag in /@list@/ -}
    -> Ptr ()
    {- ^ /@userData@/: user data -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `TagForeachFunc_WithClosures`@.
noTagForeachFunc_WithClosures :: Maybe TagForeachFunc_WithClosures
noTagForeachFunc_WithClosures = Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_TagForeachFunc :: TagForeachFunc -> TagForeachFunc_WithClosures
drop_closures_TagForeachFunc _f list tag _ = _f list tag

-- | Wrap the callback into a `GClosure`.
genClosure_TagForeachFunc :: MonadIO m => TagForeachFunc -> m (GClosure C_TagForeachFunc)
genClosure_TagForeachFunc cb = liftIO $ do
    let cb' = drop_closures_TagForeachFunc cb
    let cb'' = wrap_TagForeachFunc Nothing cb'
    mk_TagForeachFunc cb'' >>= B.GClosure.newGClosure


-- | Wrap a `TagForeachFunc` into a `C_TagForeachFunc`.
wrap_TagForeachFunc ::
    Maybe (Ptr (FunPtr C_TagForeachFunc)) ->
    TagForeachFunc_WithClosures ->
    C_TagForeachFunc
wrap_TagForeachFunc funptrptr _cb list tag userData = do
    B.ManagedPtr.withTransient Gst.TagList.TagList list $ \list' -> do
        tag' <- cstringToText tag
        _cb  list' tag' userData
        maybeReleaseFunPtr funptrptr


-- callback StructureMapFunc
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE if the map operation should continue, %FALSE if\nthe map operation should stop with %FALSE.", sinceVersion = Nothing}, args = [Arg {argCName = "field_id", argType = TBasicType TUInt32, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GQuark of the field name", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TInterface (Name {namespace = "GObject", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GValue of the field", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "A function that will be called in gst_structure_map_in_place(). The function\nmay modify @value.", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_StructureMapFunc =
    Word32 ->
    Ptr GValue ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "field_id", argType = TBasicType TUInt32, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GQuark of the field name", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TInterface (Name {namespace = "GObject", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GValue of the field", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_StructureMapFunc :: FunPtr C_StructureMapFunc -> C_StructureMapFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_StructureMapFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_StructureMapFunc
    -> Word32
    {- ^ /@fieldId@/: the @/GQuark/@ of the field name -}
    -> GValue
    {- ^ /@value@/: the 'GI.GObject.Structs.Value.Value' of the field -}
    -> Ptr ()
    {- ^ /@userData@/: user data -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the map operation should continue, 'False' if
the map operation should stop with 'False'. -}
dynamic_StructureMapFunc __funPtr fieldId value userData = liftIO $ do
    value' <- unsafeManagedPtrGetPtr value
    result <- (__dynamic_C_StructureMapFunc __funPtr) fieldId value' userData
    let result' = (/= 0) result
    touchManagedPtr value
    return result'

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

{- |
A function that will be called in 'GI.Gst.Structs.Structure.structureMapInPlace'. The function
may modify /@value@/.
-}
type StructureMapFunc =
    Word32
    {- ^ /@fieldId@/: the @/GQuark/@ of the field name -}
    -> GValue
    {- ^ /@value@/: the 'GI.GObject.Structs.Value.Value' of the field -}
    -> IO Bool
    {- ^ __Returns:__ 'True' if the map operation should continue, 'False' if
the map operation should stop with 'False'. -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `StructureMapFunc`@.
noStructureMapFunc :: Maybe StructureMapFunc
noStructureMapFunc = Nothing

{- |
A function that will be called in 'GI.Gst.Structs.Structure.structureMapInPlace'. The function
may modify /@value@/.
-}
type StructureMapFunc_WithClosures =
    Word32
    {- ^ /@fieldId@/: the @/GQuark/@ of the field name -}
    -> GValue
    {- ^ /@value@/: the 'GI.GObject.Structs.Value.Value' of the field -}
    -> Ptr ()
    {- ^ /@userData@/: user data -}
    -> IO Bool
    {- ^ __Returns:__ 'True' if the map operation should continue, 'False' if
the map operation should stop with 'False'. -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `StructureMapFunc_WithClosures`@.
noStructureMapFunc_WithClosures :: Maybe StructureMapFunc_WithClosures
noStructureMapFunc_WithClosures = Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_StructureMapFunc :: StructureMapFunc -> StructureMapFunc_WithClosures
drop_closures_StructureMapFunc _f fieldId value _ = _f fieldId value

-- | Wrap the callback into a `GClosure`.
genClosure_StructureMapFunc :: MonadIO m => StructureMapFunc -> m (GClosure C_StructureMapFunc)
genClosure_StructureMapFunc cb = liftIO $ do
    let cb' = drop_closures_StructureMapFunc cb
    let cb'' = wrap_StructureMapFunc Nothing cb'
    mk_StructureMapFunc cb'' >>= B.GClosure.newGClosure


-- | Wrap a `StructureMapFunc` into a `C_StructureMapFunc`.
wrap_StructureMapFunc ::
    Maybe (Ptr (FunPtr C_StructureMapFunc)) ->
    StructureMapFunc_WithClosures ->
    C_StructureMapFunc
wrap_StructureMapFunc funptrptr _cb fieldId value userData = do
    B.ManagedPtr.withTransient GValue value $ \value' -> do
        result <- _cb  fieldId value' userData
        maybeReleaseFunPtr funptrptr
        let result' = (fromIntegral . fromEnum) result
        return result'


-- callback StructureForeachFunc
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE if the foreach operation should continue, %FALSE if\nthe foreach operation should stop with %FALSE.", sinceVersion = Nothing}, args = [Arg {argCName = "field_id", argType = TBasicType TUInt32, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GQuark of the field name", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TInterface (Name {namespace = "GObject", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GValue of the field", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "A function that will be called in gst_structure_foreach(). The function may\nnot modify @value.", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_StructureForeachFunc =
    Word32 ->
    Ptr GValue ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "field_id", argType = TBasicType TUInt32, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GQuark of the field name", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TInterface (Name {namespace = "GObject", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GValue of the field", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_StructureForeachFunc :: FunPtr C_StructureForeachFunc -> C_StructureForeachFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_StructureForeachFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_StructureForeachFunc
    -> Word32
    {- ^ /@fieldId@/: the @/GQuark/@ of the field name -}
    -> GValue
    {- ^ /@value@/: the 'GI.GObject.Structs.Value.Value' of the field -}
    -> Ptr ()
    {- ^ /@userData@/: user data -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the foreach operation should continue, 'False' if
the foreach operation should stop with 'False'. -}
dynamic_StructureForeachFunc __funPtr fieldId value userData = liftIO $ do
    value' <- unsafeManagedPtrGetPtr value
    result <- (__dynamic_C_StructureForeachFunc __funPtr) fieldId value' userData
    let result' = (/= 0) result
    touchManagedPtr value
    return result'

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

{- |
A function that will be called in 'GI.Gst.Structs.Structure.structureForeach'. The function may
not modify /@value@/.
-}
type StructureForeachFunc =
    Word32
    {- ^ /@fieldId@/: the @/GQuark/@ of the field name -}
    -> GValue
    {- ^ /@value@/: the 'GI.GObject.Structs.Value.Value' of the field -}
    -> IO Bool
    {- ^ __Returns:__ 'True' if the foreach operation should continue, 'False' if
the foreach operation should stop with 'False'. -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `StructureForeachFunc`@.
noStructureForeachFunc :: Maybe StructureForeachFunc
noStructureForeachFunc = Nothing

{- |
A function that will be called in 'GI.Gst.Structs.Structure.structureForeach'. The function may
not modify /@value@/.
-}
type StructureForeachFunc_WithClosures =
    Word32
    {- ^ /@fieldId@/: the @/GQuark/@ of the field name -}
    -> GValue
    {- ^ /@value@/: the 'GI.GObject.Structs.Value.Value' of the field -}
    -> Ptr ()
    {- ^ /@userData@/: user data -}
    -> IO Bool
    {- ^ __Returns:__ 'True' if the foreach operation should continue, 'False' if
the foreach operation should stop with 'False'. -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `StructureForeachFunc_WithClosures`@.
noStructureForeachFunc_WithClosures :: Maybe StructureForeachFunc_WithClosures
noStructureForeachFunc_WithClosures = Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_StructureForeachFunc :: StructureForeachFunc -> StructureForeachFunc_WithClosures
drop_closures_StructureForeachFunc _f fieldId value _ = _f fieldId value

-- | Wrap the callback into a `GClosure`.
genClosure_StructureForeachFunc :: MonadIO m => StructureForeachFunc -> m (GClosure C_StructureForeachFunc)
genClosure_StructureForeachFunc cb = liftIO $ do
    let cb' = drop_closures_StructureForeachFunc cb
    let cb'' = wrap_StructureForeachFunc Nothing cb'
    mk_StructureForeachFunc cb'' >>= B.GClosure.newGClosure


-- | Wrap a `StructureForeachFunc` into a `C_StructureForeachFunc`.
wrap_StructureForeachFunc ::
    Maybe (Ptr (FunPtr C_StructureForeachFunc)) ->
    StructureForeachFunc_WithClosures ->
    C_StructureForeachFunc
wrap_StructureForeachFunc funptrptr _cb fieldId value userData = do
    B.ManagedPtr.withTransient GValue value $ \value' -> do
        result <- _cb  fieldId value' userData
        maybeReleaseFunPtr funptrptr
        let result' = (fromIntegral . fromEnum) result
        return result'


-- callback StructureFilterMapFunc
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE if the field should be preserved, %FALSE if it\nshould be removed.", sinceVersion = Nothing}, args = [Arg {argCName = "field_id", argType = TBasicType TUInt32, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GQuark of the field name", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TInterface (Name {namespace = "GObject", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GValue of the field", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "A function that will be called in gst_structure_filter_and_map_in_place().\nThe function may modify @value, and the value will be removed from\nthe structure if %FALSE is returned.", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_StructureFilterMapFunc =
    Word32 ->
    Ptr GValue ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "field_id", argType = TBasicType TUInt32, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GQuark of the field name", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "value", argType = TInterface (Name {namespace = "GObject", name = "Value"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GValue of the field", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_StructureFilterMapFunc :: FunPtr C_StructureFilterMapFunc -> C_StructureFilterMapFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_StructureFilterMapFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_StructureFilterMapFunc
    -> Word32
    {- ^ /@fieldId@/: the @/GQuark/@ of the field name -}
    -> GValue
    {- ^ /@value@/: the 'GI.GObject.Structs.Value.Value' of the field -}
    -> Ptr ()
    {- ^ /@userData@/: user data -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the field should be preserved, 'False' if it
should be removed. -}
dynamic_StructureFilterMapFunc __funPtr fieldId value userData = liftIO $ do
    value' <- unsafeManagedPtrGetPtr value
    result <- (__dynamic_C_StructureFilterMapFunc __funPtr) fieldId value' userData
    let result' = (/= 0) result
    touchManagedPtr value
    return result'

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

{- |
A function that will be called in 'GI.Gst.Structs.Structure.structureFilterAndMapInPlace'.
The function may modify /@value@/, and the value will be removed from
the structure if 'False' is returned.
-}
type StructureFilterMapFunc =
    Word32
    {- ^ /@fieldId@/: the @/GQuark/@ of the field name -}
    -> GValue
    {- ^ /@value@/: the 'GI.GObject.Structs.Value.Value' of the field -}
    -> IO Bool
    {- ^ __Returns:__ 'True' if the field should be preserved, 'False' if it
should be removed. -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `StructureFilterMapFunc`@.
noStructureFilterMapFunc :: Maybe StructureFilterMapFunc
noStructureFilterMapFunc = Nothing

{- |
A function that will be called in 'GI.Gst.Structs.Structure.structureFilterAndMapInPlace'.
The function may modify /@value@/, and the value will be removed from
the structure if 'False' is returned.
-}
type StructureFilterMapFunc_WithClosures =
    Word32
    {- ^ /@fieldId@/: the @/GQuark/@ of the field name -}
    -> GValue
    {- ^ /@value@/: the 'GI.GObject.Structs.Value.Value' of the field -}
    -> Ptr ()
    {- ^ /@userData@/: user data -}
    -> IO Bool
    {- ^ __Returns:__ 'True' if the field should be preserved, 'False' if it
should be removed. -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `StructureFilterMapFunc_WithClosures`@.
noStructureFilterMapFunc_WithClosures :: Maybe StructureFilterMapFunc_WithClosures
noStructureFilterMapFunc_WithClosures = Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_StructureFilterMapFunc :: StructureFilterMapFunc -> StructureFilterMapFunc_WithClosures
drop_closures_StructureFilterMapFunc _f fieldId value _ = _f fieldId value

-- | Wrap the callback into a `GClosure`.
genClosure_StructureFilterMapFunc :: MonadIO m => StructureFilterMapFunc -> m (GClosure C_StructureFilterMapFunc)
genClosure_StructureFilterMapFunc cb = liftIO $ do
    let cb' = drop_closures_StructureFilterMapFunc cb
    let cb'' = wrap_StructureFilterMapFunc Nothing cb'
    mk_StructureFilterMapFunc cb'' >>= B.GClosure.newGClosure


-- | Wrap a `StructureFilterMapFunc` into a `C_StructureFilterMapFunc`.
wrap_StructureFilterMapFunc ::
    Maybe (Ptr (FunPtr C_StructureFilterMapFunc)) ->
    StructureFilterMapFunc_WithClosures ->
    C_StructureFilterMapFunc
wrap_StructureFilterMapFunc funptrptr _cb fieldId value userData = do
    B.ManagedPtr.withTransient GValue value $ \value' -> do
        result <- _cb  fieldId value' userData
        maybeReleaseFunPtr funptrptr
        let result' = (fromIntegral . fromEnum) result
        return result'


-- callback PromiseChangeFunc
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "promise", argType = TInterface (Name {namespace = "Gst", name = "Promise"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstPromise", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Just "1.14"}}
-- | Type for the callback on the (unwrapped) C side.
type C_PromiseChangeFunc =
    Ptr Gst.Promise.Promise ->
    Ptr () ->
    IO ()

-- Args : [Arg {argCName = "promise", argType = TInterface (Name {namespace = "Gst", name = "Promise"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstPromise", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "user data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_PromiseChangeFunc :: FunPtr C_PromiseChangeFunc -> C_PromiseChangeFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PromiseChangeFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_PromiseChangeFunc
    -> Gst.Promise.Promise
    {- ^ /@promise@/: a 'GI.Gst.Structs.Promise.Promise' -}
    -> Ptr ()
    {- ^ /@userData@/: user data -}
    -> m ()
dynamic_PromiseChangeFunc __funPtr promise userData = liftIO $ do
    promise' <- unsafeManagedPtrGetPtr promise
    (__dynamic_C_PromiseChangeFunc __funPtr) promise' userData
    touchManagedPtr promise
    return ()

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

{- |
/No description available in the introspection data./

/Since: 1.14/
-}
type PromiseChangeFunc =
    Gst.Promise.Promise
    {- ^ /@promise@/: a 'GI.Gst.Structs.Promise.Promise' -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `PromiseChangeFunc`@.
noPromiseChangeFunc :: Maybe PromiseChangeFunc
noPromiseChangeFunc = Nothing

{- |
/No description available in the introspection data./

/Since: 1.14/
-}
type PromiseChangeFunc_WithClosures =
    Gst.Promise.Promise
    {- ^ /@promise@/: a 'GI.Gst.Structs.Promise.Promise' -}
    -> Ptr ()
    {- ^ /@userData@/: user data -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `PromiseChangeFunc_WithClosures`@.
noPromiseChangeFunc_WithClosures :: Maybe PromiseChangeFunc_WithClosures
noPromiseChangeFunc_WithClosures = Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_PromiseChangeFunc :: PromiseChangeFunc -> PromiseChangeFunc_WithClosures
drop_closures_PromiseChangeFunc _f promise _ = _f promise

-- | Wrap the callback into a `GClosure`.
genClosure_PromiseChangeFunc :: MonadIO m => PromiseChangeFunc -> m (GClosure C_PromiseChangeFunc)
genClosure_PromiseChangeFunc cb = liftIO $ do
    let cb' = drop_closures_PromiseChangeFunc cb
    let cb'' = wrap_PromiseChangeFunc Nothing cb'
    mk_PromiseChangeFunc cb'' >>= B.GClosure.newGClosure


-- | Wrap a `PromiseChangeFunc` into a `C_PromiseChangeFunc`.
wrap_PromiseChangeFunc ::
    Maybe (Ptr (FunPtr C_PromiseChangeFunc)) ->
    PromiseChangeFunc_WithClosures ->
    C_PromiseChangeFunc
wrap_PromiseChangeFunc funptrptr _cb promise userData = do
    B.ManagedPtr.withTransient Gst.Promise.Promise promise $ \promise' -> do
        _cb  promise' userData
        maybeReleaseFunPtr funptrptr


-- callback PluginInitFunc
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE if plugin initialised successfully", sinceVersion = Nothing}, args = [Arg {argCName = "plugin", argType = TInterface (Name {namespace = "Gst", name = "Plugin"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The plugin object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "A plugin should provide a pointer to a function of this type in the\nplugin_desc struct.\nThis function will be called by the loader at startup. One would then\nregister each #GstPluginFeature.", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_PluginInitFunc =
    Ptr Gst.Plugin.Plugin ->
    IO CInt

-- Args : [Arg {argCName = "plugin", argType = TInterface (Name {namespace = "Gst", name = "Plugin"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The plugin object", 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 "dynamic" __dynamic_C_PluginInitFunc :: FunPtr C_PluginInitFunc -> C_PluginInitFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PluginInitFunc ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.Plugin.IsPlugin a) =>
    FunPtr C_PluginInitFunc
    -> a
    {- ^ /@plugin@/: The plugin object -}
    -> m Bool
    {- ^ __Returns:__ 'True' if plugin initialised successfully -}
dynamic_PluginInitFunc __funPtr plugin = liftIO $ do
    plugin' <- unsafeManagedPtrCastPtr plugin
    result <- (__dynamic_C_PluginInitFunc __funPtr) plugin'
    let result' = (/= 0) result
    touchManagedPtr plugin
    return result'

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

{- |
A plugin should provide a pointer to a function of this type in the
plugin_desc struct.
This function will be called by the loader at startup. One would then
register each 'GI.Gst.Objects.PluginFeature.PluginFeature'.
-}
type PluginInitFunc =
    Gst.Plugin.Plugin
    {- ^ /@plugin@/: The plugin object -}
    -> IO Bool
    {- ^ __Returns:__ 'True' if plugin initialised successfully -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `PluginInitFunc`@.
noPluginInitFunc :: Maybe PluginInitFunc
noPluginInitFunc = Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_PluginInitFunc :: MonadIO m => PluginInitFunc -> m (GClosure C_PluginInitFunc)
genClosure_PluginInitFunc cb = liftIO $ do
    let cb' = wrap_PluginInitFunc Nothing cb
    mk_PluginInitFunc cb' >>= B.GClosure.newGClosure


-- | Wrap a `PluginInitFunc` into a `C_PluginInitFunc`.
wrap_PluginInitFunc ::
    Maybe (Ptr (FunPtr C_PluginInitFunc)) ->
    PluginInitFunc ->
    C_PluginInitFunc
wrap_PluginInitFunc funptrptr _cb plugin = do
    plugin' <- (newObject Gst.Plugin.Plugin) plugin
    result <- _cb  plugin'
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback PluginInitFullFunc
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE if plugin initialised successfully", sinceVersion = Nothing}, args = [Arg {argCName = "plugin", argType = TInterface (Name {namespace = "Gst", name = "Plugin"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The plugin object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "extra data", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "A plugin should provide a pointer to a function of either #GstPluginInitFunc\nor this type in the plugin_desc struct.\nThe function will be called by the loader at startup. One would then\nregister each #GstPluginFeature. This version allows\nuser data to be passed to init function (useful for bindings).", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_PluginInitFullFunc =
    Ptr Gst.Plugin.Plugin ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "plugin", argType = TInterface (Name {namespace = "Gst", name = "Plugin"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The plugin object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "extra data", 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 "dynamic" __dynamic_C_PluginInitFullFunc :: FunPtr C_PluginInitFullFunc -> C_PluginInitFullFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PluginInitFullFunc ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.Plugin.IsPlugin a) =>
    FunPtr C_PluginInitFullFunc
    -> a
    {- ^ /@plugin@/: The plugin object -}
    -> Ptr ()
    {- ^ /@userData@/: extra data -}
    -> m Bool
    {- ^ __Returns:__ 'True' if plugin initialised successfully -}
dynamic_PluginInitFullFunc __funPtr plugin userData = liftIO $ do
    plugin' <- unsafeManagedPtrCastPtr plugin
    result <- (__dynamic_C_PluginInitFullFunc __funPtr) plugin' userData
    let result' = (/= 0) result
    touchManagedPtr plugin
    return result'

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

{- |
A plugin should provide a pointer to a function of either 'GI.Gst.Callbacks.PluginInitFunc'
or this type in the plugin_desc struct.
The function will be called by the loader at startup. One would then
register each 'GI.Gst.Objects.PluginFeature.PluginFeature'. This version allows
user data to be passed to init function (useful for bindings).
-}
type PluginInitFullFunc =
    Gst.Plugin.Plugin
    {- ^ /@plugin@/: The plugin object -}
    -> IO Bool
    {- ^ __Returns:__ 'True' if plugin initialised successfully -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `PluginInitFullFunc`@.
noPluginInitFullFunc :: Maybe PluginInitFullFunc
noPluginInitFullFunc = Nothing

{- |
A plugin should provide a pointer to a function of either 'GI.Gst.Callbacks.PluginInitFunc'
or this type in the plugin_desc struct.
The function will be called by the loader at startup. One would then
register each 'GI.Gst.Objects.PluginFeature.PluginFeature'. This version allows
user data to be passed to init function (useful for bindings).
-}
type PluginInitFullFunc_WithClosures =
    Gst.Plugin.Plugin
    {- ^ /@plugin@/: The plugin object -}
    -> Ptr ()
    {- ^ /@userData@/: extra data -}
    -> IO Bool
    {- ^ __Returns:__ 'True' if plugin initialised successfully -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `PluginInitFullFunc_WithClosures`@.
noPluginInitFullFunc_WithClosures :: Maybe PluginInitFullFunc_WithClosures
noPluginInitFullFunc_WithClosures = Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_PluginInitFullFunc :: PluginInitFullFunc -> PluginInitFullFunc_WithClosures
drop_closures_PluginInitFullFunc _f plugin _ = _f plugin

-- | Wrap the callback into a `GClosure`.
genClosure_PluginInitFullFunc :: MonadIO m => PluginInitFullFunc -> m (GClosure C_PluginInitFullFunc)
genClosure_PluginInitFullFunc cb = liftIO $ do
    let cb' = drop_closures_PluginInitFullFunc cb
    let cb'' = wrap_PluginInitFullFunc Nothing cb'
    mk_PluginInitFullFunc cb'' >>= B.GClosure.newGClosure


-- | Wrap a `PluginInitFullFunc` into a `C_PluginInitFullFunc`.
wrap_PluginInitFullFunc ::
    Maybe (Ptr (FunPtr C_PluginInitFullFunc)) ->
    PluginInitFullFunc_WithClosures ->
    C_PluginInitFullFunc
wrap_PluginInitFullFunc funptrptr _cb plugin userData = do
    plugin' <- (newObject Gst.Plugin.Plugin) plugin
    result <- _cb  plugin' userData
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback PluginFilter
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE for a positive match, %FALSE otherwise", sinceVersion = Nothing}, args = [Arg {argCName = "plugin", argType = TInterface (Name {namespace = "Gst", name = "Plugin"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the plugin to check", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the user_data that has been passed on e.g. gst_registry_plugin_filter()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "A function that can be used with e.g. gst_registry_plugin_filter()\nto get a list of plugins that match certain criteria.", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_PluginFilter =
    Ptr Gst.Plugin.Plugin ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "plugin", argType = TInterface (Name {namespace = "Gst", name = "Plugin"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the plugin to check", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the user_data that has been passed on e.g. gst_registry_plugin_filter()", 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 "dynamic" __dynamic_C_PluginFilter :: FunPtr C_PluginFilter -> C_PluginFilter

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PluginFilter ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.Plugin.IsPlugin a) =>
    FunPtr C_PluginFilter
    -> a
    {- ^ /@plugin@/: the plugin to check -}
    -> Ptr ()
    {- ^ /@userData@/: the user_data that has been passed on e.g. 'GI.Gst.Objects.Registry.registryPluginFilter' -}
    -> m Bool
    {- ^ __Returns:__ 'True' for a positive match, 'False' otherwise -}
dynamic_PluginFilter __funPtr plugin userData = liftIO $ do
    plugin' <- unsafeManagedPtrCastPtr plugin
    result <- (__dynamic_C_PluginFilter __funPtr) plugin' userData
    let result' = (/= 0) result
    touchManagedPtr plugin
    return result'

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

{- |
A function that can be used with e.g. 'GI.Gst.Objects.Registry.registryPluginFilter'
to get a list of plugins that match certain criteria.
-}
type PluginFilter =
    Gst.Plugin.Plugin
    {- ^ /@plugin@/: the plugin to check -}
    -> IO Bool
    {- ^ __Returns:__ 'True' for a positive match, 'False' otherwise -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `PluginFilter`@.
noPluginFilter :: Maybe PluginFilter
noPluginFilter = Nothing

{- |
A function that can be used with e.g. 'GI.Gst.Objects.Registry.registryPluginFilter'
to get a list of plugins that match certain criteria.
-}
type PluginFilter_WithClosures =
    Gst.Plugin.Plugin
    {- ^ /@plugin@/: the plugin to check -}
    -> Ptr ()
    {- ^ /@userData@/: the user_data that has been passed on e.g. 'GI.Gst.Objects.Registry.registryPluginFilter' -}
    -> IO Bool
    {- ^ __Returns:__ 'True' for a positive match, 'False' otherwise -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `PluginFilter_WithClosures`@.
noPluginFilter_WithClosures :: Maybe PluginFilter_WithClosures
noPluginFilter_WithClosures = Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_PluginFilter :: PluginFilter -> PluginFilter_WithClosures
drop_closures_PluginFilter _f plugin _ = _f plugin

-- | Wrap the callback into a `GClosure`.
genClosure_PluginFilter :: MonadIO m => PluginFilter -> m (GClosure C_PluginFilter)
genClosure_PluginFilter cb = liftIO $ do
    let cb' = drop_closures_PluginFilter cb
    let cb'' = wrap_PluginFilter Nothing cb'
    mk_PluginFilter cb'' >>= B.GClosure.newGClosure


-- | Wrap a `PluginFilter` into a `C_PluginFilter`.
wrap_PluginFilter ::
    Maybe (Ptr (FunPtr C_PluginFilter)) ->
    PluginFilter_WithClosures ->
    C_PluginFilter
wrap_PluginFilter funptrptr _cb plugin userData = do
    plugin' <- (newObject Gst.Plugin.Plugin) plugin
    result <- _cb  plugin' userData
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback PluginFeatureFilter
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE for a positive match, %FALSE otherwise", sinceVersion = Nothing}, args = [Arg {argCName = "feature", argType = TInterface (Name {namespace = "Gst", name = "PluginFeature"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the pluginfeature to check", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the user_data that has been passed on e.g.\n gst_registry_feature_filter()", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "A function that can be used with e.g. gst_registry_feature_filter()\nto get a list of pluginfeature that match certain criteria.", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_PluginFeatureFilter =
    Ptr Gst.PluginFeature.PluginFeature ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "feature", argType = TInterface (Name {namespace = "Gst", name = "PluginFeature"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the pluginfeature to check", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the user_data that has been passed on e.g.\n gst_registry_feature_filter()", 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 "dynamic" __dynamic_C_PluginFeatureFilter :: FunPtr C_PluginFeatureFilter -> C_PluginFeatureFilter

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PluginFeatureFilter ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.PluginFeature.IsPluginFeature a) =>
    FunPtr C_PluginFeatureFilter
    -> a
    {- ^ /@feature@/: the pluginfeature to check -}
    -> Ptr ()
    {- ^ /@userData@/: the user_data that has been passed on e.g.
 'GI.Gst.Objects.Registry.registryFeatureFilter' -}
    -> m Bool
    {- ^ __Returns:__ 'True' for a positive match, 'False' otherwise -}
dynamic_PluginFeatureFilter __funPtr feature userData = liftIO $ do
    feature' <- unsafeManagedPtrCastPtr feature
    result <- (__dynamic_C_PluginFeatureFilter __funPtr) feature' userData
    let result' = (/= 0) result
    touchManagedPtr feature
    return result'

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

{- |
A function that can be used with e.g. 'GI.Gst.Objects.Registry.registryFeatureFilter'
to get a list of pluginfeature that match certain criteria.
-}
type PluginFeatureFilter =
    Gst.PluginFeature.PluginFeature
    {- ^ /@feature@/: the pluginfeature to check -}
    -> IO Bool
    {- ^ __Returns:__ 'True' for a positive match, 'False' otherwise -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `PluginFeatureFilter`@.
noPluginFeatureFilter :: Maybe PluginFeatureFilter
noPluginFeatureFilter = Nothing

{- |
A function that can be used with e.g. 'GI.Gst.Objects.Registry.registryFeatureFilter'
to get a list of pluginfeature that match certain criteria.
-}
type PluginFeatureFilter_WithClosures =
    Gst.PluginFeature.PluginFeature
    {- ^ /@feature@/: the pluginfeature to check -}
    -> Ptr ()
    {- ^ /@userData@/: the user_data that has been passed on e.g.
 'GI.Gst.Objects.Registry.registryFeatureFilter' -}
    -> IO Bool
    {- ^ __Returns:__ 'True' for a positive match, 'False' otherwise -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `PluginFeatureFilter_WithClosures`@.
noPluginFeatureFilter_WithClosures :: Maybe PluginFeatureFilter_WithClosures
noPluginFeatureFilter_WithClosures = Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_PluginFeatureFilter :: PluginFeatureFilter -> PluginFeatureFilter_WithClosures
drop_closures_PluginFeatureFilter _f feature _ = _f feature

-- | Wrap the callback into a `GClosure`.
genClosure_PluginFeatureFilter :: MonadIO m => PluginFeatureFilter -> m (GClosure C_PluginFeatureFilter)
genClosure_PluginFeatureFilter cb = liftIO $ do
    let cb' = drop_closures_PluginFeatureFilter cb
    let cb'' = wrap_PluginFeatureFilter Nothing cb'
    mk_PluginFeatureFilter cb'' >>= B.GClosure.newGClosure


-- | Wrap a `PluginFeatureFilter` into a `C_PluginFeatureFilter`.
wrap_PluginFeatureFilter ::
    Maybe (Ptr (FunPtr C_PluginFeatureFilter)) ->
    PluginFeatureFilter_WithClosures ->
    C_PluginFeatureFilter
wrap_PluginFeatureFilter funptrptr _cb feature userData = do
    feature' <- (newObject Gst.PluginFeature.PluginFeature) feature
    result <- _cb  feature' userData
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback PadUnlinkFunction
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstPad that is linked.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TInterface (Name {namespace = "Gst", name = "Object"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT\n         flag is set, @parent is guaranteed to be not-%NULL and remain valid\n         during the execution of this function.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Function signature to handle a unlinking the pad prom its peer.\n\nThe pad's lock is already held when the unlink function is called, so most\npad functions cannot be called from within the callback.", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_PadUnlinkFunction =
    Ptr Gst.Pad.Pad ->
    Ptr Gst.Object.Object ->
    IO ()

-- Args : [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstPad that is linked.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TInterface (Name {namespace = "Gst", name = "Object"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT\n         flag is set, @parent is guaranteed to be not-%NULL and remain valid\n         during the execution of this function.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_PadUnlinkFunction :: FunPtr C_PadUnlinkFunction -> C_PadUnlinkFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PadUnlinkFunction ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.Pad.IsPad a, Gst.Object.IsObject b) =>
    FunPtr C_PadUnlinkFunction
    -> a
    {- ^ /@pad@/: the 'GI.Gst.Objects.Pad.Pad' that is linked. -}
    -> Maybe (b)
    {- ^ /@parent@/: the parent of /@pad@/. If the @/GST_PAD_FLAG_NEED_PARENT/@
         flag is set, /@parent@/ is guaranteed to be not-'Nothing' and remain valid
         during the execution of this function. -}
    -> m ()
dynamic_PadUnlinkFunction __funPtr pad parent = liftIO $ do
    pad' <- unsafeManagedPtrCastPtr pad
    maybeParent <- case parent of
        Nothing -> return nullPtr
        Just jParent -> do
            jParent' <- unsafeManagedPtrCastPtr jParent
            return jParent'
    (__dynamic_C_PadUnlinkFunction __funPtr) pad' maybeParent
    touchManagedPtr pad
    whenJust parent touchManagedPtr
    return ()

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

{- |
Function signature to handle a unlinking the pad prom its peer.

The pad\'s lock is already held when the unlink function is called, so most
pad functions cannot be called from within the callback.
-}
type PadUnlinkFunction =
    Gst.Pad.Pad
    {- ^ /@pad@/: the 'GI.Gst.Objects.Pad.Pad' that is linked. -}
    -> Maybe Gst.Object.Object
    {- ^ /@parent@/: the parent of /@pad@/. If the @/GST_PAD_FLAG_NEED_PARENT/@
         flag is set, /@parent@/ is guaranteed to be not-'Nothing' and remain valid
         during the execution of this function. -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `PadUnlinkFunction`@.
noPadUnlinkFunction :: Maybe PadUnlinkFunction
noPadUnlinkFunction = Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_PadUnlinkFunction :: MonadIO m => PadUnlinkFunction -> m (GClosure C_PadUnlinkFunction)
genClosure_PadUnlinkFunction cb = liftIO $ do
    let cb' = wrap_PadUnlinkFunction Nothing cb
    mk_PadUnlinkFunction cb' >>= B.GClosure.newGClosure


-- | Wrap a `PadUnlinkFunction` into a `C_PadUnlinkFunction`.
wrap_PadUnlinkFunction ::
    Maybe (Ptr (FunPtr C_PadUnlinkFunction)) ->
    PadUnlinkFunction ->
    C_PadUnlinkFunction
wrap_PadUnlinkFunction funptrptr _cb pad parent = do
    pad' <- (newObject Gst.Pad.Pad) pad
    maybeParent <-
        if parent == nullPtr
        then return Nothing
        else do
            parent' <- (newObject Gst.Object.Object) parent
            return $ Just parent'
    _cb  pad' maybeParent
    maybeReleaseFunPtr funptrptr


-- callback PadStickyEventsForeachFunction
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE if the iteration should continue", sinceVersion = Nothing}, args = [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstPad.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "event", argType = TInterface (Name {namespace = "Gst", name = "Event"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a sticky #GstEvent.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the #gpointer to optional user data.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Callback used by gst_pad_sticky_events_foreach().\n\nWhen this function returns %TRUE, the next event will be\nreturned. When %FALSE is returned, gst_pad_sticky_events_foreach() will return.\n\nWhen @event is set to %NULL, the item will be removed from the list of sticky events.\n@event can be replaced by assigning a new reference to it.\nThis function is responsible for unreffing the old event when\nremoving or modifying.", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_PadStickyEventsForeachFunction =
    Ptr Gst.Pad.Pad ->
    Ptr Gst.Event.Event ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstPad.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "event", argType = TInterface (Name {namespace = "Gst", name = "Event"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a sticky #GstEvent.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the #gpointer to optional user data.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_PadStickyEventsForeachFunction :: FunPtr C_PadStickyEventsForeachFunction -> C_PadStickyEventsForeachFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PadStickyEventsForeachFunction ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.Pad.IsPad a) =>
    FunPtr C_PadStickyEventsForeachFunction
    -> a
    {- ^ /@pad@/: the 'GI.Gst.Objects.Pad.Pad'. -}
    -> Maybe (Gst.Event.Event)
    {- ^ /@event@/: a sticky 'GI.Gst.Structs.Event.Event'. -}
    -> Ptr ()
    {- ^ /@userData@/: the @/gpointer/@ to optional user data. -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the iteration should continue -}
dynamic_PadStickyEventsForeachFunction __funPtr pad event userData = liftIO $ do
    pad' <- unsafeManagedPtrCastPtr pad
    maybeEvent <- case event of
        Nothing -> return nullPtr
        Just jEvent -> do
            jEvent' <- unsafeManagedPtrGetPtr jEvent
            return jEvent'
    result <- (__dynamic_C_PadStickyEventsForeachFunction __funPtr) pad' maybeEvent userData
    let result' = (/= 0) result
    touchManagedPtr pad
    whenJust event touchManagedPtr
    return result'

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

{- |
Callback used by 'GI.Gst.Objects.Pad.padStickyEventsForeach'.

When this function returns 'True', the next event will be
returned. When 'False' is returned, 'GI.Gst.Objects.Pad.padStickyEventsForeach' will return.

When /@event@/ is set to 'Nothing', the item will be removed from the list of sticky events.
/@event@/ can be replaced by assigning a new reference to it.
This function is responsible for unreffing the old event when
removing or modifying.
-}
type PadStickyEventsForeachFunction =
    Gst.Pad.Pad
    {- ^ /@pad@/: the 'GI.Gst.Objects.Pad.Pad'. -}
    -> Maybe Gst.Event.Event
    {- ^ /@event@/: a sticky 'GI.Gst.Structs.Event.Event'. -}
    -> IO Bool
    {- ^ __Returns:__ 'True' if the iteration should continue -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `PadStickyEventsForeachFunction`@.
noPadStickyEventsForeachFunction :: Maybe PadStickyEventsForeachFunction
noPadStickyEventsForeachFunction = Nothing

{- |
Callback used by 'GI.Gst.Objects.Pad.padStickyEventsForeach'.

When this function returns 'True', the next event will be
returned. When 'False' is returned, 'GI.Gst.Objects.Pad.padStickyEventsForeach' will return.

When /@event@/ is set to 'Nothing', the item will be removed from the list of sticky events.
/@event@/ can be replaced by assigning a new reference to it.
This function is responsible for unreffing the old event when
removing or modifying.
-}
type PadStickyEventsForeachFunction_WithClosures =
    Gst.Pad.Pad
    {- ^ /@pad@/: the 'GI.Gst.Objects.Pad.Pad'. -}
    -> Maybe Gst.Event.Event
    {- ^ /@event@/: a sticky 'GI.Gst.Structs.Event.Event'. -}
    -> Ptr ()
    {- ^ /@userData@/: the @/gpointer/@ to optional user data. -}
    -> IO Bool
    {- ^ __Returns:__ 'True' if the iteration should continue -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `PadStickyEventsForeachFunction_WithClosures`@.
noPadStickyEventsForeachFunction_WithClosures :: Maybe PadStickyEventsForeachFunction_WithClosures
noPadStickyEventsForeachFunction_WithClosures = Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_PadStickyEventsForeachFunction :: PadStickyEventsForeachFunction -> PadStickyEventsForeachFunction_WithClosures
drop_closures_PadStickyEventsForeachFunction _f pad event _ = _f pad event

-- | Wrap the callback into a `GClosure`.
genClosure_PadStickyEventsForeachFunction :: MonadIO m => PadStickyEventsForeachFunction -> m (GClosure C_PadStickyEventsForeachFunction)
genClosure_PadStickyEventsForeachFunction cb = liftIO $ do
    let cb' = drop_closures_PadStickyEventsForeachFunction cb
    let cb'' = wrap_PadStickyEventsForeachFunction Nothing cb'
    mk_PadStickyEventsForeachFunction cb'' >>= B.GClosure.newGClosure


-- | Wrap a `PadStickyEventsForeachFunction` into a `C_PadStickyEventsForeachFunction`.
wrap_PadStickyEventsForeachFunction ::
    Maybe (Ptr (FunPtr C_PadStickyEventsForeachFunction)) ->
    PadStickyEventsForeachFunction_WithClosures ->
    C_PadStickyEventsForeachFunction
wrap_PadStickyEventsForeachFunction funptrptr _cb pad event userData = do
    pad' <- (newObject Gst.Pad.Pad) pad
    maybeEvent <-
        if event == nullPtr
        then return Nothing
        else do
            B.ManagedPtr.withTransient Gst.Event.Event event $ \event' -> do
                return $ Just event'
    result <- _cb  pad' maybeEvent userData
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback PadQueryFunction
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE if the query could be performed.", sinceVersion = Nothing}, args = [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstPad to query.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TInterface (Name {namespace = "Gst", name = "Object"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT\n         flag is set, @parent is guaranteed to be not-%NULL and remain valid\n         during the execution of this function.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "query", argType = TInterface (Name {namespace = "Gst", name = "Query"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstQuery object to execute", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "The signature of the query function.", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_PadQueryFunction =
    Ptr Gst.Pad.Pad ->
    Ptr Gst.Object.Object ->
    Ptr Gst.Query.Query ->
    IO CInt

-- Args : [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstPad to query.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TInterface (Name {namespace = "Gst", name = "Object"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT\n         flag is set, @parent is guaranteed to be not-%NULL and remain valid\n         during the execution of this function.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "query", argType = TInterface (Name {namespace = "Gst", name = "Query"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstQuery object to execute", 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 "dynamic" __dynamic_C_PadQueryFunction :: FunPtr C_PadQueryFunction -> C_PadQueryFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PadQueryFunction ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.Pad.IsPad a, Gst.Object.IsObject b) =>
    FunPtr C_PadQueryFunction
    -> a
    {- ^ /@pad@/: the 'GI.Gst.Objects.Pad.Pad' to query. -}
    -> Maybe (b)
    {- ^ /@parent@/: the parent of /@pad@/. If the @/GST_PAD_FLAG_NEED_PARENT/@
         flag is set, /@parent@/ is guaranteed to be not-'Nothing' and remain valid
         during the execution of this function. -}
    -> Gst.Query.Query
    {- ^ /@query@/: the 'GI.Gst.Structs.Query.Query' object to execute -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the query could be performed. -}
dynamic_PadQueryFunction __funPtr pad parent query = liftIO $ do
    pad' <- unsafeManagedPtrCastPtr pad
    maybeParent <- case parent of
        Nothing -> return nullPtr
        Just jParent -> do
            jParent' <- unsafeManagedPtrCastPtr jParent
            return jParent'
    query' <- unsafeManagedPtrGetPtr query
    result <- (__dynamic_C_PadQueryFunction __funPtr) pad' maybeParent query'
    let result' = (/= 0) result
    touchManagedPtr pad
    whenJust parent touchManagedPtr
    touchManagedPtr query
    return result'

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

{- |
The signature of the query function.
-}
type PadQueryFunction =
    Gst.Pad.Pad
    {- ^ /@pad@/: the 'GI.Gst.Objects.Pad.Pad' to query. -}
    -> Maybe Gst.Object.Object
    {- ^ /@parent@/: the parent of /@pad@/. If the @/GST_PAD_FLAG_NEED_PARENT/@
         flag is set, /@parent@/ is guaranteed to be not-'Nothing' and remain valid
         during the execution of this function. -}
    -> Gst.Query.Query
    {- ^ /@query@/: the 'GI.Gst.Structs.Query.Query' object to execute -}
    -> IO Bool
    {- ^ __Returns:__ 'True' if the query could be performed. -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `PadQueryFunction`@.
noPadQueryFunction :: Maybe PadQueryFunction
noPadQueryFunction = Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_PadQueryFunction :: MonadIO m => PadQueryFunction -> m (GClosure C_PadQueryFunction)
genClosure_PadQueryFunction cb = liftIO $ do
    let cb' = wrap_PadQueryFunction Nothing cb
    mk_PadQueryFunction cb' >>= B.GClosure.newGClosure


-- | Wrap a `PadQueryFunction` into a `C_PadQueryFunction`.
wrap_PadQueryFunction ::
    Maybe (Ptr (FunPtr C_PadQueryFunction)) ->
    PadQueryFunction ->
    C_PadQueryFunction
wrap_PadQueryFunction funptrptr _cb pad parent query = do
    pad' <- (newObject Gst.Pad.Pad) pad
    maybeParent <-
        if parent == nullPtr
        then return Nothing
        else do
            parent' <- (newObject Gst.Object.Object) parent
            return $ Just parent'
    B.ManagedPtr.withTransient Gst.Query.Query query $ \query' -> do
        result <- _cb  pad' maybeParent query'
        maybeReleaseFunPtr funptrptr
        let result' = (fromIntegral . fromEnum) result
        return result'


-- callback PadProbeCallback
--          -> Callable {returnType = Just (TInterface (Name {namespace = "Gst", name = "PadProbeReturn"})), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "a #GstPadProbeReturn", sinceVersion = Nothing}, args = [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstPad that is blocked", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "info", argType = TInterface (Name {namespace = "Gst", name = "PadProbeInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "#GstPadProbeInfo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the gpointer to optional user data.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Callback used by gst_pad_add_probe(). Gets called to notify about the current\nblocking type.\n\nThe callback is allowed to modify the data pointer in @info.", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_PadProbeCallback =
    Ptr Gst.Pad.Pad ->
    Ptr Gst.PadProbeInfo.PadProbeInfo ->
    Ptr () ->
    IO CUInt

-- Args : [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstPad that is blocked", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "info", argType = TInterface (Name {namespace = "Gst", name = "PadProbeInfo"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "#GstPadProbeInfo", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the gpointer to optional user data.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 2, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "PadProbeReturn"}))
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_PadProbeCallback :: FunPtr C_PadProbeCallback -> C_PadProbeCallback

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PadProbeCallback ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.Pad.IsPad a) =>
    FunPtr C_PadProbeCallback
    -> a
    {- ^ /@pad@/: the 'GI.Gst.Objects.Pad.Pad' that is blocked -}
    -> Gst.PadProbeInfo.PadProbeInfo
    {- ^ /@info@/: 'GI.Gst.Structs.PadProbeInfo.PadProbeInfo' -}
    -> Ptr ()
    {- ^ /@userData@/: the gpointer to optional user data. -}
    -> m Gst.Enums.PadProbeReturn
    {- ^ __Returns:__ a 'GI.Gst.Enums.PadProbeReturn' -}
dynamic_PadProbeCallback __funPtr pad info userData = liftIO $ do
    pad' <- unsafeManagedPtrCastPtr pad
    info' <- unsafeManagedPtrGetPtr info
    result <- (__dynamic_C_PadProbeCallback __funPtr) pad' info' userData
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr pad
    touchManagedPtr info
    return result'

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

{- |
Callback used by 'GI.Gst.Objects.Pad.padAddProbe'. Gets called to notify about the current
blocking type.

The callback is allowed to modify the data pointer in /@info@/.
-}
type PadProbeCallback =
    Gst.Pad.Pad
    {- ^ /@pad@/: the 'GI.Gst.Objects.Pad.Pad' that is blocked -}
    -> Gst.PadProbeInfo.PadProbeInfo
    {- ^ /@info@/: 'GI.Gst.Structs.PadProbeInfo.PadProbeInfo' -}
    -> IO Gst.Enums.PadProbeReturn
    {- ^ __Returns:__ a 'GI.Gst.Enums.PadProbeReturn' -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `PadProbeCallback`@.
noPadProbeCallback :: Maybe PadProbeCallback
noPadProbeCallback = Nothing

{- |
Callback used by 'GI.Gst.Objects.Pad.padAddProbe'. Gets called to notify about the current
blocking type.

The callback is allowed to modify the data pointer in /@info@/.
-}
type PadProbeCallback_WithClosures =
    Gst.Pad.Pad
    {- ^ /@pad@/: the 'GI.Gst.Objects.Pad.Pad' that is blocked -}
    -> Gst.PadProbeInfo.PadProbeInfo
    {- ^ /@info@/: 'GI.Gst.Structs.PadProbeInfo.PadProbeInfo' -}
    -> Ptr ()
    {- ^ /@userData@/: the gpointer to optional user data. -}
    -> IO Gst.Enums.PadProbeReturn
    {- ^ __Returns:__ a 'GI.Gst.Enums.PadProbeReturn' -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `PadProbeCallback_WithClosures`@.
noPadProbeCallback_WithClosures :: Maybe PadProbeCallback_WithClosures
noPadProbeCallback_WithClosures = Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_PadProbeCallback :: PadProbeCallback -> PadProbeCallback_WithClosures
drop_closures_PadProbeCallback _f pad info _ = _f pad info

-- | Wrap the callback into a `GClosure`.
genClosure_PadProbeCallback :: MonadIO m => PadProbeCallback -> m (GClosure C_PadProbeCallback)
genClosure_PadProbeCallback cb = liftIO $ do
    let cb' = drop_closures_PadProbeCallback cb
    let cb'' = wrap_PadProbeCallback Nothing cb'
    mk_PadProbeCallback cb'' >>= B.GClosure.newGClosure


-- | Wrap a `PadProbeCallback` into a `C_PadProbeCallback`.
wrap_PadProbeCallback ::
    Maybe (Ptr (FunPtr C_PadProbeCallback)) ->
    PadProbeCallback_WithClosures ->
    C_PadProbeCallback
wrap_PadProbeCallback funptrptr _cb pad info userData = do
    pad' <- (newObject Gst.Pad.Pad) pad
    info' <- (newPtr Gst.PadProbeInfo.PadProbeInfo) info
    result <- _cb  pad' info' userData
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback PadLinkFunction
--          -> Callable {returnType = Just (TInterface (Name {namespace = "Gst", name = "PadLinkReturn"})), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "the result of the link with the specified peer.", sinceVersion = Nothing}, args = [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstPad that is linked.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TInterface (Name {namespace = "Gst", name = "Object"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT\n         flag is set, @parent is guaranteed to be not-%NULL and remain valid\n         during the execution of this function.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "peer", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the peer #GstPad of the link", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Function signature to handle a new link on the pad.", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_PadLinkFunction =
    Ptr Gst.Pad.Pad ->
    Ptr Gst.Object.Object ->
    Ptr Gst.Pad.Pad ->
    IO CInt

-- Args : [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstPad that is linked.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TInterface (Name {namespace = "Gst", name = "Object"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT\n         flag is set, @parent is guaranteed to be not-%NULL and remain valid\n         during the execution of this function.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "peer", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the peer #GstPad of the link", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "PadLinkReturn"}))
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_PadLinkFunction :: FunPtr C_PadLinkFunction -> C_PadLinkFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PadLinkFunction ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.Pad.IsPad a, Gst.Object.IsObject b, Gst.Pad.IsPad c) =>
    FunPtr C_PadLinkFunction
    -> a
    {- ^ /@pad@/: the 'GI.Gst.Objects.Pad.Pad' that is linked. -}
    -> Maybe (b)
    {- ^ /@parent@/: the parent of /@pad@/. If the @/GST_PAD_FLAG_NEED_PARENT/@
         flag is set, /@parent@/ is guaranteed to be not-'Nothing' and remain valid
         during the execution of this function. -}
    -> c
    {- ^ /@peer@/: the peer 'GI.Gst.Objects.Pad.Pad' of the link -}
    -> m Gst.Enums.PadLinkReturn
    {- ^ __Returns:__ the result of the link with the specified peer. -}
dynamic_PadLinkFunction __funPtr pad parent peer = liftIO $ do
    pad' <- unsafeManagedPtrCastPtr pad
    maybeParent <- case parent of
        Nothing -> return nullPtr
        Just jParent -> do
            jParent' <- unsafeManagedPtrCastPtr jParent
            return jParent'
    peer' <- unsafeManagedPtrCastPtr peer
    result <- (__dynamic_C_PadLinkFunction __funPtr) pad' maybeParent peer'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr pad
    whenJust parent touchManagedPtr
    touchManagedPtr peer
    return result'

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

{- |
Function signature to handle a new link on the pad.
-}
type PadLinkFunction =
    Gst.Pad.Pad
    {- ^ /@pad@/: the 'GI.Gst.Objects.Pad.Pad' that is linked. -}
    -> Maybe Gst.Object.Object
    {- ^ /@parent@/: the parent of /@pad@/. If the @/GST_PAD_FLAG_NEED_PARENT/@
         flag is set, /@parent@/ is guaranteed to be not-'Nothing' and remain valid
         during the execution of this function. -}
    -> Gst.Pad.Pad
    {- ^ /@peer@/: the peer 'GI.Gst.Objects.Pad.Pad' of the link -}
    -> IO Gst.Enums.PadLinkReturn
    {- ^ __Returns:__ the result of the link with the specified peer. -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `PadLinkFunction`@.
noPadLinkFunction :: Maybe PadLinkFunction
noPadLinkFunction = Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_PadLinkFunction :: MonadIO m => PadLinkFunction -> m (GClosure C_PadLinkFunction)
genClosure_PadLinkFunction cb = liftIO $ do
    let cb' = wrap_PadLinkFunction Nothing cb
    mk_PadLinkFunction cb' >>= B.GClosure.newGClosure


-- | Wrap a `PadLinkFunction` into a `C_PadLinkFunction`.
wrap_PadLinkFunction ::
    Maybe (Ptr (FunPtr C_PadLinkFunction)) ->
    PadLinkFunction ->
    C_PadLinkFunction
wrap_PadLinkFunction funptrptr _cb pad parent peer = do
    pad' <- (newObject Gst.Pad.Pad) pad
    maybeParent <-
        if parent == nullPtr
        then return Nothing
        else do
            parent' <- (newObject Gst.Object.Object) parent
            return $ Just parent'
    peer' <- (newObject Gst.Pad.Pad) peer
    result <- _cb  pad' maybeParent peer'
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback PadIterIntLinkFunction
--          -> Callable {returnType = Just (TInterface (Name {namespace = "Gst", name = "Iterator"})), returnMayBeNull = False, returnTransfer = TransferEverything, returnDocumentation = Documentation {rawDocText = Just "a new #GstIterator that will iterate over all pads that are\nlinked to the given pad on the inside of the parent element.\n\nthe caller must call gst_iterator_free() after usage.", sinceVersion = Nothing}, args = [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The #GstPad to query.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TInterface (Name {namespace = "Gst", name = "Object"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT\n         flag is set, @parent is guaranteed to be not-%NULL and remain valid\n         during the execution of this function.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "The signature of the internal pad link iterator function.", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_PadIterIntLinkFunction =
    Ptr Gst.Pad.Pad ->
    Ptr Gst.Object.Object ->
    IO (Ptr Gst.Iterator.Iterator)

-- Args : [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "The #GstPad to query.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TInterface (Name {namespace = "Gst", name = "Object"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT\n         flag is set, @parent is guaranteed to be not-%NULL and remain valid\n         during the execution of this function.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "Iterator"}))
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_PadIterIntLinkFunction :: FunPtr C_PadIterIntLinkFunction -> C_PadIterIntLinkFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PadIterIntLinkFunction ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.Pad.IsPad a, Gst.Object.IsObject b) =>
    FunPtr C_PadIterIntLinkFunction
    -> a
    {- ^ /@pad@/: The 'GI.Gst.Objects.Pad.Pad' to query. -}
    -> Maybe (b)
    {- ^ /@parent@/: the parent of /@pad@/. If the @/GST_PAD_FLAG_NEED_PARENT/@
         flag is set, /@parent@/ is guaranteed to be not-'Nothing' and remain valid
         during the execution of this function. -}
    -> m Gst.Iterator.Iterator
    {- ^ __Returns:__ a new 'GI.Gst.Structs.Iterator.Iterator' that will iterate over all pads that are
linked to the given pad on the inside of the parent element.

the caller must call 'GI.Gst.Structs.Iterator.iteratorFree' after usage. -}
dynamic_PadIterIntLinkFunction __funPtr pad parent = liftIO $ do
    pad' <- unsafeManagedPtrCastPtr pad
    maybeParent <- case parent of
        Nothing -> return nullPtr
        Just jParent -> do
            jParent' <- unsafeManagedPtrCastPtr jParent
            return jParent'
    result <- (__dynamic_C_PadIterIntLinkFunction __funPtr) pad' maybeParent
    checkUnexpectedReturnNULL "padIterIntLinkFunction" result
    result' <- (wrapBoxed Gst.Iterator.Iterator) result
    touchManagedPtr pad
    whenJust parent touchManagedPtr
    return result'

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

{- |
The signature of the internal pad link iterator function.
-}
type PadIterIntLinkFunction =
    Gst.Pad.Pad
    {- ^ /@pad@/: The 'GI.Gst.Objects.Pad.Pad' to query. -}
    -> Maybe Gst.Object.Object
    {- ^ /@parent@/: the parent of /@pad@/. If the @/GST_PAD_FLAG_NEED_PARENT/@
         flag is set, /@parent@/ is guaranteed to be not-'Nothing' and remain valid
         during the execution of this function. -}
    -> IO Gst.Iterator.Iterator
    {- ^ __Returns:__ a new 'GI.Gst.Structs.Iterator.Iterator' that will iterate over all pads that are
linked to the given pad on the inside of the parent element.

the caller must call 'GI.Gst.Structs.Iterator.iteratorFree' after usage. -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `PadIterIntLinkFunction`@.
noPadIterIntLinkFunction :: Maybe PadIterIntLinkFunction
noPadIterIntLinkFunction = Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_PadIterIntLinkFunction :: MonadIO m => PadIterIntLinkFunction -> m (GClosure C_PadIterIntLinkFunction)
genClosure_PadIterIntLinkFunction cb = liftIO $ do
    let cb' = wrap_PadIterIntLinkFunction Nothing cb
    mk_PadIterIntLinkFunction cb' >>= B.GClosure.newGClosure


-- | Wrap a `PadIterIntLinkFunction` into a `C_PadIterIntLinkFunction`.
wrap_PadIterIntLinkFunction ::
    Maybe (Ptr (FunPtr C_PadIterIntLinkFunction)) ->
    PadIterIntLinkFunction ->
    C_PadIterIntLinkFunction
wrap_PadIterIntLinkFunction funptrptr _cb pad parent = do
    pad' <- (newObject Gst.Pad.Pad) pad
    maybeParent <-
        if parent == nullPtr
        then return Nothing
        else do
            parent' <- (newObject Gst.Object.Object) parent
            return $ Just parent'
    result <- _cb  pad' maybeParent
    maybeReleaseFunPtr funptrptr
    result' <- B.ManagedPtr.disownBoxed result
    return result'


-- callback PadGetRangeFunction
--          -> Callable {returnType = Just (TInterface (Name {namespace = "Gst", name = "FlowReturn"})), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "#GST_FLOW_OK for success and a valid buffer in @buffer. Any other\nreturn value leaves @buffer undefined.", sinceVersion = Nothing}, args = [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the src #GstPad to perform the getrange on.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TInterface (Name {namespace = "Gst", name = "Object"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT\n         flag is set, @parent is guaranteed to be not-%NULL and remain valid\n         during the execution of this function.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "offset", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the offset of the range", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "length", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the length of the range", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "buffer", argType = TInterface (Name {namespace = "Gst", name = "Buffer"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a memory location to hold the result buffer, cannot be %NULL.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "This function will be called on source pads when a peer element\nrequest a buffer at the specified @offset and @length. If this function\nreturns #GST_FLOW_OK, the result buffer will be stored in @buffer. The\ncontents of @buffer is invalid for any other return value.\n\nThis function is installed on a source pad with\ngst_pad_set_getrange_function() and can only be called on source pads after\nthey are successfully activated with gst_pad_activate_mode() with the\n#GST_PAD_MODE_PULL.\n\n@offset and @length are always given in byte units. @offset must normally be a value\nbetween 0 and the length in bytes of the data available on @pad. The\nlength (duration in bytes) can be retrieved with a #GST_QUERY_DURATION or with a\n#GST_QUERY_SEEKING.\n\nAny @offset larger or equal than the length will make the function return\n#GST_FLOW_EOS, which corresponds to EOS. In this case @buffer does not\ncontain a valid buffer.\n\nThe buffer size of @buffer will only be smaller than @length when @offset is\nnear the end of the stream. In all other cases, the size of @buffer must be\nexactly the requested size.\n\nIt is allowed to call this function with a 0 @length and valid @offset, in\nwhich case @buffer will contain a 0-sized buffer and the function returns\n#GST_FLOW_OK.\n\nWhen this function is called with a -1 @offset, the sequentially next buffer\nof length @length in the stream is returned.\n\nWhen this function is called with a -1 @length, a buffer with a default\noptimal length is returned in @buffer. The length might depend on the value\nof @offset.", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_PadGetRangeFunction =
    Ptr Gst.Pad.Pad ->
    Ptr Gst.Object.Object ->
    Word64 ->
    Word32 ->
    Ptr Gst.Buffer.Buffer ->
    IO CInt

-- Args : [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the src #GstPad to perform the getrange on.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TInterface (Name {namespace = "Gst", name = "Object"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT\n         flag is set, @parent is guaranteed to be not-%NULL and remain valid\n         during the execution of this function.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "offset", argType = TBasicType TUInt64, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the offset of the range", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "length", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the length of the range", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "buffer", argType = TInterface (Name {namespace = "Gst", name = "Buffer"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a memory location to hold the result buffer, cannot be %NULL.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "FlowReturn"}))
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_PadGetRangeFunction :: FunPtr C_PadGetRangeFunction -> C_PadGetRangeFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PadGetRangeFunction ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.Pad.IsPad a, Gst.Object.IsObject b) =>
    FunPtr C_PadGetRangeFunction
    -> a
    {- ^ /@pad@/: the src 'GI.Gst.Objects.Pad.Pad' to perform the getrange on. -}
    -> Maybe (b)
    {- ^ /@parent@/: the parent of /@pad@/. If the @/GST_PAD_FLAG_NEED_PARENT/@
         flag is set, /@parent@/ is guaranteed to be not-'Nothing' and remain valid
         during the execution of this function. -}
    -> Word64
    {- ^ /@offset@/: the offset of the range -}
    -> Word32
    {- ^ /@length@/: the length of the range -}
    -> Gst.Buffer.Buffer
    {- ^ /@buffer@/: a memory location to hold the result buffer, cannot be 'Nothing'. -}
    -> m Gst.Enums.FlowReturn
    {- ^ __Returns:__ @/GST_FLOW_OK/@ for success and a valid buffer in /@buffer@/. Any other
return value leaves /@buffer@/ undefined. -}
dynamic_PadGetRangeFunction __funPtr pad parent offset length_ buffer = liftIO $ do
    pad' <- unsafeManagedPtrCastPtr pad
    maybeParent <- case parent of
        Nothing -> return nullPtr
        Just jParent -> do
            jParent' <- unsafeManagedPtrCastPtr jParent
            return jParent'
    buffer' <- unsafeManagedPtrGetPtr buffer
    result <- (__dynamic_C_PadGetRangeFunction __funPtr) pad' maybeParent offset length_ buffer'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr pad
    whenJust parent touchManagedPtr
    touchManagedPtr buffer
    return result'

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

{- |
This function will be called on source pads when a peer element
request a buffer at the specified /@offset@/ and /@length@/. If this function
returns @/GST_FLOW_OK/@, the result buffer will be stored in /@buffer@/. The
contents of /@buffer@/ is invalid for any other return value.

This function is installed on a source pad with
@/gst_pad_set_getrange_function()/@ and can only be called on source pads after
they are successfully activated with 'GI.Gst.Objects.Pad.padActivateMode' with the
@/GST_PAD_MODE_PULL/@.

/@offset@/ and /@length@/ are always given in byte units. /@offset@/ must normally be a value
between 0 and the length in bytes of the data available on /@pad@/. The
length (duration in bytes) can be retrieved with a @/GST_QUERY_DURATION/@ or with a
@/GST_QUERY_SEEKING/@.

Any /@offset@/ larger or equal than the length will make the function return
@/GST_FLOW_EOS/@, which corresponds to EOS. In this case /@buffer@/ does not
contain a valid buffer.

The buffer size of /@buffer@/ will only be smaller than /@length@/ when /@offset@/ is
near the end of the stream. In all other cases, the size of /@buffer@/ must be
exactly the requested size.

It is allowed to call this function with a 0 /@length@/ and valid /@offset@/, in
which case /@buffer@/ will contain a 0-sized buffer and the function returns
@/GST_FLOW_OK/@.

When this function is called with a -1 /@offset@/, the sequentially next buffer
of length /@length@/ in the stream is returned.

When this function is called with a -1 /@length@/, a buffer with a default
optimal length is returned in /@buffer@/. The length might depend on the value
of /@offset@/.
-}
type PadGetRangeFunction =
    Gst.Pad.Pad
    {- ^ /@pad@/: the src 'GI.Gst.Objects.Pad.Pad' to perform the getrange on. -}
    -> Maybe Gst.Object.Object
    {- ^ /@parent@/: the parent of /@pad@/. If the @/GST_PAD_FLAG_NEED_PARENT/@
         flag is set, /@parent@/ is guaranteed to be not-'Nothing' and remain valid
         during the execution of this function. -}
    -> Word64
    {- ^ /@offset@/: the offset of the range -}
    -> Word32
    {- ^ /@length@/: the length of the range -}
    -> Gst.Buffer.Buffer
    {- ^ /@buffer@/: a memory location to hold the result buffer, cannot be 'Nothing'. -}
    -> IO Gst.Enums.FlowReturn
    {- ^ __Returns:__ @/GST_FLOW_OK/@ for success and a valid buffer in /@buffer@/. Any other
return value leaves /@buffer@/ undefined. -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `PadGetRangeFunction`@.
noPadGetRangeFunction :: Maybe PadGetRangeFunction
noPadGetRangeFunction = Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_PadGetRangeFunction :: MonadIO m => PadGetRangeFunction -> m (GClosure C_PadGetRangeFunction)
genClosure_PadGetRangeFunction cb = liftIO $ do
    let cb' = wrap_PadGetRangeFunction Nothing cb
    mk_PadGetRangeFunction cb' >>= B.GClosure.newGClosure


-- | Wrap a `PadGetRangeFunction` into a `C_PadGetRangeFunction`.
wrap_PadGetRangeFunction ::
    Maybe (Ptr (FunPtr C_PadGetRangeFunction)) ->
    PadGetRangeFunction ->
    C_PadGetRangeFunction
wrap_PadGetRangeFunction funptrptr _cb pad parent offset length_ buffer = do
    pad' <- (newObject Gst.Pad.Pad) pad
    maybeParent <-
        if parent == nullPtr
        then return Nothing
        else do
            parent' <- (newObject Gst.Object.Object) parent
            return $ Just parent'
    B.ManagedPtr.withTransient Gst.Buffer.Buffer buffer $ \buffer' -> do
        result <- _cb  pad' maybeParent offset length_ buffer'
        maybeReleaseFunPtr funptrptr
        let result' = (fromIntegral . fromEnum) result
        return result'


-- callback PadForwardFunction
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE if the dispatching procedure has to be stopped.", sinceVersion = Nothing}, args = [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstPad that is forwarded.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the gpointer to optional user data.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "A forward function is called for all internally linked pads, see\ngst_pad_forward().", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_PadForwardFunction =
    Ptr Gst.Pad.Pad ->
    Ptr () ->
    IO CInt

-- Args : [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstPad that is forwarded.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the gpointer to optional user data.", 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 "dynamic" __dynamic_C_PadForwardFunction :: FunPtr C_PadForwardFunction -> C_PadForwardFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PadForwardFunction ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.Pad.IsPad a) =>
    FunPtr C_PadForwardFunction
    -> a
    {- ^ /@pad@/: the 'GI.Gst.Objects.Pad.Pad' that is forwarded. -}
    -> Ptr ()
    {- ^ /@userData@/: the gpointer to optional user data. -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the dispatching procedure has to be stopped. -}
dynamic_PadForwardFunction __funPtr pad userData = liftIO $ do
    pad' <- unsafeManagedPtrCastPtr pad
    result <- (__dynamic_C_PadForwardFunction __funPtr) pad' userData
    let result' = (/= 0) result
    touchManagedPtr pad
    return result'

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

{- |
A forward function is called for all internally linked pads, see
'GI.Gst.Objects.Pad.padForward'.
-}
type PadForwardFunction =
    Gst.Pad.Pad
    {- ^ /@pad@/: the 'GI.Gst.Objects.Pad.Pad' that is forwarded. -}
    -> IO Bool
    {- ^ __Returns:__ 'True' if the dispatching procedure has to be stopped. -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `PadForwardFunction`@.
noPadForwardFunction :: Maybe PadForwardFunction
noPadForwardFunction = Nothing

{- |
A forward function is called for all internally linked pads, see
'GI.Gst.Objects.Pad.padForward'.
-}
type PadForwardFunction_WithClosures =
    Gst.Pad.Pad
    {- ^ /@pad@/: the 'GI.Gst.Objects.Pad.Pad' that is forwarded. -}
    -> Ptr ()
    {- ^ /@userData@/: the gpointer to optional user data. -}
    -> IO Bool
    {- ^ __Returns:__ 'True' if the dispatching procedure has to be stopped. -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `PadForwardFunction_WithClosures`@.
noPadForwardFunction_WithClosures :: Maybe PadForwardFunction_WithClosures
noPadForwardFunction_WithClosures = Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_PadForwardFunction :: PadForwardFunction -> PadForwardFunction_WithClosures
drop_closures_PadForwardFunction _f pad _ = _f pad

-- | Wrap the callback into a `GClosure`.
genClosure_PadForwardFunction :: MonadIO m => PadForwardFunction -> m (GClosure C_PadForwardFunction)
genClosure_PadForwardFunction cb = liftIO $ do
    let cb' = drop_closures_PadForwardFunction cb
    let cb'' = wrap_PadForwardFunction Nothing cb'
    mk_PadForwardFunction cb'' >>= B.GClosure.newGClosure


-- | Wrap a `PadForwardFunction` into a `C_PadForwardFunction`.
wrap_PadForwardFunction ::
    Maybe (Ptr (FunPtr C_PadForwardFunction)) ->
    PadForwardFunction_WithClosures ->
    C_PadForwardFunction
wrap_PadForwardFunction funptrptr _cb pad userData = do
    pad' <- (newObject Gst.Pad.Pad) pad
    result <- _cb  pad' userData
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback PadEventFunction
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE if the pad could handle the event.", sinceVersion = Nothing}, args = [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstPad to handle the event.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TInterface (Name {namespace = "Gst", name = "Object"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT\n         flag is set, @parent is guaranteed to be not-%NULL and remain valid\n         during the execution of this function.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "event", argType = TInterface (Name {namespace = "Gst", name = "Event"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstEvent to handle.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Function signature to handle an event for the pad.", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_PadEventFunction =
    Ptr Gst.Pad.Pad ->
    Ptr Gst.Object.Object ->
    Ptr Gst.Event.Event ->
    IO CInt

-- Args : [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstPad to handle the event.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TInterface (Name {namespace = "Gst", name = "Object"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT\n         flag is set, @parent is guaranteed to be not-%NULL and remain valid\n         during the execution of this function.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "event", argType = TInterface (Name {namespace = "Gst", name = "Event"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstEvent to handle.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : []
-- returnType : Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_PadEventFunction :: FunPtr C_PadEventFunction -> C_PadEventFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PadEventFunction ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.Pad.IsPad a, Gst.Object.IsObject b) =>
    FunPtr C_PadEventFunction
    -> a
    {- ^ /@pad@/: the 'GI.Gst.Objects.Pad.Pad' to handle the event. -}
    -> Maybe (b)
    {- ^ /@parent@/: the parent of /@pad@/. If the @/GST_PAD_FLAG_NEED_PARENT/@
         flag is set, /@parent@/ is guaranteed to be not-'Nothing' and remain valid
         during the execution of this function. -}
    -> Gst.Event.Event
    {- ^ /@event@/: the 'GI.Gst.Structs.Event.Event' to handle. -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the pad could handle the event. -}
dynamic_PadEventFunction __funPtr pad parent event = liftIO $ do
    pad' <- unsafeManagedPtrCastPtr pad
    maybeParent <- case parent of
        Nothing -> return nullPtr
        Just jParent -> do
            jParent' <- unsafeManagedPtrCastPtr jParent
            return jParent'
    event' <- B.ManagedPtr.disownBoxed event
    result <- (__dynamic_C_PadEventFunction __funPtr) pad' maybeParent event'
    let result' = (/= 0) result
    touchManagedPtr pad
    whenJust parent touchManagedPtr
    touchManagedPtr event
    return result'

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

{- |
Function signature to handle an event for the pad.
-}
type PadEventFunction =
    Gst.Pad.Pad
    {- ^ /@pad@/: the 'GI.Gst.Objects.Pad.Pad' to handle the event. -}
    -> Maybe Gst.Object.Object
    {- ^ /@parent@/: the parent of /@pad@/. If the @/GST_PAD_FLAG_NEED_PARENT/@
         flag is set, /@parent@/ is guaranteed to be not-'Nothing' and remain valid
         during the execution of this function. -}
    -> Gst.Event.Event
    {- ^ /@event@/: the 'GI.Gst.Structs.Event.Event' to handle. -}
    -> IO Bool
    {- ^ __Returns:__ 'True' if the pad could handle the event. -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `PadEventFunction`@.
noPadEventFunction :: Maybe PadEventFunction
noPadEventFunction = Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_PadEventFunction :: MonadIO m => PadEventFunction -> m (GClosure C_PadEventFunction)
genClosure_PadEventFunction cb = liftIO $ do
    let cb' = wrap_PadEventFunction Nothing cb
    mk_PadEventFunction cb' >>= B.GClosure.newGClosure


-- | Wrap a `PadEventFunction` into a `C_PadEventFunction`.
wrap_PadEventFunction ::
    Maybe (Ptr (FunPtr C_PadEventFunction)) ->
    PadEventFunction ->
    C_PadEventFunction
wrap_PadEventFunction funptrptr _cb pad parent event = do
    pad' <- (newObject Gst.Pad.Pad) pad
    maybeParent <-
        if parent == nullPtr
        then return Nothing
        else do
            parent' <- (newObject Gst.Object.Object) parent
            return $ Just parent'
    event' <- (wrapBoxed Gst.Event.Event) event
    result <- _cb  pad' maybeParent event'
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback PadEventFullFunction
--          -> Callable {returnType = Just (TInterface (Name {namespace = "Gst", name = "FlowReturn"})), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%GST_FLOW_OK if the event was handled properly, or any other\n#GstFlowReturn dependent on downstream state.", sinceVersion = Nothing}, args = [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstPad to handle the event.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TInterface (Name {namespace = "Gst", name = "Object"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT\n         flag is set, @parent is guaranteed to be not-%NULL and remain valid\n         during the execution of this function.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "event", argType = TInterface (Name {namespace = "Gst", name = "Event"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstEvent to handle.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Function signature to handle an event for the pad.\n\nThis variant is for specific elements that will take into account the\nlast downstream flow return (from a pad push), in which case they can\nreturn it.", sinceVersion = Just "1.8"}}
-- | Type for the callback on the (unwrapped) C side.
type C_PadEventFullFunction =
    Ptr Gst.Pad.Pad ->
    Ptr Gst.Object.Object ->
    Ptr Gst.Event.Event ->
    IO CInt

-- Args : [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstPad to handle the event.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TInterface (Name {namespace = "Gst", name = "Object"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT\n         flag is set, @parent is guaranteed to be not-%NULL and remain valid\n         during the execution of this function.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "event", argType = TInterface (Name {namespace = "Gst", name = "Event"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstEvent to handle.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "FlowReturn"}))
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_PadEventFullFunction :: FunPtr C_PadEventFullFunction -> C_PadEventFullFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PadEventFullFunction ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.Pad.IsPad a, Gst.Object.IsObject b) =>
    FunPtr C_PadEventFullFunction
    -> a
    {- ^ /@pad@/: the 'GI.Gst.Objects.Pad.Pad' to handle the event. -}
    -> Maybe (b)
    {- ^ /@parent@/: the parent of /@pad@/. If the @/GST_PAD_FLAG_NEED_PARENT/@
         flag is set, /@parent@/ is guaranteed to be not-'Nothing' and remain valid
         during the execution of this function. -}
    -> Gst.Event.Event
    {- ^ /@event@/: the 'GI.Gst.Structs.Event.Event' to handle. -}
    -> m Gst.Enums.FlowReturn
    {- ^ __Returns:__ 'GI.Gst.Enums.FlowReturnOk' if the event was handled properly, or any other
'GI.Gst.Enums.FlowReturn' dependent on downstream state. -}
dynamic_PadEventFullFunction __funPtr pad parent event = liftIO $ do
    pad' <- unsafeManagedPtrCastPtr pad
    maybeParent <- case parent of
        Nothing -> return nullPtr
        Just jParent -> do
            jParent' <- unsafeManagedPtrCastPtr jParent
            return jParent'
    event' <- B.ManagedPtr.disownBoxed event
    result <- (__dynamic_C_PadEventFullFunction __funPtr) pad' maybeParent event'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr pad
    whenJust parent touchManagedPtr
    touchManagedPtr event
    return result'

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

{- |
Function signature to handle an event for the pad.

This variant is for specific elements that will take into account the
last downstream flow return (from a pad push), in which case they can
return it.

/Since: 1.8/
-}
type PadEventFullFunction =
    Gst.Pad.Pad
    {- ^ /@pad@/: the 'GI.Gst.Objects.Pad.Pad' to handle the event. -}
    -> Maybe Gst.Object.Object
    {- ^ /@parent@/: the parent of /@pad@/. If the @/GST_PAD_FLAG_NEED_PARENT/@
         flag is set, /@parent@/ is guaranteed to be not-'Nothing' and remain valid
         during the execution of this function. -}
    -> Gst.Event.Event
    {- ^ /@event@/: the 'GI.Gst.Structs.Event.Event' to handle. -}
    -> IO Gst.Enums.FlowReturn
    {- ^ __Returns:__ 'GI.Gst.Enums.FlowReturnOk' if the event was handled properly, or any other
'GI.Gst.Enums.FlowReturn' dependent on downstream state. -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `PadEventFullFunction`@.
noPadEventFullFunction :: Maybe PadEventFullFunction
noPadEventFullFunction = Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_PadEventFullFunction :: MonadIO m => PadEventFullFunction -> m (GClosure C_PadEventFullFunction)
genClosure_PadEventFullFunction cb = liftIO $ do
    let cb' = wrap_PadEventFullFunction Nothing cb
    mk_PadEventFullFunction cb' >>= B.GClosure.newGClosure


-- | Wrap a `PadEventFullFunction` into a `C_PadEventFullFunction`.
wrap_PadEventFullFunction ::
    Maybe (Ptr (FunPtr C_PadEventFullFunction)) ->
    PadEventFullFunction ->
    C_PadEventFullFunction
wrap_PadEventFullFunction funptrptr _cb pad parent event = do
    pad' <- (newObject Gst.Pad.Pad) pad
    maybeParent <-
        if parent == nullPtr
        then return Nothing
        else do
            parent' <- (newObject Gst.Object.Object) parent
            return $ Just parent'
    event' <- (wrapBoxed Gst.Event.Event) event
    result <- _cb  pad' maybeParent event'
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback PadChainListFunction
--          -> Callable {returnType = Just (TInterface (Name {namespace = "Gst", name = "FlowReturn"})), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "#GST_FLOW_OK for success", sinceVersion = Nothing}, args = [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the sink #GstPad that performed the chain.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TInterface (Name {namespace = "Gst", name = "Object"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT\n         flag is set, @parent is guaranteed to be not-%NULL and remain valid\n         during the execution of this function.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "list", argType = TInterface (Name {namespace = "Gst", name = "BufferList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstBufferList that is chained, not %NULL.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "A function that will be called on sinkpads when chaining buffer lists.\nThe function typically processes the data contained in the buffer list and\neither consumes the data or passes it on to the internally linked pad(s).\n\nThe implementer of this function receives a refcount to @list and\nshould gst_buffer_list_unref() when the list is no longer needed.\n\nWhen a chainlist function detects an error in the data stream, it must\npost an error on the bus and return an appropriate #GstFlowReturn value.", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_PadChainListFunction =
    Ptr Gst.Pad.Pad ->
    Ptr Gst.Object.Object ->
    Ptr Gst.BufferList.BufferList ->
    IO CInt

-- Args : [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the sink #GstPad that performed the chain.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TInterface (Name {namespace = "Gst", name = "Object"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT\n         flag is set, @parent is guaranteed to be not-%NULL and remain valid\n         during the execution of this function.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "list", argType = TInterface (Name {namespace = "Gst", name = "BufferList"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstBufferList that is chained, not %NULL.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "FlowReturn"}))
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_PadChainListFunction :: FunPtr C_PadChainListFunction -> C_PadChainListFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PadChainListFunction ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.Pad.IsPad a, Gst.Object.IsObject b) =>
    FunPtr C_PadChainListFunction
    -> a
    {- ^ /@pad@/: the sink 'GI.Gst.Objects.Pad.Pad' that performed the chain. -}
    -> Maybe (b)
    {- ^ /@parent@/: the parent of /@pad@/. If the @/GST_PAD_FLAG_NEED_PARENT/@
         flag is set, /@parent@/ is guaranteed to be not-'Nothing' and remain valid
         during the execution of this function. -}
    -> Gst.BufferList.BufferList
    {- ^ /@list@/: the 'GI.Gst.Structs.BufferList.BufferList' that is chained, not 'Nothing'. -}
    -> m Gst.Enums.FlowReturn
    {- ^ __Returns:__ @/GST_FLOW_OK/@ for success -}
dynamic_PadChainListFunction __funPtr pad parent list = liftIO $ do
    pad' <- unsafeManagedPtrCastPtr pad
    maybeParent <- case parent of
        Nothing -> return nullPtr
        Just jParent -> do
            jParent' <- unsafeManagedPtrCastPtr jParent
            return jParent'
    list' <- B.ManagedPtr.disownBoxed list
    result <- (__dynamic_C_PadChainListFunction __funPtr) pad' maybeParent list'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr pad
    whenJust parent touchManagedPtr
    touchManagedPtr list
    return result'

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

{- |
A function that will be called on sinkpads when chaining buffer lists.
The function typically processes the data contained in the buffer list and
either consumes the data or passes it on to the internally linked pad(s).

The implementer of this function receives a refcount to /@list@/ and
should @/gst_buffer_list_unref()/@ when the list is no longer needed.

When a chainlist function detects an error in the data stream, it must
post an error on the bus and return an appropriate 'GI.Gst.Enums.FlowReturn' value.
-}
type PadChainListFunction =
    Gst.Pad.Pad
    {- ^ /@pad@/: the sink 'GI.Gst.Objects.Pad.Pad' that performed the chain. -}
    -> Maybe Gst.Object.Object
    {- ^ /@parent@/: the parent of /@pad@/. If the @/GST_PAD_FLAG_NEED_PARENT/@
         flag is set, /@parent@/ is guaranteed to be not-'Nothing' and remain valid
         during the execution of this function. -}
    -> Gst.BufferList.BufferList
    {- ^ /@list@/: the 'GI.Gst.Structs.BufferList.BufferList' that is chained, not 'Nothing'. -}
    -> IO Gst.Enums.FlowReturn
    {- ^ __Returns:__ @/GST_FLOW_OK/@ for success -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `PadChainListFunction`@.
noPadChainListFunction :: Maybe PadChainListFunction
noPadChainListFunction = Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_PadChainListFunction :: MonadIO m => PadChainListFunction -> m (GClosure C_PadChainListFunction)
genClosure_PadChainListFunction cb = liftIO $ do
    let cb' = wrap_PadChainListFunction Nothing cb
    mk_PadChainListFunction cb' >>= B.GClosure.newGClosure


-- | Wrap a `PadChainListFunction` into a `C_PadChainListFunction`.
wrap_PadChainListFunction ::
    Maybe (Ptr (FunPtr C_PadChainListFunction)) ->
    PadChainListFunction ->
    C_PadChainListFunction
wrap_PadChainListFunction funptrptr _cb pad parent list = do
    pad' <- (newObject Gst.Pad.Pad) pad
    maybeParent <-
        if parent == nullPtr
        then return Nothing
        else do
            parent' <- (newObject Gst.Object.Object) parent
            return $ Just parent'
    list' <- (wrapBoxed Gst.BufferList.BufferList) list
    result <- _cb  pad' maybeParent list'
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback PadChainFunction
--          -> Callable {returnType = Just (TInterface (Name {namespace = "Gst", name = "FlowReturn"})), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "#GST_FLOW_OK for success", sinceVersion = Nothing}, args = [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the sink #GstPad that performed the chain.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TInterface (Name {namespace = "Gst", name = "Object"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT\n         flag is set, @parent is guaranteed to be not-%NULL and remain valid\n         during the execution of this function.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "buffer", argType = TInterface (Name {namespace = "Gst", name = "Buffer"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstBuffer that is chained, not %NULL.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "A function that will be called on sinkpads when chaining buffers.\nThe function typically processes the data contained in the buffer and\neither consumes the data or passes it on to the internally linked pad(s).\n\nThe implementer of this function receives a refcount to @buffer and should\ngst_buffer_unref() when the buffer is no longer needed.\n\nWhen a chain function detects an error in the data stream, it must post an\nerror on the bus and return an appropriate #GstFlowReturn value.", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_PadChainFunction =
    Ptr Gst.Pad.Pad ->
    Ptr Gst.Object.Object ->
    Ptr Gst.Buffer.Buffer ->
    IO CInt

-- Args : [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the sink #GstPad that performed the chain.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TInterface (Name {namespace = "Gst", name = "Object"}), direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "the parent of @pad. If the #GST_PAD_FLAG_NEED_PARENT\n         flag is set, @parent is guaranteed to be not-%NULL and remain valid\n         during the execution of this function.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "buffer", argType = TInterface (Name {namespace = "Gst", name = "Buffer"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the #GstBuffer that is chained, not %NULL.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : []
-- returnType : Just (TInterface (Name {namespace = "Gst", name = "FlowReturn"}))
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_PadChainFunction :: FunPtr C_PadChainFunction -> C_PadChainFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PadChainFunction ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.Pad.IsPad a, Gst.Object.IsObject b) =>
    FunPtr C_PadChainFunction
    -> a
    {- ^ /@pad@/: the sink 'GI.Gst.Objects.Pad.Pad' that performed the chain. -}
    -> Maybe (b)
    {- ^ /@parent@/: the parent of /@pad@/. If the @/GST_PAD_FLAG_NEED_PARENT/@
         flag is set, /@parent@/ is guaranteed to be not-'Nothing' and remain valid
         during the execution of this function. -}
    -> Gst.Buffer.Buffer
    {- ^ /@buffer@/: the 'GI.Gst.Structs.Buffer.Buffer' that is chained, not 'Nothing'. -}
    -> m Gst.Enums.FlowReturn
    {- ^ __Returns:__ @/GST_FLOW_OK/@ for success -}
dynamic_PadChainFunction __funPtr pad parent buffer = liftIO $ do
    pad' <- unsafeManagedPtrCastPtr pad
    maybeParent <- case parent of
        Nothing -> return nullPtr
        Just jParent -> do
            jParent' <- unsafeManagedPtrCastPtr jParent
            return jParent'
    buffer' <- B.ManagedPtr.disownBoxed buffer
    result <- (__dynamic_C_PadChainFunction __funPtr) pad' maybeParent buffer'
    let result' = (toEnum . fromIntegral) result
    touchManagedPtr pad
    whenJust parent touchManagedPtr
    touchManagedPtr buffer
    return result'

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

{- |
A function that will be called on sinkpads when chaining buffers.
The function typically processes the data contained in the buffer and
either consumes the data or passes it on to the internally linked pad(s).

The implementer of this function receives a refcount to /@buffer@/ and should
@/gst_buffer_unref()/@ when the buffer is no longer needed.

When a chain function detects an error in the data stream, it must post an
error on the bus and return an appropriate 'GI.Gst.Enums.FlowReturn' value.
-}
type PadChainFunction =
    Gst.Pad.Pad
    {- ^ /@pad@/: the sink 'GI.Gst.Objects.Pad.Pad' that performed the chain. -}
    -> Maybe Gst.Object.Object
    {- ^ /@parent@/: the parent of /@pad@/. If the @/GST_PAD_FLAG_NEED_PARENT/@
         flag is set, /@parent@/ is guaranteed to be not-'Nothing' and remain valid
         during the execution of this function. -}
    -> Gst.Buffer.Buffer
    {- ^ /@buffer@/: the 'GI.Gst.Structs.Buffer.Buffer' that is chained, not 'Nothing'. -}
    -> IO Gst.Enums.FlowReturn
    {- ^ __Returns:__ @/GST_FLOW_OK/@ for success -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `PadChainFunction`@.
noPadChainFunction :: Maybe PadChainFunction
noPadChainFunction = Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_PadChainFunction :: MonadIO m => PadChainFunction -> m (GClosure C_PadChainFunction)
genClosure_PadChainFunction cb = liftIO $ do
    let cb' = wrap_PadChainFunction Nothing cb
    mk_PadChainFunction cb' >>= B.GClosure.newGClosure


-- | Wrap a `PadChainFunction` into a `C_PadChainFunction`.
wrap_PadChainFunction ::
    Maybe (Ptr (FunPtr C_PadChainFunction)) ->
    PadChainFunction ->
    C_PadChainFunction
wrap_PadChainFunction funptrptr _cb pad parent buffer = do
    pad' <- (newObject Gst.Pad.Pad) pad
    maybeParent <-
        if parent == nullPtr
        then return Nothing
        else do
            parent' <- (newObject Gst.Object.Object) parent
            return $ Just parent'
    buffer' <- (wrapBoxed Gst.Buffer.Buffer) buffer
    result <- _cb  pad' maybeParent buffer'
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback PadActivateModeFunction
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE if the pad could be activated or deactivated.", sinceVersion = Nothing}, args = [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstPad", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TInterface (Name {namespace = "Gst", name = "Object"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the parent of @pad", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "mode", argType = TInterface (Name {namespace = "Gst", name = "PadMode"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the requested activation mode of @pad", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "active", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "activate or deactivate the pad.", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "The prototype of the push and pull activate functions.", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_PadActivateModeFunction =
    Ptr Gst.Pad.Pad ->
    Ptr Gst.Object.Object ->
    CUInt ->
    CInt ->
    IO CInt

-- Args : [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstPad", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TInterface (Name {namespace = "Gst", name = "Object"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the parent of @pad", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "mode", argType = TInterface (Name {namespace = "Gst", name = "PadMode"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the requested activation mode of @pad", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "active", argType = TBasicType TBoolean, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "activate or deactivate the 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 "dynamic" __dynamic_C_PadActivateModeFunction :: FunPtr C_PadActivateModeFunction -> C_PadActivateModeFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PadActivateModeFunction ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.Pad.IsPad a, Gst.Object.IsObject b) =>
    FunPtr C_PadActivateModeFunction
    -> a
    {- ^ /@pad@/: a 'GI.Gst.Objects.Pad.Pad' -}
    -> b
    {- ^ /@parent@/: the parent of /@pad@/ -}
    -> Gst.Enums.PadMode
    {- ^ /@mode@/: the requested activation mode of /@pad@/ -}
    -> Bool
    {- ^ /@active@/: activate or deactivate the pad. -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the pad could be activated or deactivated. -}
dynamic_PadActivateModeFunction __funPtr pad parent mode active = liftIO $ do
    pad' <- unsafeManagedPtrCastPtr pad
    parent' <- unsafeManagedPtrCastPtr parent
    let mode' = (fromIntegral . fromEnum) mode
    let active' = (fromIntegral . fromEnum) active
    result <- (__dynamic_C_PadActivateModeFunction __funPtr) pad' parent' mode' active'
    let result' = (/= 0) result
    touchManagedPtr pad
    touchManagedPtr parent
    return result'

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

{- |
The prototype of the push and pull activate functions.
-}
type PadActivateModeFunction =
    Gst.Pad.Pad
    {- ^ /@pad@/: a 'GI.Gst.Objects.Pad.Pad' -}
    -> Gst.Object.Object
    {- ^ /@parent@/: the parent of /@pad@/ -}
    -> Gst.Enums.PadMode
    {- ^ /@mode@/: the requested activation mode of /@pad@/ -}
    -> Bool
    {- ^ /@active@/: activate or deactivate the pad. -}
    -> IO Bool
    {- ^ __Returns:__ 'True' if the pad could be activated or deactivated. -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `PadActivateModeFunction`@.
noPadActivateModeFunction :: Maybe PadActivateModeFunction
noPadActivateModeFunction = Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_PadActivateModeFunction :: MonadIO m => PadActivateModeFunction -> m (GClosure C_PadActivateModeFunction)
genClosure_PadActivateModeFunction cb = liftIO $ do
    let cb' = wrap_PadActivateModeFunction Nothing cb
    mk_PadActivateModeFunction cb' >>= B.GClosure.newGClosure


-- | Wrap a `PadActivateModeFunction` into a `C_PadActivateModeFunction`.
wrap_PadActivateModeFunction ::
    Maybe (Ptr (FunPtr C_PadActivateModeFunction)) ->
    PadActivateModeFunction ->
    C_PadActivateModeFunction
wrap_PadActivateModeFunction funptrptr _cb pad parent mode active = do
    pad' <- (newObject Gst.Pad.Pad) pad
    parent' <- (newObject Gst.Object.Object) parent
    let mode' = (toEnum . fromIntegral) mode
    let active' = (/= 0) active
    result <- _cb  pad' parent' mode' active'
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback PadActivateFunction
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE if the pad could be activated.", sinceVersion = Nothing}, args = [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstPad", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TInterface (Name {namespace = "Gst", name = "Object"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the parent of @pad", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "This function is called when the pad is activated during the element\nREADY to PAUSED state change. By default this function will call the\nactivate function that puts the pad in push mode but elements can\noverride this function to activate the pad in pull mode if they wish.", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_PadActivateFunction =
    Ptr Gst.Pad.Pad ->
    Ptr Gst.Object.Object ->
    IO CInt

-- Args : [Arg {argCName = "pad", argType = TInterface (Name {namespace = "Gst", name = "Pad"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GstPad", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "parent", argType = TInterface (Name {namespace = "Gst", name = "Object"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the parent of @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 "dynamic" __dynamic_C_PadActivateFunction :: FunPtr C_PadActivateFunction -> C_PadActivateFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_PadActivateFunction ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.Pad.IsPad a, Gst.Object.IsObject b) =>
    FunPtr C_PadActivateFunction
    -> a
    {- ^ /@pad@/: a 'GI.Gst.Objects.Pad.Pad' -}
    -> b
    {- ^ /@parent@/: the parent of /@pad@/ -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the pad could be activated. -}
dynamic_PadActivateFunction __funPtr pad parent = liftIO $ do
    pad' <- unsafeManagedPtrCastPtr pad
    parent' <- unsafeManagedPtrCastPtr parent
    result <- (__dynamic_C_PadActivateFunction __funPtr) pad' parent'
    let result' = (/= 0) result
    touchManagedPtr pad
    touchManagedPtr parent
    return result'

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

{- |
This function is called when the pad is activated during the element
READY to PAUSED state change. By default this function will call the
activate function that puts the pad in push mode but elements can
override this function to activate the pad in pull mode if they wish.
-}
type PadActivateFunction =
    Gst.Pad.Pad
    {- ^ /@pad@/: a 'GI.Gst.Objects.Pad.Pad' -}
    -> Gst.Object.Object
    {- ^ /@parent@/: the parent of /@pad@/ -}
    -> IO Bool
    {- ^ __Returns:__ 'True' if the pad could be activated. -}

-- | A convenience synonym for @`Nothing` :: `Maybe` `PadActivateFunction`@.
noPadActivateFunction :: Maybe PadActivateFunction
noPadActivateFunction = Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_PadActivateFunction :: MonadIO m => PadActivateFunction -> m (GClosure C_PadActivateFunction)
genClosure_PadActivateFunction cb = liftIO $ do
    let cb' = wrap_PadActivateFunction Nothing cb
    mk_PadActivateFunction cb' >>= B.GClosure.newGClosure


-- | Wrap a `PadActivateFunction` into a `C_PadActivateFunction`.
wrap_PadActivateFunction ::
    Maybe (Ptr (FunPtr C_PadActivateFunction)) ->
    PadActivateFunction ->
    C_PadActivateFunction
wrap_PadActivateFunction funptrptr _cb pad parent = do
    pad' <- (newObject Gst.Pad.Pad) pad
    parent' <- (newObject Gst.Object.Object) parent
    result <- _cb  pad' parent'
    maybeReleaseFunPtr funptrptr
    let result' = (fromIntegral . fromEnum) result
    return result'


-- callback MiniObjectNotify
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data that was provided when the notify was added", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 0, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "obj", argType = TInterface (Name {namespace = "Gst", name = "MiniObject"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the mini object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "A #GstMiniObjectNotify function can be added to a mini object as a\ncallback that gets triggered when gst_mini_object_unref() drops the\nlast ref and @obj is about to be freed.", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_MiniObjectNotify =
    Ptr () ->
    Ptr Gst.MiniObject.MiniObject ->
    IO ()

-- Args : [Arg {argCName = "user_data", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "data that was provided when the notify was added", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = 0, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "obj", argType = TInterface (Name {namespace = "Gst", name = "MiniObject"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the mini object", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_MiniObjectNotify :: FunPtr C_MiniObjectNotify -> C_MiniObjectNotify

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_MiniObjectNotify ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_MiniObjectNotify
    -> Ptr ()
    {- ^ /@userData@/: data that was provided when the notify was added -}
    -> Gst.MiniObject.MiniObject
    {- ^ /@obj@/: the mini object -}
    -> m ()
dynamic_MiniObjectNotify __funPtr userData obj = liftIO $ do
    obj' <- unsafeManagedPtrGetPtr obj
    (__dynamic_C_MiniObjectNotify __funPtr) userData obj'
    touchManagedPtr obj
    return ()

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

{- |
A 'GI.Gst.Callbacks.MiniObjectNotify' function can be added to a mini object as a
callback that gets triggered when @/gst_mini_object_unref()/@ drops the
last ref and /@obj@/ is about to be freed.
-}
type MiniObjectNotify =
    Gst.MiniObject.MiniObject
    {- ^ /@obj@/: the mini object -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `MiniObjectNotify`@.
noMiniObjectNotify :: Maybe MiniObjectNotify
noMiniObjectNotify = Nothing

{- |
A 'GI.Gst.Callbacks.MiniObjectNotify' function can be added to a mini object as a
callback that gets triggered when @/gst_mini_object_unref()/@ drops the
last ref and /@obj@/ is about to be freed.
-}
type MiniObjectNotify_WithClosures =
    Ptr ()
    {- ^ /@userData@/: data that was provided when the notify was added -}
    -> Gst.MiniObject.MiniObject
    {- ^ /@obj@/: the mini object -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `MiniObjectNotify_WithClosures`@.
noMiniObjectNotify_WithClosures :: Maybe MiniObjectNotify_WithClosures
noMiniObjectNotify_WithClosures = Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_MiniObjectNotify :: MiniObjectNotify -> MiniObjectNotify_WithClosures
drop_closures_MiniObjectNotify _f _ obj = _f obj

-- | Wrap the callback into a `GClosure`.
genClosure_MiniObjectNotify :: MonadIO m => MiniObjectNotify -> m (GClosure C_MiniObjectNotify)
genClosure_MiniObjectNotify cb = liftIO $ do
    let cb' = drop_closures_MiniObjectNotify cb
    let cb'' = wrap_MiniObjectNotify Nothing cb'
    mk_MiniObjectNotify cb'' >>= B.GClosure.newGClosure


-- | Wrap a `MiniObjectNotify` into a `C_MiniObjectNotify`.
wrap_MiniObjectNotify ::
    Maybe (Ptr (FunPtr C_MiniObjectNotify)) ->
    MiniObjectNotify_WithClosures ->
    C_MiniObjectNotify
wrap_MiniObjectNotify funptrptr _cb userData obj = do
    obj' <- (newPtr Gst.MiniObject.MiniObject) obj
    _cb  userData obj'
    maybeReleaseFunPtr funptrptr


-- callback MiniObjectFreeFunction
--          -> Callable {returnType = Nothing, returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Nothing, sinceVersion = Nothing}, args = [Arg {argCName = "obj", argType = TInterface (Name {namespace = "Gst", name = "MiniObject"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "MiniObject to free", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Virtual function prototype for methods to free resources used by\nmini-objects.", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_MiniObjectFreeFunction =
    Ptr Gst.MiniObject.MiniObject ->
    IO ()

-- Args : [Arg {argCName = "obj", argType = TInterface (Name {namespace = "Gst", name = "MiniObject"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "MiniObject to free", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_MiniObjectFreeFunction :: FunPtr C_MiniObjectFreeFunction -> C_MiniObjectFreeFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_MiniObjectFreeFunction ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_MiniObjectFreeFunction
    -> Gst.MiniObject.MiniObject
    {- ^ /@obj@/: MiniObject to free -}
    -> m ()
dynamic_MiniObjectFreeFunction __funPtr obj = liftIO $ do
    obj' <- unsafeManagedPtrGetPtr obj
    (__dynamic_C_MiniObjectFreeFunction __funPtr) obj'
    touchManagedPtr obj
    return ()

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

{- |
Virtual function prototype for methods to free resources used by
mini-objects.
-}
type MiniObjectFreeFunction =
    Gst.MiniObject.MiniObject
    {- ^ /@obj@/: MiniObject to free -}
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `MiniObjectFreeFunction`@.
noMiniObjectFreeFunction :: Maybe MiniObjectFreeFunction
noMiniObjectFreeFunction = Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_MiniObjectFreeFunction :: MonadIO m => MiniObjectFreeFunction -> m (GClosure C_MiniObjectFreeFunction)
genClosure_MiniObjectFreeFunction cb = liftIO $ do
    let cb' = wrap_MiniObjectFreeFunction Nothing cb
    mk_MiniObjectFreeFunction cb' >>= B.GClosure.newGClosure


-- | Wrap a `MiniObjectFreeFunction` into a `C_MiniObjectFreeFunction`.
wrap_MiniObjectFreeFunction ::
    Maybe (Ptr (FunPtr C_MiniObjectFreeFunction)) ->
    MiniObjectFreeFunction ->
    C_MiniObjectFreeFunction
wrap_MiniObjectFreeFunction funptrptr _cb obj = do
    obj' <- (newPtr Gst.MiniObject.MiniObject) obj
    _cb  obj'
    maybeReleaseFunPtr funptrptr


-- callback MiniObjectDisposeFunction
--          -> Callable {returnType = Just (TBasicType TBoolean), returnMayBeNull = False, returnTransfer = TransferNothing, returnDocumentation = Documentation {rawDocText = Just "%TRUE if the object should be cleaned up.", sinceVersion = Nothing}, args = [Arg {argCName = "obj", argType = TInterface (Name {namespace = "Gst", name = "MiniObject"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "MiniObject to dispose", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}], skipReturn = False, callableThrows = False, callableDeprecated = Nothing, callableDocumentation = Documentation {rawDocText = Just "Function prototype for when a miniobject has lost its last refcount.\nImplementation of the mini object are allowed to revive the\npassed object by doing a gst_mini_object_ref(). If the object is not\nrevived after the dispose function, the function should return %TRUE\nand the memory associated with the object is freed.", sinceVersion = Nothing}}
-- | Type for the callback on the (unwrapped) C side.
type C_MiniObjectDisposeFunction =
    Ptr Gst.MiniObject.MiniObject ->
    IO CInt

-- Args : [Arg {argCName = "obj", argType = TInterface (Name {namespace = "Gst", name = "MiniObject"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "MiniObject to dispose", 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 "dynamic" __dynamic_C_MiniObjectDisposeFunction :: FunPtr C_MiniObjectDisposeFunction -> C_MiniObjectDisposeFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_MiniObjectDisposeFunction ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_MiniObjectDisposeFunction
    -> Gst.MiniObject.MiniObject
    {- ^ /@obj@/: MiniObject to dispose -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the object should be cleaned up. -}
dynamic_MiniObjectDisposeFunction __funPtr obj = liftIO $ do
    obj' <- unsafeManagedPtrGetPtr obj
    result <- (__dynamic_C_MiniObjectDisposeFunction __funPtr) obj'
    let result' = (/= 0) result
    touchManagedPtr obj