module SDL.Raw.Event (
  -- * Event Handling
  addEventWatch,
  delEventWatch,
  eventState,
  filterEvents,
  flushEvent,
  flushEvents,
  getEventFilter,
  getNumTouchDevices,
  getNumTouchFingers,
  getTouchDevice,
  getTouchFinger,
  hasEvent,
  hasEvents,
  loadDollarTemplates,
  peepEvents,
  pollEvent,
  pumpEvents,
  pushEvent,
  quitRequested,
  recordGesture,
  registerEvents,
  saveAllDollarTemplates,
  saveDollarTemplate,
  setEventFilter,
  waitEvent,
  waitEventTimeout,

  -- * Keyboard Support
  getKeyFromName,
  getKeyFromScancode,
  getKeyName,
  getKeyboardFocus,
  getKeyboardState,
  getModState,
  getScancodeFromKey,
  getScancodeFromName,
  getScancodeName,
  hasScreenKeyboardSupport,
  isScreenKeyboardShown,
  isTextInputActive,
  setModState,
  setTextInputRect,
  startTextInput,
  stopTextInput,

  -- * Mouse Support
  captureMouse,
  createColorCursor,
  createCursor,
  createSystemCursor,
  freeCursor,
  getCursor,
  getDefaultCursor,
  getGlobalMouseState,
  getMouseFocus,
  getMouseState,
  getRelativeMouseMode,
  getRelativeMouseState,
  setCursor,
  setRelativeMouseMode,
  showCursor,
  warpMouseGlobal,
  warpMouseInWindow,

  -- * Joystick Support
  joystickClose,
  joystickCurrentPowerLevel,
  joystickEventState,
  joystickFromInstanceID,
  joystickGetAttached,
  joystickGetAxis,
  joystickGetBall,
  joystickGetButton,
  joystickGetDeviceGUID,
  joystickGetGUID,
  joystickGetGUIDFromString,
  joystickGetGUIDString,
  joystickGetHat,
  joystickInstanceID,
  joystickName,
  joystickNameForIndex,
  joystickNumAxes,
  joystickNumBalls,
  joystickNumButtons,
  joystickNumHats,
  joystickOpen,
  joystickUpdate,
  numJoysticks,

  -- * Game Controller Support
  gameControllerAddMapping,
  gameControllerAddMappingsFromFile,
  gameControllerAddMappingsFromRW,
  gameControllerClose,
  gameControllerEventState,
  gameControllerFromInstanceID,
  gameControllerGetAttached,
  gameControllerGetAxis,
  gameControllerGetAxisFromString,
  gameControllerGetBindForAxis,
  gameControllerGetBindForButton,
  gameControllerGetButton,
  gameControllerGetButtonFromString,
  gameControllerGetJoystick,
  gameControllerGetStringForAxis,
  gameControllerGetStringForButton,
  gameControllerMapping,
  gameControllerMappingForGUID,
  gameControllerName,
  gameControllerNameForIndex,
  gameControllerOpen,
  gameControllerUpdate,
  isGameController,
  eventBuffer,
  eventBufferSize
) where

import Control.Monad.IO.Class
import Data.Int
import Data.Word
import Foreign.C.String
import Foreign.C.Types
import Foreign.Marshal.Alloc
import Foreign.Ptr
import Foreign.Storable
import SDL.Raw.Enum
import SDL.Raw.Filesystem
import SDL.Raw.Types

foreign import ccall "SDL.h SDL_AddEventWatch" addEventWatchFFI :: EventFilter -> Ptr () -> IO ()
foreign import ccall "SDL.h SDL_DelEventWatch" delEventWatchFFI :: EventFilter -> Ptr () -> IO ()
foreign import ccall "SDL.h SDL_EventState" eventStateFFI :: Word32 -> CInt -> IO Word8
foreign import ccall "SDL.h SDL_FilterEvents" filterEventsFFI :: EventFilter -> Ptr () -> IO ()
foreign import ccall "SDL.h SDL_FlushEvent" flushEventFFI :: Word32 -> IO ()
foreign import ccall "SDL.h SDL_FlushEvents" flushEventsFFI :: Word32 -> Word32 -> IO ()
foreign import ccall "SDL.h SDL_GetEventFilter" getEventFilterFFI :: Ptr EventFilter -> Ptr (Ptr ()) -> IO Bool
foreign import ccall "SDL.h SDL_GetNumTouchDevices" getNumTouchDevicesFFI :: IO CInt
foreign import ccall "SDL.h SDL_GetNumTouchFingers" getNumTouchFingersFFI :: TouchID -> IO CInt
foreign import ccall "SDL.h SDL_GetTouchDevice" getTouchDeviceFFI :: CInt -> IO TouchID
foreign import ccall "SDL.h SDL_GetTouchFinger" getTouchFingerFFI :: TouchID -> CInt -> IO (Ptr Finger)
foreign import ccall "SDL.h SDL_HasEvent" hasEventFFI :: Word32 -> IO Bool
foreign import ccall "SDL.h SDL_HasEvents" hasEventsFFI :: Word32 -> Word32 -> IO Bool
foreign import ccall "SDL.h SDL_LoadDollarTemplates" loadDollarTemplatesFFI :: TouchID -> Ptr RWops -> IO CInt
foreign import ccall "SDL.h SDL_PeepEvents" peepEventsFFI :: Ptr Event -> CInt -> EventAction -> Word32 -> Word32 -> IO CInt
foreign import ccall "SDL.h SDL_PollEvent" pollEventFFI :: Ptr Event -> IO CInt
foreign import ccall "SDL.h SDL_PumpEvents" pumpEventsFFI :: IO ()
foreign import ccall "SDL.h SDL_PushEvent" pushEventFFI :: Ptr Event -> IO CInt
foreign import ccall "SDL.h SDL_RecordGesture" recordGestureFFI :: TouchID -> IO CInt
foreign import ccall "SDL.h SDL_RegisterEvents" registerEventsFFI :: CInt -> IO Word32
foreign import ccall "SDL.h SDL_SaveAllDollarTemplates" saveAllDollarTemplatesFFI :: Ptr RWops -> IO CInt
foreign import ccall "SDL.h SDL_SaveDollarTemplate" saveDollarTemplateFFI :: GestureID -> Ptr RWops -> IO CInt
foreign import ccall "SDL.h SDL_SetEventFilter" setEventFilterFFI :: EventFilter -> Ptr () -> IO ()
foreign import ccall "SDL.h SDL_WaitEvent" waitEventFFI :: Ptr Event -> IO CInt
foreign import ccall "SDL.h SDL_WaitEventTimeout" waitEventTimeoutFFI :: Ptr Event -> CInt -> IO CInt

