-
Notifications
You must be signed in to change notification settings - Fork 0
/
lua_plugin.h
57 lines (38 loc) · 1.03 KB
/
lua_plugin.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
// Created by simon on 11/9/20.
//
#ifndef LUATEST_LUA_PLUGIN_H
#define LUATEST_LUA_PLUGIN_H
extern "C" {
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
}
#include <cstring>
namespace lua_plugin {
typedef void (*print_function)(const char *);
typedef void (*draw_function)(int x, int y, int r, int g, int b, int alpha, int size);
namespace MouseEvent {
enum Type {
Press,
Release,
Move
};
}
namespace KeyboardEvent {
enum Type {
Press,
Release
};
}
void plugin_init();
void plugin_exit();
int exec_script(const char *lua_script);
const char *get_last_error();
lua_State *get_state();
void register_print_function(print_function print_function_replacement);
void register_draw_function(draw_function draw_function_replacement);
void mouse_event(int x, int y, MouseEvent::Type type);
void keyboard_event(char key, KeyboardEvent::Type type);
}
#endif //LUATEST_LUA_PLUGIN_H