/*************************************************************************/ /* editor_data.h */ /*************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ /* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ /* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ /* */ /* 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 EDITOR_DATA_H #define EDITOR_DATA_H #include "editor/editor_plugin.h" #include "editor/plugins/script_editor_plugin.h" #include "list.h" #include "pair.h" #include "scene/resources/texture.h" #include "undo_redo.h" class EditorHistory { enum { HISTORY_MAX = 64 }; struct Obj { REF ref; ObjectID object; String property; }; struct History { Vector path; int level; }; friend class EditorData; Vector history; int current; //Vector editor_plugins; struct PropertyData { String name; Variant value; }; void _add_object(ObjectID p_object, const String &p_property, int p_level_change); public: void cleanup_history(); bool is_at_beginning() const; bool is_at_end() const; void add_object(ObjectID p_object); void add_object(ObjectID p_object, const String &p_subprop); void add_object(ObjectID p_object, int p_relevel); int get_history_len(); int get_history_pos(); ObjectID get_history_obj(int p_obj) const; bool next(); bool previous(); ObjectID get_current(); int get_path_size() const; ObjectID get_path_object(int p_index) const; String get_path_property(int p_index) const; void clear(); EditorHistory(); }; class EditorSelection; class EditorData { public: struct CustomType { String name; Ref