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,
  gameControllerFromPlayerIndex,
  gameControllerGetAttached,
  gameControllerGetAxis,
  gameControllerGetAxisFromString,
  gameControllerGetBindForAxis,
  gameControllerGetBindForButton,
  gameControllerGetButton,
  gameControllerGetButtonFromString,
  gameControllerGetJoystick,
  gameControllerGetNumTouchpadFingers,
  gameControllerGetNumTouchpads,
  gameControllerGetPlayerIndex,
  gameControllerHasLED,
  gameControllerHasRumble,
  gameControllerHasRumbleTriggers,
  gameControllerGetStringForAxis,
  gameControllerGetStringForButton,
  gameControllerMapping,
  gameControllerMappingForGUID,
  gameControllerName,
  gameControllerNameForIndex,
  gameControllerOpen,
  gameControllerUpdate,
  gameControllerRumble,
  gameControllerRumbleTriggers,
  gameControllerSetLED,
  gameControllerSetPlayerIndex,
  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_GameControllerFromPlayerIndex" gameControllerFromPlayerIndexFFI :: CInt -> 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_GameControllerGetNumTouchpadFingers" gameControllerGetNumTouchpadFingersFFI :: GameController -> CInt -> IO CInt
foreign import ccall "SDL.h SDL_GameControllerGetNumTouchpads" gameControllerGetNumTouchpadsFFI :: GameController -> IO CInt
foreign import ccall "SDL.h SDL_GameControllerGetPlayerIndex" gameControllerGetPlayerIndexFFI :: GameController -> IO CInt
foreign import ccall "SDL.h SDL_GameControllerHasLED" gameControllerHasLEDFFI :: GameController -> IO Bool
foreign import ccall "SDL.h SDL_GameControllerHasRumble" gameControllerHasRumbleFFI :: GameController -> IO Bool
foreign import ccall "SDL.h SDL_GameControllerHasRumbleTriggers" gameControllerHasRumbleTriggersFFI :: GameController -> IO Bool
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_GameControllerRumble" gameControllerRumbleFFI :: GameController -> CUShort -> CUShort -> CUInt -> IO CInt
foreign import ccall "SDL.h SDL_GameControllerRumbleTriggers" gameControllerRumbleTriggersFFI :: GameController -> CUShort -> CUShort -> CUInt -> IO CInt
foreign import ccall "SDL.h SDL_GameControllerSetLED" gameControllerSetLEDFFI :: GameController -> Word8 -> Word8 -> Word8 -> IO CInt
foreign import ccall "SDL.h SDL_GameControllerSetPlayerIndex" gameControllerSetPlayerIndexFFI :: GameController -> CInt -> 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 = IO () -> m ()
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
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 = IO () -> m ()
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
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 = IO Word8 -> m Word8
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO Word8 -> m Word8) -> IO Word8 -> m Word8
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 = IO () -> m ()
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
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 = IO () -> m ()
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
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 = IO () -> m ()
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
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 = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
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 = IO CInt -> m CInt
forall a. IO a -> m a
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 = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
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 = IO TouchID -> m TouchID
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO TouchID -> m TouchID) -> IO TouchID -> m TouchID
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 = IO (Ptr Finger) -> m (Ptr Finger)
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr Finger) -> m (Ptr Finger))
-> IO (Ptr Finger) -> m (Ptr Finger)
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 = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
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 = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
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 = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
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 = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
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 = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
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 = IO () -> m ()
forall a. IO a -> m a
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 = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
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 = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
  IO ()
forall (m :: Type -> Type). MonadIO m => m ()
pumpEvents
  CInt
ev <- Ptr Event -> CInt -> Word32 -> Word32 -> Word32 -> IO CInt
forall (m :: Type -> Type).
MonadIO m =>
Ptr Event -> CInt -> Word32 -> Word32 -> Word32 -> m CInt
peepEvents Ptr Event
forall a. Ptr a
nullPtr CInt
0 Word32
SDL_PEEKEVENT Word32
forall {a}. (Eq a, Num a) => a
SDL_QUIT Word32
forall {a}. (Eq a, Num a) => a
SDL_QUIT
  Bool -> IO Bool
forall a. a -> IO a
forall (m :: Type -> Type) a. Monad m => a -> m a
return (Bool -> IO Bool) -> Bool -> IO Bool
forall a b. (a -> b) -> a -> b
$ CInt
ev CInt -> CInt -> Bool
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 = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
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 = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
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 = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
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 = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
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 = IO () -> m ()
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
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 = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
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 = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
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 = IO Keycode -> m Keycode
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO Keycode -> m Keycode) -> IO Keycode -> m Keycode
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 = IO Keycode -> m Keycode
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO Keycode -> m Keycode) -> IO Keycode -> m Keycode
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 = IO CString -> m CString
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CString -> m CString) -> IO CString -> m CString
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 = IO (Ptr ()) -> m (Ptr ())
forall a. IO a -> m a
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 = IO (Ptr Word8) -> m (Ptr Word8)
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr Word8) -> m (Ptr Word8))
-> IO (Ptr Word8) -> m (Ptr Word8)
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 = IO Word32 -> m Word32
forall a. IO a -> m a
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 = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
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 = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
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 = IO CString -> m CString
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CString -> m CString) -> IO CString -> m CString
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 = IO Bool -> m Bool
forall a. IO a -> m a
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 = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
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 = IO Bool -> m Bool
forall a. IO a -> m a
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 = IO () -> m ()
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
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 = IO () -> m ()
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
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 = IO () -> m ()
forall a. IO a -> m a
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 = IO () -> m ()
forall a. IO a -> m a
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 = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
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 = IO (Ptr ()) -> m (Ptr ())
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
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 = IO (Ptr ()) -> m (Ptr ())
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
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 = IO (Ptr ()) -> m (Ptr ())
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
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 = IO () -> m ()
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
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 = IO (Ptr ()) -> m (Ptr ())
forall a. IO a -> m a
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 = IO (Ptr ()) -> m (Ptr ())
forall a. IO a -> m a
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 = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
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 = IO (Ptr ()) -> m (Ptr ())
forall a. IO a -> m a
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 = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
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 = IO Bool -> m Bool
forall a. IO a -> m a
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 = IO Word32 -> m Word32
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
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 = IO () -> m ()
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
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 = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
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 = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
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 = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
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 = IO () -> m ()
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
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 = IO () -> m ()
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
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 = IO Keycode -> m Keycode
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO Keycode -> m Keycode) -> IO Keycode -> m Keycode
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 = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
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 = IO (Ptr ()) -> m (Ptr ())
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
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 = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
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 = IO Int16 -> m Int16
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO Int16 -> m Int16) -> IO Int16 -> m Int16
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 = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
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 = IO Word8 -> m Word8
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO Word8 -> m Word8) -> IO Word8 -> m Word8
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 = IO JoystickGUID -> m JoystickGUID
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO JoystickGUID -> m JoystickGUID)
-> ((Ptr JoystickGUID -> IO JoystickGUID) -> IO JoystickGUID)
-> (Ptr JoystickGUID -> IO JoystickGUID)
-> m JoystickGUID
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Ptr JoystickGUID -> IO JoystickGUID) -> IO JoystickGUID
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr JoystickGUID -> IO JoystickGUID) -> m JoystickGUID)
-> (Ptr JoystickGUID -> IO JoystickGUID) -> m JoystickGUID
forall a b. (a -> b) -> a -> b
$ \Ptr JoystickGUID
ptr -> do
  CInt -> Ptr JoystickGUID -> IO ()
joystickGetDeviceGUIDFFI CInt
device_index Ptr JoystickGUID
ptr
  Ptr JoystickGUID -> IO JoystickGUID
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 = IO JoystickGUID -> m JoystickGUID
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO JoystickGUID -> m JoystickGUID)
-> ((Ptr JoystickGUID -> IO JoystickGUID) -> IO JoystickGUID)
-> (Ptr JoystickGUID -> IO JoystickGUID)
-> m JoystickGUID
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Ptr JoystickGUID -> IO JoystickGUID) -> IO JoystickGUID
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr JoystickGUID -> IO JoystickGUID) -> m JoystickGUID)
-> (Ptr JoystickGUID -> IO JoystickGUID) -> m JoystickGUID
forall a b. (a -> b) -> a -> b
$ \Ptr JoystickGUID
ptr -> do
  Ptr () -> Ptr JoystickGUID -> IO ()
joystickGetGUIDFFI Ptr ()
joystick Ptr JoystickGUID
ptr
  Ptr JoystickGUID -> IO JoystickGUID
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 = IO JoystickGUID -> m JoystickGUID
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO JoystickGUID -> m JoystickGUID)
-> ((Ptr JoystickGUID -> IO JoystickGUID) -> IO JoystickGUID)
-> (Ptr JoystickGUID -> IO JoystickGUID)
-> m JoystickGUID
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Ptr JoystickGUID -> IO JoystickGUID) -> IO JoystickGUID
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr JoystickGUID -> IO JoystickGUID) -> m JoystickGUID)
-> (Ptr JoystickGUID -> IO JoystickGUID) -> m JoystickGUID
forall a b. (a -> b) -> a -> b
$ \Ptr JoystickGUID
ptr -> do
  CString -> Ptr JoystickGUID -> IO ()
joystickGetGUIDFromStringFFI CString
pchGUID Ptr JoystickGUID
ptr
  Ptr JoystickGUID -> IO JoystickGUID
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 = IO () -> m ()
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ())
-> ((Ptr JoystickGUID -> IO ()) -> IO ())
-> (Ptr JoystickGUID -> IO ())
-> m ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Ptr JoystickGUID -> IO ()) -> IO ()
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr JoystickGUID -> IO ()) -> m ())
-> (Ptr JoystickGUID -> IO ()) -> m ()
forall a b. (a -> b) -> a -> b
$ \Ptr JoystickGUID
ptr -> do
  Ptr JoystickGUID -> JoystickGUID -> IO ()
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 = IO Word8 -> m Word8
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO Word8 -> m Word8) -> IO Word8 -> m Word8
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 = IO Keycode -> m Keycode
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO Keycode -> m Keycode) -> IO Keycode -> m Keycode
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 = IO CString -> m CString
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CString -> m CString) -> IO CString -> m CString
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 = IO CString -> m CString
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CString -> m CString) -> IO CString -> m CString
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 = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
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 = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
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 = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
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 = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
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 = IO (Ptr ()) -> m (Ptr ())
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
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 = IO () -> m ()
forall a. IO a -> m a
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 = IO CInt -> m CInt
forall a. IO a -> m a
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 = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
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 = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
forall a b. (a -> b) -> a -> b
$ do
  Ptr RWops
rw <- String -> (CString -> IO (Ptr RWops)) -> IO (Ptr RWops)
forall a. String -> (CString -> IO a) -> IO a
withCString String
"rb" ((CString -> IO (Ptr RWops)) -> IO (Ptr RWops))
-> (CString -> IO (Ptr RWops)) -> IO (Ptr RWops)
forall a b. (a -> b) -> a -> b
$ CString -> CString -> IO (Ptr RWops)
forall (m :: Type -> Type).
MonadIO m =>
CString -> CString -> m (Ptr RWops)
rwFromFile CString
file
  Ptr RWops -> CInt -> IO CInt
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 = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
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 = IO () -> m ()
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
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 = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
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 = IO (Ptr ()) -> m (Ptr ())
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
forall a b. (a -> b) -> a -> b
$ Keycode -> IO (Ptr ())
gameControllerFromInstanceIDFFI Keycode
v1
{-# INLINE gameControllerFromInstanceID #-}

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

gameControllerGetAttached :: MonadIO m => GameController -> m Bool
gameControllerGetAttached :: forall (m :: Type -> Type). MonadIO m => Ptr () -> m Bool
gameControllerGetAttached Ptr ()
v1 = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
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 = IO Int16 -> m Int16
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO Int16 -> m Int16) -> IO Int16 -> m Int16
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 = IO Keycode -> m Keycode
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO Keycode -> m Keycode) -> IO Keycode -> m Keycode
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 = IO GameControllerButtonBind -> m GameControllerButtonBind
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO GameControllerButtonBind -> m GameControllerButtonBind)
-> ((Ptr GameControllerButtonBind -> IO GameControllerButtonBind)
    -> IO GameControllerButtonBind)
-> (Ptr GameControllerButtonBind -> IO GameControllerButtonBind)
-> m GameControllerButtonBind
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Ptr GameControllerButtonBind -> IO GameControllerButtonBind)
-> IO GameControllerButtonBind
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr GameControllerButtonBind -> IO GameControllerButtonBind)
 -> m GameControllerButtonBind)
-> (Ptr GameControllerButtonBind -> IO GameControllerButtonBind)
-> m GameControllerButtonBind
forall a b. (a -> b) -> a -> b
$ \Ptr GameControllerButtonBind
ptr -> do
  Ptr () -> Keycode -> Ptr GameControllerButtonBind -> IO ()
gameControllerGetBindForAxisFFI Ptr ()
gamecontroller Keycode
axis Ptr GameControllerButtonBind
ptr
  Ptr GameControllerButtonBind -> IO GameControllerButtonBind
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 = IO GameControllerButtonBind -> m GameControllerButtonBind
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO GameControllerButtonBind -> m GameControllerButtonBind)
-> ((Ptr GameControllerButtonBind -> IO GameControllerButtonBind)
    -> IO GameControllerButtonBind)
-> (Ptr GameControllerButtonBind -> IO GameControllerButtonBind)
-> m GameControllerButtonBind
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Ptr GameControllerButtonBind -> IO GameControllerButtonBind)
-> IO GameControllerButtonBind
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr GameControllerButtonBind -> IO GameControllerButtonBind)
 -> m GameControllerButtonBind)
-> (Ptr GameControllerButtonBind -> IO GameControllerButtonBind)
-> m GameControllerButtonBind
forall a b. (a -> b) -> a -> b
$ \Ptr GameControllerButtonBind
ptr -> do
  Ptr () -> Keycode -> Ptr GameControllerButtonBind -> IO ()
