{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.DOMPoint
(newDOMPoint, newDOMPoint', fromPoint, fromPoint_, setX, getX,
setY, getY, setZ, getZ, setW, getW, DOMPoint(..), gTypeDOMPoint)
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
newDOMPoint :: (MonadDOM m) => DOMPointInit -> m DOMPoint
newDOMPoint point
= liftDOM (DOMPoint <$> new (jsg "DOMPoint") [toJSVal point])
newDOMPoint' ::
(MonadDOM m) =>
Maybe Double ->
Maybe Double -> Maybe Double -> Maybe Double -> m DOMPoint
newDOMPoint' x y z w
= liftDOM
(DOMPoint <$>
new (jsg "DOMPoint") [toJSVal x, toJSVal y, toJSVal z, toJSVal w])
fromPoint :: (MonadDOM m) => Maybe DOMPointInit -> m DOMPoint
fromPoint other
= liftDOM
(((jsg "DOMPoint") ^. jsf "fromPoint" [toJSVal other]) >>=
fromJSValUnchecked)
fromPoint_ :: (MonadDOM m) => Maybe DOMPointInit -> m ()
fromPoint_ other
= liftDOM
(void ((jsg "DOMPoint") ^. jsf "fromPoint" [toJSVal other]))
setX :: (MonadDOM m) => DOMPoint -> Double -> m ()
setX self val = liftDOM (self ^. jss "x" (toJSVal val))
getX :: (MonadDOM m) => DOMPoint -> m Double
getX self = liftDOM ((self ^. js "x") >>= valToNumber)
setY :: (MonadDOM m) => DOMPoint -> Double -> m ()
setY self val = liftDOM (self ^. jss "y" (toJSVal val))
getY :: (MonadDOM m) => DOMPoint -> m Double
getY self = liftDOM ((self ^. js "y") >>= valToNumber)
setZ :: (MonadDOM m) => DOMPoint -> Double -> m ()
setZ self val = liftDOM (self ^. jss "z" (toJSVal val))
getZ :: (MonadDOM m) => DOMPoint -> m Double
getZ self = liftDOM ((self ^. js "z") >>= valToNumber)
setW :: (MonadDOM m) => DOMPoint -> Double -> m ()
setW self val = liftDOM (self ^. jss "w" (toJSVal val))
getW :: (MonadDOM m) => DOMPoint -> m Double
getW self = liftDOM ((self ^. js "w") >>= valToNumber)