#ifndef _INPUTGUI_H
#define _INPUTGUI_H

#include <exec/types.h>
#include "misc/array.h"
#include "base/tracks.h"

#define ID_ADD_TK			1
#define ID_DEL_TK			2
#define ID_SAVE			3
#define ID_LOAD			4
#define ID_USE				5
#define ID_TYPES_LIST 	6
#define ID_TRACK_NAME	7
#define ID_SET_COND		8
#define ID_DEL_COND		9
#define ID_CANCEL			10
#define ID_INTERNAL		11
#define ID_VALUE			12
#define ID_CHANGE_USE	13
#define ID_CHANGE_SCALE 14
#define ID_CHANGE_ALL	15
#define ID_COPY			16

#define MAXTYPES 10

class OmegaInputGUI{
protected:
	APTR gui_app;
	APTR wi_main;
	APTR lv_types, lv_tracks, lv_info;
	APTR sl_min, sl_max, sl_cond;
	APTR bt_add_tk, bt_del_tk,bt_save, bt_use, bt_load, bt_del_con, bt_add_con;
	APTR bt_int, bt_change, bt_copy;
	APTR str_name;
	APTR c_scale,c_value;
	APTR grp_cycle;		// Handle to group containing our cycle gadget
	APTR lab1, lab2;
	
	APTR gui_MakeLV(char *);
	APTR gui_MakeMainLV(char *);
	
	Array<InputType *> types;
	UINT i_maxValues;
	char **valuelist;
	UINT *typeMap;
	UINT maxTypes;
	
	Hook mainDispHook;
	Hook typeDispHook;
	static __saveds __asm LONG gui_DisplayFunc(register __a0 Hook *,
											register __a2 char **, 
											register __a1 APTR);
	static __saveds __asm LONG gui_TypeDisplay(register __a0 Hook *,
											register __a2 char **, 
											register __a1 APTR);

	// Storage buffers for our list numbers - Took me a while to get this one!
	// They'll have to be dynamic at some point I guess for flexible amount
	// of conditions
	char minBuffer[3][5];
	char maxBuffer[3][5];
	char typeBuffer[3][5];
	char typeString[3][10];

public:
	OmegaInputGUI();
	~OmegaInputGUI();
	
	// DO these really need to be public since we're inheriting from this class?
	void gui_OpenWin(Array<OmegaTrack *> *);
	void gui_ChangeType();
	void gui_SetCondition(OmegaTrack *);
	void gui_ResetCondition(OmegaTrack *);
	void gui_RefreshTracks(LONG);
	void gui_CloseWin();
	void gui_AddInfo(char *);
	UINT gui_GetActiveTrack();
	OmegaTrack *gui_AddTrack();
	void gui_ClearInfo();
	void gui_SetValueTypes();
	void gui_DisableMore();
	char **AllocateValueTypeSpace(UINT);
	inline UINT *GetTypeMap(){return typeMap;};
	void oi_AddType(char *,UBYTE,UBYTE,UBYTE);
};

#endif