-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathScreen.h
94 lines (79 loc) · 1.34 KB
/
Screen.h
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
#pragma once
/**
* File: Screen.h
* Created on: 12. 9. 2017
* Author: Denis Colesnicov <[email protected]>
* Version: 1.2.1
*/
#include <Arduino.h>
#include "Adafruit_GFX.h"
#include "common.h"
/**
* Bazova trida pro obrazovky
*/
class Screen
{
public:
Screen()
{
}
/**
* @param tft Ukazatel na instanci displeje
*/
Screen(Adafruit_GFX* tft) :
m_invalid(true),
m_tft(tft)
{
}
virtual ~Screen()
{
}
/**
* Pripravna metoda
*/
virtual void begin()
{
}
/**
* Vykresli obrazovku
* Tato metoda musi se implementovat kazdou obrazovkou
*
* @param action Akce tlacitek
*/
virtual void update(Action action = Action::NONE)
{
}
/**
* Vrati ukazatel na instanci displeje
*
* @return Adafruit_GFX*
*/
Adafruit_GFX* getTft()
{
return m_tft;
}
/**
* Je nastaven priznak pro prekresleni obrzovky?
*/
bool isInvalid()
{
return m_invalid;
}
/**
* Nastavi priznak pro prekresleni obrazovky
*/
void setValid()
{
m_invalid = false;
}
/**
* Zrusi priznak pro prekresleni obrazovky
*/
void setInvalid()
{
m_invalid = true;
}
private:
bool m_invalid;
Adafruit_GFX* m_tft;
};