{-# LINE 1 "src/NanoVG/Internal/Path.chs" #-}
module NanoVG.Internal.Path where
import qualified Foreign.C.Types as C2HSImp
import qualified Foreign.Ptr as C2HSImp
import Foreign.C.Types
import NanoVG.Internal.Context
{-# LINE 9 "src/NanoVG/Internal/Path.chs" #-}
data Winding = CCW
| CW
deriving (Show,Read,Eq,Ord)
instance Enum Winding where
succ CCW = CW
succ CW = error "Winding.succ: CW has no successor"
pred CW = CCW
pred CCW = error "Winding.pred: CCW has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from CW
fromEnum CCW = 1
fromEnum CW = 2
toEnum 1 = CCW
toEnum 2 = CW
toEnum unmatched = error ("Winding.toEnum: Cannot match " ++ show unmatched)
{-# LINE 13 "src/NanoVG/Internal/Path.chs" #-}
beginPath :: (Context) -> IO ()
beginPath a1 =
let {a1' = id a1} in
beginPath'_ a1' >>
return ()
{-# LINE 17 "src/NanoVG/Internal/Path.chs" #-}
moveTo :: (Context) -> (CFloat) -> (CFloat) -> IO ()
moveTo a1 a2 a3 =
let {a1' = id a1} in
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
moveTo'_ a1' a2' a3' >>
return ()
{-# LINE 21 "src/NanoVG/Internal/Path.chs" #-}
lineTo :: (Context) -> (CFloat) -> (CFloat) -> IO ()
lineTo a1 a2 a3 =
let {a1' = id a1} in
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
lineTo'_ a1' a2' a3' >>
return ()
{-# LINE 25 "src/NanoVG/Internal/Path.chs" #-}
bezierTo :: (Context) -> (CFloat) -> (CFloat) -> (CFloat) -> (CFloat) -> (CFloat) -> (CFloat) -> IO ()
bezierTo a1 a2 a3 a4 a5 a6 a7 =
let {a1' = id a1} in
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
let {a4' = realToFrac a4} in
let {a5' = realToFrac a5} in
let {a6' = realToFrac a6} in
let {a7' = realToFrac a7} in
bezierTo'_ a1' a2' a3' a4' a5' a6' a7' >>
return ()
{-# LINE 29 "src/NanoVG/Internal/Path.chs" #-}
quadTo :: (Context) -> (CFloat) -> (CFloat) -> (CFloat) -> (CFloat) -> IO ()
quadTo a1 a2 a3 a4 a5 =
let {a1' = id a1} in
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
let {a4' = realToFrac a4} in
let {a5' = realToFrac a5} in
quadTo'_ a1' a2' a3' a4' a5' >>
return ()
{-# LINE 33 "src/NanoVG/Internal/Path.chs" #-}
arcTo :: (Context) -> (CFloat) -> (CFloat) -> (CFloat) -> (CFloat) -> (CFloat) -> IO ()
arcTo a1 a2 a3 a4 a5 a6 =
let {a1' = id a1} in
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
let {a4' = realToFrac a4} in
let {a5' = realToFrac a5} in
let {a6' = realToFrac a6} in
arcTo'_ a1' a2' a3' a4' a5' a6' >>
return ()
{-# LINE 37 "src/NanoVG/Internal/Path.chs" #-}
closePath :: (Context) -> IO ()
closePath a1 =
let {a1' = id a1} in
closePath'_ a1' >>
return ()
{-# LINE 41 "src/NanoVG/Internal/Path.chs" #-}
pathWinding :: (Context) -> (CInt) -> IO ()
pathWinding a1 a2 =
let {a1' = id a1} in
let {a2' = fromIntegral a2} in
pathWinding'_ a1' a2' >>
return ()
{-# LINE 45 "src/NanoVG/Internal/Path.chs" #-}
arc :: (Context) -> (CFloat) -> (CFloat) -> (CFloat) -> (CFloat) -> (CFloat) -> (Winding) -> IO ()
arc a1 a2 a3 a4 a5 a6 a7 =
let {a1' = id a1} in
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
let {a4' = realToFrac a4} in
let {a5' = realToFrac a5} in
let {a6' = realToFrac a6} in
let {a7' = (fromIntegral . fromEnum) a7} in
arc'_ a1' a2' a3' a4' a5' a6' a7' >>
return ()
{-# LINE 51 "src/NanoVG/Internal/Path.chs" #-}
rect :: (Context) -> (CFloat) -> (CFloat) -> (CFloat) -> (CFloat) -> IO ()
rect a1 a2 a3 a4 a5 =
let {a1' = id a1} in
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
let {a4' = realToFrac a4} in
let {a5' = realToFrac a5} in
rect'_ a1' a2' a3' a4' a5' >>
return ()
{-# LINE 55 "src/NanoVG/Internal/Path.chs" #-}
roundedRect :: (Context) -> (CFloat) -> (CFloat) -> (CFloat) -> (CFloat) -> (CFloat) -> IO ()
roundedRect a1 a2 a3 a4 a5 a6 =
let {a1' = id a1} in
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
let {a4' = realToFrac a4} in
let {a5' = realToFrac a5} in
let {a6' = realToFrac a6} in
roundedRect'_ a1' a2' a3' a4' a5' a6' >>
return ()
{-# LINE 59 "src/NanoVG/Internal/Path.chs" #-}
ellipse :: (Context) -> (CFloat) -> (CFloat) -> (CFloat) -> (CFloat) -> IO ()
ellipse a1 a2 a3 a4 a5 =
let {a1' = id a1} in
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
let {a4' = realToFrac a4} in
let {a5' = realToFrac a5} in
ellipse'_ a1' a2' a3' a4' a5' >>
return ()
{-# LINE 63 "src/NanoVG/Internal/Path.chs" #-}
circle :: (Context) -> (CFloat) -> (CFloat) -> (CFloat) -> IO ()
circle a1 a2 a3 a4 =
let {a1' = id a1} in
let {a2' = realToFrac a2} in
let {a3' = realToFrac a3} in
let {a4' = realToFrac a4} in
circle'_ a1' a2' a3' a4' >>
return ()
{-# LINE 67 "src/NanoVG/Internal/Path.chs" #-}
fill :: (Context) -> IO ()
fill a1 =
let {a1' = id a1} in
fill'_ a1' >>
return ()
{-# LINE 71 "src/NanoVG/Internal/Path.chs" #-}
stroke :: (Context) -> IO ()
stroke a1 =
let {a1' = id a1} in
stroke'_ a1' >>
return ()
{-# LINE 75 "src/NanoVG/Internal/Path.chs" #-}
foreign import ccall unsafe "NanoVG/Internal/Path.chs.h nvgBeginPath"
beginPath'_ :: ((Context) -> (IO ()))
foreign import ccall unsafe "NanoVG/Internal/Path.chs.h nvgMoveTo"
moveTo'_ :: ((Context) -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (IO ()))))
foreign import ccall unsafe "NanoVG/Internal/Path.chs.h nvgLineTo"
lineTo'_ :: ((Context) -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (IO ()))))
foreign import ccall unsafe "NanoVG/Internal/Path.chs.h nvgBezierTo"
bezierTo'_ :: ((Context) -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (IO ()))))))))
foreign import ccall unsafe "NanoVG/Internal/Path.chs.h nvgQuadTo"
quadTo'_ :: ((Context) -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (IO ()))))))
foreign import ccall unsafe "NanoVG/Internal/Path.chs.h nvgArcTo"
arcTo'_ :: ((Context) -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (IO ())))))))
foreign import ccall unsafe "NanoVG/Internal/Path.chs.h nvgClosePath"
closePath'_ :: ((Context) -> (IO ()))
foreign import ccall unsafe "NanoVG/Internal/Path.chs.h nvgPathWinding"
pathWinding'_ :: ((Context) -> (C2HSImp.CInt -> (IO ())))
foreign import ccall unsafe "NanoVG/Internal/Path.chs.h nvgArc"
arc'_ :: ((Context) -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (C2HSImp.CInt -> (IO ()))))))))
foreign import ccall unsafe "NanoVG/Internal/Path.chs.h nvgRect"
rect'_ :: ((Context) -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (IO ()))))))
foreign import ccall unsafe "NanoVG/Internal/Path.chs.h nvgRoundedRect"
roundedRect'_ :: ((Context) -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (IO ())))))))
foreign import ccall unsafe "NanoVG/Internal/Path.chs.h nvgEllipse"
ellipse'_ :: ((Context) -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (IO ()))))))
foreign import ccall unsafe "NanoVG/Internal/Path.chs.h nvgCircle"
circle'_ :: ((Context) -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (IO ())))))
foreign import ccall unsafe "NanoVG/Internal/Path.chs.h nvgFill"
fill'_ :: ((Context) -> (IO ()))
foreign import ccall unsafe "NanoVG/Internal/Path.chs.h nvgStroke"
stroke'_ :: ((Context) -> (IO ()))