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


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- The core is the central object around which everything operates. It is essential to create a WpCore before using any other WirePlumber API.
-- The core object has the following responsibilities:
-- * it initializes the PipeWire library
-- * it creates a pw_context and allows connecting to the PipeWire server, creating a local pw_core
-- * it glues the PipeWire library\'s event loop system with GMainLoop
-- * it maintains a list of registered objects, which other classes use to keep objects loaded permanently into memory
-- * it watches the PipeWire registry and keeps track of remote and local objects that appear in the registry, making them accessible through the WpObjectManager API.
-- 
-- 
-- The core is also responsible for loading components, which are defined in the main configuration file. Components are loaded when WP_CORE_FEATURE_COMPONENTS is activated.
-- The main configuration file needs to be created and opened before the core is created, using the WpConf API. It is then passed to the core as an argument in the constructor.
-- If a configuration file is not provided, the core will let the underlying pw_context load its own configuration, based on the rules that apply to all pipewire clients (e.g. it respects the PIPEWIRE_CONFIG_NAME environment variable and loads \"client.conf\" as a last resort).
-- If a configuration file is provided, the core does not let the underlying pw_context load any configuration and instead uses the provided WpConf object.

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

module GI.Wp.Objects.Core
    ( 

-- * Exported types
    Core(..)                                ,
    IsCore                                  ,
    toCore                                  ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [abortActivation]("GI.Wp.Objects.Object#g:method:abortActivation"), [activate]("GI.Wp.Objects.Object#g:method:activate"), [activateClosure]("GI.Wp.Objects.Object#g:method:activateClosure"), [activateFinish]("GI.Wp.Objects.Object#g:method:activateFinish"), [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [clone]("GI.Wp.Objects.Core#g:method:clone"), [connect]("GI.Wp.Objects.Core#g:method:connect"), [connectFd]("GI.Wp.Objects.Core#g:method:connectFd"), [deactivate]("GI.Wp.Objects.Object#g:method:deactivate"), [disconnect]("GI.Wp.Objects.Core#g:method:disconnect"), [findObject]("GI.Wp.Objects.Core#g:method:findObject"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [idleAdd]("GI.Wp.Objects.Core#g:method:idleAdd"), [idleAddClosure]("GI.Wp.Objects.Core#g:method:idleAddClosure"), [installObjectManager]("GI.Wp.Objects.Core#g:method:installObjectManager"), [isConnected]("GI.Wp.Objects.Core#g:method:isConnected"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [loadComponent]("GI.Wp.Objects.Core#g:method:loadComponent"), [loadComponentFinish]("GI.Wp.Objects.Core#g:method:loadComponentFinish"), [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"), [registerObject]("GI.Wp.Objects.Core#g:method:registerObject"), [removeObject]("GI.Wp.Objects.Core#g:method:removeObject"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [sync]("GI.Wp.Objects.Core#g:method:sync"), [syncClosure]("GI.Wp.Objects.Core#g:method:syncClosure"), [syncFinish]("GI.Wp.Objects.Core#g:method:syncFinish"), [testActiveFeatures]("GI.Wp.Objects.Object#g:method:testActiveFeatures"), [testFeature]("GI.Wp.Objects.Core#g:method:testFeature"), [testSupportedFeatures]("GI.Wp.Objects.Object#g:method:testSupportedFeatures"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [timeoutAdd]("GI.Wp.Objects.Core#g:method:timeoutAdd"), [timeoutAddClosure]("GI.Wp.Objects.Core#g:method:timeoutAddClosure"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [updateFeatures]("GI.Wp.Objects.Object#g:method:updateFeatures"), [updateProperties]("GI.Wp.Objects.Core#g:method:updateProperties"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
-- 
-- ==== Getters
-- [getActiveFeatures]("GI.Wp.Objects.Object#g:method:getActiveFeatures"), [getConf]("GI.Wp.Objects.Core#g:method:getConf"), [getCore]("GI.Wp.Objects.Object#g:method:getCore"), [getData]("GI.GObject.Objects.Object#g:method:getData"), [getExportCore]("GI.Wp.Objects.Core#g:method:getExportCore"), [getGMainContext]("GI.Wp.Objects.Core#g:method:getGMainContext"), [getId]("GI.Wp.Objects.Object#g:method:getId"), [getOwnBoundId]("GI.Wp.Objects.Core#g:method:getOwnBoundId"), [getProperties]("GI.Wp.Objects.Core#g:method:getProperties"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getPwContext]("GI.Wp.Objects.Core#g:method:getPwContext"), [getPwCore]("GI.Wp.Objects.Core#g:method:getPwCore"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata"), [getRemoteCookie]("GI.Wp.Objects.Core#g:method:getRemoteCookie"), [getRemoteHostName]("GI.Wp.Objects.Core#g:method:getRemoteHostName"), [getRemoteName]("GI.Wp.Objects.Core#g:method:getRemoteName"), [getRemoteProperties]("GI.Wp.Objects.Core#g:method:getRemoteProperties"), [getRemoteUserName]("GI.Wp.Objects.Core#g:method:getRemoteUserName"), [getRemoteVersion]("GI.Wp.Objects.Core#g:method:getRemoteVersion"), [getSupportedFeatures]("GI.Wp.Objects.Object#g:method:getSupportedFeatures"), [getVmType]("GI.Wp.Objects.Core#g:method:getVmType").
-- 
-- ==== 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)
    ResolveCoreMethod                       ,
#endif

-- ** clone #method:clone#

#if defined(ENABLE_OVERLOADING)
    CoreCloneMethodInfo                     ,
#endif
    coreClone                               ,


-- ** connect #method:connect#

#if defined(ENABLE_OVERLOADING)
    CoreConnectMethodInfo                   ,
#endif
    coreConnect                             ,


-- ** connectFd #method:connectFd#

#if defined(ENABLE_OVERLOADING)
    CoreConnectFdMethodInfo                 ,
#endif
    coreConnectFd                           ,


-- ** disconnect #method:disconnect#

#if defined(ENABLE_OVERLOADING)
    CoreDisconnectMethodInfo                ,
#endif
    coreDisconnect                          ,


-- ** findObject #method:findObject#

#if defined(ENABLE_OVERLOADING)
    CoreFindObjectMethodInfo                ,
#endif
    coreFindObject                          ,


-- ** getConf #method:getConf#

#if defined(ENABLE_OVERLOADING)
    CoreGetConfMethodInfo                   ,
#endif
    coreGetConf                             ,


-- ** getExportCore #method:getExportCore#

#if defined(ENABLE_OVERLOADING)
    CoreGetExportCoreMethodInfo             ,
#endif
    coreGetExportCore                       ,


-- ** getGMainContext #method:getGMainContext#

#if defined(ENABLE_OVERLOADING)
    CoreGetGMainContextMethodInfo           ,
#endif
    coreGetGMainContext                     ,


-- ** getOwnBoundId #method:getOwnBoundId#

#if defined(ENABLE_OVERLOADING)
    CoreGetOwnBoundIdMethodInfo             ,
#endif
    coreGetOwnBoundId                       ,


-- ** getProperties #method:getProperties#

#if defined(ENABLE_OVERLOADING)
    CoreGetPropertiesMethodInfo             ,
#endif
    coreGetProperties                       ,


-- ** getPwContext #method:getPwContext#

#if defined(ENABLE_OVERLOADING)
    CoreGetPwContextMethodInfo              ,
#endif
    coreGetPwContext                        ,


-- ** getPwCore #method:getPwCore#

#if defined(ENABLE_OVERLOADING)
    CoreGetPwCoreMethodInfo                 ,
#endif
    coreGetPwCore                           ,


-- ** getRemoteCookie #method:getRemoteCookie#

#if defined(ENABLE_OVERLOADING)
    CoreGetRemoteCookieMethodInfo           ,
#endif
    coreGetRemoteCookie                     ,


-- ** getRemoteHostName #method:getRemoteHostName#

#if defined(ENABLE_OVERLOADING)
    CoreGetRemoteHostNameMethodInfo         ,
#endif
    coreGetRemoteHostName                   ,


-- ** getRemoteName #method:getRemoteName#

#if defined(ENABLE_OVERLOADING)
    CoreGetRemoteNameMethodInfo             ,
#endif
    coreGetRemoteName                       ,


-- ** getRemoteProperties #method:getRemoteProperties#

#if defined(ENABLE_OVERLOADING)
    CoreGetRemotePropertiesMethodInfo       ,
#endif
    coreGetRemoteProperties                 ,


-- ** getRemoteUserName #method:getRemoteUserName#

#if defined(ENABLE_OVERLOADING)
    CoreGetRemoteUserNameMethodInfo         ,
#endif
    coreGetRemoteUserName                   ,


-- ** getRemoteVersion #method:getRemoteVersion#

#if defined(ENABLE_OVERLOADING)
    CoreGetRemoteVersionMethodInfo          ,
#endif
    coreGetRemoteVersion                    ,


-- ** getVmType #method:getVmType#

#if defined(ENABLE_OVERLOADING)
    CoreGetVmTypeMethodInfo                 ,
#endif
    coreGetVmType                           ,


-- ** idleAdd #method:idleAdd#

#if defined(ENABLE_OVERLOADING)
    CoreIdleAddMethodInfo                   ,
#endif
    coreIdleAdd                             ,


-- ** idleAddClosure #method:idleAddClosure#

#if defined(ENABLE_OVERLOADING)
    CoreIdleAddClosureMethodInfo            ,
#endif
    coreIdleAddClosure                      ,


-- ** installObjectManager #method:installObjectManager#

#if defined(ENABLE_OVERLOADING)
    CoreInstallObjectManagerMethodInfo      ,
#endif
    coreInstallObjectManager                ,


-- ** isConnected #method:isConnected#

#if defined(ENABLE_OVERLOADING)
    CoreIsConnectedMethodInfo               ,
#endif
    coreIsConnected                         ,


-- ** loadComponent #method:loadComponent#

#if defined(ENABLE_OVERLOADING)
    CoreLoadComponentMethodInfo             ,
#endif
    coreLoadComponent                       ,


-- ** loadComponentFinish #method:loadComponentFinish#

#if defined(ENABLE_OVERLOADING)
    CoreLoadComponentFinishMethodInfo       ,
#endif
    coreLoadComponentFinish                 ,


-- ** new #method:new#

    coreNew                                 ,


-- ** registerObject #method:registerObject#

#if defined(ENABLE_OVERLOADING)
    CoreRegisterObjectMethodInfo            ,
#endif
    coreRegisterObject                      ,


-- ** removeObject #method:removeObject#

#if defined(ENABLE_OVERLOADING)
    CoreRemoveObjectMethodInfo              ,
#endif
    coreRemoveObject                        ,


-- ** sync #method:sync#

#if defined(ENABLE_OVERLOADING)
    CoreSyncMethodInfo                      ,
#endif
    coreSync                                ,


-- ** syncClosure #method:syncClosure#

#if defined(ENABLE_OVERLOADING)
    CoreSyncClosureMethodInfo               ,
#endif
    coreSyncClosure                         ,


-- ** syncFinish #method:syncFinish#

#if defined(ENABLE_OVERLOADING)
    CoreSyncFinishMethodInfo                ,
#endif
    coreSyncFinish                          ,


-- ** testFeature #method:testFeature#

#if defined(ENABLE_OVERLOADING)
    CoreTestFeatureMethodInfo               ,
#endif
    coreTestFeature                         ,


-- ** timeoutAdd #method:timeoutAdd#

#if defined(ENABLE_OVERLOADING)
    CoreTimeoutAddMethodInfo                ,
#endif
    coreTimeoutAdd                          ,


-- ** timeoutAddClosure #method:timeoutAddClosure#

#if defined(ENABLE_OVERLOADING)
    CoreTimeoutAddClosureMethodInfo         ,
#endif
    coreTimeoutAddClosure                   ,


-- ** updateProperties #method:updateProperties#

#if defined(ENABLE_OVERLOADING)
    CoreUpdatePropertiesMethodInfo          ,
#endif
    coreUpdateProperties                    ,




 -- * Properties


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

#if defined(ENABLE_OVERLOADING)
    CoreConfPropertyInfo                    ,
#endif
    constructCoreConf                       ,
#if defined(ENABLE_OVERLOADING)
    coreConf                                ,
#endif
    getCoreConf                             ,


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

#if defined(ENABLE_OVERLOADING)
    CoreGMainContextPropertyInfo            ,
#endif
    constructCoreGMainContext               ,
#if defined(ENABLE_OVERLOADING)
    coreGMainContext                        ,
#endif
    getCoreGMainContext                     ,


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

#if defined(ENABLE_OVERLOADING)
    CorePropertiesPropertyInfo              ,
#endif
    constructCoreProperties                 ,
#if defined(ENABLE_OVERLOADING)
    coreProperties                          ,
#endif
    getCoreProperties                       ,


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

#if defined(ENABLE_OVERLOADING)
    CorePwContextPropertyInfo               ,
#endif
    constructCorePwContext                  ,
#if defined(ENABLE_OVERLOADING)
    corePwContext                           ,
#endif
    getCorePwContext                        ,


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

#if defined(ENABLE_OVERLOADING)
    CorePwCorePropertyInfo                  ,
#endif
#if defined(ENABLE_OVERLOADING)
    corePwCore                              ,
#endif
    getCorePwCore                           ,




 -- * Signals


-- ** connected #signal:connected#

    CoreConnectedCallback                   ,
#if defined(ENABLE_OVERLOADING)
    CoreConnectedSignalInfo                 ,
#endif
    afterCoreConnected                      ,
    onCoreConnected                         ,


-- ** disconnected #signal:disconnected#

    CoreDisconnectedCallback                ,
#if defined(ENABLE_OVERLOADING)
    CoreDisconnectedSignalInfo              ,
#endif
    afterCoreDisconnected                   ,
    onCoreDisconnected                      ,




    ) 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.Object as Wp.Object
import {-# SOURCE #-} qualified GI.Wp.Objects.ObjectManager as Wp.ObjectManager
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.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 {-# SOURCE #-} qualified GI.Wp.Objects.Conf as Wp.Conf
import {-# SOURCE #-} qualified GI.Wp.Objects.Object as Wp.Object
import {-# SOURCE #-} qualified GI.Wp.Objects.ObjectManager as Wp.ObjectManager
import {-# SOURCE #-} qualified GI.Wp.Structs.Properties as Wp.Properties
import {-# SOURCE #-} qualified GI.Wp.Structs.SpaJson as Wp.SpaJson

#endif

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

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

foreign import ccall "wp_core_get_type"
    c_wp_core_get_type :: IO B.Types.GType

instance B.Types.TypedObject Core where
    glibType = c_wp_core_get_type

instance B.Types.GObject Core

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

instance O.HasParentTypes Core
type instance O.ParentTypes Core = '[Wp.Object.Object, GObject.Object.Object]

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

-- | Convert t'Core' 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 Core) where
    gvalueGType_ = c_wp_core_get_type
    gvalueSet_ gv P.Nothing = B.GValue.set_object gv (FP.nullPtr :: FP.Ptr Core)
    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 Core)
        if ptr /= FP.nullPtr
        then P.Just <$> B.ManagedPtr.newObject Core ptr
        else return P.Nothing
        
    

#if defined(ENABLE_OVERLOADING)
type family ResolveCoreMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolveCoreMethod "abortActivation" o = Wp.Object.ObjectAbortActivationMethodInfo
    ResolveCoreMethod "activate" o = Wp.Object.ObjectActivateMethodInfo
    ResolveCoreMethod "activateClosure" o = Wp.Object.ObjectActivateClosureMethodInfo
    ResolveCoreMethod "activateFinish" o = Wp.Object.ObjectActivateFinishMethodInfo
    ResolveCoreMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveCoreMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveCoreMethod "clone" o = CoreCloneMethodInfo
    ResolveCoreMethod "connect" o = CoreConnectMethodInfo
    ResolveCoreMethod "connectFd" o = CoreConnectFdMethodInfo
    ResolveCoreMethod "deactivate" o = Wp.Object.ObjectDeactivateMethodInfo
    ResolveCoreMethod "disconnect" o = CoreDisconnectMethodInfo
    ResolveCoreMethod "findObject" o = CoreFindObjectMethodInfo
    ResolveCoreMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveCoreMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveCoreMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveCoreMethod "idleAdd" o = CoreIdleAddMethodInfo
    ResolveCoreMethod "idleAddClosure" o = CoreIdleAddClosureMethodInfo
    ResolveCoreMethod "installObjectManager" o = CoreInstallObjectManagerMethodInfo
    ResolveCoreMethod "isConnected" o = CoreIsConnectedMethodInfo
    ResolveCoreMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveCoreMethod "loadComponent" o = CoreLoadComponentMethodInfo
    ResolveCoreMethod "loadComponentFinish" o = CoreLoadComponentFinishMethodInfo
    ResolveCoreMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveCoreMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveCoreMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveCoreMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveCoreMethod "registerObject" o = CoreRegisterObjectMethodInfo
    ResolveCoreMethod "removeObject" o = CoreRemoveObjectMethodInfo
    ResolveCoreMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveCoreMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveCoreMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveCoreMethod "sync" o = CoreSyncMethodInfo
    ResolveCoreMethod "syncClosure" o = CoreSyncClosureMethodInfo
    ResolveCoreMethod "syncFinish" o = CoreSyncFinishMethodInfo
    ResolveCoreMethod "testActiveFeatures" o = Wp.Object.ObjectTestActiveFeaturesMethodInfo
    ResolveCoreMethod "testFeature" o = CoreTestFeatureMethodInfo
    ResolveCoreMethod "testSupportedFeatures" o = Wp.Object.ObjectTestSupportedFeaturesMethodInfo
    ResolveCoreMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveCoreMethod "timeoutAdd" o = CoreTimeoutAddMethodInfo
    ResolveCoreMethod "timeoutAddClosure" o = CoreTimeoutAddClosureMethodInfo
    ResolveCoreMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveCoreMethod "updateFeatures" o = Wp.Object.ObjectUpdateFeaturesMethodInfo
    ResolveCoreMethod "updateProperties" o = CoreUpdatePropertiesMethodInfo
    ResolveCoreMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveCoreMethod "getActiveFeatures" o = Wp.Object.ObjectGetActiveFeaturesMethodInfo
    ResolveCoreMethod "getConf" o = CoreGetConfMethodInfo
    ResolveCoreMethod "getCore" o = Wp.Object.ObjectGetCoreMethodInfo
    ResolveCoreMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveCoreMethod "getExportCore" o = CoreGetExportCoreMethodInfo
    ResolveCoreMethod "getGMainContext" o = CoreGetGMainContextMethodInfo
    ResolveCoreMethod "getId" o = Wp.Object.ObjectGetIdMethodInfo
    ResolveCoreMethod "getOwnBoundId" o = CoreGetOwnBoundIdMethodInfo
    ResolveCoreMethod "getProperties" o = CoreGetPropertiesMethodInfo
    ResolveCoreMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveCoreMethod "getPwContext" o = CoreGetPwContextMethodInfo
    ResolveCoreMethod "getPwCore" o = CoreGetPwCoreMethodInfo
    ResolveCoreMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveCoreMethod "getRemoteCookie" o = CoreGetRemoteCookieMethodInfo
    ResolveCoreMethod "getRemoteHostName" o = CoreGetRemoteHostNameMethodInfo
    ResolveCoreMethod "getRemoteName" o = CoreGetRemoteNameMethodInfo
    ResolveCoreMethod "getRemoteProperties" o = CoreGetRemotePropertiesMethodInfo
    ResolveCoreMethod "getRemoteUserName" o = CoreGetRemoteUserNameMethodInfo
    ResolveCoreMethod "getRemoteVersion" o = CoreGetRemoteVersionMethodInfo
    ResolveCoreMethod "getSupportedFeatures" o = Wp.Object.ObjectGetSupportedFeaturesMethodInfo
    ResolveCoreMethod "getVmType" o = CoreGetVmTypeMethodInfo
    ResolveCoreMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveCoreMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveCoreMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveCoreMethod l o = O.MethodResolutionFailed l o

instance (info ~ ResolveCoreMethod t Core, O.OverloadedMethod info Core p) => OL.IsLabel t (Core -> 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 ~ ResolveCoreMethod t Core, O.OverloadedMethod info Core p, R.HasField t Core p) => R.HasField t Core p where
    getField = O.overloadedMethod @info

#endif

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

#endif

-- signal Core::connected
-- | /No description available in the introspection data./
type CoreConnectedCallback =
    IO ()

type C_CoreConnectedCallback =
    Ptr Core ->                             -- object
    Ptr () ->                               -- user_data
    IO ()

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

wrap_CoreConnectedCallback :: 
    GObject a => (a -> CoreConnectedCallback) ->
    C_CoreConnectedCallback
wrap_CoreConnectedCallback gi'cb gi'selfPtr _ = do
    B.ManagedPtr.withNewObject gi'selfPtr $ \gi'self -> gi'cb (Coerce.coerce gi'self) 


-- | Connect a signal handler for the [connected](#signal:connected) 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' core #connected callback
-- @
-- 
-- 
onCoreConnected :: (IsCore a, MonadIO m) => a -> ((?self :: a) => CoreConnectedCallback) -> m SignalHandlerId
onCoreConnected obj cb = liftIO $ do
    let wrapped self = let ?self = self in cb
    let wrapped' = wrap_CoreConnectedCallback wrapped
    wrapped'' <- mk_CoreConnectedCallback wrapped'
    connectSignalFunPtr obj "connected" wrapped'' SignalConnectBefore Nothing

-- | Connect a signal handler for the [connected](#signal:connected) 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' core #connected 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.
-- 
afterCoreConnected :: (IsCore a, MonadIO m) => a -> ((?self :: a) => CoreConnectedCallback) -> m SignalHandlerId
afterCoreConnected obj cb = liftIO $ do
    let wrapped self = let ?self = self in cb
    let wrapped' = wrap_CoreConnectedCallback wrapped
    wrapped'' <- mk_CoreConnectedCallback wrapped'
    connectSignalFunPtr obj "connected" wrapped'' SignalConnectAfter Nothing


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

#endif

-- signal Core::disconnected
-- | /No description available in the introspection data./
type CoreDisconnectedCallback =
    IO ()

type C_CoreDisconnectedCallback =
    Ptr Core ->                             -- object
    Ptr () ->                               -- user_data
    IO ()

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

wrap_CoreDisconnectedCallback :: 
    GObject a => (a -> CoreDisconnectedCallback) ->
    C_CoreDisconnectedCallback
wrap_CoreDisconnectedCallback gi'cb gi'selfPtr _ = do
    B.ManagedPtr.withNewObject gi'selfPtr $ \gi'self -> gi'cb (Coerce.coerce gi'self) 


-- | Connect a signal handler for the [disconnected](#signal:disconnected) 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' core #disconnected callback
-- @
-- 
-- 
onCoreDisconnected :: (IsCore a, MonadIO m) => a -> ((?self :: a) => CoreDisconnectedCallback) -> m SignalHandlerId
onCoreDisconnected obj cb = liftIO $ do
    let wrapped self = let ?self = self in cb
    let wrapped' = wrap_CoreDisconnectedCallback wrapped
    wrapped'' <- mk_CoreDisconnectedCallback wrapped'
    connectSignalFunPtr obj "disconnected" wrapped'' SignalConnectBefore Nothing

-- | Connect a signal handler for the [disconnected](#signal:disconnected) 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' core #disconnected 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.
-- 
afterCoreDisconnected :: (IsCore a, MonadIO m) => a -> ((?self :: a) => CoreDisconnectedCallback) -> m SignalHandlerId
afterCoreDisconnected obj cb = liftIO $ do
    let wrapped self = let ?self = self in cb
    let wrapped' = wrap_CoreDisconnectedCallback wrapped
    wrapped'' <- mk_CoreDisconnectedCallback wrapped'
    connectSignalFunPtr obj "disconnected" wrapped'' SignalConnectAfter Nothing


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

#endif

-- VVV Prop "conf"
   -- Type: TInterface (Name {namespace = "Wp", name = "Conf"})
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

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

-- | Construct a t'GValueConstruct' with valid value for the “@conf@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructCoreConf :: (IsCore o, MIO.MonadIO m, Wp.Conf.IsConf a) => a -> m (GValueConstruct o)
constructCoreConf val = MIO.liftIO $ do
    MIO.liftIO $ B.Properties.constructObjectPropertyObject "conf" (P.Just val)

#if defined(ENABLE_OVERLOADING)
data CoreConfPropertyInfo
instance AttrInfo CoreConfPropertyInfo where
    type AttrAllowedOps CoreConfPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint CoreConfPropertyInfo = IsCore
    type AttrSetTypeConstraint CoreConfPropertyInfo = Wp.Conf.IsConf
    type AttrTransferTypeConstraint CoreConfPropertyInfo = Wp.Conf.IsConf
    type AttrTransferType CoreConfPropertyInfo = Wp.Conf.Conf
    type AttrGetType CoreConfPropertyInfo = (Maybe Wp.Conf.Conf)
    type AttrLabel CoreConfPropertyInfo = "conf"
    type AttrOrigin CoreConfPropertyInfo = Core
    attrGet = getCoreConf
    attrSet = undefined
    attrPut = undefined
    attrTransfer _ v = do
        unsafeCastTo Wp.Conf.Conf v
    attrConstruct = constructCoreConf
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Objects.Core.conf"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Objects-Core.html#g:attr:conf"
        })
#endif

-- VVV Prop "g-main-context"
   -- Type: TInterface (Name {namespace = "GLib", name = "MainContext"})
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Just True,Nothing)

-- | Get the value of the “@g-main-context@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' core #gMainContext
-- @
getCoreGMainContext :: (MonadIO m, IsCore o) => o -> m (Maybe GLib.MainContext.MainContext)
getCoreGMainContext obj = MIO.liftIO $ B.Properties.getObjectPropertyBoxed obj "g-main-context" GLib.MainContext.MainContext

-- | Construct a t'GValueConstruct' with valid value for the “@g-main-context@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructCoreGMainContext :: (IsCore o, MIO.MonadIO m) => GLib.MainContext.MainContext -> m (GValueConstruct o)
constructCoreGMainContext val = MIO.liftIO $ do
    MIO.liftIO $ B.Properties.constructObjectPropertyBoxed "g-main-context" (P.Just val)

#if defined(ENABLE_OVERLOADING)
data CoreGMainContextPropertyInfo
instance AttrInfo CoreGMainContextPropertyInfo where
    type AttrAllowedOps CoreGMainContextPropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint CoreGMainContextPropertyInfo = IsCore
    type AttrSetTypeConstraint CoreGMainContextPropertyInfo = (~) GLib.MainContext.MainContext
    type AttrTransferTypeConstraint CoreGMainContextPropertyInfo = (~) GLib.MainContext.MainContext
    type AttrTransferType CoreGMainContextPropertyInfo = GLib.MainContext.MainContext
    type AttrGetType CoreGMainContextPropertyInfo = (Maybe GLib.MainContext.MainContext)
    type AttrLabel CoreGMainContextPropertyInfo = "g-main-context"
    type AttrOrigin CoreGMainContextPropertyInfo = Core
    attrGet = getCoreGMainContext
    attrSet = undefined
    attrPut = undefined
    attrTransfer _ v = do
        return v
    attrConstruct = constructCoreGMainContext
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Objects.Core.gMainContext"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Objects-Core.html#g:attr:gMainContext"
        })
#endif

-- VVV Prop "properties"
   -- Type: TInterface (Name {namespace = "Wp", name = "Properties"})
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

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

-- | Construct a t'GValueConstruct' with valid value for the “@properties@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructCoreProperties :: (IsCore o, MIO.MonadIO m) => Wp.Properties.Properties -> m (GValueConstruct o)
constructCoreProperties val = MIO.liftIO $ do
    MIO.liftIO $ B.Properties.constructObjectPropertyBoxed "properties" (P.Just val)

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

-- VVV Prop "pw-context"
   -- Type: TBasicType TPtr
   -- Flags: [PropertyReadable,PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Just True,Nothing)

-- | Get the value of the “@pw-context@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' core #pwContext
-- @
getCorePwContext :: (MonadIO m, IsCore o) => o -> m (Ptr ())
getCorePwContext obj = MIO.liftIO $ B.Properties.getObjectPropertyPtr obj "pw-context"

-- | Construct a t'GValueConstruct' with valid value for the “@pw-context@” property. This is rarely needed directly, but it is used by `Data.GI.Base.Constructible.new`.
constructCorePwContext :: (IsCore o, MIO.MonadIO m) => Ptr () -> m (GValueConstruct o)
constructCorePwContext val = MIO.liftIO $ do
    MIO.liftIO $ B.Properties.constructObjectPropertyPtr "pw-context" val

#if defined(ENABLE_OVERLOADING)
data CorePwContextPropertyInfo
instance AttrInfo CorePwContextPropertyInfo where
    type AttrAllowedOps CorePwContextPropertyInfo = '[ 'AttrConstruct, 'AttrGet]
    type AttrBaseTypeConstraint CorePwContextPropertyInfo = IsCore
    type AttrSetTypeConstraint CorePwContextPropertyInfo = (~) (Ptr ())
    type AttrTransferTypeConstraint CorePwContextPropertyInfo = (~) (Ptr ())
    type AttrTransferType CorePwContextPropertyInfo = Ptr ()
    type AttrGetType CorePwContextPropertyInfo = (Ptr ())
    type AttrLabel CorePwContextPropertyInfo = "pw-context"
    type AttrOrigin CorePwContextPropertyInfo = Core
    attrGet = getCorePwContext
    attrSet = undefined
    attrPut = undefined
    attrTransfer _ v = do
        return v
    attrConstruct = constructCorePwContext
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Objects.Core.pwContext"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Objects-Core.html#g:attr:pwContext"
        })
#endif

-- VVV Prop "pw-core"
   -- Type: TBasicType TPtr
   -- Flags: [PropertyReadable]
   -- Nullable: (Just True,Nothing)

-- | Get the value of the “@pw-core@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' core #pwCore
-- @
getCorePwCore :: (MonadIO m, IsCore o) => o -> m (Ptr ())
getCorePwCore obj = MIO.liftIO $ B.Properties.getObjectPropertyPtr obj "pw-core"

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

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Core
type instance O.AttributeList Core = CoreAttributeList
type CoreAttributeList = ('[ '("activeFeatures", Wp.Object.ObjectActiveFeaturesPropertyInfo), '("conf", CoreConfPropertyInfo), '("core", Wp.Object.ObjectCorePropertyInfo), '("gMainContext", CoreGMainContextPropertyInfo), '("id", Wp.Object.ObjectIdPropertyInfo), '("properties", CorePropertiesPropertyInfo), '("pwContext", CorePwContextPropertyInfo), '("pwCore", CorePwCorePropertyInfo), '("supportedFeatures", Wp.Object.ObjectSupportedFeaturesPropertyInfo)] :: [(Symbol, DK.Type)])
#endif

#if defined(ENABLE_OVERLOADING)
coreConf :: AttrLabelProxy "conf"
coreConf = AttrLabelProxy

coreGMainContext :: AttrLabelProxy "gMainContext"
coreGMainContext = AttrLabelProxy

coreProperties :: AttrLabelProxy "properties"
coreProperties = AttrLabelProxy

corePwContext :: AttrLabelProxy "pwContext"
corePwContext = AttrLabelProxy

corePwCore :: AttrLabelProxy "pwCore"
corePwCore = AttrLabelProxy

#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList Core = CoreSignalList
type CoreSignalList = ('[ '("connected", CoreConnectedSignalInfo), '("disconnected", CoreDisconnectedSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])

#endif

-- method Core::new
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "context"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "MainContext" }
--           , argCType = Just "GMainContext*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the GMainContext to use for events"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "conf"
--           , argType = TInterface Name { namespace = "Wp" , name = "Conf" }
--           , argCType = Just "WpConf*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the main configuration file"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "properties"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "Properties" }
--           , argCType = Just "WpProperties*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "additional properties, which are also passed to pw_context_new() and pw_context_connect()"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Wp" , name = "Core" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_core_new" wp_core_new :: 
    Ptr GLib.MainContext.MainContext ->     -- context : TInterface (Name {namespace = "GLib", name = "MainContext"})
    Ptr Wp.Conf.Conf ->                     -- conf : TInterface (Name {namespace = "Wp", name = "Conf"})
    Ptr Wp.Properties.Properties ->         -- properties : TInterface (Name {namespace = "Wp", name = "Properties"})
    IO (Ptr Core)

-- | Creates a new core object.
coreNew ::
    (B.CallStack.HasCallStack, MonadIO m, Wp.Conf.IsConf a) =>
    Maybe (GLib.MainContext.MainContext)
    -- ^ /@context@/: the GMainContext to use for events
    -> Maybe (a)
    -- ^ /@conf@/: the main configuration file
    -> Maybe (Wp.Properties.Properties)
    -- ^ /@properties@/: additional properties, which are also passed to @/pw_context_new()/@ and @/pw_context_connect()/@
    -> m Core
    -- ^ __Returns:__ a new WpCore
coreNew context conf properties = liftIO $ do
    maybeContext <- case context of
        Nothing -> return FP.nullPtr
        Just jContext -> do
            jContext' <- unsafeManagedPtrGetPtr jContext
            return jContext'
    maybeConf <- case conf of
        Nothing -> return FP.nullPtr
        Just jConf -> do
            jConf' <- B.ManagedPtr.disownObject jConf
            return jConf'
    maybeProperties <- case properties of
        Nothing -> return FP.nullPtr
        Just jProperties -> do
            jProperties' <- B.ManagedPtr.disownBoxed jProperties
            return jProperties'
    result <- wp_core_new maybeContext maybeConf maybeProperties
    checkUnexpectedReturnNULL "coreNew" result
    result' <- (wrapObject Core) result
    whenJust context touchManagedPtr
    whenJust conf touchManagedPtr
    whenJust properties touchManagedPtr
    return result'

#if defined(ENABLE_OVERLOADING)
#endif

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

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

-- | Clones a core with the same context as /@self@/.
coreClone ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a) =>
    a
    -- ^ /@self@/: the core
    -> m Core
    -- ^ __Returns:__ the clone WpCore
coreClone self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_core_clone self'
    checkUnexpectedReturnNULL "coreClone" result
    result' <- (wrapObject Core) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data CoreCloneMethodInfo
instance (signature ~ (m Core), MonadIO m, IsCore a) => O.OverloadedMethod CoreCloneMethodInfo a signature where
    overloadedMethod = coreClone

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


#endif

-- method Core::connect
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "Core" }
--           , argCType = Just "WpCore*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the core" , 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_core_connect" wp_core_connect :: 
    Ptr Core ->                             -- self : TInterface (Name {namespace = "Wp", name = "Core"})
    IO CInt

