/**************************************************************************/1/* touch_actions_panel.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 "scene/gui/panel_container.h"3334class BoxContainer;35class Button;36class TextureRect;3738class TouchActionsPanel : public PanelContainer {39GDCLASS(TouchActionsPanel, PanelContainer);4041private:42BoxContainer *box = nullptr;43Button *save_button = nullptr;44Button *delete_button = nullptr;45Button *undo_button = nullptr;46Button *redo_button = nullptr;47Button *cut_button = nullptr;48Button *copy_button = nullptr;49Button *paste_button = nullptr;5051TextureRect *drag_handle = nullptr;52Button *layout_toggle_button = nullptr;53Button *lock_panel_button = nullptr;54Button *panel_pos_button = nullptr;5556bool locked_panel = false;57bool dragging = false;58Vector2 drag_offset;5960enum Modifier {61MODIFIER_CTRL,62MODIFIER_SHIFT,63MODIFIER_ALT64};6566bool ctrl_btn_pressed = false;67bool shift_btn_pressed = false;68bool alt_btn_pressed = false;6970bool is_floating = false; // Embedded panel mode is default.71int embedded_panel_index = 0;7273void _notification(int p_what);74virtual void input(const Ref<InputEvent> &event) override;7576void _simulate_editor_shortcut(const String &p_shortcut_name);77void _simulate_key_press(Key p_keycode);78void _on_drag_handle_gui_input(const Ref<InputEvent> &p_event);79void _switch_layout();80void _lock_panel_toggled(bool p_pressed);81void _switch_embedded_panel_side();8283Button *_add_new_action_button(const String &p_shortcut, const String &p_name, Key p_keycode = Key::NONE);84void _add_new_modifier_button(Modifier p_modifier);85void _on_modifier_button_toggled(bool p_pressed, int p_modifier);8687void _hardware_keyboard_connected(bool p_connected);8889public:90TouchActionsPanel();91};929394