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

-- module HROOT.Class.Interface where

module HROOT.Class.TLatex.Interface where


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

import HROOT.Class.TLatex.RawType

import HROOT.Class.TText.Interface
import HROOT.Class.TAttLine.Interface


class (ITText a,ITAttLine a) => ITLatex a where

instance Existable TLatex where
  data Exist TLatex = forall a. (FPtr a, ITLatex a) => ETLatex a

upcastTLatex :: (FPtr a, ITLatex a) => a -> TLatex
upcastTLatex h = let fh = get_fptr h
                     fh2 :: ForeignPtr RawTLatex = castForeignPtr fh
                 in cast_fptr_to_obj fh2