/*
/ EVENT.H
/ *******
/ Event defines for the kernel.
/
/ Will Beddow 2010 - http://343gs.com/brainstem
/
/ This software is currently under development
/ and is subject to change and improvement. Some
/ aspects of the system are incomplete and/or 
/ unstable due to ongoing implementation.
/
*/

#ifndef __EVENT_H__
#define __EVENT_H__

#include "Compile.h"
#include "Types.h"

namespace Brainstem
{
	enum ENUM_EVENTREGION
	{
		EVENT_NULLREGION = 0,
		EVENT_MOUSE,
		EVENT_KB
	};

	enum ENUM_EVENT
	{
		EVENT_NULL = 0,
		EVENT_MOUSEDOWN,
		EVENT_MOUSEUP,
		EVENT_MOUSEMOVE,
		EVENT_MOUSEDBLCLICK,
		EVENT_MOUSESCROLL,
		EVENT_KEYDOWN,
		EVENT_KEYUP
	};

	enum ENUM_MOUSEBUTTON
	{
		BTN_NULL = 0,
		BTN_LEFT,
		BTN_RIGHT,
		BTN_MIDDLE,
		BTN_WHEELDOWN,
		BTN_WHEELUP
	};

	struct Event
	{
		Event() :
			Region(EVENT_NULLREGION),
			Type(EVENT_NULL)
		{ }

		struct EMouse
		{
			ENUM_MOUSEBUTTON Button;
			int X;
			int Y;
		};

		struct EKey
		{
			char Char;
			int Code;
		};

		ENUM_EVENTREGION Region;
		ENUM_EVENT Type;
		union
		{
			struct EMouse Mouse;
			struct EKey Key;
		};
	};

	class IEventManager
	{
	public:

		virtual ~IEventManager() {}
		virtual void OnEvent(const Event& e) = 0;
	};

}

#endif