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

This is a base class for anything that can be added to a 'GI.Gst.Objects.Plugin.Plugin'.
-}

module GI.Gst.Objects.PluginFeature
    ( 

-- * Exported types
    PluginFeature(..)                       ,
    IsPluginFeature                         ,
    toPluginFeature                         ,
    noPluginFeature                         ,


 -- * Methods
-- ** checkVersion #method:checkVersion#
    PluginFeatureCheckVersionMethodInfo     ,
    pluginFeatureCheckVersion               ,


-- ** getPlugin #method:getPlugin#
    PluginFeatureGetPluginMethodInfo        ,
    pluginFeatureGetPlugin                  ,


-- ** getPluginName #method:getPluginName#
    PluginFeatureGetPluginNameMethodInfo    ,
    pluginFeatureGetPluginName              ,


-- ** getRank #method:getRank#
    PluginFeatureGetRankMethodInfo          ,
    pluginFeatureGetRank                    ,


-- ** listCopy #method:listCopy#
    pluginFeatureListCopy                   ,


-- ** listDebug #method:listDebug#
    pluginFeatureListDebug                  ,


-- ** listFree #method:listFree#
    pluginFeatureListFree                   ,


-- ** load #method:load#
    PluginFeatureLoadMethodInfo             ,
    pluginFeatureLoad                       ,


-- ** rankCompareFunc #method:rankCompareFunc#
    pluginFeatureRankCompareFunc            ,


-- ** setRank #method:setRank#
    PluginFeatureSetRankMethodInfo          ,
    pluginFeatureSetRank                    ,




    ) 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.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
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 GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Gst.Objects.Object as Gst.Object
import {-# SOURCE #-} qualified GI.Gst.Objects.Plugin as Gst.Plugin

newtype PluginFeature = PluginFeature (ManagedPtr PluginFeature)
foreign import ccall "gst_plugin_feature_get_type"
    c_gst_plugin_feature_get_type :: IO GType

instance GObject PluginFeature where
    gobjectType _ = c_gst_plugin_feature_get_type
    

class GObject o => IsPluginFeature o
#if MIN_VERSION_base(4,9,0)
instance {-# OVERLAPPABLE #-} (GObject a, O.UnknownAncestorError PluginFeature a) =>
    IsPluginFeature a
#endif
instance IsPluginFeature PluginFeature
instance Gst.Object.IsObject PluginFeature
instance GObject.Object.IsObject PluginFeature

toPluginFeature :: IsPluginFeature o => o -> IO PluginFeature
toPluginFeature = unsafeCastTo PluginFeature

noPluginFeature :: Maybe PluginFeature
noPluginFeature = Nothing

type family ResolvePluginFeatureMethod (t :: Symbol) (o :: *) :: * where
    ResolvePluginFeatureMethod "addControlBinding" o = Gst.Object.ObjectAddControlBindingMethodInfo
    ResolvePluginFeatureMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolvePluginFeatureMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolvePluginFeatureMethod "checkVersion" o = PluginFeatureCheckVersionMethodInfo
    ResolvePluginFeatureMethod "defaultError" o = Gst.Object.ObjectDefaultErrorMethodInfo
    ResolvePluginFeatureMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolvePluginFeatureMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolvePluginFeatureMethod "hasActiveControlBindings" o = Gst.Object.ObjectHasActiveControlBindingsMethodInfo
    ResolvePluginFeatureMethod "hasAncestor" o = Gst.Object.ObjectHasAncestorMethodInfo
    ResolvePluginFeatureMethod "hasAsAncestor" o = Gst.Object.ObjectHasAsAncestorMethodInfo
    ResolvePluginFeatureMethod "hasAsParent" o = Gst.Object.ObjectHasAsParentMethodInfo
    ResolvePluginFeatureMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolvePluginFeatureMethod "load" o = PluginFeatureLoadMethodInfo
    ResolvePluginFeatureMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolvePluginFeatureMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolvePluginFeatureMethod "ref" o = Gst.Object.ObjectRefMethodInfo
    ResolvePluginFeatureMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolvePluginFeatureMethod "removeControlBinding" o = Gst.Object.ObjectRemoveControlBindingMethodInfo
    ResolvePluginFeatureMethod "replaceData" o = GObject.Object.ObjectReplaceDataMethodInfo
    ResolvePluginFeatureMethod "replaceQdata" o = GObject.Object.ObjectReplaceQdataMethodInfo
    ResolvePluginFeatureMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolvePluginFeatureMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolvePluginFeatureMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolvePluginFeatureMethod "suggestNextSync" o = Gst.Object.ObjectSuggestNextSyncMethodInfo
    ResolvePluginFeatureMethod "syncValues" o = Gst.Object.ObjectSyncValuesMethodInfo
    ResolvePluginFeatureMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolvePluginFeatureMethod "unparent" o = Gst.Object.ObjectUnparentMethodInfo
    ResolvePluginFeatureMethod "unref" o = Gst.Object.ObjectUnrefMethodInfo
    ResolvePluginFeatureMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolvePluginFeatureMethod "getControlBinding" o = Gst.Object.ObjectGetControlBindingMethodInfo
    ResolvePluginFeatureMethod "getControlRate" o = Gst.Object.ObjectGetControlRateMethodInfo
    ResolvePluginFeatureMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolvePluginFeatureMethod "getGValueArray" o = Gst.Object.ObjectGetGValueArrayMethodInfo
    ResolvePluginFeatureMethod "getName" o = Gst.Object.ObjectGetNameMethodInfo
    ResolvePluginFeatureMethod "getParent" o = Gst.Object.ObjectGetParentMethodInfo
    ResolvePluginFeatureMethod "getPathString" o = Gst.Object.ObjectGetPathStringMethodInfo
    ResolvePluginFeatureMethod "getPlugin" o = PluginFeatureGetPluginMethodInfo
    ResolvePluginFeatureMethod "getPluginName" o = PluginFeatureGetPluginNameMethodInfo
    ResolvePluginFeatureMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolvePluginFeatureMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolvePluginFeatureMethod "getRank" o = PluginFeatureGetRankMethodInfo
    ResolvePluginFeatureMethod "getValue" o = Gst.Object.ObjectGetValueMethodInfo
    ResolvePluginFeatureMethod "getValueArray" o = Gst.Object.ObjectGetValueArrayMethodInfo
    ResolvePluginFeatureMethod "setControlBindingDisabled" o = Gst.Object.ObjectSetControlBindingDisabledMethodInfo
    ResolvePluginFeatureMethod "setControlBindingsDisabled" o = Gst.Object.ObjectSetControlBindingsDisabledMethodInfo
    ResolvePluginFeatureMethod "setControlRate" o = Gst.Object.ObjectSetControlRateMethodInfo
    ResolvePluginFeatureMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolvePluginFeatureMethod "setName" o = Gst.Object.ObjectSetNameMethodInfo
    ResolvePluginFeatureMethod "setParent" o = Gst.Object.ObjectSetParentMethodInfo
    ResolvePluginFeatureMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolvePluginFeatureMethod "setRank" o = PluginFeatureSetRankMethodInfo
    ResolvePluginFeatureMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolvePluginFeatureMethod t PluginFeature, O.MethodInfo info PluginFeature p) => O.IsLabelProxy t (PluginFeature -> p) where
    fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)

