diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-25 15:48:44 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-25 15:48:44 +0200 |
commit | 3ab6c7feee8126bdfc5c9ab9371db41102e12e95 (patch) | |
tree | a309c45826300b888238b6a517051fe7e71d63eb /widget/nsGUIEventIPC.h | |
parent | b18a9cf86ea25bc52d9cfea584e3aa8bfbe81f0a (diff) | |
parent | b069dabc91b7e0f5f8d161cdbe598276a21d6d68 (diff) | |
download | UXP-3ab6c7feee8126bdfc5c9ab9371db41102e12e95.tar UXP-3ab6c7feee8126bdfc5c9ab9371db41102e12e95.tar.gz UXP-3ab6c7feee8126bdfc5c9ab9371db41102e12e95.tar.lz UXP-3ab6c7feee8126bdfc5c9ab9371db41102e12e95.tar.xz UXP-3ab6c7feee8126bdfc5c9ab9371db41102e12e95.zip |
Merge branch 'master' of https://github.com/MoonchildProductions/UXP into pm_url_1
Diffstat (limited to 'widget/nsGUIEventIPC.h')
-rw-r--r-- | widget/nsGUIEventIPC.h | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/widget/nsGUIEventIPC.h b/widget/nsGUIEventIPC.h index 7a9d870d9..e45189bb1 100644 --- a/widget/nsGUIEventIPC.h +++ b/widget/nsGUIEventIPC.h @@ -219,6 +219,34 @@ 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); + WriteParam(aMsg, aParam.twist); + WriteParam(aMsg, aParam.tangentialPressure); + // We don't serialize convertToPointer since it's 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) && + ReadParam(aMsg, aIter, &aResult->twist) && + ReadParam(aMsg, aIter, &aResult->tangentialPressure); + return rv; + } +}; + +template<> struct ParamTraits<mozilla::WidgetMouseEvent> { typedef mozilla::WidgetMouseEvent paramType; @@ -226,13 +254,13 @@ struct ParamTraits<mozilla::WidgetMouseEvent> static void Write(Message* aMsg, const paramType& aParam) { WriteParam(aMsg, static_cast<mozilla::WidgetMouseEventBase>(aParam)); + WriteParam(aMsg, static_cast<mozilla::WidgetPointerHelper>(aParam)); WriteParam(aMsg, aParam.mIgnoreRootScrollFrame); WriteParam(aMsg, static_cast<paramType::ReasonType>(aParam.mReason)); WriteParam(aMsg, static_cast<paramType::ContextMenuTriggerType>( aParam.mContextMenuTrigger)); WriteParam(aMsg, static_cast<paramType::ExitFromType>(aParam.mExitFrom)); WriteParam(aMsg, aParam.mClickCount); - WriteParam(aMsg, aParam.pointerId); } static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) @@ -243,12 +271,13 @@ struct ParamTraits<mozilla::WidgetMouseEvent> paramType::ExitFromType exitFrom = 0; rv = ReadParam(aMsg, aIter, static_cast<mozilla::WidgetMouseEventBase*>(aResult)) && + ReadParam(aMsg, aIter, + static_cast<mozilla::WidgetPointerHelper*>(aResult)) && ReadParam(aMsg, aIter, &aResult->mIgnoreRootScrollFrame) && ReadParam(aMsg, aIter, &reason) && ReadParam(aMsg, aIter, &contextMenuTrigger) && ReadParam(aMsg, aIter, &exitFrom) && - ReadParam(aMsg, aIter, &aResult->mClickCount) && - ReadParam(aMsg, aIter, &aResult->pointerId); + ReadParam(aMsg, aIter, &aResult->mClickCount); aResult->mReason = static_cast<paramType::Reason>(reason); aResult->mContextMenuTrigger = static_cast<paramType::ContextMenuTrigger>(contextMenuTrigger); @@ -290,8 +319,6 @@ struct ParamTraits<mozilla::WidgetPointerEvent> WriteParam(aMsg, static_cast<mozilla::WidgetMouseEvent>(aParam)); WriteParam(aMsg, aParam.mWidth); WriteParam(aMsg, aParam.mHeight); - WriteParam(aMsg, aParam.tiltX); - WriteParam(aMsg, aParam.tiltY); WriteParam(aMsg, aParam.mIsPrimary); } @@ -301,8 +328,6 @@ struct ParamTraits<mozilla::WidgetPointerEvent> ReadParam(aMsg, aIter, static_cast<mozilla::WidgetMouseEvent*>(aResult)) && ReadParam(aMsg, aIter, &aResult->mWidth) && ReadParam(aMsg, aIter, &aResult->mHeight) && - ReadParam(aMsg, aIter, &aResult->tiltX) && - ReadParam(aMsg, aIter, &aResult->tiltY) && ReadParam(aMsg, aIter, &aResult->mIsPrimary); return rv; } |