summaryrefslogtreecommitdiff
path: root/Applications/PaintBrush/SprayTool.h
blob: 679009a1da960c30ff275e7b2591f3cf477ed899 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#pragma once

#include "Tool.h"
#include <LibGUI/GPainter.h>
#include <LibCore/CTimer.h>

class GMenu;

class SprayTool final : public Tool {
public:
    SprayTool();
    virtual ~SprayTool() override;

    virtual void on_mousedown(GMouseEvent&) override;
    virtual void on_mouseup(GMouseEvent&) override;
    virtual void on_mousemove(GMouseEvent&) override;
    virtual void on_contextmenu(GContextMenuEvent&) override;

private:
    virtual const char* class_name() const override { return "SprayTool"; }
    void paint_it();
    ObjectPtr<CTimer> m_timer;
    Point m_last_pos;
    Color m_color;
    OwnPtr<GMenu> m_context_menu;
    int m_thickness { 1 };
};