{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE NoFieldSelectors #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_HADDOCK prune #-}

module SDL3.Sys.Bindgen.SurfaceShims.FunPtr (
  SDL3.Sys.Bindgen.SurfaceShims.FunPtr.lithon_SDL_MUSTLOCK,
)
where

import Prelude (IO, fmap)

import HsBindgen.Runtime.Support qualified as BG
import HsBindgen.Runtime.Support.CAPI qualified
import SDL3.Sys.Bindgen.Surface qualified

$( 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-bindgen-sys/SDL_surface_shims.h>"
         , "/* sdl3bindgensys_SDL3.Sys.Bindgen.SurfaceShims_get_lithon_SDL_MUSTLOCK */"
         , "__attribute__ ((const))"
         , "_Bool (*hs_bindgen_14ee8daa42148a86 (void)) ("
         , "  SDL_Surface *arg1"
         , ")"
         , "{"
         , "  return &lithon_SDL_MUSTLOCK;"
         , "}"
         ]
     )
 )

-- __unique:__ @sdl3bindgensys_SDL3.Sys.Bindgen.SurfaceShims_get_lithon_SDL_MUSTLOCK@
foreign import ccall unsafe "hs_bindgen_14ee8daa42148a86"
  hs_bindgen_14ee8daa42148a86_base
    :: IO (BG.FunPtr BG.Void)

-- __unique:__ @sdl3bindgensys_SDL3.Sys.Bindgen.SurfaceShims_get_lithon_SDL_MUSTLOCK@
hs_bindgen_14ee8daa42148a86
  :: IO (BG.FunPtr (BG.Ptr SDL3.Sys.Bindgen.Surface.SDL_Surface -> IO BG.CBool))
hs_bindgen_14ee8daa42148a86 :: IO (FunPtr (Ptr SDL_Surface -> IO CBool))
hs_bindgen_14ee8daa42148a86 =
  (FunPtr Void -> FunPtr (Ptr SDL_Surface -> IO CBool))
-> IO (FunPtr Void) -> IO (FunPtr (Ptr SDL_Surface -> IO CBool))
forall a b. (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap FunPtr Void -> FunPtr (Ptr SDL_Surface -> IO CBool)
FFIType (FunPtr (Ptr SDL_Surface -> IO CBool))
-> FunPtr (Ptr SDL_Surface -> IO CBool)
forall a. HasFFIType a => FFIType a -> a
BG.fromFFIType IO (FunPtr Void)
hs_bindgen_14ee8daa42148a86_base

{-# NOINLINE lithon_SDL_MUSTLOCK #-}

-- | Determine whether a surface needs to be locked before its pixels are accessed.
--
--     The SDL_MUSTLOCK macro as a function.
--
--     [@surface@]: the SDL_Surface to check.
--
--     [Returns]: true if the surface must be locked with SDL_LockSurface before its pixels are read or written, false otherwise.
--
--     @since 3.2.0
--
--     [See also]: SDL_LockSurface, SDL_UnlockSurface
--
--     [C declaration]: @lithon_SDL_MUSTLOCK@, defined at @sdl3-bindgen-sys\/SDL_surface_shims.h 39:24@
lithon_SDL_MUSTLOCK :: BG.FunPtr (BG.Ptr SDL3.Sys.Bindgen.Surface.SDL_Surface -> IO BG.CBool)
lithon_SDL_MUSTLOCK :: FunPtr (Ptr SDL_Surface -> IO CBool)
lithon_SDL_MUSTLOCK =
  IO (FunPtr (Ptr SDL_Surface -> IO CBool))
-> FunPtr (Ptr SDL_Surface -> IO CBool)
forall a. IO a -> a
BG.unsafePerformIO IO (FunPtr (Ptr SDL_Surface -> IO CBool))
hs_bindgen_14ee8daa42148a86