refs #248 replaced CStub with CPlugin

This commit is contained in:
Mathew Sutcliffe
2014-06-14 20:20:14 +01:00
parent 66bcea8e20
commit 13f9d8c343
3 changed files with 42 additions and 22 deletions

View File

@@ -3,12 +3,13 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#define NOMINMAX
#define _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS
#include "stub.h" #include "plugin.h"
#include "utils.h" #include "utils.h"
QSharedPointer<QApplication> g_qApp; QSharedPointer<QApplication> g_qApp;
XBus::CStub *g_stub; XBus::CPlugin *g_plugin;
PLUGIN_API int XPluginStart(char *o_name, char *o_sig, char *o_desc) PLUGIN_API int XPluginStart(char *o_name, char *o_sig, char *o_desc)
{ {
@@ -27,13 +28,13 @@ PLUGIN_API int XPluginEnable()
QXPlaneMessageHandler::install(); QXPlaneMessageHandler::install();
g_qApp = QSharedApplication::sharedInstance(); g_qApp = QSharedApplication::sharedInstance();
QXPlaneEventLoop::exec(); QXPlaneEventLoop::exec();
g_stub = new XBus::CStub; g_plugin = new XBus::CPlugin;
return 1; return 1;
} }
PLUGIN_API void XPluginDisable() PLUGIN_API void XPluginDisable()
{ {
delete g_stub; delete g_plugin;
g_qApp.reset(); g_qApp.reset();
} }

View File

@@ -3,25 +3,13 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef BLACKSIM_XBUS_STUB_H #include "plugin.h"
#define BLACKSIM_XBUS_STUB_H
/*!
* \file
*/
/*!
* \namespace XBus
*/
namespace XBus namespace XBus
{ {
/*!
* stub
*/
class CStub
{
};
}
#endif // guard CPlugin::CPlugin()
{
}
}

31
src/xbus/plugin.h Normal file
View File

@@ -0,0 +1,31 @@
/* Copyright (C) 2013 VATSIM Community / contributors
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef BLACKSIM_XBUS_PLUGIN_H
#define BLACKSIM_XBUS_PLUGIN_H
//! \file
//! \namespace XBus
#include <QObject>
namespace XBus
{
/*!
* Main plugin class
*/
class CPlugin : public QObject
{
Q_OBJECT
public:
CPlugin();
private:
};
}
#endif // guard