module TerraHS.TerraLib.TeBox
(
TeBox (..), TeBoxPtr,
x1, y1, x2, y2
)
where
import Foreign
import Foreign.C.String
import qualified Foreign.Ptr (Ptr)
import TerraHS.Misc.Object
data TeBox = TeBox Double Double Double Double deriving (Eq, Show)
type TeBoxPtr = Foreign.Ptr.Ptr TeBox
instance Pointer TeBox where
fromPointer ptr = do
x1 <- tebox_x1 ptr
y1 <- tebox_y1 ptr
x2 <- tebox_x2 ptr
y2 <- tebox_y2 ptr
return (TeBox x1 y1 x2 y2)
new (TeBox x1 y1 x2 y2) = do
cp <- tebox_new x1 y1 x2 y2
return cp
x1 :: TeBox -> Double
x1 (TeBox x1 y1 x2 y2) = x1
y1 :: TeBox -> Double
y1 (TeBox x1 y1 x2 y2) = y1
x2 :: TeBox -> Double
x2 (TeBox x1 y1 x2 y2) = x2
y2 :: TeBox -> Double
y2 (TeBox x1 y1 x2 y2) = y2
foreign import stdcall unsafe "c_tebox_new" tebox_new :: Double -> Double -> Double -> Double -> Prelude.IO TeBoxPtr
foreign import stdcall unsafe "c_tebox_x1" tebox_x1 :: TeBoxPtr -> Prelude.IO Double
foreign import stdcall unsafe "c_tebox_y1" tebox_y1 :: TeBoxPtr -> Prelude.IO Double
foreign import stdcall unsafe "c_tebox_x2" tebox_x2 :: TeBoxPtr -> Prelude.IO Double
foreign import stdcall unsafe "c_tebox_y2" tebox_y2 :: TeBoxPtr -> Prelude.IO Double