{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson and Iñaki García Etxebarria
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- Implementation of the metadata object.
-- Activate this object with at least WP_PROXY_FEATURE_BOUND to export it to PipeWire.

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

module GI.Wp.Objects.ImplMetadata
    ( 

-- * Exported types
    ImplMetadata(..)                        ,
    IsImplMetadata                          ,
    toImplMetadata                          ,


 -- * 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"), [clear]("GI.Wp.Objects.Metadata#g:method:clear"), [deactivate]("GI.Wp.Objects.Object#g:method:deactivate"), [find]("GI.Wp.Objects.Metadata#g:method:find"), [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"), [newIterator]("GI.Wp.Objects.Metadata#g:method:newIterator"), [notify]("GI.GObject.Objects.Object#g:method:notify"), [notifyByPspec]("GI.GObject.Objects.Object#g:method:notifyByPspec"), [ref]("GI.GObject.Objects.Object#g:method:ref"), [refSink]("GI.GObject.Objects.Object#g:method:refSink"), [requestDestroy]("GI.Wp.Objects.GlobalProxy#g:method:requestDestroy"), [runDispose]("GI.GObject.Objects.Object#g:method:runDispose"), [set]("GI.Wp.Objects.Metadata#g:method:set"), [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)
    ResolveImplMetadataMethod               ,
#endif

-- ** new #method:new#

    implMetadataNew                         ,


-- ** newFull #method:newFull#

    implMetadataNewFull                     ,




 -- * Properties


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

#if defined(ENABLE_OVERLOADING)
    ImplMetadataNamePropertyInfo            ,
#endif
    constructImplMetadataName               ,
    getImplMetadataName                     ,
#if defined(ENABLE_OVERLOADING)
    implMetadataName                        ,
#endif


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

#if defined(ENABLE_OVERLOADING)
    ImplMetadataPropertiesPropertyInfo      ,
#endif
    constructImplMetadataProperties         ,
    getImplMetadataProperties               ,
#if defined(ENABLE_OVERLOADING)
    implMetadataProperties                  ,
#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.GlobalProxy as Wp.GlobalProxy
import {-# SOURCE #-} qualified GI.Wp.Objects.Metadata as Wp.Metadata
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.Core as Wp.Core
import {-# SOURCE #-} qualified GI.Wp.Objects.GlobalProxy as Wp.GlobalProxy
import {-# SOURCE #-} qualified GI.Wp.Objects.Metadata as Wp.Metadata
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 ImplMetadata = ImplMetadata (SP.ManagedPtr ImplMetadata)
    deriving (Eq)

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

foreign import ccall "wp_impl_metadata_get_type"
    c_wp_impl_metadata_get_type :: IO B.Types.GType

instance B.Types.TypedObject ImplMetadata where
    glibType = c_wp_impl_metadata_get_type

instance B.Types.GObject ImplMetadata

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

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

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

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

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

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

#endif

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

#endif

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

-- | Get the value of the “@name@” property.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' implMetadata #name
-- @
getImplMetadataName :: (MonadIO m, IsImplMetadata o) => o -> m (Maybe T.Text)
getImplMetadataName obj = MIO.liftIO $ B.Properties.getObjectPropertyString obj "name"

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

#if defined(ENABLE_OVERLOADING)
data ImplMetadataNamePropertyInfo
instance AttrInfo ImplMetadataNamePropertyInfo where
    type AttrAllowedOps ImplMetadataNamePropertyInfo = '[ 'AttrConstruct, 'AttrGet, 'AttrClear]
    type AttrBaseTypeConstraint ImplMetadataNamePropertyInfo = IsImplMetadata
    type AttrSetTypeConstraint ImplMetadataNamePropertyInfo = (~) T.Text
    type AttrTransferTypeConstraint ImplMetadataNamePropertyInfo = (~) T.Text
    type AttrTransferType ImplMetadataNamePropertyInfo = T.Text
    type AttrGetType ImplMetadataNamePropertyInfo = (Maybe T.Text)
    type AttrLabel ImplMetadataNamePropertyInfo = "name"
    type AttrOrigin ImplMetadataNamePropertyInfo = ImplMetadata
    attrGet = getImplMetadataName
    attrSet = undefined
    attrPut = undefined
    attrTransfer _ v = do
        return v
    attrConstruct = constructImplMetadataName
    attrClear = undefined
    dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
        O.resolvedSymbolName = "GI.Wp.Objects.ImplMetadata.name"
        , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-wireplumber-0.5.14.2/docs/GI-Wp-Objects-ImplMetadata.html#g:attr:name"
        })
#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' implMetadata #properties
-- @
getImplMetadataProperties :: (MonadIO m, IsImplMetadata o) => o -> m (Maybe Wp.Properties.Properties)
getImplMetadataProperties 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`.
constructImplMetadataProperties :: (IsImplMetadata o, MIO.MonadIO m) => Wp.Properties.Properties -> m (GValueConstruct o)
constructImplMetadataProperties val = MIO.liftIO $ do
    MIO.liftIO $ B.Properties.constructObjectPropertyBoxed "properties" (P.Just val)

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

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

#if defined(ENABLE_OVERLOADING)
implMetadataName :: AttrLabelProxy "name"
implMetadataName = AttrLabelProxy

implMetadataProperties :: AttrLabelProxy "properties"
implMetadataProperties = AttrLabelProxy

#endif

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

#endif

-- method ImplMetadata::new
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "core"
--           , 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 = "ImplMetadata" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_impl_metadata_new" wp_impl_metadata_new :: 
    Ptr Wp.Core.Core ->                     -- core : TInterface (Name {namespace = "Wp", name = "Core"})
    IO (Ptr ImplMetadata)

-- | Creates a new metadata implementation.
implMetadataNew ::
    (B.CallStack.HasCallStack, MonadIO m, Wp.Core.IsCore a) =>
    a
    -- ^ /@core@/: the core
    -> m ImplMetadata
    -- ^ __Returns:__ a new WpImplMetadata
implMetadataNew core = liftIO $ do
    core' <- unsafeManagedPtrCastPtr core
    result <- wp_impl_metadata_new core'
    checkUnexpectedReturnNULL "implMetadataNew" result
    result' <- (wrapObject ImplMetadata) result
    touchManagedPtr core
    return result'

#if defined(ENABLE_OVERLOADING)
#endif

-- method ImplMetadata::new_full
-- method type : Constructor
-- Args: [ Arg
--           { argCName = "core"
--           , 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 = "name"
--           , argType = TBasicType TUTF8
--           , argCType = Just "const gchar*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the metadata name" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "properties"
--           , argType =
--               TInterface Name { namespace = "Wp" , name = "Properties" }
--           , argCType = Just "WpProperties*"
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the metadata properties"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , argCallbackUserData = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "Wp" , name = "ImplMetadata" })
-- throws : False
-- Skip return : False

foreign import ccall "wp_impl_metadata_new_full" wp_impl_metadata_new_full :: 
    Ptr Wp.Core.Core ->                     -- core : TInterface (Name {namespace = "Wp", name = "Core"})
    CString ->                              -- name : TBasicType TUTF8
    Ptr Wp.Properties.Properties ->         -- properties : TInterface (Name {namespace = "Wp", name = "Properties"})
    IO (Ptr ImplMetadata)

-- | Creates a new metadata implementation with name and properties.
-- 
-- /Since: 0.4.3/
implMetadataNewFull ::
    (B.CallStack.HasCallStack, MonadIO m, Wp.Core.IsCore a) =>
    a
    -- ^ /@core@/: the core
    -> Maybe (T.Text)
    -- ^ /@name@/: the metadata name
    -> Maybe (Wp.Properties.Properties)
    -- ^ /@properties@/: the metadata properties
    -> m ImplMetadata
    -- ^ __Returns:__ a new WpImplMetadata
implMetadataNewFull core name properties = liftIO $ do
    core' <- unsafeManagedPtrCastPtr core
    maybeName <- case name of
        Nothing -> return FP.nullPtr
        Just jName -> do
            jName' <- textToCString jName
            return jName'
    maybeProperties <- case properties of
        Nothing -> return FP.nullPtr
        Just jProperties -> do
            jProperties' <- B.ManagedPtr.disownBoxed jProperties
            return jProperties'
    result <- wp_impl_metadata_new_full core' maybeName maybeProperties
    checkUnexpectedReturnNULL "implMetadataNewFull" result
    result' <- (wrapObject ImplMetadata) result
    touchManagedPtr core
    whenJust properties touchManagedPtr
    freeMem maybeName
    return result'

#if defined(ENABLE_OVERLOADING)
#endif


