{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- One registry holds the metadata of a set of plugins.
-- 
-- \<emphasis role=\"bold\">Design:\<\/emphasis>
-- 
-- The t'GI.Gst.Objects.Registry.Registry' object is a list of plugins and some functions for dealing
-- with them. Each t'GI.Gst.Objects.Plugin.Plugin' is matched 1-1 with a file on disk, and may or may
-- not be loaded at a given time.
-- 
-- The primary source, at all times, of plugin information is each plugin file
-- itself. Thus, if an application wants information about a particular plugin,
-- or wants to search for a feature that satisfies given criteria, the primary
-- means of doing so is to load every plugin and look at the resulting
-- information that is gathered in the default registry. Clearly, this is a time
-- consuming process, so we cache information in the registry file. The format
-- and location of the cache file is internal to gstreamer.
-- 
-- On startup, plugins are searched for in the plugin search path. The following
-- locations are checked in this order:
-- 
-- * location from --gst-plugin-path commandline option.
-- * the GST_PLUGIN_PATH environment variable.
-- * the GST_PLUGIN_SYSTEM_PATH environment variable.
-- * default locations (if GST_PLUGIN_SYSTEM_PATH is not set).
--   Those default locations are:
--   @$XDG_DATA_HOME\/gstreamer-$GST_API_VERSION\/plugins\/@
--   and @$prefix\/libs\/gstreamer-$GST_API_VERSION\/@.
--   <http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html $XDG_DATA_HOME> defaults to
--   @$HOME\/.local\/share@.
-- 
-- The registry cache file is loaded from
-- @$XDG_CACHE_HOME\/gstreamer-$GST_API_VERSION\/registry-$ARCH.bin@
-- (where $XDG_CACHE_HOME defaults to @$HOME\/.cache@) or the file listed in the @GST_REGISTRY@
-- env var. One reason to change the registry location is for testing.
-- 
-- For each plugin that is found in the plugin search path, there could be 3
-- possibilities for cached information:
-- 
--   * the cache may not contain information about a given file.
--   * the cache may have stale information.
--   * the cache may have current information.
-- 
-- In the first two cases, the plugin is loaded and the cache updated. In
-- addition to these cases, the cache may have entries for plugins that are not
-- relevant to the current process. These are marked as not available to the
-- current process. If the cache is updated for whatever reason, it is marked
-- dirty.
-- 
-- A dirty cache is written out at the end of initialization. Each entry is
-- checked to make sure the information is minimally valid. If not, the entry is
-- simply dropped.
-- 
-- == Implementation notes:
-- 
-- The \"cache\" and \"registry\" are different concepts and can represent
-- different sets of plugins. For various reasons, at init time, the cache is
-- stored in the default registry, and plugins not relevant to the current
-- process are marked with the 'GI.Gst.Flags.PluginFlagsCached' bit. These plugins are
-- removed at the end of initialization.

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

module GI.Gst.Objects.Registry
    ( 

-- * Exported types
    Registry(..)                            ,
    IsRegistry                              ,
    toRegistry                              ,
    noRegistry                              ,


 -- * Methods
-- ** Overloaded methods #method:Overloaded methods#

#if defined(ENABLE_OVERLOADING)
    ResolveRegistryMethod                   ,
#endif


-- ** addFeature #method:addFeature#

#if defined(ENABLE_OVERLOADING)
    RegistryAddFeatureMethodInfo            ,
#endif
    registryAddFeature                      ,


-- ** addPlugin #method:addPlugin#

#if defined(ENABLE_OVERLOADING)
    RegistryAddPluginMethodInfo             ,
#endif
    registryAddPlugin                       ,


-- ** checkFeatureVersion #method:checkFeatureVersion#

#if defined(ENABLE_OVERLOADING)
    RegistryCheckFeatureVersionMethodInfo   ,
#endif
    registryCheckFeatureVersion             ,


-- ** featureFilter #method:featureFilter#

#if defined(ENABLE_OVERLOADING)
    RegistryFeatureFilterMethodInfo         ,
#endif
    registryFeatureFilter                   ,


-- ** findFeature #method:findFeature#

#if defined(ENABLE_OVERLOADING)
    RegistryFindFeatureMethodInfo           ,
#endif
    registryFindFeature                     ,


-- ** findPlugin #method:findPlugin#

#if defined(ENABLE_OVERLOADING)
    RegistryFindPluginMethodInfo            ,
#endif
    registryFindPlugin                      ,


-- ** forkIsEnabled #method:forkIsEnabled#

    registryForkIsEnabled                   ,


-- ** forkSetEnabled #method:forkSetEnabled#

    registryForkSetEnabled                  ,


-- ** get #method:get#

    registryGet                             ,


-- ** getFeatureList #method:getFeatureList#

#if defined(ENABLE_OVERLOADING)
    RegistryGetFeatureListMethodInfo        ,
#endif
    registryGetFeatureList                  ,


-- ** getFeatureListByPlugin #method:getFeatureListByPlugin#

#if defined(ENABLE_OVERLOADING)
    RegistryGetFeatureListByPluginMethodInfo,
#endif
    registryGetFeatureListByPlugin          ,


-- ** getFeatureListCookie #method:getFeatureListCookie#

#if defined(ENABLE_OVERLOADING)
    RegistryGetFeatureListCookieMethodInfo  ,
#endif
    registryGetFeatureListCookie            ,


-- ** getPluginList #method:getPluginList#

#if defined(ENABLE_OVERLOADING)
    RegistryGetPluginListMethodInfo         ,
#endif
    registryGetPluginList                   ,


-- ** lookup #method:lookup#

#if defined(ENABLE_OVERLOADING)
    RegistryLookupMethodInfo                ,
#endif
    registryLookup                          ,


-- ** lookupFeature #method:lookupFeature#

#if defined(ENABLE_OVERLOADING)
    RegistryLookupFeatureMethodInfo         ,
#endif
    registryLookupFeature                   ,


-- ** pluginFilter #method:pluginFilter#

#if defined(ENABLE_OVERLOADING)
    RegistryPluginFilterMethodInfo          ,
#endif
    registryPluginFilter                    ,


-- ** removeFeature #method:removeFeature#

#if defined(ENABLE_OVERLOADING)
    RegistryRemoveFeatureMethodInfo         ,
#endif
    registryRemoveFeature                   ,


-- ** removePlugin #method:removePlugin#

#if defined(ENABLE_OVERLOADING)
    RegistryRemovePluginMethodInfo          ,
#endif
    registryRemovePlugin                    ,


-- ** scanPath #method:scanPath#

#if defined(ENABLE_OVERLOADING)
    RegistryScanPathMethodInfo              ,
#endif
    registryScanPath                        ,




 -- * Signals
-- ** featureAdded #signal:featureAdded#

    C_RegistryFeatureAddedCallback          ,
    RegistryFeatureAddedCallback            ,
#if defined(ENABLE_OVERLOADING)
    RegistryFeatureAddedSignalInfo          ,
#endif
    afterRegistryFeatureAdded               ,
    genClosure_RegistryFeatureAdded         ,
    mk_RegistryFeatureAddedCallback         ,
    noRegistryFeatureAddedCallback          ,
    onRegistryFeatureAdded                  ,
    wrap_RegistryFeatureAddedCallback       ,


-- ** pluginAdded #signal:pluginAdded#

    C_RegistryPluginAddedCallback           ,
    RegistryPluginAddedCallback             ,
#if defined(ENABLE_OVERLOADING)
    RegistryPluginAddedSignalInfo           ,
#endif
    afterRegistryPluginAdded                ,
    genClosure_RegistryPluginAdded          ,
    mk_RegistryPluginAddedCallback          ,
    noRegistryPluginAddedCallback           ,
    onRegistryPluginAdded                   ,
    wrap_RegistryPluginAddedCallback        ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL

import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gst.Callbacks as Gst.Callbacks
import {-# SOURCE #-} qualified GI.Gst.Objects.Object as Gst.Object
import {-# SOURCE #-} qualified GI.Gst.Objects.Plugin as Gst.Plugin
import {-# SOURCE #-} qualified GI.Gst.Objects.PluginFeature as Gst.PluginFeature

-- | Memory-managed wrapper type.
newtype Registry = Registry (ManagedPtr Registry)
    deriving (Registry -> Registry -> Bool
(Registry -> Registry -> Bool)
-> (Registry -> Registry -> Bool) -> Eq Registry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Registry -> Registry -> Bool
$c/= :: Registry -> Registry -> Bool
== :: Registry -> Registry -> Bool
$c== :: Registry -> Registry -> Bool
Eq)
foreign import ccall "gst_registry_get_type"
    c_gst_registry_get_type :: IO GType

instance GObject Registry where
    gobjectType :: IO GType
gobjectType = IO GType
c_gst_registry_get_type
    

-- | Convert 'Registry' to and from 'Data.GI.Base.GValue.GValue' with 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue Registry where
    toGValue :: Registry -> IO GValue
toGValue o :: Registry
o = do
        GType
gtype <- IO GType
c_gst_registry_get_type
        Registry -> (Ptr Registry -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Registry
o (GType
-> (GValue -> Ptr Registry -> IO ()) -> Ptr Registry -> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr Registry -> IO ()
forall a. GObject a => GValue -> Ptr a -> IO ()
B.GValue.set_object)
        
    fromGValue :: GValue -> IO Registry
fromGValue gv :: GValue
gv = do
        Ptr Registry
ptr <- GValue -> IO (Ptr Registry)
forall b. GObject b => GValue -> IO (Ptr b)
B.GValue.get_object GValue
gv :: IO (Ptr Registry)
        (ManagedPtr Registry -> Registry) -> Ptr Registry -> IO Registry
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr Registry -> Registry
Registry Ptr Registry
ptr
        
    

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

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

-- | Cast to `Registry`, for types for which this is known to be safe. For general casts, use `Data.GI.Base.ManagedPtr.castTo`.
toRegistry :: (MonadIO m, IsRegistry o) => o -> m Registry
toRegistry :: o -> m Registry
toRegistry = IO Registry -> m Registry
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Registry -> m Registry)
-> (o -> IO Registry) -> o -> m Registry
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr Registry -> Registry) -> o -> IO Registry
forall o o'.
(HasCallStack, GObject o, GObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
unsafeCastTo ManagedPtr Registry -> Registry
Registry

-- | A convenience alias for `Nothing` :: `Maybe` `Registry`.
noRegistry :: Maybe Registry
noRegistry :: Maybe Registry
noRegistry = Maybe Registry
forall a. Maybe a
Nothing

#if defined(ENABLE_OVERLOADING)
type family ResolveRegistryMethod (t :: Symbol) (o :: *) :: * where
    ResolveRegistryMethod "addControlBinding" o = Gst.Object.ObjectAddControlBindingMethodInfo
    ResolveRegistryMethod "addFeature" o = RegistryAddFeatureMethodInfo
    ResolveRegistryMethod "addPlugin" o = RegistryAddPluginMethodInfo
    ResolveRegistryMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveRegistryMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveRegistryMethod "checkFeatureVersion" o = RegistryCheckFeatureVersionMethodInfo
    ResolveRegistryMethod "defaultError" o = Gst.Object.ObjectDefaultErrorMethodInfo
    ResolveRegistryMethod "featureFilter" o = RegistryFeatureFilterMethodInfo
    ResolveRegistryMethod "findFeature" o = RegistryFindFeatureMethodInfo
    ResolveRegistryMethod "findPlugin" o = RegistryFindPluginMethodInfo
    ResolveRegistryMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveRegistryMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveRegistryMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveRegistryMethod "hasActiveControlBindings" o = Gst.Object.ObjectHasActiveControlBindingsMethodInfo
    ResolveRegistryMethod "hasAncestor" o = Gst.Object.ObjectHasAncestorMethodInfo
    ResolveRegistryMethod "hasAsAncestor" o = Gst.Object.ObjectHasAsAncestorMethodInfo
    ResolveRegistryMethod "hasAsParent" o = Gst.Object.ObjectHasAsParentMethodInfo
    ResolveRegistryMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveRegistryMethod "lookup" o = RegistryLookupMethodInfo
    ResolveRegistryMethod "lookupFeature" o = RegistryLookupFeatureMethodInfo
    ResolveRegistryMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveRegistryMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveRegistryMethod "pluginFilter" o = RegistryPluginFilterMethodInfo
    ResolveRegistryMethod "ref" o = Gst.Object.ObjectRefMethodInfo
    ResolveRegistryMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveRegistryMethod "removeControlBinding" o = Gst.Object.ObjectRemoveControlBindingMethodInfo
    ResolveRegistryMethod "removeFeature" o = RegistryRemoveFeatureMethodInfo
    ResolveRegistryMethod "removePlugin" o = RegistryRemovePluginMethodInfo
    ResolveRegistryMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveRegistryMethod "scanPath" o = RegistryScanPathMethodInfo
    ResolveRegistryMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveRegistryMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveRegistryMethod "suggestNextSync" o = Gst.Object.ObjectSuggestNextSyncMethodInfo
    ResolveRegistryMethod "syncValues" o = Gst.Object.ObjectSyncValuesMethodInfo
    ResolveRegistryMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveRegistryMethod "unparent" o = Gst.Object.ObjectUnparentMethodInfo
    ResolveRegistryMethod "unref" o = Gst.Object.ObjectUnrefMethodInfo
    ResolveRegistryMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveRegistryMethod "getControlBinding" o = Gst.Object.ObjectGetControlBindingMethodInfo
    ResolveRegistryMethod "getControlRate" o = Gst.Object.ObjectGetControlRateMethodInfo
    ResolveRegistryMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveRegistryMethod "getFeatureList" o = RegistryGetFeatureListMethodInfo
    ResolveRegistryMethod "getFeatureListByPlugin" o = RegistryGetFeatureListByPluginMethodInfo
    ResolveRegistryMethod "getFeatureListCookie" o = RegistryGetFeatureListCookieMethodInfo
    ResolveRegistryMethod "getGValueArray" o = Gst.Object.ObjectGetGValueArrayMethodInfo
    ResolveRegistryMethod "getName" o = Gst.Object.ObjectGetNameMethodInfo
    ResolveRegistryMethod "getParent" o = Gst.Object.ObjectGetParentMethodInfo
    ResolveRegistryMethod "getPathString" o = Gst.Object.ObjectGetPathStringMethodInfo
    ResolveRegistryMethod "getPluginList" o = RegistryGetPluginListMethodInfo
    ResolveRegistryMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveRegistryMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveRegistryMethod "getValue" o = Gst.Object.ObjectGetValueMethodInfo
    ResolveRegistryMethod "setControlBindingDisabled" o = Gst.Object.ObjectSetControlBindingDisabledMethodInfo
    ResolveRegistryMethod "setControlBindingsDisabled" o = Gst.Object.ObjectSetControlBindingsDisabledMethodInfo
    ResolveRegistryMethod "setControlRate" o = Gst.Object.ObjectSetControlRateMethodInfo
    ResolveRegistryMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveRegistryMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveRegistryMethod "setName" o = Gst.Object.ObjectSetNameMethodInfo
    ResolveRegistryMethod "setParent" o = Gst.Object.ObjectSetParentMethodInfo
    ResolveRegistryMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveRegistryMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveRegistryMethod t Registry, O.MethodInfo info Registry p) => OL.IsLabel t (Registry -> p) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.overloadedMethod @info
#else
    fromLabel _ = O.overloadedMethod @info
#endif

#endif

-- signal Registry::feature-added
-- | Signals that a feature has been added to the registry (possibly
-- replacing a previously-added one by the same name)
type RegistryFeatureAddedCallback =
    Gst.PluginFeature.PluginFeature
    -- ^ /@feature@/: the feature that has been added
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `RegistryFeatureAddedCallback`@.
noRegistryFeatureAddedCallback :: Maybe RegistryFeatureAddedCallback
noRegistryFeatureAddedCallback :: Maybe RegistryFeatureAddedCallback
noRegistryFeatureAddedCallback = Maybe RegistryFeatureAddedCallback
forall a. Maybe a
Nothing

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

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

-- | Wrap the callback into a `GClosure`.
genClosure_RegistryFeatureAdded :: MonadIO m => RegistryFeatureAddedCallback -> m (GClosure C_RegistryFeatureAddedCallback)
genClosure_RegistryFeatureAdded :: RegistryFeatureAddedCallback
-> m (GClosure C_RegistryFeatureAddedCallback)
genClosure_RegistryFeatureAdded cb :: RegistryFeatureAddedCallback
cb = IO (GClosure C_RegistryFeatureAddedCallback)
-> m (GClosure C_RegistryFeatureAddedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_RegistryFeatureAddedCallback)
 -> m (GClosure C_RegistryFeatureAddedCallback))
-> IO (GClosure C_RegistryFeatureAddedCallback)
-> m (GClosure C_RegistryFeatureAddedCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_RegistryFeatureAddedCallback
cb' = RegistryFeatureAddedCallback -> C_RegistryFeatureAddedCallback
wrap_RegistryFeatureAddedCallback RegistryFeatureAddedCallback
cb
    C_RegistryFeatureAddedCallback
-> IO (FunPtr C_RegistryFeatureAddedCallback)
mk_RegistryFeatureAddedCallback C_RegistryFeatureAddedCallback
cb' IO (FunPtr C_RegistryFeatureAddedCallback)
-> (FunPtr C_RegistryFeatureAddedCallback
    -> IO (GClosure C_RegistryFeatureAddedCallback))
-> IO (GClosure C_RegistryFeatureAddedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_RegistryFeatureAddedCallback
-> IO (GClosure C_RegistryFeatureAddedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `RegistryFeatureAddedCallback` into a `C_RegistryFeatureAddedCallback`.
wrap_RegistryFeatureAddedCallback ::
    RegistryFeatureAddedCallback ->
    C_RegistryFeatureAddedCallback
wrap_RegistryFeatureAddedCallback :: RegistryFeatureAddedCallback -> C_RegistryFeatureAddedCallback
wrap_RegistryFeatureAddedCallback _cb :: RegistryFeatureAddedCallback
_cb _ feature :: Ptr PluginFeature
feature _ = do
    PluginFeature
feature' <- ((ManagedPtr PluginFeature -> PluginFeature)
-> Ptr PluginFeature -> IO PluginFeature
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr PluginFeature -> PluginFeature
Gst.PluginFeature.PluginFeature) Ptr PluginFeature
feature
    RegistryFeatureAddedCallback
_cb  PluginFeature
feature'


-- | Connect a signal handler for the [featureAdded](#signal:featureAdded) signal, to be run before the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.on' registry #featureAdded callback
-- @
-- 
-- 
onRegistryFeatureAdded :: (IsRegistry a, MonadIO m) => a -> RegistryFeatureAddedCallback -> m SignalHandlerId
onRegistryFeatureAdded :: a -> RegistryFeatureAddedCallback -> m SignalHandlerId
onRegistryFeatureAdded obj :: a
obj cb :: RegistryFeatureAddedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_RegistryFeatureAddedCallback
cb' = RegistryFeatureAddedCallback -> C_RegistryFeatureAddedCallback
wrap_RegistryFeatureAddedCallback RegistryFeatureAddedCallback
cb
    FunPtr C_RegistryFeatureAddedCallback
cb'' <- C_RegistryFeatureAddedCallback
-> IO (FunPtr C_RegistryFeatureAddedCallback)
mk_RegistryFeatureAddedCallback C_RegistryFeatureAddedCallback
cb'
    a
-> Text
-> FunPtr C_RegistryFeatureAddedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "feature-added" FunPtr C_RegistryFeatureAddedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [featureAdded](#signal:featureAdded) signal, to be run after the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.after' registry #featureAdded callback
-- @
-- 
-- 
afterRegistryFeatureAdded :: (IsRegistry a, MonadIO m) => a -> RegistryFeatureAddedCallback -> m SignalHandlerId
afterRegistryFeatureAdded :: a -> RegistryFeatureAddedCallback -> m SignalHandlerId
afterRegistryFeatureAdded obj :: a
obj cb :: RegistryFeatureAddedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_RegistryFeatureAddedCallback
cb' = RegistryFeatureAddedCallback -> C_RegistryFeatureAddedCallback
wrap_RegistryFeatureAddedCallback RegistryFeatureAddedCallback
cb
    FunPtr C_RegistryFeatureAddedCallback
cb'' <- C_RegistryFeatureAddedCallback
-> IO (FunPtr C_RegistryFeatureAddedCallback)
mk_RegistryFeatureAddedCallback C_RegistryFeatureAddedCallback
cb'
    a
-> Text
-> FunPtr C_RegistryFeatureAddedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "feature-added" FunPtr C_RegistryFeatureAddedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data RegistryFeatureAddedSignalInfo
instance SignalInfo RegistryFeatureAddedSignalInfo where
    type HaskellCallbackType RegistryFeatureAddedSignalInfo = RegistryFeatureAddedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_RegistryFeatureAddedCallback cb
        cb'' <- mk_RegistryFeatureAddedCallback cb'
        connectSignalFunPtr obj "feature-added" cb'' connectMode detail

#endif

-- signal Registry::plugin-added
-- | Signals that a plugin has been added to the registry (possibly
-- replacing a previously-added one by the same name)
type RegistryPluginAddedCallback =
    Gst.Plugin.Plugin
    -- ^ /@plugin@/: the plugin that has been added
    -> IO ()

-- | A convenience synonym for @`Nothing` :: `Maybe` `RegistryPluginAddedCallback`@.
noRegistryPluginAddedCallback :: Maybe RegistryPluginAddedCallback
noRegistryPluginAddedCallback :: Maybe RegistryPluginAddedCallback
noRegistryPluginAddedCallback = Maybe RegistryPluginAddedCallback
forall a. Maybe a
Nothing

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

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

-- | Wrap the callback into a `GClosure`.
genClosure_RegistryPluginAdded :: MonadIO m => RegistryPluginAddedCallback -> m (GClosure C_RegistryPluginAddedCallback)
genClosure_RegistryPluginAdded :: RegistryPluginAddedCallback
-> m (GClosure C_RegistryPluginAddedCallback)
genClosure_RegistryPluginAdded cb :: RegistryPluginAddedCallback
cb = IO (GClosure C_RegistryPluginAddedCallback)
-> m (GClosure C_RegistryPluginAddedCallback)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (GClosure C_RegistryPluginAddedCallback)
 -> m (GClosure C_RegistryPluginAddedCallback))
-> IO (GClosure C_RegistryPluginAddedCallback)
-> m (GClosure C_RegistryPluginAddedCallback)
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_RegistryPluginAddedCallback
cb' = RegistryPluginAddedCallback -> C_RegistryPluginAddedCallback
wrap_RegistryPluginAddedCallback RegistryPluginAddedCallback
cb
    C_RegistryPluginAddedCallback
-> IO (FunPtr C_RegistryPluginAddedCallback)
mk_RegistryPluginAddedCallback C_RegistryPluginAddedCallback
cb' IO (FunPtr C_RegistryPluginAddedCallback)
-> (FunPtr C_RegistryPluginAddedCallback
    -> IO (GClosure C_RegistryPluginAddedCallback))
-> IO (GClosure C_RegistryPluginAddedCallback)
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= FunPtr C_RegistryPluginAddedCallback
-> IO (GClosure C_RegistryPluginAddedCallback)
forall (m :: * -> *) a. MonadIO m => FunPtr a -> m (GClosure a)
B.GClosure.newGClosure


-- | Wrap a `RegistryPluginAddedCallback` into a `C_RegistryPluginAddedCallback`.
wrap_RegistryPluginAddedCallback ::
    RegistryPluginAddedCallback ->
    C_RegistryPluginAddedCallback
wrap_RegistryPluginAddedCallback :: RegistryPluginAddedCallback -> C_RegistryPluginAddedCallback
wrap_RegistryPluginAddedCallback _cb :: RegistryPluginAddedCallback
_cb _ plugin :: Ptr Plugin
plugin _ = do
    Plugin
plugin' <- ((ManagedPtr Plugin -> Plugin) -> Ptr Plugin -> IO Plugin
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Plugin -> Plugin
Gst.Plugin.Plugin) Ptr Plugin
plugin
    RegistryPluginAddedCallback
_cb  Plugin
plugin'


-- | Connect a signal handler for the [pluginAdded](#signal:pluginAdded) signal, to be run before the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.on' registry #pluginAdded callback
-- @
-- 
-- 
onRegistryPluginAdded :: (IsRegistry a, MonadIO m) => a -> RegistryPluginAddedCallback -> m SignalHandlerId
onRegistryPluginAdded :: a -> RegistryPluginAddedCallback -> m SignalHandlerId
onRegistryPluginAdded obj :: a
obj cb :: RegistryPluginAddedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_RegistryPluginAddedCallback
cb' = RegistryPluginAddedCallback -> C_RegistryPluginAddedCallback
wrap_RegistryPluginAddedCallback RegistryPluginAddedCallback
cb
    FunPtr C_RegistryPluginAddedCallback
cb'' <- C_RegistryPluginAddedCallback
-> IO (FunPtr C_RegistryPluginAddedCallback)
mk_RegistryPluginAddedCallback C_RegistryPluginAddedCallback
cb'
    a
-> Text
-> FunPtr C_RegistryPluginAddedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "plugin-added" FunPtr C_RegistryPluginAddedCallback
cb'' SignalConnectMode
SignalConnectBefore Maybe Text
forall a. Maybe a
Nothing

-- | Connect a signal handler for the [pluginAdded](#signal:pluginAdded) signal, to be run after the default handler.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Signals.after' registry #pluginAdded callback
-- @
-- 
-- 
afterRegistryPluginAdded :: (IsRegistry a, MonadIO m) => a -> RegistryPluginAddedCallback -> m SignalHandlerId
afterRegistryPluginAdded :: a -> RegistryPluginAddedCallback -> m SignalHandlerId
afterRegistryPluginAdded obj :: a
obj cb :: RegistryPluginAddedCallback
cb = IO SignalHandlerId -> m SignalHandlerId
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SignalHandlerId -> m SignalHandlerId)
-> IO SignalHandlerId -> m SignalHandlerId
forall a b. (a -> b) -> a -> b
$ do
    let cb' :: C_RegistryPluginAddedCallback
cb' = RegistryPluginAddedCallback -> C_RegistryPluginAddedCallback
wrap_RegistryPluginAddedCallback RegistryPluginAddedCallback
cb
    FunPtr C_RegistryPluginAddedCallback
cb'' <- C_RegistryPluginAddedCallback
-> IO (FunPtr C_RegistryPluginAddedCallback)
mk_RegistryPluginAddedCallback C_RegistryPluginAddedCallback
cb'
    a
-> Text
-> FunPtr C_RegistryPluginAddedCallback
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
forall o a.
GObject o =>
o
-> Text
-> FunPtr a
-> SignalConnectMode
-> Maybe Text
-> IO SignalHandlerId
connectSignalFunPtr a
obj "plugin-added" FunPtr C_RegistryPluginAddedCallback
cb'' SignalConnectMode
SignalConnectAfter Maybe Text
forall a. Maybe a
Nothing


#if defined(ENABLE_OVERLOADING)
data RegistryPluginAddedSignalInfo
instance SignalInfo RegistryPluginAddedSignalInfo where
    type HaskellCallbackType RegistryPluginAddedSignalInfo = RegistryPluginAddedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_RegistryPluginAddedCallback cb
        cb'' <- mk_RegistryPluginAddedCallback cb'
        connectSignalFunPtr obj "plugin-added" cb'' connectMode detail

#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Registry
type instance O.AttributeList Registry = RegistryAttributeList
type RegistryAttributeList = ('[ '("name", Gst.Object.ObjectNamePropertyInfo), '("parent", Gst.Object.ObjectParentPropertyInfo)] :: [(Symbol, *)])
#endif

#if defined(ENABLE_OVERLOADING)
#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Registry = RegistrySignalList
type RegistrySignalList = ('[ '("deepNotify", Gst.Object.ObjectDeepNotifySignalInfo), '("featureAdded", RegistryFeatureAddedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("pluginAdded", RegistryPluginAddedSignalInfo)] :: [(Symbol, *)])

#endif

-- method Registry::add_feature
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "registry"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Registry" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the registry to add the plugin to"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "feature"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "PluginFeature" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the feature to add" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gst_registry_add_feature" gst_registry_add_feature :: 
    Ptr Registry ->                         -- registry : TInterface (Name {namespace = "Gst", name = "Registry"})
    Ptr Gst.PluginFeature.PluginFeature ->  -- feature : TInterface (Name {namespace = "Gst", name = "PluginFeature"})
    IO CInt

-- | Add the feature to the registry. The feature-added signal will be emitted.
-- 
-- /@feature@/\'s reference count will be incremented, and any floating
-- reference will be removed (see @/gst_object_ref_sink()/@)
registryAddFeature ::
    (B.CallStack.HasCallStack, MonadIO m, IsRegistry a, Gst.PluginFeature.IsPluginFeature b) =>
    a
    -- ^ /@registry@/: the registry to add the plugin to
    -> b
    -- ^ /@feature@/: the feature to add
    -> m Bool
    -- ^ __Returns:__ 'P.True' on success.
    -- 
    -- MT safe.
registryAddFeature :: a -> b -> m Bool
registryAddFeature registry :: a
registry feature :: b
feature = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Registry
registry' <- a -> IO (Ptr Registry)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
registry
    Ptr PluginFeature
feature' <- b -> IO (Ptr PluginFeature)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
feature
    CInt
result <- Ptr Registry -> Ptr PluginFeature -> IO CInt
gst_registry_add_feature Ptr Registry
registry' Ptr PluginFeature
feature'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
registry
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
feature
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data RegistryAddFeatureMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsRegistry a, Gst.PluginFeature.IsPluginFeature b) => O.MethodInfo RegistryAddFeatureMethodInfo a signature where
    overloadedMethod = registryAddFeature

#endif

-- method Registry::add_plugin
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "registry"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Registry" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the registry to add the plugin to"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "plugin"
--           , argType = TInterface Name { namespace = "Gst" , name = "Plugin" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the plugin to add" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gst_registry_add_plugin" gst_registry_add_plugin :: 
    Ptr Registry ->                         -- registry : TInterface (Name {namespace = "Gst", name = "Registry"})
    Ptr Gst.Plugin.Plugin ->                -- plugin : TInterface (Name {namespace = "Gst", name = "Plugin"})
    IO CInt

-- | Add the plugin to the registry. The plugin-added signal will be emitted.
-- 
-- /@plugin@/\'s reference count will be incremented, and any floating
-- reference will be removed (see @/gst_object_ref_sink()/@)
registryAddPlugin ::
    (B.CallStack.HasCallStack, MonadIO m, IsRegistry a, Gst.Plugin.IsPlugin b) =>
    a
    -- ^ /@registry@/: the registry to add the plugin to
    -> b
    -- ^ /@plugin@/: the plugin to add
    -> m Bool
    -- ^ __Returns:__ 'P.True' on success.
    -- 
    -- MT safe.
registryAddPlugin :: a -> b -> m Bool
registryAddPlugin registry :: a
registry plugin :: b
plugin = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Registry
registry' <- a -> IO (Ptr Registry)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
registry
    Ptr Plugin
plugin' <- b -> IO (Ptr Plugin)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
plugin
    CInt
result <- Ptr Registry -> Ptr Plugin -> IO CInt
gst_registry_add_plugin Ptr Registry
registry' Ptr Plugin
plugin'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
registry
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
plugin
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data RegistryAddPluginMethodInfo
instance (signature ~ (b -> m Bool), MonadIO m, IsRegistry a, Gst.Plugin.IsPlugin b) => O.MethodInfo RegistryAddPluginMethodInfo a signature where
    overloadedMethod = registryAddPlugin

#endif

-- method Registry::check_feature_version
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "registry"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Registry" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstRegistry" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "feature_name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the name of the feature (e.g. \"oggdemux\")"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "min_major"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the minimum major version number"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "min_minor"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the minimum minor version number"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "min_micro"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the minimum micro version number"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gst_registry_check_feature_version" gst_registry_check_feature_version :: 
    Ptr Registry ->                         -- registry : TInterface (Name {namespace = "Gst", name = "Registry"})
    CString ->                              -- feature_name : TBasicType TUTF8
    Word32 ->                               -- min_major : TBasicType TUInt
    Word32 ->                               -- min_minor : TBasicType TUInt
    Word32 ->                               -- min_micro : TBasicType TUInt
    IO CInt

-- | Checks whether a plugin feature by the given name exists in
-- /@registry@/ and whether its version is at least the
-- version required.
registryCheckFeatureVersion ::
    (B.CallStack.HasCallStack, MonadIO m, IsRegistry a) =>
    a
    -- ^ /@registry@/: a t'GI.Gst.Objects.Registry.Registry'
    -> T.Text
    -- ^ /@featureName@/: the name of the feature (e.g. \"oggdemux\")
    -> Word32
    -- ^ /@minMajor@/: the minimum major version number
    -> Word32
    -- ^ /@minMinor@/: the minimum minor version number
    -> Word32
    -- ^ /@minMicro@/: the minimum micro version number
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the feature could be found and the version is
    -- the same as the required version or newer, and 'P.False' otherwise.
registryCheckFeatureVersion :: a -> Text -> Word32 -> Word32 -> Word32 -> m Bool
registryCheckFeatureVersion registry :: a
registry featureName :: Text
featureName minMajor :: Word32
minMajor minMinor :: Word32
minMinor minMicro :: Word32
minMicro = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Registry
registry' <- a -> IO (Ptr Registry)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
registry
    CString
featureName' <- Text -> IO CString
textToCString Text
featureName
    CInt
result <- Ptr Registry -> CString -> Word32 -> Word32 -> Word32 -> IO CInt
gst_registry_check_feature_version Ptr Registry
registry' CString
featureName' Word32
minMajor Word32
minMinor Word32
minMicro
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
registry
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
featureName'
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data RegistryCheckFeatureVersionMethodInfo
instance (signature ~ (T.Text -> Word32 -> Word32 -> Word32 -> m Bool), MonadIO m, IsRegistry a) => O.MethodInfo RegistryCheckFeatureVersionMethodInfo a signature where
    overloadedMethod = registryCheckFeatureVersion

#endif

-- method Registry::feature_filter
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "registry"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Registry" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "registry to query" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "filter"
--           , argType =
--               TInterface
--                 Name { namespace = "Gst" , name = "PluginFeatureFilter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the filter to use" , sinceVersion = Nothing }
--           , argScope = ScopeTypeCall
--           , argClosure = 3
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "first"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "only return first match"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "user data passed to the filter function"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TGList
--                  (TInterface Name { namespace = "Gst" , name = "PluginFeature" }))
-- throws : False
-- Skip return : False

foreign import ccall "gst_registry_feature_filter" gst_registry_feature_filter :: 
    Ptr Registry ->                         -- registry : TInterface (Name {namespace = "Gst", name = "Registry"})
    FunPtr Gst.Callbacks.C_PluginFeatureFilter -> -- filter : TInterface (Name {namespace = "Gst", name = "PluginFeatureFilter"})
    CInt ->                                 -- first : TBasicType TBoolean
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO (Ptr (GList (Ptr Gst.PluginFeature.PluginFeature)))

-- | Runs a filter against all features of the plugins in the registry
-- and returns a GList with the results.
-- If the first flag is set, only the first match is
-- returned (as a list with a single object).
registryFeatureFilter ::
    (B.CallStack.HasCallStack, MonadIO m, IsRegistry a) =>
    a
    -- ^ /@registry@/: registry to query
    -> Gst.Callbacks.PluginFeatureFilter
    -- ^ /@filter@/: the filter to use
    -> Bool
    -- ^ /@first@/: only return first match
    -> m [Gst.PluginFeature.PluginFeature]
    -- ^ __Returns:__ a t'GI.GLib.Structs.List.List' of
    --     t'GI.Gst.Objects.PluginFeature.PluginFeature'. Use 'GI.Gst.Objects.PluginFeature.pluginFeatureListFree' after usage.
    -- 
    -- MT safe.
registryFeatureFilter :: a -> PluginFeatureFilter -> Bool -> m [PluginFeature]
registryFeatureFilter registry :: a
registry filter :: PluginFeatureFilter
filter first :: Bool
first = IO [PluginFeature] -> m [PluginFeature]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [PluginFeature] -> m [PluginFeature])
-> IO [PluginFeature] -> m [PluginFeature]
forall a b. (a -> b) -> a -> b
$ do
    Ptr Registry
registry' <- a -> IO (Ptr Registry)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
registry
    FunPtr C_PluginFeatureFilter
filter' <- C_PluginFeatureFilter -> IO (FunPtr C_PluginFeatureFilter)
Gst.Callbacks.mk_PluginFeatureFilter (Maybe (Ptr (FunPtr C_PluginFeatureFilter))
-> PluginFeatureFilter_WithClosures -> C_PluginFeatureFilter
Gst.Callbacks.wrap_PluginFeatureFilter Maybe (Ptr (FunPtr C_PluginFeatureFilter))
forall a. Maybe a
Nothing (PluginFeatureFilter -> PluginFeatureFilter_WithClosures
Gst.Callbacks.drop_closures_PluginFeatureFilter PluginFeatureFilter
filter))
    let first' :: CInt
first' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
first
    let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
    Ptr (GList (Ptr PluginFeature))
result <- Ptr Registry
-> FunPtr C_PluginFeatureFilter
-> CInt
-> Ptr ()
-> IO (Ptr (GList (Ptr PluginFeature)))
gst_registry_feature_filter Ptr Registry
registry' FunPtr C_PluginFeatureFilter
filter' CInt
first' Ptr ()
forall a. Ptr a
userData
    [Ptr PluginFeature]
result' <- Ptr (GList (Ptr PluginFeature)) -> IO [Ptr PluginFeature]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr PluginFeature))
result
    [PluginFeature]
result'' <- (Ptr PluginFeature -> IO PluginFeature)
-> [Ptr PluginFeature] -> IO [PluginFeature]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr PluginFeature -> PluginFeature)
-> Ptr PluginFeature -> IO PluginFeature
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr PluginFeature -> PluginFeature
Gst.PluginFeature.PluginFeature) [Ptr PluginFeature]
result'
    Ptr (GList (Ptr PluginFeature)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr PluginFeature))
result
    Ptr Any -> IO ()
forall a. Ptr a -> IO ()
safeFreeFunPtr (Ptr Any -> IO ()) -> Ptr Any -> IO ()
forall a b. (a -> b) -> a -> b
$ FunPtr C_PluginFeatureFilter -> Ptr Any
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_PluginFeatureFilter
filter'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
registry
    [PluginFeature] -> IO [PluginFeature]
forall (m :: * -> *) a. Monad m => a -> m a
return [PluginFeature]
result''

#if defined(ENABLE_OVERLOADING)
data RegistryFeatureFilterMethodInfo
instance (signature ~ (Gst.Callbacks.PluginFeatureFilter -> Bool -> m [Gst.PluginFeature.PluginFeature]), MonadIO m, IsRegistry a) => O.MethodInfo RegistryFeatureFilterMethodInfo a signature where
    overloadedMethod = registryFeatureFilter

#endif

-- method Registry::find_feature
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "registry"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Registry" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the registry to search"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the pluginfeature name to find"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "type"
--           , argType = TBasicType TGType
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the pluginfeature type to find"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Gst" , name = "PluginFeature" })
-- throws : False
-- Skip return : False

foreign import ccall "gst_registry_find_feature" gst_registry_find_feature :: 
    Ptr Registry ->                         -- registry : TInterface (Name {namespace = "Gst", name = "Registry"})
    CString ->                              -- name : TBasicType TUTF8
    CGType ->                               -- type : TBasicType TGType
    IO (Ptr Gst.PluginFeature.PluginFeature)

-- | Find the pluginfeature with the given name and type in the registry.
registryFindFeature ::
    (B.CallStack.HasCallStack, MonadIO m, IsRegistry a) =>
    a
    -- ^ /@registry@/: the registry to search
    -> T.Text
    -- ^ /@name@/: the pluginfeature name to find
    -> GType
    -- ^ /@type@/: the pluginfeature type to find
    -> m (Maybe Gst.PluginFeature.PluginFeature)
    -- ^ __Returns:__ the pluginfeature with the
    --     given name and type or 'P.Nothing' if the plugin was not
    --     found. 'GI.Gst.Objects.Object.objectUnref' after usage.
    -- 
    -- MT safe.
registryFindFeature :: a -> Text -> GType -> m (Maybe PluginFeature)
registryFindFeature registry :: a
registry name :: Text
name type_ :: GType
type_ = IO (Maybe PluginFeature) -> m (Maybe PluginFeature)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe PluginFeature) -> m (Maybe PluginFeature))
-> IO (Maybe PluginFeature) -> m (Maybe PluginFeature)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Registry
registry' <- a -> IO (Ptr Registry)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
registry
    CString
