packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/GPUPrimitiveState.hs

{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE ForeignFunctionInterface, JavaScriptFFI #-}
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
-- | Generated by dom-gen from webgpu (webref). Do not edit.
module GHCJS.DOM.JSFFI.Generated.GPUPrimitiveState
       (js_newGPUPrimitiveState, js_setTopology, js_getTopology, js_setStripIndexFormat, js_getStripIndexFormat, js_setFrontFace, js_getFrontFace, js_setCullMode, js_getCullMode, js_setUnclippedDepth, js_getUnclippedDepth, newGPUPrimitiveState, setTopology, getTopology, getTopologyUnsafe, getTopologyUnchecked, setStripIndexFormat, getStripIndexFormat, getStripIndexFormatUnsafe, getStripIndexFormatUnchecked, setFrontFace, getFrontFace, getFrontFaceUnsafe, getFrontFaceUnchecked, setCullMode, getCullMode, getCullModeUnsafe, getCullModeUnchecked, setUnclippedDepth, getUnclippedDepth, getUnclippedDepthUnsafe, getUnclippedDepthUnchecked, GPUPrimitiveState(..), gTypeGPUPrimitiveState)
       where
import Prelude ((.), (==), (>>=), (<$>), (++), Bool(..), Maybe(..), IO, Int, Word, Double, Float)
import qualified Prelude as P
import Control.Monad (void)
import GHCJS.Types (JSVal, JSString)
import GHCJS.Foreign (jsUndefined, jsNull)
import GHCJS.DOM.Types
import qualified GHCJS.DOM.Types as Types
import GHCJS.DOM.EventTargetClosures (EventName, unsafeEventName, unsafeEventNameAsync)
import GHCJS.DOM.JSFFI.Generated.Enums

foreign import javascript safe "(() => { return ({}); })"
        js_newGPUPrimitiveState :: IO GPUPrimitiveState
-- | <https://gpuweb.github.io/gpuweb/#dictdef-gpuprimitivestate GPUPrimitiveState specification>
newGPUPrimitiveState :: (MonadDOM m) => m GPUPrimitiveState
newGPUPrimitiveState = liftDOM ((js_newGPUPrimitiveState))

foreign import javascript safe "(($1, $2) => { $1[\"topology\"] = $2; })"
        js_setTopology :: GPUPrimitiveState -> JSVal -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-topology GPUPrimitiveState.topology specification>
setTopology :: (MonadDOM m) => GPUPrimitiveState -> GPUPrimitiveTopology -> m ()
setTopology self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setTopology (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"topology\"]; })"
        js_getTopology :: GPUPrimitiveState -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-topology GPUPrimitiveState.topology specification>
getTopology :: (MonadDOM m) => GPUPrimitiveState -> m (Maybe GPUPrimitiveTopology)
getTopology self = liftDOM (((js_getTopology (self)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-topology GPUPrimitiveState.topology specification>
getTopologyUnsafe :: (MonadDOM m, HasCallStack) => GPUPrimitiveState -> m GPUPrimitiveTopology
getTopologyUnsafe self = liftDOM ((((js_getTopology (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-topology GPUPrimitiveState.topology specification>
getTopologyUnchecked :: (MonadDOM m) => GPUPrimitiveState -> m GPUPrimitiveTopology
getTopologyUnchecked self = liftDOM ((pFromJSVal <$> (js_getTopology (self))))

foreign import javascript safe "(($1, $2) => { $1[\"stripIndexFormat\"] = $2; })"
        js_setStripIndexFormat :: GPUPrimitiveState -> JSVal -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-stripindexformat GPUPrimitiveState.stripIndexFormat specification>
setStripIndexFormat :: (MonadDOM m) => GPUPrimitiveState -> GPUIndexFormat -> m ()
setStripIndexFormat self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setStripIndexFormat (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"stripIndexFormat\"]; })"
        js_getStripIndexFormat :: GPUPrimitiveState -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-stripindexformat GPUPrimitiveState.stripIndexFormat specification>
getStripIndexFormat :: (MonadDOM m) => GPUPrimitiveState -> m (Maybe GPUIndexFormat)
getStripIndexFormat self = liftDOM (((js_getStripIndexFormat (self)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-stripindexformat GPUPrimitiveState.stripIndexFormat specification>
getStripIndexFormatUnsafe :: (MonadDOM m, HasCallStack) => GPUPrimitiveState -> m GPUIndexFormat
getStripIndexFormatUnsafe self = liftDOM ((((js_getStripIndexFormat (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-stripindexformat GPUPrimitiveState.stripIndexFormat specification>
getStripIndexFormatUnchecked :: (MonadDOM m) => GPUPrimitiveState -> m GPUIndexFormat
getStripIndexFormatUnchecked self = liftDOM ((pFromJSVal <$> (js_getStripIndexFormat (self))))

foreign import javascript safe "(($1, $2) => { $1[\"frontFace\"] = $2; })"
        js_setFrontFace :: GPUPrimitiveState -> JSVal -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-frontface GPUPrimitiveState.frontFace specification>
setFrontFace :: (MonadDOM m) => GPUPrimitiveState -> GPUFrontFace -> m ()
setFrontFace self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setFrontFace (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"frontFace\"]; })"
        js_getFrontFace :: GPUPrimitiveState -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-frontface GPUPrimitiveState.frontFace specification>
getFrontFace :: (MonadDOM m) => GPUPrimitiveState -> m (Maybe GPUFrontFace)
getFrontFace self = liftDOM (((js_getFrontFace (self)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-frontface GPUPrimitiveState.frontFace specification>
getFrontFaceUnsafe :: (MonadDOM m, HasCallStack) => GPUPrimitiveState -> m GPUFrontFace
getFrontFaceUnsafe self = liftDOM ((((js_getFrontFace (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-frontface GPUPrimitiveState.frontFace specification>
getFrontFaceUnchecked :: (MonadDOM m) => GPUPrimitiveState -> m GPUFrontFace
getFrontFaceUnchecked self = liftDOM ((pFromJSVal <$> (js_getFrontFace (self))))

foreign import javascript safe "(($1, $2) => { $1[\"cullMode\"] = $2; })"
        js_setCullMode :: GPUPrimitiveState -> JSVal -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-cullmode GPUPrimitiveState.cullMode specification>
setCullMode :: (MonadDOM m) => GPUPrimitiveState -> GPUCullMode -> m ()
setCullMode self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setCullMode (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"cullMode\"]; })"
        js_getCullMode :: GPUPrimitiveState -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-cullmode GPUPrimitiveState.cullMode specification>
getCullMode :: (MonadDOM m) => GPUPrimitiveState -> m (Maybe GPUCullMode)
getCullMode self = liftDOM (((js_getCullMode (self)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-cullmode GPUPrimitiveState.cullMode specification>
getCullModeUnsafe :: (MonadDOM m, HasCallStack) => GPUPrimitiveState -> m GPUCullMode
getCullModeUnsafe self = liftDOM ((((js_getCullMode (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-cullmode GPUPrimitiveState.cullMode specification>
getCullModeUnchecked :: (MonadDOM m) => GPUPrimitiveState -> m GPUCullMode
getCullModeUnchecked self = liftDOM ((pFromJSVal <$> (js_getCullMode (self))))

foreign import javascript safe "(($1, $2) => { $1[\"unclippedDepth\"] = $2; })"
        js_setUnclippedDepth :: GPUPrimitiveState -> Bool -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-unclippeddepth GPUPrimitiveState.unclippedDepth specification>
setUnclippedDepth :: (MonadDOM m) => GPUPrimitiveState -> Bool -> m ()
setUnclippedDepth self val = liftDOM (void ((js_setUnclippedDepth (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"unclippedDepth\"]; })"
        js_getUnclippedDepth :: GPUPrimitiveState -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-unclippeddepth GPUPrimitiveState.unclippedDepth specification>
getUnclippedDepth :: (MonadDOM m) => GPUPrimitiveState -> m (Maybe Bool)
getUnclippedDepth self = liftDOM (((js_getUnclippedDepth (self)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-unclippeddepth GPUPrimitiveState.unclippedDepth specification>
getUnclippedDepthUnsafe :: (MonadDOM m, HasCallStack) => GPUPrimitiveState -> m Bool
getUnclippedDepthUnsafe self = liftDOM ((((js_getUnclippedDepth (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpuprimitivestate-unclippeddepth GPUPrimitiveState.unclippedDepth specification>
getUnclippedDepthUnchecked :: (MonadDOM m) => GPUPrimitiveState -> m Bool
getUnclippedDepthUnchecked self = liftDOM ((pFromJSVal <$> (js_getUnclippedDepth (self))))