]> git.gir.st - minesVIiper.git/blob - schemes.h
finish schemes cleanup, fix %.*s format
[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 struct minescheme {
30 char* number[9];
31 char* field_closed;
32 char* field_flagged;
33 char* field_question;
34 char* mouse_highlight;
35 char* mine_normal;
36 char* mine_death;
37 char* mine_wrongf;
38 char* mine_wrongq;
39
40 char* emoticons[NUM_EMOT];
41
42 char* border_top_l;
43 char* border_top_m;
44 char* border_top_r;
45
46 char* border_status_l;
47 //TODO: better define status line
48 char* border_status_r;
49
50 char* border_spacer_l;
51 char* border_spacer_m;
52 char* border_spacer_r;
53
54 char* border_field_l;
55 char* border_field_r;
56
57 char* border_bottom_l;
58 char* border_bottom_m;
59 char* border_bottom_r;
60
61 int cell_width;
62 int flag_offset;
63 char* init_seq;
64 char* reset_seq;
65 };
66
67 struct minescheme symbols_mono = {
68 .number = {" ", "1", "2", "3", "4", "5", "6", "7", "8"},
69 .field_closed = "░░",
70 .field_flagged = SGR(REV,"!"),
71 .field_question = SGR(REV,"?"),
72 .mouse_highlight = "▓▓",
73 .mine_normal = "*",
74 .mine_death = "#",
75 .mine_wrongf = "/",
76 .mine_wrongq = "\",
77
78 .emoticons = {":)", ":(", ":D", ":o"},
79
80 .border_top_l = "╔═",
81 .border_top_m = "══",
82 .border_top_r = "═╗",
83
84 .border_status_l = "║ ",
85 .border_status_r = " ║",
86
87 .border_spacer_l = "╟─",
88 .border_spacer_m = "──",
89 .border_spacer_r = "─╢",
90
91 .border_field_l = "║ ",
92 .border_field_r = " ║",
93
94 .border_bottom_l = "╚═",
95 .border_bottom_m = "═",
96 .border_bottom_r = "═╝",
97
98 .cell_width = 2,
99 .flag_offset = 4, /* length of the escape sequece infront of .field_flagged and .field_question for cursor highlighting */
100 };
101
102 struct minescheme symbols_col1 = {
103 .number = {" ",
104 SGR(BBLUE, "1"),
105 SGR(GREEN, "2"),
106 SGR(RED, "3"),
107 SGR(BLUE, "4"),
108 SGR(YELLOW,"5"),
109 SGR(CYAN, "6"),
110 SGR(GREY, "7"),
111 SGR(WHITE, "8")},
112 .field_closed = "░░",
113 .field_flagged = CGR(GREY,"▕")CGR(xxx,BRED,"▀"),
114 .field_question = "?",
115 .mouse_highlight = "▓▓",
116 .mine_normal = "*",
117 .mine_death = SGR(RED,"*"),
118 .mine_wrongf = "/",
119 .mine_wrongq = "\",
120
121 .emoticons = {":)", ":(", ":D", ":o"},
122
123 .border_top_l = "╔═",
124 .border_top_m = "══",
125 .border_top_r = "═╗",
126
127 .border_status_l = "║ ",
128 .border_status_r = " ║",
129
130 .border_spacer_l = "╟─",
131 .border_spacer_m = "──",
132 .border_spacer_r = "─╢",
133
134 .border_field_l = "║ ",
135 .border_field_r = " ║",
136
137 .border_bottom_l = "╚═",
138 .border_bottom_m = "═",
139 .border_bottom_r = "═╝",
140
141 .cell_width = 2,
142 };
143
144 struct minescheme symbols_doublewidth = {
145 /* vt220 multilingual character set,
146 see http://vt100.net/docs/vt220-rm/table2-4.html */
147 .number = {" ",
148 SGR(BOLD,"1"),
149 SGR(BOLD,"2"),
150 SGR(BOLD,"3"),
151 SGR(BOLD,"4"),
152 SGR(BOLD,"5"),
153 SGR(BOLD,"6"),
154 SGR(BOLD,"7"),
155 SGR(BOLD,"8")},
156 .field_closed = "\x61",
157 .field_flagged = SGR(BOLD,"!"),
158 .field_question = SGR(BOLD,"?"),
159 .mouse_highlight = SGR(BLINK,"@"),
160 .mine_normal = SGR(BOLD,"*"),
161 .mine_death = SGR(BOLD,"#"),
162 .mine_wrongf = SGR(BOLD,"/"),
163 .mine_wrongq = SGR(BOLD,"\\"),
164
165 .emoticons = {":)", ":(", ":D", ":o"},
166
167 .border_top_l = "\033#6\x6c",
168 .border_top_m = "\x71",
169 .border_top_r = "\x6b",
170
171 .border_status_l = "\033#6\x78",
172 .border_status_r = "\x78",
173
174 .border_spacer_l = "\033#6\x74",
175 .border_spacer_m = "\x71",
176 .border_spacer_r = "\x75",
177
178 .border_field_l = "\033#6\x78",
179 .border_field_r = "\x78",
180
181 .border_bottom_l = "\033#6\x6d",
182 .border_bottom_m = "\x71",
183 .border_bottom_r = "\x6a",
184
185 .cell_width = 1,
186 .init_seq = "\033(0" /* enable DEC Special Graphics Character Set */
187 "\033[?3l", /* switch to 80 column mode */
188 .reset_seq = "\033(B" /* enable DEC Multinational Character Set (TODO: check) */
189 "\033[?3h", /* switch to 132 column mode */
190 };
191
192 #undef SGR
193 #undef BOLD
194 #undef BLINK
195 #undef RED
196 #undef GREEN
197 #undef YELLOW
198 #undef BLUE
199 #undef CYAN
200 #undef GREY
201 #undef BRED
202 #undef BBLUE
203 #undef WHITE
204 #endif
Imprint / Impressum