Lines Matching refs:si
93 struct screen_info si; member
96 static void get_screen_info(uv_tty_t* tty_out, struct screen_info* si) { in get_screen_info() argument
97 ASSERT(GetConsoleScreenBufferInfo(tty_out->handle, &(si->csbi))); in get_screen_info()
98 si->width = si->csbi.dwSize.X; in get_screen_info()
99 si->height = si->csbi.srWindow.Bottom - si->csbi.srWindow.Top + 1; in get_screen_info()
100 si->length = si->width * si->height; in get_screen_info()
101 si->default_attr = si->csbi.wAttributes; in get_screen_info()
102 si->top = si->csbi.srWindow.Top; in get_screen_info()
154 static BOOL is_scrolling(uv_tty_t* tty_out, struct screen_info si) { in is_scrolling() argument
157 return info.srWindow.Top != si.top; in is_scrolling()
185 static void clear_screen(uv_tty_t* tty_out, struct screen_info* si) { in clear_screen() argument
197 tty_out->handle, si->default_attr, length, origin, &number_of_written); in clear_screen()
211 get_screen_info(tty_out, &(cs->si)); in capture_screen()
213 origin.Y = cs->si.csbi.srWindow.Top; in capture_screen()
214 cs->text = malloc(cs->si.length * sizeof(*cs->text)); in capture_screen()
216 cs->attributes = (WORD*) malloc(cs->si.length * sizeof(*cs->attributes)); in capture_screen()
219 tty_out->handle, cs->text, cs->si.length, origin, &length)); in capture_screen()
220 ASSERT_EQ((unsigned int) cs->si.length, length); in capture_screen()
222 tty_out->handle, cs->attributes, cs->si.length, origin, &length)); in capture_screen()
223 ASSERT_EQ((unsigned int) cs->si.length, length); in capture_screen()
233 start = cs->text + cs->si.width * (cursor_position.Y - 1); in make_expect_screen_erase()
237 end = cs->text + cs->si.length; in make_expect_screen_erase()
240 end = start + cs->si.width; in make_expect_screen_erase()
256 end = cs->text + cs->si.length; in make_expect_screen_erase()
259 end = start + cs->si.width; in make_expect_screen_erase()
265 ASSERT_LE(end - cs->text, cs->si.length); in make_expect_screen_erase()
276 start = cs->text + cs->si.width * (cursor_position.Y - 1) + in make_expect_screen_write()
279 size_t remain_length = cs->si.length - (cs->text - start); in make_expect_screen_write()
289 start = cs->attributes + cs->si.width * (cursor_position.Y - 1) + in make_expect_screen_set_attr()
291 size_t remain_length = cs->si.length - (cs->attributes - start); in make_expect_screen_set_attr()
310 if (actual->si.length != expect->si.length) { in compare_screen()
313 if (actual->si.width != expect->si.width) { in compare_screen()
316 if (actual->si.height != expect->si.height) { in compare_screen()
319 while (current < actual->si.length) { in compare_screen()
321 line = current / actual->si.width + 1; in compare_screen()
322 col = current - actual->si.width * (line - 1) + 1; in compare_screen()
332 line = current / actual->si.width + 1; in compare_screen()
333 col = current - actual->si.width * (line - 1) + 1; in compare_screen()
344 clear_screen(tty_out, &expect->si); in compare_screen()
382 struct screen_info si; in TEST_IMPL() local
387 get_screen_info(&tty_out, &si); in TEST_IMPL()
389 cursor_pos_old.X = si.width / 2; in TEST_IMPL()
390 cursor_pos_old.Y = si.height / 2; in TEST_IMPL()
402 snprintf(buffer, sizeof(buffer), "%s%dA", CSI, si.height / 4); in TEST_IMPL()
405 ASSERT_EQ(cursor_pos_old.Y - si.height / 4, cursor_pos.Y); in TEST_IMPL()
417 ASSERT(!is_scrolling(&tty_out, si)); in TEST_IMPL()
433 struct screen_info si; in TEST_IMPL() local
438 get_screen_info(&tty_out, &si); in TEST_IMPL()
440 cursor_pos_old.X = si.width / 2; in TEST_IMPL()
441 cursor_pos_old.Y = si.height / 2; in TEST_IMPL()
453 snprintf(buffer, sizeof(buffer), "%s%dB", CSI, si.height / 4); in TEST_IMPL()
456 ASSERT_EQ(cursor_pos_old.Y + si.height / 4, cursor_pos.Y); in TEST_IMPL()
460 cursor_pos_old.X = si.width / 2; in TEST_IMPL()
461 cursor_pos_old.Y = si.height; in TEST_IMPL()
468 ASSERT(!is_scrolling(&tty_out, si)); in TEST_IMPL()
484 struct screen_info si; in TEST_IMPL() local
489 get_screen_info(&tty_out, &si); in TEST_IMPL()
491 cursor_pos_old.X = si.width / 2; in TEST_IMPL()
492 cursor_pos_old.Y = si.height / 2; in TEST_IMPL()
504 snprintf(buffer, sizeof(buffer), "%s%dC", CSI, si.width / 4); in TEST_IMPL()
508 ASSERT_EQ(cursor_pos_old.X + si.width / 4, cursor_pos.X); in TEST_IMPL()
511 cursor_pos_old.X = si.width; in TEST_IMPL()
512 cursor_pos_old.Y = si.height / 2; in TEST_IMPL()
521 cursor_pos_old.X = si.width; in TEST_IMPL()
522 cursor_pos_old.Y = si.height; in TEST_IMPL()
529 ASSERT(!is_scrolling(&tty_out, si)); in TEST_IMPL()
545 struct screen_info si; in TEST_IMPL() local
550 get_screen_info(&tty_out, &si); in TEST_IMPL()
552 cursor_pos_old.X = si.width / 2; in TEST_IMPL()
553 cursor_pos_old.Y = si.height / 2; in TEST_IMPL()
565 snprintf(buffer, sizeof(buffer), "%s%dD", CSI, si.width / 4); in TEST_IMPL()
569 ASSERT_EQ(cursor_pos_old.X - si.width / 4, cursor_pos.X); in TEST_IMPL()
573 cursor_pos_old.Y = si.height / 2; in TEST_IMPL()
590 ASSERT(!is_scrolling(&tty_out, si)); in TEST_IMPL()
606 struct screen_info si; in TEST_IMPL() local
611 get_screen_info(&tty_out, &si); in TEST_IMPL()
613 cursor_pos_old.X = si.width / 2; in TEST_IMPL()
614 cursor_pos_old.Y = si.height / 2; in TEST_IMPL()
626 snprintf(buffer, sizeof(buffer), "%s%dE", CSI, si.height / 4); in TEST_IMPL()
629 ASSERT_EQ(cursor_pos_old.Y + si.height / 4, cursor_pos.Y); in TEST_IMPL()
633 cursor_pos_old.X = si.width / 2; in TEST_IMPL()
634 cursor_pos_old.Y = si.height; in TEST_IMPL()
641 ASSERT(!is_scrolling(&tty_out, si)); in TEST_IMPL()
657 struct screen_info si; in TEST_IMPL() local
662 get_screen_info(&tty_out, &si); in TEST_IMPL()
664 cursor_pos_old.X = si.width / 2; in TEST_IMPL()
665 cursor_pos_old.Y = si.height / 2; in TEST_IMPL()
677 snprintf(buffer, sizeof(buffer), "%s%dF", CSI, si.height / 4); in TEST_IMPL()
680 ASSERT_EQ(cursor_pos_old.Y - si.height / 4, cursor_pos.Y); in TEST_IMPL()
692 ASSERT(!is_scrolling(&tty_out, si)); in TEST_IMPL()
708 struct screen_info si; in TEST_IMPL() local
713 get_screen_info(&tty_out, &si); in TEST_IMPL()
715 cursor_pos_old.X = si.width / 2; in TEST_IMPL()
716 cursor_pos_old.Y = si.height / 2; in TEST_IMPL()
727 snprintf(buffer, sizeof(buffer), "%s%dG", CSI, si.width / 4); in TEST_IMPL()
730 ASSERT_EQ(si.width / 4, cursor_pos.X); in TEST_IMPL()
734 snprintf(buffer, sizeof(buffer), "%s%dG", CSI, si.width + 1); in TEST_IMPL()
737 ASSERT_EQ(si.width, cursor_pos.X); in TEST_IMPL()
754 struct screen_info si; in TEST_IMPL() local
759 get_screen_info(&tty_out, &si); in TEST_IMPL()
761 cursor_pos.X = si.width / 2; in TEST_IMPL()
762 cursor_pos.Y = si.height / 2; in TEST_IMPL()
774 buffer, sizeof(buffer), "%s%d;%df", CSI, si.height / 2, si.width / 2); in TEST_IMPL()
777 ASSERT_EQ(si.width / 2, cursor_pos.X); in TEST_IMPL()
778 ASSERT_EQ(si.height / 2, cursor_pos.Y); in TEST_IMPL()
782 buffer, sizeof(buffer), "%s%d;%df", CSI, si.height / 2, si.width + 1); in TEST_IMPL()
785 ASSERT_EQ(si.width, cursor_pos.X); in TEST_IMPL()
786 ASSERT_EQ(si.height / 2, cursor_pos.Y); in TEST_IMPL()
789 buffer, sizeof(buffer), "%s%d;%df", CSI, si.height + 1, si.width / 2); in TEST_IMPL()
792 ASSERT_EQ(si.width / 2, cursor_pos.X); in TEST_IMPL()
793 ASSERT_EQ(si.height, cursor_pos.Y); in TEST_IMPL()
794 ASSERT(!is_scrolling(&tty_out, si)); in TEST_IMPL()
855 cursor_pos.X = expect.si.width / 2; in TEST_IMPL()
856 cursor_pos.Y = expect.si.height / 2; in TEST_IMPL()
929 cursor_pos.X = expect.si.width / 2; in TEST_IMPL()
930 cursor_pos.Y = expect.si.height / 2; in TEST_IMPL()
1083 fg_attrs[8][1] = expect.si.default_attr & FOREGROUND_WHITE; in TEST_IMPL()
1084 bg_attrs[0][1] = expect.si.default_attr & BACKGROUND_WHITE; in TEST_IMPL()
1090 cursor_pos.X = expect.si.width / 2; in TEST_IMPL()
1091 cursor_pos.Y = expect.si.height / 2; in TEST_IMPL()
1092 attr = (expect.si.default_attr & ~FOREGROUND_WHITE) | fg_attrs[i][1]; in TEST_IMPL()
1109 cursor_pos.X = expect.si.width / 2; in TEST_IMPL()
1110 cursor_pos.Y = expect.si.height / 2; in TEST_IMPL()
1111 attr = (expect.si.default_attr & ~BACKGROUND_WHITE) | bg_attrs[i][1]; in TEST_IMPL()
1129 cursor_pos.X = expect.si.width / 2; in TEST_IMPL()
1130 cursor_pos.Y = expect.si.height / 2; in TEST_IMPL()
1131 attr = expect.si.default_attr & ~FOREGROUND_WHITE & ~BACKGROUND_WHITE; in TEST_IMPL()
1153 cursor_pos.X = expect.si.width / 2; in TEST_IMPL()
1154 cursor_pos.Y = expect.si.height / 2; in TEST_IMPL()
1156 attr = expect.si.default_attr; in TEST_IMPL()
1184 cursor_pos.X = expect.si.width / 2; in TEST_IMPL()
1185 cursor_pos.Y = expect.si.height / 2; in TEST_IMPL()
1187 attr = expect.si.default_attr; in TEST_IMPL()
1207 cursor_pos.X = expect.si.width / 2; in TEST_IMPL()
1208 cursor_pos.Y = expect.si.height / 2; in TEST_IMPL()
1210 attr = expect.si.default_attr; in TEST_IMPL()
1251 struct screen_info si; in TEST_IMPL() local
1256 get_screen_info(&tty_out, &si); in TEST_IMPL()
1258 cursor_pos_old.X = si.width / 2; in TEST_IMPL()
1259 cursor_pos_old.Y = si.height / 2; in TEST_IMPL()
1266 cursor_pos.X = si.width / 4; in TEST_IMPL()
1267 cursor_pos.Y = si.height / 4; in TEST_IMPL()
1277 cursor_pos_old.X = si.width / 2; in TEST_IMPL()
1278 cursor_pos_old.Y = si.height / 2; in TEST_IMPL()
1285 cursor_pos.X = si.width / 4; in TEST_IMPL()
1286 cursor_pos.Y = si.height / 4; in TEST_IMPL()
1320 cursor_pos.X = expect.si.width; in TEST_IMPL()
1321 cursor_pos.Y = expect.si.height; in TEST_IMPL()
1337 ASSERT_OK(actual.si.csbi.srWindow.Top); in TEST_IMPL()
1553 expect.si.height / 2, in TEST_IMPL()
1554 expect.si.width / 2); in TEST_IMPL()
1578 cursor_pos_old.X = expect.si.width / 2; in TEST_IMPL()
1579 cursor_pos_old.Y = expect.si.height / 2; in TEST_IMPL()
1585 expect.si.height / 4, in TEST_IMPL()
1586 expect.si.width / 4); in TEST_IMPL()
1609 cursor_pos.X = expect.si.width / 2; in TEST_IMPL()
1610 cursor_pos.Y = expect.si.height / 2; in TEST_IMPL()