    {-# LANGUAGE TypeApplications #-}

    -- | Copyright  : Will Thompson and Iñaki García Etxebarria
    -- License    : LGPL-2.1
    -- Maintainer : Iñaki García Etxebarria
    --
    -- Encapsulates information about a key event.

    #if !defined(__HADDOCK_VERSION__)
    #define ENABLE_OVERLOADING
    #endif

    module GI.Atk.Structs.KeyEventStruct
        (

    -- * Exported types
        KeyEventStruct(..)                      ,
        newZeroKeyEventStruct                   ,

     -- * Methods

    #if defined(ENABLE_OVERLOADING)
        ResolveKeyEventStructMethod             ,
    #endif

     -- * Properties

    -- ** keycode #attr:keycode#
    -- | The raw hardware code that generated the key event.  This field is raraly useful.

        getKeyEventStructKeycode                ,
    #if defined(ENABLE_OVERLOADING)
        keyEventStruct_keycode                  ,
    #endif
        setKeyEventStructKeycode                ,

    -- ** keyval #attr:keyval#
    -- | A guint representing a keysym value corresponding to those used by GDK and X11: see
    -- \/usr\/X11\/include\/keysymdef.h.

        getKeyEventStructKeyval                 ,
    #if defined(ENABLE_OVERLOADING)
        keyEventStruct_keyval                   ,
    #endif
        setKeyEventStructKeyval                 ,

    -- ** length #attr:length#
    -- | The length of member @/string/@.

        getKeyEventStructLength                 ,
    #if defined(ENABLE_OVERLOADING)
        keyEventStruct_length                   ,
    #endif
        setKeyEventStructLength                 ,

    -- ** state #attr:state#
    -- | A bitmask representing the state of the modifier keys immediately after the event takes place.
    -- The meaning of the bits is currently defined to match the bitmask used by GDK in
    -- GdkEventType.state, see
    -- http:\/\/developer.gnome.org\/doc\/API\/2.0\/gdk\/gdk-Event-Structures.html@/GdkEventKey/@

        getKeyEventStructState                  ,
    #if defined(ENABLE_OVERLOADING)
        keyEventStruct_state                    ,
    #endif
        setKeyEventStructState                  ,

    -- ** string #attr:string#
    -- | A string containing one of the following: either a string approximating the text that would
    -- result from this keypress, if the key is a control or graphic character, or a symbolic name for this keypress.
    -- Alphanumeric and printable keys will have the symbolic key name in this string member, for instance \"A\". \"0\",
    -- \"semicolon\", \"aacute\".  Keypad keys have the prefix \"KP\".

        clearKeyEventStructString               ,
        getKeyEventStructString                 ,
    #if defined(ENABLE_OVERLOADING)
        keyEventStruct_string                   ,
    #endif
        setKeyEventStructString                 ,

    -- ** timestamp #attr:timestamp#
    -- | A timestamp in milliseconds indicating when the event occurred.
    -- These timestamps are relative to a starting point which should be considered arbitrary,
    -- and only used to compare the dispatch times of events to one another.

        getKeyEventStructTimestamp              ,
    #if defined(ENABLE_OVERLOADING)
        keyEventStruct_timestamp                ,
    #endif
        setKeyEventStructTimestamp              ,

    -- ** type #attr:type#
    -- | An AtkKeyEventType, generally one of ATK_KEY_EVENT_PRESS or ATK_KEY_EVENT_RELEASE

        getKeyEventStructType                   ,
    #if defined(ENABLE_OVERLOADING)
        keyEventStruct_type                     ,
    #endif
        setKeyEventStructType                   ,

        ) where

    import Data.GI.Base.ShortPrelude
    import qualified Data.GI.Base.ShortPrelude as SP
    import qualified Data.GI.Base.Overloading as O
    import qualified Prelude as P

    import qualified Data.GI.Base.Attributes as GI.Attributes
    import qualified Data.GI.Base.BasicTypes as B.Types
    import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
    import qualified Data.GI.Base.GArray as B.GArray
    import qualified Data.GI.Base.GClosure as B.GClosure
    import qualified Data.GI.Base.GError as B.GError
    import qualified Data.GI.Base.GHashTable as B.GHT
    import qualified Data.GI.Base.GVariant as B.GVariant
    import qualified Data.GI.Base.GValue as B.GValue
    import qualified Data.GI.Base.GParamSpec as B.GParamSpec
    import qualified Data.GI.Base.CallStack as B.CallStack
    import qualified Data.GI.Base.Properties as B.Properties
    import qualified Data.GI.Base.Signals as B.Signals
    import qualified Control.Monad.IO.Class as MIO
    import qualified Data.Coerce as Coerce
    import qualified Data.Text as T
    import qualified Data.Kind as DK
    import qualified Data.ByteString.Char8 as B
    import qualified Data.Map as Map
    import qualified Foreign.Ptr as FP
    import qualified GHC.OverloadedLabels as OL
    import qualified GHC.Records as R
    import qualified Data.Word as DW
    import qualified Data.Int as DI
    import qualified System.Posix.Types as SPT
    import qualified Foreign.C.Types as FCT

    -- Workaround for https://gitlab.haskell.org/ghc/ghc/-/issues/23392
    #if MIN_VERSION_base(4,18,0)

    #else

    #endif

    -- | Memory-managed wrapper type.
    newtype KeyEventStruct = KeyEventStruct (SP.ManagedPtr KeyEventStruct)
        deriving (KeyEventStruct -> KeyEventStruct -> Bool
    (KeyEventStruct -> KeyEventStruct -> Bool)
    -> (KeyEventStruct -> KeyEventStruct -> Bool) -> Eq KeyEventStruct
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: KeyEventStruct -> KeyEventStruct -> Bool
    == :: KeyEventStruct -> KeyEventStruct -> Bool
    $c/= :: KeyEventStruct -> KeyEventStruct -> Bool
    /= :: KeyEventStruct -> KeyEventStruct -> Bool
    Eq)

    instance SP.ManagedPtrNewtype KeyEventStruct where
        toManagedPtr :: KeyEventStruct -> ManagedPtr KeyEventStruct
    toManagedPtr (KeyEventStruct ManagedPtr KeyEventStruct
    p) = ManagedPtr KeyEventStruct
    p

    instance BoxedPtr KeyEventStruct where
        boxedPtrCopy :: KeyEventStruct -> IO KeyEventStruct
    boxedPtrCopy = \KeyEventStruct
    p -> KeyEventStruct
    -> (Ptr KeyEventStruct -> IO KeyEventStruct) -> IO KeyEventStruct
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    B.ManagedPtr.withManagedPtr KeyEventStruct
    p (Int -> Ptr KeyEventStruct -> IO (Ptr KeyEventStruct)
    forall a. (HasCallStack, CallocPtr a) => Int -> Ptr a -> IO (Ptr a)
    copyBytes Int
    32 (Ptr KeyEventStruct -> IO (Ptr KeyEventStruct))
    -> (Ptr KeyEventStruct -> IO KeyEventStruct)
    -> Ptr KeyEventStruct
    -> IO KeyEventStruct
    forall (m :: * -> *) a b c.
    Monad m =>
    (a -> m b) -> (b -> m c) -> a -> m c
    >=> (ManagedPtr KeyEventStruct -> KeyEventStruct)
    -> Ptr KeyEventStruct -> IO KeyEventStruct
    forall a.
    (HasCallStack, BoxedPtr a) =>
    (ManagedPtr a -> a) -> Ptr a -> IO a
    B.ManagedPtr.wrapPtr ManagedPtr KeyEventStruct -> KeyEventStruct
    KeyEventStruct)
        boxedPtrFree :: KeyEventStruct -> IO ()
    boxedPtrFree = \KeyEventStruct
    x -> KeyEventStruct -> (Ptr KeyEventStruct -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    SP.withManagedPtr KeyEventStruct
    x Ptr KeyEventStruct -> IO ()
    forall a. Ptr a -> IO ()
    SP.freeMem
    instance CallocPtr KeyEventStruct where
        boxedPtrCalloc :: IO (Ptr KeyEventStruct)
    boxedPtrCalloc = Int -> IO (Ptr KeyEventStruct)
    forall a. Int -> IO (Ptr a)
    callocBytes Int
    32

    -- | Construct a t'KeyEventStruct' struct initialized to zero.
    newZeroKeyEventStruct :: MonadIO m => m KeyEventStruct
    newZeroKeyEventStruct :: forall (m :: * -> *). MonadIO m => m KeyEventStruct
    newZeroKeyEventStruct = IO KeyEventStruct -> m KeyEventStruct
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO KeyEventStruct -> m KeyEventStruct)
    -> IO KeyEventStruct -> m KeyEventStruct
    forall a b. (a -> b) -> a -> b
    $ IO (Ptr KeyEventStruct)
    forall a. CallocPtr a => IO (Ptr a)
    boxedPtrCalloc IO (Ptr KeyEventStruct)
    -> (Ptr KeyEventStruct -> IO KeyEventStruct) -> IO KeyEventStruct
    forall a b. IO a -> (a -> IO b) -> IO b
    forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
    >>= (ManagedPtr KeyEventStruct -> KeyEventStruct)
    -> Ptr KeyEventStruct -> IO KeyEventStruct
    forall a.
    (HasCallStack, BoxedPtr a) =>
    (ManagedPtr a -> a) -> Ptr a -> IO a
    wrapPtr ManagedPtr KeyEventStruct -> KeyEventStruct
    KeyEventStruct

    instance tag ~ 'AttrSet => Constructible KeyEventStruct tag where
        new :: forall (m :: * -> *).
    MonadIO m =>
    (ManagedPtr KeyEventStruct -> KeyEventStruct)
    -> [AttrOp KeyEventStruct tag] -> m KeyEventStruct
    new ManagedPtr KeyEventStruct -> KeyEventStruct
    _ [AttrOp KeyEventStruct tag]
    attrs = do
            o <- m KeyEventStruct
    forall (m :: * -> *). MonadIO m => m KeyEventStruct
    newZeroKeyEventStruct
            GI.Attributes.set o attrs
            return o

    -- | Get the value of the “@type@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.get' keyEventStruct #type
    -- @
    getKeyEventStructType :: MonadIO m => KeyEventStruct -> m Int32
    getKeyEventStructType :: forall (m :: * -> *). MonadIO m => KeyEventStruct -> m Int32
    getKeyEventStructType KeyEventStruct
    s = IO Int32 -> m Int32
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
    forall a b. (a -> b) -> a -> b
    $ KeyEventStruct -> (Ptr KeyEventStruct -> IO Int32) -> IO Int32
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr KeyEventStruct
    s ((Ptr KeyEventStruct -> IO Int32) -> IO Int32)
    -> (Ptr KeyEventStruct -> IO Int32) -> IO Int32
    forall a b. (a -> b) -> a -> b
    $ \Ptr KeyEventStruct
    ptr -> do
        val <- Ptr Int32 -> IO Int32
    forall a. Storable a => Ptr a -> IO a
    peek (Ptr KeyEventStruct
    ptr Ptr KeyEventStruct -> Int -> Ptr Int32
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    0) :: IO Int32
        return val

    -- | Set the value of the “@type@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.set' keyEventStruct [ #type 'Data.GI.Base.Attributes.:=' value ]
    -- @
    setKeyEventStructType :: MonadIO m => KeyEventStruct -> Int32 -> m ()
    setKeyEventStructType :: forall (m :: * -> *). MonadIO m => KeyEventStruct -> Int32 -> m ()
    setKeyEventStructType KeyEventStruct
    s Int32
    val = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $ KeyEventStruct -> (Ptr KeyEventStruct -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr KeyEventStruct
    s ((Ptr KeyEventStruct -> IO ()) -> IO ())
    -> (Ptr KeyEventStruct -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr KeyEventStruct
    ptr -> do
        Ptr Int32 -> Int32 -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke (Ptr KeyEventStruct
    ptr Ptr KeyEventStruct -> Int -> Ptr Int32
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    0) (Int32
    val :: Int32)

    #if defined(ENABLE_OVERLOADING)
    data KeyEventStructTypeFieldInfo
    instance AttrInfo KeyEventStructTypeFieldInfo where
        type AttrBaseTypeConstraint KeyEventStructTypeFieldInfo = (~) KeyEventStruct
        type AttrAllowedOps KeyEventStructTypeFieldInfo = '[ 'AttrSet, 'AttrGet]
        type AttrSetTypeConstraint KeyEventStructTypeFieldInfo = (~) Int32
        type AttrTransferTypeConstraint KeyEventStructTypeFieldInfo = (~)Int32
        type AttrTransferType KeyEventStructTypeFieldInfo = Int32
        type AttrGetType KeyEventStructTypeFieldInfo = Int32
        type AttrLabel KeyEventStructTypeFieldInfo = "type"
        type AttrOrigin KeyEventStructTypeFieldInfo = KeyEventStruct
        attrGet = getKeyEventStructType
        attrSet = setKeyEventStructType
        attrConstruct = undefined
        attrClear = undefined
        attrTransfer _ v = do
            return v
        dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Atk.Structs.KeyEventStruct.type"
            , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-atk-2.0.28/docs/GI-Atk-Structs-KeyEventStruct.html#g:attr:type"
            })

    keyEventStruct_type :: AttrLabelProxy "type"
    keyEventStruct_type = AttrLabelProxy

    #endif

    -- | Get the value of the “@state@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.get' keyEventStruct #state
    -- @
    getKeyEventStructState :: MonadIO m => KeyEventStruct -> m Word32
    getKeyEventStructState :: forall (m :: * -> *). MonadIO m => KeyEventStruct -> m Word32
    getKeyEventStructState KeyEventStruct
    s = IO Word32 -> m Word32
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
    forall a b. (a -> b) -> a -> b
    $ KeyEventStruct -> (Ptr KeyEventStruct -> IO Word32) -> IO Word32
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr KeyEventStruct
    s ((Ptr KeyEventStruct -> IO Word32) -> IO Word32)
    -> (Ptr KeyEventStruct -> IO Word32) -> IO Word32
    forall a b. (a -> b) -> a -> b
    $ \Ptr KeyEventStruct
    ptr -> do
        val <- Ptr Word32 -> IO Word32
    forall a. Storable a => Ptr a -> IO a
    peek (Ptr KeyEventStruct
    ptr Ptr KeyEventStruct -> Int -> Ptr Word32
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    4) :: IO Word32
        return val

    -- | Set the value of the “@state@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.set' keyEventStruct [ #state 'Data.GI.Base.Attributes.:=' value ]
    -- @
    setKeyEventStructState :: MonadIO m => KeyEventStruct -> Word32 -> m ()
    setKeyEventStructState :: forall (m :: * -> *). MonadIO m => KeyEventStruct -> Word32 -> m ()
    setKeyEventStructState KeyEventStruct
    s Word32
    val = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $ KeyEventStruct -> (Ptr KeyEventStruct -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr KeyEventStruct
    s ((Ptr KeyEventStruct -> IO ()) -> IO ())
    -> (Ptr KeyEventStruct -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr KeyEventStruct
    ptr -> do
        Ptr Word32 -> Word32 -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke (Ptr KeyEventStruct
    ptr Ptr KeyEventStruct -> Int -> Ptr Word32
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    4) (Word32
    val :: Word32)

    #if defined(ENABLE_OVERLOADING)
    data KeyEventStructStateFieldInfo
    instance AttrInfo KeyEventStructStateFieldInfo where
        type AttrBaseTypeConstraint KeyEventStructStateFieldInfo = (~) KeyEventStruct
        type AttrAllowedOps KeyEventStructStateFieldInfo = '[ 'AttrSet, 'AttrGet]
        type AttrSetTypeConstraint KeyEventStructStateFieldInfo = (~) Word32
        type AttrTransferTypeConstraint KeyEventStructStateFieldInfo = (~)Word32
        type AttrTransferType KeyEventStructStateFieldInfo = Word32
        type AttrGetType KeyEventStructStateFieldInfo = Word32
        type AttrLabel KeyEventStructStateFieldInfo = "state"
        type AttrOrigin KeyEventStructStateFieldInfo = KeyEventStruct
        attrGet = getKeyEventStructState
        attrSet = setKeyEventStructState
        attrConstruct = undefined
        attrClear = undefined
        attrTransfer _ v = do
            return v
        dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Atk.Structs.KeyEventStruct.state"
            , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-atk-2.0.28/docs/GI-Atk-Structs-KeyEventStruct.html#g:attr:state"
            })

    keyEventStruct_state :: AttrLabelProxy "state"
    keyEventStruct_state = AttrLabelProxy

    #endif

    -- | Get the value of the “@keyval@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.get' keyEventStruct #keyval
    -- @
    getKeyEventStructKeyval :: MonadIO m => KeyEventStruct -> m Word32
    getKeyEventStructKeyval :: forall (m :: * -> *). MonadIO m => KeyEventStruct -> m Word32
    getKeyEventStructKeyval KeyEventStruct
    s = IO Word32 -> m Word32
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
    forall a b. (a -> b) -> a -> b
    $ KeyEventStruct -> (Ptr KeyEventStruct -> IO Word32) -> IO Word32
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr KeyEventStruct
    s ((Ptr KeyEventStruct -> IO Word32) -> IO Word32)
    -> (Ptr KeyEventStruct -> IO Word32) -> IO Word32
    forall a b. (a -> b) -> a -> b
    $ \Ptr KeyEventStruct
    ptr -> do
        val <- Ptr Word32 -> IO Word32
    forall a. Storable a => Ptr a -> IO a
    peek (Ptr KeyEventStruct
    ptr Ptr KeyEventStruct -> Int -> Ptr Word32
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    8) :: IO Word32
        return val

    -- | Set the value of the “@keyval@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.set' keyEventStruct [ #keyval 'Data.GI.Base.Attributes.:=' value ]
    -- @
    setKeyEventStructKeyval :: MonadIO m => KeyEventStruct -> Word32 -> m ()
    setKeyEventStructKeyval :: forall (m :: * -> *). MonadIO m => KeyEventStruct -> Word32 -> m ()
    setKeyEventStructKeyval KeyEventStruct
    s Word32
    val = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $ KeyEventStruct -> (Ptr KeyEventStruct -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr KeyEventStruct
    s ((Ptr KeyEventStruct -> IO ()) -> IO ())
    -> (Ptr KeyEventStruct -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr KeyEventStruct
    ptr -> do
        Ptr Word32 -> Word32 -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke (Ptr KeyEventStruct
    ptr Ptr KeyEventStruct -> Int -> Ptr Word32
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    8) (Word32
    val :: Word32)

    #if defined(ENABLE_OVERLOADING)
    data KeyEventStructKeyvalFieldInfo
    instance AttrInfo KeyEventStructKeyvalFieldInfo where
        type AttrBaseTypeConstraint KeyEventStructKeyvalFieldInfo = (~) KeyEventStruct
        type AttrAllowedOps KeyEventStructKeyvalFieldInfo = '[ 'AttrSet, 'AttrGet]
        type AttrSetTypeConstraint KeyEventStructKeyvalFieldInfo = (~) Word32
        type AttrTransferTypeConstraint KeyEventStructKeyvalFieldInfo = (~)Word32
        type AttrTransferType KeyEventStructKeyvalFieldInfo = Word32
        type AttrGetType KeyEventStructKeyvalFieldInfo = Word32
        type AttrLabel KeyEventStructKeyvalFieldInfo = "keyval"
        type AttrOrigin KeyEventStructKeyvalFieldInfo = KeyEventStruct
        attrGet = getKeyEventStructKeyval
        attrSet = setKeyEventStructKeyval
        attrConstruct = undefined
        attrClear = undefined
        attrTransfer _ v = do
            return v
        dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Atk.Structs.KeyEventStruct.keyval"
            , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-atk-2.0.28/docs/GI-Atk-Structs-KeyEventStruct.html#g:attr:keyval"
            })

    keyEventStruct_keyval :: AttrLabelProxy "keyval"
    keyEventStruct_keyval = AttrLabelProxy

    #endif

    -- | Get the value of the “@length@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.get' keyEventStruct #length
    -- @
    getKeyEventStructLength :: MonadIO m => KeyEventStruct -> m Int32
    getKeyEventStructLength :: forall (m :: * -> *). MonadIO m => KeyEventStruct -> m Int32
    getKeyEventStructLength KeyEventStruct
    s = IO Int32 -> m Int32
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO Int32 -> m Int32) -> IO Int32 -> m Int32
    forall a b. (a -> b) -> a -> b
    $ KeyEventStruct -> (Ptr KeyEventStruct -> IO Int32) -> IO Int32
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr KeyEventStruct
    s ((Ptr KeyEventStruct -> IO Int32) -> IO Int32)
    -> (Ptr KeyEventStruct -> IO Int32) -> IO Int32
    forall a b. (a -> b) -> a -> b
    $ \Ptr KeyEventStruct
    ptr -> do
        val <- Ptr Int32 -> IO Int32
    forall a. Storable a => Ptr a -> IO a
    peek (Ptr KeyEventStruct
    ptr Ptr KeyEventStruct -> Int -> Ptr Int32
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    12) :: IO Int32
        return val

    -- | Set the value of the “@length@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.set' keyEventStruct [ #length 'Data.GI.Base.Attributes.:=' value ]
    -- @
    setKeyEventStructLength :: MonadIO m => KeyEventStruct -> Int32 -> m ()
    setKeyEventStructLength :: forall (m :: * -> *). MonadIO m => KeyEventStruct -> Int32 -> m ()
    setKeyEventStructLength KeyEventStruct
    s Int32
    val = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $ KeyEventStruct -> (Ptr KeyEventStruct -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr KeyEventStruct
    s ((Ptr KeyEventStruct -> IO ()) -> IO ())
    -> (Ptr KeyEventStruct -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr KeyEventStruct
    ptr -> do
        Ptr Int32 -> Int32 -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke (Ptr KeyEventStruct
    ptr Ptr KeyEventStruct -> Int -> Ptr Int32
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    12) (Int32
    val :: Int32)

    #if defined(ENABLE_OVERLOADING)
    data KeyEventStructLengthFieldInfo
    instance AttrInfo KeyEventStructLengthFieldInfo where
        type AttrBaseTypeConstraint KeyEventStructLengthFieldInfo = (~) KeyEventStruct
        type AttrAllowedOps KeyEventStructLengthFieldInfo = '[ 'AttrSet, 'AttrGet]
        type AttrSetTypeConstraint KeyEventStructLengthFieldInfo = (~) Int32
        type AttrTransferTypeConstraint KeyEventStructLengthFieldInfo = (~)Int32
        type AttrTransferType KeyEventStructLengthFieldInfo = Int32
        type AttrGetType KeyEventStructLengthFieldInfo = Int32
        type AttrLabel KeyEventStructLengthFieldInfo = "length"
        type AttrOrigin KeyEventStructLengthFieldInfo = KeyEventStruct
        attrGet = getKeyEventStructLength
        attrSet = setKeyEventStructLength
        attrConstruct = undefined
        attrClear = undefined
        attrTransfer _ v = do
            return v
        dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Atk.Structs.KeyEventStruct.length"
            , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-atk-2.0.28/docs/GI-Atk-Structs-KeyEventStruct.html#g:attr:length"
            })

    keyEventStruct_length :: AttrLabelProxy "length"
    keyEventStruct_length = AttrLabelProxy

    #endif

    -- | Get the value of the “@string@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.get' keyEventStruct #string
    -- @
    getKeyEventStructString :: MonadIO m => KeyEventStruct -> m (Maybe T.Text)
    getKeyEventStructString :: forall (m :: * -> *). MonadIO m => KeyEventStruct -> m (Maybe Text)
    getKeyEventStructString KeyEventStruct
    s = IO (Maybe Text) -> m (Maybe Text)
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO (Maybe Text) -> m (Maybe Text))
    -> IO (Maybe Text) -> m (Maybe Text)
    forall a b. (a -> b) -> a -> b
    $ KeyEventStruct
    -> (Ptr KeyEventStruct -> IO (Maybe Text)) -> IO (Maybe Text)
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr KeyEventStruct
    s ((Ptr KeyEventStruct -> IO (Maybe Text)) -> IO (Maybe Text))
    -> (Ptr KeyEventStruct -> IO (Maybe Text)) -> IO (Maybe Text)
    forall a b. (a -> b) -> a -> b
    $ \Ptr KeyEventStruct
    ptr -> do
        val <- Ptr CString -> IO CString
    forall a. Storable a => Ptr a -> IO a
    peek (Ptr KeyEventStruct
    ptr Ptr KeyEventStruct -> Int -> Ptr CString
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    16) :: IO CString
        result <- SP.convertIfNonNull val $ \CString
    val' -> do
            val'' <- HasCallStack => CString -> IO Text
    CString -> IO Text
    cstringToText CString
    val'
            return val''
        return result

    -- | Set the value of the “@string@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.set' keyEventStruct [ #string 'Data.GI.Base.Attributes.:=' value ]
    -- @
    setKeyEventStructString :: MonadIO m => KeyEventStruct -> CString -> m ()
    setKeyEventStructString :: forall (m :: * -> *).
    MonadIO m =>
    KeyEventStruct -> CString -> m ()
    setKeyEventStructString KeyEventStruct
    s CString
    val = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $ KeyEventStruct -> (Ptr KeyEventStruct -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr KeyEventStruct
    s ((Ptr KeyEventStruct -> IO ()) -> IO ())
    -> (Ptr KeyEventStruct -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr KeyEventStruct
    ptr -> do
        Ptr CString -> CString -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke (Ptr KeyEventStruct
    ptr Ptr KeyEventStruct -> Int -> Ptr CString
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    16) (CString
    val :: CString)

    -- | Set the value of the “@string@” field to `Nothing`.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.clear' #string
    -- @
    clearKeyEventStructString :: MonadIO m => KeyEventStruct -> m ()
    clearKeyEventStructString :: forall (m :: * -> *). MonadIO m => KeyEventStruct -> m ()
    clearKeyEventStructString KeyEventStruct
    s = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $ KeyEventStruct -> (Ptr KeyEventStruct -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr KeyEventStruct
    s ((Ptr KeyEventStruct -> IO ()) -> IO ())
    -> (Ptr KeyEventStruct -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr KeyEventStruct
    ptr -> do
        Ptr CString -> CString -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke (Ptr KeyEventStruct
    ptr Ptr KeyEventStruct -> Int -> Ptr CString
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    16) (CString
    forall a. Ptr a
    FP.nullPtr :: CString)

    #if defined(ENABLE_OVERLOADING)
    data KeyEventStructStringFieldInfo
    instance AttrInfo KeyEventStructStringFieldInfo where
        type AttrBaseTypeConstraint KeyEventStructStringFieldInfo = (~) KeyEventStruct
        type AttrAllowedOps KeyEventStructStringFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
        type AttrSetTypeConstraint KeyEventStructStringFieldInfo = (~) CString
        type AttrTransferTypeConstraint KeyEventStructStringFieldInfo = (~)CString
        type AttrTransferType KeyEventStructStringFieldInfo = CString
        type AttrGetType KeyEventStructStringFieldInfo = Maybe T.Text
        type AttrLabel KeyEventStructStringFieldInfo = "string"
        type AttrOrigin KeyEventStructStringFieldInfo = KeyEventStruct
        attrGet = getKeyEventStructString
        attrSet = setKeyEventStructString
        attrConstruct = undefined
        attrClear = clearKeyEventStructString
        attrTransfer _ v = do
            return v
        dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Atk.Structs.KeyEventStruct.string"
            , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-atk-2.0.28/docs/GI-Atk-Structs-KeyEventStruct.html#g:attr:string"
            })

    keyEventStruct_string :: AttrLabelProxy "string"
    keyEventStruct_string = AttrLabelProxy

    #endif

    -- | Get the value of the “@keycode@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.get' keyEventStruct #keycode
    -- @
    getKeyEventStructKeycode :: MonadIO m => KeyEventStruct -> m Word16
    getKeyEventStructKeycode :: forall (m :: * -> *). MonadIO m => KeyEventStruct -> m Word16
    getKeyEventStructKeycode KeyEventStruct
    s = IO Word16 -> m Word16
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO Word16 -> m Word16) -> IO Word16 -> m Word16
    forall a b. (a -> b) -> a -> b
    $ KeyEventStruct -> (Ptr KeyEventStruct -> IO Word16) -> IO Word16
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr KeyEventStruct
    s ((Ptr KeyEventStruct -> IO Word16) -> IO Word16)
    -> (Ptr KeyEventStruct -> IO Word16) -> IO Word16
    forall a b. (a -> b) -> a -> b
    $ \Ptr KeyEventStruct
    ptr -> do
        val <- Ptr Word16 -> IO Word16
    forall a. Storable a => Ptr a -> IO a
    peek (Ptr KeyEventStruct
    ptr Ptr KeyEventStruct -> Int -> Ptr Word16
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    24) :: IO Word16
        return val

    -- | Set the value of the “@keycode@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.set' keyEventStruct [ #keycode 'Data.GI.Base.Attributes.:=' value ]
    -- @
    setKeyEventStructKeycode :: MonadIO m => KeyEventStruct -> Word16 -> m ()
    setKeyEventStructKeycode :: forall (m :: * -> *). MonadIO m => KeyEventStruct -> Word16 -> m ()
    setKeyEventStructKeycode KeyEventStruct
    s Word16
    val = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $ KeyEventStruct -> (Ptr KeyEventStruct -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr KeyEventStruct
    s ((Ptr KeyEventStruct -> IO ()) -> IO ())
    -> (Ptr KeyEventStruct -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr KeyEventStruct
    ptr -> do
        Ptr Word16 -> Word16 -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke (Ptr KeyEventStruct
    ptr Ptr KeyEventStruct -> Int -> Ptr Word16
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    24) (Word16
    val :: Word16)

    #if defined(ENABLE_OVERLOADING)
    data KeyEventStructKeycodeFieldInfo
    instance AttrInfo KeyEventStructKeycodeFieldInfo where
        type AttrBaseTypeConstraint KeyEventStructKeycodeFieldInfo = (~) KeyEventStruct
        type AttrAllowedOps KeyEventStructKeycodeFieldInfo = '[ 'AttrSet, 'AttrGet]
        type AttrSetTypeConstraint KeyEventStructKeycodeFieldInfo = (~) Word16
        type AttrTransferTypeConstraint KeyEventStructKeycodeFieldInfo = (~)Word16
        type AttrTransferType KeyEventStructKeycodeFieldInfo = Word16
        type AttrGetType KeyEventStructKeycodeFieldInfo = Word16
        type AttrLabel KeyEventStructKeycodeFieldInfo = "keycode"
        type AttrOrigin KeyEventStructKeycodeFieldInfo = KeyEventStruct
        attrGet = getKeyEventStructKeycode
        attrSet = setKeyEventStructKeycode
        attrConstruct = undefined
        attrClear = undefined
        attrTransfer _ v = do
            return v
        dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Atk.Structs.KeyEventStruct.keycode"
            , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-atk-2.0.28/docs/GI-Atk-Structs-KeyEventStruct.html#g:attr:keycode"
            })

    keyEventStruct_keycode :: AttrLabelProxy "keycode"
    keyEventStruct_keycode = AttrLabelProxy

    #endif

    -- | Get the value of the “@timestamp@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.get' keyEventStruct #timestamp
    -- @
    getKeyEventStructTimestamp :: MonadIO m => KeyEventStruct -> m Word32
    getKeyEventStructTimestamp :: forall (m :: * -> *). MonadIO m => KeyEventStruct -> m Word32
    getKeyEventStructTimestamp KeyEventStruct
    s = IO Word32 -> m Word32
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
    forall a b. (a -> b) -> a -> b
    $ KeyEventStruct -> (Ptr KeyEventStruct -> IO Word32) -> IO Word32
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr KeyEventStruct
    s ((Ptr KeyEventStruct -> IO Word32) -> IO Word32)
    -> (Ptr KeyEventStruct -> IO Word32) -> IO Word32
    forall a b. (a -> b) -> a -> b
    $ \Ptr KeyEventStruct
    ptr -> do
        val <- Ptr Word32 -> IO Word32
    forall a. Storable a => Ptr a -> IO a
    peek (Ptr KeyEventStruct
    ptr Ptr KeyEventStruct -> Int -> Ptr Word32
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    28) :: IO Word32
        return val

    -- | Set the value of the “@timestamp@” field.
    -- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
    --
    -- @
    -- 'Data.GI.Base.Attributes.set' keyEventStruct [ #timestamp 'Data.GI.Base.Attributes.:=' value ]
    -- @
    setKeyEventStructTimestamp :: MonadIO m => KeyEventStruct -> Word32 -> m ()
    setKeyEventStructTimestamp :: forall (m :: * -> *). MonadIO m => KeyEventStruct -> Word32 -> m ()
    setKeyEventStructTimestamp KeyEventStruct
    s Word32
    val = IO () -> m ()
    forall a. IO a -> m a
    forall (m :: * -> *) a. MonadIO m => IO a -> m a
    liftIO (IO () -> m ()) -> IO () -> m ()
    forall a b. (a -> b) -> a -> b
    $ KeyEventStruct -> (Ptr KeyEventStruct -> IO ()) -> IO ()
    forall a c.
    (HasCallStack, ManagedPtrNewtype a) =>
    a -> (Ptr a -> IO c) -> IO c
    withManagedPtr KeyEventStruct
    s ((Ptr KeyEventStruct -> IO ()) -> IO ())
    -> (Ptr KeyEventStruct -> IO ()) -> IO ()
    forall a b. (a -> b) -> a -> b
    $ \Ptr KeyEventStruct
    ptr -> do
        Ptr Word32 -> Word32 -> IO ()
    forall a. Storable a => Ptr a -> a -> IO ()
    poke (Ptr KeyEventStruct
    ptr Ptr KeyEventStruct -> Int -> Ptr Word32
    forall a b. Ptr a -> Int -> Ptr b
    `plusPtr` Int
    28) (Word32
    val :: Word32)

    #if defined(ENABLE_OVERLOADING)
    data KeyEventStructTimestampFieldInfo
    instance AttrInfo KeyEventStructTimestampFieldInfo where
        type AttrBaseTypeConstraint KeyEventStructTimestampFieldInfo = (~) KeyEventStruct
        type AttrAllowedOps KeyEventStructTimestampFieldInfo = '[ 'AttrSet, 'AttrGet]
        type AttrSetTypeConstraint KeyEventStructTimestampFieldInfo = (~) Word32
        type AttrTransferTypeConstraint KeyEventStructTimestampFieldInfo = (~)Word32
        type AttrTransferType KeyEventStructTimestampFieldInfo = Word32
        type AttrGetType KeyEventStructTimestampFieldInfo = Word32
        type AttrLabel KeyEventStructTimestampFieldInfo = "timestamp"
        type AttrOrigin KeyEventStructTimestampFieldInfo = KeyEventStruct
        attrGet = getKeyEventStructTimestamp
        attrSet = setKeyEventStructTimestamp
        attrConstruct = undefined
        attrClear = undefined
        attrTransfer _ v = do
            return v
        dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
            O.resolvedSymbolName = "GI.Atk.Structs.KeyEventStruct.timestamp"
            , O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-atk-2.0.28/docs/GI-Atk-Structs-KeyEventStruct.html#g:attr:timestamp"
            })

    keyEventStruct_timestamp :: AttrLabelProxy "timestamp"
    keyEventStruct_timestamp = AttrLabelProxy

    #endif

    #if defined(ENABLE_OVERLOADING)
    instance O.HasAttributeList KeyEventStruct
    type instance O.AttributeList KeyEventStruct = KeyEventStructAttributeList
    type KeyEventStructAttributeList = ('[ '("type", KeyEventStructTypeFieldInfo), '("state", KeyEventStructStateFieldInfo), '("keyval", KeyEventStructKeyvalFieldInfo), '("length", KeyEventStructLengthFieldInfo), '("string", KeyEventStructStringFieldInfo), '("keycode", KeyEventStructKeycodeFieldInfo), '("timestamp", KeyEventStructTimestampFieldInfo)] :: [(Symbol, DK.Type)])
    #endif

    #if defined(ENABLE_OVERLOADING)
    type family ResolveKeyEventStructMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
        ResolveKeyEventStructMethod l o = O.MethodResolutionFailed l o

    instance (info ~ ResolveKeyEventStructMethod t KeyEventStruct, O.OverloadedMethod info KeyEventStruct p) => OL.IsLabel t (KeyEventStruct -> p) where
    #if MIN_VERSION_base(4,10,0)
        fromLabel = O.overloadedMethod @info
    #else
        fromLabel _ = O.overloadedMethod @info
    #endif

    #if MIN_VERSION_base(4,13,0)
    instance (info ~ ResolveKeyEventStructMethod t KeyEventStruct, O.OverloadedMethod info KeyEventStruct p, R.HasField t KeyEventStruct p) => R.HasField t KeyEventStruct p where
        getField = O.overloadedMethod @info

    #endif

    instance (info ~ ResolveKeyEventStructMethod t KeyEventStruct, O.OverloadedMethodInfo info KeyEventStruct) => OL.IsLabel t (O.MethodProxy info KeyEventStruct) where
    #if MIN_VERSION_base(4,10,0)
        fromLabel = O.MethodProxy
    #else
        fromLabel _ = O.MethodProxy
    #endif

    #endif