]> git.gir.st - minesVIiper.git/blob - schemes.h
VT220: Soft charset for Flag glyph (cleanup)
[minesVIiper.git] / schemes.h
1 /*
2 contains color/monchrome schemes for tty-mines.
3 */
4 #ifndef __SCHEMES_H__
5 #define __SCHEMES_H__
6
7 #define SGR(color, string) "\033[" color "m" string "\033[0m"
8 #define BOLD "1"
9 #define BLINK "5"
10 #define REV "7"
11 #define RED "31"
12 #define GREEN "32"
13 #define YELLOW "33"
14 #define BLUE "34"
15 #define CYAN "36"
16 #define GREY "37"
17 #define BRED "91"
18 #define BBLUE "94"
19 #define WHITE "97"
20
21 enum e_emoticons {
22 EMOT_SMILE,
23 EMOT_DEAD,
24 EMOT_WON,
25 EMOT_OHH,
26 NUM_EMOT,
27 };
28
29 enum e_border_lines {
30 B_TOP,
31 B_STATUS,
32 B_DIVIDER,
33 B_FIELD,
34 B_BOTTOM,
35 };
36 enum e_border_cols {
37 B_LEFT,
38 B_MIDDLE,
39 B_RIGHT,
40 };
41
42 struct minescheme {
43 char* number[9];
44 char* field_closed;
45 char* field_flagged;
46 char* field_question;
47 char* mouse_highlight;
48 char* mine_normal;
49 char* mine_death;
50 char* mine_wrongf;
51 char* mine_wrongq;
52
53 char* emoticons[NUM_EMOT];
54
55 char* border[5][3];
56
57 int cell_width;
58 /* length of the SGR() in front of '!' and '?' for cursor highlight: */
59 int flag_offset;
60 char* init_seq;
61 char* reset_seq;
62 };
63
64 struct minescheme symbols_mono = {
65 .number = {" ", "1", "2", "3", "4", "5", "6", "7", "8"},
66 .field_closed = "░░",
67 .field_flagged = "▕▀",
68 .field_question = "?",
69 .mouse_highlight = "▓▓",
70 .mine_normal = "*",
71 .mine_death = "#",
72 .mine_wrongf = "/",
73 .mine_wrongq = "\",
74
75 .emoticons = {":)", ":(", ":D", ":o"},
76
77 .border = {{"╔═","══","═╗"},
78 {"║ "," "," ║"},
79 {"╟─","──","─╢"},
80 {"║ "," "," ║"},
81 {"╚═","══","═╝"}},
82
83 .cell_width = 2,
84 };
85
86 struct minescheme symbols_col1 = {
87 .number = {" ",
88 SGR(BBLUE, "1"),
89 SGR(GREEN, "2"),
90 SGR(RED, "3"),
91 SGR(BLUE, "4"),
92 SGR(YELLOW,"5"),
93 SGR(CYAN, "6"),
94 SGR(GREY, "7"),
95 SGR(WHITE, "8")},
96 .field_closed = "░░",
97 .field_flagged = SGR(GREY,"▕\033["BRED"m▀"),
98 .field_question = "?",
99 .mouse_highlight = "▓▓",
100 .mine_normal = "*",
101 .mine_death = SGR(RED,"*"),
102 .mine_wrongf = "/",
103 .mine_wrongq = "\",
104
105 .emoticons = {":)", ":(", ":D", ":o"},
106
107 .border = {{"╔═","══","═╗"},
108 {"║ "," "," ║"},
109 {"╟─","──","─╢"},
110 {"║ "," "," ║"},
111 {"╚═","══","═╝"}},
112
113 .cell_width = 2,
114 };
115
116 struct minescheme symbols_doublewidth = {
117 /* for the vt220.
118 DEC Special Graphics Character Set:
119 http://vt100.net/docs/vt220-rm/table2-4.html
120 Dynamically Redefinable Character Set:
121 https://vt100.net/docs/vt220-rm/chapter4.html#S4.16 */
122 .number = {" ",
123 SGR(BOLD,"1"),
124 SGR(BOLD,"2"),
125 SGR(BOLD,"3"),
126 SGR(BOLD,"4"),
127 SGR(BOLD,"5"),
128 SGR(BOLD,"6"),
129 SGR(BOLD,"7"),
130 SGR(BOLD,"8")},
131 .field_closed = "\x61",
132 .field_flagged = SGR(BOLD,"\eO!"),
133 .field_question = SGR(BOLD,"?"),
134 .mouse_highlight = SGR(BLINK,"@"),
135 .mine_normal = SGR(BOLD,"*"),
136 .mine_death = SGR(BOLD,"#"),
137 .mine_wrongf = SGR(BOLD,"/"),
138 .mine_wrongq = SGR(BOLD,"\\"),
139
140 .emoticons = {":)", ":(", ":D", "\033(B:o\033(0"},
141
142 .border = {{"\033#6\x6c","\x71","\x6b"},
143 {"\033#6\x78"," ","\x78"},
144 {"\033[?25l\033#6\x74","\x71","\x75"},
145 {"\033#6\x78"," ","\x78"},
146 {"\033#6\x6d","\x71","\x6a"}},
147
148 .cell_width = 1,
149 .init_seq = "\eP0;1;0;4;1;1{P" /* config for DRCS "P": 7x10,erase-all */
150 "??~^^^^/??N????\e\\" /* flag at '!' resembling ▕▀ */
151 "\e(0\e+P\x0f" /* G0=Graphics, G3="P", lock charset to G0 */
152 "\033[?3l", /* switch to 80 column mode */
153 .reset_seq = "\033(B" /* reset to DEC Multinational Character Set */
154 "\033[?3h", /* switch back to 132 column mode (TODO: shouldn't be hardcoded) */
155 };
156
157 #undef SGR
158 #undef BOLD
159 #undef BLINK
160 #undef RED
161 #undef GREEN
162 #undef YELLOW
163 #undef BLUE
164 #undef CYAN
165 #undef GREY
166 #undef BRED
167 #undef BBLUE
168 #undef WHITE
169 #endif
Imprint / Impressum