module SDL.Raw.Haptic (
  -- * Force Feedback Support
  hapticClose,
  hapticDestroyEffect,
  hapticEffectSupported,
  hapticGetEffectStatus,
  hapticIndex,
  hapticName,
  hapticNewEffect,
  hapticNumAxes,
  hapticNumEffects,
  hapticNumEffectsPlaying,
  hapticOpen,
  hapticOpenFromJoystick,
  hapticOpenFromMouse,
  hapticOpened,
  hapticPause,
  hapticQuery,
  hapticRumbleInit,
  hapticRumblePlay,
  hapticRumbleStop,
  hapticRumbleSupported,
  hapticRunEffect,
  hapticSetAutocenter,
  hapticSetGain,
  hapticStopAll,
  hapticStopEffect,
  hapticUnpause,
  hapticUpdateEffect,
  joystickIsHaptic,
  mouseIsHaptic,
  numHaptics
) where

import Control.Monad.IO.Class
import Data.Word
import Foreign.C.String
import Foreign.C.Types
import Foreign.Ptr
import SDL.Raw.Types

foreign import ccall "SDL.h SDL_HapticClose" hapticCloseFFI :: Haptic -> IO ()
foreign import ccall "SDL.h SDL_HapticDestroyEffect" hapticDestroyEffectFFI :: Haptic -> CInt -> IO ()
foreign import ccall "SDL.h SDL_HapticEffectSupported" hapticEffectSupportedFFI :: Haptic -> Ptr HapticEffect -> IO CInt
foreign import ccall "SDL.h SDL_HapticGetEffectStatus" hapticGetEffectStatusFFI :: Haptic -> CInt -> IO CInt
foreign import ccall "SDL.h SDL_HapticIndex" hapticIndexFFI :: Haptic -> IO CInt
foreign import ccall "SDL.h SDL_HapticName" hapticNameFFI :: CInt -> IO CString
foreign import ccall "SDL.h SDL_HapticNewEffect" hapticNewEffectFFI :: Haptic -> Ptr HapticEffect -> IO CInt
foreign import ccall "SDL.h SDL_HapticNumAxes" hapticNumAxesFFI :: Haptic -> IO CInt
foreign import ccall "SDL.h SDL_HapticNumEffects" hapticNumEffectsFFI :: Haptic -> IO CInt
foreign import ccall "SDL.h SDL_HapticNumEffectsPlaying" hapticNumEffectsPlayingFFI :: Haptic -> IO CInt
foreign import ccall "SDL.h SDL_HapticOpen" hapticOpenFFI :: CInt -> IO Haptic
foreign import ccall "SDL.h SDL_HapticOpenFromJoystick" hapticOpenFromJoystickFFI :: Joystick -> IO Haptic
foreign import ccall "SDL.h SDL_HapticOpenFromMouse" hapticOpenFromMouseFFI :: IO Haptic
foreign import ccall "SDL.h SDL_HapticOpened" hapticOpenedFFI :: CInt -> IO CInt
foreign import ccall "SDL.h SDL_HapticPause" hapticPauseFFI :: Haptic -> IO CInt
foreign import ccall "SDL.h SDL_HapticQuery" hapticQueryFFI :: Haptic -> IO CUInt
foreign import ccall "SDL.h SDL_HapticRumbleInit" hapticRumbleInitFFI :: Haptic -> IO CInt
foreign import ccall "SDL.h SDL_HapticRumblePlay" hapticRumblePlayFFI :: Haptic -> CFloat -> Word32 -> IO CInt
foreign import ccall "SDL.h SDL_HapticRumbleStop" hapticRumbleStopFFI :: Haptic -> IO CInt
foreign import ccall "SDL.h SDL_HapticRumbleSupported" hapticRumbleSupportedFFI :: Haptic -> IO CInt
foreign import ccall "SDL.h SDL_HapticRunEffect" hapticRunEffectFFI :: Haptic -> CInt -> Word32 -> IO CInt
foreign import ccall "SDL.h SDL_HapticSetAutocenter" hapticSetAutocenterFFI :: Haptic -> CInt -> IO CInt
foreign import ccall "SDL.h SDL_HapticSetGain" hapticSetGainFFI :: Haptic -> CInt -> IO CInt
foreign import ccall "SDL.h SDL_HapticStopAll" hapticStopAllFFI :: Haptic -> IO CInt
foreign import ccall "SDL.h SDL_HapticStopEffect" hapticStopEffectFFI :: Haptic -> CInt -> IO CInt
foreign import ccall "SDL.h SDL_HapticUnpause" hapticUnpauseFFI :: Haptic -> IO CInt
foreign import ccall "SDL.h SDL_HapticUpdateEffect" hapticUpdateEffectFFI :: Haptic -> CInt -> Ptr HapticEffect -> IO CInt
foreign import ccall "SDL.h SDL_JoystickIsHaptic" joystickIsHapticFFI :: Joystick -> IO CInt
foreign import ccall "SDL.h SDL_MouseIsHaptic" mouseIsHapticFFI :: IO CInt
foreign import ccall "SDL.h SDL_NumHaptics" numHapticsFFI :: IO CInt

hapticClose :: MonadIO m => Haptic -> m ()
hapticClose :: Haptic -> m ()
hapticClose v1 :: Haptic
v1 = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Haptic -> IO ()
hapticCloseFFI Haptic
v1
{-# INLINE hapticClose #-}

hapticDestroyEffect :: MonadIO m => Haptic -> CInt -> m ()
hapticDestroyEffect :: Haptic -> CInt -> m ()
hapticDestroyEffect v1 :: Haptic
v1 v2 :: CInt
v2 = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Haptic -> CInt -> IO ()
hapticDestroyEffectFFI Haptic
v1 CInt
v2
{-# INLINE hapticDestroyEffect #-}

hapticEffectSupported :: MonadIO m => Haptic -> Ptr HapticEffect -> m CInt
hapticEffectSupported :: Haptic -> Ptr HapticEffect -> m CInt
hapticEffectSupported v1 :: Haptic
v1 v2 :: Ptr HapticEffect
v2 = IO CInt -> m CInt
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
forall a b. (a -> b) -> a -> b
$ Haptic -> Ptr HapticEffect -> IO CInt
hapticEffectSupportedFFI Haptic
v1 Ptr HapticEffect
v2
{-# INLINE hapticEffectSupported #-}

hapticGetEffectStatus :: MonadIO m => Haptic -> CInt -> m CInt
hapticGetEffectStatus :: Haptic -> CInt -> m CInt
hapticGetEffectStatus v1 :: Haptic
v1 v2 :: CInt
v2 = IO CInt -> m CInt
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
forall a b. (a -> b) -> a -> b
$ Haptic -> CInt -> IO CInt
hapticGetEffectStatusFFI Haptic
v1 CInt
v2
{-# INLINE hapticGetEffectStatus #-}

hapticIndex :: MonadIO m => Haptic -> m CInt
hapticIndex :: Haptic -> m CInt
hapticIndex v1 :: Haptic
v1 = IO CInt -> m CInt
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
forall a b. (a -> b) -> a -> b
$ Haptic -> IO CInt
hapticIndexFFI Haptic
v1
{-# INLINE hapticIndex #-}

hapticName :: MonadIO m => CInt -> m CString
hapticName :: CInt -> m CString
hapticName v1 :: CInt
v1 = IO CString -> m CString
forall (m :: * -> *) 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
hapticNameFFI CInt
v1
{-# INLINE hapticName #-}

hapticNewEffect :: MonadIO m => Haptic -> Ptr HapticEffect -> m CInt
hapticNewEffect :: Haptic -> Ptr HapticEffect -> m CInt
hapticNewEffect v1 :: Haptic
v1 v2 :: Ptr HapticEffect
v2 = IO CInt -> m CInt
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
forall a b. (a -> b) -> a -> b
$ Haptic -> Ptr HapticEffect -> IO CInt
hapticNewEffectFFI Haptic
v1 Ptr HapticEffect
v2
{-# INLINE hapticNewEffect #-}

hapticNumAxes :: MonadIO m => Haptic -> m CInt
hapticNumAxes :: Haptic -> m CInt
hapticNumAxes v1 :: Haptic
v1 = IO CInt -> m CInt
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
forall a b. (a -> b) -> a -> b
$ Haptic -> IO CInt
hapticNumAxesFFI Haptic
v1
{-# INLINE hapticNumAxes #-}

hapticNumEffects :: MonadIO m => Haptic -> m CInt
hapticNumEffects :: Haptic -> m CInt
hapticNumEffects v1 :: Haptic
v1 = IO CInt -> m CInt
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
forall a b. (a -> b) -> a -> b
$ Haptic -> IO CInt
hapticNumEffectsFFI Haptic
v1
{-# INLINE hapticNumEffects #-}

hapticNumEffectsPlaying :: MonadIO m => Haptic -> m CInt
hapticNumEffectsPlaying :: Haptic -> m CInt
hapticNumEffectsPlaying v1 :: Haptic
v1 = IO CInt -> m CInt
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
forall a b. (a -> b) -> a -> b
$ Haptic -> IO CInt
hapticNumEffectsPlayingFFI Haptic
v1
{-# INLINE hapticNumEffectsPlaying #-}

hapticOpen :: MonadIO m => CInt -> m Haptic
hapticOpen :: CInt -> m Haptic
hapticOpen v1 :: CInt
v1 = IO Haptic -> m Haptic
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Haptic -> m Haptic) -> IO Haptic -> m Haptic
forall a b. (a -> b) -> a -> b
$ CInt -> IO Haptic
hapticOpenFFI CInt
v1
{-# INLINE hapticOpen #-}

hapticOpenFromJoystick :: MonadIO m => Joystick -> m Haptic
hapticOpenFromJoystick :: Haptic -> m Haptic
hapticOpenFromJoystick v1 :: Haptic
v1 = IO Haptic -> m Haptic
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Haptic -> m Haptic) -> IO Haptic -> m Haptic
forall a b. (a -> b) -> a -> b
$ Haptic -> IO Haptic
hapticOpenFromJoystickFFI Haptic
v1
{-# INLINE hapticOpenFromJoystick #-}

hapticOpenFromMouse :: MonadIO m => m Haptic
hapticOpenFromMouse :: m Haptic
hapticOpenFromMouse = IO Haptic -> m Haptic
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO IO Haptic
hapticOpenFromMouseFFI
{-# INLINE hapticOpenFromMouse #-}

hapticOpened :: MonadIO m => CInt -> m CInt
hapticOpened :: CInt -> m CInt
hapticOpened v1 :: CInt
v1 = IO CInt -> m CInt
forall (m :: * -> *) 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
hapticOpenedFFI CInt
v1
{-# INLINE hapticOpened #-}

hapticPause :: MonadIO m => Haptic -> m CInt
hapticPause :: Haptic -> m CInt
hapticPause v1 :: Haptic
v1 = IO CInt -> m CInt
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
forall a b. (a -> b) -> a -> b
$ Haptic -> IO CInt
hapticPauseFFI Haptic
v1
{-# INLINE hapticPause #-}

hapticQuery :: MonadIO m => Haptic -> m CUInt
hapticQuery :: Haptic -> m CUInt
hapticQuery v1 :: Haptic
v1 = IO CUInt -> m CUInt
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CUInt -> m CUInt) -> IO CUInt -> m CUInt
forall a b. (a -> b) -> a -> b
$ Haptic -> IO CUInt
hapticQueryFFI Haptic
v1
{-# INLINE hapticQuery #-}

hapticRumbleInit :: MonadIO m => Haptic -> m CInt
hapticRumbleInit :: Haptic -> m CInt
hapticRumbleInit v1 :: Haptic
v1 = IO CInt -> m CInt
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
forall a b. (a -> b) -> a -> b
$ Haptic -> IO CInt
hapticRumbleInitFFI Haptic
v1
{-# INLINE hapticRumbleInit #-}

hapticRumblePlay :: MonadIO m => Haptic -> CFloat -> Word32 -> m CInt
hapticRumblePlay :: Haptic -> CFloat -> Word32 -> m CInt
hapticRumblePlay v1 :: Haptic
v1 v2 :: CFloat
v2 v3 :: Word32
v3 = IO CInt -> m CInt
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
forall a b. (a -> b) -> a -> b
$ Haptic -> CFloat -> Word32 -> IO CInt
hapticRumblePlayFFI Haptic
v1 CFloat
v2 Word32
v3
{-# INLINE hapticRumblePlay #-}

hapticRumbleStop :: MonadIO m => Haptic -> m CInt
hapticRumbleStop :: Haptic -> m CInt
hapticRumbleStop v1 :: Haptic
v1 = IO CInt -> m CInt
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
forall a b. (a -> b) -> a -> b
$ Haptic -> IO CInt
hapticRumbleStopFFI Haptic
v1
{-# INLINE hapticRumbleStop #-}

hapticRumbleSupported :: MonadIO m => Haptic -> m CInt
hapticRumbleSupported :: Haptic -> m CInt
hapticRumbleSupported v1 :: Haptic
v1 = IO CInt -> m CInt
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
forall a b. (a -> b) -> a -> b
$ Haptic -> IO CInt
hapticRumbleSupportedFFI Haptic
v1
{-# INLINE hapticRumbleSupported #-}

hapticRunEffect :: MonadIO m => Haptic -> CInt -> Word32 -> m CInt
hapticRunEffect :: Haptic -> CInt -> Word32 -> m CInt
hapticRunEffect v1 :: Haptic
v1 v2 :: CInt
v2 v3 :: Word32
v3 = IO CInt -> m CInt
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
forall a b. (a -> b) -> a -> b
$ Haptic -> CInt -> Word32 -> IO CInt
hapticRunEffectFFI Haptic
v1 CInt
v2 Word32
v3
{-# INLINE hapticRunEffect #-}

hapticSetAutocenter :: MonadIO m => Haptic -> CInt -> m CInt
hapticSetAutocenter :: Haptic -> CInt -> m CInt
hapticSetAutocenter v1 :: Haptic
v1 v2 :: CInt
v2 = IO CInt -> m CInt
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
forall a b. (a -> b) -> a -> b
$ Haptic -> CInt -> IO CInt
hapticSetAutocenterFFI Haptic
v1 CInt
v2
{-# INLINE hapticSetAutocenter #-}

hapticSetGain :: MonadIO m => Haptic -> CInt -> m CInt
hapticSetGain :: Haptic -> CInt -> m CInt
hapticSetGain v1 :: Haptic
v1 v2 :: CInt
v2 = IO CInt -> m CInt
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
forall a b. (a -> b) -> a -> b
$ Haptic -> CInt -> IO CInt
hapticSetGainFFI Haptic
v1 CInt
v2
{-# INLINE hapticSetGain #-}

hapticStopAll :: MonadIO m => Haptic -> m CInt
hapticStopAll :: Haptic -> m CInt
hapticStopAll v1 :: Haptic
v1 = IO CInt -> m CInt
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
forall a b. (a -> b) -> a -> b
$ Haptic -> IO CInt
hapticStopAllFFI Haptic
v1
{-# INLINE hapticStopAll #-}

hapticStopEffect :: MonadIO m => Haptic -> CInt -> m CInt
hapticStopEffect :: Haptic -> CInt -> m CInt
hapticStopEffect v1 :: Haptic
v1 v2 :: CInt
v2 = IO CInt -> m CInt
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
forall a b. (a -> b) -> a -> b
$ Haptic -> CInt -> IO CInt
hapticStopEffectFFI Haptic
v1 CInt
v2
{-# INLINE hapticStopEffect #-}

hapticUnpause :: MonadIO m => Haptic -> m CInt
hapticUnpause :: Haptic -> m CInt
hapticUnpause v1 :: Haptic
v1 = IO CInt -> m CInt
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
forall a b. (a -> b) -> a -> b
$ Haptic -> IO CInt
hapticUnpauseFFI Haptic
v1
{-# INLINE hapticUnpause #-}

hapticUpdateEffect :: MonadIO m => Haptic -> CInt -> Ptr HapticEffect -> m CInt
hapticUpdateEffect :: Haptic -> CInt -> Ptr HapticEffect -> m CInt
hapticUpdateEffect v1 :: Haptic
v1 v2 :: CInt
v2 v3 :: Ptr HapticEffect
v3 = IO CInt -> m CInt
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
forall a b. (a -> b) -> a -> b
$ Haptic -> CInt -> Ptr HapticEffect -> IO CInt
hapticUpdateEffectFFI Haptic
v1 CInt
v2 Ptr HapticEffect
v3
{-# INLINE hapticUpdateEffect #-}

joystickIsHaptic :: MonadIO m => Joystick -> m CInt
joystickIsHaptic :: Haptic -> m CInt
joystickIsHaptic v1 :: Haptic
v1 = IO CInt -> m CInt
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO CInt -> m CInt) -> IO CInt -> m CInt
forall a b. (a -> b) -> a -> b
$ Haptic -> IO CInt
joystickIsHapticFFI Haptic
v1
{-# INLINE joystickIsHaptic #-}

mouseIsHaptic :: MonadIO m => m CInt
mouseIsHaptic :: m CInt
mouseIsHaptic = IO CInt -> m CInt
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO IO CInt
mouseIsHapticFFI
{-# INLINE mouseIsHaptic #-}

numHaptics :: MonadIO m => m CInt
numHaptics :: m CInt
numHaptics = IO CInt -> m CInt
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO IO CInt
numHapticsFFI
{-# INLINE numHaptics #-}