name' <- Text -> IO CString
textToCString Text
name
    let type_' :: CGType
type_' = GType -> CGType
gtypeToCGType GType
type_
    Ptr PluginFeature
result <- Ptr Registry -> CString -> CGType -> IO (Ptr PluginFeature)
gst_registry_find_feature Ptr Registry
registry' CString
name' CGType
type_'
    Maybe PluginFeature
maybeResult <- Ptr PluginFeature
-> (Ptr PluginFeature -> IO PluginFeature)
-> IO (Maybe PluginFeature)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr PluginFeature
result ((Ptr PluginFeature -> IO PluginFeature)
 -> IO (Maybe PluginFeature))
-> (Ptr PluginFeature -> IO PluginFeature)
-> IO (Maybe PluginFeature)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr PluginFeature
result' -> do
        PluginFeature
result'' <- ((ManagedPtr PluginFeature -> PluginFeature)
-> Ptr PluginFeature -> IO PluginFeature
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr PluginFeature -> PluginFeature
Gst.PluginFeature.PluginFeature) Ptr PluginFeature
result'
        PluginFeature -> IO PluginFeature
forall (m :: * -> *) a. Monad m => a -> m a
return PluginFeature
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
registry
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
    Maybe PluginFeature -> IO (Maybe PluginFeature)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe PluginFeature
