-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- 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.GES.Callbacks
    ( 

 -- * Signals


-- ** BaseEffectTimeTranslationFunc #signal:BaseEffectTimeTranslationFunc#

    BaseEffectTimeTranslationFunc           ,
    BaseEffectTimeTranslationFunc_WithClosures,
    C_BaseEffectTimeTranslationFunc         ,
    drop_closures_BaseEffectTimeTranslationFunc,
    dynamic_BaseEffectTimeTranslationFunc   ,
    genClosure_BaseEffectTimeTranslationFunc,
    mk_BaseEffectTimeTranslationFunc        ,
    noBaseEffectTimeTranslationFunc         ,
    noBaseEffectTimeTranslationFunc_WithClosures,
    wrap_BaseEffectTimeTranslationFunc      ,


-- ** CreateTrackElementFunc #signal:CreateTrackElementFunc#

    C_CreateTrackElementFunc                ,
    CreateTrackElementFunc                  ,
    dynamic_CreateTrackElementFunc          ,
    genClosure_CreateTrackElementFunc       ,
    mk_CreateTrackElementFunc               ,
    noCreateTrackElementFunc                ,
    wrap_CreateTrackElementFunc             ,


-- ** CreateTrackElementsFunc #signal:CreateTrackElementsFunc#

    C_CreateTrackElementsFunc               ,
    CreateTrackElementsFunc                 ,
    dynamic_CreateTrackElementsFunc         ,
    genClosure_CreateTrackElementsFunc      ,
    mk_CreateTrackElementsFunc              ,
    noCreateTrackElementsFunc               ,
    wrap_CreateTrackElementsFunc            ,


-- ** ExtractableCheckId #signal:ExtractableCheckId#

    C_ExtractableCheckId                    ,
    ExtractableCheckId                      ,
    dynamic_ExtractableCheckId              ,
    mk_ExtractableCheckId                   ,
    noExtractableCheckId                    ,


-- ** FillTrackElementFunc #signal:FillTrackElementFunc#

    C_FillTrackElementFunc                  ,
    FillTrackElementFunc                    ,
    dynamic_FillTrackElementFunc            ,
    genClosure_FillTrackElementFunc         ,
    mk_FillTrackElementFunc                 ,
    noFillTrackElementFunc                  ,
    wrap_FillTrackElementFunc               ,


-- ** FormatterCanLoadURIMethod #signal:FormatterCanLoadURIMethod#

    C_FormatterCanLoadURIMethod             ,
    FormatterCanLoadURIMethod               ,
    dynamic_FormatterCanLoadURIMethod       ,
    mk_FormatterCanLoadURIMethod            ,
    noFormatterCanLoadURIMethod             ,


-- ** FormatterLoadFromURIMethod #signal:FormatterLoadFromURIMethod#

    C_FormatterLoadFromURIMethod            ,
    FormatterLoadFromURIMethod              ,
    dynamic_FormatterLoadFromURIMethod      ,
    mk_FormatterLoadFromURIMethod           ,
    noFormatterLoadFromURIMethod            ,


-- ** FormatterSaveToURIMethod #signal:FormatterSaveToURIMethod#

    C_FormatterSaveToURIMethod              ,
    FormatterSaveToURIMethod                ,
    dynamic_FormatterSaveToURIMethod        ,
    mk_FormatterSaveToURIMethod             ,
    noFormatterSaveToURIMethod              ,


-- ** MetaForeachFunc #signal:MetaForeachFunc#

    C_MetaForeachFunc                       ,
    MetaForeachFunc                         ,
    MetaForeachFunc_WithClosures            ,
    drop_closures_MetaForeachFunc           ,
    dynamic_MetaForeachFunc                 ,
    genClosure_MetaForeachFunc              ,
    mk_MetaForeachFunc                      ,
    noMetaForeachFunc                       ,
    noMetaForeachFunc_WithClosures          ,
    wrap_MetaForeachFunc                    ,




    ) 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.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
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.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
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 GHC.Records as R

