Main Page | Class List | File List | Class Members | File Members

ansi.h

Go to the documentation of this file.
00001 /* Copyright (c) 1993-2002
00002  *      Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
00003  *      Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
00004  * Copyright (c) 1987 Oliver Laumann
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2, or (at your option)
00009  * any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program (see the file COPYING); if not, write to the
00018  * Free Software Foundation, Inc.,
00019  * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
00020  *
00021  ****************************************************************
00022  * $Id: ansi.h,v 1.6 1994/05/31 12:31:28 mlschroe Exp $ FAU
00023  */
00024 
00025 #define NATTR           6
00026 
00027 #define ATTR_DI         0       /* Dim mode */
00028 #define ATTR_US         1       /* Underscore mode */
00029 #define ATTR_BD         2       /* Bold mode */
00030 #define ATTR_RV         3       /* Reverse mode */
00031 #define ATTR_SO         4       /* Standout mode */
00032 #define ATTR_BL         5       /* Blinking */
00033 
00034 #define A_DI    (1<<ATTR_DI)
00035 #define A_US    (1<<ATTR_US)
00036 #define A_BD    (1<<ATTR_BD)
00037 #define A_RV    (1<<ATTR_RV)
00038 #define A_SO    (1<<ATTR_SO)
00039 #define A_BL    (1<<ATTR_BL)
00040 #define A_MAX   (1<<(NATTR-1))
00041 
00042 #define ATYP_M          (1<<0)
00043 #define ATYP_S          (1<<1)
00044 #define ATYP_U          (1<<2)
00045 
00046 #ifdef COLORS16
00047 /* pseudo attributes */
00048 # define ATTR_BFG       6       /* bright foreground */
00049 # define ATTR_BBG       7       /* bright background */
00050 # define A_BFG  (1<<ATTR_BFG)
00051 # define A_BBG  (1<<ATTR_BBG)
00052 #endif
00053 
00054 /*
00055  *  Parser state
00056  */
00057 /* keep state_t and state_t_string in sync! */
00058 enum state_t 
00059 {
00060   LIT,                          /* Literal input */
00061   ESC,                          /* Start of escape sequence */
00062   ASTR,                         /* Start of control string */
00063   STRESC,                       /* ESC seen in control string */
00064   CSI,                          /* Reading arguments in "CSI Pn ;...*/
00065   PRIN,                         /* Printer mode */
00066   PRINESC,                      /* ESC seen in printer mode */
00067   PRINCSI,                      /* CSI seen in printer mode */
00068   PRIN4                         /* CSI 4 seen in printer mode */
00069 };
00070 
00071 /* keep string_t and string_t_string in sync! */
00072 enum string_t 
00073 {
00074   NONE,
00075   DCS,                          /* Device control string */
00076   OSC,                          /* Operating system command */
00077   APC,                          /* Application program command */
00078                                 /*  - used for status change */
00079   PM,                           /* Privacy message */
00080   AKA,                          /* title for current screen */
00081   GM,                           /* Global message to every display */
00082   STATUS                        /* User hardstatus line */
00083 };
00084 
00085 /*
00086  *  Types of movement used by GotoPos()
00087  */
00088 enum move_t {
00089         M_NONE,
00090         M_UP,
00091         M_CUP,
00092         M_DO,
00093         M_CDO,
00094         M_LE,
00095         M_CLE,
00096         M_RI,
00097         M_CRI,
00098         M_RW,
00099         M_CR    /* CR and rewrite */
00100 };
00101 
00102 #define EXPENSIVE        1000
00103 
00104 #define G0                       0
00105 #define G1                       1
00106 #define G2                       2
00107 #define G3                       3
00108 
00109 #define ASCII            0
00110 
00111 #ifdef TOPSTAT
00112 #define STATLINE         (0)
00113 #else
00114 #define STATLINE         (D_height-1)
00115 #endif
00116 
00117 #ifdef ENCODINGS
00118 
00119 #define KANJI           ('B' & 037)
00120 #define KANJI0212       ('D' & 037)
00121 #define KANA    'I'
00122 
00123 #define EUC_JP  1
00124 #define SJIS    2
00125 #define EUC_KR  3
00126 #define EUC_CN  4
00127 #define BIG5    5
00128 #define KOI8R   6
00129 #define CP1251  7
00130 #define GBK     20
00131 
00132 #define EUC     EUC_JP
00133 
00134 #endif
00135 
00136 #ifdef UTF8
00137 #undef UTF8
00138 #define UTF8    8
00139 #endif
00140 
00141 #ifdef UTF8
00142 # define UCS_REPL    0xfffd  /* character for illegal codes */
00143 # define UCS_REPL_DW 0xff1f  /* character for illegal codes */
00144 # define UCS_HIDDEN 0xffff
00145 #endif
00146 
00147 #ifdef DW_CHARS
00148 # define is_dw_font(f) ((f) && ((f) & 0x60) == 0)
00149 
00150 # ifdef UTF8
00151 #  define dw_left(ml, x, enc) ((enc == UTF8) ? \
00152         (unsigned char)(ml)->font[(x) + 1] == 0xff && (unsigned char)(ml)->image[(x) + 1] == 0xff : \
00153         ((unsigned char)(ml)->font[x] & 0x1f) != 0 && ((unsigned char)(ml)->font[x] & 0xe0) == 0 \
00154         )
00155 #  define dw_right(ml, x, enc) ((enc == UTF8) ? \
00156         (unsigned char)(ml)->font[x] == 0xff && (unsigned char)(ml)->image[x] == 0xff : \
00157         ((unsigned char)(ml)->font[x] & 0xe0) == 0x80 \
00158         )
00159 # else
00160 #  define dw_left(ml, x, enc) ( \
00161         ((unsigned char)(ml)->font[x] & 0x1f) != 0 && ((unsigned char)(ml)->font[x] & 0xe0) == 0 \
00162         )
00163 #  define dw_right(ml, x, enc) ( \
00164         ((unsigned char)(ml)->font[x] & 0xe0) == 0x80 \
00165         )
00166 # endif /* UTF8 */
00167 #else
00168 # define dw_left(ml, x, enc) 0
00169 # define dw_right(ml, x, enc) 0
00170 #endif

Generated on Sat Jul 2 20:56:15 2005 for GNU Screen by  doxygen 1.4.3