Commit Graph

77 Commits

Author SHA1 Message Date
536ea8561e Allow unicode class names 2024-09-18 13:24:56 -05:00
738859f49b removes warnings generated by GDCLASS usage
This change removes the warnings (unused parameters) coming from code injected by the GDCLASS macro.
Contrary to warnings coming from the normal source code which can be suppressed with most compiles by specifying the include directories of this library as external or system,
when the code is injected through a macro it is considered in the context of the user, which is the source code of user of the library.
That forces the users to modify their code to hide the warnings coming from the mandatory `GDCLASS` here.
That's why it's important to remove these warning from that specific macro and ideally any other macro that the user must use.
2024-08-08 02:46:28 +02:00
c77d44f3f6 Make sure _get and _set dispatch up the class hierarchy 2024-08-01 12:03:27 -04:00
5d8f80bc55 Merge pull request #1446 from Daylily-Zeleen/daylily-zeleen/set_instance_and_instance_biding_in_Wrapped_constructor
Set instance and instance binding in `Wrapped` constructor.
2024-06-14 09:39:46 -05:00
7f74fe7bb2 Fix undefined symbol error on Linux with virtual methods that take Node * arguments 2024-06-10 10:55:24 -05:00
76cbc66785 Set instance and instance binding in Wrapped constructor. 2024-05-28 22:59:37 +08:00
b697ba8896 Merge pull request #1447 from dsnopek/avoid-double-postinitialize
Fix NOTIFICATION_POSTINITIALIZE sent twice to native parent classes
2024-05-17 11:56:09 -05:00
e4a4d76cb3 Merge pull request #1463 from Daylily-Zeleen/daylily-zeleen/const_get_class_static
Mark return value of `get_class_static` and `get_parent_class_static` as const.
2024-05-17 11:55:45 -05:00
3db8549e19 mark return value of get_class_static and get_parent_class_static as const 2024-05-17 02:06:59 +08:00
e3f3cb58b7 Merge pull request #1450 from dsnopek/free-property-list-count
Update `free_property_list` callback to take count
2024-05-08 04:40:52 -05:00
8cc78cfea9 Update free_property_list callback to take count 2024-04-30 08:48:53 -05:00
ca46ef4d25 Give compile-time error if registering a class without its own _bind_methods() function 2024-04-24 14:49:26 -05:00
06373ce1cf Fix NOTIFICATION_POSTINITIALIZE sent twice to native parent class 2024-04-24 13:22:19 -05:00
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