-
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathpins.h
More file actions
42 lines (41 loc) · 871 Bytes
/
Copy pathpins.h
File metadata and controls
42 lines (41 loc) · 871 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
#pragma once
#include <QObject>
#include "submodules/Ardwiino/src/shared/config/config.h"
#define PIN_PROP(f) Q_PROPERTY(uint8_t p_##f MEMBER f)
class Pins: pins_t
{
Q_GADGET
PIN_PROP(up)
PIN_PROP(down)
PIN_PROP(left)
PIN_PROP(right)
PIN_PROP(start)
PIN_PROP(back)
PIN_PROP(left_stick)
PIN_PROP(right_stick)
PIN_PROP(LB)
PIN_PROP(RB)
PIN_PROP(home)
PIN_PROP(unused)
PIN_PROP(a)
PIN_PROP(b)
PIN_PROP(x)
PIN_PROP(y)
PIN_PROP(lt)
PIN_PROP(rt)
PIN_PROP(l_x)
PIN_PROP(l_y)
PIN_PROP(r_x)
PIN_PROP(r_y)
public:
inline bool operator==(const Pins &other) const
{
// compare members
return up == other.up && down == other.down;
}
inline bool operator!=(Pins const &other) const
{
return !(*this == other);
}
};
Q_DECLARE_METATYPE(Pins)