{-# LANGUAGE ImplicitParams, RankNTypes, TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- The WpObjectManager class provides a way to collect a set of objects and be notified when objects that fulfill a certain set of criteria are created or destroyed.
-- There are 4 kinds of objects that can be managed by a WpObjectManager:
-- * remote PipeWire global objects that are advertised on the registry; these are bound locally to subclasses of WpGlobalProxy
-- * remote PipeWire global objects that are created by calling a remote factory through the WirePlumber API; these are very similar to other global objects but it should be noted that the same WpGlobalProxy instance that created them appears in the WpObjectManager (as soon as its WP_PROXY_FEATURE_BOUND is enabled)
-- * local PipeWire objects that are being exported to PipeWire (WpImplMetadata, WpImplNode, etc); these appear in the WpObjectManager as soon as they are exported (so, when their WP_PROXY_FEATURE_BOUND is enabled)
-- * WirePlumber-specific objects, such as plugins, factories and session items
-- 
-- 
-- To start an object manager, you first need to declare interest in a certain kind of object by calling @/wp_object_manager_add_interest()/@ and then install it on the WpCore with 'GI.Wp.Objects.Core.coreInstallObjectManager'.
-- Upon installing a WpObjectManager on a WpCore, any pre-existing objects that match the interests of this WpObjectManager will immediately become available to get through 'GI.Wp.Objects.ObjectManager.objectManagerNewIterator' and the WpObjectManager object-added signal will be emitted for all of them. However, note that if these objects need to be prepared (to activate some features on them), the emission of object-added will be delayed. To know when it is safe to access the initial set of objects, wait until the installed signal has been emitted. That signal is emitted asynchronously after all the initial objects have been prepared.

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

module GI.Wp.Objects.ObjectManager
    ( 

-- * Exported types
    ObjectManager(..)                       ,
    IsObjectManager                         ,
    toObjectManager                         ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [addInterestFull]("GI.Wp.Objects.ObjectManager#g:method:addInterestFull"), [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [isInstalled]("GI.Wp.Objects.ObjectManager#g:method:isInstalled"), [lookupFull]("GI.Wp.Objects.ObjectManager#g:method:lookupFull"), [newFilteredIteratorFull]("GI.Wp.Objects.ObjectManager#g:method:newFilteredIteratorFull"), [newIterator]("GI.Wp.Objects.ObjectManager#g:method:newIterator"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [requestObjectFeatures]("GI.Wp.Objects.ObjectManager#g:method:requestObjectFeatures"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
-- 
-- ==== Getters
-- [getData]("GI.GObject.Objects.Object#g:method:getData"), [getNObjects]("GI.Wp.Objects.ObjectManager#g:method:getNObjects"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata").
-- 
-- ==== Setters
-- [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty").

#if defined(ENABLE_OVERLOADING)
    ResolveObjectManagerMethod              ,
#endif

-- ** addInterestFull #method:addInterestFull#

#if defined(ENABLE_OVERLOADING)
    ObjectManagerAddInterestFullMethodInfo  ,
#endif
    objectManagerAddInterestFull            ,


-- ** getNObjects #method:getNObjects#

#if defined(ENABLE_OVERLOADING)
    ObjectManagerGetNObjectsMethodInfo      ,
#endif
    objectManagerGetNObjects                ,


-- ** isInstalled #method:isInstalled#

#if defined(ENABLE_OVERLOADING)
    ObjectManagerIsInstalledMethodInfo      ,
#endif
    objectManagerIsInstalled                ,


-- ** lookupFull #method:lookupFull#

#if defined(ENABLE_OVERLOADING)
    ObjectManagerLookupFullMethodInfo       ,
#endif
    objectManagerLookupFull                 ,


-- ** new #method:new#

    objectManagerNew                        ,


-- ** newFilteredIteratorFull #method:newFilteredIteratorFull#

#if defined(ENABLE_OVERLOADING)
    ObjectManagerNewFilteredIteratorFullMethodInfo,
#endif
    objectManagerNewFilteredIteratorFull    ,


-- ** newIterator #method:newIterator#

#if defined(ENABLE_OVERLOADING)
    ObjectManagerNewIteratorMethodInfo      ,
#endif
    objectManagerNewIterator                ,


-- ** requestObjectFeatures #method:requestObjectFeatures#

#if defined(ENABLE_OVERLOADING)
    ObjectManagerRequestObjectFeaturesMethodInfo,
#endif
    objectManagerRequestObjectFeatures      ,




 -- * Properties


-- ** core #attr:core#
-- | /No description available in the introspection data./

#if defined(ENABLE_OVERLOADING)
    ObjectManagerCorePropertyInfo           ,
#endif
    getObjectManagerCore                    ,
#if defined(ENABLE_OVERLOADING)
    objectManagerCore                       ,
#endif




 -- * Signals


-- ** installed #signal:installed#

    ObjectManagerInstalledCallback          ,
#if defined(ENABLE_OVERLOADING)
    ObjectManagerInstalledSignalInfo        ,
#endif
    afterObjectManagerInstalled             ,
    onObjectManagerInstalled                ,


-- ** objectAdded #signal:objectAdded#

    ObjectManagerObjectAddedCallback        ,
#if defined(ENABLE_OVERLOADING)
    ObjectManagerObjectAddedSignalInfo      ,
#endif
    afterObjectManagerObjectAdded           ,
    onObjectManagerObjectAdded              ,


-- ** objectRemoved #signal:objectRemoved#

    ObjectManagerObjectRemovedCallback      ,
#if defined(ENABLE_OVERLOADING)
    ObjectManagerObjectRemovedSignalInfo    ,
#endif
    afterObjectManagerObjectRemoved         ,
    onObjectManagerObjectRemoved            ,


-- ** objectsChanged #signal:objectsChanged#

    ObjectManagerObjectsChangedCallback     ,
#if defined(ENABLE_OVERLOADING)
    ObjectManagerObjectsChangedSignalInfo   ,
#endif
    afterObjectManagerObjectsChanged        ,
    onObjectManagerObjectsChanged           ,




    ) where

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

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT

-- Workaround for https://gitlab.haskell.org/ghc/ghc/-/issues/23392
#if MIN_VERSION_base(4,18,0)
import qualified GI.GLib.Callbacks as GLib.Callbacks
import qualified GI.GLib.Structs.MainContext as GLib.MainContext
import qualified GI.GLib.Structs.Source as GLib.Source
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import qualified GI.Gio.Objects.Cancellable as Gio.Cancellable
import qualified GI.Wp.Callbacks as Wp.Callbacks
import {-# SOURCE #-} qualified GI.Wp.Enums as Wp.Enums
import {-# SOURCE #-} qualified GI.Wp.Flags as Wp.Flags
import {-# SOURCE #-} qualified GI.Wp.Objects.Conf as Wp.Conf
import {-# SOURCE #-} qualified GI.Wp.Objects.Core as Wp.Core
import {-# SOURCE #-} qualified GI.Wp.Objects.Object as Wp.Object
import {-# SOURCE #-} qualified GI.Wp.Structs.Iterator as Wp.Iterator
import {-# SOURCE #-} qualified GI.Wp.Structs.IteratorMethods as Wp.IteratorMethods
import {-# SOURCE #-} qualified GI.Wp.Structs.ObjectInterest as Wp.ObjectInterest
import {-# SOURCE #-} qualified GI.Wp.Structs.Properties as Wp.Properties
import {-# SOURCE #-} qualified GI.Wp.Structs.SpaJson as Wp.SpaJson

#else
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Wp.Objects.Core as Wp.Core
import {-# SOURCE #-} qualified GI.Wp.Structs.Iterator as Wp.Iterator
import {-# SOURCE #-} qualified GI.Wp.Structs.ObjectInterest as Wp.ObjectInterest

#endif

-- | Memory-managed wrapper type.
newtype ObjectManager = ObjectManager (SP.ManagedPtr ObjectManager)
    deriving (Eq)

instance SP.ManagedPtrNewtype ObjectManager where
    toManagedPtr (ObjectManager p) = p

foreign import ccall "wp_object_manager_get_type"
    c_wp_object_manager_get_type :: IO B.Types.GType

instance B.Types.TypedObject ObjectManager where
    glibType = c_wp_object_manager_get_type

instance B.Types.GObject ObjectManager

-- | Type class for types which can be safely cast to t'ObjectManager', for instance with `toObjectManager`.
class (SP.GObject o, O.IsDescendantOf ObjectManager o) => IsObjectManager o
instance (SP.GObject o, O.IsDescendantOf ObjectManager o) => IsObjectManager o

instance O.HasParentTypes ObjectManager
type instance O.ParentTypes ObjectManager = '[GObject.Object.Object]

-- | Cast to t'ObjectManager', for types for which this is known to be safe. For general casts, use 'Data.GI.Base.ManagedPtr.castTo'.
toObjectManager :: (MIO.MonadIO m, IsObjectManager o) => o -> m ObjectManager
toObjectManager = MIO.liftIO . B.ManagedPtr.unsafeCastTo ObjectManager

-- | Convert t'ObjectManager' to and from t'Data.GI.Base.GValue.GValue'. See 'Data.GI.Base.GValue.toGValue' and 'Data.GI.Base.GValue.fromGValue'.
instance B.GValue.IsGValue (Maybe ObjectManager) where
    gvalueGType_ = c_wp_object_manager_get_type
    gvalueSet_ gv P.Nothing = B.GValue.set_object gv (FP.nullPtr :: FP.Ptr ObjectManager)
    gvalueSet_ gv (P.Just obj) = B.ManagedPtr.withManagedPtr obj (B.GValue.set_object gv)
    gvalueGet_ gv = do
        ptr <- B.GValue.get_object gv :: IO (FP.Ptr ObjectManager)
        if ptr /= FP.nullPtr
        then P.Just <$> B.ManagedPtr.newObject ObjectManager ptr
        else return P.Nothing
        
    

#if defined(ENABLE_OVERLOADING)
type family ResolveObjectManagerMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolveObjectManagerMethod "addInterestFull" o = ObjectManagerAddInterestFullMethodInfo
    ResolveObjectManagerMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveObjectManagerMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveObjectManagerMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveObjectManagerMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveObjectManagerMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveObjectManagerMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveObjectManagerMethod "isInstalled" o = ObjectManagerIsInstalledMethodInfo
    ResolveObjectManagerMethod "lookupFull" o = ObjectManagerLookupFullMethodInfo
    ResolveObjectManagerMethod "newFilteredIteratorFull" o = ObjectManagerNewFilteredIteratorFullMethodInfo
    ResolveObjectManagerMethod "newIterator" o = ObjectManagerNewIteratorMethodInfo
    ResolveObjectManagerMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveObjectManagerMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveObjectManagerMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveObjectManagerMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveObjectManagerMethod "requestObjectFeatures" o = ObjectManagerRequestObjectFeaturesMethodInfo
    ResolveObjectManagerMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveObjectManagerMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveObjectManagerMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveObjectManagerMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveObjectManagerMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveObjectManagerMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveObjectManagerMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveObjectManagerMethod "getNObjects" o = ObjectManagerGetNObjectsMethodInfo
    ResolveObjectManagerMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveObjectManagerMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveObjectManagerMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveObjectManagerMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveObjectManagerMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveObjectManagerMethod l o = O.MethodResolutionFailed l o

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

#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveObjectManagerMethod t ObjectManager, O.OverloadedMethod info ObjectManager p, R.HasField t ObjectManager p) => R.HasField t ObjectManager p where
    getField = O.overloadedMethod @info

#endif

instance (info ~ ResolveObjectManagerMethod t ObjectManager, O.OverloadedMethodInfo info ObjectManager) => OL.IsLabel t (O.MethodProxy info ObjectManager) where
#if MIN_VERSION_base(4,10,0)
    fromLabel = O.MethodProxy
#else
    fromLabel _ = O.MethodProxy
#endif

#endif

-- signal ObjectManager::installed
-- | /No description available in the introspection data./
type ObjectManagerInstalledCallback =
    IO ()

type C_ObjectManagerInstalledCallback =
    Ptr ObjectManager ->                    -- object
    Ptr () ->                               -- user_data
    IO ()

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

wrap_ObjectManagerInstalledCallback :: 
    GObject a => (a -> ObjectManagerInstalledCallback) ->
    C_ObjectManagerInstalledCallback
wrap_ObjectManagerInstalledCallback gi'cb gi'selfPtr _ = do
    B.ManagedPtr.withNewObject gi'selfPtr $ \gi'self -> gi'cb (Coerce.coerce gi'self) 


-- | Connect a signal handler for the [installed](#signal:installed) 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' objectManager #installed callback
-- @
-- 
-- 
onObjectManagerInstalled :: (IsObjectManager a, MonadIO m) => a -> ((?self :: a) => ObjectManagerInstalledCallback) -> m SignalHandlerId
onObjectManagerInstalled obj cb = liftIO $ do
    let wrapped self = let ?self = self in cb
    let wrapped' = wrap_ObjectManagerInstalledCallback wrapped
    wrapped'' <- mk_ObjectManagerInstalledCallback wrapped'
    connectSignalFunPtr obj "installed" wrapped'' SignalConnectBefore Nothing

-- | Connect a signal handler for the [installed](#signal:installed) 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' objectManager #installed callback
-- @
-- 
-- 
-- 
-- By default the object invoking the signal is not passed to the callback.
-- If you need to access it, you can use the implit @?self@ parameter.
-- Note that this requires activating the @ImplicitParams@ GHC extension.
-- 
afterObjectManagerInstalled :: (IsObjectManager a, MonadIO m) => a -> ((?self :: a) => ObjectManagerInstalledCallback) -> m SignalHandlerId
afterObjectManagerInstalled obj cb = liftIO $ do
    let wrapped self = let ?self = self in cb
    let wrapped' = wrap_ObjectManagerInstalledCallback wrapped
    wrapped'' <- mk_ObjectManagerInstalledCallback wrapped'
    connectSignalFunPtr obj "installed" wrapped'' SignalConnectAfter Nothing


#if defined(ENABLE_OVERLOADING)
data ObjectManagerInstalledSignalInfo
instance SignalInfo ObjectManagerInstalledSignalInfo where
    type HaskellCallbackType ObjectManagerInstalledSignalInfo = ObjectManagerInstalledCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_ObjectManagerInstalledCallback cb
        cb'' <- mk_ObjectManagerInstalledCallback cb'
        connectSignalFunPtr obj "installed" cb'' connectMode detail
    dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Objects.ObjectManager::installed"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Objects-ObjectManager.html#g:signal:installed"})

#endif

-- signal ObjectManager::object-added
-- | /No description available in the introspection data./
type ObjectManagerObjectAddedCallback =
    GObject.Object.Object
    -> IO ()

type C_ObjectManagerObjectAddedCallback =
    Ptr ObjectManager ->                    -- object
    Ptr GObject.Object.Object ->
    Ptr () ->                               -- user_data
    IO ()

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

wrap_ObjectManagerObjectAddedCallback :: 
    GObject a => (a -> ObjectManagerObjectAddedCallback) ->
    C_ObjectManagerObjectAddedCallback
wrap_ObjectManagerObjectAddedCallback gi'cb gi'selfPtr object _ = do
    object' <- (newObject GObject.Object.Object) object
    B.ManagedPtr.withNewObject gi'selfPtr $ \gi'self -> gi'cb (Coerce.coerce gi'self)  object'


-- | Connect a signal handler for the [objectAdded](#signal:objectAdded) 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' objectManager #objectAdded callback
-- @
-- 
-- 
onObjectManagerObjectAdded :: (IsObjectManager a, MonadIO m) => a -> ((?self :: a) => ObjectManagerObjectAddedCallback) -> m SignalHandlerId
onObjectManagerObjectAdded obj cb = liftIO $ do
    let wrapped self = let ?self = self in cb
    let wrapped' = wrap_ObjectManagerObjectAddedCallback wrapped
    wrapped'' <- mk_ObjectManagerObjectAddedCallback wrapped'
    connectSignalFunPtr obj "object-added" wrapped'' SignalConnectBefore Nothing

-- | Connect a signal handler for the [objectAdded](#signal:objectAdded) 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' objectManager #objectAdded callback
-- @
-- 
-- 
-- 
-- By default the object invoking the signal is not passed to the callback.
-- If you need to access it, you can use the implit @?self@ parameter.
-- Note that this requires activating the @ImplicitParams@ GHC extension.
-- 
afterObjectManagerObjectAdded :: (IsObjectManager a, MonadIO m) => a -> ((?self :: a) => ObjectManagerObjectAddedCallback) -> m SignalHandlerId
afterObjectManagerObjectAdded obj cb = liftIO $ do
    let wrapped self = let ?self = self in cb
    let wrapped' = wrap_ObjectManagerObjectAddedCallback wrapped
    wrapped'' <- mk_ObjectManagerObjectAddedCallback wrapped'
    connectSignalFunPtr obj "object-added" wrapped'' SignalConnectAfter Nothing


#if defined(ENABLE_OVERLOADING)
data ObjectManagerObjectAddedSignalInfo
instance SignalInfo ObjectManagerObjectAddedSignalInfo where
    type HaskellCallbackType ObjectManagerObjectAddedSignalInfo = ObjectManagerObjectAddedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_ObjectManagerObjectAddedCallback cb
        cb'' <- mk_ObjectManagerObjectAddedCallback cb'
        connectSignalFunPtr obj "object-added" cb'' connectMode detail
    dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Objects.ObjectManager::object-added"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Objects-ObjectManager.html#g:signal:objectAdded"})

#endif

-- signal ObjectManager::object-removed
-- | /No description available in the introspection data./
type ObjectManagerObjectRemovedCallback =
    GObject.Object.Object
    -> IO ()

type C_ObjectManagerObjectRemovedCallback =
    Ptr ObjectManager ->                    -- object
    Ptr GObject.Object.Object ->
    Ptr () ->                               -- user_data
    IO ()

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

wrap_ObjectManagerObjectRemovedCallback :: 
    GObject a => (a -> ObjectManagerObjectRemovedCallback) ->
    C_ObjectManagerObjectRemovedCallback
wrap_ObjectManagerObjectRemovedCallback gi'cb gi'selfPtr object _ = do
    object' <- (newObject GObject.Object.Object) object
    B.ManagedPtr.withNewObject gi'selfPtr $ \gi'self -> gi'cb (Coerce.coerce gi'self)  object'


-- | Connect a signal handler for the [objectRemoved](#signal:objectRemoved) 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' objectManager #objectRemoved callback
-- @
-- 
-- 
onObjectManagerObjectRemoved :: (IsObjectManager a, MonadIO m) => a -> ((?self :: a) => ObjectManagerObjectRemovedCallback) -> m SignalHandlerId
onObjectManagerObjectRemoved obj cb = liftIO $ do
    let wrapped self = let ?self = self in cb
    let wrapped' = wrap_ObjectManagerObjectRemovedCallback wrapped
    wrapped'' <- mk_ObjectManagerObjectRemovedCallback wrapped'
    connectSignalFunPtr obj "object-removed" wrapped'' SignalConnectBefore Nothing

-- | Connect a signal handler for the [objectRemoved](#signal:objectRemoved) 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' objectManager #objectRemoved callback
-- @
-- 
-- 
-- 
-- By default the object invoking the signal is not passed to the callback.
-- If you need to access it, you can use the implit @?self@ parameter.
-- Note that this requires activating the @ImplicitParams@ GHC extension.
-- 
afterObjectManagerObjectRemoved :: (IsObjectManager a, MonadIO m) => a -> ((?self :: a) => ObjectManagerObjectRemovedCallback) -> m SignalHandlerId
afterObjectManagerObjectRemoved obj cb = liftIO $ do
    let wrapped self = let ?self = self in cb
    let wrapped' = wrap_ObjectManagerObjectRemovedCallback wrapped
    wrapped'' <- mk_ObjectManagerObjectRemovedCallback wrapped'
    connectSignalFunPtr obj "object-removed" wrapped'' SignalConnectAfter Nothing


#if defined(ENABLE_OVERLOADING)
data ObjectManagerObjectRemovedSignalInfo
instance SignalInfo ObjectManagerObjectRemovedSignalInfo where
    type HaskellCallbackType ObjectManagerObjectRemovedSignalInfo = ObjectManagerObjectRemovedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_ObjectManagerObjectRemovedCallback cb
        cb'' <- mk_ObjectManagerObjectRemovedCallback cb'
        connectSignalFunPtr obj "object-removed" cb'' connectMode detail
    dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Objects.ObjectManager::object-removed"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Objects-ObjectManager.html#g:signal:objectRemoved"})

#endif

-- signal ObjectManager::objects-changed
-- | /No description available in the introspection data./
type ObjectManagerObjectsChangedCallback =
    IO ()

type C_ObjectManagerObjectsChangedCallback =
    Ptr ObjectManager ->                    -- object
    Ptr () ->                               -- user_data
    IO ()

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

wrap_ObjectManagerObjectsChangedCallback :: 
    GObject a => (a -> ObjectManagerObjectsChangedCallback) ->
    C_ObjectManagerObjectsChangedCallback
wrap_ObjectManagerObjectsChangedCallback gi'cb gi'selfPtr _ = do
    B.ManagedPtr.withNewObject gi'selfPtr $ \gi'self -> gi'cb (Coerce.coerce gi'self) 


-- | Connect a signal handler for the [objectsChanged](#signal:objectsChanged) 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' objectManager #objectsChanged callback
-- @
-- 
-- 
onObjectManagerObjectsChanged :: (IsObjectManager a, MonadIO m) => a -> ((?self :: a) => ObjectManagerObjectsChangedCallback) -> m SignalHandlerId
onObjectManagerObjectsChanged obj cb = liftIO $ do
    let wrapped self = let ?self = self in cb
    let wrapped' = wrap_ObjectManagerObjectsChangedCallback wrapped
    wrapped'' <- mk_ObjectManagerObjectsChangedCallback wrapped'
    connectSignalFunPtr obj "objects-changed" wrapped'' SignalConnectBefore Nothing

-- | Connect a signal handler for the [objectsChanged](#signal:objectsChanged) 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' objectManager #objectsChanged callback
-- @
-- 
-- 
-- 
-- By default the object invoking the signal is not passed to the callback.
-- If you need to access it, you can use the implit @?self@ parameter.
-- Note that this requires activating the @ImplicitParams@ GHC extension.
-- 
afterObjectManagerObjectsChanged :: (IsObjectManager a, MonadIO m) => a -> ((?self :: a) => ObjectManagerObjectsChangedCallback) -> m SignalHandlerId
afterObjectManagerObjectsChanged obj cb = liftIO $ do
    let wrapped self = let ?self = self in cb
    let wrapped' = wrap_ObjectManagerObjectsChangedCallback wrapped
    wrapped'' <- mk_ObjectManagerObjectsChangedCallback wrapped'
    connectSignalFunPtr obj "objects-changed" wrapped'' SignalConnectAfter Nothing


#if defined(ENABLE_OVERLOADING)
data ObjectManagerObjectsChangedSignalInfo
instance SignalInfo ObjectManagerObjectsChangedSignalInfo where
    type HaskellCallbackType ObjectManagerObjectsChangedSignalInfo = ObjectManagerObjectsChangedCallback
    connectSignal obj cb connectMode detail = do
        let cb' = wrap_ObjectManagerObjectsChangedCallback cb
        cb'' <- mk_ObjectManagerObjectsChangedCallback cb'
        connectSignalFunPtr obj "objects-changed" cb'' connectMode detail
    dbgSignalInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Objects.ObjectManager::objects-changed"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Objects-ObjectManager.html#g:signal:objectsChanged"})

#endif

-- VVV Prop "core"
   -- Type: TInterface (Name {namespace = "Wp", name = "Core"})
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@core@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' objectManager #core
-- @
getObjectManagerCore :: (MonadIO m, IsObjectManager o) => o -> m (Maybe Wp.Core.Core)
getObjectManagerCore obj = MIO.liftIO $ B.Properties.getObjectPropertyObject obj "core" Wp.Core.Core

#if defined(ENABLE_OVERLOADING)
data ObjectManagerCorePropertyInfo
instance AttrInfo ObjectManagerCorePropertyInfo where
    type AttrAllowedOps ObjectManagerCorePropertyInfo = '[ 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint ObjectManagerCorePropertyInfo = IsObjectManager
    type AttrSetTypeConstraint ObjectManagerCorePropertyInfo = (~) ()
    type AttrTransferTypeConstraint ObjectManagerCorePropertyInfo = (~) ()
    type AttrTransferType ObjectManagerCorePropertyInfo = ()
    type AttrGetType ObjectManagerCorePropertyInfo = (Maybe Wp.Core.Core)
    type AttrLabel ObjectManagerCorePropertyInfo = "core"
    type AttrOrigin ObjectManagerCorePropertyInfo = ObjectManager
    attrGet = getObjectManagerCore
    attrSet = undefined
    attrPut = undefined
    attrTransfer _ = undefined
    attrConstruct = undefined
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Objects.ObjectManager.core"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Objects-ObjectManager.html#g:attr:core"
        })
#endif

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList ObjectManager
type instance O.AttributeList ObjectManager = ObjectManagerAttributeList
type ObjectManagerAttributeList = ('[ '("core", ObjectManagerCorePropertyInfo)] :: [(Symbol, DK.Type)])
#endif

#if defined(ENABLE_OVERLOADING)
objectManagerCore :: AttrLabelProxy "core"
objectManagerCore = AttrLabelProxy

#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList ObjectManager = ObjectManagerSignalList
type ObjectManagerSignalList = ('[ '("installed", ObjectManagerInstalledSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("objectAdded", ObjectManagerObjectAddedSignalInfo), '("objectRemoved", ObjectManagerObjectRemovedSignalInfo), '("objectsChanged", ObjectManagerObjectsChangedSignalInfo)] :: [(Symbol, DK.Type)])

#endif

-- method ObjectManager::new
-- method type : Constructor
-- Args: []
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "Wp" , name = "ObjectManager" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_object_manager_new" wp_object_manager_new :: 
    IO (Ptr ObjectManager)

-- | Constructs a new object manager.
objectManagerNew ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m ObjectManager
    -- ^ __Returns:__ the newly constructed object manager
objectManagerNew  = liftIO $ do
    result <- wp_object_manager_new
    checkUnexpectedReturnNULL "objectManagerNew" result
    result' <- (wrapObject ObjectManager) result
    return result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method ObjectManager::add_interest_full
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "ObjectManager" }
--           , argCType = Just "WpObjectManager*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the object manager" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "interest"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "ObjectInterest" }
--           , argCType = Just "WpObjectInterest*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the interest" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "wp_object_manager_add_interest_full" wp_object_manager_add_interest_full :: 
    Ptr ObjectManager ->                    -- self : TInterface (Name {namespace = "Wp", name = "ObjectManager"})
    Ptr Wp.ObjectInterest.ObjectInterest -> -- interest : TInterface (Name {namespace = "Wp", name = "ObjectInterest"})
    IO ()

-- | Declares interest in a certain kind of object.
-- 
-- 
-- Interest consists of a GType that the object must be an ancestor of ('GI.GObject.Functions.typeIsA' must match) and optionally, a set of additional constraints on certain properties of the object. Refer to WpObjectInterest for more details.
objectManagerAddInterestFull ::
    (B.CallStack.HasCallStack, MonadIO m, IsObjectManager a) =>
    a
    -- ^ /@self@/: the object manager
    -> Wp.ObjectInterest.ObjectInterest
    -- ^ /@interest@/: the interest
    -> m ()
objectManagerAddInterestFull self interest = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    interest' <- B.ManagedPtr.disownBoxed interest
    wp_object_manager_add_interest_full self' interest'
    touchManagedPtr self
    touchManagedPtr interest
    return ()

#if defined(ENABLE_OVERLOADING)
data ObjectManagerAddInterestFullMethodInfo
instance (signature ~ (Wp.ObjectInterest.ObjectInterest -> m ()), MonadIO m, IsObjectManager a) => O.OverloadedMethod ObjectManagerAddInterestFullMethodInfo a signature where
    overloadedMethod = objectManagerAddInterestFull

instance O.OverloadedMethodInfo ObjectManagerAddInterestFullMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Objects.ObjectManager.objectManagerAddInterestFull",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Objects-ObjectManager.html#v:objectManagerAddInterestFull"
        })


#endif

-- method ObjectManager::get_n_objects
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "ObjectManager" }
--           , argCType = Just "WpObjectManager*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the object manager" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "wp_object_manager_get_n_objects" wp_object_manager_get_n_objects :: 
    Ptr ObjectManager ->                    -- self : TInterface (Name {namespace = "Wp", name = "ObjectManager"})
    IO Word32

-- | Gets the number of objects managed by the object manager.
objectManagerGetNObjects ::
    (B.CallStack.HasCallStack, MonadIO m, IsObjectManager a) =>
    a
    -- ^ /@self@/: the object manager
    -> m Word32
    -- ^ __Returns:__ the number of objects managed by this WpObjectManager
objectManagerGetNObjects self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_object_manager_get_n_objects self'
    touchManagedPtr self
    return result

#if defined(ENABLE_OVERLOADING)
data ObjectManagerGetNObjectsMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsObjectManager a) => O.OverloadedMethod ObjectManagerGetNObjectsMethodInfo a signature where
    overloadedMethod = objectManagerGetNObjects

instance O.OverloadedMethodInfo ObjectManagerGetNObjectsMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Objects.ObjectManager.objectManagerGetNObjects",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Objects-ObjectManager.html#v:objectManagerGetNObjects"
        })


#endif

-- method ObjectManager::is_installed
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "ObjectManager" }
--           , argCType = Just "WpObjectManager*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the object manager" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "wp_object_manager_is_installed" wp_object_manager_is_installed :: 
    Ptr ObjectManager ->                    -- self : TInterface (Name {namespace = "Wp", name = "ObjectManager"})
    IO CInt

-- | Checks if an object manager is installed.
objectManagerIsInstalled ::
    (B.CallStack.HasCallStack, MonadIO m, IsObjectManager a) =>
    a
    -- ^ /@self@/: the object manager
    -> m Bool
    -- ^ __Returns:__ TRUE if the object manager is installed (i.e. the WpObjectManager installed signal has been emitted), FALSE otherwise
objectManagerIsInstalled self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_object_manager_is_installed self'
    let result' = (/= 0) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data ObjectManagerIsInstalledMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsObjectManager a) => O.OverloadedMethod ObjectManagerIsInstalledMethodInfo a signature where
    overloadedMethod = objectManagerIsInstalled

instance O.OverloadedMethodInfo ObjectManagerIsInstalledMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Objects.ObjectManager.objectManagerIsInstalled",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Objects-ObjectManager.html#v:objectManagerIsInstalled"
        })