#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolvePluginFeatureMethod t PluginFeature, O.MethodInfo info PluginFeature p) => O.IsLabel t (PluginFeature -> p) where
    fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif

instance O.HasAttributeList PluginFeature
type instance O.AttributeList PluginFeature = PluginFeatureAttributeList
type PluginFeatureAttributeList = ('[ '("name", Gst.Object.ObjectNamePropertyInfo), '("parent", Gst.Object.ObjectParentPropertyInfo)] :: [(Symbol, *)])

type instance O.SignalList PluginFeature = PluginFeatureSignalList
type PluginFeatureSignalList = ('[ '("deepNotify", Gst.Object.ObjectDeepNotifySignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, *)])

-- method PluginFeature::check_version
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "feature", argType = TInterface (Name {namespace = "Gst", name = "PluginFeature"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a feature", 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 "minimum required major version", 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 "minimum required minor version", 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 "minimum required micro version", 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_plugin_feature_check_version" gst_plugin_feature_check_version :: 
    Ptr PluginFeature ->                    -- feature : TInterface (Name {namespace = "Gst", name = "PluginFeature"})
    Word32 ->                               -- min_major : TBasicType TUInt
    Word32 ->                               -- min_minor : TBasicType TUInt
    Word32 ->                               -- min_micro : TBasicType TUInt
    IO CInt

{- |
Checks whether the given plugin feature is at least
 the required version
-}
pluginFeatureCheckVersion ::
    (B.CallStack.HasCallStack, MonadIO m, IsPluginFeature a) =>
    a
    {- ^ /@feature@/: a feature -}
    -> Word32
    {- ^ /@minMajor@/: minimum required major version -}
    -> Word32
    {- ^ /@minMinor@/: minimum required minor version -}
    -> Word32
    {- ^ /@minMicro@/: minimum required micro version -}
    -> m Bool
    {- ^ __Returns:__ 'True' if the plugin feature has at least
 the required version, otherwise 'False'. -}
pluginFeatureCheckVersion feature minMajor minMinor minMicro = liftIO $ do
    feature' <- unsafeManagedPtrCastPtr feature
    result <- gst_plugin_feature_check_version feature' minMajor minMinor minMicro
    let result' = (/= 0) result
    touchManagedPtr feature
    return result'

data PluginFeatureCheckVersionMethodInfo
instance (signature ~ (Word32 -> Word32 -> Word32 -> m Bool), MonadIO m, IsPluginFeature a) => O.MethodInfo PluginFeatureCheckVersionMethodInfo a signature where
    overloadedMethod _ = pluginFeatureCheckVersion

-- method PluginFeature::get_plugin
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "feature", argType = TInterface (Name {namespace = "Gst", name = "PluginFeature"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a feature", 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_plugin_feature_get_plugin" gst_plugin_feature_get_plugin :: 
    Ptr PluginFeature ->                    -- feature : TInterface (Name {namespace = "Gst", name = "PluginFeature"})
    IO (Ptr Gst.Plugin.Plugin)

{- |
Get the plugin that provides this feature.
-}
pluginFeatureGetPlugin ::
    (B.CallStack.HasCallStack, MonadIO m, IsPluginFeature a) =>
    a
    {- ^ /@feature@/: a feature -}
    -> m (Maybe Gst.Plugin.Plugin)
    {- ^ __Returns:__ the plugin that provides this
    feature, or 'Nothing'.  Unref with 'GI.Gst.Objects.Object.objectUnref' when no
    longer needed. -}
pluginFeatureGetPlugin feature = liftIO $ do
    feature' <- unsafeManagedPtrCastPtr feature
    result <- gst_plugin_feature_get_plugin feature'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (wrapObject Gst.Plugin.Plugin) result'
        return result''
    touchManagedPtr feature
    return maybeResult

data PluginFeatureGetPluginMethodInfo
instance (signature ~ (m (Maybe Gst.Plugin.Plugin)), MonadIO m, IsPluginFeature a) => O.MethodInfo PluginFeatureGetPluginMethodInfo a signature where
    overloadedMethod _ = pluginFeatureGetPlugin

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

foreign import ccall "gst_plugin_feature_get_plugin_name" gst_plugin_feature_get_plugin_name :: 
    Ptr PluginFeature ->                    -- feature : TInterface (Name {namespace = "Gst", name = "PluginFeature"})
    IO CString

{- |
Get the name of the plugin that provides this feature.

@since 1.2
-}
pluginFeatureGetPluginName ::
    (B.CallStack.HasCallStack, MonadIO m, IsPluginFeature a) =>
    a
    {- ^ /@feature@/: a feature -}
    -> m (Maybe T.Text)
    {- ^ __Returns:__ the name of the plugin that provides this
    feature, or 'Nothing' if the feature is not associated with a
    plugin. -}
pluginFeatureGetPluginName feature = liftIO $ do
    feature' <- unsafeManagedPtrCastPtr feature
    result <- gst_plugin_feature_get_plugin_name feature'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- cstringToText result'
        return result''
    touchManagedPtr feature
    return maybeResult

data PluginFeatureGetPluginNameMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsPluginFeature a) => O.MethodInfo PluginFeatureGetPluginNameMethodInfo a signature where
    overloadedMethod _ = pluginFeatureGetPluginName

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

foreign import ccall "gst_plugin_feature_get_rank" gst_plugin_feature_get_rank :: 
    Ptr PluginFeature ->                    -- feature : TInterface (Name {namespace = "Gst", name = "PluginFeature"})
    IO Word32

{- |
Gets the rank of a plugin feature.
-}
pluginFeatureGetRank ::
    (B.CallStack.HasCallStack, MonadIO m, IsPluginFeature a) =>
    a
    {- ^ /@feature@/: a feature -}
    -> m Word32
    {- ^ __Returns:__ The rank of the feature -}
pluginFeatureGetRank feature = liftIO $ do
    feature' <- unsafeManagedPtrCastPtr feature
    result <- gst_plugin_feature_get_rank feature'
    touchManagedPtr feature
    return result

data PluginFeatureGetRankMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsPluginFeature a) => O.MethodInfo PluginFeatureGetRankMethodInfo a signature where
    overloadedMethod _ = pluginFeatureGetRank

-- method PluginFeature::load
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "feature", argType = TInterface (Name {namespace = "Gst", name = "PluginFeature"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "the plugin feature to check", 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_plugin_feature_load" gst_plugin_feature_load :: 
    Ptr PluginFeature ->                    -- feature : TInterface (Name {namespace = "Gst", name = "PluginFeature"})
    IO (Ptr PluginFeature)

{- |
Loads the plugin containing /@feature@/ if it\'s not already loaded. /@feature@/ is
unaffected; use the return value instead.

Normally this function is used like this:

=== /C code/
>
>GstPluginFeature *loaded_feature;
>
>loaded_feature = gst_plugin_feature_load (feature);
>// presumably, we're no longer interested in the potentially-unloaded feature
>gst_object_unref (feature);
>feature = loaded_feature;
-}
pluginFeatureLoad ::
    (B.CallStack.HasCallStack, MonadIO m, IsPluginFeature a) =>
    a
    {- ^ /@feature@/: the plugin feature to check -}
    -> m (Maybe PluginFeature)
    {- ^ __Returns:__ a reference to the loaded
feature, or 'Nothing' on error -}
pluginFeatureLoad feature = liftIO $ do
    feature' <- unsafeManagedPtrCastPtr feature
    result <- gst_plugin_feature_load feature'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (wrapObject PluginFeature) result'
        return result''
    touchManagedPtr feature
    return maybeResult

data PluginFeatureLoadMethodInfo
instance (signature ~ (m (Maybe PluginFeature)), MonadIO m, IsPluginFeature a) => O.MethodInfo PluginFeatureLoadMethodInfo a signature where
    overloadedMethod _ = pluginFeatureLoad

-- method PluginFeature::set_rank
-- method type : OrdinaryMethod
-- Args : [Arg {argCName = "feature", argType = TInterface (Name {namespace = "Gst", name = "PluginFeature"}), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "feature to rank", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "rank", argType = TBasicType TUInt, direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "rank value - higher number means more priority rank", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_plugin_feature_set_rank" gst_plugin_feature_set_rank :: 
    Ptr PluginFeature ->                    -- feature : TInterface (Name {namespace = "Gst", name = "PluginFeature"})
    Word32 ->                               -- rank : TBasicType TUInt
    IO ()

{- |
Specifies a rank for a plugin feature, so that autoplugging uses
the most appropriate feature.
-}
pluginFeatureSetRank ::
    (B.CallStack.HasCallStack, MonadIO m, IsPluginFeature a) =>
    a
    {- ^ /@feature@/: feature to rank -}
    -> Word32
    {- ^ /@rank@/: rank value - higher number means more priority rank -}
    -> m ()
pluginFeatureSetRank feature rank = liftIO $ do
    feature' <- unsafeManagedPtrCastPtr feature
    gst_plugin_feature_set_rank feature' rank
    touchManagedPtr feature
    return ()

data PluginFeatureSetRankMethodInfo
instance (signature ~ (Word32 -> m ()), MonadIO m, IsPluginFeature a) => O.MethodInfo PluginFeatureSetRankMethodInfo a signature where
    overloadedMethod _ = pluginFeatureSetRank

-- method PluginFeature::list_copy
-- method type : MemberFunction
-- Args : [Arg {argCName = "list", argType = TGList (TInterface (Name {namespace = "Gst", name = "PluginFeature"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "list\n    of #GstPluginFeature", 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_plugin_feature_list_copy" gst_plugin_feature_list_copy :: 
    Ptr (GList (Ptr PluginFeature)) ->      -- list : TGList (TInterface (Name {namespace = "Gst", name = "PluginFeature"}))
    IO (Ptr (GList (Ptr PluginFeature)))

{- |
Copies the list of features. Caller should call /@gstPluginFeatureListFree@/
when done with the list.
-}
pluginFeatureListCopy ::
    (B.CallStack.HasCallStack, MonadIO m, IsPluginFeature a) =>
    [a]
    {- ^ /@list@/: list
    of 'GI.Gst.Objects.PluginFeature.PluginFeature' -}
    -> m [PluginFeature]
    {- ^ __Returns:__ a copy of /@list@/,
    with each feature\'s reference count incremented. -}
pluginFeatureListCopy list = liftIO $ do
    list' <- mapM unsafeManagedPtrCastPtr list
    list'' <- packGList list'
    result <- gst_plugin_feature_list_copy list''
    result' <- unpackGList result
    result'' <- mapM (wrapObject PluginFeature) result'
    g_list_free result
    mapM_ touchManagedPtr list
    g_list_free list''
    return result''

-- method PluginFeature::list_debug
-- method type : MemberFunction
-- Args : [Arg {argCName = "list", argType = TGList (TInterface (Name {namespace = "Gst", name = "PluginFeature"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "a #GList of\n    plugin features", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_plugin_feature_list_debug" gst_plugin_feature_list_debug :: 
    Ptr (GList (Ptr PluginFeature)) ->      -- list : TGList (TInterface (Name {namespace = "Gst", name = "PluginFeature"}))
    IO ()

{- |
Debug the plugin feature names in /@list@/.
-}
pluginFeatureListDebug ::
    (B.CallStack.HasCallStack, MonadIO m, IsPluginFeature a) =>
    [a]
    {- ^ /@list@/: a 'GI.GLib.Structs.List.List' of
    plugin features -}
    -> m ()
pluginFeatureListDebug list = liftIO $ do
    list' <- mapM unsafeManagedPtrCastPtr list
    list'' <- packGList list'
    gst_plugin_feature_list_debug list''
    mapM_ touchManagedPtr list
    g_list_free list''
    return ()

-- method PluginFeature::list_free
-- method type : MemberFunction
-- Args : [Arg {argCName = "list", argType = TGList (TInterface (Name {namespace = "Gst", name = "PluginFeature"})), direction = DirectionIn, mayBeNull = False, argDoc = Documentation {rawDocText = Just "list\n    of #GstPluginFeature", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferEverything}]
-- Lengths : []
-- returnType : Nothing
-- throws : False
-- Skip return : False

foreign import ccall "gst_plugin_feature_list_free" gst_plugin_feature_list_free :: 
    Ptr (GList (Ptr PluginFeature)) ->      -- list : TGList (TInterface (Name {namespace = "Gst", name = "PluginFeature"}))
    IO ()

{- |
Unrefs each member of /@list@/, then frees the list.
-}
pluginFeatureListFree ::
    (B.CallStack.HasCallStack, MonadIO m, IsPluginFeature a) =>
    [a]
    {- ^ /@list@/: list
    of 'GI.Gst.Objects.PluginFeature.PluginFeature' -}
    -> m ()
pluginFeatureListFree list = liftIO $ do
    list' <- mapM B.ManagedPtr.disownObject list
    list'' <- packGList list'
    gst_plugin_feature_list_free list''
    mapM_ touchManagedPtr list
    return ()

-- method PluginFeature::rank_compare_func
-- method type : MemberFunction
-- Args : [Arg {argCName = "p1", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GstPluginFeature", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing},Arg {argCName = "p2", argType = TBasicType TPtr, direction = DirectionIn, mayBeNull = True, argDoc = Documentation {rawDocText = Just "a #GstPluginFeature", sinceVersion = Nothing}, argScope = ScopeTypeInvalid, argClosure = -1, argDestroy = -1, argCallerAllocates = False, transfer = TransferNothing}]
-- Lengths : []
-- returnType : Just (TBasicType TInt)
-- throws : False
-- Skip return : False

foreign import ccall "gst_plugin_feature_rank_compare_func" gst_plugin_feature_rank_compare_func :: 
    Ptr () ->                               -- p1 : TBasicType TPtr
    Ptr () ->                               -- p2 : TBasicType TPtr
    IO Int32

{- |
Compares the two given 'GI.Gst.Objects.PluginFeature.PluginFeature' instances. This function can be
used as a 'GI.GLib.Callbacks.CompareFunc' when sorting by rank and then by name.
-}
pluginFeatureRankCompareFunc ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Ptr ()
    {- ^ /@p1@/: a 'GI.Gst.Objects.PluginFeature.PluginFeature' -}
    -> Ptr ()
    {- ^ /@p2@/: a 'GI.Gst.Objects.PluginFeature.PluginFeature' -}
    -> m Int32
    {- ^ __Returns:__ negative value if the rank of p1 > the rank of p2 or the ranks are
equal but the name of p1 comes before the name of p2; zero if the rank
and names are equal; positive value if the rank of p1 \< the rank of p2 or the
ranks are equal but the name of p2 comes before the name of p1 -}
pluginFeatureRankCompareFunc p1 p2 = liftIO $ do
    result <- gst_plugin_feature_rank_compare_func p1 p2
    return result