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

-- module HROOT.Class.Interface where

module HROOT.Class.TLegend.Interface where


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

import HROOT.Class.TLegend.RawType
import HROOT.Class.TLegendEntry.RawType
import HROOT.Class.TObject.Interface
import HROOT.Class.TPave.Interface
import HROOT.Class.TAttText.Interface


class (ITPave a,ITAttText a) => ITLegend a where

    addEntry :: (ITObject c0, FPtr c0) => a -> c0 -> String -> String -> IO TLegendEntry 

instance Existable TLegend where
  data Exist TLegend = forall a. (FPtr a, ITLegend a) => ETLegend a

upcastTLegend :: (FPtr a, ITLegend a) => a -> TLegend
upcastTLegend h = let fh = get_fptr h
                      fh2 :: ForeignPtr RawTLegend = castForeignPtr fh
                  in cast_fptr_to_obj fh2