module JSDOM.Generated.CanvasRenderingContext2D
(save, restore, commit, scale, rotate, translate, transform,
setTransform, resetTransform, setLineDash, getLineDash,
getLineDash_, clearRect, fillRect, beginPath, fillPath, strokePath,
clipPath, fill, stroke, clip, isPointInPathPath,
isPointInPathPath_, isPointInStrokePath, isPointInStrokePath_,
isPointInPath, isPointInPath_, isPointInStroke, isPointInStroke_,
measureText, measureText_, setAlpha, setCompositeOperation,
setLineWidthFunction, setLineCapFunction, setLineJoinFunction,
setMiterLimitFunction, clearShadow, fillText, strokeText,
setStrokeColor, setStrokeColorGray, setStrokeColorRGB,
setStrokeColorCYMK, setFillColor, setFillColorGray,
setFillColorRGB, setFillColorCYMK, strokeRect, drawImage,
drawImageScaled, drawImagePart, drawImageFromRect, setShadow,
setShadowGray, setShadowRGB, setShadowCYMK, putImageData,
putImageDataDirty, webkitPutImageDataHD, webkitPutImageDataHDDirty,
createImageData, createImageData_, createImageDataSize,
createImageDataSize_, createLinearGradient, createLinearGradient_,
createRadialGradient, createRadialGradient_, createPattern,
createPattern_, createPatternUnsafe, createPatternUnchecked,
getImageData, getImageData_, webkitGetImageDataHD,
webkitGetImageDataHD_, drawFocusIfNeeded, drawFocusIfNeededPath,
getCanvas, setGlobalAlpha, getGlobalAlpha,
setGlobalCompositeOperation, getGlobalCompositeOperation,
setLineWidth, getLineWidth, setLineCap, getLineCap, setLineJoin,
getLineJoin, setMiterLimit, getMiterLimit, setShadowOffsetX,
getShadowOffsetX, setShadowOffsetY, getShadowOffsetY,
setShadowBlur, getShadowBlur, setShadowColor, getShadowColor,
setLineDashOffset, getLineDashOffset, setWebkitLineDash,
getWebkitLineDash, setWebkitLineDashOffset,
getWebkitLineDashOffset, setFont, getFont, setTextAlign,
getTextAlign, setTextBaseline, getTextBaseline, setDirection,
getDirection, setStrokeStyle, getStrokeStyle, setFillStyle,
getFillStyle, getWebkitBackingStorePixelRatio,
setImageSmoothingEnabled, getImageSmoothingEnabled,
setWebkitImageSmoothingEnabled, getWebkitImageSmoothingEnabled,
setImageSmoothingQuality, getImageSmoothingQuality,
CanvasRenderingContext2D(..), gTypeCanvasRenderingContext2D)
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)
import JSDOM.Enums
save :: (MonadDOM m) => CanvasRenderingContext2D -> m ()
save self = liftDOM (void (self ^. jsf "save" ()))
restore :: (MonadDOM m) => CanvasRenderingContext2D -> m ()
restore self = liftDOM (void (self ^. jsf "restore" ()))
commit :: (MonadDOM m) => CanvasRenderingContext2D -> m ()
commit self = liftDOM (void (self ^. jsf "commit" ()))
scale ::
(MonadDOM m) => CanvasRenderingContext2D -> Float -> Float -> m ()
scale self sx sy
= liftDOM (void (self ^. jsf "scale" [toJSVal sx, toJSVal sy]))
rotate :: (MonadDOM m) => CanvasRenderingContext2D -> Float -> m ()
rotate self angle
= liftDOM (void (self ^. jsf "rotate" [toJSVal angle]))
translate ::
(MonadDOM m) => CanvasRenderingContext2D -> Float -> Float -> m ()
translate self tx ty
= liftDOM (void (self ^. jsf "translate" [toJSVal tx, toJSVal ty]))
transform ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
Float -> Float -> Float -> Float -> Float -> Float -> m ()
transform self m11 m12 m21 m22 dx dy
= liftDOM
(void
(self ^. jsf "transform"
[toJSVal m11, toJSVal m12, toJSVal m21, toJSVal m22, toJSVal dx,
toJSVal dy]))
setTransform ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
Float -> Float -> Float -> Float -> Float -> Float -> m ()
setTransform self m11 m12 m21 m22 dx dy
= liftDOM
(void
(self ^. jsf "setTransform"
[toJSVal m11, toJSVal m12, toJSVal m21, toJSVal m22, toJSVal dx,
toJSVal dy]))
resetTransform :: (MonadDOM m) => CanvasRenderingContext2D -> m ()
resetTransform self
= liftDOM (void (self ^. jsf "resetTransform" ()))
setLineDash ::
(MonadDOM m) => CanvasRenderingContext2D -> [Float] -> m ()
setLineDash self dash
= liftDOM (void (self ^. jsf "setLineDash" [toJSVal (array dash)]))
getLineDash ::
(MonadDOM m) => CanvasRenderingContext2D -> m [Float]
getLineDash self
= liftDOM ((self ^. jsf "getLineDash" ()) >>= fromJSArrayUnchecked)
getLineDash_ :: (MonadDOM m) => CanvasRenderingContext2D -> m ()
getLineDash_ self = liftDOM (void (self ^. jsf "getLineDash" ()))
clearRect ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
Float -> Float -> Float -> Float -> m ()
clearRect self x y width height
= liftDOM
(void
(self ^. jsf "clearRect"
[toJSVal x, toJSVal y, toJSVal width, toJSVal height]))
fillRect ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
Float -> Float -> Float -> Float -> m ()
fillRect self x y width height
= liftDOM
(void
(self ^. jsf "fillRect"
[toJSVal x, toJSVal y, toJSVal width, toJSVal height]))
beginPath :: (MonadDOM m) => CanvasRenderingContext2D -> m ()
beginPath self = liftDOM (void (self ^. jsf "beginPath" ()))
fillPath ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
Path2D -> Maybe CanvasWindingRule -> m ()
fillPath self path winding
= liftDOM
(void (self ^. jsf "fill" [toJSVal path, toJSVal winding]))
strokePath ::
(MonadDOM m) => CanvasRenderingContext2D -> Path2D -> m ()
strokePath self path
= liftDOM (void (self ^. jsf "stroke" [toJSVal path]))
clipPath ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
Path2D -> Maybe CanvasWindingRule -> m ()
clipPath self path winding
= liftDOM
(void (self ^. jsf "clip" [toJSVal path, toJSVal winding]))
fill ::
(MonadDOM m) =>
CanvasRenderingContext2D -> Maybe CanvasWindingRule -> m ()
fill self winding
= liftDOM (void (self ^. jsf "fill" [toJSVal winding]))
stroke :: (MonadDOM m) => CanvasRenderingContext2D -> m ()
stroke self = liftDOM (void (self ^. jsf "stroke" ()))
clip ::
(MonadDOM m) =>
CanvasRenderingContext2D -> Maybe CanvasWindingRule -> m ()
clip self winding
= liftDOM (void (self ^. jsf "clip" [toJSVal winding]))
isPointInPathPath ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
Path2D -> Float -> Float -> Maybe CanvasWindingRule -> m Bool
isPointInPathPath self path x y winding
= liftDOM
((self ^. jsf "isPointInPath"
[toJSVal path, toJSVal x, toJSVal y, toJSVal winding])
>>= valToBool)
isPointInPathPath_ ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
Path2D -> Float -> Float -> Maybe CanvasWindingRule -> m ()
isPointInPathPath_ self path x y winding
= liftDOM
(void
(self ^. jsf "isPointInPath"
[toJSVal path, toJSVal x, toJSVal y, toJSVal winding]))
isPointInStrokePath ::
(MonadDOM m) =>
CanvasRenderingContext2D -> Path2D -> Float -> Float -> m Bool
isPointInStrokePath self path x y
= liftDOM
((self ^. jsf "isPointInStroke"
[toJSVal path, toJSVal x, toJSVal y])
>>= valToBool)
isPointInStrokePath_ ::
(MonadDOM m) =>
CanvasRenderingContext2D -> Path2D -> Float -> Float -> m ()
isPointInStrokePath_ self path x y
= liftDOM
(void
(self ^. jsf "isPointInStroke"
[toJSVal path, toJSVal x, toJSVal y]))
isPointInPath ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
Float -> Float -> Maybe CanvasWindingRule -> m Bool
isPointInPath self x y winding
= liftDOM
((self ^. jsf "isPointInPath"
[toJSVal x, toJSVal y, toJSVal winding])
>>= valToBool)
isPointInPath_ ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
Float -> Float -> Maybe CanvasWindingRule -> m ()
isPointInPath_ self x y winding
= liftDOM
(void
(self ^. jsf "isPointInPath"
[toJSVal x, toJSVal y, toJSVal winding]))
isPointInStroke ::
(MonadDOM m) =>
CanvasRenderingContext2D -> Float -> Float -> m Bool
isPointInStroke self x y
= liftDOM
((self ^. jsf "isPointInStroke" [toJSVal x, toJSVal y]) >>=
valToBool)
isPointInStroke_ ::
(MonadDOM m) => CanvasRenderingContext2D -> Float -> Float -> m ()
isPointInStroke_ self x y
= liftDOM
(void (self ^. jsf "isPointInStroke" [toJSVal x, toJSVal y]))
measureText ::
(MonadDOM m, ToJSString text) =>
CanvasRenderingContext2D -> text -> m TextMetrics
measureText self text
= liftDOM
((self ^. jsf "measureText" [toJSVal text]) >>= fromJSValUnchecked)
measureText_ ::
(MonadDOM m, ToJSString text) =>
CanvasRenderingContext2D -> text -> m ()
measureText_ self text
= liftDOM (void (self ^. jsf "measureText" [toJSVal text]))
setAlpha ::
(MonadDOM m) => CanvasRenderingContext2D -> Maybe Float -> m ()
setAlpha self alpha
= liftDOM (void (self ^. jsf "setAlpha" [toJSVal alpha]))
setCompositeOperation ::
(MonadDOM m, ToJSString compositeOperation) =>
CanvasRenderingContext2D -> Maybe compositeOperation -> m ()
setCompositeOperation self compositeOperation
= liftDOM
(void
(self ^. jsf "setCompositeOperation" [toJSVal compositeOperation]))
setLineWidthFunction ::
(MonadDOM m) => CanvasRenderingContext2D -> Maybe Float -> m ()
setLineWidthFunction self width
= liftDOM (void (self ^. jsf "setLineWidth" [toJSVal width]))
setLineCapFunction ::
(MonadDOM m, ToJSString cap) =>
CanvasRenderingContext2D -> Maybe cap -> m ()
setLineCapFunction self cap
= liftDOM (void (self ^. jsf "setLineCap" [toJSVal cap]))
setLineJoinFunction ::
(MonadDOM m, ToJSString join) =>
CanvasRenderingContext2D -> Maybe join -> m ()
setLineJoinFunction self join
= liftDOM (void (self ^. jsf "setLineJoin" [toJSVal join]))
setMiterLimitFunction ::
(MonadDOM m) => CanvasRenderingContext2D -> Maybe Float -> m ()
setMiterLimitFunction self limit
= liftDOM (void (self ^. jsf "setMiterLimit" [toJSVal limit]))
clearShadow :: (MonadDOM m) => CanvasRenderingContext2D -> m ()
clearShadow self = liftDOM (void (self ^. jsf "clearShadow" ()))
fillText ::
(MonadDOM m, ToJSString text) =>
CanvasRenderingContext2D ->
text -> Float -> Float -> Maybe Float -> m ()
fillText self text x y maxWidth
= liftDOM
(void
(self ^. jsf "fillText"
[toJSVal text, toJSVal x, toJSVal y, toJSVal maxWidth]))
strokeText ::
(MonadDOM m, ToJSString text) =>
CanvasRenderingContext2D ->
text -> Float -> Float -> Maybe Float -> m ()
strokeText self text x y maxWidth
= liftDOM
(void
(self ^. jsf "strokeText"
[toJSVal text, toJSVal x, toJSVal y, toJSVal maxWidth]))
setStrokeColor ::
(MonadDOM m, ToJSString color) =>
CanvasRenderingContext2D -> color -> Maybe Float -> m ()
setStrokeColor self color alpha
= liftDOM
(void
(self ^. jsf "setStrokeColor" [toJSVal color, toJSVal alpha]))
setStrokeColorGray ::
(MonadDOM m) =>
CanvasRenderingContext2D -> Float -> Maybe Float -> m ()
setStrokeColorGray self grayLevel alpha
= liftDOM
(void
(self ^. jsf "setStrokeColor" [toJSVal grayLevel, toJSVal alpha]))
setStrokeColorRGB ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
Float -> Float -> Float -> Float -> m ()
setStrokeColorRGB self r g b a
= liftDOM
(void
(self ^. jsf "setStrokeColor"
[toJSVal r, toJSVal g, toJSVal b, toJSVal a]))
setStrokeColorCYMK ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
Float -> Float -> Float -> Float -> Float -> m ()
setStrokeColorCYMK self c m y k a
= liftDOM
(void
(self ^. jsf "setStrokeColor"
[toJSVal c, toJSVal m, toJSVal y, toJSVal k, toJSVal a]))
setFillColor ::
(MonadDOM m, ToJSString color) =>
CanvasRenderingContext2D -> color -> Maybe Float -> m ()
setFillColor self color alpha
= liftDOM
(void (self ^. jsf "setFillColor" [toJSVal color, toJSVal alpha]))
setFillColorGray ::
(MonadDOM m) =>
CanvasRenderingContext2D -> Float -> Maybe Float -> m ()
setFillColorGray self grayLevel alpha
= liftDOM
(void
(self ^. jsf "setFillColor" [toJSVal grayLevel, toJSVal alpha]))
setFillColorRGB ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
Float -> Float -> Float -> Float -> m ()
setFillColorRGB self r g b a
= liftDOM
(void
(self ^. jsf "setFillColor"
[toJSVal r, toJSVal g, toJSVal b, toJSVal a]))
setFillColorCYMK ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
Float -> Float -> Float -> Float -> Float -> m ()
setFillColorCYMK self c m y k a
= liftDOM
(void
(self ^. jsf "setFillColor"
[toJSVal c, toJSVal m, toJSVal y, toJSVal k, toJSVal a]))
strokeRect ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
Float -> Float -> Float -> Float -> m ()
strokeRect self x y width height
= liftDOM
(void
(self ^. jsf "strokeRect"
[toJSVal x, toJSVal y, toJSVal width, toJSVal height]))
drawImage ::
(MonadDOM m, IsCanvasImageSource image) =>
CanvasRenderingContext2D -> image -> Float -> Float -> m ()
drawImage self image x y
= liftDOM
(void
(self ^. jsf "drawImage" [toJSVal image, toJSVal x, toJSVal y]))
drawImageScaled ::
(MonadDOM m, IsCanvasImageSource image) =>
CanvasRenderingContext2D ->
image -> Float -> Float -> Float -> Float -> m ()
drawImageScaled self image x y width height
= liftDOM
(void
(self ^. jsf "drawImage"
[toJSVal image, toJSVal x, toJSVal y, toJSVal width,
toJSVal height]))
drawImagePart ::
(MonadDOM m, IsCanvasImageSource image) =>
CanvasRenderingContext2D ->
image ->
Float ->
Float -> Float -> Float -> Float -> Float -> Float -> Float -> m ()
drawImagePart self image sx sy sw sh dx dy dw dh
= liftDOM
(void
(self ^. jsf "drawImage"
[toJSVal image, toJSVal sx, toJSVal sy, toJSVal sw, toJSVal sh,
toJSVal dx, toJSVal dy, toJSVal dw, toJSVal dh]))
drawImageFromRect ::
(MonadDOM m, ToJSString compositeOperation) =>
CanvasRenderingContext2D ->
HTMLImageElement ->
Maybe Float ->
Maybe Float ->
Maybe Float ->
Maybe Float ->
Maybe Float ->
Maybe Float ->
Maybe Float -> Maybe Float -> Maybe compositeOperation -> m ()
drawImageFromRect self image sx sy sw sh dx dy dw dh
compositeOperation
= liftDOM
(void
(self ^. jsf "drawImageFromRect"
[toJSVal image, toJSVal sx, toJSVal sy, toJSVal sw, toJSVal sh,
toJSVal dx, toJSVal dy, toJSVal dw, toJSVal dh,
toJSVal compositeOperation]))
setShadow ::
(MonadDOM m, ToJSString color) =>
CanvasRenderingContext2D ->
Float -> Float -> Float -> Maybe color -> Maybe Float -> m ()
setShadow self width height blur color alpha
= liftDOM
(void
(self ^. jsf "setShadow"
[toJSVal width, toJSVal height, toJSVal blur, toJSVal color,
toJSVal alpha]))
setShadowGray ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
Float -> Float -> Float -> Float -> Maybe Float -> m ()
setShadowGray self width height blur grayLevel alpha
= liftDOM
(void
(self ^. jsf "setShadow"
[toJSVal width, toJSVal height, toJSVal blur, toJSVal grayLevel,
toJSVal alpha]))
setShadowRGB ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
Float -> Float -> Float -> Float -> Float -> Float -> Float -> m ()
setShadowRGB self width height blur r g b a
= liftDOM
(void
(self ^. jsf "setShadow"
[toJSVal width, toJSVal height, toJSVal blur, toJSVal r, toJSVal g,
toJSVal b, toJSVal a]))
setShadowCYMK ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
Float ->
Float -> Float -> Float -> Float -> Float -> Float -> Float -> m ()
setShadowCYMK self width height blur c m y k a
= liftDOM
(void
(self ^. jsf "setShadow"
[toJSVal width, toJSVal height, toJSVal blur, toJSVal c, toJSVal m,
toJSVal y, toJSVal k, toJSVal a]))
putImageData ::
(MonadDOM m) =>
CanvasRenderingContext2D -> ImageData -> Float -> Float -> m ()
putImageData self imagedata dx dy
= liftDOM
(void
(self ^. jsf "putImageData"
[toJSVal imagedata, toJSVal dx, toJSVal dy]))
putImageDataDirty ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
ImageData ->
Float -> Float -> Float -> Float -> Float -> Float -> m ()
putImageDataDirty self imagedata dx dy dirtyX dirtyY dirtyWidth
dirtyHeight
= liftDOM
(void
(self ^. jsf "putImageData"
[toJSVal imagedata, toJSVal dx, toJSVal dy, toJSVal dirtyX,
toJSVal dirtyY, toJSVal dirtyWidth, toJSVal dirtyHeight]))
webkitPutImageDataHD ::
(MonadDOM m) =>
CanvasRenderingContext2D -> ImageData -> Float -> Float -> m ()
webkitPutImageDataHD self imagedata dx dy
= liftDOM
(void
(self ^. jsf "webkitPutImageDataHD"
[toJSVal imagedata, toJSVal dx, toJSVal dy]))
webkitPutImageDataHDDirty ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
ImageData ->
Float -> Float -> Float -> Float -> Float -> Float -> m ()
webkitPutImageDataHDDirty self imagedata dx dy dirtyX dirtyY
dirtyWidth dirtyHeight
= liftDOM
(void
(self ^. jsf "webkitPutImageDataHD"
[toJSVal imagedata, toJSVal dx, toJSVal dy, toJSVal dirtyX,
toJSVal dirtyY, toJSVal dirtyWidth, toJSVal dirtyHeight]))
createImageData ::
(MonadDOM m) =>
CanvasRenderingContext2D -> Maybe ImageData -> m ImageData
createImageData self imagedata
= liftDOM
((self ^. jsf "createImageData" [toJSVal imagedata]) >>=
fromJSValUnchecked)
createImageData_ ::
(MonadDOM m) => CanvasRenderingContext2D -> Maybe ImageData -> m ()
createImageData_ self imagedata
= liftDOM
(void (self ^. jsf "createImageData" [toJSVal imagedata]))
createImageDataSize ::
(MonadDOM m) =>
CanvasRenderingContext2D -> Float -> Float -> m ImageData
createImageDataSize self sw sh
= liftDOM
((self ^. jsf "createImageData" [toJSVal sw, toJSVal sh]) >>=
fromJSValUnchecked)
createImageDataSize_ ::
(MonadDOM m) => CanvasRenderingContext2D -> Float -> Float -> m ()
createImageDataSize_ self sw sh
= liftDOM
(void (self ^. jsf "createImageData" [toJSVal sw, toJSVal sh]))
createLinearGradient ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
Float -> Float -> Float -> Float -> m CanvasGradient
createLinearGradient self x0 y0 x1 y1
= liftDOM
((self ^. jsf "createLinearGradient"
[toJSVal x0, toJSVal y0, toJSVal x1, toJSVal y1])
>>= fromJSValUnchecked)
createLinearGradient_ ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
Float -> Float -> Float -> Float -> m ()
createLinearGradient_ self x0 y0 x1 y1
= liftDOM
(void
(self ^. jsf "createLinearGradient"
[toJSVal x0, toJSVal y0, toJSVal x1, toJSVal y1]))
createRadialGradient ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
Float ->
Float -> Float -> Float -> Float -> Float -> m CanvasGradient
createRadialGradient self x0 y0 r0 x1 y1 r1
= liftDOM
((self ^. jsf "createRadialGradient"
[toJSVal x0, toJSVal y0, toJSVal r0, toJSVal x1, toJSVal y1,
toJSVal r1])
>>= fromJSValUnchecked)
createRadialGradient_ ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
Float -> Float -> Float -> Float -> Float -> Float -> m ()
createRadialGradient_ self x0 y0 r0 x1 y1 r1
= liftDOM
(void
(self ^. jsf "createRadialGradient"
[toJSVal x0, toJSVal y0, toJSVal r0, toJSVal x1, toJSVal y1,
toJSVal r1]))
createPattern ::
(MonadDOM m, IsCanvasImageSource image, ToJSString repetition) =>
CanvasRenderingContext2D ->
image -> repetition -> m (Maybe CanvasPattern)
createPattern self image repetition
= liftDOM
((self ^. jsf "createPattern" [toJSVal image, toJSVal repetition])
>>= fromJSVal)
createPattern_ ::
(MonadDOM m, IsCanvasImageSource image, ToJSString repetition) =>
CanvasRenderingContext2D -> image -> repetition -> m ()
createPattern_ self image repetition
= liftDOM
(void
(self ^. jsf "createPattern" [toJSVal image, toJSVal repetition]))
createPatternUnsafe ::
(MonadDOM m, IsCanvasImageSource image, ToJSString repetition,
HasCallStack) =>
CanvasRenderingContext2D -> image -> repetition -> m CanvasPattern
createPatternUnsafe self image repetition
= liftDOM
(((self ^. jsf "createPattern" [toJSVal image, toJSVal repetition])
>>= fromJSVal)
>>= maybe (Prelude.error "Nothing to return") return)
createPatternUnchecked ::
(MonadDOM m, IsCanvasImageSource image, ToJSString repetition) =>
CanvasRenderingContext2D -> image -> repetition -> m CanvasPattern
createPatternUnchecked self image repetition
= liftDOM
((self ^. jsf "createPattern" [toJSVal image, toJSVal repetition])
>>= fromJSValUnchecked)
getImageData ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
Float -> Float -> Float -> Float -> m ImageData
getImageData self sx sy sw sh
= liftDOM
((self ^. jsf "getImageData"
[toJSVal sx, toJSVal sy, toJSVal sw, toJSVal sh])
>>= fromJSValUnchecked)
getImageData_ ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
Float -> Float -> Float -> Float -> m ()
getImageData_ self sx sy sw sh
= liftDOM
(void
(self ^. jsf "getImageData"
[toJSVal sx, toJSVal sy, toJSVal sw, toJSVal sh]))
webkitGetImageDataHD ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
Float -> Float -> Float -> Float -> m ImageData
webkitGetImageDataHD self sx sy sw sh
= liftDOM
((self ^. jsf "webkitGetImageDataHD"
[toJSVal sx, toJSVal sy, toJSVal sw, toJSVal sh])
>>= fromJSValUnchecked)
webkitGetImageDataHD_ ::
(MonadDOM m) =>
CanvasRenderingContext2D ->
Float -> Float -> Float -> Float -> m ()
webkitGetImageDataHD_ self sx sy sw sh
= liftDOM
(void
(self ^. jsf "webkitGetImageDataHD"
[toJSVal sx, toJSVal sy, toJSVal sw, toJSVal sh]))
drawFocusIfNeeded ::
(MonadDOM m, IsElement element) =>
CanvasRenderingContext2D -> element -> m ()
drawFocusIfNeeded self element
= liftDOM
(void (self ^. jsf "drawFocusIfNeeded" [toJSVal element]))
drawFocusIfNeededPath ::
(MonadDOM m, IsElement element) =>
CanvasRenderingContext2D -> Path2D -> element -> m ()
drawFocusIfNeededPath self path element
= liftDOM
(void
(self ^. jsf "drawFocusIfNeeded" [toJSVal path, toJSVal element]))
getCanvas ::
(MonadDOM m) => CanvasRenderingContext2D -> m HTMLCanvasElement
getCanvas self
= liftDOM ((self ^. js "canvas") >>= fromJSValUnchecked)
setGlobalAlpha ::
(MonadDOM m) => CanvasRenderingContext2D -> Float -> m ()
setGlobalAlpha self val
= liftDOM (self ^. jss "globalAlpha" (toJSVal val))
getGlobalAlpha ::
(MonadDOM m) => CanvasRenderingContext2D -> m Float
getGlobalAlpha self
= liftDOM
(realToFrac <$> ((self ^. js "globalAlpha") >>= valToNumber))
setGlobalCompositeOperation ::
(MonadDOM m, ToJSString val) =>
CanvasRenderingContext2D -> val -> m ()
setGlobalCompositeOperation self val
= liftDOM (self ^. jss "globalCompositeOperation" (toJSVal val))
getGlobalCompositeOperation ::
(MonadDOM m, FromJSString result) =>
CanvasRenderingContext2D -> m result
getGlobalCompositeOperation self
= liftDOM
((self ^. js "globalCompositeOperation") >>= fromJSValUnchecked)
setLineWidth ::
(MonadDOM m) => CanvasRenderingContext2D -> Float -> m ()
setLineWidth self val
= liftDOM (self ^. jss "lineWidth" (toJSVal val))
getLineWidth :: (MonadDOM m) => CanvasRenderingContext2D -> m Float
getLineWidth self
= liftDOM
(realToFrac <$> ((self ^. js "lineWidth") >>= valToNumber))
setLineCap ::
(MonadDOM m, ToJSString val) =>
CanvasRenderingContext2D -> val -> m ()
setLineCap self val = liftDOM (self ^. jss "lineCap" (toJSVal val))
getLineCap ::
(MonadDOM m, FromJSString result) =>
CanvasRenderingContext2D -> m result
getLineCap self
= liftDOM ((self ^. js "lineCap") >>= fromJSValUnchecked)
setLineJoin ::
(MonadDOM m, ToJSString val) =>
CanvasRenderingContext2D -> val -> m ()
setLineJoin self val
= liftDOM (self ^. jss "lineJoin" (toJSVal val))
getLineJoin ::
(MonadDOM m, FromJSString result) =>
CanvasRenderingContext2D -> m result
getLineJoin self
= liftDOM ((self ^. js "lineJoin") >>= fromJSValUnchecked)
setMiterLimit ::
(MonadDOM m) => CanvasRenderingContext2D -> Float -> m ()
setMiterLimit self val
= liftDOM (self ^. jss "miterLimit" (toJSVal val))
getMiterLimit ::
(MonadDOM m) => CanvasRenderingContext2D -> m Float
getMiterLimit self
= liftDOM
(realToFrac <$> ((self ^. js "miterLimit") >>= valToNumber))
setShadowOffsetX ::
(MonadDOM m) => CanvasRenderingContext2D -> Float -> m ()
setShadowOffsetX self val
= liftDOM (self ^. jss "shadowOffsetX" (toJSVal val))
getShadowOffsetX ::
(MonadDOM m) => CanvasRenderingContext2D -> m Float
getShadowOffsetX self
= liftDOM
(realToFrac <$> ((self ^. js "shadowOffsetX") >>= valToNumber))
setShadowOffsetY ::
(MonadDOM m) => CanvasRenderingContext2D -> Float -> m ()
setShadowOffsetY self val
= liftDOM (self ^. jss "shadowOffsetY" (toJSVal val))
getShadowOffsetY ::
(MonadDOM m) => CanvasRenderingContext2D -> m Float
getShadowOffsetY self
= liftDOM
(realToFrac <$> ((self ^. js "shadowOffsetY") >>= valToNumber))
setShadowBlur ::
(MonadDOM m) => CanvasRenderingContext2D -> Float -> m ()
setShadowBlur self val
= liftDOM (self ^. jss "shadowBlur" (toJSVal val))
getShadowBlur ::
(MonadDOM m) => CanvasRenderingContext2D -> m Float
getShadowBlur self
= liftDOM
(realToFrac <$> ((self ^. js "shadowBlur") >>= valToNumber))
setShadowColor ::
(MonadDOM m, ToJSString val) =>
CanvasRenderingContext2D -> val -> m ()
setShadowColor self val
= liftDOM (self ^. jss "shadowColor" (toJSVal val))
getShadowColor ::
(MonadDOM m, FromJSString result) =>
CanvasRenderingContext2D -> m result
getShadowColor self
= liftDOM ((self ^. js "shadowColor") >>= fromJSValUnchecked)
setLineDashOffset ::
(MonadDOM m) => CanvasRenderingContext2D -> Float -> m ()
setLineDashOffset self val
= liftDOM (self ^. jss "lineDashOffset" (toJSVal val))
getLineDashOffset ::
(MonadDOM m) => CanvasRenderingContext2D -> m Float
getLineDashOffset self
= liftDOM
(realToFrac <$> ((self ^. js "lineDashOffset") >>= valToNumber))
setWebkitLineDash ::
(MonadDOM m) => CanvasRenderingContext2D -> [Float] -> m ()
setWebkitLineDash self val
= liftDOM (self ^. jss "webkitLineDash" (toJSVal (array val)))
getWebkitLineDash ::
(MonadDOM m) => CanvasRenderingContext2D -> m [Float]
getWebkitLineDash self
= liftDOM ((self ^. js "webkitLineDash") >>= fromJSArrayUnchecked)
setWebkitLineDashOffset ::
(MonadDOM m) => CanvasRenderingContext2D -> Float -> m ()
setWebkitLineDashOffset self val
= liftDOM (self ^. jss "webkitLineDashOffset" (toJSVal val))
getWebkitLineDashOffset ::
(MonadDOM m) => CanvasRenderingContext2D -> m Float
getWebkitLineDashOffset self
= liftDOM
(realToFrac <$>
((self ^. js "webkitLineDashOffset") >>= valToNumber))
setFont ::
(MonadDOM m, ToJSString val) =>
CanvasRenderingContext2D -> val -> m ()
setFont self val = liftDOM (self ^. jss "font" (toJSVal val))
getFont ::
(MonadDOM m, FromJSString result) =>
CanvasRenderingContext2D -> m result
getFont self = liftDOM ((self ^. js "font") >>= fromJSValUnchecked)
setTextAlign ::
(MonadDOM m, ToJSString val) =>
CanvasRenderingContext2D -> val -> m ()
setTextAlign self val
= liftDOM (self ^. jss "textAlign" (toJSVal val))
getTextAlign ::
(MonadDOM m, FromJSString result) =>
CanvasRenderingContext2D -> m result
getTextAlign self
= liftDOM ((self ^. js "textAlign") >>= fromJSValUnchecked)
setTextBaseline ::
(MonadDOM m, ToJSString val) =>
CanvasRenderingContext2D -> val -> m ()
setTextBaseline self val
= liftDOM (self ^. jss "textBaseline" (toJSVal val))
getTextBaseline ::
(MonadDOM m, FromJSString result) =>
CanvasRenderingContext2D -> m result
getTextBaseline self
= liftDOM ((self ^. js "textBaseline") >>= fromJSValUnchecked)
setDirection ::
(MonadDOM m, ToJSString val) =>
CanvasRenderingContext2D -> val -> m ()
setDirection self val
= liftDOM (self ^. jss "direction" (toJSVal val))
getDirection ::
(MonadDOM m, FromJSString result) =>
CanvasRenderingContext2D -> m result
getDirection self
= liftDOM ((self ^. js "direction") >>= fromJSValUnchecked)
setStrokeStyle ::
(MonadDOM m, IsCanvasStyle val) =>
CanvasRenderingContext2D -> val -> m ()
setStrokeStyle self val
= liftDOM (self ^. jss "strokeStyle" (toJSVal val))
getStrokeStyle ::
(MonadDOM m) => CanvasRenderingContext2D -> m CanvasStyle
getStrokeStyle self
= liftDOM ((self ^. js "strokeStyle") >>= fromJSValUnchecked)
setFillStyle ::
(MonadDOM m, IsCanvasStyle val) =>
CanvasRenderingContext2D -> val -> m ()
setFillStyle self val
= liftDOM (self ^. jss "fillStyle" (toJSVal val))
getFillStyle ::
(MonadDOM m) => CanvasRenderingContext2D -> m CanvasStyle
getFillStyle self
= liftDOM ((self ^. js "fillStyle") >>= fromJSValUnchecked)
getWebkitBackingStorePixelRatio ::
(MonadDOM m) => CanvasRenderingContext2D -> m Float
getWebkitBackingStorePixelRatio self
= liftDOM
(realToFrac <$>
((self ^. js "webkitBackingStorePixelRatio") >>= valToNumber))
setImageSmoothingEnabled ::
(MonadDOM m) => CanvasRenderingContext2D -> Bool -> m ()
setImageSmoothingEnabled self val
= liftDOM (self ^. jss "imageSmoothingEnabled" (toJSVal val))
getImageSmoothingEnabled ::
(MonadDOM m) => CanvasRenderingContext2D -> m Bool
getImageSmoothingEnabled self
= liftDOM ((self ^. js "imageSmoothingEnabled") >>= valToBool)
setWebkitImageSmoothingEnabled ::
(MonadDOM m) => CanvasRenderingContext2D -> Bool -> m ()
setWebkitImageSmoothingEnabled self val
= liftDOM (self ^. jss "webkitImageSmoothingEnabled" (toJSVal val))
getWebkitImageSmoothingEnabled ::
(MonadDOM m) => CanvasRenderingContext2D -> m Bool
getWebkitImageSmoothingEnabled self
= liftDOM
((self ^. js "webkitImageSmoothingEnabled") >>= valToBool)
setImageSmoothingQuality ::
(MonadDOM m) =>
CanvasRenderingContext2D -> ImageSmoothingQuality -> m ()
setImageSmoothingQuality self val
= liftDOM (self ^. jss "imageSmoothingQuality" (toJSVal val))
getImageSmoothingQuality ::
(MonadDOM m) => CanvasRenderingContext2D -> m ImageSmoothingQuality
getImageSmoothingQuality self
= liftDOM
((self ^. js "imageSmoothingQuality") >>= fromJSValUnchecked)