maybeResult

#if defined(ENABLE_OVERLOADING)
data RegistryFindFeatureMethodInfo
instance (signature ~ (T.Text -> GType -> m (Maybe Gst.PluginFeature.PluginFeature)), MonadIO m, IsRegistry a) => O.MethodInfo RegistryFindFeatureMethodInfo a signature where
    overloadedMethod = registryFindFeature

#endif

-- method Registry::find_plugin
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "registry"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Registry" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the registry to search"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the plugin name to find"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gst" , name = "Plugin" })
-- throws : False
-- Skip return : False

foreign import ccall "gst_registry_find_plugin" gst_registry_find_plugin :: 
    Ptr Registry ->                         -- registry : TInterface (Name {namespace = "Gst", name = "Registry"})
    CString ->                              -- name : TBasicType TUTF8
    IO (Ptr Gst.Plugin.Plugin)

-- | Find the plugin with the given name in the registry.
-- The plugin will be reffed; caller is responsible for unreffing.
registryFindPlugin ::
    (B.CallStack.HasCallStack, MonadIO m, IsRegistry a) =>
    a
    -- ^ /@registry@/: the registry to search
    -> T.Text
    -- ^ /@name@/: the plugin name to find
    -> m (Maybe Gst.Plugin.Plugin)
    -- ^ __Returns:__ the plugin with the given name
    --     or 'P.Nothing' if the plugin was not found. 'GI.Gst.Objects.Object.objectUnref' after
    --     usage.
    -- 
    -- MT safe.
