ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/CanvasPath.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from html (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.CanvasPath
(js_arc, js_arcTo, js_bezierCurveTo, js_closePath, js_ellipse, js_lineTo, js_moveTo, js_quadraticCurveTo, js_rect, js_roundRect, arc, arcTo, bezierCurveTo, closePath, ellipse, lineTo, moveTo, quadraticCurveTo, rect, roundRect, CanvasPath(..), gTypeCanvasPath, IsCanvasPath, toCanvasPath)
where
import Prelude ((.), (==), (>>=), (<$>), (++), Bool(..), Maybe(..), IO, Int, Word, Double, Float)
import qualified Prelude as P
import Control.Monad (void)
import GHCJS.Types (JSVal, JSString)
import GHCJS.Foreign (jsUndefined, jsNull)
import GHCJS.DOM.Types
import qualified GHCJS.DOM.Types as Types
import GHCJS.DOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import GHCJS.DOM.JSFFI.Generated.Enums
foreign import javascript safe "(($1, $2, $3, $4, $5, $6, $7) => { return $1[\"arc\"]($2, $3, $4, $5, $6, $7); })"
js_arc :: CanvasPath -> Double -> Double -> Double -> Double -> Double -> JSVal -> IO ()
-- | <https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/arc MDN CanvasPath.arc documentation>
arc :: (MonadDOM m, IsCanvasPath self) => self -> Double -> Double -> Double -> Double -> Double -> Maybe Bool -> m ()
arc self x y radius startAngle endAngle counterclockwise = liftDOM (void (((P.maybe (P.return jsUndefined) toJSVal counterclockwise) >>= \a7' -> js_arc ((Types.toCanvasPath self)) (x) (y) (radius) (startAngle) (endAngle) a7')))
foreign import javascript safe "(($1, $2, $3, $4, $5, $6) => { return $1[\"arcTo\"]($2, $3, $4, $5, $6); })"
js_arcTo :: CanvasPath -> Double -> Double -> Double -> Double -> Double -> IO ()
-- | <https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/arcTo MDN CanvasPath.arcTo documentation>
arcTo :: (MonadDOM m, IsCanvasPath self) => self -> Double -> Double -> Double -> Double -> Double -> m ()
arcTo self x1 y1 x2 y2 radius = liftDOM (void ((js_arcTo ((Types.toCanvasPath self)) (x1) (y1) (x2) (y2) (radius))))
foreign import javascript safe "(($1, $2, $3, $4, $5, $6, $7) => { return $1[\"bezierCurveTo\"]($2, $3, $4, $5, $6, $7); })"
js_bezierCurveTo :: CanvasPath -> Double -> Double -> Double -> Double -> Double -> Double -> IO ()
-- | <https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/bezierCurveTo MDN CanvasPath.bezierCurveTo documentation>
bezierCurveTo :: (MonadDOM m, IsCanvasPath self) => self -> Double -> Double -> Double -> Double -> Double -> Double -> m ()
bezierCurveTo self cp1x cp1y cp2x cp2y x y = liftDOM (void ((js_bezierCurveTo ((Types.toCanvasPath self)) (cp1x) (cp1y) (cp2x) (cp2y) (x) (y))))
foreign import javascript safe "(($1) => { return $1[\"closePath\"](); })"
js_closePath :: CanvasPath -> IO ()
-- | <https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/closePath MDN CanvasPath.closePath documentation>
closePath :: (MonadDOM m, IsCanvasPath self) => self -> m ()
closePath self = liftDOM (void ((js_closePath ((Types.toCanvasPath self)))))
foreign import javascript safe "(($1, $2, $3, $4, $5, $6, $7, $8, $9) => { return $1[\"ellipse\"]($2, $3, $4, $5, $6, $7, $8, $9); })"
js_ellipse :: CanvasPath -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> JSVal -> IO ()
-- | <https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/ellipse MDN CanvasPath.ellipse documentation>
ellipse :: (MonadDOM m, IsCanvasPath self) => self -> Double -> Double -> Double -> Double -> Double -> Double -> Double -> Maybe Bool -> m ()
ellipse self x y radiusX radiusY rotation startAngle endAngle counterclockwise = liftDOM (void (((P.maybe (P.return jsUndefined) toJSVal counterclockwise) >>= \a9' -> js_ellipse ((Types.toCanvasPath self)) (x) (y) (radiusX) (radiusY) (rotation) (startAngle) (endAngle) a9')))
foreign import javascript safe "(($1, $2, $3) => { return $1[\"lineTo\"]($2, $3); })"
js_lineTo :: CanvasPath -> Double -> Double -> IO ()
-- | <https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/lineTo MDN CanvasPath.lineTo documentation>
lineTo :: (MonadDOM m, IsCanvasPath self) => self -> Double -> Double -> m ()
lineTo self x y = liftDOM (void ((js_lineTo ((Types.toCanvasPath self)) (x) (y))))
foreign import javascript safe "(($1, $2, $3) => { return $1[\"moveTo\"]($2, $3); })"
js_moveTo :: CanvasPath -> Double -> Double -> IO ()
-- | <https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/moveTo MDN CanvasPath.moveTo documentation>
moveTo :: (MonadDOM m, IsCanvasPath self) => self -> Double -> Double -> m ()
moveTo self x y = liftDOM (void ((js_moveTo ((Types.toCanvasPath self)) (x) (y))))
foreign import javascript safe "(($1, $2, $3, $4, $5) => { return $1[\"quadraticCurveTo\"]($2, $3, $4, $5); })"
js_quadraticCurveTo :: CanvasPath -> Double -> Double -> Double -> Double -> IO ()
-- | <https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/quadraticCurveTo MDN CanvasPath.quadraticCurveTo documentation>
quadraticCurveTo :: (MonadDOM m, IsCanvasPath self) => self -> Double -> Double -> Double -> Double -> m ()
quadraticCurveTo self cpx cpy x y = liftDOM (void ((js_quadraticCurveTo ((Types.toCanvasPath self)) (cpx) (cpy) (x) (y))))
foreign import javascript safe "(($1, $2, $3, $4, $5) => { return $1[\"rect\"]($2, $3, $4, $5); })"
js_rect :: CanvasPath -> Double -> Double -> Double -> Double -> IO ()
-- | <https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/rect MDN CanvasPath.rect documentation>
rect :: (MonadDOM m, IsCanvasPath self) => self -> Double -> Double -> Double -> Double -> m ()
rect self x y w h = liftDOM (void ((js_rect ((Types.toCanvasPath self)) (x) (y) (w) (h))))
foreign import javascript safe "(($1, $2, $3, $4, $5, $6) => { return $1[\"roundRect\"]($2, $3, $4, $5, $6); })"
js_roundRect :: CanvasPath -> Double -> Double -> Double -> Double -> JSVal -> IO ()
-- | <https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/roundRect MDN CanvasPath.roundRect documentation>
roundRect :: (MonadDOM m, IsCanvasPath self, IsDoubleOrDOMPointInitOrSequenceDoubleOrDOMPointInit radii) => self -> Double -> Double -> Double -> Double -> Maybe radii -> m ()
roundRect self x y w h radii = liftDOM (void (((P.maybe (P.return jsUndefined) toJSVal radii) >>= \a6' -> js_roundRect ((Types.toCanvasPath self)) (x) (y) (w) (h) a6')))