-- | Connects this core to the PipeWire server.
-- 
-- 
-- When connection succeeds, the WpCore \"connected\" signal is emitted.
coreConnect ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a) =>
    a
    -- ^ /@self@/: the core
    -> m Bool
    -- ^ __Returns:__ TRUE if the core is effectively connected or FALSE if connection failed
coreConnect self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_core_connect self'
    let result' = (/= 0) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data CoreConnectMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsCore a) => O.OverloadedMethod CoreConnectMethodInfo a signature where
    overloadedMethod = coreConnect

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


#endif

-- method Core::connect_fd
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "Core" }
--           , argCType = Just "WpCore*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the core" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "fd"
--           , argType = TBasicType TInt
--           , argCType = Just "int"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the connected socket to use, the socket will be closed automatically on disconnect or error"
--                 , 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_core_connect_fd" wp_core_connect_fd :: 
    Ptr Core ->                             -- self : TInterface (Name {namespace = "Wp", name = "Core"})
    Int32 ->                                -- fd : TBasicType TInt
    IO CInt

-- | Connects this core to the PipeWire server on the given socket.
-- 
-- 
-- When connection succeeds, the WpCore \"connected\" signal is emitted.
-- 
-- /Since: 0.5.6/
coreConnectFd ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a) =>
    a
    -- ^ /@self@/: the core
    -> Int32
    -- ^ /@fd@/: the connected socket to use, the socket will be closed automatically on disconnect or error
    -> m Bool
    -- ^ __Returns:__ TRUE if the core is effectively connected or FALSE if connection failed