registryFindPlugin :: a -> Text -> m (Maybe Plugin)
registryFindPlugin registry :: a
registry name :: Text
name = IO (Maybe Plugin) -> m (Maybe Plugin)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Plugin) -> m (Maybe Plugin))
-> IO (Maybe Plugin) -> m (Maybe Plugin)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Registry
registry' <- a -> IO (Ptr Registry)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
registry
    CString
name' <- Text -> IO CString
textToCString Text
name
    Ptr Plugin
result <- Ptr Registry -> CString -> IO (Ptr Plugin)
gst_registry_find_plugin Ptr Registry
registry' CString
name'
    Maybe Plugin
maybeResult <- Ptr Plugin -> (Ptr Plugin -> IO Plugin) -> IO (Maybe Plugin)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Plugin
result ((Ptr Plugin -> IO Plugin) -> IO (Maybe Plugin))
-> (Ptr Plugin -> IO Plugin) -> IO (Maybe Plugin)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr Plugin
result' -> do
        Plugin
result'' <- ((ManagedPtr Plugin -> Plugin) -> Ptr Plugin -> IO Plugin
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Plugin -> Plugin
Gst.Plugin.Plugin) Ptr Plugin
result'
        Plugin -> IO Plugin
forall (m :: * -> *) a. Monad m => a -> m a
return Plugin
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
registry
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
    Maybe Plugin -> IO (Maybe Plugin)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Plugin
maybeResult

#if defined(ENABLE_OVERLOADING)
data RegistryFindPluginMethodInfo
instance (signature ~ (T.Text -> m (Maybe Gst.Plugin.Plugin)), MonadIO m, IsRegistry a) => O.MethodInfo RegistryFindPluginMethodInfo a signature where
    overloadedMethod = registryFindPlugin

#endif

-- method Registry::get_feature_list
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "registry"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Registry" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstRegistry" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "type"
--           , argType = TBasicType TGType
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GType." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TGList
--                  (TInterface Name { namespace = "Gst" , name = "PluginFeature" }))
-- throws : False
-- Skip return : False

foreign import ccall "gst_registry_get_feature_list" gst_registry_get_feature_list :: 
    Ptr Registry ->                         -- registry : TInterface (Name {namespace = "Gst", name = "Registry"})
    CGType ->                               -- type : TBasicType TGType
    IO (Ptr (GList (Ptr Gst.PluginFeature.PluginFeature)))

-- | Retrieves a t'GI.GLib.Structs.List.List' of t'GI.Gst.Objects.PluginFeature.PluginFeature' of /@type@/.
registryGetFeatureList ::
    (B.CallStack.HasCallStack, MonadIO m, IsRegistry a) =>
    a
    -- ^ /@registry@/: a t'GI.Gst.Objects.Registry.Registry'
    -> GType
    -- ^ /@type@/: a t'GType'.
    -> m [Gst.PluginFeature.PluginFeature]
    -- ^ __Returns:__ a t'GI.GLib.Structs.List.List' of
    --     t'GI.Gst.Objects.PluginFeature.PluginFeature' of /@type@/. Use 'GI.Gst.Objects.PluginFeature.pluginFeatureListFree' after use
    -- 
    -- MT safe.
