{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GLib.Structs.VariantType
(
VariantType(..) ,
noVariantType ,
#if defined(ENABLE_OVERLOADING)
ResolveVariantTypeMethod ,
#endif
variantTypeChecked_ ,
#if defined(ENABLE_OVERLOADING)
VariantTypeCopyMethodInfo ,
#endif
variantTypeCopy ,
#if defined(ENABLE_OVERLOADING)
VariantTypeDupStringMethodInfo ,
#endif
variantTypeDupString ,
#if defined(ENABLE_OVERLOADING)
VariantTypeElementMethodInfo ,
#endif
variantTypeElement ,
#if defined(ENABLE_OVERLOADING)
VariantTypeEqualMethodInfo ,
#endif
variantTypeEqual ,
#if defined(ENABLE_OVERLOADING)
VariantTypeFirstMethodInfo ,
#endif
variantTypeFirst ,
#if defined(ENABLE_OVERLOADING)
VariantTypeFreeMethodInfo ,
#endif
variantTypeFree ,
#if defined(ENABLE_OVERLOADING)
VariantTypeGetStringLengthMethodInfo ,
#endif
variantTypeGetStringLength ,
#if defined(ENABLE_OVERLOADING)
VariantTypeHashMethodInfo ,
#endif
variantTypeHash ,
#if defined(ENABLE_OVERLOADING)
VariantTypeIsArrayMethodInfo ,
#endif
variantTypeIsArray ,
#if defined(ENABLE_OVERLOADING)
VariantTypeIsBasicMethodInfo ,
#endif
variantTypeIsBasic ,
#if defined(ENABLE_OVERLOADING)
VariantTypeIsContainerMethodInfo ,
#endif
variantTypeIsContainer ,
#if defined(ENABLE_OVERLOADING)
VariantTypeIsDefiniteMethodInfo ,
#endif
variantTypeIsDefinite ,
#if defined(ENABLE_OVERLOADING)
VariantTypeIsDictEntryMethodInfo ,
#endif
variantTypeIsDictEntry ,
#if defined(ENABLE_OVERLOADING)
VariantTypeIsMaybeMethodInfo ,
#endif
variantTypeIsMaybe ,
#if defined(ENABLE_OVERLOADING)
VariantTypeIsSubtypeOfMethodInfo ,
#endif
variantTypeIsSubtypeOf ,
#if defined(ENABLE_OVERLOADING)
VariantTypeIsTupleMethodInfo ,
#endif
variantTypeIsTuple ,
#if defined(ENABLE_OVERLOADING)
VariantTypeIsVariantMethodInfo ,
#endif
variantTypeIsVariant ,
#if defined(ENABLE_OVERLOADING)
VariantTypeKeyMethodInfo ,
#endif
variantTypeKey ,
#if defined(ENABLE_OVERLOADING)
VariantTypeNItemsMethodInfo ,
#endif
variantTypeNItems ,
variantTypeNew ,
variantTypeNewArray ,
variantTypeNewDictEntry ,
variantTypeNewMaybe ,
variantTypeNewTuple ,
#if defined(ENABLE_OVERLOADING)
VariantTypeNextMethodInfo ,
#endif
variantTypeNext ,
variantTypeStringGetDepth_ ,
variantTypeStringIsValid ,
variantTypeStringScan ,
#if defined(ENABLE_OVERLOADING)
VariantTypeValueMethodInfo ,
#endif
variantTypeValue ,
) 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 VariantType = VariantType (ManagedPtr VariantType)
deriving (VariantType -> VariantType -> Bool
(VariantType -> VariantType -> Bool)
-> (VariantType -> VariantType -> Bool) -> Eq VariantType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VariantType -> VariantType -> Bool
$c/= :: VariantType -> VariantType -> Bool
== :: VariantType -> VariantType -> Bool
$c== :: VariantType -> VariantType -> Bool
Eq)
foreign import ccall "g_variant_type_get_gtype" c_g_variant_type_get_gtype ::
IO GType
instance BoxedObject VariantType where
boxedType :: VariantType -> IO GType
boxedType _ = IO GType
c_g_variant_type_get_gtype
instance B.GValue.IsGValue VariantType where
toGValue :: VariantType -> IO GValue
toGValue o :: VariantType
o = do
GType
gtype <- IO GType
c_g_variant_type_get_gtype
VariantType -> (Ptr VariantType -> IO GValue) -> IO GValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr VariantType
o (GType
-> (GValue -> Ptr VariantType -> IO ())
-> Ptr VariantType
-> IO GValue
forall a. GType -> (GValue -> a -> IO ()) -> a -> IO GValue
B.GValue.buildGValue GType
gtype GValue -> Ptr VariantType -> IO ()
forall a. GValue -> Ptr a -> IO ()
B.GValue.set_boxed)
fromGValue :: GValue -> IO VariantType
fromGValue gv :: GValue
gv = do
Ptr VariantType
ptr <- GValue -> IO (Ptr VariantType)
forall b. GValue -> IO (Ptr b)
B.GValue.get_boxed GValue
gv :: IO (Ptr VariantType)
(ManagedPtr VariantType -> VariantType)
-> Ptr VariantType -> IO VariantType
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.newBoxed ManagedPtr VariantType -> VariantType
VariantType Ptr VariantType
ptr
noVariantType :: Maybe VariantType
noVariantType :: Maybe VariantType
noVariantType = Maybe VariantType
forall a. Maybe a
Nothing
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList VariantType
type instance O.AttributeList VariantType = VariantTypeAttributeList
type VariantTypeAttributeList = ('[ ] :: [(Symbol, *)])
#endif
foreign import ccall "g_variant_type_new" g_variant_type_new ::
CString ->
IO (Ptr VariantType)
variantTypeNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m VariantType
variantTypeNew :: Text -> m VariantType
variantTypeNew typeString :: Text
typeString = IO VariantType -> m VariantType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VariantType -> m VariantType)
-> IO VariantType -> m VariantType
forall a b. (a -> b) -> a -> b
$ do
CString
typeString' <- Text -> IO CString
textToCString Text
typeString
Ptr VariantType
result <- CString -> IO (Ptr VariantType)
g_variant_type_new CString
typeString'
Text -> Ptr VariantType -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "variantTypeNew" Ptr VariantType
result
VariantType
result' <- ((ManagedPtr VariantType -> VariantType)
-> Ptr VariantType -> IO VariantType
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr VariantType -> VariantType
VariantType) Ptr VariantType
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
typeString'
VariantType -> IO VariantType
forall (m :: * -> *) a. Monad m => a -> m a
return VariantType
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_variant_type_new_array" g_variant_type_new_array ::
Ptr VariantType ->
IO (Ptr VariantType)
variantTypeNewArray ::
(B.CallStack.HasCallStack, MonadIO m) =>
VariantType
-> m VariantType
variantTypeNewArray :: VariantType -> m VariantType
variantTypeNewArray element :: VariantType
element = IO VariantType -> m VariantType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VariantType -> m VariantType)
-> IO VariantType -> m VariantType
forall a b. (a -> b) -> a -> b
$ do
Ptr VariantType
element' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
element
Ptr VariantType
result <- Ptr VariantType -> IO (Ptr VariantType)
g_variant_type_new_array Ptr VariantType
element'
Text -> Ptr VariantType -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "variantTypeNewArray" Ptr VariantType
result
VariantType
result' <- ((ManagedPtr VariantType -> VariantType)
-> Ptr VariantType -> IO VariantType
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr VariantType -> VariantType
VariantType) Ptr VariantType
result
VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariantType
element
VariantType -> IO VariantType
forall (m :: * -> *) a. Monad m => a -> m a
return VariantType
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_variant_type_new_dict_entry" g_variant_type_new_dict_entry ::
Ptr VariantType ->
Ptr VariantType ->
IO (Ptr VariantType)
variantTypeNewDictEntry ::
(B.CallStack.HasCallStack, MonadIO m) =>
VariantType
-> VariantType
-> m VariantType
variantTypeNewDictEntry :: VariantType -> VariantType -> m VariantType
variantTypeNewDictEntry key :: VariantType
key value :: VariantType
value = IO VariantType -> m VariantType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VariantType -> m VariantType)
-> IO VariantType -> m VariantType
forall a b. (a -> b) -> a -> b
$ do
Ptr VariantType
key' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
key
Ptr VariantType
value' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
value
Ptr VariantType
result <- Ptr VariantType -> Ptr VariantType -> IO (Ptr VariantType)
g_variant_type_new_dict_entry Ptr VariantType
key' Ptr VariantType
value'
Text -> Ptr VariantType -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "variantTypeNewDictEntry" Ptr VariantType
result
VariantType
result' <- ((ManagedPtr VariantType -> VariantType)
-> Ptr VariantType -> IO VariantType
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr VariantType -> VariantType
VariantType) Ptr VariantType
result
VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariantType
key
VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariantType
value
VariantType -> IO VariantType
forall (m :: * -> *) a. Monad m => a -> m a
return VariantType
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_variant_type_new_maybe" g_variant_type_new_maybe ::
Ptr VariantType ->
IO (Ptr VariantType)
variantTypeNewMaybe ::
(B.CallStack.HasCallStack, MonadIO m) =>
VariantType
-> m VariantType
variantTypeNewMaybe :: VariantType -> m VariantType
variantTypeNewMaybe element :: VariantType
element = IO VariantType -> m VariantType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VariantType -> m VariantType)
-> IO VariantType -> m VariantType
forall a b. (a -> b) -> a -> b
$ do
Ptr VariantType
element' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
element
Ptr VariantType
result <- Ptr VariantType -> IO (Ptr VariantType)
g_variant_type_new_maybe Ptr VariantType
element'
Text -> Ptr VariantType -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "variantTypeNewMaybe" Ptr VariantType
result
VariantType
result' <- ((ManagedPtr VariantType -> VariantType)
-> Ptr VariantType -> IO VariantType
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr VariantType -> VariantType
VariantType) Ptr VariantType
result
VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariantType
element
VariantType -> IO VariantType
forall (m :: * -> *) a. Monad m => a -> m a
return VariantType
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_variant_type_new_tuple" g_variant_type_new_tuple ::
Ptr (Ptr VariantType) ->
Int32 ->
IO (Ptr VariantType)
variantTypeNewTuple ::
(B.CallStack.HasCallStack, MonadIO m) =>
[VariantType]
-> m VariantType
variantTypeNewTuple :: [VariantType] -> m VariantType
variantTypeNewTuple items :: [VariantType]
items = IO VariantType -> m VariantType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VariantType -> m VariantType)
-> IO VariantType -> m VariantType
forall a b. (a -> b) -> a -> b
$ do
let length_ :: Int32
length_ = Int -> Int32
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Int32) -> Int -> Int32
forall a b. (a -> b) -> a -> b
$ [VariantType] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [VariantType]
items
[Ptr VariantType]
items' <- (VariantType -> IO (Ptr VariantType))
-> [VariantType] -> IO [Ptr VariantType]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr [VariantType]
items
Ptr (Ptr VariantType)
items'' <- [Ptr VariantType] -> IO (Ptr (Ptr VariantType))
forall a. [Ptr a] -> IO (Ptr (Ptr a))
packPtrArray [Ptr VariantType]
items'
Ptr VariantType
result <- Ptr (Ptr VariantType) -> Int32 -> IO (Ptr VariantType)
g_variant_type_new_tuple Ptr (Ptr VariantType)
items'' Int32
length_
Text -> Ptr VariantType -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "variantTypeNewTuple" Ptr VariantType
result
VariantType
result' <- ((ManagedPtr VariantType -> VariantType)
-> Ptr VariantType -> IO VariantType
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr VariantType -> VariantType
VariantType) Ptr VariantType
result
(VariantType -> IO ()) -> [VariantType] -> IO ()
forall (t :: * -> *) (m :: * -> *) a b.
(Foldable t, Monad m) =>
(a -> m b) -> t a -> m ()
mapM_ VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr [VariantType]
items
Ptr (Ptr VariantType) -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr (Ptr VariantType)
items''
VariantType -> IO VariantType
forall (m :: * -> *) a. Monad m => a -> m a
return VariantType
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_variant_type_copy" g_variant_type_copy ::
Ptr VariantType ->
IO (Ptr VariantType)
variantTypeCopy ::
(B.CallStack.HasCallStack, MonadIO m) =>
VariantType
-> m VariantType
variantTypeCopy :: VariantType -> m VariantType
variantTypeCopy type_ :: VariantType
type_ = IO VariantType -> m VariantType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VariantType -> m VariantType)
-> IO VariantType -> m VariantType
forall a b. (a -> b) -> a -> b
$ do
Ptr VariantType
type_' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
type_
Ptr VariantType
result <- Ptr VariantType -> IO (Ptr VariantType)
g_variant_type_copy Ptr VariantType
type_'
Text -> Ptr VariantType -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "variantTypeCopy" Ptr VariantType
result
VariantType
result' <- ((ManagedPtr VariantType -> VariantType)
-> Ptr VariantType -> IO VariantType
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr VariantType -> VariantType
VariantType) Ptr VariantType
result
VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariantType
type_
VariantType -> IO VariantType
forall (m :: * -> *) a. Monad m => a -> m a
return VariantType
result'
#if defined(ENABLE_OVERLOADING)
data VariantTypeCopyMethodInfo
instance (signature ~ (m VariantType), MonadIO m) => O.MethodInfo VariantTypeCopyMethodInfo VariantType signature where
overloadedMethod = variantTypeCopy
#endif
foreign import ccall "g_variant_type_dup_string" g_variant_type_dup_string ::
Ptr VariantType ->
IO CString
variantTypeDupString ::
(B.CallStack.HasCallStack, MonadIO m) =>
VariantType
-> m T.Text
variantTypeDupString :: VariantType -> m Text
variantTypeDupString type_ :: VariantType
type_ = 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 VariantType
type_' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
type_
CString
result <- Ptr VariantType -> IO CString
g_variant_type_dup_string Ptr VariantType
type_'
Text -> CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "variantTypeDupString" CString
result
Text
result' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
result
VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariantType
type_
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
result'
#if defined(ENABLE_OVERLOADING)
data VariantTypeDupStringMethodInfo
instance (signature ~ (m T.Text), MonadIO m) => O.MethodInfo VariantTypeDupStringMethodInfo VariantType signature where
overloadedMethod = variantTypeDupString
#endif
foreign import ccall "g_variant_type_element" g_variant_type_element ::
Ptr VariantType ->
IO (Ptr VariantType)
variantTypeElement ::
(B.CallStack.HasCallStack, MonadIO m) =>
VariantType
-> m VariantType
variantTypeElement :: VariantType -> m VariantType
variantTypeElement type_ :: VariantType
type_ = IO VariantType -> m VariantType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VariantType -> m VariantType)
-> IO VariantType -> m VariantType
forall a b. (a -> b) -> a -> b
$ do
Ptr VariantType
type_' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
type_
Ptr VariantType
result <- Ptr VariantType -> IO (Ptr VariantType)
g_variant_type_element Ptr VariantType
type_'
Text -> Ptr VariantType -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "variantTypeElement" Ptr VariantType
result
VariantType
result' <- ((ManagedPtr VariantType -> VariantType)
-> Ptr VariantType -> IO VariantType
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr VariantType -> VariantType
VariantType) Ptr VariantType
result
VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariantType
type_
VariantType -> IO VariantType
forall (m :: * -> *) a. Monad m => a -> m a
return VariantType
result'
#if defined(ENABLE_OVERLOADING)
data VariantTypeElementMethodInfo
instance (signature ~ (m VariantType), MonadIO m) => O.MethodInfo VariantTypeElementMethodInfo VariantType signature where
overloadedMethod = variantTypeElement
#endif
foreign import ccall "g_variant_type_equal" g_variant_type_equal ::
Ptr VariantType ->
Ptr VariantType ->
IO CInt
variantTypeEqual ::
(B.CallStack.HasCallStack, MonadIO m) =>
VariantType
-> VariantType
-> m Bool
variantTypeEqual :: VariantType -> VariantType -> m Bool
variantTypeEqual type1 :: VariantType
type1 type2 :: VariantType
type2 = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr VariantType
type1' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
type1
Ptr VariantType
type2' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
type2
CInt
result <- Ptr VariantType -> Ptr VariantType -> IO CInt
g_variant_type_equal Ptr VariantType
type1' Ptr VariantType
type2'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariantType
type1
VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariantType
type2
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data VariantTypeEqualMethodInfo
instance (signature ~ (VariantType -> m Bool), MonadIO m) => O.MethodInfo VariantTypeEqualMethodInfo VariantType signature where
overloadedMethod = variantTypeEqual
#endif
foreign import ccall "g_variant_type_first" g_variant_type_first ::
Ptr VariantType ->
IO (Ptr VariantType)
variantTypeFirst ::
(B.CallStack.HasCallStack, MonadIO m) =>
VariantType
-> m VariantType
variantTypeFirst :: VariantType -> m VariantType
variantTypeFirst type_ :: VariantType
type_ = IO VariantType -> m VariantType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VariantType -> m VariantType)
-> IO VariantType -> m VariantType
forall a b. (a -> b) -> a -> b
$ do
Ptr VariantType
type_' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
type_
Ptr VariantType
result <- Ptr VariantType -> IO (Ptr VariantType)
g_variant_type_first Ptr VariantType
type_'
Text -> Ptr VariantType -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "variantTypeFirst" Ptr VariantType
result
VariantType
result' <- ((ManagedPtr VariantType -> VariantType)
-> Ptr VariantType -> IO VariantType
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr VariantType -> VariantType
VariantType) Ptr VariantType
result
VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariantType
type_
VariantType -> IO VariantType
forall (m :: * -> *) a. Monad m => a -> m a
return VariantType
result'
#if defined(ENABLE_OVERLOADING)
data VariantTypeFirstMethodInfo
instance (signature ~ (m VariantType), MonadIO m) => O.MethodInfo VariantTypeFirstMethodInfo VariantType signature where
overloadedMethod = variantTypeFirst
#endif
foreign import ccall "g_variant_type_free" g_variant_type_free ::
Ptr VariantType ->
IO ()
variantTypeFree ::
(B.CallStack.HasCallStack, MonadIO m) =>
VariantType
-> m ()
variantTypeFree :: VariantType -> m ()
variantTypeFree type_ :: VariantType
type_ = 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 VariantType
type_' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
type_
Ptr VariantType -> IO ()
g_variant_type_free Ptr VariantType
type_'
VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariantType
type_
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data VariantTypeFreeMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo VariantTypeFreeMethodInfo VariantType signature where
overloadedMethod = variantTypeFree
#endif
foreign import ccall "g_variant_type_get_string_length" g_variant_type_get_string_length ::
Ptr VariantType ->
IO Word64
variantTypeGetStringLength ::
(B.CallStack.HasCallStack, MonadIO m) =>
VariantType
-> m Word64
variantTypeGetStringLength :: VariantType -> m Word64
variantTypeGetStringLength type_ :: VariantType
type_ = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
Ptr VariantType
type_' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
type_
Word64
result <- Ptr VariantType -> IO Word64
g_variant_type_get_string_length Ptr VariantType
type_'
VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariantType
type_
Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result
#if defined(ENABLE_OVERLOADING)
data VariantTypeGetStringLengthMethodInfo
instance (signature ~ (m Word64), MonadIO m) => O.MethodInfo VariantTypeGetStringLengthMethodInfo VariantType signature where
overloadedMethod = variantTypeGetStringLength
#endif
foreign import ccall "g_variant_type_hash" g_variant_type_hash ::
Ptr VariantType ->
IO Word32
variantTypeHash ::
(B.CallStack.HasCallStack, MonadIO m) =>
VariantType
-> m Word32
variantTypeHash :: VariantType -> m Word32
variantTypeHash type_ :: VariantType
type_ = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
Ptr VariantType
type_' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
type_
Word32
result <- Ptr VariantType -> IO Word32
g_variant_type_hash Ptr VariantType
type_'
VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariantType
type_
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data VariantTypeHashMethodInfo
instance (signature ~ (m Word32), MonadIO m) => O.MethodInfo VariantTypeHashMethodInfo VariantType signature where
overloadedMethod = variantTypeHash
#endif
foreign import ccall "g_variant_type_is_array" g_variant_type_is_array ::
Ptr VariantType ->
IO CInt
variantTypeIsArray ::
(B.CallStack.HasCallStack, MonadIO m) =>
VariantType
-> m Bool
variantTypeIsArray :: VariantType -> m Bool
variantTypeIsArray type_ :: VariantType
type_ = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr VariantType
type_' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
type_
CInt
result <- Ptr VariantType -> IO CInt
g_variant_type_is_array Ptr VariantType
type_'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariantType
type_
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data VariantTypeIsArrayMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo VariantTypeIsArrayMethodInfo VariantType signature where
overloadedMethod = variantTypeIsArray
#endif
foreign import ccall "g_variant_type_is_basic" g_variant_type_is_basic ::
Ptr VariantType ->
IO CInt
variantTypeIsBasic ::
(B.CallStack.HasCallStack, MonadIO m) =>
VariantType
-> m Bool
variantTypeIsBasic :: VariantType -> m Bool
variantTypeIsBasic type_ :: VariantType
type_ = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr VariantType
type_' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
type_
CInt
result <- Ptr VariantType -> IO CInt
g_variant_type_is_basic Ptr VariantType
type_'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariantType
type_
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data VariantTypeIsBasicMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo VariantTypeIsBasicMethodInfo VariantType signature where
overloadedMethod = variantTypeIsBasic
#endif
foreign import ccall "g_variant_type_is_container" g_variant_type_is_container ::
Ptr VariantType ->
IO CInt
variantTypeIsContainer ::
(B.CallStack.HasCallStack, MonadIO m) =>
VariantType
-> m Bool
variantTypeIsContainer :: VariantType -> m Bool
variantTypeIsContainer type_ :: VariantType
type_ = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr VariantType
type_' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
type_
CInt
result <- Ptr VariantType -> IO CInt
g_variant_type_is_container Ptr VariantType
type_'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariantType
type_
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data VariantTypeIsContainerMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo VariantTypeIsContainerMethodInfo VariantType signature where
overloadedMethod = variantTypeIsContainer
#endif
foreign import ccall "g_variant_type_is_definite" g_variant_type_is_definite ::
Ptr VariantType ->
IO CInt
variantTypeIsDefinite ::
(B.CallStack.HasCallStack, MonadIO m) =>
VariantType
-> m Bool
variantTypeIsDefinite :: VariantType -> m Bool
variantTypeIsDefinite type_ :: VariantType
type_ = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr VariantType
type_' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
type_
CInt
result <- Ptr VariantType -> IO CInt
g_variant_type_is_definite Ptr VariantType
type_'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariantType
type_
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data VariantTypeIsDefiniteMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo VariantTypeIsDefiniteMethodInfo VariantType signature where
overloadedMethod = variantTypeIsDefinite
#endif
foreign import ccall "g_variant_type_is_dict_entry" g_variant_type_is_dict_entry ::
Ptr VariantType ->
IO CInt
variantTypeIsDictEntry ::
(B.CallStack.HasCallStack, MonadIO m) =>
VariantType
-> m Bool
variantTypeIsDictEntry :: VariantType -> m Bool
variantTypeIsDictEntry type_ :: VariantType
type_ = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr VariantType
type_' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
type_
CInt
result <- Ptr VariantType -> IO CInt
g_variant_type_is_dict_entry Ptr VariantType
type_'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariantType
type_
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data VariantTypeIsDictEntryMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo VariantTypeIsDictEntryMethodInfo VariantType signature where
overloadedMethod = variantTypeIsDictEntry
#endif
foreign import ccall "g_variant_type_is_maybe" g_variant_type_is_maybe ::
Ptr VariantType ->
IO CInt
variantTypeIsMaybe ::
(B.CallStack.HasCallStack, MonadIO m) =>
VariantType
-> m Bool
variantTypeIsMaybe :: VariantType -> m Bool
variantTypeIsMaybe type_ :: VariantType
type_ = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr VariantType
type_' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
type_
CInt
result <- Ptr VariantType -> IO CInt
g_variant_type_is_maybe Ptr VariantType
type_'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariantType
type_
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data VariantTypeIsMaybeMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo VariantTypeIsMaybeMethodInfo VariantType signature where
overloadedMethod = variantTypeIsMaybe
#endif
foreign import ccall "g_variant_type_is_subtype_of" g_variant_type_is_subtype_of ::
Ptr VariantType ->
Ptr VariantType ->
IO CInt
variantTypeIsSubtypeOf ::
(B.CallStack.HasCallStack, MonadIO m) =>
VariantType
-> VariantType
-> m Bool
variantTypeIsSubtypeOf :: VariantType -> VariantType -> m Bool
variantTypeIsSubtypeOf type_ :: VariantType
type_ supertype :: VariantType
supertype = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr VariantType
type_' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
type_
Ptr VariantType
supertype' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
supertype
CInt
result <- Ptr VariantType -> Ptr VariantType -> IO CInt
g_variant_type_is_subtype_of Ptr VariantType
type_' Ptr VariantType
supertype'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariantType
type_
VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariantType
supertype
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data VariantTypeIsSubtypeOfMethodInfo
instance (signature ~ (VariantType -> m Bool), MonadIO m) => O.MethodInfo VariantTypeIsSubtypeOfMethodInfo VariantType signature where
overloadedMethod = variantTypeIsSubtypeOf
#endif
foreign import ccall "g_variant_type_is_tuple" g_variant_type_is_tuple ::
Ptr VariantType ->
IO CInt
variantTypeIsTuple ::
(B.CallStack.HasCallStack, MonadIO m) =>
VariantType
-> m Bool
variantTypeIsTuple :: VariantType -> m Bool
variantTypeIsTuple type_ :: VariantType
type_ = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr VariantType
type_' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
type_
CInt
result <- Ptr VariantType -> IO CInt
g_variant_type_is_tuple Ptr VariantType
type_'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariantType
type_
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data VariantTypeIsTupleMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo VariantTypeIsTupleMethodInfo VariantType signature where
overloadedMethod = variantTypeIsTuple
#endif
foreign import ccall "g_variant_type_is_variant" g_variant_type_is_variant ::
Ptr VariantType ->
IO CInt
variantTypeIsVariant ::
(B.CallStack.HasCallStack, MonadIO m) =>
VariantType
-> m Bool
variantTypeIsVariant :: VariantType -> m Bool
variantTypeIsVariant type_ :: VariantType
type_ = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
Ptr VariantType
type_' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
type_
CInt
result <- Ptr VariantType -> IO CInt
g_variant_type_is_variant Ptr VariantType
type_'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariantType
type_
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data VariantTypeIsVariantMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo VariantTypeIsVariantMethodInfo VariantType signature where
overloadedMethod = variantTypeIsVariant
#endif
foreign import ccall "g_variant_type_key" g_variant_type_key ::
Ptr VariantType ->
IO (Ptr VariantType)
variantTypeKey ::
(B.CallStack.HasCallStack, MonadIO m) =>
VariantType
-> m VariantType
variantTypeKey :: VariantType -> m VariantType
variantTypeKey type_ :: VariantType
type_ = IO VariantType -> m VariantType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VariantType -> m VariantType)
-> IO VariantType -> m VariantType
forall a b. (a -> b) -> a -> b
$ do
Ptr VariantType
type_' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
type_
Ptr VariantType
result <- Ptr VariantType -> IO (Ptr VariantType)
g_variant_type_key Ptr VariantType
type_'
Text -> Ptr VariantType -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "variantTypeKey" Ptr VariantType
result
VariantType
result' <- ((ManagedPtr VariantType -> VariantType)
-> Ptr VariantType -> IO VariantType
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr VariantType -> VariantType
VariantType) Ptr VariantType
result
VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariantType
type_
VariantType -> IO VariantType
forall (m :: * -> *) a. Monad m => a -> m a
return VariantType
result'
#if defined(ENABLE_OVERLOADING)
data VariantTypeKeyMethodInfo
instance (signature ~ (m VariantType), MonadIO m) => O.MethodInfo VariantTypeKeyMethodInfo VariantType signature where
overloadedMethod = variantTypeKey
#endif
foreign import ccall "g_variant_type_n_items" g_variant_type_n_items ::
Ptr VariantType ->
IO Word64
variantTypeNItems ::
(B.CallStack.HasCallStack, MonadIO m) =>
VariantType
-> m Word64
variantTypeNItems :: VariantType -> m Word64
variantTypeNItems type_ :: VariantType
type_ = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
Ptr VariantType
type_' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
type_
Word64
result <- Ptr VariantType -> IO Word64
g_variant_type_n_items Ptr VariantType
type_'
VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariantType
type_
Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result
#if defined(ENABLE_OVERLOADING)
data VariantTypeNItemsMethodInfo
instance (signature ~ (m Word64), MonadIO m) => O.MethodInfo VariantTypeNItemsMethodInfo VariantType signature where
overloadedMethod = variantTypeNItems
#endif
foreign import ccall "g_variant_type_next" g_variant_type_next ::
Ptr VariantType ->
IO (Ptr VariantType)
variantTypeNext ::
(B.CallStack.HasCallStack, MonadIO m) =>
VariantType
-> m VariantType
variantTypeNext :: VariantType -> m VariantType
variantTypeNext type_ :: VariantType
type_ = IO VariantType -> m VariantType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VariantType -> m VariantType)
-> IO VariantType -> m VariantType
forall a b. (a -> b) -> a -> b
$ do
Ptr VariantType
type_' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
type_
Ptr VariantType
result <- Ptr VariantType -> IO (Ptr VariantType)
g_variant_type_next Ptr VariantType
type_'
Text -> Ptr VariantType -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "variantTypeNext" Ptr VariantType
result
VariantType
result' <- ((ManagedPtr VariantType -> VariantType)
-> Ptr VariantType -> IO VariantType
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr VariantType -> VariantType
VariantType) Ptr VariantType
result
VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariantType
type_
VariantType -> IO VariantType
forall (m :: * -> *) a. Monad m => a -> m a
return VariantType
result'
#if defined(ENABLE_OVERLOADING)
data VariantTypeNextMethodInfo
instance (signature ~ (m VariantType), MonadIO m) => O.MethodInfo VariantTypeNextMethodInfo VariantType signature where
overloadedMethod = variantTypeNext
#endif
foreign import ccall "g_variant_type_value" g_variant_type_value ::
Ptr VariantType ->
IO (Ptr VariantType)
variantTypeValue ::
(B.CallStack.HasCallStack, MonadIO m) =>
VariantType
-> m VariantType
variantTypeValue :: VariantType -> m VariantType
variantTypeValue type_ :: VariantType
type_ = IO VariantType -> m VariantType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VariantType -> m VariantType)
-> IO VariantType -> m VariantType
forall a b. (a -> b) -> a -> b
$ do
Ptr VariantType
type_' <- VariantType -> IO (Ptr VariantType)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr VariantType
type_
Ptr VariantType
result <- Ptr VariantType -> IO (Ptr VariantType)
g_variant_type_value Ptr VariantType
type_'
Text -> Ptr VariantType -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "variantTypeValue" Ptr VariantType
result
VariantType
result' <- ((ManagedPtr VariantType -> VariantType)
-> Ptr VariantType -> IO VariantType
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr VariantType -> VariantType
VariantType) Ptr VariantType
result
VariantType -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr VariantType
type_
VariantType -> IO VariantType
forall (m :: * -> *) a. Monad m => a -> m a
return VariantType
result'
#if defined(ENABLE_OVERLOADING)
data VariantTypeValueMethodInfo
instance (signature ~ (m VariantType), MonadIO m) => O.MethodInfo VariantTypeValueMethodInfo VariantType signature where
overloadedMethod = variantTypeValue
#endif
foreign import ccall "g_variant_type_checked_" g_variant_type_checked_ ::
CString ->
IO (Ptr VariantType)
variantTypeChecked_ ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m VariantType
variantTypeChecked_ :: Text -> m VariantType
variantTypeChecked_ arg0 :: Text
arg0 = IO VariantType -> m VariantType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO VariantType -> m VariantType)
-> IO VariantType -> m VariantType
forall a b. (a -> b) -> a -> b
$ do
CString
arg0' <- Text -> IO CString
textToCString Text
arg0
Ptr VariantType
result <- CString -> IO (Ptr VariantType)
g_variant_type_checked_ CString
arg0'
Text -> Ptr VariantType -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL "variantTypeChecked_" Ptr VariantType
result
VariantType
result' <- ((ManagedPtr VariantType -> VariantType)
-> Ptr VariantType -> IO VariantType
forall a.
(HasCallStack, BoxedObject a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newBoxed ManagedPtr VariantType -> VariantType
VariantType) Ptr VariantType
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
arg0'
VariantType -> IO VariantType
forall (m :: * -> *) a. Monad m => a -> m a
return VariantType
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_variant_type_string_get_depth_" g_variant_type_string_get_depth_ ::
CString ->
IO Word64
variantTypeStringGetDepth_ ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m Word64
variantTypeStringGetDepth_ :: Text -> m Word64
variantTypeStringGetDepth_ typeString :: Text
typeString = IO Word64 -> m Word64
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word64 -> m Word64) -> IO Word64 -> m Word64
forall a b. (a -> b) -> a -> b
$ do
CString
typeString' <- Text -> IO CString
textToCString Text
typeString
Word64
result <- CString -> IO Word64
g_variant_type_string_get_depth_ CString
typeString'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
typeString'
Word64 -> IO Word64
forall (m :: * -> *) a. Monad m => a -> m a
return Word64
result
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_variant_type_string_is_valid" g_variant_type_string_is_valid ::
CString ->
IO CInt
variantTypeStringIsValid ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> m Bool
variantTypeStringIsValid :: Text -> m Bool
variantTypeStringIsValid typeString :: Text
typeString = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
CString
typeString' <- Text -> IO CString
textToCString Text
typeString
CInt
result <- CString -> IO CInt
g_variant_type_string_is_valid CString
typeString'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
typeString'
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "g_variant_type_string_scan" g_variant_type_string_scan ::
CString ->
CString ->
Ptr CString ->
IO CInt
variantTypeStringScan ::
(B.CallStack.HasCallStack, MonadIO m) =>
T.Text
-> Maybe (T.Text)
-> m ((Bool, T.Text))
variantTypeStringScan :: Text -> Maybe Text -> m (Bool, Text)
variantTypeStringScan string :: Text
string limit :: Maybe Text
limit = IO (Bool, Text) -> m (Bool, Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Text) -> m (Bool, Text))
-> IO (Bool, Text) -> m (Bool, Text)
forall a b. (a -> b) -> a -> b
$ do
CString
string' <- Text -> IO CString
textToCString Text
string
CString
maybeLimit <- case Maybe Text
limit of
Nothing -> CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
forall a. Ptr a
nullPtr
Just jLimit :: Text
jLimit -> do
CString
jLimit' <- Text -> IO CString
textToCString Text
jLimit
CString -> IO CString
forall (m :: * -> *) a. Monad m => a -> m a
return CString
jLimit'
Ptr CString
endptr <- IO (Ptr CString)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CString)
CInt
result <- CString -> CString -> Ptr CString -> IO CInt
g_variant_type_string_scan CString
string' CString
maybeLimit Ptr CString
endptr
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) CInt
result
CString
endptr' <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek Ptr CString
endptr
Text
endptr'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
endptr'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
endptr'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
string'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
maybeLimit
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
endptr
(Bool, Text) -> IO (Bool, Text)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Text
endptr'')
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveVariantTypeMethod (t :: Symbol) (o :: *) :: * where
ResolveVariantTypeMethod "copy" o = VariantTypeCopyMethodInfo
ResolveVariantTypeMethod "dupString" o = VariantTypeDupStringMethodInfo
ResolveVariantTypeMethod "element" o = VariantTypeElementMethodInfo
ResolveVariantTypeMethod "equal" o = VariantTypeEqualMethodInfo
ResolveVariantTypeMethod "first" o = VariantTypeFirstMethodInfo
ResolveVariantTypeMethod "free" o = VariantTypeFreeMethodInfo
ResolveVariantTypeMethod "hash" o = VariantTypeHashMethodInfo
ResolveVariantTypeMethod "isArray" o = VariantTypeIsArrayMethodInfo
ResolveVariantTypeMethod "isBasic" o = VariantTypeIsBasicMethodInfo
ResolveVariantTypeMethod "isContainer" o = VariantTypeIsContainerMethodInfo
ResolveVariantTypeMethod "isDefinite" o = VariantTypeIsDefiniteMethodInfo
ResolveVariantTypeMethod "isDictEntry" o = VariantTypeIsDictEntryMethodInfo
ResolveVariantTypeMethod "isMaybe" o = VariantTypeIsMaybeMethodInfo
ResolveVariantTypeMethod "isSubtypeOf" o = VariantTypeIsSubtypeOfMethodInfo
ResolveVariantTypeMethod "isTuple" o = VariantTypeIsTupleMethodInfo
ResolveVariantTypeMethod "isVariant" o = VariantTypeIsVariantMethodInfo
ResolveVariantTypeMethod "key" o = VariantTypeKeyMethodInfo
ResolveVariantTypeMethod "nItems" o = VariantTypeNItemsMethodInfo
ResolveVariantTypeMethod "next" o = VariantTypeNextMethodInfo
ResolveVariantTypeMethod "value" o = VariantTypeValueMethodInfo
ResolveVariantTypeMethod "getStringLength" o = VariantTypeGetStringLengthMethodInfo
ResolveVariantTypeMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveVariantTypeMethod t VariantType, O.MethodInfo info VariantType p) => OL.IsLabel t (VariantType -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#endif