#endif

-- method ObjectManager::lookup_full
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "ObjectManager" }
--           , argCType = Just "WpObjectManager*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the object manager" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "interest"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "ObjectInterest" }
--           , argCType = Just "WpObjectInterest*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the interest" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GObject" , name = "Object" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_object_manager_lookup_full" wp_object_manager_lookup_full :: 
    Ptr ObjectManager ->                    -- self : TInterface (Name {namespace = "Wp", name = "ObjectManager"})
    Ptr Wp.ObjectInterest.ObjectInterest -> -- interest : TInterface (Name {namespace = "Wp", name = "ObjectInterest"})
    IO (Ptr GObject.Object.Object)

-- | Searches for an object that matches the specified /@interest@/ and returns it, if found.
-- 
-- 
-- If more than one objects match, only the first one is returned. To find multiple objects that match certain criteria, @/wp_object_manager_new_filtered_iterator()/@ is more suitable.
objectManagerLookupFull ::
    (B.CallStack.HasCallStack, MonadIO m, IsObjectManager a) =>
    a
    -- ^ /@self@/: the object manager
    -> Wp.ObjectInterest.ObjectInterest
    -- ^ /@interest@/: the interest
    -> m (Maybe GObject.Object.Object)
    -- ^ __Returns:__ the first managed object that matches the lookup interest, or NULL if no object matches
objectManagerLookupFull self interest = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    interest' <- B.ManagedPtr.disownBoxed interest
    result <- wp_object_manager_lookup_full self' interest'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (wrapObject GObject.Object.Object) result'
        return result''
    touchManagedPtr self
    touchManagedPtr interest
    return maybeResult

#if defined(ENABLE_OVERLOADING)
data ObjectManagerLookupFullMethodInfo
instance (signature ~ (Wp.ObjectInterest.ObjectInterest -> m (Maybe GObject.Object.Object)), MonadIO m, IsObjectManager a) => O.OverloadedMethod ObjectManagerLookupFullMethodInfo a signature where
    overloadedMethod = objectManagerLookupFull

instance O.OverloadedMethodInfo ObjectManagerLookupFullMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Objects.ObjectManager.objectManagerLookupFull",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Objects-ObjectManager.html#v:objectManagerLookupFull"
        })


#endif

-- method ObjectManager::new_filtered_iterator_full
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "ObjectManager" }
--           , argCType = Just "WpObjectManager*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the object manager" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "interest"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "ObjectInterest" }
--           , argCType = Just "WpObjectInterest*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the interest" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Wp" , name = "Iterator" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_object_manager_new_filtered_iterator_full" wp_object_manager_new_filtered_iterator_full :: 
    Ptr ObjectManager ->                    -- self : TInterface (Name {namespace = "Wp", name = "ObjectManager"})
    Ptr Wp.ObjectInterest.ObjectInterest -> -- interest : TInterface (Name {namespace = "Wp", name = "ObjectInterest"})
    IO (Ptr Wp.Iterator.Iterator)

