#ifndef __NT_CURSES_H__
#define __NT_CURSES_H__

#include "NTGlobals.h"

#include <curses.h>
#include <panel.h>



namespace NTCurses {

using namespace NT;


typedef unsigned int (*char_replace_callback)(unsigned int);

class NTCurses {
	static WINDOW *wGlobalWindow;
	static PANEL *wGlobalPanel;

public:
	NTCurses( unsigned int x , unsigned int y , unsigned int width , unsigned int height , bool makepanel = false );
	~NTCurses();

	void Move( unsigned int x , unsigned int y , bool cursormove = false );
	unsigned int GetAttrFromString( NTString str );
	NTString GetStringFromAttr( unsigned int attr );
	void SetAttr( unsigned int attr );
	void Refresh( void );
	void UpdatePanels( void );

	void ShowPanel( bool show );
	void TopPanel( void );
	void ShowCursor( bool show );

	void Clear();
	void PutChar( chtype ch );
	void PutString( NTString str , unsigned int attr = 0 , char_replace_callback rc = NULL );
	unsigned int GetWidth( void );
	unsigned int GetHeight( void );
	void Box( void );
	void Beep( void );
	void Flash( void );
	void SetGlobalClipboard( NTString clp );
	NTString GetGlobalClipboard( void );

protected:
	// protected methods
	void InitCurses( void );

	// protected properties
	WINDOW *wWindow;
	PANEL *pPanel;

	unsigned int uX;
	unsigned int uY;
	unsigned int uWidth;
	unsigned int uHeight;
};

}



#endif
