-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtetrixwindow.h
More file actions
54 lines (45 loc) · 983 Bytes
/
tetrixwindow.h
File metadata and controls
54 lines (45 loc) · 983 Bytes
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
#ifndef TETRIXWINDOW_H
#define TETRIXWINDOW_H
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <poll.h>
#include <stdlib.h>
#include <errno.h>
#include <signal.h>
#include <sys/epoll.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <QWidget>
#include <QTimer>
#include <QDebug>
#define SYSFS_GPIO_DIR "/sys/class/gpio"
#define MAX_BUF 256
QT_BEGIN_NAMESPACE
class QLCDNumber;
class QLabel;
class QPushButton;
QT_END_NAMESPACE
class TetrixBoard;
class TetrixWindow : public QWidget
{
Q_OBJECT
public:
TetrixWindow(QWidget *parent = nullptr);
int getGpioValue(unsigned int gpio);
public slots:
void refreshGPIO();
protected:
bool eventFilter(QObject *obj, QEvent *event);
private:
QLabel *createLabel(const QString &text);
TetrixBoard *board;
QLabel *nextPieceLabel;
QLCDNumber *scoreLcd;
QLCDNumber *levelLcd;
QLCDNumber *linesLcd;
QTimer *portTimer;
};
#endif