summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--Makefile14
-rw-r--r--config.h3
-rw-r--r--config.mk1
-rw-r--r--keyboard.c10
-rw-r--r--keyboard.h4
-rw-r--r--main.c8
7 files changed, 17 insertions, 25 deletions
diff --git a/.gitignore b/.gitignore
index 345df9c..f2595a2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,4 +4,4 @@
 *-client-protocol.h
 .gdb_history
 *.log
-wvkbd
+suggpicker
diff --git a/Makefile b/Makefile
index be21e10..85e8cf3 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 include config.mk
 
-NAME=wvkbd
-BIN=${NAME}-${LAYOUT}
+NAME=suggpicker
+BIN=${NAME}
 SRC=.
 
 PKGS = wayland-client xkbcommon pangocairo
@@ -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
 CFLAGS += $(shell pkg-config --cflags $(PKGS))
 LDFLAGS =$(shell pkg-config --libs $(PKGS)) -lm -lutil -lrt
 
@@ -31,8 +31,8 @@ proto/%-client-protocol.h: proto/%.xml
 
 $(OBJECTS): $(HDRS) $(WVKBD_HEADERS)
 
-wvkbd-${LAYOUT}: config.h $(OBJECTS) layout.${LAYOUT}.h
-	$(CC) -o wvkbd-${LAYOUT} $(OBJECTS) $(LDFLAGS)
+${BIN}: config.h $(OBJECTS)
+	$(CC) -o ${BIN} $(OBJECTS) $(LDFLAGS)
 
 clean:
 	rm -f $(OBJECTS) $(HDRS) $(WAYLAND_SRC) ${BIN}
@@ -42,5 +42,5 @@ format:
 
 install: all
 	mkdir -p ${DESTDIR}${PREFIX}/bin
-	cp -f ${NAME}-${LAYOUT} ${DESTDIR}${PREFIX}/bin
-	chmod 755 ${DESTDIR}${PREFIX}/bin/${NAME}-${LAYOUT}
+	cp -f ${BIN} ${DESTDIR}${PREFIX}/bin
+	chmod 755 ${DESTDIR}${PREFIX}/bin/${BIN}
diff --git a/config.h b/config.h
index bdb8dc7..192c37e 100644
--- a/config.h
+++ b/config.h
@@ -1,6 +1,9 @@
 #ifndef config_def_h_INCLUDED
 #define config_def_h_INCLUDED
 
+#define KBD_PIXEL_HEIGHT 40
+#define KBD_PIXEL_LANDSCAPE_HEIGHT 40
+
 static const char *default_font = "Monospace 14";
 
 struct clr_scheme scheme = {
diff --git a/config.mk b/config.mk
index 4b2bad0..d52491b 100644
--- a/config.mk
+++ b/config.mk
@@ -1,3 +1,2 @@
 VERSION = 0.2
 CFLAGS = -DVERSION=\"$(VERSION)\" -D_XOPEN_SOURCE=700
-LAYOUT = mobintl
diff --git a/keyboard.c b/keyboard.c
index 540f6c9..bfebdbe 100644
--- a/keyboard.c
+++ b/keyboard.c
@@ -4,7 +4,7 @@
 #include "drw.h"
 #include "os-compatibility.h"
 
-#define MAX_LAYERS 25
+#define KBD_KEY_BORDER 1
 
 /* lazy die macro */
 #define die(...)                                                               \
@@ -147,12 +147,12 @@ kbd_resize(struct kbd *kb) {
 void
 draw_inset(struct drwsurf *ds, uint32_t x, uint32_t y, uint32_t width,
            uint32_t height, uint32_t border, Color color) {
-	drw_fill_rectangle(ds, color, x + border, y + border, width - border,
-	                   height - border);
+	drw_fill_rectangle(ds, color, x + border, y + border, width - (border*2),
+	                   height - (border*2));
 }
 void
 draw_over_inset(struct drwsurf *ds, uint32_t x, uint32_t y, uint32_t width,
                 uint32_t height, uint32_t border, Color color) {
-	drw_over_rectangle(ds, color, x + border, y + border, width - border,
-	                   height - border);
+	drw_over_rectangle(ds, color, x + border, y + border, width - (border*2),
+	                   height - (border*2));
 }
diff --git a/keyboard.h b/keyboard.h
index f09003d..2827b6a 100644
--- a/keyboard.h
+++ b/keyboard.h
@@ -63,8 +63,4 @@ void kbd_draw_layout(struct kbd *kb);
 void kbd_resize(struct kbd *kb);
 double kbd_get_row_length(struct key *k);
 
-#ifndef LAYOUT
-#error "make sure to define LAYOUT"
-#endif
-#include LAYOUT
 #endif
diff --git a/main.c b/main.c
index ca922ff..a8f63da 100644
--- a/main.c
+++ b/main.c
@@ -310,7 +310,7 @@ handle_global_remove(void *data, struct wl_registry *registry, uint32_t name) {}
 void
 layer_surface_configure(void *data, struct zwlr_layer_surface_v1 *surface,
                         uint32_t serial, uint32_t w, uint32_t h) {
-	keyboard.w = w + KBD_PIXEL_OVERSCAN_WIDTH;
+	keyboard.w = w;
 	keyboard.h = h;
 	kbd_resize(&keyboard);
 
@@ -399,12 +399,6 @@ main(int argc, char **argv) {
 	height = normal_height = KBD_PIXEL_HEIGHT;
 	landscape_height = KBD_PIXEL_LANDSCAPE_HEIGHT;
 
-	char *tmp;
-	if ((tmp = getenv("WVKBD_HEIGHT")))
-		normal_height = atoi(tmp);
-	if ((tmp = getenv("WVKBD_LANDSCAPE_HEIGHT")))
-		landscape_height = atoi(tmp);
-
 	/* keyboard settings */
 	keyboard.scheme = scheme;