Index: head/sys/teken/sequences =================================================================== --- head/sys/teken/sequences (revision 322655) +++ head/sys/teken/sequences (revision 322656) @@ -1,114 +1,114 @@ #- # Copyright (c) 2008-2009 Ed Schouten # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # # $FreeBSD$ # File format is as follows: # Abbr Abbreviation of sequence name # Name Sequence name (will be converted to C function name) # Sequence Bytes that form the sequence # Arguments Standard value of arguments passed to this sequence # - `n' non-zero number (0 gets converted to 1) # - `r' regular numeric argument # - `v' means a variable number of arguments # Abbr Name Sequence Arguments CBT Cursor Backward Tabulation ^[ [ Z n CHT Cursor Forward Tabulation ^[ [ I n CNL Cursor Next Line ^[ [ E n CPL Cursor Previous Line ^[ [ F n CPR Cursor Position Report ^[ [ n r CUB Cursor Backward ^[ [ D n CUD Cursor Down ^[ [ B n CUD Cursor Down ^[ [ e n CUF Cursor Forward ^[ [ C n CUF Cursor Forward ^[ [ a n CUP Cursor Position ^[ [ H n n CUP Cursor Position ^[ [ f n n CUU Cursor Up ^[ [ A n DA1 Primary Device Attributes ^[ [ c r DA2 Secondary Device Attributes ^[ [ > c r DC Delete character ^[ [ P n DCS Device Control String ^[ P DECALN Alignment test ^[ # 8 DECDHL Double Height Double Width Line Top ^[ # 3 DECDHL Double Height Double Width Line Bottom ^[ # 4 DECDWL Single Height Double Width Line ^[ # 6 DECKPAM Keypad application mode ^[ = DECKPNM Keypad numeric mode ^[ > DECRC Restore cursor ^[ 8 DECRC Restore cursor ^[ [ u DECRM Reset DEC mode ^[ [ ? l r DECSC Save cursor ^[ 7 DECSC Save cursor ^[ [ s DECSM Set DEC mode ^[ [ ? h r DECSTBM Set top and bottom margins ^[ [ r r r DECSWL Single Height Single Width Line ^[ # 5 DL Delete line ^[ [ M n DSR Device Status Report ^[ [ ? n r ECH Erase character ^[ [ X n ED Erase display ^[ [ J r EL Erase line ^[ [ K r G0SCS0 G0 SCS Special Graphics ^[ ( 0 G0SCS1 G0 SCS US ASCII ^[ ( 1 G0SCS2 G0 SCS Special Graphics ^[ ( 2 G0SCSA G0 SCS UK National ^[ ( A G0SCSB G0 SCS US ASCII ^[ ( B G1SCS0 G1 SCS Special Graphics ^[ ) 0 G1SCS1 G1 SCS US ASCII ^[ ) 1 G1SCS2 G1 SCS Special Graphics ^[ ) 2 G1SCSA G1 SCS UK National ^[ ) A G1SCSB G1 SCS US ASCII ^[ ) B HPA Horizontal Position Absolute ^[ [ G n HPA Horizontal Position Absolute ^[ [ ` n HTS Horizontal Tab Set ^[ H ICH Insert character ^[ [ @ n IL Insert line ^[ [ L n IND Index ^[ D NEL Next line ^[ E OSC Operating System Command ^[ ] RI Reverse index ^[ M RIS Reset to Initial State ^[ c RM Reset Mode ^[ [ l r SD Pan Up ^[ [ T n SGR Set Graphic Rendition ^[ [ m v SM Set Mode ^[ [ h r ST String Terminator ^[ \\ SU Pan Down ^[ [ S n TBC Tab Clear ^[ [ g r VPA Vertical Position Absolute ^[ [ d n # Cons25 compatibility sequences -C25ADX Cons25 set adapter border ^[ [ = A r -C25ADBG Cons25 set adapter background ^[ [ = G r -C25ADFG Cons25 set adapter foreground ^[ [ = F r C25BLPD Cons25 set bell pitch duration ^[ [ = B r r +C25BORD Cons25 set border ^[ [ = A r C25CURS Cons25 set cursor type ^[ [ = S r +C25DBG Cons25 set default background ^[ [ = G r +C25DFG Cons25 set default foreground ^[ [ = F r C25MODE Cons25 set terminal mode ^[ [ = T r C25SGR Cons25 set graphic rendition ^[ [ x r r C25VTSW Cons25 switch virtual terminal ^[ [ z r # VT52 compatibility #DECID VT52 DECID ^[ Z Index: head/sys/teken/teken_subr_compat.h =================================================================== --- head/sys/teken/teken_subr_compat.h (revision 322655) +++ head/sys/teken/teken_subr_compat.h (revision 322656) @@ -1,126 +1,126 @@ /*- * Copyright (c) 2008-2009 Ed Schouten * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ static void -teken_subr_cons25_set_adapter_border(teken_t *t, unsigned int c) +teken_subr_cons25_set_border(teken_t *t, unsigned int c) { teken_funcs_param(t, TP_SETBORDER, c); } static void teken_subr_cons25_set_cursor_type(teken_t *t, unsigned int type) { teken_funcs_param(t, TP_SHOWCURSOR, type != 1); } static const teken_color_t cons25_colors[8] = { TC_BLACK, TC_BLUE, TC_GREEN, TC_CYAN, TC_RED, TC_MAGENTA, TC_BROWN, TC_WHITE }; static void -teken_subr_cons25_set_adapter_background(teken_t *t, unsigned int c) +teken_subr_cons25_set_default_background(teken_t *t, unsigned int c) { t->t_defattr.ta_bgcolor = cons25_colors[c % 8] | (c & 8); t->t_curattr.ta_bgcolor = cons25_colors[c % 8] | (c & 8); } static void -teken_subr_cons25_set_adapter_foreground(teken_t *t, unsigned int c) +teken_subr_cons25_set_default_foreground(teken_t *t, unsigned int c) { t->t_defattr.ta_fgcolor = cons25_colors[c % 8] | (c & 8); t->t_curattr.ta_fgcolor = cons25_colors[c % 8] | (c & 8); } static const teken_color_t cons25_revcolors[8] = { 0, 4, 2, 6, 1, 5, 3, 7 }; void teken_get_defattr_cons25(teken_t *t, int *fg, int *bg) { *fg = cons25_revcolors[teken_256to8(t->t_defattr.ta_fgcolor)]; if (t->t_defattr.ta_format & TF_BOLD) *fg += 8; *bg = cons25_revcolors[teken_256to8(t->t_defattr.ta_bgcolor)]; } static void teken_subr_cons25_switch_virtual_terminal(teken_t *t, unsigned int vt) { teken_funcs_param(t, TP_SWITCHVT, vt); } static void teken_subr_cons25_set_bell_pitch_duration(teken_t *t, unsigned int pitch, unsigned int duration) { teken_funcs_param(t, TP_SETBELLPD, (pitch << 16) | (duration & 0xffff)); } static void teken_subr_cons25_set_graphic_rendition(teken_t *t, unsigned int cmd, unsigned int param __unused) { switch (cmd) { case 0: /* Reset. */ t->t_curattr = t->t_defattr; break; default: teken_printf("unsupported attribute %u\n", cmd); } } static void teken_subr_cons25_set_terminal_mode(teken_t *t, unsigned int mode) { switch (mode) { case 0: /* Switch terminal to xterm. */ t->t_stateflags &= ~TS_CONS25; break; case 1: /* Switch terminal to cons25. */ t->t_stateflags |= TS_CONS25; break; } } #if 0 static void teken_subr_vt52_decid(teken_t *t) { const char response[] = "\x1B/Z"; teken_funcs_respond(t, response, sizeof response - 1); } #endif