-
Notifications
You must be signed in to change notification settings - Fork 0
/
ToolPalette.hpp
53 lines (37 loc) · 1.43 KB
/
ToolPalette.hpp
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#pragma once
#include "Widget.hpp"
#include "tools.hpp"
namespace gGUI {
class ToolSetup;
class MainWindow;
class ToolPalette : public Widget {
private:
size_t w_cnt = 0;
size_t h_cnt = 0;
size_t d = 0;
size_t ts_x = -1;
size_t ts_y = -1;
size_t ts_w = -1;
size_t ts_h = -1;
std::map<uint64_t, ToolSetup*> toolSetups;
std::map<uint64_t, booba::Tool*> tools;
booba::Tool* curTool = nullptr;
MainWindow *parent;
public:
Slot SelectTool = Slot(this, SLOT_FUNC(ToolPalette::selectToolHandler));
Slot CanvasMAct = Slot(this, SLOT_FUNC(ToolPalette::canvasMHandler));
Slot SetupToolB = Slot(this, SLOT_FUNC(ToolPalette::setupToolBHandler));
Slot SetupToolS = Slot(this, SLOT_FUNC(ToolPalette::setupToolSHandler));
Slot SetupToolC = Slot(this, SLOT_FUNC(ToolPalette::setupToolCHandler));
ToolPalette(size_t x, size_t y, size_t w_cnt, size_t h_cnt, size_t d, MainWindow *p);
virtual void add_child(Widget *ch) override;
void selectToolHandler(Event ev);
void canvasMHandler(Event ev);
void setupToolBHandler(Event ev);
void setupToolSHandler(Event ev);
void setupToolCHandler(Event ev);
void setToolSetupPos(size_t x, size_t y, size_t w, size_t h);
void regButton(uint64_t widgetID);
void addTool(booba::Tool *tool);
};
}