{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UnboxedTuples #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE NoFieldSelectors #-}
{-# LANGUAGE NoImplicitPrelude #-}

-- | SDL provides a low-level joystick API, which just treats joysticks as an arbitrary pile of buttons, axes, and hat switches. If you\'re planning to write your own control configuration screen, this can give you a lot of flexibility, but that\'s a lot of work, and most things that we consider \"joysticks\" now are actually console-style gamepads. So SDL provides the gamepad API on top of the lower-level joystick functionality.
--
--     The difference between a joystick and a gamepad is that a gamepad tells you /where/ a button or axis is on the device. You don\'t speak to gamepads in terms of arbitrary numbers like \"button 3\" or \"axis 2\" but in standard locations: the d-pad, the shoulder buttons, triggers, A\/B\/X\/Y (or X\/O\/Square\/Triangle, if you will).
--
--     One turns a joystick into a gamepad by providing a magic configuration string, which tells SDL the details of a specific device: when you see this specific hardware, if button 2 gets pressed, this is actually D-Pad Up, etc.
--
--     SDL has many popular controllers configured out of the box, and users can add their own controller details through an environment variable if it\'s otherwise unknown to SDL.
--
--     In order to use these functions, SDL_Init() must have been called with the SDL_INIT_GAMEPAD flag. This causes SDL to scan the system for gamepads, and load appropriate drivers.
--
--     If you\'re using SDL gamepad support in a Steam game, you must call SteamAPI_InitEx() before calling SDL_Init().
--
--     If you would like to receive gamepad updates while the application is in the background, you should set the following hint before calling SDL_Init(): SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS
--
--     Gamepads support various optional features such as rumble, color LEDs, touchpad, gyro, etc. The support for these features varies depending on the controller and OS support available. You can check for LED and rumble capabilities at runtime by calling @SDL_GetGamepadProperties()@ and checking the various capability properties. You can check for touchpad by calling @SDL_GetNumGamepadTouchpads()@ and check for gyro and accelerometer by calling @SDL_GamepadHasSensor()@.
--
--     By default SDL will try to use the most capable driver available, but you can tune which OS drivers to use with the various joystick hints in SDL_hints.h.
--
--     Your application should always support gamepad hotplugging. On some platforms like Xbox, Steam Deck, etc., this is a requirement for certification. On other platforms, like macOS and Windows when using Windows.Gaming.Input, controllers may not be available at startup and will come in at some point after you\'ve started processing events. The structure used to identify an SDL gamepad
--
--     @since 3.2.0
module SDL3.Sys.Bindgen.Gamepad (
  SDL3.Sys.Bindgen.Gamepad.SDL_Gamepad,
  SDL3.Sys.Bindgen.Gamepad.SDL_GamepadType (..),
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_TYPE_UNKNOWN,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_TYPE_STANDARD,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_TYPE_XBOX360,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_TYPE_XBOXONE,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_TYPE_PS3,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_TYPE_PS4,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_TYPE_PS5,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_TYPE_GAMECUBE,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_TYPE_STEAM,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_TYPE_COUNT,
  SDL3.Sys.Bindgen.Gamepad.SDL_GamepadButton (..),
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_INVALID,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_SOUTH,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_EAST,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_WEST,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_NORTH,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_BACK,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_GUIDE,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_START,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_LEFT_STICK,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_RIGHT_STICK,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_LEFT_SHOULDER,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_DPAD_UP,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_DPAD_DOWN,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_DPAD_LEFT,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_DPAD_RIGHT,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_MISC1,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_LEFT_PADDLE1,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_LEFT_PADDLE2,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_TOUCHPAD,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_MISC2,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_MISC3,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_MISC4,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_MISC5,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_MISC6,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_COUNT,
  SDL3.Sys.Bindgen.Gamepad.SDL_GamepadButtonLabel (..),
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_LABEL_A,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_LABEL_B,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_LABEL_X,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_LABEL_Y,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_LABEL_CROSS,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_LABEL_CIRCLE,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_LABEL_SQUARE,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE,
  SDL3.Sys.Bindgen.Gamepad.SDL_GamepadAxis (..),
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_AXIS_INVALID,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_AXIS_LEFTX,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_AXIS_LEFTY,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_AXIS_RIGHTX,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_AXIS_RIGHTY,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_AXIS_LEFT_TRIGGER,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_AXIS_RIGHT_TRIGGER,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_AXIS_COUNT,
  SDL3.Sys.Bindgen.Gamepad.SDL_GamepadBindingType (..),
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BINDTYPE_NONE,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BINDTYPE_BUTTON,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BINDTYPE_AXIS,
  pattern SDL3.Sys.Bindgen.Gamepad.SDL_GAMEPAD_BINDTYPE_HAT,
  SDL3.Sys.Bindgen.Gamepad.SDL_GamepadBinding_input_axis (..),
  SDL3.Sys.Bindgen.Gamepad.SDL_GamepadBinding_input_hat (..),
  SDL3.Sys.Bindgen.Gamepad.SDL_GamepadBinding_input (..),
  SDL3.Sys.Bindgen.Gamepad.SDL_GamepadBinding_output_axis (..),
  SDL3.Sys.Bindgen.Gamepad.SDL_GamepadBinding_output (..),
  SDL3.Sys.Bindgen.Gamepad.SDL_GamepadBinding (..),
)
where

import Prelude (Eq, Int, Ord, Read, Show, pure, (<*>), (>>), type (~))

import HsBindgen.Runtime.CEnum qualified as CEnum
import HsBindgen.Runtime.HasCField qualified as HasCField
import HsBindgen.Runtime.Marshal qualified as Marshal
import HsBindgen.Runtime.Struct qualified as Struct
import HsBindgen.Runtime.Support qualified as BG
import HsBindgen.Runtime.Support.CompatHasField qualified as BG.CompatHasField
import HsBindgen.Runtime.Union qualified as Union

-- | [C declaration]: @struct SDL_Gamepad@, defined at @SDL3\/SDL_gamepad.h 100:16@
data SDL_Gamepad

-- | Standard gamepad types.
--
--     This type does not necessarily map to first-party controllers from Microsoft\/Sony\/Nintendo; in many cases, third-party controllers can report as these, either because they were designed for a specific console, or they simply most closely match that console\'s controllers (does it have A\/B\/X\/Y buttons or X\/O\/Square\/Triangle? Does it have a touchpad? etc).
--
--     [C declaration]: @enum SDL_GamepadType@, defined at @SDL3\/SDL_gamepad.h 111:14@
newtype SDL_GamepadType = SDL_GamepadType
  { SDL_GamepadType -> CUInt
unwrap :: BG.CUInt
  }
  deriving stock ((forall x. SDL_GamepadType -> Rep SDL_GamepadType x)
-> (forall x. Rep SDL_GamepadType x -> SDL_GamepadType)
-> Generic SDL_GamepadType
forall x. Rep SDL_GamepadType x -> SDL_GamepadType
forall x. SDL_GamepadType -> Rep SDL_GamepadType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SDL_GamepadType -> Rep SDL_GamepadType x
from :: forall x. SDL_GamepadType -> Rep SDL_GamepadType x
$cto :: forall x. Rep SDL_GamepadType x -> SDL_GamepadType
to :: forall x. Rep SDL_GamepadType x -> SDL_GamepadType
BG.Generic, SDL_GamepadType -> SDL_GamepadType -> Bool
(SDL_GamepadType -> SDL_GamepadType -> Bool)
-> (SDL_GamepadType -> SDL_GamepadType -> Bool)
-> Eq SDL_GamepadType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SDL_GamepadType -> SDL_GamepadType -> Bool
== :: SDL_GamepadType -> SDL_GamepadType -> Bool
$c/= :: SDL_GamepadType -> SDL_GamepadType -> Bool
/= :: SDL_GamepadType -> SDL_GamepadType -> Bool
Eq, Eq SDL_GamepadType
Eq SDL_GamepadType =>
(SDL_GamepadType -> SDL_GamepadType -> Ordering)
-> (SDL_GamepadType -> SDL_GamepadType -> Bool)
-> (SDL_GamepadType -> SDL_GamepadType -> Bool)
-> (SDL_GamepadType -> SDL_GamepadType -> Bool)
-> (SDL_GamepadType -> SDL_GamepadType -> Bool)
-> (SDL_GamepadType -> SDL_GamepadType -> SDL_GamepadType)
-> (SDL_GamepadType -> SDL_GamepadType -> SDL_GamepadType)
-> Ord SDL_GamepadType
SDL_GamepadType -> SDL_GamepadType -> Bool
SDL_GamepadType -> SDL_GamepadType -> Ordering
SDL_GamepadType -> SDL_GamepadType -> SDL_GamepadType
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: SDL_GamepadType -> SDL_GamepadType -> Ordering
compare :: SDL_GamepadType -> SDL_GamepadType -> Ordering
$c< :: SDL_GamepadType -> SDL_GamepadType -> Bool
< :: SDL_GamepadType -> SDL_GamepadType -> Bool
$c<= :: SDL_GamepadType -> SDL_GamepadType -> Bool
<= :: SDL_GamepadType -> SDL_GamepadType -> Bool
$c> :: SDL_GamepadType -> SDL_GamepadType -> Bool
> :: SDL_GamepadType -> SDL_GamepadType -> Bool
$c>= :: SDL_GamepadType -> SDL_GamepadType -> Bool
>= :: SDL_GamepadType -> SDL_GamepadType -> Bool
$cmax :: SDL_GamepadType -> SDL_GamepadType -> SDL_GamepadType
max :: SDL_GamepadType -> SDL_GamepadType -> SDL_GamepadType
$cmin :: SDL_GamepadType -> SDL_GamepadType -> SDL_GamepadType
min :: SDL_GamepadType -> SDL_GamepadType -> SDL_GamepadType
Ord)
  deriving newtype (FFIType SDL_GamepadType -> SDL_GamepadType
SDL_GamepadType -> FFIType SDL_GamepadType
(SDL_GamepadType -> FFIType SDL_GamepadType)
-> (FFIType SDL_GamepadType -> SDL_GamepadType)
-> HasFFIType SDL_GamepadType
forall a. (a -> FFIType a) -> (FFIType a -> a) -> HasFFIType a
$ctoFFIType :: SDL_GamepadType -> FFIType SDL_GamepadType
toFFIType :: SDL_GamepadType -> FFIType SDL_GamepadType
$cfromFFIType :: FFIType SDL_GamepadType -> SDL_GamepadType
fromFFIType :: FFIType SDL_GamepadType -> SDL_GamepadType
BG.HasFFIType)

instance Marshal.StaticSize SDL_GamepadType where
  staticSizeOf :: Proxy SDL_GamepadType -> Int
staticSizeOf = \Proxy SDL_GamepadType
_ -> (Int
4 :: Int)

  staticAlignment :: Proxy SDL_GamepadType -> Int
staticAlignment = \Proxy SDL_GamepadType
_ -> (Int
4 :: Int)

instance Marshal.ReadRaw SDL_GamepadType where
  readRaw :: Ptr SDL_GamepadType -> IO SDL_GamepadType
readRaw =
    \Ptr SDL_GamepadType
ptr0 ->
      (CUInt -> SDL_GamepadType) -> IO (CUInt -> SDL_GamepadType)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure CUInt -> SDL_GamepadType
SDL_GamepadType
        IO (CUInt -> SDL_GamepadType) -> IO CUInt -> IO SDL_GamepadType
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Ptr SDL_GamepadType -> Int -> IO CUInt
forall a b. ReadRaw a => Ptr b -> Int -> IO a
Marshal.readRawByteOff Ptr SDL_GamepadType
ptr0 (Int
0 :: Int)

instance Marshal.WriteRaw SDL_GamepadType where
  writeRaw :: Ptr SDL_GamepadType -> SDL_GamepadType -> IO ()
writeRaw =
    \Ptr SDL_GamepadType
ptr0 ->
      \SDL_GamepadType
s1 ->
        case SDL_GamepadType
s1 of
          SDL_GamepadType CUInt
unwrap2 ->
            Ptr SDL_GamepadType -> Int -> CUInt -> IO ()
forall a b. WriteRaw a => Ptr b -> Int -> a -> IO ()
Marshal.writeRawByteOff Ptr SDL_GamepadType
ptr0 (Int
0 :: Int) CUInt
unwrap2

deriving via Marshal.EquivStorable SDL_GamepadType instance BG.Storable SDL_GamepadType

deriving via BG.CUInt instance BG.Prim SDL_GamepadType

instance CEnum.CEnum SDL_GamepadType where
  type CEnumZ SDL_GamepadType = BG.CUInt

  toCEnum :: CEnumZ SDL_GamepadType -> SDL_GamepadType
toCEnum = CUInt -> SDL_GamepadType
CEnumZ SDL_GamepadType -> SDL_GamepadType
SDL_GamepadType

  fromCEnum :: SDL_GamepadType -> CEnumZ SDL_GamepadType
fromCEnum = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"unwrap"

  declaredValues :: forall (proxy :: * -> *).
proxy SDL_GamepadType -> DeclaredValues SDL_GamepadType
declaredValues =
    \proxy SDL_GamepadType
_ ->
      [(CEnumZ SDL_GamepadType, NonEmpty String)]
-> DeclaredValues SDL_GamepadType
forall a.
Ord (CEnumZ a) =>
[(CEnumZ a, NonEmpty String)] -> DeclaredValues a
CEnum.declaredValuesFromList
        [ (CUInt
CEnumZ SDL_GamepadType
0, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_TYPE_UNKNOWN")
        , (CUInt
CEnumZ SDL_GamepadType
1, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_TYPE_STANDARD")
        , (CUInt
CEnumZ SDL_GamepadType
2, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_TYPE_XBOX360")
        , (CUInt
CEnumZ SDL_GamepadType
3, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_TYPE_XBOXONE")
        , (CUInt
CEnumZ SDL_GamepadType
4, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_TYPE_PS3")
        , (CUInt
CEnumZ SDL_GamepadType
5, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_TYPE_PS4")
        , (CUInt
CEnumZ SDL_GamepadType
6, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_TYPE_PS5")
        , (CUInt
CEnumZ SDL_GamepadType
7, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO")
        , (CUInt
CEnumZ SDL_GamepadType
8, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT")
        , (CUInt
CEnumZ SDL_GamepadType
9, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT")
        , (CUInt
CEnumZ SDL_GamepadType
10, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR")
        , (CUInt
CEnumZ SDL_GamepadType
11, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_TYPE_GAMECUBE")
        , (CUInt
CEnumZ SDL_GamepadType
12, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_TYPE_STEAM")
        , (CUInt
CEnumZ SDL_GamepadType
13, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_TYPE_COUNT")
        ]

  showsUndeclared :: forall (proxy :: * -> *).
proxy SDL_GamepadType -> Int -> CEnumZ SDL_GamepadType -> ShowS
showsUndeclared =
    String
-> proxy SDL_GamepadType -> Int -> CEnumZ SDL_GamepadType -> ShowS
forall a (proxy :: * -> *).
Show (CEnumZ a) =>
String -> proxy a -> Int -> CEnumZ a -> ShowS
CEnum.showsWrappedUndeclared String
"SDL_GamepadType"

  readPrecUndeclared :: ReadPrec SDL_GamepadType
readPrecUndeclared =
    String -> ReadPrec SDL_GamepadType
forall a. (CEnum a, Read (CEnumZ a)) => String -> ReadPrec a
CEnum.readPrecWrappedUndeclared String
"SDL_GamepadType"

  isDeclared :: SDL_GamepadType -> Bool
isDeclared = SDL_GamepadType -> Bool
forall a. SequentialCEnum a => a -> Bool
CEnum.seqIsDeclared

  mkDeclared :: CEnumZ SDL_GamepadType -> Maybe SDL_GamepadType
mkDeclared = CEnumZ SDL_GamepadType -> Maybe SDL_GamepadType
forall a. SequentialCEnum a => CEnumZ a -> Maybe a
CEnum.seqMkDeclared

instance CEnum.SequentialCEnum SDL_GamepadType where
  minDeclaredValue :: SDL_GamepadType
minDeclaredValue = SDL_GamepadType
SDL_GAMEPAD_TYPE_UNKNOWN

  maxDeclaredValue :: SDL_GamepadType
maxDeclaredValue = SDL_GamepadType
SDL_GAMEPAD_TYPE_COUNT

instance Show SDL_GamepadType where
  showsPrec :: Int -> SDL_GamepadType -> ShowS
showsPrec = Int -> SDL_GamepadType -> ShowS
forall a. CEnum a => Int -> a -> ShowS
CEnum.shows

instance Read SDL_GamepadType where
  readPrec :: ReadPrec SDL_GamepadType
readPrec = ReadPrec SDL_GamepadType
forall a. CEnum a => ReadPrec a
CEnum.readPrec

  readList :: ReadS [SDL_GamepadType]
readList = ReadS [SDL_GamepadType]
forall a. Read a => ReadS [a]
BG.readListDefault

  readListPrec :: ReadPrec [SDL_GamepadType]
readListPrec = ReadPrec [SDL_GamepadType]
forall a. Read a => ReadPrec [a]
BG.readListPrecDefault

instance
  (ty ~ BG.CUInt)
  => BG.CompatHasField.HasField "unwrap" SDL_GamepadType ty
  where
  hasField :: SDL_GamepadType -> (ty -> SDL_GamepadType, ty)
hasField =
    \SDL_GamepadType
x0 ->
      ( \ty
y1 ->
          SDL_GamepadType{unwrap :: CUInt
unwrap = ty
CUInt
y1}
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"unwrap" SDL_GamepadType
x0
      )

instance
  (ty ~ BG.CUInt)
  => BG.HasField "unwrap" (BG.Ptr SDL_GamepadType) (BG.Ptr ty)
  where
  getField :: Ptr SDL_GamepadType -> Ptr ty
getField = Proxy "unwrap"
-> Ptr SDL_GamepadType -> Ptr (CFieldType SDL_GamepadType "unwrap")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"unwrap")

instance HasCField.HasCField SDL_GamepadType "unwrap" where
  type CFieldType SDL_GamepadType "unwrap" = BG.CUInt

  offset# :: Proxy# SDL_GamepadType -> Proxy# "unwrap" -> Int
offset# = \Proxy# SDL_GamepadType
_ -> \Proxy# "unwrap"
_ -> Int
0

-- | [C declaration]: @SDL_GAMEPAD_TYPE_UNKNOWN@, defined at @SDL3\/SDL_gamepad.h 113:5@
pattern SDL_GAMEPAD_TYPE_UNKNOWN :: SDL_GamepadType
pattern $mSDL_GAMEPAD_TYPE_UNKNOWN :: forall {r}. SDL_GamepadType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_TYPE_UNKNOWN :: SDL_GamepadType
SDL_GAMEPAD_TYPE_UNKNOWN = SDL_GamepadType 0

-- | [C declaration]: @SDL_GAMEPAD_TYPE_STANDARD@, defined at @SDL3\/SDL_gamepad.h 114:5@
pattern SDL_GAMEPAD_TYPE_STANDARD :: SDL_GamepadType
pattern $mSDL_GAMEPAD_TYPE_STANDARD :: forall {r}. SDL_GamepadType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_TYPE_STANDARD :: SDL_GamepadType
SDL_GAMEPAD_TYPE_STANDARD = SDL_GamepadType 1

-- | [C declaration]: @SDL_GAMEPAD_TYPE_XBOX360@, defined at @SDL3\/SDL_gamepad.h 115:5@
pattern SDL_GAMEPAD_TYPE_XBOX360 :: SDL_GamepadType
pattern $mSDL_GAMEPAD_TYPE_XBOX360 :: forall {r}. SDL_GamepadType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_TYPE_XBOX360 :: SDL_GamepadType
SDL_GAMEPAD_TYPE_XBOX360 = SDL_GamepadType 2

-- | [C declaration]: @SDL_GAMEPAD_TYPE_XBOXONE@, defined at @SDL3\/SDL_gamepad.h 116:5@
pattern SDL_GAMEPAD_TYPE_XBOXONE :: SDL_GamepadType
pattern $mSDL_GAMEPAD_TYPE_XBOXONE :: forall {r}. SDL_GamepadType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_TYPE_XBOXONE :: SDL_GamepadType
SDL_GAMEPAD_TYPE_XBOXONE = SDL_GamepadType 3

-- | [C declaration]: @SDL_GAMEPAD_TYPE_PS3@, defined at @SDL3\/SDL_gamepad.h 117:5@
pattern SDL_GAMEPAD_TYPE_PS3 :: SDL_GamepadType
pattern $mSDL_GAMEPAD_TYPE_PS3 :: forall {r}. SDL_GamepadType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_TYPE_PS3 :: SDL_GamepadType
SDL_GAMEPAD_TYPE_PS3 = SDL_GamepadType 4

-- | [C declaration]: @SDL_GAMEPAD_TYPE_PS4@, defined at @SDL3\/SDL_gamepad.h 118:5@
pattern SDL_GAMEPAD_TYPE_PS4 :: SDL_GamepadType
pattern $mSDL_GAMEPAD_TYPE_PS4 :: forall {r}. SDL_GamepadType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_TYPE_PS4 :: SDL_GamepadType
SDL_GAMEPAD_TYPE_PS4 = SDL_GamepadType 5

-- | [C declaration]: @SDL_GAMEPAD_TYPE_PS5@, defined at @SDL3\/SDL_gamepad.h 119:5@
pattern SDL_GAMEPAD_TYPE_PS5 :: SDL_GamepadType
pattern $mSDL_GAMEPAD_TYPE_PS5 :: forall {r}. SDL_GamepadType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_TYPE_PS5 :: SDL_GamepadType
SDL_GAMEPAD_TYPE_PS5 = SDL_GamepadType 6

-- | [C declaration]: @SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO@, defined at @SDL3\/SDL_gamepad.h 120:5@
pattern SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO :: SDL_GamepadType
pattern $mSDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO :: forall {r}. SDL_GamepadType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO :: SDL_GamepadType
SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_PRO = SDL_GamepadType 7

-- | [C declaration]: @SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT@, defined at @SDL3\/SDL_gamepad.h 121:5@
pattern SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT :: SDL_GamepadType
pattern $mSDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT :: forall {r}. SDL_GamepadType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT :: SDL_GamepadType
SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_LEFT = SDL_GamepadType 8

-- | [C declaration]: @SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT@, defined at @SDL3\/SDL_gamepad.h 122:5@
pattern SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT :: SDL_GamepadType
pattern $mSDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT :: forall {r}. SDL_GamepadType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT :: SDL_GamepadType
SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT = SDL_GamepadType 9

-- | [C declaration]: @SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR@, defined at @SDL3\/SDL_gamepad.h 123:5@
pattern SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR :: SDL_GamepadType
pattern $mSDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR :: forall {r}. SDL_GamepadType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR :: SDL_GamepadType
SDL_GAMEPAD_TYPE_NINTENDO_SWITCH_JOYCON_PAIR = SDL_GamepadType 10

-- | [C declaration]: @SDL_GAMEPAD_TYPE_GAMECUBE@, defined at @SDL3\/SDL_gamepad.h 124:5@
pattern SDL_GAMEPAD_TYPE_GAMECUBE :: SDL_GamepadType
pattern $mSDL_GAMEPAD_TYPE_GAMECUBE :: forall {r}. SDL_GamepadType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_TYPE_GAMECUBE :: SDL_GamepadType
SDL_GAMEPAD_TYPE_GAMECUBE = SDL_GamepadType 11

-- | [C declaration]: @SDL_GAMEPAD_TYPE_STEAM@, defined at @SDL3\/SDL_gamepad.h 125:5@
pattern SDL_GAMEPAD_TYPE_STEAM :: SDL_GamepadType
pattern $mSDL_GAMEPAD_TYPE_STEAM :: forall {r}. SDL_GamepadType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_TYPE_STEAM :: SDL_GamepadType
SDL_GAMEPAD_TYPE_STEAM = SDL_GamepadType 12

-- | [C declaration]: @SDL_GAMEPAD_TYPE_COUNT@, defined at @SDL3\/SDL_gamepad.h 126:5@
pattern SDL_GAMEPAD_TYPE_COUNT :: SDL_GamepadType
pattern $mSDL_GAMEPAD_TYPE_COUNT :: forall {r}. SDL_GamepadType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_TYPE_COUNT :: SDL_GamepadType
SDL_GAMEPAD_TYPE_COUNT = SDL_GamepadType 13

-- | The list of buttons available on a gamepad
--
--     For controllers that use a diamond pattern for the face buttons, the south\/east\/west\/north buttons below correspond to the locations in the diamond pattern. For Xbox controllers, this would be A\/B\/X\/Y, for Nintendo Switch controllers, this would be B\/A\/Y\/X, for GameCube controllers this would be A\/X\/B\/Y, for PlayStation controllers this would be Cross\/Circle\/Square\/Triangle.
--
--     For controllers that don\'t use a diamond pattern for the face buttons, the south\/east\/west\/north buttons indicate the buttons labeled A, B, C, D, or 1, 2, 3, 4, or for controllers that aren\'t labeled, they are the primary, secondary, etc. buttons.
--
--     The activate action is often the south button and the cancel action is often the east button, but in some regions this is reversed, so your game should allow remapping actions based on user preferences.
--
--     You can query the labels for the face buttons using @SDL_GetGamepadButtonLabel()@
--
--     @since 3.2.0
--
--     [C declaration]: @enum SDL_GamepadButton@, defined at @SDL3\/SDL_gamepad.h 153:14@
newtype SDL_GamepadButton = SDL_GamepadButton
  { SDL_GamepadButton -> CInt
unwrap :: BG.CInt
  }
  deriving stock ((forall x. SDL_GamepadButton -> Rep SDL_GamepadButton x)
-> (forall x. Rep SDL_GamepadButton x -> SDL_GamepadButton)
-> Generic SDL_GamepadButton
forall x. Rep SDL_GamepadButton x -> SDL_GamepadButton
forall x. SDL_GamepadButton -> Rep SDL_GamepadButton x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SDL_GamepadButton -> Rep SDL_GamepadButton x
from :: forall x. SDL_GamepadButton -> Rep SDL_GamepadButton x
$cto :: forall x. Rep SDL_GamepadButton x -> SDL_GamepadButton
to :: forall x. Rep SDL_GamepadButton x -> SDL_GamepadButton
BG.Generic, SDL_GamepadButton -> SDL_GamepadButton -> Bool
(SDL_GamepadButton -> SDL_GamepadButton -> Bool)
-> (SDL_GamepadButton -> SDL_GamepadButton -> Bool)
-> Eq SDL_GamepadButton
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SDL_GamepadButton -> SDL_GamepadButton -> Bool
== :: SDL_GamepadButton -> SDL_GamepadButton -> Bool
$c/= :: SDL_GamepadButton -> SDL_GamepadButton -> Bool
/= :: SDL_GamepadButton -> SDL_GamepadButton -> Bool
Eq, Eq SDL_GamepadButton
Eq SDL_GamepadButton =>
(SDL_GamepadButton -> SDL_GamepadButton -> Ordering)
-> (SDL_GamepadButton -> SDL_GamepadButton -> Bool)
-> (SDL_GamepadButton -> SDL_GamepadButton -> Bool)
-> (SDL_GamepadButton -> SDL_GamepadButton -> Bool)
-> (SDL_GamepadButton -> SDL_GamepadButton -> Bool)
-> (SDL_GamepadButton -> SDL_GamepadButton -> SDL_GamepadButton)
-> (SDL_GamepadButton -> SDL_GamepadButton -> SDL_GamepadButton)
-> Ord SDL_GamepadButton
SDL_GamepadButton -> SDL_GamepadButton -> Bool
SDL_GamepadButton -> SDL_GamepadButton -> Ordering
SDL_GamepadButton -> SDL_GamepadButton -> SDL_GamepadButton
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: SDL_GamepadButton -> SDL_GamepadButton -> Ordering
compare :: SDL_GamepadButton -> SDL_GamepadButton -> Ordering
$c< :: SDL_GamepadButton -> SDL_GamepadButton -> Bool
< :: SDL_GamepadButton -> SDL_GamepadButton -> Bool
$c<= :: SDL_GamepadButton -> SDL_GamepadButton -> Bool
<= :: SDL_GamepadButton -> SDL_GamepadButton -> Bool
$c> :: SDL_GamepadButton -> SDL_GamepadButton -> Bool
> :: SDL_GamepadButton -> SDL_GamepadButton -> Bool
$c>= :: SDL_GamepadButton -> SDL_GamepadButton -> Bool
>= :: SDL_GamepadButton -> SDL_GamepadButton -> Bool
$cmax :: SDL_GamepadButton -> SDL_GamepadButton -> SDL_GamepadButton
max :: SDL_GamepadButton -> SDL_GamepadButton -> SDL_GamepadButton
$cmin :: SDL_GamepadButton -> SDL_GamepadButton -> SDL_GamepadButton
min :: SDL_GamepadButton -> SDL_GamepadButton -> SDL_GamepadButton
Ord)
  deriving newtype (FFIType SDL_GamepadButton -> SDL_GamepadButton
SDL_GamepadButton -> FFIType SDL_GamepadButton
(SDL_GamepadButton -> FFIType SDL_GamepadButton)
-> (FFIType SDL_GamepadButton -> SDL_GamepadButton)
-> HasFFIType SDL_GamepadButton
forall a. (a -> FFIType a) -> (FFIType a -> a) -> HasFFIType a
$ctoFFIType :: SDL_GamepadButton -> FFIType SDL_GamepadButton
toFFIType :: SDL_GamepadButton -> FFIType SDL_GamepadButton
$cfromFFIType :: FFIType SDL_GamepadButton -> SDL_GamepadButton
fromFFIType :: FFIType SDL_GamepadButton -> SDL_GamepadButton
BG.HasFFIType)

instance Marshal.StaticSize SDL_GamepadButton where
  staticSizeOf :: Proxy SDL_GamepadButton -> Int
staticSizeOf = \Proxy SDL_GamepadButton
_ -> (Int
4 :: Int)

  staticAlignment :: Proxy SDL_GamepadButton -> Int
staticAlignment = \Proxy SDL_GamepadButton
_ -> (Int
4 :: Int)

instance Marshal.ReadRaw SDL_GamepadButton where
  readRaw :: Ptr SDL_GamepadButton -> IO SDL_GamepadButton
readRaw =
    \Ptr SDL_GamepadButton
ptr0 ->
      (CInt -> SDL_GamepadButton) -> IO (CInt -> SDL_GamepadButton)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure CInt -> SDL_GamepadButton
SDL_GamepadButton
        IO (CInt -> SDL_GamepadButton) -> IO CInt -> IO SDL_GamepadButton
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Ptr SDL_GamepadButton -> Int -> IO CInt
forall a b. ReadRaw a => Ptr b -> Int -> IO a
Marshal.readRawByteOff Ptr SDL_GamepadButton
ptr0 (Int
0 :: Int)

instance Marshal.WriteRaw SDL_GamepadButton where
  writeRaw :: Ptr SDL_GamepadButton -> SDL_GamepadButton -> IO ()
writeRaw =
    \Ptr SDL_GamepadButton
ptr0 ->
      \SDL_GamepadButton
s1 ->
        case SDL_GamepadButton
s1 of
          SDL_GamepadButton CInt
unwrap2 ->
            Ptr SDL_GamepadButton -> Int -> CInt -> IO ()
forall a b. WriteRaw a => Ptr b -> Int -> a -> IO ()
Marshal.writeRawByteOff Ptr SDL_GamepadButton
ptr0 (Int
0 :: Int) CInt
unwrap2

deriving via Marshal.EquivStorable SDL_GamepadButton instance BG.Storable SDL_GamepadButton

deriving via BG.CInt instance BG.Prim SDL_GamepadButton

instance CEnum.CEnum SDL_GamepadButton where
  type CEnumZ SDL_GamepadButton = BG.CInt

  toCEnum :: CEnumZ SDL_GamepadButton -> SDL_GamepadButton
toCEnum = CInt -> SDL_GamepadButton
CEnumZ SDL_GamepadButton -> SDL_GamepadButton
SDL_GamepadButton

  fromCEnum :: SDL_GamepadButton -> CEnumZ SDL_GamepadButton
fromCEnum = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"unwrap"

  declaredValues :: forall (proxy :: * -> *).
proxy SDL_GamepadButton -> DeclaredValues SDL_GamepadButton
declaredValues =
    \proxy SDL_GamepadButton
_ ->
      [(CEnumZ SDL_GamepadButton, NonEmpty String)]
-> DeclaredValues SDL_GamepadButton
forall a.
Ord (CEnumZ a) =>
[(CEnumZ a, NonEmpty String)] -> DeclaredValues a
CEnum.declaredValuesFromList
        [ (-CInt
1, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_INVALID")
        , (CInt
CEnumZ SDL_GamepadButton
0, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_SOUTH")
        , (CInt
CEnumZ SDL_GamepadButton
1, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_EAST")
        , (CInt
CEnumZ SDL_GamepadButton
2, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_WEST")
        , (CInt
CEnumZ SDL_GamepadButton
3, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_NORTH")
        , (CInt
CEnumZ SDL_GamepadButton
4, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_BACK")
        , (CInt
CEnumZ SDL_GamepadButton
5, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_GUIDE")
        , (CInt
CEnumZ SDL_GamepadButton
6, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_START")
        , (CInt
CEnumZ SDL_GamepadButton
7, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_LEFT_STICK")
        , (CInt
CEnumZ SDL_GamepadButton
8, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_RIGHT_STICK")
        , (CInt
CEnumZ SDL_GamepadButton
9, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_LEFT_SHOULDER")
        , (CInt
CEnumZ SDL_GamepadButton
10, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER")
        , (CInt
CEnumZ SDL_GamepadButton
11, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_DPAD_UP")
        , (CInt
CEnumZ SDL_GamepadButton
12, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_DPAD_DOWN")
        , (CInt
CEnumZ SDL_GamepadButton
13, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_DPAD_LEFT")
        , (CInt
CEnumZ SDL_GamepadButton
14, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_DPAD_RIGHT")
        , (CInt
CEnumZ SDL_GamepadButton
15, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_MISC1")
        , (CInt
CEnumZ SDL_GamepadButton
16, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1")
        , (CInt
CEnumZ SDL_GamepadButton
17, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_LEFT_PADDLE1")
        , (CInt
CEnumZ SDL_GamepadButton
18, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2")
        , (CInt
CEnumZ SDL_GamepadButton
19, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_LEFT_PADDLE2")
        , (CInt
CEnumZ SDL_GamepadButton
20, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_TOUCHPAD")
        , (CInt
CEnumZ SDL_GamepadButton
21, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_MISC2")
        , (CInt
CEnumZ SDL_GamepadButton
22, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_MISC3")
        , (CInt
CEnumZ SDL_GamepadButton
23, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_MISC4")
        , (CInt
CEnumZ SDL_GamepadButton
24, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_MISC5")
        , (CInt
CEnumZ SDL_GamepadButton
25, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_MISC6")
        , (CInt
CEnumZ SDL_GamepadButton
26, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_COUNT")
        ]

  showsUndeclared :: forall (proxy :: * -> *).
proxy SDL_GamepadButton -> Int -> CEnumZ SDL_GamepadButton -> ShowS
showsUndeclared =
    String
-> proxy SDL_GamepadButton
-> Int
-> CEnumZ SDL_GamepadButton
-> ShowS
forall a (proxy :: * -> *).
Show (CEnumZ a) =>
String -> proxy a -> Int -> CEnumZ a -> ShowS
CEnum.showsWrappedUndeclared String
"SDL_GamepadButton"

  readPrecUndeclared :: ReadPrec SDL_GamepadButton
readPrecUndeclared =
    String -> ReadPrec SDL_GamepadButton
forall a. (CEnum a, Read (CEnumZ a)) => String -> ReadPrec a
CEnum.readPrecWrappedUndeclared String
"SDL_GamepadButton"

  isDeclared :: SDL_GamepadButton -> Bool
isDeclared = SDL_GamepadButton -> Bool
forall a. SequentialCEnum a => a -> Bool
CEnum.seqIsDeclared

  mkDeclared :: CEnumZ SDL_GamepadButton -> Maybe SDL_GamepadButton
mkDeclared = CEnumZ SDL_GamepadButton -> Maybe SDL_GamepadButton
forall a. SequentialCEnum a => CEnumZ a -> Maybe a
CEnum.seqMkDeclared

instance CEnum.SequentialCEnum SDL_GamepadButton where
  minDeclaredValue :: SDL_GamepadButton
minDeclaredValue = SDL_GamepadButton
SDL_GAMEPAD_BUTTON_INVALID

  maxDeclaredValue :: SDL_GamepadButton
maxDeclaredValue = SDL_GamepadButton
SDL_GAMEPAD_BUTTON_COUNT

instance Show SDL_GamepadButton where
  showsPrec :: Int -> SDL_GamepadButton -> ShowS
showsPrec = Int -> SDL_GamepadButton -> ShowS
forall a. CEnum a => Int -> a -> ShowS
CEnum.shows

instance Read SDL_GamepadButton where
  readPrec :: ReadPrec SDL_GamepadButton
readPrec = ReadPrec SDL_GamepadButton
forall a. CEnum a => ReadPrec a
CEnum.readPrec

  readList :: ReadS [SDL_GamepadButton]
readList = ReadS [SDL_GamepadButton]
forall a. Read a => ReadS [a]
BG.readListDefault

  readListPrec :: ReadPrec [SDL_GamepadButton]
readListPrec = ReadPrec [SDL_GamepadButton]
forall a. Read a => ReadPrec [a]
BG.readListPrecDefault

instance
  (ty ~ BG.CInt)
  => BG.CompatHasField.HasField "unwrap" SDL_GamepadButton ty
  where
  hasField :: SDL_GamepadButton -> (ty -> SDL_GamepadButton, ty)
hasField =
    \SDL_GamepadButton
x0 ->
      ( \ty
y1 ->
          SDL_GamepadButton{unwrap :: CInt
unwrap = ty
CInt
y1}
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"unwrap" SDL_GamepadButton
x0
      )

instance
  (ty ~ BG.CInt)
  => BG.HasField "unwrap" (BG.Ptr SDL_GamepadButton) (BG.Ptr ty)
  where
  getField :: Ptr SDL_GamepadButton -> Ptr ty
getField = Proxy "unwrap"
-> Ptr SDL_GamepadButton
-> Ptr (CFieldType SDL_GamepadButton "unwrap")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"unwrap")

instance HasCField.HasCField SDL_GamepadButton "unwrap" where
  type CFieldType SDL_GamepadButton "unwrap" = BG.CInt

  offset# :: Proxy# SDL_GamepadButton -> Proxy# "unwrap" -> Int
offset# = \Proxy# SDL_GamepadButton
_ -> \Proxy# "unwrap"
_ -> Int
0

-- | [C declaration]: @SDL_GAMEPAD_BUTTON_INVALID@, defined at @SDL3\/SDL_gamepad.h 155:5@
pattern SDL_GAMEPAD_BUTTON_INVALID :: SDL_GamepadButton
pattern $mSDL_GAMEPAD_BUTTON_INVALID :: forall {r}. SDL_GamepadButton -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_INVALID :: SDL_GamepadButton
SDL_GAMEPAD_BUTTON_INVALID = SDL_GamepadButton (-1)

-- | Bottom face button (e.g. Xbox A button)
--
--     [C declaration]: @SDL_GAMEPAD_BUTTON_SOUTH@, defined at @SDL3\/SDL_gamepad.h 156:5@
pattern SDL_GAMEPAD_BUTTON_SOUTH :: SDL_GamepadButton
pattern $mSDL_GAMEPAD_BUTTON_SOUTH :: forall {r}. SDL_GamepadButton -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_SOUTH :: SDL_GamepadButton
SDL_GAMEPAD_BUTTON_SOUTH = SDL_GamepadButton 0

-- | Right face button (e.g. Xbox B button)
--
--     [C declaration]: @SDL_GAMEPAD_BUTTON_EAST@, defined at @SDL3\/SDL_gamepad.h 157:5@
pattern SDL_GAMEPAD_BUTTON_EAST :: SDL_GamepadButton
pattern $mSDL_GAMEPAD_BUTTON_EAST :: forall {r}. SDL_GamepadButton -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_EAST :: SDL_GamepadButton
SDL_GAMEPAD_BUTTON_EAST = SDL_GamepadButton 1

-- | Left face button (e.g. Xbox X button)
--
--     [C declaration]: @SDL_GAMEPAD_BUTTON_WEST@, defined at @SDL3\/SDL_gamepad.h 158:5@
pattern SDL_GAMEPAD_BUTTON_WEST :: SDL_GamepadButton
pattern $mSDL_GAMEPAD_BUTTON_WEST :: forall {r}. SDL_GamepadButton -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_WEST :: SDL_GamepadButton
SDL_GAMEPAD_BUTTON_WEST = SDL_GamepadButton 2

-- | Top face button (e.g. Xbox Y button)
--
--     [C declaration]: @SDL_GAMEPAD_BUTTON_NORTH@, defined at @SDL3\/SDL_gamepad.h 159:5@
pattern SDL_GAMEPAD_BUTTON_NORTH :: SDL_GamepadButton
pattern $mSDL_GAMEPAD_BUTTON_NORTH :: forall {r}. SDL_GamepadButton -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_NORTH :: SDL_GamepadButton
SDL_GAMEPAD_BUTTON_NORTH = SDL_GamepadButton 3

-- | [C declaration]: @SDL_GAMEPAD_BUTTON_BACK@, defined at @SDL3\/SDL_gamepad.h 160:5@
pattern SDL_GAMEPAD_BUTTON_BACK :: SDL_GamepadButton
pattern $mSDL_GAMEPAD_BUTTON_BACK :: forall {r}. SDL_GamepadButton -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_BACK :: SDL_GamepadButton
SDL_GAMEPAD_BUTTON_BACK = SDL_GamepadButton 4

-- | [C declaration]: @SDL_GAMEPAD_BUTTON_GUIDE@, defined at @SDL3\/SDL_gamepad.h 161:5@
pattern SDL_GAMEPAD_BUTTON_GUIDE :: SDL_GamepadButton
pattern $mSDL_GAMEPAD_BUTTON_GUIDE :: forall {r}. SDL_GamepadButton -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_GUIDE :: SDL_GamepadButton
SDL_GAMEPAD_BUTTON_GUIDE = SDL_GamepadButton 5

-- | [C declaration]: @SDL_GAMEPAD_BUTTON_START@, defined at @SDL3\/SDL_gamepad.h 162:5@
pattern SDL_GAMEPAD_BUTTON_START :: SDL_GamepadButton
pattern $mSDL_GAMEPAD_BUTTON_START :: forall {r}. SDL_GamepadButton -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_START :: SDL_GamepadButton
SDL_GAMEPAD_BUTTON_START = SDL_GamepadButton 6

-- | [C declaration]: @SDL_GAMEPAD_BUTTON_LEFT_STICK@, defined at @SDL3\/SDL_gamepad.h 163:5@
pattern SDL_GAMEPAD_BUTTON_LEFT_STICK :: SDL_GamepadButton
pattern $mSDL_GAMEPAD_BUTTON_LEFT_STICK :: forall {r}. SDL_GamepadButton -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_LEFT_STICK :: SDL_GamepadButton
SDL_GAMEPAD_BUTTON_LEFT_STICK = SDL_GamepadButton 7

-- | [C declaration]: @SDL_GAMEPAD_BUTTON_RIGHT_STICK@, defined at @SDL3\/SDL_gamepad.h 164:5@
pattern SDL_GAMEPAD_BUTTON_RIGHT_STICK :: SDL_GamepadButton
pattern $mSDL_GAMEPAD_BUTTON_RIGHT_STICK :: forall {r}. SDL_GamepadButton -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_RIGHT_STICK :: SDL_GamepadButton
SDL_GAMEPAD_BUTTON_RIGHT_STICK = SDL_GamepadButton 8

-- | [C declaration]: @SDL_GAMEPAD_BUTTON_LEFT_SHOULDER@, defined at @SDL3\/SDL_gamepad.h 165:5@
pattern SDL_GAMEPAD_BUTTON_LEFT_SHOULDER :: SDL_GamepadButton
pattern $mSDL_GAMEPAD_BUTTON_LEFT_SHOULDER :: forall {r}. SDL_GamepadButton -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_LEFT_SHOULDER :: SDL_GamepadButton
SDL_GAMEPAD_BUTTON_LEFT_SHOULDER = SDL_GamepadButton 9

-- | [C declaration]: @SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER@, defined at @SDL3\/SDL_gamepad.h 166:5@
pattern SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER :: SDL_GamepadButton
pattern $mSDL_GAMEPAD_BUTTON_RIGHT_SHOULDER :: forall {r}. SDL_GamepadButton -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_RIGHT_SHOULDER :: SDL_GamepadButton
SDL_GAMEPAD_BUTTON_RIGHT_SHOULDER = SDL_GamepadButton 10

-- | [C declaration]: @SDL_GAMEPAD_BUTTON_DPAD_UP@, defined at @SDL3\/SDL_gamepad.h 167:5@
pattern SDL_GAMEPAD_BUTTON_DPAD_UP :: SDL_GamepadButton
pattern $mSDL_GAMEPAD_BUTTON_DPAD_UP :: forall {r}. SDL_GamepadButton -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_DPAD_UP :: SDL_GamepadButton
SDL_GAMEPAD_BUTTON_DPAD_UP = SDL_GamepadButton 11

-- | [C declaration]: @SDL_GAMEPAD_BUTTON_DPAD_DOWN@, defined at @SDL3\/SDL_gamepad.h 168:5@
pattern SDL_GAMEPAD_BUTTON_DPAD_DOWN :: SDL_GamepadButton
pattern $mSDL_GAMEPAD_BUTTON_DPAD_DOWN :: forall {r}. SDL_GamepadButton -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_DPAD_DOWN :: SDL_GamepadButton
SDL_GAMEPAD_BUTTON_DPAD_DOWN = SDL_GamepadButton 12

-- | [C declaration]: @SDL_GAMEPAD_BUTTON_DPAD_LEFT@, defined at @SDL3\/SDL_gamepad.h 169:5@
pattern SDL_GAMEPAD_BUTTON_DPAD_LEFT :: SDL_GamepadButton
pattern $mSDL_GAMEPAD_BUTTON_DPAD_LEFT :: forall {r}. SDL_GamepadButton -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_DPAD_LEFT :: SDL_GamepadButton
SDL_GAMEPAD_BUTTON_DPAD_LEFT = SDL_GamepadButton 13

-- | [C declaration]: @SDL_GAMEPAD_BUTTON_DPAD_RIGHT@, defined at @SDL3\/SDL_gamepad.h 170:5@
pattern SDL_GAMEPAD_BUTTON_DPAD_RIGHT :: SDL_GamepadButton
pattern $mSDL_GAMEPAD_BUTTON_DPAD_RIGHT :: forall {r}. SDL_GamepadButton -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_DPAD_RIGHT :: SDL_GamepadButton
SDL_GAMEPAD_BUTTON_DPAD_RIGHT = SDL_GamepadButton 14

-- | Additional button (e.g. Xbox Series X share button, PS5 microphone button, Nintendo Switch Pro capture button, Steam Controller QAM button, Amazon Luna microphone button, Google Stadia capture button)
--
--     [C declaration]: @SDL_GAMEPAD_BUTTON_MISC1@, defined at @SDL3\/SDL_gamepad.h 171:5@
pattern SDL_GAMEPAD_BUTTON_MISC1 :: SDL_GamepadButton
pattern $mSDL_GAMEPAD_BUTTON_MISC1 :: forall {r}. SDL_GamepadButton -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_MISC1 :: SDL_GamepadButton
SDL_GAMEPAD_BUTTON_MISC1 = SDL_GamepadButton 15

-- | Upper or primary paddle, under your right hand (e.g. Xbox Elite paddle P1, DualSense Edge RB button, Right Joy-Con SR button, Steam Controller R4 button)
--
--     [C declaration]: @SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1@, defined at @SDL3\/SDL_gamepad.h 172:5@
pattern SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1 :: SDL_GamepadButton
pattern $mSDL_GAMEPAD_BUTTON_RIGHT_PADDLE1 :: forall {r}. SDL_GamepadButton -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_RIGHT_PADDLE1 :: SDL_GamepadButton
SDL_GAMEPAD_BUTTON_RIGHT_PADDLE1 = SDL_GamepadButton 16

-- | Upper or primary paddle, under your left hand (e.g. Xbox Elite paddle P3, DualSense Edge LB button, Left Joy-Con SL button, Steam Controller L4 button)
--
--     [C declaration]: @SDL_GAMEPAD_BUTTON_LEFT_PADDLE1@, defined at @SDL3\/SDL_gamepad.h 173:5@
pattern SDL_GAMEPAD_BUTTON_LEFT_PADDLE1 :: SDL_GamepadButton
pattern $mSDL_GAMEPAD_BUTTON_LEFT_PADDLE1 :: forall {r}. SDL_GamepadButton -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_LEFT_PADDLE1 :: SDL_GamepadButton
SDL_GAMEPAD_BUTTON_LEFT_PADDLE1 = SDL_GamepadButton 17

-- | Lower or secondary paddle, under your right hand (e.g. Xbox Elite paddle P2, DualSense Edge right Fn button, Right Joy-Con SL button, Steam Controller R5 button)
--
--     [C declaration]: @SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2@, defined at @SDL3\/SDL_gamepad.h 174:5@
pattern SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2 :: SDL_GamepadButton
pattern $mSDL_GAMEPAD_BUTTON_RIGHT_PADDLE2 :: forall {r}. SDL_GamepadButton -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_RIGHT_PADDLE2 :: SDL_GamepadButton
SDL_GAMEPAD_BUTTON_RIGHT_PADDLE2 = SDL_GamepadButton 18

-- | Lower or secondary paddle, under your left hand (e.g. Xbox Elite paddle P4, DualSense Edge left Fn button, Left Joy-Con SR button, Steam Controller L5 button)
--
--     [C declaration]: @SDL_GAMEPAD_BUTTON_LEFT_PADDLE2@, defined at @SDL3\/SDL_gamepad.h 175:5@
pattern SDL_GAMEPAD_BUTTON_LEFT_PADDLE2 :: SDL_GamepadButton
pattern $mSDL_GAMEPAD_BUTTON_LEFT_PADDLE2 :: forall {r}. SDL_GamepadButton -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_LEFT_PADDLE2 :: SDL_GamepadButton
SDL_GAMEPAD_BUTTON_LEFT_PADDLE2 = SDL_GamepadButton 19

-- | PS4\/PS5 touchpad button
--
--     [C declaration]: @SDL_GAMEPAD_BUTTON_TOUCHPAD@, defined at @SDL3\/SDL_gamepad.h 176:5@
pattern SDL_GAMEPAD_BUTTON_TOUCHPAD :: SDL_GamepadButton
pattern $mSDL_GAMEPAD_BUTTON_TOUCHPAD :: forall {r}. SDL_GamepadButton -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_TOUCHPAD :: SDL_GamepadButton
SDL_GAMEPAD_BUTTON_TOUCHPAD = SDL_GamepadButton 20

-- | Additional button
--
--     [C declaration]: @SDL_GAMEPAD_BUTTON_MISC2@, defined at @SDL3\/SDL_gamepad.h 177:5@
pattern SDL_GAMEPAD_BUTTON_MISC2 :: SDL_GamepadButton
pattern $mSDL_GAMEPAD_BUTTON_MISC2 :: forall {r}. SDL_GamepadButton -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_MISC2 :: SDL_GamepadButton
SDL_GAMEPAD_BUTTON_MISC2 = SDL_GamepadButton 21

-- | Additional button (e.g. Nintendo GameCube left trigger click)
--
--     [C declaration]: @SDL_GAMEPAD_BUTTON_MISC3@, defined at @SDL3\/SDL_gamepad.h 178:5@
pattern SDL_GAMEPAD_BUTTON_MISC3 :: SDL_GamepadButton
pattern $mSDL_GAMEPAD_BUTTON_MISC3 :: forall {r}. SDL_GamepadButton -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_MISC3 :: SDL_GamepadButton
SDL_GAMEPAD_BUTTON_MISC3 = SDL_GamepadButton 22

-- | Additional button (e.g. Nintendo GameCube right trigger click)
--
--     [C declaration]: @SDL_GAMEPAD_BUTTON_MISC4@, defined at @SDL3\/SDL_gamepad.h 179:5@
pattern SDL_GAMEPAD_BUTTON_MISC4 :: SDL_GamepadButton
pattern $mSDL_GAMEPAD_BUTTON_MISC4 :: forall {r}. SDL_GamepadButton -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_MISC4 :: SDL_GamepadButton
SDL_GAMEPAD_BUTTON_MISC4 = SDL_GamepadButton 23

-- | Additional button
--
--     [C declaration]: @SDL_GAMEPAD_BUTTON_MISC5@, defined at @SDL3\/SDL_gamepad.h 180:5@
pattern SDL_GAMEPAD_BUTTON_MISC5 :: SDL_GamepadButton
pattern $mSDL_GAMEPAD_BUTTON_MISC5 :: forall {r}. SDL_GamepadButton -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_MISC5 :: SDL_GamepadButton
SDL_GAMEPAD_BUTTON_MISC5 = SDL_GamepadButton 24

-- | Additional button
--
--     [C declaration]: @SDL_GAMEPAD_BUTTON_MISC6@, defined at @SDL3\/SDL_gamepad.h 181:5@
pattern SDL_GAMEPAD_BUTTON_MISC6 :: SDL_GamepadButton
pattern $mSDL_GAMEPAD_BUTTON_MISC6 :: forall {r}. SDL_GamepadButton -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_MISC6 :: SDL_GamepadButton
SDL_GAMEPAD_BUTTON_MISC6 = SDL_GamepadButton 25

-- | [C declaration]: @SDL_GAMEPAD_BUTTON_COUNT@, defined at @SDL3\/SDL_gamepad.h 182:5@
pattern SDL_GAMEPAD_BUTTON_COUNT :: SDL_GamepadButton
pattern $mSDL_GAMEPAD_BUTTON_COUNT :: forall {r}. SDL_GamepadButton -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_COUNT :: SDL_GamepadButton
SDL_GAMEPAD_BUTTON_COUNT = SDL_GamepadButton 26

-- | The set of gamepad button labels
--
--     This isn\'t a complete set, just the face buttons to make it easy to show button prompts.
--
--     For a complete set, you should look at the button and gamepad type and have a set of symbols that work well with your art style.
--
--     @since 3.2.0
--
--     [C declaration]: @enum SDL_GamepadButtonLabel@, defined at @SDL3\/SDL_gamepad.h 196:14@
newtype SDL_GamepadButtonLabel = SDL_GamepadButtonLabel
  { SDL_GamepadButtonLabel -> CUInt
unwrap :: BG.CUInt
  }
  deriving stock ((forall x. SDL_GamepadButtonLabel -> Rep SDL_GamepadButtonLabel x)
-> (forall x.
    Rep SDL_GamepadButtonLabel x -> SDL_GamepadButtonLabel)
-> Generic SDL_GamepadButtonLabel
forall x. Rep SDL_GamepadButtonLabel x -> SDL_GamepadButtonLabel
forall x. SDL_GamepadButtonLabel -> Rep SDL_GamepadButtonLabel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SDL_GamepadButtonLabel -> Rep SDL_GamepadButtonLabel x
from :: forall x. SDL_GamepadButtonLabel -> Rep SDL_GamepadButtonLabel x
$cto :: forall x. Rep SDL_GamepadButtonLabel x -> SDL_GamepadButtonLabel
to :: forall x. Rep SDL_GamepadButtonLabel x -> SDL_GamepadButtonLabel
BG.Generic, SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel -> Bool
(SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel -> Bool)
-> (SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel -> Bool)
-> Eq SDL_GamepadButtonLabel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel -> Bool
== :: SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel -> Bool
$c/= :: SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel -> Bool
/= :: SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel -> Bool
Eq, Eq SDL_GamepadButtonLabel
Eq SDL_GamepadButtonLabel =>
(SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel -> Ordering)
-> (SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel -> Bool)
-> (SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel -> Bool)
-> (SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel -> Bool)
-> (SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel -> Bool)
-> (SDL_GamepadButtonLabel
    -> SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel)
-> (SDL_GamepadButtonLabel
    -> SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel)
-> Ord SDL_GamepadButtonLabel
SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel -> Bool
SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel -> Ordering
SDL_GamepadButtonLabel
-> SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel -> Ordering
compare :: SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel -> Ordering
$c< :: SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel -> Bool
< :: SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel -> Bool
$c<= :: SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel -> Bool
<= :: SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel -> Bool
$c> :: SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel -> Bool
> :: SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel -> Bool
$c>= :: SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel -> Bool
>= :: SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel -> Bool
$cmax :: SDL_GamepadButtonLabel
-> SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel
max :: SDL_GamepadButtonLabel
-> SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel
$cmin :: SDL_GamepadButtonLabel
-> SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel
min :: SDL_GamepadButtonLabel
-> SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel
Ord)
  deriving newtype (FFIType SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel
SDL_GamepadButtonLabel -> FFIType SDL_GamepadButtonLabel
(SDL_GamepadButtonLabel -> FFIType SDL_GamepadButtonLabel)
-> (FFIType SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel)
-> HasFFIType SDL_GamepadButtonLabel
forall a. (a -> FFIType a) -> (FFIType a -> a) -> HasFFIType a
$ctoFFIType :: SDL_GamepadButtonLabel -> FFIType SDL_GamepadButtonLabel
toFFIType :: SDL_GamepadButtonLabel -> FFIType SDL_GamepadButtonLabel
$cfromFFIType :: FFIType SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel
fromFFIType :: FFIType SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel
BG.HasFFIType)

instance Marshal.StaticSize SDL_GamepadButtonLabel where
  staticSizeOf :: Proxy SDL_GamepadButtonLabel -> Int
staticSizeOf = \Proxy SDL_GamepadButtonLabel
_ -> (Int
4 :: Int)

  staticAlignment :: Proxy SDL_GamepadButtonLabel -> Int
staticAlignment = \Proxy SDL_GamepadButtonLabel
_ -> (Int
4 :: Int)

instance Marshal.ReadRaw SDL_GamepadButtonLabel where
  readRaw :: Ptr SDL_GamepadButtonLabel -> IO SDL_GamepadButtonLabel
readRaw =
    \Ptr SDL_GamepadButtonLabel
ptr0 ->
      (CUInt -> SDL_GamepadButtonLabel)
-> IO (CUInt -> SDL_GamepadButtonLabel)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure CUInt -> SDL_GamepadButtonLabel
SDL_GamepadButtonLabel
        IO (CUInt -> SDL_GamepadButtonLabel)
-> IO CUInt -> IO SDL_GamepadButtonLabel
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Ptr SDL_GamepadButtonLabel -> Int -> IO CUInt
forall a b. ReadRaw a => Ptr b -> Int -> IO a
Marshal.readRawByteOff Ptr SDL_GamepadButtonLabel
ptr0 (Int
0 :: Int)

instance Marshal.WriteRaw SDL_GamepadButtonLabel where
  writeRaw :: Ptr SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel -> IO ()
writeRaw =
    \Ptr SDL_GamepadButtonLabel
ptr0 ->
      \SDL_GamepadButtonLabel
s1 ->
        case SDL_GamepadButtonLabel
s1 of
          SDL_GamepadButtonLabel CUInt
unwrap2 ->
            Ptr SDL_GamepadButtonLabel -> Int -> CUInt -> IO ()
forall a b. WriteRaw a => Ptr b -> Int -> a -> IO ()
Marshal.writeRawByteOff Ptr SDL_GamepadButtonLabel
ptr0 (Int
0 :: Int) CUInt
unwrap2

deriving via
  Marshal.EquivStorable SDL_GamepadButtonLabel
  instance
    BG.Storable SDL_GamepadButtonLabel

deriving via BG.CUInt instance BG.Prim SDL_GamepadButtonLabel

instance CEnum.CEnum SDL_GamepadButtonLabel where
  type CEnumZ SDL_GamepadButtonLabel = BG.CUInt

  toCEnum :: CEnumZ SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel
toCEnum = CUInt -> SDL_GamepadButtonLabel
CEnumZ SDL_GamepadButtonLabel -> SDL_GamepadButtonLabel
SDL_GamepadButtonLabel

  fromCEnum :: SDL_GamepadButtonLabel -> CEnumZ SDL_GamepadButtonLabel
fromCEnum = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"unwrap"

  declaredValues :: forall (proxy :: * -> *).
proxy SDL_GamepadButtonLabel
-> DeclaredValues SDL_GamepadButtonLabel
declaredValues =
    \proxy SDL_GamepadButtonLabel
_ ->
      [(CEnumZ SDL_GamepadButtonLabel, NonEmpty String)]
-> DeclaredValues SDL_GamepadButtonLabel
forall a.
Ord (CEnumZ a) =>
[(CEnumZ a, NonEmpty String)] -> DeclaredValues a
CEnum.declaredValuesFromList
        [ (CUInt
CEnumZ SDL_GamepadButtonLabel
0, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN")
        , (CUInt
CEnumZ SDL_GamepadButtonLabel
1, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_LABEL_A")
        , (CUInt
CEnumZ SDL_GamepadButtonLabel
2, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_LABEL_B")
        , (CUInt
CEnumZ SDL_GamepadButtonLabel
3, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_LABEL_X")
        , (CUInt
CEnumZ SDL_GamepadButtonLabel
4, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_LABEL_Y")
        , (CUInt
CEnumZ SDL_GamepadButtonLabel
5, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_LABEL_CROSS")
        , (CUInt
CEnumZ SDL_GamepadButtonLabel
6, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_LABEL_CIRCLE")
        , (CUInt
CEnumZ SDL_GamepadButtonLabel
7, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_LABEL_SQUARE")
        , (CUInt
CEnumZ SDL_GamepadButtonLabel
8, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE")
        ]

  showsUndeclared :: forall (proxy :: * -> *).
proxy SDL_GamepadButtonLabel
-> Int -> CEnumZ SDL_GamepadButtonLabel -> ShowS
showsUndeclared =
    String
-> proxy SDL_GamepadButtonLabel
-> Int
-> CEnumZ SDL_GamepadButtonLabel
-> ShowS
forall a (proxy :: * -> *).
Show (CEnumZ a) =>
String -> proxy a -> Int -> CEnumZ a -> ShowS
CEnum.showsWrappedUndeclared String
"SDL_GamepadButtonLabel"

  readPrecUndeclared :: ReadPrec SDL_GamepadButtonLabel
readPrecUndeclared =
    String -> ReadPrec SDL_GamepadButtonLabel
forall a. (CEnum a, Read (CEnumZ a)) => String -> ReadPrec a
CEnum.readPrecWrappedUndeclared String
"SDL_GamepadButtonLabel"

  isDeclared :: SDL_GamepadButtonLabel -> Bool
isDeclared = SDL_GamepadButtonLabel -> Bool
forall a. SequentialCEnum a => a -> Bool
CEnum.seqIsDeclared

  mkDeclared :: CEnumZ SDL_GamepadButtonLabel -> Maybe SDL_GamepadButtonLabel
mkDeclared = CEnumZ SDL_GamepadButtonLabel -> Maybe SDL_GamepadButtonLabel
forall a. SequentialCEnum a => CEnumZ a -> Maybe a
CEnum.seqMkDeclared

instance CEnum.SequentialCEnum SDL_GamepadButtonLabel where
  minDeclaredValue :: SDL_GamepadButtonLabel
minDeclaredValue = SDL_GamepadButtonLabel
SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN

  maxDeclaredValue :: SDL_GamepadButtonLabel
maxDeclaredValue = SDL_GamepadButtonLabel
SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE

instance Show SDL_GamepadButtonLabel where
  showsPrec :: Int -> SDL_GamepadButtonLabel -> ShowS
showsPrec = Int -> SDL_GamepadButtonLabel -> ShowS
forall a. CEnum a => Int -> a -> ShowS
CEnum.shows

instance Read SDL_GamepadButtonLabel where
  readPrec :: ReadPrec SDL_GamepadButtonLabel
readPrec = ReadPrec SDL_GamepadButtonLabel
forall a. CEnum a => ReadPrec a
CEnum.readPrec

  readList :: ReadS [SDL_GamepadButtonLabel]
readList = ReadS [SDL_GamepadButtonLabel]
forall a. Read a => ReadS [a]
BG.readListDefault

  readListPrec :: ReadPrec [SDL_GamepadButtonLabel]
readListPrec = ReadPrec [SDL_GamepadButtonLabel]
forall a. Read a => ReadPrec [a]
BG.readListPrecDefault

instance
  (ty ~ BG.CUInt)
  => BG.CompatHasField.HasField "unwrap" SDL_GamepadButtonLabel ty
  where
  hasField :: SDL_GamepadButtonLabel -> (ty -> SDL_GamepadButtonLabel, ty)
hasField =
    \SDL_GamepadButtonLabel
x0 ->
      ( \ty
y1 ->
          SDL_GamepadButtonLabel{unwrap :: CUInt
unwrap = ty
CUInt
y1}
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"unwrap" SDL_GamepadButtonLabel
x0
      )

instance
  (ty ~ BG.CUInt)
  => BG.HasField "unwrap" (BG.Ptr SDL_GamepadButtonLabel) (BG.Ptr ty)
  where
  getField :: Ptr SDL_GamepadButtonLabel -> Ptr ty
getField = Proxy "unwrap"
-> Ptr SDL_GamepadButtonLabel
-> Ptr (CFieldType SDL_GamepadButtonLabel "unwrap")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"unwrap")

instance HasCField.HasCField SDL_GamepadButtonLabel "unwrap" where
  type
    CFieldType SDL_GamepadButtonLabel "unwrap" =
      BG.CUInt

  offset# :: Proxy# SDL_GamepadButtonLabel -> Proxy# "unwrap" -> Int
offset# = \Proxy# SDL_GamepadButtonLabel
_ -> \Proxy# "unwrap"
_ -> Int
0

-- | [C declaration]: @SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN@, defined at @SDL3\/SDL_gamepad.h 198:5@
pattern SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN :: SDL_GamepadButtonLabel
pattern $mSDL_GAMEPAD_BUTTON_LABEL_UNKNOWN :: forall {r}.
SDL_GamepadButtonLabel -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_LABEL_UNKNOWN :: SDL_GamepadButtonLabel
SDL_GAMEPAD_BUTTON_LABEL_UNKNOWN = SDL_GamepadButtonLabel 0

-- | [C declaration]: @SDL_GAMEPAD_BUTTON_LABEL_A@, defined at @SDL3\/SDL_gamepad.h 199:5@
pattern SDL_GAMEPAD_BUTTON_LABEL_A :: SDL_GamepadButtonLabel
pattern $mSDL_GAMEPAD_BUTTON_LABEL_A :: forall {r}.
SDL_GamepadButtonLabel -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_LABEL_A :: SDL_GamepadButtonLabel
SDL_GAMEPAD_BUTTON_LABEL_A = SDL_GamepadButtonLabel 1

-- | [C declaration]: @SDL_GAMEPAD_BUTTON_LABEL_B@, defined at @SDL3\/SDL_gamepad.h 200:5@
pattern SDL_GAMEPAD_BUTTON_LABEL_B :: SDL_GamepadButtonLabel
pattern $mSDL_GAMEPAD_BUTTON_LABEL_B :: forall {r}.
SDL_GamepadButtonLabel -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_LABEL_B :: SDL_GamepadButtonLabel
SDL_GAMEPAD_BUTTON_LABEL_B = SDL_GamepadButtonLabel 2

-- | [C declaration]: @SDL_GAMEPAD_BUTTON_LABEL_X@, defined at @SDL3\/SDL_gamepad.h 201:5@
pattern SDL_GAMEPAD_BUTTON_LABEL_X :: SDL_GamepadButtonLabel
pattern $mSDL_GAMEPAD_BUTTON_LABEL_X :: forall {r}.
SDL_GamepadButtonLabel -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_LABEL_X :: SDL_GamepadButtonLabel
SDL_GAMEPAD_BUTTON_LABEL_X = SDL_GamepadButtonLabel 3

-- | [C declaration]: @SDL_GAMEPAD_BUTTON_LABEL_Y@, defined at @SDL3\/SDL_gamepad.h 202:5@
pattern SDL_GAMEPAD_BUTTON_LABEL_Y :: SDL_GamepadButtonLabel
pattern $mSDL_GAMEPAD_BUTTON_LABEL_Y :: forall {r}.
SDL_GamepadButtonLabel -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_LABEL_Y :: SDL_GamepadButtonLabel
SDL_GAMEPAD_BUTTON_LABEL_Y = SDL_GamepadButtonLabel 4

-- | [C declaration]: @SDL_GAMEPAD_BUTTON_LABEL_CROSS@, defined at @SDL3\/SDL_gamepad.h 203:5@
pattern SDL_GAMEPAD_BUTTON_LABEL_CROSS :: SDL_GamepadButtonLabel
pattern $mSDL_GAMEPAD_BUTTON_LABEL_CROSS :: forall {r}.
SDL_GamepadButtonLabel -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_LABEL_CROSS :: SDL_GamepadButtonLabel
SDL_GAMEPAD_BUTTON_LABEL_CROSS = SDL_GamepadButtonLabel 5

-- | [C declaration]: @SDL_GAMEPAD_BUTTON_LABEL_CIRCLE@, defined at @SDL3\/SDL_gamepad.h 204:5@
pattern SDL_GAMEPAD_BUTTON_LABEL_CIRCLE :: SDL_GamepadButtonLabel
pattern $mSDL_GAMEPAD_BUTTON_LABEL_CIRCLE :: forall {r}.
SDL_GamepadButtonLabel -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_LABEL_CIRCLE :: SDL_GamepadButtonLabel
SDL_GAMEPAD_BUTTON_LABEL_CIRCLE = SDL_GamepadButtonLabel 6

-- | [C declaration]: @SDL_GAMEPAD_BUTTON_LABEL_SQUARE@, defined at @SDL3\/SDL_gamepad.h 205:5@
pattern SDL_GAMEPAD_BUTTON_LABEL_SQUARE :: SDL_GamepadButtonLabel
pattern $mSDL_GAMEPAD_BUTTON_LABEL_SQUARE :: forall {r}.
SDL_GamepadButtonLabel -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_LABEL_SQUARE :: SDL_GamepadButtonLabel
SDL_GAMEPAD_BUTTON_LABEL_SQUARE = SDL_GamepadButtonLabel 7

-- | [C declaration]: @SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE@, defined at @SDL3\/SDL_gamepad.h 206:5@
pattern SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE :: SDL_GamepadButtonLabel
pattern $mSDL_GAMEPAD_BUTTON_LABEL_TRIANGLE :: forall {r}.
SDL_GamepadButtonLabel -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BUTTON_LABEL_TRIANGLE :: SDL_GamepadButtonLabel
SDL_GAMEPAD_BUTTON_LABEL_TRIANGLE = SDL_GamepadButtonLabel 8

-- | The list of axes available on a gamepad
--
--     Thumbstick axis values range from SDL_JOYSTICK_AXIS_MIN to SDL_JOYSTICK_AXIS_MAX, and are centered within ~8000 of zero, though advanced UI will allow users to set or autodetect the dead zone, which varies between gamepads.
--
--     Trigger axis values range from 0 (released) to SDL_JOYSTICK_AXIS_MAX (fully pressed) when reported by @SDL_GetGamepadAxis()@. Note that this is not the same range that will be reported by the lower-level SDL_GetJoystickAxis().
--
--     @since 3.2.0
--
--     [C declaration]: @enum SDL_GamepadAxis@, defined at @SDL3\/SDL_gamepad.h 223:14@
newtype SDL_GamepadAxis = SDL_GamepadAxis
  { SDL_GamepadAxis -> CInt
unwrap :: BG.CInt
  }
  deriving stock ((forall x. SDL_GamepadAxis -> Rep SDL_GamepadAxis x)
-> (forall x. Rep SDL_GamepadAxis x -> SDL_GamepadAxis)
-> Generic SDL_GamepadAxis
forall x. Rep SDL_GamepadAxis x -> SDL_GamepadAxis
forall x. SDL_GamepadAxis -> Rep SDL_GamepadAxis x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SDL_GamepadAxis -> Rep SDL_GamepadAxis x
from :: forall x. SDL_GamepadAxis -> Rep SDL_GamepadAxis x
$cto :: forall x. Rep SDL_GamepadAxis x -> SDL_GamepadAxis
to :: forall x. Rep SDL_GamepadAxis x -> SDL_GamepadAxis
BG.Generic, SDL_GamepadAxis -> SDL_GamepadAxis -> Bool
(SDL_GamepadAxis -> SDL_GamepadAxis -> Bool)
-> (SDL_GamepadAxis -> SDL_GamepadAxis -> Bool)
-> Eq SDL_GamepadAxis
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SDL_GamepadAxis -> SDL_GamepadAxis -> Bool
== :: SDL_GamepadAxis -> SDL_GamepadAxis -> Bool
$c/= :: SDL_GamepadAxis -> SDL_GamepadAxis -> Bool
/= :: SDL_GamepadAxis -> SDL_GamepadAxis -> Bool
Eq, Eq SDL_GamepadAxis
Eq SDL_GamepadAxis =>
(SDL_GamepadAxis -> SDL_GamepadAxis -> Ordering)
-> (SDL_GamepadAxis -> SDL_GamepadAxis -> Bool)
-> (SDL_GamepadAxis -> SDL_GamepadAxis -> Bool)
-> (SDL_GamepadAxis -> SDL_GamepadAxis -> Bool)
-> (SDL_GamepadAxis -> SDL_GamepadAxis -> Bool)
-> (SDL_GamepadAxis -> SDL_GamepadAxis -> SDL_GamepadAxis)
-> (SDL_GamepadAxis -> SDL_GamepadAxis -> SDL_GamepadAxis)
-> Ord SDL_GamepadAxis
SDL_GamepadAxis -> SDL_GamepadAxis -> Bool
SDL_GamepadAxis -> SDL_GamepadAxis -> Ordering
SDL_GamepadAxis -> SDL_GamepadAxis -> SDL_GamepadAxis
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: SDL_GamepadAxis -> SDL_GamepadAxis -> Ordering
compare :: SDL_GamepadAxis -> SDL_GamepadAxis -> Ordering
$c< :: SDL_GamepadAxis -> SDL_GamepadAxis -> Bool
< :: SDL_GamepadAxis -> SDL_GamepadAxis -> Bool
$c<= :: SDL_GamepadAxis -> SDL_GamepadAxis -> Bool
<= :: SDL_GamepadAxis -> SDL_GamepadAxis -> Bool
$c> :: SDL_GamepadAxis -> SDL_GamepadAxis -> Bool
> :: SDL_GamepadAxis -> SDL_GamepadAxis -> Bool
$c>= :: SDL_GamepadAxis -> SDL_GamepadAxis -> Bool
>= :: SDL_GamepadAxis -> SDL_GamepadAxis -> Bool
$cmax :: SDL_GamepadAxis -> SDL_GamepadAxis -> SDL_GamepadAxis
max :: SDL_GamepadAxis -> SDL_GamepadAxis -> SDL_GamepadAxis
$cmin :: SDL_GamepadAxis -> SDL_GamepadAxis -> SDL_GamepadAxis
min :: SDL_GamepadAxis -> SDL_GamepadAxis -> SDL_GamepadAxis
Ord)
  deriving newtype (FFIType SDL_GamepadAxis -> SDL_GamepadAxis
SDL_GamepadAxis -> FFIType SDL_GamepadAxis
(SDL_GamepadAxis -> FFIType SDL_GamepadAxis)
-> (FFIType SDL_GamepadAxis -> SDL_GamepadAxis)
-> HasFFIType SDL_GamepadAxis
forall a. (a -> FFIType a) -> (FFIType a -> a) -> HasFFIType a
$ctoFFIType :: SDL_GamepadAxis -> FFIType SDL_GamepadAxis
toFFIType :: SDL_GamepadAxis -> FFIType SDL_GamepadAxis
$cfromFFIType :: FFIType SDL_GamepadAxis -> SDL_GamepadAxis
fromFFIType :: FFIType SDL_GamepadAxis -> SDL_GamepadAxis
BG.HasFFIType)

instance Marshal.StaticSize SDL_GamepadAxis where
  staticSizeOf :: Proxy SDL_GamepadAxis -> Int
staticSizeOf = \Proxy SDL_GamepadAxis
_ -> (Int
4 :: Int)

  staticAlignment :: Proxy SDL_GamepadAxis -> Int
staticAlignment = \Proxy SDL_GamepadAxis
_ -> (Int
4 :: Int)

instance Marshal.ReadRaw SDL_GamepadAxis where
  readRaw :: Ptr SDL_GamepadAxis -> IO SDL_GamepadAxis
readRaw =
    \Ptr SDL_GamepadAxis
ptr0 ->
      (CInt -> SDL_GamepadAxis) -> IO (CInt -> SDL_GamepadAxis)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure CInt -> SDL_GamepadAxis
SDL_GamepadAxis
        IO (CInt -> SDL_GamepadAxis) -> IO CInt -> IO SDL_GamepadAxis
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Ptr SDL_GamepadAxis -> Int -> IO CInt
forall a b. ReadRaw a => Ptr b -> Int -> IO a
Marshal.readRawByteOff Ptr SDL_GamepadAxis
ptr0 (Int
0 :: Int)

instance Marshal.WriteRaw SDL_GamepadAxis where
  writeRaw :: Ptr SDL_GamepadAxis -> SDL_GamepadAxis -> IO ()
writeRaw =
    \Ptr SDL_GamepadAxis
ptr0 ->
      \SDL_GamepadAxis
s1 ->
        case SDL_GamepadAxis
s1 of
          SDL_GamepadAxis CInt
unwrap2 ->
            Ptr SDL_GamepadAxis -> Int -> CInt -> IO ()
forall a b. WriteRaw a => Ptr b -> Int -> a -> IO ()
Marshal.writeRawByteOff Ptr SDL_GamepadAxis
ptr0 (Int
0 :: Int) CInt
unwrap2

deriving via Marshal.EquivStorable SDL_GamepadAxis instance BG.Storable SDL_GamepadAxis

deriving via BG.CInt instance BG.Prim SDL_GamepadAxis

instance CEnum.CEnum SDL_GamepadAxis where
  type CEnumZ SDL_GamepadAxis = BG.CInt

  toCEnum :: CEnumZ SDL_GamepadAxis -> SDL_GamepadAxis
toCEnum = CInt -> SDL_GamepadAxis
CEnumZ SDL_GamepadAxis -> SDL_GamepadAxis
SDL_GamepadAxis

  fromCEnum :: SDL_GamepadAxis -> CEnumZ SDL_GamepadAxis
fromCEnum = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"unwrap"

  declaredValues :: forall (proxy :: * -> *).
proxy SDL_GamepadAxis -> DeclaredValues SDL_GamepadAxis
declaredValues =
    \proxy SDL_GamepadAxis
_ ->
      [(CEnumZ SDL_GamepadAxis, NonEmpty String)]
-> DeclaredValues SDL_GamepadAxis
forall a.
Ord (CEnumZ a) =>
[(CEnumZ a, NonEmpty String)] -> DeclaredValues a
CEnum.declaredValuesFromList
        [ (-CInt
1, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_AXIS_INVALID")
        , (CInt
CEnumZ SDL_GamepadAxis
0, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_AXIS_LEFTX")
        , (CInt
CEnumZ SDL_GamepadAxis
1, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_AXIS_LEFTY")
        , (CInt
CEnumZ SDL_GamepadAxis
2, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_AXIS_RIGHTX")
        , (CInt
CEnumZ SDL_GamepadAxis
3, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_AXIS_RIGHTY")
        , (CInt
CEnumZ SDL_GamepadAxis
4, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_AXIS_LEFT_TRIGGER")
        , (CInt
CEnumZ SDL_GamepadAxis
5, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_AXIS_RIGHT_TRIGGER")
        , (CInt
CEnumZ SDL_GamepadAxis
6, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_AXIS_COUNT")
        ]

  showsUndeclared :: forall (proxy :: * -> *).
proxy SDL_GamepadAxis -> Int -> CEnumZ SDL_GamepadAxis -> ShowS
showsUndeclared =
    String
-> proxy SDL_GamepadAxis -> Int -> CEnumZ SDL_GamepadAxis -> ShowS
forall a (proxy :: * -> *).
Show (CEnumZ a) =>
String -> proxy a -> Int -> CEnumZ a -> ShowS
CEnum.showsWrappedUndeclared String
"SDL_GamepadAxis"

  readPrecUndeclared :: ReadPrec SDL_GamepadAxis
readPrecUndeclared =
    String -> ReadPrec SDL_GamepadAxis
forall a. (CEnum a, Read (CEnumZ a)) => String -> ReadPrec a
CEnum.readPrecWrappedUndeclared String
"SDL_GamepadAxis"

  isDeclared :: SDL_GamepadAxis -> Bool
isDeclared = SDL_GamepadAxis -> Bool
forall a. SequentialCEnum a => a -> Bool
CEnum.seqIsDeclared

  mkDeclared :: CEnumZ SDL_GamepadAxis -> Maybe SDL_GamepadAxis
mkDeclared = CEnumZ SDL_GamepadAxis -> Maybe SDL_GamepadAxis
forall a. SequentialCEnum a => CEnumZ a -> Maybe a
CEnum.seqMkDeclared

instance CEnum.SequentialCEnum SDL_GamepadAxis where
  minDeclaredValue :: SDL_GamepadAxis
minDeclaredValue = SDL_GamepadAxis
SDL_GAMEPAD_AXIS_INVALID

  maxDeclaredValue :: SDL_GamepadAxis
maxDeclaredValue = SDL_GamepadAxis
SDL_GAMEPAD_AXIS_COUNT

instance Show SDL_GamepadAxis where
  showsPrec :: Int -> SDL_GamepadAxis -> ShowS
showsPrec = Int -> SDL_GamepadAxis -> ShowS
forall a. CEnum a => Int -> a -> ShowS
CEnum.shows

instance Read SDL_GamepadAxis where
  readPrec :: ReadPrec SDL_GamepadAxis
readPrec = ReadPrec SDL_GamepadAxis
forall a. CEnum a => ReadPrec a
CEnum.readPrec

  readList :: ReadS [SDL_GamepadAxis]
readList = ReadS [SDL_GamepadAxis]
forall a. Read a => ReadS [a]
BG.readListDefault

  readListPrec :: ReadPrec [SDL_GamepadAxis]
readListPrec = ReadPrec [SDL_GamepadAxis]
forall a. Read a => ReadPrec [a]
BG.readListPrecDefault

instance
  (ty ~ BG.CInt)
  => BG.CompatHasField.HasField "unwrap" SDL_GamepadAxis ty
  where
  hasField :: SDL_GamepadAxis -> (ty -> SDL_GamepadAxis, ty)
hasField =
    \SDL_GamepadAxis
x0 ->
      ( \ty
y1 ->
          SDL_GamepadAxis{unwrap :: CInt
unwrap = ty
CInt
y1}
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"unwrap" SDL_GamepadAxis
x0
      )

instance
  (ty ~ BG.CInt)
  => BG.HasField "unwrap" (BG.Ptr SDL_GamepadAxis) (BG.Ptr ty)
  where
  getField :: Ptr SDL_GamepadAxis -> Ptr ty
getField = Proxy "unwrap"
-> Ptr SDL_GamepadAxis -> Ptr (CFieldType SDL_GamepadAxis "unwrap")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"unwrap")

instance HasCField.HasCField SDL_GamepadAxis "unwrap" where
  type CFieldType SDL_GamepadAxis "unwrap" = BG.CInt

  offset# :: Proxy# SDL_GamepadAxis -> Proxy# "unwrap" -> Int
offset# = \Proxy# SDL_GamepadAxis
_ -> \Proxy# "unwrap"
_ -> Int
0

-- | [C declaration]: @SDL_GAMEPAD_AXIS_INVALID@, defined at @SDL3\/SDL_gamepad.h 225:5@
pattern SDL_GAMEPAD_AXIS_INVALID :: SDL_GamepadAxis
pattern $mSDL_GAMEPAD_AXIS_INVALID :: forall {r}. SDL_GamepadAxis -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_AXIS_INVALID :: SDL_GamepadAxis
SDL_GAMEPAD_AXIS_INVALID = SDL_GamepadAxis (-1)

-- | [C declaration]: @SDL_GAMEPAD_AXIS_LEFTX@, defined at @SDL3\/SDL_gamepad.h 226:5@
pattern SDL_GAMEPAD_AXIS_LEFTX :: SDL_GamepadAxis
pattern $mSDL_GAMEPAD_AXIS_LEFTX :: forall {r}. SDL_GamepadAxis -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_AXIS_LEFTX :: SDL_GamepadAxis
SDL_GAMEPAD_AXIS_LEFTX = SDL_GamepadAxis 0

-- | [C declaration]: @SDL_GAMEPAD_AXIS_LEFTY@, defined at @SDL3\/SDL_gamepad.h 227:5@
pattern SDL_GAMEPAD_AXIS_LEFTY :: SDL_GamepadAxis
pattern $mSDL_GAMEPAD_AXIS_LEFTY :: forall {r}. SDL_GamepadAxis -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_AXIS_LEFTY :: SDL_GamepadAxis
SDL_GAMEPAD_AXIS_LEFTY = SDL_GamepadAxis 1

-- | [C declaration]: @SDL_GAMEPAD_AXIS_RIGHTX@, defined at @SDL3\/SDL_gamepad.h 228:5@
pattern SDL_GAMEPAD_AXIS_RIGHTX :: SDL_GamepadAxis
pattern $mSDL_GAMEPAD_AXIS_RIGHTX :: forall {r}. SDL_GamepadAxis -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_AXIS_RIGHTX :: SDL_GamepadAxis
SDL_GAMEPAD_AXIS_RIGHTX = SDL_GamepadAxis 2

-- | [C declaration]: @SDL_GAMEPAD_AXIS_RIGHTY@, defined at @SDL3\/SDL_gamepad.h 229:5@
pattern SDL_GAMEPAD_AXIS_RIGHTY :: SDL_GamepadAxis
pattern $mSDL_GAMEPAD_AXIS_RIGHTY :: forall {r}. SDL_GamepadAxis -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_AXIS_RIGHTY :: SDL_GamepadAxis
SDL_GAMEPAD_AXIS_RIGHTY = SDL_GamepadAxis 3

-- | [C declaration]: @SDL_GAMEPAD_AXIS_LEFT_TRIGGER@, defined at @SDL3\/SDL_gamepad.h 230:5@
pattern SDL_GAMEPAD_AXIS_LEFT_TRIGGER :: SDL_GamepadAxis
pattern $mSDL_GAMEPAD_AXIS_LEFT_TRIGGER :: forall {r}. SDL_GamepadAxis -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_AXIS_LEFT_TRIGGER :: SDL_GamepadAxis
SDL_GAMEPAD_AXIS_LEFT_TRIGGER = SDL_GamepadAxis 4

-- | [C declaration]: @SDL_GAMEPAD_AXIS_RIGHT_TRIGGER@, defined at @SDL3\/SDL_gamepad.h 231:5@
pattern SDL_GAMEPAD_AXIS_RIGHT_TRIGGER :: SDL_GamepadAxis
pattern $mSDL_GAMEPAD_AXIS_RIGHT_TRIGGER :: forall {r}. SDL_GamepadAxis -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_AXIS_RIGHT_TRIGGER :: SDL_GamepadAxis
SDL_GAMEPAD_AXIS_RIGHT_TRIGGER = SDL_GamepadAxis 5

-- | [C declaration]: @SDL_GAMEPAD_AXIS_COUNT@, defined at @SDL3\/SDL_gamepad.h 232:5@
pattern SDL_GAMEPAD_AXIS_COUNT :: SDL_GamepadAxis
pattern $mSDL_GAMEPAD_AXIS_COUNT :: forall {r}. SDL_GamepadAxis -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_AXIS_COUNT :: SDL_GamepadAxis
SDL_GAMEPAD_AXIS_COUNT = SDL_GamepadAxis 6

-- | Types of gamepad control bindings.
--
--     A gamepad is a collection of bindings that map arbitrary joystick buttons, axes and hat switches to specific positions on a generic console-style gamepad. This enum is used as part of 'SDL_GamepadBinding' to specify those mappings.
--
--     @since 3.2.0
--
--     [C declaration]: @enum SDL_GamepadBindingType@, defined at @SDL3\/SDL_gamepad.h 245:14@
newtype SDL_GamepadBindingType = SDL_GamepadBindingType
  { SDL_GamepadBindingType -> CUInt
unwrap :: BG.CUInt
  }
  deriving stock ((forall x. SDL_GamepadBindingType -> Rep SDL_GamepadBindingType x)
-> (forall x.
    Rep SDL_GamepadBindingType x -> SDL_GamepadBindingType)
-> Generic SDL_GamepadBindingType
forall x. Rep SDL_GamepadBindingType x -> SDL_GamepadBindingType
forall x. SDL_GamepadBindingType -> Rep SDL_GamepadBindingType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SDL_GamepadBindingType -> Rep SDL_GamepadBindingType x
from :: forall x. SDL_GamepadBindingType -> Rep SDL_GamepadBindingType x
$cto :: forall x. Rep SDL_GamepadBindingType x -> SDL_GamepadBindingType
to :: forall x. Rep SDL_GamepadBindingType x -> SDL_GamepadBindingType
BG.Generic, SDL_GamepadBindingType -> SDL_GamepadBindingType -> Bool
(SDL_GamepadBindingType -> SDL_GamepadBindingType -> Bool)
-> (SDL_GamepadBindingType -> SDL_GamepadBindingType -> Bool)
-> Eq SDL_GamepadBindingType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SDL_GamepadBindingType -> SDL_GamepadBindingType -> Bool
== :: SDL_GamepadBindingType -> SDL_GamepadBindingType -> Bool
$c/= :: SDL_GamepadBindingType -> SDL_GamepadBindingType -> Bool
/= :: SDL_GamepadBindingType -> SDL_GamepadBindingType -> Bool
Eq, Eq SDL_GamepadBindingType
Eq SDL_GamepadBindingType =>
(SDL_GamepadBindingType -> SDL_GamepadBindingType -> Ordering)
-> (SDL_GamepadBindingType -> SDL_GamepadBindingType -> Bool)
-> (SDL_GamepadBindingType -> SDL_GamepadBindingType -> Bool)
-> (SDL_GamepadBindingType -> SDL_GamepadBindingType -> Bool)
-> (SDL_GamepadBindingType -> SDL_GamepadBindingType -> Bool)
-> (SDL_GamepadBindingType
    -> SDL_GamepadBindingType -> SDL_GamepadBindingType)
-> (SDL_GamepadBindingType
    -> SDL_GamepadBindingType -> SDL_GamepadBindingType)
-> Ord SDL_GamepadBindingType
SDL_GamepadBindingType -> SDL_GamepadBindingType -> Bool
SDL_GamepadBindingType -> SDL_GamepadBindingType -> Ordering
SDL_GamepadBindingType
-> SDL_GamepadBindingType -> SDL_GamepadBindingType
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: SDL_GamepadBindingType -> SDL_GamepadBindingType -> Ordering
compare :: SDL_GamepadBindingType -> SDL_GamepadBindingType -> Ordering
$c< :: SDL_GamepadBindingType -> SDL_GamepadBindingType -> Bool
< :: SDL_GamepadBindingType -> SDL_GamepadBindingType -> Bool
$c<= :: SDL_GamepadBindingType -> SDL_GamepadBindingType -> Bool
<= :: SDL_GamepadBindingType -> SDL_GamepadBindingType -> Bool
$c> :: SDL_GamepadBindingType -> SDL_GamepadBindingType -> Bool
> :: SDL_GamepadBindingType -> SDL_GamepadBindingType -> Bool
$c>= :: SDL_GamepadBindingType -> SDL_GamepadBindingType -> Bool
>= :: SDL_GamepadBindingType -> SDL_GamepadBindingType -> Bool
$cmax :: SDL_GamepadBindingType
-> SDL_GamepadBindingType -> SDL_GamepadBindingType
max :: SDL_GamepadBindingType
-> SDL_GamepadBindingType -> SDL_GamepadBindingType
$cmin :: SDL_GamepadBindingType
-> SDL_GamepadBindingType -> SDL_GamepadBindingType
min :: SDL_GamepadBindingType
-> SDL_GamepadBindingType -> SDL_GamepadBindingType
Ord)
  deriving newtype (FFIType SDL_GamepadBindingType -> SDL_GamepadBindingType
SDL_GamepadBindingType -> FFIType SDL_GamepadBindingType
(SDL_GamepadBindingType -> FFIType SDL_GamepadBindingType)
-> (FFIType SDL_GamepadBindingType -> SDL_GamepadBindingType)
-> HasFFIType SDL_GamepadBindingType
forall a. (a -> FFIType a) -> (FFIType a -> a) -> HasFFIType a
$ctoFFIType :: SDL_GamepadBindingType -> FFIType SDL_GamepadBindingType
toFFIType :: SDL_GamepadBindingType -> FFIType SDL_GamepadBindingType
$cfromFFIType :: FFIType SDL_GamepadBindingType -> SDL_GamepadBindingType
fromFFIType :: FFIType SDL_GamepadBindingType -> SDL_GamepadBindingType
BG.HasFFIType)

instance Marshal.StaticSize SDL_GamepadBindingType where
  staticSizeOf :: Proxy SDL_GamepadBindingType -> Int
staticSizeOf = \Proxy SDL_GamepadBindingType
_ -> (Int
4 :: Int)

  staticAlignment :: Proxy SDL_GamepadBindingType -> Int
staticAlignment = \Proxy SDL_GamepadBindingType
_ -> (Int
4 :: Int)

instance Marshal.ReadRaw SDL_GamepadBindingType where
  readRaw :: Ptr SDL_GamepadBindingType -> IO SDL_GamepadBindingType
readRaw =
    \Ptr SDL_GamepadBindingType
ptr0 ->
      (CUInt -> SDL_GamepadBindingType)
-> IO (CUInt -> SDL_GamepadBindingType)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure CUInt -> SDL_GamepadBindingType
SDL_GamepadBindingType
        IO (CUInt -> SDL_GamepadBindingType)
-> IO CUInt -> IO SDL_GamepadBindingType
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Ptr SDL_GamepadBindingType -> Int -> IO CUInt
forall a b. ReadRaw a => Ptr b -> Int -> IO a
Marshal.readRawByteOff Ptr SDL_GamepadBindingType
ptr0 (Int
0 :: Int)

instance Marshal.WriteRaw SDL_GamepadBindingType where
  writeRaw :: Ptr SDL_GamepadBindingType -> SDL_GamepadBindingType -> IO ()
writeRaw =
    \Ptr SDL_GamepadBindingType
ptr0 ->
      \SDL_GamepadBindingType
s1 ->
        case SDL_GamepadBindingType
s1 of
          SDL_GamepadBindingType CUInt
unwrap2 ->
            Ptr SDL_GamepadBindingType -> Int -> CUInt -> IO ()
forall a b. WriteRaw a => Ptr b -> Int -> a -> IO ()
Marshal.writeRawByteOff Ptr SDL_GamepadBindingType
ptr0 (Int
0 :: Int) CUInt
unwrap2

deriving via
  Marshal.EquivStorable SDL_GamepadBindingType
  instance
    BG.Storable SDL_GamepadBindingType

deriving via BG.CUInt instance BG.Prim SDL_GamepadBindingType

instance CEnum.CEnum SDL_GamepadBindingType where
  type CEnumZ SDL_GamepadBindingType = BG.CUInt

  toCEnum :: CEnumZ SDL_GamepadBindingType -> SDL_GamepadBindingType
toCEnum = CUInt -> SDL_GamepadBindingType
CEnumZ SDL_GamepadBindingType -> SDL_GamepadBindingType
SDL_GamepadBindingType

  fromCEnum :: SDL_GamepadBindingType -> CEnumZ SDL_GamepadBindingType
fromCEnum = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"unwrap"

  declaredValues :: forall (proxy :: * -> *).
proxy SDL_GamepadBindingType
-> DeclaredValues SDL_GamepadBindingType
declaredValues =
    \proxy SDL_GamepadBindingType
_ ->
      [(CEnumZ SDL_GamepadBindingType, NonEmpty String)]
-> DeclaredValues SDL_GamepadBindingType
forall a.
Ord (CEnumZ a) =>
[(CEnumZ a, NonEmpty String)] -> DeclaredValues a
CEnum.declaredValuesFromList
        [ (CUInt
CEnumZ SDL_GamepadBindingType
0, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BINDTYPE_NONE")
        , (CUInt
CEnumZ SDL_GamepadBindingType
1, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BINDTYPE_BUTTON")
        , (CUInt
CEnumZ SDL_GamepadBindingType
2, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BINDTYPE_AXIS")
        , (CUInt
CEnumZ SDL_GamepadBindingType
3, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_GAMEPAD_BINDTYPE_HAT")
        ]

  showsUndeclared :: forall (proxy :: * -> *).
proxy SDL_GamepadBindingType
-> Int -> CEnumZ SDL_GamepadBindingType -> ShowS
showsUndeclared =
    String
-> proxy SDL_GamepadBindingType
-> Int
-> CEnumZ SDL_GamepadBindingType
-> ShowS
forall a (proxy :: * -> *).
Show (CEnumZ a) =>
String -> proxy a -> Int -> CEnumZ a -> ShowS
CEnum.showsWrappedUndeclared String
"SDL_GamepadBindingType"

  readPrecUndeclared :: ReadPrec SDL_GamepadBindingType
readPrecUndeclared =
    String -> ReadPrec SDL_GamepadBindingType
forall a. (CEnum a, Read (CEnumZ a)) => String -> ReadPrec a
CEnum.readPrecWrappedUndeclared String
"SDL_GamepadBindingType"

  isDeclared :: SDL_GamepadBindingType -> Bool
isDeclared = SDL_GamepadBindingType -> Bool
forall a. SequentialCEnum a => a -> Bool
CEnum.seqIsDeclared

  mkDeclared :: CEnumZ SDL_GamepadBindingType -> Maybe SDL_GamepadBindingType
mkDeclared = CEnumZ SDL_GamepadBindingType -> Maybe SDL_GamepadBindingType
forall a. SequentialCEnum a => CEnumZ a -> Maybe a
CEnum.seqMkDeclared

instance CEnum.SequentialCEnum SDL_GamepadBindingType where
  minDeclaredValue :: SDL_GamepadBindingType
minDeclaredValue = SDL_GamepadBindingType
SDL_GAMEPAD_BINDTYPE_NONE

  maxDeclaredValue :: SDL_GamepadBindingType
maxDeclaredValue = SDL_GamepadBindingType
SDL_GAMEPAD_BINDTYPE_HAT

instance Show SDL_GamepadBindingType where
  showsPrec :: Int -> SDL_GamepadBindingType -> ShowS
showsPrec = Int -> SDL_GamepadBindingType -> ShowS
forall a. CEnum a => Int -> a -> ShowS
CEnum.shows

instance Read SDL_GamepadBindingType where
  readPrec :: ReadPrec SDL_GamepadBindingType
readPrec = ReadPrec SDL_GamepadBindingType
forall a. CEnum a => ReadPrec a
CEnum.readPrec

  readList :: ReadS [SDL_GamepadBindingType]
readList = ReadS [SDL_GamepadBindingType]
forall a. Read a => ReadS [a]
BG.readListDefault

  readListPrec :: ReadPrec [SDL_GamepadBindingType]
readListPrec = ReadPrec [SDL_GamepadBindingType]
forall a. Read a => ReadPrec [a]
BG.readListPrecDefault

instance
  (ty ~ BG.CUInt)
  => BG.CompatHasField.HasField "unwrap" SDL_GamepadBindingType ty
  where
  hasField :: SDL_GamepadBindingType -> (ty -> SDL_GamepadBindingType, ty)
hasField =
    \SDL_GamepadBindingType
x0 ->
      ( \ty
y1 ->
          SDL_GamepadBindingType{unwrap :: CUInt
unwrap = ty
CUInt
y1}
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"unwrap" SDL_GamepadBindingType
x0
      )

instance
  (ty ~ BG.CUInt)
  => BG.HasField "unwrap" (BG.Ptr SDL_GamepadBindingType) (BG.Ptr ty)
  where
  getField :: Ptr SDL_GamepadBindingType -> Ptr ty
getField = Proxy "unwrap"
-> Ptr SDL_GamepadBindingType
-> Ptr (CFieldType SDL_GamepadBindingType "unwrap")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"unwrap")

instance HasCField.HasCField SDL_GamepadBindingType "unwrap" where
  type
    CFieldType SDL_GamepadBindingType "unwrap" =
      BG.CUInt

  offset# :: Proxy# SDL_GamepadBindingType -> Proxy# "unwrap" -> Int
offset# = \Proxy# SDL_GamepadBindingType
_ -> \Proxy# "unwrap"
_ -> Int
0

-- | [C declaration]: @SDL_GAMEPAD_BINDTYPE_NONE@, defined at @SDL3\/SDL_gamepad.h 247:5@
pattern SDL_GAMEPAD_BINDTYPE_NONE :: SDL_GamepadBindingType
pattern $mSDL_GAMEPAD_BINDTYPE_NONE :: forall {r}.
SDL_GamepadBindingType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BINDTYPE_NONE :: SDL_GamepadBindingType
SDL_GAMEPAD_BINDTYPE_NONE = SDL_GamepadBindingType 0

-- | [C declaration]: @SDL_GAMEPAD_BINDTYPE_BUTTON@, defined at @SDL3\/SDL_gamepad.h 248:5@
pattern SDL_GAMEPAD_BINDTYPE_BUTTON :: SDL_GamepadBindingType
pattern $mSDL_GAMEPAD_BINDTYPE_BUTTON :: forall {r}.
SDL_GamepadBindingType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BINDTYPE_BUTTON :: SDL_GamepadBindingType
SDL_GAMEPAD_BINDTYPE_BUTTON = SDL_GamepadBindingType 1

-- | [C declaration]: @SDL_GAMEPAD_BINDTYPE_AXIS@, defined at @SDL3\/SDL_gamepad.h 249:5@
pattern SDL_GAMEPAD_BINDTYPE_AXIS :: SDL_GamepadBindingType
pattern $mSDL_GAMEPAD_BINDTYPE_AXIS :: forall {r}.
SDL_GamepadBindingType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BINDTYPE_AXIS :: SDL_GamepadBindingType
SDL_GAMEPAD_BINDTYPE_AXIS = SDL_GamepadBindingType 2

-- | [C declaration]: @SDL_GAMEPAD_BINDTYPE_HAT@, defined at @SDL3\/SDL_gamepad.h 250:5@
pattern SDL_GAMEPAD_BINDTYPE_HAT :: SDL_GamepadBindingType
pattern $mSDL_GAMEPAD_BINDTYPE_HAT :: forall {r}.
SDL_GamepadBindingType -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_GAMEPAD_BINDTYPE_HAT :: SDL_GamepadBindingType
SDL_GAMEPAD_BINDTYPE_HAT = SDL_GamepadBindingType 3

-- | [C declaration]: @struct \@SDL_GamepadBinding_input_axis@, defined at @SDL3\/SDL_gamepad.h 275:9@
data SDL_GamepadBinding_input_axis = SDL_GamepadBinding_input_axis
  { SDL_GamepadBinding_input_axis -> CInt
axis :: BG.CInt
  -- ^ [C declaration]: @axis@, defined at @SDL3\/SDL_gamepad.h 277:17@
  , SDL_GamepadBinding_input_axis -> CInt
axis_min :: BG.CInt
  -- ^ [C declaration]: @axis_min@, defined at @SDL3\/SDL_gamepad.h 278:17@
  , SDL_GamepadBinding_input_axis -> CInt
axis_max :: BG.CInt
  -- ^ [C declaration]: @axis_max@, defined at @SDL3\/SDL_gamepad.h 279:17@
  }
  deriving stock ((forall x.
 SDL_GamepadBinding_input_axis
 -> Rep SDL_GamepadBinding_input_axis x)
-> (forall x.
    Rep SDL_GamepadBinding_input_axis x
    -> SDL_GamepadBinding_input_axis)
-> Generic SDL_GamepadBinding_input_axis
forall x.
Rep SDL_GamepadBinding_input_axis x
-> SDL_GamepadBinding_input_axis
forall x.
SDL_GamepadBinding_input_axis
-> Rep SDL_GamepadBinding_input_axis x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
SDL_GamepadBinding_input_axis
-> Rep SDL_GamepadBinding_input_axis x
from :: forall x.
SDL_GamepadBinding_input_axis
-> Rep SDL_GamepadBinding_input_axis x
$cto :: forall x.
Rep SDL_GamepadBinding_input_axis x
-> SDL_GamepadBinding_input_axis
to :: forall x.
Rep SDL_GamepadBinding_input_axis x
-> SDL_GamepadBinding_input_axis
BG.Generic, SDL_GamepadBinding_input_axis
-> SDL_GamepadBinding_input_axis -> Bool
(SDL_GamepadBinding_input_axis
 -> SDL_GamepadBinding_input_axis -> Bool)
-> (SDL_GamepadBinding_input_axis
    -> SDL_GamepadBinding_input_axis -> Bool)
-> Eq SDL_GamepadBinding_input_axis
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SDL_GamepadBinding_input_axis
-> SDL_GamepadBinding_input_axis -> Bool
== :: SDL_GamepadBinding_input_axis
-> SDL_GamepadBinding_input_axis -> Bool
$c/= :: SDL_GamepadBinding_input_axis
-> SDL_GamepadBinding_input_axis -> Bool
/= :: SDL_GamepadBinding_input_axis
-> SDL_GamepadBinding_input_axis -> Bool
Eq, Int -> SDL_GamepadBinding_input_axis -> ShowS
[SDL_GamepadBinding_input_axis] -> ShowS
SDL_GamepadBinding_input_axis -> String
(Int -> SDL_GamepadBinding_input_axis -> ShowS)
-> (SDL_GamepadBinding_input_axis -> String)
-> ([SDL_GamepadBinding_input_axis] -> ShowS)
-> Show SDL_GamepadBinding_input_axis
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SDL_GamepadBinding_input_axis -> ShowS
showsPrec :: Int -> SDL_GamepadBinding_input_axis -> ShowS
$cshow :: SDL_GamepadBinding_input_axis -> String
show :: SDL_GamepadBinding_input_axis -> String
$cshowList :: [SDL_GamepadBinding_input_axis] -> ShowS
showList :: [SDL_GamepadBinding_input_axis] -> ShowS
Show)

instance Marshal.StaticSize SDL_GamepadBinding_input_axis where
  staticSizeOf :: Proxy SDL_GamepadBinding_input_axis -> Int
staticSizeOf = \Proxy SDL_GamepadBinding_input_axis
_ -> (Int
12 :: Int)

  staticAlignment :: Proxy SDL_GamepadBinding_input_axis -> Int
staticAlignment = \Proxy SDL_GamepadBinding_input_axis
_ -> (Int
4 :: Int)

instance Marshal.ReadRaw SDL_GamepadBinding_input_axis where
  readRaw :: Ptr SDL_GamepadBinding_input_axis
-> IO SDL_GamepadBinding_input_axis
readRaw =
    \Ptr SDL_GamepadBinding_input_axis
ptr0 ->
      (CInt -> CInt -> CInt -> SDL_GamepadBinding_input_axis)
-> IO (CInt -> CInt -> CInt -> SDL_GamepadBinding_input_axis)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure CInt -> CInt -> CInt -> SDL_GamepadBinding_input_axis
SDL_GamepadBinding_input_axis
        IO (CInt -> CInt -> CInt -> SDL_GamepadBinding_input_axis)
-> IO CInt -> IO (CInt -> CInt -> SDL_GamepadBinding_input_axis)
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Proxy "axis"
-> Ptr SDL_GamepadBinding_input_axis
-> IO (CFieldType SDL_GamepadBinding_input_axis "axis")
forall a (field :: Symbol).
(HasCField a field, ReadRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> IO (CFieldType a field)
HasCField.readRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"axis") Ptr SDL_GamepadBinding_input_axis
ptr0
        IO (CInt -> CInt -> SDL_GamepadBinding_input_axis)
-> IO CInt -> IO (CInt -> SDL_GamepadBinding_input_axis)
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Proxy "axis_min"
-> Ptr SDL_GamepadBinding_input_axis
-> IO (CFieldType SDL_GamepadBinding_input_axis "axis_min")
forall a (field :: Symbol).
(HasCField a field, ReadRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> IO (CFieldType a field)
HasCField.readRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"axis_min") Ptr SDL_GamepadBinding_input_axis
ptr0
        IO (CInt -> SDL_GamepadBinding_input_axis)
-> IO CInt -> IO SDL_GamepadBinding_input_axis
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Proxy "axis_max"
-> Ptr SDL_GamepadBinding_input_axis
-> IO (CFieldType SDL_GamepadBinding_input_axis "axis_max")
forall a (field :: Symbol).
(HasCField a field, ReadRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> IO (CFieldType a field)
HasCField.readRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"axis_max") Ptr SDL_GamepadBinding_input_axis
ptr0

instance Marshal.WriteRaw SDL_GamepadBinding_input_axis where
  writeRaw :: Ptr SDL_GamepadBinding_input_axis
-> SDL_GamepadBinding_input_axis -> IO ()
writeRaw =
    \Ptr SDL_GamepadBinding_input_axis
ptr0 ->
      \SDL_GamepadBinding_input_axis
s1 ->
        case SDL_GamepadBinding_input_axis
s1 of
          SDL_GamepadBinding_input_axis CInt
axis2 CInt
axis_min3 CInt
axis_max4 ->
            Proxy "axis"
-> Ptr SDL_GamepadBinding_input_axis
-> CFieldType SDL_GamepadBinding_input_axis "axis"
-> IO ()
forall a (field :: Symbol).
(HasCField a field, WriteRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> CFieldType a field -> IO ()
HasCField.writeRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"axis") Ptr SDL_GamepadBinding_input_axis
ptr0 CInt
CFieldType SDL_GamepadBinding_input_axis "axis"
axis2
              IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Proxy "axis_min"
-> Ptr SDL_GamepadBinding_input_axis
-> CFieldType SDL_GamepadBinding_input_axis "axis_min"
-> IO ()
forall a (field :: Symbol).
(HasCField a field, WriteRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> CFieldType a field -> IO ()
HasCField.writeRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"axis_min") Ptr SDL_GamepadBinding_input_axis
ptr0 CInt
CFieldType SDL_GamepadBinding_input_axis "axis_min"
axis_min3
              IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Proxy "axis_max"
-> Ptr SDL_GamepadBinding_input_axis
-> CFieldType SDL_GamepadBinding_input_axis "axis_max"
-> IO ()
forall a (field :: Symbol).
(HasCField a field, WriteRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> CFieldType a field -> IO ()
HasCField.writeRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"axis_max") Ptr SDL_GamepadBinding_input_axis
ptr0 CInt
CFieldType SDL_GamepadBinding_input_axis "axis_max"
axis_max4

deriving via
  Marshal.EquivStorable SDL_GamepadBinding_input_axis
  instance
    BG.Storable SDL_GamepadBinding_input_axis

deriving via
  Struct.IsStructViaReadRaw SDL_GamepadBinding_input_axis
  instance
    Struct.IsStruct SDL_GamepadBinding_input_axis

-- | [C declaration]: @axis@, defined at @SDL3\/SDL_gamepad.h 277:17@
instance
  (ty ~ BG.CInt)
  => BG.CompatHasField.HasField "axis" SDL_GamepadBinding_input_axis ty
  where
  hasField :: SDL_GamepadBinding_input_axis
-> (ty -> SDL_GamepadBinding_input_axis, ty)
hasField =
    \SDL_GamepadBinding_input_axis
x0 ->
      ( \ty
y1 ->
          SDL_GamepadBinding_input_axis
            { axis :: CInt
axis = ty
CInt
y1
            , axis_min :: CInt
axis_min = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"axis_min" SDL_GamepadBinding_input_axis
x0
            , axis_max :: CInt
axis_max = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"axis_max" SDL_GamepadBinding_input_axis
x0
            }
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"axis" SDL_GamepadBinding_input_axis
x0
      )

instance
  (ty ~ BG.CInt)
  => BG.HasField "axis" (BG.Ptr SDL_GamepadBinding_input_axis) (BG.Ptr ty)
  where
  getField :: Ptr SDL_GamepadBinding_input_axis -> Ptr ty
getField = Proxy "axis"
-> Ptr SDL_GamepadBinding_input_axis
-> Ptr (CFieldType SDL_GamepadBinding_input_axis "axis")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"axis")

instance HasCField.HasCField SDL_GamepadBinding_input_axis "axis" where
  type
    CFieldType SDL_GamepadBinding_input_axis "axis" =
      BG.CInt

  offset# :: Proxy# SDL_GamepadBinding_input_axis -> Proxy# "axis" -> Int
offset# = \Proxy# SDL_GamepadBinding_input_axis
_ -> \Proxy# "axis"
_ -> Int
0

-- | [C declaration]: @axis_min@, defined at @SDL3\/SDL_gamepad.h 278:17@
instance
  (ty ~ BG.CInt)
  => BG.CompatHasField.HasField "axis_min" SDL_GamepadBinding_input_axis ty
  where
  hasField :: SDL_GamepadBinding_input_axis
-> (ty -> SDL_GamepadBinding_input_axis, ty)
hasField =
    \SDL_GamepadBinding_input_axis
x0 ->
      ( \ty
y1 ->
          SDL_GamepadBinding_input_axis
            { axis_min :: CInt
axis_min = ty
CInt
y1
            , axis :: CInt
axis = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"axis" SDL_GamepadBinding_input_axis
x0
            , axis_max :: CInt
axis_max = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"axis_max" SDL_GamepadBinding_input_axis
x0
            }
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"axis_min" SDL_GamepadBinding_input_axis
x0
      )

instance
  (ty ~ BG.CInt)
  => BG.HasField "axis_min" (BG.Ptr SDL_GamepadBinding_input_axis) (BG.Ptr ty)
  where
  getField :: Ptr SDL_GamepadBinding_input_axis -> Ptr ty
getField = Proxy "axis_min"
-> Ptr SDL_GamepadBinding_input_axis
-> Ptr (CFieldType SDL_GamepadBinding_input_axis "axis_min")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"axis_min")

instance HasCField.HasCField SDL_GamepadBinding_input_axis "axis_min" where
  type
    CFieldType SDL_GamepadBinding_input_axis "axis_min" =
      BG.CInt

  offset# :: Proxy# SDL_GamepadBinding_input_axis -> Proxy# "axis_min" -> Int
offset# = \Proxy# SDL_GamepadBinding_input_axis
_ -> \Proxy# "axis_min"
_ -> Int
4

-- | [C declaration]: @axis_max@, defined at @SDL3\/SDL_gamepad.h 279:17@
instance
  (ty ~ BG.CInt)
  => BG.CompatHasField.HasField "axis_max" SDL_GamepadBinding_input_axis ty
  where
  hasField :: SDL_GamepadBinding_input_axis
-> (ty -> SDL_GamepadBinding_input_axis, ty)
hasField =
    \SDL_GamepadBinding_input_axis
x0 ->
      ( \ty
y1 ->
          SDL_GamepadBinding_input_axis
            { axis_max :: CInt
axis_max = ty
CInt
y1
            , axis :: CInt
axis = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"axis" SDL_GamepadBinding_input_axis
x0
            , axis_min :: CInt
axis_min = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"axis_min" SDL_GamepadBinding_input_axis
x0
            }
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"axis_max" SDL_GamepadBinding_input_axis
x0
      )

instance
  (ty ~ BG.CInt)
  => BG.HasField "axis_max" (BG.Ptr SDL_GamepadBinding_input_axis) (BG.Ptr ty)
  where
  getField :: Ptr SDL_GamepadBinding_input_axis -> Ptr ty
getField = Proxy "axis_max"
-> Ptr SDL_GamepadBinding_input_axis
-> Ptr (CFieldType SDL_GamepadBinding_input_axis "axis_max")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"axis_max")

instance HasCField.HasCField SDL_GamepadBinding_input_axis "axis_max" where
  type
    CFieldType SDL_GamepadBinding_input_axis "axis_max" =
      BG.CInt

  offset# :: Proxy# SDL_GamepadBinding_input_axis -> Proxy# "axis_max" -> Int
offset# = \Proxy# SDL_GamepadBinding_input_axis
_ -> \Proxy# "axis_max"
_ -> Int
8

-- | [C declaration]: @struct \@SDL_GamepadBinding_input_hat@, defined at @SDL3\/SDL_gamepad.h 282:9@
data SDL_GamepadBinding_input_hat = SDL_GamepadBinding_input_hat
  { SDL_GamepadBinding_input_hat -> CInt
hat :: BG.CInt
  -- ^ [C declaration]: @hat@, defined at @SDL3\/SDL_gamepad.h 284:17@
  , SDL_GamepadBinding_input_hat -> CInt
hat_mask :: BG.CInt
  -- ^ [C declaration]: @hat_mask@, defined at @SDL3\/SDL_gamepad.h 285:17@
  }
  deriving stock ((forall x.
 SDL_GamepadBinding_input_hat -> Rep SDL_GamepadBinding_input_hat x)
-> (forall x.
    Rep SDL_GamepadBinding_input_hat x -> SDL_GamepadBinding_input_hat)
-> Generic SDL_GamepadBinding_input_hat
forall x.
Rep SDL_GamepadBinding_input_hat x -> SDL_GamepadBinding_input_hat
forall x.
SDL_GamepadBinding_input_hat -> Rep SDL_GamepadBinding_input_hat x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
SDL_GamepadBinding_input_hat -> Rep SDL_GamepadBinding_input_hat x
from :: forall x.
SDL_GamepadBinding_input_hat -> Rep SDL_GamepadBinding_input_hat x
$cto :: forall x.
Rep SDL_GamepadBinding_input_hat x -> SDL_GamepadBinding_input_hat
to :: forall x.
Rep SDL_GamepadBinding_input_hat x -> SDL_GamepadBinding_input_hat
BG.Generic, SDL_GamepadBinding_input_hat
-> SDL_GamepadBinding_input_hat -> Bool
(SDL_GamepadBinding_input_hat
 -> SDL_GamepadBinding_input_hat -> Bool)
-> (SDL_GamepadBinding_input_hat
    -> SDL_GamepadBinding_input_hat -> Bool)
-> Eq SDL_GamepadBinding_input_hat
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SDL_GamepadBinding_input_hat
-> SDL_GamepadBinding_input_hat -> Bool
== :: SDL_GamepadBinding_input_hat
-> SDL_GamepadBinding_input_hat -> Bool
$c/= :: SDL_GamepadBinding_input_hat
-> SDL_GamepadBinding_input_hat -> Bool
/= :: SDL_GamepadBinding_input_hat
-> SDL_GamepadBinding_input_hat -> Bool
Eq, Int -> SDL_GamepadBinding_input_hat -> ShowS
[SDL_GamepadBinding_input_hat] -> ShowS
SDL_GamepadBinding_input_hat -> String
(Int -> SDL_GamepadBinding_input_hat -> ShowS)
-> (SDL_GamepadBinding_input_hat -> String)
-> ([SDL_GamepadBinding_input_hat] -> ShowS)
-> Show SDL_GamepadBinding_input_hat
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SDL_GamepadBinding_input_hat -> ShowS
showsPrec :: Int -> SDL_GamepadBinding_input_hat -> ShowS
$cshow :: SDL_GamepadBinding_input_hat -> String
show :: SDL_GamepadBinding_input_hat -> String
$cshowList :: [SDL_GamepadBinding_input_hat] -> ShowS
showList :: [SDL_GamepadBinding_input_hat] -> ShowS
Show)

instance Marshal.StaticSize SDL_GamepadBinding_input_hat where
  staticSizeOf :: Proxy SDL_GamepadBinding_input_hat -> Int
staticSizeOf = \Proxy SDL_GamepadBinding_input_hat
_ -> (Int
8 :: Int)

  staticAlignment :: Proxy SDL_GamepadBinding_input_hat -> Int
staticAlignment = \Proxy SDL_GamepadBinding_input_hat
_ -> (Int
4 :: Int)

instance Marshal.ReadRaw SDL_GamepadBinding_input_hat where
  readRaw :: Ptr SDL_GamepadBinding_input_hat -> IO SDL_GamepadBinding_input_hat
readRaw =
    \Ptr SDL_GamepadBinding_input_hat
ptr0 ->
      (CInt -> CInt -> SDL_GamepadBinding_input_hat)
-> IO (CInt -> CInt -> SDL_GamepadBinding_input_hat)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure CInt -> CInt -> SDL_GamepadBinding_input_hat
SDL_GamepadBinding_input_hat
        IO (CInt -> CInt -> SDL_GamepadBinding_input_hat)
-> IO CInt -> IO (CInt -> SDL_GamepadBinding_input_hat)
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Proxy "hat"
-> Ptr SDL_GamepadBinding_input_hat
-> IO (CFieldType SDL_GamepadBinding_input_hat "hat")
forall a (field :: Symbol).
(HasCField a field, ReadRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> IO (CFieldType a field)
HasCField.readRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"hat") Ptr SDL_GamepadBinding_input_hat
ptr0
        IO (CInt -> SDL_GamepadBinding_input_hat)
-> IO CInt -> IO SDL_GamepadBinding_input_hat
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Proxy "hat_mask"
-> Ptr SDL_GamepadBinding_input_hat
-> IO (CFieldType SDL_GamepadBinding_input_hat "hat_mask")
forall a (field :: Symbol).
(HasCField a field, ReadRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> IO (CFieldType a field)
HasCField.readRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"hat_mask") Ptr SDL_GamepadBinding_input_hat
ptr0

instance Marshal.WriteRaw SDL_GamepadBinding_input_hat where
  writeRaw :: Ptr SDL_GamepadBinding_input_hat
-> SDL_GamepadBinding_input_hat -> IO ()
writeRaw =
    \Ptr SDL_GamepadBinding_input_hat
ptr0 ->
      \SDL_GamepadBinding_input_hat
s1 ->
        case SDL_GamepadBinding_input_hat
s1 of
          SDL_GamepadBinding_input_hat CInt
hat2 CInt
hat_mask3 ->
            Proxy "hat"
-> Ptr SDL_GamepadBinding_input_hat
-> CFieldType SDL_GamepadBinding_input_hat "hat"
-> IO ()
forall a (field :: Symbol).
(HasCField a field, WriteRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> CFieldType a field -> IO ()
HasCField.writeRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"hat") Ptr SDL_GamepadBinding_input_hat
ptr0 CInt
CFieldType SDL_GamepadBinding_input_hat "hat"
hat2
              IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Proxy "hat_mask"
-> Ptr SDL_GamepadBinding_input_hat
-> CFieldType SDL_GamepadBinding_input_hat "hat_mask"
-> IO ()
forall a (field :: Symbol).
(HasCField a field, WriteRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> CFieldType a field -> IO ()
HasCField.writeRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"hat_mask") Ptr SDL_GamepadBinding_input_hat
ptr0 CInt
CFieldType SDL_GamepadBinding_input_hat "hat_mask"
hat_mask3

deriving via
  Marshal.EquivStorable SDL_GamepadBinding_input_hat
  instance
    BG.Storable SDL_GamepadBinding_input_hat

deriving via
  Struct.IsStructViaReadRaw SDL_GamepadBinding_input_hat
  instance
    Struct.IsStruct SDL_GamepadBinding_input_hat

-- | [C declaration]: @hat@, defined at @SDL3\/SDL_gamepad.h 284:17@
instance
  (ty ~ BG.CInt)
  => BG.CompatHasField.HasField "hat" SDL_GamepadBinding_input_hat ty
  where
  hasField :: SDL_GamepadBinding_input_hat
-> (ty -> SDL_GamepadBinding_input_hat, ty)
hasField =
    \SDL_GamepadBinding_input_hat
x0 ->
      ( \ty
y1 ->
          SDL_GamepadBinding_input_hat{hat :: CInt
hat = ty
CInt
y1, hat_mask :: CInt
hat_mask = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"hat_mask" SDL_GamepadBinding_input_hat
x0}
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"hat" SDL_GamepadBinding_input_hat
x0
      )

instance
  (ty ~ BG.CInt)
  => BG.HasField "hat" (BG.Ptr SDL_GamepadBinding_input_hat) (BG.Ptr ty)
  where
  getField :: Ptr SDL_GamepadBinding_input_hat -> Ptr ty
getField = Proxy "hat"
-> Ptr SDL_GamepadBinding_input_hat
-> Ptr (CFieldType SDL_GamepadBinding_input_hat "hat")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"hat")

instance HasCField.HasCField SDL_GamepadBinding_input_hat "hat" where
  type
    CFieldType SDL_GamepadBinding_input_hat "hat" =
      BG.CInt

  offset# :: Proxy# SDL_GamepadBinding_input_hat -> Proxy# "hat" -> Int
offset# = \Proxy# SDL_GamepadBinding_input_hat
_ -> \Proxy# "hat"
_ -> Int
0

-- | [C declaration]: @hat_mask@, defined at @SDL3\/SDL_gamepad.h 285:17@
instance
  (ty ~ BG.CInt)
  => BG.CompatHasField.HasField "hat_mask" SDL_GamepadBinding_input_hat ty
  where
  hasField :: SDL_GamepadBinding_input_hat
-> (ty -> SDL_GamepadBinding_input_hat, ty)
hasField =
    \SDL_GamepadBinding_input_hat
x0 ->
      ( \ty
y1 ->
          SDL_GamepadBinding_input_hat{hat_mask :: CInt
hat_mask = ty
CInt
y1, hat :: CInt
hat = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"hat" SDL_GamepadBinding_input_hat
x0}
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"hat_mask" SDL_GamepadBinding_input_hat
x0
      )

instance
  (ty ~ BG.CInt)
  => BG.HasField "hat_mask" (BG.Ptr SDL_GamepadBinding_input_hat) (BG.Ptr ty)
  where
  getField :: Ptr SDL_GamepadBinding_input_hat -> Ptr ty
getField = Proxy "hat_mask"
-> Ptr SDL_GamepadBinding_input_hat
-> Ptr (CFieldType SDL_GamepadBinding_input_hat "hat_mask")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"hat_mask")

instance HasCField.HasCField SDL_GamepadBinding_input_hat "hat_mask" where
  type
    CFieldType SDL_GamepadBinding_input_hat "hat_mask" =
      BG.CInt

  offset# :: Proxy# SDL_GamepadBinding_input_hat -> Proxy# "hat_mask" -> Int
offset# = \Proxy# SDL_GamepadBinding_input_hat
_ -> \Proxy# "hat_mask"
_ -> Int
4

-- | [C declaration]: @union \@SDL_GamepadBinding_input@, defined at @SDL3\/SDL_gamepad.h 271:5@
newtype SDL_GamepadBinding_input = SDL_GamepadBinding_input
  { SDL_GamepadBinding_input -> ByteArray
unwrap :: BG.ByteArray
  }
  deriving stock ((forall x.
 SDL_GamepadBinding_input -> Rep SDL_GamepadBinding_input x)
-> (forall x.
    Rep SDL_GamepadBinding_input x -> SDL_GamepadBinding_input)
-> Generic SDL_GamepadBinding_input
forall x.
Rep SDL_GamepadBinding_input x -> SDL_GamepadBinding_input
forall x.
SDL_GamepadBinding_input -> Rep SDL_GamepadBinding_input x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
SDL_GamepadBinding_input -> Rep SDL_GamepadBinding_input x
from :: forall x.
SDL_GamepadBinding_input -> Rep SDL_GamepadBinding_input x
$cto :: forall x.
Rep SDL_GamepadBinding_input x -> SDL_GamepadBinding_input
to :: forall x.
Rep SDL_GamepadBinding_input x -> SDL_GamepadBinding_input
BG.Generic)

deriving via BG.SizedByteArray 12 4 instance Marshal.StaticSize SDL_GamepadBinding_input

deriving via BG.SizedByteArray 12 4 instance Marshal.ReadRaw SDL_GamepadBinding_input

deriving via BG.SizedByteArray 12 4 instance Marshal.WriteRaw SDL_GamepadBinding_input

deriving via
  Marshal.EquivStorable SDL_GamepadBinding_input
  instance
    BG.Storable SDL_GamepadBinding_input

deriving via BG.SizedByteArray 12 4 instance Union.IsUnion SDL_GamepadBinding_input

-- | [C declaration]: @button@, defined at @SDL3\/SDL_gamepad.h 273:13@
instance
  (ty ~ BG.CInt)
  => BG.HasField "button" SDL_GamepadBinding_input ty
  where
  getField :: SDL_GamepadBinding_input -> ty
getField = SDL_GamepadBinding_input -> ty
forall payload union.
(Storable payload, Coercible union ByteArray) =>
union -> payload
BG.getUnionPayload

-- | [C declaration]: @button@, defined at @SDL3\/SDL_gamepad.h 273:13@
instance
  (ty ~ BG.CInt)
  => BG.CompatHasField.HasField "button" SDL_GamepadBinding_input ty
  where
  hasField :: SDL_GamepadBinding_input -> (ty -> SDL_GamepadBinding_input, ty)
hasField =
    \SDL_GamepadBinding_input
x0 ->
      ( \ty
y1 ->
          ty -> SDL_GamepadBinding_input -> SDL_GamepadBinding_input
forall payload union.
(Storable payload, Coercible union ByteArray) =>
payload -> union -> union
BG.setUnionPayload ty
y1 SDL_GamepadBinding_input
x0
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"button" SDL_GamepadBinding_input
x0
      )

instance
  (ty ~ BG.CInt)
  => BG.HasField "button" (BG.Ptr SDL_GamepadBinding_input) (BG.Ptr ty)
  where
  getField :: Ptr SDL_GamepadBinding_input -> Ptr ty
getField = Proxy "button"
-> Ptr SDL_GamepadBinding_input
-> Ptr (CFieldType SDL_GamepadBinding_input "button")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"button")

instance HasCField.HasCField SDL_GamepadBinding_input "button" where
  type
    CFieldType SDL_GamepadBinding_input "button" =
      BG.CInt

  offset# :: Proxy# SDL_GamepadBinding_input -> Proxy# "button" -> Int
offset# = \Proxy# SDL_GamepadBinding_input
_ -> \Proxy# "button"
_ -> Int
0

-- | [C declaration]: @axis@, defined at @SDL3\/SDL_gamepad.h 280:11@
instance
  (ty ~ SDL_GamepadBinding_input_axis)
  => BG.HasField "axis" SDL_GamepadBinding_input ty
  where
  getField :: SDL_GamepadBinding_input -> ty
getField = SDL_GamepadBinding_input -> ty
forall payload union.
(Storable payload, Coercible union ByteArray) =>
union -> payload
BG.getUnionPayload

-- | [C declaration]: @axis@, defined at @SDL3\/SDL_gamepad.h 280:11@
instance
  (ty ~ SDL_GamepadBinding_input_axis)
  => BG.CompatHasField.HasField "axis" SDL_GamepadBinding_input ty
  where
  hasField :: SDL_GamepadBinding_input -> (ty -> SDL_GamepadBinding_input, ty)
hasField =
    \SDL_GamepadBinding_input
x0 ->
      ( \ty
y1 ->
          ty -> SDL_GamepadBinding_input -> SDL_GamepadBinding_input
forall payload union.
(Storable payload, Coercible union ByteArray) =>
payload -> union -> union
BG.setUnionPayload ty
y1 SDL_GamepadBinding_input
x0
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"axis" SDL_GamepadBinding_input
x0
      )

instance
  (ty ~ SDL_GamepadBinding_input_axis)
  => BG.HasField "axis" (BG.Ptr SDL_GamepadBinding_input) (BG.Ptr ty)
  where
  getField :: Ptr SDL_GamepadBinding_input -> Ptr ty
getField = Proxy "axis"
-> Ptr SDL_GamepadBinding_input
-> Ptr (CFieldType SDL_GamepadBinding_input "axis")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"axis")

instance HasCField.HasCField SDL_GamepadBinding_input "axis" where
  type
    CFieldType SDL_GamepadBinding_input "axis" =
      SDL_GamepadBinding_input_axis

  offset# :: Proxy# SDL_GamepadBinding_input -> Proxy# "axis" -> Int
offset# = \Proxy# SDL_GamepadBinding_input
_ -> \Proxy# "axis"
_ -> Int
0

-- | [C declaration]: @hat@, defined at @SDL3\/SDL_gamepad.h 286:11@
instance
  (ty ~ SDL_GamepadBinding_input_hat)
  => BG.HasField "hat" SDL_GamepadBinding_input ty
  where
  getField :: SDL_GamepadBinding_input -> ty
getField = SDL_GamepadBinding_input -> ty
forall payload union.
(Storable payload, Coercible union ByteArray) =>
union -> payload
BG.getUnionPayload

-- | [C declaration]: @hat@, defined at @SDL3\/SDL_gamepad.h 286:11@
instance
  (ty ~ SDL_GamepadBinding_input_hat)
  => BG.CompatHasField.HasField "hat" SDL_GamepadBinding_input ty
  where
  hasField :: SDL_GamepadBinding_input -> (ty -> SDL_GamepadBinding_input, ty)
hasField =
    \SDL_GamepadBinding_input
x0 ->
      ( \ty
y1 ->
          ty -> SDL_GamepadBinding_input -> SDL_GamepadBinding_input
forall payload union.
(Storable payload, Coercible union ByteArray) =>
payload -> union -> union
BG.setUnionPayload ty
y1 SDL_GamepadBinding_input
x0
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"hat" SDL_GamepadBinding_input
x0
      )

instance
  (ty ~ SDL_GamepadBinding_input_hat)
  => BG.HasField "hat" (BG.Ptr SDL_GamepadBinding_input) (BG.Ptr ty)
  where
  getField :: Ptr SDL_GamepadBinding_input -> Ptr ty
getField = Proxy "hat"
-> Ptr SDL_GamepadBinding_input
-> Ptr (CFieldType SDL_GamepadBinding_input "hat")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"hat")

instance HasCField.HasCField SDL_GamepadBinding_input "hat" where
  type
    CFieldType SDL_GamepadBinding_input "hat" =
      SDL_GamepadBinding_input_hat

  offset# :: Proxy# SDL_GamepadBinding_input -> Proxy# "hat" -> Int
offset# = \Proxy# SDL_GamepadBinding_input
_ -> \Proxy# "hat"
_ -> Int
0

-- | [C declaration]: @struct \@SDL_GamepadBinding_output_axis@, defined at @SDL3\/SDL_gamepad.h 295:9@
data SDL_GamepadBinding_output_axis = SDL_GamepadBinding_output_axis
  { SDL_GamepadBinding_output_axis -> SDL_GamepadAxis
axis :: SDL_GamepadAxis
  -- ^ [C declaration]: @axis@, defined at @SDL3\/SDL_gamepad.h 297:29@
  , SDL_GamepadBinding_output_axis -> CInt
axis_min :: BG.CInt
  -- ^ [C declaration]: @axis_min@, defined at @SDL3\/SDL_gamepad.h 298:17@
  , SDL_GamepadBinding_output_axis -> CInt
axis_max :: BG.CInt
  -- ^ [C declaration]: @axis_max@, defined at @SDL3\/SDL_gamepad.h 299:17@
  }
  deriving stock ((forall x.
 SDL_GamepadBinding_output_axis
 -> Rep SDL_GamepadBinding_output_axis x)
-> (forall x.
    Rep SDL_GamepadBinding_output_axis x
    -> SDL_GamepadBinding_output_axis)
-> Generic SDL_GamepadBinding_output_axis
forall x.
Rep SDL_GamepadBinding_output_axis x
-> SDL_GamepadBinding_output_axis
forall x.
SDL_GamepadBinding_output_axis
-> Rep SDL_GamepadBinding_output_axis x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
SDL_GamepadBinding_output_axis
-> Rep SDL_GamepadBinding_output_axis x
from :: forall x.
SDL_GamepadBinding_output_axis
-> Rep SDL_GamepadBinding_output_axis x
$cto :: forall x.
Rep SDL_GamepadBinding_output_axis x
-> SDL_GamepadBinding_output_axis
to :: forall x.
Rep SDL_GamepadBinding_output_axis x
-> SDL_GamepadBinding_output_axis
BG.Generic, SDL_GamepadBinding_output_axis
-> SDL_GamepadBinding_output_axis -> Bool
(SDL_GamepadBinding_output_axis
 -> SDL_GamepadBinding_output_axis -> Bool)
-> (SDL_GamepadBinding_output_axis
    -> SDL_GamepadBinding_output_axis -> Bool)
-> Eq SDL_GamepadBinding_output_axis
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SDL_GamepadBinding_output_axis
-> SDL_GamepadBinding_output_axis -> Bool
== :: SDL_GamepadBinding_output_axis
-> SDL_GamepadBinding_output_axis -> Bool
$c/= :: SDL_GamepadBinding_output_axis
-> SDL_GamepadBinding_output_axis -> Bool
/= :: SDL_GamepadBinding_output_axis
-> SDL_GamepadBinding_output_axis -> Bool
Eq, Int -> SDL_GamepadBinding_output_axis -> ShowS
[SDL_GamepadBinding_output_axis] -> ShowS
SDL_GamepadBinding_output_axis -> String
(Int -> SDL_GamepadBinding_output_axis -> ShowS)
-> (SDL_GamepadBinding_output_axis -> String)
-> ([SDL_GamepadBinding_output_axis] -> ShowS)
-> Show SDL_GamepadBinding_output_axis
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SDL_GamepadBinding_output_axis -> ShowS
showsPrec :: Int -> SDL_GamepadBinding_output_axis -> ShowS
$cshow :: SDL_GamepadBinding_output_axis -> String
show :: SDL_GamepadBinding_output_axis -> String
$cshowList :: [SDL_GamepadBinding_output_axis] -> ShowS
showList :: [SDL_GamepadBinding_output_axis] -> ShowS
Show)

instance Marshal.StaticSize SDL_GamepadBinding_output_axis where
  staticSizeOf :: Proxy SDL_GamepadBinding_output_axis -> Int
staticSizeOf = \Proxy SDL_GamepadBinding_output_axis
_ -> (Int
12 :: Int)

  staticAlignment :: Proxy SDL_GamepadBinding_output_axis -> Int
staticAlignment = \Proxy SDL_GamepadBinding_output_axis
_ -> (Int
4 :: Int)

instance Marshal.ReadRaw SDL_GamepadBinding_output_axis where
  readRaw :: Ptr SDL_GamepadBinding_output_axis
-> IO SDL_GamepadBinding_output_axis
readRaw =
    \Ptr SDL_GamepadBinding_output_axis
ptr0 ->
      (SDL_GamepadAxis -> CInt -> CInt -> SDL_GamepadBinding_output_axis)
-> IO
     (SDL_GamepadAxis -> CInt -> CInt -> SDL_GamepadBinding_output_axis)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure SDL_GamepadAxis -> CInt -> CInt -> SDL_GamepadBinding_output_axis
SDL_GamepadBinding_output_axis
        IO
  (SDL_GamepadAxis -> CInt -> CInt -> SDL_GamepadBinding_output_axis)
-> IO SDL_GamepadAxis
-> IO (CInt -> CInt -> SDL_GamepadBinding_output_axis)
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Proxy "axis"
-> Ptr SDL_GamepadBinding_output_axis
-> IO (CFieldType SDL_GamepadBinding_output_axis "axis")
forall a (field :: Symbol).
(HasCField a field, ReadRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> IO (CFieldType a field)
HasCField.readRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"axis") Ptr SDL_GamepadBinding_output_axis
ptr0
        IO (CInt -> CInt -> SDL_GamepadBinding_output_axis)
-> IO CInt -> IO (CInt -> SDL_GamepadBinding_output_axis)
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Proxy "axis_min"
-> Ptr SDL_GamepadBinding_output_axis
-> IO (CFieldType SDL_GamepadBinding_output_axis "axis_min")
forall a (field :: Symbol).
(HasCField a field, ReadRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> IO (CFieldType a field)
HasCField.readRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"axis_min") Ptr SDL_GamepadBinding_output_axis
ptr0
        IO (CInt -> SDL_GamepadBinding_output_axis)
-> IO CInt -> IO SDL_GamepadBinding_output_axis
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Proxy "axis_max"
-> Ptr SDL_GamepadBinding_output_axis
-> IO (CFieldType SDL_GamepadBinding_output_axis "axis_max")
forall a (field :: Symbol).
(HasCField a field, ReadRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> IO (CFieldType a field)
HasCField.readRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"axis_max") Ptr SDL_GamepadBinding_output_axis
ptr0

instance Marshal.WriteRaw SDL_GamepadBinding_output_axis where
  writeRaw :: Ptr SDL_GamepadBinding_output_axis
-> SDL_GamepadBinding_output_axis -> IO ()
writeRaw =
    \Ptr SDL_GamepadBinding_output_axis
ptr0 ->
      \SDL_GamepadBinding_output_axis
s1 ->
        case SDL_GamepadBinding_output_axis
s1 of
          SDL_GamepadBinding_output_axis SDL_GamepadAxis
axis2 CInt
axis_min3 CInt
axis_max4 ->
            Proxy "axis"
-> Ptr SDL_GamepadBinding_output_axis
-> CFieldType SDL_GamepadBinding_output_axis "axis"
-> IO ()
forall a (field :: Symbol).
(HasCField a field, WriteRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> CFieldType a field -> IO ()
HasCField.writeRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"axis") Ptr SDL_GamepadBinding_output_axis
ptr0 CFieldType SDL_GamepadBinding_output_axis "axis"
SDL_GamepadAxis
axis2
              IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Proxy "axis_min"
-> Ptr SDL_GamepadBinding_output_axis
-> CFieldType SDL_GamepadBinding_output_axis "axis_min"
-> IO ()
forall a (field :: Symbol).
(HasCField a field, WriteRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> CFieldType a field -> IO ()
HasCField.writeRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"axis_min") Ptr SDL_GamepadBinding_output_axis
ptr0 CInt
CFieldType SDL_GamepadBinding_output_axis "axis_min"
axis_min3
              IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Proxy "axis_max"
-> Ptr SDL_GamepadBinding_output_axis
-> CFieldType SDL_GamepadBinding_output_axis "axis_max"
-> IO ()
forall a (field :: Symbol).
(HasCField a field, WriteRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> CFieldType a field -> IO ()
HasCField.writeRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"axis_max") Ptr SDL_GamepadBinding_output_axis
ptr0 CInt
CFieldType SDL_GamepadBinding_output_axis "axis_max"
axis_max4

deriving via
  Marshal.EquivStorable SDL_GamepadBinding_output_axis
  instance
    BG.Storable SDL_GamepadBinding_output_axis

deriving via
  Struct.IsStructViaReadRaw SDL_GamepadBinding_output_axis
  instance
    Struct.IsStruct SDL_GamepadBinding_output_axis

-- | [C declaration]: @axis@, defined at @SDL3\/SDL_gamepad.h 297:29@
instance
  (ty ~ SDL_GamepadAxis)
  => BG.CompatHasField.HasField "axis" SDL_GamepadBinding_output_axis ty
  where
  hasField :: SDL_GamepadBinding_output_axis
-> (ty -> SDL_GamepadBinding_output_axis, ty)
hasField =
    \SDL_GamepadBinding_output_axis
x0 ->
      ( \ty
y1 ->
          SDL_GamepadBinding_output_axis
            { axis :: SDL_GamepadAxis
axis = ty
SDL_GamepadAxis
y1
            , axis_min :: CInt
axis_min = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"axis_min" SDL_GamepadBinding_output_axis
x0
            , axis_max :: CInt
axis_max = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"axis_max" SDL_GamepadBinding_output_axis
x0
            }
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"axis" SDL_GamepadBinding_output_axis
x0
      )

instance
  (ty ~ SDL_GamepadAxis)
  => BG.HasField "axis" (BG.Ptr SDL_GamepadBinding_output_axis) (BG.Ptr ty)
  where
  getField :: Ptr SDL_GamepadBinding_output_axis -> Ptr ty
getField = Proxy "axis"
-> Ptr SDL_GamepadBinding_output_axis
-> Ptr (CFieldType SDL_GamepadBinding_output_axis "axis")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"axis")

instance HasCField.HasCField SDL_GamepadBinding_output_axis "axis" where
  type
    CFieldType SDL_GamepadBinding_output_axis "axis" =
      SDL_GamepadAxis

  offset# :: Proxy# SDL_GamepadBinding_output_axis -> Proxy# "axis" -> Int
offset# = \Proxy# SDL_GamepadBinding_output_axis
_ -> \Proxy# "axis"
_ -> Int
0

-- | [C declaration]: @axis_min@, defined at @SDL3\/SDL_gamepad.h 298:17@
instance
  (ty ~ BG.CInt)
  => BG.CompatHasField.HasField "axis_min" SDL_GamepadBinding_output_axis ty
  where
  hasField :: SDL_GamepadBinding_output_axis
-> (ty -> SDL_GamepadBinding_output_axis, ty)
hasField =
    \SDL_GamepadBinding_output_axis
x0 ->
      ( \ty
y1 ->
          SDL_GamepadBinding_output_axis
            { axis_min :: CInt
axis_min = ty
CInt
y1
            , axis :: SDL_GamepadAxis
axis = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"axis" SDL_GamepadBinding_output_axis
x0
            , axis_max :: CInt
axis_max = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"axis_max" SDL_GamepadBinding_output_axis
x0
            }
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"axis_min" SDL_GamepadBinding_output_axis
x0
      )

instance
  (ty ~ BG.CInt)
  => BG.HasField "axis_min" (BG.Ptr SDL_GamepadBinding_output_axis) (BG.Ptr ty)
  where
  getField :: Ptr SDL_GamepadBinding_output_axis -> Ptr ty
getField = Proxy "axis_min"
-> Ptr SDL_GamepadBinding_output_axis
-> Ptr (CFieldType SDL_GamepadBinding_output_axis "axis_min")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"axis_min")

instance HasCField.HasCField SDL_GamepadBinding_output_axis "axis_min" where
  type
    CFieldType SDL_GamepadBinding_output_axis "axis_min" =
      BG.CInt

  offset# :: Proxy# SDL_GamepadBinding_output_axis -> Proxy# "axis_min" -> Int
offset# = \Proxy# SDL_GamepadBinding_output_axis
_ -> \Proxy# "axis_min"
_ -> Int
4

-- | [C declaration]: @axis_max@, defined at @SDL3\/SDL_gamepad.h 299:17@
instance
  (ty ~ BG.CInt)
  => BG.CompatHasField.HasField "axis_max" SDL_GamepadBinding_output_axis ty
  where
  hasField :: SDL_GamepadBinding_output_axis
-> (ty -> SDL_GamepadBinding_output_axis, ty)
hasField =
    \SDL_GamepadBinding_output_axis
x0 ->
      ( \ty
y1 ->
          SDL_GamepadBinding_output_axis
            { axis_max :: CInt
axis_max = ty
CInt
y1
            , axis :: SDL_GamepadAxis
axis = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"axis" SDL_GamepadBinding_output_axis
x0
            , axis_min :: CInt
axis_min = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"axis_min" SDL_GamepadBinding_output_axis
x0
            }
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"axis_max" SDL_GamepadBinding_output_axis
x0
      )

instance
  (ty ~ BG.CInt)
  => BG.HasField "axis_max" (BG.Ptr SDL_GamepadBinding_output_axis) (BG.Ptr ty)
  where
  getField :: Ptr SDL_GamepadBinding_output_axis -> Ptr ty
getField = Proxy "axis_max"
-> Ptr SDL_GamepadBinding_output_axis
-> Ptr (CFieldType SDL_GamepadBinding_output_axis "axis_max")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"axis_max")

instance HasCField.HasCField SDL_GamepadBinding_output_axis "axis_max" where
  type
    CFieldType SDL_GamepadBinding_output_axis "axis_max" =
      BG.CInt

  offset# :: Proxy# SDL_GamepadBinding_output_axis -> Proxy# "axis_max" -> Int
offset# = \Proxy# SDL_GamepadBinding_output_axis
_ -> \Proxy# "axis_max"
_ -> Int
8

-- | [C declaration]: @union \@SDL_GamepadBinding_output@, defined at @SDL3\/SDL_gamepad.h 291:5@
newtype SDL_GamepadBinding_output = SDL_GamepadBinding_output
  { SDL_GamepadBinding_output -> ByteArray
unwrap :: BG.ByteArray
  }
  deriving stock ((forall x.
 SDL_GamepadBinding_output -> Rep SDL_GamepadBinding_output x)
-> (forall x.
    Rep SDL_GamepadBinding_output x -> SDL_GamepadBinding_output)
-> Generic SDL_GamepadBinding_output
forall x.
Rep SDL_GamepadBinding_output x -> SDL_GamepadBinding_output
forall x.
SDL_GamepadBinding_output -> Rep SDL_GamepadBinding_output x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
SDL_GamepadBinding_output -> Rep SDL_GamepadBinding_output x
from :: forall x.
SDL_GamepadBinding_output -> Rep SDL_GamepadBinding_output x
$cto :: forall x.
Rep SDL_GamepadBinding_output x -> SDL_GamepadBinding_output
to :: forall x.
Rep SDL_GamepadBinding_output x -> SDL_GamepadBinding_output
BG.Generic)

deriving via BG.SizedByteArray 12 4 instance Marshal.StaticSize SDL_GamepadBinding_output

deriving via BG.SizedByteArray 12 4 instance Marshal.ReadRaw SDL_GamepadBinding_output

deriving via BG.SizedByteArray 12 4 instance Marshal.WriteRaw SDL_GamepadBinding_output

deriving via
  Marshal.EquivStorable SDL_GamepadBinding_output
  instance
    BG.Storable SDL_GamepadBinding_output

deriving via BG.SizedByteArray 12 4 instance Union.IsUnion SDL_GamepadBinding_output

-- | [C declaration]: @button@, defined at @SDL3\/SDL_gamepad.h 293:27@
instance
  (ty ~ SDL_GamepadButton)
  => BG.HasField "button" SDL_GamepadBinding_output ty
  where
  getField :: SDL_GamepadBinding_output -> ty
getField = SDL_GamepadBinding_output -> ty
forall payload union.
(Storable payload, Coercible union ByteArray) =>
union -> payload
BG.getUnionPayload

-- | [C declaration]: @button@, defined at @SDL3\/SDL_gamepad.h 293:27@
instance
  (ty ~ SDL_GamepadButton)
  => BG.CompatHasField.HasField "button" SDL_GamepadBinding_output ty
  where
  hasField :: SDL_GamepadBinding_output -> (ty -> SDL_GamepadBinding_output, ty)
hasField =
    \SDL_GamepadBinding_output
x0 ->
      ( \ty
y1 ->
          ty -> SDL_GamepadBinding_output -> SDL_GamepadBinding_output
forall payload union.
(Storable payload, Coercible union ByteArray) =>
payload -> union -> union
BG.setUnionPayload ty
y1 SDL_GamepadBinding_output
x0
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"button" SDL_GamepadBinding_output
x0
      )

instance
  (ty ~ SDL_GamepadButton)
  => BG.HasField "button" (BG.Ptr SDL_GamepadBinding_output) (BG.Ptr ty)
  where
  getField :: Ptr SDL_GamepadBinding_output -> Ptr ty
getField = Proxy "button"
-> Ptr SDL_GamepadBinding_output
-> Ptr (CFieldType SDL_GamepadBinding_output "button")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"button")

instance HasCField.HasCField SDL_GamepadBinding_output "button" where
  type
    CFieldType SDL_GamepadBinding_output "button" =
      SDL_GamepadButton

  offset# :: Proxy# SDL_GamepadBinding_output -> Proxy# "button" -> Int
offset# = \Proxy# SDL_GamepadBinding_output
_ -> \Proxy# "button"
_ -> Int
0

-- | [C declaration]: @axis@, defined at @SDL3\/SDL_gamepad.h 300:11@
instance
  (ty ~ SDL_GamepadBinding_output_axis)
  => BG.HasField "axis" SDL_GamepadBinding_output ty
  where
  getField :: SDL_GamepadBinding_output -> ty
getField = SDL_GamepadBinding_output -> ty
forall payload union.
(Storable payload, Coercible union ByteArray) =>
union -> payload
BG.getUnionPayload

-- | [C declaration]: @axis@, defined at @SDL3\/SDL_gamepad.h 300:11@
instance
  (ty ~ SDL_GamepadBinding_output_axis)
  => BG.CompatHasField.HasField "axis" SDL_GamepadBinding_output ty
  where
  hasField :: SDL_GamepadBinding_output -> (ty -> SDL_GamepadBinding_output, ty)
hasField =
    \SDL_GamepadBinding_output
x0 ->
      ( \ty
y1 ->
          ty -> SDL_GamepadBinding_output -> SDL_GamepadBinding_output
forall payload union.
(Storable payload, Coercible union ByteArray) =>
payload -> union -> union
BG.setUnionPayload ty
y1 SDL_GamepadBinding_output
x0
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"axis" SDL_GamepadBinding_output
x0
      )

instance
  (ty ~ SDL_GamepadBinding_output_axis)
  => BG.HasField "axis" (BG.Ptr SDL_GamepadBinding_output) (BG.Ptr ty)
  where
  getField :: Ptr SDL_GamepadBinding_output -> Ptr ty
getField = Proxy "axis"
-> Ptr SDL_GamepadBinding_output
-> Ptr (CFieldType SDL_GamepadBinding_output "axis")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"axis")

instance HasCField.HasCField SDL_GamepadBinding_output "axis" where
  type
    CFieldType SDL_GamepadBinding_output "axis" =
      SDL_GamepadBinding_output_axis

  offset# :: Proxy# SDL_GamepadBinding_output -> Proxy# "axis" -> Int
offset# = \Proxy# SDL_GamepadBinding_output
_ -> \Proxy# "axis"
_ -> Int
0

-- | A mapping between one joystick input to a gamepad control.
--
--     A gamepad has a collection of several bindings, to say, for example, when joystick button number 5 is pressed, that should be treated like the gamepad\'s \"start\" button.
--
--     SDL has these bindings built-in for many popular controllers, and can add more with a simple text string. Those strings are parsed into a collection of these structs to make it easier to operate on the data.
--
--     @since 3.2.0
--
--     [See also]: 'sDL_GetGamepadBindings'
--
--     [C declaration]: @struct SDL_GamepadBinding@, defined at @SDL3\/SDL_gamepad.h 268:16@
data SDL_GamepadBinding = SDL_GamepadBinding
  { SDL_GamepadBinding -> SDL_GamepadBindingType
input_type :: SDL_GamepadBindingType
  -- ^ [C declaration]: @input_type@, defined at @SDL3\/SDL_gamepad.h 270:28@
  , SDL_GamepadBinding -> SDL_GamepadBinding_input
input :: SDL_GamepadBinding_input
  -- ^ [C declaration]: @input@, defined at @SDL3\/SDL_gamepad.h 288:7@
  , SDL_GamepadBinding -> SDL_GamepadBindingType
output_type :: SDL_GamepadBindingType
  -- ^ [C declaration]: @output_type@, defined at @SDL3\/SDL_gamepad.h 290:28@
  , SDL_GamepadBinding -> SDL_GamepadBinding_output
output :: SDL_GamepadBinding_output
  -- ^ [C declaration]: @output@, defined at @SDL3\/SDL_gamepad.h 302:7@
  }
  deriving stock ((forall x. SDL_GamepadBinding -> Rep SDL_GamepadBinding x)
-> (forall x. Rep SDL_GamepadBinding x -> SDL_GamepadBinding)
-> Generic SDL_GamepadBinding
forall x. Rep SDL_GamepadBinding x -> SDL_GamepadBinding
forall x. SDL_GamepadBinding -> Rep SDL_GamepadBinding x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SDL_GamepadBinding -> Rep SDL_GamepadBinding x
from :: forall x. SDL_GamepadBinding -> Rep SDL_GamepadBinding x
$cto :: forall x. Rep SDL_GamepadBinding x -> SDL_GamepadBinding
to :: forall x. Rep SDL_GamepadBinding x -> SDL_GamepadBinding
BG.Generic)

instance Marshal.StaticSize SDL_GamepadBinding where
  staticSizeOf :: Proxy SDL_GamepadBinding -> Int
staticSizeOf = \Proxy SDL_GamepadBinding
_ -> (Int
32 :: Int)

  staticAlignment :: Proxy SDL_GamepadBinding -> Int
staticAlignment = \Proxy SDL_GamepadBinding
_ -> (Int
4 :: Int)

instance Marshal.ReadRaw SDL_GamepadBinding where
  readRaw :: Ptr SDL_GamepadBinding -> IO SDL_GamepadBinding
readRaw =
    \Ptr SDL_GamepadBinding
ptr0 ->
      (SDL_GamepadBindingType
 -> SDL_GamepadBinding_input
 -> SDL_GamepadBindingType
 -> SDL_GamepadBinding_output
 -> SDL_GamepadBinding)
-> IO
     (SDL_GamepadBindingType
      -> SDL_GamepadBinding_input
      -> SDL_GamepadBindingType
      -> SDL_GamepadBinding_output
      -> SDL_GamepadBinding)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure SDL_GamepadBindingType
-> SDL_GamepadBinding_input
-> SDL_GamepadBindingType
-> SDL_GamepadBinding_output
-> SDL_GamepadBinding
SDL_GamepadBinding
        IO
  (SDL_GamepadBindingType
   -> SDL_GamepadBinding_input
   -> SDL_GamepadBindingType
   -> SDL_GamepadBinding_output
   -> SDL_GamepadBinding)
-> IO SDL_GamepadBindingType
-> IO
     (SDL_GamepadBinding_input
      -> SDL_GamepadBindingType
      -> SDL_GamepadBinding_output
      -> SDL_GamepadBinding)
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Proxy "input_type"
-> Ptr SDL_GamepadBinding
-> IO (CFieldType SDL_GamepadBinding "input_type")
forall a (field :: Symbol).
(HasCField a field, ReadRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> IO (CFieldType a field)
HasCField.readRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"input_type") Ptr SDL_GamepadBinding
ptr0
        IO
  (SDL_GamepadBinding_input
   -> SDL_GamepadBindingType
   -> SDL_GamepadBinding_output
   -> SDL_GamepadBinding)
-> IO SDL_GamepadBinding_input
-> IO
     (SDL_GamepadBindingType
      -> SDL_GamepadBinding_output -> SDL_GamepadBinding)
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Proxy "input"
-> Ptr SDL_GamepadBinding
-> IO (CFieldType SDL_GamepadBinding "input")
forall a (field :: Symbol).
(HasCField a field, ReadRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> IO (CFieldType a field)
HasCField.readRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"input") Ptr SDL_GamepadBinding
ptr0
        IO
  (SDL_GamepadBindingType
   -> SDL_GamepadBinding_output -> SDL_GamepadBinding)
-> IO SDL_GamepadBindingType
-> IO (SDL_GamepadBinding_output -> SDL_GamepadBinding)
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Proxy "output_type"
-> Ptr SDL_GamepadBinding
-> IO (CFieldType SDL_GamepadBinding "output_type")
forall a (field :: Symbol).
(HasCField a field, ReadRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> IO (CFieldType a field)
HasCField.readRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"output_type") Ptr SDL_GamepadBinding
ptr0
        IO (SDL_GamepadBinding_output -> SDL_GamepadBinding)
-> IO SDL_GamepadBinding_output -> IO SDL_GamepadBinding
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Proxy "output"
-> Ptr SDL_GamepadBinding
-> IO (CFieldType SDL_GamepadBinding "output")
forall a (field :: Symbol).
(HasCField a field, ReadRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> IO (CFieldType a field)
HasCField.readRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"output") Ptr SDL_GamepadBinding
ptr0

instance Marshal.WriteRaw SDL_GamepadBinding where
  writeRaw :: Ptr SDL_GamepadBinding -> SDL_GamepadBinding -> IO ()
writeRaw =
    \Ptr SDL_GamepadBinding
ptr0 ->
      \SDL_GamepadBinding
s1 ->
        case SDL_GamepadBinding
s1 of
          SDL_GamepadBinding SDL_GamepadBindingType
input_type2 SDL_GamepadBinding_input
input3 SDL_GamepadBindingType
output_type4 SDL_GamepadBinding_output
output5 ->
            Proxy "input_type"
-> Ptr SDL_GamepadBinding
-> CFieldType SDL_GamepadBinding "input_type"
-> IO ()
forall a (field :: Symbol).
(HasCField a field, WriteRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> CFieldType a field -> IO ()
HasCField.writeRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"input_type") Ptr SDL_GamepadBinding
ptr0 CFieldType SDL_GamepadBinding "input_type"
SDL_GamepadBindingType
input_type2
              IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Proxy "input"
-> Ptr SDL_GamepadBinding
-> CFieldType SDL_GamepadBinding "input"
-> IO ()
forall a (field :: Symbol).
(HasCField a field, WriteRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> CFieldType a field -> IO ()
HasCField.writeRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"input") Ptr SDL_GamepadBinding
ptr0 CFieldType SDL_GamepadBinding "input"
SDL_GamepadBinding_input
input3
              IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Proxy "output_type"
-> Ptr SDL_GamepadBinding
-> CFieldType SDL_GamepadBinding "output_type"
-> IO ()
forall a (field :: Symbol).
(HasCField a field, WriteRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> CFieldType a field -> IO ()
HasCField.writeRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"output_type") Ptr SDL_GamepadBinding
ptr0 CFieldType SDL_GamepadBinding "output_type"
SDL_GamepadBindingType
output_type4
              IO () -> IO () -> IO ()
forall a b. IO a -> IO b -> IO b
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> Proxy "output"
-> Ptr SDL_GamepadBinding
-> CFieldType SDL_GamepadBinding "output"
-> IO ()
forall a (field :: Symbol).
(HasCField a field, WriteRaw (CFieldType a field)) =>
Proxy field -> Ptr a -> CFieldType a field -> IO ()
HasCField.writeRaw (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"output") Ptr SDL_GamepadBinding
ptr0 CFieldType SDL_GamepadBinding "output"
SDL_GamepadBinding_output
output5

deriving via Marshal.EquivStorable SDL_GamepadBinding instance BG.Storable SDL_GamepadBinding

deriving via
  Struct.IsStructViaReadRaw SDL_GamepadBinding
  instance
    Struct.IsStruct SDL_GamepadBinding

-- | [C declaration]: @input_type@, defined at @SDL3\/SDL_gamepad.h 270:28@
instance
  (ty ~ SDL_GamepadBindingType)
  => BG.CompatHasField.HasField "input_type" SDL_GamepadBinding ty
  where
  hasField :: SDL_GamepadBinding -> (ty -> SDL_GamepadBinding, ty)
hasField =
    \SDL_GamepadBinding
x0 ->
      ( \ty
y1 ->
          SDL_GamepadBinding
            { input_type :: SDL_GamepadBindingType
input_type = ty
SDL_GamepadBindingType
y1
            , input :: SDL_GamepadBinding_input
input = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"input" SDL_GamepadBinding
x0
            , output_type :: SDL_GamepadBindingType
output_type = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"output_type" SDL_GamepadBinding
x0
            , output :: SDL_GamepadBinding_output
output = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"output" SDL_GamepadBinding
x0
            }
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"input_type" SDL_GamepadBinding
x0
      )

instance
  (ty ~ SDL_GamepadBindingType)
  => BG.HasField "input_type" (BG.Ptr SDL_GamepadBinding) (BG.Ptr ty)
  where
  getField :: Ptr SDL_GamepadBinding -> Ptr ty
getField = Proxy "input_type"
-> Ptr SDL_GamepadBinding
-> Ptr (CFieldType SDL_GamepadBinding "input_type")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"input_type")

instance HasCField.HasCField SDL_GamepadBinding "input_type" where
  type
    CFieldType SDL_GamepadBinding "input_type" =
      SDL_GamepadBindingType

  offset# :: Proxy# SDL_GamepadBinding -> Proxy# "input_type" -> Int
offset# = \Proxy# SDL_GamepadBinding
_ -> \Proxy# "input_type"
_ -> Int
0

-- | [C declaration]: @input@, defined at @SDL3\/SDL_gamepad.h 288:7@
instance
  (ty ~ SDL_GamepadBinding_input)
  => BG.CompatHasField.HasField "input" SDL_GamepadBinding ty
  where
  hasField :: SDL_GamepadBinding -> (ty -> SDL_GamepadBinding, ty)
hasField =
    \SDL_GamepadBinding
x0 ->
      ( \ty
y1 ->
          SDL_GamepadBinding
            { input :: SDL_GamepadBinding_input
input = ty
SDL_GamepadBinding_input
y1
            , input_type :: SDL_GamepadBindingType
input_type = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"input_type" SDL_GamepadBinding
x0
            , output_type :: SDL_GamepadBindingType
output_type = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"output_type" SDL_GamepadBinding
x0
            , output :: SDL_GamepadBinding_output
output = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"output" SDL_GamepadBinding
x0
            }
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"input" SDL_GamepadBinding
x0
      )

instance
  (ty ~ SDL_GamepadBinding_input)
  => BG.HasField "input" (BG.Ptr SDL_GamepadBinding) (BG.Ptr ty)
  where
  getField :: Ptr SDL_GamepadBinding -> Ptr ty
getField = Proxy "input"
-> Ptr SDL_GamepadBinding
-> Ptr (CFieldType SDL_GamepadBinding "input")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"input")

instance HasCField.HasCField SDL_GamepadBinding "input" where
  type
    CFieldType SDL_GamepadBinding "input" =
      SDL_GamepadBinding_input

  offset# :: Proxy# SDL_GamepadBinding -> Proxy# "input" -> Int
offset# = \Proxy# SDL_GamepadBinding
_ -> \Proxy# "input"
_ -> Int
4

-- | [C declaration]: @output_type@, defined at @SDL3\/SDL_gamepad.h 290:28@
instance
  (ty ~ SDL_GamepadBindingType)
  => BG.CompatHasField.HasField "output_type" SDL_GamepadBinding ty
  where
  hasField :: SDL_GamepadBinding -> (ty -> SDL_GamepadBinding, ty)
hasField =
    \SDL_GamepadBinding
x0 ->
      ( \ty
y1 ->
          SDL_GamepadBinding
            { output_type :: SDL_GamepadBindingType
output_type = ty
SDL_GamepadBindingType
y1
            , input_type :: SDL_GamepadBindingType
input_type = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"input_type" SDL_GamepadBinding
x0
            , input :: SDL_GamepadBinding_input
input = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"input" SDL_GamepadBinding
x0
            , output :: SDL_GamepadBinding_output
output = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"output" SDL_GamepadBinding
x0
            }
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"output_type" SDL_GamepadBinding
x0
      )

instance
  (ty ~ SDL_GamepadBindingType)
  => BG.HasField "output_type" (BG.Ptr SDL_GamepadBinding) (BG.Ptr ty)
  where
  getField :: Ptr SDL_GamepadBinding -> Ptr ty
getField =
    Proxy "output_type"
-> Ptr SDL_GamepadBinding
-> Ptr (CFieldType SDL_GamepadBinding "output_type")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"output_type")

instance HasCField.HasCField SDL_GamepadBinding "output_type" where
  type
    CFieldType SDL_GamepadBinding "output_type" =
      SDL_GamepadBindingType

  offset# :: Proxy# SDL_GamepadBinding -> Proxy# "output_type" -> Int
offset# = \Proxy# SDL_GamepadBinding
_ -> \Proxy# "output_type"
_ -> Int
16

-- | [C declaration]: @output@, defined at @SDL3\/SDL_gamepad.h 302:7@
instance
  (ty ~ SDL_GamepadBinding_output)
  => BG.CompatHasField.HasField "output" SDL_GamepadBinding ty
  where
  hasField :: SDL_GamepadBinding -> (ty -> SDL_GamepadBinding, ty)
hasField =
    \SDL_GamepadBinding
x0 ->
      ( \ty
y1 ->
          SDL_GamepadBinding
            { output :: SDL_GamepadBinding_output
output = ty
SDL_GamepadBinding_output
y1
            , input_type :: SDL_GamepadBindingType
input_type = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"input_type" SDL_GamepadBinding
x0
            , input :: SDL_GamepadBinding_input
input = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"input" SDL_GamepadBinding
x0
            , output_type :: SDL_GamepadBindingType
output_type = forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"output_type" SDL_GamepadBinding
x0
            }
      , forall {k} (x :: k) r a. HasField x r a => r -> a
forall (x :: Symbol) r a. HasField x r a => r -> a
BG.getField @"output" SDL_GamepadBinding
x0
      )

instance
  (ty ~ SDL_GamepadBinding_output)
  => BG.HasField "output" (BG.Ptr SDL_GamepadBinding) (BG.Ptr ty)
  where
  getField :: Ptr SDL_GamepadBinding -> Ptr ty
getField = Proxy "output"
-> Ptr SDL_GamepadBinding
-> Ptr (CFieldType SDL_GamepadBinding "output")
forall a (field :: Symbol).
HasCField a field =>
Proxy field -> Ptr a -> Ptr (CFieldType a field)
HasCField.fromPtr (forall {k} (t :: k). Proxy t
forall (t :: Symbol). Proxy t
BG.Proxy @"output")

instance HasCField.HasCField SDL_GamepadBinding "output" where
  type
    CFieldType SDL_GamepadBinding "output" =
      SDL_GamepadBinding_output

  offset# :: Proxy# SDL_GamepadBinding -> Proxy# "output" -> Int
offset# = \Proxy# SDL_GamepadBinding
_ -> \Proxy# "output"
_ -> Int
20