]> Shamusworld >> Repos - virtualjaguar/blob - src/gui/profile.h
Replace QtGui includes with QtWidgets, add QT += widgets for qmake
[virtualjaguar] / src / gui / profile.h
1 #ifndef __PROFILE_H__
2 #define __PROFILE_H__
3
4 #include <QtWidgets>
5 #include <stdint.h>
6
7 class QComboBox;
8 class QSettings;
9
10 #define MAX_PROFILES  64                // 64 profiles ought to be enough for everybody
11 #define CONTROLLER1   0x01
12 #define CONTROLLER2   0x02
13
14
15 struct Profile
16 {
17         int device;                                     // Host device number (-1 == invalid profile)
18         char mapName[32];                       // Human readable map name
19         int preferredSlot;                      // CONTROLLER1 and/or CONTROLLER2
20         uint32_t map[21];                       // Keys/buttons/axes
21 };
22
23
24 // Function prototypes
25 void SaveProfiles(void);
26 void RestoreProfiles(void);
27 void ReadProfiles(QSettings *);
28 void WriteProfiles(QSettings *);
29 int GetFreeProfile(void);
30 void DeleteProfile(int);
31 int FindDeviceNumberForName(const char *);
32 int FindMappingsForDevice(int, QComboBox *);
33 int FindUsableProfiles(QComboBox *);
34 bool ConnectProfileToController(int, int);
35 void AutoConnectProfiles(void);
36
37
38 // Exported variables
39 extern Profile profile[];
40 extern int controller1Profile;
41 extern int controller2Profile;
42 extern int gamepadIDSlot1;
43 extern int gamepadIDSlot2;
44 //extern int numberOfProfiles;
45
46 #endif  // __PROFILE_H__
47