ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/GPUStorageTextureBindingLayout.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.GPUStorageTextureBindingLayout
(js_newGPUStorageTextureBindingLayout, js_setAccess, js_getAccess, js_setFormat, js_getFormat, js_setViewDimension, js_getViewDimension, newGPUStorageTextureBindingLayout, setAccess, getAccess, getAccessUnsafe, getAccessUnchecked, setFormat, getFormat, setViewDimension, getViewDimension, getViewDimensionUnsafe, getViewDimensionUnchecked, GPUStorageTextureBindingLayout(..), gTypeGPUStorageTextureBindingLayout)
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 "(($1) => { return ({\"format\": $1}); })"
js_newGPUStorageTextureBindingLayout :: JSVal -> IO GPUStorageTextureBindingLayout
-- | <https://gpuweb.github.io/gpuweb/#dictdef-gpustoragetexturebindinglayout GPUStorageTextureBindingLayout specification>
newGPUStorageTextureBindingLayout :: (MonadDOM m) => GPUTextureFormat -> m GPUStorageTextureBindingLayout
newGPUStorageTextureBindingLayout format = liftDOM (((toJSVal format) >>= \a1' -> js_newGPUStorageTextureBindingLayout a1'))
foreign import javascript safe "(($1, $2) => { $1[\"access\"] = $2; })"
js_setAccess :: GPUStorageTextureBindingLayout -> JSVal -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpustoragetexturebindinglayout-access GPUStorageTextureBindingLayout.access specification>
setAccess :: (MonadDOM m) => GPUStorageTextureBindingLayout -> GPUStorageTextureAccess -> m ()
setAccess self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setAccess (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"access\"]; })"
js_getAccess :: GPUStorageTextureBindingLayout -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gpustoragetexturebindinglayout-access GPUStorageTextureBindingLayout.access specification>
getAccess :: (MonadDOM m) => GPUStorageTextureBindingLayout -> m (Maybe GPUStorageTextureAccess)
getAccess self = liftDOM (((js_getAccess (self)) >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpustoragetexturebindinglayout-access GPUStorageTextureBindingLayout.access specification>
getAccessUnsafe :: (MonadDOM m, HasCallStack) => GPUStorageTextureBindingLayout -> m GPUStorageTextureAccess
getAccessUnsafe self = liftDOM ((((js_getAccess (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpustoragetexturebindinglayout-access GPUStorageTextureBindingLayout.access specification>
getAccessUnchecked :: (MonadDOM m) => GPUStorageTextureBindingLayout -> m GPUStorageTextureAccess
getAccessUnchecked self = liftDOM ((pFromJSVal <$> (js_getAccess (self))))
foreign import javascript safe "(($1, $2) => { $1[\"format\"] = $2; })"
js_setFormat :: GPUStorageTextureBindingLayout -> JSVal -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpustoragetexturebindinglayout-format GPUStorageTextureBindingLayout.format specification>
setFormat :: (MonadDOM m) => GPUStorageTextureBindingLayout -> GPUTextureFormat -> m ()
setFormat self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setFormat (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"format\"]; })"
js_getFormat :: GPUStorageTextureBindingLayout -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gpustoragetexturebindinglayout-format GPUStorageTextureBindingLayout.format specification>
getFormat :: (MonadDOM m) => GPUStorageTextureBindingLayout -> m GPUTextureFormat
getFormat self = liftDOM (((js_getFormat (self)) >>= fromJSValUnchecked))
foreign import javascript safe "(($1, $2) => { $1[\"viewDimension\"] = $2; })"
js_setViewDimension :: GPUStorageTextureBindingLayout -> JSVal -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpustoragetexturebindinglayout-viewdimension GPUStorageTextureBindingLayout.viewDimension specification>
setViewDimension :: (MonadDOM m) => GPUStorageTextureBindingLayout -> GPUTextureViewDimension -> m ()
setViewDimension self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setViewDimension (self) a2')))
foreign import javascript unsafe "(($1) => { return $1[\"viewDimension\"]; })"
js_getViewDimension :: GPUStorageTextureBindingLayout -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gpustoragetexturebindinglayout-viewdimension GPUStorageTextureBindingLayout.viewDimension specification>
getViewDimension :: (MonadDOM m) => GPUStorageTextureBindingLayout -> m (Maybe GPUTextureViewDimension)
getViewDimension self = liftDOM (((js_getViewDimension (self)) >>= fromJSValUnchecked))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpustoragetexturebindinglayout-viewdimension GPUStorageTextureBindingLayout.viewDimension specification>
getViewDimensionUnsafe :: (MonadDOM m, HasCallStack) => GPUStorageTextureBindingLayout -> m GPUTextureViewDimension
getViewDimensionUnsafe self = liftDOM ((((js_getViewDimension (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))
-- | <https://gpuweb.github.io/gpuweb/#dom-gpustoragetexturebindinglayout-viewdimension GPUStorageTextureBindingLayout.viewDimension specification>
getViewDimensionUnchecked :: (MonadDOM m) => GPUStorageTextureBindingLayout -> m GPUTextureViewDimension
getViewDimensionUnchecked self = liftDOM ((pFromJSVal <$> (js_getViewDimension (self))))