{-# LINE 1 "lib/Data/GI/CodeGen/GType.hsc" #-}
module Data.GI.CodeGen.GType
    ( GType     -- Reexport from Data.GI.Base.BasicTypes for convenience
    , gtypeIsA
    , gtypeIsBoxed
    ) where



import Foreign.C
import System.IO.Unsafe (unsafePerformIO)
import Data.GI.Base.BasicTypes (CGType, GType(..))

foreign import ccall unsafe "g_type_is_a" g_type_is_a ::
    CGType -> CGType -> IO CInt

gtypeIsA :: GType -> GType -> Bool
gtypeIsA :: GType -> GType -> Bool
gtypeIsA (GType gtype :: CGType
gtype) (GType is_a :: CGType
is_a) = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= 0) (CInt -> Bool) -> CInt -> Bool
forall a b. (a -> b) -> a -> b
$
    IO CInt -> CInt
forall a. IO a -> a
unsafePerformIO (IO CInt -> CInt) -> IO CInt -> CInt
forall a b. (a -> b) -> a -> b
$ CGType -> CGType -> IO CInt
g_type_is_a CGType
gtype CGType
is_a

gtypeBoxed :: GType
gtypeBoxed :: GType
gtypeBoxed = CGType -> GType
GType 72
{-# LINE 22 "lib/Data/GI/CodeGen/GType.hsc" #-}

gtypeIsBoxed :: GType -> Bool
gtypeIsBoxed :: GType -> Bool
gtypeIsBoxed gtype :: GType
gtype = GType -> GType -> Bool
gtypeIsA GType
gtype GType
gtypeBoxed