packages feed

ghcjs-dom-javascript-0.10.0.0: src/GHCJS/DOM/JSFFI/Generated/GPUCanvasConfiguration.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.GPUCanvasConfiguration
       (js_newGPUCanvasConfiguration, js_setDevice, js_getDevice, js_setFormat, js_getFormat, js_setUsage, js_getUsage, js_setViewFormats, js_getViewFormats, js_setColorSpace, js_getColorSpace, js_setToneMapping, js_getToneMapping, js_setAlphaMode, js_getAlphaMode, newGPUCanvasConfiguration, setDevice, getDevice, setFormat, getFormat, setUsage, getUsage, getUsageUnsafe, getUsageUnchecked, setViewFormats, getViewFormats, getViewFormatsUnsafe, getViewFormatsUnchecked, setColorSpace, getColorSpace, getColorSpaceUnsafe, getColorSpaceUnchecked, setToneMapping, getToneMapping, getToneMappingUnsafe, getToneMappingUnchecked, setAlphaMode, getAlphaMode, getAlphaModeUnsafe, getAlphaModeUnchecked, GPUCanvasConfiguration(..), gTypeGPUCanvasConfiguration)
       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, $2) => { return ({\"device\": $1, \"format\": $2}); })"
        js_newGPUCanvasConfiguration :: GPUDevice -> JSVal -> IO GPUCanvasConfiguration
-- | <https://gpuweb.github.io/gpuweb/#dictdef-gpucanvasconfiguration GPUCanvasConfiguration specification>
newGPUCanvasConfiguration :: (MonadDOM m) => GPUDevice -> GPUTextureFormat -> m GPUCanvasConfiguration
newGPUCanvasConfiguration device format = liftDOM (((toJSVal format) >>= \a2' -> js_newGPUCanvasConfiguration (device) a2'))

foreign import javascript safe "(($1, $2) => { $1[\"device\"] = $2; })"
        js_setDevice :: GPUCanvasConfiguration -> GPUDevice -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucanvasconfiguration-device GPUCanvasConfiguration.device specification>
setDevice :: (MonadDOM m) => GPUCanvasConfiguration -> GPUDevice -> m ()
setDevice self val = liftDOM (void ((js_setDevice (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"device\"]; })"
        js_getDevice :: GPUCanvasConfiguration -> IO GPUDevice
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucanvasconfiguration-device GPUCanvasConfiguration.device specification>
getDevice :: (MonadDOM m) => GPUCanvasConfiguration -> m GPUDevice
getDevice self = liftDOM ((js_getDevice (self)))

foreign import javascript safe "(($1, $2) => { $1[\"format\"] = $2; })"
        js_setFormat :: GPUCanvasConfiguration -> JSVal -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucanvasconfiguration-format GPUCanvasConfiguration.format specification>
setFormat :: (MonadDOM m) => GPUCanvasConfiguration -> GPUTextureFormat -> m ()
setFormat self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setFormat (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"format\"]; })"
        js_getFormat :: GPUCanvasConfiguration -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucanvasconfiguration-format GPUCanvasConfiguration.format specification>
getFormat :: (MonadDOM m) => GPUCanvasConfiguration -> m GPUTextureFormat
getFormat self = liftDOM (((js_getFormat (self)) >>= fromJSValUnchecked))

foreign import javascript safe "(($1, $2) => { $1[\"usage\"] = $2; })"
        js_setUsage :: GPUCanvasConfiguration -> Word -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucanvasconfiguration-usage GPUCanvasConfiguration.usage specification>
setUsage :: (MonadDOM m) => GPUCanvasConfiguration -> Word -> m ()
setUsage self val = liftDOM (void ((js_setUsage (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"usage\"]; })"
        js_getUsage :: GPUCanvasConfiguration -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucanvasconfiguration-usage GPUCanvasConfiguration.usage specification>
getUsage :: (MonadDOM m) => GPUCanvasConfiguration -> m (Maybe Word)
getUsage self = liftDOM (((js_getUsage (self)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpucanvasconfiguration-usage GPUCanvasConfiguration.usage specification>
getUsageUnsafe :: (MonadDOM m, HasCallStack) => GPUCanvasConfiguration -> m Word
getUsageUnsafe self = liftDOM ((((js_getUsage (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpucanvasconfiguration-usage GPUCanvasConfiguration.usage specification>
getUsageUnchecked :: (MonadDOM m) => GPUCanvasConfiguration -> m Word
getUsageUnchecked self = liftDOM ((pFromJSVal <$> (js_getUsage (self))))

foreign import javascript safe "(($1, $2) => { $1[\"viewFormats\"] = $2; })"
        js_setViewFormats :: GPUCanvasConfiguration -> JSVal -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucanvasconfiguration-viewformats GPUCanvasConfiguration.viewFormats specification>
setViewFormats :: (MonadDOM m) => GPUCanvasConfiguration -> [GPUTextureFormat] -> m ()
setViewFormats self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setViewFormats (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"viewFormats\"]; })"
        js_getViewFormats :: GPUCanvasConfiguration -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucanvasconfiguration-viewformats GPUCanvasConfiguration.viewFormats specification>
getViewFormats :: (MonadDOM m) => GPUCanvasConfiguration -> m (Maybe [GPUTextureFormat])
getViewFormats self = liftDOM (((js_getViewFormats (self)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpucanvasconfiguration-viewformats GPUCanvasConfiguration.viewFormats specification>
getViewFormatsUnsafe :: (MonadDOM m, HasCallStack) => GPUCanvasConfiguration -> m [GPUTextureFormat]
getViewFormatsUnsafe self = liftDOM ((((js_getViewFormats (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpucanvasconfiguration-viewformats GPUCanvasConfiguration.viewFormats specification>
getViewFormatsUnchecked :: (MonadDOM m) => GPUCanvasConfiguration -> m [GPUTextureFormat]
getViewFormatsUnchecked self = liftDOM (((js_getViewFormats (self)) >>= fromJSValUnchecked))

foreign import javascript safe "(($1, $2) => { $1[\"colorSpace\"] = $2; })"
        js_setColorSpace :: GPUCanvasConfiguration -> JSVal -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucanvasconfiguration-colorspace GPUCanvasConfiguration.colorSpace specification>
setColorSpace :: (MonadDOM m) => GPUCanvasConfiguration -> PredefinedColorSpace -> m ()
setColorSpace self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setColorSpace (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"colorSpace\"]; })"
        js_getColorSpace :: GPUCanvasConfiguration -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucanvasconfiguration-colorspace GPUCanvasConfiguration.colorSpace specification>
getColorSpace :: (MonadDOM m) => GPUCanvasConfiguration -> m (Maybe PredefinedColorSpace)
getColorSpace self = liftDOM (((js_getColorSpace (self)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpucanvasconfiguration-colorspace GPUCanvasConfiguration.colorSpace specification>
getColorSpaceUnsafe :: (MonadDOM m, HasCallStack) => GPUCanvasConfiguration -> m PredefinedColorSpace
getColorSpaceUnsafe self = liftDOM ((((js_getColorSpace (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpucanvasconfiguration-colorspace GPUCanvasConfiguration.colorSpace specification>
getColorSpaceUnchecked :: (MonadDOM m) => GPUCanvasConfiguration -> m PredefinedColorSpace
getColorSpaceUnchecked self = liftDOM ((pFromJSVal <$> (js_getColorSpace (self))))

foreign import javascript safe "(($1, $2) => { $1[\"toneMapping\"] = $2; })"
        js_setToneMapping :: GPUCanvasConfiguration -> GPUCanvasToneMapping -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucanvasconfiguration-tonemapping GPUCanvasConfiguration.toneMapping specification>
setToneMapping :: (MonadDOM m) => GPUCanvasConfiguration -> GPUCanvasToneMapping -> m ()
setToneMapping self val = liftDOM (void ((js_setToneMapping (self) (val))))

foreign import javascript unsafe "(($1) => { return $1[\"toneMapping\"]; })"
        js_getToneMapping :: GPUCanvasConfiguration -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucanvasconfiguration-tonemapping GPUCanvasConfiguration.toneMapping specification>
getToneMapping :: (MonadDOM m) => GPUCanvasConfiguration -> m (Maybe GPUCanvasToneMapping)
getToneMapping self = liftDOM (((js_getToneMapping (self)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpucanvasconfiguration-tonemapping GPUCanvasConfiguration.toneMapping specification>
getToneMappingUnsafe :: (MonadDOM m, HasCallStack) => GPUCanvasConfiguration -> m GPUCanvasToneMapping
getToneMappingUnsafe self = liftDOM ((((js_getToneMapping (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpucanvasconfiguration-tonemapping GPUCanvasConfiguration.toneMapping specification>
getToneMappingUnchecked :: (MonadDOM m) => GPUCanvasConfiguration -> m GPUCanvasToneMapping
getToneMappingUnchecked self = liftDOM ((pFromJSVal <$> (js_getToneMapping (self))))

foreign import javascript safe "(($1, $2) => { $1[\"alphaMode\"] = $2; })"
        js_setAlphaMode :: GPUCanvasConfiguration -> JSVal -> IO ()
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucanvasconfiguration-alphamode GPUCanvasConfiguration.alphaMode specification>
setAlphaMode :: (MonadDOM m) => GPUCanvasConfiguration -> GPUCanvasAlphaMode -> m ()
setAlphaMode self val = liftDOM (void (((toJSVal val) >>= \a2' -> js_setAlphaMode (self) a2')))

foreign import javascript unsafe "(($1) => { return $1[\"alphaMode\"]; })"
        js_getAlphaMode :: GPUCanvasConfiguration -> IO JSVal
-- | <https://gpuweb.github.io/gpuweb/#dom-gpucanvasconfiguration-alphamode GPUCanvasConfiguration.alphaMode specification>
getAlphaMode :: (MonadDOM m) => GPUCanvasConfiguration -> m (Maybe GPUCanvasAlphaMode)
getAlphaMode self = liftDOM (((js_getAlphaMode (self)) >>= fromJSValUnchecked))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpucanvasconfiguration-alphamode GPUCanvasConfiguration.alphaMode specification>
getAlphaModeUnsafe :: (MonadDOM m, HasCallStack) => GPUCanvasConfiguration -> m GPUCanvasAlphaMode
getAlphaModeUnsafe self = liftDOM ((((js_getAlphaMode (self)) >>= fromJSValUnchecked) >>= P.maybe (P.error "Nothing to return") P.return))

-- | <https://gpuweb.github.io/gpuweb/#dom-gpucanvasconfiguration-alphamode GPUCanvasConfiguration.alphaMode specification>
getAlphaModeUnchecked :: (MonadDOM m) => GPUCanvasConfiguration -> m GPUCanvasAlphaMode
getAlphaModeUnchecked self = liftDOM ((pFromJSVal <$> (js_getAlphaMode (self))))