#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Structs.DBusSubtreeVTable
(
DBusSubtreeVTable(..) ,
newZeroDBusSubtreeVTable ,
noDBusSubtreeVTable ,
clearDBusSubtreeVTableDispatch ,
#if ENABLE_OVERLOADING
dBusSubtreeVTable_dispatch ,
#endif
getDBusSubtreeVTableDispatch ,
setDBusSubtreeVTableDispatch ,
clearDBusSubtreeVTableIntrospect ,
#if ENABLE_OVERLOADING
dBusSubtreeVTable_introspect ,
#endif
getDBusSubtreeVTableIntrospect ,
setDBusSubtreeVTableIntrospect ,
) 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.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.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GI.Gio.Callbacks as Gio.Callbacks
newtype DBusSubtreeVTable = DBusSubtreeVTable (ManagedPtr DBusSubtreeVTable)
instance WrappedPtr DBusSubtreeVTable where
wrappedPtrCalloc = callocBytes 88
wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 88 >=> wrapPtr DBusSubtreeVTable)
wrappedPtrFree = Just ptr_to_g_free
newZeroDBusSubtreeVTable :: MonadIO m => m DBusSubtreeVTable
newZeroDBusSubtreeVTable = liftIO $ wrappedPtrCalloc >>= wrapPtr DBusSubtreeVTable
instance tag ~ 'AttrSet => Constructible DBusSubtreeVTable tag where
new _ attrs = do
o <- newZeroDBusSubtreeVTable
GI.Attributes.set o attrs
return o
noDBusSubtreeVTable :: Maybe DBusSubtreeVTable
noDBusSubtreeVTable = Nothing
getDBusSubtreeVTableIntrospect :: MonadIO m => DBusSubtreeVTable -> m (Maybe Gio.Callbacks.DBusSubtreeIntrospectFunc_WithClosures)
getDBusSubtreeVTableIntrospect s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO (FunPtr Gio.Callbacks.C_DBusSubtreeIntrospectFunc)
result <- SP.convertFunPtrIfNonNull val $ \val' -> do
let val'' = Gio.Callbacks.dynamic_DBusSubtreeIntrospectFunc val'
return val''
return result
setDBusSubtreeVTableIntrospect :: MonadIO m => DBusSubtreeVTable -> FunPtr Gio.Callbacks.C_DBusSubtreeIntrospectFunc -> m ()
setDBusSubtreeVTableIntrospect s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (val :: FunPtr Gio.Callbacks.C_DBusSubtreeIntrospectFunc)
clearDBusSubtreeVTableIntrospect :: MonadIO m => DBusSubtreeVTable -> m ()
clearDBusSubtreeVTableIntrospect s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (FP.nullFunPtr :: FunPtr Gio.Callbacks.C_DBusSubtreeIntrospectFunc)
#if ENABLE_OVERLOADING
data DBusSubtreeVTableIntrospectFieldInfo
instance AttrInfo DBusSubtreeVTableIntrospectFieldInfo where
type AttrAllowedOps DBusSubtreeVTableIntrospectFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DBusSubtreeVTableIntrospectFieldInfo = (~) (FunPtr Gio.Callbacks.C_DBusSubtreeIntrospectFunc)
type AttrBaseTypeConstraint DBusSubtreeVTableIntrospectFieldInfo = (~) DBusSubtreeVTable
type AttrGetType DBusSubtreeVTableIntrospectFieldInfo = Maybe Gio.Callbacks.DBusSubtreeIntrospectFunc_WithClosures
type AttrLabel DBusSubtreeVTableIntrospectFieldInfo = "introspect"
type AttrOrigin DBusSubtreeVTableIntrospectFieldInfo = DBusSubtreeVTable
attrGet _ = getDBusSubtreeVTableIntrospect
attrSet _ = setDBusSubtreeVTableIntrospect
attrConstruct = undefined
attrClear _ = clearDBusSubtreeVTableIntrospect
dBusSubtreeVTable_introspect :: AttrLabelProxy "introspect"
dBusSubtreeVTable_introspect = AttrLabelProxy
#endif
getDBusSubtreeVTableDispatch :: MonadIO m => DBusSubtreeVTable -> m (Maybe Gio.Callbacks.DBusSubtreeDispatchFunc_WithClosures)
getDBusSubtreeVTableDispatch s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 16) :: IO (FunPtr Gio.Callbacks.C_DBusSubtreeDispatchFunc)
result <- SP.convertFunPtrIfNonNull val $ \val' -> do
let val'' = Gio.Callbacks.dynamic_DBusSubtreeDispatchFunc val'
return val''
return result
setDBusSubtreeVTableDispatch :: MonadIO m => DBusSubtreeVTable -> FunPtr Gio.Callbacks.C_DBusSubtreeDispatchFunc -> m ()
setDBusSubtreeVTableDispatch s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (val :: FunPtr Gio.Callbacks.C_DBusSubtreeDispatchFunc)
clearDBusSubtreeVTableDispatch :: MonadIO m => DBusSubtreeVTable -> m ()
clearDBusSubtreeVTableDispatch s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (FP.nullFunPtr :: FunPtr Gio.Callbacks.C_DBusSubtreeDispatchFunc)
#if ENABLE_OVERLOADING
data DBusSubtreeVTableDispatchFieldInfo
instance AttrInfo DBusSubtreeVTableDispatchFieldInfo where
type AttrAllowedOps DBusSubtreeVTableDispatchFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DBusSubtreeVTableDispatchFieldInfo = (~) (FunPtr Gio.Callbacks.C_DBusSubtreeDispatchFunc)
type AttrBaseTypeConstraint DBusSubtreeVTableDispatchFieldInfo = (~) DBusSubtreeVTable
type AttrGetType DBusSubtreeVTableDispatchFieldInfo = Maybe Gio.Callbacks.DBusSubtreeDispatchFunc_WithClosures
type AttrLabel DBusSubtreeVTableDispatchFieldInfo = "dispatch"
type AttrOrigin DBusSubtreeVTableDispatchFieldInfo = DBusSubtreeVTable
attrGet _ = getDBusSubtreeVTableDispatch
attrSet _ = setDBusSubtreeVTableDispatch
attrConstruct = undefined
attrClear _ = clearDBusSubtreeVTableDispatch
dBusSubtreeVTable_dispatch :: AttrLabelProxy "dispatch"
dBusSubtreeVTable_dispatch = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList DBusSubtreeVTable
type instance O.AttributeList DBusSubtreeVTable = DBusSubtreeVTableAttributeList
type DBusSubtreeVTableAttributeList = ('[ '("introspect", DBusSubtreeVTableIntrospectFieldInfo), '("dispatch", DBusSubtreeVTableDispatchFieldInfo)] :: [(Symbol, *)])
#endif
#if ENABLE_OVERLOADING
type family ResolveDBusSubtreeVTableMethod (t :: Symbol) (o :: *) :: * where
ResolveDBusSubtreeVTableMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDBusSubtreeVTableMethod t DBusSubtreeVTable, O.MethodInfo info DBusSubtreeVTable p) => O.IsLabelProxy t (DBusSubtreeVTable -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveDBusSubtreeVTableMethod t DBusSubtreeVTable, O.MethodInfo info DBusSubtreeVTable p) => O.IsLabel t (DBusSubtreeVTable -> 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
#endif