Commit Graph

52 Commits

Author SHA1 Message Date
Adam
dfd3fcada6 library: api_close 2024-10-04 14:30:38 +01:00
Adam
ec0c6159d4 library: change window-closing API
This commit adds api_window_close and api_browser_close, removes the
__gc entry entirely for those types, and adds the CLOSEBROWSER_OSR ipc
message. Allowing EmbeddedWindows to be closed without the whole plugin
was a significant rework, so there may still be some edge-cases.
2024-09-14 19:49:21 +01:00
Adam
3d515829ba library: redo ipc to use header structs
A much cleaner way of sending host-to-client messages compared to that
byte hackery I was doing before. Also probably runs faster because of
larger reads/writes instead of smaller individual ones for each param.
2024-09-14 02:24:56 +01:00
Adam
0cf1d4a034 library: browser sendmessage and onmessage 2024-09-12 03:23:48 +01:00
Adam
09e04eb9b9 library: compile error 2024-09-10 04:29:21 +01:00
Adam
9cdeee6ca6 library: safety check for osr ack 2024-09-10 04:29:10 +01:00
Adam
b04f6d7ba3 library: send plugin id in osr messages 2024-09-10 01:34:47 +01:00
Adam
7ed64ef3b2 library: implementations in plugin_win32.c 2024-09-07 02:59:35 +01:00
Adam
1055cad7c1 library: partial EVMOUSELEAVE support
Plugin API is finished and working, Windows backend not yet implemented
2024-09-02 21:19:12 +01:00
Adam
0ece655032 client, library: always sync active plugins
Every edge-case should now be accounted for: closing an embedded
browser, closing a game client, closing a plugin from the host, closing
a plugin from the client.
2024-08-30 16:32:55 +01:00
Adam
93380f455a client,library: use plugin activation IDs
Plugin library no longer receives plugin ID at all, only an ID specific
to this activation of the plugin. This solves race conditions where a
plugin is restarted while an IPC message relating to it is mid-flight.
2024-08-30 14:49:34 +01:00
Adam
525f6379c9 osr: IPC_MSG_OSRUPDATE byte alignment 2024-08-30 12:33:26 +01:00
Adam
0f6984c53a library: render3d_vertexanimatedxyz 2024-08-26 19:10:28 +01:00
Adam
2d8dcb087a library: animation and bone APIs 2024-08-26 04:45:18 +01:00
Adam
adf99163a4 library: send mouse events for browsers 2024-08-24 19:32:47 +01:00
Adam
d8f1103900 library: handle damage rects for browsers 2024-08-24 16:46:18 +01:00
Adam
9833f6d48a library: api subimage functions 2024-08-24 15:03:46 +01:00
Adam
2d33a15bf7 library: add very basic browser API 2024-08-24 13:45:10 +01:00
Adam
ea9aab0a2c library: "setcallback.." -> "on.." 2024-08-17 16:29:43 +01:00
Adam
f4831a1380 library: replace some lua integers with booleans
To correct the MouseEvent functions which were documented as returning
booleans but were actually returning integers
2024-08-17 15:10:19 +01:00
Adam
8fbe9cbcad library: add mouse-button-release events 2024-08-17 01:52:15 +01:00
Adam
79a1f61876 library: api_mouseevent_mousebuttons 2024-08-16 22:45:00 +01:00
Adam
9cf6992f21 library: fix copy-paste error 2024-08-16 20:34:48 +01:00
Adam
0348864cc3 library: finally enable mouse events
Can't really remember why I hadn't already done this
2024-08-16 20:34:48 +01:00
Adam
c233ba4049 *: use posix ipc even on windows
So it turns out Windows supports AF_UNIX sockets via the afunix.h
header, as a somewhat drop-in solution for IPC. Some messing around was
required to get it to compile against winsock functions and Ws2_32.lib,
and it still doesn't actually do anything, but the IPC portion seems to
be working perfectly.
2024-08-05 16:59:46 +01:00
Adam
28fdd97965 library: implement api_time for windows 2024-06-24 21:33:56 +01:00
Adam
d4093ec1d5 library: use correct event details for scroll-down 2024-06-22 18:02:52 +01:00
Adam
6e125124b3 library: remove unused windowlightmeta 2024-06-22 17:54:44 +01:00
Adam
157b089fa8 library: use full userdata instead of light
Due to a Lua ""feature"", light userdatas all share the same metatable,
so setting individual ones for each event wasn't working very well. The
solution instead is to replace the light userdata pointer with a full
userdata with the event struct copied into it. This also means we can't
have window objects being presented in callbacks, but that's okay, I
think plugins should be using upvalues for that anyway.
2024-06-22 17:43:07 +01:00
Adam
0f331d241b library: better and fuller mouse event system 2024-06-22 17:16:22 +01:00
Adam
e1bb14f7e7 library: correct type of scroll direction 2024-06-22 00:23:56 +01:00
Adam
a6839aa126 library: generalise plugin_process_windows 2024-06-21 22:54:43 +01:00
Adam
7a60c61170 library: mouse motion and button events
also started adding window's metatable to it in the event callbacks
2024-06-21 20:37:43 +01:00
Adam
b953c29568 library: rough window-event system 2024-06-16 18:44:16 +01:00
Adam
26d7bfe402 library: basic concept for embedded windows
No focusing system (do we actually need one?), no event system at all,
and no support for inputs via wayland
2024-06-01 15:53:25 +01:00
Adam
463c2817b8 library: fix game crash on plugin crash 2024-05-26 17:10:25 +01:00
Adam
a23324e462 library: fix copy-paste error 2024-05-19 19:53:56 +01:00
Adam
86ed7ea1aa library: new time API functions
Added the following functions:
- datetime
- weekday
2024-05-11 01:40:43 +01:00
Adam
527ae38c2e library: use static as appropriate 2024-05-11 00:56:53 +01:00
Adam
fb1b464027 library: complete surfaces API
Added the following functions:
- createsurfacefromrgba
- createsurfacefrompng
- surface_drawtosurface
2024-05-11 00:44:01 +01:00
Adam
e039174e04 library: allow require() for secondary files 2024-05-04 00:30:04 +01:00
Adam
599ff83b51 library: funny hack to avoid using strlen
Calculating strlen of a hard-coded stringat runtime, by iterating
through it until finding a 0 byte, is nothing but a waste of CPU cycles.
We already know the length, so let's just use it directly.
2024-05-03 22:37:20 +01:00
Adam
62908af138 library: one lua stack per plugin
It's more resource-intensive, but all the plugins sharing one stack was
causing so many problems that I'm not sure it was even possible to do
correctly; Lua stacks are aggressively global, and all the plugins
sharing one set of global state was causing so many bugs, not to mention
safety issues of plugins potentially having access to each other, that
it's simply not worth the trouble.
2024-05-03 20:52:45 +01:00
Adam
5e1468883c library: define & handle IPC_MSG_STARTPLUGINS 2024-04-29 05:22:08 +01:00
Adam
8e85b160a6 repo: BoltIPCMessage->BoltIPCMessageToHost 2024-04-28 16:29:18 +01:00
Adam
eb48600cef library: remove unused IPC_MSG_NEWPLUGINS 2024-04-23 15:51:26 +01:00
Adam
74c0911928 library: add identify msg 2024-04-23 01:36:55 +01:00
Adam
68ec2eb6bb client,library: IPC format for plugin metadata 2024-04-01 23:28:09 +01:00
Adam
d7a0295b2d library: generalise send and receive functions 2024-03-24 12:53:54 +00:00
Adam
347625ced7 plugin: use IPC API with message types 2024-03-24 11:29:49 +00:00