coreConnectFd self fd = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_core_connect_fd self' fd
    let result' = (/= 0) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data CoreConnectFdMethodInfo
instance (signature ~ (Int32 -> m Bool), MonadIO m, IsCore a) => O.OverloadedMethod CoreConnectFdMethodInfo a signature where
    overloadedMethod = coreConnectFd

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


#endif

-- method Core::disconnect
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "Core" }
--           , argCType = Just "WpCore*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the core" , 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_core_disconnect" wp_core_disconnect :: 
    Ptr Core ->                             -- self : TInterface (Name {namespace = "Wp", name = "Core"})
    IO ()

-- | Disconnects this core from the PipeWire server.
-- 
-- 
-- This also effectively destroys all WpCore objects that were created through the registry, destroys the pw_core and finally emits the WpCore \"disconnected\" signal.
coreDisconnect ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a) =>
    a
    -- ^ /@self@/: the core
    -> m ()
coreDisconnect self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    wp_core_disconnect self'
    touchManagedPtr self
    return ()

#if defined(ENABLE_OVERLOADING)
data CoreDisconnectMethodInfo
instance (signature ~ (m ()), MonadIO m, IsCore a) => O.OverloadedMethod CoreDisconnectMethodInfo a signature where
    overloadedMethod = coreDisconnect

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


