summaryrefslogtreecommitdiffstats
path: root/modules/mono/editor/bindings_generator.h
Commit message (Collapse)AuthorAgeFilesLines
* Add C# support for bitfield enums (flags)Raul Santos2022-07-061-0/+1
|
* Make enum/constant binds 64-bit.bruvzg2022-06-171-2/+2
|
* Generate typed array parameters in C# bindingsRaul Santos2022-06-031-0/+6
| | | | | | Adds support for generating C# bindings that use the generic `Array<T>` type instead of the non-generic `Array` type when the registered ClassDB method specifies the array element type.
* Replace most uses of Map by HashMapreduz2022-05-161-5/+5
| | | | | | | | | | | | * Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated!
* Add a new HashMap implementationreduz2022-05-121-1/+1
| | | | | | | | | | | | | | | | | Adds a new, cleaned up, HashMap implementation. * Uses Robin Hood Hashing (https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing). * Keeps elements in a double linked list for simpler, ordered, iteration. * Allows keeping iterators for later use in removal (Unlike Map<>, it does not do much for performance vs keeping the key, but helps replace old code). * Uses a more modern C++ iterator API, deprecates the old one. * Supports custom allocator (in case there is a wish to use a paged one). This class aims to unify all the associative template usage and replace it by this one: * Map<> (whereas key order does not matter, which is 99% of cases) * HashMap<> * OrderedHashMap<> * OAHashMap<>
* Support static methods in C# bindings generatorRaul Santos2022-03-221-0/+5
|
* Refactor `bbcode_to_xml` into multiple specific methodsRaul Santos2022-03-031-0/+8
| | | | | | The specific `_append_xml_*` methods implement the logic that generates the proper XML documentation for the given BBCode tag and target and appends it to the output.
* Support signals in C# documentationRaul Santos2022-02-101-2/+22
|
* Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | Happy new year to the wonderful Godot community!
* Don't return reference on copy assignment operatorsRémi Verschelde2021-11-301-1/+1
| | | | | | | | | | | | | We prefer to prevent using chained assignment (`T a = b = c = T();`) as this can lead to confusing code and subtle bugs. According to https://en.wikipedia.org/wiki/Assignment_operator_(C%2B%2B), C++ allows any arbitrary return type, so this is standard compliant. This could be re-assessed if/when we have an actual need for a behavior more akin to that of the C++ STL, for now this PR simply changes a handful of cases which were inconsistent with the rest of the codebase (`void` return type was already the most common case prior to this commit).
* Fix PackedInt64Array typo in bindings_generator.hRaul Santos2021-09-031-1/+1
|
* C#: Fix bindings generator for Callable argument default valueIgnacio Roldán Etcheverry2021-08-201-0/+2
| | | | | Previously there weren't any Callable arguments with a default value, but d4dd859991205e6cecfa9a0553b89db47c983d0b introduced one.
* Use C++ iterators for Lists in many situationsAaron Franke2021-07-231-15/+15
|
* Rename Reference to RefCountedPedro J. Estébanez2021-06-111-5/+5
|
* Add C# array features from core PackedArraysAaron Franke2021-02-161-0/+1
|
* Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* Initialize class/struct variables with default values in platform/ and editor/Rafał Mikrut2020-12-021-3/+3
|
* Refactor DocData into core and editor (DocTools) partsThakee Nathees2020-12-021-1/+2
|
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-3/+3
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* Added tests for ClassDBIgnacio Etcheverry2020-05-161-59/+81
|
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-1/+0
| | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* Port member initialization from constructor to declaration (C++11)Rémi Verschelde2020-05-141-64/+29
| | | | | | | | | | Using `clang-tidy`'s `modernize-use-default-member-init` check and manual review of the changes, and some extra manual changes that `clang-tidy` failed to do. Also went manually through all of `core` to find occurrences that `clang-tidy` couldn't handle, especially all initializations done in a constructor without using initializer lists.
* Style: clang-format: Disable AllowShortIfStatementsOnASingleLineRémi Verschelde2020-05-101-1/+2
| | | | | | | Part of #33027, also discussed in #29848. Enforcing the use of brackets even on single line statements would be preferred, but `clang-format` doesn't have this functionality yet.
* Replace NULL with nullptrlupoDharkael2020-04-021-9/+9
|
* Move DocData and Collada out of their subfoldersRémi Verschelde2020-03-241-1/+1
| | | | | | | | Now that the unused DocDump was removed, the `editor/doc` subfolder is redundant. Similarly, there's no reason for Collada to have a subfolder for itself when glTF or OBJ don't.
* Fix C# bindings after recent breaking changesIgnacio Etcheverry2020-03-171-1/+48
| | | | | | | | | | | | | Implementation for new Variant types Callable, Signal, StringName. Added support for PackedInt64Array and PackedFloat64Array. Add generation of signal members as events, as well as support for user created signals as events. NOTE: As of now, raising such events will not emit the signal. As such, one must use `EmitSignal` instead of raising the event directly. Removed old ThreadLocal fallback class. It's safe to use thread_local now since it's supported on all minimum versions of compilers we support.
* Style: Set clang-format Standard to Cpp11Rémi Verschelde2020-03-171-1/+1
| | | | | | | | | | For us, it practically only changes the fact that `A<A<int>>` is now used instead of the C++03 compatible `A<A<int> >`. Note: clang-format 10+ changed the `Standard` arguments to fully specified `c++11`, `c++14`, etc. versions, but we can't use `c++17` now if we want to preserve compatibility with clang-format 8 and 9. `Cpp11` is still supported as deprecated alias for `Latest`.
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* Mono/C#: Re-structure API solution and GodotTools post-build targetIgnacio Etcheverry2019-12-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | Previously we had a placeholder solution called 'Managed' to benefit from tooling while editing the a part of the C# API. Later the bindings generator would create the final 'GodotSharp' solution including these C# files as well as the auto-generated C# API. Now we replaced the 'Managed' solution with the final 'GodotSharp' solution which is no longer auto-generated, and the bindings generator only takes care of the auto-generated C# API. This has the following benefits: - It's less confusing as there will no longer be two versions of the same file (the original and a generated copy of it). Now there's only one. - We no longer need placeholder for auto-generated API classes, like Node or Resource. We used them for benefiting from tooling. Now we can just use the auto-generated API itself. - Simplifies the build system and bindings generator. Removed lot of code that is not needed anymore. Also added a post-build target to the GodotTools project to copy the output to the data dir. This makes it easy to iterate when doing changes to GodotTools, as SCons doesn't have to be executed anymore just to copy these new files.
* Make C# internal calls return structs as ref parametersIgnacio Etcheverry2019-11-151-4/+23
| | | | | | The Mono IL interpreter's WebAssembly to native trampolines don't support passing structs by value, so we need to do it this way. Also now we pass and return long, ulong, float and double as ref parameters as well. This is due to missing trampolines for float and long types. This is likely a temporary workaround that will be reverted in the future. The correct solution would be to patch 'mono/mini/m2n-gen.cs' when building the Mono runtime for WASM in order to generate the trampolines we need.
* Mono: Don't compare API hashes on release buildsIgnacio Etcheverry2019-09-281-1/+1
| | | | API hashes cannot be calculated on release builds, as bindings information is lacking. Therefore, we should not be comparing it with the generated glue hash as they will never match.
* Improve C# bindings generator errors for default param valuesIgnacio Etcheverry2019-09-241-3/+9
|
* Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in 'modules/mono'Ignacio Etcheverry2019-08-091-1/+1
| | | | | | And 'CRASH_*_MSG' as well. Also make error messages puntuation and quotation more consistent.
* Re-write mono module editor code in C#Ignacio Etcheverry2019-07-051-4/+4
| | | | | | | | Make the build system automatically build the C# Api assemblies to be shipped with the editor. Make the editor, editor player and debug export templates use Api assemblies built with debug symbols. Always run MSBuild to build the editor tools and Api assemblies when building Godot. Several bugs fixed related to assembly hot reloading and restoring state. Fix StringExtensions internal calls not being registered correctly, resulting in MissingMethodException.
* C#: Implement ScriptInstance::to_stringIgnacio Etcheverry2019-05-241-0/+4
| | | | Create a blacklist of methods that must not be generated. Includes: "to_string", "_to_string" and "_init".
* C#: Generate the correct integer and floating point typesIgnacio Etcheverry2019-04-271-4/+27
|
* C#: Mark generated property accessor methods as ObsoleteIgnacio Etcheverry2019-04-251-0/+4
| | | | - Methods that act as accessors for properties in the same class (like `GetPosition` and `SetPosition` are for `Position`) are now marked as obsolete. They will be made private in the future.
* C# bindings generator cleanupIgnacio Etcheverry2019-04-251-20/+13
| | | | | | - Normal log messages are no longer warnings. - BindingsGenerator is no longer a singleton. - Added a log function.
* Use StringBuilder in C# bindings generatorIgnacio Etcheverry2019-04-191-5/+6
| | | | - Also fixed generation of empty summary comments when no comment should have been generated.
* EditorHelp, makerst: Improve enum ref resolving and constant ref supportIgnacio Etcheverry2019-03-291-0/+11
| | | | | Enum reference resolving will now search in the @GlobalScope if no class is specified and the enum cannot be resolved in the current class. Added support for constant references in EditorHelp, e.g.: [constant KEY_ENTER] or [constant Control.FOCUS_CLICK]. It supports enum constants (the enum name must not be included).
* C#: Bindings generator now translates BBCode docs to XML commentsIgnacio Etcheverry2019-03-231-2/+20
|
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Improve the C# API projects generationIgnacio Etcheverry2018-11-081-2/+4
| | | | | | - Now there is only one solution that contains both GodotSharp and GodotSharpEditor project. Previously we had one solution for each project - GodotSharpEditor reference GodotShatp with a 'ProjectReference'. Previously it was a 'Reference' to the assembly - This also simplifies the command line option to generate this solution: 'godot --generate-cs-api <OutputDir>'
* Fix prefix erasing for the generated C# enum constantsIgnacio Etcheverry2018-10-181-3/+5
|
* C#: Optimize struct marshallingIgnacio Etcheverry2018-10-171-7/+14
| | | | | - We no longer box struct to return them from internal calls. - Use reinterpret_cast if the managed struct layout is the same as the native struct.
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-2/+2
| | | | | | This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
* C#: Fix cs_files glue mismatch bugIgnacio Etcheverry2018-09-121-1/+0
|
* Cleanup of c# api files and bindings generatorIgnacio Etcheverry2018-09-121-5/+0
| | | | | | | | | | | | - We no longer generate RID and NodePath C# classes. Both will be maintained manually. - We no longer generate C# declarations and runtime registration of internal calls for the following classes: RID, NodePath, String, GD, SignalAwaiter and Godot.Object (partial base). - We no longer auto-generate the base members of Godot.Object. They will be maintained manually as a partial class. This makes it easier to maintain these C# classes and their internal calls, as well as the bindings generator which no longer generates C# classes that don't derive from Godot Object, and it no longer generates the Godot.Object base members (which where unreadable in the bindings generator code). - Added missing 'RID(Object from)' constructor to the RID C# class. - Replaced MONO_GLUE_DISABLED constant macro with MONO_GLUE_ENABLED. - Add sources in module/mono/glue even if glue is disabled, but surround glue files with ifdef MONO_GLUE_ENABLED.
* C# generated classes ignore warning CS1591 and cleanupIgnacio Etcheverry2018-08-271-9/+2
|
* Mono: BindingsGenerator enum fixesIgnacio Etcheverry2018-04-281-8/+35
| | | | | - Make enums have an unique signature name of int. This means that when generating internal methods, there is no difference between different enums types nor between enums and int. This way enums can re-use internal methods. - Make type resolver fallback to int if a type is not found and it's an enum.