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