{-# LANGUAGE EmptyDataDecls, ExistentialQuantification, FlexibleContexts, FlexibleInstances, ForeignFunctionInterface, MultiParamTypeClasses, ScopedTypeVariables, TypeFamilies, TypeSynonymInstances #-} module HROOT.Core.TObject.Interface where import Data.Word import Foreign.C import Foreign.Ptr import FFICXX.Runtime.Cast import HROOT.Core.TObject.RawType import HROOT.Core.TClass.RawType import HROOT.Core.Deletable.Interface class IDeletable a => ITObject a where draw :: Castable c0 CString => a -> c0 -> IO () findObject :: Castable c0 CString => a -> c0 -> IO TObject getName :: a -> IO CString isA :: a -> IO TClass paint :: Castable c0 CString => a -> c0 -> IO () printObj :: Castable c0 CString => a -> c0 -> IO () saveAs :: (Castable c1 CString, Castable c0 CString) => a -> c0 -> c1 -> IO () write :: Castable c0 CString => a -> c0 -> CInt -> CInt -> IO CInt upcastTObject :: forall a . (FPtr a, ITObject a) => a -> TObject upcastTObject h = let fh = get_fptr h fh2 :: Ptr RawTObject = castPtr fh in cast_fptr_to_obj fh2 downcastTObject :: forall a . (FPtr a, ITObject a) => TObject -> a downcastTObject h = let fh = get_fptr h fh2 = castPtr fh in cast_fptr_to_obj fh2