#endif

-- method Core::find_object
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "Core" }
--           , argCType = Just "WpCore*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the core" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "func"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "EqualFunc" }
--           , argCType = Just "GEqualFunc"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "a function that takes the object being searched as the first argument and @data as the second. it should return TRUE if the object is found or FALSE otherwise"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeCall
--           , argClosure = 2
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "data"
--           , argType = TBasicType TPtr
--           , argCType = Just "gconstpointer"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the second argument to @func"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GObject" , name = "Object" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_core_find_object" wp_core_find_object :: 
    Ptr Core ->                             -- self : TInterface (Name {namespace = "Wp", name = "Core"})
    FunPtr GLib.Callbacks.C_EqualFunc ->    -- func : TInterface (Name {namespace = "GLib", name = "EqualFunc"})
    Ptr () ->                               -- data : TBasicType TPtr
    IO (Ptr GObject.Object.Object)

-- | Finds a registered object.
coreFindObject ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a) =>
    a
    -- ^ /@self@/: the core
    -> GLib.Callbacks.EqualFunc
    -- ^ /@func@/: a function that takes the object being searched as the first argument and /@data@/ as the second. it should return TRUE if the object is found or FALSE otherwise
    -> m (Maybe GObject.Object.Object)
    -- ^ __Returns:__ the registered object or NULL if not found
coreFindObject self func = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    func' <- GLib.Callbacks.mk_EqualFunc (GLib.Callbacks.wrap_EqualFunc Nothing func)
    let data_ = nullPtr
    result <- wp_core_find_object self' func' data_
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (wrapObject GObject.Object.Object) result'
        return result''
    safeFreeFunPtr $ castFunPtrToPtr func'
    touchManagedPtr self
    return maybeResult

#if defined(ENABLE_OVERLOADING)
data CoreFindObjectMethodInfo
instance (signature ~ (GLib.Callbacks.EqualFunc -> m (Maybe GObject.Object.Object)), MonadIO m, IsCore a) => O.OverloadedMethod CoreFindObjectMethodInfo a signature where
    overloadedMethod = coreFindObject

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


#endif

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

foreign import ccall "wp_core_get_conf" wp_core_get_conf :: 
    Ptr Core ->                             -- self : TInterface (Name {namespace = "Wp", name = "Core"})
    IO (Ptr Wp.Conf.Conf)

-- | Gets the main configuration file of the core.
coreGetConf ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a) =>
    a
    -- ^ /@self@/: the core
    -> m (Maybe Wp.Conf.Conf)
    -- ^ __Returns:__ the main configuration file
