diff --git a/Applications/PixelPaint/BrushTool.h b/Applications/PixelPaint/BrushTool.h index 9c42932413..939ccdeef4 100644 --- a/Applications/PixelPaint/BrushTool.h +++ b/Applications/PixelPaint/BrushTool.h @@ -47,7 +47,6 @@ private: bool m_was_drawing { false }; Gfx::IntPoint m_last_position; - virtual const char* class_name() const override { return "BrushTool"; } void draw_line(Gfx::Bitmap& bitmap, const Gfx::Color& color, const Gfx::IntPoint& start, const Gfx::IntPoint& end); void draw_point(Gfx::Bitmap& bitmap, const Gfx::Color& color, const Gfx::IntPoint& point); }; diff --git a/Applications/PixelPaint/BucketTool.h b/Applications/PixelPaint/BucketTool.h index 2760302c44..b4bf700815 100644 --- a/Applications/PixelPaint/BucketTool.h +++ b/Applications/PixelPaint/BucketTool.h @@ -39,8 +39,6 @@ public: virtual GUI::Widget* get_properties_widget() override; private: - virtual const char* class_name() const override { return "BucketTool"; } - RefPtr m_properties_widget; int m_threshold { 0 }; }; diff --git a/Applications/PixelPaint/EllipseTool.h b/Applications/PixelPaint/EllipseTool.h index fb4a82b74a..0b1c10c89a 100644 --- a/Applications/PixelPaint/EllipseTool.h +++ b/Applications/PixelPaint/EllipseTool.h @@ -50,7 +50,6 @@ private: // FIXME: Add Mode::Fill }; - virtual const char* class_name() const override { return "EllipseTool"; } void draw_using(GUI::Painter&, const Gfx::IntRect&); GUI::MouseButton m_drawing_button { GUI::MouseButton::None }; diff --git a/Applications/PixelPaint/EraseTool.h b/Applications/PixelPaint/EraseTool.h index b41f628a8f..16241e87f0 100644 --- a/Applications/PixelPaint/EraseTool.h +++ b/Applications/PixelPaint/EraseTool.h @@ -45,7 +45,6 @@ public: private: Gfx::Color get_color() const; - virtual const char* class_name() const override { return "EraseTool"; } Gfx::IntRect build_rect(const Gfx::IntPoint& pos, const Gfx::IntRect& widget_rect); RefPtr m_context_menu; diff --git a/Applications/PixelPaint/ImageEditor.cpp b/Applications/PixelPaint/ImageEditor.cpp index 33b8b8b713..f29551c050 100644 --- a/Applications/PixelPaint/ImageEditor.cpp +++ b/Applications/PixelPaint/ImageEditor.cpp @@ -27,6 +27,7 @@ #include "ImageEditor.h" #include "Image.h" #include "Layer.h" +#include "MoveTool.h" #include "Tool.h" #include #include @@ -203,7 +204,7 @@ void ImageEditor::mousedown_event(GUI::MouseEvent& event) if (!m_active_tool) return; - if (m_active_tool->is_move_tool()) { + if (is(*m_active_tool)) { if (auto* other_layer = layer_at_editor_position(event.position())) { set_active_layer(other_layer); } diff --git a/Applications/PixelPaint/LineTool.h b/Applications/PixelPaint/LineTool.h index 9655a3b629..aa8757655c 100644 --- a/Applications/PixelPaint/LineTool.h +++ b/Applications/PixelPaint/LineTool.h @@ -46,8 +46,6 @@ public: virtual void on_keyup(GUI::KeyEvent&) override; private: - virtual const char* class_name() const override { return "LineTool"; } - GUI::MouseButton m_drawing_button { GUI::MouseButton::None }; Gfx::IntPoint m_line_start_position; Gfx::IntPoint m_line_end_position; diff --git a/Applications/PixelPaint/MoveTool.h b/Applications/PixelPaint/MoveTool.h index b680c71bc1..a0c16e5282 100644 --- a/Applications/PixelPaint/MoveTool.h +++ b/Applications/PixelPaint/MoveTool.h @@ -42,9 +42,6 @@ public: virtual void on_context_menu(Layer&, GUI::ContextMenuEvent&) override; private: - virtual const char* class_name() const override { return "MoveTool"; } - virtual bool is_move_tool() const override { return true; } - RefPtr m_layer_being_moved; Gfx::IntPoint m_event_origin; Gfx::IntPoint m_layer_origin; diff --git a/Applications/PixelPaint/PenTool.h b/Applications/PixelPaint/PenTool.h index e574099307..137e58251e 100644 --- a/Applications/PixelPaint/PenTool.h +++ b/Applications/PixelPaint/PenTool.h @@ -44,8 +44,6 @@ public: virtual GUI::Widget* get_properties_widget() override; private: - virtual const char* class_name() const override { return "PenTool"; } - Gfx::IntPoint m_last_drawing_event_position { -1, -1 }; RefPtr m_context_menu; RefPtr m_properties_widget; diff --git a/Applications/PixelPaint/PickerTool.h b/Applications/PixelPaint/PickerTool.h index 327dfffcb2..163a0aeeee 100644 --- a/Applications/PixelPaint/PickerTool.h +++ b/Applications/PixelPaint/PickerTool.h @@ -36,9 +36,6 @@ public: virtual ~PickerTool() override; virtual void on_mousedown(Layer&, GUI::MouseEvent& layer_event, GUI::MouseEvent& image_event) override; - -private: - virtual const char* class_name() const override { return "PickerTool"; } }; } diff --git a/Applications/PixelPaint/RectangleTool.h b/Applications/PixelPaint/RectangleTool.h index 4288c86235..f7d8c53273 100644 --- a/Applications/PixelPaint/RectangleTool.h +++ b/Applications/PixelPaint/RectangleTool.h @@ -51,7 +51,6 @@ private: Gradient, }; - virtual const char* class_name() const override { return "RectangleTool"; } void draw_using(GUI::Painter&, const Gfx::IntRect&); GUI::MouseButton m_drawing_button { GUI::MouseButton::None }; diff --git a/Applications/PixelPaint/SprayTool.h b/Applications/PixelPaint/SprayTool.h index 827832bc4c..a3e55efd52 100644 --- a/Applications/PixelPaint/SprayTool.h +++ b/Applications/PixelPaint/SprayTool.h @@ -45,7 +45,6 @@ public: virtual GUI::Widget* get_properties_widget() override; private: - virtual const char* class_name() const override { return "SprayTool"; } void paint_it(); RefPtr m_properties_widget; diff --git a/Applications/PixelPaint/Tool.h b/Applications/PixelPaint/Tool.h index 812e0edd2a..e7deb5f1cb 100644 --- a/Applications/PixelPaint/Tool.h +++ b/Applications/PixelPaint/Tool.h @@ -38,8 +38,6 @@ class Tool { public: virtual ~Tool(); - virtual const char* class_name() const = 0; - virtual void on_mousedown(Layer&, GUI::MouseEvent&, GUI::MouseEvent&) { } virtual void on_mousemove(Layer&, GUI::MouseEvent&, GUI::MouseEvent&) { } virtual void on_mouseup(Layer&, GUI::MouseEvent&, GUI::MouseEvent&) { } @@ -50,8 +48,6 @@ public: virtual void on_keyup(GUI::KeyEvent&) { } virtual GUI::Widget* get_properties_widget() { return nullptr; } - virtual bool is_move_tool() const { return false; } - void clear() { m_editor = nullptr; } void setup(ImageEditor&);