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

-- module HROOT.Class.Interface where

module HROOT.Core.TAttLine.Interface where


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

import HROOT.Core.TAttLine.RawType

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



class (IDeletable a) => ITAttLine a where

    getLineColor :: a -> IO CInt 

    getLineStyle :: a -> IO CInt 

    getLineWidth :: a -> IO CInt 

    resetAttLine :: a -> CString -> IO () 

    setLineAttributes :: a -> IO () 

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

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

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

instance Existable TAttLine where
  data Exist TAttLine = forall a. (FPtr a, ITAttLine a) => ETAttLine a

upcastTAttLine :: (FPtr a, ITAttLine a) => a -> TAttLine
upcastTAttLine h = let fh = get_fptr h
                       fh2 :: ForeignPtr RawTAttLine = castForeignPtr fh
                   in cast_fptr_to_obj fh2

downcastTAttLine :: (FPtr a, ITAttLine a) => TAttLine -> a 
downcastTAttLine h = let fh = get_fptr h
                         fh2 = castForeignPtr fh
                     in cast_fptr_to_obj fh2