coreGetConf self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_core_get_conf self'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (wrapObject Wp.Conf.Conf) result'
        return result''
    touchManagedPtr self
    return maybeResult

#if defined(ENABLE_OVERLOADING)
data CoreGetConfMethodInfo
instance (signature ~ (m (Maybe Wp.Conf.Conf)), MonadIO m, IsCore a) => O.OverloadedMethod CoreGetConfMethodInfo a signature where
    overloadedMethod = coreGetConf

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


#endif

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

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

{-# DEPRECATED coreGetExportCore ["The export core used to be a secondary connection to PipeWire, sharing the loop of /@self@/, on which objects implemented in-process were exported. It has been superseded by the client context, which hosts those objects in a separate pw_context running on its own thread, so that they are not affected by anything that blocks WirePlumber\\'s main loop. The client context is internal and has no WpCore associated with it; objects are placed in it transparently, so there is no replacement for this method."] #-}
-- | Returns NULL.
coreGetExportCore ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a) =>
    a
    -- ^ /@self@/: the core
    -> m (Maybe Core)
    -- ^ __Returns:__ NULL
coreGetExportCore self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_core_get_export_core self'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (wrapObject Core) result'
        return result''
    touchManagedPtr self
    return maybeResult

#if defined(ENABLE_OVERLOADING)
data CoreGetExportCoreMethodInfo
instance (signature ~ (m (Maybe Core)), MonadIO m, IsCore a) => O.OverloadedMethod CoreGetExportCoreMethodInfo a signature where
    overloadedMethod = coreGetExportCore

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


#endif

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

foreign import ccall "wp_core_get_g_main_context" wp_core_get_g_main_context :: 
    Ptr Core ->                             -- self : TInterface (Name {namespace = "Wp", name = "Core"})
    IO (Ptr GLib.MainContext.MainContext)

-- | Gets the GMainContext of the core.
coreGetGMainContext ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a) =>
    a
    -- ^ /@self@/: the core
    -> m (Maybe GLib.MainContext.MainContext)
    -- ^ __Returns:__ the GMainContext that is in use by this core for events
coreGetGMainContext self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_core_get_g_main_context self'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- (newBoxed GLib.MainContext.MainContext) result'
        return result''
    touchManagedPtr self
    return maybeResult

#if defined(ENABLE_OVERLOADING)
data CoreGetGMainContextMethodInfo
instance (signature ~ (m (Maybe GLib.MainContext.MainContext)), MonadIO m, IsCore a) => O.OverloadedMethod CoreGetGMainContextMethodInfo a signature where
    overloadedMethod = coreGetGMainContext

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


#endif

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

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

-- | Gets the bound id of the client object that is created as a result of this core being connected to the PipeWire daemon.
-- 
-- /Since: 0.4.16/
coreGetOwnBoundId ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a) =>
    a
    -- ^ /@self@/: the core
    -> m Word32
    -- ^ __Returns:__ the bound id of this client
coreGetOwnBoundId self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_core_get_own_bound_id self'
    touchManagedPtr self
    return result

#if defined(ENABLE_OVERLOADING)
data CoreGetOwnBoundIdMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsCore a) => O.OverloadedMethod CoreGetOwnBoundIdMethodInfo a signature where
    overloadedMethod = coreGetOwnBoundId

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


#endif

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

foreign import ccall "wp_core_get_properties" wp_core_get_properties :: 
    Ptr Core ->                             -- self : TInterface (Name {namespace = "Wp", name = "Core"})
    IO (Ptr Wp.Properties.Properties)

-- | Gets the properties of the core.
coreGetProperties ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a) =>
    a
    -- ^ /@self@/: the core
    -> m Wp.Properties.Properties
    -- ^ __Returns:__ the properties of /@self@/
coreGetProperties self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_core_get_properties self'
    checkUnexpectedReturnNULL "coreGetProperties" result
    result' <- (wrapBoxed Wp.Properties.Properties) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data CoreGetPropertiesMethodInfo
instance (signature ~ (m Wp.Properties.Properties), MonadIO m, IsCore a) => O.OverloadedMethod CoreGetPropertiesMethodInfo a signature where
    overloadedMethod = coreGetProperties

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


#endif

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

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

-- | Gets the internal PipeWire context of the core.
coreGetPwContext ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a) =>
    a
    -- ^ /@self@/: the core
    -> m (Ptr ())
    -- ^ __Returns:__ the internal pw_context object
coreGetPwContext self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_core_get_pw_context self'
    touchManagedPtr self
    return result

#if defined(ENABLE_OVERLOADING)
data CoreGetPwContextMethodInfo
instance (signature ~ (m (Ptr ())), MonadIO m, IsCore a) => O.OverloadedMethod CoreGetPwContextMethodInfo a signature where
    overloadedMethod = coreGetPwContext

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


#endif

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

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

-- | Gets the internal PipeWire core of the core.
coreGetPwCore ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a) =>
    a
    -- ^ /@self@/: the core
    -> m (Ptr ())
    -- ^ __Returns:__ the internal pw_core object, or NULL if the core is not connected to PipeWire
coreGetPwCore self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_core_get_pw_core self'
    touchManagedPtr self
    return result

#if defined(ENABLE_OVERLOADING)
data CoreGetPwCoreMethodInfo
instance (signature ~ (m (Ptr ())), MonadIO m, IsCore a) => O.OverloadedMethod CoreGetPwCoreMethodInfo a signature where
    overloadedMethod = coreGetPwCore

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


#endif

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

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

-- | Gets the cookie of the core\'s connected PipeWire instance.
coreGetRemoteCookie ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a) =>
    a
    -- ^ /@self@/: the core
    -> m Word32
    -- ^ __Returns:__ The cookie of the PipeWire instance that /@self@/ is connected to. The cookie is a unique random number for identifying an instance of PipeWire
coreGetRemoteCookie self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_core_get_remote_cookie self'
    touchManagedPtr self
    return result

#if defined(ENABLE_OVERLOADING)
data CoreGetRemoteCookieMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsCore a) => O.OverloadedMethod CoreGetRemoteCookieMethodInfo a signature where
    overloadedMethod = coreGetRemoteCookie

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


#endif

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

foreign import ccall "wp_core_get_remote_host_name" wp_core_get_remote_host_name :: 
    Ptr Core ->                             -- self : TInterface (Name {namespace = "Wp", name = "Core"})
    IO CString

-- | Gets the host name of the core\'s connected PipeWire instance.
coreGetRemoteHostName ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a) =>
    a
    -- ^ /@self@/: the core
    -> m T.Text
    -- ^ __Returns:__ The name of the host where the PipeWire instance that /@self@/ is connected to is running on
coreGetRemoteHostName self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_core_get_remote_host_name self'
    checkUnexpectedReturnNULL "coreGetRemoteHostName" result
    result' <- cstringToText result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data CoreGetRemoteHostNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsCore a) => O.OverloadedMethod CoreGetRemoteHostNameMethodInfo a signature where
    overloadedMethod = coreGetRemoteHostName

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


#endif

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

foreign import ccall "wp_core_get_remote_name" wp_core_get_remote_name :: 
    Ptr Core ->                             -- self : TInterface (Name {namespace = "Wp", name = "Core"})
    IO CString

-- | Gets the name of the core\'s connected PipeWire instance.
coreGetRemoteName ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a) =>
    a
    -- ^ /@self@/: the core
    -> m T.Text
    -- ^ __Returns:__ The name of the PipeWire instance that /@self@/ is connected to
coreGetRemoteName self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_core_get_remote_name self'
    checkUnexpectedReturnNULL "coreGetRemoteName" result
    result' <- cstringToText result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data CoreGetRemoteNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsCore a) => O.OverloadedMethod CoreGetRemoteNameMethodInfo a signature where
    overloadedMethod = coreGetRemoteName

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


#endif

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

foreign import ccall "wp_core_get_remote_properties" wp_core_get_remote_properties :: 
    Ptr Core ->                             -- self : TInterface (Name {namespace = "Wp", name = "Core"})
    IO (Ptr Wp.Properties.Properties)

-- | Gets the properties of the core\'s connected PipeWire instance.
coreGetRemoteProperties ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a) =>
    a
    -- ^ /@self@/: the core
    -> m Wp.Properties.Properties
    -- ^ __Returns:__ the properties of the PipeWire instance that /@self@/ is connected to
coreGetRemoteProperties self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_core_get_remote_properties self'
    checkUnexpectedReturnNULL "coreGetRemoteProperties" result
    result' <- (wrapBoxed Wp.Properties.Properties) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data CoreGetRemotePropertiesMethodInfo
instance (signature ~ (m Wp.Properties.Properties), MonadIO m, IsCore a) => O.OverloadedMethod CoreGetRemotePropertiesMethodInfo a signature where
    overloadedMethod = coreGetRemoteProperties

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


#endif

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

foreign import ccall "wp_core_get_remote_user_name" wp_core_get_remote_user_name :: 
    Ptr Core ->                             -- self : TInterface (Name {namespace = "Wp", name = "Core"})
    IO CString

-- | Gets the user name of the core\'s connected PipeWire instance.
coreGetRemoteUserName ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a) =>
    a
    -- ^ /@self@/: the core
    -> m T.Text
    -- ^ __Returns:__ The name of the user that started the PipeWire instance that /@self@/ is connected to
coreGetRemoteUserName self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_core_get_remote_user_name self'
    checkUnexpectedReturnNULL "coreGetRemoteUserName" result
    result' <- cstringToText result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data CoreGetRemoteUserNameMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsCore a) => O.OverloadedMethod CoreGetRemoteUserNameMethodInfo a signature where
    overloadedMethod = coreGetRemoteUserName

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


#endif

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

foreign import ccall "wp_core_get_remote_version" wp_core_get_remote_version :: 
    Ptr Core ->                             -- self : TInterface (Name {namespace = "Wp", name = "Core"})
    IO CString

-- | Gets the version of the core\'s connected PipeWire instance.
coreGetRemoteVersion ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a) =>
    a
    -- ^ /@self@/: the core
    -> m T.Text
    -- ^ __Returns:__ The version of the PipeWire instance that /@self@/ is connected to
