mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-28 18:17:29 +09:00
Bug 1299197 Part2: Serialize WidgetPointerHelper in IPC message
native in moebius
This commit is contained in:
parent
d49e470d3d
commit
f0a5f99021
1 changed files with 28 additions and 7 deletions
|
|
@ -218,6 +218,30 @@ struct ParamTraits<mozilla::WidgetWheelEvent>
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
struct ParamTraits<mozilla::WidgetPointerHelper>
|
||||||
|
{
|
||||||
|
typedef mozilla::WidgetPointerHelper paramType;
|
||||||
|
|
||||||
|
static void Write(Message* aMsg, const paramType& aParam)
|
||||||
|
{
|
||||||
|
WriteParam(aMsg, aParam.pointerId);
|
||||||
|
WriteParam(aMsg, aParam.tiltX);
|
||||||
|
WriteParam(aMsg, aParam.tiltY);
|
||||||
|
// We don't serialize convertToPointer and retargetedByPointerCapture since
|
||||||
|
// they are temporarily variable and should be reset to default.
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
|
||||||
|
{
|
||||||
|
bool rv;
|
||||||
|
rv = ReadParam(aMsg, aIter, &aResult->pointerId) &&
|
||||||
|
ReadParam(aMsg, aIter, &aResult->tiltX) &&
|
||||||
|
ReadParam(aMsg, aIter, &aResult->tiltY);
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
struct ParamTraits<mozilla::WidgetMouseEvent>
|
struct ParamTraits<mozilla::WidgetMouseEvent>
|
||||||
{
|
{
|
||||||
|
|
@ -226,13 +250,13 @@ struct ParamTraits<mozilla::WidgetMouseEvent>
|
||||||
static void Write(Message* aMsg, const paramType& aParam)
|
static void Write(Message* aMsg, const paramType& aParam)
|
||||||
{
|
{
|
||||||
WriteParam(aMsg, static_cast<mozilla::WidgetMouseEventBase>(aParam));
|
WriteParam(aMsg, static_cast<mozilla::WidgetMouseEventBase>(aParam));
|
||||||
|
WriteParam(aMsg, static_cast<mozilla::WidgetPointerHelper>(aParam));
|
||||||
WriteParam(aMsg, aParam.mIgnoreRootScrollFrame);
|
WriteParam(aMsg, aParam.mIgnoreRootScrollFrame);
|
||||||
WriteParam(aMsg, static_cast<paramType::ReasonType>(aParam.mReason));
|
WriteParam(aMsg, static_cast<paramType::ReasonType>(aParam.mReason));
|
||||||
WriteParam(aMsg, static_cast<paramType::ContextMenuTriggerType>(
|
WriteParam(aMsg, static_cast<paramType::ContextMenuTriggerType>(
|
||||||
aParam.mContextMenuTrigger));
|
aParam.mContextMenuTrigger));
|
||||||
WriteParam(aMsg, static_cast<paramType::ExitFromType>(aParam.mExitFrom));
|
WriteParam(aMsg, static_cast<paramType::ExitFromType>(aParam.mExitFrom));
|
||||||
WriteParam(aMsg, aParam.mClickCount);
|
WriteParam(aMsg, aParam.mClickCount);
|
||||||
WriteParam(aMsg, aParam.pointerId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
|
static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
|
||||||
|
|
@ -243,12 +267,13 @@ struct ParamTraits<mozilla::WidgetMouseEvent>
|
||||||
paramType::ExitFromType exitFrom = 0;
|
paramType::ExitFromType exitFrom = 0;
|
||||||
rv = ReadParam(aMsg, aIter,
|
rv = ReadParam(aMsg, aIter,
|
||||||
static_cast<mozilla::WidgetMouseEventBase*>(aResult)) &&
|
static_cast<mozilla::WidgetMouseEventBase*>(aResult)) &&
|
||||||
|
ReadParam(aMsg, aIter,
|
||||||
|
static_cast<mozilla::WidgetPointerHelper*>(aResult)) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mIgnoreRootScrollFrame) &&
|
ReadParam(aMsg, aIter, &aResult->mIgnoreRootScrollFrame) &&
|
||||||
ReadParam(aMsg, aIter, &reason) &&
|
ReadParam(aMsg, aIter, &reason) &&
|
||||||
ReadParam(aMsg, aIter, &contextMenuTrigger) &&
|
ReadParam(aMsg, aIter, &contextMenuTrigger) &&
|
||||||
ReadParam(aMsg, aIter, &exitFrom) &&
|
ReadParam(aMsg, aIter, &exitFrom) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mClickCount) &&
|
ReadParam(aMsg, aIter, &aResult->mClickCount);
|
||||||
ReadParam(aMsg, aIter, &aResult->pointerId);
|
|
||||||
aResult->mReason = static_cast<paramType::Reason>(reason);
|
aResult->mReason = static_cast<paramType::Reason>(reason);
|
||||||
aResult->mContextMenuTrigger =
|
aResult->mContextMenuTrigger =
|
||||||
static_cast<paramType::ContextMenuTrigger>(contextMenuTrigger);
|
static_cast<paramType::ContextMenuTrigger>(contextMenuTrigger);
|
||||||
|
|
@ -290,8 +315,6 @@ struct ParamTraits<mozilla::WidgetPointerEvent>
|
||||||
WriteParam(aMsg, static_cast<mozilla::WidgetMouseEvent>(aParam));
|
WriteParam(aMsg, static_cast<mozilla::WidgetMouseEvent>(aParam));
|
||||||
WriteParam(aMsg, aParam.mWidth);
|
WriteParam(aMsg, aParam.mWidth);
|
||||||
WriteParam(aMsg, aParam.mHeight);
|
WriteParam(aMsg, aParam.mHeight);
|
||||||
WriteParam(aMsg, aParam.tiltX);
|
|
||||||
WriteParam(aMsg, aParam.tiltY);
|
|
||||||
WriteParam(aMsg, aParam.mIsPrimary);
|
WriteParam(aMsg, aParam.mIsPrimary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -301,8 +324,6 @@ struct ParamTraits<mozilla::WidgetPointerEvent>
|
||||||
ReadParam(aMsg, aIter, static_cast<mozilla::WidgetMouseEvent*>(aResult)) &&
|
ReadParam(aMsg, aIter, static_cast<mozilla::WidgetMouseEvent*>(aResult)) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mWidth) &&
|
ReadParam(aMsg, aIter, &aResult->mWidth) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->mHeight) &&
|
ReadParam(aMsg, aIter, &aResult->mHeight) &&
|
||||||
ReadParam(aMsg, aIter, &aResult->tiltX) &&
|
|
||||||
ReadParam(aMsg, aIter, &aResult->tiltY) &&
|
|
||||||
ReadParam(aMsg, aIter, &aResult->mIsPrimary);
|
ReadParam(aMsg, aIter, &aResult->mIsPrimary);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue