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

module HROOT.Class.TDiamond.Implementation where


import HROOT.TypeCast

import HROOT.Class.TDiamond.RawType
import HROOT.Class.TDiamond.FFI
import HROOT.Class.TDiamond.Interface
import HROOT.Class.TDiamond.Cast
import HROOT.Class.TClass.RawType
import HROOT.Class.TClass.Cast
import HROOT.Class.TClass.Interface
import HROOT.Class.TPaveText.RawType
import HROOT.Class.TPaveText.Cast
import HROOT.Class.TPaveText.Interface
import HROOT.Class.TPave.RawType
import HROOT.Class.TPave.Cast
import HROOT.Class.TPave.Interface
import HROOT.Class.TAttText.RawType
import HROOT.Class.TAttText.Cast
import HROOT.Class.TAttText.Interface
import HROOT.Class.TBox.RawType
import HROOT.Class.TBox.Cast
import HROOT.Class.TBox.Interface
import HROOT.Class.TObject.RawType
import HROOT.Class.TObject.Cast
import HROOT.Class.TObject.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.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 ITDiamond TDiamond where
instance ITPaveText TDiamond where
instance ITPave TDiamond where
instance ITAttText TDiamond where
  getTextAlign = xform0 c_tdiamond_gettextalign
  getTextAngle = xform0 c_tdiamond_gettextangle
  getTextColor = xform0 c_tdiamond_gettextcolor
  getTextFont = xform0 c_tdiamond_gettextfont
  getTextSize = xform0 c_tdiamond_gettextsize
  resetAttText = xform1 c_tdiamond_resetatttext
  setTextAttributes = xform0 c_tdiamond_settextattributes
  setTextAlign = xform1 c_tdiamond_settextalign
  setTextAngle = xform1 c_tdiamond_settextangle
  setTextColor = xform1 c_tdiamond_settextcolor
  setTextFont = xform1 c_tdiamond_settextfont
  setTextSize = xform1 c_tdiamond_settextsize
  setTextSizePixels = xform1 c_tdiamond_settextsizepixels
instance ITBox TDiamond where
instance ITObject TDiamond where
  draw = xform1 c_tdiamond_draw
  findObject = xform1 c_tdiamond_findobject
  getName = xform0 c_tdiamond_getname
  isA = xform0 c_tdiamond_isa
  isFolder = xform0 c_tdiamond_isfolder
  isEqual = xform1 c_tdiamond_isequal
  isSortable = xform0 c_tdiamond_issortable
  paint = xform1 c_tdiamond_paint
  printObj = xform1 c_tdiamond_printobj
  recursiveRemove = xform1 c_tdiamond_recursiveremove
  saveAs = xform2 c_tdiamond_saveas
  useCurrentStyle = xform0 c_tdiamond_usecurrentstyle
  write = xform3 c_tdiamond_write
instance ITAttLine TDiamond where
  getLineColor = xform0 c_tdiamond_getlinecolor
  getLineStyle = xform0 c_tdiamond_getlinestyle
  getLineWidth = xform0 c_tdiamond_getlinewidth
  resetAttLine = xform1 c_tdiamond_resetattline
  setLineAttributes = xform0 c_tdiamond_setlineattributes
  setLineColor = xform1 c_tdiamond_setlinecolor
  setLineStyle = xform1 c_tdiamond_setlinestyle
  setLineWidth = xform1 c_tdiamond_setlinewidth
instance ITAttFill TDiamond where
  setFillColor = xform1 c_tdiamond_setfillcolor
  setFillStyle = xform1 c_tdiamond_setfillstyle
instance IDeletable TDiamond where
  delete = xform0 c_tdiamond_delete

instance ITDiamond (Exist TDiamond) where

instance ITPaveText (Exist TDiamond) where

instance ITPave (Exist TDiamond) where

instance ITAttText (Exist TDiamond) where
  getTextAlign (ETDiamond x) = getTextAlign x
  getTextAngle (ETDiamond x) = getTextAngle x
  getTextColor (ETDiamond x) = getTextColor x
  getTextFont (ETDiamond x) = getTextFont x
  getTextSize (ETDiamond x) = getTextSize x
  resetAttText (ETDiamond x) = resetAttText x
  setTextAttributes (ETDiamond x) = setTextAttributes x
  setTextAlign (ETDiamond x) = setTextAlign x
  setTextAngle (ETDiamond x) = setTextAngle x
  setTextColor (ETDiamond x) = setTextColor x
  setTextFont (ETDiamond x) = setTextFont x
  setTextSize (ETDiamond x) = setTextSize x
  setTextSizePixels (ETDiamond x) = setTextSizePixels x
instance ITBox (Exist TDiamond) where

instance ITObject (Exist TDiamond) where
  draw (ETDiamond x) = draw x
  findObject (ETDiamond x) = findObject x
  getName (ETDiamond x) = getName x
  isA (ETDiamond x) = isA x
  isFolder (ETDiamond x) = isFolder x
  isEqual (ETDiamond x) = isEqual x
  isSortable (ETDiamond x) = isSortable x
  paint (ETDiamond x) = paint x
  printObj (ETDiamond x) = printObj x
  recursiveRemove (ETDiamond x) = recursiveRemove x
  saveAs (ETDiamond x) = saveAs x
  useCurrentStyle (ETDiamond x) = useCurrentStyle x
  write (ETDiamond x) = write x
instance ITAttLine (Exist TDiamond) where
  getLineColor (ETDiamond x) = getLineColor x
  getLineStyle (ETDiamond x) = getLineStyle x
  getLineWidth (ETDiamond x) = getLineWidth x
  resetAttLine (ETDiamond x) = resetAttLine x
  setLineAttributes (ETDiamond x) = setLineAttributes x
  setLineColor (ETDiamond x) = setLineColor x
  setLineStyle (ETDiamond x) = setLineStyle x
  setLineWidth (ETDiamond x) = setLineWidth x
instance ITAttFill (Exist TDiamond) where
  setFillColor (ETDiamond x) = setFillColor x
  setFillStyle (ETDiamond x) = setFillStyle x
instance IDeletable (Exist TDiamond) where
  delete (ETDiamond x) = delete x


newTDiamond :: Double -> Double -> Double -> Double -> IO TDiamond
newTDiamond = xform3 c_tdiamond_newtdiamond





instance FPtr (Exist TDiamond) where
  type Raw (Exist TDiamond) = RawTDiamond
  get_fptr (ETDiamond obj) = castForeignPtr (get_fptr obj)
  cast_fptr_to_obj fptr = ETDiamond (cast_fptr_to_obj (fptr :: ForeignPtr RawTDiamond) :: TDiamond)