packages feed

HROOT-graf-0.9: src/HROOT/Graf/TLine/Implementation.hs

{-# LANGUAGE EmptyDataDecls, FlexibleContexts, FlexibleInstances,
  ForeignFunctionInterface, IncoherentInstances,
  MultiParamTypeClasses, OverlappingInstances, TypeFamilies,
  TypeSynonymInstances #-}
module HROOT.Graf.TLine.Implementation where
import FFICXX.Runtime.Cast
import Data.Word
import Foreign.C
import Foreign.Ptr
import System.IO.Unsafe
import HROOT.Graf.TLine.RawType
import HROOT.Graf.TLine.FFI
import HROOT.Graf.TLine.Interface
import HROOT.Graf.TLine.Cast
import HROOT.Core.TClass.RawType
import HROOT.Core.TClass.Cast
import HROOT.Core.TClass.Interface
import HROOT.Core.TObject.RawType
import HROOT.Core.TObject.Cast
import HROOT.Core.TObject.Interface
import HROOT.Core.TAttLine.RawType
import HROOT.Core.TAttLine.Cast
import HROOT.Core.TAttLine.Interface
import HROOT.Core.Deletable.RawType
import HROOT.Core.Deletable.Cast
import HROOT.Core.Deletable.Interface

instance ITLine TLine where
        drawLine = xform4 c_tline_drawline
        drawLineNDC = xform4 c_tline_drawlinendc
        paintLine = xform4 c_tline_paintline
        paintLineNDC = xform4 c_tline_paintlinendc
        setX1 = xform1 c_tline_setx1
        setX2 = xform1 c_tline_setx2
        setY1 = xform1 c_tline_sety1
        setY2 = xform1 c_tline_sety2

instance ITObject TLine where
        draw = xform1 c_tline_draw
        findObject = xform1 c_tline_findobject
        getName = xform0 c_tline_getname
        isA = xform0 c_tline_isa
        paint = xform1 c_tline_paint
        printObj = xform1 c_tline_printobj
        saveAs = xform2 c_tline_saveas
        write = xform3 c_tline_write

instance ITAttLine TLine where
        getLineColor = xform0 c_tline_getlinecolor
        getLineStyle = xform0 c_tline_getlinestyle
        getLineWidth = xform0 c_tline_getlinewidth
        resetAttLine = xform1 c_tline_resetattline
        setLineAttributes = xform0 c_tline_setlineattributes
        setLineColor = xform1 c_tline_setlinecolor
        setLineStyle = xform1 c_tline_setlinestyle
        setLineWidth = xform1 c_tline_setlinewidth

instance IDeletable TLine where
        delete = xform0 c_tline_delete

newTLine :: CDouble -> CDouble -> CDouble -> CDouble -> IO TLine
newTLine = xform3 c_tline_newtline

tLineGetX1 :: TLine -> IO CDouble
tLineGetX1 = xform0 c_tline_tlinegetx1

tLineGetX2 :: TLine -> IO CDouble
tLineGetX2 = xform0 c_tline_tlinegetx2

tLineGetY1 :: TLine -> IO CDouble
tLineGetY1 = xform0 c_tline_tlinegety1

tLineGetY2 :: TLine -> IO CDouble
tLineGetY2 = xform0 c_tline_tlinegety2

tLineIsHorizontal :: TLine -> IO CInt
tLineIsHorizontal = xform0 c_tline_tlineishorizontal

tLineIsVertical :: TLine -> IO CInt
tLineIsVertical = xform0 c_tline_tlineisvertical

tLineSetHorizontal :: TLine -> CInt -> IO ()
tLineSetHorizontal = xform1 c_tline_tlinesethorizontal

tLineSetVertical :: TLine -> CInt -> IO ()
tLineSetVertical = xform1 c_tline_tlinesetvertical