]> git.gir.st - minesVIiper.git/blob - schemes.h
add `make test'
[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 = SGR(REV,"!"),
68 .field_question = SGR(REV,"?"),
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 .flag_offset = 4,
85 };
86
87 struct minescheme symbols_col1 = {
88 .number = {" ",
89 SGR(BBLUE, "1"),
90 SGR(GREEN, "2"),
91 SGR(RED, "3"),
92 SGR(BLUE, "4"),
93 SGR(YELLOW,"5"),
94 SGR(CYAN, "6"),
95 SGR(GREY, "7"),
96 SGR(WHITE, "8")},
97 .field_closed = "░░",
98 .field_flagged = SGR(GREY,"▕\033["BRED"m▀"),
99 .field_question = "?",
100 .mouse_highlight = "▓▓",
101 .mine_normal = "*",
102 .mine_death = SGR(RED,"*"),
103 .mine_wrongf = "/",
104 .mine_wrongq = "\",
105
106 .emoticons = {":)", ":(", ":D", ":o"},
107
108 .border = {{"╔═","══","═╗"},
109 {"║ "," "," ║"},
110 {"╟─","──","─╢"},
111 {"║ "," "," ║"},
112 {"╚═","══","═╝"}},
113
114 .cell_width = 2,
115 };
116
117 struct minescheme symbols_doublewidth = {
118 /* vt220 multilingual character set,
119 see http://vt100.net/docs/vt220-rm/table2-4.html */
120 .number = {" ",
121 SGR(BOLD,"1"),
122 SGR(BOLD,"2"),
123 SGR(BOLD,"3"),
124 SGR(BOLD,"4"),
125 SGR(BOLD,"5"),
126 SGR(BOLD,"6"),
127 SGR(BOLD,"7"),
128 SGR(BOLD,"8")},
129 .field_closed = "\x61",
130 .field_flagged = SGR(REV,SGR(BOLD,"!")),
131 .field_question = SGR(BOLD,"?"),
132 .mouse_highlight = SGR(BLINK,"@"),
133 .mine_normal = SGR(BOLD,"*"),
134 .mine_death = SGR(BOLD,"#"),
135 .mine_wrongf = SGR(BOLD,"/"),
136 .mine_wrongq = SGR(BOLD,"\\"),
137
138 .emoticons = {":)", ":(", ":D", "\033(B:o\033(0"},
139
140 .border = {{"\033#6\x6c","\x71","\x6b"},
141 {"\033#6\x78"," ","\x78"},
142 {"\033#6\x74","\x71","\x75"},
143 {"\033#6\x78"," ","\x78"},
144 {"\033#6\x6d","\x71","\x6a"}},
145
146 .cell_width = 1,
147 .flag_offset = 4,
148 .init_seq = "\033(0" /* enable DEC Special Graphics Character Set */
149 "\033[?3l", /* switch to 80 column mode */
150 .reset_seq = "\033(B" /* reset to DEC Multinational Character Set */
151 "\033[?3h", /* switch back to 132 column mode (TODO: shouldn't be hardcoded) */
152 };
153
154 #undef SGR
155 #undef BOLD
156 #undef BLINK
157 #undef RED
158 #undef GREEN
159 #undef YELLOW
160 #undef BLUE
161 #undef CYAN
162 #undef GREY
163 #undef BRED
164 #undef BBLUE
165 #undef WHITE
166 #endif
Imprint / Impressum