-- GENERATED by C->Haskell Compiler, version 0.28.3 Switcheroo, 25 November 2017 (Haskell)
-- Edit the ORIGNAL .chs file instead!


{-# LINE 1 "src/NanoVG/Internal/Scissor.chs" #-}
module NanoVG.Internal.Scissor 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/Scissor.chs" #-}


-- | Sets the current scissor rectangle.
-- The scissor rectangle is transformed by the current transform.
scissor :: (Context) -> (CFloat) -> (CFloat) -> (CFloat) -> (CFloat) -> IO ()
scissor 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
  scissor'_ a1' a2' a3' a4' a5' >>
  return ()

{-# LINE 14 "src/NanoVG/Internal/Scissor.chs" #-}


-- | Intersects current scissor rectangle with the specified rectangle.
-- The scissor rectangle is transformed by the current transform.
-- Note: in case the rotation of previous scissor rect differs from
-- the current one, the intersection will be done between the specified
-- rectangle and the previous scissor rectangle transformed in the current
-- transform space. The resulting shape is always rectangle.
intersectScissor :: (Context) -> (CFloat) -> (CFloat) -> (CFloat) -> (CFloat) -> IO ()
intersectScissor 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
  intersectScissor'_ a1' a2' a3' a4' a5' >>
  return ()

{-# LINE 23 "src/NanoVG/Internal/Scissor.chs" #-}


-- | Reset and disables scissoring.
resetScissor :: (Context) -> IO ()
resetScissor a1 =
  let {a1' = id a1} in
  resetScissor'_ a1' >>
  return ()

{-# LINE 27 "src/NanoVG/Internal/Scissor.chs" #-}


foreign import ccall unsafe "NanoVG/Internal/Scissor.chs.h nvgScissor"
  scissor'_ :: ((Context) -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (IO ()))))))

foreign import ccall unsafe "NanoVG/Internal/Scissor.chs.h nvgIntersectScissor"
  intersectScissor'_ :: ((Context) -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (C2HSImp.CFloat -> (IO ()))))))

foreign import ccall unsafe "NanoVG/Internal/Scissor.chs.h nvgResetScissor"
  resetScissor'_ :: ((Context) -> (IO ()))