{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module JSDOM.Generated.VTTRegion
(newVTTRegion, getTrack, setId, getId, setWidth, getWidth,
setHeight, getHeight, setRegionAnchorX, getRegionAnchorX,
setRegionAnchorY, getRegionAnchorY, setViewportAnchorX,
getViewportAnchorX, setViewportAnchorY, getViewportAnchorY,
setScroll, getScroll, VTTRegion(..), gTypeVTTRegion)
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
newVTTRegion :: (MonadDOM m) => m VTTRegion
newVTTRegion = liftDOM (VTTRegion <$> new (jsg "VTTRegion") ())
getTrack :: (MonadDOM m) => VTTRegion -> m TextTrack
getTrack self
= liftDOM ((self ^. js "track") >>= fromJSValUnchecked)
setId :: (MonadDOM m, ToJSString val) => VTTRegion -> val -> m ()
setId self val = liftDOM (self ^. jss "id" (toJSVal val))
getId :: (MonadDOM m, FromJSString result) => VTTRegion -> m result
getId self = liftDOM ((self ^. js "id") >>= fromJSValUnchecked)
setWidth :: (MonadDOM m) => VTTRegion -> Double -> m ()
setWidth self val = liftDOM (self ^. jss "width" (toJSVal val))
getWidth :: (MonadDOM m) => VTTRegion -> m Double
getWidth self = liftDOM ((self ^. js "width") >>= valToNumber)
setHeight :: (MonadDOM m) => VTTRegion -> Int -> m ()
setHeight self val = liftDOM (self ^. jss "height" (toJSVal val))
getHeight :: (MonadDOM m) => VTTRegion -> m Int
getHeight self
= liftDOM (round <$> ((self ^. js "height") >>= valToNumber))
setRegionAnchorX :: (MonadDOM m) => VTTRegion -> Double -> m ()
setRegionAnchorX self val
= liftDOM (self ^. jss "regionAnchorX" (toJSVal val))
getRegionAnchorX :: (MonadDOM m) => VTTRegion -> m Double
getRegionAnchorX self
= liftDOM ((self ^. js "regionAnchorX") >>= valToNumber)
setRegionAnchorY :: (MonadDOM m) => VTTRegion -> Double -> m ()
setRegionAnchorY self val
= liftDOM (self ^. jss "regionAnchorY" (toJSVal val))
getRegionAnchorY :: (MonadDOM m) => VTTRegion -> m Double
getRegionAnchorY self
= liftDOM ((self ^. js "regionAnchorY") >>= valToNumber)
setViewportAnchorX :: (MonadDOM m) => VTTRegion -> Double -> m ()
setViewportAnchorX self val
= liftDOM (self ^. jss "viewportAnchorX" (toJSVal val))
getViewportAnchorX :: (MonadDOM m) => VTTRegion -> m Double
getViewportAnchorX self
= liftDOM ((self ^. js "viewportAnchorX") >>= valToNumber)
setViewportAnchorY :: (MonadDOM m) => VTTRegion -> Double -> m ()
setViewportAnchorY self val
= liftDOM (self ^. jss "viewportAnchorY" (toJSVal val))
getViewportAnchorY :: (MonadDOM m) => VTTRegion -> m Double
getViewportAnchorY self
= liftDOM ((self ^. js "viewportAnchorY") >>= valToNumber)
setScroll ::
(MonadDOM m, ToJSString val) => VTTRegion -> val -> m ()
setScroll self val = liftDOM (self ^. jss "scroll" (toJSVal val))
getScroll ::
(MonadDOM m, FromJSString result) => VTTRegion -> m result
getScroll self
= liftDOM ((self ^. js "scroll") >>= fromJSValUnchecked)