jsaddle-dom-0.10.0.0: src/JSDOM/Generated/WebGLContextAttributes.hs
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from webgl1 (webref). Do not edit.
module JSDOM.Generated.WebGLContextAttributes
(newWebGLContextAttributes, setAlpha, getAlpha, getAlphaUnsafe, getAlphaUnchecked, setDepth, getDepth, getDepthUnsafe, getDepthUnchecked, setStencil, getStencil, getStencilUnsafe, getStencilUnchecked, setAntialias, getAntialias, getAntialiasUnsafe, getAntialiasUnchecked, setPremultipliedAlpha, getPremultipliedAlpha, getPremultipliedAlphaUnsafe, getPremultipliedAlphaUnchecked, setPreserveDrawingBuffer, getPreserveDrawingBuffer, getPreserveDrawingBufferUnsafe, getPreserveDrawingBufferUnchecked, setPowerPreference, getPowerPreference, getPowerPreferenceUnsafe, getPowerPreferenceUnchecked, setFailIfMajorPerformanceCaveat, getFailIfMajorPerformanceCaveat, getFailIfMajorPerformanceCaveatUnsafe, getFailIfMajorPerformanceCaveatUnchecked, setDesynchronized, getDesynchronized, getDesynchronizedUnsafe, getDesynchronizedUnchecked, setXrCompatible, getXrCompatible, getXrCompatibleUnsafe, getXrCompatibleUnchecked, WebGLContextAttributes(..), gTypeWebGLContextAttributes)
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://registry.khronos.org/webgl/specs/latest/1.0/#WebGLContextAttributes WebGLContextAttributes specification>
newWebGLContextAttributes :: (MonadDOM m) => m WebGLContextAttributes
newWebGLContextAttributes = liftDOM ((((new (jsg "Object") () >>= \o -> P.return o)) >>= fromJSValUnchecked))
setAlpha :: (MonadDOM m) => WebGLContextAttributes -> Bool -> m ()
setAlpha self val = liftDOM (void (self ^. jss "alpha" (toJSVal val)))
getAlpha :: (MonadDOM m) => WebGLContextAttributes -> m (Maybe Bool)
getAlpha self = liftDOM (((self ^. js "alpha") >>= fromJSValUnchecked))
getAlphaUnsafe :: (MonadDOM m, HasCallStack) => WebGLContextAttributes -> m Bool
getAlphaUnsafe self = liftDOM ((((self ^. js "alpha") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
getAlphaUnchecked :: (MonadDOM m) => WebGLContextAttributes -> m Bool
getAlphaUnchecked self = liftDOM (((self ^. js "alpha") >>= valToBool))
setDepth :: (MonadDOM m) => WebGLContextAttributes -> Bool -> m ()
setDepth self val = liftDOM (void (self ^. jss "depth" (toJSVal val)))
getDepth :: (MonadDOM m) => WebGLContextAttributes -> m (Maybe Bool)
getDepth self = liftDOM (((self ^. js "depth") >>= fromJSValUnchecked))
getDepthUnsafe :: (MonadDOM m, HasCallStack) => WebGLContextAttributes -> m Bool
getDepthUnsafe self = liftDOM ((((self ^. js "depth") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
getDepthUnchecked :: (MonadDOM m) => WebGLContextAttributes -> m Bool
getDepthUnchecked self = liftDOM (((self ^. js "depth") >>= valToBool))
setStencil :: (MonadDOM m) => WebGLContextAttributes -> Bool -> m ()
setStencil self val = liftDOM (void (self ^. jss "stencil" (toJSVal val)))
getStencil :: (MonadDOM m) => WebGLContextAttributes -> m (Maybe Bool)
getStencil self = liftDOM (((self ^. js "stencil") >>= fromJSValUnchecked))
getStencilUnsafe :: (MonadDOM m, HasCallStack) => WebGLContextAttributes -> m Bool
getStencilUnsafe self = liftDOM ((((self ^. js "stencil") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
getStencilUnchecked :: (MonadDOM m) => WebGLContextAttributes -> m Bool
getStencilUnchecked self = liftDOM (((self ^. js "stencil") >>= valToBool))
setAntialias :: (MonadDOM m) => WebGLContextAttributes -> Bool -> m ()
setAntialias self val = liftDOM (void (self ^. jss "antialias" (toJSVal val)))
getAntialias :: (MonadDOM m) => WebGLContextAttributes -> m (Maybe Bool)
getAntialias self = liftDOM (((self ^. js "antialias") >>= fromJSValUnchecked))
getAntialiasUnsafe :: (MonadDOM m, HasCallStack) => WebGLContextAttributes -> m Bool
getAntialiasUnsafe self = liftDOM ((((self ^. js "antialias") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
getAntialiasUnchecked :: (MonadDOM m) => WebGLContextAttributes -> m Bool
getAntialiasUnchecked self = liftDOM (((self ^. js "antialias") >>= valToBool))
setPremultipliedAlpha :: (MonadDOM m) => WebGLContextAttributes -> Bool -> m ()
setPremultipliedAlpha self val = liftDOM (void (self ^. jss "premultipliedAlpha" (toJSVal val)))
getPremultipliedAlpha :: (MonadDOM m) => WebGLContextAttributes -> m (Maybe Bool)
getPremultipliedAlpha self = liftDOM (((self ^. js "premultipliedAlpha") >>= fromJSValUnchecked))
getPremultipliedAlphaUnsafe :: (MonadDOM m, HasCallStack) => WebGLContextAttributes -> m Bool
getPremultipliedAlphaUnsafe self = liftDOM ((((self ^. js "premultipliedAlpha") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
getPremultipliedAlphaUnchecked :: (MonadDOM m) => WebGLContextAttributes -> m Bool
getPremultipliedAlphaUnchecked self = liftDOM (((self ^. js "premultipliedAlpha") >>= valToBool))
setPreserveDrawingBuffer :: (MonadDOM m) => WebGLContextAttributes -> Bool -> m ()
setPreserveDrawingBuffer self val = liftDOM (void (self ^. jss "preserveDrawingBuffer" (toJSVal val)))
getPreserveDrawingBuffer :: (MonadDOM m) => WebGLContextAttributes -> m (Maybe Bool)
getPreserveDrawingBuffer self = liftDOM (((self ^. js "preserveDrawingBuffer") >>= fromJSValUnchecked))
getPreserveDrawingBufferUnsafe :: (MonadDOM m, HasCallStack) => WebGLContextAttributes -> m Bool
getPreserveDrawingBufferUnsafe self = liftDOM ((((self ^. js "preserveDrawingBuffer") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
getPreserveDrawingBufferUnchecked :: (MonadDOM m) => WebGLContextAttributes -> m Bool
getPreserveDrawingBufferUnchecked self = liftDOM (((self ^. js "preserveDrawingBuffer") >>= valToBool))
setPowerPreference :: (MonadDOM m) => WebGLContextAttributes -> WebGLPowerPreference -> m ()
setPowerPreference self val = liftDOM (void (self ^. jss "powerPreference" (toJSVal val)))
getPowerPreference :: (MonadDOM m) => WebGLContextAttributes -> m (Maybe WebGLPowerPreference)
getPowerPreference self = liftDOM (((self ^. js "powerPreference") >>= fromJSValUnchecked))
getPowerPreferenceUnsafe :: (MonadDOM m, HasCallStack) => WebGLContextAttributes -> m WebGLPowerPreference
getPowerPreferenceUnsafe self = liftDOM ((((self ^. js "powerPreference") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
getPowerPreferenceUnchecked :: (MonadDOM m) => WebGLContextAttributes -> m WebGLPowerPreference
getPowerPreferenceUnchecked self = liftDOM (((self ^. js "powerPreference") >>= fromJSValUnchecked))
setFailIfMajorPerformanceCaveat :: (MonadDOM m) => WebGLContextAttributes -> Bool -> m ()
setFailIfMajorPerformanceCaveat self val = liftDOM (void (self ^. jss "failIfMajorPerformanceCaveat" (toJSVal val)))
getFailIfMajorPerformanceCaveat :: (MonadDOM m) => WebGLContextAttributes -> m (Maybe Bool)
getFailIfMajorPerformanceCaveat self = liftDOM (((self ^. js "failIfMajorPerformanceCaveat") >>= fromJSValUnchecked))
getFailIfMajorPerformanceCaveatUnsafe :: (MonadDOM m, HasCallStack) => WebGLContextAttributes -> m Bool
getFailIfMajorPerformanceCaveatUnsafe self = liftDOM ((((self ^. js "failIfMajorPerformanceCaveat") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
getFailIfMajorPerformanceCaveatUnchecked :: (MonadDOM m) => WebGLContextAttributes -> m Bool
getFailIfMajorPerformanceCaveatUnchecked self = liftDOM (((self ^. js "failIfMajorPerformanceCaveat") >>= valToBool))
setDesynchronized :: (MonadDOM m) => WebGLContextAttributes -> Bool -> m ()
setDesynchronized self val = liftDOM (void (self ^. jss "desynchronized" (toJSVal val)))
getDesynchronized :: (MonadDOM m) => WebGLContextAttributes -> m (Maybe Bool)
getDesynchronized self = liftDOM (((self ^. js "desynchronized") >>= fromJSValUnchecked))
getDesynchronizedUnsafe :: (MonadDOM m, HasCallStack) => WebGLContextAttributes -> m Bool
getDesynchronizedUnsafe self = liftDOM ((((self ^. js "desynchronized") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
getDesynchronizedUnchecked :: (MonadDOM m) => WebGLContextAttributes -> m Bool
getDesynchronizedUnchecked self = liftDOM (((self ^. js "desynchronized") >>= valToBool))
-- | <https://immersive-web.github.io/webxr/#dom-webglcontextattributes-xrcompatible WebGLContextAttributes.xrCompatible specification>
setXrCompatible :: (MonadDOM m) => WebGLContextAttributes -> Bool -> m ()
setXrCompatible self val = liftDOM (void (self ^. jss "xrCompatible" (toJSVal val)))
-- | <https://immersive-web.github.io/webxr/#dom-webglcontextattributes-xrcompatible WebGLContextAttributes.xrCompatible specification>
getXrCompatible :: (MonadDOM m) => WebGLContextAttributes -> m (Maybe Bool)
getXrCompatible self = liftDOM (((self ^. js "xrCompatible") >>= fromJSValUnchecked))
-- | <https://immersive-web.github.io/webxr/#dom-webglcontextattributes-xrcompatible WebGLContextAttributes.xrCompatible specification>
getXrCompatibleUnsafe :: (MonadDOM m, HasCallStack) => WebGLContextAttributes -> m Bool
getXrCompatibleUnsafe self = liftDOM ((((self ^. js "xrCompatible") >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://immersive-web.github.io/webxr/#dom-webglcontextattributes-xrcompatible WebGLContextAttributes.xrCompatible specification>
getXrCompatibleUnchecked :: (MonadDOM m) => WebGLContextAttributes -> m Bool
getXrCompatibleUnchecked self = liftDOM (((self ^. js "xrCompatible") >>= valToBool))