/**************************************************************************/ /* object.h */ /**************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* https://godotengine.org */ /**************************************************************************/ /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ #ifndef OBJECT_H #define OBJECT_H #include "core/extension/gdextension_interface.h" #include "core/object/message_queue.h" #include "core/object/object_id.h" #include "core/os/rw_lock.h" #include "core/os/spin_lock.h" #include "core/templates/hash_map.h" #include "core/templates/hash_set.h" #include "core/templates/list.h" #include "core/templates/rb_map.h" #include "core/templates/safe_refcount.h" #include "core/variant/callable_bind.h" #include "core/variant/variant.h" template <typename T> class TypedArray; enum PropertyHint { … }; enum PropertyUsageFlags { … }; #define ADD_SIGNAL(m_signal) … #define ADD_PROPERTY(m_property, m_setter, m_getter) … #define ADD_PROPERTYI(m_property, m_setter, m_getter, m_index) … #define ADD_PROPERTY_DEFAULT(m_property, m_default) … #define ADD_GROUP(m_name, m_prefix) … #define ADD_GROUP_INDENT(m_name, m_prefix, m_depth) … #define ADD_SUBGROUP(m_name, m_prefix) … #define ADD_SUBGROUP_INDENT(m_name, m_prefix, m_depth) … #define ADD_LINKED_PROPERTY(m_property, m_linked_property) … #define ADD_ARRAY_COUNT(m_label, m_count_property, m_count_property_setter, m_count_property_getter, m_prefix) … #define ADD_ARRAY_COUNT_WITH_USAGE_FLAGS(m_label, m_count_property, m_count_property_setter, m_count_property_getter, m_prefix, m_property_usage_flags) … #define ADD_ARRAY(m_array_path, m_prefix) … // Helper macro to use with PROPERTY_HINT_ARRAY_TYPE for arrays of specific resources: // PropertyInfo(Variant::ARRAY, "fallbacks", PROPERTY_HINT_ARRAY_TYPE, MAKE_RESOURCE_TYPE_HINT("Font") #define MAKE_RESOURCE_TYPE_HINT(m_type) … struct PropertyInfo { … }; TypedArray<Dictionary> convert_property_list(const List<PropertyInfo> *p_list); enum MethodFlags { … }; struct MethodInfo { … }; // API used to extend in GDExtension and other C compatible compiled languages. class MethodBind; class GDExtension; struct ObjectGDExtension { … }; #define GDVIRTUAL_CALL(m_name, ...) … #define GDVIRTUAL_CALL_PTR(m_obj, m_name, ...) … #ifdef DEBUG_METHODS_ENABLED #define GDVIRTUAL_BIND(m_name, ...) … #else #define GDVIRTUAL_BIND … #endif #define GDVIRTUAL_IS_OVERRIDDEN(m_name) … #define GDVIRTUAL_IS_OVERRIDDEN_PTR(m_obj, m_name) … /* * The following is an incomprehensible blob of hacks and workarounds to * compensate for many of the fallacies in C++. As a plus, this macro pretty * much alone defines the object model. */ #define GDCLASS(m_class, m_inherits) … #define OBJ_SAVE_TYPE(m_class) … class ScriptInstance; class Object { … }; bool predelete_handler(Object *p_object); void postinitialize_handler(Object *p_object); class ObjectDB { … }; #endif // OBJECT_H