diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2014-01-03 11:22:06 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2014-01-03 11:22:06 +0100 |
commit | a3df0c8a8d19655040c7d21812414d7a335def61 (patch) | |
tree | 6739401d8e59800731b2faf26e49b8df63664573 /ftnoir_protocol_sc/ftnoir_protocol_sc.h | |
parent | 7307adbc3b8ec2213bc90a91deb1beb9198e7ff2 (diff) | |
parent | 519434cd1abb8991635487c6d84bc0d85367fc42 (diff) |
Merge branch 'feature/settings-template'
Conflicts:
README.md
Diffstat (limited to 'ftnoir_protocol_sc/ftnoir_protocol_sc.h')
-rw-r--r-- | ftnoir_protocol_sc/ftnoir_protocol_sc.h | 65 |
1 files changed, 23 insertions, 42 deletions
diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc.h b/ftnoir_protocol_sc/ftnoir_protocol_sc.h index e17cabb5..a13c0097 100644 --- a/ftnoir_protocol_sc/ftnoir_protocol_sc.h +++ b/ftnoir_protocol_sc/ftnoir_protocol_sc.h @@ -27,8 +27,6 @@ * must be treated as such... * ********************************************************************************/ #pragma once -#ifndef INCLUDED_SCSERVER_H -#define INCLUDED_SCSERVER_H #undef _WIN32_WINNT #define _WIN32_WINNT 0x0502 #include "facetracknoir/global-settings.h" @@ -48,7 +46,8 @@ #include <QProcess> #include <QDebug> #include <QFile> -//#include "math.h" +#include "facetracknoir/options.h" +using namespace options; typedef HRESULT (WINAPI *importSimConnect_Open)(HANDLE * phSimConnect, LPCSTR szName, HWND hWnd, DWORD UserEventWin32, HANDLE hEventHandle, DWORD ConfigIndex); typedef HRESULT (WINAPI *importSimConnect_Close)(HANDLE hSimConnect); @@ -77,6 +76,15 @@ enum INPUT_ID INPUT0=0, }; +struct settings { + pbundle b; + value<int> sxs_manifest; + settings() : + b(bundle("proto-simconnect")), + sxs_manifest(b, "sxs-manifest-version", 0) + {} +}; + class FTNoIR_Protocol : public IProtocol { public: @@ -87,11 +95,7 @@ public: QString getGameName() { return "FS2004/FSX"; } - private: - // Private properties - QString ProgramName; - static float virtSCPosX; static float virtSCPosY; static float virtSCPosZ; @@ -121,7 +125,7 @@ private: static HANDLE hSimConnect; // Handle to SimConnect static void CALLBACK processNextSimconnectEvent(SIMCONNECT_RECV* pData, DWORD cbData, void *pContext); - void loadSettings(); + settings s; }; // Widget that has controls for FTNoIR protocol client-settings. @@ -129,31 +133,15 @@ class SCControls: public QWidget, public IProtocolDialog { Q_OBJECT public: - - explicit SCControls(); - virtual ~SCControls(); - void showEvent ( QShowEvent * event ); - void Initialize(QWidget *parent); - void registerProtocol(IProtocol *protocol) { - theProtocol = (FTNoIR_Protocol *) protocol; // Accept the pointer to the Protocol - } - void unRegisterProtocol() { - theProtocol = NULL; // Reset the pointer - } - + SCControls(); + void registerProtocol(IProtocol *protocol) {} + void unRegisterProtocol() {} private: - Ui::UICSCControls ui; - void loadSettings(); - void save(); - - /** helper **/ - bool settingsDirty; - FTNoIR_Protocol *theProtocol; - + Ui::UICSCControls ui; + settings s; private slots: - void doOK(); - void doCancel(); - void settingChanged() { settingsDirty = true; }; + void doOK(); + void doCancel(); }; //******************************************************************************************************* @@ -162,15 +150,8 @@ private slots: class FTNoIR_ProtocolDll : public Metadata { public: - FTNoIR_ProtocolDll(); - ~FTNoIR_ProtocolDll(); - - void getFullName(QString *strToBeFilled) { *strToBeFilled = QString("FSX SimConnect"); }; - void getShortName(QString *strToBeFilled) { *strToBeFilled = QString("SimConnect"); }; - void getDescription(QString *strToBeFilled) { *strToBeFilled = QString("Microsoft SimConnect protocol"); }; - - void getIcon(QIcon *icon) { *icon = QIcon(":/images/fsx.png"); }; + void getFullName(QString *strToBeFilled) { *strToBeFilled = QString("FSX SimConnect"); } + void getShortName(QString *strToBeFilled) { *strToBeFilled = QString("SimConnect"); } + void getDescription(QString *strToBeFilled) { *strToBeFilled = QString("Microsoft SimConnect protocol"); } + void getIcon(QIcon *icon) { *icon = QIcon(":/images/fsx.png"); } }; - -#endif//INCLUDED_SCSERVER_H -//END |