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

-- module HROOT.Class.Interface where

module HROOT.Class.TAttLine.Interface where


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

import HROOT.Class.TAttLine.RawType

import HROOT.Class.Deletable.Interface


class (IDeletable a) => ITAttLine a where

    getLineColor :: a -> IO Int 

    getLineStyle :: a -> IO Int 

    getLineWidth :: a -> IO Int 

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

    setLineAttributes :: a -> IO () 

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

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

    setLineWidth :: a -> Int -> 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