mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 02:37:36 +00:00
PaintBrush: Factor out the pen tool into an actual PenTool class.
Also add a Tool base class, and an empty BucketTool subclass which is the next thing to implement.
This commit is contained in:
parent
a12751695e
commit
56cbe15033
10 changed files with 185 additions and 33 deletions
18
Applications/PaintBrush/Tool.h
Normal file
18
Applications/PaintBrush/Tool.h
Normal file
|
@ -0,0 +1,18 @@
|
|||
#pragma once
|
||||
|
||||
class GMouseEvent;
|
||||
class PaintableWidget;
|
||||
|
||||
class Tool {
|
||||
public:
|
||||
virtual ~Tool();
|
||||
|
||||
virtual const char* class_name() const = 0;
|
||||
|
||||
virtual void on_mousedown(PaintableWidget&, GMouseEvent&) { }
|
||||
virtual void on_mousemove(PaintableWidget&, GMouseEvent&) { }
|
||||
virtual void on_mouseup(PaintableWidget&, GMouseEvent&) { }
|
||||
|
||||
protected:
|
||||
Tool();
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue