jsaddle-dom-0.10.0.0: src/JSDOM/Generated/GPUMultisampleState.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from webgpu (webref). Do not edit.
module JSDOM.Generated.GPUMultisampleState
(newGPUMultisampleState, setCount, getCount, getCountUnsafe, getCountUnchecked, setMask, getMask, getMaskUnsafe, getMaskUnchecked, setAlphaToCoverageEnabled, getAlphaToCoverageEnabled, getAlphaToCoverageEnabledUnsafe, getAlphaToCoverageEnabledUnchecked, GPUMultisampleState(..), gTypeGPUMultisampleState)
where
import Prelude ((.), (==), (>>=), (<$>), (++), Bool(..), Maybe(..), IO, Int, Word, Double, Float)
import qualified Prelude as P
import Control.Monad (void)
import Control.Lens.Operators ((^.))
import Language.Javascript.JSaddle (JSM, JSVal, JSString, toJSVal, valToBool, valToNumber, js, jss, jsf, jsg, new, function, asyncFunction, jsUndefined, jsNull)
import JSDOM.Types
import qualified JSDOM.Types as Types
import JSDOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import JSDOM.Generated.Enums
-- | <https://gpuweb.github.io/gpuweb/#dictdef-gpumultisamplestate GPUMultisampleState specification>
newGPUMultisampleState :: (MonadDOM m) => m GPUMultisampleState
newGPUMultisampleState = liftDOM ((((new (jsg "Object") () >>= \o -> P.return o)) >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpumultisamplestate-count GPUMultisampleState.count specification>
setCount :: (MonadDOM m) => GPUMultisampleState -> Word -> m ()
setCount self val = liftDOM (void (self ^. jss "count" (toJSVal val)))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpumultisamplestate-count GPUMultisampleState.count specification>
getCount :: (MonadDOM m) => GPUMultisampleState -> m (Maybe Word)
getCount self = liftDOM (((self ^. js "count") >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpumultisamplestate-count GPUMultisampleState.count specification>
getCountUnsafe :: (MonadDOM m, HasCallStack) => GPUMultisampleState -> m Word
getCountUnsafe self = liftDOM ((((self ^. js "count") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpumultisamplestate-count GPUMultisampleState.count specification>
getCountUnchecked :: (MonadDOM m) => GPUMultisampleState -> m Word
getCountUnchecked self = liftDOM ((P.round <$> ((self ^. js "count") >>= valToNumber)))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpumultisamplestate-mask GPUMultisampleState.mask specification>
setMask :: (MonadDOM m) => GPUMultisampleState -> Word -> m ()
setMask self val = liftDOM (void (self ^. jss "mask" (toJSVal val)))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpumultisamplestate-mask GPUMultisampleState.mask specification>
getMask :: (MonadDOM m) => GPUMultisampleState -> m (Maybe Word)
getMask self = liftDOM (((self ^. js "mask") >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpumultisamplestate-mask GPUMultisampleState.mask specification>
getMaskUnsafe :: (MonadDOM m, HasCallStack) => GPUMultisampleState -> m Word
getMaskUnsafe self = liftDOM ((((self ^. js "mask") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpumultisamplestate-mask GPUMultisampleState.mask specification>
getMaskUnchecked :: (MonadDOM m) => GPUMultisampleState -> m Word
getMaskUnchecked self = liftDOM ((P.round <$> ((self ^. js "mask") >>= valToNumber)))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpumultisamplestate-alphatocoverageenabled GPUMultisampleState.alphaToCoverageEnabled specification>
setAlphaToCoverageEnabled :: (MonadDOM m) => GPUMultisampleState -> Bool -> m ()
setAlphaToCoverageEnabled self val = liftDOM (void (self ^. jss "alphaToCoverageEnabled" (toJSVal val)))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpumultisamplestate-alphatocoverageenabled GPUMultisampleState.alphaToCoverageEnabled specification>
getAlphaToCoverageEnabled :: (MonadDOM m) => GPUMultisampleState -> m (Maybe Bool)
getAlphaToCoverageEnabled self = liftDOM (((self ^. js "alphaToCoverageEnabled") >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpumultisamplestate-alphatocoverageenabled GPUMultisampleState.alphaToCoverageEnabled specification>
getAlphaToCoverageEnabledUnsafe :: (MonadDOM m, HasCallStack) => GPUMultisampleState -> m Bool
getAlphaToCoverageEnabledUnsafe self = liftDOM ((((self ^. js "alphaToCoverageEnabled") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpumultisamplestate-alphatocoverageenabled GPUMultisampleState.alphaToCoverageEnabled specification>
getAlphaToCoverageEnabledUnchecked :: (MonadDOM m) => GPUMultisampleState -> m Bool
getAlphaToCoverageEnabledUnchecked self = liftDOM (((self ^. js "alphaToCoverageEnabled") >>= valToBool))