Lines Matching refs:screen
68 CursorSet(TScreen *screen, int row, int col, unsigned flags)
72 int max_col = screen->max_col;
73 int max_row = screen->max_row;
76 use_col += screen->lft_marg;
77 max_col = screen->rgt_marg;
80 set_cur_col(screen, (use_col <= max_col ? use_col : max_col));
83 use_row += screen->top_marg;
84 max_row = screen->bot_marg;
87 set_cur_row(screen, (use_row <= max_row ? use_row : max_row));
89 ResetWrap(screen);
93 screen->top_marg,
94 screen->bot_marg,
95 screen->lft_marg,
96 screen->rgt_marg,
97 screen->cur_row,
98 screen->cur_col,
106 * wrapping allowed the cursor to wrap around to the end of the screen.
112 * Wrapping to the end of the screen did not appear to be the original intent.
121 TScreen *screen = TScreenOf(xw);
127 int before = screen->cur_col;
130 int col = screen->cur_col;
131 int row = screen->cur_row;
138 screen->cur_row, screen->cur_col,
149 if ((rev || rev2) && screen->do_wrap) {
175 row = (top == 0) ? bottom : screen->max_row;
179 ld = getLineData(screen, ROW2INX(screen, row));
182 if (row != screen->cur_row) {
196 set_cur_row(screen, row);
197 set_cur_col(screen, col);
200 ResetWrap(screen);
209 TScreen *screen = TScreenOf(xw);
211 LineData *ld = getLineData(screen, screen->cur_row);
213 int next = screen->cur_col + n;
217 max = screen->rgt_marg;
218 if (screen->cur_col > max)
219 max = screen->max_col;
221 max = LineMaxCol(screen, ld);
227 set_cur_col(screen, next);
228 ResetWrap(screen);
233 * Won't pass bottom margin or bottom of screen.
236 CursorDown(TScreen *screen, int n)
239 int next = screen->cur_row + n;
241 max = (screen->cur_row > screen->bot_marg ?
242 screen->max_row : screen->bot_marg);
245 if (next > screen->max_row)
246 next = screen->max_row;
248 set_cur_row(screen, next);
249 ResetWrap(screen);
254 * Won't pass top margin or top of screen.
257 CursorUp(TScreen *screen, int n)
260 int next = screen->cur_row - n;
262 min = ((screen->cur_row < screen->top_marg)
264 : screen->top_marg);
270 set_cur_row(screen, next);
271 ResetWrap(screen);
281 TScreen *screen = TScreenOf(xw);
287 if (screen->cur_row > screen->bot_marg
288 || screen->cur_row + amount <= screen->bot_marg
290 && !ScrnIsColInMargins(screen, screen->cur_col))) {
291 CursorDown(screen, amount);
294 CursorDown(screen, j = screen->bot_marg - screen->cur_row);
306 TScreen *screen = TScreenOf(xw);
312 if (screen->cur_row < screen->top_marg
313 || screen->cur_row - amount >= screen->top_marg
315 && !ScrnIsColInMargins(screen, screen->cur_col))) {
316 CursorUp(screen, amount);
318 RevScroll(xw, amount - (screen->cur_row - screen->top_marg));
319 CursorUp(screen, screen->cur_row - screen->top_marg);
330 TScreen *screen = TScreenOf(xw);
336 } else if (screen->cur_col >= left) {
347 set_cur_col(screen, col);
348 ResetWrap(screen);
349 if (screen->jumpscroll && !screen->fastscroll)
354 * When resizing the window, if we're showing the alternate screen, we still
355 * have to adjust the saved cursor from the normal screen to account for
361 TScreen *screen = TScreenOf(xw);
363 if (screen->whichBuf) {
364 SavedCursor *sc = &screen->sc[0];
379 TScreen *screen = TScreenOf(xw);
382 sc->row = screen->cur_row;
383 sc->col = screen->cur_col;
385 sc->curgl = screen->curgl;
386 sc->curgr = screen->curgr;
387 sc->wrap_flag = screen->do_wrap;
394 saveCharsets(screen, sc->gsets);
400 TScreen *screen = TScreenOf(xw);
401 CursorSave2(xw, &screen->sc[screen->whichBuf]);
448 TScreen *screen = TScreenOf(xw);
454 restoreCharsets(screen, sc->gsets);
455 screen->curgl = sc->curgl;
456 screen->curgr = sc->curgr;
458 resetCharsets(screen);
464 CursorSet(screen,
465 sc->row - screen->top_marg,
467 ? sc->col - screen->lft_marg
471 CursorSet(screen, sc->row, sc->col, xw->flags);
473 screen->do_wrap = sc->wrap_flag; /* after CursorSet/ResetWrap */
498 TScreen *screen = TScreenOf(xw);
499 CursorRestoreFlags(xw, &screen->sc[screen->whichBuf], DECSC_FLAGS);
508 TScreen *screen = TScreenOf(xw);
510 CursorDown(screen, count < 1 ? 1 : count);
520 TScreen *screen = TScreenOf(xw);
522 CursorUp(screen, count < 1 ? 1 : count);
533 TScreen *screen = TScreenOf(xw);
534 int result = screen->cur_col;
546 TScreen *screen = TScreenOf(xw);
547 int result = screen->cur_row;
549 result -= screen->top_marg;
558 set_cur_row(TScreen *screen, int value)
560 TRACE(("set_cur_row %d vs %d\n", value, screen ? LastRowNumber(screen) : -1));
562 assert(screen != NULL);
564 assert(value <= LastRowNumber(screen));
565 if_STATUS_LINE(screen, {
566 value = LastRowNumber(screen);
568 screen->cur_row = value;
573 set_cur_col(TScreen *screen, int value)
575 TRACE(("set_cur_col %d vs %d\n", value, screen ? screen->max_col : -1));
577 assert(screen != NULL);
579 assert(value <= screen->max_col);
580 screen->cur_col = value;