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

-- module HROOT.Class.Interface where

module HROOT.Class.TLegendEntry.Interface where


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

import HROOT.Class.TLegendEntry.RawType

import HROOT.Class.TObject.Interface
import HROOT.Class.TAttText.Interface
import HROOT.Class.TAttLine.Interface
import HROOT.Class.TAttFill.Interface
import HROOT.Class.TAttMarker.Interface


class (ITObject a,ITAttText a,ITAttLine a,ITAttFill a,ITAttMarker a) => ITLegendEntry a where

instance Existable TLegendEntry where
  data Exist TLegendEntry = forall a. (FPtr a, ITLegendEntry a) => ETLegendEntry a

upcastTLegendEntry :: (FPtr a, ITLegendEntry a) => a -> TLegendEntry
upcastTLegendEntry h = let fh = get_fptr h
                           fh2 :: ForeignPtr RawTLegendEntry = castForeignPtr fh
                       in cast_fptr_to_obj fh2