1 /* Copyright (c) 2008, 2009
2 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
3 * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
4 * Micah Cowan (micah@cowan.name)
5 * Sadrul Habib Chowdhury (sadrul@users.sourceforge.net)
6 * Copyright (c) 1993-2002, 2003, 2005, 2006, 2007
7 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
8 * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
9 * Copyright (c) 1987 Oliver Laumann
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 3, or (at your option)
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program (see the file COPYING); if not, see
23 * http://www.gnu.org/licenses/, or contact Free Software Foundation, Inc.,
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
26 ****************************************************************
32 #define ATTR_DI 0 /* Dim mode */
33 #define ATTR_US 1 /* Underscore mode */
34 #define ATTR_BD 2 /* Bold mode */
35 #define ATTR_RV 3 /* Reverse mode */
36 #define ATTR_SO 4 /* Standout mode */
37 #define ATTR_BL 5 /* Blinking */
39 #define A_DI (1<<ATTR_DI)
40 #define A_US (1<<ATTR_US)
41 #define A_BD (1<<ATTR_BD)
42 #define A_RV (1<<ATTR_RV)
43 #define A_SO (1<<ATTR_SO)
44 #define A_BL (1<<ATTR_BL)
45 #define A_MAX (1<<(NATTR-1))
52 /* pseudo attributes */
53 # define ATTR_BFG 6 /* bright foreground */
54 # define ATTR_BBG 7 /* bright background */
55 # define A_BFG (1<<ATTR_BFG)
56 # define A_BBG (1<<ATTR_BBG)
62 /* keep state_t and state_t_string in sync! */
65 LIT
, /* Literal input */
66 ESC
, /* Start of escape sequence */
67 ASTR
, /* Start of control string */
68 STRESC
, /* ESC seen in control string */
69 CSI
, /* Reading arguments in "CSI Pn ;...*/
70 PRIN
, /* Printer mode */
71 PRINESC
, /* ESC seen in printer mode */
72 PRINCSI
, /* CSI seen in printer mode */
73 PRIN4
/* CSI 4 seen in printer mode */
76 /* keep string_t and string_t_string in sync! */
80 DCS
, /* Device control string */
81 OSC
, /* Operating system command */
82 APC
, /* Application program command */
83 /* - used for status change */
84 PM
, /* Privacy message */
85 AKA
, /* title for current screen */
86 GM
, /* Global message to every display */
87 STATUS
/* User hardstatus line */
91 * Types of movement used by GotoPos()
104 M_CR
/* CR and rewrite */
107 #define EXPENSIVE 1000
119 #define STATLINE (D_height-1)
124 #define KANJI ('B' & 037)
125 #define KANJI0212 ('D' & 037)
147 # define UCS_REPL 0xfffd /* character for illegal codes */
148 # define UCS_REPL_DW 0xff1f /* character for illegal codes */
149 # define UCS_HIDDEN 0xffff
153 # define is_dw_font(f) ((f) && ((f) & 0x60) == 0)
156 # define dw_left(ml, x, enc) ((enc == UTF8) ? \
157 (unsigned char)(ml)->font[(x) + 1] == 0xff && (unsigned char)(ml)->image[(x) + 1] == 0xff : \
158 ((unsigned char)(ml)->font[x] & 0x1f) != 0 && ((unsigned char)(ml)->font[x] & 0xe0) == 0 \
160 # define dw_right(ml, x, enc) ((enc == UTF8) ? \
161 (unsigned char)(ml)->font[x] == 0xff && (unsigned char)(ml)->image[x] == 0xff : \
162 ((unsigned char)(ml)->font[x] & 0xe0) == 0x80 \
165 # define dw_left(ml, x, enc) ( \
166 ((unsigned char)(ml)->font[x] & 0x1f) != 0 && ((unsigned char)(ml)->font[x] & 0xe0) == 0 \
168 # define dw_right(ml, x, enc) ( \
169 ((unsigned char)(ml)->font[x] & 0xe0) == 0x80 \
173 # define dw_left(ml, x, enc) 0
174 # define dw_right(ml, x, enc) 0