{-# LANGUAGE EmptyDataDecls, ExistentialQuantification, FlexibleContexts, FlexibleInstances, ForeignFunctionInterface, MultiParamTypeClasses, ScopedTypeVariables, TypeFamilies, TypeSynonymInstances #-} module HROOT.Core.TQObject.Interface where import Data.Word import Foreign.C import Foreign.Ptr import FFICXX.Runtime.Cast import HROOT.Core.TQObject.RawType import HROOT.Core.Deletable.Interface class IDeletable a => ITQObject a upcastTQObject :: forall a . (FPtr a, ITQObject a) => a -> TQObject upcastTQObject h = let fh = get_fptr h fh2 :: Ptr RawTQObject = castPtr fh in cast_fptr_to_obj fh2 downcastTQObject :: forall a . (FPtr a, ITQObject a) => TQObject -> a downcastTQObject h = let fh = get_fptr h fh2 = castPtr fh in cast_fptr_to_obj fh2