//	Zinc Application Framework - D_HWARE.HPP
//	COPYRIGHT (C) 1990-1999.  All Rights Reserved.
//	Zinc Software Incorporated.  Pleasant Grove, Utah  USA

#ifndef D_HWARE_HPP
#	define D_HWARE_HPP

#	if !defined(D_ENV_HPP)
#		include <d_env.hpp>
#	endif

#if defined(ZAF_TEXT_MODE)
typedef int ZafTextDisplayMode;
const ZafTextDisplayMode ZAF_TDM_NONE					= 0xFF;
const ZafTextDisplayMode ZAF_TDM_AUTO					= -1;
const ZafTextDisplayMode ZAF_TDM_BW_25x40 				= 0;
const ZafTextDisplayMode ZAF_TDM_25x40 					= 1;
const ZafTextDisplayMode ZAF_TDM_BW_25x80 				= 2;
const ZafTextDisplayMode ZAF_TDM_25x80					= 3;
const ZafTextDisplayMode ZAF_TDM_MONO_25x80				= 7;
const ZafTextDisplayMode ZAF_TDM_43x80					= 64;

#include <z_cursor.hpp>
#endif

// ----- DOS Multiple hardware support --------------------------------------
#if defined(ZAF_HARDWARE) && defined(ZAF_INDEPENDENT)
#	define _i2DoName(a, b)		a ## b
#	define _i1DoName(a, b)		_i2DoName(a, b)
#	define I_MAKENAME(name)		_i1DoName(ZAF_MODULE, name)
#	define MAKE_SETFUNCTIONS	\
	void I_MAKENAME(I_SetFunctions)(void) \
	{ \
		_textDriverName = I_MAKENAME(_textDriverName); \
		I_CheckLeadIn = I_MAKENAME(I_CheckLeadIn); \
		I_ScreenOpen = I_MAKENAME(I_ScreenOpen); \
		I_ScreenClose = I_MAKENAME(I_ScreenClose); \
		I_ScreenPut = I_MAKENAME(I_ScreenPut); \
		I_CursorRemove = I_MAKENAME(I_CursorRemove); \
		I_CursorPosition = I_MAKENAME(I_CursorPosition); \
		I_GetCodePage = I_MAKENAME(I_GetCodePage); \
		I_Beep = I_MAKENAME(I_Beep); \
		\
		I_KeyboardOpen = I_MAKENAME(I_KeyboardOpen); \
		I_KeyboardClose = I_MAKENAME(I_KeyboardClose); \
		I_KeyboardRead = I_MAKENAME(I_KeyboardRead); \
		I_KeyboardQuery = I_MAKENAME(I_KeyboardQuery); \
		\
		I_MouseOpen = I_MAKENAME(I_MouseOpen); \
		I_MouseClose = I_MAKENAME(I_MouseClose); \
		\
		I_PrintDotMatrixChar = I_MAKENAME(I_PrintDotMatrixChar); \
	}
	extern ZafIChar *_textDriverName;
	extern int *(*I_CheckLeadIn)(void);
	extern void (*I_ScreenOpen)(int *, int *, int *);
	extern void (*I_ScreenClose)(void);
	extern void (*I_ScreenPut)(int, int, int, int, void *);
	extern void (*I_CursorRemove)(void);
	extern void (*I_CursorPosition)(int, int, int);
	extern int (*I_GetCodePage)(void);
	extern void (*I_Beep)(void);

	extern void (*I_KeyboardOpen)(void);
	extern void (*I_KeyboardClose)(void);
	extern void (*I_KeyboardRead)(unsigned *, unsigned *, ZafIChar *);
	extern int (*I_KeyboardQuery)(unsigned *);

	extern int (*I_MouseOpen)(void);
	extern void (*I_MouseClose)(void);
	extern void (*mouseQueueEvent)(unsigned, int *, int *);
	extern void (*I_PrintDotMatrixChar)(char);
#elif defined(ZAF_INDEPENDENT) || defined(ZAF_CURSES)
#	define I_MAKENAME(name)		name
#	define MAKE_SETFUNCTIONS
	extern ZafIChar _textDriverName[];
	extern int *I_CheckLeadIn(void);
	extern void I_ScreenOpen(int *, int *, int *);
	extern void I_ScreenClose(void);
	extern void I_ScreenPut(int, int, int, int, void *);
	extern void I_CursorRemove(void);
	extern void I_CursorPosition(int, int, int);
	extern int I_GetCodePage(void);
	extern void I_Beep(void);

	extern void I_KeyboardOpen(void);
	extern void I_KeyboardClose(void);
	extern void I_KeyboardRead(unsigned *, unsigned *, ZafIChar *);
	extern int I_KeyboardQuery(unsigned *);

	extern int I_MouseOpen(void);
	extern void I_MouseClose(void);
	extern void (*mouseQueueEvent)(unsigned, int *, int *);
	extern void I_PrintDotMatrixChar(char);
#endif

#endif // !D_HWARE_HPP
