{-# LANGUAGE ForeignFunctionInterface, TypeFamilies, MultiParamTypeClasses, 
             FlexibleInstances, TypeSynonymInstances, 
             EmptyDataDecls, ExistentialQuantification, ScopedTypeVariables #-}

-- module HROOT.Class.Interface where

module HROOT.Class.TFrame.Interface where


import Data.Word
import Foreign.ForeignPtr
import HROOT.TypeCast

import HROOT.Class.TFrame.RawType

import HROOT.Class.TWbox.Interface


class (ITWbox a) => ITFrame a where

instance Existable TFrame where
  data Exist TFrame = forall a. (FPtr a, ITFrame a) => ETFrame a

upcastTFrame :: (FPtr a, ITFrame a) => a -> TFrame
upcastTFrame h = let fh = get_fptr h
                     fh2 :: ForeignPtr RawTFrame = castForeignPtr fh
                 in cast_fptr_to_obj fh2