1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 17:08:12 +00:00
serenity/Applications/PaintBrush/Tool.h
Robin Burchell 502c54e39a Add a simple spray fill tool
Could do with some more tweaking no doubt, and it'd be nice to have a
circular spray, but this is better than nothing.
2019-06-17 05:54:32 +02:00

22 lines
484 B
C++

#pragma once
#include "PaintableWidget.h"
class GMouseEvent;
class Tool {
public:
virtual ~Tool();
virtual const char* class_name() const = 0;
virtual void on_mousedown(GMouseEvent&) { }
virtual void on_mousemove(GMouseEvent&) { }
virtual void on_mouseup(GMouseEvent&) { }
void clear() { m_widget = nullptr; }
void setup(PaintableWidget& widget) { m_widget = widget.make_weak_ptr(); }
protected:
Tool();
WeakPtr<PaintableWidget> m_widget;
};