18 #ifndef HEADER_SUPERTUX_EDITOR_TOOLBOX_WIDGET_HPP 19 #define HEADER_SUPERTUX_EDITOR_TOOLBOX_WIDGET_HPP 21 #include "editor/widget.hpp" 25 #include "math/rectf.hpp" 26 #include "math/vector.hpp" 27 #include "video/surface_ptr.hpp" 39 enum class HoveredItem {
40 NONE, TILEGROUP, OBJECTS, TOOL, TILEBOX
48 virtual bool on_mouse_button_up(
const SDL_MouseButtonEvent& button)
override;
49 virtual bool on_mouse_button_down(
const SDL_MouseButtonEvent& button)
override;
50 virtual bool on_mouse_motion(
const SDL_MouseMotionEvent& motion)
override;
51 virtual bool on_mouse_wheel(
const SDL_MouseWheelEvent& wheel)
override;
53 virtual void setup()
override;
54 virtual void resize()
override;
56 void select_tilegroup(
int id);
57 void select_objectgroup(
int id);
59 int get_tileselect_select_mode()
const;
60 int get_tileselect_move_mode()
const;
62 void update_mouse_icon();
66 bool has_mouse_focus()
const {
return m_has_mouse_focus; }
69 Vector get_tool_coords(
int pos)
const;
70 int get_tool_pos(
const Vector& coords)
const;
72 Rectf get_hovered_item_rect()
const;
74 SurfacePtr get_mouse_icon()
const;
79 std::unique_ptr<EditorTilebox> m_tilebox;
82 HoveredItem m_hovered_item;
85 std::unique_ptr<ToolIcon> m_rubber;
86 std::unique_ptr<ToolIcon> m_select_mode;
87 std::unique_ptr<ToolIcon> m_node_marker_mode;
88 std::unique_ptr<ToolIcon> m_move_mode;
89 std::unique_ptr<ToolIcon> m_undo_mode;
91 bool m_has_mouse_focus;
The tilebox allows selection of tiles or objects from a specified tilegroup/objectgroup.
Definition: tilebox.hpp:44
Definition: editor.hpp:49
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42