aboutsummaryrefslogtreecommitdiff
path: root/harness/include/plugin.h
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2024-02-16 15:41:49 -0700
committerJosh Rahm <rahm@google.com>2024-02-21 12:18:46 -0700
commit22571fc455f50d1774e7abb9a77db3a51182a420 (patch)
treefbd99182c7ac48ff5dc91e9c29fae5c3da0d1dc3 /harness/include/plugin.h
parent860a75bd4dee36880c9372d1f78ced18d1246988 (diff)
downloadwetterhorn-22571fc455f50d1774e7abb9a77db3a51182a420.tar.gz
wetterhorn-22571fc455f50d1774e7abb9a77db3a51182a420.tar.bz2
wetterhorn-22571fc455f50d1774e7abb9a77db3a51182a420.zip
Do most of keyboard handling in the plugin now.
Diffstat (limited to 'harness/include/plugin.h')
-rw-r--r--harness/include/plugin.h18
1 files changed, 11 insertions, 7 deletions
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 <pthread.h>
#include <stdint.h>
#include <stdlib.h>
+#include <wlr/types/wlr_keyboard.h>
#include <foreign_intf.h>
@@ -18,6 +19,7 @@
#define EXPORT_INCLUDE(a)
EXPORT_INCLUDE(<foreign_intf.h>)
+EXPORT_INCLUDE(<wlr / types / wlr_keyboard.h>)
#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,