teken_subr.h (187367) | teken_subr.h (187469) |
---|---|
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/dev/syscons/teken/teken_subr.h 187367 2009-01-17 16:37:13Z ed $ | 26 * $FreeBSD: head/sys/dev/syscons/teken/teken_subr.h 187469 2009-01-20 11:34:28Z 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 *); | 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 *); |
|
33 34static inline int 35teken_tab_isset(teken_t *t, unsigned int col) 36{ 37 unsigned int b, o; 38 39 teken_assert(col <= T_NUMCOL); 40 --- 482 unchanged lines hidden (view full) --- 523 r.tr_end.tp_col = t->t_winsize.tp_col; 524 break; 525 } 526 527 teken_funcs_fill(t, &r, BLANK, &t->t_curattr); 528} 529 530static void | 34 35static inline int 36teken_tab_isset(teken_t *t, unsigned int col) 37{ 38 unsigned int b, o; 39 40 teken_assert(col <= T_NUMCOL); 41 --- 482 unchanged lines hidden (view full) --- 524 r.tr_end.tp_col = t->t_winsize.tp_col; 525 break; 526 } 527 528 teken_funcs_fill(t, &r, BLANK, &t->t_curattr); 529} 530 531static void |
532teken_subr_g0_scs_special_graphics(teken_t *t __unused) 533{ 534 535 teken_scs_set(t, 0, teken_scs_special_graphics); 536} 537 538static void 539teken_subr_g0_scs_uk_national(teken_t *t __unused) 540{ 541 542 teken_scs_set(t, 0, teken_scs_uk_national); 543} 544 545static void 546teken_subr_g0_scs_us_ascii(teken_t *t __unused) 547{ 548 549 teken_scs_set(t, 0, teken_scs_us_ascii); 550} 551 552static void 553teken_subr_g1_scs_special_graphics(teken_t *t __unused) 554{ 555 556 teken_scs_set(t, 1, teken_scs_special_graphics); 557} 558 559static void 560teken_subr_g1_scs_uk_national(teken_t *t __unused) 561{ 562 563 teken_scs_set(t, 1, teken_scs_uk_national); 564} 565 566static void 567teken_subr_g1_scs_us_ascii(teken_t *t __unused) 568{ 569 570 teken_scs_set(t, 1, teken_scs_us_ascii); 571} 572 573static void |
|
531teken_subr_horizontal_position_absolute(teken_t *t, unsigned int col) 532{ 533 534 t->t_cursor.tp_col = col - 1; 535 if (t->t_cursor.tp_col >= t->t_winsize.tp_col) 536 t->t_cursor.tp_col = t->t_winsize.tp_col - 1; 537 538 t->t_stateflags &= ~TS_WRAPPED; --- 196 unchanged lines hidden (view full) --- 735 736 teken_funcs_putchar(t, tp, c, &t->t_curattr); 737} 738 739static void 740teken_subr_regular_character(teken_t *t, teken_char_t c) 741{ 742 int width; | 574teken_subr_horizontal_position_absolute(teken_t *t, unsigned int col) 575{ 576 577 t->t_cursor.tp_col = col - 1; 578 if (t->t_cursor.tp_col >= t->t_winsize.tp_col) 579 t->t_cursor.tp_col = t->t_winsize.tp_col - 1; 580 581 t->t_stateflags &= ~TS_WRAPPED; --- 196 unchanged lines hidden (view full) --- 778 779 teken_funcs_putchar(t, tp, c, &t->t_curattr); 780} 781 782static void 783teken_subr_regular_character(teken_t *t, teken_char_t c) 784{ 785 int width; |
786 787 c = teken_scs_process(t, c); |
|
743 744 /* XXX: Don't process zero-width characters yet. */ 745 width = teken_wcwidth(c); 746 if (width <= 0) 747 return; 748 749#ifdef TEKEN_XTERM 750 if (t->t_cursor.tp_col == t->t_winsize.tp_col - 1 && --- 121 unchanged lines hidden (view full) --- 872 teken_printf("Unknown reset mode: %u\n", cmd); 873 } 874} 875 876static void 877teken_subr_do_reset(teken_t *t) 878{ 879 | 788 789 /* XXX: Don't process zero-width characters yet. */ 790 width = teken_wcwidth(c); 791 if (width <= 0) 792 return; 793 794#ifdef TEKEN_XTERM 795 if (t->t_cursor.tp_col == t->t_winsize.tp_col - 1 && --- 121 unchanged lines hidden (view full) --- 917 teken_printf("Unknown reset mode: %u\n", cmd); 918 } 919} 920 921static void 922teken_subr_do_reset(teken_t *t) 923{ 924 |
880 t->t_curattr = t->t_saved_curattr = t->t_defattr; | 925 t->t_curattr = t->t_defattr; |
881 t->t_cursor.tp_row = t->t_cursor.tp_col = 0; | 926 t->t_cursor.tp_row = t->t_cursor.tp_col = 0; |
882 t->t_saved_cursor = t->t_cursor; | |
883 t->t_stateflags = TS_AUTOWRAP; 884 | 927 t->t_stateflags = TS_AUTOWRAP; 928 |
929 teken_scs_set(t, 0, teken_scs_us_ascii); 930 teken_scs_set(t, 1, teken_scs_us_ascii); 931 teken_scs_switch(t, 0); 932 933 teken_subr_save_cursor(t); |
|
885 teken_tab_default(t); 886} 887 888static void 889teken_subr_reset_to_initial_state(teken_t *t) 890{ 891 892 teken_subr_do_reset(t); --- 4 unchanged lines hidden (view full) --- 897 898static void 899teken_subr_restore_cursor(teken_t *t) 900{ 901 902 t->t_cursor = t->t_saved_cursor; 903 t->t_curattr = t->t_saved_curattr; 904 t->t_stateflags &= ~TS_WRAPPED; | 934 teken_tab_default(t); 935} 936 937static void 938teken_subr_reset_to_initial_state(teken_t *t) 939{ 940 941 teken_subr_do_reset(t); --- 4 unchanged lines hidden (view full) --- 946 947static void 948teken_subr_restore_cursor(teken_t *t) 949{ 950 951 t->t_cursor = t->t_saved_cursor; 952 t->t_curattr = t->t_saved_curattr; 953 t->t_stateflags &= ~TS_WRAPPED; |
954 teken_scs_restore(t); |
|
905 teken_funcs_cursor(t); 906} 907 908static void 909teken_subr_reverse_index(teken_t *t) 910{ 911 912 if (t->t_cursor.tp_row > t->t_scrollreg.ts_begin) { --- 6 unchanged lines hidden (view full) --- 919} 920 921static void 922teken_subr_save_cursor(teken_t *t) 923{ 924 925 t->t_saved_cursor = t->t_cursor; 926 t->t_saved_curattr = t->t_curattr; | 955 teken_funcs_cursor(t); 956} 957 958static void 959teken_subr_reverse_index(teken_t *t) 960{ 961 962 if (t->t_cursor.tp_row > t->t_scrollreg.ts_begin) { --- 6 unchanged lines hidden (view full) --- 969} 970 971static void 972teken_subr_save_cursor(teken_t *t) 973{ 974 975 t->t_saved_cursor = t->t_cursor; 976 t->t_saved_curattr = t->t_curattr; |
977 teken_scs_save(t); |
|
927} 928 929static void | 978} 979 980static void |
930teken_subr_scs(teken_t *t __unused) 931{ 932 933 teken_printf("scs???\n"); 934} 935 936static void | |
937teken_subr_secondary_device_attributes(teken_t *t, unsigned int request) 938{ 939 940 if (request == 0) { 941 const char response[] = "\x1B[>0;10;0c"; 942 teken_funcs_respond(t, response, sizeof response - 1); 943 } else { 944 teken_printf("Unknown DA2\n"); --- 218 unchanged lines hidden --- | 981teken_subr_secondary_device_attributes(teken_t *t, unsigned int request) 982{ 983 984 if (request == 0) { 985 const char response[] = "\x1B[>0;10;0c"; 986 teken_funcs_respond(t, response, sizeof response - 1); 987 } else { 988 teken_printf("Unknown DA2\n"); --- 218 unchanged lines hidden --- |