1
/* Copyright (c) 1993-2002
2
* Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
3
* Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
4
* Copyright (c) 1987 Oliver Laumann
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2, or (at your option)
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program (see the file COPYING); if not, write to the
18
* Free Software Foundation, Inc.,
19
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
21
****************************************************************
22
* $Id: ansi.h,v 1.6 1994/05/31 12:31:28 mlschroe Exp $ FAU
27
#define ATTR_DI 0 /* Dim mode */
28
#define ATTR_US 1 /* Underscore mode */
29
#define ATTR_BD 2 /* Bold mode */
30
#define ATTR_RV 3 /* Reverse mode */
31
#define ATTR_SO 4 /* Standout mode */
32
#define ATTR_BL 5 /* Blinking */
34
#define A_DI (1<<ATTR_DI)
35
#define A_US (1<<ATTR_US)
36
#define A_BD (1<<ATTR_BD)
37
#define A_RV (1<<ATTR_RV)
38
#define A_SO (1<<ATTR_SO)
39
#define A_BL (1<<ATTR_BL)
40
#define A_MAX (1<<(NATTR-1))
47
/* pseudo attributes */
48
# define ATTR_BFG 6 /* bright foreground */
49
# define ATTR_BBG 7 /* bright background */
50
# define A_BFG (1<<ATTR_BFG)
51
# define A_BBG (1<<ATTR_BBG)
57
/* keep state_t and state_t_string in sync! */
60
LIT, /* Literal input */
61
ESC, /* Start of escape sequence */
62
ASTR, /* Start of control string */
63
STRESC, /* ESC seen in control string */
64
CSI, /* Reading arguments in "CSI Pn ;...*/
65
PRIN, /* Printer mode */
66
PRINESC, /* ESC seen in printer mode */
67
PRINCSI, /* CSI seen in printer mode */
68
PRIN4 /* CSI 4 seen in printer mode */
71
/* keep string_t and string_t_string in sync! */
75
DCS, /* Device control string */
76
OSC, /* Operating system command */
77
APC, /* Application program command */
78
/* - used for status change */
79
PM, /* Privacy message */
80
AKA, /* title for current screen */
81
GM, /* Global message to every display */
82
STATUS /* User hardstatus line */
86
* Types of movement used by GotoPos()
99
M_CR /* CR and rewrite */
102
#define EXPENSIVE 1000
114
#define STATLINE (D_height-1)
119
#define KANJI ('B' & 037)
120
#define KANJI0212 ('D' & 037)
142
# define UCS_REPL 0xfffd /* character for illegal codes */
143
# define UCS_REPL_DW 0xff1f /* character for illegal codes */
144
# define UCS_HIDDEN 0xffff
148
# define is_dw_font(f) ((f) && ((f) & 0x60) == 0)
151
# define dw_left(ml, x, enc) ((enc == UTF8) ? \
152
(unsigned char)(ml)->font[(x) + 1] == 0xff && (unsigned char)(ml)->image[(x) + 1] == 0xff : \
153
((unsigned char)(ml)->font[x] & 0x1f) != 0 && ((unsigned char)(ml)->font[x] & 0xe0) == 0 \
155
# define dw_right(ml, x, enc) ((enc == UTF8) ? \
156
(unsigned char)(ml)->font[x] == 0xff && (unsigned char)(ml)->image[x] == 0xff : \
157
((unsigned char)(ml)->font[x] & 0xe0) == 0x80 \
160
# define dw_left(ml, x, enc) ( \
161
((unsigned char)(ml)->font[x] & 0x1f) != 0 && ((unsigned char)(ml)->font[x] & 0xe0) == 0 \
163
# define dw_right(ml, x, enc) ( \
164
((unsigned char)(ml)->font[x] & 0xe0) == 0x80 \
168
# define dw_left(ml, x, enc) 0
169
# define dw_right(ml, x, enc) 0