XPPlanes
X-Plane plugin to display additional planes based on network data
Classes | Functions | Variables
main.cpp File Reference

Plugin main entry points. More...

#include "XPPlanes.h"

Classes

struct  CmdMenuDefTy
 Command definition per menu item. More...
 

Functions

PLUGIN_API int XPluginEnable (void)
 Enable actual functionality of the plugin. More...
 
PLUGIN_API void XPluginDisable (void)
 Disable functionality, cleanup runtime resources. More...
 
int CBIntPrefsFunc (const char *, [[maybe_unused]] const char *item, int defaultVal)
 
void ClientTryGetAI ()
 
void ClientCBRetryGetAI (void *)
 Callback for requesting TCAS: Maybe now we have a chance? More...
 
void ClientReleaseAI ()
 
void MenuUpdateCheckmarks ()
 Sets all menu checkmarks according to current status. More...
 
int CmdCallback (XPLMCommandRef cmdRef, XPLMCommandPhase inPhase, void *)
 Callback function for menu. More...
 
float FlightLoop_Callback (float, float, int, void *)
 Regular tasks, called by flight loop. More...
 
PLUGIN_API int XPluginStart (char *outName, char *outSig, char *outDesc)
 X-Plane plugin standard startup function. More...
 
PLUGIN_API void XPluginStop (void)
 Properly shutdown the plugin, cleanup last resources. More...
 
PLUGIN_API void XPluginReceiveMessage (XPLMPluginID inFrom, int inMsg, void *)
 Process the message that some other plugin wants TCAS control. More...
 

Variables

constexpr std::uintptr_t MENU_ACTIVE = 0
 
constexpr std::uintptr_t MENU_TCAS = 1
 
struct CmdMenuDefTy CMD_MENU_DEF [2]
 
XPLMFlightLoopID flId = nullptr
 ID of our flight loop callback for regular tasks. More...
 

Detailed Description

Plugin main entry points.

Has the mandatory X-Plane interface functions XPlugin...

Author
Birger Hoppe

Class Documentation

◆ CmdMenuDefTy

struct CmdMenuDefTy

Command definition per menu item.

Class Members
const char * cmdName command's name
const char * description human-readable command description
XPLMCommandRef hCmd command reference assigned by X-Plane
const char * menuName (initial) menu item's name

Function Documentation

◆ CBIntPrefsFunc()

int CBIntPrefsFunc ( const char *  ,
[[maybe_unused] ] const char *  item,
int  defaultVal 
)

This is a callback the XPMP2 calls regularly to learn about configuration settings. Only 3 are left, all of them integers.

◆ ClientCBRetryGetAI()

void ClientCBRetryGetAI ( void *  )

Callback for requesting TCAS: Maybe now we have a chance?

◆ ClientReleaseAI()

void ClientReleaseAI ( )

◆ ClientTryGetAI()

void ClientTryGetAI ( )

◆ CmdCallback()

int CmdCallback ( XPLMCommandRef  cmdRef,
XPLMCommandPhase  inPhase,
void *   
)

Callback function for menu.

◆ FlightLoop_Callback()

float FlightLoop_Callback ( float  ,
float  ,
int  ,
void *   
)

Regular tasks, called by flight loop.

◆ MenuUpdateCheckmarks()

void MenuUpdateCheckmarks ( )

Sets all menu checkmarks according to current status.

◆ XPluginDisable()

PLUGIN_API void XPluginDisable ( void  )

Disable functionality, cleanup runtime resources.

See also
https://developer.x-plane.com/article/developing-plugins/#XPluginDisable

◆ XPluginEnable()

PLUGIN_API int XPluginEnable ( void  )

Enable actual functionality of the plugin.

See also
https://developer.x-plane.com/article/developing-plugins/#XPluginEnable

◆ XPluginReceiveMessage()

PLUGIN_API void XPluginReceiveMessage ( XPLMPluginID  inFrom,
int  inMsg,
void *   
)

Process the message that some other plugin wants TCAS control.

See also
https://developer.x-plane.com/article/developing-plugins/#XPluginReceiveMessage

◆ XPluginStart()

PLUGIN_API int XPluginStart ( char *  outName,
char *  outSig,
char *  outDesc 
)

X-Plane plugin standard startup function.

See also
https://developer.x-plane.com/article/developing-plugins/#XPluginStart

◆ XPluginStop()

PLUGIN_API void XPluginStop ( void  )

Properly shutdown the plugin, cleanup last resources.

See also
https://developer.x-plane.com/article/developing-plugins/#XPluginStop

Variable Documentation

◆ CMD_MENU_DEF

struct CmdMenuDefTy CMD_MENU_DEF[2]
Initial value:
= {
{ XPPLANES "/Activate", "Active", "Toggle if " XPPLANES " shall display planes" },
{ XPPLANES "/TCAS", "TCAS Control", "Toggle if " XPPLANES " shall have TCAS control" },
}
#define XPPLANES
Definition: Constants.h:23

◆ flId

XPLMFlightLoopID flId = nullptr

ID of our flight loop callback for regular tasks.

◆ MENU_ACTIVE

constexpr std::uintptr_t MENU_ACTIVE = 0
constexpr

◆ MENU_TCAS

constexpr std::uintptr_t MENU_TCAS = 1
constexpr