glue_header.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*************************************************************************/
  2. /* glue_header.h */
  3. /*************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /*************************************************************************/
  8. /* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
  9. /* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /*************************************************************************/
  30. #ifdef MONO_GLUE_ENABLED
  31. #include "../mono_gd/gd_mono_marshal.h"
  32. void godot_register_collections_icalls();
  33. void godot_register_gd_icalls();
  34. void godot_register_string_name_icalls();
  35. void godot_register_nodepath_icalls();
  36. void godot_register_object_icalls();
  37. void godot_register_rid_icalls();
  38. void godot_register_string_icalls();
  39. void godot_register_scene_tree_icalls();
  40. /**
  41. * Registers internal calls that were not generated. This function is called
  42. * from the generated GodotSharpBindings::register_generated_icalls() function.
  43. */
  44. void godot_register_glue_header_icalls() {
  45. godot_register_collections_icalls();
  46. godot_register_gd_icalls();
  47. godot_register_string_name_icalls();
  48. godot_register_nodepath_icalls();
  49. godot_register_object_icalls();
  50. godot_register_rid_icalls();
  51. godot_register_string_icalls();
  52. godot_register_scene_tree_icalls();
  53. }
  54. // Used by the generated glue
  55. #include "core/config/engine.h"
  56. #include "core/object/class_db.h"
  57. #include "core/object/method_bind.h"
  58. #include "core/object/reference.h"
  59. #include "core/string/node_path.h"
  60. #include "core/string/ustring.h"
  61. #include "core/typedefs.h"
  62. #include "core/variant/array.h"
  63. #include "core/variant/dictionary.h"
  64. #include "../mono_gd/gd_mono_class.h"
  65. #include "../mono_gd/gd_mono_internals.h"
  66. #include "../mono_gd/gd_mono_utils.h"
  67. #define GODOTSHARP_INSTANCE_OBJECT(m_instance, m_type) \
  68. static ClassDB::ClassInfo *ci = nullptr; \
  69. if (!ci) { \
  70. ci = ClassDB::classes.getptr(m_type); \
  71. } \
  72. Object *m_instance = ci->creation_func();
  73. #include "arguments_vector.h"
  74. #endif // MONO_GLUE_ENABLED