Mercurial > hg > nnchat
comparison ui.c @ 571:3ae357fd34bb
Rename quit-related internal variables.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 13 Dec 2012 15:49:43 +0200 |
parents | afb4caf32bdf |
children | 414d11df07ce |
comparison
equal
deleted
inserted
replaced
570:7e6917c30a09 | 571:3ae357fd34bb |
---|---|
8 | 8 |
9 | 9 |
10 nn_window_t *chatWindows[SET_MAX_WINDOWS], | 10 nn_window_t *chatWindows[SET_MAX_WINDOWS], |
11 *currWin = NULL; | 11 *currWin = NULL; |
12 | 12 |
13 BOOL cursesInit = FALSE; | 13 BOOL appCursesInit = FALSE, appQuitFlag = FALSE; |
14 int cursorVisible = ERR, | 14 int cursorVisible = ERR, |
15 scrWidth, scrHeight; | 15 scrWidth, scrHeight; |
16 | 16 |
17 | 17 |
18 static void nn_line_free(void *ptr) | 18 static void nn_line_free(void *ptr) |
107 init_pair(14, COLOR_BLUE, COLOR_RED); | 107 init_pair(14, COLOR_BLUE, COLOR_RED); |
108 init_pair(15, COLOR_MAGENTA, COLOR_RED); | 108 init_pair(15, COLOR_MAGENTA, COLOR_RED); |
109 init_pair(16, COLOR_CYAN, COLOR_RED); | 109 init_pair(16, COLOR_CYAN, COLOR_RED); |
110 } | 110 } |
111 | 111 |
112 cursesInit = TRUE; | 112 appCursesInit = TRUE; |
113 nnwin_reset(); | 113 nnwin_reset(); |
114 | 114 |
115 #ifdef PDCURSES | 115 #ifdef PDCURSES |
116 PDC_set_title("NNChat v" NN_VERSION); | 116 PDC_set_title("NNChat v" NN_VERSION); |
117 #endif | 117 #endif |
130 int i; | 130 int i; |
131 | 131 |
132 for (i = 0; i < SET_MAX_WINDOWS; i++) | 132 for (i = 0; i < SET_MAX_WINDOWS; i++) |
133 nn_window_free(chatWindows[i]); | 133 nn_window_free(chatWindows[i]); |
134 | 134 |
135 if (cursesInit) | 135 if (appCursesInit) |
136 { | 136 { |
137 if (cursorVisible != ERR) | 137 if (cursorVisible != ERR) |
138 curs_set(cursorVisible); | 138 curs_set(cursorVisible); |
139 | 139 |
140 endwin(); | 140 endwin(); |
429 | 429 |
430 // Restore cursor position | 430 // Restore cursor position |
431 wmove(stdscr, sy, sx); | 431 wmove(stdscr, sy, sx); |
432 | 432 |
433 // Update editbuf if needed | 433 // Update editbuf if needed |
434 if (cursesInit && ebuf != NULL && (force || ebuf->dirty)) | 434 if (appCursesInit && ebuf != NULL && (force || ebuf->dirty)) |
435 { | 435 { |
436 int yoffs = ebuf->pos / scrWidth, | 436 int yoffs = ebuf->pos / scrWidth, |
437 xoffs = ebuf->pos % scrWidth; | 437 xoffs = ebuf->pos % scrWidth; |
438 | 438 |
439 wmove(stdscr, scrHeight - 3, 0); | 439 wmove(stdscr, scrHeight - 3, 0); |
662 { | 662 { |
663 nn_editbuf_t *editBuf = nn_editbuf_new(NN_TMPBUF_SIZE); | 663 nn_editbuf_t *editBuf = nn_editbuf_new(NN_TMPBUF_SIZE); |
664 char *res; | 664 char *res; |
665 | 665 |
666 editState->done = FALSE; | 666 editState->done = FALSE; |
667 while (!editState->isError && !editState->exitProg && !editState->done) | 667 while (!editState->isError && !appQuitFlag && !editState->done) |
668 { | 668 { |
669 nnwin_input_process(editBuf, editState, callback); | 669 nnwin_input_process(editBuf, editState, callback); |
670 update(editBuf, editState); | 670 update(editBuf, editState); |
671 } | 671 } |
672 | 672 |