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

-- module HROOT.Class.Interface where

module HROOT.Class.TAttImage.Interface where


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

import HROOT.Class.TAttImage.RawType

import HROOT.Class.Deletable.Interface


class (IDeletable a) => ITAttImage a where

instance Existable TAttImage where
  data Exist TAttImage = forall a. (FPtr a, ITAttImage a) => ETAttImage a

upcastTAttImage :: (FPtr a, ITAttImage a) => a -> TAttImage
upcastTAttImage h = let fh = get_fptr h
                        fh2 :: ForeignPtr RawTAttImage = castForeignPtr fh
                    in cast_fptr_to_obj fh2