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

-- module HROOT.Class.Interface where

module HROOT.Core.TVirtualPad.Interface where


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

import HROOT.Core.TVirtualPad.RawType

import HROOT.Core.TObject.Interface
---- ============ ----



class (ITObject a) => ITVirtualPad a where

    cd :: a -> CInt -> IO a 

    divide_tvirtualpad :: a -> CInt -> CInt -> CDouble -> CDouble -> CInt -> IO () 

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

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

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

instance Existable TVirtualPad where
  data Exist TVirtualPad = forall a. (FPtr a, ITVirtualPad a) => ETVirtualPad a

upcastTVirtualPad :: (FPtr a, ITVirtualPad a) => a -> TVirtualPad
upcastTVirtualPad h = let fh = get_fptr h
                          fh2 :: ForeignPtr RawTVirtualPad = castForeignPtr fh
                      in cast_fptr_to_obj fh2

downcastTVirtualPad :: (FPtr a, ITVirtualPad a) => TVirtualPad -> a 
downcastTVirtualPad h = let fh = get_fptr h
                            fh2 = castForeignPtr fh
                        in cast_fptr_to_obj fh2