{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.Gio.Structs.DBusAnnotationInfo
(
DBusAnnotationInfo(..) ,
newZeroDBusAnnotationInfo ,
noDBusAnnotationInfo ,
#if defined(ENABLE_OVERLOADING)
ResolveDBusAnnotationInfoMethod ,
#endif
dBusAnnotationInfoLookup ,
#if defined(ENABLE_OVERLOADING)
DBusAnnotationInfoRefMethodInfo ,
#endif
dBusAnnotationInfoRef ,
#if defined(ENABLE_OVERLOADING)
DBusAnnotationInfoUnrefMethodInfo ,
#endif
dBusAnnotationInfoUnref ,
clearDBusAnnotationInfoAnnotations ,
#if defined(ENABLE_OVERLOADING)
dBusAnnotationInfo_annotations ,
#endif
getDBusAnnotationInfoAnnotations ,
setDBusAnnotationInfoAnnotations ,
clearDBusAnnotationInfoKey ,
#if defined(ENABLE_OVERLOADING)
dBusAnnotationInfo_key ,
#endif
getDBusAnnotationInfoKey ,
setDBusAnnotationInfoKey ,
#if defined(ENABLE_OVERLOADING)
dBusAnnotationInfo_refCount ,
#endif
getDBusAnnotationInfoRefCount ,
setDBusAnnotationInfoRefCount ,
clearDBusAnnotationInfoValue ,
#if defined(ENABLE_OVERLOADING)
dBusAnnotationInfo_value ,
#endif
getDBusAnnotationInfoValue ,
setDBusAnnotationInfoValue ,
) 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.GI.Base.Signals as B.Signals
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
newtype DBusAnnotationInfo = DBusAnnotationInfo (ManagedPtr DBusAnnotationInfo)
deriving (DBusAnnotationInfo -> DBusAnnotationInfo -> Bool
(DBusAnnotationInfo -> DBusAnnotationInfo -> Bool)
-> (DBusAnnotationInfo -> DBusAnnotationInfo -> Bool)
-> Eq DBusAnnotationInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DBusAnnotationInfo -> DBusAnnotationInfo -> Bool
$c/= :: DBusAnnotationInfo -> DBusAnnotationInfo -> Bool
== :: DBusAnnotationInfo -> DBusAnnotationInfo -> Bool
$c== :: DBusAnnotationInfo -> DBusAnnotationInfo -> Bool
Eq)
foreign import ccall "g_dbus_annotation_info_get_type" c_g_dbus_annotation_info_get_type ::
IO GType
instance BoxedObject DBusAnnotationInfo where
boxedType :: DBusAnnotationInfo -> IO GType
boxedType _ = IO GType
c_g_dbus_annotation_info_get_type
instance B.GValue.IsGValue DBusAnnotationInfo where
toGValue :: DBusAnnotationInfo -> IO GValue
toGValue o :: DBusAnnotationInfo
o = do
GType
gtype <- IO GType
c_g_dbus_annotation_info_get_type
DBusAnnotationInfo
-> (Ptr DBusAnnotationInfo -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr DBusAnnotationInfo
o (GType
-> (GValue -> Ptr DBusAnnotationInfo -> IO ())
-> Ptr DBusAnnotationInfo
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr DBusAnnotationInfo -> IO ()
forall a. GValue -> Ptr a -> IO ()
B.GValue.set_boxed)
fromGValue :: GValue -> IO DBusAnnotationInfo
fromGValue gv :: GValue
gv = do
Ptr DBusAnnotationInfo
ptr <- GValue -> IO (Ptr DBusAnnotationInfo)
forall b. GValue -> IO (Ptr b)
B.GValue.get_boxed GValue
gv :: IO (Ptr DBusAnnotationInfo)
(ManagedPtr DBusAnnotationInfo -> DBusAnnotationInfo)
-> Ptr DBusAnnotationInfo -> IO DBusAnnotationInfo
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr DBusAnnotationInfo -> DBusAnnotationInfo
DBusAnnotationInfo Ptr DBusAnnotationInfo
ptr
newZeroDBusAnnotationInfo :: MonadIO m => m DBusAnnotationInfo
newZeroDBusAnnotationInfo :: m DBusAnnotationInfo
newZeroDBusAnnotationInfo = IO DBusAnnotationInfo -> m DBusAnnotationInfo
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DBusAnnotationInfo -> m DBusAnnotationInfo)
-> IO DBusAnnotationInfo -> m DBusAnnotationInfo
forall a b. (a -> b) -> a -> b
$ Int -> IO (Ptr DBusAnnotationInfo)
forall a. BoxedObject a => Int -> IO (Ptr a)
callocBoxedBytes 32 IO (Ptr DBusAnnotationInfo)
-> (Ptr DBusAnnotationInfo -> IO DBusAnnotationInfo)
-> IO DBusAnnotationInfo
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr DBusAnnotationInfo -> DBusAnnotationInfo)
-> Ptr DBusAnnotationInfo -> IO DBusAnnotationInfo
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr DBusAnnotationInfo -> DBusAnnotationInfo
DBusAnnotationInfo
instance tag ~ 'AttrSet => Constructible DBusAnnotationInfo tag where
new :: (ManagedPtr DBusAnnotationInfo -> DBusAnnotationInfo)
-> [AttrOp DBusAnnotationInfo tag] -> m DBusAnnotationInfo
new _ attrs :: [AttrOp DBusAnnotationInfo tag]
attrs = do
DBusAnnotationInfo
o <- m DBusAnnotationInfo
forall (m :: * -> *). MonadIO m => m DBusAnnotationInfo
newZeroDBusAnnotationInfo
DBusAnnotationInfo -> [AttrOp DBusAnnotationInfo 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set DBusAnnotationInfo
o [AttrOp DBusAnnotationInfo tag]
[AttrOp DBusAnnotationInfo 'AttrSet]
attrs
DBusAnnotationInfo -> m DBusAnnotationInfo
forall (m :: * -> *) a. Monad m => a -> m a
return DBusAnnotationInfo
o
noDBusAnnotationInfo :: Maybe DBusAnnotationInfo
noDBusAnnotationInfo :: Maybe DBusAnnotationInfo
noDBusAnnotationInfo = Maybe DBusAnnotationInfo
forall a. Maybe a
Nothing
getDBusAnnotationInfoRefCount :: MonadIO m => DBusAnnotationInfo -> m Int32
getDBusAnnotationInfoRefCount :: DBusAnnotationInfo -> m Int32
getDBusAnnotationInfoRefCount s :: DBusAnnotationInfo
s = IO Int32 -> m Int32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
forall a b. (a -> b) -> a -> b
$ DBusAnnotationInfo
-> (Ptr DBusAnnotationInfo -> IO Int32) -> IO Int32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusAnnotationInfo
s ((Ptr DBusAnnotationInfo -> IO Int32) -> IO Int32)
-> (Ptr DBusAnnotationInfo -> IO Int32) -> IO Int32
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr DBusAnnotationInfo
ptr -> do
Int32
val <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek (Ptr DBusAnnotationInfo
ptr Ptr DBusAnnotationInfo -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0) :: IO Int32
Int32 -> IO Int32
forall (m :: * -> *) a. Monad m => a -> m a
return Int32
val
setDBusAnnotationInfoRefCount :: MonadIO m => DBusAnnotationInfo -> Int32 -> m ()
setDBusAnnotationInfoRefCount :: DBusAnnotationInfo -> Int32 -> m ()
setDBusAnnotationInfoRefCount s :: DBusAnnotationInfo
s val :: Int32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ DBusAnnotationInfo -> (Ptr DBusAnnotationInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusAnnotationInfo
s ((Ptr DBusAnnotationInfo -> IO ()) -> IO ())
-> (Ptr DBusAnnotationInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr DBusAnnotationInfo
ptr -> do
Ptr Int32 -> Int32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusAnnotationInfo
ptr Ptr DBusAnnotationInfo -> Int -> Ptr Int32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 0) (Int32
val :: Int32)
#if defined(ENABLE_OVERLOADING)
data DBusAnnotationInfoRefCountFieldInfo
instance AttrInfo DBusAnnotationInfoRefCountFieldInfo where
type AttrBaseTypeConstraint DBusAnnotationInfoRefCountFieldInfo = (~) DBusAnnotationInfo
type AttrAllowedOps DBusAnnotationInfoRefCountFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint DBusAnnotationInfoRefCountFieldInfo = (~) Int32
type AttrTransferTypeConstraint DBusAnnotationInfoRefCountFieldInfo = (~)Int32
type AttrTransferType DBusAnnotationInfoRefCountFieldInfo = Int32
type AttrGetType DBusAnnotationInfoRefCountFieldInfo = Int32
type AttrLabel DBusAnnotationInfoRefCountFieldInfo = "ref_count"
type AttrOrigin DBusAnnotationInfoRefCountFieldInfo = DBusAnnotationInfo
attrGet = getDBusAnnotationInfoRefCount
attrSet = setDBusAnnotationInfoRefCount
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dBusAnnotationInfo_refCount :: AttrLabelProxy "refCount"
dBusAnnotationInfo_refCount = AttrLabelProxy
#endif
getDBusAnnotationInfoKey :: MonadIO m => DBusAnnotationInfo -> m (Maybe T.Text)
getDBusAnnotationInfoKey :: DBusAnnotationInfo -> m (Maybe Text)
getDBusAnnotationInfoKey s :: DBusAnnotationInfo
s = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ DBusAnnotationInfo
-> (Ptr DBusAnnotationInfo -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusAnnotationInfo
s ((Ptr DBusAnnotationInfo -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr DBusAnnotationInfo -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr DBusAnnotationInfo
ptr -> do
CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr DBusAnnotationInfo
ptr Ptr DBusAnnotationInfo -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8) :: IO CString
Maybe Text
result <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull CString
val ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \val' :: CString
val' -> do
Text
val'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
val'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
val''
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
result
setDBusAnnotationInfoKey :: MonadIO m => DBusAnnotationInfo -> CString -> m ()
setDBusAnnotationInfoKey :: DBusAnnotationInfo -> CString -> m ()
setDBusAnnotationInfoKey s :: DBusAnnotationInfo
s val :: CString
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ DBusAnnotationInfo -> (Ptr DBusAnnotationInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusAnnotationInfo
s ((Ptr DBusAnnotationInfo -> IO ()) -> IO ())
-> (Ptr DBusAnnotationInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr DBusAnnotationInfo
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusAnnotationInfo
ptr Ptr DBusAnnotationInfo -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8) (CString
val :: CString)
clearDBusAnnotationInfoKey :: MonadIO m => DBusAnnotationInfo -> m ()
clearDBusAnnotationInfoKey :: DBusAnnotationInfo -> m ()
clearDBusAnnotationInfoKey s :: DBusAnnotationInfo
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ DBusAnnotationInfo -> (Ptr DBusAnnotationInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusAnnotationInfo
s ((Ptr DBusAnnotationInfo -> IO ()) -> IO ())
-> (Ptr DBusAnnotationInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr DBusAnnotationInfo
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusAnnotationInfo
ptr Ptr DBusAnnotationInfo -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 8) (CString
forall a. Ptr a
FP.nullPtr :: CString)
#if defined(ENABLE_OVERLOADING)
data DBusAnnotationInfoKeyFieldInfo
instance AttrInfo DBusAnnotationInfoKeyFieldInfo where
type AttrBaseTypeConstraint DBusAnnotationInfoKeyFieldInfo = (~) DBusAnnotationInfo
type AttrAllowedOps DBusAnnotationInfoKeyFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DBusAnnotationInfoKeyFieldInfo = (~) CString
type AttrTransferTypeConstraint DBusAnnotationInfoKeyFieldInfo = (~)CString
type AttrTransferType DBusAnnotationInfoKeyFieldInfo = CString
type AttrGetType DBusAnnotationInfoKeyFieldInfo = Maybe T.Text
type AttrLabel DBusAnnotationInfoKeyFieldInfo = "key"
type AttrOrigin DBusAnnotationInfoKeyFieldInfo = DBusAnnotationInfo
attrGet = getDBusAnnotationInfoKey
attrSet = setDBusAnnotationInfoKey
attrConstruct = undefined
attrClear = clearDBusAnnotationInfoKey
attrTransfer _ v = do
return v
dBusAnnotationInfo_key :: AttrLabelProxy "key"
dBusAnnotationInfo_key = AttrLabelProxy
#endif
getDBusAnnotationInfoValue :: MonadIO m => DBusAnnotationInfo -> m (Maybe T.Text)
getDBusAnnotationInfoValue :: DBusAnnotationInfo -> m (Maybe Text)
getDBusAnnotationInfoValue s :: DBusAnnotationInfo
s = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ DBusAnnotationInfo
-> (Ptr DBusAnnotationInfo -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusAnnotationInfo
s ((Ptr DBusAnnotationInfo -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr DBusAnnotationInfo -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr DBusAnnotationInfo
ptr -> do
CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr DBusAnnotationInfo
ptr Ptr DBusAnnotationInfo -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16) :: IO CString
Maybe Text
result <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull CString
val ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \val' :: CString
val' -> do
Text
val'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
val'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
val''
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
result
setDBusAnnotationInfoValue :: MonadIO m => DBusAnnotationInfo -> CString -> m ()
setDBusAnnotationInfoValue :: DBusAnnotationInfo -> CString -> m ()
setDBusAnnotationInfoValue s :: DBusAnnotationInfo
s val :: CString
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ DBusAnnotationInfo -> (Ptr DBusAnnotationInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusAnnotationInfo
s ((Ptr DBusAnnotationInfo -> IO ()) -> IO ())
-> (Ptr DBusAnnotationInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr DBusAnnotationInfo
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusAnnotationInfo
ptr Ptr DBusAnnotationInfo -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16) (CString
val :: CString)
clearDBusAnnotationInfoValue :: MonadIO m => DBusAnnotationInfo -> m ()
clearDBusAnnotationInfoValue :: DBusAnnotationInfo -> m ()
clearDBusAnnotationInfoValue s :: DBusAnnotationInfo
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ DBusAnnotationInfo -> (Ptr DBusAnnotationInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusAnnotationInfo
s ((Ptr DBusAnnotationInfo -> IO ()) -> IO ())
-> (Ptr DBusAnnotationInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr DBusAnnotationInfo
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusAnnotationInfo
ptr Ptr DBusAnnotationInfo -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 16) (CString
forall a. Ptr a
FP.nullPtr :: CString)
#if defined(ENABLE_OVERLOADING)
data DBusAnnotationInfoValueFieldInfo
instance AttrInfo DBusAnnotationInfoValueFieldInfo where
type AttrBaseTypeConstraint DBusAnnotationInfoValueFieldInfo = (~) DBusAnnotationInfo
type AttrAllowedOps DBusAnnotationInfoValueFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DBusAnnotationInfoValueFieldInfo = (~) CString
type AttrTransferTypeConstraint DBusAnnotationInfoValueFieldInfo = (~)CString
type AttrTransferType DBusAnnotationInfoValueFieldInfo = CString
type AttrGetType DBusAnnotationInfoValueFieldInfo = Maybe T.Text
type AttrLabel DBusAnnotationInfoValueFieldInfo = "value"
type AttrOrigin DBusAnnotationInfoValueFieldInfo = DBusAnnotationInfo
attrGet = getDBusAnnotationInfoValue
attrSet = setDBusAnnotationInfoValue
attrConstruct = undefined
attrClear = clearDBusAnnotationInfoValue
attrTransfer _ v = do
return v
dBusAnnotationInfo_value :: AttrLabelProxy "value"
dBusAnnotationInfo_value = AttrLabelProxy
#endif
getDBusAnnotationInfoAnnotations :: MonadIO m => DBusAnnotationInfo -> m (Maybe [DBusAnnotationInfo])
getDBusAnnotationInfoAnnotations :: DBusAnnotationInfo -> m (Maybe [DBusAnnotationInfo])
getDBusAnnotationInfoAnnotations s :: DBusAnnotationInfo
s = IO (Maybe [DBusAnnotationInfo]) -> m (Maybe [DBusAnnotationInfo])
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe [DBusAnnotationInfo]) -> m (Maybe [DBusAnnotationInfo]))
-> IO (Maybe [DBusAnnotationInfo])
-> m (Maybe [DBusAnnotationInfo])
forall a b. (a -> b) -> a -> b
$ DBusAnnotationInfo
-> (Ptr DBusAnnotationInfo -> IO (Maybe [DBusAnnotationInfo]))
-> IO (Maybe [DBusAnnotationInfo])
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusAnnotationInfo
s ((Ptr DBusAnnotationInfo -> IO (Maybe [DBusAnnotationInfo]))
-> IO (Maybe [DBusAnnotationInfo]))
-> (Ptr DBusAnnotationInfo -> IO (Maybe [DBusAnnotationInfo]))
-> IO (Maybe [DBusAnnotationInfo])
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr DBusAnnotationInfo
ptr -> do
Ptr (Ptr DBusAnnotationInfo)
val <- Ptr (Ptr (Ptr DBusAnnotationInfo))
-> IO (Ptr (Ptr DBusAnnotationInfo))
forall a. Storable a => Ptr a -> IO a
peek (Ptr DBusAnnotationInfo
ptr Ptr DBusAnnotationInfo -> Int -> Ptr (Ptr (Ptr DBusAnnotationInfo))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24) :: IO (Ptr (Ptr DBusAnnotationInfo))
Maybe [DBusAnnotationInfo]
result <- Ptr (Ptr DBusAnnotationInfo)
-> (Ptr (Ptr DBusAnnotationInfo) -> IO [DBusAnnotationInfo])
-> IO (Maybe [DBusAnnotationInfo])
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull Ptr (Ptr DBusAnnotationInfo)
val ((Ptr (Ptr DBusAnnotationInfo) -> IO [DBusAnnotationInfo])
-> IO (Maybe [DBusAnnotationInfo]))
-> (Ptr (Ptr DBusAnnotationInfo) -> IO [DBusAnnotationInfo])
-> IO (Maybe [DBusAnnotationInfo])
forall a b. (a -> b) -> a -> b
$ \val' :: Ptr (Ptr DBusAnnotationInfo)
val' -> do
[Ptr DBusAnnotationInfo]
val'' <- Ptr (Ptr DBusAnnotationInfo) -> IO [Ptr DBusAnnotationInfo]
forall a. Ptr (Ptr a) -> IO [Ptr a]
unpackZeroTerminatedPtrArray Ptr (Ptr DBusAnnotationInfo)
val'
[DBusAnnotationInfo]
val''' <- (Ptr DBusAnnotationInfo -> IO DBusAnnotationInfo)
-> [Ptr DBusAnnotationInfo] -> IO [DBusAnnotationInfo]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM ((ManagedPtr DBusAnnotationInfo -> DBusAnnotationInfo)
-> Ptr DBusAnnotationInfo -> IO DBusAnnotationInfo
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr DBusAnnotationInfo -> DBusAnnotationInfo
DBusAnnotationInfo) [Ptr DBusAnnotationInfo]
val''
[DBusAnnotationInfo] -> IO [DBusAnnotationInfo]
forall (m :: * -> *) a. Monad m => a -> m a
return [DBusAnnotationInfo]
val'''
Maybe [DBusAnnotationInfo] -> IO (Maybe [DBusAnnotationInfo])
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe [DBusAnnotationInfo]
result
setDBusAnnotationInfoAnnotations :: MonadIO m => DBusAnnotationInfo -> Ptr (Ptr DBusAnnotationInfo) -> m ()
setDBusAnnotationInfoAnnotations :: DBusAnnotationInfo -> Ptr (Ptr DBusAnnotationInfo) -> m ()
setDBusAnnotationInfoAnnotations s :: DBusAnnotationInfo
s val :: Ptr (Ptr DBusAnnotationInfo)
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ DBusAnnotationInfo -> (Ptr DBusAnnotationInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusAnnotationInfo
s ((Ptr DBusAnnotationInfo -> IO ()) -> IO ())
-> (Ptr DBusAnnotationInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr DBusAnnotationInfo
ptr -> do
Ptr (Ptr (Ptr DBusAnnotationInfo))
-> Ptr (Ptr DBusAnnotationInfo) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusAnnotationInfo
ptr Ptr DBusAnnotationInfo -> Int -> Ptr (Ptr (Ptr DBusAnnotationInfo))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24) (Ptr (Ptr DBusAnnotationInfo)
val :: Ptr (Ptr DBusAnnotationInfo))
clearDBusAnnotationInfoAnnotations :: MonadIO m => DBusAnnotationInfo -> m ()
clearDBusAnnotationInfoAnnotations :: DBusAnnotationInfo -> m ()
clearDBusAnnotationInfoAnnotations s :: DBusAnnotationInfo
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ DBusAnnotationInfo -> (Ptr DBusAnnotationInfo -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr DBusAnnotationInfo
s ((Ptr DBusAnnotationInfo -> IO ()) -> IO ())
-> (Ptr DBusAnnotationInfo -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \ptr :: Ptr DBusAnnotationInfo
ptr -> do
Ptr (Ptr (Ptr DBusAnnotationInfo))
-> Ptr (Ptr DBusAnnotationInfo) -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr DBusAnnotationInfo
ptr Ptr DBusAnnotationInfo -> Int -> Ptr (Ptr (Ptr DBusAnnotationInfo))
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` 24) (Ptr (Ptr DBusAnnotationInfo)
forall a. Ptr a
FP.nullPtr :: Ptr (Ptr DBusAnnotationInfo))
#if defined(ENABLE_OVERLOADING)
data DBusAnnotationInfoAnnotationsFieldInfo
instance AttrInfo DBusAnnotationInfoAnnotationsFieldInfo where
type AttrBaseTypeConstraint DBusAnnotationInfoAnnotationsFieldInfo = (~) DBusAnnotationInfo
type AttrAllowedOps DBusAnnotationInfoAnnotationsFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint DBusAnnotationInfoAnnotationsFieldInfo = (~) (Ptr (Ptr DBusAnnotationInfo))
type AttrTransferTypeConstraint DBusAnnotationInfoAnnotationsFieldInfo = (~)(Ptr (Ptr DBusAnnotationInfo))
type AttrTransferType DBusAnnotationInfoAnnotationsFieldInfo = (Ptr (Ptr DBusAnnotationInfo))
type AttrGetType DBusAnnotationInfoAnnotationsFieldInfo = Maybe [DBusAnnotationInfo]
type AttrLabel DBusAnnotationInfoAnnotationsFieldInfo = "annotations"
type AttrOrigin DBusAnnotationInfoAnnotationsFieldInfo = DBusAnnotationInfo
attrGet = getDBusAnnotationInfoAnnotations
attrSet = setDBusAnnotationInfoAnnotations
attrConstruct = undefined
attrClear = clearDBusAnnotationInfoAnnotations
attrTransfer _ v = do
return v
dBusAnnotationInfo_annotations :: AttrLabelProxy "annotations"
dBusAnnotationInfo_annotations = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList DBusAnnotationInfo
type instance O.AttributeList DBusAnnotationInfo = DBusAnnotationInfoAttributeList
type DBusAnnotationInfoAttributeList = ('[ '("refCount", DBusAnnotationInfoRefCountFieldInfo), '("key", DBusAnnotationInfoKeyFieldInfo), '("value", DBusAnnotationInfoValueFieldInfo), '("annotations", DBusAnnotationInfoAnnotationsFieldInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_dbus_annotation_info_ref" g_dbus_annotation_info_ref ::
Ptr DBusAnnotationInfo ->
IO (Ptr DBusAnnotationInfo)
dBusAnnotationInfoRef ::
(B.CallStack.HasCallStack, MonadIO m) =>
DBusAnnotationInfo
-> m DBusAnnotationInfo
dBusAnnotationInfoRef :: DBusAnnotationInfo -> m DBusAnnotationInfo
dBusAnnotationInfoRef info :: DBusAnnotationInfo
info = IO DBusAnnotationInfo -> m DBusAnnotationInfo
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO DBusAnnotationInfo -> m DBusAnnotationInfo)
-> IO DBusAnnotationInfo -> m DBusAnnotationInfo
forall a b. (a -> b) -> a -> b
$ do
Ptr DBusAnnotationInfo
info' <- DBusAnnotationInfo -> IO (Ptr DBusAnnotationInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DBusAnnotationInfo
info
Ptr DBusAnnotationInfo
result <- Ptr DBusAnnotationInfo -> IO (Ptr DBusAnnotationInfo)
g_dbus_annotation_info_ref Ptr DBusAnnotationInfo
info'
Text -> Ptr DBusAnnotationInfo -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dBusAnnotationInfoRef" Ptr DBusAnnotationInfo
result
DBusAnnotationInfo
result' <- ((ManagedPtr DBusAnnotationInfo -> DBusAnnotationInfo)
-> Ptr DBusAnnotationInfo -> IO DBusAnnotationInfo
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr DBusAnnotationInfo -> DBusAnnotationInfo
DBusAnnotationInfo) Ptr DBusAnnotationInfo
result
DBusAnnotationInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DBusAnnotationInfo
info
DBusAnnotationInfo -> IO DBusAnnotationInfo
forall (m :: * -> *) a. Monad m => a -> m a
return DBusAnnotationInfo
result'
#if defined(ENABLE_OVERLOADING)
data DBusAnnotationInfoRefMethodInfo
instance (signature ~ (m DBusAnnotationInfo), MonadIO m) => O.MethodInfo DBusAnnotationInfoRefMethodInfo DBusAnnotationInfo signature where
overloadedMethod = dBusAnnotationInfoRef
#endif
foreign import ccall "g_dbus_annotation_info_unref" g_dbus_annotation_info_unref ::
Ptr DBusAnnotationInfo ->
IO ()
dBusAnnotationInfoUnref ::
(B.CallStack.HasCallStack, MonadIO m) =>
DBusAnnotationInfo
-> m ()
dBusAnnotationInfoUnref :: DBusAnnotationInfo -> m ()
dBusAnnotationInfoUnref info :: DBusAnnotationInfo
info = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr DBusAnnotationInfo
info' <- DBusAnnotationInfo -> IO (Ptr DBusAnnotationInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr DBusAnnotationInfo
info
Ptr DBusAnnotationInfo -> IO ()
g_dbus_annotation_info_unref Ptr DBusAnnotationInfo
info'
DBusAnnotationInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr DBusAnnotationInfo
info
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data DBusAnnotationInfoUnrefMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo DBusAnnotationInfoUnrefMethodInfo DBusAnnotationInfo signature where
overloadedMethod = dBusAnnotationInfoUnref
#endif
foreign import ccall "g_dbus_annotation_info_lookup" g_dbus_annotation_info_lookup ::
Ptr (Ptr DBusAnnotationInfo) ->
CString ->
IO CString
dBusAnnotationInfoLookup ::
(B.CallStack.HasCallStack, MonadIO m) =>
Maybe ([DBusAnnotationInfo])
-> T.Text
-> m T.Text
dBusAnnotationInfoLookup :: Maybe [DBusAnnotationInfo] -> Text -> m Text
dBusAnnotationInfoLookup annotations :: Maybe [DBusAnnotationInfo]
annotations name :: Text
name = IO Text -> m Text
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Text -> m Text) -> IO Text -> m Text
forall a b. (a -> b) -> a -> b
$ do
Ptr (Ptr DBusAnnotationInfo)
maybeAnnotations <- case Maybe [DBusAnnotationInfo]
annotations of
Nothing -> Ptr (Ptr DBusAnnotationInfo) -> IO (Ptr (Ptr DBusAnnotationInfo))
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr (Ptr DBusAnnotationInfo)
forall a. Ptr a
nullPtr
Just jAnnotations :: [DBusAnnotationInfo]
jAnnotations -> do
[Ptr DBusAnnotationInfo]
jAnnotations' <- (DBusAnnotationInfo -> IO (Ptr DBusAnnotationInfo))
-> [DBusAnnotationInfo] -> IO [Ptr DBusAnnotationInfo]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM DBusAnnotationInfo -> IO (Ptr DBusAnnotationInfo)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [DBusAnnotationInfo]
jAnnotations
Ptr (Ptr DBusAnnotationInfo)
jAnnotations'' <- [Ptr DBusAnnotationInfo] -> IO (Ptr (Ptr DBusAnnotationInfo))
forall a. [Ptr a] -> IO (Ptr (Ptr a))
packZeroTerminatedPtrArray [Ptr DBusAnnotationInfo]
jAnnotations'
Ptr (Ptr DBusAnnotationInfo) -> IO (Ptr (Ptr DBusAnnotationInfo))
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr (Ptr DBusAnnotationInfo)
jAnnotations''
CString
name' <- Text -> IO CString
textToCString Text
name
CString
result <- Ptr (Ptr DBusAnnotationInfo) -> CString -> IO CString
g_dbus_annotation_info_lookup Ptr (Ptr DBusAnnotationInfo)
maybeAnnotations CString
name'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "dBusAnnotationInfoLookup" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
Maybe [DBusAnnotationInfo]
-> ([DBusAnnotationInfo] -> IO ()) -> IO ()
forall (m :: * -> *) a. Monad m => Maybe a -> (a -> m ()) -> m ()
whenJust Maybe [DBusAnnotationInfo]
annotations ((DBusAnnotationInfo -> IO ()) -> [DBusAnnotationInfo] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ DBusAnnotationInfo -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr)
Ptr (Ptr DBusAnnotationInfo) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr DBusAnnotationInfo)
maybeAnnotations
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
name'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveDBusAnnotationInfoMethod (t :: Symbol) (o :: *) :: * where
ResolveDBusAnnotationInfoMethod "ref" o = DBusAnnotationInfoRefMethodInfo
ResolveDBusAnnotationInfoMethod "unref" o = DBusAnnotationInfoUnrefMethodInfo
ResolveDBusAnnotationInfoMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveDBusAnnotationInfoMethod t DBusAnnotationInfo, O.MethodInfo info DBusAnnotationInfo p) => OL.IsLabel t (DBusAnnotationInfo -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif