]> git.gir.st - VIper.git/blob - schemes.h
minor in-code cleanup, documentation
[VIper.git] / schemes.h
1 #ifndef __SCHEMES_H__
2 #define __SCHEMES_H__
3
4 #include "viiper.h" /* for enum items */
5
6 #define BORDER_T 0
7 #define BORDER_C 1
8 #define BORDER_B 2
9 #define BORDER_S 3
10 #define BORDER_L 0
11 #define BORDER_R 2
12 #define BORDER(v,h) op.scheme->border[BORDER_ ## v][BORDER_ ## h]
13
14 struct scheme {
15 char* border[4][3];
16
17 char* snake[5][5]; /* [predecessor][successor] */
18 char* color[3]; /* 0=even, 1=odd, 2=head */
19
20 char* item[NUM_FOODS];
21
22 /* for en-/disabling e.g. DEC charset: */
23 char* init_seq;
24 char* reset_seq;
25
26 int cell_width;
27 };
28
29 struct scheme unic0de = {
30 .border = {
31 {"╔═", "══", "═╗"},
32 {"║ ", " ", " ║"},
33 {"╚═", "══", "═╝"},
34 { "╡","","╞" },
35 },
36
37 .snake = { /* sorted like in the enum directions */
38 {/* NONE -> */
39 /*NONE */ "",
40 /*NORTH*/ "⢿⡿",
41 /*EAST */ "⢾⣿",
42 /*SOUTH*/ "⣾⣷",
43 /*WEST */ "⣿⡷",
44 },{/* NORTH -> */
45 /*NONE */ "⢇⡸",
46 /*NORTH*/ "",
47 /*EAST */ "⢇⣈",
48 /*SOUTH*/ "⡇⢸",
49 /*WEST */ "⣁⡸",
50 },{/* EAST -> */
51 /*NONE */ "⢎⣉",
52 /*NORTH*/ "⢇⣈",
53 /*EAST */ "",
54 /*SOUTH*/ "⡎⢉",
55 /*WEST */ "⣉⣉",
56 },{/* SOUTH -> */
57 /*NONE */ "⡎⢱",
58 /*NORTH*/ "⡇⢸",
59 /*EAST */ "⡎⢉",
60 /*SOUTH*/ "",
61 /*WEST */ "⡉⢱",
62 },{/* WEST -> */
63 /*NONE */ "⣉⡱",
64 /*NORTH*/ "⣁⡸",
65 /*EAST */ "⣉⣉",
66 /*SOUTH*/ "⡉⢱",
67 /*WEST */ "",
68 },
69 },
70 .color = {"32", "92", "92;1"},
71
72 .item = {
73 [FOOD_5] = "🍐",
74 [FOOD_10] = "🍎",
75 [FOOD_20] = "🥑",
76 },
77
78 .cell_width = 2,
79 };
80
81 struct scheme vt220_charset = {
82 .border = {
83 {"\033#6\x6c","\x71","\x6b"},
84 {"\033#6\x78"," ","\x78"},
85 {"\033#6\x6d","\x71","\x6a"},
86 { "=","","=" },
87 },
88
89 .snake = {
90 {"@","A",">","V","<"}, //head
91 {"#","#","#","#","#"},
92 {"#","#","#","#","#"},
93 {"#","#","#","#","#"},
94 {"#","#","#","#","#"},
95 },
96 .color = {"0", "0", "1"},
97
98 .item = { "$", "%", "&"},
99
100 .init_seq = "\033(0\033*B\x0f" /* G0=Graphics, G2=ASCII, invoke G0 */
101 "\033[?3l", /* disable 132 column mode (DECCOLM) */
102 .reset_seq = "\033(B" /* reset to DEC Multinational Character Set */
103 "\033[?3h", /* reenable DECCOLM (WARN: unconditionally!)*/
104
105 .cell_width = 1,
106 };
107
108 #endif
Imprint / Impressum