gameControllerGetBindForButtonFFI Ptr ()
gamecontroller Keycode
button Ptr GameControllerButtonBind
ptr
  Ptr GameControllerButtonBind -> IO GameControllerButtonBind
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 = IO Word8 -> m Word8
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO Word8 -> m Word8) -> IO Word8 -> m Word8
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 = IO Keycode -> m Keycode
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO Keycode -> m Keycode) -> IO Keycode -> m Keycode
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 = IO (Ptr ()) -> m (Ptr ())
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
forall a b. (a -> b) -> a -> b
$ Ptr () -> IO (Ptr ())
gameControllerGetJoystickFFI Ptr ()
v1
{-# INLINE gameControllerGetJoystick #-}

gameControllerGetNumTouchpadFingers :: MonadIO m => GameController -> CInt -> m CInt
gameControllerGetNumTouchpadFingers :: forall (m :: Type -> Type). MonadIO m => Ptr () -> CInt -> m CInt
gameControllerGetNumTouchpadFingers Ptr ()
gamecontroller CInt
touchpad =
  IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
forall a b. (a -> b) -> a -> b
$ Ptr () -> CInt -> IO CInt
gameControllerGetNumTouchpadFingersFFI Ptr ()
gamecontroller CInt
touchpad
{-# INLINE gameControllerGetNumTouchpadFingers #-}

gameControllerGetNumTouchpads :: MonadIO m => GameController -> m CInt
gameControllerGetNumTouchpads :: forall (m :: Type -> Type). MonadIO m => Ptr () -> m CInt
gameControllerGetNumTouchpads Ptr ()
gamecontroller = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
forall a b. (a -> b) -> a -> b
$ Ptr () -> IO CInt
gameControllerGetNumTouchpadsFFI Ptr ()
gamecontroller
{-# INLINE gameControllerGetNumTouchpads #-}

gameControllerGetPlayerIndex :: MonadIO m => GameController -> m CInt
gameControllerGetPlayerIndex :: forall (m :: Type -> Type). MonadIO m => Ptr () -> m CInt
gameControllerGetPlayerIndex Ptr ()
gamecontroller = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
forall a b. (a -> b) -> a -> b
$ Ptr () -> IO CInt
gameControllerGetPlayerIndexFFI Ptr ()
gamecontroller
{-# INLINE gameControllerGetPlayerIndex #-}

gameControllerHasLED :: MonadIO m => GameController -> m Bool
gameControllerHasLED :: forall (m :: Type -> Type). MonadIO m => Ptr () -> m Bool
gameControllerHasLED Ptr ()
gamecontroller = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ Ptr () -> IO Bool
gameControllerHasLEDFFI Ptr ()
gamecontroller
{-# INLINE gameControllerHasLED #-}

gameControllerHasRumble :: MonadIO m => GameController -> m Bool
gameControllerHasRumble :: forall (m :: Type -> Type). MonadIO m => Ptr () -> m Bool
gameControllerHasRumble Ptr ()
gamecontroller = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ Ptr () -> IO Bool
gameControllerHasRumbleFFI Ptr ()
gamecontroller
{-# INLINE gameControllerHasRumble #-}

gameControllerHasRumbleTriggers :: MonadIO m => GameController -> m Bool
gameControllerHasRumbleTriggers :: forall (m :: Type -> Type). MonadIO m => Ptr () -> m Bool
gameControllerHasRumbleTriggers Ptr ()
gamecontroller = IO Bool -> m Bool
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ Ptr () -> IO Bool
gameControllerHasRumbleTriggersFFI Ptr ()
gamecontroller
{-# INLINE gameControllerHasRumbleTriggers #-}

gameControllerGetStringForAxis :: MonadIO m => GameControllerAxis -> m CString
gameControllerGetStringForAxis :: forall (m :: Type -> Type). MonadIO m => Keycode -> m CString
gameControllerGetStringForAxis Keycode
v1 = IO CString -> m CString
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CString -> m CString) -> IO CString -> m CString
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 = IO CString -> m CString
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CString -> m CString) -> IO CString -> m CString
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 = IO CString -> m CString
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CString -> m CString) -> IO CString -> m CString
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 = IO CString -> m CString
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CString -> m CString)
-> ((Ptr JoystickGUID -> IO CString) -> IO CString)
-> (Ptr JoystickGUID -> IO CString)
-> m CString
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Ptr JoystickGUID -> IO CString) -> IO CString
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr JoystickGUID -> IO CString) -> m CString)
-> (Ptr JoystickGUID -> IO CString) -> m CString
forall a b. (a -> b) -> a -> b
$ \Ptr JoystickGUID
ptr -> do
  Ptr JoystickGUID -> JoystickGUID -> IO ()
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 = IO CString -> m CString
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CString -> m CString) -> IO CString -> m CString
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 = IO CString -> m CString
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CString -> m CString) -> IO CString -> m CString
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 = IO (Ptr ()) -> m (Ptr ())
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
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 = IO () -> m ()
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO IO ()
gameControllerUpdateFFI
{-# INLINE gameControllerUpdate #-}

gameControllerRumble :: MonadIO m => GameController -> CUShort -> CUShort -> CUInt -> m CInt
gameControllerRumble :: forall (m :: Type -> Type).
MonadIO m =>
Ptr () -> CUShort -> CUShort -> CUInt -> m CInt
gameControllerRumble Ptr ()
v1 CUShort
v2 CUShort
v3 CUInt
v4 = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
forall a b. (a -> b) -> a -> b
$ Ptr () -> CUShort -> CUShort -> CUInt -> IO CInt
gameControllerRumbleFFI Ptr ()
v1 CUShort
v2 CUShort
v3 CUInt
v4
{-# INLINE gameControllerRumble #-}

gameControllerRumbleTriggers :: MonadIO m => GameController -> CUShort -> CUShort -> CUInt -> m CInt
gameControllerRumbleTriggers :: forall (m :: Type -> Type).
MonadIO m =>
Ptr () -> CUShort -> CUShort -> CUInt -> m CInt
gameControllerRumbleTriggers Ptr ()
gamecontroller CUShort
v1 CUShort
v2 CUInt
v3 = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
forall a b. (a -> b) -> a -> b
$ Ptr () -> CUShort -> CUShort -> CUInt -> IO CInt
gameControllerRumbleTriggersFFI Ptr ()
gamecontroller CUShort
v1 CUShort
v2 CUInt
v3
{-# INLINE gameControllerRumbleTriggers #-}

gameControllerSetLED :: MonadIO m => GameController -> Word8 -> Word8 -> Word8 -> m CInt
gameControllerSetLED :: forall (m :: Type -> Type).
MonadIO m =>
Ptr () -> Word8 -> Word8 -> Word8 -> m CInt
gameControllerSetLED Ptr ()
gamecontroller Word8
v1 Word8
v2 Word8
v3 = IO CInt -> m CInt
forall a. IO a -> m a
forall (m :: Type -> Type) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
forall a b. (a -> b) -> a -> b
$ Ptr () -> Word8 -> Word8 -> Word8 -> IO CInt
gameControllerSetLEDFFI Ptr ()
gamecontroller Word8
v1 Word8
v2 Word8
v3
{-# INLINE gameControllerSetLED #-}

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

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