{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- This interface provides a way to request an item for linking before doing so. This allows item implementations to apply internal policy rules.
-- A WpSiAcquisition is associated directly with a WpSiLinkable via 'GI.Wp.Interfaces.SiLinkable.siLinkableGetAcquisition'. In order to allow switching policies, it is recommended that port info implementations use a separate session item to implement this interface and allow replacing it.

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

module GI.Wp.Interfaces.SiAcquisition
    ( 

-- * Exported types
    SiAcquisition(..)                       ,
    IsSiAcquisition                         ,
    toSiAcquisition                         ,


 -- * Methods
-- | 
-- 
--  === __Click to display all available methods, including inherited ones__
-- ==== Methods
-- [abortActivation]("GI.Wp.Objects.Object#g:method:abortActivation"), [acquire]("GI.Wp.Interfaces.SiAcquisition#g:method:acquire"), [acquireFinish]("GI.Wp.Interfaces.SiAcquisition#g:method:acquireFinish"), [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"), [configure]("GI.Wp.Objects.SessionItem#g:method:configure"), [deactivate]("GI.Wp.Objects.Object#g:method:deactivate"), [forceFloating]("GI.GObject.Objects.Object#g:method:forceFloating"), [freezeNotify]("GI.GObject.Objects.Object#g:method:freezeNotify"), [getv]("GI.GObject.Objects.Object#g:method:getv"), [isConfigured]("GI.Wp.Objects.SessionItem#g:method:isConfigured"), [isFloating]("GI.GObject.Objects.Object#g:method:isFloating"), [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"), [register]("GI.Wp.Objects.SessionItem#g:method:register"), [release]("GI.Wp.Interfaces.SiAcquisition#g:method:release"), [remove]("GI.Wp.Objects.SessionItem#g:method:remove"), [reset]("GI.Wp.Objects.SessionItem#g:method:reset"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [stealData]("GI.GObject.Objects.Object#g:method:stealData"), [stealQdata]("GI.GObject.Objects.Object#g:method:stealQdata"), [testActiveFeatures]("GI.Wp.Objects.Object#g:method:testActiveFeatures"), [testSupportedFeatures]("GI.Wp.Objects.Object#g:method:testSupportedFeatures"), [thawNotify]("GI.GObject.Objects.Object#g:method:thawNotify"), [unref]("GI.GObject.Objects.Object#g:method:unref"), [updateFeatures]("GI.Wp.Objects.Object#g:method:updateFeatures"), [watchClosure]("GI.GObject.Objects.Object#g:method:watchClosure").
-- 
-- ==== Getters
-- [getActiveFeatures]("GI.Wp.Objects.Object#g:method:getActiveFeatures"), [getAssociatedProxy]("GI.Wp.Objects.SessionItem#g:method:getAssociatedProxy"), [getAssociatedProxyId]("GI.Wp.Objects.SessionItem#g:method:getAssociatedProxyId"), [getCore]("GI.Wp.Objects.Object#g:method:getCore"), [getData]("GI.GObject.Objects.Object#g:method:getData"), [getId]("GI.Wp.Objects.Object#g:method:getId"), [getProperties]("GI.Wp.Objects.SessionItem#g:method:getProperties"), [getProperty]("GI.Wp.Objects.SessionItem#g:method:getProperty"), [getQdata]("GI.GObject.Objects.Object#g:method:getQdata"), [getSupportedFeatures]("GI.Wp.Objects.Object#g:method:getSupportedFeatures").
-- 
-- ==== Setters
-- [setData]("GI.GObject.Objects.Object#g:method:setData"), [setDataFull]("GI.GObject.Objects.Object#g:method:setDataFull"), [setProperties]("GI.Wp.Objects.SessionItem#g:method:setProperties"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty").

#if defined(ENABLE_OVERLOADING)
    ResolveSiAcquisitionMethod              ,
#endif

-- ** acquire #method:acquire#

#if defined(ENABLE_OVERLOADING)
    SiAcquisitionAcquireMethodInfo          ,
#endif
    siAcquisitionAcquire                    ,


-- ** acquireFinish #method:acquireFinish#

#if defined(ENABLE_OVERLOADING)
    SiAcquisitionAcquireFinishMethodInfo    ,
#endif
    siAcquisitionAcquireFinish              ,


-- ** release #method:release#

#if defined(ENABLE_OVERLOADING)
    SiAcquisitionReleaseMethodInfo          ,
#endif
    siAcquisitionRelease                    ,




    ) 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.Interfaces.SiLink as Wp.SiLink
import {-# SOURCE #-} qualified GI.Wp.Interfaces.SiLinkable as Wp.SiLinkable
import {-# SOURCE #-} qualified GI.Wp.Objects.Conf as Wp.Conf
import {-# SOURCE #-} qualified GI.Wp.Objects.Core as Wp.Core
import {-# SOURCE #-} qualified GI.Wp.Objects.Object as Wp.Object
import {-# SOURCE #-} qualified GI.Wp.Objects.ObjectManager as Wp.ObjectManager
import {-# SOURCE #-} qualified GI.Wp.Objects.Proxy as Wp.Proxy
import {-# SOURCE #-} qualified GI.Wp.Objects.SessionItem as Wp.SessionItem
import {-# SOURCE #-} qualified GI.Wp.Structs.Iterator as Wp.Iterator
import {-# SOURCE #-} qualified GI.Wp.Structs.IteratorMethods as Wp.IteratorMethods
import {-# SOURCE #-} qualified GI.Wp.Structs.ObjectInterest as Wp.ObjectInterest
import {-# SOURCE #-} qualified GI.Wp.Structs.Properties as Wp.Properties
import {-# SOURCE #-} qualified GI.Wp.Structs.SpaJson as Wp.SpaJson

#else
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.Gio.Callbacks as Gio.Callbacks
import qualified GI.Gio.Interfaces.AsyncResult as Gio.AsyncResult
import {-# SOURCE #-} qualified GI.Wp.Interfaces.SiLink as Wp.SiLink
import {-# SOURCE #-} qualified GI.Wp.Interfaces.SiLinkable as Wp.SiLinkable
import {-# SOURCE #-} qualified GI.Wp.Objects.Object as Wp.Object
import {-# SOURCE #-} qualified GI.Wp.Objects.SessionItem as Wp.SessionItem

#endif

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

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

foreign import ccall "wp_si_acquisition_get_type"
    c_wp_si_acquisition_get_type :: IO B.Types.GType

instance B.Types.TypedObject SiAcquisition where
    glibType = c_wp_si_acquisition_get_type

instance B.Types.GObject SiAcquisition

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

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

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

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

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList SiAcquisition
type instance O.AttributeList SiAcquisition = SiAcquisitionAttributeList
type SiAcquisitionAttributeList = ('[ '("activeFeatures", Wp.Object.ObjectActiveFeaturesPropertyInfo), '("core", Wp.Object.ObjectCorePropertyInfo), '("id", Wp.Object.ObjectIdPropertyInfo), '("properties", Wp.SessionItem.SessionItemPropertiesPropertyInfo), '("supportedFeatures", Wp.Object.ObjectSupportedFeaturesPropertyInfo)] :: [(Symbol, DK.Type)])
#endif

#if defined(ENABLE_OVERLOADING)
#endif

#if defined(ENABLE_OVERLOADING)
type family ResolveSiAcquisitionMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolveSiAcquisitionMethod "abortActivation" o = Wp.Object.ObjectAbortActivationMethodInfo
    ResolveSiAcquisitionMethod "acquire" o = SiAcquisitionAcquireMethodInfo
    ResolveSiAcquisitionMethod "acquireFinish" o = SiAcquisitionAcquireFinishMethodInfo
    ResolveSiAcquisitionMethod "activate" o = Wp.Object.ObjectActivateMethodInfo
    ResolveSiAcquisitionMethod "activateClosure" o = Wp.Object.ObjectActivateClosureMethodInfo
    ResolveSiAcquisitionMethod "activateFinish" o = Wp.Object.ObjectActivateFinishMethodInfo
    ResolveSiAcquisitionMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveSiAcquisitionMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveSiAcquisitionMethod "configure" o = Wp.SessionItem.SessionItemConfigureMethodInfo
    ResolveSiAcquisitionMethod "deactivate" o = Wp.Object.ObjectDeactivateMethodInfo
    ResolveSiAcquisitionMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveSiAcquisitionMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveSiAcquisitionMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveSiAcquisitionMethod "isConfigured" o = Wp.SessionItem.SessionItemIsConfiguredMethodInfo
    ResolveSiAcquisitionMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveSiAcquisitionMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveSiAcquisitionMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveSiAcquisitionMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveSiAcquisitionMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveSiAcquisitionMethod "register" o = Wp.SessionItem.SessionItemRegisterMethodInfo
    ResolveSiAcquisitionMethod "release" o = SiAcquisitionReleaseMethodInfo
    ResolveSiAcquisitionMethod "remove" o = Wp.SessionItem.SessionItemRemoveMethodInfo
    ResolveSiAcquisitionMethod "reset" o = Wp.SessionItem.SessionItemResetMethodInfo
    ResolveSiAcquisitionMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveSiAcquisitionMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveSiAcquisitionMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveSiAcquisitionMethod "testActiveFeatures" o = Wp.Object.ObjectTestActiveFeaturesMethodInfo
    ResolveSiAcquisitionMethod "testSupportedFeatures" o = Wp.Object.ObjectTestSupportedFeaturesMethodInfo
    ResolveSiAcquisitionMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveSiAcquisitionMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveSiAcquisitionMethod "updateFeatures" o = Wp.Object.ObjectUpdateFeaturesMethodInfo
    ResolveSiAcquisitionMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveSiAcquisitionMethod "getActiveFeatures" o = Wp.Object.ObjectGetActiveFeaturesMethodInfo
    ResolveSiAcquisitionMethod "getAssociatedProxy" o = Wp.SessionItem.SessionItemGetAssociatedProxyMethodInfo
    ResolveSiAcquisitionMethod "getAssociatedProxyId" o = Wp.SessionItem.SessionItemGetAssociatedProxyIdMethodInfo
    ResolveSiAcquisitionMethod "getCore" o = Wp.Object.ObjectGetCoreMethodInfo
    ResolveSiAcquisitionMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveSiAcquisitionMethod "getId" o = Wp.Object.ObjectGetIdMethodInfo
    ResolveSiAcquisitionMethod "getProperties" o = Wp.SessionItem.SessionItemGetPropertiesMethodInfo
    ResolveSiAcquisitionMethod "getProperty" o = Wp.SessionItem.SessionItemGetPropertyMethodInfo
    ResolveSiAcquisitionMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveSiAcquisitionMethod "getSupportedFeatures" o = Wp.Object.ObjectGetSupportedFeaturesMethodInfo
    ResolveSiAcquisitionMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveSiAcquisitionMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveSiAcquisitionMethod "setProperties" o = Wp.SessionItem.SessionItemSetPropertiesMethodInfo
    ResolveSiAcquisitionMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveSiAcquisitionMethod l o = O.MethodResolutionFailed l o

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

#endif

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

#endif

-- method SiAcquisition::acquire
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "SiAcquisition" }
--           , argCType = Just "WpSiAcquisition*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the session item" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "acquisitor"
--           , argType = TInterface Name { namespace = "Wp" , name = "SiLink" }
--           , argCType = Just "WpSiLink*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the link that is trying to acquire a port info item"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "item"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "SiLinkable" }
--           , argCType = Just "WpSiLinkable*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the item that is being acquired"
--                 , 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 = 4
--           , 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 "user data for @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_si_acquisition_acquire" wp_si_acquisition_acquire :: 
    Ptr SiAcquisition ->                    -- self : TInterface (Name {namespace = "Wp", name = "SiAcquisition"})
    Ptr Wp.SiLink.SiLink ->                 -- acquisitor : TInterface (Name {namespace = "Wp", name = "SiLink"})
    Ptr Wp.SiLinkable.SiLinkable ->         -- item : TInterface (Name {namespace = "Wp", name = "SiLinkable"})
    FunPtr Gio.Callbacks.C_AsyncReadyCallback -> -- callback : TInterface (Name {namespace = "Gio", name = "AsyncReadyCallback"})
    Ptr () ->                               -- data : TBasicType TPtr
    IO ()

-- | Acquires the /@item@/ for linking by /@acquisitor@/.
-- 
-- 
-- When a link is not allowed by policy, this operation should return an error.
-- When a link needs to be delayed for a short amount of time (ex. to apply a fade out effect on another item), this operation should finish with a delay. It is safe to assume that after this operation completes, the item will be linked immediately.
siAcquisitionAcquire ::
    (B.CallStack.HasCallStack, MonadIO m, IsSiAcquisition a, Wp.SiLink.IsSiLink b, Wp.SiLinkable.IsSiLinkable c) =>
    a
    -- ^ /@self@/: the session item
    -> b
    -- ^ /@acquisitor@/: the link that is trying to acquire a port info item
    -> c
    -- ^ /@item@/: the item that is being acquired
    -> Maybe (Gio.Callbacks.AsyncReadyCallback)
    -- ^ /@callback@/: the callback to call when the operation is done
    -> m ()
siAcquisitionAcquire self acquisitor item callback = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    acquisitor' <- unsafeManagedPtrCastPtr acquisitor
    item' <- unsafeManagedPtrCastPtr item
    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_si_acquisition_acquire self' acquisitor' item' maybeCallback data_
    touchManagedPtr self
    touchManagedPtr acquisitor
    touchManagedPtr item
    return ()

#if defined(ENABLE_OVERLOADING)
data SiAcquisitionAcquireMethodInfo
instance (signature ~ (b -> c -> Maybe (Gio.Callbacks.AsyncReadyCallback) -> m ()), MonadIO m, IsSiAcquisition a, Wp.SiLink.IsSiLink b, Wp.SiLinkable.IsSiLinkable c) => O.OverloadedMethod SiAcquisitionAcquireMethodInfo a signature where
    overloadedMethod = siAcquisitionAcquire

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


#endif

-- method SiAcquisition::acquire_finish
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "SiAcquisition" }
--           , argCType = Just "WpSiAcquisition*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the session item" , 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_si_acquisition_acquire_finish" wp_si_acquisition_acquire_finish :: 
    Ptr SiAcquisition ->                    -- self : TInterface (Name {namespace = "Wp", name = "SiAcquisition"})
    Ptr Gio.AsyncResult.AsyncResult ->      -- res : TInterface (Name {namespace = "Gio", name = "AsyncResult"})
    Ptr (Ptr GError) ->                     -- error
    IO CInt

-- | Finishes the operation started by 'GI.Wp.Interfaces.SiAcquisition.siAcquisitionAcquire'. This is meant to be called in the callback that was passed to that method.
siAcquisitionAcquireFinish ::
    (B.CallStack.HasCallStack, MonadIO m, IsSiAcquisition a, Gio.AsyncResult.IsAsyncResult b) =>
    a
    -- ^ /@self@/: the session item
    -> b
    -- ^ /@res@/: the async result
    -> m ()
    -- ^ /(Can throw 'Data.GI.Base.GError.GError')/
siAcquisitionAcquireFinish self res = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    res' <- unsafeManagedPtrCastPtr res
    onException (do
        _ <- propagateGError $ wp_si_acquisition_acquire_finish self' res'
        touchManagedPtr self
        touchManagedPtr res
        return ()
     ) (do
        return ()
     )

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

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


#endif

-- method SiAcquisition::release
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "SiAcquisition" }
--           , argCType = Just "WpSiAcquisition*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the session item" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "acquisitor"
--           , argType = TInterface Name { namespace = "Wp" , name = "SiLink" }
--           , argCType = Just "WpSiLink*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just "the link that had previously acquired the item"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "item"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "SiLinkable" }
--           , argCType = Just "WpSiLinkable*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the port info that is being released"
--                 , 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_si_acquisition_release" wp_si_acquisition_release :: 
    Ptr SiAcquisition ->                    -- self : TInterface (Name {namespace = "Wp", name = "SiAcquisition"})
    Ptr Wp.SiLink.SiLink ->                 -- acquisitor : TInterface (Name {namespace = "Wp", name = "SiLink"})
    Ptr Wp.SiLinkable.SiLinkable ->         -- item : TInterface (Name {namespace = "Wp", name = "SiLinkable"})
    IO ()

-- | Releases the /@item@/, which means that it is being unlinked.
siAcquisitionRelease ::
    (B.CallStack.HasCallStack, MonadIO m, IsSiAcquisition a, Wp.SiLink.IsSiLink b, Wp.SiLinkable.IsSiLinkable c) =>
    a
    -- ^ /@self@/: the session item
    -> b
    -- ^ /@acquisitor@/: the link that had previously acquired the item
    -> c
    -- ^ /@item@/: the port info that is being released
    -> m ()
siAcquisitionRelease self acquisitor item = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    acquisitor' <- unsafeManagedPtrCastPtr acquisitor
    item' <- unsafeManagedPtrCastPtr item
    wp_si_acquisition_release self' acquisitor' item'
    touchManagedPtr self
    touchManagedPtr acquisitor
    touchManagedPtr item
    return ()

#if defined(ENABLE_OVERLOADING)
data SiAcquisitionReleaseMethodInfo
instance (signature ~ (b -> c -> m ()), MonadIO m, IsSiAcquisition a, Wp.SiLink.IsSiLink b, Wp.SiLinkable.IsSiLinkable c) => O.OverloadedMethod SiAcquisitionReleaseMethodInfo a signature where
    overloadedMethod = siAcquisitionRelease

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


#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList SiAcquisition = SiAcquisitionSignalList
type SiAcquisitionSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])

#endif


