{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DerivingVia #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# 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 realtime clock and date\/time routines.
--
--     There are two data types that are used in this category: SDL_Time, which represents the nanoseconds since a specific moment (an \"epoch\"), and 'SDL_DateTime', which breaks time down into human-understandable components: years, months, days, hours, etc.
--
--     Much of the functionality is involved in converting those two types to other useful forms. A structure holding a calendar date and time broken down into its components.
--
--     @since 3.2.0
module SDL3.Sys.Bindgen.Time (
  SDL3.Sys.Bindgen.Time.SDL_DateTime (..),
  SDL3.Sys.Bindgen.Time.SDL_DateFormat (..),
  pattern SDL3.Sys.Bindgen.Time.SDL_DATE_FORMAT_YYYYMMDD,
  pattern SDL3.Sys.Bindgen.Time.SDL_DATE_FORMAT_DDMMYYYY,
  pattern SDL3.Sys.Bindgen.Time.SDL_DATE_FORMAT_MMDDYYYY,
  SDL3.Sys.Bindgen.Time.SDL_TimeFormat (..),
  pattern SDL3.Sys.Bindgen.Time.SDL_TIME_FORMAT_24HR,
  pattern SDL3.Sys.Bindgen.Time.SDL_TIME_FORMAT_12HR,
)
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

-- | [C declaration]: @struct SDL_DateTime@, defined at @SDL3\/SDL_time.h 54:16@
data SDL_DateTime = SDL_DateTime
  { SDL_DateTime -> CInt
year :: BG.CInt
  -- ^ Year
  --
  --          [C declaration]: @year@, defined at @SDL3\/SDL_time.h 56:9@
  , SDL_DateTime -> CInt
month :: BG.CInt
  -- ^ Month [01-12]
  --
  --          [C declaration]: @month@, defined at @SDL3\/SDL_time.h 57:9@
  , SDL_DateTime -> CInt
day :: BG.CInt
  -- ^ Day of the month [01-31]
  --
  --          [C declaration]: @day@, defined at @SDL3\/SDL_time.h 58:9@
  , SDL_DateTime -> CInt
hour :: BG.CInt
  -- ^ Hour [0-23]
  --
  --          [C declaration]: @hour@, defined at @SDL3\/SDL_time.h 59:9@
  , SDL_DateTime -> CInt
minute :: BG.CInt
  -- ^ Minute [0-59]
  --
  --          [C declaration]: @minute@, defined at @SDL3\/SDL_time.h 60:9@
  , SDL_DateTime -> CInt
second :: BG.CInt
  -- ^ Seconds [0-60]
  --
  --          [C declaration]: @second@, defined at @SDL3\/SDL_time.h 61:9@
  , SDL_DateTime -> CInt
nanosecond :: BG.CInt
  -- ^ Nanoseconds [0-999999999]
  --
  --          [C declaration]: @nanosecond@, defined at @SDL3\/SDL_time.h 62:9@
  , SDL_DateTime -> CInt
day_of_week :: BG.CInt
  -- ^ Day of the week [0-6] (0 being Sunday)
  --
  --          [C declaration]: @day_of_week@, defined at @SDL3\/SDL_time.h 63:9@
  , SDL_DateTime -> CInt
utc_offset :: BG.CInt
  -- ^ Seconds east of UTC
  --
  --          [C declaration]: @utc_offset@, defined at @SDL3\/SDL_time.h 64:9@
  }
  deriving stock ((forall x. SDL_DateTime -> Rep SDL_DateTime x)
-> (forall x. Rep SDL_DateTime x -> SDL_DateTime)
-> Generic SDL_DateTime
forall x. Rep SDL_DateTime x -> SDL_DateTime
forall x. SDL_DateTime -> Rep SDL_DateTime x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SDL_DateTime -> Rep SDL_DateTime x
from :: forall x. SDL_DateTime -> Rep SDL_DateTime x
$cto :: forall x. Rep SDL_DateTime x -> SDL_DateTime
to :: forall x. Rep SDL_DateTime x -> SDL_DateTime
BG.Generic, SDL_DateTime -> SDL_DateTime -> Bool
(SDL_DateTime -> SDL_DateTime -> Bool)
-> (SDL_DateTime -> SDL_DateTime -> Bool) -> Eq SDL_DateTime
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SDL_DateTime -> SDL_DateTime -> Bool
== :: SDL_DateTime -> SDL_DateTime -> Bool
$c/= :: SDL_DateTime -> SDL_DateTime -> Bool
/= :: SDL_DateTime -> SDL_DateTime -> Bool
Eq, Int -> SDL_DateTime -> ShowS
[SDL_DateTime] -> ShowS
SDL_DateTime -> String
(Int -> SDL_DateTime -> ShowS)
-> (SDL_DateTime -> String)
-> ([SDL_DateTime] -> ShowS)
-> Show SDL_DateTime
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SDL_DateTime -> ShowS
showsPrec :: Int -> SDL_DateTime -> ShowS
$cshow :: SDL_DateTime -> String
show :: SDL_DateTime -> String
$cshowList :: [SDL_DateTime] -> ShowS
showList :: [SDL_DateTime] -> ShowS
Show)

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

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

instance Marshal.ReadRaw SDL_DateTime where
  readRaw :: Ptr SDL_DateTime -> IO SDL_DateTime
readRaw =
    \Ptr SDL_DateTime
ptr0 ->
      (CInt
 -> CInt
 -> CInt
 -> CInt
 -> CInt
 -> CInt
 -> CInt
 -> CInt
 -> CInt
 -> SDL_DateTime)
-> IO
     (CInt
      -> CInt
      -> CInt
      -> CInt
      -> CInt
      -> CInt
      -> CInt
      -> CInt
      -> CInt
      -> SDL_DateTime)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure CInt
-> CInt
-> CInt
-> CInt
-> CInt
-> CInt
-> CInt
-> CInt
-> CInt
-> SDL_DateTime
SDL_DateTime
        IO
  (CInt
   -> CInt
   -> CInt
   -> CInt
   -> CInt
   -> CInt
   -> CInt
   -> CInt
   -> CInt
   -> SDL_DateTime)
-> IO CInt
-> IO
     (CInt
      -> CInt
      -> CInt
      -> CInt
      -> CInt
      -> CInt
      -> CInt
      -> CInt
      -> SDL_DateTime)
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Proxy "year"
-> Ptr SDL_DateTime -> IO (CFieldType SDL_DateTime "year")
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 @"year") Ptr SDL_DateTime
ptr0
        IO
  (CInt
   -> CInt
   -> CInt
   -> CInt
   -> CInt
   -> CInt
   -> CInt
   -> CInt
   -> SDL_DateTime)
-> IO CInt
-> IO
     (CInt
      -> CInt -> CInt -> CInt -> CInt -> CInt -> CInt -> SDL_DateTime)
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Proxy "month"
-> Ptr SDL_DateTime -> IO (CFieldType SDL_DateTime "month")
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 @"month") Ptr SDL_DateTime
ptr0
        IO
  (CInt
   -> CInt -> CInt -> CInt -> CInt -> CInt -> CInt -> SDL_DateTime)
-> IO CInt
-> IO
     (CInt -> CInt -> CInt -> CInt -> CInt -> CInt -> SDL_DateTime)
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Proxy "day"
-> Ptr SDL_DateTime -> IO (CFieldType SDL_DateTime "day")
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 @"day") Ptr SDL_DateTime
ptr0
        IO (CInt -> CInt -> CInt -> CInt -> CInt -> CInt -> SDL_DateTime)
-> IO CInt
-> IO (CInt -> CInt -> CInt -> CInt -> CInt -> SDL_DateTime)
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Proxy "hour"
-> Ptr SDL_DateTime -> IO (CFieldType SDL_DateTime "hour")
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 @"hour") Ptr SDL_DateTime
ptr0
        IO (CInt -> CInt -> CInt -> CInt -> CInt -> SDL_DateTime)
-> IO CInt -> IO (CInt -> CInt -> CInt -> CInt -> SDL_DateTime)
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Proxy "minute"
-> Ptr SDL_DateTime -> IO (CFieldType SDL_DateTime "minute")
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 @"minute") Ptr SDL_DateTime
ptr0
        IO (CInt -> CInt -> CInt -> CInt -> SDL_DateTime)
-> IO CInt -> IO (CInt -> CInt -> CInt -> SDL_DateTime)
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Proxy "second"
-> Ptr SDL_DateTime -> IO (CFieldType SDL_DateTime "second")
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 @"second") Ptr SDL_DateTime
ptr0
        IO (CInt -> CInt -> CInt -> SDL_DateTime)
-> IO CInt -> IO (CInt -> CInt -> SDL_DateTime)
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Proxy "nanosecond"
-> Ptr SDL_DateTime -> IO (CFieldType SDL_DateTime "nanosecond")
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 @"nanosecond") Ptr SDL_DateTime
ptr0
        IO (CInt -> CInt -> SDL_DateTime)
-> IO CInt -> IO (CInt -> SDL_DateTime)
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Proxy "day_of_week"
-> Ptr SDL_DateTime -> IO (CFieldType SDL_DateTime "day_of_week")
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 @"day_of_week") Ptr SDL_DateTime
ptr0
        IO (CInt -> SDL_DateTime) -> IO CInt -> IO SDL_DateTime
forall a b. IO (a -> b) -> IO a -> IO b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Proxy "utc_offset"
-> Ptr SDL_DateTime -> IO (CFieldType SDL_DateTime "utc_offset")
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 @"utc_offset") Ptr SDL_DateTime
ptr0

instance Marshal.WriteRaw SDL_DateTime where
  writeRaw :: Ptr SDL_DateTime -> SDL_DateTime -> IO ()
writeRaw =
    \Ptr SDL_DateTime
ptr0 ->
      \SDL_DateTime
s1 ->
        case SDL_DateTime
s1 of
          SDL_DateTime
            CInt
year2
            CInt
month3
            CInt
day4
            CInt
hour5
            CInt
minute6
            CInt
second7
            CInt
nanosecond8
            CInt
day_of_week9
            CInt
utc_offset10 ->
              Proxy "year"
-> Ptr SDL_DateTime -> CFieldType SDL_DateTime "year" -> 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 @"year") Ptr SDL_DateTime
ptr0 CInt
CFieldType SDL_DateTime "year"
year2
                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 "month"
-> Ptr SDL_DateTime -> CFieldType SDL_DateTime "month" -> 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 @"month") Ptr SDL_DateTime
ptr0 CInt
CFieldType SDL_DateTime "month"
month3
                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 "day"
-> Ptr SDL_DateTime -> CFieldType SDL_DateTime "day" -> 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 @"day") Ptr SDL_DateTime
ptr0 CInt
CFieldType SDL_DateTime "day"
day4
                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 "hour"
-> Ptr SDL_DateTime -> CFieldType SDL_DateTime "hour" -> 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 @"hour") Ptr SDL_DateTime
ptr0 CInt
CFieldType SDL_DateTime "hour"
hour5
                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 "minute"
-> Ptr SDL_DateTime -> CFieldType SDL_DateTime "minute" -> 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 @"minute") Ptr SDL_DateTime
ptr0 CInt
CFieldType SDL_DateTime "minute"
minute6
                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 "second"
-> Ptr SDL_DateTime -> CFieldType SDL_DateTime "second" -> 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 @"second") Ptr SDL_DateTime
ptr0 CInt
CFieldType SDL_DateTime "second"
second7
                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 "nanosecond"
-> Ptr SDL_DateTime
-> CFieldType SDL_DateTime "nanosecond"
-> 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 @"nanosecond") Ptr SDL_DateTime
ptr0 CInt
CFieldType SDL_DateTime "nanosecond"
nanosecond8
                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 "day_of_week"
-> Ptr SDL_DateTime
-> CFieldType SDL_DateTime "day_of_week"
-> 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 @"day_of_week") Ptr SDL_DateTime
ptr0 CInt
CFieldType SDL_DateTime "day_of_week"
day_of_week9
                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 "utc_offset"
-> Ptr SDL_DateTime
-> CFieldType SDL_DateTime "utc_offset"
-> 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 @"utc_offset") Ptr SDL_DateTime
ptr0 CInt
CFieldType SDL_DateTime "utc_offset"
utc_offset10

deriving via Marshal.EquivStorable SDL_DateTime instance BG.Storable SDL_DateTime

deriving via Struct.IsStructViaReadRaw SDL_DateTime instance Struct.IsStruct SDL_DateTime

-- | Year
--
--     [C declaration]: @year@, defined at @SDL3\/SDL_time.h 56:9@
instance
  (ty ~ BG.CInt)
  => BG.CompatHasField.HasField "year" SDL_DateTime ty
  where
  hasField :: SDL_DateTime -> (ty -> SDL_DateTime, ty)
hasField =
    \SDL_DateTime
x0 ->
      ( \ty
y1 ->
          SDL_DateTime
            { year :: CInt
year = ty
CInt
y1
            , month :: CInt
month = 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 @"month" SDL_DateTime
x0
            , day :: CInt
day = 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 @"day" SDL_DateTime
x0
            , hour :: CInt
hour = 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 @"hour" SDL_DateTime
x0
            , minute :: CInt
minute = 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 @"minute" SDL_DateTime
x0
            , second :: CInt
second = 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 @"second" SDL_DateTime
x0
            , nanosecond :: CInt
nanosecond = 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 @"nanosecond" SDL_DateTime
x0
            , day_of_week :: CInt
day_of_week = 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 @"day_of_week" SDL_DateTime
x0
            , utc_offset :: CInt
utc_offset = 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 @"utc_offset" SDL_DateTime
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 @"year" SDL_DateTime
x0
      )

instance
  (ty ~ BG.CInt)
  => BG.HasField "year" (BG.Ptr SDL_DateTime) (BG.Ptr ty)
  where
  getField :: Ptr SDL_DateTime -> Ptr ty
getField = Proxy "year"
-> Ptr SDL_DateTime -> Ptr (CFieldType SDL_DateTime "year")
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 @"year")

instance HasCField.HasCField SDL_DateTime "year" where
  type CFieldType SDL_DateTime "year" = BG.CInt

  offset# :: Proxy# SDL_DateTime -> Proxy# "year" -> Int
offset# = \Proxy# SDL_DateTime
_ -> \Proxy# "year"
_ -> Int
0

-- | Month [01-12]
--
--     [C declaration]: @month@, defined at @SDL3\/SDL_time.h 57:9@
instance
  (ty ~ BG.CInt)
  => BG.CompatHasField.HasField "month" SDL_DateTime ty
  where
  hasField :: SDL_DateTime -> (ty -> SDL_DateTime, ty)
hasField =
    \SDL_DateTime
x0 ->
      ( \ty
y1 ->
          SDL_DateTime
            { month :: CInt
month = ty
CInt
y1
            , year :: CInt
year = 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 @"year" SDL_DateTime
x0
            , day :: CInt
day = 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 @"day" SDL_DateTime
x0
            , hour :: CInt
hour = 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 @"hour" SDL_DateTime
x0
            , minute :: CInt
minute = 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 @"minute" SDL_DateTime
x0
            , second :: CInt
second = 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 @"second" SDL_DateTime
x0
            , nanosecond :: CInt
nanosecond = 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 @"nanosecond" SDL_DateTime
x0
            , day_of_week :: CInt
day_of_week = 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 @"day_of_week" SDL_DateTime
x0
            , utc_offset :: CInt
utc_offset = 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 @"utc_offset" SDL_DateTime
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 @"month" SDL_DateTime
x0
      )

instance
  (ty ~ BG.CInt)
  => BG.HasField "month" (BG.Ptr SDL_DateTime) (BG.Ptr ty)
  where
  getField :: Ptr SDL_DateTime -> Ptr ty
getField = Proxy "month"
-> Ptr SDL_DateTime -> Ptr (CFieldType SDL_DateTime "month")
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 @"month")

instance HasCField.HasCField SDL_DateTime "month" where
  type CFieldType SDL_DateTime "month" = BG.CInt

  offset# :: Proxy# SDL_DateTime -> Proxy# "month" -> Int
offset# = \Proxy# SDL_DateTime
_ -> \Proxy# "month"
_ -> Int
4

-- | Day of the month [01-31]
--
--     [C declaration]: @day@, defined at @SDL3\/SDL_time.h 58:9@
instance
  (ty ~ BG.CInt)
  => BG.CompatHasField.HasField "day" SDL_DateTime ty
  where
  hasField :: SDL_DateTime -> (ty -> SDL_DateTime, ty)
hasField =
    \SDL_DateTime
x0 ->
      ( \ty
y1 ->
          SDL_DateTime
            { day :: CInt
day = ty
CInt
y1
            , year :: CInt
year = 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 @"year" SDL_DateTime
x0
            , month :: CInt
month = 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 @"month" SDL_DateTime
x0
            , hour :: CInt
hour = 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 @"hour" SDL_DateTime
x0
            , minute :: CInt
minute = 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 @"minute" SDL_DateTime
x0
            , second :: CInt
second = 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 @"second" SDL_DateTime
x0
            , nanosecond :: CInt
nanosecond = 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 @"nanosecond" SDL_DateTime
x0
            , day_of_week :: CInt
day_of_week = 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 @"day_of_week" SDL_DateTime
x0
            , utc_offset :: CInt
utc_offset = 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 @"utc_offset" SDL_DateTime
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 @"day" SDL_DateTime
x0
      )

instance
  (ty ~ BG.CInt)
  => BG.HasField "day" (BG.Ptr SDL_DateTime) (BG.Ptr ty)
  where
  getField :: Ptr SDL_DateTime -> Ptr ty
getField = Proxy "day"
-> Ptr SDL_DateTime -> Ptr (CFieldType SDL_DateTime "day")
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 @"day")

instance HasCField.HasCField SDL_DateTime "day" where
  type CFieldType SDL_DateTime "day" = BG.CInt

  offset# :: Proxy# SDL_DateTime -> Proxy# "day" -> Int
offset# = \Proxy# SDL_DateTime
_ -> \Proxy# "day"
_ -> Int
8

-- | Hour [0-23]
--
--     [C declaration]: @hour@, defined at @SDL3\/SDL_time.h 59:9@
instance
  (ty ~ BG.CInt)
  => BG.CompatHasField.HasField "hour" SDL_DateTime ty
  where
  hasField :: SDL_DateTime -> (ty -> SDL_DateTime, ty)
hasField =
    \SDL_DateTime
x0 ->
      ( \ty
y1 ->
          SDL_DateTime
            { hour :: CInt
hour = ty
CInt
y1
            , year :: CInt
year = 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 @"year" SDL_DateTime
x0
            , month :: CInt
month = 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 @"month" SDL_DateTime
x0
            , day :: CInt
day = 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 @"day" SDL_DateTime
x0
            , minute :: CInt
minute = 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 @"minute" SDL_DateTime
x0
            , second :: CInt
second = 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 @"second" SDL_DateTime
x0
            , nanosecond :: CInt
nanosecond = 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 @"nanosecond" SDL_DateTime
x0
            , day_of_week :: CInt
day_of_week = 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 @"day_of_week" SDL_DateTime
x0
            , utc_offset :: CInt
utc_offset = 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 @"utc_offset" SDL_DateTime
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 @"hour" SDL_DateTime
x0
      )

instance
  (ty ~ BG.CInt)
  => BG.HasField "hour" (BG.Ptr SDL_DateTime) (BG.Ptr ty)
  where
  getField :: Ptr SDL_DateTime -> Ptr ty
getField = Proxy "hour"
-> Ptr SDL_DateTime -> Ptr (CFieldType SDL_DateTime "hour")
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 @"hour")

instance HasCField.HasCField SDL_DateTime "hour" where
  type CFieldType SDL_DateTime "hour" = BG.CInt

  offset# :: Proxy# SDL_DateTime -> Proxy# "hour" -> Int
offset# = \Proxy# SDL_DateTime
_ -> \Proxy# "hour"
_ -> Int
12

-- | Minute [0-59]
--
--     [C declaration]: @minute@, defined at @SDL3\/SDL_time.h 60:9@
instance
  (ty ~ BG.CInt)
  => BG.CompatHasField.HasField "minute" SDL_DateTime ty
  where
  hasField :: SDL_DateTime -> (ty -> SDL_DateTime, ty)
hasField =
    \SDL_DateTime
x0 ->
      ( \ty
y1 ->
          SDL_DateTime
            { minute :: CInt
minute = ty
CInt
y1
            , year :: CInt
year = 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 @"year" SDL_DateTime
x0
            , month :: CInt
month = 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 @"month" SDL_DateTime
x0
            , day :: CInt
day = 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 @"day" SDL_DateTime
x0
            , hour :: CInt
hour = 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 @"hour" SDL_DateTime
x0
            , second :: CInt
second = 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 @"second" SDL_DateTime
x0
            , nanosecond :: CInt
nanosecond = 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 @"nanosecond" SDL_DateTime
x0
            , day_of_week :: CInt
day_of_week = 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 @"day_of_week" SDL_DateTime
x0
            , utc_offset :: CInt
utc_offset = 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 @"utc_offset" SDL_DateTime
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 @"minute" SDL_DateTime
x0
      )

instance
  (ty ~ BG.CInt)
  => BG.HasField "minute" (BG.Ptr SDL_DateTime) (BG.Ptr ty)
  where
  getField :: Ptr SDL_DateTime -> Ptr ty
getField = Proxy "minute"
-> Ptr SDL_DateTime -> Ptr (CFieldType SDL_DateTime "minute")
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 @"minute")

instance HasCField.HasCField SDL_DateTime "minute" where
  type CFieldType SDL_DateTime "minute" = BG.CInt

  offset# :: Proxy# SDL_DateTime -> Proxy# "minute" -> Int
offset# = \Proxy# SDL_DateTime
_ -> \Proxy# "minute"
_ -> Int
16

-- | Seconds [0-60]
--
--     [C declaration]: @second@, defined at @SDL3\/SDL_time.h 61:9@
instance
  (ty ~ BG.CInt)
  => BG.CompatHasField.HasField "second" SDL_DateTime ty
  where
  hasField :: SDL_DateTime -> (ty -> SDL_DateTime, ty)
hasField =
    \SDL_DateTime
x0 ->
      ( \ty
y1 ->
          SDL_DateTime
            { second :: CInt
second = ty
CInt
y1
            , year :: CInt
year = 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 @"year" SDL_DateTime
x0
            , month :: CInt
month = 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 @"month" SDL_DateTime
x0
            , day :: CInt
day = 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 @"day" SDL_DateTime
x0
            , hour :: CInt
hour = 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 @"hour" SDL_DateTime
x0
            , minute :: CInt
minute = 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 @"minute" SDL_DateTime
x0
            , nanosecond :: CInt
nanosecond = 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 @"nanosecond" SDL_DateTime
x0
            , day_of_week :: CInt
day_of_week = 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 @"day_of_week" SDL_DateTime
x0
            , utc_offset :: CInt
utc_offset = 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 @"utc_offset" SDL_DateTime
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 @"second" SDL_DateTime
x0
      )

instance
  (ty ~ BG.CInt)
  => BG.HasField "second" (BG.Ptr SDL_DateTime) (BG.Ptr ty)
  where
  getField :: Ptr SDL_DateTime -> Ptr ty
getField = Proxy "second"
-> Ptr SDL_DateTime -> Ptr (CFieldType SDL_DateTime "second")
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 @"second")

instance HasCField.HasCField SDL_DateTime "second" where
  type CFieldType SDL_DateTime "second" = BG.CInt

  offset# :: Proxy# SDL_DateTime -> Proxy# "second" -> Int
offset# = \Proxy# SDL_DateTime
_ -> \Proxy# "second"
_ -> Int
20

-- | Nanoseconds [0-999999999]
--
--     [C declaration]: @nanosecond@, defined at @SDL3\/SDL_time.h 62:9@
instance
  (ty ~ BG.CInt)
  => BG.CompatHasField.HasField "nanosecond" SDL_DateTime ty
  where
  hasField :: SDL_DateTime -> (ty -> SDL_DateTime, ty)
hasField =
    \SDL_DateTime
x0 ->
      ( \ty
y1 ->
          SDL_DateTime
            { nanosecond :: CInt
nanosecond = ty
CInt
y1
            , year :: CInt
year = 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 @"year" SDL_DateTime
x0
            , month :: CInt
month = 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 @"month" SDL_DateTime
x0
            , day :: CInt
day = 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 @"day" SDL_DateTime
x0
            , hour :: CInt
hour = 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 @"hour" SDL_DateTime
x0
            , minute :: CInt
minute = 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 @"minute" SDL_DateTime
x0
            , second :: CInt
second = 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 @"second" SDL_DateTime
x0
            , day_of_week :: CInt
day_of_week = 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 @"day_of_week" SDL_DateTime
x0
            , utc_offset :: CInt
utc_offset = 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 @"utc_offset" SDL_DateTime
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 @"nanosecond" SDL_DateTime
x0
      )

instance
  (ty ~ BG.CInt)
  => BG.HasField "nanosecond" (BG.Ptr SDL_DateTime) (BG.Ptr ty)
  where
  getField :: Ptr SDL_DateTime -> Ptr ty
getField = Proxy "nanosecond"
-> Ptr SDL_DateTime -> Ptr (CFieldType SDL_DateTime "nanosecond")
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 @"nanosecond")

instance HasCField.HasCField SDL_DateTime "nanosecond" where
  type CFieldType SDL_DateTime "nanosecond" = BG.CInt

  offset# :: Proxy# SDL_DateTime -> Proxy# "nanosecond" -> Int
offset# = \Proxy# SDL_DateTime
_ -> \Proxy# "nanosecond"
_ -> Int
24

-- | Day of the week [0-6] (0 being Sunday)
--
--     [C declaration]: @day_of_week@, defined at @SDL3\/SDL_time.h 63:9@
instance
  (ty ~ BG.CInt)
  => BG.CompatHasField.HasField "day_of_week" SDL_DateTime ty
  where
  hasField :: SDL_DateTime -> (ty -> SDL_DateTime, ty)
hasField =
    \SDL_DateTime
x0 ->
      ( \ty
y1 ->
          SDL_DateTime
            { day_of_week :: CInt
day_of_week = ty
CInt
y1
            , year :: CInt
year = 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 @"year" SDL_DateTime
x0
            , month :: CInt
month = 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 @"month" SDL_DateTime
x0
            , day :: CInt
day = 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 @"day" SDL_DateTime
x0
            , hour :: CInt
hour = 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 @"hour" SDL_DateTime
x0
            , minute :: CInt
minute = 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 @"minute" SDL_DateTime
x0
            , second :: CInt
second = 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 @"second" SDL_DateTime
x0
            , nanosecond :: CInt
nanosecond = 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 @"nanosecond" SDL_DateTime
x0
            , utc_offset :: CInt
utc_offset = 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 @"utc_offset" SDL_DateTime
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 @"day_of_week" SDL_DateTime
x0
      )

instance
  (ty ~ BG.CInt)
  => BG.HasField "day_of_week" (BG.Ptr SDL_DateTime) (BG.Ptr ty)
  where
  getField :: Ptr SDL_DateTime -> Ptr ty
getField =
    Proxy "day_of_week"
-> Ptr SDL_DateTime -> Ptr (CFieldType SDL_DateTime "day_of_week")
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 @"day_of_week")

instance HasCField.HasCField SDL_DateTime "day_of_week" where
  type CFieldType SDL_DateTime "day_of_week" = BG.CInt

  offset# :: Proxy# SDL_DateTime -> Proxy# "day_of_week" -> Int
offset# = \Proxy# SDL_DateTime
_ -> \Proxy# "day_of_week"
_ -> Int
28

-- | Seconds east of UTC
--
--     [C declaration]: @utc_offset@, defined at @SDL3\/SDL_time.h 64:9@
instance
  (ty ~ BG.CInt)
  => BG.CompatHasField.HasField "utc_offset" SDL_DateTime ty
  where
  hasField :: SDL_DateTime -> (ty -> SDL_DateTime, ty)
hasField =
    \SDL_DateTime
x0 ->
      ( \ty
y1 ->
          SDL_DateTime
            { utc_offset :: CInt
utc_offset = ty
CInt
y1
            , year :: CInt
year = 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 @"year" SDL_DateTime
x0
            , month :: CInt
month = 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 @"month" SDL_DateTime
x0
            , day :: CInt
day = 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 @"day" SDL_DateTime
x0
            , hour :: CInt
hour = 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 @"hour" SDL_DateTime
x0
            , minute :: CInt
minute = 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 @"minute" SDL_DateTime
x0
            , second :: CInt
second = 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 @"second" SDL_DateTime
x0
            , nanosecond :: CInt
nanosecond = 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 @"nanosecond" SDL_DateTime
x0
            , day_of_week :: CInt
day_of_week = 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 @"day_of_week" SDL_DateTime
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 @"utc_offset" SDL_DateTime
x0
      )

instance
  (ty ~ BG.CInt)
  => BG.HasField "utc_offset" (BG.Ptr SDL_DateTime) (BG.Ptr ty)
  where
  getField :: Ptr SDL_DateTime -> Ptr ty
getField = Proxy "utc_offset"
-> Ptr SDL_DateTime -> Ptr (CFieldType SDL_DateTime "utc_offset")
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 @"utc_offset")

instance HasCField.HasCField SDL_DateTime "utc_offset" where
  type CFieldType SDL_DateTime "utc_offset" = BG.CInt

  offset# :: Proxy# SDL_DateTime -> Proxy# "utc_offset" -> Int
offset# = \Proxy# SDL_DateTime
_ -> \Proxy# "utc_offset"
_ -> Int
32

-- | The preferred date format of the current system locale.
--
--     @since 3.2.0
--
--     [See also]: 'sDL_GetDateTimeLocalePreferences'
--
--     [C declaration]: @enum SDL_DateFormat@, defined at @SDL3\/SDL_time.h 74:14@
newtype SDL_DateFormat = SDL_DateFormat
  { SDL_DateFormat -> CUInt
unwrap :: BG.CUInt
  }
  deriving stock ((forall x. SDL_DateFormat -> Rep SDL_DateFormat x)
-> (forall x. Rep SDL_DateFormat x -> SDL_DateFormat)
-> Generic SDL_DateFormat
forall x. Rep SDL_DateFormat x -> SDL_DateFormat
forall x. SDL_DateFormat -> Rep SDL_DateFormat x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SDL_DateFormat -> Rep SDL_DateFormat x
from :: forall x. SDL_DateFormat -> Rep SDL_DateFormat x
$cto :: forall x. Rep SDL_DateFormat x -> SDL_DateFormat
to :: forall x. Rep SDL_DateFormat x -> SDL_DateFormat
BG.Generic, SDL_DateFormat -> SDL_DateFormat -> Bool
(SDL_DateFormat -> SDL_DateFormat -> Bool)
-> (SDL_DateFormat -> SDL_DateFormat -> Bool) -> Eq SDL_DateFormat
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SDL_DateFormat -> SDL_DateFormat -> Bool
== :: SDL_DateFormat -> SDL_DateFormat -> Bool
$c/= :: SDL_DateFormat -> SDL_DateFormat -> Bool
/= :: SDL_DateFormat -> SDL_DateFormat -> Bool
Eq, Eq SDL_DateFormat
Eq SDL_DateFormat =>
(SDL_DateFormat -> SDL_DateFormat -> Ordering)
-> (SDL_DateFormat -> SDL_DateFormat -> Bool)
-> (SDL_DateFormat -> SDL_DateFormat -> Bool)
-> (SDL_DateFormat -> SDL_DateFormat -> Bool)
-> (SDL_DateFormat -> SDL_DateFormat -> Bool)
-> (SDL_DateFormat -> SDL_DateFormat -> SDL_DateFormat)
-> (SDL_DateFormat -> SDL_DateFormat -> SDL_DateFormat)
-> Ord SDL_DateFormat
SDL_DateFormat -> SDL_DateFormat -> Bool
SDL_DateFormat -> SDL_DateFormat -> Ordering
SDL_DateFormat -> SDL_DateFormat -> SDL_DateFormat
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_DateFormat -> SDL_DateFormat -> Ordering
compare :: SDL_DateFormat -> SDL_DateFormat -> Ordering
$c< :: SDL_DateFormat -> SDL_DateFormat -> Bool
< :: SDL_DateFormat -> SDL_DateFormat -> Bool
$c<= :: SDL_DateFormat -> SDL_DateFormat -> Bool
<= :: SDL_DateFormat -> SDL_DateFormat -> Bool
$c> :: SDL_DateFormat -> SDL_DateFormat -> Bool
> :: SDL_DateFormat -> SDL_DateFormat -> Bool
$c>= :: SDL_DateFormat -> SDL_DateFormat -> Bool
>= :: SDL_DateFormat -> SDL_DateFormat -> Bool
$cmax :: SDL_DateFormat -> SDL_DateFormat -> SDL_DateFormat
max :: SDL_DateFormat -> SDL_DateFormat -> SDL_DateFormat
$cmin :: SDL_DateFormat -> SDL_DateFormat -> SDL_DateFormat
min :: SDL_DateFormat -> SDL_DateFormat -> SDL_DateFormat
Ord)
  deriving newtype (FFIType SDL_DateFormat -> SDL_DateFormat
SDL_DateFormat -> FFIType SDL_DateFormat
(SDL_DateFormat -> FFIType SDL_DateFormat)
-> (FFIType SDL_DateFormat -> SDL_DateFormat)
-> HasFFIType SDL_DateFormat
forall a. (a -> FFIType a) -> (FFIType a -> a) -> HasFFIType a
$ctoFFIType :: SDL_DateFormat -> FFIType SDL_DateFormat
toFFIType :: SDL_DateFormat -> FFIType SDL_DateFormat
$cfromFFIType :: FFIType SDL_DateFormat -> SDL_DateFormat
fromFFIType :: FFIType SDL_DateFormat -> SDL_DateFormat
BG.HasFFIType)

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

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

instance Marshal.ReadRaw SDL_DateFormat where
  readRaw :: Ptr SDL_DateFormat -> IO SDL_DateFormat
readRaw =
    \Ptr SDL_DateFormat
ptr0 ->
      (CUInt -> SDL_DateFormat) -> IO (CUInt -> SDL_DateFormat)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure CUInt -> SDL_DateFormat
SDL_DateFormat
        IO (CUInt -> SDL_DateFormat) -> IO CUInt -> IO SDL_DateFormat
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_DateFormat -> Int -> IO CUInt
forall a b. ReadRaw a => Ptr b -> Int -> IO a
Marshal.readRawByteOff Ptr SDL_DateFormat
ptr0 (Int
0 :: Int)

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

deriving via Marshal.EquivStorable SDL_DateFormat instance BG.Storable SDL_DateFormat

deriving via BG.CUInt instance BG.Prim SDL_DateFormat

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

  toCEnum :: CEnumZ SDL_DateFormat -> SDL_DateFormat
toCEnum = CUInt -> SDL_DateFormat
CEnumZ SDL_DateFormat -> SDL_DateFormat
SDL_DateFormat

  fromCEnum :: SDL_DateFormat -> CEnumZ SDL_DateFormat
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_DateFormat -> DeclaredValues SDL_DateFormat
declaredValues =
    \proxy SDL_DateFormat
_ ->
      [(CEnumZ SDL_DateFormat, NonEmpty String)]
-> DeclaredValues SDL_DateFormat
forall a.
Ord (CEnumZ a) =>
[(CEnumZ a, NonEmpty String)] -> DeclaredValues a
CEnum.declaredValuesFromList
        [ (CUInt
CEnumZ SDL_DateFormat
0, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_DATE_FORMAT_YYYYMMDD")
        , (CUInt
CEnumZ SDL_DateFormat
1, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_DATE_FORMAT_DDMMYYYY")
        , (CUInt
CEnumZ SDL_DateFormat
2, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_DATE_FORMAT_MMDDYYYY")
        ]

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

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

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

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

instance CEnum.SequentialCEnum SDL_DateFormat where
  minDeclaredValue :: SDL_DateFormat
minDeclaredValue = SDL_DateFormat
SDL_DATE_FORMAT_YYYYMMDD

  maxDeclaredValue :: SDL_DateFormat
maxDeclaredValue = SDL_DateFormat
SDL_DATE_FORMAT_MMDDYYYY

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

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

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

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

instance
  (ty ~ BG.CUInt)
  => BG.CompatHasField.HasField "unwrap" SDL_DateFormat ty
  where
  hasField :: SDL_DateFormat -> (ty -> SDL_DateFormat, ty)
hasField =
    \SDL_DateFormat
x0 ->
      ( \ty
y1 ->
          SDL_DateFormat{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_DateFormat
x0
      )

instance
  (ty ~ BG.CUInt)
  => BG.HasField "unwrap" (BG.Ptr SDL_DateFormat) (BG.Ptr ty)
  where
  getField :: Ptr SDL_DateFormat -> Ptr ty
getField = Proxy "unwrap"
-> Ptr SDL_DateFormat -> Ptr (CFieldType SDL_DateFormat "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_DateFormat "unwrap" where
  type CFieldType SDL_DateFormat "unwrap" = BG.CUInt

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

-- | Year\/Month\/Day
--
--     [C declaration]: @SDL_DATE_FORMAT_YYYYMMDD@, defined at @SDL3\/SDL_time.h 76:5@
pattern SDL_DATE_FORMAT_YYYYMMDD :: SDL_DateFormat
pattern $mSDL_DATE_FORMAT_YYYYMMDD :: forall {r}. SDL_DateFormat -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_DATE_FORMAT_YYYYMMDD :: SDL_DateFormat
SDL_DATE_FORMAT_YYYYMMDD = SDL_DateFormat 0

-- | Day\/Month\/Year
--
--     [C declaration]: @SDL_DATE_FORMAT_DDMMYYYY@, defined at @SDL3\/SDL_time.h 77:5@
pattern SDL_DATE_FORMAT_DDMMYYYY :: SDL_DateFormat
pattern $mSDL_DATE_FORMAT_DDMMYYYY :: forall {r}. SDL_DateFormat -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_DATE_FORMAT_DDMMYYYY :: SDL_DateFormat
SDL_DATE_FORMAT_DDMMYYYY = SDL_DateFormat 1

-- | Month\/Day\/Year
--
--     [C declaration]: @SDL_DATE_FORMAT_MMDDYYYY@, defined at @SDL3\/SDL_time.h 78:5@
pattern SDL_DATE_FORMAT_MMDDYYYY :: SDL_DateFormat
pattern $mSDL_DATE_FORMAT_MMDDYYYY :: forall {r}. SDL_DateFormat -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_DATE_FORMAT_MMDDYYYY :: SDL_DateFormat
SDL_DATE_FORMAT_MMDDYYYY = SDL_DateFormat 2

-- | The preferred time format of the current system locale.
--
--     @since 3.2.0
--
--     [See also]: 'sDL_GetDateTimeLocalePreferences'
--
--     [C declaration]: @enum SDL_TimeFormat@, defined at @SDL3\/SDL_time.h 88:14@
newtype SDL_TimeFormat = SDL_TimeFormat
  { SDL_TimeFormat -> CUInt
unwrap :: BG.CUInt
  }
  deriving stock ((forall x. SDL_TimeFormat -> Rep SDL_TimeFormat x)
-> (forall x. Rep SDL_TimeFormat x -> SDL_TimeFormat)
-> Generic SDL_TimeFormat
forall x. Rep SDL_TimeFormat x -> SDL_TimeFormat
forall x. SDL_TimeFormat -> Rep SDL_TimeFormat x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SDL_TimeFormat -> Rep SDL_TimeFormat x
from :: forall x. SDL_TimeFormat -> Rep SDL_TimeFormat x
$cto :: forall x. Rep SDL_TimeFormat x -> SDL_TimeFormat
to :: forall x. Rep SDL_TimeFormat x -> SDL_TimeFormat
BG.Generic, SDL_TimeFormat -> SDL_TimeFormat -> Bool
(SDL_TimeFormat -> SDL_TimeFormat -> Bool)
-> (SDL_TimeFormat -> SDL_TimeFormat -> Bool) -> Eq SDL_TimeFormat
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SDL_TimeFormat -> SDL_TimeFormat -> Bool
== :: SDL_TimeFormat -> SDL_TimeFormat -> Bool
$c/= :: SDL_TimeFormat -> SDL_TimeFormat -> Bool
/= :: SDL_TimeFormat -> SDL_TimeFormat -> Bool
Eq, Eq SDL_TimeFormat
Eq SDL_TimeFormat =>
(SDL_TimeFormat -> SDL_TimeFormat -> Ordering)
-> (SDL_TimeFormat -> SDL_TimeFormat -> Bool)
-> (SDL_TimeFormat -> SDL_TimeFormat -> Bool)
-> (SDL_TimeFormat -> SDL_TimeFormat -> Bool)
-> (SDL_TimeFormat -> SDL_TimeFormat -> Bool)
-> (SDL_TimeFormat -> SDL_TimeFormat -> SDL_TimeFormat)
-> (SDL_TimeFormat -> SDL_TimeFormat -> SDL_TimeFormat)
-> Ord SDL_TimeFormat
SDL_TimeFormat -> SDL_TimeFormat -> Bool
SDL_TimeFormat -> SDL_TimeFormat -> Ordering
SDL_TimeFormat -> SDL_TimeFormat -> SDL_TimeFormat
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_TimeFormat -> SDL_TimeFormat -> Ordering
compare :: SDL_TimeFormat -> SDL_TimeFormat -> Ordering
$c< :: SDL_TimeFormat -> SDL_TimeFormat -> Bool
< :: SDL_TimeFormat -> SDL_TimeFormat -> Bool
$c<= :: SDL_TimeFormat -> SDL_TimeFormat -> Bool
<= :: SDL_TimeFormat -> SDL_TimeFormat -> Bool
$c> :: SDL_TimeFormat -> SDL_TimeFormat -> Bool
> :: SDL_TimeFormat -> SDL_TimeFormat -> Bool
$c>= :: SDL_TimeFormat -> SDL_TimeFormat -> Bool
>= :: SDL_TimeFormat -> SDL_TimeFormat -> Bool
$cmax :: SDL_TimeFormat -> SDL_TimeFormat -> SDL_TimeFormat
max :: SDL_TimeFormat -> SDL_TimeFormat -> SDL_TimeFormat
$cmin :: SDL_TimeFormat -> SDL_TimeFormat -> SDL_TimeFormat
min :: SDL_TimeFormat -> SDL_TimeFormat -> SDL_TimeFormat
Ord)
  deriving newtype (FFIType SDL_TimeFormat -> SDL_TimeFormat
SDL_TimeFormat -> FFIType SDL_TimeFormat
(SDL_TimeFormat -> FFIType SDL_TimeFormat)
-> (FFIType SDL_TimeFormat -> SDL_TimeFormat)
-> HasFFIType SDL_TimeFormat
forall a. (a -> FFIType a) -> (FFIType a -> a) -> HasFFIType a
$ctoFFIType :: SDL_TimeFormat -> FFIType SDL_TimeFormat
toFFIType :: SDL_TimeFormat -> FFIType SDL_TimeFormat
$cfromFFIType :: FFIType SDL_TimeFormat -> SDL_TimeFormat
fromFFIType :: FFIType SDL_TimeFormat -> SDL_TimeFormat
BG.HasFFIType)

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

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

instance Marshal.ReadRaw SDL_TimeFormat where
  readRaw :: Ptr SDL_TimeFormat -> IO SDL_TimeFormat
readRaw =
    \Ptr SDL_TimeFormat
ptr0 ->
      (CUInt -> SDL_TimeFormat) -> IO (CUInt -> SDL_TimeFormat)
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure CUInt -> SDL_TimeFormat
SDL_TimeFormat
        IO (CUInt -> SDL_TimeFormat) -> IO CUInt -> IO SDL_TimeFormat
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_TimeFormat -> Int -> IO CUInt
forall a b. ReadRaw a => Ptr b -> Int -> IO a
Marshal.readRawByteOff Ptr SDL_TimeFormat
ptr0 (Int
0 :: Int)

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

deriving via Marshal.EquivStorable SDL_TimeFormat instance BG.Storable SDL_TimeFormat

deriving via BG.CUInt instance BG.Prim SDL_TimeFormat

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

  toCEnum :: CEnumZ SDL_TimeFormat -> SDL_TimeFormat
toCEnum = CUInt -> SDL_TimeFormat
CEnumZ SDL_TimeFormat -> SDL_TimeFormat
SDL_TimeFormat

  fromCEnum :: SDL_TimeFormat -> CEnumZ SDL_TimeFormat
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_TimeFormat -> DeclaredValues SDL_TimeFormat
declaredValues =
    \proxy SDL_TimeFormat
_ ->
      [(CEnumZ SDL_TimeFormat, NonEmpty String)]
-> DeclaredValues SDL_TimeFormat
forall a.
Ord (CEnumZ a) =>
[(CEnumZ a, NonEmpty String)] -> DeclaredValues a
CEnum.declaredValuesFromList
        [ (CUInt
CEnumZ SDL_TimeFormat
0, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_TIME_FORMAT_24HR")
        , (CUInt
CEnumZ SDL_TimeFormat
1, String -> NonEmpty String
forall a. a -> NonEmpty a
BG.singleton String
"SDL_TIME_FORMAT_12HR")
        ]

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

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

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

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

instance CEnum.SequentialCEnum SDL_TimeFormat where
  minDeclaredValue :: SDL_TimeFormat
minDeclaredValue = SDL_TimeFormat
SDL_TIME_FORMAT_24HR

  maxDeclaredValue :: SDL_TimeFormat
maxDeclaredValue = SDL_TimeFormat
SDL_TIME_FORMAT_12HR

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

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

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

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

instance
  (ty ~ BG.CUInt)
  => BG.CompatHasField.HasField "unwrap" SDL_TimeFormat ty
  where
  hasField :: SDL_TimeFormat -> (ty -> SDL_TimeFormat, ty)
hasField =
    \SDL_TimeFormat
x0 ->
      ( \ty
y1 ->
          SDL_TimeFormat{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_TimeFormat
x0
      )

instance
  (ty ~ BG.CUInt)
  => BG.HasField "unwrap" (BG.Ptr SDL_TimeFormat) (BG.Ptr ty)
  where
  getField :: Ptr SDL_TimeFormat -> Ptr ty
getField = Proxy "unwrap"
-> Ptr SDL_TimeFormat -> Ptr (CFieldType SDL_TimeFormat "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_TimeFormat "unwrap" where
  type CFieldType SDL_TimeFormat "unwrap" = BG.CUInt

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

-- | 24 hour time
--
--     [C declaration]: @SDL_TIME_FORMAT_24HR@, defined at @SDL3\/SDL_time.h 90:5@
pattern SDL_TIME_FORMAT_24HR :: SDL_TimeFormat
pattern $mSDL_TIME_FORMAT_24HR :: forall {r}. SDL_TimeFormat -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_TIME_FORMAT_24HR :: SDL_TimeFormat
SDL_TIME_FORMAT_24HR = SDL_TimeFormat 0

-- | 12 hour time
--
--     [C declaration]: @SDL_TIME_FORMAT_12HR@, defined at @SDL3\/SDL_time.h 91:5@
pattern SDL_TIME_FORMAT_12HR :: SDL_TimeFormat
pattern $mSDL_TIME_FORMAT_12HR :: forall {r}. SDL_TimeFormat -> ((# #) -> r) -> ((# #) -> r) -> r
$bSDL_TIME_FORMAT_12HR :: SDL_TimeFormat
SDL_TIME_FORMAT_12HR = SDL_TimeFormat 1