// ------------------------------------------------------------------------------------ //
//																						//
//	File: Asura_GUIMenu_MessagePump.h													//
//																						//
//	Description: Header file for the GUI Messaging system, all internal messages come	//
//				 through here. 															//
//																						//
//	Created: Steve Keen - 17/11/06														//
//																						//
//	Copyright (C) 2006 Rebellion (Derby), All Rights Reserved.							//
// ------------------------------------------------------------------------------------ //

#ifdef ASURA_USE_PRAGMA_ONCE
#pragma once
#endif

#ifndef __ASURA_GUIMENU_MESSAGEPUMP_H__
#define __ASURA_GUIMENU_MESSAGEPUMP_H__

#ifdef ASURA_USE_GUI_MENU_SYSTEM
// -- Includes ------------------------------------------------------------------------
#include "Core/Asura_Hash.h"

// -- Typedef -------------------------------------------------------------------------

// -- Enums ---------------------------------------------------------------------------

// -- Defines -------------------------------------------------------------------------

#define ASURA_GUIMENU_MAX_MESSAGEPUMP_MESSAGES	128
#define ASURA_GUIMENU_MESSAGEPUMP_DATA_SIZE		(ASURA_GUIMENU_MAX_MESSAGEPUMP_MESSAGES * sizeof(Asura_Message_GUIMenu_Notify))


// -- Structures ----------------------------------------------------------------------

// -- Class ---------------------------------------------------------------------------
struct Asura_Message_GUIMenu_Notify;

class Asura_GUIMenu_MessagePump
{
public:
	static void	Initialise(void);
	static void	Reset( void);
	static void	Shutdown(void);	
	
	static bool IsEmpty(void) { return m_uMessageIndexToProcess == m_uMessageIndexCanPostTo; }
	static void DeleteMessagesForMenu( Asura_Hash_ID uMenuID);

	static const Asura_Message_GUIMenu_Notify* GetNextMessage( void);

	static bool	PostMessage( const Asura_Message_GUIMenu_Notify* pxMessage);
	static bool PostMessage( Asura_Hash_ID uTo, Asura_Hash_ID uFrom, u_int uActionType, u_int uWidgetType, u_int uData = 0);

	static const Asura_Message_GUIMenu_Notify CreateMessage( Asura_Hash_ID uTo, Asura_Hash_ID uFrom, u_int uActionType, u_int uWidgetType, u_int uData = 0);

	static u_int GetCurrentQueueLength( void)	{	return m_uMessageIndexCanPostTo;	}

protected:

private:
	

public:

protected:

private:
	static Asura_Message_GUIMenu_Notify*	m_pucMessage;
	static u_int							m_uMessageIndexToProcess;
	static u_int							m_uMessageIndexCanPostTo;
};

#endif // ASURA_USE_GUI_MENU_SYSTEM
#endif // __ASURA_GUIMENU_MESSAGEPUMP_H__