registryGetFeatureList :: a -> GType -> m [PluginFeature]
registryGetFeatureList registry :: a
registry type_ :: GType
type_ = IO [PluginFeature] -> m [PluginFeature]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [PluginFeature] -> m [PluginFeature])
-> IO [PluginFeature] -> m [PluginFeature]
forall a b. (a -> b) -> a -> b
$ do
    Ptr Registry
registry' <- a -> IO (Ptr Registry)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
registry
    let type_' :: CGType
type_' = GType -> CGType
gtypeToCGType GType
type_
    Ptr (GList (Ptr PluginFeature))
result <- Ptr Registry -> CGType -> IO (Ptr (GList (Ptr PluginFeature)))
gst_registry_get_feature_list Ptr Registry
registry' CGType
type_'
    [Ptr PluginFeature]
result' <- Ptr (GList (Ptr PluginFeature)) -> IO [Ptr PluginFeature]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr PluginFeature))
result
    [PluginFeature]
result'' <- (Ptr PluginFeature -> IO PluginFeature)
-> [Ptr PluginFeature] -> IO [PluginFeature]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr PluginFeature -> PluginFeature)
-> Ptr PluginFeature -> IO PluginFeature
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr PluginFeature -> PluginFeature
Gst.PluginFeature.PluginFeature) [Ptr PluginFeature]
result'
    Ptr (GList (Ptr PluginFeature)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr PluginFeature))
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
registry
    [PluginFeature] -> IO [PluginFeature]
forall (m :: * -> *) a. Monad m => a -> m a
return [PluginFeature]
result''

#if defined(ENABLE_OVERLOADING)
data RegistryGetFeatureListMethodInfo
instance (signature ~ (GType -> m [Gst.PluginFeature.PluginFeature]), MonadIO m, IsRegistry a) => O.MethodInfo RegistryGetFeatureListMethodInfo a signature where
    overloadedMethod = registryGetFeatureList

#endif

-- method Registry::get_feature_list_by_plugin
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "registry"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Registry" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstRegistry." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a plugin name." , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TGList
--                  (TInterface Name { namespace = "Gst" , name = "PluginFeature" }))
-- throws : False
-- Skip return : False

foreign import ccall "gst_registry_get_feature_list_by_plugin" gst_registry_get_feature_list_by_plugin :: 
    Ptr Registry ->                         -- registry : TInterface (Name {namespace = "Gst", name = "Registry"})
    CString ->                              -- name : TBasicType TUTF8
    IO (Ptr (GList (Ptr Gst.PluginFeature.PluginFeature)))

-- | Retrieves a t'GI.GLib.Structs.List.List' of features of the plugin with name /@name@/.
registryGetFeatureListByPlugin ::
    (B.CallStack.HasCallStack, MonadIO m, IsRegistry a) =>
    a
    -- ^ /@registry@/: a t'GI.Gst.Objects.Registry.Registry'.
    -> T.Text
    -- ^ /@name@/: a plugin name.
    -> m [Gst.PluginFeature.PluginFeature]
    -- ^ __Returns:__ a t'GI.GLib.Structs.List.List' of
    --     t'GI.Gst.Objects.PluginFeature.PluginFeature'. Use 'GI.Gst.Objects.PluginFeature.pluginFeatureListFree' after usage.
registryGetFeatureListByPlugin :: a -> Text -> m [PluginFeature]
registryGetFeatureListByPlugin registry :: a
registry name :: Text
name = IO [PluginFeature] -> m [PluginFeature]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [PluginFeature] -> m [PluginFeature])
-> IO [PluginFeature] -> m [PluginFeature]
forall a b. (a -> b) -> a -> b
$ do
    Ptr Registry
registry' <- a -> IO (Ptr Registry)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
registry
    CString
name' <- Text -> IO CString
textToCString Text
name
    Ptr (GList (Ptr PluginFeature))
result <- Ptr Registry -> CString -> IO (Ptr (GList (Ptr PluginFeature)))
gst_registry_get_feature_list_by_plugin Ptr Registry
registry' CString
name'
    [Ptr PluginFeature]
result' <- Ptr (GList (Ptr PluginFeature)) -> IO [Ptr PluginFeature]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr PluginFeature))
result
    [PluginFeature]
result'' <- (Ptr PluginFeature -> IO PluginFeature)
-> [Ptr PluginFeature] -> IO [PluginFeature]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr PluginFeature -> PluginFeature)
-> Ptr PluginFeature -> IO PluginFeature
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr PluginFeature -> PluginFeature
Gst.PluginFeature.PluginFeature) [Ptr PluginFeature]
result'
    Ptr (GList (Ptr PluginFeature)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr PluginFeature))
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
registry
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
    [PluginFeature] -> IO [PluginFeature]
forall (m :: * -> *) a. Monad m => a -> m a
return [PluginFeature]
result''

#if defined(ENABLE_OVERLOADING)
data RegistryGetFeatureListByPluginMethodInfo
instance (signature ~ (T.Text -> m [Gst.PluginFeature.PluginFeature]), MonadIO m, IsRegistry a) => O.MethodInfo RegistryGetFeatureListByPluginMethodInfo a signature where
    overloadedMethod = registryGetFeatureListByPlugin

#endif

-- method Registry::get_feature_list_cookie
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "registry"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Registry" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the registry" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt32)
-- throws : False
-- Skip return : False

foreign import ccall "gst_registry_get_feature_list_cookie" gst_registry_get_feature_list_cookie :: 
    Ptr Registry ->                         -- registry : TInterface (Name {namespace = "Gst", name = "Registry"})
    IO Word32

-- | Returns the registry\'s feature list cookie. This changes
-- every time a feature is added or removed from the registry.
registryGetFeatureListCookie ::
    (B.CallStack.HasCallStack, MonadIO m, IsRegistry a) =>
    a
    -- ^ /@registry@/: the registry
    -> m Word32
    -- ^ __Returns:__ the feature list cookie.
registryGetFeatureListCookie :: a -> m Word32
registryGetFeatureListCookie registry :: a
registry = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Ptr Registry
registry' <- a -> IO (Ptr Registry)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
registry
    Word32
result <- Ptr Registry -> IO Word32
gst_registry_get_feature_list_cookie Ptr Registry
registry'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
registry
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result

#if defined(ENABLE_OVERLOADING)
data RegistryGetFeatureListCookieMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsRegistry a) => O.MethodInfo RegistryGetFeatureListCookieMethodInfo a signature where
    overloadedMethod = registryGetFeatureListCookie

#endif

-- method Registry::get_plugin_list
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "registry"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Registry" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the registry to search"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TGList (TInterface Name { namespace = "Gst" , name = "Plugin" }))
-- throws : False
-- Skip return : False

foreign import ccall "gst_registry_get_plugin_list" gst_registry_get_plugin_list :: 
    Ptr Registry ->                         -- registry : TInterface (Name {namespace = "Gst", name = "Registry"})
    IO (Ptr (GList (Ptr Gst.Plugin.Plugin)))

-- | Get a copy of all plugins registered in the given registry. The refcount
-- of each element in the list in incremented.
registryGetPluginList ::
    (B.CallStack.HasCallStack, MonadIO m, IsRegistry a) =>
    a
    -- ^ /@registry@/: the registry to search
    -> m [Gst.Plugin.Plugin]
    -- ^ __Returns:__ a t'GI.GLib.Structs.List.List' of t'GI.Gst.Objects.Plugin.Plugin'.
    --     Use 'GI.Gst.Objects.Plugin.pluginListFree' after usage.
    -- 
    -- MT safe.
registryGetPluginList :: a -> m [Plugin]
registryGetPluginList registry :: a
registry = IO [Plugin] -> m [Plugin]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Plugin] -> m [Plugin]) -> IO [Plugin] -> m [Plugin]
forall a b. (a -> b) -> a -> b
$ do
    Ptr Registry
registry' <- a -> IO (Ptr Registry)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
registry
    Ptr (GList (Ptr Plugin))
result <- Ptr Registry -> IO (Ptr (GList (Ptr Plugin)))
gst_registry_get_plugin_list Ptr Registry
registry'
    [Ptr Plugin]
result' <- Ptr (GList (Ptr Plugin)) -> IO [Ptr Plugin]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr Plugin))
result
    [Plugin]
result'' <- (Ptr Plugin -> IO Plugin) -> [Ptr Plugin] -> IO [Plugin]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr Plugin -> Plugin) -> Ptr Plugin -> IO Plugin
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Plugin -> Plugin
Gst.Plugin.Plugin) [Ptr Plugin]
result'
    Ptr (GList (Ptr Plugin)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr Plugin))
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
registry
    [Plugin] -> IO [Plugin]
forall (m :: * -> *) a. Monad m => a -> m a
return [Plugin]
result''

#if defined(ENABLE_OVERLOADING)
data RegistryGetPluginListMethodInfo
instance (signature ~ (m [Gst.Plugin.Plugin]), MonadIO m, IsRegistry a) => O.MethodInfo RegistryGetPluginListMethodInfo a signature where
    overloadedMethod = registryGetPluginList

#endif

-- method Registry::lookup
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "registry"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Registry" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the registry to look up in"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "filename"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the name of the file to look up"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gst" , name = "Plugin" })
-- throws : False
-- Skip return : False

foreign import ccall "gst_registry_lookup" gst_registry_lookup :: 
    Ptr Registry ->                         -- registry : TInterface (Name {namespace = "Gst", name = "Registry"})
    CString ->                              -- filename : TBasicType TUTF8
    IO (Ptr Gst.Plugin.Plugin)

-- | Look up a plugin in the given registry with the given filename.
-- If found, plugin is reffed.
registryLookup ::
    (B.CallStack.HasCallStack, MonadIO m, IsRegistry a) =>
    a
    -- ^ /@registry@/: the registry to look up in
    -> T.Text
    -- ^ /@filename@/: the name of the file to look up
    -> m (Maybe Gst.Plugin.Plugin)
    -- ^ __Returns:__ the t'GI.Gst.Objects.Plugin.Plugin' if found, or
    --     'P.Nothing' if not.  'GI.Gst.Objects.Object.objectUnref' after usage.
registryLookup :: a -> Text -> m (Maybe Plugin)
registryLookup registry :: a
registry filename :: Text
filename = IO (Maybe Plugin) -> m (Maybe Plugin)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Plugin) -> m (Maybe Plugin))
-> IO (Maybe Plugin) -> m (Maybe Plugin)
forall a b. (a -> b) -> a -> b
$ do
    Ptr Registry
registry' <- a -> IO (Ptr Registry)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
registry
    CString
filename' <- Text -> IO CString
textToCString Text
filename
    Ptr Plugin
result <- Ptr Registry -> CString -> IO (Ptr Plugin)
gst_registry_lookup Ptr Registry
registry' CString
filename'
    Maybe Plugin
maybeResult <- Ptr Plugin -> (Ptr Plugin -> IO Plugin) -> IO (Maybe Plugin)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
convertIfNonNull Ptr Plugin
result ((Ptr Plugin -> IO Plugin) -> IO (Maybe Plugin))
-> (Ptr Plugin -> IO Plugin) -> IO (Maybe Plugin)
forall a b. (a -> b) -> a -> b
$ \result' :: Ptr Plugin
result' -> do
        Plugin
result'' <- ((ManagedPtr Plugin -> Plugin) -> Ptr Plugin -> IO Plugin
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Plugin -> Plugin
Gst.Plugin.Plugin) Ptr Plugin
result'
        Plugin -> IO Plugin
forall (m :: * -> *) a. Monad m => a -> m a
return Plugin
result''
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
registry
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
filename'
    Maybe Plugin -> IO (Maybe Plugin)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Plugin
maybeResult

#if defined(ENABLE_OVERLOADING)
data RegistryLookupMethodInfo
instance (signature ~ (T.Text -> m (Maybe Gst.Plugin.Plugin)), MonadIO m, IsRegistry a) => O.MethodInfo RegistryLookupMethodInfo a signature where
    overloadedMethod = registryLookup

#endif

-- method Registry::lookup_feature
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "registry"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Registry" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstRegistry" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GstPluginFeature name"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Gst" , name = "PluginFeature" })
-- throws : False
-- Skip return : False

foreign import ccall "gst_registry_lookup_feature" gst_registry_lookup_feature :: 
    Ptr Registry ->                         -- registry : TInterface (Name {namespace = "Gst", name = "Registry"})
    CString ->                              -- name : TBasicType TUTF8
    IO (Ptr Gst.PluginFeature.PluginFeature)

-- | Find a t'GI.Gst.Objects.PluginFeature.PluginFeature' with /@name@/ in /@registry@/.
registryLookupFeature ::
    (B.CallStack.HasCallStack, MonadIO m, IsRegistry a) =>
    a
    -- ^ /@registry@/: a t'GI.Gst.Objects.Registry.Registry'
    -> T.Text
    -- ^ /@name@/: a t'GI.Gst.Objects.PluginFeature.PluginFeature' name
    -> m Gst.PluginFeature.PluginFeature
    -- ^ __Returns:__ a t'GI.Gst.Objects.PluginFeature.PluginFeature' with its refcount incremented,
    --     use 'GI.Gst.Objects.Object.objectUnref' after usage.
    -- 
    -- MT safe.
registryLookupFeature :: a -> Text -> m PluginFeature
registryLookupFeature registry :: a
registry name :: Text
name = IO PluginFeature -> m PluginFeature
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO PluginFeature -> m PluginFeature)
-> IO PluginFeature -> m PluginFeature
forall a b. (a -> b) -> a -> b
$ do
    Ptr Registry
registry' <- a -> IO (Ptr Registry)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
registry
    CString
name' <- Text -> IO CString
textToCString Text
name
    Ptr PluginFeature
result <- Ptr Registry -> CString -> IO (Ptr PluginFeature)
gst_registry_lookup_feature Ptr Registry
registry' CString
name'
    Text -> Ptr PluginFeature -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "registryLookupFeature" Ptr PluginFeature
result
    PluginFeature
result' <- ((ManagedPtr PluginFeature -> PluginFeature)
-> Ptr PluginFeature -> IO PluginFeature
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr PluginFeature -> PluginFeature
Gst.PluginFeature.PluginFeature) Ptr PluginFeature
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
registry
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
    PluginFeature -> IO PluginFeature
forall (m :: * -> *) a. Monad m => a -> m a
return PluginFeature
result'

#if defined(ENABLE_OVERLOADING)
data RegistryLookupFeatureMethodInfo
instance (signature ~ (T.Text -> m Gst.PluginFeature.PluginFeature), MonadIO m, IsRegistry a) => O.MethodInfo RegistryLookupFeatureMethodInfo a signature where
    overloadedMethod = registryLookupFeature

#endif

-- method Registry::plugin_filter
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "registry"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Registry" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "registry to query" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "filter"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "PluginFilter" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the filter to use" , sinceVersion = Nothing }
--           , argScope = ScopeTypeCall
--           , argClosure = 3
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "first"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "only return first match"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "user data passed to the filter function"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just
--               (TGList (TInterface Name { namespace = "Gst" , name = "Plugin" }))
-- throws : False
-- Skip return : False

foreign import ccall "gst_registry_plugin_filter" gst_registry_plugin_filter :: 
    Ptr Registry ->                         -- registry : TInterface (Name {namespace = "Gst", name = "Registry"})
    FunPtr Gst.Callbacks.C_PluginFilter ->  -- filter : TInterface (Name {namespace = "Gst", name = "PluginFilter"})
    CInt ->                                 -- first : TBasicType TBoolean
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO (Ptr (GList (Ptr Gst.Plugin.Plugin)))

-- | Runs a filter against all plugins in the registry and returns a t'GI.GLib.Structs.List.List' with
-- the results. If the first flag is set, only the first match is
-- returned (as a list with a single object).
-- Every plugin is reffed; use 'GI.Gst.Objects.Plugin.pluginListFree' after use, which
-- will unref again.
registryPluginFilter ::
    (B.CallStack.HasCallStack, MonadIO m, IsRegistry a) =>
    a
    -- ^ /@registry@/: registry to query
    -> Gst.Callbacks.PluginFilter
    -- ^ /@filter@/: the filter to use
    -> Bool
    -- ^ /@first@/: only return first match
    -> m [Gst.Plugin.Plugin]
    -- ^ __Returns:__ a t'GI.GLib.Structs.List.List' of t'GI.Gst.Objects.Plugin.Plugin'.
    --     Use 'GI.Gst.Objects.Plugin.pluginListFree' after usage.
    -- 
    -- MT safe.
registryPluginFilter :: a -> PluginFilter -> Bool -> m [Plugin]
registryPluginFilter registry :: a
registry filter :: PluginFilter
filter first :: Bool
first = IO [Plugin] -> m [Plugin]
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO [Plugin] -> m [Plugin]) -> IO [Plugin] -> m [Plugin]
forall a b. (a -> b) -> a -> b
$ do
    Ptr Registry
registry' <- a -> IO (Ptr Registry)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
registry
    FunPtr C_PluginFilter
filter' <- C_PluginFilter -> IO (FunPtr C_PluginFilter)
Gst.Callbacks.mk_PluginFilter (Maybe (Ptr (FunPtr C_PluginFilter))
-> PluginFilter_WithClosures -> C_PluginFilter
Gst.Callbacks.wrap_PluginFilter Maybe (Ptr (FunPtr C_PluginFilter))
forall a. Maybe a
Nothing (PluginFilter -> PluginFilter_WithClosures
Gst.Callbacks.drop_closures_PluginFilter PluginFilter
filter))
    let first' :: CInt
first' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
first
    let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
    Ptr (GList (Ptr Plugin))
result <- Ptr Registry
-> FunPtr C_PluginFilter
-> CInt
-> Ptr ()
-> IO (Ptr (GList (Ptr Plugin)))
gst_registry_plugin_filter Ptr Registry
registry' FunPtr C_PluginFilter
filter' CInt
first' Ptr ()
forall a. Ptr a
userData
    [Ptr Plugin]
