Commit Graph

64 Commits

Author SHA1 Message Date
87f5fb0691 Enforce template syntax typename over class 2024-03-10 16:02:43 -05:00
23c010900c Fix _notification with parent and child classes 2024-02-22 14:39:50 -06:00
8fbb7cf795 Allow GDExtensions to register virtual methods and call them on scripts 2024-02-12 13:30:07 -06:00
5f350e2572 Rework GDCLASS macro to allow pure virtual functions 2024-01-18 20:14:13 -05:00
29b34d92bb [iOS] Fix building as static library or xcframework, add iOS config and xcframework build script to the test project. 2023-11-09 20:01:59 +02:00
6eb5d450bd GDCLASS synced by ending with "private:"
• Matches implementation used by modules and godot itself
• Apply same to GDEXTENSION_CLASS, setup with same diff-friendly spacers as GDCLASS
2023-11-01 12:44:14 -05:00
a61cdc8860 Add protections against registering classes that didn't use GDCLASS() 2023-10-22 08:44:09 -05:00
b507b3e591 Automatically register only engine classes whose header has been included 2023-10-16 10:19:11 -05:00
df849651d9 Changes necessary for hot reload to work 2023-09-25 22:13:33 -05:00
b1fd1b65fd Merge pull request #1242 from AThousandShips/null_check
Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable
2023-09-20 07:32:14 -05:00
0d6de7a80e Merge pull request #1164 from dsnopek/classdb-singleton-alternate
Add static methods to `ClassDB` for the methods bound to the `ClassDB` singleton
2023-09-19 10:33:15 -05:00
1e5767693e Replace ERR_FAIL_COND with ERR_FAIL_NULL where applicable 2023-09-13 14:34:04 +02:00
aa6867e6c9 Support _validate_property() 2023-09-12 13:21:16 -05:00
f651df5e7a Ensure const correctness for wrappers 2023-09-06 19:33:03 +02:00
54092861f1 GDExtension: fix bool unknown in C 2023-09-02 13:19:14 +02:00
c2d99fd519 Fix Object::notification order
For the notification-order to work correctly, it is necessary to
allow the `p_reversed` argument to be used within cpp.
This PR changes the necessary bindings.
2023-08-30 00:07:28 +02:00
6f913563d8 Add static methods to ClassDB for the methods bound to the ClassDB singleton 2023-07-31 16:04:27 -05:00
baf0b9e0f7 Don't call parent _get_property_list when a class doesn't define it.
Godot is already supposed to call _get_property_list of parent classes,
so this binding function must really only return procedural properties of
the class it belongs to, and not parent or child classes.
2023-07-26 20:12:25 +01:00
db2394dbe7 Identifiers containing double underscore are reserved according to the C++ standard
Rename __* to _gde_*

https://timsong-cpp.github.io/cppwp/n3337/global.names

https://en.cppreference.com/w/cpp/language/identifiers

Identifiers appearing as a token or preprocessing token (i.e., not in user-defined-string-literal like operator ""id) (since C++11) of one of the following forms are reserved:
 - identifiers with a double underscore anywhere;
 - identifiers that begin with an underscore followed by an uppercase letter;
 - in the global namespace, identifiers that begin with an underscore.
2023-06-15 20:45:01 -04:00
ad726015e7 Revert the changes from PR #1044 and #1045 and standardize on Object ** encoding in ptrcall 2023-06-07 08:30:33 -05:00
0d0d5a670b Merge pull request #1116 from saki7/Ref-allow-non-const-access
Change Ref<T> to allow non const access to ptr
2023-05-24 21:17:25 -05:00
48635729b9 Change Ref<T> to allow non const access to ptr 2023-05-17 19:24:09 +09:00
431e30bc32 Ensure GDExtension class is the correct type for the Godot engine class 2023-05-16 15:18:48 -05:00
a5c6ca5920 Update to load function pointers for GDExtension interface 2023-05-09 21:45:48 -05:00
517db6686a Fix PtrToArg<Ref<T>> crash 2023-02-15 22:36:29 -08:00
04731d2b78 Merge pull request #965 from WildRackoon/fix-GDCLASS-fwddeclaration
Fix GDCLASS needs explicit ClassDB fwd declaration
2023-01-19 13:55:14 +01:00
5dd2928790 "Wrapped" has virtual functions so it should have a virtual destructor.
Deleting an object through a pointer to a base class is undefined behaviour unless the destructor in the base class is virtual.
2023-01-19 05:57:17 -05:00
0c6e26dabe Added property info for ptr and ref + ported the implementation of the check method 2023-01-13 15:56:51 +03:00
931f1a3f34 Sync license copyright with upstream GH-70885 2023-01-10 16:15:31 +01:00
72d537fd95 Fix GDCLASS needs explicit ClassDB fwd declaration 2022-12-16 13:49:10 +01:00
992d85e6f8 Fix virtual GDExtension method Ref<T> conversion 2022-12-13 10:41:55 +11:00
c02e644679 Rename GDNative to GDExtension
Non-exhaustive list of case-sensitive renames:

GDExtension -> GDNative
GDNATIVE -> GDEXTENSION
gdextension -> gdnative
ExtensionExtension -> Extension (for where there was GDNativeExtension)
EXTENSION_EXTENSION -> EXTENSION (for where there was GDNATIVE_EXTENSION)
gdnlib -> gdextension
gdn_interface -> gde_interface
gdni -> gde_interface
2022-12-12 11:06:38 +01:00
fe86a94dcf Fix const qualifier for parameters in GDExtension api functions 2022-12-03 00:27:07 +01:00
fa405a8337 Fix lifetime of StringName objects returned by Wrapped::_get_property_list 2022-11-29 18:23:56 +01:00
c7e34c2f9d Basic static analysis fixes
- remove extraneous semicolons
- use "nullptr" instead of "0"
- remove "break" after "return"
- use <cstdio> instead of <stdio.h>
2022-11-18 17:46:13 -05:00
2745d341aa Fix broken namespace isolation in GDCLASS macro 2022-11-11 16:45:42 +01:00
b6ba0dca13 StringName is working fine with demo \o/ 2022-11-08 21:44:33 +01:00
3b82d5937b Correct GDNativeExtensionScriptInstanceToString 2022-11-08 21:44:32 +01:00
a706a9ceb9 Remove now useless _alloc_and_copy_cstr 2022-11-08 21:44:31 +01:00
e24b6b0e51 Use StringName in the whole GDExtension API instead of const char * 2022-11-08 21:44:31 +01:00
0e81f89dd3 Uses StringName in GDExtension perf critical instance creation & method/properties setter/getter 2022-11-08 21:44:30 +01:00
b21931c4a3 Type GDNativePropertyInfo.type field as GDNativeVariantType 2022-10-13 14:04:54 +02:00
592bd15c7a Run scripts to format and make headers consistent 2022-10-09 01:47:07 -05:00
5de2c059d1 Fix deriving a custom class with virtual methods 2022-09-21 19:31:30 +01:00
3276688c82 Merge pull request #844 from Zylann/fix_get_const
Fix issues with `_get` and `_get_property_list`
2022-09-16 08:48:00 +02:00
6f3bdab090 Fix issues with _get and _get_property_list
`_get` was using `_set` internally, and should be `const`.
`_get_property_list` should be `const`.
2022-09-15 23:46:50 +01:00
36273baa7e Change PropertyInfo members to String. 2022-09-14 08:41:09 +03:00
bcf27d8af4 Ensure GDCLASS can be used outside the godot namespace.
The `GDCLASS` macro should not assume to be called inside the `godot`
namespace and should thus prefix function calls for that namespace with
`::godot::` to ensure proper namespace referencing.
2022-09-01 04:11:23 +02:00
270ad28931 Add support for _notification, _set, _get, _get_property_list, _property_can_revert, _property_get_revert, and _to_string methods. 2022-08-22 12:59:38 +03:00
fd8173f109 Allow GDCLASS in own namespaces
The unqualified ClassDB friending was causing (at least for me on
VS2022) an implicit forward declaration of ClassDB in the namespace
of my class, instead of using the godot namespaced one. By qualifying
the namespace, this compiles for me.

Test-Information:
My project builds now.
2022-07-31 11:54:40 +01:00