5
static char *pre_reset;
8
/*------------------------------------*/
9
/* ANSI-Terminal specific section */
10
/*------------------------------------*/
12
static void menu_ansi(char **pre, BOOL *lc, char *txt, char *parstring)
18
printf("\n-------------------------------------------------------------\n");
19
printf("Enter the text attributes for printing of >%s< residues:\n", txt);
20
printf("Different letters specify renditions,\n"
21
"lowercase choices mean lowercase residues:\n"
22
"(N,n) normal (B,b) bold (U,u) underscore (R,r) reverse\n"
23
"(F,f) flashing (E,e) reverse/bold (L,l) reverse/flashing\n\n"
24
"choose from NnBbUuRrFfEeLl ( * %c * ) : ", parstring[0]);
25
Fgets(instring, 41, stdin);
28
if (*instring == '\0')
32
if (strchr("NBURELF", toupper(code)) == NULL)
37
case 'N': *pre = ESC "[0m"; break;
38
case 'B': *pre = ESC "[0;1m"; break;
39
case 'U': *pre = ESC "[0;4m"; break;
40
case 'R': *pre = ESC "[0;7m"; break;
41
case 'E': *pre = ESC "[0;1;7m"; break;
42
case 'L': *pre = ESC "[0;5;7m"; break;
43
case 'F': *pre = ESC "[0;5m"; break;
48
static void ask(char *term)
54
printf("-------------------------------------------------------------\n");
55
pre_reset = ESC "[0m";
56
Fgets(parstring, 6, parfile);
58
menu_ansi(&pre[0], lc, "different", parstring);
59
Fgets(parstring, 6, parfile);
61
menu_ansi(&pre[1], &lc[1], "identical", parstring);
62
Fgets(parstring, 6, parfile);
65
menu_ansi(&pre[2], &lc[2], "similar", parstring);
70
Fgets(parstring, 6, parfile);
73
menu_ansi(&pre[3], &lc[3], "conserved", parstring);
81
printf("filename for %s-output (return for terminal) : ", term);
86
static void ask_vt(void) {
90
static void ask_ansi(void) {
94
/* ------------------- output functions */
96
static void VTinit(double *xpos, double *ypos) {
97
if (*outname == '\0') {
101
assert(outopen(&outfile, outname) != NULL);
102
fputs(ESC "[2J" ESC "[0;0H", outfile.f);
103
fputs(pre_reset, outfile.f);
114
static void VTsetcolor(int colno) {
115
fputs(pre[colno], outfile.f);
118
static void VTcharout(char c, double *xpos, double *ypos) {
123
static void VTnewline(double *xpos, double *ypos) {
124
uwriteln(&outfile, pre_reset);
129
static void VTnewpage(double *xpos, double *ypos) {
130
printf("\007"); fflush(stdout);
137
static void VTexit(void) {
138
uwriteln(&outfile, pre_reset);
139
if (outfile.f != NULL && outfile.f != stdout)
144
GraphicsDevice Ansi = {
156
GraphicsDevice Vt = {