/* Curses Library Wrapper Functions */ #ifndef CURSESW_H #define CURSESW_H #include #include "curseswkeymap.h" /* * Type equvilents: */ #define Window unsigned long /* * Resource ID null value. */ #define None 0 /* * Default sizes of root window (when size is not available): */ #define DefaultRootWidth 80 #define DefaultRootHeight 20 /* * CEvent type codes: */ #define CNoEvent 0 #define CKeyPress 1 #define CKeyRelease 2 /* * Key code to ASCII map values structure: * * See the CDisplay structure on how this structure * is to be used. */ typedef struct { int key; /* Curses' key value. */ } CASCIIKeymapValue; /* * Display structure: * * This structure represents the connection to the curses * library. */ typedef struct { /* Root window. */ Window root_win; /* Size of root window, this can change so calling * functions should NOT use these values!! */ unsigned int root_width, root_height; /* Current window cursor is on. */ Window cursor_window; int cursor_x, cursor_y; } CDisplay; /* * Key event structure: */ typedef struct { int key; /* ASCII value of key. */ } CEventKey; /* * Event structure: */ typedef struct { int type; CEventKey ckey; } CEvent; extern CDisplay *CWInit(int argc, char *argv[]); extern void CWShutdown(CDisplay *display); extern Window CWCreateWindow( CDisplay *display, Window parent, int x, int y, unsigned int width, unsigned int height ); extern unsigned int CWRootWidth(CDisplay *display); extern unsigned int CWRootHeight(CDisplay *display); extern void CWMoveCursor( CDisplay *display, Window w, int x, int y ); extern void CWDrawCharacter( CDisplay *display, Window w, int x, int y, char c ); extern void CWDrawString( CDisplay *display, Window w, char *string ); extern void CWDrawStringPosition( CDisplay *display, Window w, int x, int y, char *string ); extern void CWDrawStringPositionLimited( CDisplay *display, Window w, int x, int y, char *string, int limit ); extern void CWClearArea( CDisplay *display, Window w, int x, int y, unsigned int width, unsigned int height ); extern int CGetNextEvent( CDisplay *display, CEvent *event ); extern void CWSync( CDisplay *display, unsigned int options ); #endif /* CURSESW_H */