summary refs log tree commit diff
path: root/main.c
diff options
context:
space:
mode:
authorMaarten van Gompel <proycon@anaproy.nl>2021-08-24 09:53:34 +0200
committerJohn Sullivan <jsullivan@csumb.edu>2021-10-19 23:12:01 -0700
commit6742ff488f5b3981234498fc15f84ddbf4aff915 (patch)
tree8ee598e83c22a542d6d636e5df9c1cedf1a08abc /main.c
parent2ca38be37bc2ccf5b66bdd27e38a4c6062f537e9 (diff)
downloadsuggpicker-6742ff488f5b3981234498fc15f84ddbf4aff915.tar.gz
ran make format
Diffstat (limited to 'main.c')
-rw-r--r--main.c48
1 files changed, 25 insertions, 23 deletions
diff --git a/main.c b/main.c
index 72c250d..b754e90 100644
--- a/main.c
+++ b/main.c
@@ -6,9 +6,9 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <wchar.h>
 #include <sys/mman.h>
 #include <wayland-client.h>
+#include <wchar.h>
 
 #include "drw.h"
 #include "keymap.h"
@@ -94,39 +94,40 @@ static void layer_surface_configure(void *data,
                                     uint32_t serial, uint32_t w, uint32_t h);
 static void layer_surface_closed(void *data,
                                  struct zwlr_layer_surface_v1 *surface);
-static void create_and_upload_keymap(const char * name, uint32_t comp_unichr, uint32_t comp_shift_unichr);
+static void create_and_upload_keymap(const char *name, uint32_t comp_unichr,
+                                     uint32_t comp_shift_unichr);
 
 /* event handlers */
 static const struct wl_pointer_listener pointer_listener = {
-	.enter = wl_pointer_enter,
-	.leave = wl_pointer_leave,
-	.motion = wl_pointer_motion,
-	.button = wl_pointer_button,
+  .enter = wl_pointer_enter,
+  .leave = wl_pointer_leave,
+  .motion = wl_pointer_motion,
+  .button = wl_pointer_button,
 };
 
 static const struct wl_touch_listener touch_listener = {
-	.down = wl_touch_down,
-	.up = wl_touch_up,
-	.motion = wl_touch_motion,
-	.frame = wl_touch_frame,
-	.cancel = wl_touch_cancel,
-	.shape = wl_touch_shape,
-	.orientation = wl_touch_orientation,
+  .down = wl_touch_down,
+  .up = wl_touch_up,
+  .motion = wl_touch_motion,
+  .frame = wl_touch_frame,
+  .cancel = wl_touch_cancel,
+  .shape = wl_touch_shape,
+  .orientation = wl_touch_orientation,
 };
 
 static const struct wl_seat_listener seat_listener = {
-	.capabilities = seat_handle_capabilities,
-	.name = seat_handle_name,
+  .capabilities = seat_handle_capabilities,
+  .name = seat_handle_name,
 };
 
 static const struct wl_registry_listener registry_listener = {
-	.global = handle_global,
-	.global_remove = handle_global_remove,
+  .global = handle_global,
+  .global_remove = handle_global_remove,
 };
 
 static const struct zwlr_layer_surface_v1_listener layer_surface_listener = {
-	.configure = layer_surface_configure,
-	.closed = layer_surface_closed,
+  .configure = layer_surface_configure,
+  .closed = layer_surface_closed,
 };
 
 /* configuration, allows nested code to access above variables */
@@ -277,8 +278,9 @@ layer_surface_closed(void *data, struct zwlr_layer_surface_v1 *surface) {
 }
 
 void
-create_and_upload_keymap(const char * name, uint32_t comp_unichr, uint32_t comp_shift_unichr) {
-	const char * keymap_str = get_keymap(name, comp_unichr, comp_shift_unichr);
+create_and_upload_keymap(const char *name, uint32_t comp_unichr,
+                         uint32_t comp_shift_unichr) {
+	const char *keymap_str = get_keymap(name, comp_unichr, comp_shift_unichr);
 	size_t keymap_size = strlen(keymap_str) + 1;
 	int keymap_fd = os_create_anonymous_file(keymap_size);
 	if (keymap_fd < 0) {
@@ -292,7 +294,7 @@ create_and_upload_keymap(const char * name, uint32_t comp_unichr, uint32_t comp_
 	strcpy(ptr, keymap_str);
 	zwp_virtual_keyboard_v1_keymap(
 	  keyboard.vkbd, WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1, keymap_fd, keymap_size);
-	free((void*) keymap_str);
+	free((void *)keymap_str);
 }
 
 int
@@ -326,7 +328,7 @@ main(int argc, char **argv) {
 	  zwp_virtual_keyboard_manager_v1_create_virtual_keyboard(vkbd_mgr, seat);
 
 	/* upload keymap */
-    create_and_upload_keymap(layouts[DefaultLayout].keymap_name, 0,0);
+	create_and_upload_keymap(layouts[DefaultLayout].keymap_name, 0, 0);
 
 	/* assign kbd state */
 	keyboard.surf = &draw_surf;