diff --git a/.github/actions/build-mac/action.yml b/.github/actions/build-mac/action.yml index 743bf2b..2d38916 100644 --- a/.github/actions/build-mac/action.yml +++ b/.github/actions/build-mac/action.yml @@ -26,10 +26,6 @@ outputs: runs: using: "composite" steps: - - name: Install required libs - shell: bash - run: | - brew install ninja - name: Prepare shell: bash run: | diff --git a/.github/actions/upload-plugin/action.yml b/.github/actions/upload-plugin/action.yml index 788b5e9..d0dfe78 100644 --- a/.github/actions/upload-plugin/action.yml +++ b/.github/actions/upload-plugin/action.yml @@ -28,7 +28,7 @@ runs: mv "${{ inputs.pdbFileName }}" "deploy-${{ inputs.pluginName }}/${{ inputs.pluginName }}/${{ inputs.archFolder }}" fi - name: Upload plugin - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: ${{ inputs.pluginName }}-${{ env.platform }} path: deploy-${{ inputs.pluginName }}/* # this way the top folder in the artifacts is "MyPlugin" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c934085..7a8a231 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: platform: lin steps: - name: Checkout Code - uses: actions/checkout@v4 # must checkout before we can use our own actions + uses: actions/checkout@v5 # must checkout before we can use our own actions - name: Build uses: ./.github/actions/build-lin id: build @@ -43,7 +43,7 @@ jobs: platform: mac steps: - name: Checkout Code - uses: actions/checkout@v4 # must checkout before we can use our own actions + uses: actions/checkout@v5 # must checkout before we can use our own actions - name: Build uses: ./.github/actions/build-mac id: build @@ -83,9 +83,11 @@ jobs: # Windows with MS Visual Studio build-win: runs-on: windows-2022 + env: + platform: win steps: - name: Checkout Code - uses: actions/checkout@v4 # must checkout before we can use our own actions + uses: actions/checkout@v5 # must checkout before we can use our own actions - name: Build uses: ./.github/actions/build-win id: build diff --git a/.gitignore b/.gitignore index 421527b..40f582a 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ # Build directories build*/* Example/build*/* +Example/out/* # XCode user specific files xcuserdata/ diff --git a/Example/CMakeLists.txt b/Example/CMakeLists.txt index bd7fc26..321a01f 100644 --- a/Example/CMakeLists.txt +++ b/Example/CMakeLists.txt @@ -23,7 +23,7 @@ endif() set(CMAKE_BUILD_TYPE RelWithDebInfo) -project(LT_API VERSION 1.3.0 DESCRIPTION "LiveTraffic API Example Plugin") +project(LT_API VERSION 1.4.0 DESCRIPTION "LiveTraffic API Example Plugin") set(CMAKE_CXX_STANDARD 17) set_property(GLOBAL PROPERTY CXX_STANDARD_REQUIRED 17) @@ -32,7 +32,6 @@ set_property(GLOBAL PROPERTY CXX_STANDARD 17) # Set include directories used by our code and dependencies. include_directories("${CMAKE_CURRENT_SOURCE_DIR}/..") include_directories("${CMAKE_CURRENT_SOURCE_DIR}") -include_directories("${CMAKE_SOURCE_DIR}/Lib/SDK/CHeaders/Widgets") include_directories("${CMAKE_SOURCE_DIR}/Lib/SDK/CHeaders/Wrappers") include_directories("${CMAKE_SOURCE_DIR}/Lib/SDK/CHeaders/XPLM") @@ -72,27 +71,25 @@ else() add_compile_options(-fvisibility=hidden) endif() - # Debug vs Release build if(CMAKE_BUILD_TYPE MATCHES "Debug") add_compile_definitions(DEBUG=1) if (MSVC) add_compile_options(/Zi) else() - add_compile_options(-O0 -g) + add_compile_options(-O0 -g -fPIC) endif() else() add_compile_definitions(NDEBUG=1) if(MSVC) # Use highest optimization level in Release builds - add_compile_options(/GL) + add_compile_options(/MD /Zi /GL- /O2) else() - # Use position-independent code and highest optimization level - add_compile_options(-O3 -fPIC) + # Use position-independent code and highest optimization level plus some minimal debug info for stack traces + add_compile_options(-O3 -fPIC -g1) endif() endif() - ################################################################################ # Source groups ################################################################################ @@ -111,8 +108,6 @@ set(ALL_FILES ${Header_Files} ${Source_Files}) add_library(LT_API SHARED ${ALL_FILES}) -target_compile_features(LT_API PUBLIC cxx_std_11) - if (APPLE) # X-Plane supports OS X 10.10+, so this should ensure FlyWithLua can run on # all supported versions. @@ -132,8 +127,7 @@ endif( OpenGL_FOUND ) # Link X-Plane plugin system libraries. They are only provided for OS X and Windows. if (WIN32 OR APPLE) find_library(XPLM_LIBRARY NAMES XPLM XPLM_64.lib) -# find_library(XPWIDGETS_LIBRARY NAMES XPWidgets XPWidgets_64.lib) # not needed if not using X-Plane's widgets - target_link_libraries(LT_API ${XPLM_LIBRARY} ${XPWIDGETS_LIBRARY}) + target_link_libraries(LT_API ${XPLM_LIBRARY}) endif () @@ -166,7 +160,7 @@ elseif (APPLE) # conflict with other plugins, in particular ones with Lua interpreter # embedded. target_link_libraries(LT_API "-exported_symbols_list ${CMAKE_SOURCE_DIR}/LTAPIExample.sym_mac") - target_link_libraries(LT_API "-framework XPLM -framework XPWidgets -ldl") + target_link_libraries(LT_API "-framework XPLM -ldl") elseif (UNIX) # Specify additional runtime search laths for dynamically-linked libraries. # Restrict set of symbols exported from the plugin. This reduces chances of diff --git a/Example/CMakeSettings.json b/Example/CMakeSettings.json new file mode 100644 index 0000000..af2df66 --- /dev/null +++ b/Example/CMakeSettings.json @@ -0,0 +1,26 @@ +{ + "configurations": [ + { + "name": "x64-Debug", + "generator": "Ninja", + "configurationType": "Debug", + "inheritEnvironments": [ "msvc_x64_x64" ], + "buildRoot": "${projectDir}\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeCommandArgs": "", + "buildCommandArgs": "", + "ctestCommandArgs": "" + }, + { + "name": "x64-Release", + "generator": "Ninja", + "configurationType": "RelWithDebInfo", + "buildRoot": "${projectDir}\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeCommandArgs": "", + "buildCommandArgs": "", + "ctestCommandArgs": "", + "inheritEnvironments": [ "msvc_x64_x64" ] + } + ] +} \ No newline at end of file diff --git a/Example/LTAPI.sln b/Example/LTAPI.sln deleted file mode 100644 index 25a4a14..0000000 --- a/Example/LTAPI.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28307.572 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LTAPI", "LTAPI.vcxproj", "{CB03F7CE-9AF4-46A8-8C1D-23FD21ADCDBD}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {CB03F7CE-9AF4-46A8-8C1D-23FD21ADCDBD}.Debug|x64.ActiveCfg = Debug|x64 - {CB03F7CE-9AF4-46A8-8C1D-23FD21ADCDBD}.Debug|x64.Build.0 = Debug|x64 - {CB03F7CE-9AF4-46A8-8C1D-23FD21ADCDBD}.Release|x64.ActiveCfg = Release|x64 - {CB03F7CE-9AF4-46A8-8C1D-23FD21ADCDBD}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {9D125DC4-8D9D-4C1B-B2AF-ECED2718F021} - EndGlobalSection -EndGlobal diff --git a/Example/LTAPI.vcxproj b/Example/LTAPI.vcxproj deleted file mode 100644 index fa108cc..0000000 --- a/Example/LTAPI.vcxproj +++ /dev/null @@ -1,180 +0,0 @@ - - - - - Debug - x64 - - - Release - x64 - - - - - - - - - - - - - - - - - {CB03F7CE-9AF4-46A8-8C1D-23FD21ADCDBD} - 10.0.18362.0 - - - - DynamicLibrary - false - - - v141 - - - DynamicLibrary - false - - - v141 - - - - - - - - - - - - - - - build\$(Platform)\$(Configuration)\ - build\$(Platform)\$(Configuration)\ - false - .xpl - false - LTAPIExampleWin - - - build\$(Platform)\$(Configuration)\ - build\$(Platform)\$(Configuration)\ - false - .xpl - false - LTAPIExampleWin - - - - MultiThreadedDLL - Default - true - false - MaxSpeed - true - Level3 - ..;$(ProjectDir);Lib\SDK\CHeaders\Widgets;Lib\SDK\CHeaders\XPLM;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;_USRDLL;IBM=1;XPLM200=1;XPLM210=1;XPLM300=1;XPLM301=1;_CRT_SECURE_NO_WARNINGS;NDEBUG;%(PreprocessorDefinitions) - - - Default - Speed - - false - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\Hello-World-SDK-3.tlb - true - - - 0x0809 - NDEBUG;%(PreprocessorDefinitions) - - - true - - - true - true - Console - Lib\SDK\Libraries\Win;%(AdditionalLibraryDirectories) - XPLM_64.lib - NotSet - - - true - - - - - - - - - - - - - MultiThreadedDebugDLL - Default - false - Disabled - true - ProgramDatabase - ..;$(ProjectDir);Lib\SDK\CHeaders\Widgets;Lib\SDK\CHeaders\XPLM;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;_USRDLL;IBM=1;XPLM200=1;XPLM210=1;XPLM300=1;XPLM301=1;_CRT_SECURE_NO_WARNINGS;_DEBUG;DEBUG;%(PreprocessorDefinitions) - - - EnableFastChecks - Default - - false - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\Hello-World-SDK-3.tlb - true - - - 0x0809 - _DEBUG;%(PreprocessorDefinitions) - - - true - .\Debug\Hello-World-SDK-3.bsc - - - true - true - true - Console - Lib\SDK\Libraries\Win;%(AdditionalLibraryDirectories) - XPLM_64.lib - NotSet - true - - - true - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Example/LTAPI.vcxproj.user b/Example/LTAPI.vcxproj.user deleted file mode 100644 index be25078..0000000 --- a/Example/LTAPI.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Example/LTAPI.xcodeproj/project.pbxproj b/Example/LTAPI.xcodeproj/project.pbxproj index ca1530b..012bfd0 100755 --- a/Example/LTAPI.xcodeproj/project.pbxproj +++ b/Example/LTAPI.xcodeproj/project.pbxproj @@ -8,7 +8,6 @@ /* Begin PBXBuildFile section */ 254128992586A75C00C5197A /* XPLM.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 254128982586A75C00C5197A /* XPLM.framework */; }; - 2541289B2586A76D00C5197A /* XPWidgets.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2541289A2586A76D00C5197A /* XPWidgets.framework */; }; 254CCAB322666C2A003878B1 /* LTAPIExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 254CCAB222666C2A003878B1 /* LTAPIExample.cpp */; }; 254CCAB522666C3A003878B1 /* LTAPI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 254CCAB422666C3A003878B1 /* LTAPI.cpp */; }; D6A7BDAA16A1DEA200D1426A /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D6A7BDA916A1DEA200D1426A /* OpenGL.framework */; }; @@ -23,7 +22,6 @@ 254CCAB422666C3A003878B1 /* LTAPI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LTAPI.cpp; path = ../LTAPI.cpp; sourceTree = ""; }; 254CCAB622666C52003878B1 /* LTAPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LTAPI.h; path = ../LTAPI.h; sourceTree = ""; }; 25D4757422C8014900BF03D9 /* LTAPI.doxygen */ = {isa = PBXFileReference; lastKnownFileType = text; name = LTAPI.doxygen; path = ../LTAPI.doxygen; sourceTree = ""; }; - 25D4757522C8037900BF03D9 /* MainPage.dox */ = {isa = PBXFileReference; lastKnownFileType = text; name = MainPage.dox; path = ../MainPage.dox; sourceTree = ""; }; D607B19909A556E400699BC3 /* LTAPIExample.xpl */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = LTAPIExample.xpl; sourceTree = BUILT_PRODUCTS_DIR; }; D6A7BDA916A1DEA200D1426A /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; }; D6A7BDC016A1DEC000D1426A /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; @@ -34,7 +32,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 2541289B2586A76D00C5197A /* XPWidgets.framework in Frameworks */, 254128992586A75C00C5197A /* XPLM.framework in Frameworks */, D6A7BDC116A1DEC000D1426A /* CoreFoundation.framework in Frameworks */, D6A7BDAA16A1DEA200D1426A /* OpenGL.framework in Frameworks */, @@ -48,7 +45,6 @@ isa = PBXGroup; children = ( 253E8F9C22D29354008C70E8 /* README.md */, - 25D4757522C8037900BF03D9 /* MainPage.dox */, 25D4757422C8014900BF03D9 /* LTAPI.doxygen */, 254CCAB622666C52003878B1 /* LTAPI.h */, 254CCAB422666C3A003878B1 /* LTAPI.cpp */, @@ -103,7 +99,7 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; - LastUpgradeCheck = 1620; + LastUpgradeCheck = 2640; }; buildConfigurationList = D607B16209A5563100699BC3 /* Build configuration list for PBXProject "LTAPI" */; compatibilityVersion = "Xcode 3.2"; @@ -215,6 +211,7 @@ ); PRODUCT_NAME = "${TARGET_NAME}"; SDKROOT = macosx; + STRING_CATALOG_GENERATE_SYMBOLS = YES; SYMROOT = "build-mac"; XPLANE11_ROOT = "$(USER_APPS_DIR)/X-Plane/12"; XPSDK_ROOT = Lib/SDK; @@ -296,6 +293,7 @@ ); PRODUCT_NAME = "${TARGET_NAME}"; SDKROOT = macosx; + STRING_CATALOG_GENERATE_SYMBOLS = YES; SYMROOT = "build-mac"; XPLANE11_ROOT = "$(USER_APPS_DIR)/X-Plane/12"; XPSDK_ROOT = Lib/SDK; @@ -314,6 +312,7 @@ "$(inherited)", "$(PROJECT_DIR)/Lib/SDK/Libraries/Mac/XPLM.framework", ); + MACOSX_DEPLOYMENT_TARGET = 11.0; }; name = Debug; }; @@ -329,6 +328,7 @@ "$(inherited)", "$(PROJECT_DIR)/Lib/SDK/Libraries/Mac/XPLM.framework", ); + MACOSX_DEPLOYMENT_TARGET = 11.0; }; name = Release; }; diff --git a/Example/LTAPI.xcodeproj/xcshareddata/xcschemes/LTAPIExample.xcscheme b/Example/LTAPI.xcodeproj/xcshareddata/xcschemes/LTAPIExample.xcscheme index b679c16..a95009d 100644 --- a/Example/LTAPI.xcodeproj/xcshareddata/xcschemes/LTAPIExample.xcscheme +++ b/Example/LTAPI.xcodeproj/xcshareddata/xcschemes/LTAPIExample.xcscheme @@ -1,6 +1,6 @@ + + 100 ? "^" : "", xplmFont_Proportional); DRAW_N(30, getHeading(), 3, 0); DRAW_N(30, getSpeedKn(), 3, 0); + DRAW_N(30, getLocalGndSpeed_kn(), 3, 0); DRAW_N(30, getBearing(), 4, 0); DRAW_N(35, getDistNm(), 4, 1); DRAW_S(80, getPhaseStr()); @@ -448,6 +449,7 @@ void EnhAircraft::DrawOutput(int x, int y, int r, int) const } else { DRAW_T(20, "", xplmFont_Proportional); } + DRAW_T(100, getTrspModeTxt(), xplmFont_Proportional); DRAW_T(25, isVisible() ? "X" : "", xplmFont_Proportional); DRAW_T(25, isOnCamera() ? "X" : "", xplmFont_Proportional); DRAW_S(180, getCslModel()); @@ -534,11 +536,13 @@ void draw_header (int x, int y, int r) DRAW_T(15, "", xplmFont_Basic); DRAW_T(30, " °", xplmFont_Basic); DRAW_T(30, " kn", xplmFont_Basic); + DRAW_T(30, "lcl", xplmFont_Basic); DRAW_T(30, "Brng", xplmFont_Basic); DRAW_T(35, "Dist", xplmFont_Basic); DRAW_T(80, "Phase", xplmFont_Proportional); DRAW_T(60, "key", xplmFont_Proportional); DRAW_T(20, "#", xplmFont_Proportional); + DRAW_T(100, "Transp.", xplmFont_Proportional); DRAW_T(25, "vis", xplmFont_Proportional); DRAW_T(25, "cam", xplmFont_Proportional); DRAW_T(180, "CSL Model", xplmFont_Proportional); diff --git a/Example/LTAPIExample.png b/Example/LTAPIExample.png index 1d8fee3..625e63c 100644 Binary files a/Example/LTAPIExample.png and b/Example/LTAPIExample.png differ diff --git a/Example/Lib/SDK/CHeaders/Widgets/XPStandardWidgets.h b/Example/Lib/SDK/CHeaders/Widgets/XPStandardWidgets.h deleted file mode 100644 index 1903e87..0000000 --- a/Example/Lib/SDK/CHeaders/Widgets/XPStandardWidgets.h +++ /dev/null @@ -1,556 +0,0 @@ -#ifndef _XPStandardWidgets_h_ -#define _XPStandardWidgets_h_ - -/* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All - * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 - * - */ - -/*************************************************************************** - * XPStandardWidgets - ***************************************************************************/ -/* - * ## THEORY OF OPERATION - * - * The standard widgets are widgets built into the widgets library. While you - * can gain access to the widget function that drives them, you generally use - * them by calling XPCreateWidget and then listening for special messages, - * etc. - * - * The standard widgets often send messages to themselves when the user - * performs an event; these messages are sent up the widget hierarchy until - * they are handled. So you can add a widget proc directly to a push button - * (for example) to intercept the message when it is clicked, or you can put - * one widget proc on a window for all of the push buttons in the window. Most - * of these messages contain the original widget ID as a parameter so you can - * know which widget is messaging no matter who it is sent to. - * - */ - -#include "XPWidgetDefs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/*************************************************************************** - * MAIN WINDOW - ***************************************************************************/ -/* - * The main window widget class provides a "window" as the user knows it. - * These windows are draggable and can be selected. Use them to create - * floating windows and non-modal dialogs. - * - */ - - -#define xpWidgetClass_MainWindow 1 - -/* - * Main Window Type Values - * - * These type values are used to control the appearance of a main window. - * - */ -enum { - /* The standard main window; pin stripes on XP7, metal frame on XP 6. */ - xpMainWindowStyle_MainWindow = 0, - - /* A translucent dark gray window. */ - xpMainWindowStyle_Translucent = 1, - - -}; - -/* - * Main Window Properties - * - */ -enum { - /* This property specifies the type of window. Set to one of the main window * - * types above. */ - xpProperty_MainWindowType = 1100, - - /* This property specifies whether the main window has close boxes in its * - * corners. */ - xpProperty_MainWindowHasCloseBoxes = 1200, - - -}; - -/* - * MainWindow Messages - * - */ -enum { - /* This message is sent when the close buttons for your window are pressed. */ - xpMessage_CloseButtonPushed = 1200, - - -}; - -/*************************************************************************** - * SUB WINDOW - ***************************************************************************/ -/* - * X-Plane dialogs are divided into separate areas; the sub window widgets - * allow you to make these areas. Create one main window and place several - * subwindows inside it. Then place your controls inside the subwindows. - * - */ - - -#define xpWidgetClass_SubWindow 2 - -/* - * SubWindow Type Values - * - * These values control the appearance of the subwindow. - * - */ -enum { - /* A panel that sits inside a main window. */ - xpSubWindowStyle_SubWindow = 0, - - /* A screen that sits inside a panel for showing text information. */ - xpSubWindowStyle_Screen = 2, - - /* A list view for scrolling lists. */ - xpSubWindowStyle_ListView = 3, - - -}; - -/* - * SubWindow Properties - * - */ -enum { - /* This property specifies the type of window. Set to one of the subwindow * - * types above. */ - xpProperty_SubWindowType = 1200, - - -}; - -/*************************************************************************** - * BUTTON - ***************************************************************************/ -/* - * The button class provides a number of different button styles and - * behaviors, including push buttons, radio buttons, check boxes, etc. The - * button label appears on or next to the button depending on the button's - * appearance or type. - * - * The button's behavior is a separate property that dictates who it - * highlights and what kinds of messages it sends. Since behavior and type are - * different, you can do strange things like make check boxes that act as push - * buttons or push buttons with radio button behavior. - * - * In X-Plane 6 there were no check box graphics. The result is the following - * behavior: in X-Plane - * 6 all check box and radio buttons are round (radio-button style) buttons; - * in X-Plane 7 they are all square (check-box style) buttons. In a future - * version of X-Plane, the xpButtonBehavior enums will provide the correct - * graphic (check box or radio button) giving the expected result. - * - */ - - -#define xpWidgetClass_Button 3 - -/* - * Button Types - * - * These define the visual appearance of buttons but not how they respond to - * the mouse. - * - */ -enum { - /* This is a standard push button, like an 'OK' or 'Cancel' button in a dialog* - * box. */ - xpPushButton = 0, - - /* A check box or radio button. Use this and the button behaviors below to * - * get the desired behavior. */ - xpRadioButton = 1, - - /* A window close box. */ - xpWindowCloseBox = 3, - - /* A small down arrow. */ - xpLittleDownArrow = 5, - - /* A small up arrow. */ - xpLittleUpArrow = 6, - - -}; - -/* - * Button Behavior Values - * - * These define how the button responds to mouse clicks. - * - */ -enum { - /* Standard push button behavior. The button highlights while the mouse is * - * clicked over it and unhighlights when the mouse is moved outside of it or * - * released. If the mouse is released over the button, the * - * xpMsg_PushButtonPressed message is sent. */ - xpButtonBehaviorPushButton = 0, - - /* Check box behavior. The button immediately toggles its value when the mouse* - * is clicked and sends out a xpMsg_ButtonStateChanged message. */ - xpButtonBehaviorCheckBox = 1, - - /* Radio button behavior. The button immediately sets its state to one and * - * sends out a xpMsg_ButtonStateChanged message if it was not already set to * - * one. You must turn off other radio buttons in a group in your code. */ - xpButtonBehaviorRadioButton = 2, - - -}; - -/* - * Button Properties - * - */ -enum { - /* This property sets the visual type of button. Use one of the button types * - * above. */ - xpProperty_ButtonType = 1300, - - /* This property sets the button's behavior. Use one of the button behaviors * - * above. */ - xpProperty_ButtonBehavior = 1301, - - /* This property tells whether a check box or radio button is "checked" or * - * not. Not used for push buttons. */ - xpProperty_ButtonState = 1302, - - -}; - -/* - * Button Messages - * - * These messages are sent by the button to itself and then up the widget - * chain when the button is clicked. (You may intercept them by providing a - * widget handler for the button itself or by providing a handler in a parent - * widget.) - * - */ -enum { - /* This message is sent when the user completes a click and release in a * - * button with push button behavior. Parameter one of the message is the * - * widget ID of the button. This message is dispatched up the widget * - * hierarchy. */ - xpMsg_PushButtonPressed = 1300, - - /* This message is sent when a button is clicked that has radio button or * - * check box behavior and its value changes. (Note that if the value changes * - * by setting a property you do not receive this message!) Parameter one is * - * the widget ID of the button, parameter 2 is the new state value, either * - * zero or one. This message is dispatched up the widget hierarchy. */ - xpMsg_ButtonStateChanged = 1301, - - -}; - -/*************************************************************************** - * TEXT FIELD - ***************************************************************************/ -/* - * The text field widget provides an editable text field including mouse - * selection and keyboard navigation. The contents of the text field are its - * descriptor. (The descriptor changes as the user types.) - * - * The text field can have a number of types, that affect the visual layout of - * the text field. The text field sends messages to itself so you may control - * its behavior. - * - * If you need to filter keystrokes, add a new handler and intercept the key - * press message. Since key presses are passed by pointer, you can modify the - * keystroke and pass it through to the text field widget. - * - * WARNING: in X-Plane before 7.10 (including 6.70) null characters could - * crash X-Plane. To prevent this, wrap this object with a filter function - * (more instructions can be found on the SDK website). - * - */ - - -#define xpWidgetClass_TextField 4 - -/* - * Text Field Type Values - * - * These control the look of the text field. - * - */ -enum { - /* A field for text entry. */ - xpTextEntryField = 0, - - /* A transparent text field. The user can type and the text is drawn, but no * - * background is drawn. You can draw your own background by adding a widget * - * handler and prehandling the draw message. */ - xpTextTransparent = 3, - - /* A translucent edit field, dark gray. */ - xpTextTranslucent = 4, - - -}; - -/* - * Text Field Properties - * - */ -enum { - /* This is the character position the selection starts at, zero based. If it * - * is the same as the end insertion point, the insertion point is not a * - * selection. */ - xpProperty_EditFieldSelStart = 1400, - - /* This is the character position of the end of the selection. */ - xpProperty_EditFieldSelEnd = 1401, - - /* This is the character position a drag was started at if the user is * - * dragging to select text, or -1 if a drag is not in progress. */ - xpProperty_EditFieldSelDragStart = 1402, - - /* This is the type of text field to display, from the above list. */ - xpProperty_TextFieldType = 1403, - - /* Set this property to 1 to password protect the field. Characters will be * - * drawn as *s even though the descriptor will contain plain-text. */ - xpProperty_PasswordMode = 1404, - - /* The max number of characters you can enter, if limited. Zero means * - * unlimited. */ - xpProperty_MaxCharacters = 1405, - - /* The first visible character on the left. This effectively scrolls the text* - * field. */ - xpProperty_ScrollPosition = 1406, - - /* The font to draw the field's text with. (An XPLMFontID.) */ - xpProperty_Font = 1407, - - /* This is the active side of the insert selection. (Internal) */ - xpProperty_ActiveEditSide = 1408, - - -}; - -/* - * Text Field Messages - * - */ -enum { - /* The text field sends this message to itself when its text changes. It sends* - * the message up the call chain; param1 is the text field's widget ID. */ - xpMsg_TextFieldChanged = 1400, - - -}; - -/*************************************************************************** - * SCROLL BAR - ***************************************************************************/ -/* - * A standard scroll bar or slider control. The scroll bar has a minimum, - * maximum and current value that is updated when the user drags it. The - * scroll bar sends continuous messages as it is dragged. - * - */ - - -#define xpWidgetClass_ScrollBar 5 - -/* - * Scroll Bar Type Values - * - * This defines how the scroll bar looks. - * - */ -enum { - /* A standard X-Plane scroll bar (with arrows on the ends). */ - xpScrollBarTypeScrollBar = 0, - - /* A slider, no arrows. */ - xpScrollBarTypeSlider = 1, - - -}; - -/* - * Scroll Bar Properties - * - */ -enum { - /* The current position of the thumb (in between the min and max, inclusive) */ - xpProperty_ScrollBarSliderPosition = 1500, - - /* The value the scroll bar has when the thumb is in the lowest position. */ - xpProperty_ScrollBarMin = 1501, - - /* The value the scroll bar has when the thumb is in the highest position. */ - xpProperty_ScrollBarMax = 1502, - - /* How many units to move the scroll bar when clicking next to the thumb. The * - * scroll bar always moves one unit when the arrows are clicked. */ - xpProperty_ScrollBarPageAmount = 1503, - - /* The type of scrollbar from the enums above. */ - xpProperty_ScrollBarType = 1504, - - /* Used internally. */ - xpProperty_ScrollBarSlop = 1505, - - -}; - -/* - * Scroll Bar Messages - * - */ -enum { - /* The scroll bar sends this message when the slider position changes. It * - * sends the message up the call chain; param1 is the scroll bar widget ID. */ - xpMsg_ScrollBarSliderPositionChanged = 1500, - - -}; - -/*************************************************************************** - * CAPTION - ***************************************************************************/ -/* - * A caption is a simple widget that shows its descriptor as a string, useful - * for labeling parts of a window. It always shows its descriptor as its - * string and is otherwise transparent. - * - */ - - -#define xpWidgetClass_Caption 6 - -/* - * Caption Properties - * - */ -enum { - /* This property specifies whether the caption is lit; use lit captions * - * against screens. */ - xpProperty_CaptionLit = 1600, - - -}; - -/*************************************************************************** - * GENERAL GRAPHICS - ***************************************************************************/ -/* - * The general graphics widget can show one of many icons available from - * X-Plane. - * - */ - - -#define xpWidgetClass_GeneralGraphics 7 - -/* - * General Graphics Types Values - * - * These define the icon for the general graphics. - * - */ -enum { - xpShip = 4, - - xpILSGlideScope = 5, - - xpMarkerLeft = 6, - - xp_Airport = 7, - - xpNDB = 8, - - xpVOR = 9, - - xpRadioTower = 10, - - xpAircraftCarrier = 11, - - xpFire = 12, - - xpMarkerRight = 13, - - xpCustomObject = 14, - - xpCoolingTower = 15, - - xpSmokeStack = 16, - - xpBuilding = 17, - - xpPowerLine = 18, - - xpVORWithCompassRose = 19, - - xpOilPlatform = 21, - - xpOilPlatformSmall = 22, - - xpWayPoint = 23, - - -}; - -/* - * General Graphics Properties - * - */ -enum { - /* This property controls the type of icon that is drawn. */ - xpProperty_GeneralGraphicsType = 1700, - - -}; - -/*************************************************************************** - * PROGRESS INDICATOR - ***************************************************************************/ -/* - * This widget implements a progress indicator as seen when X-Plane starts up. - * - */ - -#define xpWidgetClass_Progress 8 - -/* - * Progress Indicator Properties - * - */ -enum { - /* This is the current value of the progress indicator. */ - xpProperty_ProgressPosition = 1800, - - /* This is the minimum value, equivalent to 0% filled. */ - xpProperty_ProgressMin = 1801, - - /* This is the maximum value, equivalent to 100% filled. */ - xpProperty_ProgressMax = 1802, - - -}; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/Example/Lib/SDK/CHeaders/Widgets/XPUIGraphics.h b/Example/Lib/SDK/CHeaders/Widgets/XPUIGraphics.h deleted file mode 100644 index 83ed302..0000000 --- a/Example/Lib/SDK/CHeaders/Widgets/XPUIGraphics.h +++ /dev/null @@ -1,353 +0,0 @@ -#ifndef _XPUIGraphics_h_ -#define _XPUIGraphics_h_ - -/* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All - * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 - * - */ - -/*************************************************************************** - * XPUIGraphics - ***************************************************************************/ - -#include "XPWidgetDefs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/*************************************************************************** - * UI GRAPHICS - ***************************************************************************/ - -/* - * XPWindowStyle - * - * There are a few built-in window styles in X-Plane that you can use. - * - * Note that X-Plane 6 does not offer real shadow-compositing; you must make - * sure to put a window on top of another window of the right style to make - * the shadows work, etc. This applies to elements with insets and shadows. - * The rules are: - * - * Sub windows must go on top of main windows, and screens and list views on - * top of subwindows. Only help and main windows can be over the main screen. - * - * With X-Plane 7 any window or element may be placed over any other element. - * - * Some windows are scaled by stretching, some by repeating. The drawing - * routines know which scaling method to use. The list view cannot be rescaled - * in X-Plane 6 because it has both a repeating pattern and a gradient in one - * element. All other elements can be rescaled. - * - */ -enum { - /* An LCD screen that shows help. */ - xpWindow_Help = 0, - - /* A dialog box window. */ - xpWindow_MainWindow = 1, - - /* A panel or frame within a dialog box window. */ - xpWindow_SubWindow = 2, - - /* An LCD screen within a panel to hold text displays. */ - xpWindow_Screen = 4, - - /* A list view within a panel for scrolling file names, etc. */ - xpWindow_ListView = 5, - - -}; -typedef int XPWindowStyle; - -/* - * XPDrawWindow - * - * This routine draws a window of the given dimensions at the given offset on - * the virtual screen in a given style. The window is automatically scaled as - * appropriate using a bitmap scaling technique (scaling or repeating) as - * appropriate to the style. - * - */ -WIDGET_API void XPDrawWindow( - int inX1, - int inY1, - int inX2, - int inY2, - XPWindowStyle inStyle); - -/* - * XPGetWindowDefaultDimensions - * - * This routine returns the default dimensions for a window. Output is either - * a minimum or fixed value depending on whether the window is scalable. - * - */ -WIDGET_API void XPGetWindowDefaultDimensions( - XPWindowStyle inStyle, - int * outWidth, /* Can be NULL */ - int * outHeight); /* Can be NULL */ - -/* - * XPElementStyle - * - * Elements are individually drawable UI things like push buttons, etc. The - * style defines what kind of element you are drawing. Elements can be - * stretched in one or two dimensions (depending on the element). Some - * elements can be lit. - * - * In X-Plane 6 some elements must be drawn over metal. Some are scalable and - * some are not. Any element can be drawn anywhere in X-Plane 7. - * - * Scalable Axis Required Background - * - */ -enum { - /* x metal */ - xpElement_TextField = 6, - - /* none metal */ - xpElement_CheckBox = 9, - - /* none metal */ - xpElement_CheckBoxLit = 10, - - /* none window header */ - xpElement_WindowCloseBox = 14, - - /* none window header */ - xpElement_WindowCloseBoxPressed = 15, - - /* x metal */ - xpElement_PushButton = 16, - - /* x metal */ - xpElement_PushButtonLit = 17, - - /* none any */ - xpElement_OilPlatform = 24, - - /* none any */ - xpElement_OilPlatformSmall = 25, - - /* none any */ - xpElement_Ship = 26, - - /* none any */ - xpElement_ILSGlideScope = 27, - - /* none any */ - xpElement_MarkerLeft = 28, - - /* none any */ - xpElement_Airport = 29, - - /* none any */ - xpElement_Waypoint = 30, - - /* none any */ - xpElement_NDB = 31, - - /* none any */ - xpElement_VOR = 32, - - /* none any */ - xpElement_RadioTower = 33, - - /* none any */ - xpElement_AircraftCarrier = 34, - - /* none any */ - xpElement_Fire = 35, - - /* none any */ - xpElement_MarkerRight = 36, - - /* none any */ - xpElement_CustomObject = 37, - - /* none any */ - xpElement_CoolingTower = 38, - - /* none any */ - xpElement_SmokeStack = 39, - - /* none any */ - xpElement_Building = 40, - - /* none any */ - xpElement_PowerLine = 41, - - /* none metal */ - xpElement_CopyButtons = 45, - - /* none metal */ - xpElement_CopyButtonsWithEditingGrid = 46, - - /* x, y metal */ - xpElement_EditingGrid = 47, - - /* THIS CAN PROBABLY BE REMOVED */ - xpElement_ScrollBar = 48, - - /* none any */ - xpElement_VORWithCompassRose = 49, - - /* none metal */ - xpElement_Zoomer = 51, - - /* x, y metal */ - xpElement_TextFieldMiddle = 52, - - /* none metal */ - xpElement_LittleDownArrow = 53, - - /* none metal */ - xpElement_LittleUpArrow = 54, - - /* none metal */ - xpElement_WindowDragBar = 61, - - /* none metal */ - xpElement_WindowDragBarSmooth = 62, - - -}; -typedef int XPElementStyle; - -/* - * XPDrawElement - * - * XPDrawElement draws a given element at an offset on the virtual screen in - * set dimensions. Even if the element is not scalable, it will be scaled if - * the width and height do not match the preferred dimensions; it'll just look - * ugly. Pass inLit to see the lit version of the element; if the element - * cannot be lit this is ignored. - * - */ -WIDGET_API void XPDrawElement( - int inX1, - int inY1, - int inX2, - int inY2, - XPElementStyle inStyle, - int inLit); - -/* - * XPGetElementDefaultDimensions - * - * This routine returns the recommended or minimum dimensions of a given UI - * element. outCanBeLit tells whether the element has both a lit and unlit - * state. Pass NULL to not receive any of these parameters. - * - */ -WIDGET_API void XPGetElementDefaultDimensions( - XPElementStyle inStyle, - int * outWidth, /* Can be NULL */ - int * outHeight, /* Can be NULL */ - int * outCanBeLit); /* Can be NULL */ - -/* - * XPTrackStyle - * - * A track is a UI element that displays a value vertically or horizontally. - * X-Plane has three kinds of tracks: scroll bars, sliders, and progress bars. - * Tracks can be displayed either horizontally or vertically; tracks will - * choose their own layout based on the larger dimension of their dimensions - * (e.g. they know if they are tall or wide). Sliders may be lit or unlit - * (showing the user manipulating them). - * - * - ScrollBar: this is a standard scroll bar with arrows and a thumb to drag. - * - Slider: this is a simple track with a ball in the middle that can be - * slid. - * - Progress: this is a progress indicator showing how a long task is going. - * - */ -enum { - /* not over metal can be lit can be rotated */ - xpTrack_ScrollBar = 0, - - /* over metal can be lit can be rotated */ - xpTrack_Slider = 1, - - /* over metal cannot be lit cannot be rotated */ - xpTrack_Progress = 2, - - -}; -typedef int XPTrackStyle; - -/* - * XPDrawTrack - * - * This routine draws a track. You pass in the track dimensions and size; the - * track picks the optimal orientation for these dimensions. Pass in the - * track's minimum current and maximum values; the indicator will be - * positioned appropriately. You can also specify whether the track is lit or - * not. - * - */ -WIDGET_API void XPDrawTrack( - int inX1, - int inY1, - int inX2, - int inY2, - int inMin, - int inMax, - int inValue, - XPTrackStyle inTrackStyle, - int inLit); - -/* - * XPGetTrackDefaultDimensions - * - * This routine returns a track's default smaller dimension; all tracks are - * scalable in the larger dimension. It also returns whether a track can be - * lit. - * - */ -WIDGET_API void XPGetTrackDefaultDimensions( - XPTrackStyle inStyle, - int * outWidth, - int * outCanBeLit); - -/* - * XPGetTrackMetrics - * - * This routine returns the metrics of a track. If you want to write UI code - * to manipulate a track, this routine helps you know where the mouse - * locations are. For most other elements, the rectangle the element is drawn - * in is enough information. However, the scrollbar drawing routine does some - * automatic placement; this routine lets you know where things ended up. You - * pass almost everything you would pass to the draw routine. You get out the - * orientation, and other useful stuff. - * - * Besides orientation, you get five dimensions for the five parts of a - * scrollbar, which are the down button, down area (area before the thumb), - * the thumb, and the up area and button. For horizontal scrollers, the left - * button decreases; for vertical scrollers, the top button decreases. - * - */ -WIDGET_API void XPGetTrackMetrics( - int inX1, - int inY1, - int inX2, - int inY2, - int inMin, - int inMax, - int inValue, - XPTrackStyle inTrackStyle, - int * outIsVertical, - int * outDownBtnSize, - int * outDownPageSize, - int * outThumbSize, - int * outUpPageSize, - int * outUpBtnSize); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/Example/Lib/SDK/CHeaders/Widgets/XPWidgetDefs.h b/Example/Lib/SDK/CHeaders/Widgets/XPWidgetDefs.h deleted file mode 100644 index a4fc1ba..0000000 --- a/Example/Lib/SDK/CHeaders/Widgets/XPWidgetDefs.h +++ /dev/null @@ -1,472 +0,0 @@ -#ifndef _XPWidgetDefs_h_ -#define _XPWidgetDefs_h_ - -/* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All - * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 - * - */ - -/*************************************************************************** - * XPWidgetDefs - ***************************************************************************/ - -#include "XPLMDefs.h" - -#ifdef __cplusplus -extern "C" { -#endif - - -#if APL - #if XPWIDGETS - #if __GNUC__ >= 4 - #define WIDGET_API __attribute__((visibility("default"))) - #elif __MACH__ - #define WIDGET_API - #else - #define WIDGET_API __declspec(dllexport) - #endif - #else - #define WIDGET_API - #endif -#elif IBM - #if XPWIDGETS - #define WIDGET_API __declspec(dllexport) - #else - #define WIDGET_API __declspec(dllimport) - #endif -#elif LIN - #if XPWIDGETS - #if __GNUC__ >= 4 - #define WIDGET_API __attribute__((visibility("default"))) - #else - #define WIDGET_API - #endif - #else - #define WIDGET_API - #endif -#else -#pragma error "Platform not defined!" -#endif - /*************************************************************************** - * WIDGET DEFINITIONS - ***************************************************************************/ -/* - * A widget is a call-back driven screen entity like a push-button, window, - * text entry field, etc. - * - * Use the widget API to create widgets of various classes. You can nest them - * into trees of widgets to create complex user interfaces. - * - */ - - -/* - * XPWidgetID - * - * A Widget ID is an opaque unique non-zero handle identifying your widget. - * Use 0 to specify "no widget". This type is defined as wide enough to hold a - * pointer. You receive a widget ID when you create a new widget and then use - * that widget ID to further refer to the widget. - * - */ -typedef void * XPWidgetID; - -/* - * XPWidgetPropertyID - * - * Properties are values attached to instances of your widgets. A property is - * identified by a 32-bit ID and its value is the width of a pointer. - * - * Each widget instance may have a property or not have it. When you set a - * property on a widget for the first time, the property is added to the - * widget; it then stays there for the life of the widget. - * - * Some property IDs are predefined by the widget package; you can make up - * your own property IDs as well. - * - */ -enum { - /* A window's refcon is an opaque value used by client code to find other data* - * based on it. */ - xpProperty_Refcon = 0, - - /* These properties are used by the utilities to implement dragging. */ - xpProperty_Dragging = 1, - - xpProperty_DragXOff = 2, - - xpProperty_DragYOff = 3, - - /* Is the widget highlighted? (For widgets that support this kind of thing.) */ - xpProperty_Hilited = 4, - - /* Is there a C++ object attached to this widget? */ - xpProperty_Object = 5, - - /* If this property is 1, the widget package will use OpenGL to restrict * - * drawing to the Widget's exposed rectangle. */ - xpProperty_Clip = 6, - - /* Is this widget enabled (for those that have a disabled state too)? */ - xpProperty_Enabled = 7, - - /* NOTE: Property IDs 1 - 999 are reserved for the widgets library. * - * * - * NOTE: Property IDs 1000 - 9999 are allocated to the standard widget classes* - * provided with the library. * - * * - * Properties 1000 - 1099 are for widget class 0, 1100 - 1199 for widget class* - * 1, etc. */ - xpProperty_UserStart = 10000, - - -}; -typedef int XPWidgetPropertyID; - -/* - * XPMouseState_t - * - * When the mouse is clicked or dragged, a pointer to this structure is passed - * to your widget function. - * - */ -typedef struct { - int x; - int y; - /* Mouse button number, left = 0 (right button not yet supported. */ - int button; -#if defined(XPLM200) - /* Scroll wheel delta (button in this case would be the wheel axis number). */ - int delta; -#endif /* XPLM200 */ -} XPMouseState_t; - -/* - * XPKeyState_t - * - * When a key is pressed, a pointer to this struct is passed to your widget - * function. - * - */ -typedef struct { - /* The ASCII key that was pressed. WARNING: this may be 0 for some non-ASCII * - * key sequences. */ - char key; - /* The flags. Make sure to check this if you only want key-downs! */ - XPLMKeyFlags flags; - /* The virtual key code for the key */ - char vkey; -} XPKeyState_t; - -/* - * XPWidgetGeometryChange_t - * - * This structure contains the deltas for your widget's geometry when it - * changes. - * - */ -typedef struct { - int dx; - /* +Y = the widget moved up */ - int dy; - int dwidth; - int dheight; -} XPWidgetGeometryChange_t; - -/* - * XPDispatchMode - * - * The dispatching modes describe how the widgets library sends out messages. - * Currently there are three modes: - * - */ -enum { - /* The message will only be sent to the target widget. */ - xpMode_Direct = 0, - - /* The message is sent to the target widget, then up the chain of parents * - * until the message is handled or a parentless widget is reached. */ - xpMode_UpChain = 1, - - /* The message is sent to the target widget and then all of its children * - * recursively depth-first. */ - xpMode_Recursive = 2, - - /* The message is sent just to the target, but goes to every callback, even if* - * it is handled. */ - xpMode_DirectAllCallbacks = 3, - - /* The message is only sent to the very first handler even if it is not * - * accepted. (This is really only useful for some internal widget library * - * functions.) */ - xpMode_Once = 4, - - -}; -typedef int XPDispatchMode; - -/* - * XPWidgetClass - * - * Widget classes define predefined widget types. A widget class basically - * specifies from a library the widget function to be used for the widget. - * Most widgets can be made right from classes. - * - */ -typedef int XPWidgetClass; - -/* An unspecified widget class. Other widget classes are in * - * XPStandardWidgets.h */ -#define xpWidgetClass_None 0 - -/*************************************************************************** - * WIDGET MESSAGES - ***************************************************************************/ - -/* - * XPWidgetMessage - * - * Widgets receive 32-bit messages indicating what action is to be taken or - * notifications of events. The list of messages may be expanded. - * - */ -enum { - /* No message, should not be sent. */ - xpMsg_None = 0, - - /* The create message is sent once per widget that is created with your widget* - * function and once for any widget that has your widget function attached. * - * * - * Dispatching: Direct * - * * - * Param 1: 1 if you are being added as a subclass, 0 if the widget is first * - * being created. */ - xpMsg_Create = 1, - - /* The destroy message is sent once for each message that is destroyed that * - * has your widget function. * - * * - * Dispatching: Direct for all * - * * - * Param 1: 1 if being deleted by a recursive delete to the parent, 0 for * - * explicit deletion. */ - xpMsg_Destroy = 2, - - /* The paint message is sent to your widget to draw itself. The paint message * - * is the bare-bones message; in response you must draw yourself, draw your * - * children, set up clipping and culling, check for visibility, etc. If you * - * don't want to do all of this, ignore the paint message and a draw message * - * (see below) will be sent to you. * - * * - * Dispatching: Direct */ - xpMsg_Paint = 3, - - /* The draw message is sent to your widget when it is time to draw yourself. * - * OpenGL will be set up to draw in 2-d global screen coordinates, but you * - * should use the XPLM to set up OpenGL state. * - * * - * Dispatching: Direct */ - xpMsg_Draw = 4, - - /* The key press message is sent once per key that is pressed. The first * - * parameter is the type of key code (integer or char) and the second is the * - * code itself. By handling this event, you consume the key stroke. * - * * - * Handling this message 'consumes' the keystroke; not handling it passes it * - * to your parent widget. * - * * - * Dispatching: Up Chain * - * * - * Param 1: A pointer to an XPKeyState_t structure with the keystroke. */ - xpMsg_KeyPress = 5, - - /* Keyboard focus is being given to you. By handling this message you accept * - * keyboard focus. The first parameter will be one if a child of yours gave up* - * focus to you, 0 if someone set focus on you explicitly. * - * * - * Handling this message accepts focus; not handling refuses focus. * - * * - * Dispatching: direct * - * * - * Param 1: 1 if you are gaining focus because your child is giving it up, 0 * - * if someone is explicitly giving you focus. */ - xpMsg_KeyTakeFocus = 6, - - /* Keyboard focus is being taken away from you. The first parameter will be 1 * - * if you are losing focus because another widget is taking it, or 0 if * - * someone called the API to make you lose focus explicitly. * - * * - * Dispatching: Direct * - * * - * Param 1: 1 if focus is being taken by another widget, 0 if code requested * - * to remove focus. */ - xpMsg_KeyLoseFocus = 7, - - /* You receive one mousedown event per click with a mouse-state structure * - * pointed to by parameter 1. By accepting this you eat the click, otherwise * - * your parent gets it. You will not receive drag and mouse up messages if you* - * do not accept the down message. * - * * - * Handling this message consumes the mouse click, not handling it passes it * - * to the next widget. You can act 'transparent' as a window by never handling* - * moues clicks to certain areas. * - * * - * Dispatching: Up chain NOTE: Technically this is direct dispatched, but the * - * widgets library will ship it to each widget until one consumes the click, * - * making it effectively "up chain". * - * * - * Param 1: A pointer to an XPMouseState_t containing the mouse status. */ - xpMsg_MouseDown = 8, - - /* You receive a series of mouse drag messages (typically one per frame in the* - * sim) as the mouse is moved once you have accepted a mouse down message. * - * Parameter one points to a mouse-state structure describing the mouse * - * location. You will continue to receive these until the mouse button is * - * released. You may receive multiple mouse state messages with the same mouse* - * position. You will receive mouse drag events even if the mouse is dragged * - * out of your current or original bounds at the time of the mouse down. * - * * - * Dispatching: Direct * - * * - * Param 1: A pointer to an XPMouseState_t containing the mouse status. */ - xpMsg_MouseDrag = 9, - - /* The mouseup event is sent once when the mouse button is released after a * - * drag or click. You only receive this message if you accept the mouseDown * - * message. Parameter one points to a mouse state structure. * - * * - * Dispatching: Direct * - * * - * Param 1: A pointer to an XPMouseState_t containing the mouse status. */ - xpMsg_MouseUp = 10, - - /* Your geometry or a child's geometry is being changed. * - * * - * Dispatching: Up chain * - * * - * Param 1: The widget ID of the original reshaped target. * - * * - * Param 2: A pointer to a XPWidgetGeometryChange_t struct describing the * - * change. */ - xpMsg_Reshape = 11, - - /* Your exposed area has changed. * - * * - * Dispatching: Direct */ - xpMsg_ExposedChanged = 12, - - /* A child has been added to you. The child's ID is passed in parameter one. * - * * - * Dispatching: Direct * - * * - * Param 1: The Widget ID of the child being added. */ - xpMsg_AcceptChild = 13, - - /* A child has been removed from you. The child's ID is passed in parameter * - * one. * - * * - * Dispatching: Direct * - * * - * Param 1: The Widget ID of the child being removed. */ - xpMsg_LoseChild = 14, - - /* You now have a new parent, or have no parent. The parent's ID is passed in,* - * or 0 for no parent. * - * * - * Dispatching: Direct * - * * - * Param 1: The Widget ID of your parent */ - xpMsg_AcceptParent = 15, - - /* You or a child has been shown. Note that this does not include you being * - * shown because your parent was shown, you were put in a new parent, your * - * root was shown, etc. * - * * - * Dispatching: Up chain * - * * - * Param 1: The widget ID of the shown widget. */ - xpMsg_Shown = 16, - - /* You have been hidden. See limitations above. * - * * - * Dispatching: Up chain * - * * - * Param 1: The widget ID of the hidden widget. */ - xpMsg_Hidden = 17, - - /* Your descriptor has changed. * - * * - * Dispatching: Direct */ - xpMsg_DescriptorChanged = 18, - - /* A property has changed. Param 1 contains the property ID. * - * * - * Dispatching: Direct * - * * - * Param 1: The Property ID being changed. * - * * - * Param 2: The new property value */ - xpMsg_PropertyChanged = 19, - -#if defined(XPLM200) - /* The mouse wheel has moved. * - * * - * Return 1 to consume the mouse wheel move, or 0 to pass the message to a * - * parent. Dispatching: Up chain * - * * - * Param 1: A pointer to an XPMouseState_t containing the mouse status. */ - xpMsg_MouseWheel = 20, - -#endif /* XPLM200 */ -#if defined(XPLM200) - /* The cursor is over your widget. If you consume this message, change the * - * XPLMCursorStatus value to indicate the desired result, with the same rules * - * as in XPLMDisplay.h. * - * * - * Return 1 to consume this message, 0 to pass it on. * - * * - * Dispatching: Up chain Param 1: A pointer to an XPMouseState_t struct * - * containing the mouse status. * - * * - * Param 2: A pointer to a XPLMCursorStatus - set this to the cursor result * - * you desire. */ - xpMsg_CursorAdjust = 21, - -#endif /* XPLM200 */ - /* NOTE: Message IDs 1000 - 9999 are allocated to the standard widget classes * - * provided with the library with 1000 - 1099 for widget class 0, 1100 - 1199 * - * for widget class 1, etc. Message IDs 10,000 and beyond are for plugin use. */ - xpMsg_UserStart = 10000, - - -}; -typedef int XPWidgetMessage; - -/*************************************************************************** - * WIDGET CALLBACK FUNCTION - ***************************************************************************/ - -/* - * XPWidgetFunc_t - * - * This function defines your custom widget's behavior. It will be called by - * the widgets library to send messages to your widget. The message and widget - * ID are passed in, as well as two pointer-width signed parameters whose - * meaning varies with the message. Return 1 to indicate that you have - * processed the message, 0 to indicate that you have not. For any message - * that is not understood, return 0. - * - */ -typedef int (* XPWidgetFunc_t)( - XPWidgetMessage inMessage, - XPWidgetID inWidget, - intptr_t inParam1, - intptr_t inParam2); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/Example/Lib/SDK/CHeaders/Widgets/XPWidgetUtils.h b/Example/Lib/SDK/CHeaders/Widgets/XPWidgetUtils.h deleted file mode 100644 index 60e4b95..0000000 --- a/Example/Lib/SDK/CHeaders/Widgets/XPWidgetUtils.h +++ /dev/null @@ -1,233 +0,0 @@ -#ifndef _XPWidgetUtils_h_ -#define _XPWidgetUtils_h_ - -/* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All - * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 - * - */ - -/*************************************************************************** - * XPWidgetUtils - ***************************************************************************/ -/* - * ## USAGE NOTES - * - * The XPWidgetUtils library contains useful functions that make writing and - * using widgets less of a pain. - * - * One set of functions are the widget behavior functions. These functions - * each add specific useful behaviors to widgets. They can be used in two - * manners: - * - * 1. You can add a widget behavior function to a widget as a callback proc - * using the XPAddWidgetCallback function. The widget will gain that - * behavior. Remember that the last function you add has highest priority. - * You can use this to change or augment the behavior of an existing - * finished widget. - * - * 2. You can call a widget function from inside your own widget function. - * This allows you to include useful behaviors in custom-built widgets. A - * number of the standard widgets get their behavior from this library. To - * do this, call the behavior function from your function first. If it - * returns 1, that means it handled the event and you don't need to; simply - * return 1. - * - */ - -#include "XPWidgetDefs.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/*************************************************************************** - * GENERAL UTILITIES - ***************************************************************************/ - - - -/* - * Convenience accessors - * - * It can be clumsy accessing the variables passed in by pointer to a struct - * for mouse and reshape messages; these accessors let you simply pass in the param - * right from the arguments of your widget proc and get back the value you want. - * - */ -#define MOUSE_X(param) (((XPMouseState_t *) (param))->x) -#define MOUSE_Y(param) (((XPMouseState_t *) (param))->y) - -#define DELTA_X(param) (((XPWidgetGeometryChange_t *) (param))->dx) -#define DELTA_Y(param) (((XPWidgetGeometryChange_t *) (param))->dy) -#define DELTA_W(param) (((XPWidgetGeometryChange_t *) (param))->dwidth) -#define DELTA_H(param) (((XPWidgetGeometryChange_t *) (param))->dheight) - -#define KEY_CHAR(param) (((XPKeyState_t *) (param))->key) -#define KEY_FLAGS(param) (((XPKeyState_t *) (param))->flags) -#define KEY_VKEY(param) (((XPKeyState_t *) (param))->vkey) - -#define IN_RECT(x, y, l, t, r, b) \ - (((x) >= (l)) && ((x) <= (r)) && ((y) >= (b)) && ((y) <= (t))) - -/* - * XPWidgetCreate_t - * - * This structure contains all of the parameters needed to create a widget. It - * is used with XPUCreateWidgets to create widgets in bulk from an array. All - * parameters correspond to those of XPCreateWidget except for the container - * index. - * - * If the container index is equal to the index of a widget in the array, the - * widget in the array passed to XPUCreateWidgets is used as the parent of - * this widget. Note that if you pass an index greater than your own position - * in the array, the parent you are requesting will not exist yet. - * - * If the container index is NO_PARENT, the parent widget is specified as - * NULL. If the container index is PARAM_PARENT, the widget passed into - * XPUCreateWidgets is used. - * - */ -typedef struct { - int left; - int top; - int right; - int bottom; - int visible; - const char * descriptor; - /* Whether this widget is a root widget */ - int isRoot; - /* The index of the widget to be contained within, or a constant */ - int containerIndex; - XPWidgetClass widgetClass; -} XPWidgetCreate_t; - -#define NO_PARENT -1 - -#define PARAM_PARENT -2 - -#define WIDGET_COUNT(x) ((sizeof(x) / sizeof(XPWidgetCreate_t))) - -/* - * XPUCreateWidgets - * - * This function creates a series of widgets from a table (see - * XPCreateWidget_t above). Pass in an array of widget creation structures and - * an array of widget IDs that will receive each widget. - * - * Widget parents are specified by index into the created widget table, - * allowing you to create nested widget structures. You can create multiple - * widget trees in one table. Generally you should create widget trees from - * the top down. - * - * You can also pass in a widget ID that will be used when the widget's parent - * is listed as PARAM_PARENT; this allows you to embed widgets created with - * XPUCreateWidgets in a widget created previously. - * - */ -WIDGET_API void XPUCreateWidgets( - const XPWidgetCreate_t * inWidgetDefs, - int inCount, - XPWidgetID inParamParent, - XPWidgetID * ioWidgets); - -/* - * XPUMoveWidgetBy - * - * Simply moves a widget by an amount, +x = right, +y = up, without resizing - * the widget. - * - */ -WIDGET_API void XPUMoveWidgetBy( - XPWidgetID inWidget, - int inDeltaX, - int inDeltaY); - -/*************************************************************************** - * LAYOUT MANAGERS - ***************************************************************************/ -/* - * The layout managers are widget behavior functions for handling where - * widgets move. Layout managers can be called from a widget function or - * attached to a widget later. - * - */ - - -/* - * XPUFixedLayout - * - * This function causes the widget to maintain its children in fixed position - * relative to itself as it is resized. Use this on the top level 'window' - * widget for your window. - * - */ -WIDGET_API int XPUFixedLayout( - XPWidgetMessage inMessage, - XPWidgetID inWidget, - intptr_t inParam1, - intptr_t inParam2); - -/*************************************************************************** - * WIDGET PROC BEHAVIORS - ***************************************************************************/ -/* - * These widget behavior functions add other useful behaviors to widgets. - * These functions cannot be attached to a widget; they must be called from - * your widget function. - * - */ - - -/* - * XPUSelectIfNeeded - * - * This causes the widget to bring its window to the foreground if it is not - * already. inEatClick specifies whether clicks in the background should be - * consumed by bringing the window to the foreground. - * - */ -WIDGET_API int XPUSelectIfNeeded( - XPWidgetMessage inMessage, - XPWidgetID inWidget, - intptr_t inParam1, - intptr_t inParam2, - int inEatClick); - -/* - * XPUDefocusKeyboard - * - * This causes the widget to send keyboard focus back to X-Plane. This stops - * editing of any text fields, etc. - * - */ -WIDGET_API int XPUDefocusKeyboard( - XPWidgetMessage inMessage, - XPWidgetID inWidget, - intptr_t inParam1, - intptr_t inParam2, - int inEatClick); - -/* - * XPUDragWidget - * - * XPUDragWidget drags the widget in response to mouse clicks. Pass in not - * only the event, but the global coordinates of the drag region, which might - * be a sub-region of your widget (for example, a title bar). - * - */ -WIDGET_API int XPUDragWidget( - XPWidgetMessage inMessage, - XPWidgetID inWidget, - intptr_t inParam1, - intptr_t inParam2, - int inLeft, - int inTop, - int inRight, - int inBottom); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/Example/Lib/SDK/CHeaders/Widgets/XPWidgets.h b/Example/Lib/SDK/CHeaders/Widgets/XPWidgets.h deleted file mode 100644 index f09885a..0000000 --- a/Example/Lib/SDK/CHeaders/Widgets/XPWidgets.h +++ /dev/null @@ -1,539 +0,0 @@ -#ifndef _XPWidgets_h_ -#define _XPWidgets_h_ - -/* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All - * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 - * - */ - -/*************************************************************************** - * XPWidgets - ***************************************************************************/ -/* - * ## THEORY OF OPERATION AND NOTES - * - * Widgets are persistent view 'objects' for X-Plane. A widget is an object - * referenced by its opaque handle (widget ID) and the APIs in this file. You - * cannot access the widget's guts directly. Every Widget has the following - * intrinsic data: - * - * - A bounding box defined in global screen coordinates with 0,0 in the - * bottom left and +y = up, +x = right. - * - A visible box, which is the intersection of the bounding box with the - * widget's parents visible box. - * - Zero or one parent widgets. (Always zero if the widget is a root widget. - * - Zero or more child widgets. - * - Whether the widget is a root. Root widgets are the top level plugin - * windows. - * - Whether the widget is visible. - * - A text string descriptor, whose meaning varies from widget to widget. - * - An arbitrary set of 32 bit integral properties defined by 32-bit integral - * keys. This is how specific widgets store specific data. - * - A list of widget callback procedures that implements the widgets - * behaviors. - * - * The Widgets library sends messages to widgets to request specific behaviors - * or notify the widget of things. - * - * Widgets may have more than one callback function, in which case messages - * are sent to the most recently added callback function until the message is - * handled. Messages may also be sent to parents or children; see the - * XPWidgetDefs.h header file for the different widget message dispatching - * functions. By adding a callback function to a window you can 'subclass' its - * behavior. - * - * A set of standard widgets are provided that serve common UI purposes. You - * can also customize or implement entirely custom widgets. - * - * Widgets are different than other view hierarchies (most notably Win32, - * which they bear a striking resemblance to) in the following ways: - * - * - Not all behavior can be patched. State that is managed by the XPWidgets - * DLL and not by individual widgets cannot be customized. - * - All coordinates are in global screen coordinates. Coordinates are not - * relative to an enclosing widget, nor are they relative to a display - * window. - * - Widget messages are always dispatched synchronously, and there is no - * concept of scheduling an update or a dirty region. Messages originate - * from X-Plane as the sim cycle goes by. Since X-Plane is constantly - * redrawing, so are widgets; there is no need to mark a part of a widget as - * 'needing redrawing' because redrawing happens frequently whether the - * widget needs it or not. - * - Any widget may be a 'root' widget, causing it to be drawn; there is no - * relationship between widget class and rootness. Root widgets are - * implemented as XPLMDisplay windows. - * - */ - -#include "XPWidgetDefs.h" -#include "XPLMDisplay.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/*************************************************************************** - * WIDGET CREATION AND MANAGEMENT - ***************************************************************************/ - -/* - * XPCreateWidget - * - * This function creates a new widget and returns the new widget's ID to you. - * If the widget creation fails for some reason, it returns NULL. Widget - * creation will fail either if you pass a bad class ID or if there is not - * adequate memory. - * - * Input Parameters: - * - * - Top, left, bottom, and right in global screen coordinates defining the - * widget's location on the screen. - * - inVisible is 1 if the widget should be drawn, 0 to start the widget as - * hidden. - * - inDescriptor is a null terminated string that will become the widget's - * descriptor. - * - inIsRoot is 1 if this is going to be a root widget, 0 if it will not be. - * - inContainer is the ID of this widget's container. It must be 0 for a root - * widget. For a non-root widget, pass the widget ID of the widget to place - * this widget within. If this widget is not going to start inside another - * widget, pass 0; this new widget will be created but will not be drawn - * until it is placed inside another widget. - * - inClass is the class of the widget to draw. Use one of the predefined - * class-IDs to create a standard widget. - * - * A note on widget embedding: a widget is only called (and will be drawn, - * etc.) if it is placed within a widget that will be called. Root widgets are - * always called. So it is possible to have whole chains of widgets that are - * simply not called. You can preconstruct widget trees and then place them - * into root widgets later to activate them if you wish. - * - */ -WIDGET_API XPWidgetID XPCreateWidget( - int inLeft, - int inTop, - int inRight, - int inBottom, - int inVisible, - const char * inDescriptor, - int inIsRoot, - XPWidgetID inContainer, - XPWidgetClass inClass); - -/* - * XPCreateCustomWidget - * - * This function is the same as XPCreateWidget except that instead of passing - * a class ID, you pass your widget callback function pointer defining the - * widget. Use this function to define a custom widget. All parameters are the - * same as XPCreateWidget, except that the widget class has been replaced with - * the widget function. - * - */ -WIDGET_API XPWidgetID XPCreateCustomWidget( - int inLeft, - int inTop, - int inRight, - int inBottom, - int inVisible, - const char * inDescriptor, - int inIsRoot, - XPWidgetID inContainer, - XPWidgetFunc_t inCallback); - -/* - * XPDestroyWidget - * - * This class destroys a widget. Pass in the ID of the widget to kill. If you - * pass 1 for inDestroyChilren, the widget's children will be destroyed first, - * then this widget will be destroyed. (Furthermore, the widget's children - * will be destroyed with the inDestroyChildren flag set to 1, so the - * destruction will recurse down the widget tree.) If you pass 0 for this - * flag, direct child widgets will simply end up with their parent set to 0. - * - */ -WIDGET_API void XPDestroyWidget( - XPWidgetID inWidget, - int inDestroyChildren); - -/* - * XPSendMessageToWidget - * - * This sends any message to a widget. You should probably not go around - * simulating the predefined messages that the widgets library defines for - * you. You may however define custom messages for your widgets and send them - * with this method. - * - * This method supports several dispatching patterns; see XPDispatchMode for - * more info. The function returns 1 if the message was handled, 0 if it was - * not. - * - * For each widget that receives the message (see the dispatching modes), each - * widget function from the most recently installed to the oldest one receives - * the message in order until it is handled. - * - */ -WIDGET_API int XPSendMessageToWidget( - XPWidgetID inWidget, - XPWidgetMessage inMessage, - XPDispatchMode inMode, - intptr_t inParam1, - intptr_t inParam2); - -/*************************************************************************** - * WIDGET POSITIONING AND VISIBILITY - ***************************************************************************/ - -/* - * XPPlaceWidgetWithin - * - * This function changes which container a widget resides in. You may NOT use - * this function on a root widget! inSubWidget is the widget that will be - * moved. Pass a widget ID in inContainer to make inSubWidget be a child of - * inContainer. It will become the last/closest widget in the container. Pass - * 0 to remove the widget from any container. Any call to this other than - * passing the widget ID of the old parent of the affected widget will cause - * the widget to be removed from its old parent. Placing a widget within its - * own parent simply makes it the last widget. - * - * NOTE: this routine does not reposition the sub widget in global - * coordinates. If the container has layout management code, it will - * reposition the subwidget for you, otherwise you must do it with - * SetWidgetGeometry. - * - */ -WIDGET_API void XPPlaceWidgetWithin( - XPWidgetID inSubWidget, - XPWidgetID inContainer); - -/* - * XPCountChildWidgets - * - * This routine returns the number of widgets another widget contains. - * - */ -WIDGET_API int XPCountChildWidgets( - XPWidgetID inWidget); - -/* - * XPGetNthChildWidget - * - * This routine returns the widget ID of a child widget by index. Indexes are - * 0 based, from 0 to the number of widgets in the parentone minus one, - * inclusive. If the index is invalid, 0 is returned. - * - */ -WIDGET_API XPWidgetID XPGetNthChildWidget( - XPWidgetID inWidget, - int inIndex); - -/* - * XPGetParentWidget - * - * Returns the parent of a widget, or 0 if the widget has no parent. Root - * widgets never have parents and therefore always return 0. - * - */ -WIDGET_API XPWidgetID XPGetParentWidget( - XPWidgetID inWidget); - -/* - * XPShowWidget - * - * This routine makes a widget visible if it is not already. Note that if a - * widget is not in a rooted widget hierarchy or one of its parents is not - * visible, it will still not be visible to the user. - * - */ -WIDGET_API void XPShowWidget( - XPWidgetID inWidget); - -/* - * XPHideWidget - * - * Makes a widget invisible. See XPShowWidget for considerations of when a - * widget might not be visible despite its own visibility state. - * - */ -WIDGET_API void XPHideWidget( - XPWidgetID inWidget); - -/* - * XPIsWidgetVisible - * - * This returns 1 if a widget is visible, 0 if it is not. Note that this - * routine takes into consideration whether a parent is invisible. Use this - * routine to tell if the user can see the widget. - * - */ -WIDGET_API int XPIsWidgetVisible( - XPWidgetID inWidget); - -/* - * XPFindRootWidget - * - * Returns the Widget ID of the root widget that contains the passed in widget - * or NULL if the passed in widget is not in a rooted hierarchy. - * - */ -WIDGET_API XPWidgetID XPFindRootWidget( - XPWidgetID inWidget); - -/* - * XPBringRootWidgetToFront - * - * This routine makes the specified widget be in the frontmost widget - * hierarchy. If this widget is a root widget, its widget hierarchy comes to - * front, otherwise the widget's root is brought to the front. If this widget - * is not in an active widget hiearchy (e.g. there is no root widget at the - * top of the tree), this routine does nothing. - * - */ -WIDGET_API void XPBringRootWidgetToFront( - XPWidgetID inWidget); - -/* - * XPIsWidgetInFront - * - * This routine returns true if this widget's hierarchy is the frontmost - * hierarchy. It returns false if the widget's hierarchy is not in front, or - * if the widget is not in a rooted hierarchy. - * - */ -WIDGET_API int XPIsWidgetInFront( - XPWidgetID inWidget); - -/* - * XPGetWidgetGeometry - * - * This routine returns the bounding box of a widget in global coordinates. - * Pass NULL for any parameter you are not interested in. - * - */ -WIDGET_API void XPGetWidgetGeometry( - XPWidgetID inWidget, - int * outLeft, /* Can be NULL */ - int * outTop, /* Can be NULL */ - int * outRight, /* Can be NULL */ - int * outBottom); /* Can be NULL */ - -/* - * XPSetWidgetGeometry - * - * This function changes the bounding box of a widget. - * - */ -WIDGET_API void XPSetWidgetGeometry( - XPWidgetID inWidget, - int inLeft, - int inTop, - int inRight, - int inBottom); - -/* - * XPGetWidgetForLocation - * - * Given a widget and a location, this routine returns the widget ID of the - * child of that widget that owns that location. If inRecursive is true then - * this will return a child of a child of a widget as it tries to find the - * deepest widget at that location. If inVisibleOnly is true, then only - * visible widgets are considered, otherwise all widgets are considered. The - * widget ID passed for inContainer will be returned if the location is in - * that widget but not in a child widget. 0 is returned if the location is not - * in the container. - * - * NOTE: if a widget's geometry extends outside its parents geometry, it will - * not be returned by this call for mouse locations outside the parent - * geometry. The parent geometry limits the child's eligibility for mouse - * location. - * - */ -WIDGET_API XPWidgetID XPGetWidgetForLocation( - XPWidgetID inContainer, - int inXOffset, - int inYOffset, - int inRecursive, - int inVisibleOnly); - -/* - * XPGetWidgetExposedGeometry - * - * This routine returns the bounds of the area of a widget that is completely - * within its parent widgets. Since a widget's bounding box can be outside its - * parent, part of its area will not be eligible for mouse clicks and should - * not draw. Use XPGetWidgetGeometry to find out what area defines your - * widget's shape, but use this routine to find out what area to actually draw - * into. Note that the widget library does not use OpenGL clipping to keep - * frame rates up, although you could use it internally. - * - */ -WIDGET_API void XPGetWidgetExposedGeometry( - XPWidgetID inWidgetID, - int * outLeft, /* Can be NULL */ - int * outTop, /* Can be NULL */ - int * outRight, /* Can be NULL */ - int * outBottom); /* Can be NULL */ - -/*************************************************************************** - * ACCESSING WIDGET DATA - ***************************************************************************/ - -/* - * XPSetWidgetDescriptor - * - * Every widget has a descriptor, which is a text string. What the text string - * is used for varies from widget to widget; for example, a push button's text - * is its descriptor, a caption shows its descriptor, and a text field's - * descriptor is the text being edited. In other words, the usage for the text - * varies from widget to widget, but this API provides a universal and - * convenient way to get at it. While not all UI widgets need their - * descriptor, many do. - * - */ -WIDGET_API void XPSetWidgetDescriptor( - XPWidgetID inWidget, - const char * inDescriptor); - -/* - * XPGetWidgetDescriptor - * - * This routine returns the widget's descriptor. Pass in the length of the - * buffer you are going to receive the descriptor in. The descriptor will be - * null terminated for you. This routine returns the length of the actual - * descriptor; if you pass NULL for outDescriptor, you can get the - * descriptor's length without getting its text. If the length of the - * descriptor exceeds your buffer length, the buffer will not be null - * terminated (this routine has 'strncpy' semantics). - * - */ -WIDGET_API int XPGetWidgetDescriptor( - XPWidgetID inWidget, - char * outDescriptor, - int inMaxDescLength); - -/* - * XPGetWidgetUnderlyingWindow - * - * Returns the window (from the XPLMDisplay API) that backs your widget - * window. If you have opted in to modern windows, via a call to - * XPLMEnableFeature("XPLM_USE_NATIVE_WIDGET_WINDOWS", 1), you can use the - * returned window ID for display APIs like XPLMSetWindowPositioningMode(), - * allowing you to pop the widget window out into a real OS window, or move it - * into VR. - * - */ -WIDGET_API XPLMWindowID XPGetWidgetUnderlyingWindow( - XPWidgetID inWidget); - -/* - * XPSetWidgetProperty - * - * This function sets a widget's property. Properties are arbitrary values - * associated by a widget by ID. - * - */ -WIDGET_API void XPSetWidgetProperty( - XPWidgetID inWidget, - XPWidgetPropertyID inProperty, - intptr_t inValue); - -/* - * XPGetWidgetProperty - * - * This routine returns the value of a widget's property, or 0 if the property - * is not defined. If you need to know whether the property is defined, pass a - * pointer to an int for inExists; the existence of that property will be - * returned in the int. Pass NULL for inExists if you do not need this - * information. - * - */ -WIDGET_API intptr_t XPGetWidgetProperty( - XPWidgetID inWidget, - XPWidgetPropertyID inProperty, - int * inExists); /* Can be NULL */ - -/*************************************************************************** - * KEYBOARD MANAGEMENT - ***************************************************************************/ - -/* - * XPSetKeyboardFocus - * - * Controls which widget will receive keystrokes. Pass the widget ID of the - * widget to get the keys. Note that if the widget does not care about - * keystrokes, they will go to the parent widget, and if no widget cares about - * them, they go to X-Plane. - * - * If you set the keyboard focus to widget ID 0, X-Plane gets keyboard focus. - * - * This routine returns the widget ID that ended up with keyboard focus, or 0 - * for X-Plane. - * - * Keyboard focus is not changed if the new widget will not accept it. For - * setting to X-Plane, keyboard focus is always accepted. - * - */ -WIDGET_API XPWidgetID XPSetKeyboardFocus( - XPWidgetID inWidget); - -/* - * XPLoseKeyboardFocus - * - * This causes the specified widget to lose focus; focus is passed to its - * parent, or the next parent that will accept it. This routine does nothing - * if this widget does not have focus. - * - */ -WIDGET_API void XPLoseKeyboardFocus( - XPWidgetID inWidget); - -/* - * XPGetWidgetWithFocus - * - * This routine returns the widget that has keyboard focus, or 0 if X-Plane - * has keyboard focus or some other plugin window that does not have widgets - * has focus. - * - */ -WIDGET_API XPWidgetID XPGetWidgetWithFocus(void); - -/*************************************************************************** - * CREATING CUSTOM WIDGETS - ***************************************************************************/ - -/* - * XPAddWidgetCallback - * - * This function adds a new widget callback to a widget. This widget callback - * supercedes any existing ones and will receive messages first; if it does - * not handle messages they will go on to be handled by pre-existing widgets. - * - * The widget function will remain on the widget for the life of the widget. - * The creation message will be sent to the new callback immediately with the - * widget ID, and the destruction message will be sent before the other widget - * function receives a destruction message. - * - * This provides a way to 'subclass' an existing widget. By providing a second - * hook that only handles certain widget messages, you can customize or extend - * widget behavior. - * - */ -WIDGET_API void XPAddWidgetCallback( - XPWidgetID inWidget, - XPWidgetFunc_t inNewCallback); - -/* - * XPGetWidgetClassFunc - * - * Given a widget class, this function returns the callbacks that power that - * widget class. - * - */ -WIDGET_API XPWidgetFunc_t XPGetWidgetClassFunc( - XPWidgetClass inWidgetClass); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/Example/Lib/SDK/CHeaders/XPLM/XPLMCamera.h b/Example/Lib/SDK/CHeaders/XPLM/XPLMCamera.h index 8b88d28..c81bd5f 100644 --- a/Example/Lib/SDK/CHeaders/XPLM/XPLMCamera.h +++ b/Example/Lib/SDK/CHeaders/XPLM/XPLMCamera.h @@ -2,7 +2,7 @@ #define _XPLMCamera_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -73,7 +73,6 @@ enum { }; typedef int XPLMCameraControlDuration; - /* * XPLMCameraPosition_t * @@ -94,7 +93,6 @@ typedef struct { float roll; float zoom; } XPLMCameraPosition_t; - /* * XPLMCameraControl_f * @@ -113,7 +111,6 @@ typedef int (* XPLMCameraControl_f)( XPLMCameraPosition_t * outCameraPosition, /* Can be NULL */ int inIsLosingControl, void * inRefcon); - /* * XPLMControlCamera * @@ -126,7 +123,6 @@ XPLM_API void XPLMControlCamera( XPLMCameraControlDuration inHowLong, XPLMCameraControl_f inControlFunc, void * inRefcon); - /* * XPLMDontControlCamera * @@ -139,7 +135,6 @@ XPLM_API void XPLMControlCamera( * */ XPLM_API void XPLMDontControlCamera(void); - /* * XPLMIsCameraBeingControlled * @@ -150,7 +145,6 @@ XPLM_API void XPLMDontControlCamera(void); */ XPLM_API int XPLMIsCameraBeingControlled( XPLMCameraControlDuration * outCameraControlDuration); /* Can be NULL */ - /* * XPLMReadCameraPosition * @@ -159,7 +153,6 @@ XPLM_API int XPLMIsCameraBeingControlled( */ XPLM_API void XPLMReadCameraPosition( XPLMCameraPosition_t * outCameraPosition); - #ifdef __cplusplus } #endif diff --git a/Example/Lib/SDK/CHeaders/XPLM/XPLMDataAccess.h b/Example/Lib/SDK/CHeaders/XPLM/XPLMDataAccess.h index 22c28ee..d647740 100644 --- a/Example/Lib/SDK/CHeaders/XPLM/XPLMDataAccess.h +++ b/Example/Lib/SDK/CHeaders/XPLM/XPLMDataAccess.h @@ -2,7 +2,7 @@ #define _XPLMDataAccess_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -115,7 +115,6 @@ extern "C" { * */ - /* * XPLMDataRef * @@ -126,7 +125,6 @@ extern "C" { * */ typedef void * XPLMDataRef; - /* * XPLMDataTypeID * @@ -165,7 +163,6 @@ enum { }; typedef int XPLMDataTypeID; - #if defined(XPLM400) /* * XPLMCountDataRefs @@ -175,7 +172,6 @@ typedef int XPLMDataTypeID; */ XPLM_API int XPLMCountDataRefs(void); #endif /* XPLM400 */ - #if defined(XPLM400) /* * XPLMGetDataRefsByIndex @@ -190,7 +186,6 @@ XPLM_API void XPLMGetDataRefsByIndex( int count, XPLMDataRef * outDataRefs); #endif /* XPLM400 */ - #if defined(XPLM400) /* * XPLMDataRefInfo_t @@ -214,7 +209,6 @@ typedef struct { XPLMPluginID owner; } XPLMDataRefInfo_t; #endif /* XPLM400 */ - #if defined(XPLM400) /* * XPLMGetDataRefInfo @@ -227,7 +221,6 @@ XPLM_API void XPLMGetDataRefInfo( XPLMDataRef inDataRef, XPLMDataRefInfo_t * outInfo); #endif /* XPLM400 */ - /* * XPLMFindDataRef * @@ -244,7 +237,6 @@ XPLM_API void XPLMGetDataRefInfo( */ XPLM_API XPLMDataRef XPLMFindDataRef( const char * inDataRefName); - /* * XPLMCanWriteDataRef * @@ -259,7 +251,6 @@ XPLM_API XPLMDataRef XPLMFindDataRef( */ XPLM_API int XPLMCanWriteDataRef( XPLMDataRef inDataRef); - /* * XPLMIsDataRefGood * @@ -277,7 +268,6 @@ XPLM_API int XPLMCanWriteDataRef( */ XPLM_API int XPLMIsDataRefGood( XPLMDataRef inDataRef); - /* * XPLMGetDataRefTypes * @@ -288,7 +278,6 @@ XPLM_API int XPLMIsDataRefGood( */ XPLM_API XPLMDataTypeID XPLMGetDataRefTypes( XPLMDataRef inDataRef); - /*************************************************************************** * DATA ACCESSORS ***************************************************************************/ @@ -313,7 +302,6 @@ XPLM_API XPLMDataTypeID XPLMGetDataRefTypes( * */ - /* * XPLMGetDatai * @@ -323,7 +311,6 @@ XPLM_API XPLMDataTypeID XPLMGetDataRefTypes( */ XPLM_API int XPLMGetDatai( XPLMDataRef inDataRef); - /* * XPLMSetDatai * @@ -335,7 +322,6 @@ XPLM_API int XPLMGetDatai( XPLM_API void XPLMSetDatai( XPLMDataRef inDataRef, int inValue); - /* * XPLMGetDataf * @@ -346,7 +332,6 @@ XPLM_API void XPLMSetDatai( */ XPLM_API float XPLMGetDataf( XPLMDataRef inDataRef); - /* * XPLMSetDataf * @@ -358,7 +343,6 @@ XPLM_API float XPLMGetDataf( XPLM_API void XPLMSetDataf( XPLMDataRef inDataRef, float inValue); - /* * XPLMGetDatad * @@ -369,7 +353,6 @@ XPLM_API void XPLMSetDataf( */ XPLM_API double XPLMGetDatad( XPLMDataRef inDataRef); - /* * XPLMSetDatad * @@ -381,7 +364,6 @@ XPLM_API double XPLMGetDatad( XPLM_API void XPLMSetDatad( XPLMDataRef inDataRef, double inValue); - /* * XPLMGetDatavi * @@ -404,7 +386,6 @@ XPLM_API int XPLMGetDatavi( int * outValues, /* Can be NULL */ int inOffset, int inMax); - /* * XPLMSetDatavi * @@ -424,7 +405,6 @@ XPLM_API void XPLMSetDatavi( int * inValues, int inoffset, int inCount); - /* * XPLMGetDatavf * @@ -448,7 +428,6 @@ XPLM_API int XPLMGetDatavf( float * outValues, /* Can be NULL */ int inOffset, int inMax); - /* * XPLMSetDatavf * @@ -468,7 +447,6 @@ XPLM_API void XPLMSetDatavf( float * inValues, int inoffset, int inCount); - /* * XPLMGetDatab * @@ -491,7 +469,6 @@ XPLM_API int XPLMGetDatab( void * outValue, /* Can be NULL */ int inOffset, int inMaxBytes); - /* * XPLMSetDatab * @@ -511,7 +488,6 @@ XPLM_API void XPLMSetDatab( void * inValue, int inOffset, int inLength); - /*************************************************************************** * PUBLISHING YOUR PLUGIN'S DATA ***************************************************************************/ @@ -534,7 +510,6 @@ XPLM_API void XPLMSetDatab( * */ - /* * XPLMGetDatai_f * @@ -554,7 +529,6 @@ XPLM_API void XPLMSetDatab( */ typedef int (* XPLMGetDatai_f)( void * inRefcon); - /* * XPLMSetDatai_f * @@ -562,14 +536,12 @@ typedef int (* XPLMGetDatai_f)( typedef void (* XPLMSetDatai_f)( void * inRefcon, int inValue); - /* * XPLMGetDataf_f * */ typedef float (* XPLMGetDataf_f)( void * inRefcon); - /* * XPLMSetDataf_f * @@ -577,14 +549,12 @@ typedef float (* XPLMGetDataf_f)( typedef void (* XPLMSetDataf_f)( void * inRefcon, float inValue); - /* * XPLMGetDatad_f * */ typedef double (* XPLMGetDatad_f)( void * inRefcon); - /* * XPLMSetDatad_f * @@ -592,7 +562,6 @@ typedef double (* XPLMGetDatad_f)( typedef void (* XPLMSetDatad_f)( void * inRefcon, double inValue); - /* * XPLMGetDatavi_f * @@ -602,7 +571,6 @@ typedef int (* XPLMGetDatavi_f)( int * outValues, /* Can be NULL */ int inOffset, int inMax); - /* * XPLMSetDatavi_f * @@ -612,7 +580,6 @@ typedef void (* XPLMSetDatavi_f)( int * inValues, int inOffset, int inCount); - /* * XPLMGetDatavf_f * @@ -622,7 +589,6 @@ typedef int (* XPLMGetDatavf_f)( float * outValues, /* Can be NULL */ int inOffset, int inMax); - /* * XPLMSetDatavf_f * @@ -632,7 +598,6 @@ typedef void (* XPLMSetDatavf_f)( float * inValues, int inOffset, int inCount); - /* * XPLMGetDatab_f * @@ -642,7 +607,6 @@ typedef int (* XPLMGetDatab_f)( void * outValue, /* Can be NULL */ int inOffset, int inMaxLength); - /* * XPLMSetDatab_f * @@ -652,7 +616,6 @@ typedef void (* XPLMSetDatab_f)( void * inValue, int inOffset, int inLength); - /* * XPLMRegisterDataAccessor * @@ -685,7 +648,6 @@ XPLM_API XPLMDataRef XPLMRegisterDataAccessor( XPLMSetDatab_f inWriteData, void * inReadRefcon, void * inWriteRefcon); - /* * XPLMUnregisterDataAccessor * @@ -697,7 +659,6 @@ XPLM_API XPLMDataRef XPLMRegisterDataAccessor( */ XPLM_API void XPLMUnregisterDataAccessor( XPLMDataRef inDataRef); - /*************************************************************************** * SHARING DATA BETWEEN MULTIPLE PLUGINS ***************************************************************************/ @@ -737,7 +698,6 @@ XPLM_API void XPLMUnregisterDataAccessor( * */ - /* * XPLMDataChanged_f * @@ -749,7 +709,6 @@ XPLM_API void XPLMUnregisterDataAccessor( */ typedef void (* XPLMDataChanged_f)( void * inRefcon); - /* * XPLMShareData * @@ -775,7 +734,6 @@ XPLM_API int XPLMShareData( XPLMDataTypeID inDataType, XPLMDataChanged_f inNotificationFunc, void * inNotificationRefcon); - /* * XPLMUnshareData * @@ -790,7 +748,6 @@ XPLM_API int XPLMUnshareData( XPLMDataTypeID inDataType, XPLMDataChanged_f inNotificationFunc, void * inNotificationRefcon); - #ifdef __cplusplus } #endif diff --git a/Example/Lib/SDK/CHeaders/XPLM/XPLMDefs.h b/Example/Lib/SDK/CHeaders/XPLM/XPLMDefs.h index 7ad9b89..90620a1 100644 --- a/Example/Lib/SDK/CHeaders/XPLM/XPLMDefs.h +++ b/Example/Lib/SDK/CHeaders/XPLM/XPLMDefs.h @@ -2,7 +2,7 @@ #define _XPLMDefs_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -31,6 +31,7 @@ extern "C" { #if IBM #include #endif + #include /*************************************************************************** * DLL Definitions @@ -46,7 +47,6 @@ extern "C" { * */ - #ifdef __cplusplus #if APL #if __GNUC__ >= 4 @@ -120,7 +120,6 @@ extern "C" { #else #error "Platform not defined!" #endif - /*************************************************************************** * GLOBAL DEFINITIONS ***************************************************************************/ @@ -129,7 +128,6 @@ extern "C" { * */ - /* * XPLMPluginID * @@ -147,16 +145,12 @@ extern "C" { * */ typedef int XPLMPluginID; - /* No plugin. */ #define XPLM_NO_PLUGIN_ID (-1) - /* X-Plane itself */ #define XPLM_PLUGIN_XPLANE (0) - -/* The current XPLM revision is 4.1.1 (411). */ -#define kXPLM_Version (411) - +/* The current XPLM revision is 4.3.0 (430). */ +#define kXPLM_Version (430) /* * XPLMKeyFlags * @@ -193,7 +187,6 @@ enum { }; typedef int XPLMKeyFlags; - /*************************************************************************** * ASCII CONTROL KEY CODES ***************************************************************************/ @@ -211,45 +204,25 @@ typedef int XPLMKeyFlags; * */ - #define XPLM_KEY_RETURN 13 - #define XPLM_KEY_ESCAPE 27 - #define XPLM_KEY_TAB 9 - #define XPLM_KEY_DELETE 8 - #define XPLM_KEY_LEFT 28 - #define XPLM_KEY_RIGHT 29 - #define XPLM_KEY_UP 30 - #define XPLM_KEY_DOWN 31 - #define XPLM_KEY_0 48 - #define XPLM_KEY_1 49 - #define XPLM_KEY_2 50 - #define XPLM_KEY_3 51 - #define XPLM_KEY_4 52 - #define XPLM_KEY_5 53 - #define XPLM_KEY_6 54 - #define XPLM_KEY_7 55 - #define XPLM_KEY_8 56 - #define XPLM_KEY_9 57 - #define XPLM_KEY_DECIMAL 46 - /*************************************************************************** * VIRTUAL KEY CODES ***************************************************************************/ @@ -280,233 +253,121 @@ typedef int XPLMKeyFlags; * */ - #define XPLM_VK_BACK 0x08 - #define XPLM_VK_TAB 0x09 - #define XPLM_VK_CLEAR 0x0C - #define XPLM_VK_RETURN 0x0D - #define XPLM_VK_ESCAPE 0x1B - #define XPLM_VK_SPACE 0x20 - #define XPLM_VK_PRIOR 0x21 - #define XPLM_VK_NEXT 0x22 - #define XPLM_VK_END 0x23 - #define XPLM_VK_HOME 0x24 - #define XPLM_VK_LEFT 0x25 - #define XPLM_VK_UP 0x26 - #define XPLM_VK_RIGHT 0x27 - #define XPLM_VK_DOWN 0x28 - #define XPLM_VK_SELECT 0x29 - #define XPLM_VK_PRINT 0x2A - #define XPLM_VK_EXECUTE 0x2B - #define XPLM_VK_SNAPSHOT 0x2C - #define XPLM_VK_INSERT 0x2D - #define XPLM_VK_DELETE 0x2E - #define XPLM_VK_HELP 0x2F - /* XPLM_VK_0 thru XPLM_VK_9 are the same as ASCII '0' thru '9' (0x30 - 0x39) */ #define XPLM_VK_0 0x30 - #define XPLM_VK_1 0x31 - #define XPLM_VK_2 0x32 - #define XPLM_VK_3 0x33 - #define XPLM_VK_4 0x34 - #define XPLM_VK_5 0x35 - #define XPLM_VK_6 0x36 - #define XPLM_VK_7 0x37 - #define XPLM_VK_8 0x38 - #define XPLM_VK_9 0x39 - /* XPLM_VK_A thru XPLM_VK_Z are the same as ASCII 'A' thru 'Z' (0x41 - 0x5A) */ #define XPLM_VK_A 0x41 - #define XPLM_VK_B 0x42 - #define XPLM_VK_C 0x43 - #define XPLM_VK_D 0x44 - #define XPLM_VK_E 0x45 - #define XPLM_VK_F 0x46 - #define XPLM_VK_G 0x47 - #define XPLM_VK_H 0x48 - #define XPLM_VK_I 0x49 - #define XPLM_VK_J 0x4A - #define XPLM_VK_K 0x4B - #define XPLM_VK_L 0x4C - #define XPLM_VK_M 0x4D - #define XPLM_VK_N 0x4E - #define XPLM_VK_O 0x4F - #define XPLM_VK_P 0x50 - #define XPLM_VK_Q 0x51 - #define XPLM_VK_R 0x52 - #define XPLM_VK_S 0x53 - #define XPLM_VK_T 0x54 - #define XPLM_VK_U 0x55 - #define XPLM_VK_V 0x56 - #define XPLM_VK_W 0x57 - #define XPLM_VK_X 0x58 - #define XPLM_VK_Y 0x59 - #define XPLM_VK_Z 0x5A - #define XPLM_VK_NUMPAD0 0x60 - #define XPLM_VK_NUMPAD1 0x61 - #define XPLM_VK_NUMPAD2 0x62 - #define XPLM_VK_NUMPAD3 0x63 - #define XPLM_VK_NUMPAD4 0x64 - #define XPLM_VK_NUMPAD5 0x65 - #define XPLM_VK_NUMPAD6 0x66 - #define XPLM_VK_NUMPAD7 0x67 - #define XPLM_VK_NUMPAD8 0x68 - #define XPLM_VK_NUMPAD9 0x69 - #define XPLM_VK_MULTIPLY 0x6A - #define XPLM_VK_ADD 0x6B - #define XPLM_VK_SEPARATOR 0x6C - #define XPLM_VK_SUBTRACT 0x6D - #define XPLM_VK_DECIMAL 0x6E - #define XPLM_VK_DIVIDE 0x6F - #define XPLM_VK_F1 0x70 - #define XPLM_VK_F2 0x71 - #define XPLM_VK_F3 0x72 - #define XPLM_VK_F4 0x73 - #define XPLM_VK_F5 0x74 - #define XPLM_VK_F6 0x75 - #define XPLM_VK_F7 0x76 - #define XPLM_VK_F8 0x77 - #define XPLM_VK_F9 0x78 - #define XPLM_VK_F10 0x79 - #define XPLM_VK_F11 0x7A - #define XPLM_VK_F12 0x7B - #define XPLM_VK_F13 0x7C - #define XPLM_VK_F14 0x7D - #define XPLM_VK_F15 0x7E - #define XPLM_VK_F16 0x7F - #define XPLM_VK_F17 0x80 - #define XPLM_VK_F18 0x81 - #define XPLM_VK_F19 0x82 - #define XPLM_VK_F20 0x83 - #define XPLM_VK_F21 0x84 - #define XPLM_VK_F22 0x85 - #define XPLM_VK_F23 0x86 - #define XPLM_VK_F24 0x87 - /* The following definitions are extended and are not based on the Microsoft * * key set. */ #define XPLM_VK_EQUAL 0xB0 - #define XPLM_VK_MINUS 0xB1 - #define XPLM_VK_RBRACE 0xB2 - #define XPLM_VK_LBRACE 0xB3 - #define XPLM_VK_QUOTE 0xB4 - #define XPLM_VK_SEMICOLON 0xB5 - #define XPLM_VK_BACKSLASH 0xB6 - #define XPLM_VK_COMMA 0xB7 - #define XPLM_VK_SLASH 0xB8 - #define XPLM_VK_PERIOD 0xB9 - #define XPLM_VK_BACKQUOTE 0xBA - #define XPLM_VK_ENTER 0xBB - #define XPLM_VK_NUMPAD_ENT 0xBC - #define XPLM_VK_NUMPAD_EQ 0xBD - /* * XPLMFixedString150_t * @@ -538,6 +399,111 @@ enum { /* X-Plane shows the cursor but lets you select an OS cursor. */ xplm_CursorCustom = 3, +#if defined(XPLM420) + /* X-Plane shows a small bi-directional knob-rotating cursor. */ + xplm_CursorRotateSmall = 4, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a small counter-clockwise knob-rotating cursor. */ + xplm_CursorRotateSmallLeft = 5, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a small clockwise knob-rotating cursor. */ + xplm_CursorRotateSmallRight = 6, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a medium bi-directional knob-rotating cursor. */ + xplm_CursorRotateMedium = 7, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a medium counter-clockwise knob-rotating cursor. */ + xplm_CursorRotateMediumLeft = 8, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a medium clockwise knob-rotating cursor. */ + xplm_CursorRotateMediumRight = 9, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a large bi-directional knob-rotating cursor. */ + xplm_CursorRotateLarge = 10, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a large counter-clockwise knob-rotating cursor. */ + xplm_CursorRotateLargeLeft = 11, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a large clockwise knob-rotating cursor. */ + xplm_CursorRotateLargeRight = 12, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows an up-and-down arrows cursor. */ + xplm_CursorUpDown = 13, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a down arrow cursor. */ + xplm_CursorDown = 14, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows an up arrow cursor. */ + xplm_CursorUp = 15, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a left-right arrow cursor. */ + xplm_CursorLeftRight = 16, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a left arrow cursor. */ + xplm_CursorLeft = 17, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a right arrow cursor. */ + xplm_CursorRight = 18, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a button-pushing cursor. */ + xplm_CursorButton = 19, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a handle-grabbing cursor. */ + xplm_CursorHandle = 20, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a four-arrows cursor. */ + xplm_CursorFourArrows = 21, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a cursor to drag a horizontal splitter bar. */ + xplm_CursorSplitterH = 22, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a cursor to drag a vertical splitter bar. */ + xplm_CursorSplitterV = 23, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows an I-Beam cursor for text editing. */ + xplm_CursorText = 24, + +#endif /* XPLM420 */ }; typedef int XPLMCursorStatus; diff --git a/Example/Lib/SDK/CHeaders/XPLM/XPLMDisplay.h b/Example/Lib/SDK/CHeaders/XPLM/XPLMDisplay.h index ba88487..1a548bb 100644 --- a/Example/Lib/SDK/CHeaders/XPLM/XPLMDisplay.h +++ b/Example/Lib/SDK/CHeaders/XPLM/XPLMDisplay.h @@ -2,7 +2,7 @@ #define _XPLMDisplay_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -113,7 +113,6 @@ extern "C" { * */ - /* * XPLMDrawingPhase * @@ -217,7 +216,6 @@ enum { }; typedef int XPLMDrawingPhase; - /* * XPLMDrawCallback_f * @@ -238,7 +236,6 @@ typedef int (* XPLMDrawCallback_f)( XPLMDrawingPhase inPhase, int inIsBefore, void * inRefcon); - /* * XPLMRegisterDrawCallback * @@ -259,7 +256,6 @@ XPLM_API int XPLMRegisterDrawCallback( XPLMDrawingPhase inPhase, int inWantsBefore, void * inRefcon); - /* * XPLMUnregisterDrawCallback * @@ -278,7 +274,6 @@ XPLM_API int XPLMUnregisterDrawCallback( XPLMDrawingPhase inPhase, int inWantsBefore, void * inRefcon); - #if defined(XPLM400) /*************************************************************************** * AVIONICS API @@ -311,7 +306,6 @@ XPLM_API int XPLMUnregisterDrawCallback( * */ - /* * XPLMDeviceID * @@ -380,10 +374,14 @@ enum { /* Airbus MCDU, copilot side. */ xplm_device_MCDU_2 = 19, +#if defined(XPLM430) + /* Airbus MCDU 3. */ + xplm_device_MCDU_3 = 24, + +#endif /* XPLM430 */ }; typedef int XPLMDeviceID; - /* * XPLMAvionicsCallback_f * @@ -406,7 +404,6 @@ typedef int (* XPLMAvionicsCallback_f)( XPLMDeviceID inDeviceID, int inIsBefore, void * inRefcon); - #if defined(XPLM410) /* * XPLMAvionicsMouse_f @@ -424,7 +421,6 @@ typedef int (* XPLMAvionicsMouse_f)( XPLMMouseStatus inMouse, void * inRefcon); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMAvionicsMouseWheel_f @@ -445,7 +441,6 @@ typedef int (* XPLMAvionicsMouseWheel_f)( int clicks, void * inRefcon); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMAvionicsCursor_f @@ -461,7 +456,6 @@ typedef XPLMCursorStatus (* XPLMAvionicsCursor_f)( int y, void * inRefcon); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMAvionicsKeyboard_f @@ -478,7 +472,6 @@ typedef int (* XPLMAvionicsKeyboard_f)( void * inRefCon, int losingFocus); #endif /* XPLM410 */ - /* * XPLMAvionicsID * @@ -490,7 +483,6 @@ typedef int (* XPLMAvionicsKeyboard_f)( * */ typedef void * XPLMAvionicsID; - /* * XPLMCustomizeAvionics_t * @@ -559,7 +551,6 @@ typedef struct { * to pass information to yourself as needed. */ void * refcon; } XPLMCustomizeAvionics_t; - /* * XPLMRegisterAvionicsCallbacksEx * @@ -577,7 +568,6 @@ typedef struct { */ XPLM_API XPLMAvionicsID XPLMRegisterAvionicsCallbacksEx( XPLMCustomizeAvionics_t * inParams); - /* * XPLMGetAvionicsHandle * @@ -591,7 +581,6 @@ XPLM_API XPLMAvionicsID XPLMRegisterAvionicsCallbacksEx( */ XPLM_API XPLMAvionicsID XPLMGetAvionicsHandle( XPLMDeviceID inDeviceID); - /* * XPLMUnregisterAvionicsCallbacks * @@ -602,7 +591,6 @@ XPLM_API XPLMAvionicsID XPLMGetAvionicsHandle( */ XPLM_API void XPLMUnregisterAvionicsCallbacks( XPLMAvionicsID inAvionicsId); - #if defined(XPLM410) /* * XPLMAvionicsScreenCallback_f @@ -621,7 +609,6 @@ XPLM_API void XPLMUnregisterAvionicsCallbacks( typedef void (* XPLMAvionicsScreenCallback_f)( void * inRefcon); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMAvionicsBezelCallback_f @@ -644,7 +631,6 @@ typedef void (* XPLMAvionicsBezelCallback_f)( float inAmbiantB, void * inRefcon); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMAvionicsBrightness_f @@ -677,7 +663,6 @@ typedef float (* XPLMAvionicsBrightness_f)( float inBusVoltsRatio, void * inRefcon); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMCreateAvionics_t @@ -761,7 +746,6 @@ typedef struct { void * refcon; } XPLMCreateAvionics_t; #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMCreateAvionicsEx @@ -779,7 +763,6 @@ typedef struct { XPLM_API XPLMAvionicsID XPLMCreateAvionicsEx( XPLMCreateAvionics_t * inParams); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMDestroyAvionics @@ -792,7 +775,6 @@ XPLM_API XPLMAvionicsID XPLMCreateAvionicsEx( XPLM_API void XPLMDestroyAvionics( XPLMAvionicsID inHandle); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMIsAvionicsBound @@ -804,7 +786,6 @@ XPLM_API void XPLMDestroyAvionics( XPLM_API int XPLMIsAvionicsBound( XPLMAvionicsID inHandle); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMSetAvionicsBrightnessRheo @@ -827,7 +808,6 @@ XPLM_API void XPLMSetAvionicsBrightnessRheo( XPLMAvionicsID inHandle, float brightness); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMGetAvionicsBrightnessRheo @@ -848,7 +828,6 @@ XPLM_API void XPLMSetAvionicsBrightnessRheo( XPLM_API float XPLMGetAvionicsBrightnessRheo( XPLMAvionicsID inHandle); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMGetAvionicsBusVoltsRatio @@ -861,7 +840,6 @@ XPLM_API float XPLMGetAvionicsBrightnessRheo( XPLM_API float XPLMGetAvionicsBusVoltsRatio( XPLMAvionicsID inHandle); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMIsCursorOverAvionics @@ -877,7 +855,6 @@ XPLM_API int XPLMIsCursorOverAvionics( int * outX, /* Can be NULL */ int * outY); /* Can be NULL */ #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMAvionicsNeedsDrawing @@ -891,7 +868,6 @@ XPLM_API int XPLMIsCursorOverAvionics( XPLM_API void XPLMAvionicsNeedsDrawing( XPLMAvionicsID inHandle); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMSetAvionicsPopupVisible @@ -903,7 +879,6 @@ XPLM_API void XPLMSetAvionicsPopupVisible( XPLMAvionicsID inHandle, int inVisible); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMIsAvionicsPopupVisible @@ -914,7 +889,6 @@ XPLM_API void XPLMSetAvionicsPopupVisible( XPLM_API int XPLMIsAvionicsPopupVisible( XPLMAvionicsID inHandle); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMPopOutAvionics @@ -925,7 +899,6 @@ XPLM_API int XPLMIsAvionicsPopupVisible( XPLM_API void XPLMPopOutAvionics( XPLMAvionicsID inHandle); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMIsAvionicsPoppedOut @@ -936,7 +909,6 @@ XPLM_API void XPLMPopOutAvionics( XPLM_API int XPLMIsAvionicsPoppedOut( XPLMAvionicsID inHandle); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMTakeAvionicsKeyboardFocus @@ -948,7 +920,6 @@ XPLM_API int XPLMIsAvionicsPoppedOut( XPLM_API void XPLMTakeAvionicsKeyboardFocus( XPLMAvionicsID inHandle); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMHasAvionicsKeyboardFocus @@ -960,7 +931,6 @@ XPLM_API void XPLMTakeAvionicsKeyboardFocus( XPLM_API int XPLMHasAvionicsKeyboardFocus( XPLMAvionicsID inHandle); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMGetAvionicsGeometry @@ -976,7 +946,6 @@ XPLM_API void XPLMGetAvionicsGeometry( int * outRight, /* Can be NULL */ int * outBottom); /* Can be NULL */ #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMSetAvionicsGeometry @@ -992,7 +961,6 @@ XPLM_API void XPLMSetAvionicsGeometry( int inRight, int inBottom); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMGetAvionicsGeometryOS @@ -1007,7 +975,6 @@ XPLM_API void XPLMGetAvionicsGeometryOS( int * outRight, /* Can be NULL */ int * outBottom); /* Can be NULL */ #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMSetAvionicsGeometryOS @@ -1022,7 +989,6 @@ XPLM_API void XPLMSetAvionicsGeometryOS( int inRight, int inBottom); #endif /* XPLM410 */ - #endif /* XPLM400 */ /*************************************************************************** * WINDOW API @@ -1063,7 +1029,6 @@ XPLM_API void XPLMSetAvionicsGeometryOS( * */ - /* * XPLMWindowID * @@ -1074,7 +1039,6 @@ XPLM_API void XPLMSetAvionicsGeometryOS( * */ typedef void * XPLMWindowID; - /* * XPLMDrawWindow_f * @@ -1092,7 +1056,6 @@ typedef void * XPLMWindowID; typedef void (* XPLMDrawWindow_f)( XPLMWindowID inWindowID, void * inRefcon); - /* * XPLMHandleKey_f * @@ -1122,7 +1085,6 @@ typedef void (* XPLMHandleKey_f)( char inVirtualKey, void * inRefcon, int losingFocus); - /* * XPLMHandleMouseClick_f * @@ -1154,7 +1116,6 @@ typedef int (* XPLMHandleMouseClick_f)( int y, XPLMMouseStatus inMouse, void * inRefcon); - #if defined(XPLM200) /* * XPLMHandleCursor_f @@ -1192,7 +1153,6 @@ typedef XPLMCursorStatus (* XPLMHandleCursor_f)( int y, void * inRefcon); #endif /* XPLM200 */ - #if defined(XPLM200) /* * XPLMHandleMouseWheel_f @@ -1222,7 +1182,6 @@ typedef int (* XPLMHandleMouseWheel_f)( int clicks, void * inRefcon); #endif /* XPLM200 */ - #if defined(XPLM300) /* * XPLMWindowLayer @@ -1262,7 +1221,6 @@ enum { }; typedef int XPLMWindowLayer; #endif /* XPLM300 */ - #if defined(XPLM301) /* * XPLMWindowDecoration @@ -1300,7 +1258,6 @@ enum { }; typedef int XPLMWindowDecoration; #endif /* XPLM301 */ - #if defined(XPLM200) /* * XPLMCreateWindow_t @@ -1372,7 +1329,6 @@ typedef struct { #endif /* XPLM300 */ } XPLMCreateWindow_t; #endif /* XPLM200 */ - #if defined(XPLM200) /* * XPLMCreateWindowEx @@ -1388,7 +1344,6 @@ typedef struct { XPLM_API XPLMWindowID XPLMCreateWindowEx( XPLMCreateWindow_t * inParams); #endif /* XPLM200 */ - /* * XPLMCreateWindow * @@ -1421,7 +1376,6 @@ XPLM_API XPLMWindowID XPLMCreateWindow( XPLMHandleKey_f inKeyCallback, XPLMHandleMouseClick_f inMouseCallback, void * inRefcon); - /* * XPLMDestroyWindow * @@ -1432,7 +1386,6 @@ XPLM_API XPLMWindowID XPLMCreateWindow( */ XPLM_API void XPLMDestroyWindow( XPLMWindowID inWindowID); - /* * XPLMGetScreenSize * @@ -1444,7 +1397,6 @@ XPLM_API void XPLMDestroyWindow( XPLM_API void XPLMGetScreenSize( int * outWidth, /* Can be NULL */ int * outHeight); /* Can be NULL */ - #if defined(XPLM300) /* * XPLMGetScreenBoundsGlobal @@ -1485,7 +1437,6 @@ XPLM_API void XPLMGetScreenBoundsGlobal( int * outRight, /* Can be NULL */ int * outBottom); /* Can be NULL */ #endif /* XPLM300 */ - #if defined(XPLM300) /* * XPLMReceiveMonitorBoundsGlobal_f @@ -1504,7 +1455,6 @@ typedef void (* XPLMReceiveMonitorBoundsGlobal_f)( int inBottomBx, void * inRefcon); #endif /* XPLM300 */ - #if defined(XPLM300) /* * XPLMGetAllMonitorBoundsGlobal @@ -1534,7 +1484,6 @@ XPLM_API void XPLMGetAllMonitorBoundsGlobal( XPLMReceiveMonitorBoundsGlobal_f inMonitorBoundsCallback, void * inRefcon); #endif /* XPLM300 */ - #if defined(XPLM300) /* * XPLMReceiveMonitorBoundsOS_f @@ -1554,7 +1503,6 @@ typedef void (* XPLMReceiveMonitorBoundsOS_f)( int inBottomPx, void * inRefcon); #endif /* XPLM300 */ - #if defined(XPLM300) /* * XPLMGetAllMonitorBoundsOS @@ -1574,7 +1522,6 @@ XPLM_API void XPLMGetAllMonitorBoundsOS( XPLMReceiveMonitorBoundsOS_f inMonitorBoundsCallback, void * inRefcon); #endif /* XPLM300 */ - /* * XPLMGetMouseLocation * @@ -1598,7 +1545,6 @@ XPLM_API void XPLMGetAllMonitorBoundsOS( XPLM_API void XPLMGetMouseLocation( int * outX, /* Can be NULL */ int * outY); /* Can be NULL */ - #if defined(XPLM300) /* * XPLMGetMouseLocationGlobal @@ -1621,7 +1567,6 @@ XPLM_API void XPLMGetMouseLocationGlobal( int * outX, /* Can be NULL */ int * outY); /* Can be NULL */ #endif /* XPLM300 */ - /* * XPLMGetWindowGeometry * @@ -1646,7 +1591,6 @@ XPLM_API void XPLMGetWindowGeometry( int * outTop, /* Can be NULL */ int * outRight, /* Can be NULL */ int * outBottom); /* Can be NULL */ - /* * XPLMSetWindowGeometry * @@ -1669,7 +1613,6 @@ XPLM_API void XPLMSetWindowGeometry( int inTop, int inRight, int inBottom); - #if defined(XPLM300) /* * XPLMGetWindowGeometryOS @@ -1686,7 +1629,6 @@ XPLM_API void XPLMGetWindowGeometryOS( int * outRight, /* Can be NULL */ int * outBottom); /* Can be NULL */ #endif /* XPLM300 */ - #if defined(XPLM300) /* * XPLMSetWindowGeometryOS @@ -1708,7 +1650,6 @@ XPLM_API void XPLMSetWindowGeometryOS( int inRight, int inBottom); #endif /* XPLM300 */ - #if defined(XPLM301) /* * XPLMGetWindowGeometryVR @@ -1723,7 +1664,6 @@ XPLM_API void XPLMGetWindowGeometryVR( int * outWidthBoxels, /* Can be NULL */ int * outHeightBoxels); /* Can be NULL */ #endif /* XPLM301 */ - #if defined(XPLM301) /* * XPLMSetWindowGeometryVR @@ -1740,7 +1680,6 @@ XPLM_API void XPLMSetWindowGeometryVR( int widthBoxels, int heightBoxels); #endif /* XPLM301 */ - /* * XPLMGetWindowIsVisible * @@ -1749,7 +1688,6 @@ XPLM_API void XPLMSetWindowGeometryVR( */ XPLM_API int XPLMGetWindowIsVisible( XPLMWindowID inWindowID); - /* * XPLMSetWindowIsVisible * @@ -1759,7 +1697,6 @@ XPLM_API int XPLMGetWindowIsVisible( XPLM_API void XPLMSetWindowIsVisible( XPLMWindowID inWindowID, int inIsVisible); - #if defined(XPLM300) /* * XPLMWindowIsPoppedOut @@ -1776,7 +1713,6 @@ XPLM_API void XPLMSetWindowIsVisible( XPLM_API int XPLMWindowIsPoppedOut( XPLMWindowID inWindowID); #endif /* XPLM300 */ - #if defined(XPLM301) /* * XPLMWindowIsInVR @@ -1793,7 +1729,6 @@ XPLM_API int XPLMWindowIsPoppedOut( XPLM_API int XPLMWindowIsInVR( XPLMWindowID inWindowID); #endif /* XPLM301 */ - #if defined(XPLM300) /* * XPLMSetWindowGravity @@ -1825,7 +1760,6 @@ XPLM_API void XPLMSetWindowGravity( float inRightGravity, float inBottomGravity); #endif /* XPLM300 */ - #if defined(XPLM300) /* * XPLMSetWindowResizingLimits @@ -1847,7 +1781,6 @@ XPLM_API void XPLMSetWindowResizingLimits( int inMaxWidthBoxels, int inMaxHeightBoxels); #endif /* XPLM300 */ - #if defined(XPLM300) /* * XPLMWindowPositioningMode @@ -1893,7 +1826,6 @@ enum { }; typedef int XPLMWindowPositioningMode; #endif /* XPLM300 */ - #if defined(XPLM300) /* * XPLMSetWindowPositioningMode @@ -1917,7 +1849,6 @@ XPLM_API void XPLMSetWindowPositioningMode( XPLMWindowPositioningMode inPositioningMode, int inMonitorIndex); #endif /* XPLM300 */ - #if defined(XPLM300) /* * XPLMSetWindowTitle @@ -1932,7 +1863,6 @@ XPLM_API void XPLMSetWindowTitle( XPLMWindowID inWindowID, const char * inWindowTitle); #endif /* XPLM300 */ - /* * XPLMGetWindowRefCon * @@ -1942,7 +1872,6 @@ XPLM_API void XPLMSetWindowTitle( */ XPLM_API void * XPLMGetWindowRefCon( XPLMWindowID inWindowID); - /* * XPLMSetWindowRefCon * @@ -1953,7 +1882,6 @@ XPLM_API void * XPLMGetWindowRefCon( XPLM_API void XPLMSetWindowRefCon( XPLMWindowID inWindowID, void * inRefcon); - /* * XPLMTakeKeyboardFocus * @@ -1965,7 +1893,6 @@ XPLM_API void XPLMSetWindowRefCon( */ XPLM_API void XPLMTakeKeyboardFocus( XPLMWindowID inWindow); - /* * XPLMHasKeyboardFocus * @@ -1976,7 +1903,6 @@ XPLM_API void XPLMTakeKeyboardFocus( */ XPLM_API int XPLMHasKeyboardFocus( XPLMWindowID inWindow); - /* * XPLMBringWindowToFront * @@ -1996,7 +1922,6 @@ XPLM_API int XPLMHasKeyboardFocus( */ XPLM_API void XPLMBringWindowToFront( XPLMWindowID inWindow); - /* * XPLMIsWindowInFront * @@ -2018,7 +1943,6 @@ XPLM_API void XPLMBringWindowToFront( */ XPLM_API int XPLMIsWindowInFront( XPLMWindowID inWindow); - /*************************************************************************** * KEY SNIFFERS ***************************************************************************/ @@ -2028,7 +1952,6 @@ XPLM_API int XPLMIsWindowInFront( * */ - /* * XPLMKeySniffer_f * @@ -2056,7 +1979,6 @@ typedef int (* XPLMKeySniffer_f)( XPLMKeyFlags inFlags, char inVirtualKey, void * inRefcon); - /* * XPLMRegisterKeySniffer * @@ -2073,7 +1995,6 @@ XPLM_API int XPLMRegisterKeySniffer( XPLMKeySniffer_f inCallback, int inBeforeWindows, void * inRefcon); - /* * XPLMUnregisterKeySniffer * @@ -2086,7 +2007,6 @@ XPLM_API int XPLMUnregisterKeySniffer( XPLMKeySniffer_f inCallback, int inBeforeWindows, void * inRefcon); - /*************************************************************************** * HOT KEYS ***************************************************************************/ @@ -2097,7 +2017,6 @@ XPLM_API int XPLMUnregisterKeySniffer( * */ - /* * XPLMHotKey_f * @@ -2106,7 +2025,6 @@ XPLM_API int XPLMUnregisterKeySniffer( */ typedef void (* XPLMHotKey_f)( void * inRefcon); - /* * XPLMHotKeyID * @@ -2114,7 +2032,6 @@ typedef void (* XPLMHotKey_f)( * */ typedef void * XPLMHotKeyID; - /* * XPLMRegisterHotKey * @@ -2132,7 +2049,6 @@ XPLM_API XPLMHotKeyID XPLMRegisterHotKey( const char * inDescription, XPLMHotKey_f inCallback, void * inRefcon); - /* * XPLMUnregisterHotKey * @@ -2141,7 +2057,6 @@ XPLM_API XPLMHotKeyID XPLMRegisterHotKey( */ XPLM_API void XPLMUnregisterHotKey( XPLMHotKeyID inHotKey); - /* * XPLMCountHotKeys * @@ -2149,7 +2064,6 @@ XPLM_API void XPLMUnregisterHotKey( * */ XPLM_API int XPLMCountHotKeys(void); - /* * XPLMGetNthHotKey * @@ -2158,7 +2072,6 @@ XPLM_API int XPLMCountHotKeys(void); */ XPLM_API XPLMHotKeyID XPLMGetNthHotKey( int inIndex); - /* * XPLMGetHotKeyInfo * @@ -2172,7 +2085,6 @@ XPLM_API void XPLMGetHotKeyInfo( XPLMKeyFlags * outFlags, /* Can be NULL */ char * outDescription, /* Can be NULL */ XPLMPluginID * outPlugin); /* Can be NULL */ - /* * XPLMSetHotKeyCombination * @@ -2183,7 +2095,6 @@ XPLM_API void XPLMSetHotKeyCombination( XPLMHotKeyID inHotKey, char inVirtualKey, XPLMKeyFlags inFlags); - #ifdef __cplusplus } #endif diff --git a/Example/Lib/SDK/CHeaders/XPLM/XPLMGraphics.h b/Example/Lib/SDK/CHeaders/XPLM/XPLMGraphics.h index f05cb1c..f7f62f5 100644 --- a/Example/Lib/SDK/CHeaders/XPLM/XPLMGraphics.h +++ b/Example/Lib/SDK/CHeaders/XPLM/XPLMGraphics.h @@ -2,7 +2,7 @@ #define _XPLMGraphics_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -56,7 +56,6 @@ extern "C" { * */ - /* * XPLMTextureID * @@ -82,10 +81,21 @@ enum { xplm_Tex_AircraftLiteMap = 2, #endif /* XPLM_DEPRECATED */ +#if defined(XPLM420) + /* The weather radar instrument texture as controlled by the pilot-side radar * + * controls */ + xplm_Tex_Radar_Pilot = 3, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* The weather radar instrument texture as controlled by the * + * copilot-side radar controls */ + xplm_Tex_Radar_Copilot = 4, + +#endif /* XPLM420 */ }; typedef int XPLMTextureID; - /* * XPLMSetGraphicsState * @@ -142,7 +152,6 @@ XPLM_API void XPLMSetGraphicsState( int inEnableAlphaBlending, int inEnableDepthTesting, int inEnableDepthWriting); - /* * XPLMBindTexture2d * @@ -164,7 +173,6 @@ XPLM_API void XPLMSetGraphicsState( XPLM_API void XPLMBindTexture2d( int inTextureNum, int inTextureUnit); - /* * XPLMGenerateTextureNumbers * @@ -176,20 +184,16 @@ XPLM_API void XPLMBindTexture2d( XPLM_API void XPLMGenerateTextureNumbers( int * outTextureIDs, int inCount); - -#if defined(XPLM_DEPRECATED) /* * XPLMGetTexture * * XPLMGetTexture returns the OpenGL texture ID of an X-Plane texture based on * a generic identifying code. For example, you can get the texture for - * X-Plane's UI bitmaps. + * X-Plane's weather radar. * */ XPLM_API int XPLMGetTexture( XPLMTextureID inTexture); -#endif /* XPLM_DEPRECATED */ - /* * XPLMWorldToLocal * @@ -206,7 +210,6 @@ XPLM_API void XPLMWorldToLocal( double * outX, double * outY, double * outZ); - /* * XPLMLocalToWorld * @@ -226,7 +229,6 @@ XPLM_API void XPLMLocalToWorld( double * outLatitude, double * outLongitude, double * outAltitude); - /* * XPLMDrawTranslucentDarkBox * @@ -240,7 +242,6 @@ XPLM_API void XPLMDrawTranslucentDarkBox( int inTop, int inRight, int inBottom); - /*************************************************************************** * X-PLANE TEXT ***************************************************************************/ @@ -357,7 +358,6 @@ enum { }; typedef int XPLMFontID; - /* * XPLMDrawString * @@ -376,7 +376,6 @@ XPLM_API void XPLMDrawString( const char * inChar, int * inWordWrapWidth, /* Can be NULL */ XPLMFontID inFontID); - /* * XPLMDrawNumber * @@ -397,7 +396,6 @@ XPLM_API void XPLMDrawNumber( int inDecimals, int inShowSign, XPLMFontID inFontID); - /* * XPLMGetFontDimensions * @@ -412,7 +410,6 @@ XPLM_API void XPLMGetFontDimensions( int * outCharWidth, /* Can be NULL */ int * outCharHeight, /* Can be NULL */ int * outDigitsOnly); /* Can be NULL */ - #if defined(XPLM200) /* * XPLMMeasureString @@ -429,7 +426,6 @@ XPLM_API float XPLMMeasureString( const char * inChar, int inNumChars); #endif /* XPLM200 */ - #ifdef __cplusplus } #endif diff --git a/Example/Lib/SDK/CHeaders/XPLM/XPLMInstance.h b/Example/Lib/SDK/CHeaders/XPLM/XPLMInstance.h index f2460fb..54cc7fd 100644 --- a/Example/Lib/SDK/CHeaders/XPLM/XPLMInstance.h +++ b/Example/Lib/SDK/CHeaders/XPLM/XPLMInstance.h @@ -2,7 +2,7 @@ #define _XPLMInstance_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -54,7 +54,6 @@ extern "C" { * */ - /* * XPLMInstanceRef * @@ -62,7 +61,6 @@ extern "C" { * */ typedef void * XPLMInstanceRef; - /* * XPLMCreateInstance * @@ -86,7 +84,21 @@ typedef void * XPLMInstanceRef; XPLM_API XPLMInstanceRef XPLMCreateInstance( XPLMObjectRef obj, const char ** datarefs); - +#if defined(XPLM420) +/* + * XPLMInstanceSetAutoShift + * + * XPLMInstanceSetAutoShift tells X-Plane to move the location of your + * instance every time the sim\'s local coordinate sytem changes, so that a + * static instance does not have to be moved. Without this, a plugin is + * responsible for updating an instance's local position when the coordinate + * system shifts. Use this for static instances that you would not otherwise + * have to move. + * + */ +XPLM_API void XPLMInstanceSetAutoShift( + XPLMInstanceRef instance); +#endif /* XPLM420 */ /* * XPLMDestroyInstance * @@ -100,7 +112,6 @@ XPLM_API XPLMInstanceRef XPLMCreateInstance( */ XPLM_API void XPLMDestroyInstance( XPLMInstanceRef instance); - /*************************************************************************** * Instance Manipulation ***************************************************************************/ @@ -128,7 +139,28 @@ XPLM_API void XPLMInstanceSetPosition( XPLMInstanceRef instance, const XPLMDrawInfo_t * new_position, const float * data); - +#if defined(XPLM420) +/* + * XPLMInstanceSetPositionDouble + * + * Updates both the position of the instance and all datarefs you registered + * for it. Call this from a flight loop callback or UI callback. + * + * __DO_NOT__ call XPLMInstanceSetPositionDouble from a drawing callback; the + * whole point of instancing is that you do not need any drawing callbacks. + * Setting instance data from a drawing callback may have undefined + * consequences, and the drawing callback hurts FPS unnecessarily. + * + * The memory pointed to by the data pointer must be large enough to hold one + * float for every dataref you have registered, and must contain valid + * floating point data. + * + */ +XPLM_API void XPLMInstanceSetPositionDouble( + XPLMInstanceRef instance, + const XPLMDrawInfoDouble_t * new_position, + const float * data); +#endif /* XPLM420 */ #ifdef __cplusplus } #endif diff --git a/Example/Lib/SDK/CHeaders/XPLM/XPLMMap.h b/Example/Lib/SDK/CHeaders/XPLM/XPLMMap.h index de77144..33fe51c 100644 --- a/Example/Lib/SDK/CHeaders/XPLM/XPLMMap.h +++ b/Example/Lib/SDK/CHeaders/XPLM/XPLMMap.h @@ -2,7 +2,7 @@ #define _XPLMMap_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -79,7 +79,6 @@ extern "C" { * */ - /* * XPLMMapLayerID * @@ -88,7 +87,6 @@ extern "C" { * */ typedef void * XPLMMapLayerID; - /* * XPLMMapProjectionID * @@ -97,7 +95,6 @@ typedef void * XPLMMapLayerID; * */ typedef void * XPLMMapProjectionID; - /* * XPLMMapStyle * @@ -119,7 +116,6 @@ enum { }; typedef int XPLMMapStyle; - /* * XPLMMapDrawingCallback_f * @@ -143,7 +139,6 @@ typedef void (* XPLMMapDrawingCallback_f)( XPLMMapStyle mapStyle, XPLMMapProjectionID projection, void * inRefcon); - /* * XPLMMapIconDrawingCallback_f * @@ -169,7 +164,6 @@ typedef void (* XPLMMapIconDrawingCallback_f)( XPLMMapStyle mapStyle, XPLMMapProjectionID projection, void * inRefcon); - /* * XPLMMapLabelDrawingCallback_f * @@ -195,7 +189,6 @@ typedef void (* XPLMMapLabelDrawingCallback_f)( XPLMMapStyle mapStyle, XPLMMapProjectionID projection, void * inRefcon); - #endif /* XPLM300 */ #if defined(XPLM300) /*************************************************************************** @@ -209,7 +202,6 @@ typedef void (* XPLMMapLabelDrawingCallback_f)( * */ - /* * XPLMMapPrepareCacheCallback_f * @@ -237,7 +229,6 @@ typedef void (* XPLMMapPrepareCacheCallback_f)( const float * inTotalMapBoundsLeftTopRightBottom, XPLMMapProjectionID projection, void * inRefcon); - /* * XPLMMapWillBeDeletedCallback_f * @@ -249,7 +240,6 @@ typedef void (* XPLMMapPrepareCacheCallback_f)( typedef void (* XPLMMapWillBeDeletedCallback_f)( XPLMMapLayerID inLayer, void * inRefcon); - #endif /* XPLM300 */ #if defined(XPLM300) /*************************************************************************** @@ -269,7 +259,6 @@ typedef void (* XPLMMapWillBeDeletedCallback_f)( * */ - /* * XPLMMapLayerType * @@ -290,15 +279,12 @@ enum { }; typedef int XPLMMapLayerType; - /* Globally unique identifier for X-Plane's Map window, used as the * * mapToCreateLayerIn parameter in XPLMCreateMapLayer_t */ #define XPLM_MAP_USER_INTERFACE "XPLM_MAP_USER_INTERFACE" - /* Globally unique identifier for X-Plane's Instructor Operator Station * * window, used as the mapToCreateLayerIn parameter in XPLMCreateMapLayer_t */ #define XPLM_MAP_IOS "XPLM_MAP_IOS" - /* * XPLMCreateMapLayer_t * @@ -350,7 +336,6 @@ typedef struct { /* A reference to arbitrary data that will be passed to your callbacks */ void * refcon; } XPLMCreateMapLayer_t; - /* * XPLMCreateMapLayer * @@ -368,7 +353,6 @@ typedef struct { */ XPLM_API XPLMMapLayerID XPLMCreateMapLayer( XPLMCreateMapLayer_t * inParams); - /* * XPLMDestroyMapLayer * @@ -379,7 +363,6 @@ XPLM_API XPLMMapLayerID XPLMCreateMapLayer( */ XPLM_API int XPLMDestroyMapLayer( XPLMMapLayerID inLayer); - /* * XPLMMapCreatedCallback_f * @@ -393,7 +376,6 @@ XPLM_API int XPLMDestroyMapLayer( typedef void (* XPLMMapCreatedCallback_f)( const char * mapIdentifier, void * refcon); - /* * XPLMRegisterMapCreationHook * @@ -408,7 +390,6 @@ typedef void (* XPLMMapCreatedCallback_f)( XPLM_API void XPLMRegisterMapCreationHook( XPLMMapCreatedCallback_f callback, void * refcon); - /* * XPLMMapExists * @@ -419,7 +400,6 @@ XPLM_API void XPLMRegisterMapCreationHook( */ XPLM_API int XPLMMapExists( const char * mapIdentifier); - #endif /* XPLM300 */ #if defined(XPLM300) /*************************************************************************** @@ -441,7 +421,6 @@ XPLM_API int XPLMMapExists( * */ - /* * XPLMMapOrientation * @@ -463,7 +442,6 @@ enum { }; typedef int XPLMMapOrientation; - /* * XPLMDrawMapIconFromSheet * @@ -509,7 +487,6 @@ XPLM_API void XPLMDrawMapIconFromSheet( XPLMMapOrientation orientation, float rotationDegrees, float mapWidth); - /* * XPLMDrawMapLabel * @@ -526,7 +503,6 @@ XPLM_API void XPLMDrawMapLabel( float mapY, XPLMMapOrientation orientation, float rotationDegrees); - #endif /* XPLM300 */ #if defined(XPLM300) /*************************************************************************** @@ -548,7 +524,6 @@ XPLM_API void XPLMDrawMapLabel( * */ - /* * XPLMMapProject * @@ -566,7 +541,6 @@ XPLM_API void XPLMMapProject( double longitude, float * outX, float * outY); - /* * XPLMMapUnproject * @@ -584,7 +558,6 @@ XPLM_API void XPLMMapUnproject( float mapY, double * outLatitude, double * outLongitude); - /* * XPLMMapScaleMeter * @@ -600,7 +573,6 @@ XPLM_API float XPLMMapScaleMeter( XPLMMapProjectionID projection, float mapX, float mapY); - /* * XPLMMapGetNorthHeading * @@ -619,7 +591,6 @@ XPLM_API float XPLMMapGetNorthHeading( XPLMMapProjectionID projection, float mapX, float mapY); - #endif /* XPLM300 */ #ifdef __cplusplus } diff --git a/Example/Lib/SDK/CHeaders/XPLM/XPLMMenus.h b/Example/Lib/SDK/CHeaders/XPLM/XPLMMenus.h index 2c8fcd0..146d66c 100644 --- a/Example/Lib/SDK/CHeaders/XPLM/XPLMMenus.h +++ b/Example/Lib/SDK/CHeaders/XPLM/XPLMMenus.h @@ -2,7 +2,7 @@ #define _XPLMMenus_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -72,7 +72,6 @@ enum { }; typedef int XPLMMenuCheck; - /* * XPLMMenuID * @@ -80,7 +79,6 @@ typedef int XPLMMenuCheck; * */ typedef void * XPLMMenuID; - /* * XPLMMenuHandler_f * @@ -92,7 +90,6 @@ typedef void * XPLMMenuID; typedef void (* XPLMMenuHandler_f)( void * inMenuRef, void * inItemRef); - /* * XPLMFindPluginsMenu * @@ -101,7 +98,6 @@ typedef void (* XPLMMenuHandler_f)( * */ XPLM_API XPLMMenuID XPLMFindPluginsMenu(void); - #if defined(XPLM300) /* * XPLMFindAircraftMenu @@ -120,7 +116,6 @@ XPLM_API XPLMMenuID XPLMFindPluginsMenu(void); */ XPLM_API XPLMMenuID XPLMFindAircraftMenu(void); #endif /* XPLM300 */ - /* * XPLMCreateMenu * @@ -142,7 +137,6 @@ XPLM_API XPLMMenuID XPLMCreateMenu( int inParentItem, XPLMMenuHandler_f inHandler, void * inMenuRef); - /* * XPLMDestroyMenu * @@ -152,7 +146,6 @@ XPLM_API XPLMMenuID XPLMCreateMenu( */ XPLM_API void XPLMDestroyMenu( XPLMMenuID inMenuID); - /* * XPLMClearAllMenuItems * @@ -162,7 +155,6 @@ XPLM_API void XPLMDestroyMenu( */ XPLM_API void XPLMClearAllMenuItems( XPLMMenuID inMenuID); - /* * XPLMAppendMenuItem * @@ -187,7 +179,6 @@ XPLM_API int XPLMAppendMenuItem( const char * inItemName, void * inItemRef, int inDeprecatedAndIgnored); - #if defined(XPLM300) /* * XPLMAppendMenuItemWithCommand @@ -210,19 +201,14 @@ XPLM_API int XPLMAppendMenuItemWithCommand( const char * inItemName, XPLMCommandRef inCommandToExecute); #endif /* XPLM300 */ - /* * XPLMAppendMenuSeparator * * This routine adds a separator to the end of a menu. - * - * Returns a negative index if the append failed (due to an invalid parent - * menu argument). * */ XPLM_API void XPLMAppendMenuSeparator( XPLMMenuID inMenu); - /* * XPLMSetMenuItemName * @@ -235,7 +221,6 @@ XPLM_API void XPLMSetMenuItemName( int inIndex, const char * inItemName, int inDeprecatedAndIgnored); - /* * XPLMCheckMenuItem * @@ -246,7 +231,6 @@ XPLM_API void XPLMCheckMenuItem( XPLMMenuID inMenu, int index, XPLMMenuCheck inCheck); - /* * XPLMCheckMenuItemState * @@ -258,7 +242,6 @@ XPLM_API void XPLMCheckMenuItemState( XPLMMenuID inMenu, int index, XPLMMenuCheck * outCheck); - /* * XPLMEnableMenuItem * @@ -269,7 +252,6 @@ XPLM_API void XPLMEnableMenuItem( XPLMMenuID inMenu, int index, int enabled); - #if defined(XPLM210) /* * XPLMRemoveMenuItem @@ -282,7 +264,6 @@ XPLM_API void XPLMRemoveMenuItem( XPLMMenuID inMenu, int inIndex); #endif /* XPLM210 */ - #ifdef __cplusplus } #endif diff --git a/Example/Lib/SDK/CHeaders/XPLM/XPLMNavigation.h b/Example/Lib/SDK/CHeaders/XPLM/XPLMNavigation.h index c26ed3b..dd02dff 100644 --- a/Example/Lib/SDK/CHeaders/XPLM/XPLMNavigation.h +++ b/Example/Lib/SDK/CHeaders/XPLM/XPLMNavigation.h @@ -2,7 +2,7 @@ #define _XPLMNavigation_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -77,7 +77,6 @@ enum { }; typedef int XPLMNavType; - /* * XPLMNavRef * @@ -93,9 +92,7 @@ typedef int XPLMNavType; * */ typedef int XPLMNavRef; - #define XPLM_NAV_NOT_FOUND -1 - /* * XPLMGetFirstNavAid * @@ -105,7 +102,6 @@ typedef int XPLMNavRef; * */ XPLM_API XPLMNavRef XPLMGetFirstNavAid(void); - /* * XPLMGetNextNavAid * @@ -117,7 +113,6 @@ XPLM_API XPLMNavRef XPLMGetFirstNavAid(void); */ XPLM_API XPLMNavRef XPLMGetNextNavAid( XPLMNavRef inNavAidRef); - /* * XPLMFindFirstNavAidOfType * @@ -128,7 +123,6 @@ XPLM_API XPLMNavRef XPLMGetNextNavAid( */ XPLM_API XPLMNavRef XPLMFindFirstNavAidOfType( XPLMNavType inType); - /* * XPLMFindLastNavAidOfType * @@ -139,7 +133,6 @@ XPLM_API XPLMNavRef XPLMFindFirstNavAidOfType( */ XPLM_API XPLMNavRef XPLMFindLastNavAidOfType( XPLMNavType inType); - /* * XPLMFindNavAid * @@ -175,7 +168,6 @@ XPLM_API XPLMNavRef XPLMFindNavAid( float * inLon, /* Can be NULL */ int * inFrequency, /* Can be NULL */ XPLMNavType inType); - /* * XPLMGetNavAidInfo * @@ -207,7 +199,6 @@ XPLM_API void XPLMGetNavAidInfo( char * outID, /* Can be NULL */ char * outName, /* Can be NULL */ char * outReg); /* Can be NULL */ - /*************************************************************************** * FLIGHT MANAGEMENT COMPUTER ***************************************************************************/ @@ -222,7 +213,6 @@ XPLM_API void XPLMGetNavAidInfo( * */ - /* * XPLMCountFMSEntries * @@ -230,7 +220,6 @@ XPLM_API void XPLMGetNavAidInfo( * */ XPLM_API int XPLMCountFMSEntries(void); - /* * XPLMGetDisplayedFMSEntry * @@ -238,7 +227,6 @@ XPLM_API int XPLMCountFMSEntries(void); * */ XPLM_API int XPLMGetDisplayedFMSEntry(void); - /* * XPLMGetDestinationFMSEntry * @@ -246,7 +234,6 @@ XPLM_API int XPLMGetDisplayedFMSEntry(void); * */ XPLM_API int XPLMGetDestinationFMSEntry(void); - /* * XPLMSetDisplayedFMSEntry * @@ -255,7 +242,6 @@ XPLM_API int XPLMGetDestinationFMSEntry(void); */ XPLM_API void XPLMSetDisplayedFMSEntry( int inIndex); - /* * XPLMSetDestinationFMSEntry * @@ -265,7 +251,6 @@ XPLM_API void XPLMSetDisplayedFMSEntry( */ XPLM_API void XPLMSetDestinationFMSEntry( int inIndex); - /* * XPLMGetFMSEntryInfo * @@ -295,7 +280,6 @@ XPLM_API void XPLMGetFMSEntryInfo( int * outAltitude, /* Can be NULL */ float * outLat, /* Can be NULL */ float * outLon); /* Can be NULL */ - /* * XPLMSetFMSEntryInfo * @@ -309,7 +293,6 @@ XPLM_API void XPLMSetFMSEntryInfo( int inIndex, XPLMNavRef inRef, int inAltitude); - /* * XPLMSetFMSEntryLatLon * @@ -322,7 +305,6 @@ XPLM_API void XPLMSetFMSEntryLatLon( float inLat, float inLon, int inAltitude); - /* * XPLMClearFMSEntry * @@ -332,7 +314,6 @@ XPLM_API void XPLMSetFMSEntryLatLon( */ XPLM_API void XPLMClearFMSEntry( int inIndex); - #if defined(XPLM410) /* * XPLMNavFlightPlan @@ -364,7 +345,6 @@ enum { }; typedef int XPLMNavFlightPlan; #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMCountFMSFlightPlanEntries @@ -375,7 +355,6 @@ typedef int XPLMNavFlightPlan; XPLM_API int XPLMCountFMSFlightPlanEntries( XPLMNavFlightPlan inFlightPlan); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMGetDisplayedFMSFlightPlanEntry @@ -386,7 +365,6 @@ XPLM_API int XPLMCountFMSFlightPlanEntries( XPLM_API int XPLMGetDisplayedFMSFlightPlanEntry( XPLMNavFlightPlan inFlightPlan); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMGetDestinationFMSFlightPlanEntry @@ -397,7 +375,6 @@ XPLM_API int XPLMGetDisplayedFMSFlightPlanEntry( XPLM_API int XPLMGetDestinationFMSFlightPlanEntry( XPLMNavFlightPlan inFlightPlan); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMSetDisplayedFMSFlightPlanEntry @@ -409,7 +386,6 @@ XPLM_API void XPLMSetDisplayedFMSFlightPlanEntry( XPLMNavFlightPlan inFlightPlan, int inIndex); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMSetDestinationFMSFlightPlanEntry @@ -422,7 +398,6 @@ XPLM_API void XPLMSetDestinationFMSFlightPlanEntry( XPLMNavFlightPlan inFlightPlan, int inIndex); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMSetDirectToFMSFlightPlanEntry @@ -436,7 +411,6 @@ XPLM_API void XPLMSetDirectToFMSFlightPlanEntry( XPLMNavFlightPlan inFlightPlan, int inIndex); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMGetFMSFlightPlanEntryInfo @@ -469,7 +443,6 @@ XPLM_API void XPLMGetFMSFlightPlanEntryInfo( float * outLat, /* Can be NULL */ float * outLon); /* Can be NULL */ #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMSetFMSFlightPlanEntryInfo @@ -487,7 +460,6 @@ XPLM_API void XPLMSetFMSFlightPlanEntryInfo( XPLMNavRef inRef, int inAltitude); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMSetFMSFlightPlanEntryLatLon @@ -503,7 +475,6 @@ XPLM_API void XPLMSetFMSFlightPlanEntryLatLon( float inLon, int inAltitude); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMSetFMSFlightPlanEntryLatLonWithId @@ -521,7 +492,6 @@ XPLM_API void XPLMSetFMSFlightPlanEntryLatLonWithId( const char* inId, unsigned int inIdLength); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMClearFMSFlightPlanEntry @@ -534,7 +504,6 @@ XPLM_API void XPLMClearFMSFlightPlanEntry( XPLMNavFlightPlan inFlightPlan, int inIndex); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMLoadFMSFlightPlan @@ -549,7 +518,6 @@ XPLM_API void XPLMLoadFMSFlightPlan( const char * inBuffer, unsigned int inBufferLen); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMSaveFMSFlightPlan @@ -571,7 +539,6 @@ XPLM_API unsigned int XPLMSaveFMSFlightPlan( char * inBuffer, unsigned int inBufferLen); #endif /* XPLM410 */ - /*************************************************************************** * GPS RECEIVER ***************************************************************************/ @@ -588,7 +555,6 @@ XPLM_API unsigned int XPLMSaveFMSFlightPlan( * */ XPLM_API XPLMNavType XPLMGetGPSDestinationType(void); - /* * XPLMGetGPSDestination * @@ -596,7 +562,6 @@ XPLM_API XPLMNavType XPLMGetGPSDestinationType(void); * */ XPLM_API XPLMNavRef XPLMGetGPSDestination(void); - #ifdef __cplusplus } #endif diff --git a/Example/Lib/SDK/CHeaders/XPLM/XPLMPlanes.h b/Example/Lib/SDK/CHeaders/XPLM/XPLMPlanes.h index bd5b84d..4cc9758 100644 --- a/Example/Lib/SDK/CHeaders/XPLM/XPLMPlanes.h +++ b/Example/Lib/SDK/CHeaders/XPLM/XPLMPlanes.h @@ -2,7 +2,7 @@ #define _XPLMPlanes_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -14,9 +14,22 @@ * The XPLMPlanes APIs allow you to control the various aircraft in X-Plane, * both the user's and the sim's. * - * *Note*: unlike almost all other APIs in the SDK, aircraft paths are _full_ - * file system paths for historical reasons. You'll need to prefix all - * relative paths with the X-Plane path as accessed via XPLMGetSystemPath. + * You cannot initialize a flight from any XPLM callback. Only initialize a + * flight in response to: + * * Command handlers + * * Menu handlers + * * UI handlers (keyboard, mouse) from XPLMDisplay/widgets + * * The pre-flightmodel processing callback + * + * In particular, do not initialize a flight from: + * * The post-flightmodel processing callback + * * Dataref get/set handlers + * * Any drawing callbacks + * + * *Note*: Some older APIs for accessing aircraft require full paths and not + * paths relative to the X-Plane folder for historical reasons. You will need + * to prefix all relative paths with the X-Plane path as accessed via + * XPLMGetSystemPath. * */ @@ -29,13 +42,106 @@ extern "C" { /*************************************************************************** * USER AIRCRAFT ACCESS ***************************************************************************/ +/* + * These routines are used to initialize and manipulate the user's aircraft. + * + */ + +#if defined(XPLM430) +/* + * XPLMInitResult + * + * Result codes from initializing or updating the user's aircraft. + * Initialization can fail due to unparsable/invalid data, or due to the + * contents of the initialization containing parameters the sim cannot fulfill + * (e.g. an aircraft not on disk, a ramp start not present in an airport due + * to custom scenery). + * + * If an initialization fails, a human-readable string is sent to your + * plugin's error function. This is meant for debugging purposes only and + * should not be parsed. Your plugin's logic should only use the result code + * for flow control. + * + */ +enum { + /* The initialization succeeded. */ + xplm_Init_Success = 0, + + /* The provided argument was invalid. This can be returned if the provided * + * string is not a valid json string. This error can also be returned if one * + * or more of the provided arguments is invalid, such as a missing required * + * field or an unrecognized parameter such as an unknown runway name. Invalid * + * errors imply that your calling code is generating incorrect JSON and should* + * be fixed; use your plugin's error callback to find more detailed * + * information about the problem with your input. */ + xplm_Init_Invalid = 1, + /* The new flight could not be initialized because one of the aircraft * + * requested could not be found on disk or loaded. */ + xplm_Init_MissingAircraft = 2, + + /* The new flight could not be initialized because one of the aircraft's' * + * requested liveries could not be found on disk or loaded. */ + xplm_Init_MissingLivery = 3, + + /* The new flight could not be initialized because the requested airport was * + * not found in X-Plane's airport database. */ + xplm_Init_MissingAirport = 4, + + /* The new flight could not be initialized because the requested ramp start * + * was not found at the specified airport in X-Plane's airport database. */ + xplm_Init_MissingRamp = 5, + + /* The new flight could not be initialized because the requested runway was * + * not found at the specified airport in X-Plane's airport database. */ + xplm_Init_MissingRunway = 6, + + +}; +typedef int XPLMInitResult; +#endif /* XPLM430 */ +#if defined(XPLM430) +/* + * XPLMInitFlight + * + * Initialize a new flight, ending th user's current flight. The flight config + * is provided as json string. See + * https://developer.x-plane.com/article/flight-initialization-api/ for the + * JSON format specification. + * + * Returns a XPLMInitResult enum value specifying whether the initalization + * succeeeded (and if not, what caused it to fail). + * + */ +XPLM_API XPLMInitResult XPLMInitFlight( + char const* inJsonData); +#endif /* XPLM430 */ +#if defined(XPLM430) +/* + * XPLMUpdateFlight + * + * Updates the user's 'current flight, modifying some flight parameters. The + * flight config is provided as a JSON string, see + * https://developer.x-plane.com/article/flight-initialization-api/ for the + * JSON format specification. + * + * Returns an XPLMInitResult enum value specifying whether hte update + * suceeeded (and if not, what caused it to fail). + * + */ +XPLM_API XPLMInitResult XPLMUpdateFlight( + char const* inJsonData); +#endif /* XPLM430 */ /* * XPLMSetUsersAircraft * * This routine changes the user's aircraft. Note that this will reinitialize * the user to be on the nearest airport's first runway. Pass in a full path * (hard drive and everything including the .acf extension) to the .acf file. + * + * Use XPLMInitFlight for complete control over initialization. + * + * **WARNING**: this API takes a full, not relative aicraft path. * */ XPLM_API void XPLMSetUsersAircraft( @@ -45,6 +151,8 @@ XPLM_API void XPLMSetUsersAircraft( * * This routine places the user at a given airport. Specify the airport by * its X-Plane airport ID (e.g. 'KBOS'). + * + * Use XPLMInitFlight for complete control over initialization. * */ XPLM_API void XPLMPlaceUserAtAirport( @@ -60,6 +168,8 @@ XPLM_API void XPLMPlaceUserAtAirport( * aircraft will always start with its engines running, regardless of the * user's preferences (i.e., regardless of what the dataref * `sim/operation/prefs/startup_running` says). + * + * Use XPLMInitFlight for complete control over initialization. * */ XPLM_API void XPLMPlaceUserAtLocation( @@ -72,6 +182,11 @@ XPLM_API void XPLMPlaceUserAtLocation( /*************************************************************************** * GLOBAL AIRCRAFT ACCESS ***************************************************************************/ +/* + * These APIs let you control the AI aircraft and take over multiplayer/aI + * aircraft control. + * + */ /* The user's aircraft is always index 0. */ #define XPLM_USER_AIRCRAFT 0 @@ -154,7 +269,6 @@ XPLM_API void XPLMGetNthAircraftModel( * */ - /* * XPLMPlanesAvailable_f * @@ -165,7 +279,6 @@ XPLM_API void XPLMGetNthAircraftModel( */ typedef void (* XPLMPlanesAvailable_f)( void * inRefcon); - /* * XPLMAcquirePlanes * @@ -178,6 +291,8 @@ typedef void (* XPLMPlanesAvailable_f)( * extension. NULL terminates this array, or pass NULL if there are no planes * you want loaded. * + * Aircraft paths for this API are full, not relative aircraft paths. + * * If you pass in a callback and do not receive access to the planes your * callback will be called when the airplanes are available. If you do receive * airplane access, your callback will not be called. @@ -187,7 +302,6 @@ XPLM_API int XPLMAcquirePlanes( char ** inAircraft, /* Can be NULL */ XPLMPlanesAvailable_f inCallback, void * inRefcon); - /* * XPLMReleasePlanes * @@ -196,7 +310,6 @@ XPLM_API int XPLMAcquirePlanes( * */ XPLM_API void XPLMReleasePlanes(void); - /* * XPLMSetActiveAircraftCount * @@ -207,7 +320,6 @@ XPLM_API void XPLMReleasePlanes(void); */ XPLM_API void XPLMSetActiveAircraftCount( int inCount); - /* * XPLMSetAircraftModel * @@ -215,12 +327,13 @@ XPLM_API void XPLMSetActiveAircraftCount( * exclusive access to the airplane APIs. Pass in the path of the model with * the .acf extension. The index is zero based, but you may not pass in 0 * (use XPLMSetUsersAircraft to load the user's aircracft). + * + * This API takes a full aircraft path. * */ XPLM_API void XPLMSetAircraftModel( int inIndex, const char * inAircraftPath); - /* * XPLMDisableAIForPlane * @@ -230,7 +343,6 @@ XPLM_API void XPLMSetAircraftModel( */ XPLM_API void XPLMDisableAIForPlane( int inPlaneIndex); - #if defined(XPLM_DEPRECATED) /* * XPLMDrawAircraft @@ -257,7 +369,6 @@ XPLM_API void XPLMDrawAircraft( int inFullDraw, XPLMPlaneDrawState_t * inDrawStateInfo); #endif /* XPLM_DEPRECATED */ - #if defined(XPLM_DEPRECATED) /* * XPLMReinitUsersPlane @@ -279,7 +390,6 @@ XPLM_API void XPLMDrawAircraft( */ XPLM_API void XPLMReinitUsersPlane(void); #endif /* XPLM_DEPRECATED */ - #ifdef __cplusplus } #endif diff --git a/Example/Lib/SDK/CHeaders/XPLM/XPLMPlugin.h b/Example/Lib/SDK/CHeaders/XPLM/XPLMPlugin.h index da84ac8..663b2bf 100644 --- a/Example/Lib/SDK/CHeaders/XPLM/XPLMPlugin.h +++ b/Example/Lib/SDK/CHeaders/XPLM/XPLMPlugin.h @@ -2,7 +2,7 @@ #define _XPLMPlugin_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -33,7 +33,6 @@ extern "C" { * */ - /* * XPLMGetMyID * @@ -42,7 +41,6 @@ extern "C" { * */ XPLM_API XPLMPluginID XPLMGetMyID(void); - /* * XPLMCountPlugins * @@ -51,7 +49,6 @@ XPLM_API XPLMPluginID XPLMGetMyID(void); * */ XPLM_API int XPLMCountPlugins(void); - /* * XPLMGetNthPlugin * @@ -62,7 +59,6 @@ XPLM_API int XPLMCountPlugins(void); */ XPLM_API XPLMPluginID XPLMGetNthPlugin( int inIndex); - /* * XPLMFindPluginByPath * @@ -73,7 +69,6 @@ XPLM_API XPLMPluginID XPLMGetNthPlugin( */ XPLM_API XPLMPluginID XPLMFindPluginByPath( const char * inPath); - /* * XPLMFindPluginBySignature * @@ -87,7 +82,6 @@ XPLM_API XPLMPluginID XPLMFindPluginByPath( */ XPLM_API XPLMPluginID XPLMFindPluginBySignature( const char * inSignature); - /* * XPLMGetPluginInfo * @@ -107,7 +101,6 @@ XPLM_API void XPLMGetPluginInfo( char * outFilePath, /* Can be NULL */ char * outSignature, /* Can be NULL */ char * outDescription); /* Can be NULL */ - /*************************************************************************** * ENABLING/DISABLING PLUG-INS ***************************************************************************/ @@ -117,7 +110,6 @@ XPLM_API void XPLMGetPluginInfo( * */ - /* * XPLMIsPluginEnabled * @@ -126,7 +118,6 @@ XPLM_API void XPLMGetPluginInfo( */ XPLM_API int XPLMIsPluginEnabled( XPLMPluginID inPluginID); - /* * XPLMEnablePlugin * @@ -138,16 +129,14 @@ XPLM_API int XPLMIsPluginEnabled( */ XPLM_API int XPLMEnablePlugin( XPLMPluginID inPluginID); - /* * XPLMDisablePlugin * - * This routine disableds an enabled plug-in. + * This routine disables an enabled plug-in. * */ XPLM_API void XPLMDisablePlugin( XPLMPluginID inPluginID); - /* * XPLMReloadPlugins * @@ -159,7 +148,6 @@ XPLM_API void XPLMDisablePlugin( * */ XPLM_API void XPLMReloadPlugins(void); - /*************************************************************************** * INTERPLUGIN MESSAGING ***************************************************************************/ @@ -197,40 +185,32 @@ XPLM_API void XPLMReloadPlugins(void); * */ - /* This message is sent to your plugin whenever the user's plane crashes. The * * parameter is ignored. */ #define XPLM_MSG_PLANE_CRASHED 101 - /* This message is sent to your plugin whenever a new plane is loaded. The * * parameter contains the index number of the plane being loaded; 0 indicates * - * the user's plane. */ + * the user's plane. The parameter is an integer bit-cast to a pointer. */ #define XPLM_MSG_PLANE_LOADED 102 - /* This messages is sent whenever the user's plane is positioned at a new * * airport. The parameter is ignored. */ #define XPLM_MSG_AIRPORT_LOADED 103 - /* This message is sent whenever new scenery is loaded. Use datarefs to * * determine the new scenery files that were loaded. The parameter is ignored.*/ #define XPLM_MSG_SCENERY_LOADED 104 - /* This message is sent whenever the user adjusts the number of X-Plane * * aircraft models. You must use XPLMCountPlanes to find out how many planes * * are now available. This message will only be sent in XP7 and higher * * because in XP6 the number of aircraft is not user-adjustable. The parameter* * is ignored. */ #define XPLM_MSG_AIRPLANE_COUNT_CHANGED 105 - #if defined(XPLM200) /* 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.) */ + * indicates the user's plane. The parameter is of type int, bit-cast to a * + * pointer. */ #define XPLM_MSG_PLANE_UNLOADED 106 #endif /* XPLM200 */ - #if defined(XPLM210) /* 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 * @@ -241,29 +221,26 @@ XPLM_API void XPLMReloadPlugins(void); * The parameter is ignored. */ #define XPLM_MSG_WILL_WRITE_PREFS 107 #endif /* XPLM210 */ - #if defined(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. */ + * whose livery is changing. The parameter is an integer, bit-cast to a * + * pointer. */ #define XPLM_MSG_LIVERY_LOADED 108 #endif /* XPLM210 */ - #if defined(XPLM301) /* 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. */ #define XPLM_MSG_ENTERED_VR 109 #endif /* XPLM301 */ - #if defined(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. */ #define XPLM_MSG_EXITING_VR 110 #endif /* XPLM301 */ - #if defined(XPLM303) /* 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 * @@ -274,25 +251,23 @@ XPLM_API void XPLMReloadPlugins(void); * 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. */ + * parameter is unused and should be ignored. Do not send this message * + * directly; always use the XPLMAcquirePlanes() call. */ #define XPLM_MSG_RELEASE_PLANES 111 #endif /* XPLM303 */ - #if defined(XPLM400) /* 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. */ + * bank. The bank ID is bit-cast to a pointer. */ #define XPLM_MSG_FMOD_BANK_LOADED 112 #endif /* XPLM400 */ - #if defined(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. */ + * bank. The bank ID is bit-cast to a pointer. */ #define XPLM_MSG_FMOD_BANK_UNLOADING 113 #endif /* XPLM400 */ - #if defined(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 * @@ -300,10 +275,10 @@ XPLM_API void XPLMReloadPlugins(void); * if it cares. * * * * This message is only sent to plugins that enable the * - * XPLM_WANTS_DATAREF_NOTIFICATIONS feature. */ + * XPLM_WANTS_DATAREF_NOTIFICATIONS feature. The parameteter is a pointer to a* + * 32-bit integer containing the new number of datarefs. */ #define XPLM_MSG_DATAREFS_ADDED 114 #endif /* XPLM400 */ - /* * XPLMSendMessageToPlugin * @@ -316,7 +291,6 @@ XPLM_API void XPLMSendMessageToPlugin( XPLMPluginID inPlugin, int inMessage, void * inParam); - #if defined(XPLM200) /*************************************************************************** * Plugin Features API @@ -390,7 +364,6 @@ XPLM_API void XPLMSendMessageToPlugin( * */ - /* * XPLMFeatureEnumerator_f * @@ -402,7 +375,6 @@ XPLM_API void XPLMSendMessageToPlugin( typedef void (* XPLMFeatureEnumerator_f)( const char * inFeature, void * inRef); - /* * XPLMHasFeature * @@ -412,7 +384,6 @@ typedef void (* XPLMFeatureEnumerator_f)( */ XPLM_API int XPLMHasFeature( const char * inFeature); - /* * XPLMIsFeatureEnabled * @@ -423,7 +394,6 @@ XPLM_API int XPLMHasFeature( */ XPLM_API int XPLMIsFeatureEnabled( const char * inFeature); - /* * XPLMEnableFeature * @@ -435,7 +405,6 @@ XPLM_API int XPLMIsFeatureEnabled( XPLM_API void XPLMEnableFeature( const char * inFeature, int inEnable); - /* * XPLMEnumerateFeatures * @@ -447,7 +416,6 @@ XPLM_API void XPLMEnableFeature( XPLM_API void XPLMEnumerateFeatures( XPLMFeatureEnumerator_f inEnumerator, void * inRef); - #endif /* XPLM200 */ #ifdef __cplusplus } diff --git a/Example/Lib/SDK/CHeaders/XPLM/XPLMProcessing.h b/Example/Lib/SDK/CHeaders/XPLM/XPLMProcessing.h index 247e71e..9939880 100644 --- a/Example/Lib/SDK/CHeaders/XPLM/XPLMProcessing.h +++ b/Example/Lib/SDK/CHeaders/XPLM/XPLMProcessing.h @@ -2,7 +2,7 @@ #define _XPLMProcessing_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -30,6 +30,13 @@ * callback after the deadline" schedule, e.g. your callbacks will always be * slightly late to ensure that we don't run faster than your deadline. * + * WARNING: Do NOT use the post-flightmodel callback for initialization, + * resource creation, etc. The only recommended use of post-FM callbacks is to + * "patch" the computed values of the flightmodel using dataref read-writes, + * and to compute custom system values by reading the flightmodel. APIs that + * create resources or initialize the sim may issue warnings, crash rhe sim, + * or have unexpected results. + * * WARNING: Do NOT use these callbacks to draw! You cannot draw during flight * loop callbacks. Use the drawing callbacks (see XPLMDisplay for more info) * for graphics or the XPLMInstance functions for aircraft or models. (One @@ -67,7 +74,6 @@ enum { }; typedef int XPLMFlightLoopPhaseType; #endif /* XPLM210 */ - #if defined(XPLM210) /* * XPLMFlightLoopID @@ -79,7 +85,6 @@ typedef int XPLMFlightLoopPhaseType; */ typedef void * XPLMFlightLoopID; #endif /* XPLM210 */ - /* * XPLMFlightLoop_f * @@ -119,7 +124,6 @@ typedef float (* XPLMFlightLoop_f)( float inElapsedTimeSinceLastFlightLoop, int inCounter, void * inRefcon); - #if defined(XPLM210) /* * XPLMCreateFlightLoop_t @@ -136,7 +140,6 @@ typedef struct { void * refcon; } XPLMCreateFlightLoop_t; #endif /* XPLM210 */ - /* * XPLMGetElapsedTime * @@ -150,7 +153,6 @@ typedef struct { * */ XPLM_API float XPLMGetElapsedTime(void); - /* * XPLMGetCycleNumber * @@ -159,7 +161,6 @@ XPLM_API float XPLMGetElapsedTime(void); * */ XPLM_API int XPLMGetCycleNumber(void); - /* * XPLMRegisterFlightLoopCallback * @@ -179,7 +180,6 @@ XPLM_API void XPLMRegisterFlightLoopCallback( XPLMFlightLoop_f inFlightLoop, float inInterval, void * inRefcon); - /* * XPLMUnregisterFlightLoopCallback * @@ -194,7 +194,6 @@ XPLM_API void XPLMRegisterFlightLoopCallback( XPLM_API void XPLMUnregisterFlightLoopCallback( XPLMFlightLoop_f inFlightLoop, void * inRefcon); - /* * XPLMSetFlightLoopCallbackInterval * @@ -214,7 +213,6 @@ XPLM_API void XPLMSetFlightLoopCallbackInterval( float inInterval, int inRelativeToNow, void * inRefcon); - #if defined(XPLM210) /* * XPLMCreateFlightLoop @@ -227,7 +225,6 @@ XPLM_API void XPLMSetFlightLoopCallbackInterval( XPLM_API XPLMFlightLoopID XPLMCreateFlightLoop( XPLMCreateFlightLoop_t * inParams); #endif /* XPLM210 */ - #if defined(XPLM210) /* * XPLMDestroyFlightLoop @@ -239,7 +236,6 @@ XPLM_API XPLMFlightLoopID XPLMCreateFlightLoop( XPLM_API void XPLMDestroyFlightLoop( XPLMFlightLoopID inFlightLoopID); #endif /* XPLM210 */ - #if defined(XPLM210) /* * XPLMScheduleFlightLoop @@ -259,7 +255,6 @@ XPLM_API void XPLMScheduleFlightLoop( float inInterval, int inRelativeToNow); #endif /* XPLM210 */ - #ifdef __cplusplus } #endif diff --git a/Example/Lib/SDK/CHeaders/XPLM/XPLMScenery.h b/Example/Lib/SDK/CHeaders/XPLM/XPLMScenery.h index d15f83d..f8aabe7 100644 --- a/Example/Lib/SDK/CHeaders/XPLM/XPLMScenery.h +++ b/Example/Lib/SDK/CHeaders/XPLM/XPLMScenery.h @@ -2,7 +2,7 @@ #define _XPLMScenery_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -56,7 +56,6 @@ extern "C" { * */ - /* * XPLMProbeType * @@ -73,7 +72,6 @@ enum { }; typedef int XPLMProbeType; - /* * XPLMProbeResult * @@ -95,7 +93,6 @@ enum { }; typedef int XPLMProbeResult; - /* * XPLMProbeRef * @@ -104,7 +101,6 @@ typedef int XPLMProbeResult; * */ typedef void * XPLMProbeRef; - /* * XPLMProbeInfo_t * @@ -139,7 +135,6 @@ typedef struct { /* Tells if the surface we hit is water (otherwise it is land). */ int is_wet; } XPLMProbeInfo_t; - /* * XPLMCreateProbe * @@ -148,7 +143,6 @@ typedef struct { */ XPLM_API XPLMProbeRef XPLMCreateProbe( XPLMProbeType inProbeType); - /* * XPLMDestroyProbe * @@ -157,7 +151,6 @@ XPLM_API XPLMProbeRef XPLMCreateProbe( */ XPLM_API void XPLMDestroyProbe( XPLMProbeRef inProbe); - /* * XPLMProbeTerrainXYZ * @@ -173,7 +166,6 @@ XPLM_API XPLMProbeResult XPLMProbeTerrainXYZ( float inY, float inZ, XPLMProbeInfo_t * outInfo); - #endif /* XPLM200 */ #if defined(XPLM300) /*************************************************************************** @@ -193,7 +185,6 @@ XPLM_API XPLMProbeResult XPLMProbeTerrainXYZ( * */ - /* * XPLMGetMagneticVariation * @@ -204,7 +195,6 @@ XPLM_API XPLMProbeResult XPLMProbeTerrainXYZ( XPLM_API float XPLMGetMagneticVariation( double latitude, double longitude); - /* * XPLMDegTrueToDegMagnetic * @@ -214,7 +204,6 @@ XPLM_API float XPLMGetMagneticVariation( */ XPLM_API float XPLMDegTrueToDegMagnetic( float headingDegreesTrue); - /* * XPLMDegMagneticToDegTrue * @@ -224,7 +213,6 @@ XPLM_API float XPLMDegTrueToDegMagnetic( */ XPLM_API float XPLMDegMagneticToDegTrue( float headingDegreesMagnetic); - #endif /* XPLM300 */ /*************************************************************************** * Object Drawing @@ -237,7 +225,6 @@ XPLM_API float XPLMDegMagneticToDegTrue( * */ - #if defined(XPLM200) /* * XPLMObjectRef @@ -248,7 +235,6 @@ XPLM_API float XPLMDegMagneticToDegTrue( */ typedef void * XPLMObjectRef; #endif /* XPLM200 */ - #if defined(XPLM200) /* * XPLMDrawInfo_t @@ -275,7 +261,32 @@ typedef struct { float roll; } XPLMDrawInfo_t; #endif /* XPLM200 */ - +#if defined(XPLM420) +/* + * XPLMDrawInfoDouble_t + * + * The XPLMDrawInfo_t structure contains positioning info for one object that + * is to be drawn. Be sure to set structSize to the size of the structure for + * future expansion. + * + */ +typedef struct { + /* Set this to the size of this structure! */ + int structSize; + /* X location of the object in local coordinates. */ + double x; + /* Y location of the object in local coordinates. */ + double y; + /* Z location of the object in local coordinates. */ + double z; + /* Pitch in degres to rotate the object, positive is up. */ + double pitch; + /* Heading in local coordinates to rotate the object, clockwise. */ + double heading; + /* Roll to rotate the object. */ + double roll; +} XPLMDrawInfoDouble_t; +#endif /* XPLM420 */ #if defined(XPLM210) /* * XPLMObjectLoaded_f @@ -294,7 +305,6 @@ typedef void (* XPLMObjectLoaded_f)( XPLMObjectRef inObject, void * inRefcon); #endif /* XPLM210 */ - #if defined(XPLM200) /* * XPLMLoadObject @@ -322,7 +332,6 @@ typedef void (* XPLMObjectLoaded_f)( XPLM_API XPLMObjectRef XPLMLoadObject( const char * inPath); #endif /* XPLM200 */ - #if defined(XPLM210) /* * XPLMLoadObjectAsync @@ -346,7 +355,6 @@ XPLM_API void XPLMLoadObjectAsync( XPLMObjectLoaded_f inCallback, void * inRefcon); #endif /* XPLM210 */ - #if defined(XPLM_DEPRECATED) /* * XPLMDrawObjects @@ -381,7 +389,6 @@ XPLM_API void XPLMDrawObjects( int lighting, int earth_relative); #endif /* XPLM_DEPRECATED */ - #if defined(XPLM200) /* * XPLMUnloadObject @@ -395,7 +402,6 @@ XPLM_API void XPLMDrawObjects( XPLM_API void XPLMUnloadObject( XPLMObjectRef inObject); #endif /* XPLM200 */ - #if defined(XPLM200) /*************************************************************************** * Library Access @@ -408,7 +414,6 @@ XPLM_API void XPLMUnloadObject( * */ - /* * XPLMLibraryEnumerator_f * @@ -420,7 +425,6 @@ XPLM_API void XPLMUnloadObject( typedef void (* XPLMLibraryEnumerator_f)( const char * inFilePath, void * inRef); - /* * XPLMLookupObjects * @@ -441,7 +445,6 @@ XPLM_API int XPLMLookupObjects( float inLongitude, XPLMLibraryEnumerator_f enumerator, void * ref); - #endif /* XPLM200 */ #ifdef __cplusplus } diff --git a/Example/Lib/SDK/CHeaders/XPLM/XPLMSound.h b/Example/Lib/SDK/CHeaders/XPLM/XPLMSound.h index 9e89bb6..2ba3f6b 100644 --- a/Example/Lib/SDK/CHeaders/XPLM/XPLMSound.h +++ b/Example/Lib/SDK/CHeaders/XPLM/XPLMSound.h @@ -2,7 +2,7 @@ #define _XPLMSound_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -73,7 +73,6 @@ enum { }; typedef int XPLMAudioBus; - /* * XPLMBankID * @@ -92,7 +91,6 @@ enum { }; typedef int XPLMBankID; - /* * If you want to get full access to FMOD sound features, you need to include fmod.h or fmod.hpp yourself FIRST. * If you only need the basic wrapper functions which allow 3D placement and playback on a specified channel, there @@ -108,7 +106,6 @@ typedef int XPLMBankID; * with their C++ equivalents. See https://www.fmod.com/docs/2.02/api/white-papers-handle-system.html . */ #if defined(_FMOD_COMMON_H) - /* * XPLMGetFMODStudio * @@ -123,7 +120,6 @@ typedef int XPLMBankID; * */ XPLM_API FMOD_STUDIO_SYSTEM* XPLMGetFMODStudio(void); - /* * XPLMGetFMODChannelGroup * @@ -134,7 +130,6 @@ XPLM_API FMOD_STUDIO_SYSTEM* XPLMGetFMODStudio(void); XPLM_API FMOD_CHANNELGROUP* XPLMGetFMODChannelGroup( XPLMAudioBus audioType); - #else /* * These definitions are enough to play a basic sound without linking to the full FMOD distribution. You can still position it in 3D @@ -157,7 +152,6 @@ typedef struct FMOD_VECTOR } FMOD_VECTOR; typedef void FMOD_CHANNEL; #endif - /* * XPLMPCMComplete_f * @@ -169,7 +163,6 @@ typedef void FMOD_CHANNEL; typedef void (* XPLMPCMComplete_f)( void * inRefcon, FMOD_RESULT status); - /* * XPLMPlayPCMOnBus * @@ -198,7 +191,6 @@ XPLM_API FMOD_CHANNEL* XPLMPlayPCMOnBus( XPLMAudioBus audioType, XPLMPCMComplete_f inCallback, void * inRefcon); /* Can be NULL */ - /* * XPLMStopAudio * @@ -209,7 +201,6 @@ XPLM_API FMOD_CHANNEL* XPLMPlayPCMOnBus( */ XPLM_API FMOD_RESULT XPLMStopAudio( FMOD_CHANNEL* fmod_channel); - /* * XPLMSetAudioPosition * @@ -221,7 +212,6 @@ XPLM_API FMOD_RESULT XPLMSetAudioPosition( FMOD_CHANNEL* fmod_channel, FMOD_VECTOR* position, FMOD_VECTOR* velocity); - /* * XPLMSetAudioFadeDistance * @@ -237,7 +227,6 @@ XPLM_API FMOD_RESULT XPLMSetAudioFadeDistance( FMOD_CHANNEL* fmod_channel, float min_fade_distance, float max_fade_distance); - /* * XPLMSetAudioVolume * @@ -250,7 +239,6 @@ XPLM_API FMOD_RESULT XPLMSetAudioFadeDistance( XPLM_API FMOD_RESULT XPLMSetAudioVolume( FMOD_CHANNEL* fmod_channel, float source_volume); - /* * XPLMSetAudioPitch * @@ -260,7 +248,6 @@ XPLM_API FMOD_RESULT XPLMSetAudioVolume( XPLM_API FMOD_RESULT XPLMSetAudioPitch( FMOD_CHANNEL* fmod_channel, float audio_pitch_hz); - /* * XPLMSetAudioCone * @@ -275,7 +262,6 @@ XPLM_API FMOD_RESULT XPLMSetAudioCone( float outside_angle, float outside_volume, FMOD_VECTOR* orientation); - #endif /* XPLM400 */ #ifdef __cplusplus } diff --git a/Example/Lib/SDK/CHeaders/XPLM/XPLMUtilities.h b/Example/Lib/SDK/CHeaders/XPLM/XPLMUtilities.h index d2fbf93..b0a6721 100644 --- a/Example/Lib/SDK/CHeaders/XPLM/XPLMUtilities.h +++ b/Example/Lib/SDK/CHeaders/XPLM/XPLMUtilities.h @@ -2,7 +2,7 @@ #define _XPLMUtilities_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -62,7 +62,6 @@ extern "C" { * */ - #if defined(XPLM200) /* * XPLMDataFileType @@ -83,7 +82,6 @@ enum { }; typedef int XPLMDataFileType; #endif /* XPLM200 */ - /* * XPLMGetSystemPath * @@ -96,7 +94,6 @@ typedef int XPLMDataFileType; */ XPLM_API void XPLMGetSystemPath( char * outSystemPath); - /* * XPLMGetPrefsPath * @@ -111,7 +108,6 @@ XPLM_API void XPLMGetSystemPath( */ XPLM_API void XPLMGetPrefsPath( char * outPrefsPath); - /* * XPLMGetDirectorySeparator * @@ -122,7 +118,6 @@ XPLM_API void XPLMGetPrefsPath( * */ XPLM_API const char * XPLMGetDirectorySeparator(void); - /* * XPLMExtractFileAndPath * @@ -135,7 +130,6 @@ XPLM_API const char * XPLMGetDirectorySeparator(void); */ XPLM_API char * XPLMExtractFileAndPath( char * inFullPath); - /* * XPLMGetDirectoryContents * @@ -187,7 +181,6 @@ XPLM_API int XPLMGetDirectoryContents( int inIndexCount, int * outTotalFiles, /* Can be NULL */ int * outReturnedFiles); /* Can be NULL */ - #if defined(XPLM200) /* * XPLMLoadDataFile @@ -201,7 +194,6 @@ XPLM_API int XPLMLoadDataFile( XPLMDataFileType inFileType, const char * inFilePath); /* Can be NULL */ #endif /* XPLM200 */ - #if defined(XPLM200) /* * XPLMSaveDataFile @@ -214,7 +206,6 @@ XPLM_API int XPLMSaveDataFile( XPLMDataFileType inFileType, const char * inFilePath); #endif /* XPLM200 */ - /*************************************************************************** * X-PLANE MISC ***************************************************************************/ @@ -277,7 +268,6 @@ enum { }; typedef int XPLMHostApplicationID; - /* * XPLMLanguageCode * @@ -325,7 +315,6 @@ enum { }; typedef int XPLMLanguageCode; - #if defined(XPLM200) /* * XPLMError_f @@ -343,7 +332,6 @@ typedef int XPLMLanguageCode; typedef void (* XPLMError_f)( const char * inMessage); #endif /* XPLM200 */ - #if defined(XPLM_DEPRECATED) /* * XPLMInitialized @@ -360,7 +348,6 @@ typedef void (* XPLMError_f)( */ XPLM_API int XPLMInitialized(void); #endif /* XPLM_DEPRECATED */ - /* * XPLMGetVersions * @@ -377,7 +364,6 @@ XPLM_API void XPLMGetVersions( int * outXPlaneVersion, int * outXPLMVersion, XPLMHostApplicationID * outHostID); - /* * XPLMGetLanguage * @@ -385,7 +371,6 @@ XPLM_API void XPLMGetVersions( * */ XPLM_API XPLMLanguageCode XPLMGetLanguage(void); - #if defined(XPLM200) /* * XPLMFindSymbol @@ -418,7 +403,6 @@ XPLM_API XPLMLanguageCode XPLMGetLanguage(void); XPLM_API void * XPLMFindSymbol( const char * inString); #endif /* XPLM200 */ - #if defined(XPLM200) /* * XPLMSetErrorCallback @@ -448,7 +432,6 @@ XPLM_API void * XPLMFindSymbol( XPLM_API void XPLMSetErrorCallback( XPLMError_f inCallback); #endif /* XPLM200 */ - /* * XPLMDebugString * @@ -465,7 +448,6 @@ XPLM_API void XPLMSetErrorCallback( */ XPLM_API void XPLMDebugString( const char * inString); - /* * XPLMSpeakString * @@ -477,7 +459,6 @@ XPLM_API void XPLMDebugString( */ XPLM_API void XPLMSpeakString( const char * inString); - /* * XPLMGetVirtualKeyDescription * @@ -489,7 +470,6 @@ XPLM_API void XPLMSpeakString( */ XPLM_API const char * XPLMGetVirtualKeyDescription( char inVirtualKey); - /* * XPLMReloadScenery * @@ -502,7 +482,6 @@ XPLM_API const char * XPLMGetVirtualKeyDescription( * */ XPLM_API void XPLMReloadScenery(void); - #if defined(XPLM200) /*************************************************************************** * X-PLANE COMMAND MANAGEMENT @@ -547,7 +526,6 @@ XPLM_API void XPLMReloadScenery(void); * */ - /* * XPLMCommandPhase * @@ -567,7 +545,6 @@ enum { }; typedef int XPLMCommandPhase; - /* * XPLMCommandRef * @@ -582,7 +559,6 @@ typedef int XPLMCommandPhase; * */ typedef void * XPLMCommandRef; - /* * XPLMCommandCallback_f * @@ -600,7 +576,6 @@ typedef int (* XPLMCommandCallback_f)( XPLMCommandRef inCommand, XPLMCommandPhase inPhase, void * inRefcon); - /* * XPLMFindCommand * @@ -610,7 +585,6 @@ typedef int (* XPLMCommandCallback_f)( */ XPLM_API XPLMCommandRef XPLMFindCommand( const char * inName); - /* * XPLMCommandBegin * @@ -622,7 +596,6 @@ XPLM_API XPLMCommandRef XPLMFindCommand( */ XPLM_API void XPLMCommandBegin( XPLMCommandRef inCommand); - /* * XPLMCommandEnd * @@ -633,7 +606,6 @@ XPLM_API void XPLMCommandBegin( */ XPLM_API void XPLMCommandEnd( XPLMCommandRef inCommand); - /* * XPLMCommandOnce * @@ -644,7 +616,6 @@ XPLM_API void XPLMCommandEnd( */ XPLM_API void XPLMCommandOnce( XPLMCommandRef inCommand); - /* * XPLMCreateCommand * @@ -657,7 +628,6 @@ XPLM_API void XPLMCommandOnce( XPLM_API XPLMCommandRef XPLMCreateCommand( const char * inName, const char * inDescription); - /* * XPLMRegisterCommandHandler * @@ -676,7 +646,6 @@ XPLM_API void XPLMRegisterCommandHandler( XPLMCommandCallback_f inHandler, int inBefore, void * inRefcon); - /* * XPLMUnregisterCommandHandler * @@ -689,7 +658,6 @@ XPLM_API void XPLMUnregisterCommandHandler( XPLMCommandCallback_f inHandler, int inBefore, void * inRefcon); - #endif /* XPLM200 */ #if defined(XPLM_DEPRECATED) /*************************************************************************** @@ -710,7 +678,6 @@ XPLM_API void XPLMUnregisterCommandHandler( * */ - /* * XPLMCommandKeyID * @@ -817,7 +784,6 @@ enum { xplm_key_max }; typedef int XPLMCommandKeyID; - /* * XPLMCommandButtonID * @@ -925,7 +891,6 @@ enum { xplm_joy_max }; typedef int XPLMCommandButtonID; - /* * XPLMSimulateKeyPress * @@ -940,7 +905,7 @@ typedef int XPLMCommandButtonID; XPLM_API void XPLMSimulateKeyPress( int inKeyType, int inKey); - +#if defined(XPLM_DEPRECATED) /* * XPLMCommandKeyStroke * @@ -954,7 +919,8 @@ XPLM_API void XPLMSimulateKeyPress( */ XPLM_API void XPLMCommandKeyStroke( XPLMCommandKeyID inKey); - +#endif /* XPLM_DEPRECATED */ +#if defined(XPLM_DEPRECATED) /* * XPLMCommandButtonPress * @@ -969,7 +935,8 @@ XPLM_API void XPLMCommandKeyStroke( */ XPLM_API void XPLMCommandButtonPress( XPLMCommandButtonID inButton); - +#endif /* XPLM_DEPRECATED */ +#if defined(XPLM_DEPRECATED) /* * XPLMCommandButtonRelease * @@ -981,7 +948,7 @@ XPLM_API void XPLMCommandButtonPress( */ XPLM_API void XPLMCommandButtonRelease( XPLMCommandButtonID inButton); - +#endif /* XPLM_DEPRECATED */ #endif /* XPLM_DEPRECATED */ #ifdef __cplusplus } diff --git a/Example/Lib/SDK/CHeaders/XPLM/XPLMWeather.h b/Example/Lib/SDK/CHeaders/XPLM/XPLMWeather.h index 3f1f50f..83df9d0 100644 --- a/Example/Lib/SDK/CHeaders/XPLM/XPLMWeather.h +++ b/Example/Lib/SDK/CHeaders/XPLM/XPLMWeather.h @@ -2,7 +2,7 @@ #define _XPLMWeather_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -12,6 +12,13 @@ ***************************************************************************/ /* * This provides access to the X-Plane 12 enhanced weather system. + * + * ALL FUNCTIONS RELATING TO UPDATING THE WEATHER ARE CURRENTLY EXPERIMENTAL, + * FOR EVALUATION. + * + * The API will be kept stable if at all possible during the evaluation + * period. The details of how the data is processed will change over time as + * the weather engine changes, even after the API is stabilised. * */ @@ -21,6 +28,7 @@ extern "C" { #endif +#if defined(XPLM400) /*************************************************************************** * WEATHER ACCESS ***************************************************************************/ @@ -30,20 +38,20 @@ extern "C" { * */ typedef struct { - /* Altitude MSL, meters */ + /* Altitude MSL, meters. */ float alt_msl; - /* Wind speed, meters/sec */ + /* Wind speed, meters/sec. When setting, use a negative value to signify * + * 'undefined'. */ float speed; /* Direction (true) */ float direction; - /* Gust speed, meters/sec */ + /* Gust speed, meters/sec. Total speed, not increase above wind speed. */ float gust_speed; /* Shear arc, degrees i.e. 50% of this arc in either direction from base */ float shear; /* Clear-air turbulence ratio */ float turbulence; } XPLMWeatherInfoWinds_t; - /* * XPLMWeatherInfoClouds_t * @@ -58,37 +66,66 @@ typedef struct { /* Altitude MSL, meters */ float alt_base; } XPLMWeatherInfoClouds_t; - +/* The number of wind layers that are expected in the latest version of * + * XPLMWeatherInfo_t . */ +#define XPLM_NUM_WIND_LAYERS 13 +/* The number of cloud layers that are expected in the latest version of * + * XPLMWeatherInfo_t . */ +#define XPLM_NUM_CLOUD_LAYERS 3 +#if defined(XPLM420) +/* The number of temperature layers that are expected in the latest version of* + * XPLMWeatherInfo_t . */ +#define XPLM_NUM_TEMPERATURE_LAYERS 13 +#endif /* XPLM420 */ +#if defined(XPLM420) +/* Use this value to designate a wind layer as undefined when setting. */ +#define XPLM_WIND_UNDEFINED_LAYER -1 +#endif /* XPLM420 */ +#if defined(XPLM420) +/* Default radius of weather data points set using XPLMSetWeatherAtLocation * + * and XPLMSetWeatherAtAirport. */ +#define XPLM_DEFAULT_WXR_RADIUS_NM 30 +#endif /* XPLM420 */ +#if defined(XPLM420) +/* Default vertical limit of effect of weather data points set using * + * XPLMSetWeatherAtLocation and XPLMSetWeatherAtAirport. */ +#define XPLM_DEFAULT_WXR_LIMIT_MSL_FT 10000 +#endif /* XPLM420 */ /* * XPLMWeatherInfo_t * - * Basic weather conditions at a specific point. + * Basic weather conditions at a specific point. To specify exactly what data + * you intend to send or receive, it is required to set the structSize + * appropriately. + * + * Version 2 data starts at "temp_layers". * */ typedef struct { - /* The size of the struct. */ + /* The size of the struct. Required for both reading and writing. */ int structSize; /* Temperature at the given altitude in Celsius */ float temperature_alt; /* Dewpoint at the given altitude in Celsius */ float dewpoint_alt; - /* Pressure at the given altitude in Pascals */ + /* Pressure at the given altitude in Pascals. Pass 0 when setting to use * + * sea-level pressure instead of QNH. */ float pressure_alt; - /* Precipitation rate at the given altitude */ + /* Precipitation rate at the given altitude. Unused when setting. */ float precip_rate_alt; - /* Wind direction at the given altitude */ + /* Wind direction at the given altitude. Unused when setting. */ float wind_dir_alt; - /* Wind speed at the given altitude, meters/sec */ + /* Wind speed at the given altitude, meters/sec. Unused when setting. */ float wind_spd_alt; - /* Turbulence ratio at the given altitude */ + /* Turbulence ratio at the given altitude. Unused when setting. */ float turbulence_alt; /* Height of water waves in meters */ float wave_height; - /* Length of water waves in meters */ + /* Length of water waves in meters. Unused when setting. */ float wave_length; /* Direction from which water waves are coming */ int wave_dir; - /* Speed of wave advance in meters/sec */ + /* Speed of wave advance in meters/sec. Unused when setting. */ float wave_speed; /* Base visibility at 0 altitude, meters */ float visibility; @@ -96,40 +133,72 @@ typedef struct { float precip_rate; /* Climb rate due to thermals, meters/sec */ float thermal_climb; - /* Pressure at 0 altitude in Pascals */ + /* Pressure at sealevel in Pascals. Used when setting ONLY if pressure_alt * + * (i.e. QNH) is not valid. */ float pressure_sl; /* Defined wind layers. Not all layers are always defined. */ - XPLMWeatherInfoWinds_t wind_layers[13]; + XPLMWeatherInfoWinds_t wind_layers[XPLM_NUM_WIND_LAYERS]; /* Defined cloud layers. Not all layers are always defined. */ - XPLMWeatherInfoClouds_t cloud_layers[3]; + XPLMWeatherInfoClouds_t cloud_layers[XPLM_NUM_CLOUD_LAYERS]; +#if defined(XPLM420) + /* Temperatures at altitude, in degrees C. Layer altitudes are the same * + * globally - see the 'sim/weather/region/atmosphere_alt_levels_m' dataref. */ + float temp_layers[XPLM_NUM_TEMPERATURE_LAYERS]; +#endif /* XPLM420 */ +#if defined(XPLM420) + /* Dewpoints at altitude, in degrees C. Layer altitudes are the same globally * + * - see the 'sim/weather/region/atmosphere_alt_levels_m' dataref. */ + float dewp_layers[XPLM_NUM_TEMPERATURE_LAYERS]; +#endif /* XPLM420 */ +#if defined(XPLM420) + /* The altitude in MSL of the troposphere. */ + float troposphere_alt; +#endif /* XPLM420 */ +#if defined(XPLM420) + /* The temperature in degrees C of the troposphere. */ + float troposphere_temp; +#endif /* XPLM420 */ +#if defined(XPLM420) + /* Age in seconds of this weather report. Age affects how strongly the report * + * affects the resulting weather. */ + float age; +#endif /* XPLM420 */ +#if defined(XPLM420) + /* Horizontal radius of effect of this weather report, nautical miles. */ + float radius_nm; +#endif /* XPLM420 */ +#if defined(XPLM420) + /* Vertical limit of effect of this weather report, feet MSL. */ + float max_altitude_msl_ft; +#endif /* XPLM420 */ } XPLMWeatherInfo_t; - -#if defined(XPLM400) /* * XPLMGetMETARForAirport * * Get the last-downloaded METAR report for an airport by ICAO code. Note that * the actual weather at that airport may have evolved significantly since the * last downloaded METAR. outMETAR must point to a char buffer of at least 150 - * characters. This call is not intended to be used per-frame. This call does - * not return the current weather at the airport, and returns an empty string - * if the system is not in real-weather mode. + * characters. THIS CALL DOES NOT RETURN THE CURRENT WEATHER AT THE AIRPORT, + * and returns an empty string if the system is not in real-weather mode. + * + * This call is not intended to be used per-frame. It should be called only + * during the pre-flight loop callback. * */ XPLM_API void XPLMGetMETARForAirport( const char * airport_id, XPLMFixedString150_t * outMETAR); -#endif /* XPLM400 */ - -#if defined(XPLM400) /* * XPLMGetWeatherAtLocation * * Get the current weather conditions at a given location. Note that this does * not work world-wide, only within the surrounding region. Return 1 if * detailed weather (i.e. an airport-specific METAR) was found, 0 if not. In - * both cases, the structure will contain the best data available. This call - * is not intended to be used per-frame. + * both cases, the structure will contain the best data available. The passed + * in altitude is used to sample wind data vertically. + * + * This call is not intended to be used per-frame. It should be called only + * during the pre-flight loop callback. * */ XPLM_API int XPLMGetWeatherAtLocation( @@ -137,8 +206,163 @@ XPLM_API int XPLMGetWeatherAtLocation( double longitude, double altitude_m, XPLMWeatherInfo_t * out_info); +#if defined(XPLM420) +/* + * XPLMBeginWeatherUpdate + * + * Inform the simulator that you are starting a batch update of weather + * information. If you are providing multiple weather updates, using this call + * may improve performance by telling the simulator not to update weather + * until you are done. + * + * This call is not intended to be used per-frame. It should be called only + * during the pre-flight loop callback. You must call XPLMEndWeatherUpdate + * before you return from the callback; XPLMBeginWeatherUpdate in one callback + * and XPLMEndWeatherUpdate in a later callback, even within the same frame, + * is not permitted. + * + */ +XPLM_API void XPLMBeginWeatherUpdate(void); +#endif /* XPLM420 */ +#if defined(XPLM420) +/* + * XPLMEndWeatherUpdate + * + * Inform the simulator that you are ending a batch update of weather + * information. If you have called XPLMBeginWeatherUpdate, you MUST call + * XPLMEndWeatherUpdate before exiting your callback otherwise any accumulated + * weather data will be discarded. + * + * When using incremental mode, any changes made are applied to your existing + * data. This makes it possible to only update a fraction of your weather data + * at any one time. When not using incremental mode, ALL reports previously + * passed by your plugin are erased before applying new data. + * + * When using any of these 'weather set' APIs, the normal mode of operation is + * that you are setting the weather in the near future. Currently this is + * somewhere between one and two minutes but do not rely on this remaining the + * same. + * + * Setting future weather ensures that there is no sudden jump in weather + * conditions when you make a change mid-cycle. In some situations, notably + * for an initial setup, you may want to ensure that the weather is changed + * instantly. To do this, set 'updateImmediately' as true. + * + * isIncremental : If true, append or modify existing records created by + * your plugin. If false, clear any existing records. updateImmediately : If + * true, immediately reset and recalculate the weather. If false, your new + * data will be used when the weather next recalculates. + * + * This call is not intended to be used per-frame. It should be called only + * during the pre-flight loop callback. + * + */ +XPLM_API void XPLMEndWeatherUpdate( + int isIncremental, + int updateImmediately); +#endif /* XPLM420 */ +#if defined(XPLM420) +/* + * XPLMSetWeatherAtLocation + * + * Set the current weather conditions at a given location on the ground and + * above it.. Please see the notes on individual fields in + * XPLMSetWeatherAtAirport, and notes on timing in XPLMEndWeatherUpdate. + * + * The ground altitude passed into this function call does not set the area of + * influence of this weather vertically; the weather takes effect from 0 MSL + * ground up to the passed in max_altitude_msl_ft The ground altitude passed + * in is the elevation of the reporting station to calibrate QNH. + * + * This call is not intended to be used per-frame. It should be called only + * during the pre-flight loop callback. + * + */ +XPLM_API void XPLMSetWeatherAtLocation( + double latitude, + double longitude, + double ground_altitude_msl, + XPLMWeatherInfo_t * in_info); +#endif /* XPLM420 */ +#if defined(XPLM420) +/* + * XPLMEraseWeatherAtLocation + * + * Erase weather conditions set by your plugin at a given location. You must + * give exactly the same coordinates that you used to create a weather record + * at this point. It does NOT mean 'create clear weather at this location'. + * + * This call is not intended to be used per-frame. It should be called only + * during the pre-flight loop callback. + * + */ +XPLM_API void XPLMEraseWeatherAtLocation( + double latitude, + double longitude); +#endif /* XPLM420 */ +#if defined(XPLM420) +/* + * XPLMSetWeatherAtAirport + * + * Set the current weather conditions at a given airport. Unlike + * XPLMSetWeatherAtLocation, this call will replace any existing weather + * records for that airport from other sources (i.e. downloaded METARs) + * instead of being used as just another weather sample. + * + * Some notes on individual fields: + * - pressure_alt should be QNH as reported by a station at the specified + * airport, or 0 if you are passing sealevel pressure in 'pressure_sl' + * instead. + * - pressure_sl is ignored if pressure_alt is given. + * - wind_dir_alt, wind_spd_alt, turbulence_alt, wave_speed, wave_length are + * derived from other data and are UNUSED when setting weather. + * - Temperatures can be given either as a single temperature at the ground + * altitude (temperature_alt) OR, if the struct is V2 or higher, as an + * array of temperatures aloft (temp_layers). If you pass a value for + * temperature_alt higher than -273.15 (absolute zero), that will be used + * with the altitude value to calculate an offset from ISA temperature at + * all altitudes. Any layer in temp_layers for which you set the + * temperature higher than -273.15 (absolute zero) will use that + * temperature and all others will use the existing value for the + * location, or the calculated values from temperature_alt if you also + * passed that. It is advised to use a lower value than exactly -273.15 to + * avoid floating-point precision errors. These calculated temperatures + * during a read are also affected by the troposphere altitude and + * temperature, and the vertical radius of effect. Do not expect to get + * the exact values you set. + * - The same rules apply to dewpoint temperatures; either a single value at + * ground level in 'dewpoint_alt', or per-layer values in 'dewp_layers'. + * - The troposphere altitude and temperature will be derived from existing + * data if you pass 0 or lower for troposphere_alt. Both altitude and + * temperature may be clamped to internally-defined ranges. + * - When setting both temperature and dewpoint from a single value + * (temperature_alt/dewpoint_alt), the rest of the atmosphere will be + * graded to fit between the given values and the troposphere. + * + * This call is not intended to be used per-frame. It should be called only + * during the pre-flight loop callback. + * + */ +XPLM_API void XPLMSetWeatherAtAirport( + const char * airport_id, + XPLMWeatherInfo_t * in_info); +#endif /* XPLM420 */ +#if defined(XPLM420) +/* + * XPLMEraseWeatherAtAirport + * + * Erase the current weather conditions set by your plugin at a given airport, + * allowing records from other sources to be used. It does NOT mean 'create + * clear weather at this airport'. + * + * This call is not intended to be used per-frame. It should be called only + * during the pre-flight loop callback. + * + */ +XPLM_API void XPLMEraseWeatherAtAirport( + const char * airport_id); +#endif /* XPLM420 */ #endif /* XPLM400 */ - #ifdef __cplusplus } #endif diff --git a/Example/Lib/SDK/Libraries/Lin/XPLM_64.so b/Example/Lib/SDK/Libraries/Lin/XPLM_64.so deleted file mode 100755 index 001e6f6..0000000 Binary files a/Example/Lib/SDK/Libraries/Lin/XPLM_64.so and /dev/null differ diff --git a/Example/Lib/SDK/Libraries/Lin/XPWidgets_64.so b/Example/Lib/SDK/Libraries/Lin/XPWidgets_64.so deleted file mode 100755 index 6eaca3c..0000000 Binary files a/Example/Lib/SDK/Libraries/Lin/XPWidgets_64.so and /dev/null differ diff --git a/Example/Lib/SDK/Libraries/Mac/XPLM.framework/Versions/C/Resources/Info.plist b/Example/Lib/SDK/Libraries/Mac/XPLM.framework/Versions/C/Resources/Info.plist index 53b5610..322ccd8 100644 --- a/Example/Lib/SDK/Libraries/Mac/XPLM.framework/Versions/C/Resources/Info.plist +++ b/Example/Lib/SDK/Libraries/Mac/XPLM.framework/Versions/C/Resources/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 22C65 + 22G313 CFBundleDevelopmentRegion English CFBundleExecutable diff --git a/Example/Lib/SDK/Libraries/Mac/XPLM.framework/Versions/C/XPLM b/Example/Lib/SDK/Libraries/Mac/XPLM.framework/Versions/C/XPLM index 1ea059f..f1d456d 100755 Binary files a/Example/Lib/SDK/Libraries/Mac/XPLM.framework/Versions/C/XPLM and b/Example/Lib/SDK/Libraries/Mac/XPLM.framework/Versions/C/XPLM differ diff --git a/Example/Lib/SDK/Libraries/Mac/XPLM.framework/Versions/C/_CodeSignature/CodeResources b/Example/Lib/SDK/Libraries/Mac/XPLM.framework/Versions/C/_CodeSignature/CodeResources index 1e37a64..14d4a60 100644 --- a/Example/Lib/SDK/Libraries/Mac/XPLM.framework/Versions/C/_CodeSignature/CodeResources +++ b/Example/Lib/SDK/Libraries/Mac/XPLM.framework/Versions/C/_CodeSignature/CodeResources @@ -6,7 +6,7 @@ Resources/Info.plist - voAQ/IDgQqHZqcOEgtUnY+ZQ4Vo= + RyZ+rg/H3cLq281FLYEnVSKuwL0= files2 @@ -15,7 +15,7 @@ hash2 - cbolIMR2jzM1jeru8QBpXnyfepv6PMzWJfroq2E2Coo= + SYG87x/kiE0V2ECkam7vTO0Wgi6AWZr6szuPpYzm+kc= diff --git a/Example/Lib/SDK/Libraries/Mac/XPLM.framework/XPLM b/Example/Lib/SDK/Libraries/Mac/XPLM.framework/XPLM deleted file mode 120000 index ae3cf6c..0000000 --- a/Example/Lib/SDK/Libraries/Mac/XPLM.framework/XPLM +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/XPLM \ No newline at end of file diff --git a/Example/Lib/SDK/Libraries/Mac/XPLM.framework/XPLM b/Example/Lib/SDK/Libraries/Mac/XPLM.framework/XPLM new file mode 100755 index 0000000..b0d529b Binary files /dev/null and b/Example/Lib/SDK/Libraries/Mac/XPLM.framework/XPLM differ diff --git a/Example/Lib/SDK/Libraries/Mac/XPWidgets.framework/Resources b/Example/Lib/SDK/Libraries/Mac/XPWidgets.framework/Resources deleted file mode 120000 index 953ee36..0000000 --- a/Example/Lib/SDK/Libraries/Mac/XPWidgets.framework/Resources +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/Resources \ No newline at end of file diff --git a/Example/Lib/SDK/Libraries/Mac/XPWidgets.framework/Versions/C/Resources/Info.plist b/Example/Lib/SDK/Libraries/Mac/XPWidgets.framework/Versions/C/Resources/Info.plist deleted file mode 100644 index 60487dd..0000000 --- a/Example/Lib/SDK/Libraries/Mac/XPWidgets.framework/Versions/C/Resources/Info.plist +++ /dev/null @@ -1,42 +0,0 @@ - - - - - BuildMachineOSBuild - 22C65 - CFBundleDevelopmentRegion - English - CFBundleExecutable - XPWidgets - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - FMWK - CFBundleSignature - ???? - CFBundleSupportedPlatforms - - MacOSX - - CSResourcesFileMapped - - DTCompiler - com.apple.compilers.llvm.clang.1_0 - DTPlatformBuild - 14C18 - DTPlatformName - macosx - DTPlatformVersion - 13.1 - DTSDKBuild - 22C55 - DTSDKName - macosx13.1 - DTXcode - 1420 - DTXcodeBuild - 14C18 - LSMinimumSystemVersion - 10.15 - - diff --git a/Example/Lib/SDK/Libraries/Mac/XPWidgets.framework/Versions/C/XPWidgets b/Example/Lib/SDK/Libraries/Mac/XPWidgets.framework/Versions/C/XPWidgets deleted file mode 100755 index c996c4a..0000000 Binary files a/Example/Lib/SDK/Libraries/Mac/XPWidgets.framework/Versions/C/XPWidgets and /dev/null differ diff --git a/Example/Lib/SDK/Libraries/Mac/XPWidgets.framework/Versions/C/_CodeSignature/CodeResources b/Example/Lib/SDK/Libraries/Mac/XPWidgets.framework/Versions/C/_CodeSignature/CodeResources deleted file mode 100644 index cf0809d..0000000 --- a/Example/Lib/SDK/Libraries/Mac/XPWidgets.framework/Versions/C/_CodeSignature/CodeResources +++ /dev/null @@ -1,128 +0,0 @@ - - - - - files - - Resources/Info.plist - - SngFRYyYZvFDvj7WlMImI0nWjNQ= - - - files2 - - Resources/Info.plist - - hash2 - - cyPpU9uTChX7rFyoW42moNimK/DK8zmtQ8Wih5q0fz4= - - - - rules - - ^Resources/ - - ^Resources/.*\.lproj/ - - optional - - weight - 1000 - - ^Resources/.*\.lproj/locversion.plist$ - - omit - - weight - 1100 - - ^Resources/Base\.lproj/ - - weight - 1010 - - ^version.plist$ - - - rules2 - - .*\.dSYM($|/) - - weight - 11 - - ^(.*/)?\.DS_Store$ - - omit - - weight - 2000 - - ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ - - nested - - weight - 10 - - ^.* - - ^Info\.plist$ - - omit - - weight - 20 - - ^PkgInfo$ - - omit - - weight - 20 - - ^Resources/ - - weight - 20 - - ^Resources/.*\.lproj/ - - optional - - weight - 1000 - - ^Resources/.*\.lproj/locversion.plist$ - - omit - - weight - 1100 - - ^Resources/Base\.lproj/ - - weight - 1010 - - ^[^/]+$ - - nested - - weight - 10 - - ^embedded\.provisionprofile$ - - weight - 20 - - ^version\.plist$ - - weight - 20 - - - - diff --git a/Example/Lib/SDK/Libraries/Mac/XPWidgets.framework/Versions/Current b/Example/Lib/SDK/Libraries/Mac/XPWidgets.framework/Versions/Current deleted file mode 120000 index 96d80cd..0000000 --- a/Example/Lib/SDK/Libraries/Mac/XPWidgets.framework/Versions/Current +++ /dev/null @@ -1 +0,0 @@ -C \ No newline at end of file diff --git a/Example/Lib/SDK/Libraries/Mac/XPWidgets.framework/XPWidgets b/Example/Lib/SDK/Libraries/Mac/XPWidgets.framework/XPWidgets deleted file mode 120000 index 61477f4..0000000 --- a/Example/Lib/SDK/Libraries/Mac/XPWidgets.framework/XPWidgets +++ /dev/null @@ -1 +0,0 @@ -Versions/Current/XPWidgets \ No newline at end of file diff --git a/Example/Lib/SDK/Libraries/Win/XPLM_64.lib b/Example/Lib/SDK/Libraries/Win/XPLM_64.lib index 090ed41..bb5dbf2 100644 Binary files a/Example/Lib/SDK/Libraries/Win/XPLM_64.lib and b/Example/Lib/SDK/Libraries/Win/XPLM_64.lib differ diff --git a/Example/Lib/SDK/Libraries/Win/XPWidgets_64.lib b/Example/Lib/SDK/Libraries/Win/XPWidgets_64.lib deleted file mode 100644 index 53c55d6..0000000 Binary files a/Example/Lib/SDK/Libraries/Win/XPWidgets_64.lib and /dev/null differ diff --git a/Example/Lib/SDK/README.txt b/Example/Lib/SDK/README.txt index 122e3df..2cd419c 100644 --- a/Example/Lib/SDK/README.txt +++ b/Example/Lib/SDK/README.txt @@ -32,6 +32,49 @@ SDK website explains this process in more detail. This section contains per-release notes for the history of the X-Plane SDK. +X-Plane SDK Release 4.3.0 2/21/2026 + +The 4.3.0 SDK includes new API functionality: + + - The new XPLMInitFlight and XPLMUpdateFlight APIs in XPLMPlanes provide + complete control over creating and editing how the user's flight starts. + + These APIs supercede and expose deeper functinality than the previous + XPLMPlaceUserAtAirport and XPLMPlaceUserAtLocation APIs. + + - The third MDCU is exposed in the avionics API. + +This version of the SDK requires X-Pane 12.4.0 or newer. + + Erata note: the 4.3.0 SDK incorrectly identifies itself as version "421" + in the version includeded in X-Plane 12.4.0. Despite this, all entry points + are present. The version number is corrected to 430 to match published docs + as of X-Plane 12.4.1. + +X-Plane SDK Release 4.2.0 10/31/2025 + +The 4.2.0 SDK includes new API functionality: + + - New weather APIs allow plugins to specify weather at multiple points for + custom weather that varies spatially. + + - The weather info structure is extended to support new data fields. + + - Extended texture ID enumerations to access the radar return texture for + avionics drawing callbacks. + + - Instances can be located using double precision coordinates, and can be + set to automatically move to match scenery coordinate shifts. + + - Extended cursor enumerations for display and avionic cursor callbacks. + +This version of the SDK requires X-Plane 12.3.0 or newer. This version of the +SDK is compiled against FMOD 2.0.2. + +X-Plane SDK Release 4.1.2 1/6/2025 + +Internal changes to support 'safe mode' in the simulator. + X-Plane SDK Release 4.1.1 10/10/2024 This is a bug fix to the SDK itself; the dylib link paths on the included diff --git a/LTAPI.cpp b/LTAPI.cpp index 35977f4..e46b444 100644 --- a/LTAPI.cpp +++ b/LTAPI.cpp @@ -10,7 +10,7 @@ /// textual info like type, registration, call sign, flight number. /// @see https://twinfan.github.io/LTAPI/ /// @author Birger Hoppe -/// @copyright (c) 2019-2025 Birger Hoppe +/// @copyright (c) 2019-2026 Birger Hoppe /// @copyright Permission is hereby granted, free of charge, to any person obtaining a /// copy of this software and associated documentation files (the "Software"), /// to deal in the Software without restriction, including without limitation @@ -299,6 +299,36 @@ std::string LTAPIAircraft::getPhaseStr () const return "?"; } +// Transponder mode text, like "off", "Mode C", "Mode S TARA" +const char* LTAPIAircraft::getTrspModeTxt() const +{ + switch (getTrspMode()) { + case xpmpTransponderMode_Off: return "off"; + case xpmpTransponderMode_Standby: return "standby"; + case xpmpTransponderMode_ModeA: return "Mode A"; + case xpmpTransponderMode_ModeC: return "Mode C"; + case xpmpTransponderMode_Test: return "Test"; + case xpmpTransponderMode_ModeS_Gnd: return "Mode S GND"; + case xpmpTransponderMode_ModeS_TAOnly: return "Mode S TA-Only"; + case xpmpTransponderMode_ModeS_TARA: return "Mode S TA/RA"; + } + return "?"; +} + +// @brief `lat`/`lon`/`alt` converted to local coordinates +void LTAPIAircraft::getLocalCoord (double& x, double& y, double& z) const +{ + // older version don't send local coordinates directly, then we need to convert + if (std::isnan(bulk.x)) + XPLMWorldToLocal(bulk.lat,bulk.lon,bulk.alt_ft*0.3048, &x,&y,&z); + // but if we have local coordinates already then let's just forward those + else { + x = bulk.x; + y = bulk.y; + z = bulk.z; + } +} + // // MARK: LTAPIConnect // diff --git a/LTAPI.h b/LTAPI.h index d55f39a..cf33073 100644 --- a/LTAPI.h +++ b/LTAPI.h @@ -10,7 +10,7 @@ /// textual info like type, registration, call sign, flight number. /// @see https://twinfan.github.io/LTAPI/ /// @author Birger Hoppe -/// @copyright (c) 2019-2025 Birger Hoppe +/// @copyright (c) 2019-2026 Birger Hoppe /// @copyright Permission is hereby granted, free of charge, to any person obtaining a /// copy of this software and associated documentation files (the "Software"), /// to deal in the Software without restriction, including without limitation @@ -36,6 +36,7 @@ #include #include #include +#include #include "XPLMDataAccess.h" #include "XPLMGraphics.h" @@ -85,6 +86,20 @@ class LTAPIAircraft FPH_STOPPED_ON_RWY ///< Stopped on runway because ran out of tracking data, plane will disappear soon }; + /// @brief These enumerations define the way the transponder of a given plane is operating. + /// @note as defined by dataRef `sim/cockpit2/tcas/targets/ssr_mode`: + /// "Transponder mode: off=0, stdby=1, on (mode A)=2, alt (mode C)=3, test=4, GND (mode S)=5, ta_only (mode S)=6, ta/ra=7" + enum XPMPTransponderMode { + xpmpTransponderMode_Off = 0, ///< transponder is off not currently sending -> aircraft not visible on TCAS + xpmpTransponderMode_Standby, ///< transponder is in standby, not currently sending -> aircraft not visible on TCAS + xpmpTransponderMode_ModeA, ///< transponder is on, Mode A + xpmpTransponderMode_ModeC, ///< transponder is on, Mode C (Alt) + xpmpTransponderMode_Test, ///< transponder is on, Test + xpmpTransponderMode_ModeS_Gnd, ///< transponder is on, Mode S (Gnd) + xpmpTransponderMode_ModeS_TAOnly, ///< transponder is on, Mode S (TA-Only) + xpmpTransponderMode_ModeS_TARA, ///< transponder is on, Mode S (TA/RA) + }; + /// @brief Bulk data transfer structur for communication with LTAPI /// @note Structure needs to be in synch with LiveTraffic, /// version differences are handled using a struct size "negotiation", @@ -126,20 +141,31 @@ class LTAPIAircraft bool camera : 1; ///< is LiveTraffic's camera on this aircraft? // Misc int multiIdx : 8; ///< multiplayer index if plane reported via sim/multiplayer/position dataRefs, 0 if not + // Transponder Mode (added in LT 4.4.0) + unsigned trspMode : 4; ///< Transponder mode, see enum XPMPTransponderMode (filled only as of LT 4.4.0) // Filler for 8-byte alignment - unsigned filler2 : 8; + unsigned filler2 : 4; unsigned filler3 : 32; } bits; ///< Flights phase, on-ground status, lights // V1.22 additions - double lat = 0.0f; ///< [°] latitude - double lon = 0.0f; ///< [°] longitude - double alt_ft = 0.0f; ///< [ft] altitude - + double lat = 0.0f; ///< [°] latitude + double lon = 0.0f; ///< [°] longitude + double alt_ft = 0.0f; ///< [ft] altitude + + // LT v4.4.0 additions + // Cartesian location in local coordinates + double x = NAN; ///< local Cartesian X coordinate (NAN indicates to delivered by master, e.g. because older version) + double y = NAN; ///< local Cartesian Y coordinate + double z = NAN; ///< local Cartesian Z coordinate + // Cartesian velocity in m/s per axis, updated at least once per second + double v_x = NAN; ///< [m/s] Cartesian velocity in X direction + double v_y = NAN; ///< [m/s] Cartesian velocity in Y direction + double v_z = NAN; ///< [m/s] Cartesian velocity in Z direction /// Constructor initializes some data without defaults LTAPIBulkData() - { memset(&bits, 0, sizeof(bits)); } + { memset(&bits, 0, sizeof(bits)); bits.trspMode = 4; } }; /// @brief Bulk text transfer structur for communication with LTAPI @@ -275,15 +301,31 @@ class LTAPIAircraft float getBearing() const { return bulk.bearing; } ///< [°] to current camera position float getDistNm() const { return bulk.dist_nm; } ///< [nm] distance to current camera int getMultiIdx() const { return bulk.bits.multiIdx; } ///< multiplayer index if plane reported via sim/multiplayer/position dataRefs, 0 if not + XPMPTransponderMode getTrspMode() const ///< Transponder mode, like off, Mode_C, Mode_S_TARA + { return XPMPTransponderMode(bulk.bits.trspMode); } + const char* getTrspModeTxt() const; ///< Transponder mode text, like "off", "Mode C", "Mode S TARA" - // calculated /// @brief `lat`/`lon`/`alt` converted to local coordinates + /// @see https://developer.x-plane.com/article/screencoordinates/#3-D_Coordinate_System + /// @param[out] v_x [m/s] Local cartesian velocity on the x axis of the local coordinate system (roughly "east") + /// @param[out] v_y [m/s] Local cartesian velocity on the y axis of the local coordinate system (roughly "up") + /// @param[out] v_z [m/s] Local cartesian velocity on the z axis of the local coordinate system (roughly "south") + void getLocalVelocities (double& v_x, double& v_y, double& v_z) const + { v_x = bulk.v_x; v_y = bulk.v_y; v_z = bulk.v_z; } + + /// @brief [m/s] Approximate ground speed based on local coordinates + double getLocalGndSpeed_ms () const { return std::hypot(bulk.v_x, bulk.v_z); } + /// @brief [kn] Approximate ground speed based on local coordinates + double getLocalGndSpeed_kn () const { return getLocalGndSpeed_ms() * 1.94384; } + + // calculated (or transferred in newer versions) + /// @brief Local coordinates (coverted from `lat`/`lon`/`alt` in older versions) + /// @see https://developer.x-plane.com/article/screencoordinates/#3-D_Coordinate_System /// @see https://developer.x-plane.com/sdk/XPLMGraphics/#XPLMWorldToLocal /// @param[out] x Local x coordinate /// @param[out] y Local y coordinate /// @param[out] z Local z coordinate - void getLocalCoord (double& x, double& y, double& z) const - { XPLMWorldToLocal(bulk.lat,bulk.lon,bulk.alt_ft*0.3048, &x,&y,&z); } + void getLocalCoord (double& x, double& y, double& z) const; public: /// @brief Standard object creation callback. @@ -509,13 +551,26 @@ class LTDataRef { /// Size of original bulk structure as per LiveTraffic v1.20 constexpr size_t LTAPIBulkData_v120 = 80; +/// Size of bulk structure as per LiveTraffic v1.22 +#if IBM +constexpr size_t LTAPIBulkData_v122 = 120; +#else +constexpr size_t LTAPIBulkData_v122 = 104; +#endif + /// Size of current bulk structure -constexpr size_t LTAPIBulkData_v122 = sizeof(LTAPIAircraft::LTAPIBulkData); +constexpr size_t LTAPIBulkData_v440 = sizeof(LTAPIAircraft::LTAPIBulkData); +#if IBM +static_assert(LTAPIBulkData_v440 == 168, "LTAPIBulkData size is not 152 as expected"); +#else +static_assert(LTAPIBulkData_v440 == 152, "LTAPIBulkData size is not 152 as expected"); +#endif /// Size of original bulk info structure as per previous versions of LiveTraffic constexpr size_t LTAPIBulkInfoTexts_v120 = 264; constexpr size_t LTAPIBulkInfoTexts_v122 = 288; /// Size of current bulk info structure constexpr size_t LTAPIBulkInfoTexts_v240 = sizeof(LTAPIAircraft::LTAPIBulkInfoTexts); +static_assert(LTAPIBulkInfoTexts_v240 == 304, "LTAPIBulkInfoTexts size is not 304 as expected"); #endif /* LTAPI_h */ diff --git a/README.md b/README.md index 13d45e3..aaea134 100644 --- a/README.md +++ b/README.md @@ -51,10 +51,15 @@ All the rest of the code deals with the example's functionality, which is: ### IDEs - Mac: Open the XCode project `LTAPI.xcodeproj`. There might be paths you way want to check: In the Build Settings there is a user-defined setting `XPLANE11_ROOT` pointing to the root folder of your X-Plane 11 installation. If that is set correctly then the resulting plugin is installed there correctly in the `plugins` folder. -- Windows: Open the Visual Studio solution `LTAPI.sln`. Also here you might need to check directories. There is a copy command to my X-Plane installation in the _Post Build Event_. +- Windows: In Visual Studio, use "File | Open | Folder..." to open the LTAPI +folder. Visual Studio will find the `Example/CMakeList.txt` file and offer +to use it to build the solution based on it. Results are in the `build` folder. ### Docker +> **NOTE:** The Docker environment hasn't been maintained for a long time +> and is no longer guaranteed to work. + As I don't have a Linux environment myself I provide a Docker environment to build the Linux version as well as the Windows and the Mac version based on a `CMakeList`. I have not tested the resulting Linux binary. - You need [Docker](https://www.docker.com/get-started) installed. Then, with the Docker app running: - `cd Example/docker` diff --git a/docs/html/LTAPI_8cpp.html b/docs/html/LTAPI_8cpp.html index f8a6871..40defd1 100644 --- a/docs/html/LTAPI_8cpp.html +++ b/docs/html/LTAPI_8cpp.html @@ -98,7 +98,7 @@

