-- GENERATED by C->Haskell Compiler, version 0.28.1 Switcheroo, 1 April 2016 (Haskell)
-- Edit the ORIGNAL .chs file instead!


{-# LINE 1 "src/NanoVG/Internal/Style.chs" #-}
module NanoVG.Internal.Style where
import qualified Foreign.C.Types as C2HSImp
import qualified Foreign.Ptr as C2HSImp



import Foreign.C.Types
import Foreign.Marshal.Utils

import NanoVG.Internal.Context
import NanoVG.Internal.Color
import NanoVG.Internal.Paint





{-# LINE 13 "src/NanoVG/Internal/Style.chs" #-}


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


{-# LINE 15 "src/NanoVG/Internal/Style.chs" #-}


data LineCap = Butt
             | Round
             | Square
             | Bevel
             | Miter
  deriving (Enum,Show,Read,Eq,Ord)

{-# LINE 19 "src/NanoVG/Internal/Style.chs" #-}


-- | Sets current stroke style to a solid color.
strokeColor :: (Context) -> (Color) -> IO ()
strokeColor a1 a2 =
  let {a1' = id a1} in 
  with a2 $ \a2' -> 
  strokeColor'_ a1' a2' >>
  return ()

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


-- | Sets current stroke style to a paint, which can be a one of the gradients or a pattern.
strokePaint :: (Context) -> (Paint) -> IO ()
strokePaint a1 a2 =
  let {a1' = id a1} in 
  with a2 $ \a2' -> 
  strokePaint'_ a1' a2' >>
  return ()

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


-- | Sets current fill style to a solid color.
fillColor :: (Context) -> (Color) -> IO ()
fillColor a1 a2 =
  let {a1' = id a1} in 
  with a2 $ \a2' -> 
  fillColor'_ a1' a2' >>
  return ()

{-# LINE 31 "src/NanoVG/Internal/Style.chs" #-}


-- | Sets current fill style to a paint, which can be a one of the gradients or a pattern.
fillPaint :: (Context) -> (Paint) -> IO ()
fillPaint a1 a2 =
  let {a1' = id a1} in 
  with a2 $ \a2' -> 
  fillPaint'_ a1' a2' >>
  return ()

{-# LINE 35 "src/NanoVG/Internal/Style.chs" #-}


-- | Sets the miter limit of the stroke style.
-- Miter limit controls when a sharp corner is beveled.
miterLimit :: (Context) -> (CFloat) -> IO ()
miterLimit a1 a2 =
  let {a1' = id a1} in 
  let {a2' = realToFrac a2} in 
  miterLimit'_ a1' a2' >>
  return ()

{-# LINE 40 "src/NanoVG/Internal/Style.chs" #-}


-- | Sets the stroke width of the stroke style.
strokeWidth :: (Context) -> (CFloat) -> IO ()
strokeWidth a1 a2 =
  let {a1' = id a1} in 
  let {a2' = realToFrac a2} in 
  strokeWidth'_ a1' a2' >>
  return ()

{-# LINE 44 "src/NanoVG/Internal/Style.chs" #-}


-- | Sets how the end of the line (cap) is drawn,
-- Can be one of: 'Butt' (default), 'Round', 'Square'.
lineCap :: (Context) -> (LineCap) -> IO ()
lineCap a1 a2 =
  let {a1' = id a1} in 
  let {a2' = (fromIntegral . fromEnum) a2} in 
  lineCap'_ a1' a2' >>
  return ()

{-# LINE 49 "src/NanoVG/Internal/Style.chs" #-}


-- | Sets how sharp path corners are drawn.
-- Can be one of 'Miter' (default), 'Round', 'Bevel.
lineJoin :: (Context) -> (LineCap) -> IO ()
lineJoin a1 a2 =
  let {a1' = id a1} in 
  let {a2' = (fromIntegral . fromEnum) a2} in 
  lineJoin'_ a1' a2' >>
  return ()

{-# LINE 54 "src/NanoVG/Internal/Style.chs" #-}


-- | Sets the transparency applied to all rendered shapes.
-- Already transparent paths will get proportionally more transparent as well.
globalAlpha :: (Context) -> (CFloat) -> IO ()
globalAlpha a1 a2 =
  let {a1' = id a1} in 
  let {a2' = realToFrac a2} in 
  globalAlpha'_ a1' a2' >>
  return ()

{-# LINE 59 "src/NanoVG/Internal/Style.chs" #-}



foreign import ccall unsafe "NanoVG/Internal/Style.chs.h nvgStrokeColor_"
  strokeColor'_ :: ((Context) -> ((ColorPtr) -> (IO ())))

foreign import ccall unsafe "NanoVG/Internal/Style.chs.h nvgStrokePaint_"
  strokePaint'_ :: ((Context) -> ((PaintPtr) -> (IO ())))

foreign import ccall unsafe "NanoVG/Internal/Style.chs.h nvgFillColor_"
  fillColor'_ :: ((Context) -> ((ColorPtr) -> (IO ())))

foreign import ccall unsafe "NanoVG/Internal/Style.chs.h nvgFillPaint_"
  fillPaint'_ :: ((Context) -> ((PaintPtr) -> (IO ())))

foreign import ccall unsafe "NanoVG/Internal/Style.chs.h nvgMiterLimit"
  miterLimit'_ :: ((Context) -> (C2HSImp.CFloat -> (IO ())))

foreign import ccall unsafe "NanoVG/Internal/Style.chs.h nvgStrokeWidth"
  strokeWidth'_ :: ((Context) -> (C2HSImp.CFloat -> (IO ())))

foreign import ccall unsafe "NanoVG/Internal/Style.chs.h nvgLineCap"
  lineCap'_ :: ((Context) -> (C2HSImp.CInt -> (IO ())))

foreign import ccall unsafe "NanoVG/Internal/Style.chs.h nvgLineJoin"
  lineJoin'_ :: ((Context) -> (C2HSImp.CInt -> (IO ())))

foreign import ccall unsafe "NanoVG/Internal/Style.chs.h nvgGlobalAlpha"
  globalAlpha'_ :: ((Context) -> (C2HSImp.CFloat -> (IO ())))