-- | Iterates through all the objects managed by this object manager that match the specified /@interest@/.
objectManagerNewFilteredIteratorFull ::
    (B.CallStack.HasCallStack, MonadIO m, IsObjectManager a) =>
    a
    -- ^ /@self@/: the object manager
    -> Wp.ObjectInterest.ObjectInterest
    -- ^ /@interest@/: the interest
    -> m Wp.Iterator.Iterator
    -- ^ __Returns:__ a WpIterator that iterates over all the matching objects of this object manager
objectManagerNewFilteredIteratorFull self interest = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    interest' <- B.ManagedPtr.disownBoxed interest
    result <- wp_object_manager_new_filtered_iterator_full self' interest'
    checkUnexpectedReturnNULL "objectManagerNewFilteredIteratorFull" result
    result' <- (wrapBoxed Wp.Iterator.Iterator) result
    touchManagedPtr self
    touchManagedPtr interest
    return result'

#if defined(ENABLE_OVERLOADING)
data ObjectManagerNewFilteredIteratorFullMethodInfo
instance (signature ~ (Wp.ObjectInterest.ObjectInterest -> m Wp.Iterator.Iterator), MonadIO m, IsObjectManager a) => O.OverloadedMethod ObjectManagerNewFilteredIteratorFullMethodInfo a signature where
    overloadedMethod = objectManagerNewFilteredIteratorFull

