Commit graph

28 commits

Author SHA1 Message Date
King_DuckZ
c2089568f3 Bugfixes and improvements, simplify examples 2022-04-29 18:35:46 +02:00
King_DuckZ
fa0183a3bf Implement CallbackManager
With it users don't have to provide a foreign_method_fn()
function anymore, it's become optional.
2022-04-29 18:16:57 +02:00
King_DuckZ
7fcb89e459 Move more stuff to wren_types.hpp 2022-04-29 18:15:02 +02:00
King_DuckZ
edd5f27ab2 Build fix 2022-04-29 12:43:06 +02:00
King_DuckZ
5d6575f328 Add make_foreign_object() overload
It's only available when users define WRENPP_WITH_NAME_GUESSING
and it automatically retrieves the class name of T using
new code in guess_class_name.hpp. Only tested on gcc so far.
Microsoft compiler doesn't seem to understand consteval keyword.
2022-04-29 12:34:01 +02:00
King_DuckZ
a63a8c33d8 Add make_foreign_object() function.
It creates an instance of the given foreign class and
returns a pointer to it. The wren object is stored in
slot 0.
2022-04-29 12:34:01 +02:00
King_DuckZ
31ba3af348 Update copyright year 2022-04-28 22:56:11 +02:00
King_DuckZ
6f4b0ce094 Pass string_view instead of const char* to callback functions 2022-04-28 22:55:22 +02:00
King_DuckZ
e157607df6 Update copyright year on recently modified files 2022-04-24 03:43:19 +02:00
King_DuckZ
f749b7fb18 call() will fail earlier when object for call doesn't exist 2022-04-22 22:04:09 +02:00
King_DuckZ
0255edb8be Update wren to latest and fix build 2022-04-22 22:02:59 +02:00
King_DuckZ
b4383e9449 Set slot in case caller didn't, or else why we get the object parameter? 2022-04-22 10:36:41 +02:00
King_DuckZ
cfc8bb89f8 Add convenience variable_ensure_slot 2021-02-12 14:43:25 +01:00
King_DuckZ
dc10c38a3f Add reset() method 2021-02-12 14:43:25 +01:00
King_DuckZ
3c318d6771 Add a very simple test program
Not quite a unit test, it looks more like an example
but still something.
2021-02-02 14:04:27 +01:00
King_DuckZ
6a30725a62 Add arbitrary method to foreign_method_t conversion helper
It might not work in every case, you still are restricted
to types that set() and get() understand.
2020-05-03 12:23:06 +02:00
King_DuckZ
34d2317f11 Add support for foreign types to get()
wren::get() can now be used to get foreign types by pointer.
Invoking get<A>() will return an A*. With this change it's
now possible to use variables() to get mixed foreign
and core types.
2020-05-03 11:32:43 +02:00
King_DuckZ
90d93d2583 Add calendar example and supporting functions 2020-05-03 01:54:07 +02:00
King_DuckZ
cad9f96739 Add a reallocate_fn() to DefConfiguration implemented around new/delete 2020-05-02 23:28:48 +02:00
King_DuckZ
51c69e6343 __func__ is just the function name, ie "type_id", I need the whole signature to capture U as well 2020-05-01 18:34:36 +02:00
King_DuckZ
f5fcbd193a Fix uninitialised pointers. Whoopsies! 2020-05-01 18:21:33 +02:00
King_DuckZ
f33900b351 Allow users to store a custom pointer into the VM object. 2020-05-01 17:44:09 +02:00
King_DuckZ
279a34237b I don't see any reason to get a pointer, I want a ref instead 2020-05-01 01:53:53 +02:00
King_DuckZ
274a2fea11 Update sample code in main(), fix the rest as required 2020-05-01 01:39:11 +02:00
King_DuckZ
a3dcb583d7 Attach licence 2020-04-30 23:33:54 +02:00
King_DuckZ
4843ddd95e Add overload for Handle 2020-04-30 23:18:41 +02:00
King_DuckZ
97514085cb Add operator== 2020-04-30 23:05:35 +02:00
King_DuckZ
0f0d149ad2 Move public headers to a separate directory, make a library 2020-04-30 22:50:46 +02:00