foreign import ccall "SDL.h SDL_GetKeyFromName" getKeyFromNameFFI :: CString -> IO Keycode
foreign import ccall "SDL.h SDL_GetKeyFromScancode" getKeyFromScancodeFFI :: Scancode -> IO Keycode
foreign import ccall "SDL.h SDL_GetKeyName" getKeyNameFFI :: Keycode -> IO CString
foreign import ccall "SDL.h SDL_GetKeyboardFocus" getKeyboardFocusFFI :: IO Window
foreign import ccall "SDL.h SDL_GetKeyboardState" getKeyboardStateFFI :: Ptr CInt -> IO (Ptr Word8)
foreign import ccall "SDL.h SDL_GetModState" getModStateFFI :: IO Keymod
foreign import ccall "SDL.h SDL_GetScancodeFromKey" getScancodeFromKeyFFI :: Keycode -> IO Scancode
foreign import ccall "SDL.h SDL_GetScancodeFromName" getScancodeFromNameFFI :: CString -> IO Scancode
foreign import ccall "SDL.h SDL_GetScancodeName" getScancodeNameFFI :: Scancode -> IO CString
foreign import ccall "SDL.h SDL_HasScreenKeyboardSupport" hasScreenKeyboardSupportFFI :: IO Bool
foreign import ccall "SDL.h SDL_IsScreenKeyboardShown" isScreenKeyboardShownFFI :: Window -> IO Bool
foreign import ccall "SDL.h SDL_IsTextInputActive" isTextInputActiveFFI :: IO Bool
foreign import ccall "SDL.h SDL_SetModState" setModStateFFI :: Keymod -> IO ()
foreign import ccall "SDL.h SDL_SetTextInputRect" setTextInputRectFFI :: Ptr Rect -> IO ()
foreign import ccall "SDL.h SDL_StartTextInput" startTextInputFFI :: IO ()
foreign import ccall "SDL.h SDL_StopTextInput" stopTextInputFFI :: IO ()

foreign import ccall "SDL.h SDL_CaptureMouse" captureMouseFFI :: Bool -> IO CInt
foreign import ccall "SDL.h SDL_CreateColorCursor" createColorCursorFFI :: Ptr Surface -> CInt -> CInt -> IO Cursor
foreign import ccall "SDL.h SDL_CreateCursor" createCursorFFI :: Ptr Word8 -> Ptr Word8 -> CInt -> CInt -> CInt -> CInt -> IO Cursor
foreign import ccall "SDL.h SDL_CreateSystemCursor" createSystemCursorFFI :: SystemCursor -> IO Cursor
foreign import ccall "SDL.h SDL_FreeCursor" freeCursorFFI :: Cursor -> IO ()
foreign import ccall "SDL.h SDL_GetCursor" getCursorFFI :: IO Cursor
foreign import ccall "SDL.h SDL_GetDefaultCursor" getDefaultCursorFFI :: IO Cursor
foreign import ccall "SDL.h SDL_GetGlobalMouseState" getGlobalMouseStateFFI :: Ptr CInt -> Ptr CInt -> IO Word32
foreign import ccall "SDL.h SDL_GetMouseFocus" getMouseFocusFFI :: IO Window
foreign import ccall "SDL.h SDL_GetMouseState" getMouseStateFFI :: Ptr CInt -> Ptr CInt -> IO Word32
foreign import ccall "SDL.h SDL_GetRelativeMouseMode" getRelativeMouseModeFFI :: IO Bool
foreign import ccall "SDL.h SDL_GetRelativeMouseState" getRelativeMouseStateFFI :: Ptr CInt -> Ptr CInt -> IO Word32
foreign import ccall "SDL.h SDL_SetCursor" setCursorFFI :: Cursor -> IO ()
foreign import ccall "SDL.h SDL_SetRelativeMouseMode" setRelativeMouseModeFFI :: Bool -> IO CInt
foreign import ccall "SDL.h SDL_ShowCursor" showCursorFFI :: CInt -> IO CInt
foreign import ccall "SDL.h SDL_WarpMouseGlobal" warpMouseGlobalFFI :: CInt -> CInt -> IO CInt
foreign import ccall "SDL.h SDL_WarpMouseInWindow" warpMouseInWindowFFI :: Window -> CInt -> CInt -> IO ()

foreign import ccall "SDL.h SDL_JoystickClose" joystickCloseFFI :: Joystick -> IO ()
foreign import ccall "SDL.h SDL_JoystickCurrentPowerLevel" joystickCurrentPowerLevelFFI :: Joystick -> IO JoystickPowerLevel
foreign import ccall "SDL.h SDL_JoystickEventState" joystickEventStateFFI :: CInt -> IO CInt
foreign import ccall "SDL.h SDL_JoystickFromInstanceID" joystickFromInstanceIDFFI :: JoystickID -> IO Joystick
foreign import ccall "SDL.h SDL_JoystickGetAttached" joystickGetAttachedFFI :: Joystick -> IO Bool
foreign import ccall "SDL.h SDL_JoystickGetAxis" joystickGetAxisFFI :: Joystick -> CInt -> IO Int16
foreign import ccall "SDL.h SDL_JoystickGetBall" joystickGetBallFFI :: Joystick -> CInt -> Ptr CInt -> Ptr CInt -> IO CInt
foreign import ccall "SDL.h SDL_JoystickGetButton" joystickGetButtonFFI :: Joystick -> CInt -> IO Word8
foreign import ccall "sdlhelper.h SDLHelper_JoystickGetDeviceGUID" joystickGetDeviceGUIDFFI :: CInt -> Ptr JoystickGUID -> IO ()
foreign import ccall "sdlhelper.h SDLHelper_JoystickGetGUID" joystickGetGUIDFFI :: Joystick -> Ptr JoystickGUID -> IO ()
foreign import ccall "sdlhelper.h SDLHelper_JoystickGetGUIDFromString" joystickGetGUIDFromStringFFI :: CString -> Ptr JoystickGUID -> IO ()
foreign import ccall "sdlhelper.h SDLHelper_JoystickGetGUIDString" joystickGetGUIDStringFFI :: Ptr JoystickGUID -> CString -> CInt -> IO ()
foreign import ccall "SDL.h SDL_JoystickGetHat" joystickGetHatFFI :: Joystick -> CInt -> IO Word8
foreign import ccall "SDL.h SDL_JoystickInstanceID" joystickInstanceIDFFI :: Joystick -> IO JoystickID
foreign import ccall "SDL.h SDL_JoystickName" joystickNameFFI :: Joystick -> IO CString
foreign import ccall "SDL.h SDL_JoystickNameForIndex" joystickNameForIndexFFI :: CInt -> IO CString
foreign import ccall "SDL.h SDL_JoystickNumAxes" joystickNumAxesFFI :: Joystick -> IO CInt
foreign import ccall "SDL.h SDL_JoystickNumBalls" joystickNumBallsFFI :: Joystick -> IO CInt
foreign import ccall "SDL.h SDL_JoystickNumButtons" joystickNumButtonsFFI :: Joystick -> IO CInt
foreign import ccall "SDL.h SDL_JoystickNumHats" joystickNumHatsFFI :: Joystick -> IO CInt
foreign import ccall "SDL.h SDL_JoystickOpen" joystickOpenFFI :: CInt -> IO Joystick
foreign import ccall "SDL.h SDL_JoystickUpdate" joystickUpdateFFI :: IO ()
foreign import ccall "SDL.h SDL_NumJoysticks" numJoysticksFFI :: IO CInt

