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

-- module HROOT.Class.Interface where

module HROOT.Class.TAttText.Interface where


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

import HROOT.Class.TAttText.RawType

import HROOT.Class.Deletable.Interface


class (IDeletable a) => ITAttText a where

    getTextAlign :: a -> IO Int 

    getTextAngle :: a -> IO Double 

    getTextColor :: a -> IO Int 

    getTextFont :: a -> IO Int 

    getTextSize :: a -> IO Double 

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

    setTextAttributes :: a -> IO () 

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

    setTextAngle :: a -> Double -> IO () 

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

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

    setTextSize :: a -> Double -> IO () 

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

instance Existable TAttText where
  data Exist TAttText = forall a. (FPtr a, ITAttText a) => ETAttText a

upcastTAttText :: (FPtr a, ITAttText a) => a -> TAttText
upcastTAttText h = let fh = get_fptr h
                       fh2 :: ForeignPtr RawTAttText = castForeignPtr fh
                   in cast_fptr_to_obj fh2