{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- A proxy that represents a PipeWire global object, i.e. an object that is made available through the PipeWire registry.

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

module GI.Wp.Objects.GlobalProxy
    ( 

-- * Exported types
    GlobalProxy(..)                         ,
    IsGlobalProxy                           ,
    toGlobalProxy                           ,


 -- * 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"), [bind]("GI.Wp.Objects.GlobalProxy#g:method:bind"), [bindProperty]("GI.GObject.Objects.Object#g:method:bindProperty"), [bindPropertyFull]("GI.GObject.Objects.Object#g:method:bindPropertyFull"), [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"), [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"), [requestDestroy]("GI.Wp.Objects.GlobalProxy#g:method:requestDestroy"), [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"), [getBoundId]("GI.Wp.Objects.Proxy#g:method:getBoundId"), [getCore]("GI.Wp.Objects.Object#g:method:getCore"), [getData]("GI.GObject.Objects.Object#g:method:getData"), [getGlobalProperties]("GI.Wp.Objects.GlobalProxy#g:method:getGlobalProperties"), [getId]("GI.Wp.Objects.Object#g:method:getId"), [getInterfaceType]("GI.Wp.Objects.Proxy#g:method:getInterfaceType"), [getPermissions]("GI.Wp.Objects.GlobalProxy#g:method:getPermissions"), [getProperty]("GI.GObject.Objects.Object#g:method:getProperty"), [getPwProxy]("GI.Wp.Objects.Proxy#g:method:getPwProxy"), [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"), [setProperty]("GI.GObject.Objects.Object#g:method:setProperty"), [setPwProxy]("GI.Wp.Objects.Proxy#g:method:setPwProxy").

#if defined(ENABLE_OVERLOADING)
    ResolveGlobalProxyMethod                ,
#endif

-- ** bind #method:bind#

#if defined(ENABLE_OVERLOADING)
    GlobalProxyBindMethodInfo               ,
#endif
    globalProxyBind                         ,


-- ** getGlobalProperties #method:getGlobalProperties#

#if defined(ENABLE_OVERLOADING)
    GlobalProxyGetGlobalPropertiesMethodInfo,
#endif
    globalProxyGetGlobalProperties          ,


-- ** getPermissions #method:getPermissions#

#if defined(ENABLE_OVERLOADING)
    GlobalProxyGetPermissionsMethodInfo     ,
#endif
    globalProxyGetPermissions               ,


-- ** requestDestroy #method:requestDestroy#

#if defined(ENABLE_OVERLOADING)
    GlobalProxyRequestDestroyMethodInfo     ,
#endif
    globalProxyRequestDestroy               ,




 -- * Properties


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

#if defined(ENABLE_OVERLOADING)
    GlobalProxyFactoryNamePropertyInfo      ,
#endif
    constructGlobalProxyFactoryName         ,
#if defined(ENABLE_OVERLOADING)
    globalProxyFactoryName                  ,
#endif


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

#if defined(ENABLE_OVERLOADING)
    GlobalProxyGlobalPropertiesPropertyInfo ,
#endif
    constructGlobalProxyGlobalProperties    ,
    getGlobalProxyGlobalProperties          ,
#if defined(ENABLE_OVERLOADING)
    globalProxyGlobalProperties             ,
#endif


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

#if defined(ENABLE_OVERLOADING)
    GlobalProxyPermissionsPropertyInfo      ,
#endif
    getGlobalProxyPermissions               ,
#if defined(ENABLE_OVERLOADING)
    globalProxyPermissions                  ,
#endif




    ) where

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

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

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

#else
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.Wp.Objects.Object as Wp.Object
import {-# SOURCE #-} qualified GI.Wp.Objects.Proxy as Wp.Proxy
import {-# SOURCE #-} qualified GI.Wp.Structs.Properties as Wp.Properties

#endif

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

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

foreign import ccall "wp_global_proxy_get_type"
    c_wp_global_proxy_get_type :: IO B.Types.GType

instance B.Types.TypedObject GlobalProxy where
    glibType = c_wp_global_proxy_get_type

instance B.Types.GObject GlobalProxy

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

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

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

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

#if defined(ENABLE_OVERLOADING)
type family ResolveGlobalProxyMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
    ResolveGlobalProxyMethod "abortActivation" o = Wp.Object.ObjectAbortActivationMethodInfo
    ResolveGlobalProxyMethod "activate" o = Wp.Object.ObjectActivateMethodInfo
    ResolveGlobalProxyMethod "activateClosure" o = Wp.Object.ObjectActivateClosureMethodInfo
    ResolveGlobalProxyMethod "activateFinish" o = Wp.Object.ObjectActivateFinishMethodInfo
    ResolveGlobalProxyMethod "bind" o = GlobalProxyBindMethodInfo
    ResolveGlobalProxyMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
    ResolveGlobalProxyMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
    ResolveGlobalProxyMethod "deactivate" o = Wp.Object.ObjectDeactivateMethodInfo
    ResolveGlobalProxyMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
    ResolveGlobalProxyMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
    ResolveGlobalProxyMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
    ResolveGlobalProxyMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
    ResolveGlobalProxyMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
    ResolveGlobalProxyMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
    ResolveGlobalProxyMethod "ref" o = GObject.Object.ObjectRefMethodInfo
    ResolveGlobalProxyMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
    ResolveGlobalProxyMethod "requestDestroy" o = GlobalProxyRequestDestroyMethodInfo
    ResolveGlobalProxyMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
    ResolveGlobalProxyMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
    ResolveGlobalProxyMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
    ResolveGlobalProxyMethod "testActiveFeatures" o = Wp.Object.ObjectTestActiveFeaturesMethodInfo
    ResolveGlobalProxyMethod "testSupportedFeatures" o = Wp.Object.ObjectTestSupportedFeaturesMethodInfo
    ResolveGlobalProxyMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
    ResolveGlobalProxyMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
    ResolveGlobalProxyMethod "updateFeatures" o = Wp.Object.ObjectUpdateFeaturesMethodInfo
    ResolveGlobalProxyMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
    ResolveGlobalProxyMethod "getActiveFeatures" o = Wp.Object.ObjectGetActiveFeaturesMethodInfo
    ResolveGlobalProxyMethod "getBoundId" o = Wp.Proxy.ProxyGetBoundIdMethodInfo
    ResolveGlobalProxyMethod "getCore" o = Wp.Object.ObjectGetCoreMethodInfo
    ResolveGlobalProxyMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
    ResolveGlobalProxyMethod "getGlobalProperties" o = GlobalProxyGetGlobalPropertiesMethodInfo
    ResolveGlobalProxyMethod "getId" o = Wp.Object.ObjectGetIdMethodInfo
    ResolveGlobalProxyMethod "getInterfaceType" o = Wp.Proxy.ProxyGetInterfaceTypeMethodInfo
    ResolveGlobalProxyMethod "getPermissions" o = GlobalProxyGetPermissionsMethodInfo
    ResolveGlobalProxyMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
    ResolveGlobalProxyMethod "getPwProxy" o = Wp.Proxy.ProxyGetPwProxyMethodInfo
    ResolveGlobalProxyMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
    ResolveGlobalProxyMethod "getSupportedFeatures" o = Wp.Object.ObjectGetSupportedFeaturesMethodInfo
    ResolveGlobalProxyMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
    ResolveGlobalProxyMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
    ResolveGlobalProxyMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
    ResolveGlobalProxyMethod "setPwProxy" o = Wp.Proxy.ProxySetPwProxyMethodInfo
    ResolveGlobalProxyMethod l o = O.MethodResolutionFailed l o

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

#endif

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

#endif

-- VVV Prop "factory-name"
   -- Type: TBasicType TUTF8
   -- Flags: [PropertyWritable,PropertyConstructOnly]
   -- Nullable: (Nothing,Nothing)

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

#if defined(ENABLE_OVERLOADING)
data GlobalProxyFactoryNamePropertyInfo
instance AttrInfo GlobalProxyFactoryNamePropertyInfo where
    type AttrAllowedOps GlobalProxyFactoryNamePropertyInfo = '[ 'AttrConstruct, 'AttrClear]
    type AttrBaseTypeConstraint GlobalProxyFactoryNamePropertyInfo = IsGlobalProxy
    type AttrSetTypeConstraint GlobalProxyFactoryNamePropertyInfo = (~) T.Text
    type AttrTransferTypeConstraint GlobalProxyFactoryNamePropertyInfo = (~) T.Text
    type AttrTransferType GlobalProxyFactoryNamePropertyInfo = T.Text
    type AttrGetType GlobalProxyFactoryNamePropertyInfo = ()
    type AttrLabel GlobalProxyFactoryNamePropertyInfo = "factory-name"
    type AttrOrigin GlobalProxyFactoryNamePropertyInfo = GlobalProxy
    attrGet = undefined
    attrSet = undefined
    attrPut = undefined
    attrTransfer _ v = do
        return v
    attrConstruct = constructGlobalProxyFactoryName
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Objects.GlobalProxy.factoryName"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Objects-GlobalProxy.html#g:attr:factoryName"
        })
#endif

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

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

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

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

-- VVV Prop "permissions"
   -- Type: TBasicType TUInt
   -- Flags: [PropertyReadable]
   -- Nullable: (Nothing,Nothing)

-- | Get the value of the “@permissions@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' globalProxy #permissions
-- @
getGlobalProxyPermissions :: (MonadIO m, IsGlobalProxy o) => o -> m Word32
getGlobalProxyPermissions obj = MIO.liftIO $ B.Properties.getObjectPropertyUInt32 obj "permissions"

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

#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList GlobalProxy
type instance O.AttributeList GlobalProxy = GlobalProxyAttributeList
type GlobalProxyAttributeList = ('[ '("activeFeatures", Wp.Object.ObjectActiveFeaturesPropertyInfo), '("boundId", Wp.Proxy.ProxyBoundIdPropertyInfo), '("core", Wp.Object.ObjectCorePropertyInfo), '("factoryName", GlobalProxyFactoryNamePropertyInfo), '("globalProperties", GlobalProxyGlobalPropertiesPropertyInfo), '("id", Wp.Object.ObjectIdPropertyInfo), '("permissions", GlobalProxyPermissionsPropertyInfo), '("pwProxy", Wp.Proxy.ProxyPwProxyPropertyInfo), '("supportedFeatures", Wp.Object.ObjectSupportedFeaturesPropertyInfo)] :: [(Symbol, DK.Type)])
#endif