LiveTraffic API.

API to access LiveTraffic's aircraft information. Data transfer from LiveTraffic to your plugin is by dataRefs in a fast, efficient way: LiveTraffic copies data of several planes combined into defined structures. LTAPI handles all that in the background and provides you with an array of aircraft information with numerical info like position, heading, speed and textual info like type, registration, call sign, flight number.

See also
https://twinfan.github.io/LTAPI/
Author
Birger Hoppe
-
@@ -115,9 +116,12 @@ constexpr size_t LTAPIBulkData_v120 = 80  Size of original bulk structure as per LiveTraffic v1.20.
  -constexpr size_t LTAPIBulkData_v122 = sizeof(LTAPIAircraft::LTAPIBulkData) - Size of current bulk structure.
+constexpr size_t LTAPIBulkData_v122 = 104 + Size of bulk structure as per LiveTraffic v1.22.
  +constexpr size_t LTAPIBulkData_v440 = sizeof(LTAPIAircraft::LTAPIBulkData) + Size of current bulk structure.
+  constexpr size_t LTAPIBulkInfoTexts_v120 = 264  Size of original bulk info structure as per previous versions of LiveTraffic.
  @@ -131,7 +135,7 @@

LiveTraffic API.

API to access LiveTraffic's aircraft information. Data transfer from LiveTraffic to your plugin is by dataRefs in a fast, efficient way: LiveTraffic copies data of several planes combined into defined structures. LTAPI handles all that in the background and provides you with an array of aircraft information with numerical info like position, heading, speed and textual info like type, registration, call sign, flight number.

See also
https://twinfan.github.io/LTAPI/
Author
Birger Hoppe
-
@@ -313,7 +323,31 @@

- + + +
size_t LTAPIBulkData_v122 = sizeof(LTAPIAircraft::LTAPIBulkData)size_t LTAPIBulkData_v122 = 104
+ + +constexpr + + +
+ +

Size of bulk structure as per LiveTraffic v1.22.

+ +
+ +
+

◆ LTAPIBulkData_v440

+ +
+
+ + + diff --git a/docs/html/LTAPI_8h_source.html b/docs/html/LTAPI_8h_source.html index 9a0004e..572dd82 100644 --- a/docs/html/LTAPI_8h_source.html +++ b/docs/html/LTAPI_8h_source.html @@ -68,393 +68,440 @@
36#include <list>
37#include <map>
38#include <chrono>
-
39
-
40#include "XPLMDataAccess.h"
-
41#include "XPLMGraphics.h"
-
42
-
43class LTDataRef;
-
44class LTAPIAircraft;
-
45
-
47typedef std::shared_ptr<LTAPIAircraft> SPtrLTAPIAircraft;
-
48
-
- -
56{
-
57private:
-
60 unsigned keyNum = 0;
-
62 std::string key;
-
63
-
64public:
-
65
- -
87
+
39#include <cmath>
+
40
+
41#include "XPLMDataAccess.h"
+
42#include "XPLMGraphics.h"
+
43
+
44class LTDataRef;
+
45class LTAPIAircraft;
+
46
+
48typedef std::shared_ptr<LTAPIAircraft> SPtrLTAPIAircraft;
+
49
+
+ +
57{
+
58private:
+
61 unsigned keyNum = 0;
+
63 std::string key;
+
64
+
65public:
+
66
+ +
88
- -
93 public:
-
94 // identification
-
95 uint64_t keyNum = 0;
-
96 // position, attitude
-
97 float lat_f = 0.0f;
-
98 float lon_f = 0.0f;
-
99 float alt_ft_f = 0.0f;
-
100 float heading = 0.0f;
-
101 float track = 0.0f;
-
102 float roll = 0.0f;
-
103 float pitch = 0.0f;
-
104 float speed_kt = 0.0f;
-
105 float vsi_ft = 0.0f;
-
106 float terrainAlt_ft = 0.0f;
-
107 float height_ft = 0.0f;
-
108 // configuration
-
109 float flaps = 0.0f;
-
110 float gear = 0.0f;
-
111 float reversers = 0.0f;
-
112 // simulation
-
113 float bearing = 0.0f;
-
114 float dist_nm = 0.0f;
-
115
-
-
116 struct BulkBitsTy {
- -
118 bool onGnd : 1;
-
119 // Lights:
-
120 bool taxi : 1;
-
121 bool land : 1;
-
122 bool bcn : 1;
-
123 bool strb : 1;
-
124 bool nav : 1;
-
125 unsigned hidden : 1;
-
126 bool camera : 1;
-
127 // Misc
-
128 int multiIdx : 8;
-
129 // Filler for 8-byte alignment
-
130 unsigned filler2 : 8;
-
131 unsigned filler3 : 32;
- -
-
133
-
134 // V1.22 additions
-
135 double lat = 0.0f;
-
136 double lon = 0.0f;
-
137 double alt_ft = 0.0f;
-
138
-
139
-
- -
142 { memset(&bits, 0, sizeof(bits)); }
-
-
143 };
-
-
144
-
- -
148 public:
-
149 // identification
-
150 uint64_t keyNum;
-
151 char registration[8];
-
152 // aircraft model/operator
-
153 char modelIcao[8];
-
154 char acClass[4];
-
155 char wtc[4];
-
156 char opIcao[8];
-
157 char man[40];
-
158 char model[40];
-
159 char catDescr[40];
-
160 char op[40];
-
161 // flight data
-
162 char callSign[8];
-
163 char squawk[8];
-
164 char flightNumber[8];
-
165 char origin[8];
-
166 char destination[8];
-
167 char trackedBy[24];
-
168
-
169 // V1.22 additions, in V2.40 extended from 24 to 40 chars
-
170 char cslModel[40];
-
171
-
- -
174 { memset(this, 0, sizeof(*this)); }
-
-
175 };
-
-
176
-
-
178 struct LTLights {
-
179 bool beacon : 1;
-
180 bool strobe : 1;
-
181 bool nav : 1;
-
182 bool landing : 1;
-
183 bool taxi : 1;
-
184
-
- -
187 beacon(b.bcn), strobe(b.strb), nav(b.nav), landing(b.land), taxi(b.taxi){}
-
-
188 };
-
-
189
-
190protected:
- - -
193
-
195 bool bUpdated = false;
-
196
-
197public:
- -
199 virtual ~LTAPIAircraft();
-
200
-
201 // Updates an aircraft. If our key is defined it first verifies that the
-
202 // key matches with the one currently available in the dataRefs.
-
203 // Returns false if not.
-
204 // If our key is not defined it just accepts anything available.
-
205 // Updates all fields, set bUpdated and returns true.
-
209 virtual bool updateAircraft(const LTAPIBulkData& __bulk, size_t __inSize);
-
213 virtual bool updateAircraft(const LTAPIBulkInfoTexts& __info, size_t __inSize);
-
215 bool isUpdated () const { return bUpdated; }
-
217 void resetUpdated () { bUpdated = false; }
-
218
-
-
222 virtual void toggleCamera ([[maybe_unused]] bool bCameraActive,
-
223 [[maybe_unused]] SPtrLTAPIAircraft spPrevAc) {}
-
-
224
-
226 void setCameraAc ();
-
227
-
228 // data access
-
229public:
-
230 std::string getKey() const { return key; }
-
231 // identification
-
-
232 std::string getRegistration() const { return info.registration; }
-
233 // aircraft model/operator
-
-
234 std::string getModelIcao() const { return info.modelIcao; }
-
-
235 std::string getAcClass() const { return info.acClass; }
-
-
236 std::string getWtc() const { return info.wtc; }
-
-
237 std::string getOpIcao() const { return info.opIcao; }
-
-
238 std::string getMan() const { return info.man; }
-
-
239 std::string getModel() const { return info.model; }
-
-
240 std::string getCatDescr() const { return info.catDescr; }
-
-
241 std::string getOp() const { return info.op; }
-
-
242 std::string getCslModel() const { return info.cslModel; }
-
243 // flight data
-
-
244 std::string getCallSign() const { return info.callSign; }
-
-
245 std::string getSquawk() const { return info.squawk; }
-
-
246 std::string getFlightNumber() const { return info.flightNumber; }
- +
102
+
+ +
108 public:
+
109 // identification
+
110 uint64_t keyNum = 0;
+
111 // position, attitude
+
112 float lat_f = 0.0f;
+
113 float lon_f = 0.0f;
+
114 float alt_ft_f = 0.0f;
+
115 float heading = 0.0f;
+
116 float track = 0.0f;
+
117 float roll = 0.0f;
+
118 float pitch = 0.0f;
+
119 float speed_kt = 0.0f;
+
120 float vsi_ft = 0.0f;
+
121 float terrainAlt_ft = 0.0f;
+
122 float height_ft = 0.0f;
+
123 // configuration
+
124 float flaps = 0.0f;
+
125 float gear = 0.0f;
+
126 float reversers = 0.0f;
+
127 // simulation
+
128 float bearing = 0.0f;
+
129 float dist_nm = 0.0f;
+
130
+
+
131 struct BulkBitsTy {
+ +
133 bool onGnd : 1;
+
134 // Lights:
+
135 bool taxi : 1;
+
136 bool land : 1;
+
137 bool bcn : 1;
+
138 bool strb : 1;
+
139 bool nav : 1;
+
140 unsigned hidden : 1;
+
141 bool camera : 1;
+
142 // Misc
+
143 int multiIdx : 8;
+
144 // Transponder Mode (added in LT 4.4.0)
+
145 unsigned trspMode : 4;
+
146 // Filler for 8-byte alignment
+
147 unsigned filler2 : 4;
+
148 unsigned filler3 : 32;
+ +
+
150
+
151 // V1.22 additions
+
152 double lat = 0.0f;
+
153 double lon = 0.0f;
+
154 double alt_ft = 0.0f;
+
155
+
156 // LT v4.4.0 additions
+
157 // Cartesian location in local coordinates
+
158 double x = NAN;
+
159 double y = NAN;
+
160 double z = NAN;
+
161 // Cartesian velocity in m/s per axis, updated at least once per second
+
162 double v_x = NAN;
+
163 double v_y = NAN;
+
164 double v_z = NAN;
+
165
+
+ +
168 { memset(&bits, 0, sizeof(bits)); bits.trspMode = 4; }
+
+
169 };
+
+
170
+
+ +
174 public:
+
175 // identification
+
176 uint64_t keyNum;
+
177 char registration[8];
+
178 // aircraft model/operator
+
179 char modelIcao[8];
+
180 char acClass[4];
+
181 char wtc[4];
+
182 char opIcao[8];
+
183 char man[40];
+
184 char model[40];
+
185 char catDescr[40];
+
186 char op[40];
+
187 // flight data
+
188 char callSign[8];
+
189 char squawk[8];
+
190 char flightNumber[8];
+
191 char origin[8];
+
192 char destination[8];
+
193 char trackedBy[24];
+
194
+
195 // V1.22 additions, in V2.40 extended from 24 to 40 chars
+
196 char cslModel[40];
+
197
+
+ +
200 { memset(this, 0, sizeof(*this)); }
+
+
201 };
+
+
202
+
+
204 struct LTLights {
+
205 bool beacon : 1;
+
206 bool strobe : 1;
+
207 bool nav : 1;
+
208 bool landing : 1;
+
209 bool taxi : 1;
+
210
+
+ +
213 beacon(b.bcn), strobe(b.strb), nav(b.nav), landing(b.land), taxi(b.taxi){}
+
+
214 };
+
+
215
+
216protected:
+ + +
219
+
221 bool bUpdated = false;
+
222
+
223public:
+ +
225 virtual ~LTAPIAircraft();
+
226
+
227 // Updates an aircraft. If our key is defined it first verifies that the
+
228 // key matches with the one currently available in the dataRefs.
+
229 // Returns false if not.
+
230 // If our key is not defined it just accepts anything available.
+
231 // Updates all fields, set bUpdated and returns true.
+
235 virtual bool updateAircraft(const LTAPIBulkData& __bulk, size_t __inSize);
+
239 virtual bool updateAircraft(const LTAPIBulkInfoTexts& __info, size_t __inSize);
+
241 bool isUpdated () const { return bUpdated; }
+
243 void resetUpdated () { bUpdated = false; }
+
244
-
248 std::string getDestination() const { return info.destination; }
-
-
249 std::string getTrackedBy() const { return info.trackedBy; }
-
250 // combined info
-
-
251 std::string getDescription() const;
-
252 // position, attitude
-
253 double getLat() const { return bulk.lat; }
-
-
254 double getLon() const { return bulk.lon; }
-
-
255 double getAltFt() const { return bulk.alt_ft; }
-
-
256 float getHeading() const { return bulk.heading; }
-
-
257 float getTrack() const { return bulk.track; }
+
248 virtual void toggleCamera ([[maybe_unused]] bool bCameraActive,
+
249 [[maybe_unused]] SPtrLTAPIAircraft spPrevAc) {}
+
+
250
+
252 void setCameraAc ();
+
253
+
254 // data access
+
255public:
+
256 std::string getKey() const { return key; }
+
257 // identification
-
258 float getRoll() const { return bulk.roll; }
-
-
259 float getPitch() const { return bulk.pitch; }
+
258 std::string getRegistration() const { return info.registration; }
+
259 // aircraft model/operator
-
260 float getSpeedKn() const { return bulk.speed_kt; }
+
260 std::string getModelIcao() const { return info.modelIcao; }
-
261 float getVSIft() const { return bulk.vsi_ft; }
+
261 std::string getAcClass() const { return info.acClass; }
-
262 float getTerrainFt() const { return bulk.terrainAlt_ft; }
+
262 std::string getWtc() const { return info.wtc; }
-
263 float getHeightFt() const { return bulk.height_ft; }
+
263 std::string getOpIcao() const { return info.opIcao; }
-
264 bool isOnGnd() const { return bulk.bits.onGnd; }
+
264 std::string getMan() const { return info.man; }
-
265 LTFlightPhase getPhase() const { return bulk.bits.phase; }
+
265 std::string getModel() const { return info.model; }
-
266 std::string getPhaseStr() const;
-
267 bool isVisible() const { return !bulk.bits.hidden; }
-
268 // configuration
-
-
269 float getFlaps() const { return bulk.flaps; }
+
266 std::string getCatDescr() const { return info.catDescr; }
+
+
267 std::string getOp() const { return info.op; }
+
+
268 std::string getCslModel() const { return info.cslModel; }
+
269 // flight data
-
270 float getGear() const { return bulk.gear; }
+
270 std::string getCallSign() const { return info.callSign; }
-
271 float getReversers() const { return bulk.reversers; }
+
271 std::string getSquawk() const { return info.squawk; }
-
272 LTLights getLights() const { return bulk.bits; }
+
272 std::string getFlightNumber() const { return info.flightNumber; }
-
273 bool isOnCamera() const { return bulk.bits.camera; }
-
274 // simulation
+
273 std::string getOrigin() const { return info.origin; }
+
+
274 std::string getDestination() const { return info.destination; }
-
275 float getBearing() const { return bulk.bearing; }
-
-
276 float getDistNm() const { return bulk.dist_nm; }
+
275 std::string getTrackedBy() const { return info.trackedBy; }
+
276 // combined info
-
277 int getMultiIdx() const { return bulk.bits.multiIdx; }
-
278
-
279 // calculated
+
277 std::string getDescription() const;
+
278 // position, attitude
+
279 double getLat() const { return bulk.lat; }
+
+
280 double getLon() const { return bulk.lon; }
+
+
281 double getAltFt() const { return bulk.alt_ft; }
+
+
282 float getHeading() const { return bulk.heading; }
+
+
283 float getTrack() const { return bulk.track; }
+
+
284 float getRoll() const { return bulk.roll; }
-
285 void getLocalCoord (double& x, double& y, double& z) const
-
286 { XPLMWorldToLocal(bulk.lat,bulk.lon,bulk.alt_ft*0.3048, &x,&y,&z); }
-
-
287
-
288public:
-
291 static LTAPIAircraft* CreateNewObject() { return new LTAPIAircraft(); }
-
292};
-
293
-
294//
-
295// MapLTAPIAircraft
-
296//
-
297
-
308typedef std::map<std::string,SPtrLTAPIAircraft> MapLTAPIAircraft;
-
309
-
314typedef std::list<SPtrLTAPIAircraft> ListLTAPIAircraft;
-
315
-
- -
320{
-
321public:
- -
332
-
336 std::chrono::seconds sPeriodExpsv = std::chrono::seconds(3);
-
337
-
338protected:
-
340 const int iBulkAc = 50;
-
342 std::unique_ptr<LTAPIAircraft::LTAPIBulkData[]> vBulkNum;
-
344 std::unique_ptr<LTAPIAircraft::LTAPIBulkInfoTexts[]> vInfoTexts;
-
345
-
346protected:
- -
349
- -
352
-
354 std::chrono::time_point<std::chrono::steady_clock> lastExpsvFetch;
-
355
-
356public:
- -
362 int numBulkAc = 50);
-
363 virtual ~LTAPIConnect();
-
364
-
366 static bool isLTAvail ();
-
367
-
379 static int getLTVerNr();
-
380
-
385 static int getLTVerDate();
-
386
-
392 static bool doesLTDisplayAc ();
-
393
-
395 static int getLTNumAc ();
-
396
-
404 static bool doesLTControlAI ();
-
405
-
407 static time_t getLTSimTime ();
-
408
-
410 static std::chrono::system_clock::time_point getLTSimTimePoint ();
-
411
-
419 const MapLTAPIAircraft& UpdateAcList (ListLTAPIAircraft* plistRemovedAc = nullptr);
-
420
-
422 const MapLTAPIAircraft& getAcMap () const { return mapAc; }
-
423
-
427 SPtrLTAPIAircraft getAcByMultIdx (int multiIdx) const;
+
285 float getPitch() const { return bulk.pitch; }
+
+
286 float getSpeedKn() const { return bulk.speed_kt; }
+
+
287 float getVSIft() const { return bulk.vsi_ft; }
+
+
288 float getTerrainFt() const { return bulk.terrainAlt_ft; }
+
+
289 float getHeightFt() const { return bulk.height_ft; }
+
+
290 bool isOnGnd() const { return bulk.bits.onGnd; }
+
+
291 LTFlightPhase getPhase() const { return bulk.bits.phase; }
+
+
292 std::string getPhaseStr() const;
+
293 bool isVisible() const { return !bulk.bits.hidden; }
+
294 // configuration
+
+
295 float getFlaps() const { return bulk.flaps; }
+
+
296 float getGear() const { return bulk.gear; }
+
+
297 float getReversers() const { return bulk.reversers; }
+
+
298 LTLights getLights() const { return bulk.bits; }
+
+
299 bool isOnCamera() const { return bulk.bits.camera; }
+
300 // simulation
+
+
301 float getBearing() const { return bulk.bearing; }
+
+
302 float getDistNm() const { return bulk.dist_nm; }
+
+
303 int getMultiIdx() const { return bulk.bits.multiIdx; }
+ +
306 const char* getTrspModeTxt() const;
+
307
+
+
313 void getLocalVelocities (double& v_x, double& v_y, double& v_z) const
+
314 { v_x = bulk.v_x; v_y = bulk.v_y; v_z = bulk.v_z; }
+
+
315
+
317 double getLocalGndSpeed_ms () const { return std::hypot(bulk.v_x, bulk.v_z); }
+
319 double getLocalGndSpeed_kn () const { return getLocalGndSpeed_ms() * 1.94384; }
+
320
+
321 // calculated (or transferred in newer versions)
+
328 void getLocalCoord (double& x, double& y, double& z) const;
+
329
+
330public:
+
333 static LTAPIAircraft* CreateNewObject() { return new LTAPIAircraft(); }
+
334};
+
335
+
336//
+
337// MapLTAPIAircraft
+
338//
+
339
+
350typedef std::map<std::string,SPtrLTAPIAircraft> MapLTAPIAircraft;
+
351
+
356typedef std::list<SPtrLTAPIAircraft> ListLTAPIAircraft;
+
357
+
+ +
362{
+
363public:
+ +
374
+
378 std::chrono::seconds sPeriodExpsv = std::chrono::seconds(3);
+
379
+
380protected:
+
382 const int iBulkAc = 50;
+
384 std::unique_ptr<LTAPIAircraft::LTAPIBulkData[]> vBulkNum;
+
386 std::unique_ptr<LTAPIAircraft::LTAPIBulkInfoTexts[]> vInfoTexts;
+
387
+
388protected:
+ +
391
+ +
394
+
396 std::chrono::time_point<std::chrono::steady_clock> lastExpsvFetch;
+
397
+
398public:
+ +
404 int numBulkAc = 50);
+
405 virtual ~LTAPIConnect();
+
406
+
408 static bool isLTAvail ();
+
409
+
421 static int getLTVerNr();
+
422
+
427 static int getLTVerDate();
428
- -
432
- +
434 static bool doesLTDisplayAc ();
435
-
436protected:
-
444 template <class T>
-
445 bool DoBulkFetch (int numAc, LTDataRef& DR, int& outSizeLT,
-
446 std::unique_ptr<T[]> &vBulk);
+
437 static int getLTNumAc ();
+
438
+
446 static bool doesLTControlAI ();
447
- -
450};
+
449 static time_t getLTSimTime ();
+
450
+
452 static std::chrono::system_clock::time_point getLTSimTimePoint ();
+
453
+
461 const MapLTAPIAircraft& UpdateAcList (ListLTAPIAircraft* plistRemovedAc = nullptr);
+
462
+
464 const MapLTAPIAircraft& getAcMap () const { return mapAc; }
+
465
+
469 SPtrLTAPIAircraft getAcByMultIdx (int multiIdx) const;
+
470
+ +
474
+ +
477
+
478protected:
+
486 template <class T>
+
487 bool DoBulkFetch (int numAc, LTDataRef& DR, int& outSizeLT,
+
488 std::unique_ptr<T[]> &vBulk);
+
489
+ +
492};
-
451
-
452
-
461
-
- -
463protected:
-
464 std::string sDataRef;
-
465 XPLMDataRef dataRef = NULL;
-
466 XPLMDataTypeID dataTypes = xplmType_Unknown;
-
467 bool bValid = true;
-
468public:
-
469 LTDataRef (std::string _sDataRef);
-
470 inline bool needsInit () const { return bValid && !dataRef; }
-
472 bool isValid ();
-
474 bool FindDataRef ();
-
475
-
476 // types
-
478 XPLMDataTypeID getDataRefTypes() const { return dataTypes; }
-
480 bool hasInt () const { return dataTypes & xplmType_Int; }
-
482 bool hasFloat () const { return dataTypes & xplmType_Float; }
-
484 static constexpr XPLMDataTypeID usefulTypes =
-
485 xplmType_Int | xplmType_Float | xplmType_Data;
-
486
-
489 int getInt();
-
492 float getFloat();
-
494 inline bool getBool() { return getInt() != 0; }
-
496 int getData(void* pOut, int inOffset, int inMaxBytes);
-
497
-
499 void set(int i);
-
501 void set(float f);
-
502
-
503protected:
-
504};
+
493
+
494
+
503
+
+ +
505protected:
+
506 std::string sDataRef;
+
507 XPLMDataRef dataRef = NULL;
+
508 XPLMDataTypeID dataTypes = xplmType_Unknown;
+
509 bool bValid = true;
+
510public:
+
511 LTDataRef (std::string _sDataRef);
+
512 inline bool needsInit () const { return bValid && !dataRef; }
+
514 bool isValid ();
+
516 bool FindDataRef ();
+
517
+
518 // types
+
520 XPLMDataTypeID getDataRefTypes() const { return dataTypes; }
+
522 bool hasInt () const { return dataTypes & xplmType_Int; }
+
524 bool hasFloat () const { return dataTypes & xplmType_Float; }
+
526 static constexpr XPLMDataTypeID usefulTypes =
+
527 xplmType_Int | xplmType_Float | xplmType_Data;
+
528
+
531 int getInt();
+
534 float getFloat();
+
536 inline bool getBool() { return getInt() != 0; }
+
538 int getData(void* pOut, int inOffset, int inMaxBytes);
+
539
+
541 void set(int i);
+
543 void set(float f);
+
544
+
545protected:
+
546};
-
505
-
506//
-
507// Sizes for version compatibility comparison
-
508//
-
509
-
511constexpr size_t LTAPIBulkData_v120 = 80;
- -
514
-
516constexpr size_t LTAPIBulkInfoTexts_v120 = 264;
-
517constexpr size_t LTAPIBulkInfoTexts_v122 = 288;
- -
520
-
521#endif /* LTAPI_h */
+
547
+
548//
+
549// Sizes for version compatibility comparison
+
550//
+
551
+
553constexpr size_t LTAPIBulkData_v120 = 80;
+
555#if IBM
+
556constexpr size_t LTAPIBulkData_v122 = 120;
+
557#else
+
558constexpr size_t LTAPIBulkData_v122 = 104;
+
559#endif
+
560
+ +
563#if IBM
+
564static_assert(LTAPIBulkData_v440 == 168, "LTAPIBulkData size is not 152 as expected");
+
565#else
+
566static_assert(LTAPIBulkData_v440 == 152, "LTAPIBulkData size is not 152 as expected");
+
567#endif
+
568
+
570constexpr size_t LTAPIBulkInfoTexts_v120 = 264;
+
571constexpr size_t LTAPIBulkInfoTexts_v122 = 288;
+ +
574static_assert(LTAPIBulkInfoTexts_v240 == 304, "LTAPIBulkInfoTexts size is not 304 as expected");
+
575
+
576#endif /* LTAPI_h */
@@ -494,101 +541,116 @@
-
std::map< std::string, SPtrLTAPIAircraft > MapLTAPIAircraft
Map of all aircrafts stored as smart pointers to LTAPIAircraft objects.
Definition LTAPI.h:308
-
constexpr size_t LTAPIBulkData_v122
Size of current bulk structure.
Definition LTAPI.h:513
-
std::list< SPtrLTAPIAircraft > ListLTAPIAircraft
Simple list of smart pointers to LTAPIAircraft objects.
Definition LTAPI.h:314
-
constexpr size_t LTAPIBulkInfoTexts_v120
Size of original bulk info structure as per previous versions of LiveTraffic.
Definition LTAPI.h:516
-
constexpr size_t LTAPIBulkData_v120
Size of original bulk structure as per LiveTraffic v1.20.
Definition LTAPI.h:511
-
std::shared_ptr< LTAPIAircraft > SPtrLTAPIAircraft
Smart pointer to an LTAPIAircraft object.
Definition LTAPI.h:47
-
constexpr size_t LTAPIBulkInfoTexts_v240
Size of current bulk info structure.
Definition LTAPI.h:519
-
constexpr size_t LTAPIBulkInfoTexts_v122
Definition LTAPI.h:517
-
Represents one aircraft as controlled by LiveTraffic.
Definition LTAPI.h:56
-
std::string getKey() const
Unique key for this aircraft, usually ICAO transponder hex code.
Definition LTAPI.h:230
-
float getPitch() const
[°] pitch: positive up
Definition LTAPI.h:259
-
float getFlaps() const
flap position: 0.0 retracted, 1.0 fully extended
Definition LTAPI.h:269
-
bool isOnGnd() const
Is plane on ground?
Definition LTAPI.h:264
-
LTFlightPhase getPhase() const
flight phase
Definition LTAPI.h:265
+
std::map< std::string, SPtrLTAPIAircraft > MapLTAPIAircraft
Map of all aircrafts stored as smart pointers to LTAPIAircraft objects.
Definition LTAPI.h:350
+
constexpr size_t LTAPIBulkData_v122
Size of bulk structure as per LiveTraffic v1.22.
Definition LTAPI.h:558
+
std::list< SPtrLTAPIAircraft > ListLTAPIAircraft
Simple list of smart pointers to LTAPIAircraft objects.
Definition LTAPI.h:356
+
constexpr size_t LTAPIBulkInfoTexts_v120
Size of original bulk info structure as per previous versions of LiveTraffic.
Definition LTAPI.h:570
+
constexpr size_t LTAPIBulkData_v120
Size of original bulk structure as per LiveTraffic v1.20.
Definition LTAPI.h:553
+
std::shared_ptr< LTAPIAircraft > SPtrLTAPIAircraft
Smart pointer to an LTAPIAircraft object.
Definition LTAPI.h:48
+
constexpr size_t LTAPIBulkData_v440
Size of current bulk structure.
Definition LTAPI.h:562
+
constexpr size_t LTAPIBulkInfoTexts_v240
Size of current bulk info structure.
Definition LTAPI.h:573
+
constexpr size_t LTAPIBulkInfoTexts_v122
Definition LTAPI.h:571
+
Represents one aircraft as controlled by LiveTraffic.
Definition LTAPI.h:57
+
std::string getKey() const
Unique key for this aircraft, usually ICAO transponder hex code.
Definition LTAPI.h:256
+
float getPitch() const
[°] pitch: positive up
Definition LTAPI.h:285
+
float getFlaps() const
flap position: 0.0 retracted, 1.0 fully extended
Definition LTAPI.h:295
+
bool isOnGnd() const
Is plane on ground?
Definition LTAPI.h:290
+
LTFlightPhase getPhase() const
flight phase
Definition LTAPI.h:291
std::string getPhaseStr() const
flight phase as string
-
std::string getDestination() const
destination airport (IATA or ICAO) like "FRA" or "EDDF"
Definition LTAPI.h:248
-
void resetUpdated()
Helper in update loop, resets bUpdated flag.
Definition LTAPI.h:217
-
std::string getOpIcao() const
ICAO-code of operator like "DLH".
Definition LTAPI.h:237
-
float getTrack() const
[°] track over ground
Definition LTAPI.h:257
-
LTAPIBulkInfoTexts info
textual plane's data
Definition LTAPI.h:192
-
void getLocalCoord(double &x, double &y, double &z) const
lat/lon/alt converted to local coordinates
Definition LTAPI.h:285
-
LTLights getLights() const
all plane's lights
Definition LTAPI.h:272
+
std::string getDestination() const
destination airport (IATA or ICAO) like "FRA" or "EDDF"
Definition LTAPI.h:274
+
double getLocalGndSpeed_kn() const
[kn] Approximate ground speed based on local coordinates
Definition LTAPI.h:319
+
void resetUpdated()
Helper in update loop, resets bUpdated flag.
Definition LTAPI.h:243
+
std::string getOpIcao() const
ICAO-code of operator like "DLH".
Definition LTAPI.h:263
+
const char * getTrspModeTxt() const
Transponder mode text, like "off", "Mode C", "Mode S TARA".
+
float getTrack() const
[°] track over ground
Definition LTAPI.h:283
+
LTAPIBulkInfoTexts info
textual plane's data
Definition LTAPI.h:218
+
void getLocalCoord(double &x, double &y, double &z) const
Local coordinates (coverted from lat/lon/alt in older versions)
+
LTLights getLights() const
all plane's lights
Definition LTAPI.h:298
void setCameraAc()
Declare the aircraft the one under the camera (e.g. if your plugin is a camera plugin and now views t...
-
std::string getOrigin() const
origin airport (IATA or ICAO) like "MAD" or "LEMD"
Definition LTAPI.h:247
-
std::string getMan() const
human-readable manufacturer like "Airbus"
Definition LTAPI.h:238
-
double getLon() const
[°] longitude
Definition LTAPI.h:254
-
float getTerrainFt() const
[ft] terrain altitude beneath plane
Definition LTAPI.h:262
-
bool isVisible() const
aircraft visible?
Definition LTAPI.h:267
-
std::string getTrackedBy() const
name of channel deliverying the underlying tracking data
Definition LTAPI.h:249
-
std::string getModel() const
human-readable a/c model like "A321-231"
Definition LTAPI.h:239
-
virtual void toggleCamera(bool bCameraActive, SPtrLTAPIAircraft spPrevAc)
Called when LiveTraffic toggles its aircraft camera, override in your class to handle event.
Definition LTAPI.h:222
-
std::string getFlightNumber() const
flight number like "LH1113"
Definition LTAPI.h:246
+
std::string getOrigin() const
origin airport (IATA or ICAO) like "MAD" or "LEMD"
Definition LTAPI.h:273
+
std::string getMan() const
human-readable manufacturer like "Airbus"
Definition LTAPI.h:264
+
double getLon() const
[°] longitude
Definition LTAPI.h:280
+
float getTerrainFt() const
[ft] terrain altitude beneath plane
Definition LTAPI.h:288
+
bool isVisible() const
aircraft visible?
Definition LTAPI.h:293
+
std::string getTrackedBy() const
name of channel deliverying the underlying tracking data
Definition LTAPI.h:275
+
std::string getModel() const
human-readable a/c model like "A321-231"
Definition LTAPI.h:265
+
virtual void toggleCamera(bool bCameraActive, SPtrLTAPIAircraft spPrevAc)
Called when LiveTraffic toggles its aircraft camera, override in your class to handle event.
Definition LTAPI.h:248
+
std::string getFlightNumber() const
flight number like "LH1113"
Definition LTAPI.h:272
virtual bool updateAircraft(const LTAPIBulkData &__bulk, size_t __inSize)
Updates the aircraft with fresh numerical values, called from LTAPIConnect::UpdateAcList()
-
std::string getSquawk() const
squawk code (as text) like "1000"
Definition LTAPI.h:245
-
float getReversers() const
reversers position: 0.0 closed, 1.0 fully opened
Definition LTAPI.h:271
-
LTFlightPhase
Flight phase, definition copied from LiveTraffic.
Definition LTAPI.h:67
-
@ FPH_TAXI
Taxiing.
Definition LTAPI.h:70
-
@ FPH_LIFT_OFF
Lift-off, until "gear-up" height.
Definition LTAPI.h:74
-
@ FPH_STOPPED_ON_RWY
Stopped on runway because ran out of tracking data, plane will disappear soon.
Definition LTAPI.h:85
-
@ FPH_DESCEND
Descend, more then 100ft/min descend.
Definition LTAPI.h:78
-
@ FPH_FLARE
Flare, when reaching "flare " height.
Definition LTAPI.h:82
-
@ FPH_TOUCH_DOWN
The one cycle when plane touches down, don't rely on catching it...it's really one cycle only.
Definition LTAPI.h:83
-
@ FPH_ROTATE
Rotating.
Definition LTAPI.h:73
-
@ FPH_FINAL
Final, below "gear-down" height.
Definition LTAPI.h:80
-
@ FPH_CRUISE
Cruising, no altitude change.
Definition LTAPI.h:77
-
@ FPH_UNKNOWN
used for initializations
Definition LTAPI.h:68
-
@ FPH_ROLL_OUT
Roll-out after touch-down until reaching taxi speed or stopping.
Definition LTAPI.h:84
-
@ FPH_APPROACH
Approach, below "flaps-down" height.
Definition LTAPI.h:79
-
@ FPH_INITIAL_CLIMB
Initial climb, until "flaps-up" height.
Definition LTAPI.h:75
-
@ FPH_TAKE_OFF
Group of status for take-off:
Definition LTAPI.h:71
-
@ FPH_CLIMB
Regular climbout.
Definition LTAPI.h:76
-
@ FPH_PARKED
Parked at startup position.
Definition LTAPI.h:69
-
@ FPH_TO_ROLL
Take-off roll.
Definition LTAPI.h:72
-
@ FPH_LANDING
Group of status for landing:
Definition LTAPI.h:81
-
float getHeightFt() const
[ft] height AGL
Definition LTAPI.h:263
-
std::string getModelIcao() const
ICAO aircraft type like "A321".
Definition LTAPI.h:234
-
float getGear() const
gear position: 0.0 retracted, 1.0 fully extended
Definition LTAPI.h:270
-
bool isUpdated() const
Helper in update loop to detected removed aircrafts.
Definition LTAPI.h:215
-
std::string getCslModel() const
name of CSL model used for actual rendering of plane
Definition LTAPI.h:242
-
std::string getCatDescr() const
human-readable category description
Definition LTAPI.h:240
+
std::string getSquawk() const
squawk code (as text) like "1000"
Definition LTAPI.h:271
+
float getReversers() const
reversers position: 0.0 closed, 1.0 fully opened
Definition LTAPI.h:297
+
LTFlightPhase
Flight phase, definition copied from LiveTraffic.
Definition LTAPI.h:68
+
@ FPH_TAXI
Taxiing.
Definition LTAPI.h:71
+
@ FPH_LIFT_OFF
Lift-off, until "gear-up" height.
Definition LTAPI.h:75
+
@ FPH_STOPPED_ON_RWY
Stopped on runway because ran out of tracking data, plane will disappear soon.
Definition LTAPI.h:86
+
@ FPH_DESCEND
Descend, more then 100ft/min descend.
Definition LTAPI.h:79
+
@ FPH_FLARE
Flare, when reaching "flare " height.
Definition LTAPI.h:83
+
@ FPH_TOUCH_DOWN
The one cycle when plane touches down, don't rely on catching it...it's really one cycle only.
Definition LTAPI.h:84
+
@ FPH_ROTATE
Rotating.
Definition LTAPI.h:74
+
@ FPH_FINAL
Final, below "gear-down" height.
Definition LTAPI.h:81
+
@ FPH_CRUISE
Cruising, no altitude change.
Definition LTAPI.h:78
+
@ FPH_UNKNOWN
used for initializations
Definition LTAPI.h:69
+
@ FPH_ROLL_OUT
Roll-out after touch-down until reaching taxi speed or stopping.
Definition LTAPI.h:85
+
@ FPH_APPROACH
Approach, below "flaps-down" height.
Definition LTAPI.h:80
+
@ FPH_INITIAL_CLIMB
Initial climb, until "flaps-up" height.
Definition LTAPI.h:76
+
@ FPH_TAKE_OFF
Group of status for take-off:
Definition LTAPI.h:72
+
@ FPH_CLIMB
Regular climbout.
Definition LTAPI.h:77
+
@ FPH_PARKED
Parked at startup position.
Definition LTAPI.h:70
+
@ FPH_TO_ROLL
Take-off roll.
Definition LTAPI.h:73
+
@ FPH_LANDING
Group of status for landing:
Definition LTAPI.h:82
+
float getHeightFt() const
[ft] height AGL
Definition LTAPI.h:289
+
std::string getModelIcao() const
ICAO aircraft type like "A321".
Definition LTAPI.h:260
+
float getGear() const
gear position: 0.0 retracted, 1.0 fully extended
Definition LTAPI.h:296
+
bool isUpdated() const
Helper in update loop to detected removed aircrafts.
Definition LTAPI.h:241
+
std::string getCslModel() const
name of CSL model used for actual rendering of plane
Definition LTAPI.h:268
+
std::string getCatDescr() const
human-readable category description
Definition LTAPI.h:266
virtual ~LTAPIAircraft()
-
int getMultiIdx() const
multiplayer index if plane reported via sim/multiplayer/position dataRefs, 0 if not
Definition LTAPI.h:277
-
std::string getAcClass() const
a/c class like "L2J"
Definition LTAPI.h:235
+
double getLocalGndSpeed_ms() const
[m/s] Approximate ground speed based on local coordinates
Definition LTAPI.h:317
+
int getMultiIdx() const
multiplayer index if plane reported via sim/multiplayer/position dataRefs, 0 if not
Definition LTAPI.h:303
+
std::string getAcClass() const
a/c class like "L2J"
Definition LTAPI.h:261
std::string getDescription() const
some reasonable descriptive string formed from the above, like an identifier, type,...
virtual bool updateAircraft(const LTAPIBulkInfoTexts &__info, size_t __inSize)
Updates the aircraft with fresh textual information, called from LTAPIConnect::UpdateAcList()
-
LTAPIBulkData bulk
numerical plane's data
Definition LTAPI.h:191
-
double getLat() const
[°] latitude
Definition LTAPI.h:253
-
bool bUpdated
update helper, gets reset before updates, set during updates, stays false if not updated
Definition LTAPI.h:195
+
LTAPIBulkData bulk
numerical plane's data
Definition LTAPI.h:217
+
double getLat() const
[°] latitude
Definition LTAPI.h:279
+
XPMPTransponderMode getTrspMode() const
< Transponder mode, like off, Mode_C, Mode_S_TARA
Definition LTAPI.h:304
+
bool bUpdated
update helper, gets reset before updates, set during updates, stays false if not updated
Definition LTAPI.h:221
-
static LTAPIAircraft * CreateNewObject()
Standard object creation callback.
Definition LTAPI.h:291
-
std::string getCallSign() const
call sign like "DLH56C"
Definition LTAPI.h:244
-
std::string getRegistration() const
tail number like "D-AISD"
Definition LTAPI.h:232
-
float getVSIft() const
[ft/minute] vertical speed, positive up
Definition LTAPI.h:261
-
float getBearing() const
[°] to current camera position
Definition LTAPI.h:275
-
float getDistNm() const
[nm] distance to current camera
Definition LTAPI.h:276
-
float getRoll() const
[°] roll: positive right
Definition LTAPI.h:258
-
std::string getWtc() const
wake turbulence category like H,M,L/M,L
Definition LTAPI.h:236
-
double getAltFt() const
[ft] altitude
Definition LTAPI.h:255
-
bool isOnCamera() const
is currently seen on LiveTraffic's internal camera view?
Definition LTAPI.h:273
-
float getSpeedKn() const
[kt] ground speed
Definition LTAPI.h:260
-
std::string getOp() const
human-readable operator like "Lufthansa"
Definition LTAPI.h:241
-
float getHeading() const
[°] heading
Definition LTAPI.h:256
-
Connects to LiveTraffic's dataRefs and returns aircraft information.
Definition LTAPI.h:320
-
fCreateAcObject * pfCreateAcObject
Pointer to callback function returning new aircraft objects.
Definition LTAPI.h:348
-
const MapLTAPIAircraft & getAcMap() const
Returns the map of aircraft as it currently stands.
Definition LTAPI.h:422
+
static LTAPIAircraft * CreateNewObject()
Standard object creation callback.
Definition LTAPI.h:333
+
std::string getCallSign() const
call sign like "DLH56C"
Definition LTAPI.h:270
+
XPMPTransponderMode
These enumerations define the way the transponder of a given plane is operating.
Definition LTAPI.h:92
+
@ xpmpTransponderMode_ModeC
transponder is on, Mode C (Alt)
Definition LTAPI.h:96
+
@ xpmpTransponderMode_ModeS_Gnd
transponder is on, Mode S (Gnd)
Definition LTAPI.h:98
+
@ xpmpTransponderMode_ModeA
transponder is on, Mode A
Definition LTAPI.h:95
+
@ xpmpTransponderMode_Standby
transponder is in standby, not currently sending -> aircraft not visible on TCAS
Definition LTAPI.h:94
+
@ xpmpTransponderMode_ModeS_TARA
transponder is on, Mode S (TA/RA)
Definition LTAPI.h:100
+
@ xpmpTransponderMode_ModeS_TAOnly
transponder is on, Mode S (TA-Only)
Definition LTAPI.h:99
+
@ xpmpTransponderMode_Test
transponder is on, Test
Definition LTAPI.h:97
+
@ xpmpTransponderMode_Off
transponder is off not currently sending -> aircraft not visible on TCAS
Definition LTAPI.h:93
+
std::string getRegistration() const
tail number like "D-AISD"
Definition LTAPI.h:258
+
float getVSIft() const
[ft/minute] vertical speed, positive up
Definition LTAPI.h:287
+
void getLocalVelocities(double &v_x, double &v_y, double &v_z) const
lat/lon/alt converted to local coordinates
Definition LTAPI.h:313
+
float getBearing() const
[°] to current camera position
Definition LTAPI.h:301
+
float getDistNm() const
[nm] distance to current camera
Definition LTAPI.h:302
+
float getRoll() const
[°] roll: positive right
Definition LTAPI.h:284
+
std::string getWtc() const
wake turbulence category like H,M,L/M,L
Definition LTAPI.h:262
+
double getAltFt() const
[ft] altitude
Definition LTAPI.h:281
+
bool isOnCamera() const
is currently seen on LiveTraffic's internal camera view?
Definition LTAPI.h:299
+
float getSpeedKn() const
[kt] ground speed
Definition LTAPI.h:286
+
std::string getOp() const
human-readable operator like "Lufthansa"
Definition LTAPI.h:267
+
float getHeading() const
[°] heading
Definition LTAPI.h:282
+
Connects to LiveTraffic's dataRefs and returns aircraft information.
Definition LTAPI.h:362
+
fCreateAcObject * pfCreateAcObject
Pointer to callback function returning new aircraft objects.
Definition LTAPI.h:390
+
const MapLTAPIAircraft & getAcMap() const
Returns the map of aircraft as it currently stands.
Definition LTAPI.h:464
static int getLTNumAc()
How many aircraft does LiveTraffic display right now?
bool DoBulkFetch(int numAc, LTDataRef &DR, int &outSizeLT, std::unique_ptr< T[]> &vBulk)
fetch bulk data and create/update aircraft objects
-
std::unique_ptr< LTAPIAircraft::LTAPIBulkInfoTexts[]> vInfoTexts
bulk info text array for communication with LT
Definition LTAPI.h:344
-
std::chrono::seconds sPeriodExpsv
Definition LTAPI.h:336
-
MapLTAPIAircraft mapAc
THE map of aircrafts.
Definition LTAPI.h:351
+
std::unique_ptr< LTAPIAircraft::LTAPIBulkInfoTexts[]> vInfoTexts
bulk info text array for communication with LT
Definition LTAPI.h:386
+
std::chrono::seconds sPeriodExpsv
Definition LTAPI.h:378
+
MapLTAPIAircraft mapAc
THE map of aircrafts.
Definition LTAPI.h:393
static int getLTVerDate()
LiveTraffic's version date.
SPtrLTAPIAircraft getAcInCameraView() const
Returns the aircraft being viewed in LiveTraffic's camera view, if any.
static void CameraSharedDataCB(LTAPIConnect *me)
shared DataRef event notification
-
std::unique_ptr< LTAPIAircraft::LTAPIBulkData[]> vBulkNum
bulk data array for communication with LT
Definition LTAPI.h:342
-
LTAPIAircraft * fCreateAcObject()
Callback function type passed in to LTAPIConnect()
Definition LTAPI.h:331
+
std::unique_ptr< LTAPIAircraft::LTAPIBulkData[]> vBulkNum
bulk data array for communication with LT
Definition LTAPI.h:384
+
LTAPIAircraft * fCreateAcObject()
Callback function type passed in to LTAPIConnect()
Definition LTAPI.h:373
static bool doesLTControlAI()
Does LiveTaffic control AI planes?
static bool doesLTDisplayAc()
Does LiveTraffic display aircrafts? (Is it activated?)
virtual ~LTAPIConnect()
@@ -597,92 +659,99 @@
static time_t getLTSimTime()
What is current simulated time in LiveTraffic (usually 'now' minus buffering period)?
static bool isLTAvail()
Is LiveTraffic available? (checks via XPLMFindPluginBySignature)
LTAPIConnect(fCreateAcObject *_pfCreateAcObject=LTAPIAircraft::CreateNewObject, int numBulkAc=50)
Constructor.
-
const int iBulkAc
Number of aircraft to fetch in one bulk operation.
Definition LTAPI.h:340
+
const int iBulkAc
Number of aircraft to fetch in one bulk operation.
Definition LTAPI.h:382
SPtrLTAPIAircraft getAcByMultIdx(int multiIdx) const
Finds an aircraft for a given multiplayer slot.
void clearCameraInfo()
Clear camera information, ie. delcare that no aircraft is currently being viewed.
-
std::chrono::time_point< std::chrono::steady_clock > lastExpsvFetch
Last fetching of expensive data.
Definition LTAPI.h:354
+
std::chrono::time_point< std::chrono::steady_clock > lastExpsvFetch
Last fetching of expensive data.
Definition LTAPI.h:396
const MapLTAPIAircraft & UpdateAcList(ListLTAPIAircraft *plistRemovedAc=nullptr)
Main function: updates map of aircrafts and returns reference to it.
-
Represents a dataRef and covers late binding.
Definition LTAPI.h:462
-
XPLMDataTypeID dataTypes
supported data types
Definition LTAPI.h:466
+
Represents a dataRef and covers late binding.
Definition LTAPI.h:504
+
XPLMDataTypeID dataTypes
supported data types
Definition LTAPI.h:508
int getData(void *pOut, int inOffset, int inMaxBytes)
Gets dataRef's binary data.
-
bool hasFloat() const
Is float a supported dataRef type?
Definition LTAPI.h:482
-
static constexpr XPLMDataTypeID usefulTypes
Defines which types to work with to become valid
Definition LTAPI.h:484
+
bool hasFloat() const
Is float a supported dataRef type?
Definition LTAPI.h:524
+
static constexpr XPLMDataTypeID usefulTypes
Defines which types to work with to become valid
Definition LTAPI.h:526
void set(float f)
Writes a float vlue to the dataRef.
LTDataRef(std::string _sDataRef)
Constructor, set the dataRef's name.
-
bool hasInt() const
Is int a supported dataRef type?
Definition LTAPI.h:480
+
bool hasInt() const
Is int a supported dataRef type?
Definition LTAPI.h:522
bool FindDataRef()
Finds the dataRef (and would try again and again, no matter what bValid says)
-
XPLMDataRef dataRef
dataRef identifier returned by X-Plane
Definition LTAPI.h:465
-
bool bValid
does this object have a valid binding to a dataRef already?
Definition LTAPI.h:467
-
XPLMDataTypeID getDataRefTypes() const
Get types supported by the dataRef.
Definition LTAPI.h:478
+
XPLMDataRef dataRef
dataRef identifier returned by X-Plane
Definition LTAPI.h:507
+
bool bValid
does this object have a valid binding to a dataRef already?
Definition LTAPI.h:509
+
XPLMDataTypeID getDataRefTypes() const
Get types supported by the dataRef.
Definition LTAPI.h:520
void set(int i)
Writes an integer value to the dataRef.
-
bool needsInit() const
Definition LTAPI.h:470
+
bool needsInit() const
Definition LTAPI.h:512
int getInt()
Get dataRef's integer value. Silently returns 0 if dataRef doesn't exist.
-
std::string sDataRef
dataRef name, passed in via constructor
Definition LTAPI.h:464
+
std::string sDataRef
dataRef name, passed in via constructor
Definition LTAPI.h:506
bool isValid()
Found the dataRef and it contains formats we can work with?
-
bool getBool()
Gets dataRef's integer value and returns if it is not zero.
Definition LTAPI.h:494
+
bool getBool()
Gets dataRef's integer value and returns if it is not zero.
Definition LTAPI.h:536
float getFloat()
Get dataRef's float value. Silently returns 0.0f if dataRef doesn't exist.
-
Bulk data transfer structur for communication with LTAPI.
Definition LTAPI.h:92
-
LTFlightPhase phase
flight phase, see LTAircraft::FlightPhase
Definition LTAPI.h:117
-
unsigned hidden
aircraft not visible? (remains an 'unsigned' for backward compatibility)
Definition LTAPI.h:125
-
float alt_ft_f
deprecated: [ft] altitude
Definition LTAPI.h:99
-
float track
[°] track over ground
Definition LTAPI.h:101
-
float gear
gear position: 0.0 retracted, 1.0 fully extended
Definition LTAPI.h:110
-
float terrainAlt_ft
[ft] terrain altitude beneath plane
Definition LTAPI.h:106
-
float pitch
[°] pitch: positive up
Definition LTAPI.h:103
-
float lat_f
deprecated: [°] latitude
Definition LTAPI.h:97
-
double lat
[°] latitude
Definition LTAPI.h:135
-
float reversers
reversers position: 0.0 closed, 1.0 fully opened
Definition LTAPI.h:111
-
unsigned filler2
Definition LTAPI.h:130
-
float height_ft
[ft] height AGL
Definition LTAPI.h:107
-
uint64_t keyNum
a/c id, usually transp hex code, or any other unique id (FLARM etc.)
Definition LTAPI.h:95
-
float speed_kt
[kt] ground speed
Definition LTAPI.h:104
-
float flaps
flap position: 0.0 retracted, 1.0 fully extended
Definition LTAPI.h:109
-
LTAPIBulkData()
Constructor initializes some data without defaults.
Definition LTAPI.h:141
-
float heading
[°] heading
Definition LTAPI.h:100
-
bool camera
is LiveTraffic's camera on this aircraft?
Definition LTAPI.h:126
-
bool strb
strobe light
Definition LTAPI.h:123
-
float vsi_ft
[ft/minute] vertical speed, positive up
Definition LTAPI.h:105
-
double alt_ft
[ft] altitude
Definition LTAPI.h:137
-
float lon_f
deprecated: [°] longitude
Definition LTAPI.h:98
-
bool taxi
taxi lights
Definition LTAPI.h:120
+
Bulk data transfer structur for communication with LTAPI.
Definition LTAPI.h:107
+
LTFlightPhase phase
flight phase, see LTAircraft::FlightPhase
Definition LTAPI.h:132
+
unsigned hidden
aircraft not visible? (remains an 'unsigned' for backward compatibility)
Definition LTAPI.h:140
+
float alt_ft_f
deprecated: [ft] altitude
Definition LTAPI.h:114
+
float track
[°] track over ground
Definition LTAPI.h:116
+
float gear
gear position: 0.0 retracted, 1.0 fully extended
Definition LTAPI.h:125
+
float terrainAlt_ft
[ft] terrain altitude beneath plane
Definition LTAPI.h:121
+
float pitch
[°] pitch: positive up
Definition LTAPI.h:118
+
float lat_f
deprecated: [°] latitude
Definition LTAPI.h:112
+
double lat
[°] latitude
Definition LTAPI.h:152
+
double v_z
[m/s] Cartesian velocity in Z direction
Definition LTAPI.h:164
+
double x
local Cartesian X coordinate (NAN indicates to delivered by master, e.g. because older version)
Definition LTAPI.h:158
+
float reversers
reversers position: 0.0 closed, 1.0 fully opened
Definition LTAPI.h:126
+
unsigned filler2
Definition LTAPI.h:147
+
float height_ft
[ft] height AGL
Definition LTAPI.h:122
+
double z
local Cartesian Z coordinate
Definition LTAPI.h:160
+
uint64_t keyNum
a/c id, usually transp hex code, or any other unique id (FLARM etc.)
Definition LTAPI.h:110
+
float speed_kt
[kt] ground speed
Definition LTAPI.h:119
+
float flaps
flap position: 0.0 retracted, 1.0 fully extended
Definition LTAPI.h:124
+
LTAPIBulkData()
Constructor initializes some data without defaults.
Definition LTAPI.h:167
+
float heading
[°] heading
Definition LTAPI.h:115
+
bool camera
is LiveTraffic's camera on this aircraft?
Definition LTAPI.h:141
+
double v_x
[m/s] Cartesian velocity in X direction
Definition LTAPI.h:162
+
bool strb
strobe light
Definition LTAPI.h:138
+
unsigned trspMode
Transponder mode, see enum XPMPTransponderMode (filled only as of LT 4.4.0)
Definition LTAPI.h:145
+
float vsi_ft
[ft/minute] vertical speed, positive up
Definition LTAPI.h:120
+
double alt_ft
[ft] altitude
Definition LTAPI.h:154
+
float lon_f
deprecated: [°] longitude
Definition LTAPI.h:113
+
bool taxi
taxi lights
Definition LTAPI.h:135
struct LTAPIAircraft::LTAPIBulkData::BulkBitsTy bits
Flights phase, on-ground status, lights.
-
bool land
landing lights
Definition LTAPI.h:121
-
bool nav
navigaton lights
Definition LTAPI.h:124
-
int multiIdx
multiplayer index if plane reported via sim/multiplayer/position dataRefs, 0 if not
Definition LTAPI.h:128
-
float bearing
[°] to current camera position
Definition LTAPI.h:113
-
float dist_nm
[nm] distance to current camera
Definition LTAPI.h:114
-
unsigned filler3
Definition LTAPI.h:131
-
float roll
[°] roll: positive right
Definition LTAPI.h:102
-
bool bcn
beacon light
Definition LTAPI.h:122
-
bool onGnd
Is plane on ground?
Definition LTAPI.h:118
-
double lon
[°] longitude
Definition LTAPI.h:136
- -
Bulk text transfer structur for communication with LTAPI.
Definition LTAPI.h:147
-
char wtc[4]
wake turbulence category like H,M,L/M,L
Definition LTAPI.h:155
-
char catDescr[40]
human-readable category description
Definition LTAPI.h:159
-
char callSign[8]
call sign like "DLH56C"
Definition LTAPI.h:162
-
char squawk[8]
squawk code (as text) like "1000"
Definition LTAPI.h:163
-
LTAPIBulkInfoTexts()
Constructor initializes all data with zeroes.
Definition LTAPI.h:173
-
uint64_t keyNum
a/c id, usually transp hex code, or any other unique id (FLARM etc.)
Definition LTAPI.h:150
-
char opIcao[8]
ICAO-code of operator like "DLH".
Definition LTAPI.h:156
-
char op[40]
human-readable operator like "Lufthansa"
Definition LTAPI.h:160
-
char modelIcao[8]
ICAO aircraft type like "A321".
Definition LTAPI.h:153
-
char flightNumber[8]
flight number like "LH1113"
Definition LTAPI.h:164
-
char origin[8]
origin airport (IATA or ICAO) like "MAD" or "LEMD"
Definition LTAPI.h:165
-
char registration[8]
tail number like "D-AISD"
Definition LTAPI.h:151
-
char cslModel[40]
name of CSL model used for actual rendering of plane
Definition LTAPI.h:170
-
char man[40]
human-readable manufacturer like "Airbus"
Definition LTAPI.h:157
-
char trackedBy[24]
name of channel deliverying the underlying tracking data
Definition LTAPI.h:167
-
char destination[8]
destination airport (IATA or ICAO) like "FRA" or "EDDF"
Definition LTAPI.h:166
-
char acClass[4]
a/c class like "L2J"
Definition LTAPI.h:154
-
char model[40]
human-readable a/c model like "A321-231"
Definition LTAPI.h:158
-
Structure to return plane's lights status.
Definition LTAPI.h:178
-
bool nav
navigaton lights
Definition LTAPI.h:181
-
LTLights(const LTAPIBulkData::BulkBitsTy b)
Type conversion constructor.
Definition LTAPI.h:186
-
bool strobe
strobe light
Definition LTAPI.h:180
-
bool beacon
beacon light
Definition LTAPI.h:179
-
bool landing
landing lights
Definition LTAPI.h:182
-
bool taxi
taxi lights
Definition LTAPI.h:183
+
bool land
landing lights
Definition LTAPI.h:136
+
bool nav
navigaton lights
Definition LTAPI.h:139
+
int multiIdx
multiplayer index if plane reported via sim/multiplayer/position dataRefs, 0 if not
Definition LTAPI.h:143
+
double v_y
[m/s] Cartesian velocity in Y direction
Definition LTAPI.h:163
+
float bearing
[°] to current camera position
Definition LTAPI.h:128
+
float dist_nm
[nm] distance to current camera
Definition LTAPI.h:129
+
unsigned filler3
Definition LTAPI.h:148
+
float roll
[°] roll: positive right
Definition LTAPI.h:117
+
bool bcn
beacon light
Definition LTAPI.h:137
+
bool onGnd
Is plane on ground?
Definition LTAPI.h:133
+
double y
local Cartesian Y coordinate
Definition LTAPI.h:159
+
double lon
[°] longitude
Definition LTAPI.h:153
+ +
Bulk text transfer structur for communication with LTAPI.
Definition LTAPI.h:173
+
char wtc[4]
wake turbulence category like H,M,L/M,L
Definition LTAPI.h:181
+
char catDescr[40]
human-readable category description
Definition LTAPI.h:185
+
char callSign[8]
call sign like "DLH56C"
Definition LTAPI.h:188
+
char squawk[8]
squawk code (as text) like "1000"
Definition LTAPI.h:189
+
LTAPIBulkInfoTexts()
Constructor initializes all data with zeroes.
Definition LTAPI.h:199
+
uint64_t keyNum
a/c id, usually transp hex code, or any other unique id (FLARM etc.)
Definition LTAPI.h:176
+
char opIcao[8]
ICAO-code of operator like "DLH".
Definition LTAPI.h:182
+
char op[40]
human-readable operator like "Lufthansa"
Definition LTAPI.h:186
+
char modelIcao[8]
ICAO aircraft type like "A321".
Definition LTAPI.h:179
+
char flightNumber[8]
flight number like "LH1113"
Definition LTAPI.h:190
+
char origin[8]
origin airport (IATA or ICAO) like "MAD" or "LEMD"
Definition LTAPI.h:191
+
char registration[8]
tail number like "D-AISD"
Definition LTAPI.h:177
+
char cslModel[40]
name of CSL model used for actual rendering of plane
Definition LTAPI.h:196
+
char man[40]
human-readable manufacturer like "Airbus"
Definition LTAPI.h:183
+
char trackedBy[24]
name of channel deliverying the underlying tracking data
Definition LTAPI.h:193
+
char destination[8]
destination airport (IATA or ICAO) like "FRA" or "EDDF"
Definition LTAPI.h:192
+
char acClass[4]
a/c class like "L2J"
Definition LTAPI.h:180
+
char model[40]
human-readable a/c model like "A321-231"
Definition LTAPI.h:184
+
Structure to return plane's lights status.
Definition LTAPI.h:204
+
bool nav
navigaton lights
Definition LTAPI.h:207
+
LTLights(const LTAPIBulkData::BulkBitsTy b)
Type conversion constructor.
Definition LTAPI.h:212
+
bool strobe
strobe light
Definition LTAPI.h:206
+
bool beacon
beacon light
Definition LTAPI.h:205
+
bool landing
landing lights
Definition LTAPI.h:208
+
bool taxi
taxi lights
Definition LTAPI.h:209
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
size_t LTAPIBulkData_v440 = sizeof(LTAPIAircraft::LTAPIBulkData)
getKey() constLTAPIAircraftinline
getLat() constLTAPIAircraftinline
getLights() constLTAPIAircraftinline
getLocalCoord(double &x, double &y, double &z) constLTAPIAircraftinline
getLon() constLTAPIAircraftinline
getMan() constLTAPIAircraftinline
getModel() constLTAPIAircraftinline
getModelIcao() constLTAPIAircraftinline
getMultiIdx() constLTAPIAircraftinline
getOp() constLTAPIAircraftinline
getOpIcao() constLTAPIAircraftinline
getOrigin() constLTAPIAircraftinline
getPhase() constLTAPIAircraftinline
getPhaseStr() constLTAPIAircraft
getPitch() constLTAPIAircraftinline
getRegistration() constLTAPIAircraftinline
getReversers() constLTAPIAircraftinline
getRoll() constLTAPIAircraftinline
getSpeedKn() constLTAPIAircraftinline
getSquawk() constLTAPIAircraftinline
getTerrainFt() constLTAPIAircraftinline
getTrack() constLTAPIAircraftinline
getTrackedBy() constLTAPIAircraftinline
getVSIft() constLTAPIAircraftinline
getWtc() constLTAPIAircraftinline
infoLTAPIAircraftprotected
isOnCamera() constLTAPIAircraftinline
isOnGnd() constLTAPIAircraftinline
isUpdated() constLTAPIAircraftinline
isVisible() constLTAPIAircraftinline
LTAPIAircraft()LTAPIAircraft
LTFlightPhase enum nameLTAPIAircraft
resetUpdated()LTAPIAircraftinline
setCameraAc()LTAPIAircraft
toggleCamera(bool bCameraActive, SPtrLTAPIAircraft spPrevAc)LTAPIAircraftinlinevirtual
updateAircraft(const LTAPIBulkData &__bulk, size_t __inSize)LTAPIAircraftvirtual
updateAircraft(const LTAPIBulkInfoTexts &__info, size_t __inSize)LTAPIAircraftvirtual
getLocalCoord(double &x, double &y, double &z) constLTAPIAircraft
getLocalGndSpeed_kn() constLTAPIAircraftinline
getLocalGndSpeed_ms() constLTAPIAircraftinline
getLocalVelocities(double &v_x, double &v_y, double &v_z) constLTAPIAircraftinline
getLon() constLTAPIAircraftinline
getMan() constLTAPIAircraftinline
getModel() constLTAPIAircraftinline
getModelIcao() constLTAPIAircraftinline
getMultiIdx() constLTAPIAircraftinline
getOp() constLTAPIAircraftinline
getOpIcao() constLTAPIAircraftinline
getOrigin() constLTAPIAircraftinline
getPhase() constLTAPIAircraftinline
getPhaseStr() constLTAPIAircraft
getPitch() constLTAPIAircraftinline
getRegistration() constLTAPIAircraftinline
getReversers() constLTAPIAircraftinline
getRoll() constLTAPIAircraftinline
getSpeedKn() constLTAPIAircraftinline
getSquawk() constLTAPIAircraftinline
getTerrainFt() constLTAPIAircraftinline
getTrack() constLTAPIAircraftinline
getTrackedBy() constLTAPIAircraftinline
getTrspMode() constLTAPIAircraftinline
getTrspModeTxt() constLTAPIAircraft
getVSIft() constLTAPIAircraftinline
getWtc() constLTAPIAircraftinline
infoLTAPIAircraftprotected
isOnCamera() constLTAPIAircraftinline
isOnGnd() constLTAPIAircraftinline
isUpdated() constLTAPIAircraftinline
isVisible() constLTAPIAircraftinline
LTAPIAircraft()LTAPIAircraft
LTFlightPhase enum nameLTAPIAircraft
resetUpdated()LTAPIAircraftinline
setCameraAc()LTAPIAircraft
toggleCamera(bool bCameraActive, SPtrLTAPIAircraft spPrevAc)LTAPIAircraftinlinevirtual
updateAircraft(const LTAPIBulkData &__bulk, size_t __inSize)LTAPIAircraftvirtual
updateAircraft(const LTAPIBulkInfoTexts &__info, size_t __inSize)LTAPIAircraftvirtual
XPMPTransponderMode enum nameLTAPIAircraft
xpmpTransponderMode_ModeA enum valueLTAPIAircraft
xpmpTransponderMode_ModeC enum valueLTAPIAircraft
xpmpTransponderMode_ModeS_Gnd enum valueLTAPIAircraft
xpmpTransponderMode_ModeS_TAOnly enum valueLTAPIAircraft
xpmpTransponderMode_ModeS_TARA enum valueLTAPIAircraft
xpmpTransponderMode_Off enum valueLTAPIAircraft
xpmpTransponderMode_Standby enum valueLTAPIAircraft
xpmpTransponderMode_Test enum valueLTAPIAircraft
~LTAPIAircraft()LTAPIAircraftvirtual
diff --git a/docs/html/classLTAPIAircraft.html b/docs/html/classLTAPIAircraft.html index 32feac8..e1533f2 100644 --- a/docs/html/classLTAPIAircraft.html +++ b/docs/html/classLTAPIAircraft.html @@ -111,6 +111,20 @@ }  Flight phase, definition copied from LiveTraffic. More...
  +enum  XPMPTransponderMode {
+  xpmpTransponderMode_Off = 0 +, xpmpTransponderMode_Standby +, xpmpTransponderMode_ModeA +, xpmpTransponderMode_ModeC +,
+  xpmpTransponderMode_Test +, xpmpTransponderMode_ModeS_Gnd +, xpmpTransponderMode_ModeS_TAOnly +, xpmpTransponderMode_ModeS_TARA +
+ } + These enumerations define the way the transponder of a given plane is operating. More...
+  @@ -259,8 +273,23 @@ + + + + + + + + + + + + + + + - +

Public Member Functions

int getMultiIdx () const
 multiplayer index if plane reported via sim/multiplayer/position dataRefs, 0 if not
 
XPMPTransponderMode getTrspMode () const
 < Transponder mode, like off, Mode_C, Mode_S_TARA
 
const char * getTrspModeTxt () const
 Transponder mode text, like "off", "Mode C", "Mode S TARA".
 
void getLocalVelocities (double &v_x, double &v_y, double &v_z) const
 lat/lon/alt converted to local coordinates
 
double getLocalGndSpeed_ms () const
 [m/s] Approximate ground speed based on local coordinates
 
double getLocalGndSpeed_kn () const
 [kn] Approximate ground speed based on local coordinates
 
void getLocalCoord (double &x, double &y, double &z) const
 lat/lon/alt converted to local coordinates
 Local coordinates (coverted from lat/lon/alt in older versions)
 
+ + + + + + + + + + + + + + + + + +

@@ -337,6 +366,41 @@

+

◆ XPMPTransponderMode

+ +
+
+ +

These enumerations define the way the transponder of a given plane is operating.

+
Note
as defined by dataRef sim/cockpit2/tcas/targets/ssr_mode: "Transponder mode: off=0, stdby=1, on (mode A)=2, alt (mode C)=3, test=4, GND (mode S)=5, ta_only (mode S)=6, ta/ra=7"
+ + + + + + + + + +
Enumerator
xpmpTransponderMode_Off 

transponder is off not currently sending -> aircraft not visible on TCAS

+
xpmpTransponderMode_Standby 

transponder is in standby, not currently sending -> aircraft not visible on TCAS

+
xpmpTransponderMode_ModeA 

transponder is on, Mode A

+
xpmpTransponderMode_ModeC 

transponder is on, Mode C (Alt)

+
xpmpTransponderMode_Test 

transponder is on, Test

+
xpmpTransponderMode_ModeS_Gnd 

transponder is on, Mode S (Gnd)

+
xpmpTransponderMode_ModeS_TAOnly 

transponder is on, Mode S (TA-Only)

+
xpmpTransponderMode_ModeS_TARA 

transponder is on, Mode S (TA/RA)

+
+

Constructor & Destructor Documentation

@@ -867,9 +931,6 @@

- - - - + + + + + + +
@@ -887,6 +948,102 @@

double &

void LTAPIAircraft::getLocalCoord z ) const
+ + + +

◆ getLocalGndSpeed_kn()

+ +
+
+ + + + + +
+ + + + + + + +
double LTAPIAircraft::getLocalGndSpeed_kn () const
+
+inline
+
+ +

[kn] Approximate ground speed based on local coordinates

+ +
+
+ +

◆ getLocalGndSpeed_ms()

+ +
+
+ + + + + +
+ + + + + + + +
double LTAPIAircraft::getLocalGndSpeed_ms () const
+
+inline
+
+ +

[m/s] Approximate ground speed based on local coordinates

+ +
+
+ +

◆ getLocalVelocities()

+ +
+
+ + + @@ -895,12 +1052,12 @@

lat/lon/alt converted to local coordinates

-
See also
https://developer.x-plane.com/sdk/XPLMGraphics/#XPLMWorldToLocal
+
See also
https://developer.x-plane.com/article/screencoordinates/#3-D_Coordinate_System
Parameters

+ + + + + + + + + + + + + + + + +
void LTAPIAircraft::getLocalVelocities (double & v_x,
double & v_y,
double & v_z ) const
inline
- - - + + +
[out]xLocal x coordinate
[out]yLocal y coordinate
[out]zLocal z coordinate
[out]v_x[m/s] Local cartesian velocity on the x axis of the local coordinate system (roughly "east")
[out]v_y[m/s] Local cartesian velocity on the y axis of the local coordinate system (roughly "up")
[out]v_z[m/s] Local cartesian velocity on the z axis of the local coordinate system (roughly "south")
@@ -1410,6 +1567,52 @@

+

◆ getTrspMode()

+ +
+
+ + + + + +
+ + + + + + + +
XPMPTransponderMode LTAPIAircraft::getTrspMode () const
+
+inline
+
+ +

< Transponder mode, like off, Mode_C, Mode_S_TARA

+ +
+
+ +

◆ getTrspModeTxt()

+ +
+
+ + + + + + + +
const char * LTAPIAircraft::getTrspModeTxt () const
+
+ +

Transponder mode text, like "off", "Mode C", "Mode S TARA".

+
diff --git a/docs/html/doxygen_crawl.html b/docs/html/doxygen_crawl.html index d18e800..6c2fe66 100644 --- a/docs/html/doxygen_crawl.html +++ b/docs/html/doxygen_crawl.html @@ -53,6 +53,9 @@ + + + @@ -86,8 +89,13 @@ + + + + + @@ -119,6 +127,7 @@ + @@ -130,8 +139,10 @@ + + @@ -175,18 +186,30 @@ + + + + + + + + + + + + @@ -266,16 +289,21 @@ + + + + + @@ -284,12 +312,14 @@ + + diff --git a/docs/html/functions.html b/docs/html/functions.html index 8160ce3..f77a629 100644 --- a/docs/html/functions.html +++ b/docs/html/functions.html @@ -152,6 +152,9 @@

- g -

diff --git a/docs/html/functions_func.html b/docs/html/functions_func.html index 78c9962..8994fee 100644 --- a/docs/html/functions_func.html +++ b/docs/html/functions_func.html @@ -102,6 +102,9 @@

