<commit_before>{-# LANGUAGE OverloadedStrings #-}
module SDL.Events
  ( Event(..)
  , EventPayload(..)
  , pollEvent
  , waitEvent
  ) where

import Control.Applicative
import Foreign
import Foreign.C
import Linear
import Linear.Affine (Point(P))
import SDL.Raw.Types hiding (Event(..), Point)

import qualified SDL.Exception as SDLEx
import qualified SDL.Raw as Raw

data Event = Event
  { eventTimestamp :: Word32
  , eventPayload :: EventPayload}

data EventPayload
  = WindowEvent {indowEventWindowID :: Word32
                ,windowEventEvent :: Word8
                ,windowEventData1 :: Int32
                ,windowEventData2 :: Int32}
  | KeyboardEvent {keyboardEventWindowID :: Word32
                  ,keyboardEventState :: Word8
                  ,keyboardEventRepeat :: Word8
                  ,keyboardEventKeysym :: Keysym}
  | TextEditingEvent {textEditingEventWindowID :: Word32
                     ,textEditingEventText :: [CChar]
                     ,textEditingEventStart :: Int32<commit_msg>Re-export pumpEvents<commit_after>{-# LANGUAGE OverloadedStrings #-}
module SDL.Events
  ( Event(..)
  , EventPayload(..)
  , pollEvent
  , Raw.pumpEvents
  , waitEvent
  ) where

import Control.Applicative
import Foreign
import Foreign.C
import Linear
import Linear.Affine (Point(P))
import SDL.Raw.Types hiding (Event(..), Point)

import qualified SDL.Exception as SDLEx
import qualified SDL.Raw as Raw

data Event = Event
  { eventTimestamp :: Word32
  , eventPayload :: EventPayload}

data EventPayload
  = WindowEvent {indowEventWindowID :: Word32
                ,windowEventEvent :: Word8
                ,windowEventData1 :: Int32
                ,windowEventData2 :: Int32}
  | KeyboardEvent {keyboardEventWindowID :: Word32
                  ,keyboardEventState :: Word8
                  ,keyboardEventRepeat :: Word8
                  ,keyboardEventKeysym :: Keysym}
  | TextEditingEvent {textEditingEventWindowID :: Word32
                     ,textEditingEventText :: [CChar]
                     ,textEditingEventStart :: Int32
{'fraction_non_alphanumeric': 0.08794946550048591, 'fraction_numerical': 0.0184645286686103, 'mean_word_length': 2.650709219858156, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1601998', 'n_tokens_mistral': 613, 'n_tokens_neox': 566, 'n_words': 141}