#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Structs.DBusInterfaceVTable
(
DBusInterfaceVTable(..) ,
newZeroDBusInterfaceVTable ,
noDBusInterfaceVTable ,
clearDBusInterfaceVTableGetProperty ,
#if ENABLE_OVERLOADING
dBusInterfaceVTable_getProperty ,
#endif
getDBusInterfaceVTableGetProperty ,
setDBusInterfaceVTableGetProperty ,
clearDBusInterfaceVTableMethodCall ,
#if ENABLE_OVERLOADING
dBusInterfaceVTable_methodCall ,
#endif
getDBusInterfaceVTableMethodCall ,
setDBusInterfaceVTableMethodCall ,
clearDBusInterfaceVTableSetProperty ,
#if ENABLE_OVERLOADING
dBusInterfaceVTable_setProperty ,
#endif
getDBusInterfaceVTableSetProperty ,
setDBusInterfaceVTableSetProperty ,
) 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.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
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.Text as T
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 GI.Gio.Callbacks as Gio.Callbacks
newtype DBusInterfaceVTable = DBusInterfaceVTable (ManagedPtr DBusInterfaceVTable)
instance WrappedPtr DBusInterfaceVTable where
wrappedPtrCalloc = callocBytes 88
wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 88 >=> wrapPtr DBusInterfaceVTable)
wrappedPtrFree = Just ptr_to_g_free
newZeroDBusInterfaceVTable :: MonadIO m => m DBusInterfaceVTable
newZeroDBusInterfaceVTable = liftIO $ wrappedPtrCalloc >>= wrapPtr DBusInterfaceVTable
instance tag ~ 'AttrSet => Constructible DBusInterfaceVTable tag where
new _ attrs = do
o <- newZeroDBusInterfaceVTable
GI.Attributes.set o attrs
return o
noDBusInterfaceVTable :: Maybe DBusInterfaceVTable
noDBusInterfaceVTable = Nothing
getDBusInterfaceVTableMethodCall :: MonadIO m => DBusInterfaceVTable -> m (Maybe Gio.Callbacks.DBusInterfaceMethodCallFunc_WithClosures)
getDBusInterfaceVTableMethodCall s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO (FunPtr Gio.Callbacks.C_DBusInterfaceMethodCallFunc)
result <- SP.convertFunPtrIfNonNull val $ \val' -> do
let val'' = Gio.Callbacks.dynamic_DBusInterfaceMethodCallFunc val'
return val''
return result
setDBusInterfaceVTableMethodCall :: MonadIO m => DBusInterfaceVTable -> FunPtr Gio.Callbacks.C_DBusInterfaceMethodCallFunc -> m ()
setDBusInterfaceVTableMethodCall s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (val :: FunPtr Gio.Callbacks.C_DBusInterfaceMethodCallFunc)
clearDBusInterfaceVTableMethodCall :: MonadIO m => DBusInterfaceVTable -> m ()
clearDBusInterfaceVTableMethodCall s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (FP.nullFunPtr :: FunPtr Gio.Callbacks.C_DBusInterfaceMethodCallFunc)
#if ENABLE_OVERLOADING
data DBusInterfaceVTableMethodCallFieldInfo
instance AttrInfo DBusInterfaceVTableMethodCallFieldInfo where
type AttrAllowedOps DBusInterfaceVTableMethodCallFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DBusInterfaceVTableMethodCallFieldInfo = (~) (FunPtr Gio.Callbacks.C_DBusInterfaceMethodCallFunc)
type AttrBaseTypeConstraint DBusInterfaceVTableMethodCallFieldInfo = (~) DBusInterfaceVTable
type AttrGetType DBusInterfaceVTableMethodCallFieldInfo = Maybe Gio.Callbacks.DBusInterfaceMethodCallFunc_WithClosures
type AttrLabel DBusInterfaceVTableMethodCallFieldInfo = "method_call"
type AttrOrigin DBusInterfaceVTableMethodCallFieldInfo = DBusInterfaceVTable
attrGet _ = getDBusInterfaceVTableMethodCall
attrSet _ = setDBusInterfaceVTableMethodCall
attrConstruct = undefined
attrClear _ = clearDBusInterfaceVTableMethodCall
dBusInterfaceVTable_methodCall :: AttrLabelProxy "methodCall"
dBusInterfaceVTable_methodCall = AttrLabelProxy
#endif
getDBusInterfaceVTableGetProperty :: MonadIO m => DBusInterfaceVTable -> m (Maybe Gio.Callbacks.DBusInterfaceGetPropertyFunc_WithClosures)
getDBusInterfaceVTableGetProperty s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO (FunPtr Gio.Callbacks.C_DBusInterfaceGetPropertyFunc)
result <- SP.convertFunPtrIfNonNull val $ \val' -> do
let val'' = Gio.Callbacks.dynamic_DBusInterfaceGetPropertyFunc val'
return val''
return result
setDBusInterfaceVTableGetProperty :: MonadIO m => DBusInterfaceVTable -> FunPtr Gio.Callbacks.C_DBusInterfaceGetPropertyFunc -> m ()
setDBusInterfaceVTableGetProperty s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (val :: FunPtr Gio.Callbacks.C_DBusInterfaceGetPropertyFunc)
clearDBusInterfaceVTableGetProperty :: MonadIO m => DBusInterfaceVTable -> m ()
clearDBusInterfaceVTableGetProperty s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (FP.nullFunPtr :: FunPtr Gio.Callbacks.C_DBusInterfaceGetPropertyFunc)
#if ENABLE_OVERLOADING
data DBusInterfaceVTableGetPropertyFieldInfo
instance AttrInfo DBusInterfaceVTableGetPropertyFieldInfo where
type AttrAllowedOps DBusInterfaceVTableGetPropertyFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DBusInterfaceVTableGetPropertyFieldInfo = (~) (FunPtr Gio.Callbacks.C_DBusInterfaceGetPropertyFunc)
type AttrBaseTypeConstraint DBusInterfaceVTableGetPropertyFieldInfo = (~) DBusInterfaceVTable
type AttrGetType DBusInterfaceVTableGetPropertyFieldInfo = Maybe Gio.Callbacks.DBusInterfaceGetPropertyFunc_WithClosures
type AttrLabel DBusInterfaceVTableGetPropertyFieldInfo = "get_property"
type AttrOrigin DBusInterfaceVTableGetPropertyFieldInfo = DBusInterfaceVTable
attrGet _ = getDBusInterfaceVTableGetProperty
attrSet _ = setDBusInterfaceVTableGetProperty
attrConstruct = undefined
attrClear _ = clearDBusInterfaceVTableGetProperty
dBusInterfaceVTable_getProperty :: AttrLabelProxy "getProperty"
dBusInterfaceVTable_getProperty = AttrLabelProxy
#endif
getDBusInterfaceVTableSetProperty :: MonadIO m => DBusInterfaceVTable -> m (Maybe Gio.Callbacks.DBusInterfaceSetPropertyFunc_WithClosures)
getDBusInterfaceVTableSetProperty s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 16) :: IO (FunPtr Gio.Callbacks.C_DBusInterfaceSetPropertyFunc)
result <- SP.convertFunPtrIfNonNull val $ \val' -> do
let val'' = Gio.Callbacks.dynamic_DBusInterfaceSetPropertyFunc val'
return val''
return result
setDBusInterfaceVTableSetProperty :: MonadIO m => DBusInterfaceVTable -> FunPtr Gio.Callbacks.C_DBusInterfaceSetPropertyFunc -> m ()
setDBusInterfaceVTableSetProperty s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (val :: FunPtr Gio.Callbacks.C_DBusInterfaceSetPropertyFunc)
clearDBusInterfaceVTableSetProperty :: MonadIO m => DBusInterfaceVTable -> m ()
clearDBusInterfaceVTableSetProperty s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (FP.nullFunPtr :: FunPtr Gio.Callbacks.C_DBusInterfaceSetPropertyFunc)
#if ENABLE_OVERLOADING
data DBusInterfaceVTableSetPropertyFieldInfo
instance AttrInfo DBusInterfaceVTableSetPropertyFieldInfo where
type AttrAllowedOps DBusInterfaceVTableSetPropertyFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DBusInterfaceVTableSetPropertyFieldInfo = (~) (FunPtr Gio.Callbacks.C_DBusInterfaceSetPropertyFunc)
type AttrBaseTypeConstraint DBusInterfaceVTableSetPropertyFieldInfo = (~) DBusInterfaceVTable
type AttrGetType DBusInterfaceVTableSetPropertyFieldInfo = Maybe Gio.Callbacks.DBusInterfaceSetPropertyFunc_WithClosures
type AttrLabel DBusInterfaceVTableSetPropertyFieldInfo = "set_property"
type AttrOrigin DBusInterfaceVTableSetPropertyFieldInfo = DBusInterfaceVTable
attrGet _ = getDBusInterfaceVTableSetProperty
attrSet _ = setDBusInterfaceVTableSetProperty
attrConstruct = undefined
attrClear _ = clearDBusInterfaceVTableSetProperty
dBusInterfaceVTable_setProperty :: AttrLabelProxy "setProperty"
dBusInterfaceVTable_setProperty = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList DBusInterfaceVTable
type instance O.AttributeList DBusInterfaceVTable = DBusInterfaceVTableAttributeList
type DBusInterfaceVTableAttributeList = ('[ '("methodCall", DBusInterfaceVTableMethodCallFieldInfo), '("getProperty", DBusInterfaceVTableGetPropertyFieldInfo), '("setProperty", DBusInterfaceVTableSetPropertyFieldInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
type family ResolveDBusInterfaceVTableMethod (t :: Symbol) (o :: *) :: * where
ResolveDBusInterfaceVTableMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDBusInterfaceVTableMethod t DBusInterfaceVTable, O.MethodInfo info DBusInterfaceVTable p) => OL.IsLabel t (DBusInterfaceVTable -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif