{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE NoFieldSelectors #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_HADDOCK prune #-}
module SDL3.Sys.Bindgen.Pen.Unsafe (
SDL3.Sys.Bindgen.Pen.Unsafe.sDL_GetPenDeviceType,
)
where
import Prelude (IO, fmap)
import HsBindgen.Runtime.LibC qualified
import HsBindgen.Runtime.Support qualified as BG
import HsBindgen.Runtime.Support.CAPI qualified
import SDL3.Sys.Bindgen.Pen
$( HsBindgen.Runtime.Support.CAPI.addCSource
( HsBindgen.Runtime.Support.CAPI.unlines
[ "#define SDL_MAIN_HANDLED"
, "#define SDL_SLOW_MEMCPY"
, "#define SDL_SLOW_MEMMOVE"
, "#define SDL_SLOW_MEMSET"
, "#include <SDL3/SDL_pen.h>"
, "#include <SDL3/SDL_version.h>"
, "#include <SDL3/SDL_error.h>"
, "#include <SDL3/SDL_version.h>"
, "#if !SDL_VERSION_ATLEAST(3, 4, 0)"
, "typedef int SDL_PenDeviceType;"
, "#endif"
, "SDL_PenDeviceType hs_bindgen_c3c39a594724cad9 ("
, " SDL_PenID arg1"
, ")"
, "{"
, "#if SDL_VERSION_ATLEAST(3, 4, 0)"
, " return (SDL_GetPenDeviceType)(arg1);"
, "#else"
, " (void)arg1; SDL_SetError(\"SDL_GetPenDeviceType requires SDL >= 3.4.0\"); return 0;"
, "#endif"
, "}"
]
)
)
foreign import ccall unsafe "hs_bindgen_c3c39a594724cad9"
hs_bindgen_c3c39a594724cad9_base
:: HsBindgen.Runtime.LibC.Word32
-> IO BG.CInt
hs_bindgen_c3c39a594724cad9
:: SDL_PenID
-> IO SDL_PenDeviceType
hs_bindgen_c3c39a594724cad9 :: SDL_PenID -> IO SDL_PenDeviceType
hs_bindgen_c3c39a594724cad9 =
\SDL_PenID
x0 ->
(CInt -> SDL_PenDeviceType) -> IO CInt -> IO SDL_PenDeviceType
forall a b. (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap CInt -> SDL_PenDeviceType
FFIType SDL_PenDeviceType -> SDL_PenDeviceType
forall a. HasFFIType a => FFIType a -> a
BG.fromFFIType (Word32 -> IO CInt
hs_bindgen_c3c39a594724cad9_base (SDL_PenID -> FFIType SDL_PenID
forall a. HasFFIType a => a -> FFIType a
BG.toFFIType SDL_PenID
x0))
sDL_GetPenDeviceType
:: SDL_PenID
-> IO SDL_PenDeviceType
sDL_GetPenDeviceType :: SDL_PenID -> IO SDL_PenDeviceType
sDL_GetPenDeviceType = SDL_PenID -> IO SDL_PenDeviceType
hs_bindgen_c3c39a594724cad9