#if defined(ENABLE_OVERLOADING)
globalProxyFactoryName :: AttrLabelProxy "factoryName"
globalProxyFactoryName = AttrLabelProxy

globalProxyGlobalProperties :: AttrLabelProxy "globalProperties"
globalProxyGlobalProperties = AttrLabelProxy

globalProxyPermissions :: AttrLabelProxy "permissions"
globalProxyPermissions = AttrLabelProxy

#endif

#if defined(ENABLE_OVERLOADING)
type instance O.SignalList GlobalProxy = GlobalProxySignalList
type GlobalProxySignalList = ('[ '("bound", Wp.Proxy.ProxyBoundSignalInfo), '("error", Wp.Proxy.ProxyErrorSignalInfo), '("notify", GObject.Object.ObjectNotifySignalInfo), '("pwProxyCreated", Wp.Proxy.ProxyPwProxyCreatedSignalInfo), '("pwProxyDestroyed", Wp.Proxy.ProxyPwProxyDestroyedSignalInfo)] :: [(Symbol, DK.Type)])

#endif

-- method GlobalProxy::bind
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "GlobalProxy" }
--           , argCType = Just "WpGlobalProxy*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the pipewire global"
--                 , 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_global_proxy_bind" wp_global_proxy_bind :: 
    Ptr GlobalProxy ->                      -- self : TInterface (Name {namespace = "Wp", name = "GlobalProxy"})
    IO CInt

