teken_subr.h (197480) | teken_subr.h (197520) |
---|---|
1/*- 2 * Copyright (c) 2008-2009 Ed Schouten <ed@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 2008-2009 Ed Schouten <ed@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/teken/teken_subr.h 197480 2009-09-25 11:58:51Z ed $ | 26 * $FreeBSD: head/sys/teken/teken_subr.h 197520 2009-09-26 15:03:42Z ed $ |
27 */ 28 29static void teken_subr_cursor_up(teken_t *, unsigned int); 30static void teken_subr_erase_line(teken_t *, unsigned int); 31static void teken_subr_regular_character(teken_t *, teken_char_t); 32static void teken_subr_reset_to_initial_state(teken_t *); 33static void teken_subr_save_cursor(teken_t *); 34 --- 500 unchanged lines hidden (view full) --- 535 536 teken_funcs_fill(t, &r, BLANK, &t->t_curattr); 537} 538 539static void 540teken_subr_g0_scs_special_graphics(teken_t *t __unused) 541{ 542 | 27 */ 28 29static void teken_subr_cursor_up(teken_t *, unsigned int); 30static void teken_subr_erase_line(teken_t *, unsigned int); 31static void teken_subr_regular_character(teken_t *, teken_char_t); 32static void teken_subr_reset_to_initial_state(teken_t *); 33static void teken_subr_save_cursor(teken_t *); 34 --- 500 unchanged lines hidden (view full) --- 535 536 teken_funcs_fill(t, &r, BLANK, &t->t_curattr); 537} 538 539static void 540teken_subr_g0_scs_special_graphics(teken_t *t __unused) 541{ 542 |
543 teken_scs_set(t, 0, teken_scs_special_graphics); | 543 t->t_scs[0] = teken_scs_special_graphics; |
544} 545 546static void 547teken_subr_g0_scs_uk_national(teken_t *t __unused) 548{ 549 | 544} 545 546static void 547teken_subr_g0_scs_uk_national(teken_t *t __unused) 548{ 549 |
550 teken_scs_set(t, 0, teken_scs_uk_national); | 550 t->t_scs[0] = teken_scs_uk_national; |
551} 552 553static void 554teken_subr_g0_scs_us_ascii(teken_t *t __unused) 555{ 556 | 551} 552 553static void 554teken_subr_g0_scs_us_ascii(teken_t *t __unused) 555{ 556 |
557 teken_scs_set(t, 0, teken_scs_us_ascii); | 557 t->t_scs[0] = teken_scs_us_ascii; |
558} 559 560static void 561teken_subr_g1_scs_special_graphics(teken_t *t __unused) 562{ 563 | 558} 559 560static void 561teken_subr_g1_scs_special_graphics(teken_t *t __unused) 562{ 563 |
564 teken_scs_set(t, 1, teken_scs_special_graphics); | 564 t->t_scs[1] = teken_scs_special_graphics; |
565} 566 567static void 568teken_subr_g1_scs_uk_national(teken_t *t __unused) 569{ 570 | 565} 566 567static void 568teken_subr_g1_scs_uk_national(teken_t *t __unused) 569{ 570 |
571 teken_scs_set(t, 1, teken_scs_uk_national); | 571 t->t_scs[1] = teken_scs_uk_national; |
572} 573 574static void 575teken_subr_g1_scs_us_ascii(teken_t *t __unused) 576{ 577 | 572} 573 574static void 575teken_subr_g1_scs_us_ascii(teken_t *t __unused) 576{ 577 |
578 teken_scs_set(t, 1, teken_scs_us_ascii); | 578 t->t_scs[1] = teken_scs_us_ascii; |
579} 580 581static void 582teken_subr_horizontal_position_absolute(teken_t *t, unsigned int col) 583{ 584 585 t->t_cursor.tp_col = col - 1; 586 if (t->t_cursor.tp_col >= t->t_winsize.tp_col) --- 370 unchanged lines hidden (view full) --- 957 t->t_curattr = t->t_defattr; 958 t->t_cursor.tp_row = t->t_cursor.tp_col = 0; 959 t->t_scrollreg.ts_begin = 0; 960 t->t_scrollreg.ts_end = t->t_winsize.tp_row; 961 t->t_originreg = t->t_scrollreg; 962 t->t_stateflags &= TS_8BIT|TS_CONS25; 963 t->t_stateflags |= TS_AUTOWRAP; 964 | 579} 580 581static void 582teken_subr_horizontal_position_absolute(teken_t *t, unsigned int col) 583{ 584 585 t->t_cursor.tp_col = col - 1; 586 if (t->t_cursor.tp_col >= t->t_winsize.tp_col) --- 370 unchanged lines hidden (view full) --- 957 t->t_curattr = t->t_defattr; 958 t->t_cursor.tp_row = t->t_cursor.tp_col = 0; 959 t->t_scrollreg.ts_begin = 0; 960 t->t_scrollreg.ts_end = t->t_winsize.tp_row; 961 t->t_originreg = t->t_scrollreg; 962 t->t_stateflags &= TS_8BIT|TS_CONS25; 963 t->t_stateflags |= TS_AUTOWRAP; 964 |
965 teken_scs_set(t, 0, teken_scs_us_ascii); 966 teken_scs_set(t, 1, teken_scs_us_ascii); 967 teken_scs_switch(t, 0); | 965 t->t_scs[0] = teken_scs_us_ascii; 966 t->t_scs[1] = teken_scs_us_ascii; 967 t->t_curscs = 0; |
968 969 teken_subr_save_cursor(t); 970 teken_tab_default(t); 971} 972 973static void 974teken_subr_reset_to_initial_state(teken_t *t) 975{ --- 5 unchanged lines hidden (view full) --- 981} 982 983static void 984teken_subr_restore_cursor(teken_t *t) 985{ 986 987 t->t_cursor = t->t_saved_cursor; 988 t->t_curattr = t->t_saved_curattr; | 968 969 teken_subr_save_cursor(t); 970 teken_tab_default(t); 971} 972 973static void 974teken_subr_reset_to_initial_state(teken_t *t) 975{ --- 5 unchanged lines hidden (view full) --- 981} 982 983static void 984teken_subr_restore_cursor(teken_t *t) 985{ 986 987 t->t_cursor = t->t_saved_cursor; 988 t->t_curattr = t->t_saved_curattr; |
989 t->t_scs[t->t_curscs] = t->t_saved_curscs; |
|
989 t->t_stateflags &= ~TS_WRAPPED; | 990 t->t_stateflags &= ~TS_WRAPPED; |
990 teken_scs_restore(t); | |
991 teken_funcs_cursor(t); 992} 993 994static void 995teken_subr_reverse_index(teken_t *t) 996{ 997 998 if (t->t_cursor.tp_row > t->t_scrollreg.ts_begin) { --- 6 unchanged lines hidden (view full) --- 1005} 1006 1007static void 1008teken_subr_save_cursor(teken_t *t) 1009{ 1010 1011 t->t_saved_cursor = t->t_cursor; 1012 t->t_saved_curattr = t->t_curattr; | 991 teken_funcs_cursor(t); 992} 993 994static void 995teken_subr_reverse_index(teken_t *t) 996{ 997 998 if (t->t_cursor.tp_row > t->t_scrollreg.ts_begin) { --- 6 unchanged lines hidden (view full) --- 1005} 1006 1007static void 1008teken_subr_save_cursor(teken_t *t) 1009{ 1010 1011 t->t_saved_cursor = t->t_cursor; 1012 t->t_saved_curattr = t->t_curattr; |
1013 teken_scs_save(t); | 1013 t->t_saved_curscs = t->t_scs[t->t_curscs]; |
1014} 1015 1016static void 1017teken_subr_secondary_device_attributes(teken_t *t, unsigned int request) 1018{ 1019 1020 if (request == 0) { 1021 const char response[] = "\x1B[>0;10;0c"; --- 221 unchanged lines hidden --- | 1014} 1015 1016static void 1017teken_subr_secondary_device_attributes(teken_t *t, unsigned int request) 1018{ 1019 1020 if (request == 0) { 1021 const char response[] = "\x1B[>0;10;0c"; --- 221 unchanged lines hidden --- |