instance O.OverloadedMethodInfo ObjectManagerNewFilteredIteratorFullMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Objects.ObjectManager.objectManagerNewFilteredIteratorFull",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Objects-ObjectManager.html#v:objectManagerNewFilteredIteratorFull"
        })


#endif

-- method ObjectManager::new_iterator
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "ObjectManager" }
--           , argCType = Just "WpObjectManager*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the object manager" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Wp" , name = "Iterator" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_object_manager_new_iterator" wp_object_manager_new_iterator :: 
    Ptr ObjectManager ->                    -- self : TInterface (Name {namespace = "Wp", name = "ObjectManager"})
    IO (Ptr Wp.Iterator.Iterator)

-- | Iterates through all the objects managed by this object manager.
objectManagerNewIterator ::
    (B.CallStack.HasCallStack, MonadIO m, IsObjectManager a) =>
    a
    -- ^ /@self@/: the object manager
    -> m Wp.Iterator.Iterator
    -- ^ __Returns:__ a WpIterator that iterates over all the managed objects of this object manager
objectManagerNewIterator self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_object_manager_new_iterator self'
    checkUnexpectedReturnNULL "objectManagerNewIterator" result
    result' <- (wrapBoxed Wp.Iterator.Iterator) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data ObjectManagerNewIteratorMethodInfo