-- | Binds to the global and creates the underlying pw_proxy.
-- 
-- 
-- This is mostly meant to be called internally. It will create the pw_proxy and will activate the WP_PROXY_FEATURE_BOUND feature.
-- This may only be called if there is no pw_proxy associated with this object yet.
globalProxyBind ::
    (B.CallStack.HasCallStack, MonadIO m, IsGlobalProxy a) =>
    a
    -- ^ /@self@/: the pipewire global
    -> m Bool
    -- ^ __Returns:__ TRUE on success, FALSE if there is no global to bind to
globalProxyBind self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_global_proxy_bind self'
    let result' = (/= 0) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data GlobalProxyBindMethodInfo
instance (signature ~ (m Bool), MonadIO m, IsGlobalProxy a) => O.OverloadedMethod GlobalProxyBindMethodInfo a signature where
    overloadedMethod = globalProxyBind

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


#endif

-- method GlobalProxy::get_global_properties
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "GlobalProxy" }
--           , argCType = Just "WpGlobalProxy*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the pipewire global"
--                 , 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_global_proxy_get_global_properties" wp_global_proxy_get_global_properties :: 
    Ptr GlobalProxy ->                      -- self : TInterface (Name {namespace = "Wp", name = "GlobalProxy"})
    IO (Ptr Wp.Properties.Properties)

