2010-08-17 12:07:42 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2010-08-17 12:07:42 +04:00
|
|
|
|
|
|
|
#ifndef nsGUIEventIPC_h__
|
|
|
|
#define nsGUIEventIPC_h__
|
|
|
|
|
2012-08-28 16:41:04 +04:00
|
|
|
#include "ipc/IPCMessageUtils.h"
|
2015-06-05 12:28:19 +03:00
|
|
|
#include "mozilla/ContentCache.h"
|
2013-07-26 23:28:31 +04:00
|
|
|
#include "mozilla/GfxMessageUtils.h"
|
2013-04-05 12:49:00 +04:00
|
|
|
#include "mozilla/dom/Touch.h"
|
2013-09-25 15:21:20 +04:00
|
|
|
#include "mozilla/MiscEvents.h"
|
2013-09-25 15:21:18 +04:00
|
|
|
#include "mozilla/MouseEvents.h"
|
2013-09-25 15:21:19 +04:00
|
|
|
#include "mozilla/TextEvents.h"
|
2013-09-25 15:21:16 +04:00
|
|
|
#include "mozilla/TouchEvents.h"
|
2018-03-16 14:23:53 +03:00
|
|
|
#include "mozilla/WheelHandlingHelper.h" // for WheelDeltaAdjustmentStrategy
|
2017-08-02 00:19:19 +03:00
|
|
|
#include "mozilla/dom/Selection.h"
|
2016-07-20 14:37:00 +03:00
|
|
|
#include "InputData.h"
|
2010-08-17 12:07:42 +04:00
|
|
|
|
|
|
|
namespace IPC {
|
|
|
|
|
2015-08-26 15:56:59 +03:00
|
|
|
template <>
|
2017-12-01 21:00:56 +03:00
|
|
|
struct ParamTraits<mozilla::EventMessage>
|
|
|
|
: public ContiguousEnumSerializer<
|
|
|
|
mozilla::EventMessage, mozilla::EventMessage(0),
|
|
|
|
mozilla::EventMessage::eEventMessage_MaxValue> {};
|
2015-08-26 15:56:59 +03:00
|
|
|
|
2012-12-16 05:26:03 +04:00
|
|
|
template <>
|
2013-09-14 06:39:41 +04:00
|
|
|
struct ParamTraits<mozilla::BaseEventFlags> {
|
|
|
|
typedef mozilla::BaseEventFlags paramType;
|
2012-12-16 05:26:03 +04:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
2012-12-20 07:42:29 +04:00
|
|
|
aMsg->WriteBytes(&aParam, sizeof(aParam));
|
2012-12-16 05:26:03 +04:00
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2016-05-17 00:32:37 +03:00
|
|
|
return aMsg->ReadBytesInto(aIter, aResult, sizeof(*aResult));
|
2012-12-16 05:26:03 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-08-17 12:07:42 +04:00
|
|
|
template <>
|
2013-10-02 07:46:04 +04:00
|
|
|
struct ParamTraits<mozilla::WidgetEvent> {
|
|
|
|
typedef mozilla::WidgetEvent paramType;
|
2010-08-17 12:07:42 +04:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
2017-07-05 12:59:44 +03:00
|
|
|
// Mark the event as posted to another process.
|
|
|
|
const_cast<mozilla::WidgetEvent&>(aParam).MarkAsPostedToRemoteProcess();
|
|
|
|
|
2014-08-04 09:28:46 +04:00
|
|
|
WriteParam(aMsg, static_cast<mozilla::EventClassIDType>(aParam.mClass));
|
2015-08-22 04:34:51 +03:00
|
|
|
WriteParam(aMsg, aParam.mMessage);
|
2016-04-18 17:09:02 +03:00
|
|
|
WriteParam(aMsg, aParam.mRefPoint);
|
2017-06-06 03:45:31 +03:00
|
|
|
WriteParam(aMsg, aParam.mFocusSequenceNumber);
|
2016-03-28 07:29:42 +03:00
|
|
|
WriteParam(aMsg, aParam.mTime);
|
2016-03-28 07:49:02 +03:00
|
|
|
WriteParam(aMsg, aParam.mTimeStamp);
|
2012-12-16 05:26:03 +04:00
|
|
|
WriteParam(aMsg, aParam.mFlags);
|
2010-08-17 12:07:42 +04:00
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2014-08-04 09:28:46 +04:00
|
|
|
mozilla::EventClassIDType eventClassID = 0;
|
|
|
|
bool ret = ReadParam(aMsg, aIter, &eventClassID) &&
|
2015-08-22 04:34:51 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mMessage) &&
|
2016-04-18 17:09:02 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mRefPoint) &&
|
2017-06-06 03:45:31 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mFocusSequenceNumber) &&
|
2016-03-28 07:29:42 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mTime) &&
|
2016-03-28 07:49:02 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mTimeStamp) &&
|
2012-12-16 05:26:03 +04:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mFlags);
|
2014-08-04 09:28:46 +04:00
|
|
|
aResult->mClass = static_cast<mozilla::EventClassID>(eventClassID);
|
2017-07-05 12:59:44 +03:00
|
|
|
if (ret) {
|
|
|
|
// Reset cross process dispatching state here because the event has not
|
|
|
|
// been dispatched to different process from current process.
|
|
|
|
aResult->ResetCrossProcessDispatchingState();
|
|
|
|
}
|
2012-11-20 10:05:56 +04:00
|
|
|
return ret;
|
2010-08-17 12:07:42 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2016-04-05 08:23:13 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::NativeEventData> {
|
|
|
|
typedef mozilla::NativeEventData paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
|
|
|
WriteParam(aMsg, aParam.mBuffer);
|
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2016-04-05 08:23:13 +03:00
|
|
|
return ReadParam(aMsg, aIter, &aResult->mBuffer);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-08-17 12:07:42 +04:00
|
|
|
template <>
|
2013-10-02 07:46:03 +04:00
|
|
|
struct ParamTraits<mozilla::WidgetGUIEvent> {
|
|
|
|
typedef mozilla::WidgetGUIEvent paramType;
|
2010-08-17 12:07:42 +04:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
2017-07-05 12:59:44 +03:00
|
|
|
WriteParam(aMsg, static_cast<const mozilla::WidgetEvent&>(aParam));
|
2016-04-05 08:23:13 +03:00
|
|
|
WriteParam(aMsg, aParam.mPluginEvent);
|
2010-08-17 12:07:42 +04:00
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2014-07-23 23:55:51 +04:00
|
|
|
return ReadParam(aMsg, aIter,
|
|
|
|
static_cast<mozilla::WidgetEvent*>(aResult)) &&
|
2016-04-05 08:23:13 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mPluginEvent);
|
2010-08-17 12:07:42 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <>
|
2013-10-01 11:23:02 +04:00
|
|
|
struct ParamTraits<mozilla::WidgetInputEvent> {
|
|
|
|
typedef mozilla::WidgetInputEvent paramType;
|
2010-08-17 12:07:42 +04:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
2017-07-05 12:59:44 +03:00
|
|
|
WriteParam(aMsg, static_cast<const mozilla::WidgetGUIEvent&>(aParam));
|
2016-03-31 11:03:00 +03:00
|
|
|
WriteParam(aMsg, aParam.mModifiers);
|
2010-08-17 12:07:42 +04:00
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2013-10-02 07:46:03 +04:00
|
|
|
return ReadParam(aMsg, aIter,
|
|
|
|
static_cast<mozilla::WidgetGUIEvent*>(aResult)) &&
|
2016-03-31 11:03:00 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mModifiers);
|
2010-08-17 12:07:42 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2011-05-17 04:23:23 +04:00
|
|
|
template <>
|
2013-10-01 11:23:02 +04:00
|
|
|
struct ParamTraits<mozilla::WidgetMouseEventBase> {
|
|
|
|
typedef mozilla::WidgetMouseEventBase paramType;
|
2011-05-17 04:23:23 +04:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
2017-07-05 12:59:44 +03:00
|
|
|
WriteParam(aMsg, static_cast<const mozilla::WidgetInputEvent&>(aParam));
|
2011-05-17 04:23:23 +04:00
|
|
|
WriteParam(aMsg, aParam.button);
|
2012-04-25 07:00:01 +04:00
|
|
|
WriteParam(aMsg, aParam.buttons);
|
2011-05-17 04:23:23 +04:00
|
|
|
WriteParam(aMsg, aParam.pressure);
|
2015-03-07 00:45:59 +03:00
|
|
|
WriteParam(aMsg, aParam.hitCluster);
|
2011-05-17 04:23:23 +04:00
|
|
|
WriteParam(aMsg, aParam.inputSource);
|
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2013-10-01 11:23:02 +04:00
|
|
|
return ReadParam(aMsg, aIter,
|
|
|
|
static_cast<mozilla::WidgetInputEvent*>(aResult)) &&
|
2011-05-17 04:23:23 +04:00
|
|
|
ReadParam(aMsg, aIter, &aResult->button) &&
|
2012-04-25 07:00:01 +04:00
|
|
|
ReadParam(aMsg, aIter, &aResult->buttons) &&
|
2011-05-17 04:23:23 +04:00
|
|
|
ReadParam(aMsg, aIter, &aResult->pressure) &&
|
2015-03-07 00:45:59 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->hitCluster) &&
|
2011-05-17 04:23:23 +04:00
|
|
|
ReadParam(aMsg, aIter, &aResult->inputSource);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-08-12 05:42:34 +04:00
|
|
|
template <>
|
2013-10-16 13:37:36 +04:00
|
|
|
struct ParamTraits<mozilla::WidgetWheelEvent> {
|
|
|
|
typedef mozilla::WidgetWheelEvent paramType;
|
2012-08-12 05:42:34 +04:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
2017-07-05 12:59:44 +03:00
|
|
|
WriteParam(aMsg, static_cast<const mozilla::WidgetMouseEventBase&>(aParam));
|
2016-03-31 12:55:59 +03:00
|
|
|
WriteParam(aMsg, aParam.mDeltaX);
|
2016-03-31 12:09:47 +03:00
|
|
|
WriteParam(aMsg, aParam.mDeltaY);
|
2016-03-31 12:18:34 +03:00
|
|
|
WriteParam(aMsg, aParam.mDeltaZ);
|
2016-03-31 12:35:24 +03:00
|
|
|
WriteParam(aMsg, aParam.mDeltaMode);
|
2016-03-31 12:44:01 +03:00
|
|
|
WriteParam(aMsg, aParam.mCustomizedByUserPrefs);
|
2016-03-31 17:36:49 +03:00
|
|
|
WriteParam(aMsg, aParam.mMayHaveMomentum);
|
2016-03-31 17:45:55 +03:00
|
|
|
WriteParam(aMsg, aParam.mIsMomentum);
|
2014-07-07 13:54:14 +04:00
|
|
|
WriteParam(aMsg, aParam.mIsNoLineOrPageDelta);
|
2016-03-31 18:10:46 +03:00
|
|
|
WriteParam(aMsg, aParam.mLineOrPageDeltaX);
|
2016-03-31 18:10:09 +03:00
|
|
|
WriteParam(aMsg, aParam.mLineOrPageDeltaY);
|
2016-03-31 18:46:18 +03:00
|
|
|
WriteParam(aMsg, static_cast<uint8_t>(aParam.mScrollType));
|
2016-03-31 18:27:45 +03:00
|
|
|
WriteParam(aMsg, aParam.mOverflowDeltaX);
|
2016-03-31 18:36:55 +03:00
|
|
|
WriteParam(aMsg, aParam.mOverflowDeltaY);
|
2015-03-07 00:45:59 +03:00
|
|
|
WriteParam(aMsg, aParam.mViewPortIsOverscrolled);
|
2015-08-28 06:50:31 +03:00
|
|
|
WriteParam(aMsg, aParam.mCanTriggerSwipe);
|
2016-01-27 09:09:13 +03:00
|
|
|
WriteParam(aMsg, aParam.mAllowToOverrideSystemScrollSpeed);
|
2018-03-15 11:31:07 +03:00
|
|
|
WriteParam(aMsg, aParam.mDeltaValuesHorizontalizedForDefaultHandler);
|
2012-08-12 05:42:34 +04:00
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2016-03-31 18:46:18 +03:00
|
|
|
uint8_t scrollType = 0;
|
2012-08-12 05:42:36 +04:00
|
|
|
bool rv =
|
2013-10-01 11:23:02 +04:00
|
|
|
ReadParam(aMsg, aIter,
|
|
|
|
static_cast<mozilla::WidgetMouseEventBase*>(aResult)) &&
|
2016-03-31 12:55:59 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mDeltaX) &&
|
2016-03-31 12:09:47 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mDeltaY) &&
|
2016-03-31 12:18:34 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mDeltaZ) &&
|
2016-03-31 12:35:24 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mDeltaMode) &&
|
2016-03-31 12:44:01 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mCustomizedByUserPrefs) &&
|
2016-03-31 17:36:49 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mMayHaveMomentum) &&
|
2016-03-31 17:45:55 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mIsMomentum) &&
|
2014-07-07 13:54:14 +04:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mIsNoLineOrPageDelta) &&
|
2016-03-31 18:10:46 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mLineOrPageDeltaX) &&
|
2016-03-31 18:10:09 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mLineOrPageDeltaY) &&
|
2012-08-12 05:42:36 +04:00
|
|
|
ReadParam(aMsg, aIter, &scrollType) &&
|
2016-03-31 18:27:45 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mOverflowDeltaX) &&
|
2016-03-31 18:36:55 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mOverflowDeltaY) &&
|
2015-08-28 06:50:31 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mViewPortIsOverscrolled) &&
|
2016-01-27 09:09:13 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mCanTriggerSwipe) &&
|
Bug 143038 Make users can scroll contents horizontally with vertical wheel operation with a modifier r=smaug
This patch declares a new default action, "horizontal scroll", this scrolls
content horizontally with deltaY of wheel events and ignores deltaX and deltaZ.
This is used for default action with Shift key in default setting except on
macOS. On macOS, legacy mouse's vertical wheel operation with Shift key causes
native horizontal wheel event. Therefore, we don't need to use this new
default action on macOS. Additionally, old default action with Shift key,
navigating history, is moved to with Alt key. This makes same settings between
macOS and the others. So, this is better for users who use macOS and another
OS and web app developers who check wheel events only on macOS or other
platform(s).
For simpler implementation, default action handlers moves deltaY values to
deltaX values temporarily *only* while they handle wheel events. This is
performed by AutoWheelDeltaAdjuster and restored after handling it
automatically.
So, in other words, even if default action is "horizontal scroll", web apps
receives wheel events whose deltaY is not zero but its content will be
scrolled horizontally. This is same as Chromium, so, this behavior shouldn't
cause any incompatible behavior with it.
MozReview-Commit-ID: E4X3yZzLEAl
--HG--
extra : rebase_source : e20d854c6b0a181ad4c9e7304bd9ad14256481ff
2017-10-04 19:12:35 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mAllowToOverrideSystemScrollSpeed) &&
|
2018-03-15 11:31:07 +03:00
|
|
|
ReadParam(aMsg, aIter,
|
|
|
|
&aResult->mDeltaValuesHorizontalizedForDefaultHandler);
|
2016-03-31 17:54:42 +03:00
|
|
|
aResult->mScrollType =
|
2013-10-16 13:37:36 +04:00
|
|
|
static_cast<mozilla::WidgetWheelEvent::ScrollType>(scrollType);
|
2012-08-12 05:42:36 +04:00
|
|
|
return rv;
|
2012-08-12 05:42:34 +04:00
|
|
|
}
|
|
|
|
};
|
2011-06-22 04:32:43 +04:00
|
|
|
|
2016-11-20 04:49:00 +03:00
|
|
|
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);
|
2017-02-09 05:49:00 +03:00
|
|
|
WriteParam(aMsg, aParam.twist);
|
|
|
|
WriteParam(aMsg, aParam.tangentialPressure);
|
2017-01-18 10:25:44 +03:00
|
|
|
// We don't serialize convertToPointer since it's temporarily variable and
|
|
|
|
// should be reset to default.
|
2016-11-20 04:49:00 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
|
|
|
bool rv;
|
|
|
|
rv = ReadParam(aMsg, aIter, &aResult->pointerId) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->tiltX) &&
|
2017-02-09 05:49:00 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->tiltY) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->twist) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->tangentialPressure);
|
2016-11-20 04:49:00 +03:00
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2011-06-22 04:32:43 +04:00
|
|
|
template <>
|
2013-10-02 10:38:27 +04:00
|
|
|
struct ParamTraits<mozilla::WidgetMouseEvent> {
|
|
|
|
typedef mozilla::WidgetMouseEvent paramType;
|
2011-06-22 04:32:43 +04:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
2017-07-05 12:59:44 +03:00
|
|
|
WriteParam(aMsg, static_cast<const mozilla::WidgetMouseEventBase&>(aParam));
|
2017-09-21 11:17:30 +03:00
|
|
|
WriteParam(aMsg, static_cast<const mozilla::WidgetPointerHelper&>(aParam));
|
2016-05-10 15:15:05 +03:00
|
|
|
WriteParam(aMsg, aParam.mIgnoreRootScrollFrame);
|
2016-05-12 05:36:41 +03:00
|
|
|
WriteParam(aMsg, static_cast<paramType::ReasonType>(aParam.mReason));
|
2016-05-12 05:39:05 +03:00
|
|
|
WriteParam(aMsg, static_cast<paramType::ContextMenuTriggerType>(
|
|
|
|
aParam.mContextMenuTrigger));
|
2016-05-12 05:42:08 +03:00
|
|
|
WriteParam(aMsg, static_cast<paramType::ExitFromType>(aParam.mExitFrom));
|
2016-05-10 17:29:14 +03:00
|
|
|
WriteParam(aMsg, aParam.mClickCount);
|
2011-06-22 04:32:43 +04:00
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2011-06-22 04:32:43 +04:00
|
|
|
bool rv;
|
2016-05-12 05:17:46 +03:00
|
|
|
paramType::ReasonType reason = 0;
|
2016-05-12 05:28:14 +03:00
|
|
|
paramType::ContextMenuTriggerType contextMenuTrigger = 0;
|
2016-05-12 05:32:53 +03:00
|
|
|
paramType::ExitFromType exitFrom = 0;
|
2013-10-01 11:23:02 +04:00
|
|
|
rv = ReadParam(aMsg, aIter,
|
|
|
|
static_cast<mozilla::WidgetMouseEventBase*>(aResult)) &&
|
2016-11-20 04:49:00 +03:00
|
|
|
ReadParam(aMsg, aIter,
|
|
|
|
static_cast<mozilla::WidgetPointerHelper*>(aResult)) &&
|
2016-05-10 15:15:05 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mIgnoreRootScrollFrame) &&
|
2011-06-22 04:32:43 +04:00
|
|
|
ReadParam(aMsg, aIter, &reason) &&
|
2016-05-12 05:28:14 +03:00
|
|
|
ReadParam(aMsg, aIter, &contextMenuTrigger) &&
|
2016-05-12 05:32:53 +03:00
|
|
|
ReadParam(aMsg, aIter, &exitFrom) &&
|
2016-11-20 04:49:00 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mClickCount);
|
2016-05-12 05:36:41 +03:00
|
|
|
aResult->mReason = static_cast<paramType::Reason>(reason);
|
2016-05-12 05:39:05 +03:00
|
|
|
aResult->mContextMenuTrigger =
|
2016-05-12 05:28:14 +03:00
|
|
|
static_cast<paramType::ContextMenuTrigger>(contextMenuTrigger);
|
2016-05-12 05:42:08 +03:00
|
|
|
aResult->mExitFrom = static_cast<paramType::ExitFrom>(exitFrom);
|
2011-06-22 04:32:43 +04:00
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-04-08 21:48:11 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::WidgetDragEvent> {
|
|
|
|
typedef mozilla::WidgetDragEvent paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
2017-07-05 12:59:44 +03:00
|
|
|
WriteParam(aMsg, static_cast<const mozilla::WidgetMouseEvent&>(aParam));
|
2016-03-31 13:06:05 +03:00
|
|
|
WriteParam(aMsg, aParam.mUserCancelled);
|
2015-04-08 21:48:11 +03:00
|
|
|
WriteParam(aMsg, aParam.mDefaultPreventedOnContent);
|
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2015-04-08 21:48:11 +03:00
|
|
|
bool rv = ReadParam(aMsg, aIter,
|
|
|
|
static_cast<mozilla::WidgetMouseEvent*>(aResult)) &&
|
2016-03-31 13:06:05 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mUserCancelled) &&
|
2015-04-08 21:48:11 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mDefaultPreventedOnContent);
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2013-11-21 09:44:22 +04:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::WidgetPointerEvent> {
|
|
|
|
typedef mozilla::WidgetPointerEvent paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
2017-07-05 12:59:44 +03:00
|
|
|
WriteParam(aMsg, static_cast<const mozilla::WidgetMouseEvent&>(aParam));
|
2016-08-03 11:18:04 +03:00
|
|
|
WriteParam(aMsg, aParam.mWidth);
|
2016-08-03 11:23:56 +03:00
|
|
|
WriteParam(aMsg, aParam.mHeight);
|
2016-08-03 11:34:53 +03:00
|
|
|
WriteParam(aMsg, aParam.mIsPrimary);
|
2013-11-21 09:44:22 +04:00
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2013-11-21 09:44:22 +04:00
|
|
|
bool rv = ReadParam(aMsg, aIter,
|
|
|
|
static_cast<mozilla::WidgetMouseEvent*>(aResult)) &&
|
2016-08-03 11:18:04 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mWidth) &&
|
2016-08-03 11:23:56 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mHeight) &&
|
2016-08-03 11:34:53 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mIsPrimary);
|
2013-11-21 09:44:22 +04:00
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-07-16 06:58:43 +04:00
|
|
|
template <>
|
2013-09-27 10:20:57 +04:00
|
|
|
struct ParamTraits<mozilla::WidgetTouchEvent> {
|
|
|
|
typedef mozilla::WidgetTouchEvent paramType;
|
2012-07-16 06:58:43 +04:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
2013-10-01 11:23:02 +04:00
|
|
|
WriteParam(aMsg, static_cast<const mozilla::WidgetInputEvent&>(aParam));
|
2013-04-05 12:49:00 +04:00
|
|
|
// Sigh, Touch bites us again! We want to be able to do
|
2016-03-30 12:44:28 +03:00
|
|
|
// WriteParam(aMsg, aParam.mTouches);
|
|
|
|
const paramType::TouchArray& touches = aParam.mTouches;
|
2012-07-16 06:58:43 +04:00
|
|
|
WriteParam(aMsg, touches.Length());
|
|
|
|
for (uint32_t i = 0; i < touches.Length(); ++i) {
|
2013-07-10 13:53:09 +04:00
|
|
|
mozilla::dom::Touch* touch = touches[i];
|
2012-07-16 06:58:43 +04:00
|
|
|
WriteParam(aMsg, touch->mIdentifier);
|
|
|
|
WriteParam(aMsg, touch->mRefPoint);
|
|
|
|
WriteParam(aMsg, touch->mRadius);
|
|
|
|
WriteParam(aMsg, touch->mRotationAngle);
|
|
|
|
WriteParam(aMsg, touch->mForce);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2014-07-09 00:48:18 +04:00
|
|
|
paramType::TouchArray::size_type numTouches;
|
2013-10-01 11:23:02 +04:00
|
|
|
if (!ReadParam(aMsg, aIter,
|
|
|
|
static_cast<mozilla::WidgetInputEvent*>(aResult)) ||
|
2012-07-16 06:58:43 +04:00
|
|
|
!ReadParam(aMsg, aIter, &numTouches)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
for (uint32_t i = 0; i < numTouches; ++i) {
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t identifier;
|
2013-08-02 11:05:16 +04:00
|
|
|
mozilla::LayoutDeviceIntPoint refPoint;
|
2015-11-10 08:37:31 +03:00
|
|
|
mozilla::LayoutDeviceIntPoint radius;
|
2012-07-16 06:58:43 +04:00
|
|
|
float rotationAngle;
|
|
|
|
float force;
|
|
|
|
if (!ReadParam(aMsg, aIter, &identifier) ||
|
|
|
|
!ReadParam(aMsg, aIter, &refPoint) ||
|
|
|
|
!ReadParam(aMsg, aIter, &radius) ||
|
|
|
|
!ReadParam(aMsg, aIter, &rotationAngle) ||
|
|
|
|
!ReadParam(aMsg, aIter, &force)) {
|
|
|
|
return false;
|
|
|
|
}
|
2016-03-30 12:44:28 +03:00
|
|
|
aResult->mTouches.AppendElement(new mozilla::dom::Touch(
|
2015-02-02 01:27:31 +03:00
|
|
|
identifier, refPoint, radius, rotationAngle, force));
|
2012-07-16 06:58:43 +04:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-07-23 15:05:45 +04:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::AlternativeCharCode> {
|
|
|
|
typedef mozilla::AlternativeCharCode paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
|
|
|
WriteParam(aMsg, aParam.mUnshiftedCharCode);
|
|
|
|
WriteParam(aMsg, aParam.mShiftedCharCode);
|
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2014-07-23 15:05:45 +04:00
|
|
|
return ReadParam(aMsg, aIter, &aResult->mUnshiftedCharCode) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mShiftedCharCode);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2017-06-06 02:09:40 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::ShortcutKeyCandidate> {
|
|
|
|
typedef mozilla::ShortcutKeyCandidate paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
|
|
|
WriteParam(aMsg, aParam.mCharCode);
|
|
|
|
WriteParam(aMsg, aParam.mIgnoreShift);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
|
|
|
return ReadParam(aMsg, aIter, &aResult->mCharCode) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mIgnoreShift);
|
|
|
|
}
|
|
|
|
};
|
2014-07-23 15:05:45 +04:00
|
|
|
|
2011-06-22 04:32:43 +04:00
|
|
|
template <>
|
2013-10-01 11:22:58 +04:00
|
|
|
struct ParamTraits<mozilla::WidgetKeyboardEvent> {
|
|
|
|
typedef mozilla::WidgetKeyboardEvent paramType;
|
2011-06-22 04:32:43 +04:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
2017-07-05 12:59:44 +03:00
|
|
|
WriteParam(aMsg, static_cast<const mozilla::WidgetInputEvent&>(aParam));
|
2016-05-12 13:18:36 +03:00
|
|
|
WriteParam(aMsg,
|
|
|
|
static_cast<mozilla::KeyNameIndexType>(aParam.mKeyNameIndex));
|
|
|
|
WriteParam(aMsg,
|
|
|
|
static_cast<mozilla::CodeNameIndexType>(aParam.mCodeNameIndex));
|
2013-12-10 20:14:53 +04:00
|
|
|
WriteParam(aMsg, aParam.mKeyValue);
|
2014-05-25 06:08:58 +04:00
|
|
|
WriteParam(aMsg, aParam.mCodeValue);
|
2016-05-12 11:13:49 +03:00
|
|
|
WriteParam(aMsg, aParam.mKeyCode);
|
2016-05-13 10:06:18 +03:00
|
|
|
WriteParam(aMsg, aParam.mCharCode);
|
2016-03-19 14:57:11 +03:00
|
|
|
WriteParam(aMsg, aParam.mPseudoCharCode);
|
2016-05-12 11:57:21 +03:00
|
|
|
WriteParam(aMsg, aParam.mAlternativeCharCodes);
|
2013-11-07 15:17:32 +04:00
|
|
|
WriteParam(aMsg, aParam.mIsRepeat);
|
2016-05-12 12:17:22 +03:00
|
|
|
WriteParam(aMsg, aParam.mLocation);
|
2013-09-06 17:11:15 +04:00
|
|
|
WriteParam(aMsg, aParam.mUniqueId);
|
2016-03-15 08:50:16 +03:00
|
|
|
WriteParam(aMsg, aParam.mIsSynthesizedByTIP);
|
Bug 1441821 - NativeKey shouldn't mark eKeyDown and eKeyPress as "skippable in remote process" if message is not caused by physical key press r=m_kato,smaug
Currently, TabChild discards eKeyDown and eKeyPress events which are marked as
"repeated" and were dispatched after the latest eKeyDown event comes into the
process. However, keyboard layout utils may generate native key events
as "repeated" even if each native key is important to input proper text.
So, TabChild shouldn't decide if coming keyboard event is skippable only with
mIsRepeat. For solving this issue, this patch adds
mMaybeSkippableInRemoteProcess to WidgetKeyboardEvent and makes
TabChild::SkipRepeatedKeyEvent() check
WidgetKeyboardEvent::CanSkipInRemoteProcess() instead.
On Windows, there are two ways to generate keyboard input messages. One is
using SendMessage() or PostMessage(). The other is SendInput() API. In both
ways, utils can make their input as repeated key messages.
The former case must be safe for this issue since such utils need to set 31st
bit of lParam to 1 explicitly.
On the other hand, in the latter case, the utils probably need to append
KEYEVENTF_KEYUP into KEYBDINPUT::dwFlags. Otherwise, only first call is
treated as non-repeated event.
So, when given message does not came from physical key operation, NativeKey
should set WidgetKeyboardEvent::mMaybeSkippableInRemoteProcess to false
even if WidgetKeyboardEvent::mIsRepeat is true.
MozReview-Commit-ID: 3rinrOjx8Tf
--HG--
extra : rebase_source : 26b6d869260176fc7ef535323b83001bb4b725c2
2018-06-06 17:35:16 +03:00
|
|
|
WriteParam(aMsg, aParam.mMaybeSkippableInRemoteProcess);
|
2014-12-11 17:44:07 +03:00
|
|
|
#ifdef XP_MACOSX
|
|
|
|
WriteParam(aMsg, aParam.mNativeKeyCode);
|
|
|
|
WriteParam(aMsg, aParam.mNativeModifierFlags);
|
|
|
|
WriteParam(aMsg, aParam.mNativeCharacters);
|
|
|
|
WriteParam(aMsg, aParam.mNativeCharactersIgnoringModifiers);
|
2015-02-20 19:37:02 +03:00
|
|
|
WriteParam(aMsg, aParam.mPluginTextEventString);
|
2014-12-11 17:44:07 +03:00
|
|
|
#endif
|
2017-05-19 11:24:20 +03:00
|
|
|
|
2013-07-10 07:42:59 +04:00
|
|
|
// An OS-specific native event might be attached in |mNativeKeyEvent|, but
|
|
|
|
// that cannot be copied across process boundaries.
|
2017-05-19 11:24:20 +03:00
|
|
|
|
|
|
|
WriteParam(aMsg, aParam.mEditCommandsForSingleLineEditor);
|
|
|
|
WriteParam(aMsg, aParam.mEditCommandsForMultiLineEditor);
|
|
|
|
WriteParam(aMsg, aParam.mEditCommandsForRichTextEditor);
|
|
|
|
WriteParam(aMsg, aParam.mEditCommandsForSingleLineEditorInitialized);
|
|
|
|
WriteParam(aMsg, aParam.mEditCommandsForMultiLineEditorInitialized);
|
|
|
|
WriteParam(aMsg, aParam.mEditCommandsForRichTextEditorInitialized);
|
2011-06-22 04:32:43 +04:00
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2016-05-12 13:18:36 +03:00
|
|
|
mozilla::KeyNameIndexType keyNameIndex = 0;
|
|
|
|
mozilla::CodeNameIndexType codeNameIndex = 0;
|
2013-10-01 11:23:02 +04:00
|
|
|
if (ReadParam(aMsg, aIter,
|
|
|
|
static_cast<mozilla::WidgetInputEvent*>(aResult)) &&
|
2013-04-26 11:41:27 +04:00
|
|
|
ReadParam(aMsg, aIter, &keyNameIndex) &&
|
2014-05-25 06:08:58 +04:00
|
|
|
ReadParam(aMsg, aIter, &codeNameIndex) &&
|
2013-12-10 20:14:53 +04:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mKeyValue) &&
|
2014-05-25 06:08:58 +04:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mCodeValue) &&
|
2016-05-12 11:13:49 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mKeyCode) &&
|
2016-05-13 10:06:18 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mCharCode) &&
|
2016-03-19 14:57:11 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mPseudoCharCode) &&
|
2016-05-12 11:57:21 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mAlternativeCharCodes) &&
|
2013-11-07 15:17:32 +04:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mIsRepeat) &&
|
2016-05-12 12:17:22 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mLocation) &&
|
2016-03-15 08:50:16 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mUniqueId) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mIsSynthesizedByTIP) &&
|
Bug 1441821 - NativeKey shouldn't mark eKeyDown and eKeyPress as "skippable in remote process" if message is not caused by physical key press r=m_kato,smaug
Currently, TabChild discards eKeyDown and eKeyPress events which are marked as
"repeated" and were dispatched after the latest eKeyDown event comes into the
process. However, keyboard layout utils may generate native key events
as "repeated" even if each native key is important to input proper text.
So, TabChild shouldn't decide if coming keyboard event is skippable only with
mIsRepeat. For solving this issue, this patch adds
mMaybeSkippableInRemoteProcess to WidgetKeyboardEvent and makes
TabChild::SkipRepeatedKeyEvent() check
WidgetKeyboardEvent::CanSkipInRemoteProcess() instead.
On Windows, there are two ways to generate keyboard input messages. One is
using SendMessage() or PostMessage(). The other is SendInput() API. In both
ways, utils can make their input as repeated key messages.
The former case must be safe for this issue since such utils need to set 31st
bit of lParam to 1 explicitly.
On the other hand, in the latter case, the utils probably need to append
KEYEVENTF_KEYUP into KEYBDINPUT::dwFlags. Otherwise, only first call is
treated as non-repeated event.
So, when given message does not came from physical key operation, NativeKey
should set WidgetKeyboardEvent::mMaybeSkippableInRemoteProcess to false
even if WidgetKeyboardEvent::mIsRepeat is true.
MozReview-Commit-ID: 3rinrOjx8Tf
--HG--
extra : rebase_source : 26b6d869260176fc7ef535323b83001bb4b725c2
2018-06-06 17:35:16 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mMaybeSkippableInRemoteProcess) &&
|
2014-12-11 17:44:07 +03:00
|
|
|
#ifdef XP_MACOSX
|
2017-05-19 11:24:20 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mNativeKeyCode) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mNativeModifierFlags) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mNativeCharacters) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mNativeCharactersIgnoringModifiers) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mPluginTextEventString) &&
|
2014-12-11 17:44:07 +03:00
|
|
|
#endif
|
2017-05-19 11:24:20 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mEditCommandsForSingleLineEditor) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mEditCommandsForMultiLineEditor) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mEditCommandsForRichTextEditor) &&
|
|
|
|
ReadParam(aMsg, aIter,
|
|
|
|
&aResult->mEditCommandsForSingleLineEditorInitialized) &&
|
|
|
|
ReadParam(aMsg, aIter,
|
|
|
|
&aResult->mEditCommandsForMultiLineEditorInitialized) &&
|
|
|
|
ReadParam(aMsg, aIter,
|
|
|
|
&aResult->mEditCommandsForRichTextEditorInitialized)) {
|
2013-09-14 06:39:41 +04:00
|
|
|
aResult->mKeyNameIndex = static_cast<mozilla::KeyNameIndex>(keyNameIndex);
|
2014-05-25 06:08:58 +04:00
|
|
|
aResult->mCodeNameIndex =
|
|
|
|
static_cast<mozilla::CodeNameIndex>(codeNameIndex);
|
2013-10-28 18:05:51 +04:00
|
|
|
aResult->mNativeKeyEvent = nullptr;
|
2013-04-26 11:41:27 +04:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
2011-06-22 04:32:43 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-08-17 12:07:42 +04:00
|
|
|
template <>
|
2013-10-01 11:22:59 +04:00
|
|
|
struct ParamTraits<mozilla::TextRangeStyle> {
|
|
|
|
typedef mozilla::TextRangeStyle paramType;
|
2010-08-17 12:07:42 +04:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
|
|
|
WriteParam(aMsg, aParam.mDefinedStyles);
|
|
|
|
WriteParam(aMsg, aParam.mLineStyle);
|
|
|
|
WriteParam(aMsg, aParam.mIsBoldLine);
|
|
|
|
WriteParam(aMsg, aParam.mForegroundColor);
|
|
|
|
WriteParam(aMsg, aParam.mBackgroundColor);
|
|
|
|
WriteParam(aMsg, aParam.mUnderlineColor);
|
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2010-08-17 12:07:42 +04:00
|
|
|
return ReadParam(aMsg, aIter, &aResult->mDefinedStyles) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mLineStyle) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mIsBoldLine) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mForegroundColor) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mBackgroundColor) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mUnderlineColor);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <>
|
2013-10-01 11:22:59 +04:00
|
|
|
struct ParamTraits<mozilla::TextRange> {
|
|
|
|
typedef mozilla::TextRange paramType;
|
2010-08-17 12:07:42 +04:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
|
|
|
WriteParam(aMsg, aParam.mStartOffset);
|
|
|
|
WriteParam(aMsg, aParam.mEndOffset);
|
2016-06-04 03:49:21 +03:00
|
|
|
WriteParam(aMsg, mozilla::ToRawTextRangeType(aParam.mRangeType));
|
2010-08-17 12:07:42 +04:00
|
|
|
WriteParam(aMsg, aParam.mRangeStyle);
|
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2016-06-04 03:49:21 +03:00
|
|
|
mozilla::RawTextRangeType rawTextRangeType;
|
|
|
|
if (ReadParam(aMsg, aIter, &aResult->mStartOffset) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mEndOffset) &&
|
|
|
|
ReadParam(aMsg, aIter, &rawTextRangeType) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mRangeStyle)) {
|
|
|
|
aResult->mRangeType = mozilla::ToTextRangeType(rawTextRangeType);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
2010-08-17 12:07:42 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-03-04 17:48:26 +04:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::TextRangeArray> {
|
|
|
|
typedef mozilla::TextRangeArray paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
|
|
|
WriteParam(aMsg, aParam.Length());
|
|
|
|
for (uint32_t index = 0; index < aParam.Length(); index++) {
|
|
|
|
WriteParam(aMsg, aParam[index]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2014-07-09 00:48:18 +04:00
|
|
|
paramType::size_type length;
|
2014-03-04 17:48:26 +04:00
|
|
|
if (!ReadParam(aMsg, aIter, &length)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
for (uint32_t index = 0; index < length; index++) {
|
|
|
|
mozilla::TextRange textRange;
|
|
|
|
if (!ReadParam(aMsg, aIter, &textRange)) {
|
|
|
|
aResult->Clear();
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
aResult->AppendElement(textRange);
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-08-17 12:07:42 +04:00
|
|
|
template <>
|
2013-10-01 11:23:00 +04:00
|
|
|
struct ParamTraits<mozilla::WidgetCompositionEvent> {
|
|
|
|
typedef mozilla::WidgetCompositionEvent paramType;
|
2010-08-17 12:07:42 +04:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
2017-07-05 12:59:44 +03:00
|
|
|
WriteParam(aMsg, static_cast<const mozilla::WidgetGUIEvent&>(aParam));
|
2014-10-07 14:01:46 +04:00
|
|
|
WriteParam(aMsg, aParam.mData);
|
2015-12-11 09:15:57 +03:00
|
|
|
WriteParam(aMsg, aParam.mNativeIMEContext);
|
2014-10-07 14:01:47 +04:00
|
|
|
bool hasRanges = !!aParam.mRanges;
|
|
|
|
WriteParam(aMsg, hasRanges);
|
|
|
|
if (hasRanges) {
|
|
|
|
WriteParam(aMsg, *aParam.mRanges.get());
|
|
|
|
}
|
2010-08-17 12:07:42 +04:00
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2014-10-07 14:01:47 +04:00
|
|
|
bool hasRanges;
|
|
|
|
if (!ReadParam(aMsg, aIter,
|
|
|
|
static_cast<mozilla::WidgetGUIEvent*>(aResult)) ||
|
|
|
|
!ReadParam(aMsg, aIter, &aResult->mData) ||
|
2015-12-11 09:15:57 +03:00
|
|
|
!ReadParam(aMsg, aIter, &aResult->mNativeIMEContext) ||
|
2014-10-07 14:01:47 +04:00
|
|
|
!ReadParam(aMsg, aIter, &hasRanges)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!hasRanges) {
|
|
|
|
aResult->mRanges = nullptr;
|
|
|
|
} else {
|
|
|
|
aResult->mRanges = new mozilla::TextRangeArray();
|
|
|
|
if (!ReadParam(aMsg, aIter, aResult->mRanges.get())) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
2010-08-17 12:07:42 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-01-31 10:17:12 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::FontRange> {
|
|
|
|
typedef mozilla::FontRange paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
|
|
|
WriteParam(aMsg, aParam.mStartOffset);
|
|
|
|
WriteParam(aMsg, aParam.mFontName);
|
|
|
|
WriteParam(aMsg, aParam.mFontSize);
|
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2015-01-31 10:17:12 +03:00
|
|
|
return ReadParam(aMsg, aIter, &aResult->mStartOffset) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mFontName) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mFontSize);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2016-06-21 07:13:11 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::WidgetQueryContentEvent::Input> {
|
|
|
|
typedef mozilla::WidgetQueryContentEvent::Input paramType;
|
|
|
|
typedef mozilla::WidgetQueryContentEvent event;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
|
|
|
WriteParam(aMsg, aParam.mOffset);
|
|
|
|
WriteParam(aMsg, aParam.mLength);
|
|
|
|
WriteParam(aMsg, mozilla::ToRawSelectionType(aParam.mSelectionType));
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
|
|
|
mozilla::RawSelectionType rawSelectionType = 0;
|
|
|
|
bool ok = ReadParam(aMsg, aIter, &aResult->mOffset) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mLength) &&
|
|
|
|
ReadParam(aMsg, aIter, &rawSelectionType);
|
|
|
|
aResult->mSelectionType = mozilla::ToSelectionType(rawSelectionType);
|
|
|
|
return ok;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-08-17 12:07:42 +04:00
|
|
|
template <>
|
2013-10-01 11:23:00 +04:00
|
|
|
struct ParamTraits<mozilla::WidgetQueryContentEvent> {
|
|
|
|
typedef mozilla::WidgetQueryContentEvent paramType;
|
2010-08-17 12:07:42 +04:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
2017-07-05 12:59:44 +03:00
|
|
|
WriteParam(aMsg, static_cast<const mozilla::WidgetGUIEvent&>(aParam));
|
2010-08-17 12:07:42 +04:00
|
|
|
WriteParam(aMsg, aParam.mSucceeded);
|
2014-04-26 03:52:12 +04:00
|
|
|
WriteParam(aMsg, aParam.mUseNativeLineBreak);
|
2015-01-31 10:17:12 +03:00
|
|
|
WriteParam(aMsg, aParam.mWithFontRanges);
|
2016-06-21 07:13:11 +03:00
|
|
|
WriteParam(aMsg, aParam.mInput);
|
2010-08-17 12:07:42 +04:00
|
|
|
WriteParam(aMsg, aParam.mReply.mOffset);
|
2015-04-14 08:27:37 +03:00
|
|
|
WriteParam(aMsg, aParam.mReply.mTentativeCaretOffset);
|
2010-08-17 12:07:42 +04:00
|
|
|
WriteParam(aMsg, aParam.mReply.mString);
|
|
|
|
WriteParam(aMsg, aParam.mReply.mRect);
|
|
|
|
WriteParam(aMsg, aParam.mReply.mReversed);
|
|
|
|
WriteParam(aMsg, aParam.mReply.mHasSelection);
|
2011-03-02 00:15:23 +03:00
|
|
|
WriteParam(aMsg, aParam.mReply.mWidgetIsHit);
|
2015-01-31 10:17:12 +03:00
|
|
|
WriteParam(aMsg, aParam.mReply.mFontRanges);
|
2010-08-17 12:07:42 +04:00
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2013-10-02 07:46:03 +04:00
|
|
|
return ReadParam(aMsg, aIter,
|
|
|
|
static_cast<mozilla::WidgetGUIEvent*>(aResult)) &&
|
2010-08-17 12:07:42 +04:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mSucceeded) &&
|
2014-04-26 03:52:12 +04:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mUseNativeLineBreak) &&
|
2015-01-31 10:17:12 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mWithFontRanges) &&
|
2016-06-21 07:13:11 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mInput) &&
|
2010-08-17 12:07:42 +04:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mReply.mOffset) &&
|
2015-04-14 08:27:37 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mReply.mTentativeCaretOffset) &&
|
2010-08-17 12:07:42 +04:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mReply.mString) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mReply.mRect) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mReply.mReversed) &&
|
2011-03-22 21:18:17 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mReply.mHasSelection) &&
|
2015-01-31 10:17:12 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mReply.mWidgetIsHit) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mReply.mFontRanges);
|
2010-08-17 12:07:42 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <>
|
2013-10-01 11:23:01 +04:00
|
|
|
struct ParamTraits<mozilla::WidgetSelectionEvent> {
|
|
|
|
typedef mozilla::WidgetSelectionEvent paramType;
|
2010-08-17 12:07:42 +04:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
2017-07-05 12:59:44 +03:00
|
|
|
WriteParam(aMsg, static_cast<const mozilla::WidgetGUIEvent&>(aParam));
|
2010-08-17 12:07:42 +04:00
|
|
|
WriteParam(aMsg, aParam.mOffset);
|
|
|
|
WriteParam(aMsg, aParam.mLength);
|
|
|
|
WriteParam(aMsg, aParam.mReversed);
|
|
|
|
WriteParam(aMsg, aParam.mExpandToClusterBoundary);
|
|
|
|
WriteParam(aMsg, aParam.mSucceeded);
|
2014-04-26 03:52:12 +04:00
|
|
|
WriteParam(aMsg, aParam.mUseNativeLineBreak);
|
2010-08-17 12:07:42 +04:00
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2013-10-02 07:46:03 +04:00
|
|
|
return ReadParam(aMsg, aIter,
|
|
|
|
static_cast<mozilla::WidgetGUIEvent*>(aResult)) &&
|
2010-08-17 12:07:42 +04:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mOffset) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mLength) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mReversed) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mExpandToClusterBoundary) &&
|
2014-04-26 03:52:12 +04:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mSucceeded) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mUseNativeLineBreak);
|
2010-08-17 12:07:42 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-09-24 07:28:15 +04:00
|
|
|
template <>
|
2017-04-11 15:24:55 +03:00
|
|
|
struct ParamTraits<mozilla::widget::IMENotificationRequests> {
|
|
|
|
typedef mozilla::widget::IMENotificationRequests paramType;
|
2010-09-24 07:28:15 +04:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
|
|
|
WriteParam(aMsg, aParam.mWantUpdates);
|
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2014-01-29 13:32:35 +04:00
|
|
|
return ReadParam(aMsg, aIter, &aResult->mWantUpdates);
|
2010-09-24 07:28:15 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-12-11 09:15:57 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::widget::NativeIMEContext> {
|
|
|
|
typedef mozilla::widget::NativeIMEContext paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
|
|
|
WriteParam(aMsg, aParam.mRawNativeIMEContext);
|
|
|
|
WriteParam(aMsg, aParam.mOriginProcessID);
|
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2015-12-11 09:15:57 +03:00
|
|
|
return ReadParam(aMsg, aIter, &aResult->mRawNativeIMEContext) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mOriginProcessID);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-07-17 07:30:01 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::widget::IMENotification::Point> {
|
|
|
|
typedef mozilla::widget::IMENotification::Point paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
|
|
|
WriteParam(aMsg, aParam.mX);
|
|
|
|
WriteParam(aMsg, aParam.mY);
|
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2015-07-17 07:30:01 +03:00
|
|
|
return ReadParam(aMsg, aIter, &aResult->mX) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mY);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::widget::IMENotification::Rect> {
|
|
|
|
typedef mozilla::widget::IMENotification::Rect paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
|
|
|
WriteParam(aMsg, aParam.mX);
|
|
|
|
WriteParam(aMsg, aParam.mY);
|
|
|
|
WriteParam(aMsg, aParam.mWidth);
|
|
|
|
WriteParam(aMsg, aParam.mHeight);
|
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2015-07-17 07:30:01 +03:00
|
|
|
return ReadParam(aMsg, aIter, &aResult->mX) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mY) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mWidth) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mHeight);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <>
|
2015-08-21 19:43:41 +03:00
|
|
|
struct ParamTraits<mozilla::widget::IMENotification::SelectionChangeDataBase> {
|
|
|
|
typedef mozilla::widget::IMENotification::SelectionChangeDataBase paramType;
|
2015-07-17 07:30:01 +03:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
2015-07-22 06:40:32 +03:00
|
|
|
MOZ_RELEASE_ASSERT(aParam.mString);
|
2015-07-17 07:30:01 +03:00
|
|
|
WriteParam(aMsg, aParam.mOffset);
|
2015-07-22 06:40:32 +03:00
|
|
|
WriteParam(aMsg, *aParam.mString);
|
2015-07-17 07:30:01 +03:00
|
|
|
WriteParam(aMsg, aParam.mWritingMode);
|
|
|
|
WriteParam(aMsg, aParam.mReversed);
|
|
|
|
WriteParam(aMsg, aParam.mCausedByComposition);
|
|
|
|
WriteParam(aMsg, aParam.mCausedBySelectionEvent);
|
2015-10-27 01:21:37 +03:00
|
|
|
WriteParam(aMsg, aParam.mOccurredDuringComposition);
|
2015-07-17 07:30:01 +03:00
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2015-07-22 06:40:32 +03:00
|
|
|
aResult->mString = new nsString();
|
2015-07-17 07:30:01 +03:00
|
|
|
return ReadParam(aMsg, aIter, &aResult->mOffset) &&
|
2015-07-22 06:40:32 +03:00
|
|
|
ReadParam(aMsg, aIter, aResult->mString) &&
|
2015-07-17 07:30:01 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mWritingMode) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mReversed) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mCausedByComposition) &&
|
2015-10-27 01:21:37 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mCausedBySelectionEvent) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mOccurredDuringComposition);
|
2015-07-17 07:30:01 +03:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::widget::IMENotification::TextChangeDataBase> {
|
|
|
|
typedef mozilla::widget::IMENotification::TextChangeDataBase paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
|
|
|
WriteParam(aMsg, aParam.mStartOffset);
|
|
|
|
WriteParam(aMsg, aParam.mRemovedEndOffset);
|
|
|
|
WriteParam(aMsg, aParam.mAddedEndOffset);
|
2016-01-28 07:28:53 +03:00
|
|
|
WriteParam(aMsg, aParam.mCausedOnlyByComposition);
|
2016-01-28 07:28:53 +03:00
|
|
|
WriteParam(aMsg, aParam.mIncludingChangesDuringComposition);
|
2016-01-28 07:28:54 +03:00
|
|
|
WriteParam(aMsg, aParam.mIncludingChangesWithoutComposition);
|
2015-07-17 07:30:01 +03:00
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2015-07-17 07:30:01 +03:00
|
|
|
return ReadParam(aMsg, aIter, &aResult->mStartOffset) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mRemovedEndOffset) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mAddedEndOffset) &&
|
2016-01-28 07:28:53 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mCausedOnlyByComposition) &&
|
2016-01-28 07:28:54 +03:00
|
|
|
ReadParam(aMsg, aIter,
|
|
|
|
&aResult->mIncludingChangesDuringComposition) &&
|
|
|
|
ReadParam(aMsg, aIter,
|
|
|
|
&aResult->mIncludingChangesWithoutComposition);
|
2015-07-17 07:30:01 +03:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::widget::IMENotification::MouseButtonEventData> {
|
|
|
|
typedef mozilla::widget::IMENotification::MouseButtonEventData paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
|
|
|
WriteParam(aMsg, aParam.mEventMessage);
|
|
|
|
WriteParam(aMsg, aParam.mOffset);
|
|
|
|
WriteParam(aMsg, aParam.mCursorPos);
|
|
|
|
WriteParam(aMsg, aParam.mCharRect);
|
|
|
|
WriteParam(aMsg, aParam.mButton);
|
|
|
|
WriteParam(aMsg, aParam.mButtons);
|
|
|
|
WriteParam(aMsg, aParam.mModifiers);
|
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2015-07-17 07:30:01 +03:00
|
|
|
return ReadParam(aMsg, aIter, &aResult->mEventMessage) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mOffset) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mCursorPos) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mCharRect) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mButton) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mButtons) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mModifiers);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-09-11 17:46:17 +04:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::widget::IMENotification> {
|
|
|
|
typedef mozilla::widget::IMENotification paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
|
|
|
WriteParam(aMsg,
|
|
|
|
static_cast<mozilla::widget::IMEMessageType>(aParam.mMessage));
|
|
|
|
switch (aParam.mMessage) {
|
|
|
|
case mozilla::widget::NOTIFY_IME_OF_SELECTION_CHANGE:
|
2015-07-17 07:30:01 +03:00
|
|
|
WriteParam(aMsg, aParam.mSelectionChangeData);
|
2014-09-11 17:46:17 +04:00
|
|
|
return;
|
|
|
|
case mozilla::widget::NOTIFY_IME_OF_TEXT_CHANGE:
|
2015-07-17 07:30:01 +03:00
|
|
|
WriteParam(aMsg, aParam.mTextChangeData);
|
2014-09-11 17:46:17 +04:00
|
|
|
return;
|
|
|
|
case mozilla::widget::NOTIFY_IME_OF_MOUSE_BUTTON_EVENT:
|
2015-07-17 07:30:01 +03:00
|
|
|
WriteParam(aMsg, aParam.mMouseButtonEventData);
|
2014-09-11 17:46:17 +04:00
|
|
|
return;
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2014-09-11 17:46:17 +04:00
|
|
|
mozilla::widget::IMEMessageType IMEMessage = 0;
|
|
|
|
if (!ReadParam(aMsg, aIter, &IMEMessage)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
aResult->mMessage = static_cast<mozilla::widget::IMEMessage>(IMEMessage);
|
|
|
|
switch (aResult->mMessage) {
|
|
|
|
case mozilla::widget::NOTIFY_IME_OF_SELECTION_CHANGE:
|
2015-07-17 07:30:01 +03:00
|
|
|
return ReadParam(aMsg, aIter, &aResult->mSelectionChangeData);
|
2014-09-11 17:46:17 +04:00
|
|
|
case mozilla::widget::NOTIFY_IME_OF_TEXT_CHANGE:
|
2015-07-17 07:30:01 +03:00
|
|
|
return ReadParam(aMsg, aIter, &aResult->mTextChangeData);
|
2014-09-11 17:46:17 +04:00
|
|
|
case mozilla::widget::NOTIFY_IME_OF_MOUSE_BUTTON_EVENT:
|
2015-07-17 07:30:01 +03:00
|
|
|
return ReadParam(aMsg, aIter, &aResult->mMouseButtonEventData);
|
2014-09-11 17:46:17 +04:00
|
|
|
default:
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-04-11 19:26:33 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::widget::IMEState::Enabled>
|
|
|
|
: ContiguousEnumSerializer<mozilla::widget::IMEState::Enabled,
|
|
|
|
mozilla::widget::IMEState::Enabled::DISABLED,
|
|
|
|
mozilla::widget::IMEState::Enabled::UNKNOWN> {};
|
|
|
|
|
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::widget::IMEState::Open>
|
|
|
|
: ContiguousEnumSerializerInclusive<
|
|
|
|
mozilla::widget::IMEState::Open,
|
|
|
|
mozilla::widget::IMEState::Open::OPEN_STATE_NOT_SUPPORTED,
|
|
|
|
mozilla::widget::IMEState::Open::CLOSED> {};
|
|
|
|
|
2018-06-19 23:31:24 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::widget::IMEState> {
|
|
|
|
typedef mozilla::widget::IMEState paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
|
|
|
WriteParam(aMsg, aParam.mEnabled);
|
|
|
|
WriteParam(aMsg, aParam.mOpen);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
|
|
|
return ReadParam(aMsg, aIter, &aResult->mEnabled) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mOpen);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::widget::InputContext::Origin>
|
|
|
|
: ContiguousEnumSerializerInclusive<
|
|
|
|
mozilla::widget::InputContext::Origin,
|
|
|
|
mozilla::widget::InputContext::Origin::ORIGIN_MAIN,
|
|
|
|
mozilla::widget::InputContext::Origin::ORIGIN_CONTENT> {};
|
|
|
|
|
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::widget::InputContext> {
|
|
|
|
typedef mozilla::widget::InputContext paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
|
|
|
WriteParam(aMsg, aParam.mIMEState);
|
|
|
|
WriteParam(aMsg, aParam.mHTMLInputType);
|
|
|
|
WriteParam(aMsg, aParam.mHTMLInputInputmode);
|
|
|
|
WriteParam(aMsg, aParam.mActionHint);
|
|
|
|
WriteParam(aMsg, aParam.mOrigin);
|
|
|
|
WriteParam(aMsg, aParam.mMayBeIMEUnaware);
|
|
|
|
WriteParam(aMsg, aParam.mHasHandledUserInput);
|
|
|
|
WriteParam(aMsg, aParam.mInPrivateBrowsing);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
|
|
|
return ReadParam(aMsg, aIter, &aResult->mIMEState) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mHTMLInputType) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mHTMLInputInputmode) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mActionHint) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mOrigin) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mMayBeIMEUnaware) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mHasHandledUserInput) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mInPrivateBrowsing);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-04-11 19:26:33 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::widget::InputContextAction::Cause>
|
|
|
|
: ContiguousEnumSerializerInclusive<
|
|
|
|
mozilla::widget::InputContextAction::Cause,
|
|
|
|
mozilla::widget::InputContextAction::Cause::CAUSE_UNKNOWN,
|
|
|
|
mozilla::widget::InputContextAction::Cause::
|
|
|
|
CAUSE_UNKNOWN_DURING_KEYBOARD_INPUT> {};
|
|
|
|
|
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::widget::InputContextAction::FocusChange>
|
|
|
|
: ContiguousEnumSerializerInclusive<
|
|
|
|
mozilla::widget::InputContextAction::FocusChange,
|
|
|
|
mozilla::widget::InputContextAction::FocusChange::FOCUS_NOT_CHANGED,
|
|
|
|
mozilla::widget::InputContextAction::FocusChange::WIDGET_CREATED> {};
|
|
|
|
|
2018-06-19 23:31:24 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::widget::InputContextAction> {
|
|
|
|
typedef mozilla::widget::InputContextAction paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
|
|
|
WriteParam(aMsg, aParam.mCause);
|
|
|
|
WriteParam(aMsg, aParam.mFocusChange);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
|
|
|
return ReadParam(aMsg, aIter, &aResult->mCause) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mFocusChange);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2011-05-11 08:52:44 +04:00
|
|
|
template <>
|
2013-09-27 10:20:54 +04:00
|
|
|
struct ParamTraits<mozilla::WidgetPluginEvent> {
|
|
|
|
typedef mozilla::WidgetPluginEvent paramType;
|
2011-05-11 08:52:44 +04:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
2017-07-05 12:59:44 +03:00
|
|
|
WriteParam(aMsg, static_cast<const mozilla::WidgetGUIEvent&>(aParam));
|
2016-03-30 12:07:50 +03:00
|
|
|
WriteParam(aMsg, aParam.mRetargetToFocusedDocument);
|
2011-05-11 08:52:44 +04:00
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2013-10-02 07:46:03 +04:00
|
|
|
return ReadParam(aMsg, aIter,
|
|
|
|
static_cast<mozilla::WidgetGUIEvent*>(aResult)) &&
|
2016-03-30 12:07:50 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mRetargetToFocusedDocument);
|
2011-05-11 08:52:44 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-12-05 05:15:43 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::WritingMode> {
|
|
|
|
typedef mozilla::WritingMode paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
|
|
|
WriteParam(aMsg, aParam.mWritingMode);
|
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2014-12-05 05:15:43 +03:00
|
|
|
return ReadParam(aMsg, aIter, &aResult->mWritingMode);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-06-05 12:28:19 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::ContentCache> {
|
|
|
|
typedef mozilla::ContentCache paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
2016-06-13 12:17:58 +03:00
|
|
|
WriteParam(aMsg, aParam.mCompositionStart);
|
2015-06-05 12:28:19 +03:00
|
|
|
WriteParam(aMsg, aParam.mText);
|
|
|
|
WriteParam(aMsg, aParam.mSelection.mAnchor);
|
|
|
|
WriteParam(aMsg, aParam.mSelection.mFocus);
|
|
|
|
WriteParam(aMsg, aParam.mSelection.mWritingMode);
|
2016-07-22 14:47:51 +03:00
|
|
|
WriteParam(aMsg, aParam.mSelection.mAnchorCharRects[0]);
|
|
|
|
WriteParam(aMsg, aParam.mSelection.mAnchorCharRects[1]);
|
|
|
|
WriteParam(aMsg, aParam.mSelection.mFocusCharRects[0]);
|
|
|
|
WriteParam(aMsg, aParam.mSelection.mFocusCharRects[1]);
|
2015-06-08 05:46:17 +03:00
|
|
|
WriteParam(aMsg, aParam.mSelection.mRect);
|
2015-06-17 04:03:58 +03:00
|
|
|
WriteParam(aMsg, aParam.mFirstCharRect);
|
2015-06-05 12:28:19 +03:00
|
|
|
WriteParam(aMsg, aParam.mCaret.mOffset);
|
|
|
|
WriteParam(aMsg, aParam.mCaret.mRect);
|
|
|
|
WriteParam(aMsg, aParam.mTextRectArray.mStart);
|
|
|
|
WriteParam(aMsg, aParam.mTextRectArray.mRects);
|
|
|
|
WriteParam(aMsg, aParam.mEditorRect);
|
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2016-06-13 12:17:58 +03:00
|
|
|
return ReadParam(aMsg, aIter, &aResult->mCompositionStart) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mText) &&
|
2015-06-05 12:28:19 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mSelection.mAnchor) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mSelection.mFocus) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mSelection.mWritingMode) &&
|
2016-07-22 14:47:51 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mSelection.mAnchorCharRects[0]) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mSelection.mAnchorCharRects[1]) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mSelection.mFocusCharRects[0]) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mSelection.mFocusCharRects[1]) &&
|
2015-06-08 05:46:17 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mSelection.mRect) &&
|
2015-06-17 04:03:58 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mFirstCharRect) &&
|
2015-06-05 12:28:19 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mCaret.mOffset) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mCaret.mRect) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mTextRectArray.mStart) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mTextRectArray.mRects) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mEditorRect);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2016-02-02 11:05:56 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::widget::CandidateWindowPosition> {
|
|
|
|
typedef mozilla::widget::CandidateWindowPosition paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
|
|
|
WriteParam(aMsg, aParam.mPoint);
|
|
|
|
WriteParam(aMsg, aParam.mRect);
|
|
|
|
WriteParam(aMsg, aParam.mExcludeRect);
|
|
|
|
}
|
|
|
|
|
2016-04-21 07:09:15 +03:00
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
2016-02-02 11:05:56 +03:00
|
|
|
return ReadParam(aMsg, aIter, &aResult->mPoint) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mRect) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mExcludeRect);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2016-07-20 14:37:00 +03:00
|
|
|
// InputData.h
|
|
|
|
|
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::InputType>
|
2017-07-01 04:18:55 +03:00
|
|
|
: public ContiguousEnumSerializerInclusive<
|
2016-07-20 14:37:00 +03:00
|
|
|
mozilla::InputType, mozilla::InputType::MULTITOUCH_INPUT,
|
2017-07-01 04:18:55 +03:00
|
|
|
mozilla::kHighestInputType> {};
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2016-07-20 14:37:00 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::InputData> {
|
|
|
|
typedef mozilla::InputData paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
|
|
|
WriteParam(aMsg, aParam.mInputType);
|
|
|
|
WriteParam(aMsg, aParam.mTime);
|
|
|
|
WriteParam(aMsg, aParam.mTimeStamp);
|
|
|
|
WriteParam(aMsg, aParam.modifiers);
|
2017-06-06 03:45:31 +03:00
|
|
|
WriteParam(aMsg, aParam.mFocusSequenceNumber);
|
2016-07-20 14:37:00 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
|
|
|
return ReadParam(aMsg, aIter, &aResult->mInputType) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mTime) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mTimeStamp) &&
|
2017-06-06 03:45:31 +03:00
|
|
|
ReadParam(aMsg, aIter, &aResult->modifiers) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mFocusSequenceNumber);
|
2016-07-20 14:37:00 +03:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::SingleTouchData> {
|
|
|
|
typedef mozilla::SingleTouchData paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
|
|
|
WriteParam(aMsg, aParam.mIdentifier);
|
|
|
|
WriteParam(aMsg, aParam.mScreenPoint);
|
|
|
|
WriteParam(aMsg, aParam.mLocalScreenPoint);
|
|
|
|
WriteParam(aMsg, aParam.mRadius);
|
|
|
|
WriteParam(aMsg, aParam.mRotationAngle);
|
|
|
|
WriteParam(aMsg, aParam.mForce);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
|
|
|
return (ReadParam(aMsg, aIter, &aResult->mIdentifier) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mScreenPoint) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mLocalScreenPoint) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mRadius) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mRotationAngle) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mForce));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::MultiTouchInput::MultiTouchType>
|
2017-07-01 04:18:55 +03:00
|
|
|
: public ContiguousEnumSerializerInclusive<
|
2016-07-20 14:37:00 +03:00
|
|
|
mozilla::MultiTouchInput::MultiTouchType,
|
|
|
|
mozilla::MultiTouchInput::MultiTouchType::MULTITOUCH_START,
|
2017-07-01 04:18:55 +03:00
|
|
|
mozilla::MultiTouchInput::sHighestMultiTouchType> {};
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2016-07-20 14:37:00 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::MultiTouchInput> {
|
|
|
|
typedef mozilla::MultiTouchInput paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
2017-07-05 12:59:44 +03:00
|
|
|
WriteParam(aMsg, static_cast<const mozilla::InputData&>(aParam));
|
2016-07-20 14:37:00 +03:00
|
|
|
WriteParam(aMsg, aParam.mType);
|
|
|
|
WriteParam(aMsg, aParam.mTouches);
|
|
|
|
WriteParam(aMsg, aParam.mHandledByAPZ);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
|
|
|
return ReadParam(aMsg, aIter, static_cast<mozilla::InputData*>(aResult)) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mType) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mTouches) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mHandledByAPZ);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::MouseInput::MouseType>
|
2017-07-01 04:18:55 +03:00
|
|
|
: public ContiguousEnumSerializerInclusive<
|
2016-07-20 14:37:00 +03:00
|
|
|
mozilla::MouseInput::MouseType,
|
|
|
|
mozilla::MouseInput::MouseType::MOUSE_NONE,
|
2017-07-01 04:18:55 +03:00
|
|
|
mozilla::MouseInput::sHighestMouseType> {};
|
2016-07-20 14:37:00 +03:00
|
|
|
|
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::MouseInput::ButtonType>
|
2017-07-01 04:18:55 +03:00
|
|
|
: public ContiguousEnumSerializerInclusive<
|
2016-07-20 14:37:00 +03:00
|
|
|
mozilla::MouseInput::ButtonType,
|
|
|
|
mozilla::MouseInput::ButtonType::LEFT_BUTTON,
|
2017-07-01 04:18:55 +03:00
|
|
|
mozilla::MouseInput::sHighestButtonType> {};
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2016-07-20 14:37:00 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::MouseInput> {
|
|
|
|
typedef mozilla::MouseInput paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
2017-07-05 12:59:44 +03:00
|
|
|
WriteParam(aMsg, static_cast<const mozilla::InputData&>(aParam));
|
2016-07-20 14:37:00 +03:00
|
|
|
WriteParam(aMsg, aParam.mButtonType);
|
|
|
|
WriteParam(aMsg, aParam.mType);
|
|
|
|
WriteParam(aMsg, aParam.mInputSource);
|
|
|
|
WriteParam(aMsg, aParam.mButtons);
|
|
|
|
WriteParam(aMsg, aParam.mOrigin);
|
|
|
|
WriteParam(aMsg, aParam.mLocalOrigin);
|
|
|
|
WriteParam(aMsg, aParam.mHandledByAPZ);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
|
|
|
return ReadParam(aMsg, aIter, static_cast<mozilla::InputData*>(aResult)) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mButtonType) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mType) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mInputSource) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mButtons) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mOrigin) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mLocalOrigin) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mHandledByAPZ);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::PanGestureInput::PanGestureType>
|
2017-07-01 04:18:55 +03:00
|
|
|
: public ContiguousEnumSerializerInclusive<
|
2016-07-20 14:37:00 +03:00
|
|
|
mozilla::PanGestureInput::PanGestureType,
|
|
|
|
mozilla::PanGestureInput::PanGestureType::PANGESTURE_MAYSTART,
|
2017-07-01 04:18:55 +03:00
|
|
|
mozilla::PanGestureInput::sHighestPanGestureType> {};
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2016-07-20 14:37:00 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::PanGestureInput> {
|
|
|
|
typedef mozilla::PanGestureInput paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
2017-07-05 12:59:44 +03:00
|
|
|
WriteParam(aMsg, static_cast<const mozilla::InputData&>(aParam));
|
2016-07-20 14:37:00 +03:00
|
|
|
WriteParam(aMsg, aParam.mType);
|
|
|
|
WriteParam(aMsg, aParam.mPanStartPoint);
|
|
|
|
WriteParam(aMsg, aParam.mPanDisplacement);
|
|
|
|
WriteParam(aMsg, aParam.mLocalPanStartPoint);
|
|
|
|
WriteParam(aMsg, aParam.mLocalPanDisplacement);
|
|
|
|
WriteParam(aMsg, aParam.mLineOrPageDeltaX);
|
|
|
|
WriteParam(aMsg, aParam.mLineOrPageDeltaY);
|
|
|
|
WriteParam(aMsg, aParam.mUserDeltaMultiplierX);
|
|
|
|
WriteParam(aMsg, aParam.mUserDeltaMultiplierY);
|
|
|
|
WriteParam(aMsg, aParam.mHandledByAPZ);
|
|
|
|
WriteParam(aMsg, aParam.mFollowedByMomentum);
|
|
|
|
WriteParam(
|
|
|
|
aMsg,
|
|
|
|
aParam
|
|
|
|
.mRequiresContentResponseIfCannotScrollHorizontallyInStartDirection);
|
2017-10-24 01:27:24 +03:00
|
|
|
WriteParam(aMsg, aParam.mOverscrollBehaviorAllowsSwipe);
|
2016-07-20 14:37:00 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
|
|
|
return ReadParam(aMsg, aIter, static_cast<mozilla::InputData*>(aResult)) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mType) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mPanStartPoint) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mPanDisplacement) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mLocalPanStartPoint) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mLocalPanDisplacement) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mLineOrPageDeltaX) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mLineOrPageDeltaY) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mUserDeltaMultiplierX) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mUserDeltaMultiplierY) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mHandledByAPZ) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mFollowedByMomentum) &&
|
2017-10-24 01:27:24 +03:00
|
|
|
ReadParam(
|
|
|
|
aMsg, aIter,
|
|
|
|
&aResult
|
|
|
|
->mRequiresContentResponseIfCannotScrollHorizontallyInStartDirection) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mOverscrollBehaviorAllowsSwipe);
|
2016-07-20 14:37:00 +03:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::PinchGestureInput::PinchGestureType>
|
2017-07-01 04:18:55 +03:00
|
|
|
: public ContiguousEnumSerializerInclusive<
|
2016-07-20 14:37:00 +03:00
|
|
|
mozilla::PinchGestureInput::PinchGestureType,
|
|
|
|
mozilla::PinchGestureInput::PinchGestureType::PINCHGESTURE_START,
|
2017-07-01 04:18:55 +03:00
|
|
|
mozilla::PinchGestureInput::sHighestPinchGestureType> {};
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2016-07-20 14:37:00 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::PinchGestureInput> {
|
|
|
|
typedef mozilla::PinchGestureInput paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
2017-07-05 12:59:44 +03:00
|
|
|
WriteParam(aMsg, static_cast<const mozilla::InputData&>(aParam));
|
2016-07-20 14:37:00 +03:00
|
|
|
WriteParam(aMsg, aParam.mType);
|
|
|
|
WriteParam(aMsg, aParam.mFocusPoint);
|
|
|
|
WriteParam(aMsg, aParam.mLocalFocusPoint);
|
|
|
|
WriteParam(aMsg, aParam.mCurrentSpan);
|
|
|
|
WriteParam(aMsg, aParam.mPreviousSpan);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
|
|
|
return ReadParam(aMsg, aIter, static_cast<mozilla::InputData*>(aResult)) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mType) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mFocusPoint) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mLocalFocusPoint) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mCurrentSpan) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mPreviousSpan);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::TapGestureInput::TapGestureType>
|
2017-07-01 04:18:55 +03:00
|
|
|
: public ContiguousEnumSerializerInclusive<
|
2016-07-20 14:37:00 +03:00
|
|
|
mozilla::TapGestureInput::TapGestureType,
|
|
|
|
mozilla::TapGestureInput::TapGestureType::TAPGESTURE_LONG,
|
2017-07-01 04:18:55 +03:00
|
|
|
mozilla::TapGestureInput::sHighestTapGestureType> {};
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2016-07-20 14:37:00 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::TapGestureInput> {
|
|
|
|
typedef mozilla::TapGestureInput paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
2017-07-05 12:59:44 +03:00
|
|
|
WriteParam(aMsg, static_cast<const mozilla::InputData&>(aParam));
|
2016-07-20 14:37:00 +03:00
|
|
|
WriteParam(aMsg, aParam.mType);
|
|
|
|
WriteParam(aMsg, aParam.mPoint);
|
|
|
|
WriteParam(aMsg, aParam.mLocalPoint);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
|
|
|
return ReadParam(aMsg, aIter, static_cast<mozilla::InputData*>(aResult)) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mType) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mPoint) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mLocalPoint);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::ScrollWheelInput::ScrollDeltaType>
|
2017-07-01 04:18:55 +03:00
|
|
|
: public ContiguousEnumSerializerInclusive<
|
2016-07-20 14:37:00 +03:00
|
|
|
mozilla::ScrollWheelInput::ScrollDeltaType,
|
|
|
|
mozilla::ScrollWheelInput::ScrollDeltaType::SCROLLDELTA_LINE,
|
2017-07-01 04:18:55 +03:00
|
|
|
mozilla::ScrollWheelInput::sHighestScrollDeltaType> {};
|
2016-07-20 14:37:00 +03:00
|
|
|
|
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::ScrollWheelInput::ScrollMode>
|
2017-07-01 04:18:55 +03:00
|
|
|
: public ContiguousEnumSerializerInclusive<
|
2016-07-20 14:37:00 +03:00
|
|
|
mozilla::ScrollWheelInput::ScrollMode,
|
|
|
|
mozilla::ScrollWheelInput::ScrollMode::SCROLLMODE_INSTANT,
|
2017-07-01 04:18:55 +03:00
|
|
|
mozilla::ScrollWheelInput::sHighestScrollMode> {};
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2018-03-16 14:23:53 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::WheelDeltaAdjustmentStrategy>
|
|
|
|
: public ContiguousEnumSerializer<
|
|
|
|
mozilla::WheelDeltaAdjustmentStrategy,
|
|
|
|
mozilla::WheelDeltaAdjustmentStrategy(0),
|
|
|
|
mozilla::WheelDeltaAdjustmentStrategy::eSentinel> {};
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2016-07-20 14:37:00 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::ScrollWheelInput> {
|
|
|
|
typedef mozilla::ScrollWheelInput paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
2017-07-05 12:59:44 +03:00
|
|
|
WriteParam(aMsg, static_cast<const mozilla::InputData&>(aParam));
|
2016-07-20 14:37:00 +03:00
|
|
|
WriteParam(aMsg, aParam.mDeltaType);
|
|
|
|
WriteParam(aMsg, aParam.mScrollMode);
|
|
|
|
WriteParam(aMsg, aParam.mOrigin);
|
|
|
|
WriteParam(aMsg, aParam.mHandledByAPZ);
|
|
|
|
WriteParam(aMsg, aParam.mDeltaX);
|
|
|
|
WriteParam(aMsg, aParam.mDeltaY);
|
|
|
|
WriteParam(aMsg, aParam.mLocalOrigin);
|
|
|
|
WriteParam(aMsg, aParam.mLineOrPageDeltaX);
|
|
|
|
WriteParam(aMsg, aParam.mLineOrPageDeltaY);
|
|
|
|
WriteParam(aMsg, aParam.mScrollSeriesNumber);
|
|
|
|
WriteParam(aMsg, aParam.mUserDeltaMultiplierX);
|
|
|
|
WriteParam(aMsg, aParam.mUserDeltaMultiplierY);
|
|
|
|
WriteParam(aMsg, aParam.mMayHaveMomentum);
|
|
|
|
WriteParam(aMsg, aParam.mIsMomentum);
|
|
|
|
WriteParam(aMsg, aParam.mAllowToOverrideSystemScrollSpeed);
|
2018-03-16 14:23:53 +03:00
|
|
|
WriteParam(aMsg, aParam.mWheelDeltaAdjustmentStrategy);
|
2016-07-20 14:37:00 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
|
|
|
return ReadParam(aMsg, aIter, static_cast<mozilla::InputData*>(aResult)) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mDeltaType) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mScrollMode) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mOrigin) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mHandledByAPZ) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mDeltaX) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mDeltaY) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mLocalOrigin) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mLineOrPageDeltaX) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mLineOrPageDeltaY) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mScrollSeriesNumber) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mUserDeltaMultiplierX) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mUserDeltaMultiplierY) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mMayHaveMomentum) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mIsMomentum) &&
|
2018-03-16 14:23:53 +03:00
|
|
|
ReadParam(aMsg, aIter,
|
|
|
|
&aResult->mAllowToOverrideSystemScrollSpeed) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mWheelDeltaAdjustmentStrategy);
|
2016-07-20 14:37:00 +03:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2017-06-06 02:09:40 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::KeyboardInput::KeyboardEventType>
|
|
|
|
: public ContiguousEnumSerializer<
|
|
|
|
mozilla::KeyboardInput::KeyboardEventType,
|
|
|
|
mozilla::KeyboardInput::KeyboardEventType::KEY_DOWN,
|
|
|
|
mozilla::KeyboardInput::KeyboardEventType::KEY_SENTINEL> {};
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2017-06-06 02:09:40 +03:00
|
|
|
template <>
|
|
|
|
struct ParamTraits<mozilla::KeyboardInput> {
|
|
|
|
typedef mozilla::KeyboardInput paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam) {
|
2017-07-05 12:59:44 +03:00
|
|
|
WriteParam(aMsg, static_cast<const mozilla::InputData&>(aParam));
|
2017-06-06 02:09:40 +03:00
|
|
|
WriteParam(aMsg, aParam.mType);
|
|
|
|
WriteParam(aMsg, aParam.mKeyCode);
|
|
|
|
WriteParam(aMsg, aParam.mCharCode);
|
|
|
|
WriteParam(aMsg, aParam.mShortcutCandidates);
|
|
|
|
WriteParam(aMsg, aParam.mHandledByAPZ);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, PickleIterator* aIter,
|
|
|
|
paramType* aResult) {
|
|
|
|
return ReadParam(aMsg, aIter, static_cast<mozilla::InputData*>(aResult)) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mType) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mKeyCode) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mCharCode) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mShortcutCandidates) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mHandledByAPZ);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-08-17 12:07:42 +04:00
|
|
|
} // namespace IPC
|
|
|
|
|
|
|
|
#endif // nsGUIEventIPC_h__
|