summary refs log tree commit diff
path: root/keyboard.h
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@librem.one>2022-01-21 17:22:25 -0500
committerZach DeCook <zachdecook@librem.one>2022-01-21 17:22:25 -0500
commit6e16e55851b472513b3869e8af757c7e4fbc131f (patch)
tree237a404fbddb9a3fe6539a336b9c563f254466e7 /keyboard.h
parent707cf18d0ce882504c19a534e236c050f745ca81 (diff)
downloadsuggpicker-6e16e55851b472513b3869e8af757c7e4fbc131f.tar.gz
layout: Rename to suggs
Diffstat (limited to 'keyboard.h')
-rw-r--r--keyboard.h22
1 files changed, 4 insertions, 18 deletions
diff --git a/keyboard.h b/keyboard.h
index 876172d..f09003d 100644
--- a/keyboard.h
+++ b/keyboard.h
@@ -7,7 +7,6 @@
 
 struct clr_scheme;
 struct key;
-struct layout;
 struct kbd;
 
 enum key_draw_type {
@@ -26,24 +25,14 @@ struct clr_scheme {
 
 struct key {
 	const char *label;       // primary label
-
-	struct layout *layout;   // pointer back to the parent layout that holds this
-	                         // key
-
 	// actual coordinates on the surface (pixels), will be computed automatically
 	// for all keys
 	uint32_t x, y, w, h;
 };
 
-struct layout {
-	struct key *keys;
-	uint32_t keyheight; // absolute height (pixels)
-};
-
 struct kbd {
 	bool debug;
 
-	struct layout *layout;
 	struct clr_scheme scheme;
 
 	uint32_t w, h, s;
@@ -51,10 +40,8 @@ struct kbd {
 	uint8_t mods;
 	uint8_t compose;
 	struct key *last_press;
-	size_t layer_index;
 
-	struct layout *layouts;
-	enum layout_id *layers;
+	struct key suggs[64];
 
 	struct drwsurf *surf;
 };
@@ -64,17 +51,16 @@ void draw_inset(struct drwsurf *ds, uint32_t x, uint32_t y, uint32_t width,
 void draw_over_inset(struct drwsurf *ds, uint32_t x, uint32_t y, uint32_t width,
                      uint32_t height, uint32_t border, Color color);
 
-void kbd_init(struct kbd *kb, struct layout *layouts);
-void kbd_init_layout(struct layout *l, uint32_t width, uint32_t height);
+void kbd_init(struct kbd *kb);
+void kbd_init_suggs(struct key *suggs, uint32_t width, uint32_t height);
 struct key *kbd_get_key(struct kbd *kb, uint32_t x, uint32_t y);
 void kbd_unpress_key(struct kbd *kb, uint32_t time);
 void kbd_release_key(struct kbd *kb, uint32_t time);
 void kbd_motion_key(struct kbd *kb, uint32_t time, uint32_t x, uint32_t y);
 void kbd_press_key(struct kbd *kb, struct key *k, uint32_t time);
-void kbd_print_key_stdout(struct kbd *kb, struct key *k);
 void kbd_draw_key(struct kbd *kb, struct key *k, enum key_draw_type);
 void kbd_draw_layout(struct kbd *kb);
-void kbd_resize(struct kbd *kb, struct layout *layouts);
+void kbd_resize(struct kbd *kb);
 double kbd_get_row_length(struct key *k);
 
 #ifndef LAYOUT