-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforTools.hpp
60 lines (48 loc) · 1.65 KB
/
forTools.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
54
55
56
57
58
59
60
#include <iostream>
#include <cassert>
#include "MainWindow.hpp"
#include "ToolSetup.hpp"
#include "Canvas.hpp"
#include "tools.hpp"
namespace booba {
gGUI::MainWindow *MAINWINDOW = nullptr;
ApplicationContext *APPCONTEXT = nullptr;
Image::~Image() {}
uint64_t createButton(int32_t x, int32_t y, uint32_t w, uint32_t h, const char *text)
{
assert(MAINWINDOW);
return MAINWINDOW->getToolSetup()->addButton(x, y, w, h, text);
}
uint64_t createLabel(int32_t x, int32_t y, uint32_t w, uint32_t h, const char *text)
{
assert(MAINWINDOW);
return MAINWINDOW->getToolSetup()->addLabel(x, y, w, h, text);
}
uint64_t createScrollbar(int32_t x, int32_t y, uint32_t w, uint32_t h, int32_t max, int32_t start) //FIXME rename to `slider` after v2.0.0 standart release
{
assert(MAINWINDOW);
return MAINWINDOW->getToolSetup()->addSlider(x, y, w, h, max, start);
}
uint64_t createCanvas(int32_t x, int32_t y, int32_t w, int32_t h) //FIXME rename after v2.0.0 standart release
{
assert(MAINWINDOW);
return MAINWINDOW->getToolSetup()->addCanvas(x, y, w, h);
}
void putPixel (uint64_t canvas, int32_t x, int32_t y, uint32_t color)
{
gGUI::Canvas *c = reinterpret_cast<gGUI::Canvas*>(canvas);
c->putPixel(x, y, color);
}
void putSprite(uint64_t canvas, int32_t x, int32_t y, uint32_t w, uint32_t h, const char* texture)
{
assert(!"no sprites for canvas yet");
}
void addTool(Tool* tool)
{
MAINWINDOW->getToolPalette()->addTool(tool);
}
void addFilter(Tool* tool)
{
addTool(tool);
}
}