foreign import ccall "SDL.h SDL_GameControllerAddMapping" gameControllerAddMappingFFI :: CString -> IO CInt
foreign import ccall "SDL.h SDL_GameControllerAddMappingsFromRW" gameControllerAddMappingsFromRWFFI :: Ptr RWops -> CInt -> IO CInt
foreign import ccall "SDL.h SDL_GameControllerClose" gameControllerCloseFFI :: GameController -> IO ()
foreign import ccall "SDL.h SDL_GameControllerEventState" gameControllerEventStateFFI :: CInt -> IO CInt
foreign import ccall "SDL.h SDL_GameControllerFromInstanceID" gameControllerFromInstanceIDFFI :: JoystickID -> IO GameController
foreign import ccall "SDL.h SDL_GameControllerGetAttached" gameControllerGetAttachedFFI :: GameController -> IO Bool
foreign import ccall "SDL.h SDL_GameControllerGetAxis" gameControllerGetAxisFFI :: GameController -> GameControllerAxis -> IO Int16
foreign import ccall "SDL.h SDL_GameControllerGetAxisFromString" gameControllerGetAxisFromStringFFI :: CString -> IO GameControllerAxis
foreign import ccall "sdlhelper.h SDLHelper_GameControllerGetBindForAxis" gameControllerGetBindForAxisFFI :: GameController -> GameControllerAxis -> Ptr GameControllerButtonBind -> IO ()
foreign import ccall "sdlhelper.h SDLHelper_GameControllerGetBindForButton" gameControllerGetBindForButtonFFI :: GameController -> GameControllerButton -> Ptr GameControllerButtonBind -> IO ()
foreign import ccall "SDL.h SDL_GameControllerGetButton" gameControllerGetButtonFFI :: GameController -> GameControllerButton -> IO Word8
foreign import ccall "SDL.h SDL_GameControllerGetButtonFromString" gameControllerGetButtonFromStringFFI :: CString -> IO GameControllerButton
foreign import ccall "SDL.h SDL_GameControllerGetJoystick" gameControllerGetJoystickFFI :: GameController -> IO Joystick
foreign import ccall "SDL.h SDL_GameControllerGetStringForAxis" gameControllerGetStringForAxisFFI :: GameControllerAxis -> IO CString
foreign import ccall "SDL.h SDL_GameControllerGetStringForButton" gameControllerGetStringForButtonFFI :: GameControllerButton -> IO CString
foreign import ccall "SDL.h SDL_GameControllerMapping" gameControllerMappingFFI :: GameController -> IO CString
foreign import ccall "sdlhelper.h SDLHelper_GameControllerMappingForGUID" gameControllerMappingForGUIDFFI :: Ptr JoystickGUID -> IO CString
foreign import ccall "SDL.h SDL_GameControllerName" gameControllerNameFFI :: GameController -> IO CString
foreign import ccall "SDL.h SDL_GameControllerNameForIndex" gameControllerNameForIndexFFI :: CInt -> IO CString
foreign import ccall "SDL.h SDL_GameControllerOpen" gameControllerOpenFFI :: CInt -> IO GameController
foreign import ccall "SDL.h SDL_GameControllerUpdate" gameControllerUpdateFFI :: IO ()
foreign import ccall "SDL.h SDL_IsGameController" isGameControllerFFI :: CInt -> IO Bool

foreign import ccall "sdlhelper.c SDLHelper_GetEventBufferSize" eventBufferSize :: CInt
foreign import ccall "sdlhelper.c SDLHelper_GetEventBuffer"  eventBuffer :: Ptr Event

