]> git.gir.st - VIper.git/blob - schemes.h
BONUS item: snip (Proof of Concept stage)
[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.sch->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* food[NUM_FOODS];
21 char* boni[NUM_BONI];
22
23 /* for en-/disabling e.g. DEC charset: */
24 char* init_seq;
25 char* reset_seq;
26
27 int cell_width; /* number of characters per cell */
28 int display_width; /* how wide a cell appears to be */
29 };
30
31 struct scheme unic0de = {
32 .border = {
33 {"╔", "══", "╗"},
34 {"║", " ", "║"},
35 {"╚", "══", "╝"},
36 { "╡","","╞" },
37 },
38
39 .snake = { /* sorted like in the enum directions */
40 {/* NONE -> */
41 /*NONE */ "",
42 /*NORTH*/ "⢿⡿",
43 /*EAST */ "⢾⣿",
44 /*SOUTH*/ "⣾⣷",
45 /*WEST */ "⣿⡷",
46 },{/* NORTH -> */
47 /*NONE */ "⢇⡸",
48 /*NORTH*/ "",
49 /*EAST */ "⢇⣈",
50 /*SOUTH*/ "⡇⢸",
51 /*WEST */ "⣁⡸",
52 },{/* EAST -> */
53 /*NONE */ "⢎⣉",
54 /*NORTH*/ "⢇⣈",
55 /*EAST */ "",
56 /*SOUTH*/ "⡎⢉",
57 /*WEST */ "⣉⣉",
58 },{/* SOUTH -> */
59 /*NONE */ "⡎⢱",
60 /*NORTH*/ "⡇⢸",
61 /*EAST */ "⡎⢉",
62 /*SOUTH*/ "",
63 /*WEST */ "⡉⢱",
64 },{/* WEST -> */
65 /*NONE */ "⣉⡱",
66 /*NORTH*/ "⣁⡸",
67 /*EAST */ "⣉⣉",
68 /*SOUTH*/ "⡉⢱",
69 /*WEST */ "",
70 },
71 },
72 .color = {"32", "92", "92;1"},
73
74 .food = {
75 [FOOD_5] = "🍐",
76 [FOOD_10] = "🍎",
77 [FOOD_20] = "🥑",
78 },
79 .boni = {
80 [BONUS_SNIP] = "✂️ ",
81 },
82
83 .cell_width = 2,
84 .display_width = 2,
85 };
86
87 struct scheme vt220_charset = {
88 .border = {
89 {"\033#6\x6c","\x71","\x6b"},
90 {"\033#6\x78"," ","\x78"},
91 {"\033#6\x6d","\x71","\x6a"},
92 { "=","","=" },
93 },
94
95 .snake = {
96 {"@","A",">","V","<"}, //head
97 {"#","#","#","#","#"},
98 {"#","#","#","#","#"},
99 {"#","#","#","#","#"},
100 {"#","#","#","#","#"},
101 },
102 .color = {"0", "0", "1"},
103
104 .food = { "$", "%", "&" },
105 .boni = { "x" },
106
107 .init_seq = "\033(0\033*B\x0f" /* G0=Graphics, G2=ASCII, invoke G0 */
108 "\033[?3l", /* disable 132 column mode (DECCOLM) */
109 .reset_seq = "\033(B" /* reset to DEC Multinational Character Set */
110 "\033[?3h", /* reenable DECCOLM (WARN: unconditionally!)*/
111
112 .cell_width = 1,
113 .display_width = 2,
114 };
115
116 #endif
Imprint / Impressum