mirror of
https://github.com/jjsullivan5196/wvkbd.git
synced 2025-07-13 06:24:29 +02:00
ran make format
This commit is contained in:
committed by
John Sullivan
parent
878b16b997
commit
07f153fe32
48
main.c
48
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;
|
||||
|
Reference in New Issue
Block a user