instance (signature ~ (m Wp.Iterator.Iterator), MonadIO m, IsObjectManager a) => O.OverloadedMethod ObjectManagerNewIteratorMethodInfo a signature where
    overloadedMethod = objectManagerNewIterator

instance O.OverloadedMethodInfo ObjectManagerNewIteratorMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Objects.ObjectManager.objectManagerNewIterator",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Objects-ObjectManager.html#v:objectManagerNewIterator"
        })


#endif

-- method ObjectManager::request_object_features
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "ObjectManager" }
--           , argCType = Just "WpObjectManager*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the object manager" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "object_type"
--           , argType = TBasicType TGType
--           , argCType = Just "GType"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the WpProxy descendant type"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "wanted_features"
--           , argType = TBasicType TUInt
--           , argCType = Just "WpObjectFeatures"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the features to enable on this kind of object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "wp_object_manager_request_object_features" wp_object_manager_request_object_features :: 
    Ptr ObjectManager ->                    -- self : TInterface (Name {namespace = "Wp", name = "ObjectManager"})
    CGType ->                               -- object_type : TBasicType TGType
    Word32 ->                               -- wanted_features : TBasicType TUInt
    IO ()

-- | Requests the object manager to automatically prepare the /@wantedFeatures@/ on any managed object that is of the specified /@objectType@/.
-- 
-- 
-- These features will always be prepared before the object appears on the object manager.
objectManagerRequestObjectFeatures ::
    (B.CallStack.HasCallStack, MonadIO m, IsObjectManager a) =>
    a
    -- ^ /@self@/: the object manager
    -> GType
    -- ^ /@objectType@/: the WpProxy descendant type
    -> Word32
    -- ^ /@wantedFeatures@/: the features to enable on this kind of object
    -> m ()
objectManagerRequestObjectFeatures self objectType wantedFeatures = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    let objectType' = gtypeToCGType objectType
    wp_object_manager_request_object_features self' objectType' wantedFeatures
    touchManagedPtr self
    return ()

#if defined(ENABLE_OVERLOADING)
data ObjectManagerRequestObjectFeaturesMethodInfo
instance (signature ~ (GType -> Word32 -> m ()), MonadIO m, IsObjectManager a) => O.OverloadedMethod ObjectManagerRequestObjectFeaturesMethodInfo a signature where
    overloadedMethod = objectManagerRequestObjectFeatures

instance O.OverloadedMethodInfo ObjectManagerRequestObjectFeaturesMethodInfo a where
    overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Objects.ObjectManager.objectManagerRequestObjectFeatures",
        O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Objects-ObjectManager.html#v:objectManagerRequestObjectFeatures"
        })


#endif


