-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobal.h
More file actions
133 lines (100 loc) · 2.73 KB
/
global.h
File metadata and controls
133 lines (100 loc) · 2.73 KB
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#ifndef GLOBAL_H
#define GLOBAL_H
#include <QWidget>
#include <QApplication>
#include <QGamepadManager>
#include <QGamepad>
#include <QtEndian>
#include <QUdpSocket>
#include <QFormLayout>
#include <QVBoxLayout>
#include <QLineEdit>
#include <QPushButton>
#include <QCheckBox>
#include <QDialog>
#include <QSettings>
#include <QMouseEvent>
#include <QCloseEvent>
#include <QFileDialog>
#include <QLabel>
#include <QSlider>
#include <QThread>
#include <QMetaObject>
#include "gpconfigurator.h"
#include "settings.h"
#include "shortcut.h"
#define TOUCH_SCREEN_WIDTH 320
#define TOUCH_SCREEN_HEIGHT 240
extern int CPAD_BOUND;
extern int CPP_BOUND;
extern Settings btnSettings;
typedef uint32_t u32;
typedef uint16_t u16;
typedef uint8_t u8;
int appScreenTo3dsX(int);
int appScreenTo3dsY(int);
struct TouchButton
{
int x, y;
};
extern std::vector<ShortCut> listShortcuts;
QGamepadManager::GamepadButton variantToButton(QVariant variant);
ShortCut variantToShortCut(QVariant variant);
extern int id, fid;
extern QSettings settings;
extern QGamepadManager::GamepadButtons buttons;
extern u32 interfaceButtons;
extern int yAxisMultiplier, yAxisMultiplierCpp;
extern QString ipAddress;
extern bool timerEnabled;
extern GamepadConfigurator *gpConfigurator;
extern bool touchScreenPressed;
extern QSize touchScreenSize;
extern QPoint touchScreenPosition;
extern double tsRatio;
extern QGamepadManager::GamepadButton homeButton;
extern QGamepadManager::GamepadButton powerButton;
extern QGamepadManager::GamepadButton powerLongButton;
extern QGamepadManager::GamepadButton touchButton1;
extern QGamepadManager::GamepadButton touchButton2;
extern QGamepadManager::GamepadButton touchButton3;
extern QGamepadManager::GamepadButton touchButton4;
extern TouchButton tbOne, tbTwo, tbThree, tbFour;
extern QGamepadManager::GamepadButton hidButtonsAB[2];
extern QGamepadManager::GamepadButton hidButtonsMiddle[8];
extern QGamepadManager::GamepadButton hidButtonsXY[2];
extern QGamepadManager::GamepadButton irButtons[2];
struct MyAxis
{
double x, y;
};
class Worker : public QObject {
Q_OBJECT
public:
MyAxis getLeftAxis();
MyAxis getRightAxis();
MyAxis getPreviousLAxis();
void setLeftAxis(double x, double y);
void setRightAxis(double x, double y);
void setPreviousLAxis(double x, double y);
void closeThread() { emit finished(); }
/*explicit Worker(QObject *parent = 0) : QObject(parent)
{
previousLeftAxis.x = leftAxis.x;
previousLeftAxis.y = leftAxis.y;
}*/
~Worker()
{
}
public slots:
void sendFrame();
signals:
void finished();
void error(QString err);
private:
MyAxis leftAxis;
MyAxis rightAxis;
MyAxis previousLeftAxis;
};
extern Worker worker;
#endif // GLOBAL_H