{-# LANGUAGE ForeignFunctionInterface, TypeFamilies, MultiParamTypeClasses, 
             FlexibleInstances, TypeSynonymInstances, EmptyDataDecls, 
             OverlappingInstances, IncoherentInstances #-}

module HROOT.Class.TTUBE.Implementation where


import HROOT.TypeCast

import HROOT.Class.TTUBE.RawType
import HROOT.Class.TTUBE.FFI
import HROOT.Class.TTUBE.Interface
import HROOT.Class.TTUBE.Cast
import HROOT.Class.TClass.RawType
import HROOT.Class.TClass.Cast
import HROOT.Class.TClass.Interface
import HROOT.Class.TShape.RawType
import HROOT.Class.TShape.Cast
import HROOT.Class.TShape.Interface
import HROOT.Class.TNamed.RawType
import HROOT.Class.TNamed.Cast
import HROOT.Class.TNamed.Interface
import HROOT.Class.TAttLine.RawType
import HROOT.Class.TAttLine.Cast
import HROOT.Class.TAttLine.Interface
import HROOT.Class.TAttFill.RawType
import HROOT.Class.TAttFill.Cast
import HROOT.Class.TAttFill.Interface
import HROOT.Class.TAtt3D.RawType
import HROOT.Class.TAtt3D.Cast
import HROOT.Class.TAtt3D.Interface
import HROOT.Class.TObject.RawType
import HROOT.Class.TObject.Cast
import HROOT.Class.TObject.Interface
import HROOT.Class.Deletable.RawType
import HROOT.Class.Deletable.Cast
import HROOT.Class.Deletable.Interface

import Data.Word
-- import Foreign.C            
-- import Foreign.Ptr
import Foreign.ForeignPtr

import System.IO.Unsafe


instance ITTUBE TTUBE where
instance ITShape TTUBE where
instance ITNamed TTUBE where
  setName = xform1 c_ttube_setname
  setNameTitle = xform2 c_ttube_setnametitle
  setTitle = xform1 c_ttube_settitle
instance ITAttLine TTUBE where
  getLineColor = xform0 c_ttube_getlinecolor
  getLineStyle = xform0 c_ttube_getlinestyle
  getLineWidth = xform0 c_ttube_getlinewidth
  resetAttLine = xform1 c_ttube_resetattline
  setLineAttributes = xform0 c_ttube_setlineattributes
  setLineColor = xform1 c_ttube_setlinecolor
  setLineStyle = xform1 c_ttube_setlinestyle
  setLineWidth = xform1 c_ttube_setlinewidth
instance ITAttFill TTUBE where
  setFillColor = xform1 c_ttube_setfillcolor
  setFillStyle = xform1 c_ttube_setfillstyle
instance ITAtt3D TTUBE where
instance ITObject TTUBE where
  draw = xform1 c_ttube_draw
  findObject = xform1 c_ttube_findobject
  getName = xform0 c_ttube_getname
  isA = xform0 c_ttube_isa
  isFolder = xform0 c_ttube_isfolder
  isEqual = xform1 c_ttube_isequal
  isSortable = xform0 c_ttube_issortable
  paint = xform1 c_ttube_paint
  printObj = xform1 c_ttube_printobj
  recursiveRemove = xform1 c_ttube_recursiveremove
  saveAs = xform2 c_ttube_saveas
  useCurrentStyle = xform0 c_ttube_usecurrentstyle
  write = xform3 c_ttube_write
instance IDeletable TTUBE where
  delete = xform0 c_ttube_delete

instance ITTUBE (Exist TTUBE) where

instance ITShape (Exist TTUBE) where

instance ITNamed (Exist TTUBE) where
  setName (ETTUBE x) = setName x
  setNameTitle (ETTUBE x) = setNameTitle x
  setTitle (ETTUBE x) = setTitle x
instance ITAttLine (Exist TTUBE) where
  getLineColor (ETTUBE x) = getLineColor x
  getLineStyle (ETTUBE x) = getLineStyle x
  getLineWidth (ETTUBE x) = getLineWidth x
  resetAttLine (ETTUBE x) = resetAttLine x
  setLineAttributes (ETTUBE x) = setLineAttributes x
  setLineColor (ETTUBE x) = setLineColor x
  setLineStyle (ETTUBE x) = setLineStyle x
  setLineWidth (ETTUBE x) = setLineWidth x
instance ITAttFill (Exist TTUBE) where
  setFillColor (ETTUBE x) = setFillColor x
  setFillStyle (ETTUBE x) = setFillStyle x
instance ITAtt3D (Exist TTUBE) where

instance ITObject (Exist TTUBE) where
  draw (ETTUBE x) = draw x
  findObject (ETTUBE x) = findObject x
  getName (ETTUBE x) = getName x
  isA (ETTUBE x) = isA x
  isFolder (ETTUBE x) = isFolder x
  isEqual (ETTUBE x) = isEqual x
  isSortable (ETTUBE x) = isSortable x
  paint (ETTUBE x) = paint x
  printObj (ETTUBE x) = printObj x
  recursiveRemove (ETTUBE x) = recursiveRemove x
  saveAs (ETTUBE x) = saveAs x
  useCurrentStyle (ETTUBE x) = useCurrentStyle x
  write (ETTUBE x) = write x
instance IDeletable (Exist TTUBE) where
  delete (ETTUBE x) = delete x


newTTUBE :: String -> String -> String -> Double -> Double -> Double -> Double -> IO TTUBE
newTTUBE = xform6 c_ttube_newttube





instance FPtr (Exist TTUBE) where
  type Raw (Exist TTUBE) = RawTTUBE
  get_fptr (ETTUBE obj) = castForeignPtr (get_fptr obj)
  cast_fptr_to_obj fptr = ETTUBE (cast_fptr_to_obj (fptr :: ForeignPtr RawTTUBE) :: TTUBE)