diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-12-12 16:16:36 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-12-12 17:28:24 +0100 |
commit | c503daf6c6b99beb7d811c952fd52d763aa008ca (patch) | |
tree | 0a3a5181829c7b4d68a100696d7d66be94931607 /proto-wine/ftnoir_protocol_wine.h | |
parent | fe0bbcc24ae2d0916135a8f7553ee46c9b463b44 (diff) |
proto/wine: fixes
- use SDK_WINE boolean
- improve logic when building for X-Plane only
- rename when building for X-Plane
- conditionalize Wine-related stuff
- move starting the wrapper to initialize() as it should be done
- use more C++17
- update header usage
Diffstat (limited to 'proto-wine/ftnoir_protocol_wine.h')
-rw-r--r-- | proto-wine/ftnoir_protocol_wine.h | 37 |
1 files changed, 25 insertions, 12 deletions
diff --git a/proto-wine/ftnoir_protocol_wine.h b/proto-wine/ftnoir_protocol_wine.h index 19b905e7..b4cbd305 100644 --- a/proto-wine/ftnoir_protocol_wine.h +++ b/proto-wine/ftnoir_protocol_wine.h @@ -1,16 +1,16 @@ #pragma once -#include "ui_ftnoir_winecontrols.h" -#include <QMessageBox> -#include <QProcess> -#include <QDebug> -#include <QMutex> -#include <QMutexLocker> -#include <QFile> #include "api/plugin-api.hpp" #include "compat/shm.h" #include "wine-shm.h" -#include "compat/tr.hpp" + +#include "ui_ftnoir_winecontrols.h" + +#include <QString> +#include <QProcess> +#include <QMutex> + +#include <QDebug> class wine : TR, public IProtocol { @@ -25,21 +25,29 @@ public: QString game_name() override { +#ifndef OTR_WINE_NO_WRAPPER QMutexLocker foo(&game_name_mutex); return connected_game; +#else + return QStringLiteral("X-Plane"); +#endif } private: - shm_wrapper lck_shm; - WineSHM* shm; + shm_wrapper lck_shm { WINE_SHM_NAME, WINE_MTX_NAME, sizeof(WineSHM) }; + WineSHM* shm = nullptr; + +#ifndef OTR_WINE_NO_WRAPPER QProcess wrapper; - int gameid; + int gameid = 0; QString connected_game; QMutex game_name_mutex; +#endif }; class FTControls: public IProtocolDialog { Q_OBJECT + public: FTControls(); void register_protocol(IProtocol *) override {} @@ -53,11 +61,16 @@ private slots: void doCancel(); }; -class wineDll : public Metadata +class wine_metadata : public Metadata { Q_OBJECT public: +#ifndef OTR_WINE_NO_WRAPPER QString name() override { return tr("Wine -- Windows layer for Unix"); } QIcon icon() override { return QIcon(":/images/wine.png"); } +#else + QString name() override { return tr("X-Plane"); } + QIcon icon() override { return {}; } +#endif }; |