-- | Gets the global properties of a pipewire global.
globalProxyGetGlobalProperties ::
    (B.CallStack.HasCallStack, MonadIO m, IsGlobalProxy a) =>
    a
    -- ^ /@self@/: the pipewire global
    -> m Wp.Properties.Properties
    -- ^ __Returns:__ the global (immutable) properties of this pipewire object
globalProxyGetGlobalProperties self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_global_proxy_get_global_properties self'
    checkUnexpectedReturnNULL "globalProxyGetGlobalProperties" result
    result' <- (wrapBoxed Wp.Properties.Properties) result
    touchManagedPtr self
    return result'

#if defined(ENABLE_OVERLOADING)
data GlobalProxyGetGlobalPropertiesMethodInfo
instance (signature ~ (m Wp.Properties.Properties), MonadIO m, IsGlobalProxy a) => O.OverloadedMethod GlobalProxyGetGlobalPropertiesMethodInfo a signature where
    overloadedMethod = globalProxyGetGlobalProperties

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


#endif

-- method GlobalProxy::get_permissions
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "GlobalProxy" }
--           , argCType = Just "WpGlobalProxy*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the pipewire global"
--                 , 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_global_proxy_get_permissions" wp_global_proxy_get_permissions :: 
    Ptr GlobalProxy ->                      -- self : TInterface (Name {namespace = "Wp", name = "GlobalProxy"})
    IO Word32

-- | Gets the permissions of a pipewire global.
globalProxyGetPermissions ::
    (B.CallStack.HasCallStack, MonadIO m, IsGlobalProxy a) =>
    a
    -- ^ /@self@/: the pipewire global
    -> m Word32
    -- ^ __Returns:__ the permissions that wireplumber has on this object
globalProxyGetPermissions self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    result <- wp_global_proxy_get_permissions self'
    touchManagedPtr self
    return result

#if defined(ENABLE_OVERLOADING)
data GlobalProxyGetPermissionsMethodInfo
instance (signature ~ (m Word32), MonadIO m, IsGlobalProxy a) => O.OverloadedMethod GlobalProxyGetPermissionsMethodInfo a signature where
    overloadedMethod = globalProxyGetPermissions

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


#endif

-- method GlobalProxy::request_destroy
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "self"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "GlobalProxy" }
--           , argCType = Just "WpGlobalProxy*"
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the pipewire global"
--                 , 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_global_proxy_request_destroy" wp_global_proxy_request_destroy :: 
    Ptr GlobalProxy ->                      -- self : TInterface (Name {namespace = "Wp", name = "GlobalProxy"})
    IO ()

-- | Requests the PipeWire server to destroy the object represented by this proxy.
-- 
-- 
-- If the server allows it, the object will be destroyed and the WpProxy\'s pw-proxy-destroyed signal will be emitted. If the server does not allow it, nothing will happen.
-- This is mostly useful for destroying WpLink objects.
globalProxyRequestDestroy ::
    (B.CallStack.HasCallStack, MonadIO m, IsGlobalProxy a) =>
    a
    -- ^ /@self@/: the pipewire global
    -> m ()
globalProxyRequestDestroy self = liftIO $ do
    self' <- unsafeManagedPtrCastPtr self
    wp_global_proxy_request_destroy self'
    touchManagedPtr self
    return ()

#if defined(ENABLE_OVERLOADING)
data GlobalProxyRequestDestroyMethodInfo
instance (signature ~ (m ()), MonadIO m, IsGlobalProxy a) => O.OverloadedMethod GlobalProxyRequestDestroyMethodInfo a signature where
    overloadedMethod = globalProxyRequestDestroy

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


#endif


