Lines Matching refs:sp

52 #define GetEscdelay(sp) *_nc_ptr_Escdelay(sp)  argument
60 _nc_ptr_Escdelay(SCREEN *sp) in _nc_ptr_Escdelay() argument
62 return ptrEscdelay(sp); in _nc_ptr_Escdelay()
65 #define GetEscdelay(sp) ESCDELAY
133 SCREEN *sp = _nc_screen_of(win); in _nc_use_meta() local
134 return (sp ? sp->_use_meta : 0); in _nc_use_meta()
152 check_mouse_activity(SCREEN *sp, int delay EVENTLIST_2nd(_nc_eventlist * evl)) in check_mouse_activity() argument
157 TERMINAL_CONTROL_BLOCK *TCB = TCBOf(sp); in check_mouse_activity()
158 rc = TCBOf(sp)->drv->td_testmouse(TCBOf(sp), delay EVENTLIST_2nd(evl)); in check_mouse_activity()
161 if (IsTermInfoOnConsole(sp)) { in check_mouse_activity()
162 rc = _nc_console_testmouse(sp, in check_mouse_activity()
163 _nc_console_handle(sp->_ifd), in check_mouse_activity()
168 if (IsTermInfoOnConsole(sp)) { in check_mouse_activity()
169 HANDLE fd = _nc_get_handle(sp->_ifd); in check_mouse_activity()
170 rc = _nc_mingw_testmouse(sp, fd, delay EVENTLIST_2nd(evl)); in check_mouse_activity()
176 if ((sp->_mouse_type == M_SYSMOUSE) in check_mouse_activity()
177 && (sp->_sysmouse_head < sp->_sysmouse_tail)) { in check_mouse_activity()
183 rc = _nc_console_testmouse(sp, in check_mouse_activity()
184 _nc_console_handle(sp->_ifd), in check_mouse_activity()
188 rc = _nc_timed_wait(sp, in check_mouse_activity()
195 if ((sp->_mouse_type == M_SYSMOUSE) in check_mouse_activity()
196 && (sp->_sysmouse_head < sp->_sysmouse_tail) in check_mouse_activity()
208 fifo_peek(SCREEN *sp) in fifo_peek() argument
210 int ch = (peek >= 0) ? sp->_fifo[peek] : ERR; in fifo_peek()
218 fifo_pull(SCREEN *sp) in fifo_pull() argument
220 int ch = (head >= 0) ? sp->_fifo[head] : ERR; in fifo_pull()
222 TR(TRACE_IEVENT, ("pulling %s from %d", _nc_tracechar(sp, ch), head)); in fifo_pull()
233 _nc_fifo_dump(sp); in fifo_pull()
241 fifo_push(SCREEN *sp EVENTLIST_2nd(_nc_eventlist * evl)) in fifo_push()
254 || (sp->_mouse_fd >= 0) in fifo_push()
257 mask = check_mouse_activity(sp, -1 EVENTLIST_2nd(evl)); in fifo_push()
263 safe_ungetch(sp, KEY_EVENT); in fifo_push()
267 if (sp->_mouse_fd >= 0) { in fifo_push()
268 mask = check_mouse_activity(sp, -1 EVENTLIST_2nd(evl)); in fifo_push()
273 if ((sp->_mouse_fd >= 0) && (mask & TW_MOUSE)) { in fifo_push()
274 sp->_mouse_event(sp); in fifo_push()
280 if ((sp->_mouse_type == M_SYSMOUSE) in fifo_push()
281 && (sp->_sysmouse_head < sp->_sysmouse_tail)) { in fifo_push()
282 sp->_mouse_event(sp); in fifo_push()
285 } else if ((sp->_mouse_type == M_SYSMOUSE) in fifo_push()
287 sp->_mouse_event(sp); in fifo_push()
293 if ((sp->_mouse_type == M_TERM_DRIVER) in fifo_push()
294 && (sp->_drv_mouse_head < sp->_drv_mouse_tail)) { in fifo_push()
295 sp->_mouse_event(sp); in fifo_push()
301 if (NC_ISATTY(sp->_ifd) && sp->_cbreak) { in fifo_push()
302 ch = _read_kbd(0, 1, !sp->_raw); in fifo_push()
304 sp->_extended_key = (ch == 0); in fifo_push()
311 if (NC_ISATTY(sp->_ifd) && IsTermInfoOnConsole(sp) && sp->_cbreak) { in fifo_push()
316 n = _nc_console_read(sp, in fifo_push()
317 _nc_console_handle(sp->_ifd), in fifo_push()
324 if (NC_ISATTY(sp->_ifd) && IsTermInfoOnConsole(sp) && sp->_cbreak) in fifo_push()
325 n = _nc_mingw_console_read(sp, in fifo_push()
326 _nc_get_handle(sp->_ifd), in fifo_push()
330 n = CallDriver_1(sp, td_read, &buf); in fifo_push()
344 n = _nc_console_read(sp, in fifo_push()
345 _nc_console_handle(sp->_ifd), in fifo_push()
349 n = (int) read(sp->_ifd, &c2, (size_t) 1); in fifo_push()
359 TR(TRACE_IEVENT, ("read(%d,&ch,1)=%d, errno=%d", sp->_ifd, n, errno)); in fifo_push()
364 sp->_fifo[tail] = ch; in fifo_push()
365 sp->_fifohold = 0; in fifo_push()
369 TR(TRACE_IEVENT, ("pushed %s at %d", _nc_tracechar(sp, ch), tail)); in fifo_push()
372 _nc_fifo_dump(sp); in fifo_push()
380 fifo_clear(SCREEN *sp) in fifo_clear() argument
382 memset(sp->_fifo, 0, sizeof(sp->_fifo)); in fifo_clear()
393 SCREEN *sp = _nc_screen_of(win); in recur_wrefresh() local
394 if (_nc_use_pthreads && sp != CURRENT_SCREEN) { in recur_wrefresh()
400 _nc_set_screen(sp); in recur_wrefresh()
415 SCREEN *sp = _nc_screen_of(win); in recur_wgetnstr() local
418 if (sp != 0) { in recur_wgetnstr()
420 if (_nc_use_pthreads && sp != CURRENT_SCREEN) { in recur_wgetnstr()
426 _nc_set_screen(sp); in recur_wgetnstr()
433 sp->_called_wgetch = TRUE; in recur_wgetnstr()
435 sp->_called_wgetch = FALSE; in recur_wgetnstr()
449 SCREEN *sp; in _nc_wgetch() local
460 sp = _nc_screen_of(win); in _nc_wgetch()
461 if (win == 0 || sp == 0) { in _nc_wgetch()
467 *result = fifo_pull(sp); in _nc_wgetch()
482 !sp->_notty && in _nc_wgetch()
483 !sp->_raw && in _nc_wgetch()
484 !sp->_cbreak && in _nc_wgetch()
485 !sp->_called_wgetch) { in _nc_wgetch()
494 safe_ungetch(sp, '\n'); in _nc_wgetch()
497 safe_ungetch(sp, '\n'); in _nc_wgetch()
500 safe_ungetch(sp, bufp[-1]); in _nc_wgetch()
508 *result = fifo_pull(sp); in _nc_wgetch()
512 if (win->_use_keypad != sp->_keypad_on) in _nc_wgetch()
513 _nc_keypad(sp, win->_use_keypad); in _nc_wgetch()
517 if (win->_notimeout || (win->_delay >= 0) || (sp->_cbreak > 1)) { in _nc_wgetch()
522 if (sp->_cbreak > 1) in _nc_wgetch()
523 delay = (sp->_cbreak - 1) * 100; in _nc_wgetch()
534 rc = check_mouse_activity(sp, delay EVENTLIST_2nd(evl)); in _nc_wgetch()
564 ch = kgetch(sp, win->_notimeout EVENTLIST_2nd(evl)); in _nc_wgetch()
567 if (sp->_mouse_inline(sp)) in _nc_wgetch()
570 if (sp->_maxclick < 0) in _nc_wgetch()
574 && (((rc = check_mouse_activity(sp, sp->_maxclick in _nc_wgetch()
577 || !sp->_mouse_parse(sp, runcount))); in _nc_wgetch()
580 safe_ungetch(sp, ch); in _nc_wgetch()
588 safe_ungetch(sp, KEY_MOUSE); /* FIXME This interrupts a gesture... */ in _nc_wgetch()
593 safe_ungetch(sp, ch); in _nc_wgetch()
599 fifo_push(sp EVENTLIST_2nd(evl)); in _nc_wgetch()
600 ch = fifo_pull(sp); in _nc_wgetch()
606 if (_nc_handle_sigwinch(sp)) { in _nc_wgetch()
607 _nc_update_screensize(sp); in _nc_wgetch()
610 *result = fifo_pull(sp); in _nc_wgetch()
615 if (fifo_peek(sp) == -1) in _nc_wgetch()
616 fifo_pull(sp); in _nc_wgetch()
642 if (sp->_echo && !(win->_flags & _ISPAD)) { in _nc_wgetch()
651 if ((ch == '\r') && sp->_nl) in _nc_wgetch()
663 T(("wgetch returning : %s", _nc_tracechar(sp, ch))); in _nc_wgetch()
719 kgetch(SCREEN *sp, bool forever EVENTLIST_2nd(_nc_eventlist * evl)) in kgetch() argument
723 int timeleft = forever ? 9999999 : GetEscdelay(sp); in kgetch()
727 ptr = sp->_keytry; in kgetch()
730 if (cooked_key_in_fifo() && sp->_fifo[head] >= KEY_MIN) { in kgetch()
733 ch = fifo_push(sp EVENTLIST_2nd(evl)); in kgetch()
741 return fifo_pull(sp); /* Remove KEY_EVENT from the queue */ in kgetch()
746 ch = fifo_peek(sp); in kgetch()
758 TR(TRACE_IEVENT, ("ch: %s", _nc_tracechar(sp, (unsigned char) ch))); in kgetch()
772 fifo_clear(sp); in kgetch()
785 rc = check_mouse_activity(sp, timeleft EVENTLIST_2nd(evl)); in kgetch()
800 ch = fifo_pull(sp); in kgetch()