]> git.gir.st - minesVIiper.git/blob - schemes.h
implement 'z' key, improved scheme (is new version)
[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 int flag_offset;
59 char* init_seq;
60 char* reset_seq;
61 };
62
63 struct minescheme symbols_mono = {
64 .number = {" ", "1", "2", "3", "4", "5", "6", "7", "8"},
65 .field_closed = "░░",
66 .field_flagged = SGR(REV,"!"),
67 .field_question = SGR(REV,"?"),
68 .mouse_highlight = "▓▓",
69 .mine_normal = "*",
70 .mine_death = "#",
71 .mine_wrongf = "/",
72 .mine_wrongq = "\",
73
74 .emoticons = {":)", ":(", ":D", ":o"},
75
76 .border = {{"╔═","══","═╗"},
77 {"║ "," "," ║"},
78 {"╟─","──","─╢"},
79 {"║ "," "," ║"},
80 {"╚═","══","═╝"}},
81
82 .cell_width = 2,
83 .flag_offset = 4, /* length of the escape sequece infront of .field_flagged and .field_question for cursor highlighting */
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 /* vt220 multilingual character set,
118 see http://vt100.net/docs/vt220-rm/table2-4.html */
119 .number = {" ",
120 SGR(BOLD,"1"),
121 SGR(BOLD,"2"),
122 SGR(BOLD,"3"),
123 SGR(BOLD,"4"),
124 SGR(BOLD,"5"),
125 SGR(BOLD,"6"),
126 SGR(BOLD,"7"),
127 SGR(BOLD,"8")},
128 .field_closed = "\x61",
129 .field_flagged = SGR(REV,SGR(BOLD,"!")),
130 .field_question = SGR(BOLD,"?"),
131 .mouse_highlight = SGR(BLINK,"@"),
132 .mine_normal = SGR(BOLD,"*"),
133 .mine_death = SGR(BOLD,"#"),
134 .mine_wrongf = SGR(BOLD,"/"),
135 .mine_wrongq = SGR(BOLD,"\\"),
136
137 .emoticons = {":)", ":(", ":D", "\033(B:o\033(0"},
138
139 .border = {{"\033#6\x6c","\x71","\x6b"},
140 {"\033#6\x78"," ","\x78"},
141 {"\033#6\x74","\x71","\x75"},
142 {"\033#6\x78"," ","\x78"},
143 {"\033#6\x6d","\x71","\x6a"}},
144
145 .cell_width = 1,
146 .flag_offset = 4,
147 .init_seq = "\033(0" /* enable DEC Special Graphics Character Set */
148 "\033[?3l", /* switch to 80 column mode */
149 .reset_seq = "\033(B" /* reset to DEC Multinational Character Set */
150 "\033[?3h", /* switch back to 132 column mode (TODO: shouldn't be hardcoded) */
151 };
152
153 #undef SGR
154 #undef BOLD
155 #undef BLINK
156 #undef RED
157 #undef GREEN
158 #undef YELLOW
159 #undef BLUE
160 #undef CYAN
161 #undef GREY
162 #undef BRED
163 #undef BBLUE
164 #undef WHITE
165 #endif
Imprint / Impressum