Update XPLM for ARM64

This commit is contained in:
Kilian committed 2022-09-27 15:34:46 +02:00
1 parent 40067a606d
commit 174c20bd8f
59 files changed
+12475 -9196

No files matched your search

+71 -74
View File
@@ -1,107 +1,104 @@
#include "XPCDisplay.h"
XPCKeySniffer::XPCKeySniffer(int inBeforeWindows)
: mBeforeWindows(inBeforeWindows)
XPCKeySniffer::XPCKeySniffer(int inBeforeWindows) : mBeforeWindows(inBeforeWindows)
{
XPLMRegisterKeySniffer(KeySnifferCB,
mBeforeWindows,
reinterpret_cast<void *>(this));
}
XPLMRegisterKeySniffer(KeySnifferCB, mBeforeWindows, reinterpret_cast<void *>(this));
}
XPCKeySniffer::~XPCKeySniffer()
{
XPLMUnregisterKeySniffer(KeySnifferCB,
mBeforeWindows,
reinterpret_cast<void *>(this));
XPLMUnregisterKeySniffer(KeySnifferCB, mBeforeWindows, reinterpret_cast<void *>(this));
}
int XPCKeySniffer::KeySnifferCB(char inCharKey,
XPLMKeyFlags inFlags,
char inVirtualKey,
void *inRefCon)
int XPCKeySniffer::KeySnifferCB(
char inCharKey,
XPLMKeyFlags inFlags,
char inVirtualKey,
void * inRefCon)
{
XPCKeySniffer *me = reinterpret_cast<XPCKeySniffer *>(inRefCon);
return me->HandleKeyStroke(inCharKey, inFlags, inVirtualKey);
}
XPCKeySniffer * me = reinterpret_cast<XPCKeySniffer *>(inRefCon);
return me->HandleKeyStroke(inCharKey, inFlags, inVirtualKey);
}
XPCWindow::XPCWindow(int inLeft,
int inTop,
int inRight,
int inBottom,
int inIsVisible)
XPCWindow::XPCWindow(
int inLeft,
int inTop,
int inRight,
int inBottom,
int inIsVisible)
{
mWindow = XPLMCreateWindow(inLeft,
inTop,
inRight,
inBottom,
inIsVisible,
DrawCB,
HandleKeyCB,
MouseClickCB,
reinterpret_cast<void *>(this));
mWindow = XPLMCreateWindow(inLeft, inTop, inRight, inBottom, inIsVisible,
DrawCB, HandleKeyCB, MouseClickCB,
reinterpret_cast<void *>(this));
}
XPCWindow::~XPCWindow() { XPLMDestroyWindow(mWindow); }
void XPCWindow::GetWindowGeometry(int *outLeft,
int *outTop,
int *outRight,
int *outBottom)
XPCWindow::~XPCWindow()
{
XPLMGetWindowGeometry(mWindow, outLeft, outTop, outRight, outBottom);
XPLMDestroyWindow(mWindow);
}
void XPCWindow::SetWindowGeometry(int inLeft,
int inTop,
int inRight,
int inBottom)
void XPCWindow::GetWindowGeometry(
int * outLeft,
int * outTop,
int * outRight,
int * outBottom)
{
XPLMSetWindowGeometry(mWindow, inLeft, inTop, inRight, inBottom);
XPLMGetWindowGeometry(mWindow, outLeft, outTop, outRight, outBottom);
}
int XPCWindow::GetWindowIsVisible(void)
void XPCWindow::SetWindowGeometry(
int inLeft,
int inTop,
int inRight,
int inBottom)
{
return XPLMGetWindowIsVisible(mWindow);
XPLMSetWindowGeometry(mWindow, inLeft, inTop, inRight, inBottom);
}
void XPCWindow::SetWindowIsVisible(int inIsVisible)
int XPCWindow::GetWindowIsVisible(void)
{
XPLMSetWindowIsVisible(mWindow, inIsVisible);
return XPLMGetWindowIsVisible(mWindow);
}
void XPCWindow::TakeKeyboardFocus(void) { XPLMTakeKeyboardFocus(mWindow); }
void XPCWindow::BringWindowToFront(void) { XPLMBringWindowToFront(mWindow); }
int XPCWindow::IsWindowInFront(void) { return XPLMIsWindowInFront(mWindow); }
void XPCWindow::DrawCB(XPLMWindowID inWindowID, void *inRefcon)
void XPCWindow::SetWindowIsVisible(
int inIsVisible)
{
XPCWindow *me = reinterpret_cast<XPCWindow *>(inRefcon);
me->DoDraw();
XPLMSetWindowIsVisible(mWindow, inIsVisible);
}
void XPCWindow::TakeKeyboardFocus(void)
{
XPLMTakeKeyboardFocus(mWindow);
}
void XPCWindow::HandleKeyCB(XPLMWindowID inWindowID,
char inKey,
XPLMKeyFlags inFlags,
char inVirtualKey,
void *inRefcon,
int losingFocus)
void XPCWindow::BringWindowToFront(void)
{
XPCWindow *me = reinterpret_cast<XPCWindow *>(inRefcon);
if (losingFocus)
me->LoseFocus();
else
me->HandleKey(inKey, inFlags, inVirtualKey);
XPLMBringWindowToFront(mWindow);
}
int XPCWindow::MouseClickCB(XPLMWindowID inWindowID,
int x,
int y,
XPLMMouseStatus inMouse,
void *inRefcon)
int XPCWindow::IsWindowInFront(void)
{
XPCWindow *me = reinterpret_cast<XPCWindow *>(inRefcon);
return me->HandleClick(x, y, inMouse);
return XPLMIsWindowInFront(mWindow);
}
void XPCWindow::DrawCB(XPLMWindowID inWindowID, void * inRefcon)
{
XPCWindow * me = reinterpret_cast<XPCWindow *>(inRefcon);
me->DoDraw();
}
void XPCWindow::HandleKeyCB(XPLMWindowID inWindowID, char inKey, XPLMKeyFlags inFlags, char inVirtualKey, void * inRefcon, int losingFocus)
{
XPCWindow * me = reinterpret_cast<XPCWindow *>(inRefcon);
if (losingFocus)
me->LoseFocus();
else
me->HandleKey(inKey, inFlags, inVirtualKey);
}
int XPCWindow::MouseClickCB(XPLMWindowID inWindowID, int x, int y, XPLMMouseStatus inMouse, void * inRefcon)
{
XPCWindow * me = reinterpret_cast<XPCWindow *>(inRefcon);
return me->HandleClick(x, y, inMouse);
}