result' <- Ptr (GList (Ptr Plugin)) -> IO [Ptr Plugin]
forall a. Ptr (GList (Ptr a)) -> IO [Ptr a]
unpackGList Ptr (GList (Ptr Plugin))
result
    [Plugin]
result'' <- (Ptr Plugin -> IO Plugin) -> [Ptr Plugin] -> IO [Plugin]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr Plugin -> Plugin) -> Ptr Plugin -> IO Plugin
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr Plugin -> Plugin
Gst.Plugin.Plugin) [Ptr Plugin]
result'
    Ptr (GList (Ptr Plugin)) -> IO ()
forall a. Ptr (GList a) -> IO ()
g_list_free Ptr (GList (Ptr Plugin))
result
    Ptr Any -> IO ()
forall a. Ptr a -> IO ()
safeFreeFunPtr (Ptr Any -> IO ()) -> Ptr Any -> IO ()
forall a b. (a -> b) -> a -> b
$ FunPtr C_PluginFilter -> Ptr Any
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_PluginFilter
filter'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
registry
    [Plugin] -> IO [Plugin]
forall (m :: * -> *) a. Monad m => a -> m a
return [Plugin]
result''

#if defined(ENABLE_OVERLOADING)
data RegistryPluginFilterMethodInfo
instance (signature ~ (Gst.Callbacks.PluginFilter -> Bool -> m [Gst.Plugin.Plugin]), MonadIO m, IsRegistry a) => O.MethodInfo RegistryPluginFilterMethodInfo a signature where
    overloadedMethod = registryPluginFilter

#endif

-- method Registry::remove_feature
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "registry"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Registry" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the registry to remove the feature from"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "feature"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "PluginFeature" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the feature to remove"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_registry_remove_feature" gst_registry_remove_feature :: 
    Ptr Registry ->                         -- registry : TInterface (Name {namespace = "Gst", name = "Registry"})
    Ptr Gst.PluginFeature.PluginFeature ->  -- feature : TInterface (Name {namespace = "Gst", name = "PluginFeature"})
    IO ()

-- | Remove the feature from the registry.
-- 
-- MT safe.
registryRemoveFeature ::
    (B.CallStack.HasCallStack, MonadIO m, IsRegistry a, Gst.PluginFeature.IsPluginFeature b) =>
    a
    -- ^ /@registry@/: the registry to remove the feature from
    -> b
    -- ^ /@feature@/: the feature to remove
    -> m ()
registryRemoveFeature :: a -> b -> m ()
registryRemoveFeature registry :: a
registry feature :: b
feature = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Registry
registry' <- a -> IO (Ptr Registry)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
registry
    Ptr PluginFeature
feature' <- b -> IO (Ptr PluginFeature)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
feature
    Ptr Registry -> Ptr PluginFeature -> IO ()
gst_registry_remove_feature Ptr Registry
registry' Ptr PluginFeature
feature'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
registry
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
feature
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data RegistryRemoveFeatureMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsRegistry a, Gst.PluginFeature.IsPluginFeature b) => O.MethodInfo RegistryRemoveFeatureMethodInfo a signature where
    overloadedMethod = registryRemoveFeature

#endif

-- method Registry::remove_plugin
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "registry"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Registry" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the registry to remove the plugin from"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "plugin"
--           , argType = TInterface Name { namespace = "Gst" , name = "Plugin" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the plugin to remove"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_registry_remove_plugin" gst_registry_remove_plugin :: 
    Ptr Registry ->                         -- registry : TInterface (Name {namespace = "Gst", name = "Registry"})
    Ptr Gst.Plugin.Plugin ->                -- plugin : TInterface (Name {namespace = "Gst", name = "Plugin"})
    IO ()

-- | Remove the plugin from the registry.
-- 
-- MT safe.
registryRemovePlugin ::
    (B.CallStack.HasCallStack, MonadIO m, IsRegistry a, Gst.Plugin.IsPlugin b) =>
    a
    -- ^ /@registry@/: the registry to remove the plugin from
    -> b
    -- ^ /@plugin@/: the plugin to remove
    -> m ()
registryRemovePlugin :: a -> b -> m ()
registryRemovePlugin registry :: a
registry plugin :: b
plugin = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    Ptr Registry
registry' <- a -> IO (Ptr Registry)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
registry
    Ptr Plugin
plugin' <- b -> IO (Ptr Plugin)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr b
plugin
    Ptr Registry -> Ptr Plugin -> IO ()
gst_registry_remove_plugin Ptr Registry
registry' Ptr Plugin
plugin'
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
registry
    b -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr b
plugin
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
data RegistryRemovePluginMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsRegistry a, Gst.Plugin.IsPlugin b) => O.MethodInfo RegistryRemovePluginMethodInfo a signature where
    overloadedMethod = registryRemovePlugin

#endif

-- method Registry::scan_path
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "registry"
--           , argType =
--               TInterface Name { namespace = "Gst" , name = "Registry" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the registry to add found plugins to"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "path"
--           , argType = TBasicType TFileName
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the path to scan" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gst_registry_scan_path" gst_registry_scan_path :: 
    Ptr Registry ->                         -- registry : TInterface (Name {namespace = "Gst", name = "Registry"})
    CString ->                              -- path : TBasicType TFileName
    IO CInt

-- | Scan the given path for plugins to add to the registry. The syntax of the
-- path is specific to the registry.
registryScanPath ::
    (B.CallStack.HasCallStack, MonadIO m, IsRegistry a) =>
    a
    -- ^ /@registry@/: the registry to add found plugins to
    -> [Char]
    -- ^ /@path@/: the path to scan
    -> m Bool
    -- ^ __Returns:__ 'P.True' if registry changed
registryScanPath :: a -> [Char] -> m Bool
registryScanPath registry :: a
registry path :: [Char]
path = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    Ptr Registry
registry' <- a -> IO (Ptr Registry)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
registry
    CString
path' <- [Char] -> IO CString
stringToCString [Char]
path
    CInt
result <- Ptr Registry -> CString -> IO CInt
gst_registry_scan_path Ptr Registry
registry' CString
path'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
registry
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
path'
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
data RegistryScanPathMethodInfo
instance (signature ~ ([Char] -> m Bool), MonadIO m, IsRegistry a) => O.MethodInfo RegistryScanPathMethodInfo a signature where
    overloadedMethod = registryScanPath

#endif

-- method Registry::fork_is_enabled
-- method type : MemberFunction
-- Args: []
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "gst_registry_fork_is_enabled" gst_registry_fork_is_enabled :: 
    IO CInt

-- | By default GStreamer will perform scanning and rebuilding of the
-- registry file using a helper child process.
-- 
-- Applications might want to disable this behaviour with the
-- 'GI.Gst.Objects.Registry.registryForkSetEnabled' function, in which case new plugins
-- are scanned (and loaded) into the application process.
registryForkIsEnabled ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Bool
    -- ^ __Returns:__ 'P.True' if GStreamer will use the child helper process when
    -- rebuilding the registry.
registryForkIsEnabled :: m Bool
registryForkIsEnabled  = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    CInt
result <- IO CInt
gst_registry_fork_is_enabled
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method Registry::fork_set_enabled
-- method type : MemberFunction
-- Args: [ Arg
--           { argCName = "enabled"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "whether rebuilding the registry can use a temporary child helper process."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_registry_fork_set_enabled" gst_registry_fork_set_enabled :: 
    CInt ->                                 -- enabled : TBasicType TBoolean
    IO ()

-- | Applications might want to disable\/enable spawning of a child helper process
-- when rebuilding the registry. See 'GI.Gst.Objects.Registry.registryForkIsEnabled' for more
-- information.
registryForkSetEnabled ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Bool
    -- ^ /@enabled@/: whether rebuilding the registry can use a temporary child helper process.
    -> m ()
registryForkSetEnabled :: Bool -> m ()
registryForkSetEnabled enabled :: Bool
enabled = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    let enabled' :: CInt
enabled' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
enabled
    CInt -> IO ()
gst_registry_fork_set_enabled CInt
enabled'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()

#if defined(ENABLE_OVERLOADING)
#endif

-- method Registry::get
-- method type : MemberFunction
-- Args: []
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Gst" , name = "Registry" })
-- throws : False
-- Skip return : False

foreign import ccall "gst_registry_get" gst_registry_get :: 
    IO (Ptr Registry)

-- | Retrieves the singleton plugin registry. The caller does not own a
-- reference on the registry, as it is alive as long as GStreamer is
-- initialized.
registryGet ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Registry
    -- ^ __Returns:__ the t'GI.Gst.Objects.Registry.Registry'.
registryGet :: m Registry
registryGet  = IO Registry -> m Registry
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Registry -> m Registry) -> IO Registry -> m Registry
forall a b. (a -> b) -> a -> b
$ do
    Ptr Registry
result <- IO (Ptr Registry)
gst_registry_get
    Text -> Ptr Registry -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "registryGet" Ptr Registry
result
    Registry
result' <- ((ManagedPtr Registry -> Registry) -> Ptr Registry -> IO Registry
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
newObject ManagedPtr Registry -> Registry
Registry) Ptr Registry
result
    Registry -> IO Registry
forall (m :: * -> *) a. Monad m => a -> m a
return Registry
result'

#if defined(ENABLE_OVERLOADING)
#endif