michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsGUIEventIPC_h__ michael@0: #define nsGUIEventIPC_h__ michael@0: michael@0: #include "ipc/IPCMessageUtils.h" michael@0: #include "mozilla/GfxMessageUtils.h" michael@0: #include "mozilla/dom/Touch.h" michael@0: #include "mozilla/MiscEvents.h" michael@0: #include "mozilla/MouseEvents.h" michael@0: #include "mozilla/TextEvents.h" michael@0: #include "mozilla/TouchEvents.h" michael@0: michael@0: namespace IPC michael@0: { michael@0: michael@0: template<> michael@0: struct ParamTraits michael@0: { michael@0: typedef mozilla::BaseEventFlags paramType; michael@0: michael@0: static void Write(Message* aMsg, const paramType& aParam) michael@0: { michael@0: aMsg->WriteBytes(&aParam, sizeof(aParam)); michael@0: } michael@0: michael@0: static bool Read(const Message* aMsg, void** aIter, paramType* aResult) michael@0: { michael@0: const char* outp; michael@0: if (!aMsg->ReadBytes(aIter, &outp, sizeof(*aResult))) { michael@0: return false; michael@0: } michael@0: *aResult = *reinterpret_cast(outp); michael@0: return true; michael@0: } michael@0: }; michael@0: michael@0: template<> michael@0: struct ParamTraits michael@0: { michael@0: typedef mozilla::WidgetEvent paramType; michael@0: michael@0: static void Write(Message* aMsg, const paramType& aParam) michael@0: { michael@0: WriteParam(aMsg, (uint8_t) aParam.eventStructType); michael@0: WriteParam(aMsg, aParam.message); michael@0: WriteParam(aMsg, aParam.refPoint); michael@0: WriteParam(aMsg, aParam.time); michael@0: WriteParam(aMsg, aParam.mFlags); michael@0: } michael@0: michael@0: static bool Read(const Message* aMsg, void** aIter, paramType* aResult) michael@0: { michael@0: uint8_t eventStructType = 0; michael@0: bool ret = ReadParam(aMsg, aIter, &eventStructType) && michael@0: ReadParam(aMsg, aIter, &aResult->message) && michael@0: ReadParam(aMsg, aIter, &aResult->refPoint) && michael@0: ReadParam(aMsg, aIter, &aResult->time) && michael@0: ReadParam(aMsg, aIter, &aResult->mFlags); michael@0: aResult->eventStructType = static_cast(eventStructType); michael@0: return ret; michael@0: } michael@0: }; michael@0: michael@0: template<> michael@0: struct ParamTraits michael@0: { michael@0: typedef mozilla::WidgetGUIEvent paramType; michael@0: michael@0: static void Write(Message* aMsg, const paramType& aParam) michael@0: { michael@0: WriteParam(aMsg, static_cast(aParam)); michael@0: } michael@0: michael@0: static bool Read(const Message* aMsg, void** aIter, paramType* aResult) michael@0: { michael@0: return ReadParam(aMsg, aIter, static_cast(aResult)); michael@0: } michael@0: }; michael@0: michael@0: template<> michael@0: struct ParamTraits michael@0: { michael@0: typedef mozilla::WidgetInputEvent paramType; michael@0: michael@0: static void Write(Message* aMsg, const paramType& aParam) michael@0: { michael@0: WriteParam(aMsg, static_cast(aParam)); michael@0: WriteParam(aMsg, aParam.modifiers); michael@0: } michael@0: michael@0: static bool Read(const Message* aMsg, void** aIter, paramType* aResult) michael@0: { michael@0: return ReadParam(aMsg, aIter, michael@0: static_cast(aResult)) && michael@0: ReadParam(aMsg, aIter, &aResult->modifiers); michael@0: } michael@0: }; michael@0: michael@0: template<> michael@0: struct ParamTraits michael@0: { michael@0: typedef mozilla::WidgetMouseEventBase paramType; michael@0: michael@0: static void Write(Message* aMsg, const paramType& aParam) michael@0: { michael@0: WriteParam(aMsg, static_cast(aParam)); michael@0: WriteParam(aMsg, aParam.button); michael@0: WriteParam(aMsg, aParam.buttons); michael@0: WriteParam(aMsg, aParam.pressure); michael@0: WriteParam(aMsg, aParam.inputSource); michael@0: } michael@0: michael@0: static bool Read(const Message* aMsg, void** aIter, paramType* aResult) michael@0: { michael@0: return ReadParam(aMsg, aIter, michael@0: static_cast(aResult)) && michael@0: ReadParam(aMsg, aIter, &aResult->button) && michael@0: ReadParam(aMsg, aIter, &aResult->buttons) && michael@0: ReadParam(aMsg, aIter, &aResult->pressure) && michael@0: ReadParam(aMsg, aIter, &aResult->inputSource); michael@0: } michael@0: }; michael@0: michael@0: template<> michael@0: struct ParamTraits michael@0: { michael@0: typedef mozilla::WidgetWheelEvent paramType; michael@0: michael@0: static void Write(Message* aMsg, const paramType& aParam) michael@0: { michael@0: WriteParam(aMsg, static_cast(aParam)); michael@0: WriteParam(aMsg, aParam.deltaX); michael@0: WriteParam(aMsg, aParam.deltaY); michael@0: WriteParam(aMsg, aParam.deltaZ); michael@0: WriteParam(aMsg, aParam.deltaMode); michael@0: WriteParam(aMsg, aParam.customizedByUserPrefs); michael@0: WriteParam(aMsg, aParam.isMomentum); michael@0: WriteParam(aMsg, aParam.isPixelOnlyDevice); michael@0: WriteParam(aMsg, aParam.lineOrPageDeltaX); michael@0: WriteParam(aMsg, aParam.lineOrPageDeltaY); michael@0: WriteParam(aMsg, static_cast(aParam.scrollType)); michael@0: WriteParam(aMsg, aParam.overflowDeltaX); michael@0: WriteParam(aMsg, aParam.overflowDeltaY); michael@0: } michael@0: michael@0: static bool Read(const Message* aMsg, void** aIter, paramType* aResult) michael@0: { michael@0: int32_t scrollType = 0; michael@0: bool rv = michael@0: ReadParam(aMsg, aIter, michael@0: static_cast(aResult)) && michael@0: ReadParam(aMsg, aIter, &aResult->deltaX) && michael@0: ReadParam(aMsg, aIter, &aResult->deltaY) && michael@0: ReadParam(aMsg, aIter, &aResult->deltaZ) && michael@0: ReadParam(aMsg, aIter, &aResult->deltaMode) && michael@0: ReadParam(aMsg, aIter, &aResult->customizedByUserPrefs) && michael@0: ReadParam(aMsg, aIter, &aResult->isMomentum) && michael@0: ReadParam(aMsg, aIter, &aResult->isPixelOnlyDevice) && michael@0: ReadParam(aMsg, aIter, &aResult->lineOrPageDeltaX) && michael@0: ReadParam(aMsg, aIter, &aResult->lineOrPageDeltaY) && michael@0: ReadParam(aMsg, aIter, &scrollType) && michael@0: ReadParam(aMsg, aIter, &aResult->overflowDeltaX) && michael@0: ReadParam(aMsg, aIter, &aResult->overflowDeltaY); michael@0: aResult->scrollType = michael@0: static_cast(scrollType); michael@0: return rv; michael@0: } michael@0: }; michael@0: michael@0: template<> michael@0: struct ParamTraits michael@0: { michael@0: typedef mozilla::WidgetMouseEvent paramType; michael@0: michael@0: static void Write(Message* aMsg, const paramType& aParam) michael@0: { michael@0: WriteParam(aMsg, static_cast(aParam)); michael@0: WriteParam(aMsg, aParam.ignoreRootScrollFrame); michael@0: WriteParam(aMsg, (uint8_t) aParam.reason); michael@0: WriteParam(aMsg, (uint8_t) aParam.context); michael@0: WriteParam(aMsg, (uint8_t) aParam.exit); michael@0: WriteParam(aMsg, aParam.clickCount); michael@0: } michael@0: michael@0: static bool Read(const Message* aMsg, void** aIter, paramType* aResult) michael@0: { michael@0: bool rv; michael@0: uint8_t reason = 0, context = 0, exit = 0; michael@0: rv = ReadParam(aMsg, aIter, michael@0: static_cast(aResult)) && michael@0: ReadParam(aMsg, aIter, &aResult->ignoreRootScrollFrame) && michael@0: ReadParam(aMsg, aIter, &reason) && michael@0: ReadParam(aMsg, aIter, &context) && michael@0: ReadParam(aMsg, aIter, &exit) && michael@0: ReadParam(aMsg, aIter, &aResult->clickCount); michael@0: aResult->reason = michael@0: static_cast(reason); michael@0: aResult->context = michael@0: static_cast(context); michael@0: aResult->exit = static_cast(exit); michael@0: return rv; michael@0: } michael@0: }; michael@0: michael@0: template<> michael@0: struct ParamTraits michael@0: { michael@0: typedef mozilla::WidgetPointerEvent paramType; michael@0: michael@0: static void Write(Message* aMsg, const paramType& aParam) michael@0: { michael@0: WriteParam(aMsg, static_cast(aParam)); michael@0: WriteParam(aMsg, aParam.pointerId); michael@0: WriteParam(aMsg, aParam.width); michael@0: WriteParam(aMsg, aParam.height); michael@0: WriteParam(aMsg, aParam.tiltX); michael@0: WriteParam(aMsg, aParam.tiltY); michael@0: WriteParam(aMsg, aParam.isPrimary); michael@0: } michael@0: michael@0: static bool Read(const Message* aMsg, void** aIter, paramType* aResult) michael@0: { michael@0: bool rv = michael@0: ReadParam(aMsg, aIter, static_cast(aResult)) && michael@0: ReadParam(aMsg, aIter, &aResult->pointerId) && michael@0: ReadParam(aMsg, aIter, &aResult->width) && michael@0: ReadParam(aMsg, aIter, &aResult->height) && michael@0: ReadParam(aMsg, aIter, &aResult->tiltX) && michael@0: ReadParam(aMsg, aIter, &aResult->tiltY) && michael@0: ReadParam(aMsg, aIter, &aResult->isPrimary); michael@0: return rv; michael@0: } michael@0: }; michael@0: michael@0: template<> michael@0: struct ParamTraits michael@0: { michael@0: typedef mozilla::WidgetTouchEvent paramType; michael@0: michael@0: static void Write(Message* aMsg, const paramType& aParam) michael@0: { michael@0: WriteParam(aMsg, static_cast(aParam)); michael@0: // Sigh, Touch bites us again! We want to be able to do michael@0: // WriteParam(aMsg, aParam.touches); michael@0: const nsTArray< nsRefPtr >& touches = aParam.touches; michael@0: WriteParam(aMsg, touches.Length()); michael@0: for (uint32_t i = 0; i < touches.Length(); ++i) { michael@0: mozilla::dom::Touch* touch = touches[i]; michael@0: WriteParam(aMsg, touch->mIdentifier); michael@0: WriteParam(aMsg, touch->mRefPoint); michael@0: WriteParam(aMsg, touch->mRadius); michael@0: WriteParam(aMsg, touch->mRotationAngle); michael@0: WriteParam(aMsg, touch->mForce); michael@0: } michael@0: } michael@0: michael@0: static bool Read(const Message* aMsg, void** aIter, paramType* aResult) michael@0: { michael@0: uint32_t numTouches; michael@0: if (!ReadParam(aMsg, aIter, michael@0: static_cast(aResult)) || michael@0: !ReadParam(aMsg, aIter, &numTouches)) { michael@0: return false; michael@0: } michael@0: for (uint32_t i = 0; i < numTouches; ++i) { michael@0: int32_t identifier; michael@0: mozilla::LayoutDeviceIntPoint refPoint; michael@0: nsIntPoint radius; michael@0: float rotationAngle; michael@0: float force; michael@0: if (!ReadParam(aMsg, aIter, &identifier) || michael@0: !ReadParam(aMsg, aIter, &refPoint) || michael@0: !ReadParam(aMsg, aIter, &radius) || michael@0: !ReadParam(aMsg, aIter, &rotationAngle) || michael@0: !ReadParam(aMsg, aIter, &force)) { michael@0: return false; michael@0: } michael@0: aResult->touches.AppendElement( michael@0: new mozilla::dom::Touch( michael@0: identifier, mozilla::LayoutDeviceIntPoint::ToUntyped(refPoint), michael@0: radius, rotationAngle, force)); michael@0: } michael@0: return true; michael@0: } michael@0: }; michael@0: michael@0: template<> michael@0: struct ParamTraits michael@0: { michael@0: typedef mozilla::WidgetKeyboardEvent paramType; michael@0: michael@0: static void Write(Message* aMsg, const paramType& aParam) michael@0: { michael@0: WriteParam(aMsg, static_cast(aParam)); michael@0: WriteParam(aMsg, static_cast(aParam.mKeyNameIndex)); michael@0: WriteParam(aMsg, aParam.mKeyValue); michael@0: WriteParam(aMsg, aParam.keyCode); michael@0: WriteParam(aMsg, aParam.charCode); michael@0: WriteParam(aMsg, aParam.isChar); michael@0: WriteParam(aMsg, aParam.mIsRepeat); michael@0: WriteParam(aMsg, aParam.location); michael@0: WriteParam(aMsg, aParam.mUniqueId); michael@0: // An OS-specific native event might be attached in |mNativeKeyEvent|, but michael@0: // that cannot be copied across process boundaries. michael@0: } michael@0: michael@0: static bool Read(const Message* aMsg, void** aIter, paramType* aResult) michael@0: { michael@0: uint32_t keyNameIndex = 0; michael@0: if (ReadParam(aMsg, aIter, michael@0: static_cast(aResult)) && michael@0: ReadParam(aMsg, aIter, &keyNameIndex) && michael@0: ReadParam(aMsg, aIter, &aResult->mKeyValue) && michael@0: ReadParam(aMsg, aIter, &aResult->keyCode) && michael@0: ReadParam(aMsg, aIter, &aResult->charCode) && michael@0: ReadParam(aMsg, aIter, &aResult->isChar) && michael@0: ReadParam(aMsg, aIter, &aResult->mIsRepeat) && michael@0: ReadParam(aMsg, aIter, &aResult->location) && michael@0: ReadParam(aMsg, aIter, &aResult->mUniqueId)) michael@0: { michael@0: aResult->mKeyNameIndex = static_cast(keyNameIndex); michael@0: aResult->mNativeKeyEvent = nullptr; michael@0: return true; michael@0: } michael@0: return false; michael@0: } michael@0: }; michael@0: michael@0: template<> michael@0: struct ParamTraits michael@0: { michael@0: typedef mozilla::TextRangeStyle paramType; michael@0: michael@0: static void Write(Message* aMsg, const paramType& aParam) michael@0: { michael@0: WriteParam(aMsg, aParam.mDefinedStyles); michael@0: WriteParam(aMsg, aParam.mLineStyle); michael@0: WriteParam(aMsg, aParam.mIsBoldLine); michael@0: WriteParam(aMsg, aParam.mForegroundColor); michael@0: WriteParam(aMsg, aParam.mBackgroundColor); michael@0: WriteParam(aMsg, aParam.mUnderlineColor); michael@0: } michael@0: michael@0: static bool Read(const Message* aMsg, void** aIter, paramType* aResult) michael@0: { michael@0: return ReadParam(aMsg, aIter, &aResult->mDefinedStyles) && michael@0: ReadParam(aMsg, aIter, &aResult->mLineStyle) && michael@0: ReadParam(aMsg, aIter, &aResult->mIsBoldLine) && michael@0: ReadParam(aMsg, aIter, &aResult->mForegroundColor) && michael@0: ReadParam(aMsg, aIter, &aResult->mBackgroundColor) && michael@0: ReadParam(aMsg, aIter, &aResult->mUnderlineColor); michael@0: } michael@0: }; michael@0: michael@0: template<> michael@0: struct ParamTraits michael@0: { michael@0: typedef mozilla::TextRange paramType; michael@0: michael@0: static void Write(Message* aMsg, const paramType& aParam) michael@0: { michael@0: WriteParam(aMsg, aParam.mStartOffset); michael@0: WriteParam(aMsg, aParam.mEndOffset); michael@0: WriteParam(aMsg, aParam.mRangeType); michael@0: WriteParam(aMsg, aParam.mRangeStyle); michael@0: } michael@0: michael@0: static bool Read(const Message* aMsg, void** aIter, paramType* aResult) michael@0: { michael@0: return ReadParam(aMsg, aIter, &aResult->mStartOffset) && michael@0: ReadParam(aMsg, aIter, &aResult->mEndOffset) && michael@0: ReadParam(aMsg, aIter, &aResult->mRangeType) && michael@0: ReadParam(aMsg, aIter, &aResult->mRangeStyle); michael@0: } michael@0: }; michael@0: michael@0: template<> michael@0: struct ParamTraits michael@0: { michael@0: typedef mozilla::TextRangeArray paramType; michael@0: michael@0: static void Write(Message* aMsg, const paramType& aParam) michael@0: { michael@0: WriteParam(aMsg, aParam.Length()); michael@0: for (uint32_t index = 0; index < aParam.Length(); index++) { michael@0: WriteParam(aMsg, aParam[index]); michael@0: } michael@0: } michael@0: michael@0: static bool Read(const Message* aMsg, void** aIter, paramType* aResult) michael@0: { michael@0: uint32_t length; michael@0: if (!ReadParam(aMsg, aIter, &length)) { michael@0: return false; michael@0: } michael@0: for (uint32_t index = 0; index < length; index++) { michael@0: mozilla::TextRange textRange; michael@0: if (!ReadParam(aMsg, aIter, &textRange)) { michael@0: aResult->Clear(); michael@0: return false; michael@0: } michael@0: aResult->AppendElement(textRange); michael@0: } michael@0: return true; michael@0: } michael@0: }; michael@0: michael@0: template<> michael@0: struct ParamTraits michael@0: { michael@0: typedef mozilla::WidgetTextEvent paramType; michael@0: michael@0: static void Write(Message* aMsg, const paramType& aParam) michael@0: { michael@0: WriteParam(aMsg, static_cast(aParam)); michael@0: WriteParam(aMsg, aParam.mSeqno); michael@0: WriteParam(aMsg, aParam.theText); michael@0: WriteParam(aMsg, aParam.isChar); michael@0: bool hasRanges = !!aParam.mRanges; michael@0: WriteParam(aMsg, hasRanges); michael@0: if (hasRanges) { michael@0: WriteParam(aMsg, *aParam.mRanges.get()); michael@0: } michael@0: } michael@0: michael@0: static bool Read(const Message* aMsg, void** aIter, paramType* aResult) michael@0: { michael@0: bool hasRanges; michael@0: if (!ReadParam(aMsg, aIter, michael@0: static_cast(aResult)) || michael@0: !ReadParam(aMsg, aIter, &aResult->mSeqno) || michael@0: !ReadParam(aMsg, aIter, &aResult->theText) || michael@0: !ReadParam(aMsg, aIter, &aResult->isChar) || michael@0: !ReadParam(aMsg, aIter, &hasRanges)) { michael@0: return false; michael@0: } michael@0: michael@0: if (!hasRanges) { michael@0: aResult->mRanges = nullptr; michael@0: } else { michael@0: aResult->mRanges = new mozilla::TextRangeArray(); michael@0: if (!aResult->mRanges) { michael@0: return false; michael@0: } michael@0: if (!ReadParam(aMsg, aIter, aResult->mRanges.get())) { michael@0: return false; michael@0: } michael@0: } michael@0: return true; michael@0: } michael@0: }; michael@0: michael@0: template<> michael@0: struct ParamTraits michael@0: { michael@0: typedef mozilla::WidgetCompositionEvent paramType; michael@0: michael@0: static void Write(Message* aMsg, const paramType& aParam) michael@0: { michael@0: WriteParam(aMsg, static_cast(aParam)); michael@0: WriteParam(aMsg, aParam.mSeqno); michael@0: WriteParam(aMsg, aParam.data); michael@0: } michael@0: michael@0: static bool Read(const Message* aMsg, void** aIter, paramType* aResult) michael@0: { michael@0: return ReadParam(aMsg, aIter, michael@0: static_cast(aResult)) && michael@0: ReadParam(aMsg, aIter, &aResult->mSeqno) && michael@0: ReadParam(aMsg, aIter, &aResult->data); michael@0: } michael@0: }; michael@0: michael@0: template<> michael@0: struct ParamTraits michael@0: { michael@0: typedef mozilla::WidgetQueryContentEvent paramType; michael@0: michael@0: static void Write(Message* aMsg, const paramType& aParam) michael@0: { michael@0: WriteParam(aMsg, static_cast(aParam)); michael@0: WriteParam(aMsg, aParam.mSucceeded); michael@0: WriteParam(aMsg, aParam.mUseNativeLineBreak); michael@0: WriteParam(aMsg, aParam.mInput.mOffset); michael@0: WriteParam(aMsg, aParam.mInput.mLength); michael@0: WriteParam(aMsg, aParam.mReply.mOffset); michael@0: WriteParam(aMsg, aParam.mReply.mString); michael@0: WriteParam(aMsg, aParam.mReply.mRect); michael@0: WriteParam(aMsg, aParam.mReply.mReversed); michael@0: WriteParam(aMsg, aParam.mReply.mHasSelection); michael@0: WriteParam(aMsg, aParam.mReply.mWidgetIsHit); michael@0: } michael@0: michael@0: static bool Read(const Message* aMsg, void** aIter, paramType* aResult) michael@0: { michael@0: aResult->mWasAsync = true; michael@0: return ReadParam(aMsg, aIter, michael@0: static_cast(aResult)) && michael@0: ReadParam(aMsg, aIter, &aResult->mSucceeded) && michael@0: ReadParam(aMsg, aIter, &aResult->mUseNativeLineBreak) && michael@0: ReadParam(aMsg, aIter, &aResult->mInput.mOffset) && michael@0: ReadParam(aMsg, aIter, &aResult->mInput.mLength) && michael@0: ReadParam(aMsg, aIter, &aResult->mReply.mOffset) && michael@0: ReadParam(aMsg, aIter, &aResult->mReply.mString) && michael@0: ReadParam(aMsg, aIter, &aResult->mReply.mRect) && michael@0: ReadParam(aMsg, aIter, &aResult->mReply.mReversed) && michael@0: ReadParam(aMsg, aIter, &aResult->mReply.mHasSelection) && michael@0: ReadParam(aMsg, aIter, &aResult->mReply.mWidgetIsHit); michael@0: } michael@0: }; michael@0: michael@0: template<> michael@0: struct ParamTraits michael@0: { michael@0: typedef mozilla::WidgetSelectionEvent paramType; michael@0: michael@0: static void Write(Message* aMsg, const paramType& aParam) michael@0: { michael@0: WriteParam(aMsg, static_cast(aParam)); michael@0: WriteParam(aMsg, aParam.mSeqno); michael@0: WriteParam(aMsg, aParam.mOffset); michael@0: WriteParam(aMsg, aParam.mLength); michael@0: WriteParam(aMsg, aParam.mReversed); michael@0: WriteParam(aMsg, aParam.mExpandToClusterBoundary); michael@0: WriteParam(aMsg, aParam.mSucceeded); michael@0: WriteParam(aMsg, aParam.mUseNativeLineBreak); michael@0: } michael@0: michael@0: static bool Read(const Message* aMsg, void** aIter, paramType* aResult) michael@0: { michael@0: return ReadParam(aMsg, aIter, michael@0: static_cast(aResult)) && michael@0: ReadParam(aMsg, aIter, &aResult->mSeqno) && michael@0: ReadParam(aMsg, aIter, &aResult->mOffset) && michael@0: ReadParam(aMsg, aIter, &aResult->mLength) && michael@0: ReadParam(aMsg, aIter, &aResult->mReversed) && michael@0: ReadParam(aMsg, aIter, &aResult->mExpandToClusterBoundary) && michael@0: ReadParam(aMsg, aIter, &aResult->mSucceeded) && michael@0: ReadParam(aMsg, aIter, &aResult->mUseNativeLineBreak); michael@0: } michael@0: }; michael@0: michael@0: template<> michael@0: struct ParamTraits michael@0: { michael@0: typedef nsIMEUpdatePreference paramType; michael@0: michael@0: static void Write(Message* aMsg, const paramType& aParam) michael@0: { michael@0: WriteParam(aMsg, aParam.mWantUpdates); michael@0: } michael@0: michael@0: static bool Read(const Message* aMsg, void** aIter, paramType* aResult) michael@0: { michael@0: return ReadParam(aMsg, aIter, &aResult->mWantUpdates); michael@0: } michael@0: }; michael@0: michael@0: template<> michael@0: struct ParamTraits michael@0: { michael@0: typedef mozilla::WidgetPluginEvent paramType; michael@0: michael@0: static void Write(Message* aMsg, const paramType& aParam) michael@0: { michael@0: WriteParam(aMsg, static_cast(aParam)); michael@0: WriteParam(aMsg, aParam.retargetToFocusedDocument); michael@0: } michael@0: michael@0: static bool Read(const Message* aMsg, void** aIter, paramType* aResult) michael@0: { michael@0: return ReadParam(aMsg, aIter, michael@0: static_cast(aResult)) && michael@0: ReadParam(aMsg, aIter, &aResult->retargetToFocusedDocument); michael@0: } michael@0: }; michael@0: michael@0: } // namespace IPC michael@0: michael@0: #endif // nsGUIEventIPC_h__ michael@0: