12 #include <XPLM/XPLMPlanes.h>
13 #include <XPLM/XPLMPlugin.h>
18 # define XPLM_MSG_LIVERY_LOADED 108
23 PLUGIN_API
int XPluginStart(
char *o_name,
char *o_sig,
char *o_desc)
27 XPLMEnableFeature(
"XPLM_USE_NATIVE_PATHS", 1);
30 INFO_LOG(
"xswiftbus plugin starting");
31 std::strcpy(o_name,
"xswiftbus");
32 std::strcpy(o_sig,
"org.swift-project.xswiftbus");
33 std::strcpy(o_desc,
"Allows swift to connect to X-Plane via D-Bus IPC");
37 PLUGIN_API
void XPluginStop()
42 PLUGIN_API
int XPluginEnable()
48 PLUGIN_API
void XPluginDisable() {
delete g_plugin; }
50 PLUGIN_API
void XPluginReceiveMessage(XPLMPluginID from,
long msg,
void *param)
52 if (from == XPLM_PLUGIN_XPLANE)
56 WARNING_LOG(
"Received message, but plugin NOT running");
62 case XPLM_MSG_PLANE_LOADED:
63 case XPLM_MSG_LIVERY_LOADED:
void onSceneryLoaded()
Called by XPluginReceiveMessage when some scenery is loaded.
void onAircraftRepositioned()
Called by XPluginReceiveMessage when the aircraft is positioned at an airport.
void onAircraftModelChanged()
Called by XPluginReceiveMessage when the model is changed.
bool isRunning() const
Is running.
#define INFO_LOG(msg)
Logger convenience macros.
#define WARNING_LOG(msg)
Logger convenience macros.