2019-08-30 12:33:40 +00:00
|
|
|
#ifndef ESPANSO_BRIDGE_H
|
|
|
|
#define ESPANSO_BRIDGE_H
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2019-08-30 16:32:10 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Called when a new keypress is made, the first argument is an int array,
|
|
|
|
* while the second is the size of the array.
|
|
|
|
*/
|
2019-08-30 17:45:27 +00:00
|
|
|
typedef void (*keypress_callback)(void * self, int32_t *buffer, int32_t len);
|
2019-08-30 16:32:10 +00:00
|
|
|
|
|
|
|
extern keypress_callback keypressCallback;
|
2019-08-30 17:45:27 +00:00
|
|
|
extern void * backend_instance;
|
2019-08-30 16:32:10 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Register the callback that will be called when a keypress was made
|
|
|
|
*/
|
2019-08-30 17:45:27 +00:00
|
|
|
extern "C" void register_keypress_callback(void *self, keypress_callback callback);
|
2019-08-30 12:33:40 +00:00
|
|
|
|
2019-08-30 15:58:18 +00:00
|
|
|
/*
|
|
|
|
* Initialize the Windows worker's parameters
|
2019-08-30 16:32:10 +00:00
|
|
|
* return: 1 if OK, -1 otherwise.
|
2019-08-30 15:58:18 +00:00
|
|
|
*/
|
2019-08-30 17:45:27 +00:00
|
|
|
extern "C" int32_t initialize_window();
|
2019-08-30 15:58:18 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Start the event loop indefinitely. Blocking call.
|
|
|
|
*/
|
|
|
|
extern "C" void eventloop();
|
2019-08-30 12:33:40 +00:00
|
|
|
|
|
|
|
#endif //ESPANSO_BRIDGE_H
|