{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.CanvasPath
(closePath, moveTo, lineTo, quadraticCurveTo, bezierCurveTo, arcTo,
rect, arc, ellipse, CanvasPath(..), gTypeCanvasPath, IsCanvasPath,
toCanvasPath)
where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, fromIntegral, round, realToFrac, fmap, Show, Read, Eq, Ord, Maybe(..))
import qualified Prelude (error)
import Data.Typeable (Typeable)
import Data.Traversable (mapM)
import Language.Javascript.JSaddle (JSM(..), JSVal(..), JSString, strictEqual, toJSVal, valToStr, valToNumber, valToBool, js, jss, jsf, jsg, function, asyncFunction, new, array, jsUndefined, (!), (!!))
import Data.Int (Int64)
import Data.Word (Word, Word64)
import JSDOM.Types
import Control.Applicative ((<$>))
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import JSDOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import JSDOM.Enums
closePath :: (MonadDOM m, IsCanvasPath self) => self -> m ()
closePath :: forall (m :: * -> *) self.
(MonadDOM m, IsCanvasPath self) =>
self -> m ()
closePath self
self
= DOM () -> m ()
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM (JSM JSVal -> DOM ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void ((self -> CanvasPath
forall o. IsCanvasPath o => o -> CanvasPath
toCanvasPath self
self) CanvasPath
-> Getting (JSM JSVal) CanvasPath (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> () -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"closePath" ()))
moveTo ::
(MonadDOM m, IsCanvasPath self) => self -> Double -> Double -> m ()
moveTo :: forall (m :: * -> *) self.
(MonadDOM m, IsCanvasPath self) =>
self -> Double -> Double -> m ()
moveTo self
self Double
x Double
y
= DOM () -> m ()
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM
(JSM JSVal -> DOM ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void ((self -> CanvasPath
forall o. IsCanvasPath o => o -> CanvasPath
toCanvasPath self
self) CanvasPath
-> Getting (JSM JSVal) CanvasPath (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> [JSM JSVal] -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"moveTo" [Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
x, Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
y]))
lineTo ::
(MonadDOM m, IsCanvasPath self) => self -> Double -> Double -> m ()
lineTo :: forall (m :: * -> *) self.
(MonadDOM m, IsCanvasPath self) =>
self -> Double -> Double -> m ()
lineTo self
self Double
x Double
y
= DOM () -> m ()
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM
(JSM JSVal -> DOM ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void ((self -> CanvasPath
forall o. IsCanvasPath o => o -> CanvasPath
toCanvasPath self
self) CanvasPath
-> Getting (JSM JSVal) CanvasPath (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> [JSM JSVal] -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"lineTo" [Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
x, Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
y]))
quadraticCurveTo ::
(MonadDOM m, IsCanvasPath self) =>
self -> Double -> Double -> Double -> Double -> m ()
quadraticCurveTo :: forall (m :: * -> *) self.
(MonadDOM m, IsCanvasPath self) =>
self -> Double -> Double -> Double -> Double -> m ()
quadraticCurveTo self
self Double
cpx Double
cpy Double
x Double
y
= DOM () -> m ()
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM
(JSM JSVal -> DOM ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void
((self -> CanvasPath
forall o. IsCanvasPath o => o -> CanvasPath
toCanvasPath self
self) CanvasPath
-> Getting (JSM JSVal) CanvasPath (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> [JSM JSVal] -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"quadraticCurveTo"
[Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
cpx, Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
cpy, Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
x, Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
y]))
bezierCurveTo ::
(MonadDOM m, IsCanvasPath self) =>
self ->
Double -> Double -> Double -> Double -> Double -> Double -> m ()
bezierCurveTo :: forall (m :: * -> *) self.
(MonadDOM m, IsCanvasPath self) =>
self
-> Double -> Double -> Double -> Double -> Double -> Double -> m ()
bezierCurveTo self
self Double
cp1x Double
cp1y Double
cp2x Double
cp2y Double
x Double
y
= DOM () -> m ()
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM
(JSM JSVal -> DOM ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void
((self -> CanvasPath
forall o. IsCanvasPath o => o -> CanvasPath
toCanvasPath self
self) CanvasPath
-> Getting (JSM JSVal) CanvasPath (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> [JSM JSVal] -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"bezierCurveTo"
[Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
cp1x, Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
cp1y, Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
cp2x, Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
cp2y, Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
x,
Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
y]))
arcTo ::
(MonadDOM m, IsCanvasPath self) =>
self -> Double -> Double -> Double -> Double -> Double -> m ()
arcTo :: forall (m :: * -> *) self.
(MonadDOM m, IsCanvasPath self) =>
self -> Double -> Double -> Double -> Double -> Double -> m ()
arcTo self
self Double
x1 Double
y1 Double
x2 Double
y2 Double
radius
= DOM () -> m ()
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM
(JSM JSVal -> DOM ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void
((self -> CanvasPath
forall o. IsCanvasPath o => o -> CanvasPath
toCanvasPath self
self) CanvasPath
-> Getting (JSM JSVal) CanvasPath (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> [JSM JSVal] -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"arcTo"
[Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
x1, Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
y1, Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
x2, Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
y2, Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
radius]))
rect ::
(MonadDOM m, IsCanvasPath self) =>
self -> Double -> Double -> Double -> Double -> m ()
rect :: forall (m :: * -> *) self.
(MonadDOM m, IsCanvasPath self) =>
self -> Double -> Double -> Double -> Double -> m ()
rect self
self Double
x Double
y Double
w Double
h
= DOM () -> m ()
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM
(JSM JSVal -> DOM ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void
((self -> CanvasPath
forall o. IsCanvasPath o => o -> CanvasPath
toCanvasPath self
self) CanvasPath
-> Getting (JSM JSVal) CanvasPath (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> [JSM JSVal] -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"rect"
[Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
x, Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
y, Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
w, Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
h]))
arc ::
(MonadDOM m, IsCanvasPath self) =>
self ->
Double -> Double -> Double -> Double -> Double -> Bool -> m ()
arc :: forall (m :: * -> *) self.
(MonadDOM m, IsCanvasPath self) =>
self
-> Double -> Double -> Double -> Double -> Double -> Bool -> m ()
arc self
self Double
x Double
y Double
radius Double
startAngle Double
endAngle Bool
anticlockwise
= DOM () -> m ()
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM
(JSM JSVal -> DOM ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void
((self -> CanvasPath
forall o. IsCanvasPath o => o -> CanvasPath
toCanvasPath self
self) CanvasPath
-> Getting (JSM JSVal) CanvasPath (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> [JSM JSVal] -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"arc"
[Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
x, Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
y, Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
radius, Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
startAngle,
Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
endAngle, Bool -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Bool
anticlockwise]))
ellipse ::
(MonadDOM m, IsCanvasPath self) =>
self ->
Double ->
Double ->
Double -> Double -> Double -> Double -> Double -> Bool -> m ()
ellipse :: forall (m :: * -> *) self.
(MonadDOM m, IsCanvasPath self) =>
self
-> Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> Double
-> Bool
-> m ()
ellipse self
self Double
x Double
y Double
radiusX Double
radiusY Double
rotation Double
startAngle Double
endAngle
Bool
anticlockwise
= DOM () -> m ()
forall (m :: * -> *) a. MonadDOM m => DOM a -> m a
liftDOM
(JSM JSVal -> DOM ()
forall (f :: * -> *) a. Functor f => f a -> f ()
void
((self -> CanvasPath
forall o. IsCanvasPath o => o -> CanvasPath
toCanvasPath self
self) CanvasPath
-> Getting (JSM JSVal) CanvasPath (JSM JSVal) -> JSM JSVal
forall s a. s -> Getting a s a -> a
^. String -> [JSM JSVal] -> JSF
forall name args.
(ToJSString name, MakeArgs args) =>
name -> args -> JSF
jsf String
"ellipse"
[Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
x, Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
y, Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
radiusX, Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
radiusY,
Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
rotation, Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
startAngle, Double -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Double
endAngle,
Bool -> JSM JSVal
forall a. ToJSVal a => a -> JSM JSVal
toJSVal Bool
anticlockwise]))