From 22571fc455f50d1774e7abb9a77db3a51182a420 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Fri, 16 Feb 2024 15:41:49 -0700 Subject: Do most of keyboard handling in the plugin now. --- harness/include/plugin.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'harness/include/plugin.h') diff --git a/harness/include/plugin.h b/harness/include/plugin.h index bde8990..37e36ba 100644 --- a/harness/include/plugin.h +++ b/harness/include/plugin.h @@ -6,6 +6,7 @@ #include #include #include +#include #include @@ -18,6 +19,7 @@ #define EXPORT_INCLUDE(a) EXPORT_INCLUDE() +EXPORT_INCLUDE() #define MAX_QUEUED_ACTIONS 8 @@ -31,12 +33,12 @@ struct PLUGIN; /* This structure represents an action requested by the plugin for the harness. */ typedef struct { - int (*action)(struct PLUGIN *requester, void* arg); - void (*arg_dtor)(void* arg); + int (*action)(struct PLUGIN *requester, void *arg); + void (*arg_dtor)(void *arg); union { - void* ptr_arg; + void *ptr_arg; int int_arg; - char* str_arg; + char *str_arg; }; } requested_action_t; @@ -96,7 +98,7 @@ typedef struct PLUGIN { /** Intializes the plugin with the given argc/argv. This is the first thing * called on the plugin and is called immediately after the library is loaded. */ - EXPORT(void (*plugin_load)(int argc, char** argv, foreign_interface_t *intf)); + EXPORT(void (*plugin_load)(int argc, char **argv, foreign_interface_t *intf)); /* Start the plugin with the marshalled state from the previous plugin. * @@ -132,7 +134,9 @@ typedef struct PLUGIN { /* * Handles a keybinding. */ - EXPORT(opqst_t (*plugin_handle_keybinding)(uint32_t keysym, opqst_t state)); + EXPORT(opqst_t (*plugin_handle_keybinding)( + struct wlr_event_keyboard_key *event, uint32_t modifiers, uint32_t keysym, + int *out_handled, opqst_t state)); /* * Handles a surface being mapped, unmapped or destroyed. @@ -166,7 +170,7 @@ int plugin_hot_reload(int argc, char **argv, const char *filepath, int plugin_hot_reload_same_state(plugin_t *plugin); /* Starts a plugin in a cold state. Called after load_plugin_from_file. */ -void plugin_cold_start(plugin_t* plugin); +void plugin_cold_start(plugin_t *plugin); /* Reads a plugin from a filename. */ int load_plugin_from_file(int argc, char **argv, const char *filename, -- cgit