{-# LANGUAGE EmptyDataDecls, ExistentialQuantification, FlexibleContexts, FlexibleInstances, ForeignFunctionInterface, MultiParamTypeClasses, ScopedTypeVariables, TypeFamilies, TypeSynonymInstances #-} module HROOT.Graf.TBox.Interface where import Data.Word import Data.Int import Foreign.C import Foreign.Ptr import FFICXX.Runtime.Cast import HROOT.Graf.TBox.RawType import HROOT.Core.TObject.Interface import HROOT.Core.TAttLine.Interface import HROOT.Core.TAttFill.Interface class (ITObject a, ITAttLine a, ITAttFill a) => ITBox a where upcastTBox :: forall a . (FPtr a, ITBox a) => a -> TBox upcastTBox :: forall a. (FPtr a, ITBox a) => a -> TBox upcastTBox a h = let fh :: Ptr (Raw a) fh = a -> Ptr (Raw a) forall a. FPtr a => a -> Ptr (Raw a) get_fptr a h Ptr RawTBox fh2 :: Ptr RawTBox = Ptr (Raw a) -> Ptr RawTBox forall a b. Ptr a -> Ptr b castPtr Ptr (Raw a) fh in Ptr (Raw TBox) -> TBox forall a. FPtr a => Ptr (Raw a) -> a cast_fptr_to_obj Ptr (Raw TBox) Ptr RawTBox fh2 downcastTBox :: forall a . (FPtr a, ITBox a) => TBox -> a downcastTBox :: forall a. (FPtr a, ITBox a) => TBox -> a downcastTBox TBox h = let fh :: Ptr (Raw TBox) fh = TBox -> Ptr (Raw TBox) forall a. FPtr a => a -> Ptr (Raw a) get_fptr TBox h fh2 :: Ptr (Raw a) fh2 = Ptr RawTBox -> Ptr (Raw a) forall a b. Ptr a -> Ptr b castPtr Ptr (Raw TBox) Ptr RawTBox fh in Ptr (Raw a) -> a forall a. FPtr a => Ptr (Raw a) -> a cast_fptr_to_obj Ptr (Raw a) fh2