-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria

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

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.BasicTypes as B.Types
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.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
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 = TGValue
          , 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
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_ValueSerializeFunc =
    Ptr GValue ->
    IO CString

-- Args: [ Arg
--           { argCName = "value1"
--           , argType = TGValue
--           , 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 t'GI.GObject.Structs.Value.Value'
    -> m T.Text
    -- ^ __Returns:__ the string representation of the value
dynamic_ValueSerializeFunc :: FunPtr C_ValueSerializeFunc -> GValue -> m Text
dynamic_ValueSerializeFunc FunPtr C_ValueSerializeFunc
__funPtr GValue
value1 = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
    Ptr GValue
value1' <- GValue -> IO (Ptr GValue)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GValue
value1
    CString
result <- (FunPtr C_ValueSerializeFunc -> C_ValueSerializeFunc
__dynamic_C_ValueSerializeFunc FunPtr C_ValueSerializeFunc
__funPtr) Ptr GValue
value1'
    Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"valueSerializeFunc" CString
result
    Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
    GValue -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GValue
value1
    Ptr GValue -> IO ()
B.GValue.unsetGValue Ptr GValue
value1'
    Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
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 t'GI.GObject.Structs.Value.Value'.
-- 
-- Free-function: g_free
type ValueSerializeFunc =
    GValue
    -- ^ /@value1@/: a t'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 :: Maybe ValueSerializeFunc
noValueSerializeFunc = Maybe ValueSerializeFunc
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_ValueSerializeFunc :: MonadIO m => ValueSerializeFunc -> m (GClosure C_ValueSerializeFunc)
genClosure_ValueSerializeFunc :: ValueSerializeFunc -> m (GClosure C_ValueSerializeFunc)
genClosure_ValueSerializeFunc ValueSerializeFunc
cb = IO (GClosure C_ValueSerializeFunc)
-> m (GClosure C_ValueSerializeFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ValueSerializeFunc)
 -> m (GClosure C_ValueSerializeFunc))
-> IO (GClosure C_ValueSerializeFunc)
-> m (GClosure C_ValueSerializeFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_ValueSerializeFunc
cb' = Maybe (Ptr (FunPtr C_ValueSerializeFunc))
-> ValueSerializeFunc -> C_ValueSerializeFunc
wrap_ValueSerializeFunc Maybe (Ptr (FunPtr C_ValueSerializeFunc))
forall a. Maybe a
Nothing ValueSerializeFunc
cb
    C_ValueSerializeFunc -> IO (FunPtr C_ValueSerializeFunc)
mk_ValueSerializeFunc C_ValueSerializeFunc
cb' IO (FunPtr C_ValueSerializeFunc)
-> (FunPtr C_ValueSerializeFunc
    -> IO (GClosure C_ValueSerializeFunc))
-> IO (GClosure C_ValueSerializeFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ValueSerializeFunc -> IO (GClosure C_ValueSerializeFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `ValueSerializeFunc` into a `C_ValueSerializeFunc`.
wrap_ValueSerializeFunc ::
    Maybe (Ptr (FunPtr C_ValueSerializeFunc)) ->
    ValueSerializeFunc ->
    C_ValueSerializeFunc
wrap_ValueSerializeFunc :: Maybe (Ptr (FunPtr C_ValueSerializeFunc))
-> ValueSerializeFunc -> C_ValueSerializeFunc
wrap_ValueSerializeFunc Maybe (Ptr (FunPtr C_ValueSerializeFunc))
funptrptr ValueSerializeFunc
_cb Ptr GValue
value1 = do
    GValue
value1' <- Ptr GValue -> IO GValue
B.GValue.newGValueFromPtr Ptr GValue
value1
    Text
result <- ValueSerializeFunc
_cb  GValue
value1'
    Maybe (Ptr (FunPtr C_ValueSerializeFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_ValueSerializeFunc))
funptrptr
    CString
result' <- Text -> IO CString
textToCString Text
result
    CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
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 = TGValue
          , 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
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_ValueDeserializeFunc =
    Ptr GValue ->
    CString ->
    IO CInt

-- Args: [ Arg
--           { argCName = "dest"
--           , argType = TGValue
--           , 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 t'GI.GObject.Structs.Value.Value'
    -> T.Text
    -- ^ /@s@/: a string
    -> m Bool
    -- ^ __Returns:__ 'P.True' for success
dynamic_ValueDeserializeFunc :: FunPtr C_ValueDeserializeFunc -> GValue -> Text -> m Bool
dynamic_ValueDeserializeFunc FunPtr C_ValueDeserializeFunc
__funPtr GValue
dest Text
s = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr GValue
dest' <- GValue -> IO (Ptr GValue)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GValue
dest
    CString
s' <- Text -> IO CString
textToCString Text
s
    CInt
result <- (FunPtr C_ValueDeserializeFunc -> C_ValueDeserializeFunc
__dynamic_C_ValueDeserializeFunc FunPtr C_ValueDeserializeFunc
__funPtr) Ptr GValue
dest' CString
s'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    GValue -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GValue
dest
    Ptr GValue -> IO ()
B.GValue.unsetGValue Ptr GValue
dest'
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
s'
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
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 t'GI.GObject.Structs.Value.Value'.
type ValueDeserializeFunc =
    GValue
    -- ^ /@dest@/: a t'GI.GObject.Structs.Value.Value'
    -> T.Text
    -- ^ /@s@/: a string
    -> IO Bool
    -- ^ __Returns:__ 'P.True' for success

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

-- | Wrap the callback into a `GClosure`.
genClosure_ValueDeserializeFunc :: MonadIO m => ValueDeserializeFunc -> m (GClosure C_ValueDeserializeFunc)
genClosure_ValueDeserializeFunc :: ValueDeserializeFunc -> m (GClosure C_ValueDeserializeFunc)
genClosure_ValueDeserializeFunc ValueDeserializeFunc
cb = IO (GClosure C_ValueDeserializeFunc)
-> m (GClosure C_ValueDeserializeFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ValueDeserializeFunc)
 -> m (GClosure C_ValueDeserializeFunc))
-> IO (GClosure C_ValueDeserializeFunc)
-> m (GClosure C_ValueDeserializeFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_ValueDeserializeFunc
cb' = Maybe (Ptr (FunPtr C_ValueDeserializeFunc))
-> ValueDeserializeFunc -> C_ValueDeserializeFunc
wrap_ValueDeserializeFunc Maybe (Ptr (FunPtr C_ValueDeserializeFunc))
forall a. Maybe a
Nothing ValueDeserializeFunc
cb
    C_ValueDeserializeFunc -> IO (FunPtr C_ValueDeserializeFunc)
mk_ValueDeserializeFunc C_ValueDeserializeFunc
cb' IO (FunPtr C_ValueDeserializeFunc)
-> (FunPtr C_ValueDeserializeFunc
    -> IO (GClosure C_ValueDeserializeFunc))
-> IO (GClosure C_ValueDeserializeFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ValueDeserializeFunc
-> IO (GClosure C_ValueDeserializeFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `ValueDeserializeFunc` into a `C_ValueDeserializeFunc`.
wrap_ValueDeserializeFunc ::
    Maybe (Ptr (FunPtr C_ValueDeserializeFunc)) ->
    ValueDeserializeFunc ->
    C_ValueDeserializeFunc
wrap_ValueDeserializeFunc :: Maybe (Ptr (FunPtr C_ValueDeserializeFunc))
-> ValueDeserializeFunc -> C_ValueDeserializeFunc
wrap_ValueDeserializeFunc Maybe (Ptr (FunPtr C_ValueDeserializeFunc))
funptrptr ValueDeserializeFunc
_cb Ptr GValue
dest CString
s = do
    GValue
dest' <- Ptr GValue -> IO GValue
B.GValue.newGValueFromPtr Ptr GValue
dest
    Text
s' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
s
    Bool
result <- ValueDeserializeFunc
_cb  GValue
dest' Text
s'
    Maybe (Ptr (FunPtr C_ValueDeserializeFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_ValueDeserializeFunc))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
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 = TGValue
          , 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 = TGValue
          , 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
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_ValueCompareFunc =
    Ptr GValue ->
    Ptr GValue ->
    IO Int32

-- Args: [ Arg
--           { argCName = "value1"
--           , argType = TGValue
--           , 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 = TGValue
--           , 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 C_ValueCompareFunc -> GValue -> GValue -> m Int32
dynamic_ValueCompareFunc FunPtr C_ValueCompareFunc
__funPtr GValue
value1 GValue
value2 = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ do
    Ptr GValue
value1' <- GValue -> IO (Ptr GValue)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GValue
value1
    Ptr GValue
value2' <- GValue -> IO (Ptr GValue)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GValue
value2
    Int32
result <- (FunPtr C_ValueCompareFunc -> C_ValueCompareFunc
__dynamic_C_ValueCompareFunc FunPtr C_ValueCompareFunc
__funPtr) Ptr GValue
value1' Ptr GValue
value2'
    GValue -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GValue
value1
    GValue -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GValue
value2
    Ptr GValue -> IO ()
B.GValue.unsetGValue Ptr GValue
value1'
    Ptr GValue -> IO ()
B.GValue.unsetGValue Ptr GValue
value2'
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
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 t'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 :: Maybe ValueCompareFunc
noValueCompareFunc = Maybe ValueCompareFunc
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_ValueCompareFunc :: MonadIO m => ValueCompareFunc -> m (GClosure C_ValueCompareFunc)
genClosure_ValueCompareFunc :: ValueCompareFunc -> m (GClosure C_ValueCompareFunc)
genClosure_ValueCompareFunc ValueCompareFunc
cb = IO (GClosure C_ValueCompareFunc) -> m (GClosure C_ValueCompareFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ValueCompareFunc)
 -> m (GClosure C_ValueCompareFunc))
-> IO (GClosure C_ValueCompareFunc)
-> m (GClosure C_ValueCompareFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_ValueCompareFunc
cb' = Maybe (Ptr (FunPtr C_ValueCompareFunc))
-> ValueCompareFunc -> C_ValueCompareFunc
wrap_ValueCompareFunc Maybe (Ptr (FunPtr C_ValueCompareFunc))
forall a. Maybe a
Nothing ValueCompareFunc
cb
    C_ValueCompareFunc -> IO (FunPtr C_ValueCompareFunc)
mk_ValueCompareFunc C_ValueCompareFunc
cb' IO (FunPtr C_ValueCompareFunc)
-> (FunPtr C_ValueCompareFunc -> IO (GClosure C_ValueCompareFunc))
-> IO (GClosure C_ValueCompareFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ValueCompareFunc -> IO (GClosure C_ValueCompareFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `ValueCompareFunc` into a `C_ValueCompareFunc`.
wrap_ValueCompareFunc ::
    Maybe (Ptr (FunPtr C_ValueCompareFunc)) ->
    ValueCompareFunc ->
    C_ValueCompareFunc
wrap_ValueCompareFunc :: Maybe (Ptr (FunPtr C_ValueCompareFunc))
-> ValueCompareFunc -> C_ValueCompareFunc
wrap_ValueCompareFunc Maybe (Ptr (FunPtr C_ValueCompareFunc))
funptrptr ValueCompareFunc
_cb Ptr GValue
value1 Ptr GValue
value2 = do
    GValue
value1' <- Ptr GValue -> IO GValue
B.GValue.newGValueFromPtr Ptr GValue
value1
    GValue
value2' <- Ptr GValue -> IO GValue
B.GValue.newGValueFromPtr Ptr GValue
value2
    Int32
result <- ValueCompareFunc
_cb  GValue
value1' GValue
value2'
    Maybe (Ptr (FunPtr C_ValueCompareFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_ValueCompareFunc))
funptrptr
    Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
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 }
  , callableResolvable = 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 C_TypeFindSuggestFieldCallback
-> Ptr () -> Word32 -> Caps -> m ()
dynamic_TypeFindSuggestFieldCallback FunPtr C_TypeFindSuggestFieldCallback
__funPtr Ptr ()
data_ Word32
probability Caps
caps = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Caps
caps' <- Caps -> IO (Ptr Caps)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Caps
caps
    (FunPtr C_TypeFindSuggestFieldCallback
-> C_TypeFindSuggestFieldCallback
__dynamic_C_TypeFindSuggestFieldCallback FunPtr C_TypeFindSuggestFieldCallback
__funPtr) Ptr ()
data_ Word32
probability Ptr Caps
caps'
    Caps -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Caps
caps
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
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 :: Maybe TypeFindSuggestFieldCallback
noTypeFindSuggestFieldCallback = Maybe TypeFindSuggestFieldCallback
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_TypeFindSuggestFieldCallback :: MonadIO m => TypeFindSuggestFieldCallback -> m (GClosure C_TypeFindSuggestFieldCallback)
genClosure_TypeFindSuggestFieldCallback :: TypeFindSuggestFieldCallback
-> m (GClosure C_TypeFindSuggestFieldCallback)
genClosure_TypeFindSuggestFieldCallback TypeFindSuggestFieldCallback
cb = IO (GClosure C_TypeFindSuggestFieldCallback)
-> m (GClosure C_TypeFindSuggestFieldCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_TypeFindSuggestFieldCallback)
 -> m (GClosure C_TypeFindSuggestFieldCallback))
-> IO (GClosure C_TypeFindSuggestFieldCallback)
-> m (GClosure C_TypeFindSuggestFieldCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_TypeFindSuggestFieldCallback
cb' = Maybe (Ptr (FunPtr C_TypeFindSuggestFieldCallback))
-> TypeFindSuggestFieldCallback -> C_TypeFindSuggestFieldCallback
wrap_TypeFindSuggestFieldCallback Maybe (Ptr (FunPtr C_TypeFindSuggestFieldCallback))
forall a. Maybe a
Nothing TypeFindSuggestFieldCallback
cb
    C_TypeFindSuggestFieldCallback
-> IO (FunPtr C_TypeFindSuggestFieldCallback)
mk_TypeFindSuggestFieldCallback C_TypeFindSuggestFieldCallback
cb' IO (FunPtr C_TypeFindSuggestFieldCallback)
-> (FunPtr C_TypeFindSuggestFieldCallback
    -> IO (GClosure C_TypeFindSuggestFieldCallback))
-> IO (GClosure C_TypeFindSuggestFieldCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_TypeFindSuggestFieldCallback
-> IO (GClosure C_TypeFindSuggestFieldCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `TypeFindSuggestFieldCallback` into a `C_TypeFindSuggestFieldCallback`.
wrap_TypeFindSuggestFieldCallback ::
    Maybe (Ptr (FunPtr C_TypeFindSuggestFieldCallback)) ->
    TypeFindSuggestFieldCallback ->
    C_TypeFindSuggestFieldCallback
wrap_TypeFindSuggestFieldCallback :: Maybe (Ptr (FunPtr C_TypeFindSuggestFieldCallback))
-> TypeFindSuggestFieldCallback -> C_TypeFindSuggestFieldCallback
wrap_TypeFindSuggestFieldCallback Maybe (Ptr (FunPtr C_TypeFindSuggestFieldCallback))
funptrptr TypeFindSuggestFieldCallback
_cb Ptr ()
data_ Word32
probability Ptr Caps
caps = do
    (ManagedPtr Caps -> Caps) -> Ptr Caps -> (Caps -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Caps -> Caps
Gst.Caps.Caps Ptr Caps
caps ((Caps -> IO ()) -> IO ()) -> (Caps -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Caps
caps' -> do
        TypeFindSuggestFieldCallback
_cb  Ptr ()
data_ Word32
probability Caps
caps'
        Maybe (Ptr (FunPtr C_TypeFindSuggestFieldCallback)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_TypeFindSuggestFieldCallback))
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 }
  , callableResolvable = 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 C_TypeFindPeekFieldCallback
-> Ptr () -> Int64 -> Word32 -> m Word8
dynamic_TypeFindPeekFieldCallback FunPtr C_TypeFindPeekFieldCallback
__funPtr Ptr ()
data_ Int64
offset Word32
size = IO Word8 -> m Word8
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word8 -> m Word8) -> IO Word8 -> m Word8
forall a b. (a -> b) -> a -> b
$ do
    Word8
result <- (FunPtr C_TypeFindPeekFieldCallback -> C_TypeFindPeekFieldCallback
__dynamic_C_TypeFindPeekFieldCallback FunPtr C_TypeFindPeekFieldCallback
__funPtr) Ptr ()
data_ Int64
offset Word32
size
    Word8 -> IO Word8
forall (m :: * -> *) a. Monad m => a -> m a
return Word8
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 :: Maybe C_TypeFindPeekFieldCallback
noTypeFindPeekFieldCallback = Maybe C_TypeFindPeekFieldCallback
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_TypeFindPeekFieldCallback :: MonadIO m => TypeFindPeekFieldCallback -> m (GClosure C_TypeFindPeekFieldCallback)
genClosure_TypeFindPeekFieldCallback :: C_TypeFindPeekFieldCallback
-> m (GClosure C_TypeFindPeekFieldCallback)
genClosure_TypeFindPeekFieldCallback C_TypeFindPeekFieldCallback
cb = IO (GClosure C_TypeFindPeekFieldCallback)
-> m (GClosure C_TypeFindPeekFieldCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_TypeFindPeekFieldCallback)
 -> m (GClosure C_TypeFindPeekFieldCallback))
-> IO (GClosure C_TypeFindPeekFieldCallback)
-> m (GClosure C_TypeFindPeekFieldCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_TypeFindPeekFieldCallback
cb' = Maybe (Ptr (FunPtr C_TypeFindPeekFieldCallback))
-> C_TypeFindPeekFieldCallback -> C_TypeFindPeekFieldCallback
wrap_TypeFindPeekFieldCallback Maybe (Ptr (FunPtr C_TypeFindPeekFieldCallback))
forall a. Maybe a
Nothing C_TypeFindPeekFieldCallback
cb
    C_TypeFindPeekFieldCallback
-> IO (FunPtr C_TypeFindPeekFieldCallback)
mk_TypeFindPeekFieldCallback C_TypeFindPeekFieldCallback
cb' IO (FunPtr C_TypeFindPeekFieldCallback)
-> (FunPtr C_TypeFindPeekFieldCallback
    -> IO (GClosure C_TypeFindPeekFieldCallback))
-> IO (GClosure C_TypeFindPeekFieldCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_TypeFindPeekFieldCallback
-> IO (GClosure C_TypeFindPeekFieldCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `TypeFindPeekFieldCallback` into a `C_TypeFindPeekFieldCallback`.
wrap_TypeFindPeekFieldCallback ::
    Maybe (Ptr (FunPtr C_TypeFindPeekFieldCallback)) ->
    TypeFindPeekFieldCallback ->
    C_TypeFindPeekFieldCallback
wrap_TypeFindPeekFieldCallback :: Maybe (Ptr (FunPtr C_TypeFindPeekFieldCallback))
-> C_TypeFindPeekFieldCallback -> C_TypeFindPeekFieldCallback
wrap_TypeFindPeekFieldCallback Maybe (Ptr (FunPtr C_TypeFindPeekFieldCallback))
funptrptr C_TypeFindPeekFieldCallback
_cb Ptr ()
data_ Int64
offset Word32
size = do
    Word8
result <- C_TypeFindPeekFieldCallback
_cb  Ptr ()
data_ Int64
offset Word32
size
    Maybe (Ptr (FunPtr C_TypeFindPeekFieldCallback)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_TypeFindPeekFieldCallback))
funptrptr
    Word8 -> IO Word8
forall (m :: * -> *) a. Monad m => a -> m a
return Word8
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 }
  , callableResolvable = 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 C_TypeFindGetLengthFieldCallback -> Ptr () -> m Word64
dynamic_TypeFindGetLengthFieldCallback FunPtr C_TypeFindGetLengthFieldCallback
__funPtr Ptr ()
data_ = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
    Word64
result <- (FunPtr C_TypeFindGetLengthFieldCallback
-> C_TypeFindGetLengthFieldCallback
__dynamic_C_TypeFindGetLengthFieldCallback FunPtr C_TypeFindGetLengthFieldCallback
__funPtr) Ptr ()
data_
    Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
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 :: Maybe C_TypeFindGetLengthFieldCallback
noTypeFindGetLengthFieldCallback = Maybe C_TypeFindGetLengthFieldCallback
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_TypeFindGetLengthFieldCallback :: MonadIO m => TypeFindGetLengthFieldCallback -> m (GClosure C_TypeFindGetLengthFieldCallback)
genClosure_TypeFindGetLengthFieldCallback :: C_TypeFindGetLengthFieldCallback
-> m (GClosure C_TypeFindGetLengthFieldCallback)
genClosure_TypeFindGetLengthFieldCallback C_TypeFindGetLengthFieldCallback
cb = IO (GClosure C_TypeFindGetLengthFieldCallback)
-> m (GClosure C_TypeFindGetLengthFieldCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_TypeFindGetLengthFieldCallback)
 -> m (GClosure C_TypeFindGetLengthFieldCallback))
-> IO (GClosure C_TypeFindGetLengthFieldCallback)
-> m (GClosure C_TypeFindGetLengthFieldCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_TypeFindGetLengthFieldCallback
cb' = Maybe (Ptr (FunPtr C_TypeFindGetLengthFieldCallback))
-> C_TypeFindGetLengthFieldCallback
-> C_TypeFindGetLengthFieldCallback
wrap_TypeFindGetLengthFieldCallback Maybe (Ptr (FunPtr C_TypeFindGetLengthFieldCallback))
forall a. Maybe a
Nothing C_TypeFindGetLengthFieldCallback
cb
    C_TypeFindGetLengthFieldCallback
-> IO (FunPtr C_TypeFindGetLengthFieldCallback)
mk_TypeFindGetLengthFieldCallback C_TypeFindGetLengthFieldCallback
cb' IO (FunPtr C_TypeFindGetLengthFieldCallback)
-> (FunPtr C_TypeFindGetLengthFieldCallback
    -> IO (GClosure C_TypeFindGetLengthFieldCallback))
-> IO (GClosure C_TypeFindGetLengthFieldCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_TypeFindGetLengthFieldCallback
-> IO (GClosure C_TypeFindGetLengthFieldCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `TypeFindGetLengthFieldCallback` into a `C_TypeFindGetLengthFieldCallback`.
wrap_TypeFindGetLengthFieldCallback ::
    Maybe (Ptr (FunPtr C_TypeFindGetLengthFieldCallback)) ->
    TypeFindGetLengthFieldCallback ->
    C_TypeFindGetLengthFieldCallback
wrap_TypeFindGetLengthFieldCallback :: Maybe (Ptr (FunPtr C_TypeFindGetLengthFieldCallback))
-> C_TypeFindGetLengthFieldCallback
-> C_TypeFindGetLengthFieldCallback
wrap_TypeFindGetLengthFieldCallback Maybe (Ptr (FunPtr C_TypeFindGetLengthFieldCallback))
funptrptr C_TypeFindGetLengthFieldCallback
_cb Ptr ()
data_ = do
    Word64
result <- C_TypeFindGetLengthFieldCallback
_cb  Ptr ()
data_
    Maybe (Ptr (FunPtr C_TypeFindGetLengthFieldCallback)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_TypeFindGetLengthFieldCallback))
funptrptr
    Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
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
        }
  , callableResolvable = 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 t'GI.Gst.Structs.TypeFind.TypeFind' structure
    -> Ptr ()
    -- ^ /@userData@/: optional data to pass to the function
    -> m ()
dynamic_TypeFindFunction :: FunPtr C_TypeFindFunction -> TypeFind -> Ptr () -> m ()
dynamic_TypeFindFunction FunPtr C_TypeFindFunction
__funPtr TypeFind
find Ptr ()
userData = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr TypeFind
find' <- TypeFind -> IO (Ptr TypeFind)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TypeFind
find
    (FunPtr C_TypeFindFunction -> C_TypeFindFunction
__dynamic_C_TypeFindFunction FunPtr C_TypeFindFunction
__funPtr) Ptr TypeFind
find' Ptr ()
userData
    TypeFind -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TypeFind
find
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
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 t'GI.Gst.Structs.TypeFind.TypeFind' structure
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `TypeFindFunction`@.
noTypeFindFunction :: Maybe TypeFindFunction
noTypeFindFunction :: Maybe (TypeFind -> IO ())
noTypeFindFunction = Maybe (TypeFind -> IO ())
forall a. Maybe a
Nothing

-- | A function that will be called by typefinding.
type TypeFindFunction_WithClosures =
    Gst.TypeFind.TypeFind
    -- ^ /@find@/: A t'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 :: Maybe TypeFindFunction_WithClosures
noTypeFindFunction_WithClosures = Maybe TypeFindFunction_WithClosures
forall a. Maybe a
Nothing

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

-- | Wrap the callback into a `GClosure`.
genClosure_TypeFindFunction :: MonadIO m => TypeFindFunction -> m (GClosure C_TypeFindFunction)
genClosure_TypeFindFunction :: (TypeFind -> IO ()) -> m (GClosure C_TypeFindFunction)
genClosure_TypeFindFunction TypeFind -> IO ()
cb = IO (GClosure C_TypeFindFunction) -> m (GClosure C_TypeFindFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_TypeFindFunction)
 -> m (GClosure C_TypeFindFunction))
-> IO (GClosure C_TypeFindFunction)
-> m (GClosure C_TypeFindFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: TypeFindFunction_WithClosures
cb' = (TypeFind -> IO ()) -> TypeFindFunction_WithClosures
drop_closures_TypeFindFunction TypeFind -> IO ()
cb
    let cb'' :: C_TypeFindFunction
cb'' = Maybe (Ptr (FunPtr C_TypeFindFunction))
-> TypeFindFunction_WithClosures -> C_TypeFindFunction
wrap_TypeFindFunction Maybe (Ptr (FunPtr C_TypeFindFunction))
forall a. Maybe a
Nothing TypeFindFunction_WithClosures
cb'
    C_TypeFindFunction -> IO (FunPtr C_TypeFindFunction)
mk_TypeFindFunction C_TypeFindFunction
cb'' IO (FunPtr C_TypeFindFunction)
-> (FunPtr C_TypeFindFunction -> IO (GClosure C_TypeFindFunction))
-> IO (GClosure C_TypeFindFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_TypeFindFunction -> IO (GClosure C_TypeFindFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `TypeFindFunction` into a `C_TypeFindFunction`.
wrap_TypeFindFunction ::
    Maybe (Ptr (FunPtr C_TypeFindFunction)) ->
    TypeFindFunction_WithClosures ->
    C_TypeFindFunction
wrap_TypeFindFunction :: Maybe (Ptr (FunPtr C_TypeFindFunction))
-> TypeFindFunction_WithClosures -> C_TypeFindFunction
wrap_TypeFindFunction Maybe (Ptr (FunPtr C_TypeFindFunction))
funptrptr TypeFindFunction_WithClosures
_cb Ptr TypeFind
find Ptr ()
userData = do
    TypeFind
find' <- ((ManagedPtr TypeFind -> TypeFind) -> Ptr TypeFind -> IO TypeFind
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr TypeFind -> TypeFind
Gst.TypeFind.TypeFind) Ptr TypeFind
find
    TypeFindFunction_WithClosures
_cb  TypeFind
find' Ptr ()
userData
    Maybe (Ptr (FunPtr C_TypeFindFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_TypeFindFunction))
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
        }
  , callableResolvable = 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 t'GI.Gst.Objects.Task.Task'
    -> GLib.Thread.Thread
    -- ^ /@thread@/: The t'GI.GLib.Structs.Thread.Thread'
    -> Ptr ()
    -- ^ /@userData@/: user data
    -> m ()
dynamic_TaskThreadFunc :: FunPtr C_TaskThreadFunc -> a -> Thread -> Ptr () -> m ()
dynamic_TaskThreadFunc FunPtr C_TaskThreadFunc
__funPtr a
task Thread
thread Ptr ()
userData = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Task
task' <- a -> IO (Ptr Task)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
task
    Ptr Thread
thread' <- Thread -> IO (Ptr Thread)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Thread
thread
    (FunPtr C_TaskThreadFunc -> C_TaskThreadFunc
__dynamic_C_TaskThreadFunc FunPtr C_TaskThreadFunc
__funPtr) Ptr Task
task' Ptr Thread
thread' Ptr ()
userData
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
task
    Thread -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Thread
thread
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
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 t'GI.Gst.Objects.Task.Task'
    -> GLib.Thread.Thread
    -- ^ /@thread@/: The t'GI.GLib.Structs.Thread.Thread'
    -> IO ()

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

-- | Custom GstTask thread callback functions that can be installed.
type TaskThreadFunc_WithClosures =
    Gst.Task.Task
    -- ^ /@task@/: The t'GI.Gst.Objects.Task.Task'
    -> GLib.Thread.Thread
    -- ^ /@thread@/: The t'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 :: Maybe TaskThreadFunc_WithClosures
noTaskThreadFunc_WithClosures = Maybe TaskThreadFunc_WithClosures
forall a. Maybe a
Nothing

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

-- | Wrap the callback into a `GClosure`.
genClosure_TaskThreadFunc :: MonadIO m => TaskThreadFunc -> m (GClosure C_TaskThreadFunc)
genClosure_TaskThreadFunc :: TaskThreadFunc -> m (GClosure C_TaskThreadFunc)
genClosure_TaskThreadFunc TaskThreadFunc
cb = IO (GClosure C_TaskThreadFunc) -> m (GClosure C_TaskThreadFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_TaskThreadFunc) -> m (GClosure C_TaskThreadFunc))
-> IO (GClosure C_TaskThreadFunc) -> m (GClosure C_TaskThreadFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: TaskThreadFunc_WithClosures
cb' = TaskThreadFunc -> TaskThreadFunc_WithClosures
drop_closures_TaskThreadFunc TaskThreadFunc
cb
    let cb'' :: C_TaskThreadFunc
cb'' = Maybe (Ptr (FunPtr C_TaskThreadFunc))
-> TaskThreadFunc_WithClosures -> C_TaskThreadFunc
wrap_TaskThreadFunc Maybe (Ptr (FunPtr C_TaskThreadFunc))
forall a. Maybe a
Nothing TaskThreadFunc_WithClosures
cb'
    C_TaskThreadFunc -> IO (FunPtr C_TaskThreadFunc)
mk_TaskThreadFunc C_TaskThreadFunc
cb'' IO (FunPtr C_TaskThreadFunc)
-> (FunPtr C_TaskThreadFunc -> IO (GClosure C_TaskThreadFunc))
-> IO (GClosure C_TaskThreadFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_TaskThreadFunc -> IO (GClosure C_TaskThreadFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `TaskThreadFunc` into a `C_TaskThreadFunc`.
wrap_TaskThreadFunc ::
    Maybe (Ptr (FunPtr C_TaskThreadFunc)) ->
    TaskThreadFunc_WithClosures ->
    C_TaskThreadFunc
wrap_TaskThreadFunc :: Maybe (Ptr (FunPtr C_TaskThreadFunc))
-> TaskThreadFunc_WithClosures -> C_TaskThreadFunc
wrap_TaskThreadFunc Maybe (Ptr (FunPtr C_TaskThreadFunc))
funptrptr TaskThreadFunc_WithClosures
_cb Ptr Task
task Ptr Thread
thread Ptr ()
userData = do
    Task
task' <- ((ManagedPtr Task -> Task) -> Ptr Task -> IO Task
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Task -> Task
Gst.Task.Task) Ptr Task
task
    (ManagedPtr Thread -> Thread)
-> Ptr Thread -> (Thread -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Thread -> Thread
GLib.Thread.Thread Ptr Thread
thread ((Thread -> IO ()) -> IO ()) -> (Thread -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Thread
thread' -> do
        TaskThreadFunc_WithClosures
_cb  Task
task' Thread
thread' Ptr ()
userData
        Maybe (Ptr (FunPtr C_TaskThreadFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_TaskThreadFunc))
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
        }
  , callableResolvable = 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 C_TaskPoolFunction -> Ptr () -> m ()
dynamic_TaskPoolFunction FunPtr C_TaskPoolFunction
__funPtr Ptr ()
userData = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    (FunPtr C_TaskPoolFunction -> C_TaskPoolFunction
__dynamic_C_TaskPoolFunction FunPtr C_TaskPoolFunction
__funPtr) Ptr ()
userData
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
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 :: Maybe (IO ())
noTaskPoolFunction = Maybe (IO ())
forall a. Maybe a
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 :: Maybe C_TaskPoolFunction
noTaskPoolFunction_WithClosures = Maybe C_TaskPoolFunction
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_TaskPoolFunction :: TaskPoolFunction -> TaskPoolFunction_WithClosures
drop_closures_TaskPoolFunction :: IO () -> C_TaskPoolFunction
drop_closures_TaskPoolFunction IO ()
_f Ptr ()
_ = IO ()
_f 

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


-- | Wrap a `TaskPoolFunction` into a `C_TaskPoolFunction`.
wrap_TaskPoolFunction ::
    Maybe (Ptr (FunPtr C_TaskPoolFunction)) ->
    TaskPoolFunction_WithClosures ->
    C_TaskPoolFunction
wrap_TaskPoolFunction :: Maybe (Ptr (FunPtr C_TaskPoolFunction))
-> C_TaskPoolFunction -> C_TaskPoolFunction
wrap_TaskPoolFunction Maybe (Ptr (FunPtr C_TaskPoolFunction))
funptrptr C_TaskPoolFunction
_cb Ptr ()
userData = do
    C_TaskPoolFunction
_cb  Ptr ()
userData
    Maybe (Ptr (FunPtr C_TaskPoolFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_TaskPoolFunction))
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
        }
  , callableResolvable = 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 C_TaskPoolFunction -> Ptr () -> m ()
dynamic_TaskFunction FunPtr C_TaskPoolFunction
__funPtr Ptr ()
userData = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    (FunPtr C_TaskPoolFunction -> C_TaskPoolFunction
__dynamic_C_TaskFunction FunPtr C_TaskPoolFunction
__funPtr) Ptr ()
userData
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
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 t'GI.Gst.Objects.Task.Task'.
type TaskFunction =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `TaskFunction`@.
noTaskFunction :: Maybe TaskFunction
noTaskFunction :: Maybe (IO ())
noTaskFunction = Maybe (IO ())
forall a. Maybe a
Nothing

-- | A function that will repeatedly be called in the thread created by
-- a t'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 :: Maybe C_TaskPoolFunction
noTaskFunction_WithClosures = Maybe C_TaskPoolFunction
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_TaskFunction :: TaskFunction -> TaskFunction_WithClosures
drop_closures_TaskFunction :: IO () -> C_TaskPoolFunction
drop_closures_TaskFunction IO ()
_f Ptr ()
_ = IO ()
_f 

-- | Wrap the callback into a `GClosure`.
genClosure_TaskFunction :: MonadIO m => TaskFunction -> m (GClosure C_TaskFunction)
genClosure_TaskFunction :: IO () -> m (GClosure C_TaskPoolFunction)
genClosure_TaskFunction IO ()
cb = IO (GClosure C_TaskPoolFunction) -> m (GClosure C_TaskPoolFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_TaskPoolFunction)
 -> m (GClosure C_TaskPoolFunction))
-> IO (GClosure C_TaskPoolFunction)
-> m (GClosure C_TaskPoolFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_TaskPoolFunction
cb' = IO () -> C_TaskPoolFunction
drop_closures_TaskFunction IO ()
cb
    let cb'' :: C_TaskPoolFunction
cb'' = Maybe (Ptr (FunPtr C_TaskPoolFunction))
-> C_TaskPoolFunction -> C_TaskPoolFunction
wrap_TaskFunction Maybe (Ptr (FunPtr C_TaskPoolFunction))
forall a. Maybe a
Nothing C_TaskPoolFunction
cb'
    C_TaskPoolFunction -> IO (FunPtr C_TaskPoolFunction)
mk_TaskFunction C_TaskPoolFunction
cb'' IO (FunPtr C_TaskPoolFunction)
-> (FunPtr C_TaskPoolFunction -> IO (GClosure C_TaskPoolFunction))
-> IO (GClosure C_TaskPoolFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_TaskPoolFunction -> IO (GClosure C_TaskPoolFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


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


-- callback TagMergeFunc
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "dest"
          , argType = TGValue
          , 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 = TGValue
          , 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
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_TagMergeFunc =
    Ptr GValue ->
    Ptr GValue ->
    IO ()

-- Args: [ Arg
--           { argCName = "dest"
--           , argType = TGValue
--           , 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 = TGValue
--           , 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 t'GI.GObject.Structs.Value.Value'
    -> GValue
    -- ^ /@src@/: the source t'GI.GObject.Structs.Value.Value'
    -> m ()
dynamic_TagMergeFunc :: FunPtr C_TagMergeFunc -> GValue -> GValue -> m ()
dynamic_TagMergeFunc FunPtr C_TagMergeFunc
__funPtr GValue
dest GValue
src = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr GValue
dest' <- GValue -> IO (Ptr GValue)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GValue
dest
    Ptr GValue
src' <- GValue -> IO (Ptr GValue)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GValue
src
    (FunPtr C_TagMergeFunc -> C_TagMergeFunc
__dynamic_C_TagMergeFunc FunPtr C_TagMergeFunc
__funPtr) Ptr GValue
dest' Ptr GValue
src'
    GValue -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GValue
dest
    GValue -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GValue
src
    Ptr GValue -> IO ()
B.GValue.unsetGValue Ptr GValue
dest'
    Ptr GValue -> IO ()
B.GValue.unsetGValue Ptr GValue
src'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
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 t'GI.GObject.Structs.Value.Value'
    -> GValue
    -- ^ /@src@/: the source t'GI.GObject.Structs.Value.Value'
    -> IO ()

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

-- | Wrap the callback into a `GClosure`.
genClosure_TagMergeFunc :: MonadIO m => TagMergeFunc -> m (GClosure C_TagMergeFunc)
genClosure_TagMergeFunc :: TagMergeFunc -> m (GClosure C_TagMergeFunc)
genClosure_TagMergeFunc TagMergeFunc
cb = IO (GClosure C_TagMergeFunc) -> m (GClosure C_TagMergeFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_TagMergeFunc) -> m (GClosure C_TagMergeFunc))
-> IO (GClosure C_TagMergeFunc) -> m (GClosure C_TagMergeFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_TagMergeFunc
cb' = Maybe (Ptr (FunPtr C_TagMergeFunc))
-> TagMergeFunc -> C_TagMergeFunc
wrap_TagMergeFunc Maybe (Ptr (FunPtr C_TagMergeFunc))
forall a. Maybe a
Nothing TagMergeFunc
cb
    C_TagMergeFunc -> IO (FunPtr C_TagMergeFunc)
mk_TagMergeFunc C_TagMergeFunc
cb' IO (FunPtr C_TagMergeFunc)
-> (FunPtr C_TagMergeFunc -> IO (GClosure C_TagMergeFunc))
-> IO (GClosure C_TagMergeFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_TagMergeFunc -> IO (GClosure C_TagMergeFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `TagMergeFunc` into a `C_TagMergeFunc`.
wrap_TagMergeFunc ::
    Maybe (Ptr (FunPtr C_TagMergeFunc)) ->
    TagMergeFunc ->
    C_TagMergeFunc
wrap_TagMergeFunc :: Maybe (Ptr (FunPtr C_TagMergeFunc))
-> TagMergeFunc -> C_TagMergeFunc
wrap_TagMergeFunc Maybe (Ptr (FunPtr C_TagMergeFunc))
funptrptr TagMergeFunc
_cb Ptr GValue
dest Ptr GValue
src = do
    GValue
dest' <- Ptr GValue -> IO GValue
B.GValue.newGValueFromPtr Ptr GValue
dest
    GValue
src' <- Ptr GValue -> IO GValue
B.GValue.newGValueFromPtr Ptr GValue
src
    TagMergeFunc
_cb  GValue
dest' GValue
src'
    Maybe (Ptr (FunPtr C_TagMergeFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_TagMergeFunc))
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
        }
  , callableResolvable = 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 t'GI.Gst.Structs.TagList.TagList'
    -> T.Text
    -- ^ /@tag@/: a name of a tag in /@list@/
    -> Ptr ()
    -- ^ /@userData@/: user data
    -> m ()
dynamic_TagForeachFunc :: FunPtr C_TagForeachFunc -> TagList -> Text -> Ptr () -> m ()
dynamic_TagForeachFunc FunPtr C_TagForeachFunc
__funPtr TagList
list Text
tag Ptr ()
userData = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr TagList
list' <- TagList -> IO (Ptr TagList)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr TagList
list
    CString
tag' <- Text -> IO CString
textToCString Text
tag
    (FunPtr C_TagForeachFunc -> C_TagForeachFunc
__dynamic_C_TagForeachFunc FunPtr C_TagForeachFunc
__funPtr) Ptr TagList
list' CString
tag' Ptr ()
userData
    TagList -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr TagList
list
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
tag'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
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 t'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 :: Maybe TagForeachFunc
noTagForeachFunc = Maybe TagForeachFunc
forall a. Maybe a
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 t'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 :: Maybe TagForeachFunc_WithClosures
noTagForeachFunc_WithClosures = Maybe TagForeachFunc_WithClosures
forall a. Maybe a
Nothing

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

-- | Wrap the callback into a `GClosure`.
genClosure_TagForeachFunc :: MonadIO m => TagForeachFunc -> m (GClosure C_TagForeachFunc)
genClosure_TagForeachFunc :: TagForeachFunc -> m (GClosure C_TagForeachFunc)
genClosure_TagForeachFunc TagForeachFunc
cb = IO (GClosure C_TagForeachFunc) -> m (GClosure C_TagForeachFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_TagForeachFunc) -> m (GClosure C_TagForeachFunc))
-> IO (GClosure C_TagForeachFunc) -> m (GClosure C_TagForeachFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: TagForeachFunc_WithClosures
cb' = TagForeachFunc -> TagForeachFunc_WithClosures
drop_closures_TagForeachFunc TagForeachFunc
cb
    let cb'' :: C_TagForeachFunc
cb'' = Maybe (Ptr (FunPtr C_TagForeachFunc))
-> TagForeachFunc_WithClosures -> C_TagForeachFunc
wrap_TagForeachFunc Maybe (Ptr (FunPtr C_TagForeachFunc))
forall a. Maybe a
Nothing TagForeachFunc_WithClosures
cb'
    C_TagForeachFunc -> IO (FunPtr C_TagForeachFunc)
mk_TagForeachFunc C_TagForeachFunc
cb'' IO (FunPtr C_TagForeachFunc)
-> (FunPtr C_TagForeachFunc -> IO (GClosure C_TagForeachFunc))
-> IO (GClosure C_TagForeachFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_TagForeachFunc -> IO (GClosure C_TagForeachFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `TagForeachFunc` into a `C_TagForeachFunc`.
wrap_TagForeachFunc ::
    Maybe (Ptr (FunPtr C_TagForeachFunc)) ->
    TagForeachFunc_WithClosures ->
    C_TagForeachFunc
wrap_TagForeachFunc :: Maybe (Ptr (FunPtr C_TagForeachFunc))
-> TagForeachFunc_WithClosures -> C_TagForeachFunc
wrap_TagForeachFunc Maybe (Ptr (FunPtr C_TagForeachFunc))
funptrptr TagForeachFunc_WithClosures
_cb Ptr TagList
list CString
tag Ptr ()
userData = do
    (ManagedPtr TagList -> TagList)
-> Ptr TagList -> (TagList -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr TagList -> TagList
Gst.TagList.TagList Ptr TagList
list ((TagList -> IO ()) -> IO ()) -> (TagList -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \TagList
list' -> do
        Text
tag' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
tag
        TagForeachFunc_WithClosures
_cb  TagList
list' Text
tag' Ptr ()
userData
        Maybe (Ptr (FunPtr C_TagForeachFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_TagForeachFunc))
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 = TGValue
          , 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
        }
  , callableResolvable = 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 = TGValue
--           , 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 t'GI.GObject.Structs.Value.Value' of the field
    -> Ptr ()
    -- ^ /@userData@/: user data
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the map operation should continue, 'P.False' if
    -- the map operation should stop with 'P.False'.
dynamic_StructureMapFunc :: FunPtr C_StructureMapFunc -> Word32 -> GValue -> Ptr () -> m Bool
dynamic_StructureMapFunc FunPtr C_StructureMapFunc
__funPtr Word32
fieldId GValue
value Ptr ()
userData = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr GValue
value' <- GValue -> IO (Ptr GValue)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GValue
value
    CInt
result <- (FunPtr C_StructureMapFunc -> C_StructureMapFunc
__dynamic_C_StructureMapFunc FunPtr C_StructureMapFunc
__funPtr) Word32
fieldId Ptr GValue
value' Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    GValue -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GValue
value
    Ptr GValue -> IO ()
B.GValue.unsetGValue Ptr GValue
value'
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
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 t'GI.GObject.Structs.Value.Value' of the field
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the map operation should continue, 'P.False' if
    -- the map operation should stop with 'P.False'.

-- | A convenience synonym for @`Nothing` :: `Maybe` `StructureMapFunc`@.
noStructureMapFunc :: Maybe StructureMapFunc
noStructureMapFunc :: Maybe StructureMapFunc
noStructureMapFunc = Maybe StructureMapFunc
forall a. Maybe a
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 t'GI.GObject.Structs.Value.Value' of the field
    -> Ptr ()
    -- ^ /@userData@/: user data
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the map operation should continue, 'P.False' if
    -- the map operation should stop with 'P.False'.

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

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

-- | Wrap the callback into a `GClosure`.
genClosure_StructureMapFunc :: MonadIO m => StructureMapFunc -> m (GClosure C_StructureMapFunc)
genClosure_StructureMapFunc :: StructureMapFunc -> m (GClosure C_StructureMapFunc)
genClosure_StructureMapFunc StructureMapFunc
cb = IO (GClosure C_StructureMapFunc) -> m (GClosure C_StructureMapFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_StructureMapFunc)
 -> m (GClosure C_StructureMapFunc))
-> IO (GClosure C_StructureMapFunc)
-> m (GClosure C_StructureMapFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: StructureMapFunc_WithClosures
cb' = StructureMapFunc -> StructureMapFunc_WithClosures
drop_closures_StructureMapFunc StructureMapFunc
cb
    let cb'' :: C_StructureMapFunc
cb'' = Maybe (Ptr (FunPtr C_StructureMapFunc))
-> StructureMapFunc_WithClosures -> C_StructureMapFunc
wrap_StructureMapFunc Maybe (Ptr (FunPtr C_StructureMapFunc))
forall a. Maybe a
Nothing StructureMapFunc_WithClosures
cb'
    C_StructureMapFunc -> IO (FunPtr C_StructureMapFunc)
mk_StructureMapFunc C_StructureMapFunc
cb'' IO (FunPtr C_StructureMapFunc)
-> (FunPtr C_StructureMapFunc -> IO (GClosure C_StructureMapFunc))
-> IO (GClosure C_StructureMapFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_StructureMapFunc -> IO (GClosure C_StructureMapFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `StructureMapFunc` into a `C_StructureMapFunc`.
wrap_StructureMapFunc ::
    Maybe (Ptr (FunPtr C_StructureMapFunc)) ->
    StructureMapFunc_WithClosures ->
    C_StructureMapFunc
wrap_StructureMapFunc :: Maybe (Ptr (FunPtr C_StructureMapFunc))
-> StructureMapFunc_WithClosures -> C_StructureMapFunc
wrap_StructureMapFunc Maybe (Ptr (FunPtr C_StructureMapFunc))
funptrptr StructureMapFunc_WithClosures
_cb Word32
fieldId Ptr GValue
value Ptr ()
userData = do
    GValue
value' <- Ptr GValue -> IO GValue
B.GValue.newGValueFromPtr Ptr GValue
value
    Bool
result <- StructureMapFunc_WithClosures
_cb  Word32
fieldId GValue
value' Ptr ()
userData
    Maybe (Ptr (FunPtr C_StructureMapFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_StructureMapFunc))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
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 = TGValue
          , 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
        }
  , callableResolvable = 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 = TGValue
--           , 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 t'GI.GObject.Structs.Value.Value' of the field
    -> Ptr ()
    -- ^ /@userData@/: user data
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the foreach operation should continue, 'P.False' if
    -- the foreach operation should stop with 'P.False'.
dynamic_StructureForeachFunc :: FunPtr C_StructureMapFunc -> Word32 -> GValue -> Ptr () -> m Bool
dynamic_StructureForeachFunc FunPtr C_StructureMapFunc
__funPtr Word32
fieldId GValue
value Ptr ()
userData = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr GValue
value' <- GValue -> IO (Ptr GValue)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GValue
value
    CInt
result <- (FunPtr C_StructureMapFunc -> C_StructureMapFunc
__dynamic_C_StructureForeachFunc FunPtr C_StructureMapFunc
__funPtr) Word32
fieldId Ptr GValue
value' Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    GValue -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GValue
value
    Ptr GValue -> IO ()
B.GValue.unsetGValue Ptr GValue
value'
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
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 t'GI.GObject.Structs.Value.Value' of the field
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the foreach operation should continue, 'P.False' if
    -- the foreach operation should stop with 'P.False'.

-- | A convenience synonym for @`Nothing` :: `Maybe` `StructureForeachFunc`@.
noStructureForeachFunc :: Maybe StructureForeachFunc
noStructureForeachFunc :: Maybe StructureMapFunc
noStructureForeachFunc = Maybe StructureMapFunc
forall a. Maybe a
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 t'GI.GObject.Structs.Value.Value' of the field
    -> Ptr ()
    -- ^ /@userData@/: user data
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the foreach operation should continue, 'P.False' if
    -- the foreach operation should stop with 'P.False'.

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

-- | A simple wrapper that ignores the closure arguments.
drop_closures_StructureForeachFunc :: StructureForeachFunc -> StructureForeachFunc_WithClosures
drop_closures_StructureForeachFunc :: StructureMapFunc -> StructureMapFunc_WithClosures
drop_closures_StructureForeachFunc StructureMapFunc
_f Word32
fieldId GValue
value Ptr ()
_ = StructureMapFunc
_f Word32
fieldId GValue
value

-- | Wrap the callback into a `GClosure`.
genClosure_StructureForeachFunc :: MonadIO m => StructureForeachFunc -> m (GClosure C_StructureForeachFunc)
genClosure_StructureForeachFunc :: StructureMapFunc -> m (GClosure C_StructureMapFunc)
genClosure_StructureForeachFunc StructureMapFunc
cb = IO (GClosure C_StructureMapFunc) -> m (GClosure C_StructureMapFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_StructureMapFunc)
 -> m (GClosure C_StructureMapFunc))
-> IO (GClosure C_StructureMapFunc)
-> m (GClosure C_StructureMapFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: StructureMapFunc_WithClosures
cb' = StructureMapFunc -> StructureMapFunc_WithClosures
drop_closures_StructureForeachFunc StructureMapFunc
cb
    let cb'' :: C_StructureMapFunc
cb'' = Maybe (Ptr (FunPtr C_StructureMapFunc))
-> StructureMapFunc_WithClosures -> C_StructureMapFunc
wrap_StructureForeachFunc Maybe (Ptr (FunPtr C_StructureMapFunc))
forall a. Maybe a
Nothing StructureMapFunc_WithClosures
cb'
    C_StructureMapFunc -> IO (FunPtr C_StructureMapFunc)
mk_StructureForeachFunc C_StructureMapFunc
cb'' IO (FunPtr C_StructureMapFunc)
-> (FunPtr C_StructureMapFunc -> IO (GClosure C_StructureMapFunc))
-> IO (GClosure C_StructureMapFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_StructureMapFunc -> IO (GClosure C_StructureMapFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `StructureForeachFunc` into a `C_StructureForeachFunc`.
wrap_StructureForeachFunc ::
    Maybe (Ptr (FunPtr C_StructureForeachFunc)) ->
    StructureForeachFunc_WithClosures ->
    C_StructureForeachFunc
wrap_StructureForeachFunc :: Maybe (Ptr (FunPtr C_StructureMapFunc))
-> StructureMapFunc_WithClosures -> C_StructureMapFunc
wrap_StructureForeachFunc Maybe (Ptr (FunPtr C_StructureMapFunc))
funptrptr StructureMapFunc_WithClosures
_cb Word32
fieldId Ptr GValue
value Ptr ()
userData = do
    GValue
value' <- Ptr GValue -> IO GValue
B.GValue.newGValueFromPtr Ptr GValue
value
    Bool
result <- StructureMapFunc_WithClosures
_cb  Word32
fieldId GValue
value' Ptr ()
userData
    Maybe (Ptr (FunPtr C_StructureMapFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_StructureMapFunc))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
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 = TGValue
          , 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
        }
  , callableResolvable = 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 = TGValue
--           , 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 t'GI.GObject.Structs.Value.Value' of the field
    -> Ptr ()
    -- ^ /@userData@/: user data
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the field should be preserved, 'P.False' if it
    -- should be removed.
dynamic_StructureFilterMapFunc :: FunPtr C_StructureMapFunc -> Word32 -> GValue -> Ptr () -> m Bool
dynamic_StructureFilterMapFunc FunPtr C_StructureMapFunc
__funPtr Word32
fieldId GValue
value Ptr ()
userData = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr GValue
value' <- GValue -> IO (Ptr GValue)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GValue
value
    CInt
result <- (FunPtr C_StructureMapFunc -> C_StructureMapFunc
__dynamic_C_StructureFilterMapFunc FunPtr C_StructureMapFunc
__funPtr) Word32
fieldId Ptr GValue
value' Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    GValue -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GValue
value
    Ptr GValue -> IO ()
B.GValue.unsetGValue Ptr GValue
value'
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
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 'P.False' is returned.
type StructureFilterMapFunc =
    Word32
    -- ^ /@fieldId@/: the @/GQuark/@ of the field name
    -> GValue
    -- ^ /@value@/: the t'GI.GObject.Structs.Value.Value' of the field
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the field should be preserved, 'P.False' if it
    -- should be removed.

-- | A convenience synonym for @`Nothing` :: `Maybe` `StructureFilterMapFunc`@.
noStructureFilterMapFunc :: Maybe StructureFilterMapFunc
noStructureFilterMapFunc :: Maybe StructureMapFunc
noStructureFilterMapFunc = Maybe StructureMapFunc
forall a. Maybe a
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 'P.False' is returned.
type StructureFilterMapFunc_WithClosures =
    Word32
    -- ^ /@fieldId@/: the @/GQuark/@ of the field name
    -> GValue
    -- ^ /@value@/: the t'GI.GObject.Structs.Value.Value' of the field
    -> Ptr ()
    -- ^ /@userData@/: user data
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the field should be preserved, 'P.False' if it
    -- should be removed.

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

-- | A simple wrapper that ignores the closure arguments.
drop_closures_StructureFilterMapFunc :: StructureFilterMapFunc -> StructureFilterMapFunc_WithClosures
drop_closures_StructureFilterMapFunc :: StructureMapFunc -> StructureMapFunc_WithClosures
drop_closures_StructureFilterMapFunc StructureMapFunc
_f Word32
fieldId GValue
value Ptr ()
_ = StructureMapFunc
_f Word32
fieldId GValue
value

-- | Wrap the callback into a `GClosure`.
genClosure_StructureFilterMapFunc :: MonadIO m => StructureFilterMapFunc -> m (GClosure C_StructureFilterMapFunc)
genClosure_StructureFilterMapFunc :: StructureMapFunc -> m (GClosure C_StructureMapFunc)
genClosure_StructureFilterMapFunc StructureMapFunc
cb = IO (GClosure C_StructureMapFunc) -> m (GClosure C_StructureMapFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_StructureMapFunc)
 -> m (GClosure C_StructureMapFunc))
-> IO (GClosure C_StructureMapFunc)
-> m (GClosure C_StructureMapFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: StructureMapFunc_WithClosures
cb' = StructureMapFunc -> StructureMapFunc_WithClosures
drop_closures_StructureFilterMapFunc StructureMapFunc
cb
    let cb'' :: C_StructureMapFunc
cb'' = Maybe (Ptr (FunPtr C_StructureMapFunc))
-> StructureMapFunc_WithClosures -> C_StructureMapFunc
wrap_StructureFilterMapFunc Maybe (Ptr (FunPtr C_StructureMapFunc))
forall a. Maybe a
Nothing StructureMapFunc_WithClosures
cb'
    C_StructureMapFunc -> IO (FunPtr C_StructureMapFunc)
mk_StructureFilterMapFunc C_StructureMapFunc
cb'' IO (FunPtr C_StructureMapFunc)
-> (FunPtr C_StructureMapFunc -> IO (GClosure C_StructureMapFunc))
-> IO (GClosure C_StructureMapFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_StructureMapFunc -> IO (GClosure C_StructureMapFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `StructureFilterMapFunc` into a `C_StructureFilterMapFunc`.
wrap_StructureFilterMapFunc ::
    Maybe (Ptr (FunPtr C_StructureFilterMapFunc)) ->
    StructureFilterMapFunc_WithClosures ->
    C_StructureFilterMapFunc
wrap_StructureFilterMapFunc :: Maybe (Ptr (FunPtr C_StructureMapFunc))
-> StructureMapFunc_WithClosures -> C_StructureMapFunc
wrap_StructureFilterMapFunc Maybe (Ptr (FunPtr C_StructureMapFunc))
funptrptr StructureMapFunc_WithClosures
_cb Word32
fieldId Ptr GValue
value Ptr ()
userData = do
    GValue
value' <- Ptr GValue -> IO GValue
B.GValue.newGValueFromPtr Ptr GValue
value
    Bool
result <- StructureMapFunc_WithClosures
_cb  Word32
fieldId GValue
value' Ptr ()
userData
    Maybe (Ptr (FunPtr C_StructureMapFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_StructureMapFunc))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
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" }
  , callableResolvable = Nothing
  }
-}
-- | 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 t'GI.Gst.Structs.Promise.Promise'
    -> Ptr ()
    -- ^ /@userData@/: user data
    -> m ()
dynamic_PromiseChangeFunc :: FunPtr C_PromiseChangeFunc -> Promise -> Ptr () -> m ()
dynamic_PromiseChangeFunc FunPtr C_PromiseChangeFunc
__funPtr Promise
promise Ptr ()
userData = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Promise
promise' <- Promise -> IO (Ptr Promise)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Promise
promise
    (FunPtr C_PromiseChangeFunc -> C_PromiseChangeFunc
__dynamic_C_PromiseChangeFunc FunPtr C_PromiseChangeFunc
__funPtr) Ptr Promise
promise' Ptr ()
userData
    Promise -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Promise
promise
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
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 t'GI.Gst.Structs.Promise.Promise'
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `PromiseChangeFunc`@.
noPromiseChangeFunc :: Maybe PromiseChangeFunc
noPromiseChangeFunc :: Maybe (Promise -> IO ())
noPromiseChangeFunc = Maybe (Promise -> IO ())
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
-- 
-- /Since: 1.14/
type PromiseChangeFunc_WithClosures =
    Gst.Promise.Promise
    -- ^ /@promise@/: a t'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 :: Maybe PromiseChangeFunc_WithClosures
noPromiseChangeFunc_WithClosures = Maybe PromiseChangeFunc_WithClosures
forall a. Maybe a
Nothing

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

-- | Wrap the callback into a `GClosure`.
genClosure_PromiseChangeFunc :: MonadIO m => PromiseChangeFunc -> m (GClosure C_PromiseChangeFunc)
genClosure_PromiseChangeFunc :: (Promise -> IO ()) -> m (GClosure C_PromiseChangeFunc)
genClosure_PromiseChangeFunc Promise -> IO ()
cb = IO (GClosure C_PromiseChangeFunc)
-> m (GClosure C_PromiseChangeFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PromiseChangeFunc)
 -> m (GClosure C_PromiseChangeFunc))
-> IO (GClosure C_PromiseChangeFunc)
-> m (GClosure C_PromiseChangeFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: PromiseChangeFunc_WithClosures
cb' = (Promise -> IO ()) -> PromiseChangeFunc_WithClosures
drop_closures_PromiseChangeFunc Promise -> IO ()
cb
    let cb'' :: C_PromiseChangeFunc
cb'' = Maybe (Ptr (FunPtr C_PromiseChangeFunc))
-> PromiseChangeFunc_WithClosures -> C_PromiseChangeFunc
wrap_PromiseChangeFunc Maybe (Ptr (FunPtr C_PromiseChangeFunc))
forall a. Maybe a
Nothing PromiseChangeFunc_WithClosures
cb'
    C_PromiseChangeFunc -> IO (FunPtr C_PromiseChangeFunc)
mk_PromiseChangeFunc C_PromiseChangeFunc
cb'' IO (FunPtr C_PromiseChangeFunc)
-> (FunPtr C_PromiseChangeFunc
    -> IO (GClosure C_PromiseChangeFunc))
-> IO (GClosure C_PromiseChangeFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PromiseChangeFunc -> IO (GClosure C_PromiseChangeFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PromiseChangeFunc` into a `C_PromiseChangeFunc`.
wrap_PromiseChangeFunc ::
    Maybe (Ptr (FunPtr C_PromiseChangeFunc)) ->
    PromiseChangeFunc_WithClosures ->
    C_PromiseChangeFunc
wrap_PromiseChangeFunc :: Maybe (Ptr (FunPtr C_PromiseChangeFunc))
-> PromiseChangeFunc_WithClosures -> C_PromiseChangeFunc
wrap_PromiseChangeFunc Maybe (Ptr (FunPtr C_PromiseChangeFunc))
funptrptr PromiseChangeFunc_WithClosures
_cb Ptr Promise
promise Ptr ()
userData = do
    (ManagedPtr Promise -> Promise)
-> Ptr Promise -> (Promise -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Promise -> Promise
Gst.Promise.Promise Ptr Promise
promise ((Promise -> IO ()) -> IO ()) -> (Promise -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Promise
promise' -> do
        PromiseChangeFunc_WithClosures
_cb  Promise
promise' Ptr ()
userData
        Maybe (Ptr (FunPtr C_PromiseChangeFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_PromiseChangeFunc))
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
        }
  , callableResolvable = 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:__ 'P.True' if plugin initialised successfully
dynamic_PluginInitFunc :: FunPtr C_PluginInitFunc -> a -> m Bool
dynamic_PluginInitFunc FunPtr C_PluginInitFunc
__funPtr a
plugin = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Plugin
plugin' <- a -> IO (Ptr Plugin)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
plugin
    CInt
result <- (FunPtr C_PluginInitFunc -> C_PluginInitFunc
__dynamic_C_PluginInitFunc FunPtr C_PluginInitFunc
__funPtr) Ptr Plugin
plugin'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
plugin
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
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 t'GI.Gst.Objects.PluginFeature.PluginFeature'.
type PluginInitFunc =
    Gst.Plugin.Plugin
    -- ^ /@plugin@/: The plugin object
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if plugin initialised successfully

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

-- | Wrap the callback into a `GClosure`.
genClosure_PluginInitFunc :: MonadIO m => PluginInitFunc -> m (GClosure C_PluginInitFunc)
genClosure_PluginInitFunc :: PluginInitFunc -> m (GClosure C_PluginInitFunc)
genClosure_PluginInitFunc PluginInitFunc
cb = IO (GClosure C_PluginInitFunc) -> m (GClosure C_PluginInitFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PluginInitFunc) -> m (GClosure C_PluginInitFunc))
-> IO (GClosure C_PluginInitFunc) -> m (GClosure C_PluginInitFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PluginInitFunc
cb' = Maybe (Ptr (FunPtr C_PluginInitFunc))
-> PluginInitFunc -> C_PluginInitFunc
wrap_PluginInitFunc Maybe (Ptr (FunPtr C_PluginInitFunc))
forall a. Maybe a
Nothing PluginInitFunc
cb
    C_PluginInitFunc -> IO (FunPtr C_PluginInitFunc)
mk_PluginInitFunc C_PluginInitFunc
cb' IO (FunPtr C_PluginInitFunc)
-> (FunPtr C_PluginInitFunc -> IO (GClosure C_PluginInitFunc))
-> IO (GClosure C_PluginInitFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PluginInitFunc -> IO (GClosure C_PluginInitFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PluginInitFunc` into a `C_PluginInitFunc`.
wrap_PluginInitFunc ::
    Maybe (Ptr (FunPtr C_PluginInitFunc)) ->
    PluginInitFunc ->
    C_PluginInitFunc
wrap_PluginInitFunc :: Maybe (Ptr (FunPtr C_PluginInitFunc))
-> PluginInitFunc -> C_PluginInitFunc
wrap_PluginInitFunc Maybe (Ptr (FunPtr C_PluginInitFunc))
funptrptr PluginInitFunc
_cb Ptr Plugin
plugin = do
    Plugin
plugin' <- ((ManagedPtr Plugin -> Plugin) -> Ptr Plugin -> IO Plugin
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Plugin -> Plugin
Gst.Plugin.Plugin) Ptr Plugin
plugin
    Bool
result <- PluginInitFunc
_cb  Plugin
plugin'
    Maybe (Ptr (FunPtr C_PluginInitFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_PluginInitFunc))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
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
        }
  , callableResolvable = 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:__ 'P.True' if plugin initialised successfully
dynamic_PluginInitFullFunc :: FunPtr C_PluginInitFullFunc -> a -> Ptr () -> m Bool
dynamic_PluginInitFullFunc FunPtr C_PluginInitFullFunc
__funPtr a
plugin Ptr ()
userData = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Plugin
plugin' <- a -> IO (Ptr Plugin)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
plugin
    CInt
result <- (FunPtr C_PluginInitFullFunc -> C_PluginInitFullFunc
__dynamic_C_PluginInitFullFunc FunPtr C_PluginInitFullFunc
__funPtr) Ptr Plugin
plugin' Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
plugin
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
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 t'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 t'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:__ 'P.True' if plugin initialised successfully

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

-- | A plugin should provide a pointer to a function of either t'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 t'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:__ 'P.True' if plugin initialised successfully

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

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

-- | Wrap the callback into a `GClosure`.
genClosure_PluginInitFullFunc :: MonadIO m => PluginInitFullFunc -> m (GClosure C_PluginInitFullFunc)
genClosure_PluginInitFullFunc :: PluginInitFunc -> m (GClosure C_PluginInitFullFunc)
genClosure_PluginInitFullFunc PluginInitFunc
cb = IO (GClosure C_PluginInitFullFunc)
-> m (GClosure C_PluginInitFullFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PluginInitFullFunc)
 -> m (GClosure C_PluginInitFullFunc))
-> IO (GClosure C_PluginInitFullFunc)
-> m (GClosure C_PluginInitFullFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: PluginInitFullFunc_WithClosures
cb' = PluginInitFunc -> PluginInitFullFunc_WithClosures
drop_closures_PluginInitFullFunc PluginInitFunc
cb
    let cb'' :: C_PluginInitFullFunc
cb'' = Maybe (Ptr (FunPtr C_PluginInitFullFunc))
-> PluginInitFullFunc_WithClosures -> C_PluginInitFullFunc
wrap_PluginInitFullFunc Maybe (Ptr (FunPtr C_PluginInitFullFunc))
forall a. Maybe a
Nothing PluginInitFullFunc_WithClosures
cb'
    C_PluginInitFullFunc -> IO (FunPtr C_PluginInitFullFunc)
mk_PluginInitFullFunc C_PluginInitFullFunc
cb'' IO (FunPtr C_PluginInitFullFunc)
-> (FunPtr C_PluginInitFullFunc
    -> IO (GClosure C_PluginInitFullFunc))
-> IO (GClosure C_PluginInitFullFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PluginInitFullFunc -> IO (GClosure C_PluginInitFullFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PluginInitFullFunc` into a `C_PluginInitFullFunc`.
wrap_PluginInitFullFunc ::
    Maybe (Ptr (FunPtr C_PluginInitFullFunc)) ->
    PluginInitFullFunc_WithClosures ->
    C_PluginInitFullFunc
wrap_PluginInitFullFunc :: Maybe (Ptr (FunPtr C_PluginInitFullFunc))
-> PluginInitFullFunc_WithClosures -> C_PluginInitFullFunc
wrap_PluginInitFullFunc Maybe (Ptr (FunPtr C_PluginInitFullFunc))
funptrptr PluginInitFullFunc_WithClosures
_cb Ptr Plugin
plugin Ptr ()
userData = do
    Plugin
plugin' <- ((ManagedPtr Plugin -> Plugin) -> Ptr Plugin -> IO Plugin
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Plugin -> Plugin
Gst.Plugin.Plugin) Ptr Plugin
plugin
    Bool
result <- PluginInitFullFunc_WithClosures
_cb  Plugin
plugin' Ptr ()
userData
    Maybe (Ptr (FunPtr C_PluginInitFullFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_PluginInitFullFunc))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
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
        }
  , callableResolvable = 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:__ 'P.True' for a positive match, 'P.False' otherwise
dynamic_PluginFilter :: FunPtr C_PluginInitFullFunc -> a -> Ptr () -> m Bool
dynamic_PluginFilter FunPtr C_PluginInitFullFunc
__funPtr a
plugin Ptr ()
userData = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Plugin
plugin' <- a -> IO (Ptr Plugin)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
plugin
    CInt
result <- (FunPtr C_PluginInitFullFunc -> C_PluginInitFullFunc
__dynamic_C_PluginFilter FunPtr C_PluginInitFullFunc
__funPtr) Ptr Plugin
plugin' Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
plugin
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
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:__ 'P.True' for a positive match, 'P.False' otherwise

-- | A convenience synonym for @`Nothing` :: `Maybe` `PluginFilter`@.
noPluginFilter :: Maybe PluginFilter
noPluginFilter :: Maybe PluginInitFunc
noPluginFilter = Maybe PluginInitFunc
forall a. Maybe a
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:__ 'P.True' for a positive match, 'P.False' otherwise

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

-- | A simple wrapper that ignores the closure arguments.
drop_closures_PluginFilter :: PluginFilter -> PluginFilter_WithClosures
drop_closures_PluginFilter :: PluginInitFunc -> PluginInitFullFunc_WithClosures
drop_closures_PluginFilter PluginInitFunc
_f Plugin
plugin Ptr ()
_ = PluginInitFunc
_f Plugin
plugin

-- | Wrap the callback into a `GClosure`.
genClosure_PluginFilter :: MonadIO m => PluginFilter -> m (GClosure C_PluginFilter)
genClosure_PluginFilter :: PluginInitFunc -> m (GClosure C_PluginInitFullFunc)
genClosure_PluginFilter PluginInitFunc
cb = IO (GClosure C_PluginInitFullFunc)
-> m (GClosure C_PluginInitFullFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PluginInitFullFunc)
 -> m (GClosure C_PluginInitFullFunc))
-> IO (GClosure C_PluginInitFullFunc)
-> m (GClosure C_PluginInitFullFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: PluginInitFullFunc_WithClosures
cb' = PluginInitFunc -> PluginInitFullFunc_WithClosures
drop_closures_PluginFilter PluginInitFunc
cb
    let cb'' :: C_PluginInitFullFunc
cb'' = Maybe (Ptr (FunPtr C_PluginInitFullFunc))
-> PluginInitFullFunc_WithClosures -> C_PluginInitFullFunc
wrap_PluginFilter Maybe (Ptr (FunPtr C_PluginInitFullFunc))
forall a. Maybe a
Nothing PluginInitFullFunc_WithClosures
cb'
    C_PluginInitFullFunc -> IO (FunPtr C_PluginInitFullFunc)
mk_PluginFilter C_PluginInitFullFunc
cb'' IO (FunPtr C_PluginInitFullFunc)
-> (FunPtr C_PluginInitFullFunc
    -> IO (GClosure C_PluginInitFullFunc))
-> IO (GClosure C_PluginInitFullFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PluginInitFullFunc -> IO (GClosure C_PluginInitFullFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PluginFilter` into a `C_PluginFilter`.
wrap_PluginFilter ::
    Maybe (Ptr (FunPtr C_PluginFilter)) ->
    PluginFilter_WithClosures ->
    C_PluginFilter
wrap_PluginFilter :: Maybe (Ptr (FunPtr C_PluginInitFullFunc))
-> PluginInitFullFunc_WithClosures -> C_PluginInitFullFunc
wrap_PluginFilter Maybe (Ptr (FunPtr C_PluginInitFullFunc))
funptrptr PluginInitFullFunc_WithClosures
_cb Ptr Plugin
plugin Ptr ()
userData = do
    Plugin
plugin' <- ((ManagedPtr Plugin -> Plugin) -> Ptr Plugin -> IO Plugin
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Plugin -> Plugin
Gst.Plugin.Plugin) Ptr Plugin
plugin
    Bool
result <- PluginInitFullFunc_WithClosures
_cb  Plugin
plugin' Ptr ()
userData
    Maybe (Ptr (FunPtr C_PluginInitFullFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_PluginInitFullFunc))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
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
        }
  , callableResolvable = 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:__ 'P.True' for a positive match, 'P.False' otherwise
dynamic_PluginFeatureFilter :: FunPtr C_PluginFeatureFilter -> a -> Ptr () -> m Bool
dynamic_PluginFeatureFilter FunPtr C_PluginFeatureFilter
__funPtr a
feature Ptr ()
userData = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr PluginFeature
feature' <- a -> IO (Ptr PluginFeature)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
feature
    CInt
result <- (FunPtr C_PluginFeatureFilter -> C_PluginFeatureFilter
__dynamic_C_PluginFeatureFilter FunPtr C_PluginFeatureFilter
__funPtr) Ptr PluginFeature
feature' Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
feature
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
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:__ 'P.True' for a positive match, 'P.False' otherwise

-- | A convenience synonym for @`Nothing` :: `Maybe` `PluginFeatureFilter`@.
noPluginFeatureFilter :: Maybe PluginFeatureFilter
noPluginFeatureFilter :: Maybe PluginFeatureFilter
noPluginFeatureFilter = Maybe PluginFeatureFilter
forall a. Maybe a
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:__ 'P.True' for a positive match, 'P.False' otherwise

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

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

-- | Wrap the callback into a `GClosure`.
genClosure_PluginFeatureFilter :: MonadIO m => PluginFeatureFilter -> m (GClosure C_PluginFeatureFilter)
genClosure_PluginFeatureFilter :: PluginFeatureFilter -> m (GClosure C_PluginFeatureFilter)
genClosure_PluginFeatureFilter PluginFeatureFilter
cb = IO (GClosure C_PluginFeatureFilter)
-> m (GClosure C_PluginFeatureFilter)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PluginFeatureFilter)
 -> m (GClosure C_PluginFeatureFilter))
-> IO (GClosure C_PluginFeatureFilter)
-> m (GClosure C_PluginFeatureFilter)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: PluginFeatureFilter_WithClosures
cb' = PluginFeatureFilter -> PluginFeatureFilter_WithClosures
drop_closures_PluginFeatureFilter PluginFeatureFilter
cb
    let cb'' :: C_PluginFeatureFilter
cb'' = Maybe (Ptr (FunPtr C_PluginFeatureFilter))
-> PluginFeatureFilter_WithClosures -> C_PluginFeatureFilter
wrap_PluginFeatureFilter Maybe (Ptr (FunPtr C_PluginFeatureFilter))
forall a. Maybe a
Nothing PluginFeatureFilter_WithClosures
cb'
    C_PluginFeatureFilter -> IO (FunPtr C_PluginFeatureFilter)
mk_PluginFeatureFilter C_PluginFeatureFilter
cb'' IO (FunPtr C_PluginFeatureFilter)
-> (FunPtr C_PluginFeatureFilter
    -> IO (GClosure C_PluginFeatureFilter))
-> IO (GClosure C_PluginFeatureFilter)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PluginFeatureFilter -> IO (GClosure C_PluginFeatureFilter)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PluginFeatureFilter` into a `C_PluginFeatureFilter`.
wrap_PluginFeatureFilter ::
    Maybe (Ptr (FunPtr C_PluginFeatureFilter)) ->
    PluginFeatureFilter_WithClosures ->
    C_PluginFeatureFilter
wrap_PluginFeatureFilter :: Maybe (Ptr (FunPtr C_PluginFeatureFilter))
-> PluginFeatureFilter_WithClosures -> C_PluginFeatureFilter
wrap_PluginFeatureFilter Maybe (Ptr (FunPtr C_PluginFeatureFilter))
funptrptr PluginFeatureFilter_WithClosures
_cb Ptr PluginFeature
feature Ptr ()
userData = do
    PluginFeature
feature' <- ((ManagedPtr PluginFeature -> PluginFeature)
-> Ptr PluginFeature -> IO PluginFeature
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr PluginFeature -> PluginFeature
Gst.PluginFeature.PluginFeature) Ptr PluginFeature
feature
    Bool
result <- PluginFeatureFilter_WithClosures
_cb  PluginFeature
feature' Ptr ()
userData
    Maybe (Ptr (FunPtr C_PluginFeatureFilter)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_PluginFeatureFilter))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
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
        }
  , callableResolvable = 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 t'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-'P.Nothing' and remain valid
    --          during the execution of this function.
    -> m ()
dynamic_PadUnlinkFunction :: FunPtr C_PadUnlinkFunction -> a -> Maybe b -> m ()
dynamic_PadUnlinkFunction FunPtr C_PadUnlinkFunction
__funPtr a
pad Maybe b
parent = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Pad
pad' <- a -> IO (Ptr Pad)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pad
    Ptr Object
maybeParent <- case Maybe b
parent of
        Maybe b
Nothing -> Ptr Object -> IO (Ptr Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Object
forall a. Ptr a
nullPtr
        Just b
jParent -> do
            Ptr Object
jParent' <- b -> IO (Ptr Object)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jParent
            Ptr Object -> IO (Ptr Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Object
jParent'
    (FunPtr C_PadUnlinkFunction -> C_PadUnlinkFunction
__dynamic_C_PadUnlinkFunction FunPtr C_PadUnlinkFunction
__funPtr) Ptr Pad
pad' Ptr Object
maybeParent
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pad
    Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
parent b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
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 t'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-'P.Nothing' and remain valid
    --          during the execution of this function.
    -> IO ()

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

-- | Wrap the callback into a `GClosure`.
genClosure_PadUnlinkFunction :: MonadIO m => PadUnlinkFunction -> m (GClosure C_PadUnlinkFunction)
genClosure_PadUnlinkFunction :: PadUnlinkFunction -> m (GClosure C_PadUnlinkFunction)
genClosure_PadUnlinkFunction PadUnlinkFunction
cb = IO (GClosure C_PadUnlinkFunction)
-> m (GClosure C_PadUnlinkFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PadUnlinkFunction)
 -> m (GClosure C_PadUnlinkFunction))
-> IO (GClosure C_PadUnlinkFunction)
-> m (GClosure C_PadUnlinkFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PadUnlinkFunction
cb' = Maybe (Ptr (FunPtr C_PadUnlinkFunction))
-> PadUnlinkFunction -> C_PadUnlinkFunction
wrap_PadUnlinkFunction Maybe (Ptr (FunPtr C_PadUnlinkFunction))
forall a. Maybe a
Nothing PadUnlinkFunction
cb
    C_PadUnlinkFunction -> IO (FunPtr C_PadUnlinkFunction)
mk_PadUnlinkFunction C_PadUnlinkFunction
cb' IO (FunPtr C_PadUnlinkFunction)
-> (FunPtr C_PadUnlinkFunction
    -> IO (GClosure C_PadUnlinkFunction))
-> IO (GClosure C_PadUnlinkFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PadUnlinkFunction -> IO (GClosure C_PadUnlinkFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PadUnlinkFunction` into a `C_PadUnlinkFunction`.
wrap_PadUnlinkFunction ::
    Maybe (Ptr (FunPtr C_PadUnlinkFunction)) ->
    PadUnlinkFunction ->
    C_PadUnlinkFunction
wrap_PadUnlinkFunction :: Maybe (Ptr (FunPtr C_PadUnlinkFunction))
-> PadUnlinkFunction -> C_PadUnlinkFunction
wrap_PadUnlinkFunction Maybe (Ptr (FunPtr C_PadUnlinkFunction))
funptrptr PadUnlinkFunction
_cb Ptr Pad
pad Ptr Object
parent = do
    Pad
pad' <- ((ManagedPtr Pad -> Pad) -> Ptr Pad -> IO Pad
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Pad -> Pad
Gst.Pad.Pad) Ptr Pad
pad
    Maybe Object
maybeParent <-
        if Ptr Object
parent Ptr Object -> Ptr Object -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr Object
forall a. Ptr a
nullPtr
        then Maybe Object -> IO (Maybe Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Object
forall a. Maybe a
Nothing
        else do
            Object
parent' <- ((ManagedPtr Object -> Object) -> Ptr Object -> IO Object
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Object -> Object
Gst.Object.Object) Ptr Object
parent
            Maybe Object -> IO (Maybe Object)
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe Object -> IO (Maybe Object))
-> Maybe Object -> IO (Maybe Object)
forall a b. (a -> b) -> a -> b
$ Object -> Maybe Object
forall a. a -> Maybe a
Just Object
parent'
    PadUnlinkFunction
_cb  Pad
pad' Maybe Object
maybeParent
    Maybe (Ptr (FunPtr C_PadUnlinkFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_PadUnlinkFunction))
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
        }
  , callableResolvable = 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 t'GI.Gst.Objects.Pad.Pad'.
    -> Maybe (Gst.Event.Event)
    -- ^ /@event@/: a sticky t'GI.Gst.Structs.Event.Event'.
    -> Ptr ()
    -- ^ /@userData@/: the @/gpointer/@ to optional user data.
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the iteration should continue
dynamic_PadStickyEventsForeachFunction :: FunPtr C_PadStickyEventsForeachFunction
-> a -> Maybe Event -> Ptr () -> m Bool
dynamic_PadStickyEventsForeachFunction FunPtr C_PadStickyEventsForeachFunction
__funPtr a
pad Maybe Event
event Ptr ()
userData = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Pad
pad' <- a -> IO (Ptr Pad)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pad
    Ptr Event
maybeEvent <- case Maybe Event
event of
        Maybe Event
Nothing -> Ptr Event -> IO (Ptr Event)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Event
forall a. Ptr a
nullPtr
        Just Event
jEvent -> do
            Ptr Event
jEvent' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Event
jEvent
            Ptr Event -> IO (Ptr Event)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Event
jEvent'
    CInt
result <- (FunPtr C_PadStickyEventsForeachFunction
-> C_PadStickyEventsForeachFunction
__dynamic_C_PadStickyEventsForeachFunction FunPtr C_PadStickyEventsForeachFunction
__funPtr) Ptr Pad
pad' Ptr Event
maybeEvent Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pad
    Maybe Event -> (Event -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe Event
event Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
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 'P.True', the next event will be
-- returned. When 'P.False' is returned, 'GI.Gst.Objects.Pad.padStickyEventsForeach' will return.
-- 
-- When /@event@/ is set to 'P.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 t'GI.Gst.Objects.Pad.Pad'.
    -> Maybe Gst.Event.Event
    -- ^ /@event@/: a sticky t'GI.Gst.Structs.Event.Event'.
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the iteration should continue

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

-- | Callback used by 'GI.Gst.Objects.Pad.padStickyEventsForeach'.
-- 
-- When this function returns 'P.True', the next event will be
-- returned. When 'P.False' is returned, 'GI.Gst.Objects.Pad.padStickyEventsForeach' will return.
-- 
-- When /@event@/ is set to 'P.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 t'GI.Gst.Objects.Pad.Pad'.
    -> Maybe Gst.Event.Event
    -- ^ /@event@/: a sticky t'GI.Gst.Structs.Event.Event'.
    -> Ptr ()
    -- ^ /@userData@/: the @/gpointer/@ to optional user data.
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the iteration should continue

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

-- | A simple wrapper that ignores the closure arguments.
drop_closures_PadStickyEventsForeachFunction :: PadStickyEventsForeachFunction -> PadStickyEventsForeachFunction_WithClosures
drop_closures_PadStickyEventsForeachFunction :: PadStickyEventsForeachFunction
-> PadStickyEventsForeachFunction_WithClosures
drop_closures_PadStickyEventsForeachFunction PadStickyEventsForeachFunction
_f Pad
pad Maybe Event
event Ptr ()
_ = PadStickyEventsForeachFunction
_f Pad
pad Maybe Event
event

-- | Wrap the callback into a `GClosure`.
genClosure_PadStickyEventsForeachFunction :: MonadIO m => PadStickyEventsForeachFunction -> m (GClosure C_PadStickyEventsForeachFunction)
genClosure_PadStickyEventsForeachFunction :: PadStickyEventsForeachFunction
-> m (GClosure C_PadStickyEventsForeachFunction)
genClosure_PadStickyEventsForeachFunction PadStickyEventsForeachFunction
cb = IO (GClosure C_PadStickyEventsForeachFunction)
-> m (GClosure C_PadStickyEventsForeachFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PadStickyEventsForeachFunction)
 -> m (GClosure C_PadStickyEventsForeachFunction))
-> IO (GClosure C_PadStickyEventsForeachFunction)
-> m (GClosure C_PadStickyEventsForeachFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: PadStickyEventsForeachFunction_WithClosures
cb' = PadStickyEventsForeachFunction
-> PadStickyEventsForeachFunction_WithClosures
drop_closures_PadStickyEventsForeachFunction PadStickyEventsForeachFunction
cb
    let cb'' :: C_PadStickyEventsForeachFunction
cb'' = Maybe (Ptr (FunPtr C_PadStickyEventsForeachFunction))
-> PadStickyEventsForeachFunction_WithClosures
-> C_PadStickyEventsForeachFunction
wrap_PadStickyEventsForeachFunction Maybe (Ptr (FunPtr C_PadStickyEventsForeachFunction))
forall a. Maybe a
Nothing PadStickyEventsForeachFunction_WithClosures
cb'
    C_PadStickyEventsForeachFunction
-> IO (FunPtr C_PadStickyEventsForeachFunction)
mk_PadStickyEventsForeachFunction C_PadStickyEventsForeachFunction
cb'' IO (FunPtr C_PadStickyEventsForeachFunction)
-> (FunPtr C_PadStickyEventsForeachFunction
    -> IO (GClosure C_PadStickyEventsForeachFunction))
-> IO (GClosure C_PadStickyEventsForeachFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PadStickyEventsForeachFunction
-> IO (GClosure C_PadStickyEventsForeachFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PadStickyEventsForeachFunction` into a `C_PadStickyEventsForeachFunction`.
wrap_PadStickyEventsForeachFunction ::
    Maybe (Ptr (FunPtr C_PadStickyEventsForeachFunction)) ->
    PadStickyEventsForeachFunction_WithClosures ->
    C_PadStickyEventsForeachFunction
wrap_PadStickyEventsForeachFunction :: Maybe (Ptr (FunPtr C_PadStickyEventsForeachFunction))
-> PadStickyEventsForeachFunction_WithClosures
-> C_PadStickyEventsForeachFunction
wrap_PadStickyEventsForeachFunction Maybe (Ptr (FunPtr C_PadStickyEventsForeachFunction))
funptrptr PadStickyEventsForeachFunction_WithClosures
_cb Ptr Pad
pad Ptr Event
event Ptr ()
userData = do
    Pad
pad' <- ((ManagedPtr Pad -> Pad) -> Ptr Pad -> IO Pad
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Pad -> Pad
Gst.Pad.Pad) Ptr Pad
pad
    Maybe Event
maybeEvent <-
        if Ptr Event
event Ptr Event -> Ptr Event -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr Event
forall a. Ptr a
nullPtr
        then Maybe Event -> IO (Maybe Event)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Event
forall a. Maybe a
Nothing
        else do
            (ManagedPtr Event -> Event)
-> Ptr Event -> (Event -> IO (Maybe Event)) -> IO (Maybe Event)
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Event -> Event
Gst.Event.Event Ptr Event
event ((Event -> IO (Maybe Event)) -> IO (Maybe Event))
-> (Event -> IO (Maybe Event)) -> IO (Maybe Event)
forall a b. (a -> b) -> a -> b
$ \Event
event' -> do
                Maybe Event -> IO (Maybe Event)
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe Event -> IO (Maybe Event))
-> Maybe Event -> IO (Maybe Event)
forall a b. (a -> b) -> a -> b
$ Event -> Maybe Event
forall a. a -> Maybe a
Just Event
event'
    Bool
result <- PadStickyEventsForeachFunction_WithClosures
_cb  Pad
pad' Maybe Event
maybeEvent Ptr ()
userData
    Maybe (Ptr (FunPtr C_PadStickyEventsForeachFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_PadStickyEventsForeachFunction))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
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
        }
  , callableResolvable = 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 t'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-'P.Nothing' and remain valid
    --          during the execution of this function.
    -> Gst.Query.Query
    -- ^ /@query@/: the t'GI.Gst.Structs.Query.Query' object to execute
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the query could be performed.
dynamic_PadQueryFunction :: FunPtr C_PadQueryFunction -> a -> Maybe b -> Query -> m Bool
dynamic_PadQueryFunction FunPtr C_PadQueryFunction
__funPtr a
pad Maybe b
parent Query
query = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Pad
pad' <- a -> IO (Ptr Pad)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pad
    Ptr Object
maybeParent <- case Maybe b
parent of
        Maybe b
Nothing -> Ptr Object -> IO (Ptr Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Object
forall a. Ptr a
nullPtr
        Just b
jParent -> do
            Ptr Object
jParent' <- b -> IO (Ptr Object)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jParent
            Ptr Object -> IO (Ptr Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Object
jParent'
    Ptr Query
query' <- Query -> IO (Ptr Query)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Query
query
    CInt
result <- (FunPtr C_PadQueryFunction -> C_PadQueryFunction
__dynamic_C_PadQueryFunction FunPtr C_PadQueryFunction
__funPtr) Ptr Pad
pad' Ptr Object
maybeParent Ptr Query
query'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pad
    Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
parent b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Query -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Query
query
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
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 t'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-'P.Nothing' and remain valid
    --          during the execution of this function.
    -> Gst.Query.Query
    -- ^ /@query@/: the t'GI.Gst.Structs.Query.Query' object to execute
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the query could be performed.

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

-- | Wrap the callback into a `GClosure`.
genClosure_PadQueryFunction :: MonadIO m => PadQueryFunction -> m (GClosure C_PadQueryFunction)
genClosure_PadQueryFunction :: PadQueryFunction -> m (GClosure C_PadQueryFunction)
genClosure_PadQueryFunction PadQueryFunction
cb = IO (GClosure C_PadQueryFunction) -> m (GClosure C_PadQueryFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PadQueryFunction)
 -> m (GClosure C_PadQueryFunction))
-> IO (GClosure C_PadQueryFunction)
-> m (GClosure C_PadQueryFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PadQueryFunction
cb' = Maybe (Ptr (FunPtr C_PadQueryFunction))
-> PadQueryFunction -> C_PadQueryFunction
wrap_PadQueryFunction Maybe (Ptr (FunPtr C_PadQueryFunction))
forall a. Maybe a
Nothing PadQueryFunction
cb
    C_PadQueryFunction -> IO (FunPtr C_PadQueryFunction)
mk_PadQueryFunction C_PadQueryFunction
cb' IO (FunPtr C_PadQueryFunction)
-> (FunPtr C_PadQueryFunction -> IO (GClosure C_PadQueryFunction))
-> IO (GClosure C_PadQueryFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PadQueryFunction -> IO (GClosure C_PadQueryFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PadQueryFunction` into a `C_PadQueryFunction`.
wrap_PadQueryFunction ::
    Maybe (Ptr (FunPtr C_PadQueryFunction)) ->
    PadQueryFunction ->
    C_PadQueryFunction
wrap_PadQueryFunction :: Maybe (Ptr (FunPtr C_PadQueryFunction))
-> PadQueryFunction -> C_PadQueryFunction
wrap_PadQueryFunction Maybe (Ptr (FunPtr C_PadQueryFunction))
funptrptr PadQueryFunction
_cb Ptr Pad
pad Ptr Object
parent Ptr Query
query = do
    Pad
pad' <- ((ManagedPtr Pad -> Pad) -> Ptr Pad -> IO Pad
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Pad -> Pad
Gst.Pad.Pad) Ptr Pad
pad
    Maybe Object
maybeParent <-
        if Ptr Object
parent Ptr Object -> Ptr Object -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr Object
forall a. Ptr a
nullPtr
        then Maybe Object -> IO (Maybe Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Object
forall a. Maybe a
Nothing
        else do
            Object
parent' <- ((ManagedPtr Object -> Object) -> Ptr Object -> IO Object
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Object -> Object
Gst.Object.Object) Ptr Object
parent
            Maybe Object -> IO (Maybe Object)
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe Object -> IO (Maybe Object))
-> Maybe Object -> IO (Maybe Object)
forall a b. (a -> b) -> a -> b
$ Object -> Maybe Object
forall a. a -> Maybe a
Just Object
parent'
    (ManagedPtr Query -> Query)
-> Ptr Query -> (Query -> IO CInt) -> IO CInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Query -> Query
Gst.Query.Query Ptr Query
query ((Query -> IO CInt) -> IO CInt) -> (Query -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Query
query' -> do
        Bool
result <- PadQueryFunction
_cb  Pad
pad' Maybe Object
maybeParent Query
query'
        Maybe (Ptr (FunPtr C_PadQueryFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_PadQueryFunction))
funptrptr
        let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
        CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
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
        }
  , callableResolvable = 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 t'GI.Gst.Objects.Pad.Pad' that is blocked
    -> Gst.PadProbeInfo.PadProbeInfo
    -- ^ /@info@/: t'GI.Gst.Structs.PadProbeInfo.PadProbeInfo'
    -> Ptr ()
    -- ^ /@userData@/: the gpointer to optional user data.
    -> m Gst.Enums.PadProbeReturn
    -- ^ __Returns:__ a t'GI.Gst.Enums.PadProbeReturn'
dynamic_PadProbeCallback :: FunPtr C_PadProbeCallback
-> a -> PadProbeInfo -> Ptr () -> m PadProbeReturn
dynamic_PadProbeCallback FunPtr C_PadProbeCallback
__funPtr a
pad PadProbeInfo
info Ptr ()
userData = IO PadProbeReturn -> m PadProbeReturn
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PadProbeReturn -> m PadProbeReturn)
-> IO PadProbeReturn -> m PadProbeReturn
forall a b. (a -> b) -> a -> b
$ do
    Ptr Pad
pad' <- a -> IO (Ptr Pad)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pad
    Ptr PadProbeInfo
info' <- PadProbeInfo -> IO (Ptr PadProbeInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr PadProbeInfo
info
    CUInt
result <- (FunPtr C_PadProbeCallback -> C_PadProbeCallback
__dynamic_C_PadProbeCallback FunPtr C_PadProbeCallback
__funPtr) Ptr Pad
pad' Ptr PadProbeInfo
info' Ptr ()
userData
    let result' :: PadProbeReturn
result' = (Int -> PadProbeReturn
forall a. Enum a => Int -> a
toEnum (Int -> PadProbeReturn)
-> (CUInt -> Int) -> CUInt -> PadProbeReturn
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pad
    PadProbeInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr PadProbeInfo
info
    PadProbeReturn -> IO PadProbeReturn
forall (m :: * -> *) a. Monad m => a -> m a
return PadProbeReturn
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 t'GI.Gst.Objects.Pad.Pad' that is blocked
    -> Gst.PadProbeInfo.PadProbeInfo
    -- ^ /@info@/: t'GI.Gst.Structs.PadProbeInfo.PadProbeInfo'
    -> IO Gst.Enums.PadProbeReturn
    -- ^ __Returns:__ a t'GI.Gst.Enums.PadProbeReturn'

-- | A convenience synonym for @`Nothing` :: `Maybe` `PadProbeCallback`@.
noPadProbeCallback :: Maybe PadProbeCallback
noPadProbeCallback :: Maybe PadProbeCallback
noPadProbeCallback = Maybe PadProbeCallback
forall a. Maybe a
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 t'GI.Gst.Objects.Pad.Pad' that is blocked
    -> Gst.PadProbeInfo.PadProbeInfo
    -- ^ /@info@/: t'GI.Gst.Structs.PadProbeInfo.PadProbeInfo'
    -> Ptr ()
    -- ^ /@userData@/: the gpointer to optional user data.
    -> IO Gst.Enums.PadProbeReturn
    -- ^ __Returns:__ a t'GI.Gst.Enums.PadProbeReturn'

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

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

-- | Wrap the callback into a `GClosure`.
genClosure_PadProbeCallback :: MonadIO m => PadProbeCallback -> m (GClosure C_PadProbeCallback)
genClosure_PadProbeCallback :: PadProbeCallback -> m (GClosure C_PadProbeCallback)
genClosure_PadProbeCallback PadProbeCallback
cb = IO (GClosure C_PadProbeCallback) -> m (GClosure C_PadProbeCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PadProbeCallback)
 -> m (GClosure C_PadProbeCallback))
-> IO (GClosure C_PadProbeCallback)
-> m (GClosure C_PadProbeCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: PadProbeCallback_WithClosures
cb' = PadProbeCallback -> PadProbeCallback_WithClosures
drop_closures_PadProbeCallback PadProbeCallback
cb
    let cb'' :: C_PadProbeCallback
cb'' = Maybe (Ptr (FunPtr C_PadProbeCallback))
-> PadProbeCallback_WithClosures -> C_PadProbeCallback
wrap_PadProbeCallback Maybe (Ptr (FunPtr C_PadProbeCallback))
forall a. Maybe a
Nothing PadProbeCallback_WithClosures
cb'
    C_PadProbeCallback -> IO (FunPtr C_PadProbeCallback)
mk_PadProbeCallback C_PadProbeCallback
cb'' IO (FunPtr C_PadProbeCallback)
-> (FunPtr C_PadProbeCallback -> IO (GClosure C_PadProbeCallback))
-> IO (GClosure C_PadProbeCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PadProbeCallback -> IO (GClosure C_PadProbeCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PadProbeCallback` into a `C_PadProbeCallback`.
wrap_PadProbeCallback ::
    Maybe (Ptr (FunPtr C_PadProbeCallback)) ->
    PadProbeCallback_WithClosures ->
    C_PadProbeCallback
wrap_PadProbeCallback :: Maybe (Ptr (FunPtr C_PadProbeCallback))
-> PadProbeCallback_WithClosures -> C_PadProbeCallback
wrap_PadProbeCallback Maybe (Ptr (FunPtr C_PadProbeCallback))
funptrptr PadProbeCallback_WithClosures
_cb Ptr Pad
pad Ptr PadProbeInfo
info Ptr ()
userData = do
    Pad
pad' <- ((ManagedPtr Pad -> Pad) -> Ptr Pad -> IO Pad
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Pad -> Pad
Gst.Pad.Pad) Ptr Pad
pad
    PadProbeInfo
info' <- ((ManagedPtr PadProbeInfo -> PadProbeInfo)
-> Ptr PadProbeInfo -> IO PadProbeInfo
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr PadProbeInfo -> PadProbeInfo
Gst.PadProbeInfo.PadProbeInfo) Ptr PadProbeInfo
info
    PadProbeReturn
result <- PadProbeCallback_WithClosures
_cb  Pad
pad' PadProbeInfo
info' Ptr ()
userData
    Maybe (Ptr (FunPtr C_PadProbeCallback)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_PadProbeCallback))
funptrptr
    let result' :: CUInt
result' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (PadProbeReturn -> Int) -> PadProbeReturn -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PadProbeReturn -> Int
forall a. Enum a => a -> Int
fromEnum) PadProbeReturn
result
    CUInt -> IO CUInt
forall (m :: * -> *) a. Monad m => a -> m a
return CUInt
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
        }
  , callableResolvable = 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 t'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-'P.Nothing' and remain valid
    --          during the execution of this function.
    -> c
    -- ^ /@peer@/: the peer t'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 C_PadLinkFunction -> a -> Maybe b -> c -> m PadLinkReturn
dynamic_PadLinkFunction FunPtr C_PadLinkFunction
__funPtr a
pad Maybe b
parent c
peer = IO PadLinkReturn -> m PadLinkReturn
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PadLinkReturn -> m PadLinkReturn)
-> IO PadLinkReturn -> m PadLinkReturn
forall a b. (a -> b) -> a -> b
$ do
    Ptr Pad
pad' <- a -> IO (Ptr Pad)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pad
    Ptr Object
maybeParent <- case Maybe b
parent of
        Maybe b
Nothing -> Ptr Object -> IO (Ptr Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Object
forall a. Ptr a
nullPtr
        Just b
jParent -> do
            Ptr Object
jParent' <- b -> IO (Ptr Object)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jParent
            Ptr Object -> IO (Ptr Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Object
jParent'
    Ptr Pad
peer' <- c -> IO (Ptr Pad)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
peer
    CInt
result <- (FunPtr C_PadLinkFunction -> C_PadLinkFunction
__dynamic_C_PadLinkFunction FunPtr C_PadLinkFunction
__funPtr) Ptr Pad
pad' Ptr Object
maybeParent Ptr Pad
peer'
    let result' :: PadLinkReturn
result' = (Int -> PadLinkReturn
forall a. Enum a => Int -> a
toEnum (Int -> PadLinkReturn) -> (CInt -> Int) -> CInt -> PadLinkReturn
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pad
    Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
parent b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr c
peer
    PadLinkReturn -> IO PadLinkReturn
forall (m :: * -> *) a. Monad m => a -> m a
return PadLinkReturn
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 t'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-'P.Nothing' and remain valid
    --          during the execution of this function.
    -> Gst.Pad.Pad
    -- ^ /@peer@/: the peer t'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 :: Maybe PadLinkFunction
noPadLinkFunction = Maybe PadLinkFunction
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_PadLinkFunction :: MonadIO m => PadLinkFunction -> m (GClosure C_PadLinkFunction)
genClosure_PadLinkFunction :: PadLinkFunction -> m (GClosure C_PadLinkFunction)
genClosure_PadLinkFunction PadLinkFunction
cb = IO (GClosure C_PadLinkFunction) -> m (GClosure C_PadLinkFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PadLinkFunction) -> m (GClosure C_PadLinkFunction))
-> IO (GClosure C_PadLinkFunction)
-> m (GClosure C_PadLinkFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PadLinkFunction
cb' = Maybe (Ptr (FunPtr C_PadLinkFunction))
-> PadLinkFunction -> C_PadLinkFunction
wrap_PadLinkFunction Maybe (Ptr (FunPtr C_PadLinkFunction))
forall a. Maybe a
Nothing PadLinkFunction
cb
    C_PadLinkFunction -> IO (FunPtr C_PadLinkFunction)
mk_PadLinkFunction C_PadLinkFunction
cb' IO (FunPtr C_PadLinkFunction)
-> (FunPtr C_PadLinkFunction -> IO (GClosure C_PadLinkFunction))
-> IO (GClosure C_PadLinkFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PadLinkFunction -> IO (GClosure C_PadLinkFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PadLinkFunction` into a `C_PadLinkFunction`.
wrap_PadLinkFunction ::
    Maybe (Ptr (FunPtr C_PadLinkFunction)) ->
    PadLinkFunction ->
    C_PadLinkFunction
wrap_PadLinkFunction :: Maybe (Ptr (FunPtr C_PadLinkFunction))
-> PadLinkFunction -> C_PadLinkFunction
wrap_PadLinkFunction Maybe (Ptr (FunPtr C_PadLinkFunction))
funptrptr PadLinkFunction
_cb Ptr Pad
pad Ptr Object
parent Ptr Pad
peer = do
    Pad
pad' <- ((ManagedPtr Pad -> Pad) -> Ptr Pad -> IO Pad
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Pad -> Pad
Gst.Pad.Pad) Ptr Pad
pad
    Maybe Object
maybeParent <-
        if Ptr Object
parent Ptr Object -> Ptr Object -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr Object
forall a. Ptr a
nullPtr
        then Maybe Object -> IO (Maybe Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Object
forall a. Maybe a
Nothing
        else do
            Object
parent' <- ((ManagedPtr Object -> Object) -> Ptr Object -> IO Object
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Object -> Object
Gst.Object.Object) Ptr Object
parent
            Maybe Object -> IO (Maybe Object)
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe Object -> IO (Maybe Object))
-> Maybe Object -> IO (Maybe Object)
forall a b. (a -> b) -> a -> b
$ Object -> Maybe Object
forall a. a -> Maybe a
Just Object
parent'
    Pad
peer' <- ((ManagedPtr Pad -> Pad) -> Ptr Pad -> IO Pad
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Pad -> Pad
Gst.Pad.Pad) Ptr Pad
peer
    PadLinkReturn
result <- PadLinkFunction
_cb  Pad
pad' Maybe Object
maybeParent Pad
peer'
    Maybe (Ptr (FunPtr C_PadLinkFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_PadLinkFunction))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (PadLinkReturn -> Int) -> PadLinkReturn -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PadLinkReturn -> Int
forall a. Enum a => a -> Int
fromEnum) PadLinkReturn
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
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
        }
  , callableResolvable = 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 t'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-'P.Nothing' and remain valid
    --          during the execution of this function.
    -> m Gst.Iterator.Iterator
    -- ^ __Returns:__ a new t'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 C_PadIterIntLinkFunction -> a -> Maybe b -> m Iterator
dynamic_PadIterIntLinkFunction FunPtr C_PadIterIntLinkFunction
__funPtr a
pad Maybe b
parent = IO Iterator -> m Iterator
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Iterator -> m Iterator) -> IO Iterator -> m Iterator
forall a b. (a -> b) -> a -> b
$ do
    Ptr Pad
pad' <- a -> IO (Ptr Pad)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pad
    Ptr Object
maybeParent <- case Maybe b
parent of
        Maybe b
Nothing -> Ptr Object -> IO (Ptr Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Object
forall a. Ptr a
nullPtr
        Just b
jParent -> do
            Ptr Object
jParent' <- b -> IO (Ptr Object)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jParent
            Ptr Object -> IO (Ptr Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Object
jParent'
    Ptr Iterator
result <- (FunPtr C_PadIterIntLinkFunction -> C_PadIterIntLinkFunction
__dynamic_C_PadIterIntLinkFunction FunPtr C_PadIterIntLinkFunction
__funPtr) Ptr Pad
pad' Ptr Object
maybeParent
    Text -> Ptr Iterator -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"padIterIntLinkFunction" Ptr Iterator
result
    Iterator
result' <- ((ManagedPtr Iterator -> Iterator) -> Ptr Iterator -> IO Iterator
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Iterator -> Iterator
Gst.Iterator.Iterator) Ptr Iterator
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pad
    Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
parent b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Iterator -> IO Iterator
forall (m :: * -> *) a. Monad m => a -> m a
return Iterator
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 t'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-'P.Nothing' and remain valid
    --          during the execution of this function.
    -> IO Gst.Iterator.Iterator
    -- ^ __Returns:__ a new t'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 :: Maybe PadIterIntLinkFunction
noPadIterIntLinkFunction = Maybe PadIterIntLinkFunction
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_PadIterIntLinkFunction :: MonadIO m => PadIterIntLinkFunction -> m (GClosure C_PadIterIntLinkFunction)
genClosure_PadIterIntLinkFunction :: PadIterIntLinkFunction -> m (GClosure C_PadIterIntLinkFunction)
genClosure_PadIterIntLinkFunction PadIterIntLinkFunction
cb = IO (GClosure C_PadIterIntLinkFunction)
-> m (GClosure C_PadIterIntLinkFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PadIterIntLinkFunction)
 -> m (GClosure C_PadIterIntLinkFunction))
-> IO (GClosure C_PadIterIntLinkFunction)
-> m (GClosure C_PadIterIntLinkFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PadIterIntLinkFunction
cb' = Maybe (Ptr (FunPtr C_PadIterIntLinkFunction))
-> PadIterIntLinkFunction -> C_PadIterIntLinkFunction
wrap_PadIterIntLinkFunction Maybe (Ptr (FunPtr C_PadIterIntLinkFunction))
forall a. Maybe a
Nothing PadIterIntLinkFunction
cb
    C_PadIterIntLinkFunction -> IO (FunPtr C_PadIterIntLinkFunction)
mk_PadIterIntLinkFunction C_PadIterIntLinkFunction
cb' IO (FunPtr C_PadIterIntLinkFunction)
-> (FunPtr C_PadIterIntLinkFunction
    -> IO (GClosure C_PadIterIntLinkFunction))
-> IO (GClosure C_PadIterIntLinkFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PadIterIntLinkFunction
-> IO (GClosure C_PadIterIntLinkFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PadIterIntLinkFunction` into a `C_PadIterIntLinkFunction`.
wrap_PadIterIntLinkFunction ::
    Maybe (Ptr (FunPtr C_PadIterIntLinkFunction)) ->
    PadIterIntLinkFunction ->
    C_PadIterIntLinkFunction
wrap_PadIterIntLinkFunction :: Maybe (Ptr (FunPtr C_PadIterIntLinkFunction))
-> PadIterIntLinkFunction -> C_PadIterIntLinkFunction
wrap_PadIterIntLinkFunction Maybe (Ptr (FunPtr C_PadIterIntLinkFunction))
funptrptr PadIterIntLinkFunction
_cb Ptr Pad
pad Ptr Object
parent = do
    Pad
pad' <- ((ManagedPtr Pad -> Pad) -> Ptr Pad -> IO Pad
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Pad -> Pad
Gst.Pad.Pad) Ptr Pad
pad
    Maybe Object
maybeParent <-
        if Ptr Object
parent Ptr Object -> Ptr Object -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr Object
forall a. Ptr a
nullPtr
        then Maybe Object -> IO (Maybe Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Object
forall a. Maybe a
Nothing
        else do
            Object
parent' <- ((ManagedPtr Object -> Object) -> Ptr Object -> IO Object
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Object -> Object
Gst.Object.Object) Ptr Object
parent
            Maybe Object -> IO (Maybe Object)
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe Object -> IO (Maybe Object))
-> Maybe Object -> IO (Maybe Object)
forall a b. (a -> b) -> a -> b
$ Object -> Maybe Object
forall a. a -> Maybe a
Just Object
parent'
    Iterator
result <- PadIterIntLinkFunction
_cb  Pad
pad' Maybe Object
maybeParent
    Maybe (Ptr (FunPtr C_PadIterIntLinkFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_PadIterIntLinkFunction))
funptrptr
    Ptr Iterator
result' <- Iterator -> IO (Ptr Iterator)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Iterator
result
    Ptr Iterator -> IO (Ptr Iterator)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Iterator
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
        }
  , callableResolvable = 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 t'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-'P.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 'P.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 C_PadGetRangeFunction
-> a -> Maybe b -> Word64 -> Word32 -> Buffer -> m FlowReturn
dynamic_PadGetRangeFunction FunPtr C_PadGetRangeFunction
__funPtr a
pad Maybe b
parent Word64
offset Word32
length_ Buffer
buffer = IO FlowReturn -> m FlowReturn
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FlowReturn -> m FlowReturn) -> IO FlowReturn -> m FlowReturn
forall a b. (a -> b) -> a -> b
$ do
    Ptr Pad
pad' <- a -> IO (Ptr Pad)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pad
    Ptr Object
maybeParent <- case Maybe b
parent of
        Maybe b
Nothing -> Ptr Object -> IO (Ptr Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Object
forall a. Ptr a
nullPtr
        Just b
jParent -> do
            Ptr Object
jParent' <- b -> IO (Ptr Object)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jParent
            Ptr Object -> IO (Ptr Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Object
jParent'
    Ptr Buffer
buffer' <- Buffer -> IO (Ptr Buffer)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Buffer
buffer
    CInt
result <- (FunPtr C_PadGetRangeFunction -> C_PadGetRangeFunction
__dynamic_C_PadGetRangeFunction FunPtr C_PadGetRangeFunction
__funPtr) Ptr Pad
pad' Ptr Object
maybeParent Word64
offset Word32
length_ Ptr Buffer
buffer'
    let result' :: FlowReturn
result' = (Int -> FlowReturn
forall a. Enum a => Int -> a
toEnum (Int -> FlowReturn) -> (CInt -> Int) -> CInt -> FlowReturn
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pad
    Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
parent b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Buffer -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Buffer
buffer
    FlowReturn -> IO FlowReturn
forall (m :: * -> *) a. Monad m => a -> m a
return FlowReturn
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 t'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-'P.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 'P.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 :: Maybe PadGetRangeFunction
noPadGetRangeFunction = Maybe PadGetRangeFunction
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_PadGetRangeFunction :: MonadIO m => PadGetRangeFunction -> m (GClosure C_PadGetRangeFunction)
genClosure_PadGetRangeFunction :: PadGetRangeFunction -> m (GClosure C_PadGetRangeFunction)
genClosure_PadGetRangeFunction PadGetRangeFunction
cb = IO (GClosure C_PadGetRangeFunction)
-> m (GClosure C_PadGetRangeFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PadGetRangeFunction)
 -> m (GClosure C_PadGetRangeFunction))
-> IO (GClosure C_PadGetRangeFunction)
-> m (GClosure C_PadGetRangeFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PadGetRangeFunction
cb' = Maybe (Ptr (FunPtr C_PadGetRangeFunction))
-> PadGetRangeFunction -> C_PadGetRangeFunction
wrap_PadGetRangeFunction Maybe (Ptr (FunPtr C_PadGetRangeFunction))
forall a. Maybe a
Nothing PadGetRangeFunction
cb
    C_PadGetRangeFunction -> IO (FunPtr C_PadGetRangeFunction)
mk_PadGetRangeFunction C_PadGetRangeFunction
cb' IO (FunPtr C_PadGetRangeFunction)
-> (FunPtr C_PadGetRangeFunction
    -> IO (GClosure C_PadGetRangeFunction))
-> IO (GClosure C_PadGetRangeFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PadGetRangeFunction -> IO (GClosure C_PadGetRangeFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PadGetRangeFunction` into a `C_PadGetRangeFunction`.
wrap_PadGetRangeFunction ::
    Maybe (Ptr (FunPtr C_PadGetRangeFunction)) ->
    PadGetRangeFunction ->
    C_PadGetRangeFunction
wrap_PadGetRangeFunction :: Maybe (Ptr (FunPtr C_PadGetRangeFunction))
-> PadGetRangeFunction -> C_PadGetRangeFunction
wrap_PadGetRangeFunction Maybe (Ptr (FunPtr C_PadGetRangeFunction))
funptrptr PadGetRangeFunction
_cb Ptr Pad
pad Ptr Object
parent Word64
offset Word32
length_ Ptr Buffer
buffer = do
    Pad
pad' <- ((ManagedPtr Pad -> Pad) -> Ptr Pad -> IO Pad
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Pad -> Pad
Gst.Pad.Pad) Ptr Pad
pad
    Maybe Object
maybeParent <-
        if Ptr Object
parent Ptr Object -> Ptr Object -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr Object
forall a. Ptr a
nullPtr
        then Maybe Object -> IO (Maybe Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Object
forall a. Maybe a
Nothing
        else do
            Object
parent' <- ((ManagedPtr Object -> Object) -> Ptr Object -> IO Object
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Object -> Object
Gst.Object.Object) Ptr Object
parent
            Maybe Object -> IO (Maybe Object)
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe Object -> IO (Maybe Object))
-> Maybe Object -> IO (Maybe Object)
forall a b. (a -> b) -> a -> b
$ Object -> Maybe Object
forall a. a -> Maybe a
Just Object
parent'
    (ManagedPtr Buffer -> Buffer)
-> Ptr Buffer -> (Buffer -> IO CInt) -> IO CInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Buffer -> Buffer
Gst.Buffer.Buffer Ptr Buffer
buffer ((Buffer -> IO CInt) -> IO CInt) -> (Buffer -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Buffer
buffer' -> do
        FlowReturn
result <- PadGetRangeFunction
_cb  Pad
pad' Maybe Object
maybeParent Word64
offset Word32
length_ Buffer
buffer'
        Maybe (Ptr (FunPtr C_PadGetRangeFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_PadGetRangeFunction))
funptrptr
        let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (FlowReturn -> Int) -> FlowReturn -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FlowReturn -> Int
forall a. Enum a => a -> Int
fromEnum) FlowReturn
result
        CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
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
        }
  , callableResolvable = 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 t'GI.Gst.Objects.Pad.Pad' that is forwarded.
    -> Ptr ()
    -- ^ /@userData@/: the gpointer to optional user data.
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the dispatching procedure has to be stopped.
dynamic_PadForwardFunction :: FunPtr C_PadForwardFunction -> a -> Ptr () -> m Bool
dynamic_PadForwardFunction FunPtr C_PadForwardFunction
__funPtr a
pad Ptr ()
userData = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Pad
pad' <- a -> IO (Ptr Pad)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pad
    CInt
result <- (FunPtr C_PadForwardFunction -> C_PadForwardFunction
__dynamic_C_PadForwardFunction FunPtr C_PadForwardFunction
__funPtr) Ptr Pad
pad' Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pad
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
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 t'GI.Gst.Objects.Pad.Pad' that is forwarded.
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the dispatching procedure has to be stopped.

-- | A convenience synonym for @`Nothing` :: `Maybe` `PadForwardFunction`@.
noPadForwardFunction :: Maybe PadForwardFunction
noPadForwardFunction :: Maybe PadForwardFunction
noPadForwardFunction = Maybe PadForwardFunction
forall a. Maybe a
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 t'GI.Gst.Objects.Pad.Pad' that is forwarded.
    -> Ptr ()
    -- ^ /@userData@/: the gpointer to optional user data.
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the dispatching procedure has to be stopped.

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

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

-- | Wrap the callback into a `GClosure`.
genClosure_PadForwardFunction :: MonadIO m => PadForwardFunction -> m (GClosure C_PadForwardFunction)
genClosure_PadForwardFunction :: PadForwardFunction -> m (GClosure C_PadForwardFunction)
genClosure_PadForwardFunction PadForwardFunction
cb = IO (GClosure C_PadForwardFunction)
-> m (GClosure C_PadForwardFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PadForwardFunction)
 -> m (GClosure C_PadForwardFunction))
-> IO (GClosure C_PadForwardFunction)
-> m (GClosure C_PadForwardFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: PadForwardFunction_WithClosures
cb' = PadForwardFunction -> PadForwardFunction_WithClosures
drop_closures_PadForwardFunction PadForwardFunction
cb
    let cb'' :: C_PadForwardFunction
cb'' = Maybe (Ptr (FunPtr C_PadForwardFunction))
-> PadForwardFunction_WithClosures -> C_PadForwardFunction
wrap_PadForwardFunction Maybe (Ptr (FunPtr C_PadForwardFunction))
forall a. Maybe a
Nothing PadForwardFunction_WithClosures
cb'
    C_PadForwardFunction -> IO (FunPtr C_PadForwardFunction)
mk_PadForwardFunction C_PadForwardFunction
cb'' IO (FunPtr C_PadForwardFunction)
-> (FunPtr C_PadForwardFunction
    -> IO (GClosure C_PadForwardFunction))
-> IO (GClosure C_PadForwardFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PadForwardFunction -> IO (GClosure C_PadForwardFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PadForwardFunction` into a `C_PadForwardFunction`.
wrap_PadForwardFunction ::
    Maybe (Ptr (FunPtr C_PadForwardFunction)) ->
    PadForwardFunction_WithClosures ->
    C_PadForwardFunction
wrap_PadForwardFunction :: Maybe (Ptr (FunPtr C_PadForwardFunction))
-> PadForwardFunction_WithClosures -> C_PadForwardFunction
wrap_PadForwardFunction Maybe (Ptr (FunPtr C_PadForwardFunction))
funptrptr PadForwardFunction_WithClosures
_cb Ptr Pad
pad Ptr ()
userData = do
    Pad
pad' <- ((ManagedPtr Pad -> Pad) -> Ptr Pad -> IO Pad
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Pad -> Pad
Gst.Pad.Pad) Ptr Pad
pad
    Bool
result <- PadForwardFunction_WithClosures
_cb  Pad
pad' Ptr ()
userData
    Maybe (Ptr (FunPtr C_PadForwardFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_PadForwardFunction))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
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
        }
  , callableResolvable = 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 t'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-'P.Nothing' and remain valid
    --          during the execution of this function.
    -> Gst.Event.Event
    -- ^ /@event@/: the t'GI.Gst.Structs.Event.Event' to handle.
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the pad could handle the event.
dynamic_PadEventFunction :: FunPtr C_PadEventFunction -> a -> Maybe b -> Event -> m Bool
dynamic_PadEventFunction FunPtr C_PadEventFunction
__funPtr a
pad Maybe b
parent Event
event = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Pad
pad' <- a -> IO (Ptr Pad)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pad
    Ptr Object
maybeParent <- case Maybe b
parent of
        Maybe b
Nothing -> Ptr Object -> IO (Ptr Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Object
forall a. Ptr a
nullPtr
        Just b
jParent -> do
            Ptr Object
jParent' <- b -> IO (Ptr Object)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jParent
            Ptr Object -> IO (Ptr Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Object
jParent'
    Ptr Event
event' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Event
event
    CInt
result <- (FunPtr C_PadEventFunction -> C_PadEventFunction
__dynamic_C_PadEventFunction FunPtr C_PadEventFunction
__funPtr) Ptr Pad
pad' Ptr Object
maybeParent Ptr Event
event'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pad
    Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
parent b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
event
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
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 t'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-'P.Nothing' and remain valid
    --          during the execution of this function.
    -> Gst.Event.Event
    -- ^ /@event@/: the t'GI.Gst.Structs.Event.Event' to handle.
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the pad could handle the event.

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

-- | Wrap the callback into a `GClosure`.
genClosure_PadEventFunction :: MonadIO m => PadEventFunction -> m (GClosure C_PadEventFunction)
genClosure_PadEventFunction :: PadEventFunction -> m (GClosure C_PadEventFunction)
genClosure_PadEventFunction PadEventFunction
cb = IO (GClosure C_PadEventFunction) -> m (GClosure C_PadEventFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PadEventFunction)
 -> m (GClosure C_PadEventFunction))
-> IO (GClosure C_PadEventFunction)
-> m (GClosure C_PadEventFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PadEventFunction
cb' = Maybe (Ptr (FunPtr C_PadEventFunction))
-> PadEventFunction -> C_PadEventFunction
wrap_PadEventFunction Maybe (Ptr (FunPtr C_PadEventFunction))
forall a. Maybe a
Nothing PadEventFunction
cb
    C_PadEventFunction -> IO (FunPtr C_PadEventFunction)
mk_PadEventFunction C_PadEventFunction
cb' IO (FunPtr C_PadEventFunction)
-> (FunPtr C_PadEventFunction -> IO (GClosure C_PadEventFunction))
-> IO (GClosure C_PadEventFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PadEventFunction -> IO (GClosure C_PadEventFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PadEventFunction` into a `C_PadEventFunction`.
wrap_PadEventFunction ::
    Maybe (Ptr (FunPtr C_PadEventFunction)) ->
    PadEventFunction ->
    C_PadEventFunction
wrap_PadEventFunction :: Maybe (Ptr (FunPtr C_PadEventFunction))
-> PadEventFunction -> C_PadEventFunction
wrap_PadEventFunction Maybe (Ptr (FunPtr C_PadEventFunction))
funptrptr PadEventFunction
_cb Ptr Pad
pad Ptr Object
parent Ptr Event
event = do
    Pad
pad' <- ((ManagedPtr Pad -> Pad) -> Ptr Pad -> IO Pad
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Pad -> Pad
Gst.Pad.Pad) Ptr Pad
pad
    Maybe Object
maybeParent <-
        if Ptr Object
parent Ptr Object -> Ptr Object -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr Object
forall a. Ptr a
nullPtr
        then Maybe Object -> IO (Maybe Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Object
forall a. Maybe a
Nothing
        else do
            Object
parent' <- ((ManagedPtr Object -> Object) -> Ptr Object -> IO Object
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Object -> Object
Gst.Object.Object) Ptr Object
parent
            Maybe Object -> IO (Maybe Object)
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe Object -> IO (Maybe Object))
-> Maybe Object -> IO (Maybe Object)
forall a b. (a -> b) -> a -> b
$ Object -> Maybe Object
forall a. a -> Maybe a
Just Object
parent'
    Event
event' <- ((ManagedPtr Event -> Event) -> Ptr Event -> IO Event
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Event -> Event
Gst.Event.Event) Ptr Event
event
    Bool
result <- PadEventFunction
_cb  Pad
pad' Maybe Object
maybeParent Event
event'
    Maybe (Ptr (FunPtr C_PadEventFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_PadEventFunction))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
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"
        }
  , callableResolvable = Nothing
  }
-}
-- | 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 t'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-'P.Nothing' and remain valid
    --          during the execution of this function.
    -> Gst.Event.Event
    -- ^ /@event@/: the t'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
    -- t'GI.Gst.Enums.FlowReturn' dependent on downstream state.
dynamic_PadEventFullFunction :: FunPtr C_PadEventFunction -> a -> Maybe b -> Event -> m FlowReturn
dynamic_PadEventFullFunction FunPtr C_PadEventFunction
__funPtr a
pad Maybe b
parent Event
event = IO FlowReturn -> m FlowReturn
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FlowReturn -> m FlowReturn) -> IO FlowReturn -> m FlowReturn
forall a b. (a -> b) -> a -> b
$ do
    Ptr Pad
pad' <- a -> IO (Ptr Pad)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pad
    Ptr Object
maybeParent <- case Maybe b
parent of
        Maybe b
Nothing -> Ptr Object -> IO (Ptr Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Object
forall a. Ptr a
nullPtr
        Just b
jParent -> do
            Ptr Object
jParent' <- b -> IO (Ptr Object)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jParent
            Ptr Object -> IO (Ptr Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Object
jParent'
    Ptr Event
event' <- Event -> IO (Ptr Event)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Event
event
    CInt
result <- (FunPtr C_PadEventFunction -> C_PadEventFunction
__dynamic_C_PadEventFullFunction FunPtr C_PadEventFunction
__funPtr) Ptr Pad
pad' Ptr Object
maybeParent Ptr Event
event'
    let result' :: FlowReturn
result' = (Int -> FlowReturn
forall a. Enum a => Int -> a
toEnum (Int -> FlowReturn) -> (CInt -> Int) -> CInt -> FlowReturn
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pad
    Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
parent b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Event -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Event
event
    FlowReturn -> IO FlowReturn
forall (m :: * -> *) a. Monad m => a -> m a
return FlowReturn
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 t'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-'P.Nothing' and remain valid
    --          during the execution of this function.
    -> Gst.Event.Event
    -- ^ /@event@/: the t'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
    -- t'GI.Gst.Enums.FlowReturn' dependent on downstream state.

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

-- | Wrap the callback into a `GClosure`.
genClosure_PadEventFullFunction :: MonadIO m => PadEventFullFunction -> m (GClosure C_PadEventFullFunction)
genClosure_PadEventFullFunction :: PadEventFullFunction -> m (GClosure C_PadEventFunction)
genClosure_PadEventFullFunction PadEventFullFunction
cb = IO (GClosure C_PadEventFunction) -> m (GClosure C_PadEventFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PadEventFunction)
 -> m (GClosure C_PadEventFunction))
-> IO (GClosure C_PadEventFunction)
-> m (GClosure C_PadEventFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PadEventFunction
cb' = Maybe (Ptr (FunPtr C_PadEventFunction))
-> PadEventFullFunction -> C_PadEventFunction
wrap_PadEventFullFunction Maybe (Ptr (FunPtr C_PadEventFunction))
forall a. Maybe a
Nothing PadEventFullFunction
cb
    C_PadEventFunction -> IO (FunPtr C_PadEventFunction)
mk_PadEventFullFunction C_PadEventFunction
cb' IO (FunPtr C_PadEventFunction)
-> (FunPtr C_PadEventFunction -> IO (GClosure C_PadEventFunction))
-> IO (GClosure C_PadEventFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PadEventFunction -> IO (GClosure C_PadEventFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PadEventFullFunction` into a `C_PadEventFullFunction`.
wrap_PadEventFullFunction ::
    Maybe (Ptr (FunPtr C_PadEventFullFunction)) ->
    PadEventFullFunction ->
    C_PadEventFullFunction
wrap_PadEventFullFunction :: Maybe (Ptr (FunPtr C_PadEventFunction))
-> PadEventFullFunction -> C_PadEventFunction
wrap_PadEventFullFunction Maybe (Ptr (FunPtr C_PadEventFunction))
funptrptr PadEventFullFunction
_cb Ptr Pad
pad Ptr Object
parent Ptr Event
event = do
    Pad
pad' <- ((ManagedPtr Pad -> Pad) -> Ptr Pad -> IO Pad
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Pad -> Pad
Gst.Pad.Pad) Ptr Pad
pad
    Maybe Object
maybeParent <-
        if Ptr Object
parent Ptr Object -> Ptr Object -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr Object
forall a. Ptr a
nullPtr
        then Maybe Object -> IO (Maybe Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Object
forall a. Maybe a
Nothing
        else do
            Object
parent' <- ((ManagedPtr Object -> Object) -> Ptr Object -> IO Object
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Object -> Object
Gst.Object.Object) Ptr Object
parent
            Maybe Object -> IO (Maybe Object)
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe Object -> IO (Maybe Object))
-> Maybe Object -> IO (Maybe Object)
forall a b. (a -> b) -> a -> b
$ Object -> Maybe Object
forall a. a -> Maybe a
Just Object
parent'
    Event
event' <- ((ManagedPtr Event -> Event) -> Ptr Event -> IO Event
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Event -> Event
Gst.Event.Event) Ptr Event
event
    FlowReturn
result <- PadEventFullFunction
_cb  Pad
pad' Maybe Object
maybeParent Event
event'
    Maybe (Ptr (FunPtr C_PadEventFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_PadEventFunction))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (FlowReturn -> Int) -> FlowReturn -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FlowReturn -> Int
forall a. Enum a => a -> Int
fromEnum) FlowReturn
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
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
        }
  , callableResolvable = 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 t'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-'P.Nothing' and remain valid
    --          during the execution of this function.
    -> Gst.BufferList.BufferList
    -- ^ /@list@/: the t'GI.Gst.Structs.BufferList.BufferList' that is chained, not 'P.Nothing'.
    -> m Gst.Enums.FlowReturn
    -- ^ __Returns:__ @/GST_FLOW_OK/@ for success
dynamic_PadChainListFunction :: FunPtr C_PadChainListFunction
-> a -> Maybe b -> BufferList -> m FlowReturn
dynamic_PadChainListFunction FunPtr C_PadChainListFunction
__funPtr a
pad Maybe b
parent BufferList
list = IO FlowReturn -> m FlowReturn
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FlowReturn -> m FlowReturn) -> IO FlowReturn -> m FlowReturn
forall a b. (a -> b) -> a -> b
$ do
    Ptr Pad
pad' <- a -> IO (Ptr Pad)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pad
    Ptr Object
maybeParent <- case Maybe b
parent of
        Maybe b
Nothing -> Ptr Object -> IO (Ptr Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Object
forall a. Ptr a
nullPtr
        Just b
jParent -> do
            Ptr Object
jParent' <- b -> IO (Ptr Object)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jParent
            Ptr Object -> IO (Ptr Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Object
jParent'
    Ptr BufferList
list' <- BufferList -> IO (Ptr BufferList)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed BufferList
list
    CInt
result <- (FunPtr C_PadChainListFunction -> C_PadChainListFunction
__dynamic_C_PadChainListFunction FunPtr C_PadChainListFunction
__funPtr) Ptr Pad
pad' Ptr Object
maybeParent Ptr BufferList
list'
    let result' :: FlowReturn
result' = (Int -> FlowReturn
forall a. Enum a => Int -> a
toEnum (Int -> FlowReturn) -> (CInt -> Int) -> CInt -> FlowReturn
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pad
    Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
parent b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    BufferList -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr BufferList
list
    FlowReturn -> IO FlowReturn
forall (m :: * -> *) a. Monad m => a -> m a
return FlowReturn
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 t'GI.Gst.Enums.FlowReturn' value.
type PadChainListFunction =
    Gst.Pad.Pad
    -- ^ /@pad@/: the sink t'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-'P.Nothing' and remain valid
    --          during the execution of this function.
    -> Gst.BufferList.BufferList
    -- ^ /@list@/: the t'GI.Gst.Structs.BufferList.BufferList' that is chained, not 'P.Nothing'.
    -> IO Gst.Enums.FlowReturn
    -- ^ __Returns:__ @/GST_FLOW_OK/@ for success

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

-- | Wrap the callback into a `GClosure`.
genClosure_PadChainListFunction :: MonadIO m => PadChainListFunction -> m (GClosure C_PadChainListFunction)
genClosure_PadChainListFunction :: PadChainListFunction -> m (GClosure C_PadChainListFunction)
genClosure_PadChainListFunction PadChainListFunction
cb = IO (GClosure C_PadChainListFunction)
-> m (GClosure C_PadChainListFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PadChainListFunction)
 -> m (GClosure C_PadChainListFunction))
-> IO (GClosure C_PadChainListFunction)
-> m (GClosure C_PadChainListFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PadChainListFunction
cb' = Maybe (Ptr (FunPtr C_PadChainListFunction))
-> PadChainListFunction -> C_PadChainListFunction
wrap_PadChainListFunction Maybe (Ptr (FunPtr C_PadChainListFunction))
forall a. Maybe a
Nothing PadChainListFunction
cb
    C_PadChainListFunction -> IO (FunPtr C_PadChainListFunction)
mk_PadChainListFunction C_PadChainListFunction
cb' IO (FunPtr C_PadChainListFunction)
-> (FunPtr C_PadChainListFunction
    -> IO (GClosure C_PadChainListFunction))
-> IO (GClosure C_PadChainListFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PadChainListFunction
-> IO (GClosure C_PadChainListFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PadChainListFunction` into a `C_PadChainListFunction`.
wrap_PadChainListFunction ::
    Maybe (Ptr (FunPtr C_PadChainListFunction)) ->
    PadChainListFunction ->
    C_PadChainListFunction
wrap_PadChainListFunction :: Maybe (Ptr (FunPtr C_PadChainListFunction))
-> PadChainListFunction -> C_PadChainListFunction
wrap_PadChainListFunction Maybe (Ptr (FunPtr C_PadChainListFunction))
funptrptr PadChainListFunction
_cb Ptr Pad
pad Ptr Object
parent Ptr BufferList
list = do
    Pad
pad' <- ((ManagedPtr Pad -> Pad) -> Ptr Pad -> IO Pad
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Pad -> Pad
Gst.Pad.Pad) Ptr Pad
pad
    Maybe Object
maybeParent <-
        if Ptr Object
parent Ptr Object -> Ptr Object -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr Object
forall a. Ptr a
nullPtr
        then Maybe Object -> IO (Maybe Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Object
forall a. Maybe a
Nothing
        else do
            Object
parent' <- ((ManagedPtr Object -> Object) -> Ptr Object -> IO Object
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Object -> Object
Gst.Object.Object) Ptr Object
parent
            Maybe Object -> IO (Maybe Object)
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe Object -> IO (Maybe Object))
-> Maybe Object -> IO (Maybe Object)
forall a b. (a -> b) -> a -> b
$ Object -> Maybe Object
forall a. a -> Maybe a
Just Object
parent'
    BufferList
list' <- ((ManagedPtr BufferList -> BufferList)
-> Ptr BufferList -> IO BufferList
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr BufferList -> BufferList
Gst.BufferList.BufferList) Ptr BufferList
list
    FlowReturn
result <- PadChainListFunction
_cb  Pad
pad' Maybe Object
maybeParent BufferList
list'
    Maybe (Ptr (FunPtr C_PadChainListFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_PadChainListFunction))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (FlowReturn -> Int) -> FlowReturn -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FlowReturn -> Int
forall a. Enum a => a -> Int
fromEnum) FlowReturn
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
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
        }
  , callableResolvable = 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 t'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-'P.Nothing' and remain valid
    --          during the execution of this function.
    -> Gst.Buffer.Buffer
    -- ^ /@buffer@/: the t'GI.Gst.Structs.Buffer.Buffer' that is chained, not 'P.Nothing'.
    -> m Gst.Enums.FlowReturn
    -- ^ __Returns:__ @/GST_FLOW_OK/@ for success
dynamic_PadChainFunction :: FunPtr C_PadChainFunction -> a -> Maybe b -> Buffer -> m FlowReturn
dynamic_PadChainFunction FunPtr C_PadChainFunction
__funPtr a
pad Maybe b
parent Buffer
buffer = IO FlowReturn -> m FlowReturn
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO FlowReturn -> m FlowReturn) -> IO FlowReturn -> m FlowReturn
forall a b. (a -> b) -> a -> b
$ do
    Ptr Pad
pad' <- a -> IO (Ptr Pad)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pad
    Ptr Object
maybeParent <- case Maybe b
parent of
        Maybe b
Nothing -> Ptr Object -> IO (Ptr Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Object
forall a. Ptr a
nullPtr
        Just b
jParent -> do
            Ptr Object
jParent' <- b -> IO (Ptr Object)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
jParent
            Ptr Object -> IO (Ptr Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Object
jParent'
    Ptr Buffer
buffer' <- Buffer -> IO (Ptr Buffer)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Buffer
buffer
    CInt
result <- (FunPtr C_PadChainFunction -> C_PadChainFunction
__dynamic_C_PadChainFunction FunPtr C_PadChainFunction
__funPtr) Ptr Pad
pad' Ptr Object
maybeParent Ptr Buffer
buffer'
    let result' :: FlowReturn
result' = (Int -> FlowReturn
forall a. Enum a => Int -> a
toEnum (Int -> FlowReturn) -> (CInt -> Int) -> CInt -> FlowReturn
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pad
    Maybe b -> (b -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe b
parent b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr
    Buffer -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Buffer
buffer
    FlowReturn -> IO FlowReturn
forall (m :: * -> *) a. Monad m => a -> m a
return FlowReturn
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 t'GI.Gst.Enums.FlowReturn' value.
type PadChainFunction =
    Gst.Pad.Pad
    -- ^ /@pad@/: the sink t'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-'P.Nothing' and remain valid
    --          during the execution of this function.
    -> Gst.Buffer.Buffer
    -- ^ /@buffer@/: the t'GI.Gst.Structs.Buffer.Buffer' that is chained, not 'P.Nothing'.
    -> IO Gst.Enums.FlowReturn
    -- ^ __Returns:__ @/GST_FLOW_OK/@ for success

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

-- | Wrap the callback into a `GClosure`.
genClosure_PadChainFunction :: MonadIO m => PadChainFunction -> m (GClosure C_PadChainFunction)
genClosure_PadChainFunction :: PadChainFunction -> m (GClosure C_PadChainFunction)
genClosure_PadChainFunction PadChainFunction
cb = IO (GClosure C_PadChainFunction) -> m (GClosure C_PadChainFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PadChainFunction)
 -> m (GClosure C_PadChainFunction))
-> IO (GClosure C_PadChainFunction)
-> m (GClosure C_PadChainFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PadChainFunction
cb' = Maybe (Ptr (FunPtr C_PadChainFunction))
-> PadChainFunction -> C_PadChainFunction
wrap_PadChainFunction Maybe (Ptr (FunPtr C_PadChainFunction))
forall a. Maybe a
Nothing PadChainFunction
cb
    C_PadChainFunction -> IO (FunPtr C_PadChainFunction)
mk_PadChainFunction C_PadChainFunction
cb' IO (FunPtr C_PadChainFunction)
-> (FunPtr C_PadChainFunction -> IO (GClosure C_PadChainFunction))
-> IO (GClosure C_PadChainFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PadChainFunction -> IO (GClosure C_PadChainFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PadChainFunction` into a `C_PadChainFunction`.
wrap_PadChainFunction ::
    Maybe (Ptr (FunPtr C_PadChainFunction)) ->
    PadChainFunction ->
    C_PadChainFunction
wrap_PadChainFunction :: Maybe (Ptr (FunPtr C_PadChainFunction))
-> PadChainFunction -> C_PadChainFunction
wrap_PadChainFunction Maybe (Ptr (FunPtr C_PadChainFunction))
funptrptr PadChainFunction
_cb Ptr Pad
pad Ptr Object
parent Ptr Buffer
buffer = do
    Pad
pad' <- ((ManagedPtr Pad -> Pad) -> Ptr Pad -> IO Pad
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Pad -> Pad
Gst.Pad.Pad) Ptr Pad
pad
    Maybe Object
maybeParent <-
        if Ptr Object
parent Ptr Object -> Ptr Object -> Bool
forall a. Eq a => a -> a -> Bool
== Ptr Object
forall a. Ptr a
nullPtr
        then Maybe Object -> IO (Maybe Object)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Object
forall a. Maybe a
Nothing
        else do
            Object
parent' <- ((ManagedPtr Object -> Object) -> Ptr Object -> IO Object
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Object -> Object
Gst.Object.Object) Ptr Object
parent
            Maybe Object -> IO (Maybe Object)
forall (m :: * -> *) a. Monad m => a -> m a
return (Maybe Object -> IO (Maybe Object))
-> Maybe Object -> IO (Maybe Object)
forall a b. (a -> b) -> a -> b
$ Object -> Maybe Object
forall a. a -> Maybe a
Just Object
parent'
    Buffer
buffer' <- ((ManagedPtr Buffer -> Buffer) -> Ptr Buffer -> IO Buffer
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Buffer -> Buffer
Gst.Buffer.Buffer) Ptr Buffer
buffer
    FlowReturn
result <- PadChainFunction
_cb  Pad
pad' Maybe Object
maybeParent Buffer
buffer'
    Maybe (Ptr (FunPtr C_PadChainFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_PadChainFunction))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (FlowReturn -> Int) -> FlowReturn -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FlowReturn -> Int
forall a. Enum a => a -> Int
fromEnum) FlowReturn
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
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
        }
  , callableResolvable = 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 t'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:__ 'P.True' if the pad could be activated or deactivated.
dynamic_PadActivateModeFunction :: FunPtr C_PadActivateModeFunction
-> a -> b -> PadMode -> Bool -> m Bool
dynamic_PadActivateModeFunction FunPtr C_PadActivateModeFunction
__funPtr a
pad b
parent PadMode
mode Bool
active = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Pad
pad' <- a -> IO (Ptr Pad)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pad
    Ptr Object
parent' <- b -> IO (Ptr Object)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
parent
    let mode' :: CUInt
mode' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (PadMode -> Int) -> PadMode -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PadMode -> Int
forall a. Enum a => a -> Int
fromEnum) PadMode
mode
    let active' :: CInt
active' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
active
    CInt
result <- (FunPtr C_PadActivateModeFunction -> C_PadActivateModeFunction
__dynamic_C_PadActivateModeFunction FunPtr C_PadActivateModeFunction
__funPtr) Ptr Pad
pad' Ptr Object
parent' CUInt
mode' CInt
active'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pad
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
parent
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
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 t'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:__ 'P.True' if the pad could be activated or deactivated.

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

-- | Wrap the callback into a `GClosure`.
genClosure_PadActivateModeFunction :: MonadIO m => PadActivateModeFunction -> m (GClosure C_PadActivateModeFunction)
genClosure_PadActivateModeFunction :: PadActivateModeFunction -> m (GClosure C_PadActivateModeFunction)
genClosure_PadActivateModeFunction PadActivateModeFunction
cb = IO (GClosure C_PadActivateModeFunction)
-> m (GClosure C_PadActivateModeFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PadActivateModeFunction)
 -> m (GClosure C_PadActivateModeFunction))
-> IO (GClosure C_PadActivateModeFunction)
-> m (GClosure C_PadActivateModeFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PadActivateModeFunction
cb' = Maybe (Ptr (FunPtr C_PadActivateModeFunction))
-> PadActivateModeFunction -> C_PadActivateModeFunction
wrap_PadActivateModeFunction Maybe (Ptr (FunPtr C_PadActivateModeFunction))
forall a. Maybe a
Nothing PadActivateModeFunction
cb
    C_PadActivateModeFunction -> IO (FunPtr C_PadActivateModeFunction)
mk_PadActivateModeFunction C_PadActivateModeFunction
cb' IO (FunPtr C_PadActivateModeFunction)
-> (FunPtr C_PadActivateModeFunction
    -> IO (GClosure C_PadActivateModeFunction))
-> IO (GClosure C_PadActivateModeFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PadActivateModeFunction
-> IO (GClosure C_PadActivateModeFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PadActivateModeFunction` into a `C_PadActivateModeFunction`.
wrap_PadActivateModeFunction ::
    Maybe (Ptr (FunPtr C_PadActivateModeFunction)) ->
    PadActivateModeFunction ->
    C_PadActivateModeFunction
wrap_PadActivateModeFunction :: Maybe (Ptr (FunPtr C_PadActivateModeFunction))
-> PadActivateModeFunction -> C_PadActivateModeFunction
wrap_PadActivateModeFunction Maybe (Ptr (FunPtr C_PadActivateModeFunction))
funptrptr PadActivateModeFunction
_cb Ptr Pad
pad Ptr Object
parent CUInt
mode CInt
active = do
    Pad
pad' <- ((ManagedPtr Pad -> Pad) -> Ptr Pad -> IO Pad
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Pad -> Pad
Gst.Pad.Pad) Ptr Pad
pad
    Object
parent' <- ((ManagedPtr Object -> Object) -> Ptr Object -> IO Object
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Object -> Object
Gst.Object.Object) Ptr Object
parent
    let mode' :: PadMode
mode' = (Int -> PadMode
forall a. Enum a => Int -> a
toEnum (Int -> PadMode) -> (CUInt -> Int) -> CUInt -> PadMode
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
mode
    let active' :: Bool
active' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
active
    Bool
result <- PadActivateModeFunction
_cb  Pad
pad' Object
parent' PadMode
mode' Bool
active'
    Maybe (Ptr (FunPtr C_PadActivateModeFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_PadActivateModeFunction))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
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
        }
  , callableResolvable = 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 t'GI.Gst.Objects.Pad.Pad'
    -> b
    -- ^ /@parent@/: the parent of /@pad@/
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the pad could be activated.
dynamic_PadActivateFunction :: FunPtr C_PadActivateFunction -> a -> b -> m Bool
dynamic_PadActivateFunction FunPtr C_PadActivateFunction
__funPtr a
pad b
parent = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Pad
pad' <- a -> IO (Ptr Pad)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
pad
    Ptr Object
parent' <- b -> IO (Ptr Object)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
parent
    CInt
result <- (FunPtr C_PadActivateFunction -> C_PadActivateFunction
__dynamic_C_PadActivateFunction FunPtr C_PadActivateFunction
__funPtr) Ptr Pad
pad' Ptr Object
parent'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
pad
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
parent
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
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 t'GI.Gst.Objects.Pad.Pad'
    -> Gst.Object.Object
    -- ^ /@parent@/: the parent of /@pad@/
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the pad could be activated.

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

-- | Wrap the callback into a `GClosure`.
genClosure_PadActivateFunction :: MonadIO m => PadActivateFunction -> m (GClosure C_PadActivateFunction)
genClosure_PadActivateFunction :: PadActivateFunction -> m (GClosure C_PadActivateFunction)
genClosure_PadActivateFunction PadActivateFunction
cb = IO (GClosure C_PadActivateFunction)
-> m (GClosure C_PadActivateFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_PadActivateFunction)
 -> m (GClosure C_PadActivateFunction))
-> IO (GClosure C_PadActivateFunction)
-> m (GClosure C_PadActivateFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_PadActivateFunction
cb' = Maybe (Ptr (FunPtr C_PadActivateFunction))
-> PadActivateFunction -> C_PadActivateFunction
wrap_PadActivateFunction Maybe (Ptr (FunPtr C_PadActivateFunction))
forall a. Maybe a
Nothing PadActivateFunction
cb
    C_PadActivateFunction -> IO (FunPtr C_PadActivateFunction)
mk_PadActivateFunction C_PadActivateFunction
cb' IO (FunPtr C_PadActivateFunction)
-> (FunPtr C_PadActivateFunction
    -> IO (GClosure C_PadActivateFunction))
-> IO (GClosure C_PadActivateFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_PadActivateFunction -> IO (GClosure C_PadActivateFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `PadActivateFunction` into a `C_PadActivateFunction`.
wrap_PadActivateFunction ::
    Maybe (Ptr (FunPtr C_PadActivateFunction)) ->
    PadActivateFunction ->
    C_PadActivateFunction
wrap_PadActivateFunction :: Maybe (Ptr (FunPtr C_PadActivateFunction))
-> PadActivateFunction -> C_PadActivateFunction
wrap_PadActivateFunction Maybe (Ptr (FunPtr C_PadActivateFunction))
funptrptr PadActivateFunction
_cb Ptr Pad
pad Ptr Object
parent = do
    Pad
pad' <- ((ManagedPtr Pad -> Pad) -> Ptr Pad -> IO Pad
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Pad -> Pad
Gst.Pad.Pad) Ptr Pad
pad
    Object
parent' <- ((ManagedPtr Object -> Object) -> Ptr Object -> IO Object
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Object -> Object
Gst.Object.Object) Ptr Object
parent
    Bool
result <- PadActivateFunction
_cb  Pad
pad' Object
parent'
    Maybe (Ptr (FunPtr C_PadActivateFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_PadActivateFunction))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
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
        }
  , callableResolvable = 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 C_MiniObjectNotify -> Ptr () -> MiniObject -> m ()
dynamic_MiniObjectNotify FunPtr C_MiniObjectNotify
__funPtr Ptr ()
userData MiniObject
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr MiniObject
obj' <- MiniObject -> IO (Ptr MiniObject)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MiniObject
obj
    (FunPtr C_MiniObjectNotify -> C_MiniObjectNotify
__dynamic_C_MiniObjectNotify FunPtr C_MiniObjectNotify
__funPtr) Ptr ()
userData Ptr MiniObject
obj'
    MiniObject -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MiniObject
obj
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
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 t'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 :: Maybe (MiniObject -> IO ())
noMiniObjectNotify = Maybe (MiniObject -> IO ())
forall a. Maybe a
Nothing

-- | A t'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 :: Maybe MiniObjectNotify_WithClosures
noMiniObjectNotify_WithClosures = Maybe MiniObjectNotify_WithClosures
forall a. Maybe a
Nothing

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

-- | Wrap the callback into a `GClosure`.
genClosure_MiniObjectNotify :: MonadIO m => MiniObjectNotify -> m (GClosure C_MiniObjectNotify)
genClosure_MiniObjectNotify :: (MiniObject -> IO ()) -> m (GClosure C_MiniObjectNotify)
genClosure_MiniObjectNotify MiniObject -> IO ()
cb = IO (GClosure C_MiniObjectNotify) -> m (GClosure C_MiniObjectNotify)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_MiniObjectNotify)
 -> m (GClosure C_MiniObjectNotify))
-> IO (GClosure C_MiniObjectNotify)
-> m (GClosure C_MiniObjectNotify)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: MiniObjectNotify_WithClosures
cb' = (MiniObject -> IO ()) -> MiniObjectNotify_WithClosures
drop_closures_MiniObjectNotify MiniObject -> IO ()
cb
    let cb'' :: C_MiniObjectNotify
cb'' = Maybe (Ptr (FunPtr C_MiniObjectNotify))
-> MiniObjectNotify_WithClosures -> C_MiniObjectNotify
wrap_MiniObjectNotify Maybe (Ptr (FunPtr C_MiniObjectNotify))
forall a. Maybe a
Nothing MiniObjectNotify_WithClosures
cb'
    C_MiniObjectNotify -> IO (FunPtr C_MiniObjectNotify)
mk_MiniObjectNotify C_MiniObjectNotify
cb'' IO (FunPtr C_MiniObjectNotify)
-> (FunPtr C_MiniObjectNotify -> IO (GClosure C_MiniObjectNotify))
-> IO (GClosure C_MiniObjectNotify)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_MiniObjectNotify -> IO (GClosure C_MiniObjectNotify)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `MiniObjectNotify` into a `C_MiniObjectNotify`.
wrap_MiniObjectNotify ::
    Maybe (Ptr (FunPtr C_MiniObjectNotify)) ->
    MiniObjectNotify_WithClosures ->
    C_MiniObjectNotify
wrap_MiniObjectNotify :: Maybe (Ptr (FunPtr C_MiniObjectNotify))
-> MiniObjectNotify_WithClosures -> C_MiniObjectNotify
wrap_MiniObjectNotify Maybe (Ptr (FunPtr C_MiniObjectNotify))
funptrptr MiniObjectNotify_WithClosures
_cb Ptr ()
userData Ptr MiniObject
obj = do
    MiniObject
obj' <- ((ManagedPtr MiniObject -> MiniObject)
-> Ptr MiniObject -> IO MiniObject
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr MiniObject -> MiniObject
Gst.MiniObject.MiniObject) Ptr MiniObject
obj
    MiniObjectNotify_WithClosures
_cb  Ptr ()
userData MiniObject
obj'
    Maybe (Ptr (FunPtr C_MiniObjectNotify)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_MiniObjectNotify))
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
        }
  , callableResolvable = 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 C_MiniObjectFreeFunction -> MiniObject -> m ()
dynamic_MiniObjectFreeFunction FunPtr C_MiniObjectFreeFunction
__funPtr MiniObject
obj = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr MiniObject
obj' <- MiniObject -> IO (Ptr MiniObject)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MiniObject
obj
    (FunPtr C_MiniObjectFreeFunction -> C_MiniObjectFreeFunction
__dynamic_C_MiniObjectFreeFunction FunPtr C_MiniObjectFreeFunction
__funPtr) Ptr MiniObject
obj'
    MiniObject -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MiniObject
obj
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
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 :: Maybe (MiniObject -> IO ())
noMiniObjectFreeFunction = Maybe (MiniObject -> IO ())
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_MiniObjectFreeFunction :: MonadIO m => MiniObjectFreeFunction -> m (GClosure C_MiniObjectFreeFunction)
genClosure_MiniObjectFreeFunction :: (MiniObject -> IO ()) -> m (GClosure C_MiniObjectFreeFunction)
genClosure_MiniObjectFreeFunction MiniObject -> IO ()
cb = IO (GClosure C_MiniObjectFreeFunction)
-> m (GClosure C_MiniObjectFreeFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_MiniObjectFreeFunction)
 -> m (GClosure C_MiniObjectFreeFunction))
-> IO (GClosure C_MiniObjectFreeFunction)
-> m (GClosure C_MiniObjectFreeFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_MiniObjectFreeFunction
cb' = Maybe (Ptr (FunPtr C_MiniObjectFreeFunction))
-> (MiniObject -> IO ()) -> C_MiniObjectFreeFunction
wrap_MiniObjectFreeFunction Maybe (Ptr (FunPtr C_MiniObjectFreeFunction))
forall a. Maybe a
Nothing MiniObject -> IO ()
cb
    C_MiniObjectFreeFunction -> IO (FunPtr C_MiniObjectFreeFunction)
mk_MiniObjectFreeFunction C_MiniObjectFreeFunction
cb' IO (FunPtr C_MiniObjectFreeFunction)
-> (FunPtr C_MiniObjectFreeFunction
    -> IO (GClosure C_MiniObjectFreeFunction))
-> IO (GClosure C_MiniObjectFreeFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_MiniObjectFreeFunction
-> IO (GClosure C_MiniObjectFreeFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `MiniObjectFreeFunction` into a `C_MiniObjectFreeFunction`.
wrap_MiniObjectFreeFunction ::
    Maybe (Ptr (FunPtr C_MiniObjectFreeFunction)) ->
    MiniObjectFreeFunction ->
    C_MiniObjectFreeFunction
wrap_MiniObjectFreeFunction :: Maybe (Ptr (FunPtr C_MiniObjectFreeFunction))
-> (MiniObject -> IO ()) -> C_MiniObjectFreeFunction
wrap_MiniObjectFreeFunction Maybe (Ptr (FunPtr C_MiniObjectFreeFunction))
funptrptr MiniObject -> IO ()
_cb Ptr MiniObject
obj = do
    MiniObject
obj' <- ((ManagedPtr MiniObject -> MiniObject)
-> Ptr MiniObject -> IO MiniObject
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr MiniObject -> MiniObject
Gst.MiniObject.MiniObject) Ptr MiniObject
obj
    MiniObject -> IO ()
_cb  MiniObject
obj'
    Maybe (Ptr (FunPtr C_MiniObjectFreeFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_MiniObjectFreeFunction))
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
        }
  , callableResolvable = 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:__ 'P.True' if the object should be cleaned up.
dynamic_MiniObjectDisposeFunction :: FunPtr C_MiniObjectDisposeFunction -> MiniObject -> m Bool
dynamic_MiniObjectDisposeFunction FunPtr C_MiniObjectDisposeFunction
__funPtr MiniObject
obj = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr MiniObject
obj' <- MiniObject -> IO (Ptr MiniObject)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MiniObject
obj
    CInt
result <- (FunPtr C_MiniObjectDisposeFunction -> C_MiniObjectDisposeFunction
__dynamic_C_MiniObjectDisposeFunction FunPtr C_MiniObjectDisposeFunction
__funPtr) Ptr MiniObject
obj'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    MiniObject -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MiniObject
obj
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

-- | Function prototype for when a miniobject has lost its last refcount.
-- Implementation of the mini object are allowed to revive the
-- passed object by doing a @/gst_mini_object_ref()/@. If the object is not
-- revived after the dispose function, the function should return 'P.True'
-- and the memory associated with the object is freed.
type MiniObjectDisposeFunction =
    Gst.MiniObject.MiniObject
    -- ^ /@obj@/: MiniObject to dispose
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the object should be cleaned up.

-- | A convenience synonym for @`Nothing` :: `Maybe` `MiniObjectDisposeFunction`@.
noMiniObjectDisposeFunction :: Maybe MiniObjectDisposeFunction
noMiniObjectDisposeFunction :: Maybe MiniObjectDisposeFunction
noMiniObjectDisposeFunction = Maybe MiniObjectDisposeFunction
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_MiniObjectDisposeFunction :: MonadIO m => MiniObjectDisposeFunction -> m (GClosure C_MiniObjectDisposeFunction)
genClosure_MiniObjectDisposeFunction :: MiniObjectDisposeFunction
-> m (GClosure C_MiniObjectDisposeFunction)
genClosure_MiniObjectDisposeFunction MiniObjectDisposeFunction
cb = IO (GClosure C_MiniObjectDisposeFunction)
-> m (GClosure C_MiniObjectDisposeFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_MiniObjectDisposeFunction)
 -> m (GClosure C_MiniObjectDisposeFunction))
-> IO (GClosure C_MiniObjectDisposeFunction)
-> m (GClosure C_MiniObjectDisposeFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_MiniObjectDisposeFunction
cb' = Maybe (Ptr (FunPtr C_MiniObjectDisposeFunction))
-> MiniObjectDisposeFunction -> C_MiniObjectDisposeFunction
wrap_MiniObjectDisposeFunction Maybe (Ptr (FunPtr C_MiniObjectDisposeFunction))
forall a. Maybe a
Nothing MiniObjectDisposeFunction
cb
    C_MiniObjectDisposeFunction
-> IO (FunPtr C_MiniObjectDisposeFunction)
mk_MiniObjectDisposeFunction C_MiniObjectDisposeFunction
cb' IO (FunPtr C_MiniObjectDisposeFunction)
-> (FunPtr C_MiniObjectDisposeFunction
    -> IO (GClosure C_MiniObjectDisposeFunction))
-> IO (GClosure C_MiniObjectDisposeFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_MiniObjectDisposeFunction
-> IO (GClosure C_MiniObjectDisposeFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `MiniObjectDisposeFunction` into a `C_MiniObjectDisposeFunction`.
wrap_MiniObjectDisposeFunction ::
    Maybe (Ptr (FunPtr C_MiniObjectDisposeFunction)) ->
    MiniObjectDisposeFunction ->
    C_MiniObjectDisposeFunction
wrap_MiniObjectDisposeFunction :: Maybe (Ptr (FunPtr C_MiniObjectDisposeFunction))
-> MiniObjectDisposeFunction -> C_MiniObjectDisposeFunction
wrap_MiniObjectDisposeFunction Maybe (Ptr (FunPtr C_MiniObjectDisposeFunction))
funptrptr MiniObjectDisposeFunction
_cb Ptr MiniObject
obj = do
    MiniObject
obj' <- ((ManagedPtr MiniObject -> MiniObject)
-> Ptr MiniObject -> IO MiniObject
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr MiniObject -> MiniObject
Gst.MiniObject.MiniObject) Ptr MiniObject
obj
    Bool
result <- MiniObjectDisposeFunction
_cb  MiniObject
obj'
    Maybe (Ptr (FunPtr C_MiniObjectDisposeFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_MiniObjectDisposeFunction))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback MetaTransformFunction
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText = Just "%TRUE if the transform could be performed"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "transbuf"
          , argType = TInterface Name { namespace = "Gst" , name = "Buffer" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GstBuffer" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "meta"
          , argType = TInterface Name { namespace = "Gst" , name = "Meta" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GstMeta" , 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 #GstBuffer" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "type"
          , argType = TBasicType TUInt32
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the transform type" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "transform specific data."
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Function called for each @meta in @buffer as a result of performing a\ntransformation on @transbuf. Additional @type specific transform data\nis passed to the function as @data.\n\nImplementations should check the @type of the transform and parse\nadditional type specific fields in @data that should be used to update\nthe metadata on @transbuf."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_MetaTransformFunction =
    Ptr Gst.Buffer.Buffer ->
    Ptr Gst.Meta.Meta ->
    Ptr Gst.Buffer.Buffer ->
    Word32 ->
    Ptr () ->
    IO CInt

-- Args: [ Arg
--           { argCName = "transbuf"
--           , argType = TInterface Name { namespace = "Gst" , name = "Buffer" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstBuffer" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "meta"
--           , argType = TInterface Name { namespace = "Gst" , name = "Meta" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstMeta" , 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 #GstBuffer" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "type"
--           , argType = TBasicType TUInt32
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the transform type" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "transform specific 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_MetaTransformFunction :: FunPtr C_MetaTransformFunction -> C_MetaTransformFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_MetaTransformFunction ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_MetaTransformFunction
    -> Gst.Buffer.Buffer
    -- ^ /@transbuf@/: a t'GI.Gst.Structs.Buffer.Buffer'
    -> Gst.Meta.Meta
    -- ^ /@meta@/: a t'GI.Gst.Structs.Meta.Meta'
    -> Gst.Buffer.Buffer
    -- ^ /@buffer@/: a t'GI.Gst.Structs.Buffer.Buffer'
    -> Word32
    -- ^ /@type@/: the transform type
    -> Ptr ()
    -- ^ /@data@/: transform specific data.
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the transform could be performed
dynamic_MetaTransformFunction :: FunPtr C_MetaTransformFunction
-> Buffer -> Meta -> Buffer -> Word32 -> Ptr () -> m Bool
dynamic_MetaTransformFunction FunPtr C_MetaTransformFunction
__funPtr Buffer
transbuf Meta
meta Buffer
buffer Word32
type_ Ptr ()
data_ = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Buffer
transbuf' <- Buffer -> IO (Ptr Buffer)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Buffer
transbuf
    Ptr Meta
meta' <- Meta -> IO (Ptr Meta)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Meta
meta
    Ptr Buffer
buffer' <- Buffer -> IO (Ptr Buffer)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Buffer
buffer
    CInt
result <- (FunPtr C_MetaTransformFunction -> C_MetaTransformFunction
__dynamic_C_MetaTransformFunction FunPtr C_MetaTransformFunction
__funPtr) Ptr Buffer
transbuf' Ptr Meta
meta' Ptr Buffer
buffer' Word32
type_ Ptr ()
data_
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Buffer -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Buffer
transbuf
    Meta -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Meta
meta
    Buffer -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Buffer
buffer
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

-- | Function called for each /@meta@/ in /@buffer@/ as a result of performing a
-- transformation on /@transbuf@/. Additional /@type@/ specific transform data
-- is passed to the function as /@data@/.
-- 
-- Implementations should check the /@type@/ of the transform and parse
-- additional type specific fields in /@data@/ that should be used to update
-- the metadata on /@transbuf@/.
type MetaTransformFunction =
    Gst.Buffer.Buffer
    -- ^ /@transbuf@/: a t'GI.Gst.Structs.Buffer.Buffer'
    -> Gst.Meta.Meta
    -- ^ /@meta@/: a t'GI.Gst.Structs.Meta.Meta'
    -> Gst.Buffer.Buffer
    -- ^ /@buffer@/: a t'GI.Gst.Structs.Buffer.Buffer'
    -> Word32
    -- ^ /@type@/: the transform type
    -> Ptr ()
    -- ^ /@data@/: transform specific data.
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the transform could be performed

-- | A convenience synonym for @`Nothing` :: `Maybe` `MetaTransformFunction`@.
noMetaTransformFunction :: Maybe MetaTransformFunction
noMetaTransformFunction :: Maybe MetaTransformFunction
noMetaTransformFunction = Maybe MetaTransformFunction
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_MetaTransformFunction :: MonadIO m => MetaTransformFunction -> m (GClosure C_MetaTransformFunction)
genClosure_MetaTransformFunction :: MetaTransformFunction -> m (GClosure C_MetaTransformFunction)
genClosure_MetaTransformFunction MetaTransformFunction
cb = IO (GClosure C_MetaTransformFunction)
-> m (GClosure C_MetaTransformFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_MetaTransformFunction)
 -> m (GClosure C_MetaTransformFunction))
-> IO (GClosure C_MetaTransformFunction)
-> m (GClosure C_MetaTransformFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_MetaTransformFunction
cb' = Maybe (Ptr (FunPtr C_MetaTransformFunction))
-> MetaTransformFunction -> C_MetaTransformFunction
wrap_MetaTransformFunction Maybe (Ptr (FunPtr C_MetaTransformFunction))
forall a. Maybe a
Nothing MetaTransformFunction
cb
    C_MetaTransformFunction -> IO (FunPtr C_MetaTransformFunction)
mk_MetaTransformFunction C_MetaTransformFunction
cb' IO (FunPtr C_MetaTransformFunction)
-> (FunPtr C_MetaTransformFunction
    -> IO (GClosure C_MetaTransformFunction))
-> IO (GClosure C_MetaTransformFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_MetaTransformFunction
-> IO (GClosure C_MetaTransformFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `MetaTransformFunction` into a `C_MetaTransformFunction`.
wrap_MetaTransformFunction ::
    Maybe (Ptr (FunPtr C_MetaTransformFunction)) ->
    MetaTransformFunction ->
    C_MetaTransformFunction
wrap_MetaTransformFunction :: Maybe (Ptr (FunPtr C_MetaTransformFunction))
-> MetaTransformFunction -> C_MetaTransformFunction
wrap_MetaTransformFunction Maybe (Ptr (FunPtr C_MetaTransformFunction))
funptrptr MetaTransformFunction
_cb Ptr Buffer
transbuf Ptr Meta
meta Ptr Buffer
buffer Word32
type_ Ptr ()
data_ = do
    (ManagedPtr Buffer -> Buffer)
-> Ptr Buffer -> (Buffer -> IO CInt) -> IO CInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Buffer -> Buffer
Gst.Buffer.Buffer Ptr Buffer
transbuf ((Buffer -> IO CInt) -> IO CInt) -> (Buffer -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Buffer
transbuf' -> do
        Meta
meta' <- ((ManagedPtr Meta -> Meta) -> Ptr Meta -> IO Meta
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr Meta -> Meta
Gst.Meta.Meta) Ptr Meta
meta
        (ManagedPtr Buffer -> Buffer)
-> Ptr Buffer -> (Buffer -> IO CInt) -> IO CInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Buffer -> Buffer
Gst.Buffer.Buffer Ptr Buffer
buffer ((Buffer -> IO CInt) -> IO CInt) -> (Buffer -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Buffer
buffer' -> do
            Bool
result <- MetaTransformFunction
_cb  Buffer
transbuf' Meta
meta' Buffer
buffer' Word32
type_ Ptr ()
data_
            Maybe (Ptr (FunPtr C_MetaTransformFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_MetaTransformFunction))
funptrptr
            let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
            CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback MetaInitFunction
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "meta"
          , argType = TInterface Name { namespace = "Gst" , name = "Meta" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GstMeta" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "params"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "parameters passed to the init 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 "a #GstBuffer" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just "Function called when @meta is initialized in @buffer."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_MetaInitFunction =
    Ptr Gst.Meta.Meta ->
    Ptr () ->
    Ptr Gst.Buffer.Buffer ->
    IO CInt

-- Args: [ Arg
--           { argCName = "meta"
--           , argType = TInterface Name { namespace = "Gst" , name = "Meta" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstMeta" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "params"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "parameters passed to the init 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 "a #GstBuffer" , 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_MetaInitFunction :: FunPtr C_MetaInitFunction -> C_MetaInitFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_MetaInitFunction ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_MetaInitFunction
    -> Gst.Meta.Meta
    -- ^ /@meta@/: a t'GI.Gst.Structs.Meta.Meta'
    -> Ptr ()
    -- ^ /@params@/: parameters passed to the init function
    -> Gst.Buffer.Buffer
    -- ^ /@buffer@/: a t'GI.Gst.Structs.Buffer.Buffer'
    -> m Bool
dynamic_MetaInitFunction :: FunPtr C_MetaInitFunction -> Meta -> Ptr () -> Buffer -> m Bool
dynamic_MetaInitFunction FunPtr C_MetaInitFunction
__funPtr Meta
meta Ptr ()
params Buffer
buffer = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Meta
meta' <- Meta -> IO (Ptr Meta)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Meta
meta
    Ptr Buffer
buffer' <- Buffer -> IO (Ptr Buffer)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Buffer
buffer
    CInt
result <- (FunPtr C_MetaInitFunction -> C_MetaInitFunction
__dynamic_C_MetaInitFunction FunPtr C_MetaInitFunction
__funPtr) Ptr Meta
meta' Ptr ()
params Ptr Buffer
buffer'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Meta -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Meta
meta
    Buffer -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Buffer
buffer
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

-- | Function called when /@meta@/ is initialized in /@buffer@/.
type MetaInitFunction =
    Gst.Meta.Meta
    -- ^ /@meta@/: a t'GI.Gst.Structs.Meta.Meta'
    -> Ptr ()
    -- ^ /@params@/: parameters passed to the init function
    -> Gst.Buffer.Buffer
    -- ^ /@buffer@/: a t'GI.Gst.Structs.Buffer.Buffer'
    -> IO Bool

-- | A convenience synonym for @`Nothing` :: `Maybe` `MetaInitFunction`@.
noMetaInitFunction :: Maybe MetaInitFunction
noMetaInitFunction :: Maybe MetaInitFunction
noMetaInitFunction = Maybe MetaInitFunction
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_MetaInitFunction :: MonadIO m => MetaInitFunction -> m (GClosure C_MetaInitFunction)
genClosure_MetaInitFunction :: MetaInitFunction -> m (GClosure C_MetaInitFunction)
genClosure_MetaInitFunction MetaInitFunction
cb = IO (GClosure C_MetaInitFunction) -> m (GClosure C_MetaInitFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_MetaInitFunction)
 -> m (GClosure C_MetaInitFunction))
-> IO (GClosure C_MetaInitFunction)
-> m (GClosure C_MetaInitFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_MetaInitFunction
cb' = Maybe (Ptr (FunPtr C_MetaInitFunction))
-> MetaInitFunction -> C_MetaInitFunction
wrap_MetaInitFunction Maybe (Ptr (FunPtr C_MetaInitFunction))
forall a. Maybe a
Nothing MetaInitFunction
cb
    C_MetaInitFunction -> IO (FunPtr C_MetaInitFunction)
mk_MetaInitFunction C_MetaInitFunction
cb' IO (FunPtr C_MetaInitFunction)
-> (FunPtr C_MetaInitFunction -> IO (GClosure C_MetaInitFunction))
-> IO (GClosure C_MetaInitFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_MetaInitFunction -> IO (GClosure C_MetaInitFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `MetaInitFunction` into a `C_MetaInitFunction`.
wrap_MetaInitFunction ::
    Maybe (Ptr (FunPtr C_MetaInitFunction)) ->
    MetaInitFunction ->
    C_MetaInitFunction
wrap_MetaInitFunction :: Maybe (Ptr (FunPtr C_MetaInitFunction))
-> MetaInitFunction -> C_MetaInitFunction
wrap_MetaInitFunction Maybe (Ptr (FunPtr C_MetaInitFunction))
funptrptr MetaInitFunction
_cb Ptr Meta
meta Ptr ()
params Ptr Buffer
buffer = do
    Meta
meta' <- ((ManagedPtr Meta -> Meta) -> Ptr Meta -> IO Meta
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr Meta -> Meta
Gst.Meta.Meta) Ptr Meta
meta
    (ManagedPtr Buffer -> Buffer)
-> Ptr Buffer -> (Buffer -> IO CInt) -> IO CInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Buffer -> Buffer
Gst.Buffer.Buffer Ptr Buffer
buffer ((Buffer -> IO CInt) -> IO CInt) -> (Buffer -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Buffer
buffer' -> do
        Bool
result <- MetaInitFunction
_cb  Meta
meta' Ptr ()
params Buffer
buffer'
        Maybe (Ptr (FunPtr C_MetaInitFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_MetaInitFunction))
funptrptr
        let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
        CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback MetaFreeFunction
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "meta"
          , argType = TInterface Name { namespace = "Gst" , name = "Meta" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GstMeta" , 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 #GstBuffer" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just "Function called when @meta is freed in @buffer."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_MetaFreeFunction =
    Ptr Gst.Meta.Meta ->
    Ptr Gst.Buffer.Buffer ->
    IO ()

-- Args: [ Arg
--           { argCName = "meta"
--           , argType = TInterface Name { namespace = "Gst" , name = "Meta" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstMeta" , 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 #GstBuffer" , 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_MetaFreeFunction :: FunPtr C_MetaFreeFunction -> C_MetaFreeFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_MetaFreeFunction ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_MetaFreeFunction
    -> Gst.Meta.Meta
    -- ^ /@meta@/: a t'GI.Gst.Structs.Meta.Meta'
    -> Gst.Buffer.Buffer
    -- ^ /@buffer@/: a t'GI.Gst.Structs.Buffer.Buffer'
    -> m ()
dynamic_MetaFreeFunction :: FunPtr C_MetaFreeFunction -> Meta -> Buffer -> m ()
dynamic_MetaFreeFunction FunPtr C_MetaFreeFunction
__funPtr Meta
meta Buffer
buffer = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Meta
meta' <- Meta -> IO (Ptr Meta)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Meta
meta
    Ptr Buffer
buffer' <- Buffer -> IO (Ptr Buffer)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Buffer
buffer
    (FunPtr C_MetaFreeFunction -> C_MetaFreeFunction
__dynamic_C_MetaFreeFunction FunPtr C_MetaFreeFunction
__funPtr) Ptr Meta
meta' Ptr Buffer
buffer'
    Meta -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Meta
meta
    Buffer -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Buffer
buffer
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | Function called when /@meta@/ is freed in /@buffer@/.
type MetaFreeFunction =
    Gst.Meta.Meta
    -- ^ /@meta@/: a t'GI.Gst.Structs.Meta.Meta'
    -> Gst.Buffer.Buffer
    -- ^ /@buffer@/: a t'GI.Gst.Structs.Buffer.Buffer'
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `MetaFreeFunction`@.
noMetaFreeFunction :: Maybe MetaFreeFunction
noMetaFreeFunction :: Maybe MetaFreeFunction
noMetaFreeFunction = Maybe MetaFreeFunction
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_MetaFreeFunction :: MonadIO m => MetaFreeFunction -> m (GClosure C_MetaFreeFunction)
genClosure_MetaFreeFunction :: MetaFreeFunction -> m (GClosure C_MetaFreeFunction)
genClosure_MetaFreeFunction MetaFreeFunction
cb = IO (GClosure C_MetaFreeFunction) -> m (GClosure C_MetaFreeFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_MetaFreeFunction)
 -> m (GClosure C_MetaFreeFunction))
-> IO (GClosure C_MetaFreeFunction)
-> m (GClosure C_MetaFreeFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_MetaFreeFunction
cb' = Maybe (Ptr (FunPtr C_MetaFreeFunction))
-> MetaFreeFunction -> C_MetaFreeFunction
wrap_MetaFreeFunction Maybe (Ptr (FunPtr C_MetaFreeFunction))
forall a. Maybe a
Nothing MetaFreeFunction
cb
    C_MetaFreeFunction -> IO (FunPtr C_MetaFreeFunction)
mk_MetaFreeFunction C_MetaFreeFunction
cb' IO (FunPtr C_MetaFreeFunction)
-> (FunPtr C_MetaFreeFunction -> IO (GClosure C_MetaFreeFunction))
-> IO (GClosure C_MetaFreeFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_MetaFreeFunction -> IO (GClosure C_MetaFreeFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `MetaFreeFunction` into a `C_MetaFreeFunction`.
wrap_MetaFreeFunction ::
    Maybe (Ptr (FunPtr C_MetaFreeFunction)) ->
    MetaFreeFunction ->
    C_MetaFreeFunction
wrap_MetaFreeFunction :: Maybe (Ptr (FunPtr C_MetaFreeFunction))
-> MetaFreeFunction -> C_MetaFreeFunction
wrap_MetaFreeFunction Maybe (Ptr (FunPtr C_MetaFreeFunction))
funptrptr MetaFreeFunction
_cb Ptr Meta
meta Ptr Buffer
buffer = do
    Meta
meta' <- ((ManagedPtr Meta -> Meta) -> Ptr Meta -> IO Meta
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr Meta -> Meta
Gst.Meta.Meta) Ptr Meta
meta
    (ManagedPtr Buffer -> Buffer)
-> Ptr Buffer -> (Buffer -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Buffer -> Buffer
Gst.Buffer.Buffer Ptr Buffer
buffer ((Buffer -> IO ()) -> IO ()) -> (Buffer -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Buffer
buffer' -> do
        MetaFreeFunction
_cb  Meta
meta' Buffer
buffer'
        Maybe (Ptr (FunPtr C_MetaFreeFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_MetaFreeFunction))
funptrptr


-- callback MemoryUnmapFunction
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "mem"
          , argType = TInterface Name { namespace = "Gst" , name = "Memory" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GstMemory" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Return the pointer previously retrieved with gst_memory_map()."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_MemoryUnmapFunction =
    Ptr Gst.Memory.Memory ->
    IO ()

-- Args: [ Arg
--           { argCName = "mem"
--           , argType = TInterface Name { namespace = "Gst" , name = "Memory" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstMemory" , 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_MemoryUnmapFunction :: FunPtr C_MemoryUnmapFunction -> C_MemoryUnmapFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_MemoryUnmapFunction ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_MemoryUnmapFunction
    -> Gst.Memory.Memory
    -- ^ /@mem@/: a t'GI.Gst.Structs.Memory.Memory'
    -> m ()
dynamic_MemoryUnmapFunction :: FunPtr C_MemoryUnmapFunction -> Memory -> m ()
dynamic_MemoryUnmapFunction FunPtr C_MemoryUnmapFunction
__funPtr Memory
mem = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Memory
mem' <- Memory -> IO (Ptr Memory)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Memory
mem
    (FunPtr C_MemoryUnmapFunction -> C_MemoryUnmapFunction
__dynamic_C_MemoryUnmapFunction FunPtr C_MemoryUnmapFunction
__funPtr) Ptr Memory
mem'
    Memory -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Memory
mem
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | Return the pointer previously retrieved with 'GI.Gst.Structs.Memory.memoryMap'.
type MemoryUnmapFunction =
    Gst.Memory.Memory
    -- ^ /@mem@/: a t'GI.Gst.Structs.Memory.Memory'
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `MemoryUnmapFunction`@.
noMemoryUnmapFunction :: Maybe MemoryUnmapFunction
noMemoryUnmapFunction :: Maybe (Memory -> IO ())
noMemoryUnmapFunction = Maybe (Memory -> IO ())
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_MemoryUnmapFunction :: MonadIO m => MemoryUnmapFunction -> m (GClosure C_MemoryUnmapFunction)
genClosure_MemoryUnmapFunction :: (Memory -> IO ()) -> m (GClosure C_MemoryUnmapFunction)
genClosure_MemoryUnmapFunction Memory -> IO ()
cb = IO (GClosure C_MemoryUnmapFunction)
-> m (GClosure C_MemoryUnmapFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_MemoryUnmapFunction)
 -> m (GClosure C_MemoryUnmapFunction))
-> IO (GClosure C_MemoryUnmapFunction)
-> m (GClosure C_MemoryUnmapFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_MemoryUnmapFunction
cb' = Maybe (Ptr (FunPtr C_MemoryUnmapFunction))
-> (Memory -> IO ()) -> C_MemoryUnmapFunction
wrap_MemoryUnmapFunction Maybe (Ptr (FunPtr C_MemoryUnmapFunction))
forall a. Maybe a
Nothing Memory -> IO ()
cb
    C_MemoryUnmapFunction -> IO (FunPtr C_MemoryUnmapFunction)
mk_MemoryUnmapFunction C_MemoryUnmapFunction
cb' IO (FunPtr C_MemoryUnmapFunction)
-> (FunPtr C_MemoryUnmapFunction
    -> IO (GClosure C_MemoryUnmapFunction))
-> IO (GClosure C_MemoryUnmapFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_MemoryUnmapFunction -> IO (GClosure C_MemoryUnmapFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `MemoryUnmapFunction` into a `C_MemoryUnmapFunction`.
wrap_MemoryUnmapFunction ::
    Maybe (Ptr (FunPtr C_MemoryUnmapFunction)) ->
    MemoryUnmapFunction ->
    C_MemoryUnmapFunction
wrap_MemoryUnmapFunction :: Maybe (Ptr (FunPtr C_MemoryUnmapFunction))
-> (Memory -> IO ()) -> C_MemoryUnmapFunction
wrap_MemoryUnmapFunction Maybe (Ptr (FunPtr C_MemoryUnmapFunction))
funptrptr Memory -> IO ()
_cb Ptr Memory
mem = do
    (ManagedPtr Memory -> Memory)
-> Ptr Memory -> (Memory -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Memory -> Memory
Gst.Memory.Memory Ptr Memory
mem ((Memory -> IO ()) -> IO ()) -> (Memory -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Memory
mem' -> do
        Memory -> IO ()
_cb  Memory
mem'
        Maybe (Ptr (FunPtr C_MemoryUnmapFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_MemoryUnmapFunction))
funptrptr


-- callback MemoryUnmapFullFunction
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "mem"
          , argType = TInterface Name { namespace = "Gst" , name = "Memory" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GstMemory" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "info"
          , argType =
              TInterface Name { namespace = "Gst" , name = "MapInfo" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GstMapInfo" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Return the pointer previously retrieved with gst_memory_map() with @info."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_MemoryUnmapFullFunction =
    Ptr Gst.Memory.Memory ->
    Ptr Gst.MapInfo.MapInfo ->
    IO ()

-- Args: [ Arg
--           { argCName = "mem"
--           , argType = TInterface Name { namespace = "Gst" , name = "Memory" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstMemory" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "info"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "MapInfo" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstMapInfo" , 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_MemoryUnmapFullFunction :: FunPtr C_MemoryUnmapFullFunction -> C_MemoryUnmapFullFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_MemoryUnmapFullFunction ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_MemoryUnmapFullFunction
    -> Gst.Memory.Memory
    -- ^ /@mem@/: a t'GI.Gst.Structs.Memory.Memory'
    -> Gst.MapInfo.MapInfo
    -- ^ /@info@/: a t'GI.Gst.Structs.MapInfo.MapInfo'
    -> m ()
dynamic_MemoryUnmapFullFunction :: FunPtr C_MemoryUnmapFullFunction -> Memory -> MapInfo -> m ()
dynamic_MemoryUnmapFullFunction FunPtr C_MemoryUnmapFullFunction
__funPtr Memory
mem MapInfo
info = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Memory
mem' <- Memory -> IO (Ptr Memory)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Memory
mem
    Ptr MapInfo
info' <- MapInfo -> IO (Ptr MapInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MapInfo
info
    (FunPtr C_MemoryUnmapFullFunction -> C_MemoryUnmapFullFunction
__dynamic_C_MemoryUnmapFullFunction FunPtr C_MemoryUnmapFullFunction
__funPtr) Ptr Memory
mem' Ptr MapInfo
info'
    Memory -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Memory
mem
    MapInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MapInfo
info
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | Return the pointer previously retrieved with 'GI.Gst.Structs.Memory.memoryMap' with /@info@/.
type MemoryUnmapFullFunction =
    Gst.Memory.Memory
    -- ^ /@mem@/: a t'GI.Gst.Structs.Memory.Memory'
    -> Gst.MapInfo.MapInfo
    -- ^ /@info@/: a t'GI.Gst.Structs.MapInfo.MapInfo'
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `MemoryUnmapFullFunction`@.
noMemoryUnmapFullFunction :: Maybe MemoryUnmapFullFunction
noMemoryUnmapFullFunction :: Maybe MemoryUnmapFullFunction
noMemoryUnmapFullFunction = Maybe MemoryUnmapFullFunction
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_MemoryUnmapFullFunction :: MonadIO m => MemoryUnmapFullFunction -> m (GClosure C_MemoryUnmapFullFunction)
genClosure_MemoryUnmapFullFunction :: MemoryUnmapFullFunction -> m (GClosure C_MemoryUnmapFullFunction)
genClosure_MemoryUnmapFullFunction MemoryUnmapFullFunction
cb = IO (GClosure C_MemoryUnmapFullFunction)
-> m (GClosure C_MemoryUnmapFullFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_MemoryUnmapFullFunction)
 -> m (GClosure C_MemoryUnmapFullFunction))
-> IO (GClosure C_MemoryUnmapFullFunction)
-> m (GClosure C_MemoryUnmapFullFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_MemoryUnmapFullFunction
cb' = Maybe (Ptr (FunPtr C_MemoryUnmapFullFunction))
-> MemoryUnmapFullFunction -> C_MemoryUnmapFullFunction
wrap_MemoryUnmapFullFunction Maybe (Ptr (FunPtr C_MemoryUnmapFullFunction))
forall a. Maybe a
Nothing MemoryUnmapFullFunction
cb
    C_MemoryUnmapFullFunction -> IO (FunPtr C_MemoryUnmapFullFunction)
mk_MemoryUnmapFullFunction C_MemoryUnmapFullFunction
cb' IO (FunPtr C_MemoryUnmapFullFunction)
-> (FunPtr C_MemoryUnmapFullFunction
    -> IO (GClosure C_MemoryUnmapFullFunction))
-> IO (GClosure C_MemoryUnmapFullFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_MemoryUnmapFullFunction
-> IO (GClosure C_MemoryUnmapFullFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `MemoryUnmapFullFunction` into a `C_MemoryUnmapFullFunction`.
wrap_MemoryUnmapFullFunction ::
    Maybe (Ptr (FunPtr C_MemoryUnmapFullFunction)) ->
    MemoryUnmapFullFunction ->
    C_MemoryUnmapFullFunction
wrap_MemoryUnmapFullFunction :: Maybe (Ptr (FunPtr C_MemoryUnmapFullFunction))
-> MemoryUnmapFullFunction -> C_MemoryUnmapFullFunction
wrap_MemoryUnmapFullFunction Maybe (Ptr (FunPtr C_MemoryUnmapFullFunction))
funptrptr MemoryUnmapFullFunction
_cb Ptr Memory
mem Ptr MapInfo
info = do
    (ManagedPtr Memory -> Memory)
-> Ptr Memory -> (Memory -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Memory -> Memory
Gst.Memory.Memory Ptr Memory
mem ((Memory -> IO ()) -> IO ()) -> (Memory -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Memory
mem' -> do
        MapInfo
info' <- ((ManagedPtr MapInfo -> MapInfo) -> Ptr MapInfo -> IO MapInfo
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr MapInfo -> MapInfo
Gst.MapInfo.MapInfo) Ptr MapInfo
info
        MemoryUnmapFullFunction
_cb  Memory
mem' MapInfo
info'
        Maybe (Ptr (FunPtr C_MemoryUnmapFullFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_MemoryUnmapFullFunction))
funptrptr


-- callback MemoryShareFunction
{- Callable
  { returnType =
      Just (TInterface Name { namespace = "Gst" , name = "Memory" })
  , returnMayBeNull = False
  , returnTransfer = TransferEverything
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just
              "a new #GstMemory object sharing the requested region in @mem."
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "mem"
          , argType = TInterface Name { namespace = "Gst" , name = "Memory" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GstMemory" , 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 = Just "an offset" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "size"
          , argType = TBasicType TInt64
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a size or -1" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Share @size bytes from @mem starting at @offset and return them wrapped in a\nnew GstMemory object. If @size is set to -1, all bytes starting at @offset are\nshared. This function does not make a copy of the bytes in @mem."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_MemoryShareFunction =
    Ptr Gst.Memory.Memory ->
    Int64 ->
    Int64 ->
    IO (Ptr Gst.Memory.Memory)

-- Args: [ Arg
--           { argCName = "mem"
--           , argType = TInterface Name { namespace = "Gst" , name = "Memory" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstMemory" , 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 = Just "an offset" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "size"
--           , argType = TBasicType TInt64
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a size or -1" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gst" , name = "Memory" })
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_MemoryShareFunction :: FunPtr C_MemoryShareFunction -> C_MemoryShareFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_MemoryShareFunction ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_MemoryShareFunction
    -> Gst.Memory.Memory
    -- ^ /@mem@/: a t'GI.Gst.Structs.Memory.Memory'
    -> Int64
    -- ^ /@offset@/: an offset
    -> Int64
    -- ^ /@size@/: a size or -1
    -> m Gst.Memory.Memory
    -- ^ __Returns:__ a new t'GI.Gst.Structs.Memory.Memory' object sharing the requested region in /@mem@/.
dynamic_MemoryShareFunction :: FunPtr C_MemoryShareFunction
-> Memory -> Int64 -> Int64 -> m Memory
dynamic_MemoryShareFunction FunPtr C_MemoryShareFunction
__funPtr Memory
mem Int64
offset Int64
size = IO Memory -> m Memory
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Memory -> m Memory) -> IO Memory -> m Memory
forall a b. (a -> b) -> a -> b
$ do
    Ptr Memory
mem' <- Memory -> IO (Ptr Memory)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Memory
mem
    Ptr Memory
result <- (FunPtr C_MemoryShareFunction -> C_MemoryShareFunction
__dynamic_C_MemoryShareFunction FunPtr C_MemoryShareFunction
__funPtr) Ptr Memory
mem' Int64
offset Int64
size
    Text -> C_MemoryUnmapFunction
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"memoryShareFunction" Ptr Memory
result
    Memory
result' <- ((ManagedPtr Memory -> Memory) -> Ptr Memory -> IO Memory
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Memory -> Memory
Gst.Memory.Memory) Ptr Memory
result
    Memory -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Memory
mem
    Memory -> IO Memory
forall (m :: * -> *) a. Monad m => a -> m a
return Memory
result'

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

-- | Share /@size@/ bytes from /@mem@/ starting at /@offset@/ and return them wrapped in a
-- new GstMemory object. If /@size@/ is set to -1, all bytes starting at /@offset@/ are
-- shared. This function does not make a copy of the bytes in /@mem@/.
type MemoryShareFunction =
    Gst.Memory.Memory
    -- ^ /@mem@/: a t'GI.Gst.Structs.Memory.Memory'
    -> Int64
    -- ^ /@offset@/: an offset
    -> Int64
    -- ^ /@size@/: a size or -1
    -> IO Gst.Memory.Memory
    -- ^ __Returns:__ a new t'GI.Gst.Structs.Memory.Memory' object sharing the requested region in /@mem@/.

-- | A convenience synonym for @`Nothing` :: `Maybe` `MemoryShareFunction`@.
noMemoryShareFunction :: Maybe MemoryShareFunction
noMemoryShareFunction :: Maybe MemoryShareFunction
noMemoryShareFunction = Maybe MemoryShareFunction
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_MemoryShareFunction :: MonadIO m => MemoryShareFunction -> m (GClosure C_MemoryShareFunction)
genClosure_MemoryShareFunction :: MemoryShareFunction -> m (GClosure C_MemoryShareFunction)
genClosure_MemoryShareFunction MemoryShareFunction
cb = IO (GClosure C_MemoryShareFunction)
-> m (GClosure C_MemoryShareFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_MemoryShareFunction)
 -> m (GClosure C_MemoryShareFunction))
-> IO (GClosure C_MemoryShareFunction)
-> m (GClosure C_MemoryShareFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_MemoryShareFunction
cb' = Maybe (Ptr (FunPtr C_MemoryShareFunction))
-> MemoryShareFunction -> C_MemoryShareFunction
wrap_MemoryShareFunction Maybe (Ptr (FunPtr C_MemoryShareFunction))
forall a. Maybe a
Nothing MemoryShareFunction
cb
    C_MemoryShareFunction -> IO (FunPtr C_MemoryShareFunction)
mk_MemoryShareFunction C_MemoryShareFunction
cb' IO (FunPtr C_MemoryShareFunction)
-> (FunPtr C_MemoryShareFunction
    -> IO (GClosure C_MemoryShareFunction))
-> IO (GClosure C_MemoryShareFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_MemoryShareFunction -> IO (GClosure C_MemoryShareFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `MemoryShareFunction` into a `C_MemoryShareFunction`.
wrap_MemoryShareFunction ::
    Maybe (Ptr (FunPtr C_MemoryShareFunction)) ->
    MemoryShareFunction ->
    C_MemoryShareFunction
wrap_MemoryShareFunction :: Maybe (Ptr (FunPtr C_MemoryShareFunction))
-> MemoryShareFunction -> C_MemoryShareFunction
wrap_MemoryShareFunction Maybe (Ptr (FunPtr C_MemoryShareFunction))
funptrptr MemoryShareFunction
_cb Ptr Memory
mem Int64
offset Int64
size = do
    (ManagedPtr Memory -> Memory)
-> Ptr Memory -> (Memory -> IO (Ptr Memory)) -> IO (Ptr Memory)
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Memory -> Memory
Gst.Memory.Memory Ptr Memory
mem ((Memory -> IO (Ptr Memory)) -> IO (Ptr Memory))
-> (Memory -> IO (Ptr Memory)) -> IO (Ptr Memory)
forall a b. (a -> b) -> a -> b
$ \Memory
mem' -> do
        Memory
result <- MemoryShareFunction
_cb  Memory
mem' Int64
offset Int64
size
        Maybe (Ptr (FunPtr C_MemoryShareFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_MemoryShareFunction))
funptrptr
        Ptr Memory
result' <- Memory -> IO (Ptr Memory)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Memory
result
        Ptr Memory -> IO (Ptr Memory)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Memory
result'


-- callback MemoryMapFunction
{- Callable
  { returnType = Just (TBasicType TPtr)
  , returnMayBeNull = True
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just
              "a pointer to memory of which at least @maxsize bytes can be\naccessed according to the access pattern in @flags."
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "mem"
          , argType = TInterface Name { namespace = "Gst" , name = "Memory" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GstMemory" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "maxsize"
          , argType = TBasicType TUInt64
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "size to map" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "flags"
          , argType =
              TInterface Name { namespace = "Gst" , name = "MapFlags" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "access mode for the memory"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Get the memory of @mem that can be accessed according to the mode specified\nin @flags. The function should return a pointer that contains at least\n@maxsize bytes."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_MemoryMapFunction =
    Ptr Gst.Memory.Memory ->
    Word64 ->
    CUInt ->
    IO (Ptr ())

-- Args: [ Arg
--           { argCName = "mem"
--           , argType = TInterface Name { namespace = "Gst" , name = "Memory" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstMemory" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "maxsize"
--           , argType = TBasicType TUInt64
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "size to map" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "flags"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "MapFlags" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "access mode for the memory"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TPtr)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_MemoryMapFunction :: FunPtr C_MemoryMapFunction -> C_MemoryMapFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_MemoryMapFunction ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_MemoryMapFunction
    -> Gst.Memory.Memory
    -- ^ /@mem@/: a t'GI.Gst.Structs.Memory.Memory'
    -> Word64
    -- ^ /@maxsize@/: size to map
    -> [Gst.Flags.MapFlags]
    -- ^ /@flags@/: access mode for the memory
    -> m (Ptr ())
    -- ^ __Returns:__ a pointer to memory of which at least /@maxsize@/ bytes can be
    -- accessed according to the access pattern in /@flags@/.
dynamic_MemoryMapFunction :: FunPtr C_MemoryMapFunction
-> Memory -> Word64 -> [MapFlags] -> m (Ptr ())
dynamic_MemoryMapFunction FunPtr C_MemoryMapFunction
__funPtr Memory
mem Word64
maxsize [MapFlags]
flags = IO (Ptr ()) -> m (Ptr ())
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
forall a b. (a -> b) -> a -> b
$ do
    Ptr Memory
mem' <- Memory -> IO (Ptr Memory)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Memory
mem
    let flags' :: CUInt
flags' = [MapFlags] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [MapFlags]
flags
    Ptr ()
result <- (FunPtr C_MemoryMapFunction -> C_MemoryMapFunction
__dynamic_C_MemoryMapFunction FunPtr C_MemoryMapFunction
__funPtr) Ptr Memory
mem' Word64
maxsize CUInt
flags'
    Memory -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Memory
mem
    Ptr () -> IO (Ptr ())
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ()
result

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

-- | Get the memory of /@mem@/ that can be accessed according to the mode specified
-- in /@flags@/. The function should return a pointer that contains at least
-- /@maxsize@/ bytes.
type MemoryMapFunction =
    Gst.Memory.Memory
    -- ^ /@mem@/: a t'GI.Gst.Structs.Memory.Memory'
    -> Word64
    -- ^ /@maxsize@/: size to map
    -> [Gst.Flags.MapFlags]
    -- ^ /@flags@/: access mode for the memory
    -> IO (Ptr ())
    -- ^ __Returns:__ a pointer to memory of which at least /@maxsize@/ bytes can be
    -- accessed according to the access pattern in /@flags@/.

-- | A convenience synonym for @`Nothing` :: `Maybe` `MemoryMapFunction`@.
noMemoryMapFunction :: Maybe MemoryMapFunction
noMemoryMapFunction :: Maybe MemoryMapFunction
noMemoryMapFunction = Maybe MemoryMapFunction
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_MemoryMapFunction :: MonadIO m => MemoryMapFunction -> m (GClosure C_MemoryMapFunction)
genClosure_MemoryMapFunction :: MemoryMapFunction -> m (GClosure C_MemoryMapFunction)
genClosure_MemoryMapFunction MemoryMapFunction
cb = IO (GClosure C_MemoryMapFunction)
-> m (GClosure C_MemoryMapFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_MemoryMapFunction)
 -> m (GClosure C_MemoryMapFunction))
-> IO (GClosure C_MemoryMapFunction)
-> m (GClosure C_MemoryMapFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_MemoryMapFunction
cb' = Maybe (Ptr (FunPtr C_MemoryMapFunction))
-> MemoryMapFunction -> C_MemoryMapFunction
wrap_MemoryMapFunction Maybe (Ptr (FunPtr C_MemoryMapFunction))
forall a. Maybe a
Nothing MemoryMapFunction
cb
    C_MemoryMapFunction -> IO (FunPtr C_MemoryMapFunction)
mk_MemoryMapFunction C_MemoryMapFunction
cb' IO (FunPtr C_MemoryMapFunction)
-> (FunPtr C_MemoryMapFunction
    -> IO (GClosure C_MemoryMapFunction))
-> IO (GClosure C_MemoryMapFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_MemoryMapFunction -> IO (GClosure C_MemoryMapFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `MemoryMapFunction` into a `C_MemoryMapFunction`.
wrap_MemoryMapFunction ::
    Maybe (Ptr (FunPtr C_MemoryMapFunction)) ->
    MemoryMapFunction ->
    C_MemoryMapFunction
wrap_MemoryMapFunction :: Maybe (Ptr (FunPtr C_MemoryMapFunction))
-> MemoryMapFunction -> C_MemoryMapFunction
wrap_MemoryMapFunction Maybe (Ptr (FunPtr C_MemoryMapFunction))
funptrptr MemoryMapFunction
_cb Ptr Memory
mem Word64
maxsize CUInt
flags = do
    (ManagedPtr Memory -> Memory)
-> Ptr Memory -> (Memory -> IO (Ptr ())) -> IO (Ptr ())
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Memory -> Memory
Gst.Memory.Memory Ptr Memory
mem ((Memory -> IO (Ptr ())) -> IO (Ptr ()))
-> (Memory -> IO (Ptr ())) -> IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ \Memory
mem' -> do
        let flags' :: [MapFlags]
flags' = CUInt -> [MapFlags]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
flags
        Ptr ()
result <- MemoryMapFunction
_cb  Memory
mem' Word64
maxsize [MapFlags]
flags'
        Maybe (Ptr (FunPtr C_MemoryMapFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_MemoryMapFunction))
funptrptr
        Ptr () -> IO (Ptr ())
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ()
result


-- callback MemoryMapFullFunction
{- Callable
  { returnType = Just (TBasicType TPtr)
  , returnMayBeNull = True
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just
              "a pointer to memory of which at least @maxsize bytes can be\naccessed according to the access pattern in @info's flags."
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "mem"
          , argType = TInterface Name { namespace = "Gst" , name = "Memory" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GstMemory" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "info"
          , argType =
              TInterface Name { namespace = "Gst" , name = "MapInfo" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the #GstMapInfo to map with"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "maxsize"
          , argType = TBasicType TUInt64
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "size to map" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Get the memory of @mem that can be accessed according to the mode specified\nin @info's flags. The function should return a pointer that contains at least\n@maxsize bytes."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_MemoryMapFullFunction =
    Ptr Gst.Memory.Memory ->
    Ptr Gst.MapInfo.MapInfo ->
    Word64 ->
    IO (Ptr ())

-- Args: [ Arg
--           { argCName = "mem"
--           , argType = TInterface Name { namespace = "Gst" , name = "Memory" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstMemory" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "info"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "MapInfo" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GstMapInfo to map with"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "maxsize"
--           , argType = TBasicType TUInt64
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "size to map" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TPtr)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_MemoryMapFullFunction :: FunPtr C_MemoryMapFullFunction -> C_MemoryMapFullFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_MemoryMapFullFunction ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_MemoryMapFullFunction
    -> Gst.Memory.Memory
    -- ^ /@mem@/: a t'GI.Gst.Structs.Memory.Memory'
    -> Gst.MapInfo.MapInfo
    -- ^ /@info@/: the t'GI.Gst.Structs.MapInfo.MapInfo' to map with
    -> Word64
    -- ^ /@maxsize@/: size to map
    -> m (Ptr ())
    -- ^ __Returns:__ a pointer to memory of which at least /@maxsize@/ bytes can be
    -- accessed according to the access pattern in /@info@/\'s flags.
dynamic_MemoryMapFullFunction :: FunPtr C_MemoryMapFullFunction
-> Memory -> MapInfo -> Word64 -> m (Ptr ())
dynamic_MemoryMapFullFunction FunPtr C_MemoryMapFullFunction
__funPtr Memory
mem MapInfo
info Word64
maxsize = IO (Ptr ()) -> m (Ptr ())
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
forall a b. (a -> b) -> a -> b
$ do
    Ptr Memory
mem' <- Memory -> IO (Ptr Memory)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Memory
mem
    Ptr MapInfo
info' <- MapInfo -> IO (Ptr MapInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr MapInfo
info
    Ptr ()
result <- (FunPtr C_MemoryMapFullFunction -> C_MemoryMapFullFunction
__dynamic_C_MemoryMapFullFunction FunPtr C_MemoryMapFullFunction
__funPtr) Ptr Memory
mem' Ptr MapInfo
info' Word64
maxsize
    Memory -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Memory
mem
    MapInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr MapInfo
info
    Ptr () -> IO (Ptr ())
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ()
result

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

-- | Get the memory of /@mem@/ that can be accessed according to the mode specified
-- in /@info@/\'s flags. The function should return a pointer that contains at least
-- /@maxsize@/ bytes.
type MemoryMapFullFunction =
    Gst.Memory.Memory
    -- ^ /@mem@/: a t'GI.Gst.Structs.Memory.Memory'
    -> Gst.MapInfo.MapInfo
    -- ^ /@info@/: the t'GI.Gst.Structs.MapInfo.MapInfo' to map with
    -> Word64
    -- ^ /@maxsize@/: size to map
    -> IO (Ptr ())
    -- ^ __Returns:__ a pointer to memory of which at least /@maxsize@/ bytes can be
    -- accessed according to the access pattern in /@info@/\'s flags.

-- | A convenience synonym for @`Nothing` :: `Maybe` `MemoryMapFullFunction`@.
noMemoryMapFullFunction :: Maybe MemoryMapFullFunction
noMemoryMapFullFunction :: Maybe MemoryMapFullFunction
noMemoryMapFullFunction = Maybe MemoryMapFullFunction
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_MemoryMapFullFunction :: MonadIO m => MemoryMapFullFunction -> m (GClosure C_MemoryMapFullFunction)
genClosure_MemoryMapFullFunction :: MemoryMapFullFunction -> m (GClosure C_MemoryMapFullFunction)
genClosure_MemoryMapFullFunction MemoryMapFullFunction
cb = IO (GClosure C_MemoryMapFullFunction)
-> m (GClosure C_MemoryMapFullFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_MemoryMapFullFunction)
 -> m (GClosure C_MemoryMapFullFunction))
-> IO (GClosure C_MemoryMapFullFunction)
-> m (GClosure C_MemoryMapFullFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_MemoryMapFullFunction
cb' = Maybe (Ptr (FunPtr C_MemoryMapFullFunction))
-> MemoryMapFullFunction -> C_MemoryMapFullFunction
wrap_MemoryMapFullFunction Maybe (Ptr (FunPtr C_MemoryMapFullFunction))
forall a. Maybe a
Nothing MemoryMapFullFunction
cb
    C_MemoryMapFullFunction -> IO (FunPtr C_MemoryMapFullFunction)
mk_MemoryMapFullFunction C_MemoryMapFullFunction
cb' IO (FunPtr C_MemoryMapFullFunction)
-> (FunPtr C_MemoryMapFullFunction
    -> IO (GClosure C_MemoryMapFullFunction))
-> IO (GClosure C_MemoryMapFullFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_MemoryMapFullFunction
-> IO (GClosure C_MemoryMapFullFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `MemoryMapFullFunction` into a `C_MemoryMapFullFunction`.
wrap_MemoryMapFullFunction ::
    Maybe (Ptr (FunPtr C_MemoryMapFullFunction)) ->
    MemoryMapFullFunction ->
    C_MemoryMapFullFunction
wrap_MemoryMapFullFunction :: Maybe (Ptr (FunPtr C_MemoryMapFullFunction))
-> MemoryMapFullFunction -> C_MemoryMapFullFunction
wrap_MemoryMapFullFunction Maybe (Ptr (FunPtr C_MemoryMapFullFunction))
funptrptr MemoryMapFullFunction
_cb Ptr Memory
mem Ptr MapInfo
info Word64
maxsize = do
    (ManagedPtr Memory -> Memory)
-> Ptr Memory -> (Memory -> IO (Ptr ())) -> IO (Ptr ())
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Memory -> Memory
Gst.Memory.Memory Ptr Memory
mem ((Memory -> IO (Ptr ())) -> IO (Ptr ()))
-> (Memory -> IO (Ptr ())) -> IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ \Memory
mem' -> do
        MapInfo
info' <- ((ManagedPtr MapInfo -> MapInfo) -> Ptr MapInfo -> IO MapInfo
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr MapInfo -> MapInfo
Gst.MapInfo.MapInfo) Ptr MapInfo
info
        Ptr ()
result <- MemoryMapFullFunction
_cb  Memory
mem' MapInfo
info' Word64
maxsize
        Maybe (Ptr (FunPtr C_MemoryMapFullFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_MemoryMapFullFunction))
funptrptr
        Ptr () -> IO (Ptr ())
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ()
result


-- callback MemoryIsSpanFunction
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just "%TRUE if @mem1 and @mem2 are in contiguous memory."
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "mem1"
          , argType = TInterface Name { namespace = "Gst" , name = "Memory" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GstMemory" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "mem2"
          , argType = TInterface Name { namespace = "Gst" , name = "Memory" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GstMemory" , 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 "a result offset" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Check if @mem1 and @mem2 occupy contiguous memory and return the offset of\n@mem1 in the parent buffer in @offset."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_MemoryIsSpanFunction =
    Ptr Gst.Memory.Memory ->
    Ptr Gst.Memory.Memory ->
    Word64 ->
    IO CInt

-- Args: [ Arg
--           { argCName = "mem1"
--           , argType = TInterface Name { namespace = "Gst" , name = "Memory" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstMemory" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "mem2"
--           , argType = TInterface Name { namespace = "Gst" , name = "Memory" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstMemory" , 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 "a result offset" , 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_MemoryIsSpanFunction :: FunPtr C_MemoryIsSpanFunction -> C_MemoryIsSpanFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_MemoryIsSpanFunction ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_MemoryIsSpanFunction
    -> Gst.Memory.Memory
    -- ^ /@mem1@/: a t'GI.Gst.Structs.Memory.Memory'
    -> Gst.Memory.Memory
    -- ^ /@mem2@/: a t'GI.Gst.Structs.Memory.Memory'
    -> Word64
    -- ^ /@offset@/: a result offset
    -> m Bool
    -- ^ __Returns:__ 'P.True' if /@mem1@/ and /@mem2@/ are in contiguous memory.
dynamic_MemoryIsSpanFunction :: FunPtr C_MemoryIsSpanFunction
-> Memory -> Memory -> Word64 -> m Bool
dynamic_MemoryIsSpanFunction FunPtr C_MemoryIsSpanFunction
__funPtr Memory
mem1 Memory
mem2 Word64
offset = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Memory
mem1' <- Memory -> IO (Ptr Memory)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Memory
mem1
    Ptr Memory
mem2' <- Memory -> IO (Ptr Memory)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Memory
mem2
    CInt
result <- (FunPtr C_MemoryIsSpanFunction -> C_MemoryIsSpanFunction
__dynamic_C_MemoryIsSpanFunction FunPtr C_MemoryIsSpanFunction
__funPtr) Ptr Memory
mem1' Ptr Memory
mem2' Word64
offset
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Memory -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Memory
mem1
    Memory -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Memory
mem2
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

-- | Check if /@mem1@/ and /@mem2@/ occupy contiguous memory and return the offset of
-- /@mem1@/ in the parent buffer in /@offset@/.
type MemoryIsSpanFunction =
    Gst.Memory.Memory
    -- ^ /@mem1@/: a t'GI.Gst.Structs.Memory.Memory'
    -> Gst.Memory.Memory
    -- ^ /@mem2@/: a t'GI.Gst.Structs.Memory.Memory'
    -> Word64
    -- ^ /@offset@/: a result offset
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if /@mem1@/ and /@mem2@/ are in contiguous memory.

-- | A convenience synonym for @`Nothing` :: `Maybe` `MemoryIsSpanFunction`@.
noMemoryIsSpanFunction :: Maybe MemoryIsSpanFunction
noMemoryIsSpanFunction :: Maybe MemoryIsSpanFunction
noMemoryIsSpanFunction = Maybe MemoryIsSpanFunction
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_MemoryIsSpanFunction :: MonadIO m => MemoryIsSpanFunction -> m (GClosure C_MemoryIsSpanFunction)
genClosure_MemoryIsSpanFunction :: MemoryIsSpanFunction -> m (GClosure C_MemoryIsSpanFunction)
genClosure_MemoryIsSpanFunction MemoryIsSpanFunction
cb = IO (GClosure C_MemoryIsSpanFunction)
-> m (GClosure C_MemoryIsSpanFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_MemoryIsSpanFunction)
 -> m (GClosure C_MemoryIsSpanFunction))
-> IO (GClosure C_MemoryIsSpanFunction)
-> m (GClosure C_MemoryIsSpanFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_MemoryIsSpanFunction
cb' = Maybe (Ptr (FunPtr C_MemoryIsSpanFunction))
-> MemoryIsSpanFunction -> C_MemoryIsSpanFunction
wrap_MemoryIsSpanFunction Maybe (Ptr (FunPtr C_MemoryIsSpanFunction))
forall a. Maybe a
Nothing MemoryIsSpanFunction
cb
    C_MemoryIsSpanFunction -> IO (FunPtr C_MemoryIsSpanFunction)
mk_MemoryIsSpanFunction C_MemoryIsSpanFunction
cb' IO (FunPtr C_MemoryIsSpanFunction)
-> (FunPtr C_MemoryIsSpanFunction
    -> IO (GClosure C_MemoryIsSpanFunction))
-> IO (GClosure C_MemoryIsSpanFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_MemoryIsSpanFunction
-> IO (GClosure C_MemoryIsSpanFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `MemoryIsSpanFunction` into a `C_MemoryIsSpanFunction`.
wrap_MemoryIsSpanFunction ::
    Maybe (Ptr (FunPtr C_MemoryIsSpanFunction)) ->
    MemoryIsSpanFunction ->
    C_MemoryIsSpanFunction
wrap_MemoryIsSpanFunction :: Maybe (Ptr (FunPtr C_MemoryIsSpanFunction))
-> MemoryIsSpanFunction -> C_MemoryIsSpanFunction
wrap_MemoryIsSpanFunction Maybe (Ptr (FunPtr C_MemoryIsSpanFunction))
funptrptr MemoryIsSpanFunction
_cb Ptr Memory
mem1 Ptr Memory
mem2 Word64
offset = do
    (ManagedPtr Memory -> Memory)
-> Ptr Memory -> (Memory -> IO CInt) -> IO CInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Memory -> Memory
Gst.Memory.Memory Ptr Memory
mem1 ((Memory -> IO CInt) -> IO CInt) -> (Memory -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Memory
mem1' -> do
        (ManagedPtr Memory -> Memory)
-> Ptr Memory -> (Memory -> IO CInt) -> IO CInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Memory -> Memory
Gst.Memory.Memory Ptr Memory
mem2 ((Memory -> IO CInt) -> IO CInt) -> (Memory -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Memory
mem2' -> do
            Bool
result <- MemoryIsSpanFunction
_cb  Memory
mem1' Memory
mem2' Word64
offset
            Maybe (Ptr (FunPtr C_MemoryIsSpanFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_MemoryIsSpanFunction))
funptrptr
            let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
            CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback MemoryCopyFunction
{- Callable
  { returnType =
      Just (TInterface Name { namespace = "Gst" , name = "Memory" })
  , returnMayBeNull = False
  , returnTransfer = TransferEverything
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just
              "a new #GstMemory object wrapping a copy of the requested region in\n@mem."
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "mem"
          , argType = TInterface Name { namespace = "Gst" , name = "Memory" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GstMemory" , 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 = Just "an offset" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "size"
          , argType = TBasicType TInt64
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a size or -1" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Copy @size bytes from @mem starting at @offset and return them wrapped in a\nnew GstMemory object.\nIf @size is set to -1, all bytes starting at @offset are copied."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_MemoryCopyFunction =
    Ptr Gst.Memory.Memory ->
    Int64 ->
    Int64 ->
    IO (Ptr Gst.Memory.Memory)

-- Args: [ Arg
--           { argCName = "mem"
--           , argType = TInterface Name { namespace = "Gst" , name = "Memory" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstMemory" , 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 = Just "an offset" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "size"
--           , argType = TBasicType TInt64
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a size or -1" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gst" , name = "Memory" })
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_MemoryCopyFunction :: FunPtr C_MemoryCopyFunction -> C_MemoryCopyFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_MemoryCopyFunction ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_MemoryCopyFunction
    -> Gst.Memory.Memory
    -- ^ /@mem@/: a t'GI.Gst.Structs.Memory.Memory'
    -> Int64
    -- ^ /@offset@/: an offset
    -> Int64
    -- ^ /@size@/: a size or -1
    -> m Gst.Memory.Memory
    -- ^ __Returns:__ a new t'GI.Gst.Structs.Memory.Memory' object wrapping a copy of the requested region in
    -- /@mem@/.
dynamic_MemoryCopyFunction :: FunPtr C_MemoryShareFunction
-> Memory -> Int64 -> Int64 -> m Memory
dynamic_MemoryCopyFunction FunPtr C_MemoryShareFunction
__funPtr Memory
mem Int64
offset Int64
size = IO Memory -> m Memory
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Memory -> m Memory) -> IO Memory -> m Memory
forall a b. (a -> b) -> a -> b
$ do
    Ptr Memory
mem' <- Memory -> IO (Ptr Memory)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Memory
mem
    Ptr Memory
result <- (FunPtr C_MemoryShareFunction -> C_MemoryShareFunction
__dynamic_C_MemoryCopyFunction FunPtr C_MemoryShareFunction
__funPtr) Ptr Memory
mem' Int64
offset Int64
size
    Text -> C_MemoryUnmapFunction
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"memoryCopyFunction" Ptr Memory
result
    Memory
result' <- ((ManagedPtr Memory -> Memory) -> Ptr Memory -> IO Memory
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Memory -> Memory
Gst.Memory.Memory) Ptr Memory
result
    Memory -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Memory
mem
    Memory -> IO Memory
forall (m :: * -> *) a. Monad m => a -> m a
return Memory
result'

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

-- | Copy /@size@/ bytes from /@mem@/ starting at /@offset@/ and return them wrapped in a
-- new GstMemory object.
-- If /@size@/ is set to -1, all bytes starting at /@offset@/ are copied.
type MemoryCopyFunction =
    Gst.Memory.Memory
    -- ^ /@mem@/: a t'GI.Gst.Structs.Memory.Memory'
    -> Int64
    -- ^ /@offset@/: an offset
    -> Int64
    -- ^ /@size@/: a size or -1
    -> IO Gst.Memory.Memory
    -- ^ __Returns:__ a new t'GI.Gst.Structs.Memory.Memory' object wrapping a copy of the requested region in
    -- /@mem@/.

-- | A convenience synonym for @`Nothing` :: `Maybe` `MemoryCopyFunction`@.
noMemoryCopyFunction :: Maybe MemoryCopyFunction
noMemoryCopyFunction :: Maybe MemoryShareFunction
noMemoryCopyFunction = Maybe MemoryShareFunction
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_MemoryCopyFunction :: MonadIO m => MemoryCopyFunction -> m (GClosure C_MemoryCopyFunction)
genClosure_MemoryCopyFunction :: MemoryShareFunction -> m (GClosure C_MemoryShareFunction)
genClosure_MemoryCopyFunction MemoryShareFunction
cb = IO (GClosure C_MemoryShareFunction)
-> m (GClosure C_MemoryShareFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_MemoryShareFunction)
 -> m (GClosure C_MemoryShareFunction))
-> IO (GClosure C_MemoryShareFunction)
-> m (GClosure C_MemoryShareFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_MemoryShareFunction
cb' = Maybe (Ptr (FunPtr C_MemoryShareFunction))
-> MemoryShareFunction -> C_MemoryShareFunction
wrap_MemoryCopyFunction Maybe (Ptr (FunPtr C_MemoryShareFunction))
forall a. Maybe a
Nothing MemoryShareFunction
cb
    C_MemoryShareFunction -> IO (FunPtr C_MemoryShareFunction)
mk_MemoryCopyFunction C_MemoryShareFunction
cb' IO (FunPtr C_MemoryShareFunction)
-> (FunPtr C_MemoryShareFunction
    -> IO (GClosure C_MemoryShareFunction))
-> IO (GClosure C_MemoryShareFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_MemoryShareFunction -> IO (GClosure C_MemoryShareFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `MemoryCopyFunction` into a `C_MemoryCopyFunction`.
wrap_MemoryCopyFunction ::
    Maybe (Ptr (FunPtr C_MemoryCopyFunction)) ->
    MemoryCopyFunction ->
    C_MemoryCopyFunction
wrap_MemoryCopyFunction :: Maybe (Ptr (FunPtr C_MemoryShareFunction))
-> MemoryShareFunction -> C_MemoryShareFunction
wrap_MemoryCopyFunction Maybe (Ptr (FunPtr C_MemoryShareFunction))
funptrptr MemoryShareFunction
_cb Ptr Memory
mem Int64
offset Int64
size = do
    (ManagedPtr Memory -> Memory)
-> Ptr Memory -> (Memory -> IO (Ptr Memory)) -> IO (Ptr Memory)
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Memory -> Memory
Gst.Memory.Memory Ptr Memory
mem ((Memory -> IO (Ptr Memory)) -> IO (Ptr Memory))
-> (Memory -> IO (Ptr Memory)) -> IO (Ptr Memory)
forall a b. (a -> b) -> a -> b
$ \Memory
mem' -> do
        Memory
result <- MemoryShareFunction
_cb  Memory
mem' Int64
offset Int64
size
        Maybe (Ptr (FunPtr C_MemoryShareFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_MemoryShareFunction))
funptrptr
        Ptr Memory
result' <- Memory -> IO (Ptr Memory)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Memory
result
        Ptr Memory -> IO (Ptr Memory)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Memory
result'


-- callback LogFunction
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "category"
          , argType =
              TInterface Name { namespace = "Gst" , name = "DebugCategory" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GstDebugCategory"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "level"
          , argType =
              TInterface Name { namespace = "Gst" , name = "DebugLevel" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GstDebugLevel" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "file"
          , argType = TBasicType TUTF8
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "file name" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "function"
          , argType = TBasicType TUTF8
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "function name" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "line"
          , argType = TBasicType TInt
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "line number" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "object"
          , argType =
              TInterface Name { namespace = "GObject" , name = "Object" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GObject" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "message"
          , argType =
              TInterface Name { namespace = "Gst" , name = "DebugMessage" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the message" , 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 for the log function"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 7
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Function prototype for a logging function that can be registered with\ngst_debug_add_log_function().\nUse G_GNUC_NO_INSTRUMENT on that function."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_LogFunction =
    Ptr Gst.DebugCategory.DebugCategory ->
    CUInt ->
    CString ->
    CString ->
    Int32 ->
    Ptr GObject.Object.Object ->
    Ptr Gst.DebugMessage.DebugMessage ->
    Ptr () ->
    IO ()

-- Args: [ Arg
--           { argCName = "category"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "DebugCategory" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstDebugCategory"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "level"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "DebugLevel" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstDebugLevel" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "file"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "file name" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "function"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "function name" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "line"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "line number" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "object"
--           , argType =
--               TInterface Name { namespace = "GObject" , name = "Object" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GObject" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "message"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "DebugMessage" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the message" , 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 for the log function"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 7
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_LogFunction :: FunPtr C_LogFunction -> C_LogFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_LogFunction ::
    (B.CallStack.HasCallStack, MonadIO m, GObject.Object.IsObject a) =>
    FunPtr C_LogFunction
    -> Gst.DebugCategory.DebugCategory
    -- ^ /@category@/: a t'GI.Gst.Structs.DebugCategory.DebugCategory'
    -> Gst.Enums.DebugLevel
    -- ^ /@level@/: a t'GI.Gst.Enums.DebugLevel'
    -> T.Text
    -- ^ /@file@/: file name
    -> T.Text
    -- ^ /@function@/: function name
    -> Int32
    -- ^ /@line@/: line number
    -> a
    -- ^ /@object@/: a t'GI.GObject.Objects.Object.Object'
    -> Gst.DebugMessage.DebugMessage
    -- ^ /@message@/: the message
    -> Ptr ()
    -- ^ /@userData@/: user data for the log function
    -> m ()
dynamic_LogFunction :: FunPtr C_LogFunction
-> DebugCategory
-> DebugLevel
-> Text
-> Text
-> Int32
-> a
-> DebugMessage
-> Ptr ()
-> m ()
dynamic_LogFunction FunPtr C_LogFunction
__funPtr DebugCategory
category DebugLevel
level Text
file Text
function Int32
line a
object DebugMessage
message Ptr ()
userData = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr DebugCategory
category' <- DebugCategory -> IO (Ptr DebugCategory)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DebugCategory
category
    let level' :: CUInt
level' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (DebugLevel -> Int) -> DebugLevel -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DebugLevel -> Int
forall a. Enum a => a -> Int
fromEnum) DebugLevel
level
    CString
file' <- Text -> IO CString
textToCString Text
file
    CString
function' <- Text -> IO CString
textToCString Text
function
    Ptr Object
object' <- a -> IO (Ptr Object)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
object
    Ptr DebugMessage
message' <- DebugMessage -> IO (Ptr DebugMessage)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DebugMessage
message
    (FunPtr C_LogFunction -> C_LogFunction
__dynamic_C_LogFunction FunPtr C_LogFunction
__funPtr) Ptr DebugCategory
category' CUInt
level' CString
file' CString
function' Int32
line Ptr Object
object' Ptr DebugMessage
message' Ptr ()
userData
    DebugCategory -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DebugCategory
category
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
object
    DebugMessage -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DebugMessage
message
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
file'
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
function'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | Function prototype for a logging function that can be registered with
-- 'GI.Gst.Functions.debugAddLogFunction'.
-- Use G_GNUC_NO_INSTRUMENT on that function.
type LogFunction =
    Gst.DebugCategory.DebugCategory
    -- ^ /@category@/: a t'GI.Gst.Structs.DebugCategory.DebugCategory'
    -> Gst.Enums.DebugLevel
    -- ^ /@level@/: a t'GI.Gst.Enums.DebugLevel'
    -> T.Text
    -- ^ /@file@/: file name
    -> T.Text
    -- ^ /@function@/: function name
    -> Int32
    -- ^ /@line@/: line number
    -> GObject.Object.Object
    -- ^ /@object@/: a t'GI.GObject.Objects.Object.Object'
    -> Gst.DebugMessage.DebugMessage
    -- ^ /@message@/: the message
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `LogFunction`@.
noLogFunction :: Maybe LogFunction
noLogFunction :: Maybe LogFunction
noLogFunction = Maybe LogFunction
forall a. Maybe a
Nothing

-- | Function prototype for a logging function that can be registered with
-- 'GI.Gst.Functions.debugAddLogFunction'.
-- Use G_GNUC_NO_INSTRUMENT on that function.
type LogFunction_WithClosures =
    Gst.DebugCategory.DebugCategory
    -- ^ /@category@/: a t'GI.Gst.Structs.DebugCategory.DebugCategory'
    -> Gst.Enums.DebugLevel
    -- ^ /@level@/: a t'GI.Gst.Enums.DebugLevel'
    -> T.Text
    -- ^ /@file@/: file name
    -> T.Text
    -- ^ /@function@/: function name
    -> Int32
    -- ^ /@line@/: line number
    -> GObject.Object.Object
    -- ^ /@object@/: a t'GI.GObject.Objects.Object.Object'
    -> Gst.DebugMessage.DebugMessage
    -- ^ /@message@/: the message
    -> Ptr ()
    -- ^ /@userData@/: user data for the log function
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `LogFunction_WithClosures`@.
noLogFunction_WithClosures :: Maybe LogFunction_WithClosures
noLogFunction_WithClosures :: Maybe LogFunction_WithClosures
noLogFunction_WithClosures = Maybe LogFunction_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_LogFunction :: LogFunction -> LogFunction_WithClosures
drop_closures_LogFunction :: LogFunction -> LogFunction_WithClosures
drop_closures_LogFunction LogFunction
_f DebugCategory
category DebugLevel
level Text
file Text
function Int32
line Object
object DebugMessage
message Ptr ()
_ = LogFunction
_f DebugCategory
category DebugLevel
level Text
file Text
function Int32
line Object
object DebugMessage
message

-- | Wrap the callback into a `GClosure`.
genClosure_LogFunction :: MonadIO m => LogFunction -> m (GClosure C_LogFunction)
genClosure_LogFunction :: LogFunction -> m (GClosure C_LogFunction)
genClosure_LogFunction LogFunction
cb = IO (GClosure C_LogFunction) -> m (GClosure C_LogFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_LogFunction) -> m (GClosure C_LogFunction))
-> IO (GClosure C_LogFunction) -> m (GClosure C_LogFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: LogFunction_WithClosures
cb' = LogFunction -> LogFunction_WithClosures
drop_closures_LogFunction LogFunction
cb
    let cb'' :: C_LogFunction
cb'' = Maybe (Ptr (FunPtr C_LogFunction))
-> LogFunction_WithClosures -> C_LogFunction
wrap_LogFunction Maybe (Ptr (FunPtr C_LogFunction))
forall a. Maybe a
Nothing LogFunction_WithClosures
cb'
    C_LogFunction -> IO (FunPtr C_LogFunction)
mk_LogFunction C_LogFunction
cb'' IO (FunPtr C_LogFunction)
-> (FunPtr C_LogFunction -> IO (GClosure C_LogFunction))
-> IO (GClosure C_LogFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_LogFunction -> IO (GClosure C_LogFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `LogFunction` into a `C_LogFunction`.
wrap_LogFunction ::
    Maybe (Ptr (FunPtr C_LogFunction)) ->
    LogFunction_WithClosures ->
    C_LogFunction
wrap_LogFunction :: Maybe (Ptr (FunPtr C_LogFunction))
-> LogFunction_WithClosures -> C_LogFunction
wrap_LogFunction Maybe (Ptr (FunPtr C_LogFunction))
funptrptr LogFunction_WithClosures
_cb Ptr DebugCategory
category CUInt
level CString
file CString
function Int32
line Ptr Object
object Ptr DebugMessage
message Ptr ()
userData = do
    DebugCategory
category' <- ((ManagedPtr DebugCategory -> DebugCategory)
-> Ptr DebugCategory -> IO DebugCategory
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr DebugCategory -> DebugCategory
Gst.DebugCategory.DebugCategory) Ptr DebugCategory
category
    let level' :: DebugLevel
level' = (Int -> DebugLevel
forall a. Enum a => Int -> a
toEnum (Int -> DebugLevel) -> (CUInt -> Int) -> CUInt -> DebugLevel
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
level
    Text
file' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
file
    Text
function' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
function
    Object
object' <- ((ManagedPtr Object -> Object) -> Ptr Object -> IO Object
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Object -> Object
GObject.Object.Object) Ptr Object
object
    DebugMessage
message' <- ((ManagedPtr DebugMessage -> DebugMessage)
-> Ptr DebugMessage -> IO DebugMessage
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr DebugMessage -> DebugMessage
Gst.DebugMessage.DebugMessage) Ptr DebugMessage
message
    LogFunction_WithClosures
_cb  DebugCategory
category' DebugLevel
level' Text
file' Text
function' Int32
line Object
object' DebugMessage
message' Ptr ()
userData
    Maybe (Ptr (FunPtr C_LogFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_LogFunction))
funptrptr


-- callback IteratorResyncFunction
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "it"
          , argType =
              TInterface Name { namespace = "Gst" , name = "Iterator" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the iterator" , 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 whenever a concurrent update happened\nto the iterated datastructure. The implementor of the iterator should\nrestart the iterator from the beginning and clean up any state it might\nhave.\n\nImplementors of a #GstIterator should implement this\nfunction and pass it to the constructor of the custom iterator.\nThe function will be called with the iterator lock held."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_IteratorResyncFunction =
    Ptr Gst.Iterator.Iterator ->
    IO ()

-- Args: [ Arg
--           { argCName = "it"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Iterator" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the iterator" , 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_IteratorResyncFunction :: FunPtr C_IteratorResyncFunction -> C_IteratorResyncFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_IteratorResyncFunction ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_IteratorResyncFunction
    -> Gst.Iterator.Iterator
    -- ^ /@it@/: the iterator
    -> m ()
dynamic_IteratorResyncFunction :: FunPtr (Ptr Iterator -> IO ()) -> Iterator -> m ()
dynamic_IteratorResyncFunction FunPtr (Ptr Iterator -> IO ())
__funPtr Iterator
it = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Iterator
it' <- Iterator -> IO (Ptr Iterator)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Iterator
it
    (FunPtr (Ptr Iterator -> IO ()) -> Ptr Iterator -> IO ()
__dynamic_C_IteratorResyncFunction FunPtr (Ptr Iterator -> IO ())
__funPtr) Ptr Iterator
it'
    Iterator -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Iterator
it
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | This function will be called whenever a concurrent update happened
-- to the iterated datastructure. The implementor of the iterator should
-- restart the iterator from the beginning and clean up any state it might
-- have.
-- 
-- Implementors of a t'GI.Gst.Structs.Iterator.Iterator' should implement this
-- function and pass it to the constructor of the custom iterator.
-- The function will be called with the iterator lock held.
type IteratorResyncFunction =
    Gst.Iterator.Iterator
    -- ^ /@it@/: the iterator
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `IteratorResyncFunction`@.
noIteratorResyncFunction :: Maybe IteratorResyncFunction
noIteratorResyncFunction :: Maybe (Iterator -> IO ())
noIteratorResyncFunction = Maybe (Iterator -> IO ())
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_IteratorResyncFunction :: MonadIO m => IteratorResyncFunction -> m (GClosure C_IteratorResyncFunction)
genClosure_IteratorResyncFunction :: (Iterator -> IO ()) -> m (GClosure (Ptr Iterator -> IO ()))
genClosure_IteratorResyncFunction Iterator -> IO ()
cb = IO (GClosure (Ptr Iterator -> IO ()))
-> m (GClosure (Ptr Iterator -> IO ()))
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure (Ptr Iterator -> IO ()))
 -> m (GClosure (Ptr Iterator -> IO ())))
-> IO (GClosure (Ptr Iterator -> IO ()))
-> m (GClosure (Ptr Iterator -> IO ()))
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: Ptr Iterator -> IO ()
cb' = Maybe (Ptr (FunPtr (Ptr Iterator -> IO ())))
-> (Iterator -> IO ()) -> Ptr Iterator -> IO ()
wrap_IteratorResyncFunction Maybe (Ptr (FunPtr (Ptr Iterator -> IO ())))
forall a. Maybe a
Nothing Iterator -> IO ()
cb
    (Ptr Iterator -> IO ()) -> IO (FunPtr (Ptr Iterator -> IO ()))
mk_IteratorResyncFunction Ptr Iterator -> IO ()
cb' IO (FunPtr (Ptr Iterator -> IO ()))
-> (FunPtr (Ptr Iterator -> IO ())
    -> IO (GClosure (Ptr Iterator -> IO ())))
-> IO (GClosure (Ptr Iterator -> IO ()))
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr (Ptr Iterator -> IO ())
-> IO (GClosure (Ptr Iterator -> IO ()))
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `IteratorResyncFunction` into a `C_IteratorResyncFunction`.
wrap_IteratorResyncFunction ::
    Maybe (Ptr (FunPtr C_IteratorResyncFunction)) ->
    IteratorResyncFunction ->
    C_IteratorResyncFunction
wrap_IteratorResyncFunction :: Maybe (Ptr (FunPtr (Ptr Iterator -> IO ())))
-> (Iterator -> IO ()) -> Ptr Iterator -> IO ()
wrap_IteratorResyncFunction Maybe (Ptr (FunPtr (Ptr Iterator -> IO ())))
funptrptr Iterator -> IO ()
_cb Ptr Iterator
it = do
    (ManagedPtr Iterator -> Iterator)
-> Ptr Iterator -> (Iterator -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Iterator -> Iterator
Gst.Iterator.Iterator Ptr Iterator
it ((Iterator -> IO ()) -> IO ()) -> (Iterator -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Iterator
it' -> do
        Iterator -> IO ()
_cb  Iterator
it'
        Maybe (Ptr (FunPtr (Ptr Iterator -> IO ()))) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr (Ptr Iterator -> IO ())))
funptrptr


-- callback IteratorNextFunction
{- Callable
  { returnType =
      Just
        (TInterface Name { namespace = "Gst" , name = "IteratorResult" })
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText = Just "the result of the operation."
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "it"
          , argType =
              TInterface Name { namespace = "Gst" , name = "Iterator" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the iterator" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "result"
          , argType = TGValue
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a pointer to hold the next item"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "The function that will be called when the next element of the iterator\nshould be retrieved.\n\nImplementors of a #GstIterator should implement this\nfunction and pass it to the constructor of the custom iterator.\nThe function will be called with the iterator lock held."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_IteratorNextFunction =
    Ptr Gst.Iterator.Iterator ->
    Ptr GValue ->
    IO CUInt

-- Args: [ Arg
--           { argCName = "it"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Iterator" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the iterator" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "result"
--           , argType = TGValue
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a pointer to hold the next item"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Gst" , name = "IteratorResult" })
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_IteratorNextFunction :: FunPtr C_IteratorNextFunction -> C_IteratorNextFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_IteratorNextFunction ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_IteratorNextFunction
    -> Gst.Iterator.Iterator
    -- ^ /@it@/: the iterator
    -> GValue
    -- ^ /@result@/: a pointer to hold the next item
    -> m Gst.Enums.IteratorResult
    -- ^ __Returns:__ the result of the operation.
dynamic_IteratorNextFunction :: FunPtr C_IteratorNextFunction
-> Iterator -> GValue -> m IteratorResult
dynamic_IteratorNextFunction FunPtr C_IteratorNextFunction
__funPtr Iterator
it GValue
result_ = IO IteratorResult -> m IteratorResult
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO IteratorResult -> m IteratorResult)
-> IO IteratorResult -> m IteratorResult
forall a b. (a -> b) -> a -> b
$ do
    Ptr Iterator
it' <- Iterator -> IO (Ptr Iterator)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Iterator
it
    Ptr GValue
result_' <- GValue -> IO (Ptr GValue)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GValue
result_
    CUInt
result <- (FunPtr C_IteratorNextFunction -> C_IteratorNextFunction
__dynamic_C_IteratorNextFunction FunPtr C_IteratorNextFunction
__funPtr) Ptr Iterator
it' Ptr GValue
result_'
    let result' :: IteratorResult
result' = (Int -> IteratorResult
forall a. Enum a => Int -> a
toEnum (Int -> IteratorResult)
-> (CUInt -> Int) -> CUInt -> IteratorResult
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    Iterator -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Iterator
it
    GValue -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GValue
result_
    Ptr GValue -> IO ()
B.GValue.unsetGValue Ptr GValue
result_'
    IteratorResult -> IO IteratorResult
forall (m :: * -> *) a. Monad m => a -> m a
return IteratorResult
result'

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

-- | The function that will be called when the next element of the iterator
-- should be retrieved.
-- 
-- Implementors of a t'GI.Gst.Structs.Iterator.Iterator' should implement this
-- function and pass it to the constructor of the custom iterator.
-- The function will be called with the iterator lock held.
type IteratorNextFunction =
    Gst.Iterator.Iterator
    -- ^ /@it@/: the iterator
    -> GValue
    -- ^ /@result@/: a pointer to hold the next item
    -> IO Gst.Enums.IteratorResult
    -- ^ __Returns:__ the result of the operation.

-- | A convenience synonym for @`Nothing` :: `Maybe` `IteratorNextFunction`@.
noIteratorNextFunction :: Maybe IteratorNextFunction
noIteratorNextFunction :: Maybe IteratorNextFunction
noIteratorNextFunction = Maybe IteratorNextFunction
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_IteratorNextFunction :: MonadIO m => IteratorNextFunction -> m (GClosure C_IteratorNextFunction)
genClosure_IteratorNextFunction :: IteratorNextFunction -> m (GClosure C_IteratorNextFunction)
genClosure_IteratorNextFunction IteratorNextFunction
cb = IO (GClosure C_IteratorNextFunction)
-> m (GClosure C_IteratorNextFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_IteratorNextFunction)
 -> m (GClosure C_IteratorNextFunction))
-> IO (GClosure C_IteratorNextFunction)
-> m (GClosure C_IteratorNextFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_IteratorNextFunction
cb' = Maybe (Ptr (FunPtr C_IteratorNextFunction))
-> IteratorNextFunction -> C_IteratorNextFunction
wrap_IteratorNextFunction Maybe (Ptr (FunPtr C_IteratorNextFunction))
forall a. Maybe a
Nothing IteratorNextFunction
cb
    C_IteratorNextFunction -> IO (FunPtr C_IteratorNextFunction)
mk_IteratorNextFunction C_IteratorNextFunction
cb' IO (FunPtr C_IteratorNextFunction)
-> (FunPtr C_IteratorNextFunction
    -> IO (GClosure C_IteratorNextFunction))
-> IO (GClosure C_IteratorNextFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_IteratorNextFunction
-> IO (GClosure C_IteratorNextFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `IteratorNextFunction` into a `C_IteratorNextFunction`.
wrap_IteratorNextFunction ::
    Maybe (Ptr (FunPtr C_IteratorNextFunction)) ->
    IteratorNextFunction ->
    C_IteratorNextFunction
wrap_IteratorNextFunction :: Maybe (Ptr (FunPtr C_IteratorNextFunction))
-> IteratorNextFunction -> C_IteratorNextFunction
wrap_IteratorNextFunction Maybe (Ptr (FunPtr C_IteratorNextFunction))
funptrptr IteratorNextFunction
_cb Ptr Iterator
it Ptr GValue
result_ = do
    (ManagedPtr Iterator -> Iterator)
-> Ptr Iterator -> (Iterator -> IO CUInt) -> IO CUInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Iterator -> Iterator
Gst.Iterator.Iterator Ptr Iterator
it ((Iterator -> IO CUInt) -> IO CUInt)
-> (Iterator -> IO CUInt) -> IO CUInt
forall a b. (a -> b) -> a -> b
$ \Iterator
it' -> do
        GValue
result_' <- Ptr GValue -> IO GValue
B.GValue.newGValueFromPtr Ptr GValue
result_
        IteratorResult
result <- IteratorNextFunction
_cb  Iterator
it' GValue
result_'
        Maybe (Ptr (FunPtr C_IteratorNextFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_IteratorNextFunction))
funptrptr
        let result' :: CUInt
result' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt)
-> (IteratorResult -> Int) -> IteratorResult -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IteratorResult -> Int
forall a. Enum a => a -> Int
fromEnum) IteratorResult
result
        CUInt -> IO CUInt
forall (m :: * -> *) a. Monad m => a -> m a
return CUInt
result'


-- callback IteratorItemFunction
{- Callable
  { returnType =
      Just
        (TInterface Name { namespace = "Gst" , name = "IteratorItem" })
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText = Just "the result of the operation."
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "it"
          , argType =
              TInterface Name { namespace = "Gst" , name = "Iterator" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the iterator" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "item"
          , argType = TGValue
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the item being retrieved."
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "The function that will be called after the next item of the iterator\nhas been retrieved. This function can be used to skip items or stop\nthe iterator.\n\nThe function will be called with the iterator lock held."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_IteratorItemFunction =
    Ptr Gst.Iterator.Iterator ->
    Ptr GValue ->
    IO CUInt

-- Args: [ Arg
--           { argCName = "it"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Iterator" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the iterator" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "item"
--           , argType = TGValue
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the item being retrieved."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Gst" , name = "IteratorItem" })
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_IteratorItemFunction :: FunPtr C_IteratorItemFunction -> C_IteratorItemFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_IteratorItemFunction ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_IteratorItemFunction
    -> Gst.Iterator.Iterator
    -- ^ /@it@/: the iterator
    -> GValue
    -- ^ /@item@/: the item being retrieved.
    -> m Gst.Enums.IteratorItem
    -- ^ __Returns:__ the result of the operation.
dynamic_IteratorItemFunction :: FunPtr C_IteratorNextFunction
-> Iterator -> GValue -> m IteratorItem
dynamic_IteratorItemFunction FunPtr C_IteratorNextFunction
__funPtr Iterator
it GValue
item = IO IteratorItem -> m IteratorItem
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO IteratorItem -> m IteratorItem)
-> IO IteratorItem -> m IteratorItem
forall a b. (a -> b) -> a -> b
$ do
    Ptr Iterator
it' <- Iterator -> IO (Ptr Iterator)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Iterator
it
    Ptr GValue
item' <- GValue -> IO (Ptr GValue)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GValue
item
    CUInt
result <- (FunPtr C_IteratorNextFunction -> C_IteratorNextFunction
__dynamic_C_IteratorItemFunction FunPtr C_IteratorNextFunction
__funPtr) Ptr Iterator
it' Ptr GValue
item'
    let result' :: IteratorItem
result' = (Int -> IteratorItem
forall a. Enum a => Int -> a
toEnum (Int -> IteratorItem) -> (CUInt -> Int) -> CUInt -> IteratorItem
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    Iterator -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Iterator
it
    GValue -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GValue
item
    Ptr GValue -> IO ()
B.GValue.unsetGValue Ptr GValue
item'
    IteratorItem -> IO IteratorItem
forall (m :: * -> *) a. Monad m => a -> m a
return IteratorItem
result'

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

-- | The function that will be called after the next item of the iterator
-- has been retrieved. This function can be used to skip items or stop
-- the iterator.
-- 
-- The function will be called with the iterator lock held.
type IteratorItemFunction =
    Gst.Iterator.Iterator
    -- ^ /@it@/: the iterator
    -> GValue
    -- ^ /@item@/: the item being retrieved.
    -> IO Gst.Enums.IteratorItem
    -- ^ __Returns:__ the result of the operation.

-- | A convenience synonym for @`Nothing` :: `Maybe` `IteratorItemFunction`@.
noIteratorItemFunction :: Maybe IteratorItemFunction
noIteratorItemFunction :: Maybe IteratorItemFunction
noIteratorItemFunction = Maybe IteratorItemFunction
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_IteratorItemFunction :: MonadIO m => IteratorItemFunction -> m (GClosure C_IteratorItemFunction)
genClosure_IteratorItemFunction :: IteratorItemFunction -> m (GClosure C_IteratorNextFunction)
genClosure_IteratorItemFunction IteratorItemFunction
cb = IO (GClosure C_IteratorNextFunction)
-> m (GClosure C_IteratorNextFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_IteratorNextFunction)
 -> m (GClosure C_IteratorNextFunction))
-> IO (GClosure C_IteratorNextFunction)
-> m (GClosure C_IteratorNextFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_IteratorNextFunction
cb' = Maybe (Ptr (FunPtr C_IteratorNextFunction))
-> IteratorItemFunction -> C_IteratorNextFunction
wrap_IteratorItemFunction Maybe (Ptr (FunPtr C_IteratorNextFunction))
forall a. Maybe a
Nothing IteratorItemFunction
cb
    C_IteratorNextFunction -> IO (FunPtr C_IteratorNextFunction)
mk_IteratorItemFunction C_IteratorNextFunction
cb' IO (FunPtr C_IteratorNextFunction)
-> (FunPtr C_IteratorNextFunction
    -> IO (GClosure C_IteratorNextFunction))
-> IO (GClosure C_IteratorNextFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_IteratorNextFunction
-> IO (GClosure C_IteratorNextFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `IteratorItemFunction` into a `C_IteratorItemFunction`.
wrap_IteratorItemFunction ::
    Maybe (Ptr (FunPtr C_IteratorItemFunction)) ->
    IteratorItemFunction ->
    C_IteratorItemFunction
wrap_IteratorItemFunction :: Maybe (Ptr (FunPtr C_IteratorNextFunction))
-> IteratorItemFunction -> C_IteratorNextFunction
wrap_IteratorItemFunction Maybe (Ptr (FunPtr C_IteratorNextFunction))
funptrptr IteratorItemFunction
_cb Ptr Iterator
it Ptr GValue
item = do
    (ManagedPtr Iterator -> Iterator)
-> Ptr Iterator -> (Iterator -> IO CUInt) -> IO CUInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Iterator -> Iterator
Gst.Iterator.Iterator Ptr Iterator
it ((Iterator -> IO CUInt) -> IO CUInt)
-> (Iterator -> IO CUInt) -> IO CUInt
forall a b. (a -> b) -> a -> b
$ \Iterator
it' -> do
        GValue
item' <- Ptr GValue -> IO GValue
B.GValue.newGValueFromPtr Ptr GValue
item
        IteratorItem
result <- IteratorItemFunction
_cb  Iterator
it' GValue
item'
        Maybe (Ptr (FunPtr C_IteratorNextFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_IteratorNextFunction))
funptrptr
        let result' :: CUInt
result' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (IteratorItem -> Int) -> IteratorItem -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IteratorItem -> Int
forall a. Enum a => a -> Int
fromEnum) IteratorItem
result
        CUInt -> IO CUInt
forall (m :: * -> *) a. Monad m => a -> m a
return CUInt
result'


-- callback IteratorFreeFunction
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "it"
          , argType =
              TInterface Name { namespace = "Gst" , name = "Iterator" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the iterator" , 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 when the iterator is freed.\n\nImplementors of a #GstIterator should implement this\nfunction and pass it to the constructor of the custom iterator.\nThe function will be called with the iterator lock held."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_IteratorFreeFunction =
    Ptr Gst.Iterator.Iterator ->
    IO ()

-- Args: [ Arg
--           { argCName = "it"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Iterator" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the iterator" , 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_IteratorFreeFunction :: FunPtr C_IteratorFreeFunction -> C_IteratorFreeFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_IteratorFreeFunction ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_IteratorFreeFunction
    -> Gst.Iterator.Iterator
    -- ^ /@it@/: the iterator
    -> m ()
dynamic_IteratorFreeFunction :: FunPtr (Ptr Iterator -> IO ()) -> Iterator -> m ()
dynamic_IteratorFreeFunction FunPtr (Ptr Iterator -> IO ())
__funPtr Iterator
it = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Iterator
it' <- Iterator -> IO (Ptr Iterator)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Iterator
it
    (FunPtr (Ptr Iterator -> IO ()) -> Ptr Iterator -> IO ()
__dynamic_C_IteratorFreeFunction FunPtr (Ptr Iterator -> IO ())
__funPtr) Ptr Iterator
it'
    Iterator -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Iterator
it
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | This function will be called when the iterator is freed.
-- 
-- Implementors of a t'GI.Gst.Structs.Iterator.Iterator' should implement this
-- function and pass it to the constructor of the custom iterator.
-- The function will be called with the iterator lock held.
type IteratorFreeFunction =
    Gst.Iterator.Iterator
    -- ^ /@it@/: the iterator
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `IteratorFreeFunction`@.
noIteratorFreeFunction :: Maybe IteratorFreeFunction
noIteratorFreeFunction :: Maybe (Iterator -> IO ())
noIteratorFreeFunction = Maybe (Iterator -> IO ())
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_IteratorFreeFunction :: MonadIO m => IteratorFreeFunction -> m (GClosure C_IteratorFreeFunction)
genClosure_IteratorFreeFunction :: (Iterator -> IO ()) -> m (GClosure (Ptr Iterator -> IO ()))
genClosure_IteratorFreeFunction Iterator -> IO ()
cb = IO (GClosure (Ptr Iterator -> IO ()))
-> m (GClosure (Ptr Iterator -> IO ()))
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure (Ptr Iterator -> IO ()))
 -> m (GClosure (Ptr Iterator -> IO ())))
-> IO (GClosure (Ptr Iterator -> IO ()))
-> m (GClosure (Ptr Iterator -> IO ()))
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: Ptr Iterator -> IO ()
cb' = Maybe (Ptr (FunPtr (Ptr Iterator -> IO ())))
-> (Iterator -> IO ()) -> Ptr Iterator -> IO ()
wrap_IteratorFreeFunction Maybe (Ptr (FunPtr (Ptr Iterator -> IO ())))
forall a. Maybe a
Nothing Iterator -> IO ()
cb
    (Ptr Iterator -> IO ()) -> IO (FunPtr (Ptr Iterator -> IO ()))
mk_IteratorFreeFunction Ptr Iterator -> IO ()
cb' IO (FunPtr (Ptr Iterator -> IO ()))
-> (FunPtr (Ptr Iterator -> IO ())
    -> IO (GClosure (Ptr Iterator -> IO ())))
-> IO (GClosure (Ptr Iterator -> IO ()))
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr (Ptr Iterator -> IO ())
-> IO (GClosure (Ptr Iterator -> IO ()))
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `IteratorFreeFunction` into a `C_IteratorFreeFunction`.
wrap_IteratorFreeFunction ::
    Maybe (Ptr (FunPtr C_IteratorFreeFunction)) ->
    IteratorFreeFunction ->
    C_IteratorFreeFunction
wrap_IteratorFreeFunction :: Maybe (Ptr (FunPtr (Ptr Iterator -> IO ())))
-> (Iterator -> IO ()) -> Ptr Iterator -> IO ()
wrap_IteratorFreeFunction Maybe (Ptr (FunPtr (Ptr Iterator -> IO ())))
funptrptr Iterator -> IO ()
_cb Ptr Iterator
it = do
    (ManagedPtr Iterator -> Iterator)
-> Ptr Iterator -> (Iterator -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Iterator -> Iterator
Gst.Iterator.Iterator Ptr Iterator
it ((Iterator -> IO ()) -> IO ()) -> (Iterator -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Iterator
it' -> do
        Iterator -> IO ()
_cb  Iterator
it'
        Maybe (Ptr (FunPtr (Ptr Iterator -> IO ()))) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr (Ptr Iterator -> IO ())))
funptrptr


-- callback IteratorForeachFunction
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "item"
          , argType = TGValue
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The item" , 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 =
            Just
              "A function that is called by gst_iterator_foreach() for every element."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_IteratorForeachFunction =
    Ptr GValue ->
    Ptr () ->
    IO ()

-- Args: [ Arg
--           { argCName = "item"
--           , argType = TGValue
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The item" , 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_IteratorForeachFunction :: FunPtr C_IteratorForeachFunction -> C_IteratorForeachFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_IteratorForeachFunction ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_IteratorForeachFunction
    -> GValue
    -- ^ /@item@/: The item
    -> Ptr ()
    -- ^ /@userData@/: User data
    -> m ()
dynamic_IteratorForeachFunction :: FunPtr C_IteratorForeachFunction -> GValue -> Ptr () -> m ()
dynamic_IteratorForeachFunction FunPtr C_IteratorForeachFunction
__funPtr GValue
item Ptr ()
userData = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr GValue
item' <- GValue -> IO (Ptr GValue)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GValue
item
    (FunPtr C_IteratorForeachFunction -> C_IteratorForeachFunction
__dynamic_C_IteratorForeachFunction FunPtr C_IteratorForeachFunction
__funPtr) Ptr GValue
item' Ptr ()
userData
    GValue -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GValue
item
    Ptr GValue -> IO ()
B.GValue.unsetGValue Ptr GValue
item'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | A function that is called by 'GI.Gst.Structs.Iterator.iteratorForeach' for every element.
type IteratorForeachFunction =
    GValue
    -- ^ /@item@/: The item
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `IteratorForeachFunction`@.
noIteratorForeachFunction :: Maybe IteratorForeachFunction
noIteratorForeachFunction :: Maybe (GValue -> IO ())
noIteratorForeachFunction = Maybe (GValue -> IO ())
forall a. Maybe a
Nothing

-- | A function that is called by 'GI.Gst.Structs.Iterator.iteratorForeach' for every element.
type IteratorForeachFunction_WithClosures =
    GValue
    -- ^ /@item@/: The item
    -> Ptr ()
    -- ^ /@userData@/: User data
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `IteratorForeachFunction_WithClosures`@.
noIteratorForeachFunction_WithClosures :: Maybe IteratorForeachFunction_WithClosures
noIteratorForeachFunction_WithClosures :: Maybe IteratorForeachFunction_WithClosures
noIteratorForeachFunction_WithClosures = Maybe IteratorForeachFunction_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_IteratorForeachFunction :: IteratorForeachFunction -> IteratorForeachFunction_WithClosures
drop_closures_IteratorForeachFunction :: (GValue -> IO ()) -> IteratorForeachFunction_WithClosures
drop_closures_IteratorForeachFunction GValue -> IO ()
_f GValue
item Ptr ()
_ = GValue -> IO ()
_f GValue
item

-- | Wrap the callback into a `GClosure`.
genClosure_IteratorForeachFunction :: MonadIO m => IteratorForeachFunction -> m (GClosure C_IteratorForeachFunction)
genClosure_IteratorForeachFunction :: (GValue -> IO ()) -> m (GClosure C_IteratorForeachFunction)
genClosure_IteratorForeachFunction GValue -> IO ()
cb = IO (GClosure C_IteratorForeachFunction)
-> m (GClosure C_IteratorForeachFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_IteratorForeachFunction)
 -> m (GClosure C_IteratorForeachFunction))
-> IO (GClosure C_IteratorForeachFunction)
-> m (GClosure C_IteratorForeachFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: IteratorForeachFunction_WithClosures
cb' = (GValue -> IO ()) -> IteratorForeachFunction_WithClosures
drop_closures_IteratorForeachFunction GValue -> IO ()
cb
    let cb'' :: C_IteratorForeachFunction
cb'' = Maybe (Ptr (FunPtr C_IteratorForeachFunction))
-> IteratorForeachFunction_WithClosures
-> C_IteratorForeachFunction
wrap_IteratorForeachFunction Maybe (Ptr (FunPtr C_IteratorForeachFunction))
forall a. Maybe a
Nothing IteratorForeachFunction_WithClosures
cb'
    C_IteratorForeachFunction -> IO (FunPtr C_IteratorForeachFunction)
mk_IteratorForeachFunction C_IteratorForeachFunction
cb'' IO (FunPtr C_IteratorForeachFunction)
-> (FunPtr C_IteratorForeachFunction
    -> IO (GClosure C_IteratorForeachFunction))
-> IO (GClosure C_IteratorForeachFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_IteratorForeachFunction
-> IO (GClosure C_IteratorForeachFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `IteratorForeachFunction` into a `C_IteratorForeachFunction`.
wrap_IteratorForeachFunction ::
    Maybe (Ptr (FunPtr C_IteratorForeachFunction)) ->
    IteratorForeachFunction_WithClosures ->
    C_IteratorForeachFunction
wrap_IteratorForeachFunction :: Maybe (Ptr (FunPtr C_IteratorForeachFunction))
-> IteratorForeachFunction_WithClosures
-> C_IteratorForeachFunction
wrap_IteratorForeachFunction Maybe (Ptr (FunPtr C_IteratorForeachFunction))
funptrptr IteratorForeachFunction_WithClosures
_cb Ptr GValue
item Ptr ()
userData = do
    GValue
item' <- Ptr GValue -> IO GValue
B.GValue.newGValueFromPtr Ptr GValue
item
    IteratorForeachFunction_WithClosures
_cb  GValue
item' Ptr ()
userData
    Maybe (Ptr (FunPtr C_IteratorForeachFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_IteratorForeachFunction))
funptrptr


-- callback IteratorFoldFunction
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just "%TRUE if the fold should continue, %FALSE if it should stop."
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "item"
          , argType = TGValue
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the item to fold" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "ret"
          , argType = TGValue
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GValue collecting the result"
                , 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 "data passed to gst_iterator_fold()"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 2
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just "A function to be passed to gst_iterator_fold()."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_IteratorFoldFunction =
    Ptr GValue ->
    Ptr GValue ->
    Ptr () ->
    IO CInt

-- Args: [ Arg
--           { argCName = "item"
--           , argType = TGValue
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the item to fold" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "ret"
--           , argType = TGValue
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GValue collecting the result"
--                 , 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 "data passed to gst_iterator_fold()"
--                 , 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_IteratorFoldFunction :: FunPtr C_IteratorFoldFunction -> C_IteratorFoldFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_IteratorFoldFunction ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_IteratorFoldFunction
    -> GValue
    -- ^ /@item@/: the item to fold
    -> GValue
    -- ^ /@ret@/: a t'GI.GObject.Structs.Value.Value' collecting the result
    -> Ptr ()
    -- ^ /@userData@/: data passed to 'GI.Gst.Structs.Iterator.iteratorFold'
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the fold should continue, 'P.False' if it should stop.
dynamic_IteratorFoldFunction :: FunPtr C_IteratorFoldFunction
-> GValue -> GValue -> Ptr () -> m Bool
dynamic_IteratorFoldFunction FunPtr C_IteratorFoldFunction
__funPtr GValue
item GValue
ret Ptr ()
userData = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr GValue
item' <- GValue -> IO (Ptr GValue)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GValue
item
    Ptr GValue
ret' <- GValue -> IO (Ptr GValue)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GValue
ret
    CInt
result <- (FunPtr C_IteratorFoldFunction -> C_IteratorFoldFunction
__dynamic_C_IteratorFoldFunction FunPtr C_IteratorFoldFunction
__funPtr) Ptr GValue
item' Ptr GValue
ret' Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    GValue -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GValue
item
    GValue -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GValue
ret
    Ptr GValue -> IO ()
B.GValue.unsetGValue Ptr GValue
item'
    Ptr GValue -> IO ()
B.GValue.unsetGValue Ptr GValue
ret'
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

-- | A function to be passed to 'GI.Gst.Structs.Iterator.iteratorFold'.
type IteratorFoldFunction =
    GValue
    -- ^ /@item@/: the item to fold
    -> GValue
    -- ^ /@ret@/: a t'GI.GObject.Structs.Value.Value' collecting the result
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the fold should continue, 'P.False' if it should stop.

-- | A convenience synonym for @`Nothing` :: `Maybe` `IteratorFoldFunction`@.
noIteratorFoldFunction :: Maybe IteratorFoldFunction
noIteratorFoldFunction :: Maybe IteratorFoldFunction
noIteratorFoldFunction = Maybe IteratorFoldFunction
forall a. Maybe a
Nothing

-- | A function to be passed to 'GI.Gst.Structs.Iterator.iteratorFold'.
type IteratorFoldFunction_WithClosures =
    GValue
    -- ^ /@item@/: the item to fold
    -> GValue
    -- ^ /@ret@/: a t'GI.GObject.Structs.Value.Value' collecting the result
    -> Ptr ()
    -- ^ /@userData@/: data passed to 'GI.Gst.Structs.Iterator.iteratorFold'
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the fold should continue, 'P.False' if it should stop.

-- | A convenience synonym for @`Nothing` :: `Maybe` `IteratorFoldFunction_WithClosures`@.
noIteratorFoldFunction_WithClosures :: Maybe IteratorFoldFunction_WithClosures
noIteratorFoldFunction_WithClosures :: Maybe IteratorFoldFunction_WithClosures
noIteratorFoldFunction_WithClosures = Maybe IteratorFoldFunction_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_IteratorFoldFunction :: IteratorFoldFunction -> IteratorFoldFunction_WithClosures
drop_closures_IteratorFoldFunction :: IteratorFoldFunction -> IteratorFoldFunction_WithClosures
drop_closures_IteratorFoldFunction IteratorFoldFunction
_f GValue
item GValue
ret Ptr ()
_ = IteratorFoldFunction
_f GValue
item GValue
ret

-- | Wrap the callback into a `GClosure`.
genClosure_IteratorFoldFunction :: MonadIO m => IteratorFoldFunction -> m (GClosure C_IteratorFoldFunction)
genClosure_IteratorFoldFunction :: IteratorFoldFunction -> m (GClosure C_IteratorFoldFunction)
genClosure_IteratorFoldFunction IteratorFoldFunction
cb = IO (GClosure C_IteratorFoldFunction)
-> m (GClosure C_IteratorFoldFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_IteratorFoldFunction)
 -> m (GClosure C_IteratorFoldFunction))
-> IO (GClosure C_IteratorFoldFunction)
-> m (GClosure C_IteratorFoldFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: IteratorFoldFunction_WithClosures
cb' = IteratorFoldFunction -> IteratorFoldFunction_WithClosures
drop_closures_IteratorFoldFunction IteratorFoldFunction
cb
    let cb'' :: C_IteratorFoldFunction
cb'' = Maybe (Ptr (FunPtr C_IteratorFoldFunction))
-> IteratorFoldFunction_WithClosures -> C_IteratorFoldFunction
wrap_IteratorFoldFunction Maybe (Ptr (FunPtr C_IteratorFoldFunction))
forall a. Maybe a
Nothing IteratorFoldFunction_WithClosures
cb'
    C_IteratorFoldFunction -> IO (FunPtr C_IteratorFoldFunction)
mk_IteratorFoldFunction C_IteratorFoldFunction
cb'' IO (FunPtr C_IteratorFoldFunction)
-> (FunPtr C_IteratorFoldFunction
    -> IO (GClosure C_IteratorFoldFunction))
-> IO (GClosure C_IteratorFoldFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_IteratorFoldFunction
-> IO (GClosure C_IteratorFoldFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `IteratorFoldFunction` into a `C_IteratorFoldFunction`.
wrap_IteratorFoldFunction ::
    Maybe (Ptr (FunPtr C_IteratorFoldFunction)) ->
    IteratorFoldFunction_WithClosures ->
    C_IteratorFoldFunction
wrap_IteratorFoldFunction :: Maybe (Ptr (FunPtr C_IteratorFoldFunction))
-> IteratorFoldFunction_WithClosures -> C_IteratorFoldFunction
wrap_IteratorFoldFunction Maybe (Ptr (FunPtr C_IteratorFoldFunction))
funptrptr IteratorFoldFunction_WithClosures
_cb Ptr GValue
item Ptr GValue
ret Ptr ()
userData = do
    GValue
item' <- Ptr GValue -> IO GValue
B.GValue.newGValueFromPtr Ptr GValue
item
    GValue
ret' <- Ptr GValue -> IO GValue
B.GValue.newGValueFromPtr Ptr GValue
ret
    Bool
result <- IteratorFoldFunction_WithClosures
_cb  GValue
item' GValue
ret' Ptr ()
userData
    Maybe (Ptr (FunPtr C_IteratorFoldFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_IteratorFoldFunction))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback IteratorCopyFunction
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "it"
          , argType =
              TInterface Name { namespace = "Gst" , name = "Iterator" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The original iterator"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "copy"
          , argType =
              TInterface Name { namespace = "Gst" , name = "Iterator" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The copied iterator"
                , 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 when creating a copy of @it and should\ncreate a copy of all custom iterator fields or increase their\nreference counts."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_IteratorCopyFunction =
    Ptr Gst.Iterator.Iterator ->
    Ptr Gst.Iterator.Iterator ->
    IO ()

-- Args: [ Arg
--           { argCName = "it"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Iterator" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The original iterator"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "copy"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Iterator" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The copied iterator"
--                 , 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_IteratorCopyFunction :: FunPtr C_IteratorCopyFunction -> C_IteratorCopyFunction

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_IteratorCopyFunction ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_IteratorCopyFunction
    -> Gst.Iterator.Iterator
    -- ^ /@it@/: The original iterator
    -> Gst.Iterator.Iterator
    -- ^ /@copy@/: The copied iterator
    -> m ()
dynamic_IteratorCopyFunction :: FunPtr C_IteratorCopyFunction -> Iterator -> Iterator -> m ()
dynamic_IteratorCopyFunction FunPtr C_IteratorCopyFunction
__funPtr Iterator
it Iterator
copy = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Iterator
it' <- Iterator -> IO (Ptr Iterator)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Iterator
it
    Ptr Iterator
copy' <- Iterator -> IO (Ptr Iterator)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Iterator
copy
    (FunPtr C_IteratorCopyFunction -> C_IteratorCopyFunction
__dynamic_C_IteratorCopyFunction FunPtr C_IteratorCopyFunction
__funPtr) Ptr Iterator
it' Ptr Iterator
copy'
    Iterator -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Iterator
it
    Iterator -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Iterator
copy
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | This function will be called when creating a copy of /@it@/ and should
-- create a copy of all custom iterator fields or increase their
-- reference counts.
type IteratorCopyFunction =
    Gst.Iterator.Iterator
    -- ^ /@it@/: The original iterator
    -> Gst.Iterator.Iterator
    -- ^ /@copy@/: The copied iterator
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `IteratorCopyFunction`@.
noIteratorCopyFunction :: Maybe IteratorCopyFunction
noIteratorCopyFunction :: Maybe IteratorCopyFunction
noIteratorCopyFunction = Maybe IteratorCopyFunction
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_IteratorCopyFunction :: MonadIO m => IteratorCopyFunction -> m (GClosure C_IteratorCopyFunction)
genClosure_IteratorCopyFunction :: IteratorCopyFunction -> m (GClosure C_IteratorCopyFunction)
genClosure_IteratorCopyFunction IteratorCopyFunction
cb = IO (GClosure C_IteratorCopyFunction)
-> m (GClosure C_IteratorCopyFunction)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_IteratorCopyFunction)
 -> m (GClosure C_IteratorCopyFunction))
-> IO (GClosure C_IteratorCopyFunction)
-> m (GClosure C_IteratorCopyFunction)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_IteratorCopyFunction
cb' = Maybe (Ptr (FunPtr C_IteratorCopyFunction))
-> IteratorCopyFunction -> C_IteratorCopyFunction
wrap_IteratorCopyFunction Maybe (Ptr (FunPtr C_IteratorCopyFunction))
forall a. Maybe a
Nothing IteratorCopyFunction
cb
    C_IteratorCopyFunction -> IO (FunPtr C_IteratorCopyFunction)
mk_IteratorCopyFunction C_IteratorCopyFunction
cb' IO (FunPtr C_IteratorCopyFunction)
-> (FunPtr C_IteratorCopyFunction
    -> IO (GClosure C_IteratorCopyFunction))
-> IO (GClosure C_IteratorCopyFunction)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_IteratorCopyFunction
-> IO (GClosure C_IteratorCopyFunction)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `IteratorCopyFunction` into a `C_IteratorCopyFunction`.
wrap_IteratorCopyFunction ::
    Maybe (Ptr (FunPtr C_IteratorCopyFunction)) ->
    IteratorCopyFunction ->
    C_IteratorCopyFunction
wrap_IteratorCopyFunction :: Maybe (Ptr (FunPtr C_IteratorCopyFunction))
-> IteratorCopyFunction -> C_IteratorCopyFunction
wrap_IteratorCopyFunction Maybe (Ptr (FunPtr C_IteratorCopyFunction))
funptrptr IteratorCopyFunction
_cb Ptr Iterator
it Ptr Iterator
copy = do
    (ManagedPtr Iterator -> Iterator)
-> Ptr Iterator -> (Iterator -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Iterator -> Iterator
Gst.Iterator.Iterator Ptr Iterator
it ((Iterator -> IO ()) -> IO ()) -> (Iterator -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Iterator
it' -> do
        (ManagedPtr Iterator -> Iterator)
-> Ptr Iterator -> (Iterator -> IO ()) -> IO ()
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Iterator -> Iterator
Gst.Iterator.Iterator Ptr Iterator
copy ((Iterator -> IO ()) -> IO ()) -> (Iterator -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Iterator
copy' -> do
            IteratorCopyFunction
_cb  Iterator
it' Iterator
copy'
            Maybe (Ptr (FunPtr C_IteratorCopyFunction)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_IteratorCopyFunction))
funptrptr


-- callback ElementForeachPadFunc
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just "%FALSE to stop iterating pads, %TRUE to continue"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "element"
          , argType =
              TInterface Name { namespace = "Gst" , name = "Element" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the #GstElement" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , 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 = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "user data passed to the foreach function"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 2
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Function called for each pad when using gst_element_foreach_sink_pad(),\ngst_element_foreach_src_pad(), or gst_element_foreach_pad()."
        , sinceVersion = Just "1.14"
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_ElementForeachPadFunc =
    Ptr Gst.Element.Element ->
    Ptr Gst.Pad.Pad ->
    Ptr () ->
    IO CInt

-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GstElement" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , 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 = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "user data passed to the foreach function"
--                 , 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_ElementForeachPadFunc :: FunPtr C_ElementForeachPadFunc -> C_ElementForeachPadFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_ElementForeachPadFunc ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.Element.IsElement a, Gst.Pad.IsPad b) =>
    FunPtr C_ElementForeachPadFunc
    -> a
    -- ^ /@element@/: the t'GI.Gst.Objects.Element.Element'
    -> b
    -- ^ /@pad@/: a t'GI.Gst.Objects.Pad.Pad'
    -> Ptr ()
    -- ^ /@userData@/: user data passed to the foreach function
    -> m Bool
    -- ^ __Returns:__ 'P.False' to stop iterating pads, 'P.True' to continue
dynamic_ElementForeachPadFunc :: FunPtr C_ElementForeachPadFunc -> a -> b -> Ptr () -> m Bool
dynamic_ElementForeachPadFunc FunPtr C_ElementForeachPadFunc
__funPtr a
element b
pad Ptr ()
userData = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    Ptr Pad
pad' <- b -> IO (Ptr Pad)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
pad
    CInt
result <- (FunPtr C_ElementForeachPadFunc -> C_ElementForeachPadFunc
__dynamic_C_ElementForeachPadFunc FunPtr C_ElementForeachPadFunc
__funPtr) Ptr Element
element' Ptr Pad
pad' Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
pad
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

-- | Function called for each pad when using 'GI.Gst.Objects.Element.elementForeachSinkPad',
-- 'GI.Gst.Objects.Element.elementForeachSrcPad', or 'GI.Gst.Objects.Element.elementForeachPad'.
-- 
-- /Since: 1.14/
type ElementForeachPadFunc =
    Gst.Element.Element
    -- ^ /@element@/: the t'GI.Gst.Objects.Element.Element'
    -> Gst.Pad.Pad
    -- ^ /@pad@/: a t'GI.Gst.Objects.Pad.Pad'
    -> IO Bool
    -- ^ __Returns:__ 'P.False' to stop iterating pads, 'P.True' to continue

-- | A convenience synonym for @`Nothing` :: `Maybe` `ElementForeachPadFunc`@.
noElementForeachPadFunc :: Maybe ElementForeachPadFunc
noElementForeachPadFunc :: Maybe ElementForeachPadFunc
noElementForeachPadFunc = Maybe ElementForeachPadFunc
forall a. Maybe a
Nothing

-- | Function called for each pad when using 'GI.Gst.Objects.Element.elementForeachSinkPad',
-- 'GI.Gst.Objects.Element.elementForeachSrcPad', or 'GI.Gst.Objects.Element.elementForeachPad'.
-- 
-- /Since: 1.14/
type ElementForeachPadFunc_WithClosures =
    Gst.Element.Element
    -- ^ /@element@/: the t'GI.Gst.Objects.Element.Element'
    -> Gst.Pad.Pad
    -- ^ /@pad@/: a t'GI.Gst.Objects.Pad.Pad'
    -> Ptr ()
    -- ^ /@userData@/: user data passed to the foreach function
    -> IO Bool
    -- ^ __Returns:__ 'P.False' to stop iterating pads, 'P.True' to continue

-- | A convenience synonym for @`Nothing` :: `Maybe` `ElementForeachPadFunc_WithClosures`@.
noElementForeachPadFunc_WithClosures :: Maybe ElementForeachPadFunc_WithClosures
noElementForeachPadFunc_WithClosures :: Maybe ElementForeachPadFunc_WithClosures
noElementForeachPadFunc_WithClosures = Maybe ElementForeachPadFunc_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_ElementForeachPadFunc :: ElementForeachPadFunc -> ElementForeachPadFunc_WithClosures
drop_closures_ElementForeachPadFunc :: ElementForeachPadFunc -> ElementForeachPadFunc_WithClosures
drop_closures_ElementForeachPadFunc ElementForeachPadFunc
_f Element
element Pad
pad Ptr ()
_ = ElementForeachPadFunc
_f Element
element Pad
pad

-- | Wrap the callback into a `GClosure`.
genClosure_ElementForeachPadFunc :: MonadIO m => ElementForeachPadFunc -> m (GClosure C_ElementForeachPadFunc)
genClosure_ElementForeachPadFunc :: ElementForeachPadFunc -> m (GClosure C_ElementForeachPadFunc)
genClosure_ElementForeachPadFunc ElementForeachPadFunc
cb = IO (GClosure C_ElementForeachPadFunc)
-> m (GClosure C_ElementForeachPadFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ElementForeachPadFunc)
 -> m (GClosure C_ElementForeachPadFunc))
-> IO (GClosure C_ElementForeachPadFunc)
-> m (GClosure C_ElementForeachPadFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: ElementForeachPadFunc_WithClosures
cb' = ElementForeachPadFunc -> ElementForeachPadFunc_WithClosures
drop_closures_ElementForeachPadFunc ElementForeachPadFunc
cb
    let cb'' :: C_ElementForeachPadFunc
cb'' = Maybe (Ptr (FunPtr C_ElementForeachPadFunc))
-> ElementForeachPadFunc_WithClosures -> C_ElementForeachPadFunc
wrap_ElementForeachPadFunc Maybe (Ptr (FunPtr C_ElementForeachPadFunc))
forall a. Maybe a
Nothing ElementForeachPadFunc_WithClosures
cb'
    C_ElementForeachPadFunc -> IO (FunPtr C_ElementForeachPadFunc)
mk_ElementForeachPadFunc C_ElementForeachPadFunc
cb'' IO (FunPtr C_ElementForeachPadFunc)
-> (FunPtr C_ElementForeachPadFunc
    -> IO (GClosure C_ElementForeachPadFunc))
-> IO (GClosure C_ElementForeachPadFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ElementForeachPadFunc
-> IO (GClosure C_ElementForeachPadFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `ElementForeachPadFunc` into a `C_ElementForeachPadFunc`.
wrap_ElementForeachPadFunc ::
    Maybe (Ptr (FunPtr C_ElementForeachPadFunc)) ->
    ElementForeachPadFunc_WithClosures ->
    C_ElementForeachPadFunc
wrap_ElementForeachPadFunc :: Maybe (Ptr (FunPtr C_ElementForeachPadFunc))
-> ElementForeachPadFunc_WithClosures -> C_ElementForeachPadFunc
wrap_ElementForeachPadFunc Maybe (Ptr (FunPtr C_ElementForeachPadFunc))
funptrptr ElementForeachPadFunc_WithClosures
_cb Ptr Element
element Ptr Pad
pad Ptr ()
userData = do
    Element
element' <- ((ManagedPtr Element -> Element) -> Ptr Element -> IO Element
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Element -> Element
Gst.Element.Element) Ptr Element
element
    Pad
pad' <- ((ManagedPtr Pad -> Pad) -> Ptr Pad -> IO Pad
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Pad -> Pad
Gst.Pad.Pad) Ptr Pad
pad
    Bool
result <- ElementForeachPadFunc_WithClosures
_cb  Element
element' Pad
pad' Ptr ()
userData
    Maybe (Ptr (FunPtr C_ElementForeachPadFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_ElementForeachPadFunc))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback ElementCallAsyncFunc
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "element"
          , argType =
              TInterface Name { namespace = "Gst" , name = "Element" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , 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 = 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 }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_ElementCallAsyncFunc =
    Ptr Gst.Element.Element ->
    Ptr () ->
    IO ()

-- Args: [ Arg
--           { argCName = "element"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , 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 = 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_ElementCallAsyncFunc :: FunPtr C_ElementCallAsyncFunc -> C_ElementCallAsyncFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_ElementCallAsyncFunc ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.Element.IsElement a) =>
    FunPtr C_ElementCallAsyncFunc
    -> a
    -> Ptr ()
    -> m ()
dynamic_ElementCallAsyncFunc :: FunPtr C_ElementCallAsyncFunc -> a -> Ptr () -> m ()
dynamic_ElementCallAsyncFunc FunPtr C_ElementCallAsyncFunc
__funPtr a
element Ptr ()
userData = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Element
element' <- a -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
element
    (FunPtr C_ElementCallAsyncFunc -> C_ElementCallAsyncFunc
__dynamic_C_ElementCallAsyncFunc FunPtr C_ElementCallAsyncFunc
__funPtr) Ptr Element
element' Ptr ()
userData
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
element
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | /No description available in the introspection data./
type ElementCallAsyncFunc =
    Gst.Element.Element
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `ElementCallAsyncFunc`@.
noElementCallAsyncFunc :: Maybe ElementCallAsyncFunc
noElementCallAsyncFunc :: Maybe ElementCallAsyncFunc
noElementCallAsyncFunc = Maybe ElementCallAsyncFunc
forall a. Maybe a
Nothing

-- | /No description available in the introspection data./
type ElementCallAsyncFunc_WithClosures =
    Gst.Element.Element
    -> Ptr ()
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `ElementCallAsyncFunc_WithClosures`@.
noElementCallAsyncFunc_WithClosures :: Maybe ElementCallAsyncFunc_WithClosures
noElementCallAsyncFunc_WithClosures :: Maybe ElementCallAsyncFunc_WithClosures
noElementCallAsyncFunc_WithClosures = Maybe ElementCallAsyncFunc_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_ElementCallAsyncFunc :: ElementCallAsyncFunc -> ElementCallAsyncFunc_WithClosures
drop_closures_ElementCallAsyncFunc :: ElementCallAsyncFunc -> ElementCallAsyncFunc_WithClosures
drop_closures_ElementCallAsyncFunc ElementCallAsyncFunc
_f Element
element Ptr ()
_ = ElementCallAsyncFunc
_f Element
element

-- | Wrap the callback into a `GClosure`.
genClosure_ElementCallAsyncFunc :: MonadIO m => ElementCallAsyncFunc -> m (GClosure C_ElementCallAsyncFunc)
genClosure_ElementCallAsyncFunc :: ElementCallAsyncFunc -> m (GClosure C_ElementCallAsyncFunc)
genClosure_ElementCallAsyncFunc ElementCallAsyncFunc
cb = IO (GClosure C_ElementCallAsyncFunc)
-> m (GClosure C_ElementCallAsyncFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ElementCallAsyncFunc)
 -> m (GClosure C_ElementCallAsyncFunc))
-> IO (GClosure C_ElementCallAsyncFunc)
-> m (GClosure C_ElementCallAsyncFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: ElementCallAsyncFunc_WithClosures
cb' = ElementCallAsyncFunc -> ElementCallAsyncFunc_WithClosures
drop_closures_ElementCallAsyncFunc ElementCallAsyncFunc
cb
    let cb'' :: C_ElementCallAsyncFunc
cb'' = Maybe (Ptr (FunPtr C_ElementCallAsyncFunc))
-> ElementCallAsyncFunc_WithClosures -> C_ElementCallAsyncFunc
wrap_ElementCallAsyncFunc Maybe (Ptr (FunPtr C_ElementCallAsyncFunc))
forall a. Maybe a
Nothing ElementCallAsyncFunc_WithClosures
cb'
    C_ElementCallAsyncFunc -> IO (FunPtr C_ElementCallAsyncFunc)
mk_ElementCallAsyncFunc C_ElementCallAsyncFunc
cb'' IO (FunPtr C_ElementCallAsyncFunc)
-> (FunPtr C_ElementCallAsyncFunc
    -> IO (GClosure C_ElementCallAsyncFunc))
-> IO (GClosure C_ElementCallAsyncFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ElementCallAsyncFunc
-> IO (GClosure C_ElementCallAsyncFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `ElementCallAsyncFunc` into a `C_ElementCallAsyncFunc`.
wrap_ElementCallAsyncFunc ::
    Maybe (Ptr (FunPtr C_ElementCallAsyncFunc)) ->
    ElementCallAsyncFunc_WithClosures ->
    C_ElementCallAsyncFunc
wrap_ElementCallAsyncFunc :: Maybe (Ptr (FunPtr C_ElementCallAsyncFunc))
-> ElementCallAsyncFunc_WithClosures -> C_ElementCallAsyncFunc
wrap_ElementCallAsyncFunc Maybe (Ptr (FunPtr C_ElementCallAsyncFunc))
funptrptr ElementCallAsyncFunc_WithClosures
_cb Ptr Element
element Ptr ()
userData = do
    Element
element' <- ((ManagedPtr Element -> Element) -> Ptr Element -> IO Element
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Element -> Element
Gst.Element.Element) Ptr Element
element
    ElementCallAsyncFunc_WithClosures
_cb  Element
element' Ptr ()
userData
    Maybe (Ptr (FunPtr C_ElementCallAsyncFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_ElementCallAsyncFunc))
funptrptr


-- callback DebugFuncPtr
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args = []
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_DebugFuncPtr =
    IO ()

-- Args: []
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_DebugFuncPtr :: FunPtr C_DebugFuncPtr -> C_DebugFuncPtr

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_DebugFuncPtr ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_DebugFuncPtr
    -> m ()
dynamic_DebugFuncPtr :: FunPtr (IO ()) -> m ()
dynamic_DebugFuncPtr FunPtr (IO ())
__funPtr = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    (FunPtr (IO ()) -> IO ()
__dynamic_C_DebugFuncPtr FunPtr (IO ())
__funPtr)
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | /No description available in the introspection data./
type DebugFuncPtr =
    IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `DebugFuncPtr`@.
noDebugFuncPtr :: Maybe DebugFuncPtr
noDebugFuncPtr :: Maybe (IO ())
noDebugFuncPtr = Maybe (IO ())
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_DebugFuncPtr :: MonadIO m => DebugFuncPtr -> m (GClosure C_DebugFuncPtr)
genClosure_DebugFuncPtr :: IO () -> m (GClosure (IO ()))
genClosure_DebugFuncPtr IO ()
cb = IO (GClosure (IO ())) -> m (GClosure (IO ()))
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure (IO ())) -> m (GClosure (IO ())))
-> IO (GClosure (IO ())) -> m (GClosure (IO ()))
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: IO ()
cb' = Maybe (Ptr (FunPtr (IO ()))) -> IO () -> IO ()
wrap_DebugFuncPtr Maybe (Ptr (FunPtr (IO ())))
forall a. Maybe a
Nothing IO ()
cb
    IO () -> IO (FunPtr (IO ()))
mk_DebugFuncPtr IO ()
cb' IO (FunPtr (IO ()))
-> (FunPtr (IO ()) -> IO (GClosure (IO ())))
-> IO (GClosure (IO ()))
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr (IO ()) -> IO (GClosure (IO ()))
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `DebugFuncPtr` into a `C_DebugFuncPtr`.
wrap_DebugFuncPtr ::
    Maybe (Ptr (FunPtr C_DebugFuncPtr)) ->
    DebugFuncPtr ->
    C_DebugFuncPtr
wrap_DebugFuncPtr :: Maybe (Ptr (FunPtr (IO ()))) -> IO () -> IO ()
wrap_DebugFuncPtr Maybe (Ptr (FunPtr (IO ())))
funptrptr IO ()
_cb = do
    IO ()
_cb 
    Maybe (Ptr (FunPtr (IO ()))) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr (IO ())))
funptrptr


-- callback ControlSourceGetValueArray
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just "%TRUE if the values were successfully calculated."
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "self"
          , argType =
              TInterface Name { namespace = "Gst" , name = "ControlSource" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the #GstControlSource instance"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "timestamp"
          , argType = TBasicType TUInt64
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText =
                    Just "timestamp for which a value should be calculated"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "interval"
          , argType = TBasicType TUInt64
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the time spacing between subsequent values"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "n_values"
          , argType = TBasicType TUInt
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the number of values"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "values"
          , argType = TBasicType TDouble
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "array to put control-values in"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Function for returning an array of values for starting at a given timestamp."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_ControlSourceGetValueArray =
    Ptr Gst.ControlSource.ControlSource ->
    Word64 ->
    Word64 ->
    Word32 ->
    CDouble ->
    IO CInt

-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "ControlSource" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GstControlSource instance"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "timestamp"
--           , argType = TBasicType TUInt64
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "timestamp for which a value should be calculated"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "interval"
--           , argType = TBasicType TUInt64
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the time spacing between subsequent values"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "n_values"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the number of values"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "values"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "array to put control-values in"
--                 , 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_ControlSourceGetValueArray :: FunPtr C_ControlSourceGetValueArray -> C_ControlSourceGetValueArray

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_ControlSourceGetValueArray ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.ControlSource.IsControlSource a) =>
    FunPtr C_ControlSourceGetValueArray
    -> a
    -- ^ /@self@/: the t'GI.Gst.Objects.ControlSource.ControlSource' instance
    -> Word64
    -- ^ /@timestamp@/: timestamp for which a value should be calculated
    -> Word64
    -- ^ /@interval@/: the time spacing between subsequent values
    -> Word32
    -- ^ /@nValues@/: the number of values
    -> Double
    -- ^ /@values@/: array to put control-values in
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the values were successfully calculated.
dynamic_ControlSourceGetValueArray :: FunPtr C_ControlSourceGetValueArray
-> a -> Word64 -> Word64 -> Word32 -> Double -> m Bool
dynamic_ControlSourceGetValueArray FunPtr C_ControlSourceGetValueArray
__funPtr a
self Word64
timestamp Word64
interval Word32
nValues Double
values = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr ControlSource
self' <- a -> IO (Ptr ControlSource)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    let values' :: CDouble
values' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
values
    CInt
result <- (FunPtr C_ControlSourceGetValueArray -> C_ControlSourceGetValueArray
__dynamic_C_ControlSourceGetValueArray FunPtr C_ControlSourceGetValueArray
__funPtr) Ptr ControlSource
self' Word64
timestamp Word64
interval Word32
nValues CDouble
values'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

-- | Function for returning an array of values for starting at a given timestamp.
type ControlSourceGetValueArray =
    Gst.ControlSource.ControlSource
    -- ^ /@self@/: the t'GI.Gst.Objects.ControlSource.ControlSource' instance
    -> Word64
    -- ^ /@timestamp@/: timestamp for which a value should be calculated
    -> Word64
    -- ^ /@interval@/: the time spacing between subsequent values
    -> Word32
    -- ^ /@nValues@/: the number of values
    -> Double
    -- ^ /@values@/: array to put control-values in
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the values were successfully calculated.

-- | A convenience synonym for @`Nothing` :: `Maybe` `ControlSourceGetValueArray`@.
noControlSourceGetValueArray :: Maybe ControlSourceGetValueArray
noControlSourceGetValueArray :: Maybe ControlSourceGetValueArray
noControlSourceGetValueArray = Maybe ControlSourceGetValueArray
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_ControlSourceGetValueArray :: MonadIO m => ControlSourceGetValueArray -> m (GClosure C_ControlSourceGetValueArray)
genClosure_ControlSourceGetValueArray :: ControlSourceGetValueArray
-> m (GClosure C_ControlSourceGetValueArray)
genClosure_ControlSourceGetValueArray ControlSourceGetValueArray
cb = IO (GClosure C_ControlSourceGetValueArray)
-> m (GClosure C_ControlSourceGetValueArray)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ControlSourceGetValueArray)
 -> m (GClosure C_ControlSourceGetValueArray))
-> IO (GClosure C_ControlSourceGetValueArray)
-> m (GClosure C_ControlSourceGetValueArray)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_ControlSourceGetValueArray
cb' = Maybe (Ptr (FunPtr C_ControlSourceGetValueArray))
-> ControlSourceGetValueArray -> C_ControlSourceGetValueArray
wrap_ControlSourceGetValueArray Maybe (Ptr (FunPtr C_ControlSourceGetValueArray))
forall a. Maybe a
Nothing ControlSourceGetValueArray
cb
    C_ControlSourceGetValueArray
-> IO (FunPtr C_ControlSourceGetValueArray)
mk_ControlSourceGetValueArray C_ControlSourceGetValueArray
cb' IO (FunPtr C_ControlSourceGetValueArray)
-> (FunPtr C_ControlSourceGetValueArray
    -> IO (GClosure C_ControlSourceGetValueArray))
-> IO (GClosure C_ControlSourceGetValueArray)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ControlSourceGetValueArray
-> IO (GClosure C_ControlSourceGetValueArray)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `ControlSourceGetValueArray` into a `C_ControlSourceGetValueArray`.
wrap_ControlSourceGetValueArray ::
    Maybe (Ptr (FunPtr C_ControlSourceGetValueArray)) ->
    ControlSourceGetValueArray ->
    C_ControlSourceGetValueArray
wrap_ControlSourceGetValueArray :: Maybe (Ptr (FunPtr C_ControlSourceGetValueArray))
-> ControlSourceGetValueArray -> C_ControlSourceGetValueArray
wrap_ControlSourceGetValueArray Maybe (Ptr (FunPtr C_ControlSourceGetValueArray))
funptrptr ControlSourceGetValueArray
_cb Ptr ControlSource
self Word64
timestamp Word64
interval Word32
nValues CDouble
values = do
    ControlSource
self' <- ((ManagedPtr ControlSource -> ControlSource)
-> Ptr ControlSource -> IO ControlSource
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr ControlSource -> ControlSource
Gst.ControlSource.ControlSource) Ptr ControlSource
self
    let values' :: Double
values' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
values
    Bool
result <- ControlSourceGetValueArray
_cb  ControlSource
self' Word64
timestamp Word64
interval Word32
nValues Double
values'
    Maybe (Ptr (FunPtr C_ControlSourceGetValueArray)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_ControlSourceGetValueArray))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback ControlSourceGetValue
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just "%TRUE if the value was successfully calculated."
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "self"
          , argType =
              TInterface Name { namespace = "Gst" , name = "ControlSource" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the #GstControlSource instance"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "timestamp"
          , argType = TBasicType TUInt64
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText =
                    Just "timestamp for which a value should be calculated"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "value"
          , argType = TBasicType TDouble
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a value which will be set to the result."
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just "Function for returning a value for a given timestamp."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_ControlSourceGetValue =
    Ptr Gst.ControlSource.ControlSource ->
    Word64 ->
    CDouble ->
    IO CInt

-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "ControlSource" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GstControlSource instance"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "timestamp"
--           , argType = TBasicType TUInt64
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "timestamp for which a value should be calculated"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a value which will be set to the result."
--                 , 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_ControlSourceGetValue :: FunPtr C_ControlSourceGetValue -> C_ControlSourceGetValue

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_ControlSourceGetValue ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.ControlSource.IsControlSource a) =>
    FunPtr C_ControlSourceGetValue
    -> a
    -- ^ /@self@/: the t'GI.Gst.Objects.ControlSource.ControlSource' instance
    -> Word64
    -- ^ /@timestamp@/: timestamp for which a value should be calculated
    -> Double
    -- ^ /@value@/: a value which will be set to the result.
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the value was successfully calculated.
dynamic_ControlSourceGetValue :: FunPtr C_ControlSourceGetValue -> a -> Word64 -> Double -> m Bool
dynamic_ControlSourceGetValue FunPtr C_ControlSourceGetValue
__funPtr a
self Word64
timestamp Double
value = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr ControlSource
self' <- a -> IO (Ptr ControlSource)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
self
    let value' :: CDouble
value' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
value
    CInt
result <- (FunPtr C_ControlSourceGetValue -> C_ControlSourceGetValue
__dynamic_C_ControlSourceGetValue FunPtr C_ControlSourceGetValue
__funPtr) Ptr ControlSource
self' Word64
timestamp CDouble
value'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
self
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

-- | Function for returning a value for a given timestamp.
type ControlSourceGetValue =
    Gst.ControlSource.ControlSource
    -- ^ /@self@/: the t'GI.Gst.Objects.ControlSource.ControlSource' instance
    -> Word64
    -- ^ /@timestamp@/: timestamp for which a value should be calculated
    -> Double
    -- ^ /@value@/: a value which will be set to the result.
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the value was successfully calculated.

-- | A convenience synonym for @`Nothing` :: `Maybe` `ControlSourceGetValue`@.
noControlSourceGetValue :: Maybe ControlSourceGetValue
noControlSourceGetValue :: Maybe ControlSourceGetValue
noControlSourceGetValue = Maybe ControlSourceGetValue
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_ControlSourceGetValue :: MonadIO m => ControlSourceGetValue -> m (GClosure C_ControlSourceGetValue)
genClosure_ControlSourceGetValue :: ControlSourceGetValue -> m (GClosure C_ControlSourceGetValue)
genClosure_ControlSourceGetValue ControlSourceGetValue
cb = IO (GClosure C_ControlSourceGetValue)
-> m (GClosure C_ControlSourceGetValue)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ControlSourceGetValue)
 -> m (GClosure C_ControlSourceGetValue))
-> IO (GClosure C_ControlSourceGetValue)
-> m (GClosure C_ControlSourceGetValue)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_ControlSourceGetValue
cb' = Maybe (Ptr (FunPtr C_ControlSourceGetValue))
-> ControlSourceGetValue -> C_ControlSourceGetValue
wrap_ControlSourceGetValue Maybe (Ptr (FunPtr C_ControlSourceGetValue))
forall a. Maybe a
Nothing ControlSourceGetValue
cb
    C_ControlSourceGetValue -> IO (FunPtr C_ControlSourceGetValue)
mk_ControlSourceGetValue C_ControlSourceGetValue
cb' IO (FunPtr C_ControlSourceGetValue)
-> (FunPtr C_ControlSourceGetValue
    -> IO (GClosure C_ControlSourceGetValue))
-> IO (GClosure C_ControlSourceGetValue)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ControlSourceGetValue
-> IO (GClosure C_ControlSourceGetValue)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `ControlSourceGetValue` into a `C_ControlSourceGetValue`.
wrap_ControlSourceGetValue ::
    Maybe (Ptr (FunPtr C_ControlSourceGetValue)) ->
    ControlSourceGetValue ->
    C_ControlSourceGetValue
wrap_ControlSourceGetValue :: Maybe (Ptr (FunPtr C_ControlSourceGetValue))
-> ControlSourceGetValue -> C_ControlSourceGetValue
wrap_ControlSourceGetValue Maybe (Ptr (FunPtr C_ControlSourceGetValue))
funptrptr ControlSourceGetValue
_cb Ptr ControlSource
self Word64
timestamp CDouble
value = do
    ControlSource
self' <- ((ManagedPtr ControlSource -> ControlSource)
-> Ptr ControlSource -> IO ControlSource
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr ControlSource -> ControlSource
Gst.ControlSource.ControlSource) Ptr ControlSource
self
    let value' :: Double
value' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
value
    Bool
result <- ControlSourceGetValue
_cb  ControlSource
self' Word64
timestamp Double
value'
    Maybe (Ptr (FunPtr C_ControlSourceGetValue)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_ControlSourceGetValue))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback ControlBindingConvert
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "binding"
          , argType =
              TInterface Name { namespace = "Gst" , name = "ControlBinding" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "src_value"
          , argType = TBasicType TDouble
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "dest_value"
          , argType = TGValue
          , 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 }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_ControlBindingConvert =
    Ptr Gst.ControlBinding.ControlBinding ->
    CDouble ->
    Ptr GValue ->
    IO ()

-- Args: [ Arg
--           { argCName = "binding"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "ControlBinding" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "src_value"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "dest_value"
--           , argType = TGValue
--           , 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_ControlBindingConvert :: FunPtr C_ControlBindingConvert -> C_ControlBindingConvert

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_ControlBindingConvert ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.ControlBinding.IsControlBinding a) =>
    FunPtr C_ControlBindingConvert
    -> a
    -> Double
    -> GValue
    -> m ()
dynamic_ControlBindingConvert :: FunPtr C_ControlBindingConvert -> a -> Double -> GValue -> m ()
dynamic_ControlBindingConvert FunPtr C_ControlBindingConvert
__funPtr a
binding Double
srcValue GValue
destValue = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr ControlBinding
binding' <- a -> IO (Ptr ControlBinding)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
binding
    let srcValue' :: CDouble
srcValue' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
srcValue
    Ptr GValue
destValue' <- GValue -> IO (Ptr GValue)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GValue
destValue
    (FunPtr C_ControlBindingConvert -> C_ControlBindingConvert
__dynamic_C_ControlBindingConvert FunPtr C_ControlBindingConvert
__funPtr) Ptr ControlBinding
binding' CDouble
srcValue' Ptr GValue
destValue'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
binding
    GValue -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GValue
destValue
    Ptr GValue -> IO ()
B.GValue.unsetGValue Ptr GValue
destValue'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | /No description available in the introspection data./
type ControlBindingConvert =
    Gst.ControlBinding.ControlBinding
    -> Double
    -> GValue
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `ControlBindingConvert`@.
noControlBindingConvert :: Maybe ControlBindingConvert
noControlBindingConvert :: Maybe ControlBindingConvert
noControlBindingConvert = Maybe ControlBindingConvert
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_ControlBindingConvert :: MonadIO m => ControlBindingConvert -> m (GClosure C_ControlBindingConvert)
genClosure_ControlBindingConvert :: ControlBindingConvert -> m (GClosure C_ControlBindingConvert)
genClosure_ControlBindingConvert ControlBindingConvert
cb = IO (GClosure C_ControlBindingConvert)
-> m (GClosure C_ControlBindingConvert)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ControlBindingConvert)
 -> m (GClosure C_ControlBindingConvert))
-> IO (GClosure C_ControlBindingConvert)
-> m (GClosure C_ControlBindingConvert)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_ControlBindingConvert
cb' = Maybe (Ptr (FunPtr C_ControlBindingConvert))
-> ControlBindingConvert -> C_ControlBindingConvert
wrap_ControlBindingConvert Maybe (Ptr (FunPtr C_ControlBindingConvert))
forall a. Maybe a
Nothing ControlBindingConvert
cb
    C_ControlBindingConvert -> IO (FunPtr C_ControlBindingConvert)
mk_ControlBindingConvert C_ControlBindingConvert
cb' IO (FunPtr C_ControlBindingConvert)
-> (FunPtr C_ControlBindingConvert
    -> IO (GClosure C_ControlBindingConvert))
-> IO (GClosure C_ControlBindingConvert)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ControlBindingConvert
-> IO (GClosure C_ControlBindingConvert)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `ControlBindingConvert` into a `C_ControlBindingConvert`.
wrap_ControlBindingConvert ::
    Maybe (Ptr (FunPtr C_ControlBindingConvert)) ->
    ControlBindingConvert ->
    C_ControlBindingConvert
wrap_ControlBindingConvert :: Maybe (Ptr (FunPtr C_ControlBindingConvert))
-> ControlBindingConvert -> C_ControlBindingConvert
wrap_ControlBindingConvert Maybe (Ptr (FunPtr C_ControlBindingConvert))
funptrptr ControlBindingConvert
_cb Ptr ControlBinding
binding CDouble
srcValue Ptr GValue
destValue = do
    ControlBinding
binding' <- ((ManagedPtr ControlBinding -> ControlBinding)
-> Ptr ControlBinding -> IO ControlBinding
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr ControlBinding -> ControlBinding
Gst.ControlBinding.ControlBinding) Ptr ControlBinding
binding
    let srcValue' :: Double
srcValue' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
srcValue
    GValue
destValue' <- Ptr GValue -> IO GValue
B.GValue.newGValueFromPtr Ptr GValue
destValue
    ControlBindingConvert
_cb  ControlBinding
binding' Double
srcValue' GValue
destValue'
    Maybe (Ptr (FunPtr C_ControlBindingConvert)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_ControlBindingConvert))
funptrptr


-- callback ClockCallback
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText = Just "%TRUE or %FALSE (currently unused)"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "clock"
          , argType = TInterface Name { namespace = "Gst" , name = "Clock" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The clock that triggered the callback"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "time"
          , argType = TBasicType TUInt64
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The time it was triggered"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "id"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The #GstClockID that expired"
                , 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 passed in the gst_clock_id_wait_async() function"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 3
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText = Just "The function prototype of the callback."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_ClockCallback =
    Ptr Gst.Clock.Clock ->
    Word64 ->
    Ptr () ->
    Ptr () ->
    IO CInt

-- Args: [ Arg
--           { argCName = "clock"
--           , argType = TInterface Name { namespace = "Gst" , name = "Clock" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The clock that triggered the callback"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "time"
--           , argType = TBasicType TUInt64
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The time it was triggered"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "id"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #GstClockID that expired"
--                 , 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 passed in the gst_clock_id_wait_async() function"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 3
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_ClockCallback :: FunPtr C_ClockCallback -> C_ClockCallback

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_ClockCallback ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.Clock.IsClock a) =>
    FunPtr C_ClockCallback
    -> a
    -- ^ /@clock@/: The clock that triggered the callback
    -> Word64
    -- ^ /@time@/: The time it was triggered
    -> Ptr ()
    -- ^ /@id@/: The @/GstClockID/@ that expired
    -> Ptr ()
    -- ^ /@userData@/: user data passed in the 'GI.Gst.Objects.Clock.clockIdWaitAsync' function
    -> m Bool
    -- ^ __Returns:__ 'P.True' or 'P.False' (currently unused)
dynamic_ClockCallback :: FunPtr C_ClockCallback -> a -> Word64 -> Ptr () -> Ptr () -> m Bool
dynamic_ClockCallback FunPtr C_ClockCallback
__funPtr a
clock Word64
time Ptr ()
id Ptr ()
userData = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Clock
clock' <- a -> IO (Ptr Clock)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clock
    CInt
result <- (FunPtr C_ClockCallback -> C_ClockCallback
__dynamic_C_ClockCallback FunPtr C_ClockCallback
__funPtr) Ptr Clock
clock' Word64
time Ptr ()
id Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clock
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

-- | The function prototype of the callback.
type ClockCallback =
    Gst.Clock.Clock
    -- ^ /@clock@/: The clock that triggered the callback
    -> Word64
    -- ^ /@time@/: The time it was triggered
    -> Ptr ()
    -- ^ /@id@/: The @/GstClockID/@ that expired
    -> IO Bool
    -- ^ __Returns:__ 'P.True' or 'P.False' (currently unused)

-- | A convenience synonym for @`Nothing` :: `Maybe` `ClockCallback`@.
noClockCallback :: Maybe ClockCallback
noClockCallback :: Maybe ClockCallback
noClockCallback = Maybe ClockCallback
forall a. Maybe a
Nothing

-- | The function prototype of the callback.
type ClockCallback_WithClosures =
    Gst.Clock.Clock
    -- ^ /@clock@/: The clock that triggered the callback
    -> Word64
    -- ^ /@time@/: The time it was triggered
    -> Ptr ()
    -- ^ /@id@/: The @/GstClockID/@ that expired
    -> Ptr ()
    -- ^ /@userData@/: user data passed in the 'GI.Gst.Objects.Clock.clockIdWaitAsync' function
    -> IO Bool
    -- ^ __Returns:__ 'P.True' or 'P.False' (currently unused)

-- | A convenience synonym for @`Nothing` :: `Maybe` `ClockCallback_WithClosures`@.
noClockCallback_WithClosures :: Maybe ClockCallback_WithClosures
noClockCallback_WithClosures :: Maybe ClockCallback_WithClosures
noClockCallback_WithClosures = Maybe ClockCallback_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_ClockCallback :: ClockCallback -> ClockCallback_WithClosures
drop_closures_ClockCallback :: ClockCallback -> ClockCallback_WithClosures
drop_closures_ClockCallback ClockCallback
_f Clock
clock Word64
time Ptr ()
id Ptr ()
_ = ClockCallback
_f Clock
clock Word64
time Ptr ()
id

-- | Wrap the callback into a `GClosure`.
genClosure_ClockCallback :: MonadIO m => ClockCallback -> m (GClosure C_ClockCallback)
genClosure_ClockCallback :: ClockCallback -> m (GClosure C_ClockCallback)
genClosure_ClockCallback ClockCallback
cb = IO (GClosure C_ClockCallback) -> m (GClosure C_ClockCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_ClockCallback) -> m (GClosure C_ClockCallback))
-> IO (GClosure C_ClockCallback) -> m (GClosure C_ClockCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: ClockCallback_WithClosures
cb' = ClockCallback -> ClockCallback_WithClosures
drop_closures_ClockCallback ClockCallback
cb
    let cb'' :: C_ClockCallback
cb'' = Maybe (Ptr (FunPtr C_ClockCallback))
-> ClockCallback_WithClosures -> C_ClockCallback
wrap_ClockCallback Maybe (Ptr (FunPtr C_ClockCallback))
forall a. Maybe a
Nothing ClockCallback_WithClosures
cb'
    C_ClockCallback -> IO (FunPtr C_ClockCallback)
mk_ClockCallback C_ClockCallback
cb'' IO (FunPtr C_ClockCallback)
-> (FunPtr C_ClockCallback -> IO (GClosure C_ClockCallback))
-> IO (GClosure C_ClockCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_ClockCallback -> IO (GClosure C_ClockCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `ClockCallback` into a `C_ClockCallback`.
wrap_ClockCallback ::
    Maybe (Ptr (FunPtr C_ClockCallback)) ->
    ClockCallback_WithClosures ->
    C_ClockCallback
wrap_ClockCallback :: Maybe (Ptr (FunPtr C_ClockCallback))
-> ClockCallback_WithClosures -> C_ClockCallback
wrap_ClockCallback Maybe (Ptr (FunPtr C_ClockCallback))
funptrptr ClockCallback_WithClosures
_cb Ptr Clock
clock Word64
time Ptr ()
id Ptr ()
userData = do
    Clock
clock' <- ((ManagedPtr Clock -> Clock) -> Ptr Clock -> IO Clock
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Clock -> Clock
Gst.Clock.Clock) Ptr Clock
clock
    Bool
result <- ClockCallback_WithClosures
_cb  Clock
clock' Word64
time Ptr ()
id Ptr ()
userData
    Maybe (Ptr (FunPtr C_ClockCallback)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_ClockCallback))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback CapsMapFunc
{- 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 = "features"
          , argType =
              TInterface Name { namespace = "Gst" , name = "CapsFeatures" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the #GstCapsFeatures"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "structure"
          , argType =
              TInterface Name { namespace = "Gst" , name = "Structure" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the #GstStructure" , 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_caps_map_in_place(). The function\nmay modify @features and @structure."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_CapsMapFunc =
    Ptr Gst.CapsFeatures.CapsFeatures ->
    Ptr Gst.Structure.Structure ->
    Ptr () ->
    IO CInt

-- Args: [ Arg
--           { argCName = "features"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "CapsFeatures" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GstCapsFeatures"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "structure"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Structure" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GstStructure" , 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_CapsMapFunc :: FunPtr C_CapsMapFunc -> C_CapsMapFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_CapsMapFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_CapsMapFunc
    -> Gst.CapsFeatures.CapsFeatures
    -- ^ /@features@/: the t'GI.Gst.Structs.CapsFeatures.CapsFeatures'
    -> Gst.Structure.Structure
    -- ^ /@structure@/: the t'GI.Gst.Structs.Structure.Structure'
    -> Ptr ()
    -- ^ /@userData@/: user data
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the map operation should continue, 'P.False' if
    -- the map operation should stop with 'P.False'.
dynamic_CapsMapFunc :: FunPtr C_CapsMapFunc
-> CapsFeatures -> Structure -> Ptr () -> m Bool
dynamic_CapsMapFunc FunPtr C_CapsMapFunc
__funPtr CapsFeatures
features Structure
structure Ptr ()
userData = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr CapsFeatures
features' <- CapsFeatures -> IO (Ptr CapsFeatures)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr CapsFeatures
features
    Ptr Structure
structure' <- Structure -> IO (Ptr Structure)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Structure
structure
    CInt
result <- (FunPtr C_CapsMapFunc -> C_CapsMapFunc
__dynamic_C_CapsMapFunc FunPtr C_CapsMapFunc
__funPtr) Ptr CapsFeatures
features' Ptr Structure
structure' Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    CapsFeatures -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr CapsFeatures
features
    Structure -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Structure
structure
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

-- | A function that will be called in 'GI.Gst.Structs.Caps.capsMapInPlace'. The function
-- may modify /@features@/ and /@structure@/.
type CapsMapFunc =
    Gst.CapsFeatures.CapsFeatures
    -- ^ /@features@/: the t'GI.Gst.Structs.CapsFeatures.CapsFeatures'
    -> Gst.Structure.Structure
    -- ^ /@structure@/: the t'GI.Gst.Structs.Structure.Structure'
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the map operation should continue, 'P.False' if
    -- the map operation should stop with 'P.False'.

-- | A convenience synonym for @`Nothing` :: `Maybe` `CapsMapFunc`@.
noCapsMapFunc :: Maybe CapsMapFunc
noCapsMapFunc :: Maybe CapsMapFunc
noCapsMapFunc = Maybe CapsMapFunc
forall a. Maybe a
Nothing

-- | A function that will be called in 'GI.Gst.Structs.Caps.capsMapInPlace'. The function
-- may modify /@features@/ and /@structure@/.
type CapsMapFunc_WithClosures =
    Gst.CapsFeatures.CapsFeatures
    -- ^ /@features@/: the t'GI.Gst.Structs.CapsFeatures.CapsFeatures'
    -> Gst.Structure.Structure
    -- ^ /@structure@/: the t'GI.Gst.Structs.Structure.Structure'
    -> Ptr ()
    -- ^ /@userData@/: user data
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the map operation should continue, 'P.False' if
    -- the map operation should stop with 'P.False'.

-- | A convenience synonym for @`Nothing` :: `Maybe` `CapsMapFunc_WithClosures`@.
noCapsMapFunc_WithClosures :: Maybe CapsMapFunc_WithClosures
noCapsMapFunc_WithClosures :: Maybe CapsMapFunc_WithClosures
noCapsMapFunc_WithClosures = Maybe CapsMapFunc_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_CapsMapFunc :: CapsMapFunc -> CapsMapFunc_WithClosures
drop_closures_CapsMapFunc :: CapsMapFunc -> CapsMapFunc_WithClosures
drop_closures_CapsMapFunc CapsMapFunc
_f CapsFeatures
features Structure
structure Ptr ()
_ = CapsMapFunc
_f CapsFeatures
features Structure
structure

-- | Wrap the callback into a `GClosure`.
genClosure_CapsMapFunc :: MonadIO m => CapsMapFunc -> m (GClosure C_CapsMapFunc)
genClosure_CapsMapFunc :: CapsMapFunc -> m (GClosure C_CapsMapFunc)
genClosure_CapsMapFunc CapsMapFunc
cb = IO (GClosure C_CapsMapFunc) -> m (GClosure C_CapsMapFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_CapsMapFunc) -> m (GClosure C_CapsMapFunc))
-> IO (GClosure C_CapsMapFunc) -> m (GClosure C_CapsMapFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: CapsMapFunc_WithClosures
cb' = CapsMapFunc -> CapsMapFunc_WithClosures
drop_closures_CapsMapFunc CapsMapFunc
cb
    let cb'' :: C_CapsMapFunc
cb'' = Maybe (Ptr (FunPtr C_CapsMapFunc))
-> CapsMapFunc_WithClosures -> C_CapsMapFunc
wrap_CapsMapFunc Maybe (Ptr (FunPtr C_CapsMapFunc))
forall a. Maybe a
Nothing CapsMapFunc_WithClosures
cb'
    C_CapsMapFunc -> IO (FunPtr C_CapsMapFunc)
mk_CapsMapFunc C_CapsMapFunc
cb'' IO (FunPtr C_CapsMapFunc)
-> (FunPtr C_CapsMapFunc -> IO (GClosure C_CapsMapFunc))
-> IO (GClosure C_CapsMapFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_CapsMapFunc -> IO (GClosure C_CapsMapFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `CapsMapFunc` into a `C_CapsMapFunc`.
wrap_CapsMapFunc ::
    Maybe (Ptr (FunPtr C_CapsMapFunc)) ->
    CapsMapFunc_WithClosures ->
    C_CapsMapFunc
wrap_CapsMapFunc :: Maybe (Ptr (FunPtr C_CapsMapFunc))
-> CapsMapFunc_WithClosures -> C_CapsMapFunc
wrap_CapsMapFunc Maybe (Ptr (FunPtr C_CapsMapFunc))
funptrptr CapsMapFunc_WithClosures
_cb Ptr CapsFeatures
features Ptr Structure
structure Ptr ()
userData = do
    (ManagedPtr CapsFeatures -> CapsFeatures)
-> Ptr CapsFeatures -> (CapsFeatures -> IO CInt) -> IO CInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr CapsFeatures -> CapsFeatures
Gst.CapsFeatures.CapsFeatures Ptr CapsFeatures
features ((CapsFeatures -> IO CInt) -> IO CInt)
-> (CapsFeatures -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \CapsFeatures
features' -> do
        (ManagedPtr Structure -> Structure)
-> Ptr Structure -> (Structure -> IO CInt) -> IO CInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Structure -> Structure
Gst.Structure.Structure Ptr Structure
structure ((Structure -> IO CInt) -> IO CInt)
-> (Structure -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Structure
structure' -> do
            Bool
result <- CapsMapFunc_WithClosures
_cb  CapsFeatures
features' Structure
structure' Ptr ()
userData
            Maybe (Ptr (FunPtr C_CapsMapFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_CapsMapFunc))
funptrptr
            let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
            CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback CapsForeachFunc
{- 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 = "features"
          , argType =
              TInterface Name { namespace = "Gst" , name = "CapsFeatures" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the #GstCapsFeatures"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "structure"
          , argType =
              TInterface Name { namespace = "Gst" , name = "Structure" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the #GstStructure" , 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_caps_foreach(). The function may\nnot modify @features or @structure."
        , sinceVersion = Just "1.6"
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_CapsForeachFunc =
    Ptr Gst.CapsFeatures.CapsFeatures ->
    Ptr Gst.Structure.Structure ->
    Ptr () ->
    IO CInt

-- Args: [ Arg
--           { argCName = "features"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "CapsFeatures" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GstCapsFeatures"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "structure"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Structure" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GstStructure" , 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_CapsForeachFunc :: FunPtr C_CapsForeachFunc -> C_CapsForeachFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_CapsForeachFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_CapsForeachFunc
    -> Gst.CapsFeatures.CapsFeatures
    -- ^ /@features@/: the t'GI.Gst.Structs.CapsFeatures.CapsFeatures'
    -> Gst.Structure.Structure
    -- ^ /@structure@/: the t'GI.Gst.Structs.Structure.Structure'
    -> Ptr ()
    -- ^ /@userData@/: user data
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the foreach operation should continue, 'P.False' if
    -- the foreach operation should stop with 'P.False'.
dynamic_CapsForeachFunc :: FunPtr C_CapsMapFunc
-> CapsFeatures -> Structure -> Ptr () -> m Bool
dynamic_CapsForeachFunc FunPtr C_CapsMapFunc
__funPtr CapsFeatures
features Structure
structure Ptr ()
userData = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr CapsFeatures
features' <- CapsFeatures -> IO (Ptr CapsFeatures)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr CapsFeatures
features
    Ptr Structure
structure' <- Structure -> IO (Ptr Structure)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Structure
structure
    CInt
result <- (FunPtr C_CapsMapFunc -> C_CapsMapFunc
__dynamic_C_CapsForeachFunc FunPtr C_CapsMapFunc
__funPtr) Ptr CapsFeatures
features' Ptr Structure
structure' Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    CapsFeatures -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr CapsFeatures
features
    Structure -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Structure
structure
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

-- | A function that will be called in 'GI.Gst.Structs.Caps.capsForeach'. The function may
-- not modify /@features@/ or /@structure@/.
-- 
-- /Since: 1.6/
type CapsForeachFunc =
    Gst.CapsFeatures.CapsFeatures
    -- ^ /@features@/: the t'GI.Gst.Structs.CapsFeatures.CapsFeatures'
    -> Gst.Structure.Structure
    -- ^ /@structure@/: the t'GI.Gst.Structs.Structure.Structure'
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the foreach operation should continue, 'P.False' if
    -- the foreach operation should stop with 'P.False'.

-- | A convenience synonym for @`Nothing` :: `Maybe` `CapsForeachFunc`@.
noCapsForeachFunc :: Maybe CapsForeachFunc
noCapsForeachFunc :: Maybe CapsMapFunc
noCapsForeachFunc = Maybe CapsMapFunc
forall a. Maybe a
Nothing

-- | A function that will be called in 'GI.Gst.Structs.Caps.capsForeach'. The function may
-- not modify /@features@/ or /@structure@/.
-- 
-- /Since: 1.6/
type CapsForeachFunc_WithClosures =
    Gst.CapsFeatures.CapsFeatures
    -- ^ /@features@/: the t'GI.Gst.Structs.CapsFeatures.CapsFeatures'
    -> Gst.Structure.Structure
    -- ^ /@structure@/: the t'GI.Gst.Structs.Structure.Structure'
    -> Ptr ()
    -- ^ /@userData@/: user data
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the foreach operation should continue, 'P.False' if
    -- the foreach operation should stop with 'P.False'.

-- | A convenience synonym for @`Nothing` :: `Maybe` `CapsForeachFunc_WithClosures`@.
noCapsForeachFunc_WithClosures :: Maybe CapsForeachFunc_WithClosures
noCapsForeachFunc_WithClosures :: Maybe CapsMapFunc_WithClosures
noCapsForeachFunc_WithClosures = Maybe CapsMapFunc_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_CapsForeachFunc :: CapsForeachFunc -> CapsForeachFunc_WithClosures
drop_closures_CapsForeachFunc :: CapsMapFunc -> CapsMapFunc_WithClosures
drop_closures_CapsForeachFunc CapsMapFunc
_f CapsFeatures
features Structure
structure Ptr ()
_ = CapsMapFunc
_f CapsFeatures
features Structure
structure

-- | Wrap the callback into a `GClosure`.
genClosure_CapsForeachFunc :: MonadIO m => CapsForeachFunc -> m (GClosure C_CapsForeachFunc)
genClosure_CapsForeachFunc :: CapsMapFunc -> m (GClosure C_CapsMapFunc)
genClosure_CapsForeachFunc CapsMapFunc
cb = IO (GClosure C_CapsMapFunc) -> m (GClosure C_CapsMapFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_CapsMapFunc) -> m (GClosure C_CapsMapFunc))
-> IO (GClosure C_CapsMapFunc) -> m (GClosure C_CapsMapFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: CapsMapFunc_WithClosures
cb' = CapsMapFunc -> CapsMapFunc_WithClosures
drop_closures_CapsForeachFunc CapsMapFunc
cb
    let cb'' :: C_CapsMapFunc
cb'' = Maybe (Ptr (FunPtr C_CapsMapFunc))
-> CapsMapFunc_WithClosures -> C_CapsMapFunc
wrap_CapsForeachFunc Maybe (Ptr (FunPtr C_CapsMapFunc))
forall a. Maybe a
Nothing CapsMapFunc_WithClosures
cb'
    C_CapsMapFunc -> IO (FunPtr C_CapsMapFunc)
mk_CapsForeachFunc C_CapsMapFunc
cb'' IO (FunPtr C_CapsMapFunc)
-> (FunPtr C_CapsMapFunc -> IO (GClosure C_CapsMapFunc))
-> IO (GClosure C_CapsMapFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_CapsMapFunc -> IO (GClosure C_CapsMapFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `CapsForeachFunc` into a `C_CapsForeachFunc`.
wrap_CapsForeachFunc ::
    Maybe (Ptr (FunPtr C_CapsForeachFunc)) ->
    CapsForeachFunc_WithClosures ->
    C_CapsForeachFunc
wrap_CapsForeachFunc :: Maybe (Ptr (FunPtr C_CapsMapFunc))
-> CapsMapFunc_WithClosures -> C_CapsMapFunc
wrap_CapsForeachFunc Maybe (Ptr (FunPtr C_CapsMapFunc))
funptrptr CapsMapFunc_WithClosures
_cb Ptr CapsFeatures
features Ptr Structure
structure Ptr ()
userData = do
    (ManagedPtr CapsFeatures -> CapsFeatures)
-> Ptr CapsFeatures -> (CapsFeatures -> IO CInt) -> IO CInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr CapsFeatures -> CapsFeatures
Gst.CapsFeatures.CapsFeatures Ptr CapsFeatures
features ((CapsFeatures -> IO CInt) -> IO CInt)
-> (CapsFeatures -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \CapsFeatures
features' -> do
        (ManagedPtr Structure -> Structure)
-> Ptr Structure -> (Structure -> IO CInt) -> IO CInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Structure -> Structure
Gst.Structure.Structure Ptr Structure
structure ((Structure -> IO CInt) -> IO CInt)
-> (Structure -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Structure
structure' -> do
            Bool
result <- CapsMapFunc_WithClosures
_cb  CapsFeatures
features' Structure
structure' Ptr ()
userData
            Maybe (Ptr (FunPtr C_CapsMapFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_CapsMapFunc))
funptrptr
            let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
            CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback CapsFilterMapFunc
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just
              "%TRUE if the features and structure should be preserved,\n%FALSE if it should be removed."
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "features"
          , argType =
              TInterface Name { namespace = "Gst" , name = "CapsFeatures" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the #GstCapsFeatures"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "structure"
          , argType =
              TInterface Name { namespace = "Gst" , name = "Structure" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the #GstStructure" , 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_caps_filter_and_map_in_place().\nThe function may modify @features and @structure, and both will be\nremoved from the caps if %FALSE is returned."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_CapsFilterMapFunc =
    Ptr Gst.CapsFeatures.CapsFeatures ->
    Ptr Gst.Structure.Structure ->
    Ptr () ->
    IO CInt

-- Args: [ Arg
--           { argCName = "features"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "CapsFeatures" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GstCapsFeatures"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "structure"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Structure" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GstStructure" , 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_CapsFilterMapFunc :: FunPtr C_CapsFilterMapFunc -> C_CapsFilterMapFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_CapsFilterMapFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_CapsFilterMapFunc
    -> Gst.CapsFeatures.CapsFeatures
    -- ^ /@features@/: the t'GI.Gst.Structs.CapsFeatures.CapsFeatures'
    -> Gst.Structure.Structure
    -- ^ /@structure@/: the t'GI.Gst.Structs.Structure.Structure'
    -> Ptr ()
    -- ^ /@userData@/: user data
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the features and structure should be preserved,
    -- 'P.False' if it should be removed.
dynamic_CapsFilterMapFunc :: FunPtr C_CapsMapFunc
-> CapsFeatures -> Structure -> Ptr () -> m Bool
dynamic_CapsFilterMapFunc FunPtr C_CapsMapFunc
__funPtr CapsFeatures
features Structure
structure Ptr ()
userData = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr CapsFeatures
features' <- CapsFeatures -> IO (Ptr CapsFeatures)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr CapsFeatures
features
    Ptr Structure
structure' <- Structure -> IO (Ptr Structure)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Structure
structure
    CInt
result <- (FunPtr C_CapsMapFunc -> C_CapsMapFunc
__dynamic_C_CapsFilterMapFunc FunPtr C_CapsMapFunc
__funPtr) Ptr CapsFeatures
features' Ptr Structure
structure' Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    CapsFeatures -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr CapsFeatures
features
    Structure -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Structure
structure
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

-- | A function that will be called in 'GI.Gst.Structs.Caps.capsFilterAndMapInPlace'.
-- The function may modify /@features@/ and /@structure@/, and both will be
-- removed from the caps if 'P.False' is returned.
type CapsFilterMapFunc =
    Gst.CapsFeatures.CapsFeatures
    -- ^ /@features@/: the t'GI.Gst.Structs.CapsFeatures.CapsFeatures'
    -> Gst.Structure.Structure
    -- ^ /@structure@/: the t'GI.Gst.Structs.Structure.Structure'
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the features and structure should be preserved,
    -- 'P.False' if it should be removed.

-- | A convenience synonym for @`Nothing` :: `Maybe` `CapsFilterMapFunc`@.
noCapsFilterMapFunc :: Maybe CapsFilterMapFunc
noCapsFilterMapFunc :: Maybe CapsMapFunc
noCapsFilterMapFunc = Maybe CapsMapFunc
forall a. Maybe a
Nothing

-- | A function that will be called in 'GI.Gst.Structs.Caps.capsFilterAndMapInPlace'.
-- The function may modify /@features@/ and /@structure@/, and both will be
-- removed from the caps if 'P.False' is returned.
type CapsFilterMapFunc_WithClosures =
    Gst.CapsFeatures.CapsFeatures
    -- ^ /@features@/: the t'GI.Gst.Structs.CapsFeatures.CapsFeatures'
    -> Gst.Structure.Structure
    -- ^ /@structure@/: the t'GI.Gst.Structs.Structure.Structure'
    -> Ptr ()
    -- ^ /@userData@/: user data
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the features and structure should be preserved,
    -- 'P.False' if it should be removed.

-- | A convenience synonym for @`Nothing` :: `Maybe` `CapsFilterMapFunc_WithClosures`@.
noCapsFilterMapFunc_WithClosures :: Maybe CapsFilterMapFunc_WithClosures
noCapsFilterMapFunc_WithClosures :: Maybe CapsMapFunc_WithClosures
noCapsFilterMapFunc_WithClosures = Maybe CapsMapFunc_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_CapsFilterMapFunc :: CapsFilterMapFunc -> CapsFilterMapFunc_WithClosures
drop_closures_CapsFilterMapFunc :: CapsMapFunc -> CapsMapFunc_WithClosures
drop_closures_CapsFilterMapFunc CapsMapFunc
_f CapsFeatures
features Structure
structure Ptr ()
_ = CapsMapFunc
_f CapsFeatures
features Structure
structure

-- | Wrap the callback into a `GClosure`.
genClosure_CapsFilterMapFunc :: MonadIO m => CapsFilterMapFunc -> m (GClosure C_CapsFilterMapFunc)
genClosure_CapsFilterMapFunc :: CapsMapFunc -> m (GClosure C_CapsMapFunc)
genClosure_CapsFilterMapFunc CapsMapFunc
cb = IO (GClosure C_CapsMapFunc) -> m (GClosure C_CapsMapFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_CapsMapFunc) -> m (GClosure C_CapsMapFunc))
-> IO (GClosure C_CapsMapFunc) -> m (GClosure C_CapsMapFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: CapsMapFunc_WithClosures
cb' = CapsMapFunc -> CapsMapFunc_WithClosures
drop_closures_CapsFilterMapFunc CapsMapFunc
cb
    let cb'' :: C_CapsMapFunc
cb'' = Maybe (Ptr (FunPtr C_CapsMapFunc))
-> CapsMapFunc_WithClosures -> C_CapsMapFunc
wrap_CapsFilterMapFunc Maybe (Ptr (FunPtr C_CapsMapFunc))
forall a. Maybe a
Nothing CapsMapFunc_WithClosures
cb'
    C_CapsMapFunc -> IO (FunPtr C_CapsMapFunc)
mk_CapsFilterMapFunc C_CapsMapFunc
cb'' IO (FunPtr C_CapsMapFunc)
-> (FunPtr C_CapsMapFunc -> IO (GClosure C_CapsMapFunc))
-> IO (GClosure C_CapsMapFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_CapsMapFunc -> IO (GClosure C_CapsMapFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `CapsFilterMapFunc` into a `C_CapsFilterMapFunc`.
wrap_CapsFilterMapFunc ::
    Maybe (Ptr (FunPtr C_CapsFilterMapFunc)) ->
    CapsFilterMapFunc_WithClosures ->
    C_CapsFilterMapFunc
wrap_CapsFilterMapFunc :: Maybe (Ptr (FunPtr C_CapsMapFunc))
-> CapsMapFunc_WithClosures -> C_CapsMapFunc
wrap_CapsFilterMapFunc Maybe (Ptr (FunPtr C_CapsMapFunc))
funptrptr CapsMapFunc_WithClosures
_cb Ptr CapsFeatures
features Ptr Structure
structure Ptr ()
userData = do
    (ManagedPtr CapsFeatures -> CapsFeatures)
-> Ptr CapsFeatures -> (CapsFeatures -> IO CInt) -> IO CInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr CapsFeatures -> CapsFeatures
Gst.CapsFeatures.CapsFeatures Ptr CapsFeatures
features ((CapsFeatures -> IO CInt) -> IO CInt)
-> (CapsFeatures -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \CapsFeatures
features' -> do
        (ManagedPtr Structure -> Structure)
-> Ptr Structure -> (Structure -> IO CInt) -> IO CInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Structure -> Structure
Gst.Structure.Structure Ptr Structure
structure ((Structure -> IO CInt) -> IO CInt)
-> (Structure -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Structure
structure' -> do
            Bool
result <- CapsMapFunc_WithClosures
_cb  CapsFeatures
features' Structure
structure' Ptr ()
userData
            Maybe (Ptr (FunPtr C_CapsMapFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_CapsMapFunc))
funptrptr
            let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
            CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback BusSyncHandler
{- Callable
  { returnType =
      Just
        (TInterface Name { namespace = "Gst" , name = "BusSyncReply" })
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just "#GstBusSyncReply stating what to do with the message"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "bus"
          , argType = TInterface Name { namespace = "Gst" , name = "Bus" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the #GstBus that sent the message"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "message"
          , argType =
              TInterface Name { namespace = "Gst" , name = "Message" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the #GstMessage" , 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 that has been given, when registering the handler"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 2
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Handler will be invoked synchronously, when a new message has been injected\ninto the bus. This function is mostly used internally. Only one sync handler\ncan be attached to a given bus.\n\nIf the handler returns GST_BUS_DROP, it should unref the message, else the\nmessage should not be unreffed by the sync handler."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_BusSyncHandler =
    Ptr Gst.Bus.Bus ->
    Ptr Gst.Message.Message ->
    Ptr () ->
    IO CUInt

-- Args: [ Arg
--           { argCName = "bus"
--           , argType = TInterface Name { namespace = "Gst" , name = "Bus" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GstBus that sent the message"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "message"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Message" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GstMessage" , 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 that has been given, when registering the handler"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 2
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Gst" , name = "BusSyncReply" })
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_BusSyncHandler :: FunPtr C_BusSyncHandler -> C_BusSyncHandler

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_BusSyncHandler ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.Bus.IsBus a) =>
    FunPtr C_BusSyncHandler
    -> a
    -- ^ /@bus@/: the t'GI.Gst.Objects.Bus.Bus' that sent the message
    -> Gst.Message.Message
    -- ^ /@message@/: the t'GI.Gst.Structs.Message.Message'
    -> Ptr ()
    -- ^ /@userData@/: user data that has been given, when registering the handler
    -> m Gst.Enums.BusSyncReply
    -- ^ __Returns:__ t'GI.Gst.Enums.BusSyncReply' stating what to do with the message
dynamic_BusSyncHandler :: FunPtr C_BusSyncHandler -> a -> Message -> Ptr () -> m BusSyncReply
dynamic_BusSyncHandler FunPtr C_BusSyncHandler
__funPtr a
bus Message
message Ptr ()
userData = IO BusSyncReply -> m BusSyncReply
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO BusSyncReply -> m BusSyncReply)
-> IO BusSyncReply -> m BusSyncReply
forall a b. (a -> b) -> a -> b
$ do
    Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
    Ptr Message
message' <- Message -> IO (Ptr Message)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Message
message
    CUInt
result <- (FunPtr C_BusSyncHandler -> C_BusSyncHandler
__dynamic_C_BusSyncHandler FunPtr C_BusSyncHandler
__funPtr) Ptr Bus
bus' Ptr Message
message' Ptr ()
userData
    let result' :: BusSyncReply
result' = (Int -> BusSyncReply
forall a. Enum a => Int -> a
toEnum (Int -> BusSyncReply) -> (CUInt -> Int) -> CUInt -> BusSyncReply
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
    Message -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Message
message
    BusSyncReply -> IO BusSyncReply
forall (m :: * -> *) a. Monad m => a -> m a
return BusSyncReply
result'

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

-- | Handler will be invoked synchronously, when a new message has been injected
-- into the bus. This function is mostly used internally. Only one sync handler
-- can be attached to a given bus.
-- 
-- If the handler returns GST_BUS_DROP, it should unref the message, else the
-- message should not be unreffed by the sync handler.
type BusSyncHandler =
    Gst.Bus.Bus
    -- ^ /@bus@/: the t'GI.Gst.Objects.Bus.Bus' that sent the message
    -> Gst.Message.Message
    -- ^ /@message@/: the t'GI.Gst.Structs.Message.Message'
    -> IO Gst.Enums.BusSyncReply
    -- ^ __Returns:__ t'GI.Gst.Enums.BusSyncReply' stating what to do with the message

-- | A convenience synonym for @`Nothing` :: `Maybe` `BusSyncHandler`@.
noBusSyncHandler :: Maybe BusSyncHandler
noBusSyncHandler :: Maybe BusSyncHandler
noBusSyncHandler = Maybe BusSyncHandler
forall a. Maybe a
Nothing

-- | Handler will be invoked synchronously, when a new message has been injected
-- into the bus. This function is mostly used internally. Only one sync handler
-- can be attached to a given bus.
-- 
-- If the handler returns GST_BUS_DROP, it should unref the message, else the
-- message should not be unreffed by the sync handler.
type BusSyncHandler_WithClosures =
    Gst.Bus.Bus
    -- ^ /@bus@/: the t'GI.Gst.Objects.Bus.Bus' that sent the message
    -> Gst.Message.Message
    -- ^ /@message@/: the t'GI.Gst.Structs.Message.Message'
    -> Ptr ()
    -- ^ /@userData@/: user data that has been given, when registering the handler
    -> IO Gst.Enums.BusSyncReply
    -- ^ __Returns:__ t'GI.Gst.Enums.BusSyncReply' stating what to do with the message

-- | A convenience synonym for @`Nothing` :: `Maybe` `BusSyncHandler_WithClosures`@.
noBusSyncHandler_WithClosures :: Maybe BusSyncHandler_WithClosures
noBusSyncHandler_WithClosures :: Maybe BusSyncHandler_WithClosures
noBusSyncHandler_WithClosures = Maybe BusSyncHandler_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_BusSyncHandler :: BusSyncHandler -> BusSyncHandler_WithClosures
drop_closures_BusSyncHandler :: BusSyncHandler -> BusSyncHandler_WithClosures
drop_closures_BusSyncHandler BusSyncHandler
_f Bus
bus Message
message Ptr ()
_ = BusSyncHandler
_f Bus
bus Message
message

-- | Wrap the callback into a `GClosure`.
genClosure_BusSyncHandler :: MonadIO m => BusSyncHandler -> m (GClosure C_BusSyncHandler)
genClosure_BusSyncHandler :: BusSyncHandler -> m (GClosure C_BusSyncHandler)
genClosure_BusSyncHandler BusSyncHandler
cb = IO (GClosure C_BusSyncHandler) -> m (GClosure C_BusSyncHandler)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_BusSyncHandler) -> m (GClosure C_BusSyncHandler))
-> IO (GClosure C_BusSyncHandler) -> m (GClosure C_BusSyncHandler)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: BusSyncHandler_WithClosures
cb' = BusSyncHandler -> BusSyncHandler_WithClosures
drop_closures_BusSyncHandler BusSyncHandler
cb
    let cb'' :: C_BusSyncHandler
cb'' = Maybe (Ptr (FunPtr C_BusSyncHandler))
-> BusSyncHandler_WithClosures -> C_BusSyncHandler
wrap_BusSyncHandler Maybe (Ptr (FunPtr C_BusSyncHandler))
forall a. Maybe a
Nothing BusSyncHandler_WithClosures
cb'
    C_BusSyncHandler -> IO (FunPtr C_BusSyncHandler)
mk_BusSyncHandler C_BusSyncHandler
cb'' IO (FunPtr C_BusSyncHandler)
-> (FunPtr C_BusSyncHandler -> IO (GClosure C_BusSyncHandler))
-> IO (GClosure C_BusSyncHandler)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_BusSyncHandler -> IO (GClosure C_BusSyncHandler)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `BusSyncHandler` into a `C_BusSyncHandler`.
wrap_BusSyncHandler ::
    Maybe (Ptr (FunPtr C_BusSyncHandler)) ->
    BusSyncHandler_WithClosures ->
    C_BusSyncHandler
wrap_BusSyncHandler :: Maybe (Ptr (FunPtr C_BusSyncHandler))
-> BusSyncHandler_WithClosures -> C_BusSyncHandler
wrap_BusSyncHandler Maybe (Ptr (FunPtr C_BusSyncHandler))
funptrptr BusSyncHandler_WithClosures
_cb Ptr Bus
bus Ptr Message
message Ptr ()
userData = do
    Bus
bus' <- ((ManagedPtr Bus -> Bus) -> Ptr Bus -> IO Bus
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Bus -> Bus
Gst.Bus.Bus) Ptr Bus
bus
    (ManagedPtr Message -> Message)
-> Ptr Message -> (Message -> IO CUInt) -> IO CUInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Message -> Message
Gst.Message.Message Ptr Message
message ((Message -> IO CUInt) -> IO CUInt)
-> (Message -> IO CUInt) -> IO CUInt
forall a b. (a -> b) -> a -> b
$ \Message
message' -> do
        BusSyncReply
result <- BusSyncHandler_WithClosures
_cb  Bus
bus' Message
message' Ptr ()
userData
        Maybe (Ptr (FunPtr C_BusSyncHandler)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_BusSyncHandler))
funptrptr
        let result' :: CUInt
result' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (BusSyncReply -> Int) -> BusSyncReply -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BusSyncReply -> Int
forall a. Enum a => a -> Int
fromEnum) BusSyncReply
result
        CUInt -> IO CUInt
forall (m :: * -> *) a. Monad m => a -> m a
return CUInt
result'


-- callback BusFunc
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText = Just "%FALSE if the event source should be removed."
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "bus"
          , argType = TInterface Name { namespace = "Gst" , name = "Bus" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the #GstBus that sent the message"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "message"
          , argType =
              TInterface Name { namespace = "Gst" , name = "Message" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the #GstMessage" , 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 that has been given, when registering the handler"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 2
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Specifies the type of function passed to gst_bus_add_watch() or\ngst_bus_add_watch_full(), which is called from the mainloop when a message\nis available on the bus.\n\nThe message passed to the function will be unreffed after execution of this\nfunction so it should not be freed in the function.\n\nNote that this function is used as a GSourceFunc which means that returning\n%FALSE will remove the GSource from the mainloop."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_BusFunc =
    Ptr Gst.Bus.Bus ->
    Ptr Gst.Message.Message ->
    Ptr () ->
    IO CInt

-- Args: [ Arg
--           { argCName = "bus"
--           , argType = TInterface Name { namespace = "Gst" , name = "Bus" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GstBus that sent the message"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "message"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Message" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the #GstMessage" , 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 that has been given, when registering the handler"
--                 , 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_BusFunc :: FunPtr C_BusFunc -> C_BusFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_BusFunc ::
    (B.CallStack.HasCallStack, MonadIO m, Gst.Bus.IsBus a) =>
    FunPtr C_BusFunc
    -> a
    -- ^ /@bus@/: the t'GI.Gst.Objects.Bus.Bus' that sent the message
    -> Gst.Message.Message
    -- ^ /@message@/: the t'GI.Gst.Structs.Message.Message'
    -> Ptr ()
    -- ^ /@userData@/: user data that has been given, when registering the handler
    -> m Bool
    -- ^ __Returns:__ 'P.False' if the event source should be removed.
dynamic_BusFunc :: FunPtr C_BusFunc -> a -> Message -> Ptr () -> m Bool
dynamic_BusFunc FunPtr C_BusFunc
__funPtr a
bus Message
message Ptr ()
userData = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Bus
bus' <- a -> IO (Ptr Bus)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
bus
    Ptr Message
message' <- Message -> IO (Ptr Message)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Message
message
    CInt
result <- (FunPtr C_BusFunc -> C_BusFunc
__dynamic_C_BusFunc FunPtr C_BusFunc
__funPtr) Ptr Bus
bus' Ptr Message
message' Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
bus
    Message -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Message
message
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

-- | Specifies the type of function passed to @/gst_bus_add_watch()/@ or
-- 'GI.Gst.Objects.Bus.busAddWatch', which is called from the mainloop when a message
-- is available on the bus.
-- 
-- The message passed to the function will be unreffed after execution of this
-- function so it should not be freed in the function.
-- 
-- Note that this function is used as a GSourceFunc which means that returning
-- 'P.False' will remove the GSource from the mainloop.
type BusFunc =
    Gst.Bus.Bus
    -- ^ /@bus@/: the t'GI.Gst.Objects.Bus.Bus' that sent the message
    -> Gst.Message.Message
    -- ^ /@message@/: the t'GI.Gst.Structs.Message.Message'
    -> IO Bool
    -- ^ __Returns:__ 'P.False' if the event source should be removed.

-- | A convenience synonym for @`Nothing` :: `Maybe` `BusFunc`@.
noBusFunc :: Maybe BusFunc
noBusFunc :: Maybe BusFunc
noBusFunc = Maybe BusFunc
forall a. Maybe a
Nothing

-- | Specifies the type of function passed to @/gst_bus_add_watch()/@ or
-- 'GI.Gst.Objects.Bus.busAddWatch', which is called from the mainloop when a message
-- is available on the bus.
-- 
-- The message passed to the function will be unreffed after execution of this
-- function so it should not be freed in the function.
-- 
-- Note that this function is used as a GSourceFunc which means that returning
-- 'P.False' will remove the GSource from the mainloop.
type BusFunc_WithClosures =
    Gst.Bus.Bus
    -- ^ /@bus@/: the t'GI.Gst.Objects.Bus.Bus' that sent the message
    -> Gst.Message.Message
    -- ^ /@message@/: the t'GI.Gst.Structs.Message.Message'
    -> Ptr ()
    -- ^ /@userData@/: user data that has been given, when registering the handler
    -> IO Bool
    -- ^ __Returns:__ 'P.False' if the event source should be removed.

-- | A convenience synonym for @`Nothing` :: `Maybe` `BusFunc_WithClosures`@.
noBusFunc_WithClosures :: Maybe BusFunc_WithClosures
noBusFunc_WithClosures :: Maybe BusFunc_WithClosures
noBusFunc_WithClosures = Maybe BusFunc_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_BusFunc :: BusFunc -> BusFunc_WithClosures
drop_closures_BusFunc :: BusFunc -> BusFunc_WithClosures
drop_closures_BusFunc BusFunc
_f Bus
bus Message
message Ptr ()
_ = BusFunc
_f Bus
bus Message
message

-- | Wrap the callback into a `GClosure`.
genClosure_BusFunc :: MonadIO m => BusFunc -> m (GClosure C_BusFunc)
genClosure_BusFunc :: BusFunc -> m (GClosure C_BusFunc)
genClosure_BusFunc BusFunc
cb = IO (GClosure C_BusFunc) -> m (GClosure C_BusFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_BusFunc) -> m (GClosure C_BusFunc))
-> IO (GClosure C_BusFunc) -> m (GClosure C_BusFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: BusFunc_WithClosures
cb' = BusFunc -> BusFunc_WithClosures
drop_closures_BusFunc BusFunc
cb
    let cb'' :: C_BusFunc
cb'' = Maybe (Ptr (FunPtr C_BusFunc)) -> BusFunc_WithClosures -> C_BusFunc
wrap_BusFunc Maybe (Ptr (FunPtr C_BusFunc))
forall a. Maybe a
Nothing BusFunc_WithClosures
cb'
    C_BusFunc -> IO (FunPtr C_BusFunc)
mk_BusFunc C_BusFunc
cb'' IO (FunPtr C_BusFunc)
-> (FunPtr C_BusFunc -> IO (GClosure C_BusFunc))
-> IO (GClosure C_BusFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_BusFunc -> IO (GClosure C_BusFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `BusFunc` into a `C_BusFunc`.
wrap_BusFunc ::
    Maybe (Ptr (FunPtr C_BusFunc)) ->
    BusFunc_WithClosures ->
    C_BusFunc
wrap_BusFunc :: Maybe (Ptr (FunPtr C_BusFunc)) -> BusFunc_WithClosures -> C_BusFunc
wrap_BusFunc Maybe (Ptr (FunPtr C_BusFunc))
funptrptr BusFunc_WithClosures
_cb Ptr Bus
bus Ptr Message
message Ptr ()
userData = do
    Bus
bus' <- ((ManagedPtr Bus -> Bus) -> Ptr Bus -> IO Bus
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Bus -> Bus
Gst.Bus.Bus) Ptr Bus
bus
    (ManagedPtr Message -> Message)
-> Ptr Message -> (Message -> IO CInt) -> IO CInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Message -> Message
Gst.Message.Message Ptr Message
message ((Message -> IO CInt) -> IO CInt)
-> (Message -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Message
message' -> do
        Bool
result <- BusFunc_WithClosures
_cb  Bus
bus' Message
message' Ptr ()
userData
        Maybe (Ptr (FunPtr C_BusFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_BusFunc))
funptrptr
        let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
        CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback BufferListFunc
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just "%FALSE when gst_buffer_list_foreach() should stop"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "buffer"
          , argType = TInterface Name { namespace = "Gst" , name = "Buffer" }
          , direction = DirectionOut
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "pointer the buffer" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferEverything
          }
      , Arg
          { argCName = "idx"
          , argType = TBasicType TUInt
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "the index of @buffer"
                , 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 passed to gst_buffer_list_foreach()"
                , 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 from gst_buffer_list_foreach(). The @buffer\nfield will point to a the reference of the buffer at @idx.\n\nWhen this function returns %TRUE, the next buffer will be\nreturned. When %FALSE is returned, gst_buffer_list_foreach() will return.\n\nWhen @buffer is set to %NULL, the item will be removed from the bufferlist.\nWhen @buffer has been made writable, the new buffer reference can be assigned\nto @buffer. This function is responsible for unreffing the old buffer when\nremoving or modifying."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_BufferListFunc =
    Ptr (Ptr Gst.Buffer.Buffer) ->
    Word32 ->
    Ptr () ->
    IO CInt

-- Args: [ Arg
--           { argCName = "buffer"
--           , argType = TInterface Name { namespace = "Gst" , name = "Buffer" }
--           , direction = DirectionOut
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "pointer the buffer" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "idx"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the index of @buffer"
--                 , 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 passed to gst_buffer_list_foreach()"
--                 , 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_BufferListFunc :: FunPtr C_BufferListFunc -> C_BufferListFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_BufferListFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_BufferListFunc
    -> Word32
    -- ^ /@idx@/: the index of /@buffer@/
    -> Ptr ()
    -- ^ /@userData@/: user data passed to 'GI.Gst.Structs.BufferList.bufferListForeach'
    -> m ((Bool, Maybe Gst.Buffer.Buffer))
    -- ^ __Returns:__ 'P.False' when 'GI.Gst.Structs.BufferList.bufferListForeach' should stop
dynamic_BufferListFunc :: FunPtr C_BufferListFunc
-> Word32 -> Ptr () -> m (Bool, Maybe Buffer)
dynamic_BufferListFunc FunPtr C_BufferListFunc
__funPtr Word32
idx Ptr ()
userData = IO (Bool, Maybe Buffer) -> m (Bool, Maybe Buffer)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Maybe Buffer) -> m (Bool, Maybe Buffer))
-> IO (Bool, Maybe Buffer) -> m (Bool, Maybe Buffer)
forall a b. (a -> b) -> a -> b
$ do
    Ptr (Ptr Buffer)
buffer <- IO (Ptr (Ptr Buffer))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Gst.Buffer.Buffer))
    CInt
result <- (FunPtr C_BufferListFunc -> C_BufferListFunc
__dynamic_C_BufferListFunc FunPtr C_BufferListFunc
__funPtr) Ptr (Ptr Buffer)
buffer Word32
idx Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Ptr Buffer
buffer' <- Ptr (Ptr Buffer) -> IO (Ptr Buffer)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Buffer)
buffer
    Maybe Buffer
maybeBuffer' <- Ptr Buffer -> (Ptr Buffer -> IO Buffer) -> IO (Maybe Buffer)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Buffer
buffer' ((Ptr Buffer -> IO Buffer) -> IO (Maybe Buffer))
-> (Ptr Buffer -> IO Buffer) -> IO (Maybe Buffer)
forall a b. (a -> b) -> a -> b
$ \Ptr Buffer
buffer'' -> do
        Buffer
buffer''' <- ((ManagedPtr Buffer -> Buffer) -> Ptr Buffer -> IO Buffer
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr Buffer -> Buffer
Gst.Buffer.Buffer) Ptr Buffer
buffer''
        Buffer -> IO Buffer
forall (m :: * -> *) a. Monad m => a -> m a
return Buffer
buffer'''
    Ptr (Ptr Buffer) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Buffer)
buffer
    (Bool, Maybe Buffer) -> IO (Bool, Maybe Buffer)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Maybe Buffer
maybeBuffer')

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

-- | A function that will be called from 'GI.Gst.Structs.BufferList.bufferListForeach'. The /@buffer@/
-- field will point to a the reference of the buffer at /@idx@/.
-- 
-- When this function returns 'P.True', the next buffer will be
-- returned. When 'P.False' is returned, 'GI.Gst.Structs.BufferList.bufferListForeach' will return.
-- 
-- When /@buffer@/ is set to 'P.Nothing', the item will be removed from the bufferlist.
-- When /@buffer@/ has been made writable, the new buffer reference can be assigned
-- to /@buffer@/. This function is responsible for unreffing the old buffer when
-- removing or modifying.
type BufferListFunc =
    Word32
    -- ^ /@idx@/: the index of /@buffer@/
    -> IO ((Bool, Maybe Gst.Buffer.Buffer))
    -- ^ __Returns:__ 'P.False' when 'GI.Gst.Structs.BufferList.bufferListForeach' should stop

-- | A convenience synonym for @`Nothing` :: `Maybe` `BufferListFunc`@.
noBufferListFunc :: Maybe BufferListFunc
noBufferListFunc :: Maybe BufferListFunc
noBufferListFunc = Maybe BufferListFunc
forall a. Maybe a
Nothing

-- | A function that will be called from 'GI.Gst.Structs.BufferList.bufferListForeach'. The /@buffer@/
-- field will point to a the reference of the buffer at /@idx@/.
-- 
-- When this function returns 'P.True', the next buffer will be
-- returned. When 'P.False' is returned, 'GI.Gst.Structs.BufferList.bufferListForeach' will return.
-- 
-- When /@buffer@/ is set to 'P.Nothing', the item will be removed from the bufferlist.
-- When /@buffer@/ has been made writable, the new buffer reference can be assigned
-- to /@buffer@/. This function is responsible for unreffing the old buffer when
-- removing or modifying.
type BufferListFunc_WithClosures =
    Word32
    -- ^ /@idx@/: the index of /@buffer@/
    -> Ptr ()
    -- ^ /@userData@/: user data passed to 'GI.Gst.Structs.BufferList.bufferListForeach'
    -> IO ((Bool, Maybe Gst.Buffer.Buffer))
    -- ^ __Returns:__ 'P.False' when 'GI.Gst.Structs.BufferList.bufferListForeach' should stop

-- | A convenience synonym for @`Nothing` :: `Maybe` `BufferListFunc_WithClosures`@.
noBufferListFunc_WithClosures :: Maybe BufferListFunc_WithClosures
noBufferListFunc_WithClosures :: Maybe BufferListFunc_WithClosures
noBufferListFunc_WithClosures = Maybe BufferListFunc_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_BufferListFunc :: BufferListFunc -> BufferListFunc_WithClosures
drop_closures_BufferListFunc :: BufferListFunc -> BufferListFunc_WithClosures
drop_closures_BufferListFunc BufferListFunc
_f Word32
idx Ptr ()
_ = BufferListFunc
_f Word32
idx

-- | Wrap the callback into a `GClosure`.
genClosure_BufferListFunc :: MonadIO m => BufferListFunc -> m (GClosure C_BufferListFunc)
genClosure_BufferListFunc :: BufferListFunc -> m (GClosure C_BufferListFunc)
genClosure_BufferListFunc BufferListFunc
cb = IO (GClosure C_BufferListFunc) -> m (GClosure C_BufferListFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_BufferListFunc) -> m (GClosure C_BufferListFunc))
-> IO (GClosure C_BufferListFunc) -> m (GClosure C_BufferListFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: BufferListFunc_WithClosures
cb' = BufferListFunc -> BufferListFunc_WithClosures
drop_closures_BufferListFunc BufferListFunc
cb
    let cb'' :: C_BufferListFunc
cb'' = Maybe (Ptr (FunPtr C_BufferListFunc))
-> BufferListFunc_WithClosures -> C_BufferListFunc
wrap_BufferListFunc Maybe (Ptr (FunPtr C_BufferListFunc))
forall a. Maybe a
Nothing BufferListFunc_WithClosures
cb'
    C_BufferListFunc -> IO (FunPtr C_BufferListFunc)
mk_BufferListFunc C_BufferListFunc
cb'' IO (FunPtr C_BufferListFunc)
-> (FunPtr C_BufferListFunc -> IO (GClosure C_BufferListFunc))
-> IO (GClosure C_BufferListFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_BufferListFunc -> IO (GClosure C_BufferListFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `BufferListFunc` into a `C_BufferListFunc`.
wrap_BufferListFunc ::
    Maybe (Ptr (FunPtr C_BufferListFunc)) ->
    BufferListFunc_WithClosures ->
    C_BufferListFunc
wrap_BufferListFunc :: Maybe (Ptr (FunPtr C_BufferListFunc))
-> BufferListFunc_WithClosures -> C_BufferListFunc
wrap_BufferListFunc Maybe (Ptr (FunPtr C_BufferListFunc))
funptrptr BufferListFunc_WithClosures
_cb Ptr (Ptr Buffer)
buffer Word32
idx Ptr ()
userData = do
    (Bool
result, Maybe Buffer
outbuffer) <- BufferListFunc_WithClosures
_cb  Word32
idx Ptr ()
userData
    Ptr Buffer
outbuffer' <- case Maybe Buffer
outbuffer of
        Maybe Buffer
Nothing -> Ptr Buffer -> IO (Ptr Buffer)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Buffer
forall a. Ptr a
nullPtr
        Just Buffer
outbuffer' -> do
            Ptr Buffer
outbuffer'' <- Buffer -> IO (Ptr Buffer)
forall a. (HasCallStack, GBoxed a) => a -> IO (Ptr a)
B.ManagedPtr.disownBoxed Buffer
outbuffer'
            Ptr Buffer -> IO (Ptr Buffer)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Buffer
outbuffer''
    Ptr (Ptr Buffer) -> Ptr Buffer -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (Ptr Buffer)
buffer Ptr Buffer
outbuffer'
    Maybe (Ptr (FunPtr C_BufferListFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_BufferListFunc))
funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
    CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback BufferForeachMetaFunc
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just "%FALSE when gst_buffer_foreach_meta() should stop"
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "buffer"
          , argType = TInterface Name { namespace = "Gst" , name = "Buffer" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GstBuffer" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "meta"
          , argType = TInterface Name { namespace = "Gst" , name = "Meta" }
          , direction = DirectionOut
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "a pointer to a #GstMeta"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferEverything
          }
      , Arg
          { argCName = "user_data"
          , argType = TBasicType TPtr
          , direction = DirectionIn
          , mayBeNull = True
          , argDoc =
              Documentation
                { rawDocText = Just "user data passed to gst_buffer_foreach_meta()"
                , 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 from gst_buffer_foreach_meta(). The @meta\nfield will point to a the reference of the meta.\n\n@buffer should not be modified from this callback.\n\nWhen this function returns %TRUE, the next meta will be\nreturned. When %FALSE is returned, gst_buffer_foreach_meta() will return.\n\nWhen @meta is set to %NULL, the item will be removed from the buffer."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_BufferForeachMetaFunc =
    Ptr Gst.Buffer.Buffer ->
    Ptr (Ptr Gst.Meta.Meta) ->
    Ptr () ->
    IO CInt

-- Args: [ Arg
--           { argCName = "buffer"
--           , argType = TInterface Name { namespace = "Gst" , name = "Buffer" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstBuffer" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "meta"
--           , argType = TInterface Name { namespace = "Gst" , name = "Meta" }
--           , direction = DirectionOut
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a pointer to a #GstMeta"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "user data passed to gst_buffer_foreach_meta()"
--                 , 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_BufferForeachMetaFunc :: FunPtr C_BufferForeachMetaFunc -> C_BufferForeachMetaFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_BufferForeachMetaFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_BufferForeachMetaFunc
    -> Gst.Buffer.Buffer
    -- ^ /@buffer@/: a t'GI.Gst.Structs.Buffer.Buffer'
    -> Ptr ()
    -- ^ /@userData@/: user data passed to 'GI.Gst.Structs.Buffer.bufferForeachMeta'
    -> m ((Bool, Maybe Gst.Meta.Meta))
    -- ^ __Returns:__ 'P.False' when 'GI.Gst.Structs.Buffer.bufferForeachMeta' should stop
dynamic_BufferForeachMetaFunc :: FunPtr C_BufferForeachMetaFunc
-> Buffer -> Ptr () -> m (Bool, Maybe Meta)
dynamic_BufferForeachMetaFunc FunPtr C_BufferForeachMetaFunc
__funPtr Buffer
buffer Ptr ()
userData = IO (Bool, Maybe Meta) -> m (Bool, Maybe Meta)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Maybe Meta) -> m (Bool, Maybe Meta))
-> IO (Bool, Maybe Meta) -> m (Bool, Maybe Meta)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Buffer
buffer' <- Buffer -> IO (Ptr Buffer)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Buffer
buffer
    Ptr (Ptr Meta)
meta <- IO (Ptr (Ptr Meta))
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr (Ptr Gst.Meta.Meta))
    CInt
result <- (FunPtr C_BufferForeachMetaFunc -> C_BufferForeachMetaFunc
__dynamic_C_BufferForeachMetaFunc FunPtr C_BufferForeachMetaFunc
__funPtr) Ptr Buffer
buffer' Ptr (Ptr Meta)
meta Ptr ()
userData
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Ptr Meta
meta' <- Ptr (Ptr Meta) -> IO (Ptr Meta)
forall a. Storable a => Ptr a -> IO a
peek Ptr (Ptr Meta)
meta
    Maybe Meta
maybeMeta' <- Ptr Meta -> (Ptr Meta -> IO Meta) -> IO (Maybe Meta)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Meta
meta' ((Ptr Meta -> IO Meta) -> IO (Maybe Meta))
-> (Ptr Meta -> IO Meta) -> IO (Maybe Meta)
forall a b. (a -> b) -> a -> b
$ \Ptr Meta
meta'' -> do
        Meta
meta''' <- ((ManagedPtr Meta -> Meta) -> Ptr Meta -> IO Meta
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr Meta -> Meta
Gst.Meta.Meta) Ptr Meta
meta''
        Meta -> IO Meta
forall (m :: * -> *) a. Monad m => a -> m a
return Meta
meta'''
    Buffer -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Buffer
buffer
    Ptr (Ptr Meta) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr Meta)
meta
    (Bool, Maybe Meta) -> IO (Bool, Maybe Meta)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Maybe Meta
maybeMeta')

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

-- | A function that will be called from 'GI.Gst.Structs.Buffer.bufferForeachMeta'. The /@meta@/
-- field will point to a the reference of the meta.
-- 
-- /@buffer@/ should not be modified from this callback.
-- 
-- When this function returns 'P.True', the next meta will be
-- returned. When 'P.False' is returned, 'GI.Gst.Structs.Buffer.bufferForeachMeta' will return.
-- 
-- When /@meta@/ is set to 'P.Nothing', the item will be removed from the buffer.
type BufferForeachMetaFunc =
    Gst.Buffer.Buffer
    -- ^ /@buffer@/: a t'GI.Gst.Structs.Buffer.Buffer'
    -> IO ((Bool, Maybe Gst.Meta.Meta))
    -- ^ __Returns:__ 'P.False' when 'GI.Gst.Structs.Buffer.bufferForeachMeta' should stop

-- | A convenience synonym for @`Nothing` :: `Maybe` `BufferForeachMetaFunc`@.
noBufferForeachMetaFunc :: Maybe BufferForeachMetaFunc
noBufferForeachMetaFunc :: Maybe BufferForeachMetaFunc
noBufferForeachMetaFunc = Maybe BufferForeachMetaFunc
forall a. Maybe a
Nothing

-- | A function that will be called from 'GI.Gst.Structs.Buffer.bufferForeachMeta'. The /@meta@/
-- field will point to a the reference of the meta.
-- 
-- /@buffer@/ should not be modified from this callback.
-- 
-- When this function returns 'P.True', the next meta will be
-- returned. When 'P.False' is returned, 'GI.Gst.Structs.Buffer.bufferForeachMeta' will return.
-- 
-- When /@meta@/ is set to 'P.Nothing', the item will be removed from the buffer.
type BufferForeachMetaFunc_WithClosures =
    Gst.Buffer.Buffer
    -- ^ /@buffer@/: a t'GI.Gst.Structs.Buffer.Buffer'
    -> Ptr ()
    -- ^ /@userData@/: user data passed to 'GI.Gst.Structs.Buffer.bufferForeachMeta'
    -> IO ((Bool, Maybe Gst.Meta.Meta))
    -- ^ __Returns:__ 'P.False' when 'GI.Gst.Structs.Buffer.bufferForeachMeta' should stop

-- | A convenience synonym for @`Nothing` :: `Maybe` `BufferForeachMetaFunc_WithClosures`@.
noBufferForeachMetaFunc_WithClosures :: Maybe BufferForeachMetaFunc_WithClosures
noBufferForeachMetaFunc_WithClosures :: Maybe BufferForeachMetaFunc_WithClosures
noBufferForeachMetaFunc_WithClosures = Maybe BufferForeachMetaFunc_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_BufferForeachMetaFunc :: BufferForeachMetaFunc -> BufferForeachMetaFunc_WithClosures
drop_closures_BufferForeachMetaFunc :: BufferForeachMetaFunc -> BufferForeachMetaFunc_WithClosures
drop_closures_BufferForeachMetaFunc BufferForeachMetaFunc
_f Buffer
buffer Ptr ()
_ = BufferForeachMetaFunc
_f Buffer
buffer

-- | Wrap the callback into a `GClosure`.
genClosure_BufferForeachMetaFunc :: MonadIO m => BufferForeachMetaFunc -> m (GClosure C_BufferForeachMetaFunc)
genClosure_BufferForeachMetaFunc :: BufferForeachMetaFunc -> m (GClosure C_BufferForeachMetaFunc)
genClosure_BufferForeachMetaFunc BufferForeachMetaFunc
cb = IO (GClosure C_BufferForeachMetaFunc)
-> m (GClosure C_BufferForeachMetaFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_BufferForeachMetaFunc)
 -> m (GClosure C_BufferForeachMetaFunc))
-> IO (GClosure C_BufferForeachMetaFunc)
-> m (GClosure C_BufferForeachMetaFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: BufferForeachMetaFunc_WithClosures
cb' = BufferForeachMetaFunc -> BufferForeachMetaFunc_WithClosures
drop_closures_BufferForeachMetaFunc BufferForeachMetaFunc
cb
    let cb'' :: C_BufferForeachMetaFunc
cb'' = Maybe (Ptr (FunPtr C_BufferForeachMetaFunc))
-> BufferForeachMetaFunc_WithClosures -> C_BufferForeachMetaFunc
wrap_BufferForeachMetaFunc Maybe (Ptr (FunPtr C_BufferForeachMetaFunc))
forall a. Maybe a
Nothing BufferForeachMetaFunc_WithClosures
cb'
    C_BufferForeachMetaFunc -> IO (FunPtr C_BufferForeachMetaFunc)
mk_BufferForeachMetaFunc C_BufferForeachMetaFunc
cb'' IO (FunPtr C_BufferForeachMetaFunc)
-> (FunPtr C_BufferForeachMetaFunc
    -> IO (GClosure C_BufferForeachMetaFunc))
-> IO (GClosure C_BufferForeachMetaFunc)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_BufferForeachMetaFunc
-> IO (GClosure C_BufferForeachMetaFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `BufferForeachMetaFunc` into a `C_BufferForeachMetaFunc`.
wrap_BufferForeachMetaFunc ::
    Maybe (Ptr (FunPtr C_BufferForeachMetaFunc)) ->
    BufferForeachMetaFunc_WithClosures ->
    C_BufferForeachMetaFunc
wrap_BufferForeachMetaFunc :: Maybe (Ptr (FunPtr C_BufferForeachMetaFunc))
-> BufferForeachMetaFunc_WithClosures -> C_BufferForeachMetaFunc
wrap_BufferForeachMetaFunc Maybe (Ptr (FunPtr C_BufferForeachMetaFunc))
funptrptr BufferForeachMetaFunc_WithClosures
_cb Ptr Buffer
buffer Ptr (Ptr Meta)
meta Ptr ()
userData = do
    (ManagedPtr Buffer -> Buffer)
-> Ptr Buffer -> (Buffer -> IO CInt) -> IO CInt
forall a b.
(HasCallStack, ManagedPtrNewtype a) =>
(ManagedPtr a -> a) -> Ptr a -> (a -> IO b) -> IO b
B.ManagedPtr.withTransient ManagedPtr Buffer -> Buffer
Gst.Buffer.Buffer Ptr Buffer
buffer ((Buffer -> IO CInt) -> IO CInt) -> (Buffer -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ \Buffer
buffer' -> do
        (Bool
result, Maybe Meta
outmeta) <- BufferForeachMetaFunc_WithClosures
_cb  Buffer
buffer' Ptr ()
userData
        Ptr Meta
outmeta' <- case Maybe Meta
outmeta of
            Maybe Meta
Nothing -> Ptr Meta -> IO (Ptr Meta)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Meta
forall a. Ptr a
nullPtr
            Just Meta
outmeta' -> do
                Ptr Meta
outmeta'' <- Meta -> IO (Ptr Meta)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Meta
outmeta'
                Ptr Meta -> IO (Ptr Meta)
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr Meta
outmeta''
        Ptr (Ptr Meta) -> Ptr Meta -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr (Ptr Meta)
meta Ptr Meta
outmeta'
        Maybe (Ptr (FunPtr C_BufferForeachMetaFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_BufferForeachMetaFunc))
funptrptr
        let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
result
        CInt -> IO CInt
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'