Update XPLM for ARM64
This commit is contained in:
1 parent
40067a606d
commit
174c20bd8f
59 files changed
+12475
-9196
No files matched your search
+164
-84
@@ -2,27 +2,46 @@
|
||||
#define _XPLMMenus_h_
|
||||
|
||||
/*
|
||||
* Copyright 2005-2012 Sandy Barbour and Ben Supnik
|
||||
*
|
||||
* All rights reserved. See license.txt for usage.
|
||||
*
|
||||
* X-Plane SDK Version: 2.1.1
|
||||
* Copyright 2005-2012 Sandy Barbour and Ben Supnik All rights reserved. See
|
||||
* license.txt for usage. X-Plane SDK Version: 2.1.1
|
||||
*
|
||||
*/
|
||||
|
||||
/***************************************************************************
|
||||
* XPLMMenus
|
||||
***************************************************************************/
|
||||
/*
|
||||
* XPLMMenus - Theory of Operation
|
||||
*
|
||||
* Plug-ins can create menus in the menu bar of X-Plane. This is done by
|
||||
* Plug-ins can create menus in the menu bar of X-Plane. This is done by
|
||||
* creating a menu and then creating items. Menus are referred to by an
|
||||
* opaque ID. Items are referred to by index number. For each menu and item
|
||||
* you specify a void *. Per menu you specify a handler function that is
|
||||
* called with each void * when the menu item is picked. Menu item indices
|
||||
* are zero based.
|
||||
* opaque ID. Items are referred to by (zero-based) index number.
|
||||
*
|
||||
* Menus are "sandboxed" between plugins---no plugin can access the menus of
|
||||
* any other plugin. Furthermore, all menu indices are relative to your
|
||||
* plugin's menus only; if your plugin creates two sub-menus in the Plugins
|
||||
* menu at different times, it doesn't matter how many other plugins also
|
||||
* create sub-menus of Plugins in the intervening time: your sub-menus will be
|
||||
* given menu indices 0 and 1. (The SDK does some work in the back-end to
|
||||
* filter out menus that are irrelevant to your plugin in order to deliver
|
||||
* this consistency for each plugin.)
|
||||
*
|
||||
* When you create a menu item, you specify how we should handle clicks on
|
||||
* that menu item. You can either have the XPLM trigger a callback (the
|
||||
* XPLMMenuHandler_f associated with the menu that contains the item), or you
|
||||
* can simply have a command be triggered (with no associated call to your
|
||||
* menu handler). The advantage of the latter method is that X-Plane will
|
||||
* display any keyboard shortcuts associated with the command. (In contrast,
|
||||
* there are no keyboard shortcuts associated with menu handler callbacks with
|
||||
* specific parameters.)
|
||||
*
|
||||
* Menu text in X-Plane is UTF8; X-Plane's character set covers latin, greek
|
||||
* and cyrillic characters, Katakana, as well as some Japanese symbols. Some
|
||||
* APIs have a inDeprecatedAndIgnored parameter that used to select a
|
||||
* character set; since X-Plane 9 all localization is done via UTF-8 only.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "XPLMDefs.h"
|
||||
#include "XPLMUtilities.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -31,31 +50,24 @@ extern "C" {
|
||||
/***************************************************************************
|
||||
* XPLM MENUS
|
||||
***************************************************************************/
|
||||
/*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* XPLMMenuCheck
|
||||
*
|
||||
* These enumerations define the various 'check' states for an X-Plane menu.
|
||||
* 'checking' in x-plane actually appears as a light which may or may not be
|
||||
* lit. So there are three possible states.
|
||||
*
|
||||
* These enumerations define the various 'check' states for an X-Plane menu.
|
||||
* 'checking' in X-Plane actually appears as a light which may or may not be
|
||||
* lit. So there are three possible states.
|
||||
*
|
||||
*/
|
||||
enum {
|
||||
/* there is no symbol to the left of the menu item. */
|
||||
xplm_Menu_NoCheck = 0
|
||||
/* there is no symbol to the left of the menu item. */
|
||||
xplm_Menu_NoCheck = 0,
|
||||
|
||||
/* the menu has a mark next to it that is unmarked (not lit). */
|
||||
,
|
||||
xplm_Menu_Unchecked = 1
|
||||
/* the menu has a mark next to it that is unmarked (not lit). */
|
||||
xplm_Menu_Unchecked = 1,
|
||||
|
||||
/* the menu has a mark next to it that is checked (lit). */
|
||||
,
|
||||
xplm_Menu_Checked = 2
|
||||
/* the menu has a mark next to it that is checked (lit). */
|
||||
xplm_Menu_Checked = 2,
|
||||
|
||||
|
||||
};
|
||||
@@ -63,34 +75,55 @@ typedef int XPLMMenuCheck;
|
||||
|
||||
/*
|
||||
* XPLMMenuID
|
||||
*
|
||||
* This is a unique ID for each menu you create.
|
||||
*
|
||||
* This is a unique ID for each menu you create.
|
||||
*
|
||||
*/
|
||||
typedef void *XPLMMenuID;
|
||||
typedef void * XPLMMenuID;
|
||||
|
||||
/*
|
||||
* XPLMMenuHandler_f
|
||||
*
|
||||
*
|
||||
* A menu handler function takes two reference pointers, one for the menu
|
||||
* (specified when the menu was created) and one for the item (specified when
|
||||
* the item was created).
|
||||
* the item was created).
|
||||
*
|
||||
*/
|
||||
typedef void (*XPLMMenuHandler_f)(void *inMenuRef, void *inItemRef);
|
||||
typedef void (* XPLMMenuHandler_f)(
|
||||
void * inMenuRef,
|
||||
void * inItemRef);
|
||||
|
||||
/*
|
||||
* XPLMFindPluginsMenu
|
||||
*
|
||||
*
|
||||
* This function returns the ID of the plug-ins menu, which is created for you
|
||||
* at startup.
|
||||
* at startup.
|
||||
*
|
||||
*/
|
||||
XPLM_API XPLMMenuID XPLMFindPluginsMenu(void);
|
||||
|
||||
#if defined(XPLM300)
|
||||
/*
|
||||
* XPLMFindAircraftMenu
|
||||
*
|
||||
* This function returns the ID of the menu for the currently-loaded aircraft,
|
||||
* used for showing aircraft-specific commands.
|
||||
*
|
||||
* The aircraft menu is created by X-Plane at startup, but it remains hidden
|
||||
* until it is populated via XPLMAppendMenuItem() or
|
||||
* XPLMAppendMenuItemWithCommand().
|
||||
*
|
||||
* Only plugins loaded with the user's current aircraft are allowed to access
|
||||
* the aircraft menu. For all other plugins, this will return NULL, and any
|
||||
* attempts to add menu items to it will fail.
|
||||
*
|
||||
*/
|
||||
XPLM_API XPLMMenuID XPLMFindAircraftMenu(void);
|
||||
#endif /* XPLM300 */
|
||||
|
||||
/*
|
||||
* XPLMCreateMenu
|
||||
*
|
||||
*
|
||||
* This function creates a new menu and returns its ID. It returns NULL if
|
||||
* the menu cannot be created. Pass in a parent menu ID and an item index to
|
||||
* create a submenu, or NULL for the parent menu to put the menu in the menu
|
||||
@@ -98,109 +131,156 @@ XPLM_API XPLMMenuID XPLMFindPluginsMenu(void);
|
||||
* pass a handler function and a menu reference value. Pass NULL for the
|
||||
* handler if you do not need callbacks from the menu (for example, if it only
|
||||
* contains submenus).
|
||||
*
|
||||
*
|
||||
* Important: you must pass a valid, non-empty menu title even if the menu is
|
||||
* a submenu where the title is not visible.
|
||||
* a submenu where the title is not visible.
|
||||
*
|
||||
*/
|
||||
XPLM_API XPLMMenuID XPLMCreateMenu(const char *inName,
|
||||
XPLMMenuID inParentMenu,
|
||||
int inParentItem,
|
||||
XPLMMenuHandler_f inHandler,
|
||||
void *inMenuRef);
|
||||
XPLM_API XPLMMenuID XPLMCreateMenu(
|
||||
const char * inName,
|
||||
XPLMMenuID inParentMenu,
|
||||
int inParentItem,
|
||||
XPLMMenuHandler_f inHandler,
|
||||
void * inMenuRef);
|
||||
|
||||
/*
|
||||
* XPLMDestroyMenu
|
||||
*
|
||||
*
|
||||
* This function destroys a menu that you have created. Use this to remove a
|
||||
* submenu if necessary. (Normally this function will not be necessary.)
|
||||
* submenu if necessary. (Normally this function will not be necessary.)
|
||||
*
|
||||
*/
|
||||
XPLM_API void XPLMDestroyMenu(XPLMMenuID inMenuID);
|
||||
XPLM_API void XPLMDestroyMenu(
|
||||
XPLMMenuID inMenuID);
|
||||
|
||||
/*
|
||||
* XPLMClearAllMenuItems
|
||||
*
|
||||
*
|
||||
* This function removes all menu items from a menu, allowing you to rebuild
|
||||
* it. Use this function if you need to change the number of items on a menu.
|
||||
*
|
||||
*/
|
||||
XPLM_API void XPLMClearAllMenuItems(XPLMMenuID inMenuID);
|
||||
XPLM_API void XPLMClearAllMenuItems(
|
||||
XPLMMenuID inMenuID);
|
||||
|
||||
/*
|
||||
* XPLMAppendMenuItem
|
||||
*
|
||||
*
|
||||
* This routine appends a new menu item to the bottom of a menu and returns
|
||||
* its index. Pass in the menu to add the item to, the items name, and a void
|
||||
* * ref for this item. If you pass in inForceEnglish, this menu item will be
|
||||
* drawn using the english character set no matter what language x-plane is
|
||||
* running in. Otherwise the menu item will be drawn localized. (An example
|
||||
* of why you'd want to do this is for a proper name.) See XPLMUtilities for
|
||||
* determining the current langauge.
|
||||
* * ref for this item.
|
||||
*
|
||||
* Returns a negative index if the append failed (due to an invalid parent
|
||||
* menu argument).
|
||||
*
|
||||
* Note that all menu indices returned are relative to your plugin's menus
|
||||
* only; if your plugin creates two sub-menus in the Plugins menu at different
|
||||
* times, it doesn't matter how many other plugins also create sub-menus of
|
||||
* Plugins in the intervening time: your sub-menus will be given menu indices
|
||||
* 0 and 1. (The SDK does some work in the back-end to filter out menus that
|
||||
* are irrelevant to your plugin in order to deliver this consistency for each
|
||||
* plugin.)
|
||||
*
|
||||
*/
|
||||
XPLM_API int XPLMAppendMenuItem(XPLMMenuID inMenu,
|
||||
const char *inItemName,
|
||||
void *inItemRef,
|
||||
int inForceEnglish);
|
||||
XPLM_API int XPLMAppendMenuItem(
|
||||
XPLMMenuID inMenu,
|
||||
const char * inItemName,
|
||||
void * inItemRef,
|
||||
int inDeprecatedAndIgnored);
|
||||
|
||||
#if defined(XPLM300)
|
||||
/*
|
||||
* XPLMAppendMenuItemWithCommand
|
||||
*
|
||||
* Like XPLMAppendMenuItem(), but instead of the new menu item triggering the
|
||||
* XPLMMenuHandler_f of the containiner menu, it will simply execute the
|
||||
* command you pass in. Using a command for your menu item allows the user to
|
||||
* bind a keyboard shortcut to the command and see that shortcut represented
|
||||
* in the menu.
|
||||
*
|
||||
* Returns a negative index if the append failed (due to an invalid parent
|
||||
* menu argument).
|
||||
*
|
||||
* Like XPLMAppendMenuItem(), all menu indices are relative to your plugin's
|
||||
* menus only.
|
||||
*
|
||||
*/
|
||||
XPLM_API int XPLMAppendMenuItemWithCommand(
|
||||
XPLMMenuID inMenu,
|
||||
const char * inItemName,
|
||||
XPLMCommandRef inCommandToExecute);
|
||||
#endif /* XPLM300 */
|
||||
|
||||
/*
|
||||
* XPLMAppendMenuSeparator
|
||||
*
|
||||
* This routine adds a seperator to the end of a menu.
|
||||
*
|
||||
* 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);
|
||||
XPLM_API void XPLMAppendMenuSeparator(
|
||||
XPLMMenuID inMenu);
|
||||
|
||||
/*
|
||||
* XPLMSetMenuItemName
|
||||
*
|
||||
*
|
||||
* This routine changes the name of an existing menu item. Pass in the menu
|
||||
* ID and the index of the menu item.
|
||||
* ID and the index of the menu item.
|
||||
*
|
||||
*/
|
||||
XPLM_API void XPLMSetMenuItemName(XPLMMenuID inMenu,
|
||||
int inIndex,
|
||||
const char *inItemName,
|
||||
int inForceEnglish);
|
||||
XPLM_API void XPLMSetMenuItemName(
|
||||
XPLMMenuID inMenu,
|
||||
int inIndex,
|
||||
const char * inItemName,
|
||||
int inDeprecatedAndIgnored);
|
||||
|
||||
/*
|
||||
* XPLMCheckMenuItem
|
||||
*
|
||||
* Set whether a menu item is checked. Pass in the menu ID and item index.
|
||||
*
|
||||
* Set whether a menu item is checked. Pass in the menu ID and item index.
|
||||
*
|
||||
*/
|
||||
XPLM_API void
|
||||
XPLMCheckMenuItem(XPLMMenuID inMenu, int index, XPLMMenuCheck inCheck);
|
||||
XPLM_API void XPLMCheckMenuItem(
|
||||
XPLMMenuID inMenu,
|
||||
int index,
|
||||
XPLMMenuCheck inCheck);
|
||||
|
||||
/*
|
||||
* XPLMCheckMenuItemState
|
||||
*
|
||||
*
|
||||
* This routine returns whether a menu item is checked or not. A menu item's
|
||||
* check mark may be on or off, or a menu may not have an icon at all.
|
||||
* check mark may be on or off, or a menu may not have an icon at all.
|
||||
*
|
||||
*/
|
||||
XPLM_API void XPLMCheckMenuItemState(XPLMMenuID inMenu,
|
||||
int index,
|
||||
XPLMMenuCheck *outCheck);
|
||||
XPLM_API void XPLMCheckMenuItemState(
|
||||
XPLMMenuID inMenu,
|
||||
int index,
|
||||
XPLMMenuCheck * outCheck);
|
||||
|
||||
/*
|
||||
* XPLMEnableMenuItem
|
||||
*
|
||||
* Sets whether this menu item is enabled. Items start out enabled.
|
||||
*
|
||||
* Sets whether this menu item is enabled. Items start out enabled.
|
||||
*
|
||||
*/
|
||||
XPLM_API void XPLMEnableMenuItem(XPLMMenuID inMenu, int index, int enabled);
|
||||
XPLM_API void XPLMEnableMenuItem(
|
||||
XPLMMenuID inMenu,
|
||||
int index,
|
||||
int enabled);
|
||||
|
||||
#if defined(XPLM210)
|
||||
/*
|
||||
* XPLMRemoveMenuItem
|
||||
*
|
||||
*
|
||||
* Removes one item from a menu. Note that all menu items below are moved up
|
||||
* one; your plugin must track the change in index numbers.
|
||||
* one; your plugin must track the change in index numbers.
|
||||
*
|
||||
*/
|
||||
XPLM_API void XPLMRemoveMenuItem(XPLMMenuID inMenu, int inIndex);
|
||||
XPLM_API void XPLMRemoveMenuItem(
|
||||
XPLMMenuID inMenu,
|
||||
int inIndex);
|
||||
#endif /* XPLM210 */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Reference in new issue
Block a user