summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--config.def.h26
-rw-r--r--keyboard.c5
-rw-r--r--main.c10
4 files changed, 41 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 1348b31..c9c17cb 100644
--- a/Makefile
+++ b/Makefile
@@ -9,7 +9,7 @@ PKGS = wayland-client xkbcommon pangocairo
 WVKBD_SOURCES += $(wildcard $(SRC)/*.c)
 WVKBD_HEADERS += $(wildcard $(SRC)/*.h)
 
-CFLAGS += -std=gnu99 -Wall -g -DWITH_WAYLAND_SHM -DLAYOUT=\"layout.${LAYOUT}.h\"
+CFLAGS += -std=gnu99 -Wall -g -DWITH_WAYLAND_SHM -DLAYOUT=\"layout.${LAYOUT}.h\" -DKEYMAP=\"keymap.${LAYOUT}.h\"
 CFLAGS += $(shell pkg-config --cflags $(PKGS))
 LDFLAGS =$(shell pkg-config --libs $(PKGS)) -lm -lutil -lrt
 
diff --git a/config.def.h b/config.def.h
index 266ba81..a6227a6 100644
--- a/config.def.h
+++ b/config.def.h
@@ -3,5 +3,31 @@
 
 static const char *default_font = "Monospace 15";
 
+struct clr_scheme scheme = {
+	/* colors */
+	.bg = {.bgra = {15, 15, 15, 225}},
+	.fg = {.bgra = {45, 45, 45, 225}},
+	.high = {.bgra = {100, 100, 100, 225}},
+	.text = {.color = UINT32_MAX},
+};
+struct clr_scheme scheme1 = {
+	/* colors */
+	.bg = {.bgra = {15, 15, 15, 225}},
+	.fg = {.bgra = {32, 32, 32, 225}},
+	.high = {.bgra = {100, 100, 100, 225}},
+	.text = {.color = UINT32_MAX},
+};
+
+/* layers is an ordered list of layouts, used to cycle through */
+static enum layout_id layers[] = {
+	Full, //First layout is the default layout on startup
+	Special,
+	Emoji,
+	Simple,
+	Cyrillic,
+	Arabic,
+	NumLayouts //signals the last item, may not be omitted
+};
+
 #endif // config_def_h_INCLUDED
 
diff --git a/keyboard.c b/keyboard.c
index 0d6b43b..879704c 100644
--- a/keyboard.c
+++ b/keyboard.c
@@ -13,6 +13,11 @@
 	fprintf(stderr, __VA_ARGS__);                                                \
 	exit(1)
 
+#ifndef KEYMAP
+#error "make sure to define KEYMAP"
+#endif
+#include KEYMAP
+
 void
 kbd_switch_layout(struct kbd *kb, struct layout *l) {
 	kb->prevlayout = kb->layout;
diff --git a/main.c b/main.c
index ee2712e..0cdf6e2 100644
--- a/main.c
+++ b/main.c
@@ -8,7 +8,6 @@
 #include <wayland-client.h>
 #include <wchar.h>
 
-#include "drw.h"
 #include "keyboard.h"
 #include "config.h"
 
@@ -42,6 +41,7 @@ static uint32_t anchor = ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM |
 /* application state */
 static bool run_display = true;
 static int cur_x = -1, cur_y = -1;
+static struct kbd keyboard;
 
 /* event handler prototypes */
 static void wl_pointer_enter(void *data, struct wl_pointer *wl_pointer,
@@ -333,6 +333,14 @@ main(int argc, char **argv) {
 	if ((tmp = getenv("WVKBD_HEIGHT")))
 		height = atoi(tmp);
 
+	/* keyboard settings */
+	keyboard.layers = (enum layout_id *) &layers;
+	keyboard.scheme = scheme;
+	keyboard.layer_index = 0;
+	keyboard.scheme1 = scheme1;
+	keyboard.scheme1 = scheme1;
+
+
 	int i;
 	for (i = 1; argv[i]; i++) {
 		if ((!strcmp(argv[i], "-v")) || (!strcmp(argv[i], "--version"))) {