mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 02:35:38 +08:00
refs #248 replaced CStub with CPlugin
This commit is contained in:
@@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
31
src/xbus/plugin.h
Normal 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
|
||||||
Reference in New Issue
Block a user