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

module HROOT.Class.TCurlyArc.Implementation where


import HROOT.TypeCast

import HROOT.Class.TCurlyArc.RawType
import HROOT.Class.TCurlyArc.FFI
import HROOT.Class.TCurlyArc.Interface
import HROOT.Class.TCurlyArc.Cast
import HROOT.Class.TClass.RawType
import HROOT.Class.TClass.Cast
import HROOT.Class.TClass.Interface
import HROOT.Class.TCurlyLine.RawType
import HROOT.Class.TCurlyLine.Cast
import HROOT.Class.TCurlyLine.Interface
import HROOT.Class.TPolyLine.RawType
import HROOT.Class.TPolyLine.Cast
import HROOT.Class.TPolyLine.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 ITCurlyArc TCurlyArc where
instance ITCurlyLine TCurlyArc where
instance ITPolyLine TCurlyArc where
instance ITObject TCurlyArc where
  draw = xform1 c_tcurlyarc_draw
  findObject = xform1 c_tcurlyarc_findobject
  getName = xform0 c_tcurlyarc_getname
  isA = xform0 c_tcurlyarc_isa
  isFolder = xform0 c_tcurlyarc_isfolder
  isEqual = xform1 c_tcurlyarc_isequal
  isSortable = xform0 c_tcurlyarc_issortable
  paint = xform1 c_tcurlyarc_paint
  printObj = xform1 c_tcurlyarc_printobj
  recursiveRemove = xform1 c_tcurlyarc_recursiveremove
  saveAs = xform2 c_tcurlyarc_saveas
  useCurrentStyle = xform0 c_tcurlyarc_usecurrentstyle
  write = xform3 c_tcurlyarc_write
instance ITAttLine TCurlyArc where
  getLineColor = xform0 c_tcurlyarc_getlinecolor
  getLineStyle = xform0 c_tcurlyarc_getlinestyle
  getLineWidth = xform0 c_tcurlyarc_getlinewidth
  resetAttLine = xform1 c_tcurlyarc_resetattline
  setLineAttributes = xform0 c_tcurlyarc_setlineattributes
  setLineColor = xform1 c_tcurlyarc_setlinecolor
  setLineStyle = xform1 c_tcurlyarc_setlinestyle
  setLineWidth = xform1 c_tcurlyarc_setlinewidth
instance ITAttFill TCurlyArc where
  setFillColor = xform1 c_tcurlyarc_setfillcolor
  setFillStyle = xform1 c_tcurlyarc_setfillstyle
instance IDeletable TCurlyArc where
  delete = xform0 c_tcurlyarc_delete

instance ITCurlyArc (Exist TCurlyArc) where

instance ITCurlyLine (Exist TCurlyArc) where

instance ITPolyLine (Exist TCurlyArc) where

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


newTCurlyArc :: Double -> Double -> Double -> Double -> Double -> Double -> Double -> IO TCurlyArc
newTCurlyArc = xform6 c_tcurlyarc_newtcurlyarc





instance FPtr (Exist TCurlyArc) where
  type Raw (Exist TCurlyArc) = RawTCurlyArc
  get_fptr (ETCurlyArc obj) = castForeignPtr (get_fptr obj)
  cast_fptr_to_obj fptr = ETCurlyArc (cast_fptr_to_obj (fptr :: ForeignPtr RawTCurlyArc) :: TCurlyArc)