coreGetRemoteVersion self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_core_get_remote_version self'
    checkUnexpectedReturnNULL "coreGetRemoteVersion" result
    result' <- cstringToText result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data CoreGetRemoteVersionMethodInfo
instance (signature ~ (m T.Text), MonadIO m, IsCore a) => O.OverloadedMethod CoreGetRemoteVersionMethodInfo a signature where
    overloadedMethod = coreGetRemoteVersion

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


#endif

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

foreign import ccall "wp_core_get_vm_type" wp_core_get_vm_type :: 
    Ptr Core ->                             -- self : TInterface (Name {namespace = "Wp", name = "Core"})
    IO CString

-- | Gets the virtual machine type of the core.
-- 
-- /Since: 0.4.11/
coreGetVmType ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a) =>
    a
    -- ^ /@self@/: the core
    -> m (Maybe T.Text)
    -- ^ __Returns:__ a comma separated string with all the virtual machine types that this core matches, or NULL if the core is not running in a virtual machine.
coreGetVmType self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_core_get_vm_type self'
    maybeResult <- convertIfNonNull result $ \result' -> do
        result'' <- cstringToText result'
        freeMem result'
        return result''
    touchManagedPtr self
    return maybeResult

#if defined(ENABLE_OVERLOADING)
data CoreGetVmTypeMethodInfo
instance (signature ~ (m (Maybe T.Text)), MonadIO m, IsCore a) => O.OverloadedMethod CoreGetVmTypeMethodInfo a signature where
    overloadedMethod = coreGetVmType

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


#endif

-- method Core::idle_add
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "Core" }
--           , argCType = Just "WpCore*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the core" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "source"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "Source" }
--           , argCType = Just "GSource**"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the source" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "function"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "SourceFunc" }
--           , argCType = Just "GSourceFunc"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the function to call"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeNotified
--           , argClosure = 3
--           , argDestroy = 4
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "data"
--           , argType = TBasicType TPtr
--           , argCType = Just "gpointer"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "data to pass to @function"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "destroy"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DestroyNotify" }
--           , argCType = Just "GDestroyNotify"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a function to destroy @data"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeAsync
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "wp_core_idle_add" wp_core_idle_add :: 
    Ptr Core ->                             -- self : TInterface (Name {namespace = "Wp", name = "Core"})
    Ptr (Ptr GLib.Source.Source) ->         -- source : TInterface (Name {namespace = "GLib", name = "Source"})
    FunPtr GLib.Callbacks.C_SourceFunc ->   -- function : TInterface (Name {namespace = "GLib", name = "SourceFunc"})
    Ptr () ->                               -- data : TBasicType TPtr
    FunPtr GLib.Callbacks.C_DestroyNotify -> -- destroy : TInterface (Name {namespace = "GLib", name = "DestroyNotify"})
    IO ()

-- | Adds an idle callback to be called in the same GMainContext as the one used by this core.
-- 
-- 
-- This is essentially the same as 'GI.GLib.Functions.idleAdd', but it adds the created GSource on the GMainContext used by this core instead of the default context.
coreIdleAdd ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a) =>
    a
    -- ^ /@self@/: the core
    -> GLib.Callbacks.SourceFunc
    -- ^ /@function@/: the function to call
    -> m (GLib.Source.Source)
coreIdleAdd self function = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    source <- callocMem :: IO (Ptr (Ptr GLib.Source.Source))
    function' <- GLib.Callbacks.mk_SourceFunc (GLib.Callbacks.wrap_SourceFunc Nothing (GLib.Callbacks.drop_closures_SourceFunc function))
    let data_ = castFunPtrToPtr function'
    let destroy = SP.safeFreeFunPtrPtr
    wp_core_idle_add self' source function' data_ destroy
    source' <- peek source
    source'' <- (wrapBoxed GLib.Source.Source) source'
    touchManagedPtr self
    freeMem source
    return source''

#if defined(ENABLE_OVERLOADING)
data CoreIdleAddMethodInfo
instance (signature ~ (GLib.Callbacks.SourceFunc -> m (GLib.Source.Source)), MonadIO m, IsCore a) => O.OverloadedMethod CoreIdleAddMethodInfo a signature where
    overloadedMethod = coreIdleAdd

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


#endif

-- method Core::idle_add_closure
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "Core" }
--           , argCType = Just "WpCore*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the core" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "source"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "Source" }
--           , argCType = Just "GSource**"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the source" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "closure"
--           , argType = TGClosure Nothing
--           , argCType = Just "GClosure*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the closure to invoke"
--                 , 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_core_idle_add_closure" wp_core_idle_add_closure :: 
    Ptr Core ->                             -- self : TInterface (Name {namespace = "Wp", name = "Core"})
    Ptr (Ptr GLib.Source.Source) ->         -- source : TInterface (Name {namespace = "GLib", name = "Source"})
    Ptr (GClosure ()) ->                    -- closure : TGClosure Nothing
    IO ()

-- | Adds an idle callback to be called in the same GMainContext as the one used by this core.
-- 
-- 
-- This is the same as 'GI.Wp.Objects.Core.coreIdleAdd', but it allows you to specify a GClosure instead of a C callback.
coreIdleAddClosure ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a) =>
    a
    -- ^ /@self@/: the core
    -> GClosure b
    -- ^ /@closure@/: the closure to invoke
    -> m (GLib.Source.Source)
coreIdleAddClosure self closure = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    source <- callocMem :: IO (Ptr (Ptr GLib.Source.Source))
    closure' <- unsafeManagedPtrCastPtr closure
    wp_core_idle_add_closure self' source closure'
    source' <- peek source
    source'' <- (wrapBoxed GLib.Source.Source) source'
    touchManagedPtr self
    touchManagedPtr closure
    freeMem source
    return source''

#if defined(ENABLE_OVERLOADING)
data CoreIdleAddClosureMethodInfo
instance (signature ~ (GClosure b -> m (GLib.Source.Source)), MonadIO m, IsCore a) => O.OverloadedMethod CoreIdleAddClosureMethodInfo a signature where
    overloadedMethod = coreIdleAddClosure

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


#endif

-- method Core::install_object_manager
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "Core" }
--           , argCType = Just "WpCore*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the core" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "om"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "ObjectManager" }
--           , argCType = Just "WpObjectManager*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a WpObjectManager" , 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_core_install_object_manager" wp_core_install_object_manager :: 
    Ptr Core ->                             -- self : TInterface (Name {namespace = "Wp", name = "Core"})
    Ptr Wp.ObjectManager.ObjectManager ->   -- om : TInterface (Name {namespace = "Wp", name = "ObjectManager"})
    IO ()

-- | Installs the object manager on this core, activating its internal management engine.
-- 
-- 
-- This will immediately emit signals about objects added on /@om@/ if objects that the /@om@/ is interested in were in existence already.
coreInstallObjectManager ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a, Wp.ObjectManager.IsObjectManager b) =>
    a
    -- ^ /@self@/: the core
    -> b
    -- ^ /@om@/: a WpObjectManager
    -> m ()
coreInstallObjectManager self om = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    om' <- unsafeManagedPtrCastPtr om
    wp_core_install_object_manager self' om'
    touchManagedPtr self
    touchManagedPtr om
    return ()

#if defined(ENABLE_OVERLOADING)
data CoreInstallObjectManagerMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsCore a, Wp.ObjectManager.IsObjectManager b) => O.OverloadedMethod CoreInstallObjectManagerMethodInfo a signature where
    overloadedMethod = coreInstallObjectManager

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


#endif

-- method Core::is_connected
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "Core" }
--           , argCType = Just "WpCore*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the core" , 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_core_is_connected" wp_core_is_connected :: 
    Ptr Core ->                             -- self : TInterface (Name {namespace = "Wp", name = "Core"})
    IO CInt

-- | Checks if the core is connected to PipeWire.
coreIsConnected ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a) =>
    a
    -- ^ /@self@/: the core
    -> m Bool
    -- ^ __Returns:__ TRUE if the core is connected to PipeWire, FALSE otherwise
coreIsConnected self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_core_is_connected self'
    let result' = (/= 0) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data CoreIsConnectedMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsCore a) => O.OverloadedMethod CoreIsConnectedMethodInfo a signature where
    overloadedMethod = coreIsConnected

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


#endif

-- method Core::load_component
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "Core" }
--           , argCType = Just "WpCore*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the core" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "component"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the module name or file name"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "type"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the type of the component"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "args"
--           , argType = TInterface Name { namespace = "Wp" , name = "SpaJson" }
--           , argCType = Just "WpSpaJson*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "additional arguments for the component, expected to be a JSON object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "provides"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the name of the feature that this component will provide if it loads successfully; this can be queried later with wp_core_test_feature()"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "optional GCancellable"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "callback"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncReadyCallback" }
--           , argCType = Just "GAsyncReadyCallback"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the callback to call when the operation is done"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeAsync
--           , argClosure = 7
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "data"
--           , argType = TBasicType TPtr
--           , argCType = Just "gpointer"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "data to pass to @callback"
--                 , 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_core_load_component" wp_core_load_component :: 
    Ptr Core ->                             -- self : TInterface (Name {namespace = "Wp", name = "Core"})
    CString ->                              -- component : TBasicType TUTF8
    CString ->                              -- type : TBasicType TUTF8
    Ptr Wp.SpaJson.SpaJson ->               -- args : TInterface (Name {namespace = "Wp", name = "SpaJson"})
    CString ->                              -- provides : TBasicType TUTF8
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
    Ptr () ->                               -- data : TBasicType TPtr
    IO ()

-- | Loads the specified /@component@/ on /@self@/.
-- 
-- 
-- The /@type@/ will determine which component loader to use. The following types are built-in and will always work without a component loader:
-- * \"module\" - Loads a WirePlumber module
-- * \"array\" - Loads multiple components interpreting the /@args@/ as a JSON array with component definitions, as they would appear in the configuration file. When this type is used, /@component@/ is ignored and can be NULL
coreLoadComponent ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: the core
    -> Maybe (T.Text)
    -- ^ /@component@/: the module name or file name
    -> T.Text
    -- ^ /@type@/: the type of the component
    -> Maybe (Wp.SpaJson.SpaJson)
    -- ^ /@args@/: additional arguments for the component, expected to be a JSON object
    -> Maybe (T.Text)
    -- ^ /@provides@/: the name of the feature that this component will provide if it loads successfully; this can be queried later with 'GI.Wp.Objects.Core.coreTestFeature'
    -> Maybe (b)
    -- ^ /@cancellable@/: optional GCancellable
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    -- ^ /@callback@/: the callback to call when the operation is done
    -> m ()
coreLoadComponent self component type_ args provides cancellable callback = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeComponent <- case component of
        Nothing -> return FP.nullPtr
        Just jComponent -> do
            jComponent' <- textToCString jComponent
            return jComponent'
    type_' <- textToCString type_
    maybeArgs <- case args of
        Nothing -> return FP.nullPtr
        Just jArgs -> do
            jArgs' <- unsafeManagedPtrGetPtr jArgs
            return jArgs'
    maybeProvides <- case provides of
        Nothing -> return FP.nullPtr
        Just jProvides -> do
            jProvides' <- textToCString jProvides
            return jProvides'
    maybeCancellable <- case cancellable of
        Nothing -> return FP.nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    maybeCallback <- case callback of
        Nothing -> return FP.nullFunPtr
        Just jCallback -> do
            ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
            jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
            poke ptrcallback jCallback'
            return jCallback'
    let data_ = nullPtr
    wp_core_load_component self' maybeComponent type_' maybeArgs maybeProvides maybeCancellable maybeCallback data_
    touchManagedPtr self
    whenJust args touchManagedPtr
    whenJust cancellable touchManagedPtr
    freeMem maybeComponent
    freeMem type_'
    freeMem maybeProvides
    return ()

#if defined(ENABLE_OVERLOADING)
data CoreLoadComponentMethodInfo
instance (signature ~ (Maybe (T.Text) -> T.Text -> Maybe (Wp.SpaJson.SpaJson) -> Maybe (T.Text) -> Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsCore a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod CoreLoadComponentMethodInfo a signature where
    overloadedMethod = coreLoadComponent

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


#endif

-- method Core::load_component_finish
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "Core" }
--           , argCType = Just "WpCore*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the component loader object"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "res"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncResult" }
--           , argCType = Just "GAsyncResult*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the async result" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "wp_core_load_component_finish" wp_core_load_component_finish :: 
    Ptr Core ->                             -- self : TInterface (Name {namespace = "Wp", name = "Core"})
    Ptr Gio.AsyncResult.AsyncResult ->      -- res : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Finishes the operation started by 'GI.Wp.Objects.Core.coreLoadComponent'. This is meant to be called in the callback that was passed to that method.
coreLoadComponentFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    -- ^ /@self@/: the component loader object
    -> b
    -- ^ /@res@/: the async result
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
coreLoadComponentFinish self res = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    res' <- unsafeManagedPtrCastPtr res
    onException (do
        _ <- propagateGError $ wp_core_load_component_finish self' res'
        touchManagedPtr self
        touchManagedPtr res
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data CoreLoadComponentFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsCore a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod CoreLoadComponentFinishMethodInfo a signature where
    overloadedMethod = coreLoadComponentFinish

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


#endif

-- method Core::register_object
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "Core" }
--           , argCType = Just "WpCore*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the core" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "obj"
--           , argType =
--               TInterface Name { namespace = "GObject" , name = "Object" }
--           , argCType = Just "gpointer"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the object to register"
--                 , 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_core_register_object" wp_core_register_object :: 
    Ptr Core ->                             -- self : TInterface (Name {namespace = "Wp", name = "Core"})
    Ptr GObject.Object.Object ->            -- obj : TInterface (Name {namespace = "GObject", name = "Object"})
    IO ()

-- | Registers /@obj@/ with the core, making it appear on WpObjectManager instances as well.
-- 
-- 
-- The core will also maintain a ref to that object until it is removed.
coreRegisterObject ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a, GObject.Object.IsObject b) =>
    a
    -- ^ /@self@/: the core
    -> b
    -- ^ /@obj@/: the object to register
    -> m ()
coreRegisterObject self obj = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    obj' <- B.ManagedPtr.disownObject obj
    wp_core_register_object self' obj'
    touchManagedPtr self
    touchManagedPtr obj
    return ()

#if defined(ENABLE_OVERLOADING)
data CoreRegisterObjectMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsCore a, GObject.Object.IsObject b) => O.OverloadedMethod CoreRegisterObjectMethodInfo a signature where
    overloadedMethod = coreRegisterObject

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


#endif

-- method Core::remove_object
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "Core" }
--           , argCType = Just "WpCore*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the core" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "obj"
--           , argType =
--               TInterface Name { namespace = "GObject" , name = "Object" }
--           , argCType = Just "gpointer"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a pointer to the object to remove"
--                 , 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_core_remove_object" wp_core_remove_object :: 
    Ptr Core ->                             -- self : TInterface (Name {namespace = "Wp", name = "Core"})
    Ptr GObject.Object.Object ->            -- obj : TInterface (Name {namespace = "GObject", name = "Object"})
    IO ()

-- | Detaches and unrefs the specified object from this core.
coreRemoveObject ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a, GObject.Object.IsObject b) =>
    a
    -- ^ /@self@/: the core
    -> b
    -- ^ /@obj@/: a pointer to the object to remove
    -> m ()
coreRemoveObject self obj = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    obj' <- unsafeManagedPtrCastPtr obj
    wp_core_remove_object self' obj'
    touchManagedPtr self
    touchManagedPtr obj
    return ()

#if defined(ENABLE_OVERLOADING)
data CoreRemoveObjectMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsCore a, GObject.Object.IsObject b) => O.OverloadedMethod CoreRemoveObjectMethodInfo a signature where
    overloadedMethod = coreRemoveObject

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


#endif

-- method Core::sync
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "Core" }
--           , argCType = Just "WpCore*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the core" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a GCancellable to cancel the operation"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "callback"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncReadyCallback" }
--           , argCType = Just "GAsyncReadyCallback"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a function to call when the operation is done"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeAsync
--           , argClosure = 3
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , argCType = Just "gpointer"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "data to pass to @callback"
--                 , 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_core_sync" wp_core_sync :: 
    Ptr Core ->                             -- self : TInterface (Name {namespace = "Wp", name = "Core"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO CInt

-- | Asks the PipeWire server to call the /@callback@/ via an event.
-- 
-- 
-- Since methods are handled in-order and events are delivered in-order, this can be used as a barrier to ensure all previous methods and the resulting events have been handled.
-- In both success and error cases, /@callback@/ is always called. Use 'GI.Wp.Objects.Core.coreSyncFinish' from within the /@callback@/ to determine whether the operation completed successfully or if an error occurred.
coreSync ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: the core
    -> Maybe (b)
    -- ^ /@cancellable@/: a GCancellable to cancel the operation
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    -- ^ /@callback@/: a function to call when the operation is done
    -> m Bool
    -- ^ __Returns:__ TRUE if the sync operation was started, FALSE if an error occurred before returning from this function
coreSync self cancellable callback = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeCancellable <- case cancellable of
        Nothing -> return FP.nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    maybeCallback <- case callback of
        Nothing -> return FP.nullFunPtr
        Just jCallback -> do
            ptrcallback <- callocMem :: IO (Ptr (FunPtr Gio.Callbacks.C_AsyncReadyCallback))
            jCallback' <- Gio.Callbacks.mk_AsyncReadyCallback (Gio.Callbacks.wrap_AsyncReadyCallback (Just ptrcallback) (Gio.Callbacks.drop_closures_AsyncReadyCallback jCallback))
            poke ptrcallback jCallback'
            return jCallback'
    let userData = nullPtr
    result <- wp_core_sync self' maybeCancellable maybeCallback userData
    let result' = (/= 0) result
    touchManagedPtr self
    whenJust cancellable touchManagedPtr
    return result'

#if defined(ENABLE_OVERLOADING)
data CoreSyncMethodInfo
instance (signature ~ (Maybe (b) -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m Bool), MonadIO m, IsCore a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod CoreSyncMethodInfo a signature where
    overloadedMethod = coreSync

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


#endif

-- method Core::sync_closure
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "Core" }
--           , argCType = Just "WpCore*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the core" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "cancellable"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "Cancellable" }
--           , argCType = Just "GCancellable*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a GCancellable to cancel the operation"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "closure"
--           , argType = TGClosure Nothing
--           , argCType = Just "GClosure*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "a closure to invoke when the operation is done"
--                 , 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_core_sync_closure" wp_core_sync_closure :: 
    Ptr Core ->                             -- self : TInterface (Name {namespace = "Wp", name = "Core"})
    Ptr Gio.Cancellable.Cancellable ->      -- cancellable : TInterface (Name {namespace = "Gio", name = "Cancellable"})
    Ptr (GClosure ()) ->                    -- closure : TGClosure Nothing
    IO CInt

-- | Asks the PipeWire server to invoke the /@closure@/ via an event.
-- 
-- 
-- Since methods are handled in-order and events are delivered in-order, this can be used as a barrier to ensure all previous methods and the resulting events have been handled.
-- In both success and error cases, /@closure@/ is always invoked. Use 'GI.Wp.Objects.Core.coreSyncFinish' from within the /@closure@/ to determine whether the operation completed successfully or if an error occurred.
-- 
-- /Since: 0.4.6/
coreSyncClosure ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a, Gio.Cancellable.IsCancellable b) =>
    a
    -- ^ /@self@/: the core
    -> Maybe (b)
    -- ^ /@cancellable@/: a GCancellable to cancel the operation
    -> GClosure c
    -- ^ /@closure@/: a closure to invoke when the operation is done
    -> m Bool
    -- ^ __Returns:__ TRUE if the sync operation was started, FALSE if an error occurred before returning from this function
coreSyncClosure self cancellable closure = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    maybeCancellable <- case cancellable of
        Nothing -> return FP.nullPtr
        Just jCancellable -> do
            jCancellable' <- unsafeManagedPtrCastPtr jCancellable
            return jCancellable'
    closure' <- unsafeManagedPtrCastPtr closure
    result <- wp_core_sync_closure self' maybeCancellable closure'
    let result' = (/= 0) result
    touchManagedPtr self
    whenJust cancellable touchManagedPtr
    touchManagedPtr closure
    return result'

