diff --git a/examples/pdcurses/charset_main.c b/examples/pdcurses/charset_main.c index a13ed96d4..cb7e4903c 100644 --- a/examples/pdcurses/charset_main.c +++ b/examples/pdcurses/charset_main.c @@ -76,6 +76,9 @@ int charset_main(int argc, char *argv[]) int row; int col; int i; +#ifdef CONFIG_PDCURSES_MULTITHREAD + FAR struct pdc_context_s *ctx = PDC_ctx(); +#endif /* Initialize */ diff --git a/examples/pdcurses/firework_main.c b/examples/pdcurses/firework_main.c index 5a5895aa8..cbc6fad14 100644 --- a/examples/pdcurses/firework_main.c +++ b/examples/pdcurses/firework_main.c @@ -79,6 +79,10 @@ static short color_table[] = static void myrefresh(void) { +#ifdef CONFIG_PDCURSES_MULTITHREAD + FAR struct pdc_context_s *ctx = PDC_ctx(); +#endif + napms(DELAYSIZE); move(LINES - 1, COLS - 1); refresh(); @@ -157,6 +161,9 @@ int firework_main(int argc, char *argv[]) int direction; int seed; int i; +#ifdef CONFIG_PDCURSES_MULTITHREAD + FAR struct pdc_context_s *ctx = PDC_ctx(); +#endif traceon(); initscr(); diff --git a/examples/pdcurses/newdemo_main.c b/examples/pdcurses/newdemo_main.c index a368d418f..440009e42 100644 --- a/examples/pdcurses/newdemo_main.c +++ b/examples/pdcurses/newdemo_main.c @@ -102,6 +102,9 @@ static char *messages[] = static int wait_for_user(void) { chtype ch; +#ifdef CONFIG_PDCURSES_MULTITHREAD + FAR struct pdc_context_s *ctx = PDC_ctx(); +#endif nodelay(stdscr, true); halfdelay(50); @@ -198,6 +201,9 @@ static int bouncing_balls(WINDOW *win) int xd3; int yd3; int c; +#ifdef CONFIG_PDCURSES_MULTITHREAD + FAR struct pdc_context_s *ctx = PDC_ctx(); +#endif curs_set(0); @@ -313,6 +319,9 @@ int newdemo_main(int argc, char *argv[]) int i; int j; int seed; +#ifdef CONFIG_PDCURSES_MULTITHREAD + FAR struct pdc_context_s *ctx = PDC_ctx(); +#endif traceon(); initscr(); diff --git a/examples/pdcurses/panel_main.c b/examples/pdcurses/panel_main.c index 8aae261fa..c057eb5fe 100644 --- a/examples/pdcurses/panel_main.c +++ b/examples/pdcurses/panel_main.c @@ -79,6 +79,9 @@ static void backfill(void) { int x; int y; +#ifdef CONFIG_PDCURSES_MULTITHREAD + FAR struct pdc_context_s *ctx = PDC_ctx(); +#endif erase(); @@ -94,6 +97,9 @@ static void backfill(void) static void wait_a_while(long msec) { int c; +#ifdef CONFIG_PDCURSES_MULTITHREAD + FAR struct pdc_context_s *ctx = PDC_ctx(); +#endif if (msec != 1) { @@ -110,6 +116,9 @@ static void wait_a_while(long msec) static void saywhat(const char *text) { +#ifdef CONFIG_PDCURSES_MULTITHREAD + FAR struct pdc_context_s *ctx = PDC_ctx(); +#endif mvprintw(LINES - 1, 0, "%-20.20s", text); } diff --git a/examples/pdcurses/rain_main.c b/examples/pdcurses/rain_main.c index 6014ddb84..3d233e8f6 100644 --- a/examples/pdcurses/rain_main.c +++ b/examples/pdcurses/rain_main.c @@ -83,6 +83,9 @@ int rain_main(int argc, char *argv[]) { int x, y, j, r, c, seed; static int xpos[5], ypos[5]; +#ifdef CONFIG_PDCURSES_MULTITHREAD + FAR struct pdc_context_s *ctx = PDC_ctx(); +#endif traceon(); initscr(); diff --git a/examples/pdcurses/testcurs_main.c b/examples/pdcurses/testcurs_main.c index ba2ddaca8..73d8d9b15 100644 --- a/examples/pdcurses/testcurs_main.c +++ b/examples/pdcurses/testcurs_main.c @@ -246,6 +246,10 @@ static void continue2(void) static int init_test(WINDOW ** win, int argc, char *argv[]) { +#ifdef CONFIG_PDCURSES_MULTITHREAD + FAR struct pdc_context_s *ctx = PDC_ctx(); +#endif + traceon(); initscr(); #ifdef A_COLOR @@ -359,6 +363,9 @@ static void input_test(WINDOW *win) WINDOW *subWin; static const char spinner[4] = "/-\\|"; int spinner_count = 0; +#ifdef CONFIG_PDCURSES_MULTITHREAD + FAR struct pdc_context_s *ctx = PDC_ctx(); +#endif wclear(win); @@ -629,6 +636,9 @@ static void output_test(WINDOW *win) chtype ch; int bx; int by; +#ifdef CONFIG_PDCURSES_MULTITHREAD + FAR struct pdc_context_s *ctx = PDC_ctx(); +#endif nl(); wclear(win); @@ -799,6 +809,9 @@ static void resize_test(WINDOW *dummy) WINDOW *win1; int nwidth = 135; int nheight = 52; +#ifdef CONFIG_PDCURSES_MULTITHREAD + FAR struct pdc_context_s *ctx = PDC_ctx(); +#endif int owidth = COLS; int oheight = LINES; @@ -891,6 +904,9 @@ static void clipboard_test(WINDOW *win) char *ptr = NULL; long length = 0; long i; +#ifdef CONFIG_PDCURSES_MULTITHREAD + FAR struct pdc_context_s *ctx = PDC_ctx(); +#endif mvaddstr(1, 1, "This test will display the contents of the system clipboard"); @@ -950,6 +966,9 @@ static void clipboard_test(WINDOW *win) static void acs_test(WINDOW *win) { +#ifdef CONFIG_PDCURSES_MULTITHREAD + FAR struct pdc_context_s *ctx = PDC_ctx(); +#endif chtype acs_values[ACSNUM]; int tmarg = (LINES - 22) / 2; int i; @@ -1046,6 +1065,9 @@ static void color_test(WINDOW *win) int col3; int i; int j; +#ifdef CONFIG_PDCURSES_MULTITHREAD + FAR struct pdc_context_s *ctx = PDC_ctx(); +#endif if (!has_colors()) { @@ -1137,6 +1159,9 @@ static void wide_test(WINDOW *win) { wchar_t tmp[513]; size_t i; +#ifdef CONFIG_PDCURSES_MULTITHREAD + FAR struct pdc_context_s *ctx = PDC_ctx(); +#endif attrset(A_BOLD); mvaddstr(1, (COLS - 25) / 2, "Wide Character Input Test"); @@ -1165,6 +1190,9 @@ static void wide_test(WINDOW *win) void display_menu(int old_option, int new_option) { +#ifdef CONFIG_PDCURSES_MULTITHREAD + FAR struct pdc_context_s *ctx = PDC_ctx(); +#endif int lmarg = (COLS - 14) / 2, tmarg = (LINES - (MAX_OPTIONS + 2)) / 2; if (old_option == -1) @@ -1209,6 +1237,9 @@ int testcurs_main(int argc, char *argv[]) int old_option = -1; int new_option = 0; bool quit = false; +#ifdef CONFIG_PDCURSES_MULTITHREAD + FAR struct pdc_context_s *ctx = PDC_ctx(); +#endif #ifdef CONFIG_LIBC_LOCALE setlocale(LC_ALL, ""); diff --git a/examples/pdcurses/tui.c b/examples/pdcurses/tui.c index fa43c46d7..af468c255 100644 --- a/examples/pdcurses/tui.c +++ b/examples/pdcurses/tui.c @@ -138,6 +138,10 @@ static char *prepad(char *s, int length) static void rmline(WINDOW *win, int nr) /* keeps box lines intact */ { +#ifdef CONFIG_PDCURSES_MULTITHREAD + FAR struct pdc_context_s *ctx = PDC_ctx(); +#endif + mvwaddstr(win, nr, 1, padstr(" ", bw - 2)); wrefresh(win); } @@ -212,6 +216,9 @@ static void idle(void) char buf[MAXSTRLEN]; time_t t; struct tm *tp; +#ifdef CONFIG_PDCURSES_MULTITHREAD + FAR struct pdc_context_s *ctx = PDC_ctx(); +#endif if (time(&t) == -1) { @@ -453,6 +460,10 @@ void rmstatus(void) void titlemsg(char *msg) { +#ifdef CONFIG_PDCURSES_MULTITHREAD + FAR struct pdc_context_s *ctx = PDC_ctx(); +#endif + mvwaddstr(wtitl, 0, 2, padstr(msg, bw - 3)); wrefresh(wtitl); } @@ -465,6 +476,10 @@ void bodymsg(char *msg) void errormsg(char *msg) { +#ifdef CONFIG_PDCURSES_MULTITHREAD + FAR struct pdc_context_s *ctx = PDC_ctx(); +#endif + beep(); mvwaddstr(wstat, 0, 2, padstr(msg, bw - 3)); wrefresh(wstat); @@ -472,6 +487,10 @@ void errormsg(char *msg) void statusmsg(char *msg) { +#ifdef CONFIG_PDCURSES_MULTITHREAD + FAR struct pdc_context_s *ctx = PDC_ctx(); +#endif + mvwaddstr(wstat, 1, 2, padstr(msg, bw - 3)); wrefresh(wstat); } @@ -617,8 +636,13 @@ void domenu(const menu *mp) void startmenu(menu *mp, char *mtitle) { +#ifdef CONFIG_PDCURSES_MULTITHREAD + FAR struct pdc_context_s *ctx = PDC_ctx(); +#endif + traceon(); initscr(); + quit = false; incurses = true; initcolor(); @@ -753,6 +777,13 @@ int weditstr(WINDOW *win, char *buf, int field) curs_set(insert ? 2 : 1); break; + case KEY_DC: + if (*bp != 0) + { + memmove((void *)(bp), (const void *)(bp+1), strlen(bp)); + } + break; + default: if (c == erasechar()) /* backspace, ^H */ { diff --git a/examples/pdcurses/worm_main.c b/examples/pdcurses/worm_main.c index 0ff92d827..0ec3f7824 100644 --- a/examples/pdcurses/worm_main.c +++ b/examples/pdcurses/worm_main.c @@ -619,6 +619,9 @@ int worm_main(int argc, char *argv[]) int last; int bottom; int seed; +#ifdef CONFIG_PDCURSES_MULTITHREAD + FAR struct pdc_context_s *ctx = PDC_ctx(); +#endif for (x = 1; x < argc; x++) { diff --git a/examples/pdcurses/xmas_main.c b/examples/pdcurses/xmas_main.c index a6b61e639..e4be0c97b 100644 --- a/examples/pdcurses/xmas_main.c +++ b/examples/pdcurses/xmas_main.c @@ -790,6 +790,9 @@ int xmas_main(int argc, char *argv[]) #endif { int loopy; +#ifdef CONFIG_PDCURSES_MULTITHREAD + FAR struct pdc_context_s *ctx = PDC_ctx(); +#endif traceon(); initscr(); @@ -1077,6 +1080,38 @@ int xmas_main(int argc, char *argv[]) clear(); refresh(); + + delwin(treescrn); + delwin(treescrn2); + delwin(treescrn3); + delwin(treescrn4); + delwin(treescrn5); + delwin(treescrn6); + delwin(treescrn7); + delwin(treescrn8); + delwin(dotdeer0); + delwin(stardeer0); + delwin(lildeer0); + delwin(lildeer1); + delwin(lildeer2); + delwin(lildeer3); + delwin(middeer0); + delwin(middeer1); + delwin(middeer2); + delwin(middeer3); + delwin(bigdeer0); + delwin(bigdeer1); + delwin(bigdeer2); + delwin(bigdeer3); + delwin(bigdeer4); + delwin(lookdeer0); + delwin(lookdeer1); + delwin(lookdeer2); + delwin(lookdeer3); + delwin(lookdeer4); + delwin(w_holiday); + delwin(w_del_msg); + endwin(); return 0; }