1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
/***************************************************************************
* XPLMPlugin
***************************************************************************/
/*
* These APIs provide facilities to find and work with other plugins and
* manage other plugins.
*
*/
extern "C"
/* This message is sent to your plugin whenever a plane is unloaded. The *
* parameter contains the index number of the plane being unloaded; 0 *
* indicates the user's plane. The parameter is of type int, passed as the *
* value of the pointer. (That is: the parameter is an int, not a pointer to *
* an int.) */
/* XPLM200 */
/* This message is sent to your plugin right before X-Plane writes its *
* preferences file. You can use this for two purposes: to write your own *
* preferences, and to modify any datarefs to influence preferences output. *
* For example, if your plugin temporarily modifies saved preferences, you can*
* put them back to their default values here to avoid having the tweaks be *
* persisted if your plugin is not loaded on the next invocation of X-Plane. *
* The parameter is ignored. */
/* XPLM210 */
/* This message is sent to your plugin right after a livery is loaded for an *
* airplane. You can use this to check the new livery (via datarefs) and *
* react accordingly. The parameter contains the index number of the aircraft*
* whose livery is changing. */
/* XPLM210 */
/* Sent to your plugin right before X-Plane enters virtual reality mode (at *
* which time any windows that are not positioned in VR mode will no longer be*
* visible to the user). The parameter is unused and should be ignored. */
/* XPLM301 */
/* Sent to your plugin right before X-Plane leaves virtual reality mode (at *
* which time you may want to clean up windows that are positioned in VR *
* mode). The parameter is unused and should be ignored. */
/* XPLM301 */
/* Sent to your plugin if another plugin wants to take over AI planes. If you *
* are a synthetic traffic provider, that probably means a plugin for an *
* online network has connected and wants to supply aircraft flown by real *
* humans and you should cease to provide synthetic traffic. If however you *
* are providing online traffic from real humans, you probably don't want to *
* disconnect, in which case you just ignore this message. The sender is the *
* plugin ID of the plugin asking for control of the planes now. You can use *
* it to find out who is requesting and whether you should yield to them. *
* Synthetic traffic providers should always yield to online networks. The *
* parameter is unused and should be ignored. */
/* XPLM303 */
/* Sent to your plugin after FMOD sound banks are loaded. The parameter is the*
* XPLMBankID enum in XPLMSound.h, 0 for the master bank and 1 for the radio *
* bank. */
/* XPLM400 */
/* Sent to your plugin before FMOD sound banks are unloaded. Any associated *
* resources should be cleaned up at this point. The parameter is the *
* XPLMBankID enum in XPLMSound.h, 0 for the master bank and 1 for the radio *
* bank. */
/* XPLM400 */
/* Sent to your plugin per-frame (at-most) when/if datarefs are added. It will*
* include the new data ref total count so that your plugin can keep a local *
* cache of the total, see what's changed and know which ones to inquire about*
* if it cares. *
* *
* This message is only sent to plugins that enable the *
* XPLM_WANTS_DATAREF_NOTIFICATIONS feature. */
/* XPLM400 */
/*
* XPLMSendMessageToPlugin
*
* This function sends a message to another plug-in or X-Plane. Pass
* XPLM_NO_PLUGIN_ID to broadcast to all plug-ins. Only enabled plug-ins with
* a message receive function receive the message.
*
*/
XPLM_API void ;
/***************************************************************************
* Plugin Features API
***************************************************************************/
/*
* The plugin features API allows your plugin to "sign up" for additional
* capabilities and plugin system features that are normally disabled for
* backward compatibility or performance. This allows advanced plugins to
* "opt-in" to new behavior.
*
* Each feature is defined by a permanent string name. The feature string
* names will vary with the particular installation of X-Plane, so plugins
* should not expect a feature to be guaranteed present.
*
* XPLM_WANTS_REFLECTIONS
* ----------------------
*
* Available in the SDK 2.0 and later for X-Plane 9, enabling this capability
* causes your plugin to receive drawing hook callbacks when X-Plane builds
* its off-screen reflection and shadow rendering passes. Plugins should
* enable this and examine the dataref sim/graphics/view/plane_render_type to
* determine whether the drawing callback is for a reflection, shadow
* calculation, or the main screen. Rendering can be simlified or omitted for
* reflections, and non-solid drawing should be skipped for shadow
* calculations.
*
* **Note**: direct drawing via draw callbacks is not recommended; use the
* XPLMInstance API to create object models instead.
*
* XPLM_USE_NATIVE_PATHS
* ---------------------
*
* available in the SDK 2.1 and later for X-Plane 10, this modifies the plugin
* system to use Unix-style paths on all operating systems. With this enabled:
*
* * OS X paths will match the native OS X Unix.
* * Windows will use forward slashes but preserve C:\ or another drive letter
* when using complete file paths.
* * Linux uses its native file system path scheme.
*
* Without this enabled:
*
* * OS X will use CFM file paths separated by a colon.
* * Windows will use back-slashes and conventional DOS paths.
* * Linux uses its native file system path scheme.
*
* All plugins should enable this feature on OS X to access the native file
* system.
*
* XPLM_USE_NATIVE_WIDGET_WINDOWS
* ------------------------------
*
* Available in the SDK 3.0.2 SDK, this capability tells the widgets library
* to use new, modern X-Plane backed XPLMDisplay windows to anchor all widget
* trees. Without it, widgets will always use legacy windows.
*
* Plugins should enable this to allow their widget hierarchies to respond to
* the user's UI size settings and to map widget-based windwos to a VR HMD.
*
* Before enabling this, make sure any custom widget code in your plugin is
* prepared to cope with the UI coordinate system not being th same as the
* OpenGL window coordinate system.
*
* XPLM_WANTS_DATAREF_NOTIFICATIONS
* --------------------------------
*
* Available in the SDK 4.0.0, this capability tells X-Plane to to send the
* enabling plugin the new XPLM_MSG_DATAREFS_ADDED message any time new
* datarefs are added. The SDK will coalesce consecutive dataref registrations
* to minimize the number of messages sent.
*
*/
/*
* XPLMFeatureEnumerator_f
*
* You pass an XPLMFeatureEnumerator_f to get a list of all features supported
* by a given version running version of X-Plane. This routine is called once
* for each feature.
*
*/
typedef void ;
/*
* XPLMHasFeature
*
* This returns 1 if the given installation of X-Plane supports a feature, or
* 0 if it does not.
*
*/
XPLM_API int ;
/*
* XPLMIsFeatureEnabled
*
* This returns 1 if a feature is currently enabled for your plugin, or 0 if
* it is not enabled. It is an error to call this routine with an unsupported
* feature.
*
*/
XPLM_API int ;
/*
* XPLMEnableFeature
*
* This routine enables or disables a feature for your plugin. This will
* change the running behavior of X-Plane and your plugin in some way,
* depending on the feature.
*
*/
XPLM_API void ;
/*
* XPLMEnumerateFeatures
*
* This routine calls your enumerator callback once for each feature that this
* running version of X-Plane supports. Use this routine to determine all of
* the features that X-Plane can support.
*
*/
XPLM_API void ;
/* XPLM200 */
}