#ifndef _CURSES_WIN32SIM_H_ #define _CURSES_WIN32SIM_H_ #if !defined(_WIN32) && !defined(MAC_NATIVE) && !defined(FORCE_WIN32_CURSES) #ifdef MAC #include #else #include #endif #else #ifdef _WIN32 #include #else #include "../swell/swell.h" #endif #include "../wdltypes.h" /* ** this implements a tiny subset of curses on win32. ** It creates a window (Resizeable by user), and gives you a callback to run ** your UI. */ // if you need multiple contexts, define this in your sourcefiles BEFORE including curses.h // if you don't need multiple contexts, declare win32CursesCtx g_curses_context; in one of your source files. #ifndef CURSES_INSTANCE #define CURSES_INSTANCE (&g_curses_context) #endif #define LINES ((CURSES_INSTANCE)->lines) #define COLS ((CURSES_INSTANCE)->cols) //ncurses WIN32 wrapper functions #define WDL_IS_FAKE_CURSES #define addnstr(str,n) __addnstr(CURSES_INSTANCE,str,n) #define addstr(str) __addnstr(CURSES_INSTANCE,str,-1) #define addnstr_w(str,n) __addnstr_w(CURSES_INSTANCE,str,n) #define addstr_w(str) __addnstr_w(CURSES_INSTANCE,str,-1) #define addch(c) __addch(CURSES_INSTANCE,c) #define mvaddstr(y,x,str) __mvaddnstr(CURSES_INSTANCE,y,x,str,-1) #define mvaddnstr(y,x,str,n) __mvaddnstr(CURSES_INSTANCE,y,x,str,n) #define mvaddstr_w(y,x,str) __mvaddnstr_w(CURSES_INSTANCE,y,x,str,-1) #define mvaddnstr_w(y,x,str,n) __mvaddnstr_w(CURSES_INSTANCE,y,x,str,n) #define clrtoeol() __clrtoeol(CURSES_INSTANCE) #define move(y,x) __move(CURSES_INSTANCE,y,x,0) #define attrset(a) (CURSES_INSTANCE)->m_cur_attr=(a) #define bkgdset(a) (CURSES_INSTANCE)->m_cur_erase_attr=(a) #define initscr() __initscr(CURSES_INSTANCE) #define endwin() __endwin(CURSES_INSTANCE) #define curses_erase(x) __curses_erase(x) #define start_color() #define init_pair(x,y,z) __init_pair((CURSES_INSTANCE),x,y,z) #define has_colors() 1 #define A_NORMAL 0 #define A_BOLD 1 #define COLOR_PAIR(x) ((x)<