/*
*     ___                       ____               __
*    / _ \___ _    _____ ____  /  _/__  ___  __ __/ /_
*   / ___/ _ \ |/|/ / -_) __/ _/ // _ \/ _ \/ // / __/
*  /_/   \___/__,__/\__/_/   /___/_//_/ .__/\_,_/\__/
*                                    /_/
*
*   Original Code by John Garrison
*   Written July 16,22,31 1999
*   To be released under the LGPL
*
*   PowerInput initialization and misc. routines
*
*   See LICENSE.TXT for more LGPL info
*/

#ifndef _PI_H
#define _PI_H

#ifdef __cplusplus
extern "C" {
#endif

#include <SDL/SDL.h>
#include "keyboard.h"
#include "joystick.h"
#include "mouse.h"

typedef SDL_keysym PI_KeySymbol;

extern SDL_Event Event;
extern int MOUSE_X, MOUSE_Y;

/* Event enumerations */
enum { PI_NOEVENT,                     /* Unused (do not remove) */
       PI_ACTIVEEVENT,                 /* Application loses/gains visibility */
       PI_KEYDOWN,                     /* Keys pressed */
       PI_KEYUP,                       /* Keys released */
       PI_MOUSEMOTION,                 /* Mouse moved */
       PI_MOUSEBUTTONDOWN,             /* Mouse button pressed */
       PI_MOUSEBUTTONUP,               /* Mouse button released */
       PI_JOYAXISMOTION,               /* Joystick axis motion */
       PI_JOYBALLMOTION,               /* Joystick trackball motion */
       PI_JOYHATMOTION,                /* Joystick hat position change */
       PI_JOYBUTTONDOWN,               /* Joystick button pressed */
       PI_JOYBUTTONUP,                 /* Joystick button released */
       PI_QUIT,                        /* User-requested quit */
       PI_SYSWMEVENT,                  /* System specific event */
       /* Events SDL_USEREVENT through SDL_MAXEVENTS-1 are for your use */
       PI_USEREVENT = 24,
       /* This last event is only for bounding internal arrays
          It is the number of bits in the event mask datatype -- Uint32
        */
       PI_NUMEVENTS = 32
};

int PI_WaitEvent();
int PI_PollEvent();

#define PI_PollKeyboard() PI_PollEvent()
#define PI_PollMouse() PI_PollEvent()

#ifdef __cplusplus
};
#endif

#endif
