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

-- module HROOT.Class.Interface where

module HROOT.Core.TAttFill.Interface where


import Data.Word
import Foreign.C
import Foreign.Ptr
import Foreign.ForeignPtr
import FFICXX.Runtime.Cast

import HROOT.Core.TAttFill.RawType

import HROOT.Core.Deletable.Interface
---- ============ ----



class (IDeletable a) => ITAttFill a where

    setFillColor :: a -> CInt -> IO () 

    setFillStyle :: a -> CInt -> IO () 

instance Existable TAttFill where
  data Exist TAttFill = forall a. (FPtr a, ITAttFill a) => ETAttFill a

upcastTAttFill :: (FPtr a, ITAttFill a) => a -> TAttFill
upcastTAttFill h = let fh = get_fptr h
                       fh2 :: ForeignPtr RawTAttFill = castForeignPtr fh
                   in cast_fptr_to_obj fh2

downcastTAttFill :: (FPtr a, ITAttFill a) => TAttFill -> a 
downcastTAttFill h = let fh = get_fptr h
                         fh2 = castForeignPtr fh
                     in cast_fptr_to_obj fh2