teken.3 (98e0ffaefb0f241cda3a72395d3be04192ae0d47) | teken.3 (2610c9f2b2449c968304f48bf73d1eef2f4be558) |
---|---|
1.\" Copyright (c) 2011 Ed Schouten <ed@FreeBSD.org> 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 10 unchanged lines hidden (view full) --- 19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23.\" SUCH DAMAGE. 24.\" 25.\" $FreeBSD$ 26.\" | 1.\" Copyright (c) 2011 Ed Schouten <ed@FreeBSD.org> 2.\" All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 10 unchanged lines hidden (view full) --- 19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 23.\" SUCH DAMAGE. 24.\" 25.\" $FreeBSD$ 26.\" |
27.Dd May 9, 2011 | 27.Dd Mar 13, 2017 |
28.Dt TEKEN 3 29.Os 30.Sh NAME 31.Nm teken 32.Nd xterm-like terminal emulation interface 33.Sh LIBRARY 34.Lb libteken 35.Sh SYNOPSIS --- 16 unchanged lines hidden (view full) --- 52.Fn teken_set_curattr "teken_t *t" "const teken_attr_t *attr" 53.Ft const teken_attr_t * 54.Fn teken_get_defattr "teken_t *t" 55.Ft void 56.Fn teken_set_defattr "teken_t *t" "const teken_attr_t *attr" 57.Ft const char * 58.Fn teken_get_sequence "teken_t *t" "unsigned int id" 59.Ft teken_color_t | 28.Dt TEKEN 3 29.Os 30.Sh NAME 31.Nm teken 32.Nd xterm-like terminal emulation interface 33.Sh LIBRARY 34.Lb libteken 35.Sh SYNOPSIS --- 16 unchanged lines hidden (view full) --- 52.Fn teken_set_curattr "teken_t *t" "const teken_attr_t *attr" 53.Ft const teken_attr_t * 54.Fn teken_get_defattr "teken_t *t" 55.Ft void 56.Fn teken_set_defattr "teken_t *t" "const teken_attr_t *attr" 57.Ft const char * 58.Fn teken_get_sequence "teken_t *t" "unsigned int id" 59.Ft teken_color_t |
60.Fn teken_256to16 "teken_color_t color" 61.Ft teken_color_t |
|
60.Fn teken_256to8 "teken_color_t color" 61.Ft void 62.Fn teken_get_defattr_cons25 "teken_t *t" "int *fg" "int *bg" 63.Ft void 64.Fn teken_set_8bit "teken_t *t" 65.Ft void 66.Fn teken_set_cons25 "teken_t *t" 67.Sh DESCRIPTION --- 90 unchanged lines hidden (view full) --- 158.Dv TKEY_* 159parameters listed in 160.In teken.h . 161.Sh LEGACY FEATURES 162This library also provides a set of functions that shouldn't be used in 163any modern applications. 164.Pp 165The | 62.Fn teken_256to8 "teken_color_t color" 63.Ft void 64.Fn teken_get_defattr_cons25 "teken_t *t" "int *fg" "int *bg" 65.Ft void 66.Fn teken_set_8bit "teken_t *t" 67.Ft void 68.Fn teken_set_cons25 "teken_t *t" 69.Sh DESCRIPTION --- 90 unchanged lines hidden (view full) --- 160.Dv TKEY_* 161parameters listed in 162.In teken.h . 163.Sh LEGACY FEATURES 164This library also provides a set of functions that shouldn't be used in 165any modern applications. 166.Pp 167The |
168.Fn teken_256to16 169function converts an xterm-256 256-color code to an xterm 16-color code 170whose color with default palettes is as similar as possible (not very 171similar). 172The lower 3 bits of the result are the ANSI color and the next lowest 173bit is brightness. 174Other layers (hardare and software) that only support 16 colors can use 175this to avoid knowing the details of 256-color codes. 176.Pp 177The |
|
166.Fn teken_256to8 | 178.Fn teken_256to8 |
167function converts a color code to one of the 8 primary colors, allowing 168the terminal to be rendered on graphics hardware that only supports 8 or 16916 colors (e.g. VGA). | 179function is similar to 180.Fn teken_256to16 181except it converts to an ANSI 8-color code. 182This is more accurate than discarding the brigtness bit in the result of 183.Fn teken_256to16 . |
170.Pp 171The 172.Fn teken_get_defattr_cons25 173function obtains the default terminal attributes as a pair of foreground 174and background colors, using ANSI color numbering. 175.Pp 176The 177.Fn teken_set_8bit --- 43 unchanged lines hidden --- | 184.Pp 185The 186.Fn teken_get_defattr_cons25 187function obtains the default terminal attributes as a pair of foreground 188and background colors, using ANSI color numbering. 189.Pp 190The 191.Fn teken_set_8bit --- 43 unchanged lines hidden --- |