#ifndef __HGLG_PRINTF_CHINESE__
#define __HGLG_PRINTF_CHINESE__

#include <Memory.h>

#define HGLG_DISPLAY_NULL      0
#define HGLG_DISPLAY_LINE      1
#define HGLG_DISPLAY_BOX       2
#define HGLG_DISPLAY_COLOR     3
#define TRANSRATE_ARC(a)       (1.0*a*3.14129/180.0)

#define WINDOWXMS_COUNT  128
#define WINDOWXMS_TYPE_NULL 0
#define WINDOWXMS_TYPE_XMS  1
#define WINDOWXMS_TYPE_DISK 2

#define FONT_ANGLE_0     0
#define FONT_ANGLE_90    90
#define FONT_ANGLE_180   180
#define FONT_ANGLE_270   270


struct WINDOWXMS
{
	int	nWidth;
	int	nHeight;
	DWORD	dwLocation;
	DWORD   dwSize;
	int	nType;
};

BOOL FAR SaveBmpFile(int nX,int nY, int nWidth, int nHeight, char *pStr);
BOOL FAR DisplayBmpFileEx(int nX, int nY, CXmsMemory* pXmsMemory,
	DWORD lgLocation = 0, BOOL bChange = FALSE,
	BOOL bPalette=FALSE, BOOL bBack = TRUE,int nBackColor = BLACK);
BOOL        DisplayBmpFileEx(int nX,int nY,char *pStr,BOOL bChange, BOOL bPalette=FALSE,BOOL bBack=TRUE,int nBackColor=BLACK);
BOOL        DisplayBmpFile(int nX,int nY,char *pStr,BOOL bPalette=FALSE,BOOL bBack=TRUE,int nBackColor=BLACK);

CRect       DisplayIcon(int nX,int nY,char* pStrFile,int nPage,BOOL bDisplay,BOOL bPalette);

BOOL ResetSound16_DSP();
void SetSoundCardAttrib(int nBase, int nIrq, int nDma, int nInterrupt);
void SetSoundDelayTime(int nTime);
BOOL PlayWaveFile(char* pStrFile);

BOOL    FAR DrawAngleText(int nCircleX,int nCircleY,int nR,int nStartAngle,int nEndAngle,int nForeColor,
        int nBackColor,int nBei,int nStyle,const char *pStr);
BOOL FAR ChPrintf(int nX, int nY,int nForeColor ,int nBackColor,int nTimes,int nOption,const char *pStr, BOOL bDoWithMouse = FALSE);
BOOL FAR ChPrintf2(int nX, int nY,int nForeColor ,int nBackColor,int nTimes,int nOption,const char *pStr, BOOL bDoWithMouse = FALSE);
void 	     FAR SetPutpixelAttrib(int nX,int nY,int nAngle,int nAttrib=HGLG_DISPLAY_NULL,int nColor=0x3);
BOOL 	     FAR LoadFontToXms();
BOOL         FAR FreeFontToXms();
DWORD        FAR GetCaptionEmptyPoint_FromFontXms();
//DWORD        FAR GetFontXmsEmptyPoint();
//DWORD        FAR GetFontBlockLocation(int nIndex);
void         OperationWindowXms(int nBlock,WINDOWXMS* pWindowXms,BOOL bWrite);
BOOL	     FreeWindowXms(int nBlock);
int          MallocWindowXms(int nLeft,int nTop,int nWidth,int nHeight);
DWORD        GetWindowXmsBlockPoint(int nBlock);
BOOL FAR AfxChangeFontAngle(int nAngle);


BOOL  OpenWindowXms();
BOOL  CloseWindowXms();
DWORD MallocWindowXmsEx(int ,int, int nWidth, int nHeight);
BOOL  FreeWindowXmsEx(DWORD dwLoc);
BOOL  WindowXms_WriteData(DWORD dwLoc, DWORD dwIndex, BYTE* pByte, DWORD dwSize);
BOOL  WindowXms_ReadData(DWORD dwLoc, DWORD dwIndex, BYTE* pByte, DWORD dwSize);

DWORD GetXms_FontBlock();
DWORD GetXms_WaveBlock();
DWORD GetXms_CaptionBlock();
DWORD GetXms_WindowBlock();
DWORD GetXms_FreeBlock();

DWORD GetXms_SurgeWaveBlock() ;
DWORD GetXms_SurgeTempBlock();

#endif
