Path: blob/master/editor/debugger/editor_debugger_inspector.h
9896 views
/**************************************************************************/1/* editor_debugger_inspector.h */2/**************************************************************************/3/* This file is part of: */4/* GODOT ENGINE */5/* https://godotengine.org */6/**************************************************************************/7/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */8/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */9/* */10/* Permission is hereby granted, free of charge, to any person obtaining */11/* a copy of this software and associated documentation files (the */12/* "Software"), to deal in the Software without restriction, including */13/* without limitation the rights to use, copy, modify, merge, publish, */14/* distribute, sublicense, and/or sell copies of the Software, and to */15/* permit persons to whom the Software is furnished to do so, subject to */16/* the following conditions: */17/* */18/* The above copyright notice and this permission notice shall be */19/* included in all copies or substantial portions of the Software. */20/* */21/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */22/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */23/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */24/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */25/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */26/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */27/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */28/**************************************************************************/2930#pragma once3132#include "core/variant/typed_dictionary.h"33#include "editor/inspector/editor_inspector.h"3435class SceneDebuggerObject;3637class EditorDebuggerRemoteObjects : public Object {38GDCLASS(EditorDebuggerRemoteObjects, Object);3940private:41bool _set_impl(const StringName &p_name, const Variant &p_value, const String &p_field);4243protected:44bool _set(const StringName &p_name, const Variant &p_value);45bool _get(const StringName &p_name, Variant &r_ret) const;46void _get_property_list(List<PropertyInfo> *p_list) const;47static void _bind_methods();4849public:50TypedArray<uint64_t> remote_object_ids;51String type_name;52List<PropertyInfo> prop_list;53HashMap<StringName, TypedDictionary<uint64_t, Variant>> prop_values;5455bool _hide_script_from_inspector() { return true; }56bool _hide_metadata_from_inspector() { return true; }5758void set_property_field(const StringName &p_property, const Variant &p_value, const String &p_field);59String get_title();60Variant get_variant(const StringName &p_name);6162void clear() {63prop_list.clear();64prop_values.clear();65}6667void update() { notify_property_list_changed(); }68};6970class EditorDebuggerInspector : public EditorInspector {71GDCLASS(EditorDebuggerInspector, EditorInspector);7273private:74LocalVector<EditorDebuggerRemoteObjects *> remote_objects_list;75HashSet<Ref<Resource>> remote_dependencies;76EditorDebuggerRemoteObjects *variables = nullptr;7778void _object_selected(ObjectID p_object);79void _objects_edited(const String &p_prop, const TypedDictionary<uint64_t, Variant> &p_values, const String &p_field);8081protected:82void _notification(int p_what);83static void _bind_methods();8485public:86EditorDebuggerInspector();87~EditorDebuggerInspector();8889// Remote Object cache90EditorDebuggerRemoteObjects *set_objects(const Array &p_array);91void clear_remote_inspector();92void clear_cache();93void invalidate_selection_from_cache(const TypedArray<uint64_t> &p_ids);9495// Stack Dump variables96String get_stack_variable(const String &p_var);97void add_stack_variable(const Array &p_arr, int p_offset = -1);98void clear_stack_variables();99};100101102