#include "canvas_item_editor_plugin.h"
#include "core/config/project_settings.h"
#include "core/input/input.h"
#include "core/os/keyboard.h"
#include "editor/debugger/editor_debugger_node.h"
#include "editor/editor_node.h"
#include "editor/editor_settings.h"
#include "editor/editor_string_names.h"
#include "editor/editor_undo_redo_manager.h"
#include "editor/gui/editor_run_bar.h"
#include "editor/gui/editor_toaster.h"
#include "editor/gui/editor_zoom_widget.h"
#include "editor/plugins/animation_player_editor_plugin.h"
#include "editor/plugins/script_editor_plugin.h"
#include "editor/scene_tree_dock.h"
#include "editor/themes/editor_scale.h"
#include "editor/themes/editor_theme_manager.h"
#include "scene/2d/audio_stream_player_2d.h"
#include "scene/2d/polygon_2d.h"
#include "scene/2d/skeleton_2d.h"
#include "scene/2d/sprite_2d.h"
#include "scene/2d/touch_screen_button.h"
#include "scene/gui/base_button.h"
#include "scene/gui/flow_container.h"
#include "scene/gui/grid_container.h"
#include "scene/gui/separator.h"
#include "scene/gui/split_container.h"
#include "scene/gui/subviewport_container.h"
#include "scene/gui/view_panner.h"
#include "scene/main/canvas_layer.h"
#include "scene/main/window.h"
#include "scene/resources/packed_scene.h"
#include "scene/resources/style_box_texture.h"
#define RULER_WIDTH …
#define DRAG_THRESHOLD …
constexpr real_t SCALE_HANDLE_DISTANCE = …;
constexpr real_t MOVE_HANDLE_DISTANCE = …;
class SnapDialog : public ConfirmationDialog { … };
bool CanvasItemEditor::_is_node_locked(const Node *p_node) const { … }
bool CanvasItemEditor::_is_node_movable(const Node *p_node, bool p_popup_warning) { … }
void CanvasItemEditor::_snap_if_closer_float(
const real_t p_value,
real_t &r_current_snap, SnapTarget &r_current_snap_target,
const real_t p_target_value, const SnapTarget p_snap_target,
const real_t p_radius) { … }
void CanvasItemEditor::_snap_if_closer_point(
Point2 p_value,
Point2 &r_current_snap, SnapTarget (&r_current_snap_target)[2],
Point2 p_target_value, const SnapTarget p_snap_target,
const real_t rotation,
const real_t p_radius) { … }
void CanvasItemEditor::_snap_other_nodes(
const Point2 p_value,
const Transform2D p_transform_to_snap,
Point2 &r_current_snap, SnapTarget (&r_current_snap_target)[2],
const SnapTarget p_snap_target, List<const CanvasItem *> p_exceptions,
const Node *p_current) { … }
Point2 CanvasItemEditor::snap_point(Point2 p_target, unsigned int p_modes, unsigned int p_forced_modes, const CanvasItem *p_self_canvas_item, const List<CanvasItem *> &p_other_nodes_exceptions) { … }
real_t CanvasItemEditor::snap_angle(real_t p_target, real_t p_start) const { … }
void CanvasItemEditor::shortcut_input(const Ref<InputEvent> &p_ev) { … }
Object *CanvasItemEditor::_get_editor_data(Object *p_what) { … }
void CanvasItemEditor::_keying_changed() { … }
Rect2 CanvasItemEditor::_get_encompassing_rect_from_list(const List<CanvasItem *> &p_list) { … }
void CanvasItemEditor::_expand_encompassing_rect_using_children(Rect2 &r_rect, const Node *p_node, bool &r_first, const Transform2D &p_parent_xform, const Transform2D &p_canvas_xform, bool include_locked_nodes) { … }
Rect2 CanvasItemEditor::_get_encompassing_rect(const Node *p_node) { … }
void CanvasItemEditor::_find_canvas_items_at_pos(const Point2 &p_pos, Node *p_node, Vector<_SelectResult> &r_items, const Transform2D &p_parent_xform, const Transform2D &p_canvas_xform) { … }
void CanvasItemEditor::_get_canvas_items_at_pos(const Point2 &p_pos, Vector<_SelectResult> &r_items, bool p_allow_locked) { … }
void CanvasItemEditor::_find_canvas_items_in_rect(const Rect2 &p_rect, Node *p_node, List<CanvasItem *> *r_items, const Transform2D &p_parent_xform, const Transform2D &p_canvas_xform) { … }
bool CanvasItemEditor::_select_click_on_item(CanvasItem *item, Point2 p_click_pos, bool p_append) { … }
List<CanvasItem *> CanvasItemEditor::_get_edited_canvas_items(bool p_retrieve_locked, bool p_remove_canvas_item_if_parent_in_selection, bool *r_has_locked_items) const { … }
Vector2 CanvasItemEditor::_anchor_to_position(const Control *p_control, Vector2 anchor) { … }
Vector2 CanvasItemEditor::_position_to_anchor(const Control *p_control, Vector2 position) { … }
void CanvasItemEditor::_save_canvas_item_state(const List<CanvasItem *> &p_canvas_items, bool save_bones) { … }
void CanvasItemEditor::_restore_canvas_item_state(const List<CanvasItem *> &p_canvas_items, bool restore_bones) { … }
void CanvasItemEditor::_commit_canvas_item_state(const List<CanvasItem *> &p_canvas_items, const String &action_name, bool commit_bones) { … }
void CanvasItemEditor::_snap_changed() { … }
void CanvasItemEditor::_selection_result_pressed(int p_result) { … }
void CanvasItemEditor::_selection_menu_hide() { … }
void CanvasItemEditor::_add_node_pressed(int p_result) { … }
void CanvasItemEditor::_adjust_new_node_position(Node *p_node) { … }
void CanvasItemEditor::_reset_create_position() { … }
bool CanvasItemEditor::_is_grid_visible() const { … }
void CanvasItemEditor::_prepare_grid_menu() { … }
void CanvasItemEditor::_on_grid_menu_id_pressed(int p_id) { … }
void CanvasItemEditor::_switch_theme_preview(int p_mode) { … }
bool CanvasItemEditor::_gui_input_rulers_and_guides(const Ref<InputEvent> &p_event) { … }
bool CanvasItemEditor::_gui_input_zoom_or_pan(const Ref<InputEvent> &p_event, bool p_already_accepted) { … }
void CanvasItemEditor::_pan_callback(Vector2 p_scroll_vec, Ref<InputEvent> p_event) { … }
void CanvasItemEditor::_zoom_callback(float p_zoom_factor, Vector2 p_origin, Ref<InputEvent> p_event) { … }
bool CanvasItemEditor::_gui_input_pivot(const Ref<InputEvent> &p_event) { … }
bool CanvasItemEditor::_gui_input_rotate(const Ref<InputEvent> &p_event) { … }
bool CanvasItemEditor::_gui_input_open_scene_on_double_click(const Ref<InputEvent> &p_event) { … }
bool CanvasItemEditor::_gui_input_anchors(const Ref<InputEvent> &p_event) { … }
bool CanvasItemEditor::_gui_input_resize(const Ref<InputEvent> &p_event) { … }
bool CanvasItemEditor::_gui_input_scale(const Ref<InputEvent> &p_event) { … }
bool CanvasItemEditor::_gui_input_move(const Ref<InputEvent> &p_event) { … }
bool CanvasItemEditor::_gui_input_select(const Ref<InputEvent> &p_event) { … }
bool CanvasItemEditor::_gui_input_ruler_tool(const Ref<InputEvent> &p_event) { … }
bool CanvasItemEditor::_gui_input_hover(const Ref<InputEvent> &p_event) { … }
void CanvasItemEditor::_gui_input_viewport(const Ref<InputEvent> &p_event) { … }
void CanvasItemEditor::_update_cursor() { … }
void CanvasItemEditor::_update_lock_and_group_button() { … }
Control::CursorShape CanvasItemEditor::get_cursor_shape(const Point2 &p_pos) const { … }
void CanvasItemEditor::_draw_text_at_position(Point2 p_position, const String &p_string, Side p_side) { … }
void CanvasItemEditor::_draw_margin_at_position(int p_value, Point2 p_position, Side p_side) { … }
void CanvasItemEditor::_draw_percentage_at_position(real_t p_value, Point2 p_position, Side p_side) { … }
void CanvasItemEditor::_draw_focus() { … }
void CanvasItemEditor::_draw_guides() { … }
void CanvasItemEditor::_draw_smart_snapping() { … }
void CanvasItemEditor::_draw_rulers() { … }
void CanvasItemEditor::_draw_grid() { … }
void CanvasItemEditor::_draw_ruler_tool() { … }
void CanvasItemEditor::_draw_control_anchors(Control *control) { … }
void CanvasItemEditor::_draw_control_helpers(Control *control) { … }
void CanvasItemEditor::_draw_selection() { … }
void CanvasItemEditor::_draw_straight_line(Point2 p_from, Point2 p_to, Color p_color) { … }
void CanvasItemEditor::_draw_axis() { … }
void CanvasItemEditor::_draw_invisible_nodes_positions(Node *p_node, const Transform2D &p_parent_xform, const Transform2D &p_canvas_xform) { … }
void CanvasItemEditor::_draw_hover() { … }
void CanvasItemEditor::_draw_message() { … }
void CanvasItemEditor::_draw_locks_and_groups(Node *p_node, const Transform2D &p_parent_xform, const Transform2D &p_canvas_xform) { … }
void CanvasItemEditor::_draw_viewport() { … }
void CanvasItemEditor::update_viewport() { … }
void CanvasItemEditor::set_current_tool(Tool p_tool) { … }
void CanvasItemEditor::_update_editor_settings() { … }
void CanvasItemEditor::_project_settings_changed() { … }
void CanvasItemEditor::_notification(int p_what) { … }
void CanvasItemEditor::_selection_changed() { … }
void CanvasItemEditor::edit(CanvasItem *p_canvas_item) { … }
void CanvasItemEditor::_update_scrollbars() { … }
void CanvasItemEditor::_update_scroll(real_t) { … }
void CanvasItemEditor::_zoom_on_position(real_t p_zoom, Point2 p_position) { … }
void CanvasItemEditor::_update_zoom(real_t p_zoom) { … }
void CanvasItemEditor::_shortcut_zoom_set(real_t p_zoom) { … }
void CanvasItemEditor::_button_toggle_smart_snap(bool p_status) { … }
void CanvasItemEditor::_button_toggle_grid_snap(bool p_status) { … }
void CanvasItemEditor::_button_override_camera(bool p_pressed) { … }
void CanvasItemEditor::_button_tool_select(int p_index) { … }
void CanvasItemEditor::_insert_animation_keys(bool p_location, bool p_rotation, bool p_scale, bool p_on_existing) { … }
void CanvasItemEditor::_update_override_camera_button(bool p_game_running) { … }
void CanvasItemEditor::_popup_callback(int p_op) { … }
void CanvasItemEditor::_set_owner_for_node_and_children(Node *p_node, Node *p_owner) { … }
void CanvasItemEditor::_focus_selection(int p_op) { … }
void CanvasItemEditor::_reset_drag() { … }
void CanvasItemEditor::_bind_methods() { … }
Dictionary CanvasItemEditor::get_state() const { … }
void CanvasItemEditor::set_state(const Dictionary &p_state) { … }
void CanvasItemEditor::clear() { … }
void CanvasItemEditor::add_control_to_menu_panel(Control *p_control) { … }
void CanvasItemEditor::remove_control_from_menu_panel(Control *p_control) { … }
void CanvasItemEditor::_update_context_toolbar() { … }
void CanvasItemEditor::add_control_to_left_panel(Control *p_control) { … }
void CanvasItemEditor::add_control_to_right_panel(Control *p_control) { … }
void CanvasItemEditor::remove_control_from_left_panel(Control *p_control) { … }
void CanvasItemEditor::remove_control_from_right_panel(Control *p_control) { … }
VSplitContainer *CanvasItemEditor::get_bottom_split() { … }
void CanvasItemEditor::focus_selection() { … }
void CanvasItemEditor::center_at(const Point2 &p_pos) { … }
CanvasItemEditor::CanvasItemEditor() { … }
CanvasItemEditor *CanvasItemEditor::singleton = …;
void CanvasItemEditorPlugin::edit(Object *p_object) { … }
bool CanvasItemEditorPlugin::handles(Object *p_object) const { … }
void CanvasItemEditorPlugin::make_visible(bool p_visible) { … }
Dictionary CanvasItemEditorPlugin::get_state() const { … }
void CanvasItemEditorPlugin::set_state(const Dictionary &p_state) { … }
void CanvasItemEditorPlugin::clear() { … }
void CanvasItemEditorPlugin::_notification(int p_what) { … }
CanvasItemEditorPlugin::CanvasItemEditorPlugin() { … }
CanvasItemEditorPlugin::~CanvasItemEditorPlugin() { … }
void CanvasItemEditorViewport::_on_mouse_exit() { … }
void CanvasItemEditorViewport::_on_select_texture_node_type(Object *selected) { … }
void CanvasItemEditorViewport::_on_change_type_confirmed() { … }
void CanvasItemEditorViewport::_on_change_type_closed() { … }
void CanvasItemEditorViewport::_create_preview(const Vector<String> &files) const { … }
void CanvasItemEditorViewport::_remove_preview() { … }
bool CanvasItemEditorViewport::_cyclical_dependency_exists(const String &p_target_scene_path, Node *p_desired_node) const { … }
void CanvasItemEditorViewport::_create_texture_node(Node *p_parent, Node *p_child, const String &p_path, const Point2 &p_point) { … }
void CanvasItemEditorViewport::_create_audio_node(Node *p_parent, const String &p_path, const Point2 &p_point) { … }
bool CanvasItemEditorViewport::_create_instance(Node *p_parent, const String &p_path, const Point2 &p_point) { … }
void CanvasItemEditorViewport::_perform_drop_data() { … }
bool CanvasItemEditorViewport::can_drop_data(const Point2 &p_point, const Variant &p_data) const { … }
void CanvasItemEditorViewport::_show_texture_node_type_selector() { … }
bool CanvasItemEditorViewport::_is_any_texture_selected() const { … }
void CanvasItemEditorViewport::drop_data(const Point2 &p_point, const Variant &p_data) { … }
void CanvasItemEditorViewport::_update_theme() { … }
void CanvasItemEditorViewport::_notification(int p_what) { … }
CanvasItemEditorViewport::CanvasItemEditorViewport(CanvasItemEditor *p_canvas_item_editor) { … }
CanvasItemEditorViewport::~CanvasItemEditorViewport() { … }