#if defined(ENABLE_OVERLOADING)
data CoreSyncClosureMethodInfo
instance (signature ~ (Maybe (b) -> GClosure c -> m Bool), MonadIO m, IsCore a, Gio.Cancellable.IsCancellable b) => O.OverloadedMethod CoreSyncClosureMethodInfo a signature where
    overloadedMethod = coreSyncClosure

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


#endif

-- method Core::sync_finish
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "Core" }
--           , argCType = Just "WpCore*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the core" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "res"
--           , argType =
--               TInterface Name { namespace = "Gio" , name = "AsyncResult" }
--           , argCType = Just "GAsyncResult*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a GAsyncResult" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : True
-- Skip return : False

foreign import ccall "wp_core_sync_finish" wp_core_sync_finish :: 
    Ptr Core ->                             -- self : TInterface (Name {namespace = "Wp", name = "Core"})
    Ptr Gio.AsyncResult.AsyncResult ->      -- res : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | This function is meant to be called from within the callback of 'GI.Wp.Objects.Core.coreSync' in order to determine the success or failure of the operation.
coreSyncFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    -- ^ /@self@/: the core
    -> b
    -- ^ /@res@/: a GAsyncResult
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
coreSyncFinish self res = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    res' <- unsafeManagedPtrCastPtr res
    onException (do
        _ <- propagateGError $ wp_core_sync_finish self' res'
        touchManagedPtr self
        touchManagedPtr res
        return ()
     ) (do
        return ()
     )

#if defined(ENABLE_OVERLOADING)
data CoreSyncFinishMethodInfo
instance (signature ~ (b -> m ()), MonadIO m, IsCore a, Gio.AsyncResult.IsAsyncResult b) => O.OverloadedMethod CoreSyncFinishMethodInfo a signature where
    overloadedMethod = coreSyncFinish

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


#endif

-- method Core::test_feature
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "Core" }
--           , argCType = Just "WpCore*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the core" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "feature"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the feature name" , 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_core_test_feature" wp_core_test_feature :: 
    Ptr Core ->                             -- self : TInterface (Name {namespace = "Wp", name = "Core"})
    CString ->                              -- feature : TBasicType TUTF8
    IO CInt

-- | Test if a global feature is provided.
coreTestFeature ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a) =>
    a
    -- ^ /@self@/: the core
    -> T.Text
    -- ^ /@feature@/: the feature name
    -> m Bool
    -- ^ __Returns:__ TRUE if the feature is provided, FALSE otherwise
coreTestFeature self feature = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    feature' <- textToCString feature
    result <- wp_core_test_feature self' feature'
    let result' = (/= 0) result
    touchManagedPtr self
    freeMem feature'
    return result'

#if defined(ENABLE_OVERLOADING)
data CoreTestFeatureMethodInfo
instance (signature ~ (T.Text -> m Bool), MonadIO m, IsCore a) => O.OverloadedMethod CoreTestFeatureMethodInfo a signature where
    overloadedMethod = coreTestFeature

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


#endif

-- method Core::timeout_add
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "Core" }
--           , argCType = Just "WpCore*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the core" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "source"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "Source" }
--           , argCType = Just "GSource**"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the source" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "timeout_ms"
--           , argType = TBasicType TUInt
--           , argCType = Just "guint"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the timeout in milliseconds"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "function"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "SourceFunc" }
--           , argCType = Just "GSourceFunc"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the function to call"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeNotified
--           , argClosure = 4
--           , argDestroy = 5
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "data"
--           , argType = TBasicType TPtr
--           , argCType = Just "gpointer"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "data to pass to @function"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "destroy"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "DestroyNotify" }
--           , argCType = Just "GDestroyNotify"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a function to destroy @data"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeAsync
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "wp_core_timeout_add" wp_core_timeout_add :: 
    Ptr Core ->                             -- self : TInterface (Name {namespace = "Wp", name = "Core"})
    Ptr (Ptr GLib.Source.Source) ->         -- source : TInterface (Name {namespace = "GLib", name = "Source"})
    Word32 ->                               -- timeout_ms : TBasicType TUInt
    FunPtr GLib.Callbacks.C_SourceFunc ->   -- function : TInterface (Name {namespace = "GLib", name = "SourceFunc"})
    Ptr () ->                               -- data : TBasicType TPtr
    FunPtr GLib.Callbacks.C_DestroyNotify -> -- destroy : TInterface (Name {namespace = "GLib", name = "DestroyNotify"})
    IO ()

-- | Adds a timeout callback to be called at regular intervals in the same GMainContext as the one used by this core.
-- 
-- 
-- The function is called repeatedly until it returns FALSE, at which point the timeout is automatically destroyed and the function will not be called again. The first call to the function will be at the end of the first interval.
-- This is essentially the same as 'GI.GLib.Functions.timeoutAdd', but it adds the created GSource on the GMainContext used by this core instead of the default context.
coreTimeoutAdd ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a) =>
    a
    -- ^ /@self@/: the core
    -> Word32
    -- ^ /@timeoutMs@/: the timeout in milliseconds
    -> GLib.Callbacks.SourceFunc
    -- ^ /@function@/: the function to call
    -> m (GLib.Source.Source)
coreTimeoutAdd self timeoutMs function = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    source <- callocMem :: IO (Ptr (Ptr GLib.Source.Source))
    function' <- GLib.Callbacks.mk_SourceFunc (GLib.Callbacks.wrap_SourceFunc Nothing (GLib.Callbacks.drop_closures_SourceFunc function))
    let data_ = castFunPtrToPtr function'
    let destroy = SP.safeFreeFunPtrPtr
    wp_core_timeout_add self' source timeoutMs function' data_ destroy
    source' <- peek source
    source'' <- (wrapBoxed GLib.Source.Source) source'
    touchManagedPtr self
    freeMem source
    return source''

#if defined(ENABLE_OVERLOADING)
data CoreTimeoutAddMethodInfo
instance (signature ~ (Word32 -> GLib.Callbacks.SourceFunc -> m (GLib.Source.Source)), MonadIO m, IsCore a) => O.OverloadedMethod CoreTimeoutAddMethodInfo a signature where
    overloadedMethod = coreTimeoutAdd

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


#endif

-- method Core::timeout_add_closure
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "Core" }
--           , argCType = Just "WpCore*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the core" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "source"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "Source" }
--           , argCType = Just "GSource**"
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the source" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       , Arg
--           { argCName = "timeout_ms"
--           , argType = TBasicType TUInt
--           , argCType = Just "guint"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the timeout in milliseconds"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "closure"
--           , argType = TGClosure Nothing
--           , argCType = Just "GClosure*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the closure to invoke"
--                 , 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_core_timeout_add_closure" wp_core_timeout_add_closure :: 
    Ptr Core ->                             -- self : TInterface (Name {namespace = "Wp", name = "Core"})
    Ptr (Ptr GLib.Source.Source) ->         -- source : TInterface (Name {namespace = "GLib", name = "Source"})
    Word32 ->                               -- timeout_ms : TBasicType TUInt
    Ptr (GClosure ()) ->                    -- closure : TGClosure Nothing
    IO ()

-- | Adds a timeout callback to be called at regular intervals in the same GMainContext as the one used by this core.
-- 
-- 
-- This is the same as 'GI.Wp.Objects.Core.coreTimeoutAdd', but it allows you to specify a GClosure instead of a C callback.
coreTimeoutAddClosure ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a) =>
    a
    -- ^ /@self@/: the core
    -> Word32
    -- ^ /@timeoutMs@/: the timeout in milliseconds
    -> GClosure b
    -- ^ /@closure@/: the closure to invoke
    -> m (GLib.Source.Source)
coreTimeoutAddClosure self timeoutMs closure = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    source <- callocMem :: IO (Ptr (Ptr GLib.Source.Source))
    closure' <- unsafeManagedPtrCastPtr closure
    wp_core_timeout_add_closure self' source timeoutMs closure'
    source' <- peek source
    source'' <- (wrapBoxed GLib.Source.Source) source'
    touchManagedPtr self
    touchManagedPtr closure
    freeMem source
    return source''

#if defined(ENABLE_OVERLOADING)
data CoreTimeoutAddClosureMethodInfo
instance (signature ~ (Word32 -> GClosure b -> m (GLib.Source.Source)), MonadIO m, IsCore a) => O.OverloadedMethod CoreTimeoutAddClosureMethodInfo a signature where
    overloadedMethod = coreTimeoutAddClosure

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


#endif

-- method Core::update_properties
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType = TInterface Name { namespace = "Wp" , name = "Core" }
--           , argCType = Just "WpCore*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the core" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "updates"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "Properties" }
--           , argCType = Just "WpProperties*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "updates to apply to the properties of @self; this does not need to include properties that have not changed"
--                 , 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_core_update_properties" wp_core_update_properties :: 
    Ptr Core ->                             -- self : TInterface (Name {namespace = "Wp", name = "Core"})
    Ptr Wp.Properties.Properties ->         -- updates : TInterface (Name {namespace = "Wp", name = "Properties"})
    IO ()

-- | Updates the properties of /@self@/ on the connection, making them appear on the client object that represents this connection.
-- 
-- 
-- If /@self@/ is not connected yet, these properties are stored and passed to @/pw_context_connect()/@ when connecting.
coreUpdateProperties ::
    (B.CallStack.HasCallStack, MonadIO m, IsCore a) =>
    a
    -- ^ /@self@/: the core
    -> Wp.Properties.Properties
    -- ^ /@updates@/: updates to apply to the properties of /@self@/; this does not need to include properties that have not changed
    -> m ()
coreUpdateProperties self updates = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    updates' <- B.ManagedPtr.disownBoxed updates
    wp_core_update_properties self' updates'
    touchManagedPtr self
    touchManagedPtr updates
    return ()

#if defined(ENABLE_OVERLOADING)
data CoreUpdatePropertiesMethodInfo
instance (signature ~ (Wp.Properties.Properties -> m ()), MonadIO m, IsCore a) => O.OverloadedMethod CoreUpdatePropertiesMethodInfo a signature where
    overloadedMethod = coreUpdateProperties

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


#endif