import {-# SOURCE #-} qualified GI.GES.Flags as GES.Flags
import {-# SOURCE #-} qualified GI.GES.Interfaces.MetaContainer as GES.MetaContainer
import {-# SOURCE #-} qualified GI.GES.Objects.BaseEffect as GES.BaseEffect
import {-# SOURCE #-} qualified GI.GES.Objects.Clip as GES.Clip
import {-# SOURCE #-} qualified GI.GES.Objects.Formatter as GES.Formatter
import {-# SOURCE #-} qualified GI.GES.Objects.Timeline as GES.Timeline
import {-# SOURCE #-} qualified GI.GES.Objects.TrackElement as GES.TrackElement
import qualified GI.Gst.Objects.Element as Gst.Element

-- callback MetaForeachFunc
{- Callable
  { returnType = Nothing
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "container"
          , argType =
              TInterface Name { namespace = "GES" , name = "MetaContainer" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "A #GESMetaContainer"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "key"
          , argType = TBasicType TUTF8
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The key for one of @container's fields"
                , 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 set value under @key"
                , 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 = 3
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just "A method to be called on all of a meta container's fields."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_MetaForeachFunc =
    Ptr GES.MetaContainer.MetaContainer ->
    CString ->
    Ptr GValue ->
    Ptr () ->
    IO ()

-- Args: [ Arg
--           { argCName = "container"
--           , argType =
--               TInterface Name { namespace = "GES" , name = "MetaContainer" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A #GESMetaContainer"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "key"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The key for one of @container's fields"
--                 , 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 set value under @key"
--                 , 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 = 3
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_MetaForeachFunc :: FunPtr C_MetaForeachFunc -> C_MetaForeachFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_MetaForeachFunc ::
    (B.CallStack.HasCallStack, MonadIO m, GES.MetaContainer.IsMetaContainer a) =>
    FunPtr C_MetaForeachFunc
    -> a
    -- ^ /@container@/: A t'GI.GES.Interfaces.MetaContainer.MetaContainer'
    -> T.Text
    -- ^ /@key@/: The key for one of /@container@/\'s fields
    -> GValue
    -- ^ /@value@/: The set value under /@key@/
    -> Ptr ()
    -- ^ /@userData@/: User data
    -> m ()
dynamic_MetaForeachFunc :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsMetaContainer a) =>
FunPtr C_MetaForeachFunc -> a -> Text -> GValue -> Ptr () -> m ()
dynamic_MetaForeachFunc FunPtr C_MetaForeachFunc
__funPtr a
container Text
key GValue
value Ptr ()
userData = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr MetaContainer
container' <- a -> IO (Ptr MetaContainer)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
container
    CString
key' <- Text -> IO CString
textToCString Text
key
    Ptr GValue
value' <- GValue -> IO (Ptr GValue)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr GValue
value
    (FunPtr C_MetaForeachFunc -> C_MetaForeachFunc
__dynamic_C_MetaForeachFunc FunPtr C_MetaForeachFunc
__funPtr) Ptr MetaContainer
container' CString
key' Ptr GValue
value' Ptr ()
userData
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
container
    GValue -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr GValue
value
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
key'
    () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()

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

-- | A method to be called on all of a meta container\'s fields.
type MetaForeachFunc =
    GES.MetaContainer.MetaContainer
    -- ^ /@container@/: A t'GI.GES.Interfaces.MetaContainer.MetaContainer'
    -> T.Text
    -- ^ /@key@/: The key for one of /@container@/\'s fields
    -> GValue
    -- ^ /@value@/: The set value under /@key@/
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `MetaForeachFunc`@.
noMetaForeachFunc :: Maybe MetaForeachFunc
noMetaForeachFunc :: Maybe MetaForeachFunc
noMetaForeachFunc = Maybe MetaForeachFunc
forall a. Maybe a
Nothing

-- | A method to be called on all of a meta container\'s fields.
type MetaForeachFunc_WithClosures =
    GES.MetaContainer.MetaContainer
    -- ^ /@container@/: A t'GI.GES.Interfaces.MetaContainer.MetaContainer'
    -> T.Text
    -- ^ /@key@/: The key for one of /@container@/\'s fields
    -> GValue
    -- ^ /@value@/: The set value under /@key@/
    -> Ptr ()
    -- ^ /@userData@/: User data
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `MetaForeachFunc_WithClosures`@.
noMetaForeachFunc_WithClosures :: Maybe MetaForeachFunc_WithClosures
noMetaForeachFunc_WithClosures :: Maybe MetaForeachFunc_WithClosures
noMetaForeachFunc_WithClosures = Maybe MetaForeachFunc_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_MetaForeachFunc :: MetaForeachFunc -> MetaForeachFunc_WithClosures
drop_closures_MetaForeachFunc :: MetaForeachFunc -> MetaForeachFunc_WithClosures
drop_closures_MetaForeachFunc MetaForeachFunc
_f MetaContainer
container Text
key GValue
value Ptr ()
_ = MetaForeachFunc
_f MetaContainer
container Text
key GValue
value

-- | Wrap the callback into a `GClosure`.
genClosure_MetaForeachFunc :: MonadIO m => MetaForeachFunc -> m (GClosure C_MetaForeachFunc)
genClosure_MetaForeachFunc :: forall (m :: * -> *).
MonadIO m =>
MetaForeachFunc -> m (GClosure C_MetaForeachFunc)
genClosure_MetaForeachFunc MetaForeachFunc
cb = IO (GClosure C_MetaForeachFunc) -> m (GClosure C_MetaForeachFunc)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_MetaForeachFunc) -> m (GClosure C_MetaForeachFunc))
-> IO (GClosure C_MetaForeachFunc)
-> m (GClosure C_MetaForeachFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: MetaForeachFunc_WithClosures
cb' = MetaForeachFunc -> MetaForeachFunc_WithClosures
drop_closures_MetaForeachFunc MetaForeachFunc
cb
    let cb'' :: C_MetaForeachFunc
cb'' = Maybe (Ptr (FunPtr C_MetaForeachFunc))
-> MetaForeachFunc_WithClosures -> C_MetaForeachFunc
wrap_MetaForeachFunc Maybe (Ptr (FunPtr C_MetaForeachFunc))
forall a. Maybe a
Nothing MetaForeachFunc_WithClosures
cb'
    C_MetaForeachFunc -> IO (FunPtr C_MetaForeachFunc)
mk_MetaForeachFunc C_MetaForeachFunc
cb'' IO (FunPtr C_MetaForeachFunc)
-> (FunPtr C_MetaForeachFunc -> IO (GClosure C_MetaForeachFunc))
-> IO (GClosure C_MetaForeachFunc)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_MetaForeachFunc -> IO (GClosure C_MetaForeachFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `MetaForeachFunc` into a `C_MetaForeachFunc`.
wrap_MetaForeachFunc :: 
    Maybe (Ptr (FunPtr C_MetaForeachFunc)) ->
    MetaForeachFunc_WithClosures ->
    C_MetaForeachFunc
wrap_MetaForeachFunc :: Maybe (Ptr (FunPtr C_MetaForeachFunc))
-> MetaForeachFunc_WithClosures -> C_MetaForeachFunc
wrap_MetaForeachFunc Maybe (Ptr (FunPtr C_MetaForeachFunc))
gi'funptrptr MetaForeachFunc_WithClosures
gi'cb Ptr MetaContainer
container CString
key Ptr GValue
value Ptr ()
userData = do
    MetaContainer
container' <- ((ManagedPtr MetaContainer -> MetaContainer)
-> Ptr MetaContainer -> IO MetaContainer
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr MetaContainer -> MetaContainer
GES.MetaContainer.MetaContainer) Ptr MetaContainer
container
    Text
key' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
key
    GValue
value' <- Ptr GValue -> IO GValue
B.GValue.newGValueFromPtr Ptr GValue
value
    MetaForeachFunc_WithClosures
gi'cb  MetaContainer
container' Text
key' GValue
value' Ptr ()
userData
    Maybe (Ptr (FunPtr C_MetaForeachFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_MetaForeachFunc))
gi'funptrptr


-- callback FormatterSaveToURIMethod
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just
              "TRUE if the timeline data was successfully saved to the URI\nelse FALSE."
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "formatter"
          , argType =
              TInterface Name { namespace = "GES" , name = "Formatter" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GESFormatter" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "timeline"
          , argType =
              TInterface Name { namespace = "GES" , name = "Timeline" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GESTimeline" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "uri"
          , argType = TBasicType TUTF8
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #gchar * pointing to a URI"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "overwrite"
          , argType = TBasicType TBoolean
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "%TRUE to overwrite file if it exists"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = True
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Virtual method for saving a timeline to a uri.\n\nEvery #GESFormatter subclass needs to implement this method."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_FormatterSaveToURIMethod =
    Ptr GES.Formatter.Formatter ->
    Ptr GES.Timeline.Timeline ->
    CString ->
    CInt ->
    Ptr (Ptr GError) ->
    IO CInt

-- Args: [ Arg
--           { argCName = "formatter"
--           , argType =
--               TInterface Name { namespace = "GES" , name = "Formatter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GESFormatter" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "timeline"
--           , argType =
--               TInterface Name { namespace = "GES" , name = "Timeline" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GESTimeline" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "uri"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #gchar * pointing to a URI"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "overwrite"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "%TRUE to overwrite file if it exists"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_FormatterSaveToURIMethod :: FunPtr C_FormatterSaveToURIMethod -> C_FormatterSaveToURIMethod

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_FormatterSaveToURIMethod ::
    (B.CallStack.HasCallStack, MonadIO m, GES.Formatter.IsFormatter a, GES.Timeline.IsTimeline b) =>
    FunPtr C_FormatterSaveToURIMethod
    -> a
    -- ^ /@formatter@/: a t'GI.GES.Objects.Formatter.Formatter'
    -> b
    -- ^ /@timeline@/: a t'GI.GES.Objects.Timeline.Timeline'
    -> T.Text
    -- ^ /@uri@/: a @/gchar/@ * pointing to a URI
    -> Bool
    -- ^ /@overwrite@/: 'P.True' to overwrite file if it exists
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
dynamic_FormatterSaveToURIMethod :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsFormatter a, IsTimeline b) =>
FunPtr C_FormatterSaveToURIMethod -> a -> b -> Text -> Bool -> m ()
dynamic_FormatterSaveToURIMethod FunPtr C_FormatterSaveToURIMethod
__funPtr a
formatter b
timeline Text
uri Bool
overwrite = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Formatter
formatter' <- a -> IO (Ptr Formatter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
formatter
    Ptr Timeline
timeline' <- b -> IO (Ptr Timeline)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
timeline
    CString
uri' <- Text -> IO CString
textToCString Text
uri
    let overwrite' :: CInt
overwrite' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.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
P.fromEnum) Bool
overwrite
    IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ (FunPtr C_FormatterSaveToURIMethod -> C_FormatterSaveToURIMethod
__dynamic_C_FormatterSaveToURIMethod FunPtr C_FormatterSaveToURIMethod
__funPtr) Ptr Formatter
formatter' Ptr Timeline
timeline' CString
uri' CInt
overwrite'
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
formatter
        b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
timeline
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uri'
        () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uri'
     )

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

-- | Virtual method for saving a timeline to a uri.
-- 
-- Every t'GI.GES.Objects.Formatter.Formatter' subclass needs to implement this method.
type FormatterSaveToURIMethod =
    GES.Formatter.Formatter
    -- ^ /@formatter@/: a t'GI.GES.Objects.Formatter.Formatter'
    -> GES.Timeline.Timeline
    -- ^ /@timeline@/: a t'GI.GES.Objects.Timeline.Timeline'
    -> T.Text
    -- ^ /@uri@/: a @/gchar/@ * pointing to a URI
    -> Bool
    -- ^ /@overwrite@/: 'P.True' to overwrite file if it exists
    -> IO ()
    -- ^ __Returns:__ TRUE if the timeline data was successfully saved to the URI
    -- else FALSE. /(Can throw 'Data.GI.Base.GError.GError')/

-- | A convenience synonym for @`Nothing` :: `Maybe` `FormatterSaveToURIMethod`@.
noFormatterSaveToURIMethod :: Maybe FormatterSaveToURIMethod
noFormatterSaveToURIMethod :: Maybe FormatterSaveToURIMethod
noFormatterSaveToURIMethod = Maybe FormatterSaveToURIMethod
forall a. Maybe a
Nothing

-- No Haskell->C wrapper generated since the function throws.

-- callback FormatterLoadFromURIMethod
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just
              "TRUE if the timeline data was successfully loaded from the URI,\nelse FALSE."
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "formatter"
          , argType =
              TInterface Name { namespace = "GES" , name = "Formatter" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GESFormatter" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "timeline"
          , argType =
              TInterface Name { namespace = "GES" , name = "Timeline" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #GESTimeline" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "uri"
          , argType = TBasicType TUTF8
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "a #gchar * pointing to a URI"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = True
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Virtual method for loading a timeline from a given URI.\n\nEvery #GESFormatter subclass needs to implement this method."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_FormatterLoadFromURIMethod =
    Ptr GES.Formatter.Formatter ->
    Ptr GES.Timeline.Timeline ->
    CString ->
    Ptr (Ptr GError) ->
    IO CInt

-- Args: [ Arg
--           { argCName = "formatter"
--           , argType =
--               TInterface Name { namespace = "GES" , name = "Formatter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GESFormatter" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "timeline"
--           , argType =
--               TInterface Name { namespace = "GES" , name = "Timeline" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GESTimeline" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "uri"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #gchar * pointing to a URI"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_FormatterLoadFromURIMethod :: FunPtr C_FormatterLoadFromURIMethod -> C_FormatterLoadFromURIMethod

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_FormatterLoadFromURIMethod ::
    (B.CallStack.HasCallStack, MonadIO m, GES.Formatter.IsFormatter a, GES.Timeline.IsTimeline b) =>
    FunPtr C_FormatterLoadFromURIMethod
    -> a
    -- ^ /@formatter@/: a t'GI.GES.Objects.Formatter.Formatter'
    -> b
    -- ^ /@timeline@/: a t'GI.GES.Objects.Timeline.Timeline'
    -> T.Text
    -- ^ /@uri@/: a @/gchar/@ * pointing to a URI
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
dynamic_FormatterLoadFromURIMethod :: forall (m :: * -> *) a b.
(HasCallStack, MonadIO m, IsFormatter a, IsTimeline b) =>
FunPtr C_FormatterLoadFromURIMethod -> a -> b -> Text -> m ()
dynamic_FormatterLoadFromURIMethod FunPtr C_FormatterLoadFromURIMethod
__funPtr a
formatter b
timeline Text
uri = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Formatter
formatter' <- a -> IO (Ptr Formatter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
formatter
    Ptr Timeline
timeline' <- b -> IO (Ptr Timeline)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
timeline
    CString
uri' <- Text -> IO CString
textToCString Text
uri
    IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ (FunPtr C_FormatterLoadFromURIMethod -> C_FormatterLoadFromURIMethod
__dynamic_C_FormatterLoadFromURIMethod FunPtr C_FormatterLoadFromURIMethod
__funPtr) Ptr Formatter
formatter' Ptr Timeline
timeline' CString
uri'
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
formatter
        b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
timeline
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uri'
        () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uri'
     )

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

-- | Virtual method for loading a timeline from a given URI.
-- 
-- Every t'GI.GES.Objects.Formatter.Formatter' subclass needs to implement this method.
type FormatterLoadFromURIMethod =
    GES.Formatter.Formatter
    -- ^ /@formatter@/: a t'GI.GES.Objects.Formatter.Formatter'
    -> GES.Timeline.Timeline
    -- ^ /@timeline@/: a t'GI.GES.Objects.Timeline.Timeline'
    -> T.Text
    -- ^ /@uri@/: a @/gchar/@ * pointing to a URI
    -> IO ()
    -- ^ __Returns:__ TRUE if the timeline data was successfully loaded from the URI,
    -- else FALSE. /(Can throw 'Data.GI.Base.GError.GError')/

-- | A convenience synonym for @`Nothing` :: `Maybe` `FormatterLoadFromURIMethod`@.
noFormatterLoadFromURIMethod :: Maybe FormatterLoadFromURIMethod
noFormatterLoadFromURIMethod :: Maybe FormatterLoadFromURIMethod
noFormatterLoadFromURIMethod = Maybe FormatterLoadFromURIMethod
forall a. Maybe a
Nothing

-- No Haskell->C wrapper generated since the function throws.

-- callback FormatterCanLoadURIMethod
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "dummy_instance"
          , argType =
              TInterface Name { namespace = "GES" , name = "Formatter" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "uri"
          , argType = TBasicType TUTF8
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation { rawDocText = Nothing , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = True
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_FormatterCanLoadURIMethod =
    Ptr GES.Formatter.Formatter ->
    CString ->
    Ptr (Ptr GError) ->
    IO CInt

-- Args: [ Arg
--           { argCName = "dummy_instance"
--           , argType =
--               TInterface Name { namespace = "GES" , name = "Formatter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "uri"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation { rawDocText = Nothing , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_FormatterCanLoadURIMethod :: FunPtr C_FormatterCanLoadURIMethod -> C_FormatterCanLoadURIMethod

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_FormatterCanLoadURIMethod ::
    (B.CallStack.HasCallStack, MonadIO m, GES.Formatter.IsFormatter a) =>
    FunPtr C_FormatterCanLoadURIMethod
    -> a
    -> T.Text
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
dynamic_FormatterCanLoadURIMethod :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsFormatter a) =>
FunPtr C_FormatterCanLoadURIMethod -> a -> Text -> m ()
dynamic_FormatterCanLoadURIMethod FunPtr C_FormatterCanLoadURIMethod
__funPtr a
dummyInstance Text
uri = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Formatter
dummyInstance' <- a -> IO (Ptr Formatter)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
dummyInstance
    CString
uri' <- Text -> IO CString
textToCString Text
uri
    IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO a
onException (do
        CInt
_ <- (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CInt) -> IO CInt)
-> (Ptr (Ptr GError) -> IO CInt) -> IO CInt
forall a b. (a -> b) -> a -> b
$ (FunPtr C_FormatterCanLoadURIMethod -> C_FormatterCanLoadURIMethod
__dynamic_C_FormatterCanLoadURIMethod FunPtr C_FormatterCanLoadURIMethod
__funPtr) Ptr Formatter
dummyInstance' CString
uri'
        a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
dummyInstance
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uri'
        () -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
     ) (do
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
uri'
     )

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

-- | /No description available in the introspection data./
type FormatterCanLoadURIMethod =
    GES.Formatter.Formatter
    -> T.Text
    -> IO ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/

-- | A convenience synonym for @`Nothing` :: `Maybe` `FormatterCanLoadURIMethod`@.
noFormatterCanLoadURIMethod :: Maybe FormatterCanLoadURIMethod
noFormatterCanLoadURIMethod :: Maybe FormatterCanLoadURIMethod
noFormatterCanLoadURIMethod = Maybe FormatterCanLoadURIMethod
forall a. Maybe a
Nothing

-- No Haskell->C wrapper generated since the function throws.

-- callback FillTrackElementFunc
{- Callable
  { returnType = Just (TBasicType TBoolean)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just "%TRUE if the implementer successfully filled the @nleobj."
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "clip"
          , argType = TInterface Name { namespace = "GES" , name = "Clip" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The #GESClip controlling the track elements"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "track_element"
          , argType =
              TInterface Name { namespace = "GES" , name = "TrackElement" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The #GESTrackElement"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "nleobj"
          , argType =
              TInterface Name { namespace = "Gst" , name = "Element" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The nleobject that needs to be filled"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated =
      Just
        DeprecationInfo
          { deprecatedSinceVersion = Just "1.18"
          , deprecationMessage = Just "This method type is no longer used."
          }
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "A function that will be called when the nleobject of a corresponding\ntrack element needs to be filled.\n\nThe implementer of this function shall add the proper #GstElement to @nleobj\nusing gst_bin_add()."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_FillTrackElementFunc =
    Ptr GES.Clip.Clip ->
    Ptr GES.TrackElement.TrackElement ->
    Ptr Gst.Element.Element ->
    IO CInt

-- Args: [ Arg
--           { argCName = "clip"
--           , argType = TInterface Name { namespace = "GES" , name = "Clip" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #GESClip controlling the track elements"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "track_element"
--           , argType =
--               TInterface Name { namespace = "GES" , name = "TrackElement" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #GESTrackElement"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "nleobj"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Element" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The nleobject that needs to be filled"
--                 , 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_FillTrackElementFunc :: FunPtr C_FillTrackElementFunc -> C_FillTrackElementFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_FillTrackElementFunc ::
    (B.CallStack.HasCallStack, MonadIO m, GES.Clip.IsClip a, GES.TrackElement.IsTrackElement b, Gst.Element.IsElement c) =>
    FunPtr C_FillTrackElementFunc
    -> a
    -- ^ /@clip@/: The t'GI.GES.Objects.Clip.Clip' controlling the track elements
    -> b
    -- ^ /@trackElement@/: The t'GI.GES.Objects.TrackElement.TrackElement'
    -> c
    -- ^ /@nleobj@/: The nleobject that needs to be filled
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the implementer successfully filled the /@nleobj@/.
dynamic_FillTrackElementFunc :: forall (m :: * -> *) a b c.
(HasCallStack, MonadIO m, IsClip a, IsTrackElement b,
 IsElement c) =>
FunPtr C_FillTrackElementFunc -> a -> b -> c -> m Bool
dynamic_FillTrackElementFunc FunPtr C_FillTrackElementFunc
__funPtr a
clip b
trackElement c
nleobj = IO Bool -> m Bool
forall a. IO a -> m a
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 Clip
clip' <- a -> IO (Ptr Clip)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clip
    Ptr TrackElement
trackElement' <- b -> IO (Ptr TrackElement)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
trackElement
    Ptr Element
nleobj' <- c -> IO (Ptr Element)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr c
nleobj
    CInt
result <- (FunPtr C_FillTrackElementFunc -> C_FillTrackElementFunc
__dynamic_C_FillTrackElementFunc FunPtr C_FillTrackElementFunc
__funPtr) Ptr Clip
clip' Ptr TrackElement
trackElement' Ptr Element
nleobj'
    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
clip
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
trackElement
    c -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr c
nleobj
    Bool -> IO Bool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

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

{-# DEPRECATED FillTrackElementFunc ["(Since version 1.18)","This method type is no longer used."] #-}
-- | A function that will be called when the nleobject of a corresponding
-- track element needs to be filled.
-- 
-- The implementer of this function shall add the proper t'GI.Gst.Objects.Element.Element' to /@nleobj@/
-- using 'GI.Gst.Objects.Bin.binAdd'.
type FillTrackElementFunc =
    GES.Clip.Clip
    -- ^ /@clip@/: The t'GI.GES.Objects.Clip.Clip' controlling the track elements
    -> GES.TrackElement.TrackElement
    -- ^ /@trackElement@/: The t'GI.GES.Objects.TrackElement.TrackElement'
    -> Gst.Element.Element
    -- ^ /@nleobj@/: The nleobject that needs to be filled
    -> IO Bool
    -- ^ __Returns:__ 'P.True' if the implementer successfully filled the /@nleobj@/.

-- | A convenience synonym for @`Nothing` :: `Maybe` `FillTrackElementFunc`@.
noFillTrackElementFunc :: Maybe FillTrackElementFunc
noFillTrackElementFunc :: Maybe FillTrackElementFunc
noFillTrackElementFunc = Maybe FillTrackElementFunc
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_FillTrackElementFunc :: MonadIO m => FillTrackElementFunc -> m (GClosure C_FillTrackElementFunc)
genClosure_FillTrackElementFunc :: forall (m :: * -> *).
MonadIO m =>
FillTrackElementFunc -> m (GClosure C_FillTrackElementFunc)
genClosure_FillTrackElementFunc FillTrackElementFunc
cb = IO (GClosure C_FillTrackElementFunc)
-> m (GClosure C_FillTrackElementFunc)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_FillTrackElementFunc)
 -> m (GClosure C_FillTrackElementFunc))
-> IO (GClosure C_FillTrackElementFunc)
-> m (GClosure C_FillTrackElementFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_FillTrackElementFunc
cb' = Maybe (Ptr (FunPtr C_FillTrackElementFunc))
-> FillTrackElementFunc -> C_FillTrackElementFunc
wrap_FillTrackElementFunc Maybe (Ptr (FunPtr C_FillTrackElementFunc))
forall a. Maybe a
Nothing FillTrackElementFunc
cb
    C_FillTrackElementFunc -> IO (FunPtr C_FillTrackElementFunc)
mk_FillTrackElementFunc C_FillTrackElementFunc
cb' IO (FunPtr C_FillTrackElementFunc)
-> (FunPtr C_FillTrackElementFunc
    -> IO (GClosure C_FillTrackElementFunc))
-> IO (GClosure C_FillTrackElementFunc)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_FillTrackElementFunc
-> IO (GClosure C_FillTrackElementFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `FillTrackElementFunc` into a `C_FillTrackElementFunc`.
wrap_FillTrackElementFunc :: 
    Maybe (Ptr (FunPtr C_FillTrackElementFunc)) ->
    FillTrackElementFunc ->
    C_FillTrackElementFunc
wrap_FillTrackElementFunc :: Maybe (Ptr (FunPtr C_FillTrackElementFunc))
-> FillTrackElementFunc -> C_FillTrackElementFunc
wrap_FillTrackElementFunc Maybe (Ptr (FunPtr C_FillTrackElementFunc))
gi'funptrptr FillTrackElementFunc
gi'cb Ptr Clip
clip Ptr TrackElement
trackElement Ptr Element
nleobj = do
    Clip
clip' <- ((ManagedPtr Clip -> Clip) -> Ptr Clip -> IO Clip
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Clip -> Clip
GES.Clip.Clip) Ptr Clip
clip
    TrackElement
trackElement' <- ((ManagedPtr TrackElement -> TrackElement)
-> Ptr TrackElement -> IO TrackElement
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr TrackElement -> TrackElement
GES.TrackElement.TrackElement) Ptr TrackElement
trackElement
    Element
nleobj' <- ((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
nleobj
    Bool
result <- FillTrackElementFunc
gi'cb  Clip
clip' TrackElement
trackElement' Element
nleobj'
    Maybe (Ptr (FunPtr C_FillTrackElementFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_FillTrackElementFunc))
gi'funptrptr
    let result' :: CInt
result' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
P.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
P.fromEnum) Bool
result
    CInt -> IO CInt
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CInt
result'


-- callback ExtractableCheckId
{- Callable
  { returnType = Just (TBasicType TUTF8)
  , returnMayBeNull = False
  , returnTransfer = TransferEverything
  , returnDocumentation =
      Documentation { rawDocText = Nothing , sinceVersion = Nothing }
  , args =
      [ Arg
          { argCName = "type"
          , argType = TBasicType TGType
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The #GESExtractable type to check @id for"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "id"
          , argType = TBasicType TUTF8
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "The ID to check" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = True
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "Method for checking that an ID is valid for the given #GESExtractable\ntype. If the given ID is considered valid, it can be adjusted into some\nstandard and returned to prevent the creation of separate #GESAsset-s,\nwith different #GESAsset:id, that would otherwise act the same.\n\nReturns (transfer full) (nullable): The actual #GESAsset:id to set on\nany corresponding assets, based on @id, or %NULL if @id is not valid."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_ExtractableCheckId =
    CGType ->
    CString ->
    Ptr (Ptr GError) ->
    IO CString

-- Args: [ Arg
--           { argCName = "type"
--           , argType = TBasicType TGType
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The #GESExtractable type to check @id for"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "id"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "The ID to check" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUTF8)
-- throws : True
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_ExtractableCheckId :: FunPtr C_ExtractableCheckId -> C_ExtractableCheckId

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_ExtractableCheckId ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    FunPtr C_ExtractableCheckId
    -> GType
    -- ^ /@type@/: The t'GI.GES.Interfaces.Extractable.Extractable' type to check /@id@/ for
    -> T.Text
    -- ^ /@id@/: The ID to check
    -> m T.Text
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
dynamic_ExtractableCheckId :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_ExtractableCheckId -> GType -> Text -> m Text
dynamic_ExtractableCheckId FunPtr C_ExtractableCheckId
__funPtr GType
type_ Text
id = IO Text -> m Text
forall a. IO a -> m a
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
    let type_' :: CGType
type_' = GType -> CGType
gtypeToCGType GType
type_
    CString
id' <- Text -> IO CString
textToCString Text
id
    IO Text -> IO () -> IO Text
forall a b. IO a -> IO b -> IO a
onException (do
        CString
result <- (Ptr (Ptr GError) -> IO CString) -> IO CString
forall a. (Ptr (Ptr GError) -> IO a) -> IO a
propagateGError ((Ptr (Ptr GError) -> IO CString) -> IO CString)
-> (Ptr (Ptr GError) -> IO CString) -> IO CString
forall a b. (a -> b) -> a -> b
$ (FunPtr C_ExtractableCheckId -> C_ExtractableCheckId
__dynamic_C_ExtractableCheckId FunPtr C_ExtractableCheckId
__funPtr) CGType
type_' CString
id'
        Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"extractableCheckId" CString
result
        Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
id'
        Text -> IO Text
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
     ) (do
        CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
id'
     )

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

-- | Method for checking that an ID is valid for the given t'GI.GES.Interfaces.Extractable.Extractable'
-- type. If the given ID is considered valid, it can be adjusted into some
-- standard and returned to prevent the creation of separate t'GI.GES.Objects.Asset.Asset'-s,
-- with different [Asset:id]("GI.GES.Objects.Asset#g:attr:id"), that would otherwise act the same.
-- 
-- Returns (transfer full) (nullable): The actual [Asset:id]("GI.GES.Objects.Asset#g:attr:id") to set on
-- any corresponding assets, based on /@id@/, or 'P.Nothing' if /@id@/ is not valid.
type ExtractableCheckId =
    GType
    -- ^ /@type@/: The t'GI.GES.Interfaces.Extractable.Extractable' type to check /@id@/ for
    -> T.Text
    -- ^ /@id@/: The ID to check
    -> IO T.Text
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/

-- | A convenience synonym for @`Nothing` :: `Maybe` `ExtractableCheckId`@.
noExtractableCheckId :: Maybe ExtractableCheckId
noExtractableCheckId :: Maybe ExtractableCheckId
noExtractableCheckId = Maybe ExtractableCheckId
forall a. Maybe a
Nothing

-- No Haskell->C wrapper generated since the function throws.

-- callback CreateTrackElementsFunc
{- Callable
  { returnType =
      Just
        (TGList
           (TInterface Name { namespace = "GES" , name = "TrackElement" }))
  , returnMayBeNull = False
  , returnTransfer = TransferContainer
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just
              "A list of\nthe #GESTrackElement-s created by @clip for the given @type, or %NULL\nif no track elements are created or an error occurred."
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "clip"
          , argType = TInterface Name { namespace = "GES" , name = "Clip" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "A #GESClip" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "type"
          , argType =
              TInterface Name { namespace = "GES" , name = "TrackType" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText =
                    Just "A #GESTrackType to create #GESTrackElement-s for"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "A method for creating the core #GESTrackElement-s of a clip, to be\nadded to #GESTrack-s of the given track type."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_CreateTrackElementsFunc =
    Ptr GES.Clip.Clip ->
    CUInt ->
    IO (Ptr (GList (Ptr GES.TrackElement.TrackElement)))

-- Args: [ Arg
--           { argCName = "clip"
--           , argType = TInterface Name { namespace = "GES" , name = "Clip" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A #GESClip" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "type"
--           , argType =
--               TInterface Name { namespace = "GES" , name = "TrackType" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "A #GESTrackType to create #GESTrackElement-s for"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TGList
--                  (TInterface Name { namespace = "GES" , name = "TrackElement" }))
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_CreateTrackElementsFunc :: FunPtr C_CreateTrackElementsFunc -> C_CreateTrackElementsFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_CreateTrackElementsFunc ::
    (B.CallStack.HasCallStack, MonadIO m, GES.Clip.IsClip a) =>
    FunPtr C_CreateTrackElementsFunc
    -> a
    -- ^ /@clip@/: A t'GI.GES.Objects.Clip.Clip'
    -> [GES.Flags.TrackType]
    -- ^ /@type@/: A t'GI.GES.Flags.TrackType' to create t'GI.GES.Objects.TrackElement.TrackElement'-s for
    -> m [GES.TrackElement.TrackElement]
    -- ^ __Returns:__ A list of
    -- the t'GI.GES.Objects.TrackElement.TrackElement'-s created by /@clip@/ for the given /@type@/, or 'P.Nothing'
    -- if no track elements are created or an error occurred.
dynamic_CreateTrackElementsFunc :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClip a) =>
FunPtr C_CreateTrackElementsFunc
-> a -> [TrackType] -> m [TrackElement]
dynamic_CreateTrackElementsFunc FunPtr C_CreateTrackElementsFunc
__funPtr a
clip [TrackType]
type_ = IO [TrackElement] -> m [TrackElement]
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [TrackElement] -> m [TrackElement])
-> IO [TrackElement] -> m [TrackElement]
forall a b. (a -> b) -> a -> b
$ do
    Ptr Clip
clip' <- a -> IO (Ptr Clip)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clip
    let type_' :: CUInt
type_' = [TrackType] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [TrackType]
type_
    Ptr (GList (Ptr TrackElement))
result <- (FunPtr C_CreateTrackElementsFunc -> C_CreateTrackElementsFunc
__dynamic_C_CreateTrackElementsFunc FunPtr C_CreateTrackElementsFunc
__funPtr) Ptr Clip
clip' CUInt
type_'
    [Ptr TrackElement]
result' <- Ptr (GList (Ptr TrackElement)) -> IO [Ptr TrackElement]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr TrackElement))
result
    [TrackElement]
result'' <- (Ptr TrackElement -> IO TrackElement)
-> [Ptr TrackElement] -> IO [TrackElement]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM ((ManagedPtr TrackElement -> TrackElement)
-> Ptr TrackElement -> IO TrackElement
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr TrackElement -> TrackElement
GES.TrackElement.TrackElement) [Ptr TrackElement]
result'
    Ptr (GList (Ptr TrackElement)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr TrackElement))
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clip
    [TrackElement] -> IO [TrackElement]
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return [TrackElement]
result''

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

-- | A method for creating the core t'GI.GES.Objects.TrackElement.TrackElement'-s of a clip, to be
-- added to t'GI.GES.Objects.Track.Track'-s of the given track type.
type CreateTrackElementsFunc =
    GES.Clip.Clip
    -- ^ /@clip@/: A t'GI.GES.Objects.Clip.Clip'
    -> [GES.Flags.TrackType]
    -- ^ /@type@/: A t'GI.GES.Flags.TrackType' to create t'GI.GES.Objects.TrackElement.TrackElement'-s for
    -> IO [GES.TrackElement.TrackElement]
    -- ^ __Returns:__ A list of
    -- the t'GI.GES.Objects.TrackElement.TrackElement'-s created by /@clip@/ for the given /@type@/, or 'P.Nothing'
    -- if no track elements are created or an error occurred.

-- | A convenience synonym for @`Nothing` :: `Maybe` `CreateTrackElementsFunc`@.
noCreateTrackElementsFunc :: Maybe CreateTrackElementsFunc
noCreateTrackElementsFunc :: Maybe CreateTrackElementsFunc
noCreateTrackElementsFunc = Maybe CreateTrackElementsFunc
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_CreateTrackElementsFunc :: MonadIO m => CreateTrackElementsFunc -> m (GClosure C_CreateTrackElementsFunc)
genClosure_CreateTrackElementsFunc :: forall (m :: * -> *).
MonadIO m =>
CreateTrackElementsFunc -> m (GClosure C_CreateTrackElementsFunc)
genClosure_CreateTrackElementsFunc CreateTrackElementsFunc
cb = IO (GClosure C_CreateTrackElementsFunc)
-> m (GClosure C_CreateTrackElementsFunc)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_CreateTrackElementsFunc)
 -> m (GClosure C_CreateTrackElementsFunc))
-> IO (GClosure C_CreateTrackElementsFunc)
-> m (GClosure C_CreateTrackElementsFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_CreateTrackElementsFunc
cb' = Maybe (Ptr (FunPtr C_CreateTrackElementsFunc))
-> CreateTrackElementsFunc -> C_CreateTrackElementsFunc
wrap_CreateTrackElementsFunc Maybe (Ptr (FunPtr C_CreateTrackElementsFunc))
forall a. Maybe a
Nothing CreateTrackElementsFunc
cb
    C_CreateTrackElementsFunc -> IO (FunPtr C_CreateTrackElementsFunc)
mk_CreateTrackElementsFunc C_CreateTrackElementsFunc
cb' IO (FunPtr C_CreateTrackElementsFunc)
-> (FunPtr C_CreateTrackElementsFunc
    -> IO (GClosure C_CreateTrackElementsFunc))
-> IO (GClosure C_CreateTrackElementsFunc)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_CreateTrackElementsFunc
-> IO (GClosure C_CreateTrackElementsFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `CreateTrackElementsFunc` into a `C_CreateTrackElementsFunc`.
wrap_CreateTrackElementsFunc :: 
    Maybe (Ptr (FunPtr C_CreateTrackElementsFunc)) ->
    CreateTrackElementsFunc ->
    C_CreateTrackElementsFunc
wrap_CreateTrackElementsFunc :: Maybe (Ptr (FunPtr C_CreateTrackElementsFunc))
-> CreateTrackElementsFunc -> C_CreateTrackElementsFunc
wrap_CreateTrackElementsFunc Maybe (Ptr (FunPtr C_CreateTrackElementsFunc))
gi'funptrptr CreateTrackElementsFunc
gi'cb Ptr Clip
clip CUInt
type_ = do
    Clip
clip' <- ((ManagedPtr Clip -> Clip) -> Ptr Clip -> IO Clip
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Clip -> Clip
GES.Clip.Clip) Ptr Clip
clip
    let type_' :: [TrackType]
type_' = CUInt -> [TrackType]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
type_
    [TrackElement]
result <- CreateTrackElementsFunc
gi'cb  Clip
clip' [TrackType]
type_'
    Maybe (Ptr (FunPtr C_CreateTrackElementsFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_CreateTrackElementsFunc))
gi'funptrptr
    [Ptr TrackElement]
result' <- (TrackElement -> IO (Ptr TrackElement))
-> [TrackElement] -> IO [Ptr TrackElement]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM TrackElement -> IO (Ptr TrackElement)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr [TrackElement]
result
    Ptr (GList (Ptr TrackElement))
result'' <- [Ptr TrackElement] -> IO (Ptr (GList (Ptr TrackElement)))
forall a. [Ptr a] -> IO (Ptr (GList (Ptr a)))
packGList [Ptr TrackElement]
result'
    Ptr (GList (Ptr TrackElement))
-> IO (Ptr (GList (Ptr TrackElement)))
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr (GList (Ptr TrackElement))
result''


-- callback CreateTrackElementFunc
{- Callable
  { returnType =
      Just
        (TInterface Name { namespace = "GES" , name = "TrackElement" })
  , returnMayBeNull = True
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText =
            Just
              "The #GESTrackElement created\nby @clip, or %NULL if @clip can not provide a track element for the\ngiven @type or an error occurred."
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "clip"
          , argType = TInterface Name { namespace = "GES" , name = "Clip" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "A #GESClip" , sinceVersion = Nothing }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "type"
          , argType =
              TInterface Name { namespace = "GES" , name = "TrackType" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText =
                    Just "A #GESTrackType to create a #GESTrackElement for"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "A method for creating the core #GESTrackElement of a clip, to be added\nto a #GESTrack of the given track type.\n\nIf a clip may produce several track elements per track type,\n#GESCreateTrackElementsFunc is more appropriate."
        , sinceVersion = Nothing
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_CreateTrackElementFunc =
    Ptr GES.Clip.Clip ->
    CUInt ->
    IO (Ptr GES.TrackElement.TrackElement)

-- Args: [ Arg
--           { argCName = "clip"
--           , argType = TInterface Name { namespace = "GES" , name = "Clip" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A #GESClip" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "type"
--           , argType =
--               TInterface Name { namespace = "GES" , name = "TrackType" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "A #GESTrackType to create a #GESTrackElement for"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "GES" , name = "TrackElement" })
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_CreateTrackElementFunc :: FunPtr C_CreateTrackElementFunc -> C_CreateTrackElementFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_CreateTrackElementFunc ::
    (B.CallStack.HasCallStack, MonadIO m, GES.Clip.IsClip a) =>
    FunPtr C_CreateTrackElementFunc
    -> a
    -- ^ /@clip@/: A t'GI.GES.Objects.Clip.Clip'
    -> [GES.Flags.TrackType]
    -- ^ /@type@/: A t'GI.GES.Flags.TrackType' to create a t'GI.GES.Objects.TrackElement.TrackElement' for
    -> m (Maybe GES.TrackElement.TrackElement)
    -- ^ __Returns:__ The t'GI.GES.Objects.TrackElement.TrackElement' created
    -- by /@clip@/, or 'P.Nothing' if /@clip@/ can not provide a track element for the
    -- given /@type@/ or an error occurred.
dynamic_CreateTrackElementFunc :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsClip a) =>
FunPtr C_CreateTrackElementFunc
-> a -> [TrackType] -> m (Maybe TrackElement)
dynamic_CreateTrackElementFunc FunPtr C_CreateTrackElementFunc
__funPtr a
clip [TrackType]
type_ = IO (Maybe TrackElement) -> m (Maybe TrackElement)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe TrackElement) -> m (Maybe TrackElement))
-> IO (Maybe TrackElement) -> m (Maybe TrackElement)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Clip
clip' <- a -> IO (Ptr Clip)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
clip
    let type_' :: CUInt
type_' = [TrackType] -> CUInt
forall b a. (Num b, IsGFlag a) => [a] -> b
gflagsToWord [TrackType]
type_
    Ptr TrackElement
result <- (FunPtr C_CreateTrackElementFunc -> C_CreateTrackElementFunc
__dynamic_C_CreateTrackElementFunc FunPtr C_CreateTrackElementFunc
__funPtr) Ptr Clip
clip' CUInt
type_'
    Maybe TrackElement
maybeResult <- Ptr TrackElement
-> (Ptr TrackElement -> IO TrackElement) -> IO (Maybe TrackElement)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr TrackElement
result ((Ptr TrackElement -> IO TrackElement) -> IO (Maybe TrackElement))
-> (Ptr TrackElement -> IO TrackElement) -> IO (Maybe TrackElement)
forall a b. (a -> b) -> a -> b
$ \Ptr TrackElement
result' -> do
        TrackElement
result'' <- ((ManagedPtr TrackElement -> TrackElement)
-> Ptr TrackElement -> IO TrackElement
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr TrackElement -> TrackElement
GES.TrackElement.TrackElement) Ptr TrackElement
result'
        TrackElement -> IO TrackElement
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return TrackElement
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
clip
    Maybe TrackElement -> IO (Maybe TrackElement)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe TrackElement
maybeResult

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

-- | A method for creating the core t'GI.GES.Objects.TrackElement.TrackElement' of a clip, to be added
-- to a t'GI.GES.Objects.Track.Track' of the given track type.
-- 
-- If a clip may produce several track elements per track type,
-- t'GI.GES.Callbacks.CreateTrackElementsFunc' is more appropriate.
type CreateTrackElementFunc =
    GES.Clip.Clip
    -- ^ /@clip@/: A t'GI.GES.Objects.Clip.Clip'
    -> [GES.Flags.TrackType]
    -- ^ /@type@/: A t'GI.GES.Flags.TrackType' to create a t'GI.GES.Objects.TrackElement.TrackElement' for
    -> IO (Maybe GES.TrackElement.TrackElement)
    -- ^ __Returns:__ The t'GI.GES.Objects.TrackElement.TrackElement' created
    -- by /@clip@/, or 'P.Nothing' if /@clip@/ can not provide a track element for the
    -- given /@type@/ or an error occurred.

-- | A convenience synonym for @`Nothing` :: `Maybe` `CreateTrackElementFunc`@.
noCreateTrackElementFunc :: Maybe CreateTrackElementFunc
noCreateTrackElementFunc :: Maybe CreateTrackElementFunc
noCreateTrackElementFunc = Maybe CreateTrackElementFunc
forall a. Maybe a
Nothing

-- | Wrap the callback into a `GClosure`.
genClosure_CreateTrackElementFunc :: MonadIO m => CreateTrackElementFunc -> m (GClosure C_CreateTrackElementFunc)
genClosure_CreateTrackElementFunc :: forall (m :: * -> *).
MonadIO m =>
CreateTrackElementFunc -> m (GClosure C_CreateTrackElementFunc)
genClosure_CreateTrackElementFunc CreateTrackElementFunc
cb = IO (GClosure C_CreateTrackElementFunc)
-> m (GClosure C_CreateTrackElementFunc)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_CreateTrackElementFunc)
 -> m (GClosure C_CreateTrackElementFunc))
-> IO (GClosure C_CreateTrackElementFunc)
-> m (GClosure C_CreateTrackElementFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_CreateTrackElementFunc
cb' = Maybe (Ptr (FunPtr C_CreateTrackElementFunc))
-> CreateTrackElementFunc -> C_CreateTrackElementFunc
wrap_CreateTrackElementFunc Maybe (Ptr (FunPtr C_CreateTrackElementFunc))
forall a. Maybe a
Nothing CreateTrackElementFunc
cb
    C_CreateTrackElementFunc -> IO (FunPtr C_CreateTrackElementFunc)
mk_CreateTrackElementFunc C_CreateTrackElementFunc
cb' IO (FunPtr C_CreateTrackElementFunc)
-> (FunPtr C_CreateTrackElementFunc
    -> IO (GClosure C_CreateTrackElementFunc))
-> IO (GClosure C_CreateTrackElementFunc)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_CreateTrackElementFunc
-> IO (GClosure C_CreateTrackElementFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `CreateTrackElementFunc` into a `C_CreateTrackElementFunc`.
wrap_CreateTrackElementFunc :: 
    Maybe (Ptr (FunPtr C_CreateTrackElementFunc)) ->
    CreateTrackElementFunc ->
    C_CreateTrackElementFunc
wrap_CreateTrackElementFunc :: Maybe (Ptr (FunPtr C_CreateTrackElementFunc))
-> CreateTrackElementFunc -> C_CreateTrackElementFunc
wrap_CreateTrackElementFunc Maybe (Ptr (FunPtr C_CreateTrackElementFunc))
gi'funptrptr CreateTrackElementFunc
gi'cb Ptr Clip
clip CUInt
type_ = do
    Clip
clip' <- ((ManagedPtr Clip -> Clip) -> Ptr Clip -> IO Clip
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Clip -> Clip
GES.Clip.Clip) Ptr Clip
clip
    let type_' :: [TrackType]
type_' = CUInt -> [TrackType]
forall a b. (Storable a, Integral a, Bits a, IsGFlag b) => a -> [b]
wordToGFlags CUInt
type_
    Maybe TrackElement
result <- CreateTrackElementFunc
gi'cb  Clip
clip' [TrackType]
type_'
    Maybe (Ptr (FunPtr C_CreateTrackElementFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_CreateTrackElementFunc))
gi'funptrptr
    Ptr TrackElement
-> Maybe TrackElement
-> (TrackElement -> IO (Ptr TrackElement))
-> IO (Ptr TrackElement)
forall (m :: * -> *) b a.
Monad m =>
b -> Maybe a -> (a -> m b) -> m b
maybeM Ptr TrackElement
forall a. Ptr a
FP.nullPtr Maybe TrackElement
result ((TrackElement -> IO (Ptr TrackElement)) -> IO (Ptr TrackElement))
-> (TrackElement -> IO (Ptr TrackElement)) -> IO (Ptr TrackElement)
forall a b. (a -> b) -> a -> b
$ \TrackElement
result' -> do
        Ptr TrackElement
result'' <- TrackElement -> IO (Ptr TrackElement)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr TrackElement
result'
        Ptr TrackElement -> IO (Ptr TrackElement)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr TrackElement
result''


-- callback BaseEffectTimeTranslationFunc
{- Callable
  { returnType = Just (TBasicType TUInt64)
  , returnMayBeNull = False
  , returnTransfer = TransferNothing
  , returnDocumentation =
      Documentation
        { rawDocText = Just "The translated time."
        , sinceVersion = Nothing
        }
  , args =
      [ Arg
          { argCName = "effect"
          , argType =
              TInterface Name { namespace = "GES" , name = "BaseEffect" }
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText =
                    Just "The #GESBaseEffect that is doing the time translation"
                , 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 #GstClockTime to translation"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = -1
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      , Arg
          { argCName = "time_property_values"
          , argType = TGHash (TBasicType TUTF8) TGValue
          , direction = DirectionIn
          , mayBeNull = False
          , argDoc =
              Documentation
                { rawDocText = Just "A table of child\nproperty name/value pairs"
                , 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 ges_base_effect_set_time_translation_funcs()"
                , sinceVersion = Nothing
                }
          , argScope = ScopeTypeInvalid
          , argClosure = 3
          , argDestroy = -1
          , argCallerAllocates = False
          , transfer = TransferNothing
          }
      ]
  , skipReturn = False
  , callableThrows = False
  , callableDeprecated = Nothing
  , callableDocumentation =
      Documentation
        { rawDocText =
            Just
              "A function for querying how an effect would translate a time if it had\nthe given child property values set. The keys for @time_properties will\nbe the same string that was passed to\nges_base_effect_register_time_property(), the values will be #GValue*\nvalues of the corresponding child properties. You should always use the\nvalues given in @time_properties before using the currently set values."
        , sinceVersion = Just "1.18"
        }
  , callableResolvable = Nothing
  }
-}
-- | Type for the callback on the (unwrapped) C side.
type C_BaseEffectTimeTranslationFunc =
    Ptr GES.BaseEffect.BaseEffect ->
    Word64 ->
    Ptr (GHashTable CString (Ptr GValue)) ->
    Ptr () ->
    IO Word64

-- Args: [ Arg
--           { argCName = "effect"
--           , argType =
--               TInterface Name { namespace = "GES" , name = "BaseEffect" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "The #GESBaseEffect that is doing the time translation"
--                 , 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 #GstClockTime to translation"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "time_property_values"
--           , argType = TGHash (TBasicType TUTF8) TGValue
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "A table of child\nproperty name/value pairs"
--                 , 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 ges_base_effect_set_time_translation_funcs()"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = 3
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt64)
-- throws : False
-- Skip return : False

foreign import ccall "dynamic" __dynamic_C_BaseEffectTimeTranslationFunc :: FunPtr C_BaseEffectTimeTranslationFunc -> C_BaseEffectTimeTranslationFunc

-- | Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
dynamic_BaseEffectTimeTranslationFunc ::
    (B.CallStack.HasCallStack, MonadIO m, GES.BaseEffect.IsBaseEffect a) =>
    FunPtr C_BaseEffectTimeTranslationFunc
    -> a
    -- ^ /@effect@/: The t'GI.GES.Objects.BaseEffect.BaseEffect' that is doing the time translation
    -> Word64
    -- ^ /@time@/: The @/GstClockTime/@ to translation
    -> Map.Map T.Text GValue
    -- ^ /@timePropertyValues@/: A table of child
    -- property name\/value pairs
    -> Ptr ()
    -- ^ /@userData@/: Data passed to 'GI.GES.Objects.BaseEffect.baseEffectSetTimeTranslationFuncs'
    -> m Word64
    -- ^ __Returns:__ The translated time.
dynamic_BaseEffectTimeTranslationFunc :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsBaseEffect a) =>
FunPtr C_BaseEffectTimeTranslationFunc
-> a -> CGType -> Map Text GValue -> Ptr () -> m CGType
dynamic_BaseEffectTimeTranslationFunc FunPtr C_BaseEffectTimeTranslationFunc
__funPtr a
effect CGType
time Map Text GValue
timePropertyValues Ptr ()
userData = IO CGType -> m CGType
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CGType -> m CGType) -> IO CGType -> m CGType
forall a b. (a -> b) -> a -> b
$ do
    Ptr BaseEffect
effect' <- a -> IO (Ptr BaseEffect)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
effect
    let timePropertyValues' :: [(Text, GValue)]
timePropertyValues' = Map Text GValue -> [(Text, GValue)]
forall k a. Map k a -> [(k, a)]
Map.toList Map Text GValue
timePropertyValues
    [(CString, GValue)]
timePropertyValues'' <- (Text -> IO CString) -> [(Text, GValue)] -> IO [(CString, GValue)]
forall (f :: * -> *) a c b.
Applicative f =>
(a -> f c) -> [(a, b)] -> f [(c, b)]
mapFirstA Text -> IO CString
textToCString [(Text, GValue)]
timePropertyValues'
    [(CString, Ptr GValue)]
timePropertyValues''' <- (GValue -> IO (Ptr GValue))
-> [(CString, GValue)] -> IO [(CString, Ptr GValue)]
forall (f :: * -> *) b c a.
Applicative f =>
(b -> f c) -> [(a, b)] -> f [(a, c)]
mapSecondA GValue -> IO (Ptr GValue)
B.GValue.disownGValue [(CString, GValue)]
timePropertyValues''
    let timePropertyValues'''' :: [(PtrWrapped CString, Ptr GValue)]
timePropertyValues'''' = (CString -> PtrWrapped CString)
-> [(CString, Ptr GValue)] -> [(PtrWrapped CString, Ptr GValue)]
forall a c b. (a -> c) -> [(a, b)] -> [(c, b)]
mapFirst CString -> PtrWrapped CString
B.GHT.cstringPackPtr [(CString, Ptr GValue)]
timePropertyValues'''
    let timePropertyValues''''' :: [(PtrWrapped CString, PtrWrapped (Ptr GValue))]
timePropertyValues''''' = (Ptr GValue -> PtrWrapped (Ptr GValue))
-> [(PtrWrapped CString, Ptr GValue)]
-> [(PtrWrapped CString, PtrWrapped (Ptr GValue))]
forall b c a. (b -> c) -> [(a, b)] -> [(a, c)]
mapSecond Ptr GValue -> PtrWrapped (Ptr GValue)
B.GHT.gvaluePackPtr [(PtrWrapped CString, Ptr GValue)]
timePropertyValues''''
    Ptr (GHashTable CString (Ptr GValue))
timePropertyValues'''''' <- GHashFunc CString
-> GEqualFunc CString
-> Maybe (GDestroyNotify CString)
-> Maybe (GDestroyNotify (Ptr GValue))
-> [(PtrWrapped CString, PtrWrapped (Ptr GValue))]
-> IO (Ptr (GHashTable CString (Ptr GValue)))
forall a b.
GHashFunc a
-> GEqualFunc a
-> Maybe (GDestroyNotify a)
-> Maybe (GDestroyNotify b)
-> [(PtrWrapped a, PtrWrapped b)]
-> IO (Ptr (GHashTable a b))
packGHashTable GHashFunc CString
gStrHash GEqualFunc CString
gStrEqual (GDestroyNotify CString -> Maybe (GDestroyNotify CString)
forall a. a -> Maybe a
Just GDestroyNotify CString
forall a. FunPtr (Ptr a -> IO ())
ptr_to_g_free) (GDestroyNotify (Ptr GValue) -> Maybe (GDestroyNotify (Ptr GValue))
forall a. a -> Maybe a
Just GDestroyNotify (Ptr GValue)
B.GValue.ptr_to_gvalue_free) [(PtrWrapped CString, PtrWrapped (Ptr GValue))]
timePropertyValues'''''
    CGType
result <- (FunPtr C_BaseEffectTimeTranslationFunc
-> C_BaseEffectTimeTranslationFunc
__dynamic_C_BaseEffectTimeTranslationFunc FunPtr C_BaseEffectTimeTranslationFunc
__funPtr) Ptr BaseEffect
effect' CGType
time Ptr (GHashTable CString (Ptr GValue))
timePropertyValues'''''' Ptr ()
userData
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
effect
    Ptr (GHashTable CString (Ptr GValue)) -> IO ()
forall a b. Ptr (GHashTable a b) -> IO ()
unrefGHashTable Ptr (GHashTable CString (Ptr GValue))
timePropertyValues''''''
    CGType -> IO CGType
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CGType
result

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

-- | A function for querying how an effect would translate a time if it had
-- the given child property values set. The keys for /@timeProperties@/ will
-- be the same string that was passed to
-- 'GI.GES.Objects.BaseEffect.baseEffectRegisterTimeProperty', the values will be t'GI.GObject.Structs.Value.Value'*
-- values of the corresponding child properties. You should always use the
-- values given in /@timeProperties@/ before using the currently set values.
-- 
-- /Since: 1.18/
type BaseEffectTimeTranslationFunc =
    GES.BaseEffect.BaseEffect
    -- ^ /@effect@/: The t'GI.GES.Objects.BaseEffect.BaseEffect' that is doing the time translation
    -> Word64
    -- ^ /@time@/: The @/GstClockTime/@ to translation
    -> Map.Map T.Text GValue
    -- ^ /@timePropertyValues@/: A table of child
    -- property name\/value pairs
    -> IO Word64
    -- ^ __Returns:__ The translated time.

-- | A convenience synonym for @`Nothing` :: `Maybe` `BaseEffectTimeTranslationFunc`@.
noBaseEffectTimeTranslationFunc :: Maybe BaseEffectTimeTranslationFunc
noBaseEffectTimeTranslationFunc :: Maybe BaseEffectTimeTranslationFunc
noBaseEffectTimeTranslationFunc = Maybe BaseEffectTimeTranslationFunc
forall a. Maybe a
Nothing

-- | A function for querying how an effect would translate a time if it had
-- the given child property values set. The keys for /@timeProperties@/ will
-- be the same string that was passed to
-- 'GI.GES.Objects.BaseEffect.baseEffectRegisterTimeProperty', the values will be t'GI.GObject.Structs.Value.Value'*
-- values of the corresponding child properties. You should always use the
-- values given in /@timeProperties@/ before using the currently set values.
-- 
-- /Since: 1.18/
type BaseEffectTimeTranslationFunc_WithClosures =
    GES.BaseEffect.BaseEffect
    -- ^ /@effect@/: The t'GI.GES.Objects.BaseEffect.BaseEffect' that is doing the time translation
    -> Word64
    -- ^ /@time@/: The @/GstClockTime/@ to translation
    -> Map.Map T.Text GValue
    -- ^ /@timePropertyValues@/: A table of child
    -- property name\/value pairs
    -> Ptr ()
    -- ^ /@userData@/: Data passed to 'GI.GES.Objects.BaseEffect.baseEffectSetTimeTranslationFuncs'
    -> IO Word64
    -- ^ __Returns:__ The translated time.

-- | A convenience synonym for @`Nothing` :: `Maybe` `BaseEffectTimeTranslationFunc_WithClosures`@.
noBaseEffectTimeTranslationFunc_WithClosures :: Maybe BaseEffectTimeTranslationFunc_WithClosures
noBaseEffectTimeTranslationFunc_WithClosures :: Maybe BaseEffectTimeTranslationFunc_WithClosures
noBaseEffectTimeTranslationFunc_WithClosures = Maybe BaseEffectTimeTranslationFunc_WithClosures
forall a. Maybe a
Nothing

-- | A simple wrapper that ignores the closure arguments.
drop_closures_BaseEffectTimeTranslationFunc :: BaseEffectTimeTranslationFunc -> BaseEffectTimeTranslationFunc_WithClosures
drop_closures_BaseEffectTimeTranslationFunc :: BaseEffectTimeTranslationFunc
-> BaseEffectTimeTranslationFunc_WithClosures
drop_closures_BaseEffectTimeTranslationFunc BaseEffectTimeTranslationFunc
_f BaseEffect
effect CGType
time Map Text GValue
timePropertyValues Ptr ()
_ = BaseEffectTimeTranslationFunc
_f BaseEffect
effect CGType
time Map Text GValue
timePropertyValues

-- | Wrap the callback into a `GClosure`.
genClosure_BaseEffectTimeTranslationFunc :: MonadIO m => BaseEffectTimeTranslationFunc -> m (GClosure C_BaseEffectTimeTranslationFunc)
genClosure_BaseEffectTimeTranslationFunc :: forall (m :: * -> *).
MonadIO m =>
BaseEffectTimeTranslationFunc
-> m (GClosure C_BaseEffectTimeTranslationFunc)
genClosure_BaseEffectTimeTranslationFunc BaseEffectTimeTranslationFunc
cb = IO (GClosure C_BaseEffectTimeTranslationFunc)
-> m (GClosure C_BaseEffectTimeTranslationFunc)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_BaseEffectTimeTranslationFunc)
 -> m (GClosure C_BaseEffectTimeTranslationFunc))
-> IO (GClosure C_BaseEffectTimeTranslationFunc)
-> m (GClosure C_BaseEffectTimeTranslationFunc)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: BaseEffectTimeTranslationFunc_WithClosures
cb' = BaseEffectTimeTranslationFunc
-> BaseEffectTimeTranslationFunc_WithClosures
drop_closures_BaseEffectTimeTranslationFunc BaseEffectTimeTranslationFunc
cb
    let cb'' :: C_BaseEffectTimeTranslationFunc
cb'' = Maybe (Ptr (FunPtr C_BaseEffectTimeTranslationFunc))
-> BaseEffectTimeTranslationFunc_WithClosures
-> C_BaseEffectTimeTranslationFunc
wrap_BaseEffectTimeTranslationFunc Maybe (Ptr (FunPtr C_BaseEffectTimeTranslationFunc))
forall a. Maybe a
Nothing BaseEffectTimeTranslationFunc_WithClosures
cb'
    C_BaseEffectTimeTranslationFunc
-> IO (FunPtr C_BaseEffectTimeTranslationFunc)
mk_BaseEffectTimeTranslationFunc C_BaseEffectTimeTranslationFunc
cb'' IO (FunPtr C_BaseEffectTimeTranslationFunc)
-> (FunPtr C_BaseEffectTimeTranslationFunc
    -> IO (GClosure C_BaseEffectTimeTranslationFunc))
-> IO (GClosure C_BaseEffectTimeTranslationFunc)
forall a b. IO a -> (a -> IO b) -> IO b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_BaseEffectTimeTranslationFunc
-> IO (GClosure C_BaseEffectTimeTranslationFunc)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `BaseEffectTimeTranslationFunc` into a `C_BaseEffectTimeTranslationFunc`.
wrap_BaseEffectTimeTranslationFunc :: 
    Maybe (Ptr (FunPtr C_BaseEffectTimeTranslationFunc)) ->
    BaseEffectTimeTranslationFunc_WithClosures ->
    C_BaseEffectTimeTranslationFunc
wrap_BaseEffectTimeTranslationFunc :: Maybe (Ptr (FunPtr C_BaseEffectTimeTranslationFunc))
-> BaseEffectTimeTranslationFunc_WithClosures
-> C_BaseEffectTimeTranslationFunc
wrap_BaseEffectTimeTranslationFunc Maybe (Ptr (FunPtr C_BaseEffectTimeTranslationFunc))
gi'funptrptr BaseEffectTimeTranslationFunc_WithClosures
gi'cb Ptr BaseEffect
effect CGType
time Ptr (GHashTable CString (Ptr GValue))
timePropertyValues Ptr ()
userData = do
    BaseEffect
effect' <- ((ManagedPtr BaseEffect -> BaseEffect)
-> Ptr BaseEffect -> IO BaseEffect
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr BaseEffect -> BaseEffect
GES.BaseEffect.BaseEffect) Ptr BaseEffect
effect
    [(PtrWrapped CString, PtrWrapped (Ptr GValue))]
timePropertyValues' <- Ptr (GHashTable CString (Ptr GValue))
-> IO [(PtrWrapped CString, PtrWrapped (Ptr GValue))]
forall a b.
Ptr (GHashTable a b) -> IO [(PtrWrapped a, PtrWrapped b)]
unpackGHashTable Ptr (GHashTable CString (Ptr GValue))
timePropertyValues
    let timePropertyValues'' :: [(CString, PtrWrapped (Ptr GValue))]
timePropertyValues'' = (PtrWrapped CString -> CString)
-> [(PtrWrapped CString, PtrWrapped (Ptr GValue))]
-> [(CString, PtrWrapped (Ptr GValue))]
forall a c b. (a -> c) -> [(a, b)] -> [(c, b)]
mapFirst PtrWrapped CString -> CString
B.GHT.cstringUnpackPtr [(PtrWrapped CString, PtrWrapped (Ptr GValue))]
timePropertyValues'
    [(Text, PtrWrapped (Ptr GValue))]
timePropertyValues''' <- (CString -> IO Text)
-> [(CString, PtrWrapped (Ptr GValue))]
-> IO [(Text, PtrWrapped (Ptr GValue))]
forall (f :: * -> *) a c b.
Applicative f =>
(a -> f c) -> [(a, b)] -> f [(c, b)]
mapFirstA HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText [(CString, PtrWrapped (Ptr GValue))]
timePropertyValues''
    let timePropertyValues'''' :: [(Text, Ptr GValue)]
timePropertyValues'''' = (PtrWrapped (Ptr GValue) -> Ptr GValue)
-> [(Text, PtrWrapped (Ptr GValue))] -> [(Text, Ptr GValue)]
forall b c a. (b -> c) -> [(a, b)] -> [(a, c)]
mapSecond PtrWrapped (Ptr GValue) -> Ptr GValue
B.GHT.gvalueUnpackPtr [(Text, PtrWrapped (Ptr GValue))]
timePropertyValues'''
    [(Text, GValue)]
timePropertyValues''''' <- (Ptr GValue -> IO GValue)
-> [(Text, Ptr GValue)] -> IO [(Text, GValue)]
forall (f :: * -> *) b c a.
Applicative f =>
(b -> f c) -> [(a, b)] -> f [(a, c)]
mapSecondA Ptr GValue -> IO GValue
B.GValue.newGValueFromPtr [(Text, Ptr GValue)]
timePropertyValues''''
    let timePropertyValues'''''' :: Map Text GValue
timePropertyValues'''''' = [(Text, GValue)] -> Map Text GValue
forall k a. Ord k => [(k, a)] -> Map k a
Map.fromList [(Text, GValue)]
timePropertyValues'''''
    CGType
result <- BaseEffectTimeTranslationFunc_WithClosures
gi'cb  BaseEffect
effect' CGType
time Map Text GValue
timePropertyValues'''''' Ptr ()
userData
    Maybe (Ptr (FunPtr C_BaseEffectTimeTranslationFunc)) -> IO ()
forall a. Maybe (Ptr (FunPtr a)) -> IO ()
maybeReleaseFunPtr Maybe (Ptr (FunPtr C_BaseEffectTimeTranslationFunc))
gi'funptrptr
    CGType -> IO CGType
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return CGType
result