- g -

speed_ktLTAPIAircraft::LTAPIBulkData
terrainAlt_ftLTAPIAircraft::LTAPIBulkData
trackLTAPIAircraft::LTAPIBulkData
vsi_ftLTAPIAircraft::LTAPIBulkData
v_xLTAPIAircraft::LTAPIBulkData
v_yLTAPIAircraft::LTAPIBulkData
v_zLTAPIAircraft::LTAPIBulkData
vsi_ftLTAPIAircraft::LTAPIBulkData
xLTAPIAircraft::LTAPIBulkData
yLTAPIAircraft::LTAPIBulkData
zLTAPIAircraft::LTAPIBulkData

double alt_ft = 0.0f
 [ft] altitude
 
double x = NAN
 local Cartesian X coordinate (NAN indicates to delivered by master, e.g. because older version)
 
double y = NAN
 local Cartesian Y coordinate
 
double z = NAN
 local Cartesian Z coordinate
 
double v_x = NAN
 [m/s] Cartesian velocity in X direction
 
double v_y = NAN
 [m/s] Cartesian velocity in Y direction
 
double v_z = NAN
 [m/s] Cartesian velocity in Z direction
 

Detailed Description

Bulk data transfer structur for communication with LTAPI.

@@ -181,7 +199,7 @@

unsigned -filler2: 8 +filler2: 4 @@ -238,6 +256,12 @@

taxi lights + +unsigned + +trspMode: 4 + +Transponder mode, see enum XPMPTransponderMode (filled only as of LT 4.4.0)

@@ -589,6 +613,54 @@

+

◆ v_x

+ +
+
+ + + + +
double LTAPIAircraft::LTAPIBulkData::v_x = NAN
+
+ +

[m/s] Cartesian velocity in X direction

+ +
+
+ +

◆ v_y

+ +
+
+ + + + +
double LTAPIAircraft::LTAPIBulkData::v_y = NAN
+
+ +

[m/s] Cartesian velocity in Y direction

+ +
+
+ +

◆ v_z

+ +
+
+ + + + +
double LTAPIAircraft::LTAPIBulkData::v_z = NAN
+
+ +

[m/s] Cartesian velocity in Z direction

+
@@ -605,6 +677,54 @@

+

◆ x

+ +
+
+ + + + +
double LTAPIAircraft::LTAPIBulkData::x = NAN
+
+ +

local Cartesian X coordinate (NAN indicates to delivered by master, e.g. because older version)

+ +
+
+ +

◆ y

+ +
+
+ + + + +
double LTAPIAircraft::LTAPIBulkData::y = NAN
+
+ +

local Cartesian Y coordinate

+ +
+
+ +

◆ z

+ +
+
+ + + + +
double LTAPIAircraft::LTAPIBulkData::z = NAN
+
+ +

local Cartesian Z coordinate

+

The documentation for this struct was generated from the following file: