commit 7edb969

seiko  ·  2026-05-29 19:38:20 +0000 UTC
parent b8fbbb1
add config.h
1 files changed,  +64, -0
+64, -0
 1@@ -0,0 +1,64 @@
 2+#ifndef CONFIG_H
 3+#define CONFIG_H
 4+
 5+#include <stdbool.h>
 6+#include <stdint.h>
 7+#include <stdlib.h>
 8+
 9+static const char* font_path = "./Xanh.bdf";
10+static const float font_size = 24.0f;/* BDF fonts ignore font_size */
11+static const int   antialias = true; /* BDF fonts are not affected */
12+
13+static const int   win_width = 800;
14+static const int   win_height = 600;
15+static const char* win_title = "cterm";
16+
17+static const int   pad_x = 8;
18+static const int   pad_y = 8;
19+
20+static const char* shell = NULL; /* NULL uses $SHELL */
21+static const char* term_name = "vt100";
22+
23+/* Colors Format: 0xAARRGGBB */
24+static const uint32_t default_fg = 0xffdcdccc;
25+static const uint32_t default_bg = 0xff111111;
26+static const uint32_t cursor_fg  = 0xff111111;
27+static const uint32_t cursor_bg  = 0xffdcdccc;
28+
29+static const uint32_t color_table[16] = {
30+	0xff000000, /* black */
31+	0xffcc0000, /* red */
32+	0xff4e9a06, /* green */
33+	0xffc4a000, /* yellow */
34+	0xff3465a4, /* blue */
35+	0xff75507b, /* magenta */
36+	0xff06989a, /* cyan */
37+	0xffd3d7cf, /* white */
38+
39+	0xff555753, /* bright black */
40+	0xffef2929, /* bright red */
41+	0xff8ae234, /* bright green */
42+	0xfffce94f, /* bright yellow */
43+	0xff729fcf, /* bright blue */
44+	0xffad7fa8, /* bright magenta */
45+	0xff34e2e2, /* bright cyan */
46+	0xffffffff, /* bright white */
47+};
48+
49+/* Key sequences
50+   These are for physical/special keys only.
51+   Text input should come from translated character events.
52+ */
53+static const char *key_up        = "\x1b[A";
54+static const char *key_down      = "\x1b[B";
55+static const char *key_right     = "\x1b[C";
56+static const char *key_left      = "\x1b[D";
57+static const char *key_home      = "\x1b[H";
58+static const char *key_end       = "\x1b[F";
59+static const char *key_insert    = "\x1b[2~";
60+static const char *key_delete    = "\x1b[3~";
61+static const char *key_page_up   = "\x1b[5~";
62+static const char *key_page_down = "\x1b[6~";
63+
64+#endif /* CONFIG_H */
65+