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

+99 -87
View File
@@ -1,111 +1,123 @@
#include "XPCWidget.h"
XPCWidget::XPCWidget(int inLeft,
int inTop,
int inRight,
int inBottom,
bool inVisible,
const char *inDescriptor,
bool inIsRoot,
XPWidgetID inParent,
XPWidgetClass inClass)
: mWidget(NULL), mOwnsChildren(false), mOwnsWidget(true)
XPCWidget::XPCWidget(
int inLeft,
int inTop,
int inRight,
int inBottom,
bool inVisible,
const char * inDescriptor,
bool inIsRoot,
XPWidgetID inParent,
XPWidgetClass inClass) :
mWidget(NULL),
mOwnsChildren(false),
mOwnsWidget(true)
{
mWidget = XPCreateWidget(inLeft,
inTop,
inRight,
inBottom,
inVisible ? 1 : 0,
inDescriptor,
inIsRoot ? 1 : 0,
inIsRoot ? NULL : inParent,
inClass);
mWidget = XPCreateWidget(
inLeft, inTop, inRight, inBottom,
inVisible ? 1 : 0,
inDescriptor,
inIsRoot ? 1 : 0,
inIsRoot ? NULL : inParent,
inClass);
XPSetWidgetProperty(mWidget,
xpProperty_Object,
reinterpret_cast<intptr_t>(this));
XPAddWidgetCallback(mWidget, WidgetCallback);
}
XPCWidget::XPCWidget(XPWidgetID inWidget, bool inOwnsWidget)
: mWidget(inWidget), mOwnsChildren(false), mOwnsWidget(inOwnsWidget)
XPSetWidgetProperty(mWidget, xpProperty_Object, reinterpret_cast<intptr_t>(this));
XPAddWidgetCallback(mWidget, WidgetCallback);
}
XPCWidget::XPCWidget(
XPWidgetID inWidget,
bool inOwnsWidget) :
mWidget(inWidget),
mOwnsChildren(false),
mOwnsWidget(inOwnsWidget)
{
XPSetWidgetProperty(mWidget,
xpProperty_Object,
reinterpret_cast<intptr_t>(this));
XPAddWidgetCallback(mWidget, WidgetCallback);
XPSetWidgetProperty(mWidget, xpProperty_Object, reinterpret_cast<intptr_t>(this));
XPAddWidgetCallback(mWidget, WidgetCallback);
}
XPCWidget::~XPCWidget()
{
if (mOwnsWidget)
XPDestroyWidget(mWidget, mOwnsChildren ? 1 : 0);
if (mOwnsWidget)
XPDestroyWidget(mWidget, mOwnsChildren ? 1 : 0);
}
void XPCWidget::SetOwnsWidget(bool inOwnsWidget) { mOwnsWidget = inOwnsWidget; }
void XPCWidget::SetOwnsChildren(bool inOwnsChildren)
void XPCWidget::SetOwnsWidget(
bool inOwnsWidget)
{
mOwnsChildren = inOwnsChildren;
mOwnsWidget = inOwnsWidget;
}
XPCWidget::operator XPWidgetID() const { return mWidget; }
XPWidgetID XPCWidget::Get(void) const { return mWidget; }
void XPCWidget::AddAttachment(XPCWidgetAttachment *inAttachment,
bool inOwnsAttachment,
bool inPrefilter)
void XPCWidget::SetOwnsChildren(
bool inOwnsChildren)
{
if (inPrefilter) {
mAttachments.insert(mAttachments.begin(),
AttachmentInfo(inAttachment, inOwnsAttachment));
} else {
mAttachments.push_back(AttachmentInfo(inAttachment, inOwnsAttachment));
}
}
mOwnsChildren = inOwnsChildren;
}
void XPCWidget::RemoveAttachment(XPCWidgetAttachment *inAttachment)
XPCWidget::operator XPWidgetID () const
{
for (AttachmentVector::iterator iter = mAttachments.begin();
iter != mAttachments.end();
++iter) {
if (iter->first == inAttachment) {
mAttachments.erase(iter);
return;
}
}
return mWidget;
}
int XPCWidget::HandleWidgetMessage(XPWidgetMessage inMessage,
XPWidgetID inWidget,
intptr_t inParam1,
intptr_t inParam2)
XPWidgetID XPCWidget::Get(void) const
{
return 0;
return mWidget;
}
int XPCWidget::WidgetCallback(XPWidgetMessage inMessage,
XPWidgetID inWidget,
intptr_t inParam1,
intptr_t inParam2)
void XPCWidget::AddAttachment(
XPCWidgetAttachment * inAttachment,
bool inOwnsAttachment,
bool inPrefilter)
{
XPCWidget *me = reinterpret_cast<XPCWidget *>(
XPGetWidgetProperty(inWidget, xpProperty_Object, NULL));
if (me == NULL)
return 0;
if (inPrefilter)
{
mAttachments.insert(mAttachments.begin(), AttachmentInfo(inAttachment, inOwnsAttachment));
} else {
mAttachments.push_back(AttachmentInfo(inAttachment, inOwnsAttachment));
}
}
for (AttachmentVector::iterator iter = me->mAttachments.begin();
iter != me->mAttachments.end();
++iter) {
int result = iter->first->HandleWidgetMessage(me,
inMessage,
inWidget,
inParam1,
inParam2);
if (result != 0)
return result;
}
void XPCWidget::RemoveAttachment(
XPCWidgetAttachment * inAttachment)
{
for (AttachmentVector::iterator iter = mAttachments.begin();
iter != mAttachments.end(); ++iter)
{
if (iter->first == inAttachment)
{
mAttachments.erase(iter);
return;
}
}
}
return me->HandleWidgetMessage(inMessage, inWidget, inParam1, inParam2);
}
int XPCWidget::HandleWidgetMessage(
XPWidgetMessage inMessage,
XPWidgetID inWidget,
intptr_t inParam1,
intptr_t inParam2)
{
return 0;
}
int XPCWidget::WidgetCallback(
XPWidgetMessage inMessage,
XPWidgetID inWidget,
intptr_t inParam1,
intptr_t inParam2)
{
XPCWidget * me = reinterpret_cast<XPCWidget *>(XPGetWidgetProperty(inWidget, xpProperty_Object, NULL));
if (me == NULL)
return 0;
for (AttachmentVector::iterator iter = me->mAttachments.begin(); iter !=
me->mAttachments.end(); ++iter)
{
int result = iter->first->HandleWidgetMessage(me, inMessage, inWidget, inParam1, inParam2);
if (result != 0)
return result;
}
return me->HandleWidgetMessage(inMessage, inWidget, inParam1, inParam2);
}