addEventWatch :: MonadIO m => EventFilter -> Ptr () -> m ()
addEventWatch :: forall (m :: Type -> Type).
MonadIO m =>
EventFilter -> Ptr () -> m ()
addEventWatch EventFilter
v1 Ptr ()
v2 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ EventFilter -> Ptr () -> IO ()
addEventWatchFFI EventFilter
v1 Ptr ()
v2
{-# INLINE addEventWatch #-}

delEventWatch :: MonadIO m => EventFilter -> Ptr () -> m ()
delEventWatch :: forall (m :: Type -> Type).
MonadIO m =>
EventFilter -> Ptr () -> m ()
delEventWatch EventFilter
v1 Ptr ()
v2 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ EventFilter -> Ptr () -> IO ()
delEventWatchFFI EventFilter
v1 Ptr ()
v2
{-# INLINE delEventWatch #-}

eventState :: MonadIO m => Word32 -> CInt -> m Word8
eventState :: forall (m :: Type -> Type). MonadIO m => Word32 -> CInt -> m Word8
eventState Word32
v1 CInt
v2 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Word32 -> CInt -> IO Word8
eventStateFFI Word32
v1 CInt
v2
{-# INLINE eventState #-}

filterEvents :: MonadIO m => EventFilter -> Ptr () -> m ()
filterEvents :: forall (m :: Type -> Type).
MonadIO m =>
EventFilter -> Ptr () -> m ()
filterEvents EventFilter
v1 Ptr ()
v2 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ EventFilter -> Ptr () -> IO ()
filterEventsFFI EventFilter
v1 Ptr ()
v2
{-# INLINE filterEvents #-}

flushEvent :: MonadIO m => Word32 -> m ()
flushEvent :: forall (m :: Type -> Type). MonadIO m => Word32 -> m ()
flushEvent Word32
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Word32 -> IO ()
flushEventFFI Word32
v1
{-# INLINE flushEvent #-}

flushEvents :: MonadIO m => Word32 -> Word32 -> m ()
flushEvents :: forall (m :: Type -> Type). MonadIO m => Word32 -> Word32 -> m ()
flushEvents Word32
v1 Word32
v2 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Word32 -> Word32 -> IO ()
flushEventsFFI Word32
v1 Word32
v2
{-# INLINE flushEvents #-}

getEventFilter :: MonadIO m => Ptr EventFilter -> Ptr (Ptr ()) -> m Bool
getEventFilter :: forall (m :: Type -> Type).
MonadIO m =>
Ptr EventFilter -> Ptr (Ptr ()) -> m Bool
getEventFilter Ptr EventFilter
v1 Ptr (Ptr ())
v2 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr EventFilter -> Ptr (Ptr ()) -> IO Bool
getEventFilterFFI Ptr EventFilter
v1 Ptr (Ptr ())
v2
{-# INLINE getEventFilter #-}

getNumTouchDevices :: MonadIO m => m CInt
getNumTouchDevices :: forall (m :: Type -> Type). MonadIO m => m CInt
getNumTouchDevices = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO IO CInt
getNumTouchDevicesFFI
{-# INLINE getNumTouchDevices #-}

getNumTouchFingers :: MonadIO m => TouchID -> m CInt
getNumTouchFingers :: forall (m :: Type -> Type). MonadIO m => TouchID -> m CInt
getNumTouchFingers TouchID
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ TouchID -> IO CInt
getNumTouchFingersFFI TouchID
v1
{-# INLINE getNumTouchFingers #-}

getTouchDevice :: MonadIO m => CInt -> m TouchID
getTouchDevice :: forall (m :: Type -> Type). MonadIO m => CInt -> m TouchID
getTouchDevice CInt
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ CInt -> IO TouchID
getTouchDeviceFFI CInt
v1
{-# INLINE getTouchDevice #-}

getTouchFinger :: MonadIO m => TouchID -> CInt -> m (Ptr Finger)
getTouchFinger :: forall (m :: Type -> Type).
MonadIO m =>
TouchID -> CInt -> m (Ptr Finger)
getTouchFinger TouchID
v1 CInt
v2 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ TouchID -> CInt -> IO (Ptr Finger)
getTouchFingerFFI TouchID
v1 CInt
v2
{-# INLINE getTouchFinger #-}

hasEvent :: MonadIO m => Word32 -> m Bool
hasEvent :: forall (m :: Type -> Type). MonadIO m => Word32 -> m Bool
hasEvent Word32
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Word32 -> IO Bool
hasEventFFI Word32
v1
{-# INLINE hasEvent #-}

hasEvents :: MonadIO m => Word32 -> Word32 -> m Bool
hasEvents :: forall (m :: Type -> Type). MonadIO m => Word32 -> Word32 -> m Bool
hasEvents Word32
v1 Word32
v2 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Word32 -> Word32 -> IO Bool
hasEventsFFI Word32
v1 Word32
v2
{-# INLINE hasEvents #-}

loadDollarTemplates :: MonadIO m => TouchID -> Ptr RWops -> m CInt
loadDollarTemplates :: forall (m :: Type -> Type).
MonadIO m =>
TouchID -> Ptr RWops -> m CInt
loadDollarTemplates TouchID
v1 Ptr RWops
v2 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ TouchID -> Ptr RWops -> IO CInt
loadDollarTemplatesFFI TouchID
v1 Ptr RWops
v2
{-# INLINE loadDollarTemplates #-}

peepEvents :: MonadIO m => Ptr Event -> CInt -> EventAction -> Word32 -> Word32 -> m CInt
peepEvents :: forall (m :: Type -> Type).
MonadIO m =>
Ptr Event -> CInt -> Word32 -> Word32 -> Word32 -> m CInt
peepEvents Ptr Event
v1 CInt
v2 Word32
v3 Word32
v4 Word32
v5 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr Event -> CInt -> Word32 -> Word32 -> Word32 -> IO CInt
peepEventsFFI Ptr Event
v1 CInt
v2 Word32
v3 Word32
v4 Word32
v5
{-# INLINE peepEvents #-}

pollEvent :: MonadIO m => Ptr Event -> m CInt
pollEvent :: forall (m :: Type -> Type). MonadIO m => Ptr Event -> m CInt
pollEvent Ptr Event
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr Event -> IO CInt
pollEventFFI Ptr Event
v1
{-# INLINE pollEvent #-}

pumpEvents :: MonadIO m => m ()
pumpEvents :: forall (m :: Type -> Type). MonadIO m => m ()
pumpEvents = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO IO ()
pumpEventsFFI
{-# INLINE pumpEvents #-}

pushEvent :: MonadIO m => Ptr Event -> m CInt
pushEvent :: forall (m :: Type -> Type). MonadIO m => Ptr Event -> m CInt
pushEvent Ptr Event
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr Event -> IO CInt
pushEventFFI Ptr Event
v1
{-# INLINE pushEvent #-}

quitRequested :: MonadIO m => m Bool
quitRequested :: forall (m :: Type -> Type). MonadIO m => m Bool
quitRequested = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
  forall (m :: Type -> Type). MonadIO m => m ()
pumpEvents
  CInt
ev <- forall (m :: Type -> Type).
MonadIO m =>
Ptr Event -> CInt -> Word32 -> Word32 -> Word32 -> m CInt
peepEvents forall a. Ptr a
nullPtr CInt
0 Word32
SDL_PEEKEVENT forall {a}. (Eq a, Num a) => a
SDL_QUIT forall {a}. (Eq a, Num a) => a
SDL_QUIT
  forall (m :: Type -> Type) a. Monad m => a -> m a
return forall a b. (a -> b) -> a -> b
$ CInt
ev forall a. Ord a => a -> a -> Bool
> CInt
0
{-# INLINE quitRequested #-}

recordGesture :: MonadIO m => TouchID -> m CInt
recordGesture :: forall (m :: Type -> Type). MonadIO m => TouchID -> m CInt
recordGesture TouchID
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ TouchID -> IO CInt
recordGestureFFI TouchID
v1
{-# INLINE recordGesture #-}

registerEvents :: MonadIO m => CInt -> m Word32
registerEvents :: forall (m :: Type -> Type). MonadIO m => CInt -> m Word32
registerEvents CInt
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ CInt -> IO Word32
registerEventsFFI CInt
v1
{-# INLINE registerEvents #-}

saveAllDollarTemplates :: MonadIO m => Ptr RWops -> m CInt
saveAllDollarTemplates :: forall (m :: Type -> Type). MonadIO m => Ptr RWops -> m CInt
saveAllDollarTemplates Ptr RWops
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr RWops -> IO CInt
saveAllDollarTemplatesFFI Ptr RWops
v1
{-# INLINE saveAllDollarTemplates #-}

saveDollarTemplate :: MonadIO m => GestureID -> Ptr RWops -> m CInt
saveDollarTemplate :: forall (m :: Type -> Type).
MonadIO m =>
TouchID -> Ptr RWops -> m CInt
saveDollarTemplate TouchID
v1 Ptr RWops
v2 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ TouchID -> Ptr RWops -> IO CInt
saveDollarTemplateFFI TouchID
v1 Ptr RWops
v2
{-# INLINE saveDollarTemplate #-}

setEventFilter :: MonadIO m => EventFilter -> Ptr () -> m ()
setEventFilter :: forall (m :: Type -> Type).
MonadIO m =>
EventFilter -> Ptr () -> m ()
setEventFilter EventFilter
v1 Ptr ()
v2 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ EventFilter -> Ptr () -> IO ()
setEventFilterFFI EventFilter
v1 Ptr ()
v2
{-# INLINE setEventFilter #-}

waitEvent :: MonadIO m => Ptr Event -> m CInt
waitEvent :: forall (m :: Type -> Type). MonadIO m => Ptr Event -> m CInt
waitEvent Ptr Event
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr Event -> IO CInt
waitEventFFI Ptr Event
v1
{-# INLINE waitEvent #-}

waitEventTimeout :: MonadIO m => Ptr Event -> CInt -> m CInt
waitEventTimeout :: forall (m :: Type -> Type).
MonadIO m =>
Ptr Event -> CInt -> m CInt
waitEventTimeout Ptr Event
v1 CInt
v2 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr Event -> CInt -> IO CInt
waitEventTimeoutFFI Ptr Event
v1 CInt
v2
{-# INLINE waitEventTimeout #-}

getKeyFromName :: MonadIO m => CString -> m Keycode
getKeyFromName :: forall (m :: Type -> Type). MonadIO m => CString -> m Keycode
getKeyFromName CString
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ CString -> IO Keycode
getKeyFromNameFFI CString
v1
{-# INLINE getKeyFromName #-}

getKeyFromScancode :: MonadIO m => Scancode -> m Keycode
getKeyFromScancode :: forall (m :: Type -> Type). MonadIO m => Word32 -> m Keycode
getKeyFromScancode Word32
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Word32 -> IO Keycode
getKeyFromScancodeFFI Word32
v1
{-# INLINE getKeyFromScancode #-}

getKeyName :: MonadIO m => Keycode -> m CString
getKeyName :: forall (m :: Type -> Type). MonadIO m => Keycode -> m CString
getKeyName Keycode
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Keycode -> IO CString
getKeyNameFFI Keycode
v1
{-# INLINE getKeyName #-}

getKeyboardFocus :: MonadIO m => m Window
getKeyboardFocus :: forall (m :: Type -> Type). MonadIO m => m (Ptr ())
getKeyboardFocus = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO IO (Ptr ())
getKeyboardFocusFFI
{-# INLINE getKeyboardFocus #-}

getKeyboardState :: MonadIO m => Ptr CInt -> m (Ptr Word8)
getKeyboardState :: forall (m :: Type -> Type). MonadIO m => Ptr CInt -> m (Ptr Word8)
getKeyboardState Ptr CInt
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr CInt -> IO (Ptr Word8)
getKeyboardStateFFI Ptr CInt
v1
{-# INLINE getKeyboardState #-}

getModState :: MonadIO m => m Keymod
getModState :: forall (m :: Type -> Type). MonadIO m => m Word32
getModState = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO IO Word32
getModStateFFI
{-# INLINE getModState #-}

getScancodeFromKey :: MonadIO m => Keycode -> m Scancode
getScancodeFromKey :: forall (m :: Type -> Type). MonadIO m => Keycode -> m Word32
getScancodeFromKey Keycode
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Keycode -> IO Word32
getScancodeFromKeyFFI Keycode
v1
{-# INLINE getScancodeFromKey #-}

getScancodeFromName :: MonadIO m => CString -> m Scancode
getScancodeFromName :: forall (m :: Type -> Type). MonadIO m => CString -> m Word32
getScancodeFromName CString
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ CString -> IO Word32
getScancodeFromNameFFI CString
v1
{-# INLINE getScancodeFromName #-}

getScancodeName :: MonadIO m => Scancode -> m CString
getScancodeName :: forall (m :: Type -> Type). MonadIO m => Word32 -> m CString
getScancodeName Word32
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Word32 -> IO CString
getScancodeNameFFI Word32
v1
{-# INLINE getScancodeName #-}

hasScreenKeyboardSupport :: MonadIO m => m Bool
hasScreenKeyboardSupport :: forall (m :: Type -> Type). MonadIO m => m Bool
hasScreenKeyboardSupport = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO IO Bool
hasScreenKeyboardSupportFFI
{-# INLINE hasScreenKeyboardSupport #-}

isScreenKeyboardShown :: MonadIO m => Window -> m Bool
isScreenKeyboardShown :: forall (m :: Type -> Type). MonadIO m => Ptr () -> m Bool
isScreenKeyboardShown Ptr ()
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr () -> IO Bool
isScreenKeyboardShownFFI Ptr ()
v1
{-# INLINE isScreenKeyboardShown #-}

isTextInputActive :: MonadIO m => m Bool
isTextInputActive :: forall (m :: Type -> Type). MonadIO m => m Bool
isTextInputActive = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO IO Bool
isTextInputActiveFFI
{-# INLINE isTextInputActive #-}

setModState :: MonadIO m => Keymod -> m ()
setModState :: forall (m :: Type -> Type). MonadIO m => Word32 -> m ()
setModState Word32
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Word32 -> IO ()
setModStateFFI Word32
v1
{-# INLINE setModState #-}

setTextInputRect :: MonadIO m => Ptr Rect -> m ()
setTextInputRect :: forall (m :: Type -> Type). MonadIO m => Ptr Rect -> m ()
setTextInputRect Ptr Rect
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr Rect -> IO ()
setTextInputRectFFI Ptr Rect
v1
{-# INLINE setTextInputRect #-}

startTextInput :: MonadIO m => m ()
startTextInput :: forall (m :: Type -> Type). MonadIO m => m ()
startTextInput = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO IO ()
startTextInputFFI
{-# INLINE startTextInput #-}

stopTextInput :: MonadIO m => m ()
stopTextInput :: forall (m :: Type -> Type). MonadIO m => m ()
stopTextInput = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO IO ()
stopTextInputFFI
{-# INLINE stopTextInput #-}

captureMouse :: MonadIO m => Bool -> m CInt
captureMouse :: forall (m :: Type -> Type). MonadIO m => Bool -> m CInt
captureMouse Bool
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Bool -> IO CInt
captureMouseFFI Bool
v1
{-# INLINE captureMouse #-}

createColorCursor :: MonadIO m => Ptr Surface -> CInt -> CInt -> m Cursor
createColorCursor :: forall (m :: Type -> Type).
MonadIO m =>
Ptr Surface -> CInt -> CInt -> m (Ptr ())
createColorCursor Ptr Surface
v1 CInt
v2 CInt
v3 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr Surface -> CInt -> CInt -> IO (Ptr ())
createColorCursorFFI Ptr Surface
v1 CInt
v2 CInt
v3
{-# INLINE createColorCursor #-}

createCursor :: MonadIO m => Ptr Word8 -> Ptr Word8 -> CInt -> CInt -> CInt -> CInt -> m Cursor
createCursor :: forall (m :: Type -> Type).
MonadIO m =>
Ptr Word8
-> Ptr Word8 -> CInt -> CInt -> CInt -> CInt -> m (Ptr ())
createCursor Ptr Word8
v1 Ptr Word8
v2 CInt
v3 CInt
v4 CInt
v5 CInt
v6 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr Word8
-> Ptr Word8 -> CInt -> CInt -> CInt -> CInt -> IO (Ptr ())
createCursorFFI Ptr Word8
v1 Ptr Word8
v2 CInt
v3 CInt
v4 CInt
v5 CInt
v6
{-# INLINE createCursor #-}

createSystemCursor :: MonadIO m => SystemCursor -> m Cursor
createSystemCursor :: forall (m :: Type -> Type). MonadIO m => Word32 -> m (Ptr ())
createSystemCursor Word32
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Word32 -> IO (Ptr ())
createSystemCursorFFI Word32
v1
{-# INLINE createSystemCursor #-}

freeCursor :: MonadIO m => Cursor -> m ()
freeCursor :: forall (m :: Type -> Type). MonadIO m => Ptr () -> m ()
freeCursor Ptr ()
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr () -> IO ()
freeCursorFFI Ptr ()
v1
{-# INLINE freeCursor #-}

getCursor :: MonadIO m => m Cursor
getCursor :: forall (m :: Type -> Type). MonadIO m => m (Ptr ())
getCursor = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO IO (Ptr ())
getCursorFFI
{-# INLINE getCursor #-}

getDefaultCursor :: MonadIO m => m Cursor
getDefaultCursor :: forall (m :: Type -> Type). MonadIO m => m (Ptr ())
getDefaultCursor = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO IO (Ptr ())
getDefaultCursorFFI
{-# INLINE getDefaultCursor #-}

getGlobalMouseState :: MonadIO m => Ptr CInt -> Ptr CInt -> m Word32
getGlobalMouseState :: forall (m :: Type -> Type).
MonadIO m =>
Ptr CInt -> Ptr CInt -> m Word32
getGlobalMouseState Ptr CInt
v1 Ptr CInt
v2 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr CInt -> Ptr CInt -> IO Word32
getGlobalMouseStateFFI Ptr CInt
v1 Ptr CInt
v2
{-# INLINE getGlobalMouseState #-}

getMouseFocus :: MonadIO m => m Window
getMouseFocus :: forall (m :: Type -> Type). MonadIO m => m (Ptr ())
getMouseFocus = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO IO (Ptr ())
getMouseFocusFFI
{-# INLINE getMouseFocus #-}

getMouseState :: MonadIO m => Ptr CInt -> Ptr CInt -> m Word32
getMouseState :: forall (m :: Type -> Type).
MonadIO m =>
Ptr CInt -> Ptr CInt -> m Word32
getMouseState Ptr CInt
v1 Ptr CInt
v2 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr CInt -> Ptr CInt -> IO Word32
getMouseStateFFI Ptr CInt
v1 Ptr CInt
v2
{-# INLINE getMouseState #-}

getRelativeMouseMode :: MonadIO m => m Bool
getRelativeMouseMode :: forall (m :: Type -> Type). MonadIO m => m Bool
getRelativeMouseMode = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO IO Bool
getRelativeMouseModeFFI
{-# INLINE getRelativeMouseMode #-}

getRelativeMouseState :: MonadIO m => Ptr CInt -> Ptr CInt -> m Word32
getRelativeMouseState :: forall (m :: Type -> Type).
MonadIO m =>
Ptr CInt -> Ptr CInt -> m Word32
getRelativeMouseState Ptr CInt
v1 Ptr CInt
v2 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr CInt -> Ptr CInt -> IO Word32
getRelativeMouseStateFFI Ptr CInt
v1 Ptr CInt
v2
{-# INLINE getRelativeMouseState #-}

setCursor :: MonadIO m => Cursor -> m ()
setCursor :: forall (m :: Type -> Type). MonadIO m => Ptr () -> m ()
setCursor Ptr ()
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr () -> IO ()
setCursorFFI Ptr ()
v1
{-# INLINE setCursor #-}

setRelativeMouseMode :: MonadIO m => Bool -> m CInt
setRelativeMouseMode :: forall (m :: Type -> Type). MonadIO m => Bool -> m CInt
setRelativeMouseMode Bool
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Bool -> IO CInt
setRelativeMouseModeFFI Bool
v1
{-# INLINE setRelativeMouseMode #-}

showCursor :: MonadIO m => CInt -> m CInt
showCursor :: forall (m :: Type -> Type). MonadIO m => CInt -> m CInt
showCursor CInt
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ CInt -> IO CInt
showCursorFFI CInt
v1
{-# INLINE showCursor #-}

warpMouseGlobal :: MonadIO m => CInt -> CInt -> m CInt
warpMouseGlobal :: forall (m :: Type -> Type). MonadIO m => CInt -> CInt -> m CInt
warpMouseGlobal CInt
v1 CInt
v2 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ CInt -> CInt -> IO CInt
warpMouseGlobalFFI CInt
v1 CInt
v2
{-# INLINE warpMouseGlobal #-}

warpMouseInWindow :: MonadIO m => Window -> CInt -> CInt -> m ()
warpMouseInWindow :: forall (m :: Type -> Type).
MonadIO m =>
Ptr () -> CInt -> CInt -> m ()
warpMouseInWindow Ptr ()
v1 CInt
v2 CInt
v3 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr () -> CInt -> CInt -> IO ()
warpMouseInWindowFFI Ptr ()
v1 CInt
v2 CInt
v3
{-# INLINE warpMouseInWindow #-}

joystickClose :: MonadIO m => Joystick -> m ()
joystickClose :: forall (m :: Type -> Type). MonadIO m => Ptr () -> m ()
joystickClose Ptr ()
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr () -> IO ()
joystickCloseFFI Ptr ()
v1
{-# INLINE joystickClose #-}

joystickCurrentPowerLevel :: MonadIO m => Joystick -> m JoystickPowerLevel
joystickCurrentPowerLevel :: forall (m :: Type -> Type). MonadIO m => Ptr () -> m Keycode
joystickCurrentPowerLevel Ptr ()
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr () -> IO Keycode
joystickCurrentPowerLevelFFI Ptr ()
v1
{-# INLINE joystickCurrentPowerLevel #-}

joystickEventState :: MonadIO m => CInt -> m CInt
joystickEventState :: forall (m :: Type -> Type). MonadIO m => CInt -> m CInt
joystickEventState CInt
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ CInt -> IO CInt
joystickEventStateFFI CInt
v1
{-# INLINE joystickEventState #-}

joystickFromInstanceID :: MonadIO m => JoystickID -> m Joystick
joystickFromInstanceID :: forall (m :: Type -> Type). MonadIO m => Keycode -> m (Ptr ())
joystickFromInstanceID Keycode
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Keycode -> IO (Ptr ())
joystickFromInstanceIDFFI Keycode
v1
{-# INLINE joystickFromInstanceID #-}

joystickGetAttached :: MonadIO m => Joystick -> m Bool
joystickGetAttached :: forall (m :: Type -> Type). MonadIO m => Ptr () -> m Bool
joystickGetAttached Ptr ()
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr () -> IO Bool
joystickGetAttachedFFI Ptr ()
v1
{-# INLINE joystickGetAttached #-}

joystickGetAxis :: MonadIO m => Joystick -> CInt -> m Int16
joystickGetAxis :: forall (m :: Type -> Type). MonadIO m => Ptr () -> CInt -> m Int16
joystickGetAxis Ptr ()
v1 CInt
v2 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr () -> CInt -> IO Int16
joystickGetAxisFFI Ptr ()
v1 CInt
v2
{-# INLINE joystickGetAxis #-}

joystickGetBall :: MonadIO m => Joystick -> CInt -> Ptr CInt -> Ptr CInt -> m CInt
joystickGetBall :: forall (m :: Type -> Type).
MonadIO m =>
Ptr () -> CInt -> Ptr CInt -> Ptr CInt -> m CInt
joystickGetBall Ptr ()
v1 CInt
v2 Ptr CInt
v3 Ptr CInt
v4 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr () -> CInt -> Ptr CInt -> Ptr CInt -> IO CInt
joystickGetBallFFI Ptr ()
v1 CInt
v2 Ptr CInt
v3 Ptr CInt
v4
{-# INLINE joystickGetBall #-}

joystickGetButton :: MonadIO m => Joystick -> CInt -> m Word8
joystickGetButton :: forall (m :: Type -> Type). MonadIO m => Ptr () -> CInt -> m Word8
joystickGetButton Ptr ()
v1 CInt
v2 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr () -> CInt -> IO Word8
joystickGetButtonFFI Ptr ()
v1 CInt
v2
{-# INLINE joystickGetButton #-}

joystickGetDeviceGUID :: MonadIO m => CInt -> m JoystickGUID
joystickGetDeviceGUID :: forall (m :: Type -> Type). MonadIO m => CInt -> m JoystickGUID
joystickGetDeviceGUID CInt
device_index = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca forall a b. (a -> b) -> a -> b
$ \Ptr JoystickGUID
ptr -> do
  CInt -> Ptr JoystickGUID -> IO ()
joystickGetDeviceGUIDFFI CInt
device_index Ptr JoystickGUID
ptr
  forall a. Storable a => Ptr a -> IO a
peek Ptr JoystickGUID
ptr
{-# INLINE joystickGetDeviceGUID #-}

joystickGetGUID :: MonadIO m => Joystick -> m JoystickGUID
joystickGetGUID :: forall (m :: Type -> Type). MonadIO m => Ptr () -> m JoystickGUID
joystickGetGUID Ptr ()
joystick = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca forall a b. (a -> b) -> a -> b
$ \Ptr JoystickGUID
ptr -> do
  Ptr () -> Ptr JoystickGUID -> IO ()
joystickGetGUIDFFI Ptr ()
joystick Ptr JoystickGUID
ptr
  forall a. Storable a => Ptr a -> IO a
peek Ptr JoystickGUID
ptr
{-# INLINE joystickGetGUID #-}

joystickGetGUIDFromString :: MonadIO m => CString -> m JoystickGUID
joystickGetGUIDFromString :: forall (m :: Type -> Type). MonadIO m => CString -> m JoystickGUID
joystickGetGUIDFromString CString
pchGUID = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca forall a b. (a -> b) -> a -> b
$ \Ptr JoystickGUID
ptr -> do
  CString -> Ptr JoystickGUID -> IO ()
joystickGetGUIDFromStringFFI CString
pchGUID Ptr JoystickGUID
ptr
  forall a. Storable a => Ptr a -> IO a
peek Ptr JoystickGUID
ptr
{-# INLINE joystickGetGUIDFromString #-}

joystickGetGUIDString :: MonadIO m => JoystickGUID -> CString -> CInt -> m ()
joystickGetGUIDString :: forall (m :: Type -> Type).
MonadIO m =>
JoystickGUID -> CString -> CInt -> m ()
joystickGetGUIDString JoystickGUID
guid CString
pszGUID CInt
cbGUID = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca forall a b. (a -> b) -> a -> b
$ \Ptr JoystickGUID
ptr -> do
  forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr JoystickGUID
ptr JoystickGUID
guid
  Ptr JoystickGUID -> CString -> CInt -> IO ()
joystickGetGUIDStringFFI Ptr JoystickGUID
ptr CString
pszGUID CInt
cbGUID
{-# INLINE joystickGetGUIDString #-}

joystickGetHat :: MonadIO m => Joystick -> CInt -> m Word8
joystickGetHat :: forall (m :: Type -> Type). MonadIO m => Ptr () -> CInt -> m Word8
joystickGetHat Ptr ()
v1 CInt
v2 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr () -> CInt -> IO Word8
joystickGetHatFFI Ptr ()
v1 CInt
v2
{-# INLINE joystickGetHat #-}

joystickInstanceID :: MonadIO m => Joystick -> m JoystickID
joystickInstanceID :: forall (m :: Type -> Type). MonadIO m => Ptr () -> m Keycode
joystickInstanceID Ptr ()
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr () -> IO Keycode
joystickInstanceIDFFI Ptr ()
v1
{-# INLINE joystickInstanceID #-}

joystickName :: MonadIO m => Joystick -> m CString
joystickName :: forall (m :: Type -> Type). MonadIO m => Ptr () -> m CString
joystickName Ptr ()
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr () -> IO CString
joystickNameFFI Ptr ()
v1
{-# INLINE joystickName #-}

joystickNameForIndex :: MonadIO m => CInt -> m CString
joystickNameForIndex :: forall (m :: Type -> Type). MonadIO m => CInt -> m CString
joystickNameForIndex CInt
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ CInt -> IO CString
joystickNameForIndexFFI CInt
v1
{-# INLINE joystickNameForIndex #-}

joystickNumAxes :: MonadIO m => Joystick -> m CInt
joystickNumAxes :: forall (m :: Type -> Type). MonadIO m => Ptr () -> m CInt
joystickNumAxes Ptr ()
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr () -> IO CInt
joystickNumAxesFFI Ptr ()
v1
{-# INLINE joystickNumAxes #-}

joystickNumBalls :: MonadIO m => Joystick -> m CInt
joystickNumBalls :: forall (m :: Type -> Type). MonadIO m => Ptr () -> m CInt
joystickNumBalls Ptr ()
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr () -> IO CInt
joystickNumBallsFFI Ptr ()
v1
{-# INLINE joystickNumBalls #-}

joystickNumButtons :: MonadIO m => Joystick -> m CInt
joystickNumButtons :: forall (m :: Type -> Type). MonadIO m => Ptr () -> m CInt
joystickNumButtons Ptr ()
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr () -> IO CInt
joystickNumButtonsFFI Ptr ()
v1
{-# INLINE joystickNumButtons #-}

joystickNumHats :: MonadIO m => Joystick -> m CInt
joystickNumHats :: forall (m :: Type -> Type). MonadIO m => Ptr () -> m CInt
joystickNumHats Ptr ()
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr () -> IO CInt
joystickNumHatsFFI Ptr ()
v1
{-# INLINE joystickNumHats #-}

joystickOpen :: MonadIO m => CInt -> m Joystick
joystickOpen :: forall (m :: Type -> Type). MonadIO m => CInt -> m (Ptr ())
joystickOpen CInt
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ CInt -> IO (Ptr ())
joystickOpenFFI CInt
v1
{-# INLINE joystickOpen #-}

joystickUpdate :: MonadIO m => m ()
joystickUpdate :: forall (m :: Type -> Type). MonadIO m => m ()
joystickUpdate = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO IO ()
joystickUpdateFFI
{-# INLINE joystickUpdate #-}

numJoysticks :: MonadIO m => m CInt
numJoysticks :: forall (m :: Type -> Type). MonadIO m => m CInt
numJoysticks = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO IO CInt
numJoysticksFFI
{-# INLINE numJoysticks #-}

gameControllerAddMapping :: MonadIO m => CString -> m CInt
gameControllerAddMapping :: forall (m :: Type -> Type). MonadIO m => CString -> m CInt
gameControllerAddMapping CString
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ CString -> IO CInt
gameControllerAddMappingFFI CString
v1
{-# INLINE gameControllerAddMapping #-}

gameControllerAddMappingsFromFile :: MonadIO m => CString -> m CInt
gameControllerAddMappingsFromFile :: forall (m :: Type -> Type). MonadIO m => CString -> m CInt
gameControllerAddMappingsFromFile CString
file = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ do
  Ptr RWops
rw <- forall a. String -> (CString -> IO a) -> IO a
withCString String
"rb" forall a b. (a -> b) -> a -> b
$ forall (m :: Type -> Type).
MonadIO m =>
CString -> CString -> m (Ptr RWops)
rwFromFile CString
file
  forall (m :: Type -> Type).
MonadIO m =>
Ptr RWops -> CInt -> m CInt
gameControllerAddMappingsFromRW Ptr RWops
rw CInt
1
{-# INLINE gameControllerAddMappingsFromFile #-}

gameControllerAddMappingsFromRW :: MonadIO m => Ptr RWops -> CInt -> m CInt
gameControllerAddMappingsFromRW :: forall (m :: Type -> Type).
MonadIO m =>
Ptr RWops -> CInt -> m CInt
gameControllerAddMappingsFromRW Ptr RWops
v1 CInt
v2 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr RWops -> CInt -> IO CInt
gameControllerAddMappingsFromRWFFI Ptr RWops
v1 CInt
v2
{-# INLINE gameControllerAddMappingsFromRW #-}

gameControllerClose :: MonadIO m => GameController -> m ()
gameControllerClose :: forall (m :: Type -> Type). MonadIO m => Ptr () -> m ()
gameControllerClose Ptr ()
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr () -> IO ()
gameControllerCloseFFI Ptr ()
v1
{-# INLINE gameControllerClose #-}

gameControllerEventState :: MonadIO m => CInt -> m CInt
gameControllerEventState :: forall (m :: Type -> Type). MonadIO m => CInt -> m CInt
gameControllerEventState CInt
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ CInt -> IO CInt
gameControllerEventStateFFI CInt
v1
{-# INLINE gameControllerEventState #-}

gameControllerFromInstanceID :: MonadIO m => JoystickID -> m GameController
gameControllerFromInstanceID :: forall (m :: Type -> Type). MonadIO m => Keycode -> m (Ptr ())
gameControllerFromInstanceID Keycode
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Keycode -> IO (Ptr ())
gameControllerFromInstanceIDFFI Keycode
v1
{-# INLINE gameControllerFromInstanceID #-}

gameControllerGetAttached :: MonadIO m => GameController -> m Bool
gameControllerGetAttached :: forall (m :: Type -> Type). MonadIO m => Ptr () -> m Bool
gameControllerGetAttached Ptr ()
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr () -> IO Bool
gameControllerGetAttachedFFI Ptr ()
v1
{-# INLINE gameControllerGetAttached #-}

gameControllerGetAxis :: MonadIO m => GameController -> GameControllerAxis -> m Int16
gameControllerGetAxis :: forall (m :: Type -> Type).
MonadIO m =>
Ptr () -> Keycode -> m Int16
gameControllerGetAxis Ptr ()
v1 Keycode
v2 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr () -> Keycode -> IO Int16
gameControllerGetAxisFFI Ptr ()
v1 Keycode
v2
{-# INLINE gameControllerGetAxis #-}

gameControllerGetAxisFromString :: MonadIO m => CString -> m GameControllerAxis
gameControllerGetAxisFromString :: forall (m :: Type -> Type). MonadIO m => CString -> m Keycode
gameControllerGetAxisFromString CString
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ CString -> IO Keycode
gameControllerGetAxisFromStringFFI CString
v1
{-# INLINE gameControllerGetAxisFromString #-}

gameControllerGetBindForAxis :: MonadIO m => GameController -> GameControllerAxis -> m GameControllerButtonBind
gameControllerGetBindForAxis :: forall (m :: Type -> Type).
MonadIO m =>
Ptr () -> Keycode -> m GameControllerButtonBind
gameControllerGetBindForAxis Ptr ()
gamecontroller Keycode
axis = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca forall a b. (a -> b) -> a -> b
$ \Ptr GameControllerButtonBind
ptr -> do
  Ptr () -> Keycode -> Ptr GameControllerButtonBind -> IO ()
gameControllerGetBindForAxisFFI Ptr ()
gamecontroller Keycode
axis Ptr GameControllerButtonBind
ptr
  forall a. Storable a => Ptr a -> IO a
peek Ptr GameControllerButtonBind
ptr
{-# INLINE gameControllerGetBindForAxis #-}

gameControllerGetBindForButton :: MonadIO m => GameController -> GameControllerButton -> m GameControllerButtonBind
gameControllerGetBindForButton :: forall (m :: Type -> Type).
MonadIO m =>
Ptr () -> Keycode -> m GameControllerButtonBind
gameControllerGetBindForButton Ptr ()
gamecontroller Keycode
button = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca forall a b. (a -> b) -> a -> b
$ \Ptr GameControllerButtonBind
ptr -> do
  Ptr () -> Keycode -> Ptr GameControllerButtonBind -> IO ()
gameControllerGetBindForButtonFFI Ptr ()
gamecontroller Keycode
button Ptr GameControllerButtonBind
ptr
  forall a. Storable a => Ptr a -> IO a
peek Ptr GameControllerButtonBind
ptr
{-# INLINE gameControllerGetBindForButton #-}

gameControllerGetButton :: MonadIO m => GameController -> GameControllerButton -> m Word8
gameControllerGetButton :: forall (m :: Type -> Type).
MonadIO m =>
Ptr () -> Keycode -> m Word8
gameControllerGetButton Ptr ()
v1 Keycode
v2 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr () -> Keycode -> IO Word8
gameControllerGetButtonFFI Ptr ()
v1 Keycode
v2
{-# INLINE gameControllerGetButton #-}

gameControllerGetButtonFromString :: MonadIO m => CString -> m GameControllerButton
gameControllerGetButtonFromString :: forall (m :: Type -> Type). MonadIO m => CString -> m Keycode
gameControllerGetButtonFromString CString
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ CString -> IO Keycode
gameControllerGetButtonFromStringFFI CString
v1
{-# INLINE gameControllerGetButtonFromString #-}

gameControllerGetJoystick :: MonadIO m => GameController -> m Joystick
gameControllerGetJoystick :: forall (m :: Type -> Type). MonadIO m => Ptr () -> m (Ptr ())
gameControllerGetJoystick Ptr ()
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr () -> IO (Ptr ())
gameControllerGetJoystickFFI Ptr ()
v1
{-# INLINE gameControllerGetJoystick #-}

gameControllerGetStringForAxis :: MonadIO m => GameControllerAxis -> m CString
gameControllerGetStringForAxis :: forall (m :: Type -> Type). MonadIO m => Keycode -> m CString
gameControllerGetStringForAxis Keycode
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Keycode -> IO CString
gameControllerGetStringForAxisFFI Keycode
v1
{-# INLINE gameControllerGetStringForAxis #-}

gameControllerGetStringForButton :: MonadIO m => GameControllerButton -> m CString
gameControllerGetStringForButton :: forall (m :: Type -> Type). MonadIO m => Keycode -> m CString
gameControllerGetStringForButton Keycode
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Keycode -> IO CString
gameControllerGetStringForButtonFFI Keycode
v1
{-# INLINE gameControllerGetStringForButton #-}

gameControllerMapping :: MonadIO m => GameController -> m CString
gameControllerMapping :: forall (m :: Type -> Type). MonadIO m => Ptr () -> m CString
gameControllerMapping Ptr ()
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr () -> IO CString
gameControllerMappingFFI Ptr ()
v1
{-# INLINE gameControllerMapping #-}

gameControllerMappingForGUID :: MonadIO m => JoystickGUID -> m CString
gameControllerMappingForGUID :: forall (m :: Type -> Type). MonadIO m => JoystickGUID -> m CString
gameControllerMappingForGUID JoystickGUID
guid = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca forall a b. (a -> b) -> a -> b
$ \Ptr JoystickGUID
ptr -> do
  forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr JoystickGUID
ptr JoystickGUID
guid
  Ptr JoystickGUID -> IO CString
gameControllerMappingForGUIDFFI Ptr JoystickGUID
ptr
{-# INLINE gameControllerMappingForGUID #-}

gameControllerName :: MonadIO m => GameController -> m CString
gameControllerName :: forall (m :: Type -> Type). MonadIO m => Ptr () -> m CString
gameControllerName Ptr ()
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ Ptr () -> IO CString
gameControllerNameFFI Ptr ()
v1
{-# INLINE gameControllerName #-}

gameControllerNameForIndex :: MonadIO m => CInt -> m CString
gameControllerNameForIndex :: forall (m :: Type -> Type). MonadIO m => CInt -> m CString
gameControllerNameForIndex CInt
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ CInt -> IO CString
gameControllerNameForIndexFFI CInt
v1
{-# INLINE gameControllerNameForIndex #-}

gameControllerOpen :: MonadIO m => CInt -> m GameController
gameControllerOpen :: forall (m :: Type -> Type). MonadIO m => CInt -> m (Ptr ())
gameControllerOpen CInt
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ CInt -> IO (Ptr ())
gameControllerOpenFFI CInt
v1
{-# INLINE gameControllerOpen #-}

gameControllerUpdate :: MonadIO m => m ()
gameControllerUpdate :: forall (m :: Type -> Type). MonadIO m => m ()
gameControllerUpdate = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO IO ()
gameControllerUpdateFFI
{-# INLINE gameControllerUpdate #-}

isGameController :: MonadIO m => CInt -> m Bool
isGameController :: forall (m :: Type -> Type). MonadIO m => CInt -> m Bool
isGameController CInt
v1 = forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO forall a b. (a -> b) -> a -> b
$ CInt -> IO Bool
isGameControllerFFI CInt
v1
{-# INLINE isGameController #-}