{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.SVGTransform
(setMatrix, setTranslate, setScale, setRotate, setSkewX, setSkewY,
pattern SVG_TRANSFORM_UNKNOWN, pattern SVG_TRANSFORM_MATRIX,
pattern SVG_TRANSFORM_TRANSLATE, pattern SVG_TRANSFORM_SCALE,
pattern SVG_TRANSFORM_ROTATE, pattern SVG_TRANSFORM_SKEWX,
pattern SVG_TRANSFORM_SKEWY, getType, getMatrix, getAngle,
SVGTransform(..), gTypeSVGTransform)
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
setMatrix :: (MonadDOM m) => SVGTransform -> SVGMatrix -> m ()
setMatrix self matrix
= liftDOM (void (self ^. jsf "setMatrix" [toJSVal matrix]))
setTranslate ::
(MonadDOM m) => SVGTransform -> Float -> Float -> m ()
setTranslate self tx ty
= liftDOM
(void (self ^. jsf "setTranslate" [toJSVal tx, toJSVal ty]))
setScale :: (MonadDOM m) => SVGTransform -> Float -> Float -> m ()
setScale self sx sy
= liftDOM (void (self ^. jsf "setScale" [toJSVal sx, toJSVal sy]))
setRotate ::
(MonadDOM m) => SVGTransform -> Float -> Float -> Float -> m ()
setRotate self angle cx cy
= liftDOM
(void
(self ^. jsf "setRotate" [toJSVal angle, toJSVal cx, toJSVal cy]))
setSkewX :: (MonadDOM m) => SVGTransform -> Float -> m ()
setSkewX self angle
= liftDOM (void (self ^. jsf "setSkewX" [toJSVal angle]))
setSkewY :: (MonadDOM m) => SVGTransform -> Float -> m ()
setSkewY self angle
= liftDOM (void (self ^. jsf "setSkewY" [toJSVal angle]))
pattern SVG_TRANSFORM_UNKNOWN = 0
pattern SVG_TRANSFORM_MATRIX = 1
pattern SVG_TRANSFORM_TRANSLATE = 2
pattern SVG_TRANSFORM_SCALE = 3
pattern SVG_TRANSFORM_ROTATE = 4
pattern SVG_TRANSFORM_SKEWX = 5
pattern SVG_TRANSFORM_SKEWY = 6
getType :: (MonadDOM m) => SVGTransform -> m Word
getType self
= liftDOM (round <$> ((self ^. js "type") >>= valToNumber))
getMatrix :: (MonadDOM m) => SVGTransform -> m SVGMatrix
getMatrix self
= liftDOM ((self ^. js "matrix") >>= fromJSValUnchecked)
getAngle :: (MonadDOM m) => SVGTransform -> m Float
getAngle self
= liftDOM (realToFrac <$> ((self ^. js "angle") >>= valToNumber))