#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.Gio.Structs.DBusArgInfo
(
DBusArgInfo(..) ,
newZeroDBusArgInfo ,
noDBusArgInfo ,
#if ENABLE_OVERLOADING
DBusArgInfoRefMethodInfo ,
#endif
dBusArgInfoRef ,
#if ENABLE_OVERLOADING
DBusArgInfoUnrefMethodInfo ,
#endif
dBusArgInfoUnref ,
clearDBusArgInfoAnnotations ,
#if ENABLE_OVERLOADING
dBusArgInfo_annotations ,
#endif
getDBusArgInfoAnnotations ,
setDBusArgInfoAnnotations ,
clearDBusArgInfoName ,
#if ENABLE_OVERLOADING
dBusArgInfo_name ,
#endif
getDBusArgInfoName ,
setDBusArgInfoName ,
#if ENABLE_OVERLOADING
dBusArgInfo_refCount ,
#endif
getDBusArgInfoRefCount ,
setDBusArgInfoRefCount ,
clearDBusArgInfoSignature ,
#if ENABLE_OVERLOADING
dBusArgInfo_signature ,
#endif
getDBusArgInfoSignature ,
setDBusArgInfoSignature ,
) 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 {-# SOURCE #-} qualified GI.Gio.Structs.DBusAnnotationInfo as Gio.DBusAnnotationInfo
newtype DBusArgInfo = DBusArgInfo (ManagedPtr DBusArgInfo)
foreign import ccall "g_dbus_arg_info_get_type" c_g_dbus_arg_info_get_type ::
IO GType
instance BoxedObject DBusArgInfo where
boxedType _ = c_g_dbus_arg_info_get_type
newZeroDBusArgInfo :: MonadIO m => m DBusArgInfo
newZeroDBusArgInfo = liftIO $ callocBoxedBytes 32 >>= wrapBoxed DBusArgInfo
instance tag ~ 'AttrSet => Constructible DBusArgInfo tag where
new _ attrs = do
o <- newZeroDBusArgInfo
GI.Attributes.set o attrs
return o
noDBusArgInfo :: Maybe DBusArgInfo
noDBusArgInfo = Nothing
getDBusArgInfoRefCount :: MonadIO m => DBusArgInfo -> m Int32
getDBusArgInfoRefCount s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO Int32
return val
setDBusArgInfoRefCount :: MonadIO m => DBusArgInfo -> Int32 -> m ()
setDBusArgInfoRefCount s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (val :: Int32)
#if ENABLE_OVERLOADING
data DBusArgInfoRefCountFieldInfo
instance AttrInfo DBusArgInfoRefCountFieldInfo where
type AttrAllowedOps DBusArgInfoRefCountFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint DBusArgInfoRefCountFieldInfo = (~) Int32
type AttrBaseTypeConstraint DBusArgInfoRefCountFieldInfo = (~) DBusArgInfo
type AttrGetType DBusArgInfoRefCountFieldInfo = Int32
type AttrLabel DBusArgInfoRefCountFieldInfo = "ref_count"
type AttrOrigin DBusArgInfoRefCountFieldInfo = DBusArgInfo
attrGet _ = getDBusArgInfoRefCount
attrSet _ = setDBusArgInfoRefCount
attrConstruct = undefined
attrClear _ = undefined
dBusArgInfo_refCount :: AttrLabelProxy "refCount"
dBusArgInfo_refCount = AttrLabelProxy
#endif
getDBusArgInfoName :: MonadIO m => DBusArgInfo -> m (Maybe T.Text)
getDBusArgInfoName s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO CString
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- cstringToText val'
return val''
return result
setDBusArgInfoName :: MonadIO m => DBusArgInfo -> CString -> m ()
setDBusArgInfoName s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (val :: CString)
clearDBusArgInfoName :: MonadIO m => DBusArgInfo -> m ()
clearDBusArgInfoName s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (FP.nullPtr :: CString)
#if ENABLE_OVERLOADING
data DBusArgInfoNameFieldInfo
instance AttrInfo DBusArgInfoNameFieldInfo where
type AttrAllowedOps DBusArgInfoNameFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DBusArgInfoNameFieldInfo = (~) CString
type AttrBaseTypeConstraint DBusArgInfoNameFieldInfo = (~) DBusArgInfo
type AttrGetType DBusArgInfoNameFieldInfo = Maybe T.Text
type AttrLabel DBusArgInfoNameFieldInfo = "name"
type AttrOrigin DBusArgInfoNameFieldInfo = DBusArgInfo
attrGet _ = getDBusArgInfoName
attrSet _ = setDBusArgInfoName
attrConstruct = undefined
attrClear _ = clearDBusArgInfoName
dBusArgInfo_name :: AttrLabelProxy "name"
dBusArgInfo_name = AttrLabelProxy
#endif
getDBusArgInfoSignature :: MonadIO m => DBusArgInfo -> m (Maybe T.Text)
getDBusArgInfoSignature s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 16) :: IO CString
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- cstringToText val'
return val''
return result
setDBusArgInfoSignature :: MonadIO m => DBusArgInfo -> CString -> m ()
setDBusArgInfoSignature s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (val :: CString)
clearDBusArgInfoSignature :: MonadIO m => DBusArgInfo -> m ()
clearDBusArgInfoSignature s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (FP.nullPtr :: CString)
#if ENABLE_OVERLOADING
data DBusArgInfoSignatureFieldInfo
instance AttrInfo DBusArgInfoSignatureFieldInfo where
type AttrAllowedOps DBusArgInfoSignatureFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DBusArgInfoSignatureFieldInfo = (~) CString
type AttrBaseTypeConstraint DBusArgInfoSignatureFieldInfo = (~) DBusArgInfo
type AttrGetType DBusArgInfoSignatureFieldInfo = Maybe T.Text
type AttrLabel DBusArgInfoSignatureFieldInfo = "signature"
type AttrOrigin DBusArgInfoSignatureFieldInfo = DBusArgInfo
attrGet _ = getDBusArgInfoSignature
attrSet _ = setDBusArgInfoSignature
attrConstruct = undefined
attrClear _ = clearDBusArgInfoSignature
dBusArgInfo_signature :: AttrLabelProxy "signature"
dBusArgInfo_signature = AttrLabelProxy
#endif
getDBusArgInfoAnnotations :: MonadIO m => DBusArgInfo -> m (Maybe [Gio.DBusAnnotationInfo.DBusAnnotationInfo])
getDBusArgInfoAnnotations s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 24) :: IO (Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo))
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- unpackZeroTerminatedPtrArray val'
val''' <- mapM (newBoxed Gio.DBusAnnotationInfo.DBusAnnotationInfo) val''
return val'''
return result
setDBusArgInfoAnnotations :: MonadIO m => DBusArgInfo -> Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo) -> m ()
setDBusArgInfoAnnotations s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 24) (val :: Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo))
clearDBusArgInfoAnnotations :: MonadIO m => DBusArgInfo -> m ()
clearDBusArgInfoAnnotations s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 24) (FP.nullPtr :: Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo))
#if ENABLE_OVERLOADING
data DBusArgInfoAnnotationsFieldInfo
instance AttrInfo DBusArgInfoAnnotationsFieldInfo where
type AttrAllowedOps DBusArgInfoAnnotationsFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DBusArgInfoAnnotationsFieldInfo = (~) (Ptr (Ptr Gio.DBusAnnotationInfo.DBusAnnotationInfo))
type AttrBaseTypeConstraint DBusArgInfoAnnotationsFieldInfo = (~) DBusArgInfo
type AttrGetType DBusArgInfoAnnotationsFieldInfo = Maybe [Gio.DBusAnnotationInfo.DBusAnnotationInfo]
type AttrLabel DBusArgInfoAnnotationsFieldInfo = "annotations"
type AttrOrigin DBusArgInfoAnnotationsFieldInfo = DBusArgInfo
attrGet _ = getDBusArgInfoAnnotations
attrSet _ = setDBusArgInfoAnnotations
attrConstruct = undefined
attrClear _ = clearDBusArgInfoAnnotations
dBusArgInfo_annotations :: AttrLabelProxy "annotations"
dBusArgInfo_annotations = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList DBusArgInfo
type instance O.AttributeList DBusArgInfo = DBusArgInfoAttributeList
type DBusArgInfoAttributeList = ('[ '("refCount", DBusArgInfoRefCountFieldInfo), '("name", DBusArgInfoNameFieldInfo), '("signature", DBusArgInfoSignatureFieldInfo), '("annotations", DBusArgInfoAnnotationsFieldInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_dbus_arg_info_ref" g_dbus_arg_info_ref ::
Ptr DBusArgInfo ->
IO (Ptr DBusArgInfo)
dBusArgInfoRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
DBusArgInfo
-> m DBusArgInfo
dBusArgInfoRef info = liftIO $ do
info' <- unsafeManagedPtrGetPtr info
result <- g_dbus_arg_info_ref info'
checkUnexpectedReturnNULL "dBusArgInfoRef" result
result' <- (wrapBoxed DBusArgInfo) result
touchManagedPtr info
return result'
#if ENABLE_OVERLOADING
data DBusArgInfoRefMethodInfo
instance (signature ~ (m DBusArgInfo), MonadIO m) => O.MethodInfo DBusArgInfoRefMethodInfo DBusArgInfo signature where
overloadedMethod _ = dBusArgInfoRef
#endif
foreign import ccall "g_dbus_arg_info_unref" g_dbus_arg_info_unref ::
Ptr DBusArgInfo ->
IO ()
dBusArgInfoUnref ::
(B.CallStack.HasCallStack, MonadIO m) =>
DBusArgInfo
-> m ()
dBusArgInfoUnref info = liftIO $ do
info' <- unsafeManagedPtrGetPtr info
g_dbus_arg_info_unref info'
touchManagedPtr info
return ()
#if ENABLE_OVERLOADING
data DBusArgInfoUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo DBusArgInfoUnrefMethodInfo DBusArgInfo signature where
overloadedMethod _ = dBusArgInfoUnref
#endif
#if ENABLE_OVERLOADING
type family ResolveDBusArgInfoMethod (t :: Symbol) (o :: *) :: * where
ResolveDBusArgInfoMethod "ref" o = DBusArgInfoRefMethodInfo
ResolveDBusArgInfoMethod "unref" o = DBusArgInfoUnrefMethodInfo
ResolveDBusArgInfoMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDBusArgInfoMethod t DBusArgInfo, O.MethodInfo info DBusArgInfo p) => OL.IsLabel t (DBusArgInfo -> 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