#ifndef _SDL_events_h
#define _SDL_events_h
#include "SDL_stdinc.h"
#include "SDL_error.h"
#include "SDL_video.h"
#include "SDL_keyboard.h"
#include "SDL_mouse.h"
#include "SDL_joystick.h"
#include "SDL_quit.h"
#include "SDL_gesture.h"
#include "SDL_touch.h"
#include "begin_code.h"
#ifdef __cplusplus
extern "C" {
#endif
#define SDL_RELEASED 0
#define SDL_PRESSED 1
typedef enum
{
SDL_NOEVENT = 0,
SDL_FIRSTEVENT = 0,
SDL_QUIT = 0x100,
SDL_WINDOWEVENT = 0x200,
SDL_SYSWMEVENT,
SDL_KEYDOWN = 0x300,
SDL_KEYUP,
SDL_TEXTEDITING,
SDL_TEXTINPUT,
SDL_MOUSEMOTION = 0x400,
SDL_MOUSEBUTTONDOWN,
SDL_MOUSEBUTTONUP,
SDL_MOUSEWHEEL,
SDL_INPUTMOTION = 0x500,
SDL_INPUTBUTTONDOWN,
SDL_INPUTBUTTONUP,
SDL_INPUTWHEEL,
SDL_INPUTPROXIMITYIN,
SDL_INPUTPROXIMITYOUT,
SDL_JOYAXISMOTION = 0x600,
SDL_JOYBALLMOTION,
SDL_JOYHATMOTION,
SDL_JOYBUTTONDOWN,
SDL_JOYBUTTONUP,
SDL_FINGERDOWN = 0x700,
SDL_FINGERUP,
SDL_FINGERMOTION,
SDL_TOUCHBUTTONDOWN,
SDL_TOUCHBUTTONUP,
SDL_DOLLARGESTURE = 0x800,
SDL_DOLLARRECORD,
SDL_MULTIGESTURE,
SDL_CLIPBOARDUPDATE = 0x900,
SDL_EVENT_COMPAT1 = 0x7000,
SDL_EVENT_COMPAT2,
SDL_EVENT_COMPAT3,
SDL_USEREVENT = 0x8000,
SDL_LASTEVENT = 0xFFFF
} SDL_EventType;
typedef struct SDL_WindowEvent
{
Uint32 type;
Uint32 windowID;
Uint8 event;
Uint8 padding1;
Uint8 padding2;
Uint8 padding3;
int data1;
int data2;
} SDL_WindowEvent;
typedef struct SDL_KeyboardEvent
{
Uint32 type;
Uint32 windowID;
Uint8 state;
Uint8 repeat;
Uint8 padding2;
Uint8 padding3;
SDL_Keysym keysym;
} SDL_KeyboardEvent;
#define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
typedef struct SDL_TextEditingEvent
{
Uint32 type;
Uint32 windowID;
char text[SDL_TEXTEDITINGEVENT_TEXT_SIZE];
int start;
int length;
} SDL_TextEditingEvent;
#define SDL_TEXTINPUTEVENT_TEXT_SIZE (32)
typedef struct SDL_TextInputEvent
{
Uint32 type;
Uint32 windowID;
char text[SDL_TEXTINPUTEVENT_TEXT_SIZE];
} SDL_TextInputEvent;
typedef struct SDL_MouseMotionEvent
{
Uint32 type;
Uint32 timestamp;
Uint32 windowID;
Uint32 which;
Uint32 state;
Sint32 x;
Sint32 y;
Sint32 xrel;
Sint32 yrel;
} SDL_MouseMotionEvent;
typedef struct SDL_MouseButtonEvent
{
Uint32 type;
Uint32 timestamp;
Uint32 windowID;
Uint32 which;
Uint8 button;
Uint8 state;
Uint8 padding1;
Uint8 padding2;
Sint32 x;
Sint32 y;
} SDL_MouseButtonEvent;
typedef struct SDL_MouseWheelEvent
{
Uint32 type;
Uint32 timestamp;
Uint32 windowID;
Uint32 which;
Sint32 x;
Sint32 y;
} SDL_MouseWheelEvent;
typedef struct SDL_JoyAxisEvent
{
Uint32 type;
Uint8 which;
Uint8 axis;
Uint8 padding1;
Uint8 padding2;
int value;
} SDL_JoyAxisEvent;
typedef struct SDL_JoyBallEvent
{
Uint32 type;
Uint8 which;
Uint8 ball;
Uint8 padding1;
Uint8 padding2;
int xrel;
int yrel;
} SDL_JoyBallEvent;
typedef struct SDL_JoyHatEvent
{
Uint32 type;
Uint8 which;
Uint8 hat;
Uint8 value;
Uint8 padding1;
} SDL_JoyHatEvent;
typedef struct SDL_JoyButtonEvent
{
Uint32 type;
Uint8 which;
Uint8 button;
Uint8 state;
Uint8 padding1;
} SDL_JoyButtonEvent;
typedef struct SDL_TouchFingerEvent
{
Uint32 type;
Uint32 timestamp;
SDL_TouchID touchId;
SDL_FingerID fingerId;
float x;
float y;
float dx;
float dy;
float pressure;
} SDL_TouchFingerEvent;
typedef struct SDL_TouchButtonEvent
{
Uint32 type;
Uint32 windowID;
SDL_TouchID touchId;
Uint8 state;
Uint8 button;
Uint8 padding1;
Uint8 padding2;
} SDL_TouchButtonEvent;
typedef struct SDL_MultiGestureEvent
{
Uint32 type;
Uint32 windowID;
SDL_TouchID touchId;
float dTheta;
float dDist;
float x; float y;
Uint16 numFingers;
Uint16 padding;
} SDL_MultiGestureEvent;
typedef struct SDL_DollarGestureEvent
{
Uint32 type;
Uint32 windowID;
SDL_TouchID touchId;
SDL_GestureID gestureId;
Uint32 numFingers;
float error;
} SDL_DollarGestureEvent;
typedef struct SDL_QuitEvent
{
Uint32 type;
} SDL_QuitEvent;
typedef struct SDL_UserEvent
{
Uint32 type;
Uint32 windowID;
int code;
void *data1;
void *data2;
} SDL_UserEvent;
struct SDL_SysWMmsg;
typedef struct SDL_SysWMmsg SDL_SysWMmsg;
typedef struct SDL_SysWMEvent
{
Uint32 type;
SDL_SysWMmsg *msg;
} SDL_SysWMEvent;
#ifndef SDL_NO_COMPAT
typedef struct SDL_ActiveEvent
{
Uint32 type;
Uint8 gain;
Uint8 state;
} SDL_ActiveEvent;
typedef struct SDL_ResizeEvent
{
Uint32 type;
int w;
int h;
} SDL_ResizeEvent;
#endif
typedef union SDL_Event
{
Uint32 type;
SDL_WindowEvent window;
SDL_KeyboardEvent key;
SDL_TextEditingEvent edit;
SDL_TextInputEvent text;
SDL_MouseMotionEvent motion;
SDL_MouseButtonEvent button;
SDL_MouseWheelEvent wheel;
SDL_JoyAxisEvent jaxis;
SDL_JoyBallEvent jball;
SDL_JoyHatEvent jhat;
SDL_JoyButtonEvent jbutton;
SDL_QuitEvent quit;
SDL_UserEvent user;
SDL_SysWMEvent syswm;
SDL_TouchFingerEvent tfinger;
SDL_TouchButtonEvent tbutton;
SDL_MultiGestureEvent mgesture;
SDL_DollarGestureEvent dgesture;
#ifndef SDL_NO_COMPAT
SDL_ActiveEvent active;
SDL_ResizeEvent resize;
#endif
} SDL_Event;
extern DECLSPEC void SDLCALL SDL_PumpEvents(void);
typedef enum
{
SDL_ADDEVENT,
SDL_PEEKEVENT,
SDL_GETEVENT
} SDL_eventaction;
extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents,
SDL_eventaction action,
Uint32 minType, Uint32 maxType);
extern DECLSPEC SDL_bool SDLCALL SDL_HasEvent(Uint32 type);
extern DECLSPEC SDL_bool SDLCALL SDL_HasEvents(Uint32 minType, Uint32 maxType);
extern DECLSPEC void SDLCALL SDL_FlushEvent(Uint32 type);
extern DECLSPEC void SDLCALL SDL_FlushEvents(Uint32 minType, Uint32 maxType);
extern DECLSPEC int SDLCALL SDL_PollEvent(SDL_Event * event);
extern DECLSPEC int SDLCALL SDL_WaitEvent(SDL_Event * event);
extern DECLSPEC int SDLCALL SDL_WaitEventTimeout(SDL_Event * event,
int timeout);
extern DECLSPEC int SDLCALL SDL_PushEvent(SDL_Event * event);
typedef int (SDLCALL * SDL_EventFilter) (void *userdata, SDL_Event * event);
extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter,
void *userdata);
extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter,
void **userdata);
extern DECLSPEC void SDLCALL SDL_AddEventWatch(SDL_EventFilter filter,
void *userdata);
extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter,
void *userdata);
extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter,
void *userdata);
extern DECLSPEC void SDLCALL emscripten_SDL_SetEventHandler(SDL_EventFilter handler,
void *userdata);
#define SDL_QUERY -1
#define SDL_IGNORE 0
#define SDL_DISABLE 0
#define SDL_ENABLE 1
extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint32 type, int state);
#define SDL_GetEventState(type) SDL_EventState(type, SDL_QUERY)
extern DECLSPEC Uint32 SDLCALL SDL_RegisterEvents(int numevents);
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif