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

-- module HROOT.Class.Interface where

module HROOT.Class.TWbox.Interface where


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

import HROOT.Class.TWbox.RawType

import HROOT.Class.TBox.Interface


class (ITBox a) => ITWbox a where

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

instance Existable TWbox where
  data Exist TWbox = forall a. (FPtr a, ITWbox a) => ETWbox a

upcastTWbox :: (FPtr a, ITWbox a) => a -> TWbox
upcastTWbox h = let fh = get_fptr h
                    fh2 :: ForeignPtr RawTWbox = castForeignPtr fh
                in cast_fptr_to_obj fh2