From 2c88c46101e80af00b7e1fd5870d677ccb088b2f Mon Sep 17 00:00:00 2001 From: Relintai Date: Thu, 17 Mar 2022 11:28:57 +0100 Subject: [PATCH] Moved more includes to cpp files. --- editor/editor_network_profiler.cpp | 1 + editor/editor_sectioned_inspector.cpp | 1 + editor/quick_open.cpp | 1 + editor/run_settings_dialog.cpp | 2 ++ main/tests/test_gui.cpp | 1 + main/tests/test_shader_lang.cpp | 1 + modules/ui_extensions/bs_input_event_key.cpp | 2 ++ modules/ui_extensions/register_types.cpp | 1 + scene/gui/base_button.cpp | 1 + scene/gui/color_picker.cpp | 13 ++++++++++ scene/gui/color_picker.h | 27 +++++++++++--------- scene/gui/control.cpp | 3 +++ scene/gui/control.h | 10 +++++--- scene/gui/file_dialog.cpp | 1 + scene/gui/graph_edit.cpp | 1 + scene/gui/line_edit.cpp | 1 + scene/gui/menu_button.cpp | 1 + scene/gui/option_button.cpp | 1 + scene/gui/popup_menu.cpp | 2 ++ scene/gui/spin_box.cpp | 1 + scene/gui/text_edit.cpp | 1 + scene/gui/tree.cpp | 2 ++ scene/main/viewport.cpp | 1 + scene/register_scene_types.cpp | 1 + scene/resources/packed_scene.cpp | 1 + 25 files changed, 63 insertions(+), 15 deletions(-) diff --git a/editor/editor_network_profiler.cpp b/editor/editor_network_profiler.cpp index e2b5b779f..bc6fcc43b 100644 --- a/editor/editor_network_profiler.cpp +++ b/editor/editor_network_profiler.cpp @@ -33,6 +33,7 @@ #include "core/os/os.h" #include "editor_scale.h" #include "editor_settings.h" +#include "scene/main/timer.h" void EditorNetworkProfiler::_bind_methods() { ClassDB::bind_method(D_METHOD("_update_frame"), &EditorNetworkProfiler::_update_frame); diff --git a/editor/editor_sectioned_inspector.cpp b/editor/editor_sectioned_inspector.cpp index 7a211bc33..6ea5e4674 100644 --- a/editor/editor_sectioned_inspector.cpp +++ b/editor/editor_sectioned_inspector.cpp @@ -32,6 +32,7 @@ #include "editor_property_name_processor.h" #include "editor_scale.h" +#include "scene/gui/shortcut.h" class SectionedInspectorFilter : public Object { GDCLASS(SectionedInspectorFilter, Object); diff --git a/editor/quick_open.cpp b/editor/quick_open.cpp index 5f44fdd24..a34e2bfa2 100644 --- a/editor/quick_open.cpp +++ b/editor/quick_open.cpp @@ -31,6 +31,7 @@ #include "quick_open.h" #include "core/os/keyboard.h" +#include "scene/gui/shortcut.h" void EditorQuickOpen::popup_dialog(const StringName &p_base, bool p_enable_multi, bool p_dontclear) { base_type = p_base; diff --git a/editor/run_settings_dialog.cpp b/editor/run_settings_dialog.cpp index 37fdbed5b..85d06c092 100644 --- a/editor/run_settings_dialog.cpp +++ b/editor/run_settings_dialog.cpp @@ -30,6 +30,8 @@ #include "run_settings_dialog.h" +#include "scene/gui/shortcut.h" + void RunSettingsDialog::popup_run_settings() { popup_centered(Size2(300, 150)); } diff --git a/main/tests/test_gui.cpp b/main/tests/test_gui.cpp index 18b5436f9..883919e2c 100644 --- a/main/tests/test_gui.cpp +++ b/main/tests/test_gui.cpp @@ -52,6 +52,7 @@ #include "scene/gui/texture_rect.h" #include "scene/gui/tree.h" #include "scene/main/scene_tree.h" +#include "scene/gui/shortcut.h" #include "scene/3d/camera.h" #include "scene/main/viewport.h" diff --git a/main/tests/test_shader_lang.cpp b/main/tests/test_shader_lang.cpp index adc1c510b..46a0d0ad7 100644 --- a/main/tests/test_shader_lang.cpp +++ b/main/tests/test_shader_lang.cpp @@ -39,6 +39,7 @@ #include "scene/gui/text_edit.h" #include "servers/visual/shader_language.h" #include "servers/visual/shader_types.h" +#include "scene/gui/shortcut.h" typedef ShaderLanguage SL; diff --git a/modules/ui_extensions/bs_input_event_key.cpp b/modules/ui_extensions/bs_input_event_key.cpp index ed3407662..cf1f33cec 100644 --- a/modules/ui_extensions/bs_input_event_key.cpp +++ b/modules/ui_extensions/bs_input_event_key.cpp @@ -22,6 +22,8 @@ SOFTWARE. #include "bs_input_event_key.h" +#include "scene/gui/shortcut.h" + void BSInputEventKey::from_input_event_key(const Ref event) { set_device(event->get_device()); diff --git a/modules/ui_extensions/register_types.cpp b/modules/ui_extensions/register_types.cpp index fc4149d00..c8ee37812 100644 --- a/modules/ui_extensions/register_types.cpp +++ b/modules/ui_extensions/register_types.cpp @@ -25,6 +25,7 @@ SOFTWARE. #include "bs_input_event_key.h" #include "input_map_editor.h" #include "touch_button.h" +#include "scene/gui/shortcut.h" void register_ui_extensions_types() { ClassDB::register_class(); diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index f51d423ad..361cc49d1 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -33,6 +33,7 @@ #include "core/os/keyboard.h" #include "scene/main/viewport.h" #include "scene/scene_string_names.h" +#include "scene/gui/shortcut.h" void BaseButton::_unpress_group() { if (!button_group.is_valid()) { diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp index 00458a79c..2397f5423 100644 --- a/scene/gui/color_picker.cpp +++ b/scene/gui/color_picker.cpp @@ -34,6 +34,17 @@ #include "core/os/keyboard.h" #include "core/os/os.h" +#include "scene/gui/check_button.h" +#include "scene/gui/grid_container.h" +#include "scene/gui/label.h" +#include "scene/gui/line_edit.h" +#include "scene/gui/popup.h" +#include "scene/gui/separator.h" +#include "scene/gui/slider.h" +#include "scene/gui/spin_box.h" +#include "scene/gui/texture_rect.h" +#include "scene/gui/tool_button.h" + #ifdef TOOLS_ENABLED #include "editor/editor_scale.h" #include "editor/editor_settings.h" @@ -790,6 +801,8 @@ void ColorPicker::_bind_methods() { ColorPicker::ColorPicker() : BoxContainer(true) { + preset_container = memnew(GridContainer); + updating = true; edit_alpha = true; text_is_constructor = false; diff --git a/scene/gui/color_picker.h b/scene/gui/color_picker.h index 7424c9f9b..e17965d6e 100644 --- a/scene/gui/color_picker.h +++ b/scene/gui/color_picker.h @@ -31,18 +31,21 @@ #ifndef COLOR_PICKER_H #define COLOR_PICKER_H -#include "scene/gui/box_container.h" #include "scene/gui/button.h" -#include "scene/gui/check_button.h" -#include "scene/gui/grid_container.h" -#include "scene/gui/label.h" -#include "scene/gui/line_edit.h" -#include "scene/gui/popup.h" -#include "scene/gui/separator.h" -#include "scene/gui/slider.h" -#include "scene/gui/spin_box.h" -#include "scene/gui/texture_rect.h" -#include "scene/gui/tool_button.h" +#include "scene/gui/box_container.h" + +class Control; +class TextureRect; +class GridContainer; +class HSeparator; +class ToolButton; +class CheckButton; +class HSlider; +class SpinBox; +class Label; +class LineEdit; +class PopupPanel; +class GridContainer; class ColorPresetButton : public BaseButton { GDCLASS(ColorPresetButton, BaseButton); @@ -69,7 +72,7 @@ private: Control *uv_edit; Control *w_edit; TextureRect *sample; - GridContainer *preset_container = memnew(GridContainer); + GridContainer *preset_container; HSeparator *preset_separator; Button *btn_add_preset; ToolButton *btn_pick; diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 8d50147fe..c7dfdb6e0 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -41,6 +41,9 @@ #include "scene/main/viewport.h" #include "scene/scene_string_names.h" #include "servers/visual_server.h" +#include "scene/gui/shortcut.h" +#include "scene/main/node.h" +#include "scene/main/timer.h" #ifdef TOOLS_ENABLED #include "editor/editor_settings.h" diff --git a/scene/gui/control.h b/scene/gui/control.h index 0a0fb1b58..0f0f98a12 100644 --- a/scene/gui/control.h +++ b/scene/gui/control.h @@ -34,14 +34,18 @@ #include "core/math/transform_2d.h" #include "core/rid.h" #include "scene/2d/canvas_item.h" -#include "scene/gui/shortcut.h" -#include "scene/main/node.h" -#include "scene/main/timer.h" #include "scene/resources/theme.h" class Viewport; class Label; class Panel; +class Texture; +class Shader; +class StyleBox; +class Font; +class Node; +class ShortCut; +class Timer; class Control : public CanvasItem { GDCLASS(Control, CanvasItem); diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index c1e337894..af52f6809 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -33,6 +33,7 @@ #include "core/os/keyboard.h" #include "core/print_string.h" #include "scene/gui/label.h" +#include "scene/gui/shortcut.h" FileDialog::GetIconFunc FileDialog::get_icon_func = nullptr; FileDialog::GetIconFunc FileDialog::get_large_icon_func = nullptr; diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index fe1fa3c8b..a8b038f29 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -34,6 +34,7 @@ #include "core/os/input.h" #include "core/os/keyboard.h" #include "scene/gui/box_container.h" +#include "scene/gui/shortcut.h" #ifdef TOOLS_ENABLED #include "editor/editor_scale.h" diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 3aa928396..e81086c0b 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -36,6 +36,7 @@ #include "core/print_string.h" #include "core/translation.h" #include "label.h" +#include "scene/main/timer.h" #ifdef TOOLS_ENABLED #include "editor/editor_scale.h" diff --git a/scene/gui/menu_button.cpp b/scene/gui/menu_button.cpp index 2c9766cae..b86c25c22 100644 --- a/scene/gui/menu_button.cpp +++ b/scene/gui/menu_button.cpp @@ -32,6 +32,7 @@ #include "core/os/input.h" #include "core/os/keyboard.h" #include "scene/main/viewport.h" +#include "scene/gui/shortcut.h" void MenuButton::_unhandled_key_input(Ref p_event) { ERR_FAIL_COND(p_event.is_null()); diff --git a/scene/gui/option_button.cpp b/scene/gui/option_button.cpp index b847f772a..9e626cd74 100644 --- a/scene/gui/option_button.cpp +++ b/scene/gui/option_button.cpp @@ -31,6 +31,7 @@ #include "option_button.h" #include "core/os/input.h" #include "core/print_string.h" +#include "scene/gui/shortcut.h" Size2 OptionButton::get_minimum_size() const { Size2 minsize = Button::get_minimum_size(); diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index ea96c5627..e4aa56c8a 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -34,6 +34,8 @@ #include "core/os/os.h" #include "core/print_string.h" #include "core/translation.h" +#include "scene/gui/shortcut.h" +#include "scene/main/timer.h" String PopupMenu::_get_accel_text(int p_item) const { ERR_FAIL_INDEX_V(p_item, items.size(), String()); diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp index 5f237f1a8..c8055b44a 100644 --- a/scene/gui/spin_box.cpp +++ b/scene/gui/spin_box.cpp @@ -31,6 +31,7 @@ #include "spin_box.h" #include "core/math/expression.h" #include "core/os/input.h" +#include "scene/gui/shortcut.h" Size2 SpinBox::get_minimum_size() const { Size2 ms = line_edit->get_combined_minimum_size(); diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 4b374516e..a9f5c62e2 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -37,6 +37,7 @@ #include "core/project_settings.h" #include "core/script_language.h" #include "scene/main/viewport.h" +#include "scene/gui/shortcut.h" #ifdef TOOLS_ENABLED #include "editor/editor_scale.h" diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 2b257c5ab..699299ec7 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -37,6 +37,8 @@ #include "core/print_string.h" #include "core/project_settings.h" #include "scene/main/viewport.h" +#include "scene/main/timer.h" +#include "scene/gui/shortcut.h" #ifdef TOOLS_ENABLED #include "editor/editor_scale.h" diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 80d3878fc..605acf01a 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -53,6 +53,7 @@ #include "scene/resources/mesh.h" #include "scene/scene_string_names.h" #include "servers/physics_2d_server.h" +#include "scene/gui/shortcut.h" void ViewportTexture::setup_local_to_scene() { Node *local_scene = get_local_scene(); diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index ccb1146e1..3911bfd06 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -171,6 +171,7 @@ #include "scene/resources/world.h" #include "scene/resources/world_2d.h" #include "scene/resources/skin.h" +#include "scene/gui/shortcut.h" #include "scene/scene_string_names.h" #ifndef _3D_DISABLED diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index c86a78698..c12b96b73 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -40,6 +40,7 @@ #include "scene/gui/control.h" #include "scene/main/instance_placeholder.h" #include "scene/property_utils.h" +#include "scene/gui/shortcut.h" #define PACKED_SCENE_VERSION 2