2010-08-17 01:07:42 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07: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 01:07:42 -07:00
|
|
|
|
|
|
|
#ifndef nsGUIEventIPC_h__
|
|
|
|
#define nsGUIEventIPC_h__
|
|
|
|
|
2012-08-28 05:41:04 -07:00
|
|
|
#include "ipc/IPCMessageUtils.h"
|
2015-06-05 02:28:19 -07:00
|
|
|
#include "mozilla/ContentCache.h"
|
2013-07-26 12:28:31 -07:00
|
|
|
#include "mozilla/GfxMessageUtils.h"
|
2013-04-05 01:49:00 -07:00
|
|
|
#include "mozilla/dom/Touch.h"
|
2013-09-25 04:21:20 -07:00
|
|
|
#include "mozilla/MiscEvents.h"
|
2013-09-25 04:21:18 -07:00
|
|
|
#include "mozilla/MouseEvents.h"
|
2013-09-25 04:21:19 -07:00
|
|
|
#include "mozilla/TextEvents.h"
|
2013-09-25 04:21:16 -07:00
|
|
|
#include "mozilla/TouchEvents.h"
|
2010-08-17 01:07:42 -07:00
|
|
|
|
|
|
|
namespace IPC
|
|
|
|
{
|
|
|
|
|
2015-08-26 05:56:59 -07:00
|
|
|
template<>
|
|
|
|
struct ParamTraits<mozilla::EventMessage>
|
|
|
|
{
|
|
|
|
typedef mozilla::EventMessage paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
|
|
{
|
|
|
|
WriteParam(aMsg, static_cast<const mozilla::EventMessageType&>(aParam));
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
|
|
|
mozilla::EventMessageType eventMessage = 0;
|
|
|
|
bool ret = ReadParam(aMsg, aIter, &eventMessage);
|
|
|
|
*aResult = static_cast<paramType>(eventMessage);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-12-15 17:26:03 -08:00
|
|
|
template<>
|
2013-09-13 19:39:41 -07:00
|
|
|
struct ParamTraits<mozilla::BaseEventFlags>
|
2012-12-15 17:26:03 -08:00
|
|
|
{
|
2013-09-13 19:39:41 -07:00
|
|
|
typedef mozilla::BaseEventFlags paramType;
|
2012-12-15 17:26:03 -08:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
|
|
{
|
2012-12-19 19:42:29 -08:00
|
|
|
aMsg->WriteBytes(&aParam, sizeof(aParam));
|
2012-12-15 17:26:03 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
2012-12-19 19:42:29 -08:00
|
|
|
const char* outp;
|
|
|
|
if (!aMsg->ReadBytes(aIter, &outp, sizeof(*aResult))) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
*aResult = *reinterpret_cast<const paramType*>(outp);
|
|
|
|
return true;
|
2012-12-15 17:26:03 -08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-08-17 01:07:42 -07:00
|
|
|
template<>
|
2013-10-01 20:46:04 -07:00
|
|
|
struct ParamTraits<mozilla::WidgetEvent>
|
2010-08-17 01:07:42 -07:00
|
|
|
{
|
2013-10-01 20:46:04 -07:00
|
|
|
typedef mozilla::WidgetEvent paramType;
|
2010-08-17 01:07:42 -07:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
|
|
{
|
2014-08-03 22:28:46 -07:00
|
|
|
WriteParam(aMsg,
|
|
|
|
static_cast<mozilla::EventClassIDType>(aParam.mClass));
|
2015-08-21 18:34:51 -07:00
|
|
|
WriteParam(aMsg, aParam.mMessage);
|
2010-08-17 01:07:42 -07:00
|
|
|
WriteParam(aMsg, aParam.refPoint);
|
|
|
|
WriteParam(aMsg, aParam.time);
|
2014-06-05 22:29:49 -07:00
|
|
|
WriteParam(aMsg, aParam.timeStamp);
|
2012-12-15 17:26:03 -08:00
|
|
|
WriteParam(aMsg, aParam.mFlags);
|
2010-08-17 01:07:42 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
2014-08-03 22:28:46 -07:00
|
|
|
mozilla::EventClassIDType eventClassID = 0;
|
|
|
|
bool ret = ReadParam(aMsg, aIter, &eventClassID) &&
|
2015-08-21 18:34:51 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mMessage) &&
|
2012-11-19 22:05:56 -08:00
|
|
|
ReadParam(aMsg, aIter, &aResult->refPoint) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->time) &&
|
2014-06-05 22:29:49 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->timeStamp) &&
|
2012-12-15 17:26:03 -08:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mFlags);
|
2014-08-03 22:28:46 -07:00
|
|
|
aResult->mClass = static_cast<mozilla::EventClassID>(eventClassID);
|
2012-11-19 22:05:56 -08:00
|
|
|
return ret;
|
2010-08-17 01:07:42 -07:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template<>
|
2013-10-01 20:46:03 -07:00
|
|
|
struct ParamTraits<mozilla::WidgetGUIEvent>
|
2010-08-17 01:07:42 -07:00
|
|
|
{
|
2013-10-01 20:46:03 -07:00
|
|
|
typedef mozilla::WidgetGUIEvent paramType;
|
2010-08-17 01:07:42 -07:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
|
|
{
|
2013-10-01 20:46:04 -07:00
|
|
|
WriteParam(aMsg, static_cast<mozilla::WidgetEvent>(aParam));
|
2014-07-23 12:55:51 -07:00
|
|
|
WriteParam(aMsg, aParam.mPluginEvent.mBuffer);
|
2010-08-17 01:07:42 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
2014-07-23 12:55:51 -07:00
|
|
|
return ReadParam(aMsg, aIter, static_cast<mozilla::WidgetEvent*>(aResult)) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mPluginEvent.mBuffer);
|
2010-08-17 01:07:42 -07:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template<>
|
2013-10-01 00:23:02 -07:00
|
|
|
struct ParamTraits<mozilla::WidgetInputEvent>
|
2010-08-17 01:07:42 -07:00
|
|
|
{
|
2013-10-01 00:23:02 -07:00
|
|
|
typedef mozilla::WidgetInputEvent paramType;
|
2010-08-17 01:07:42 -07:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
|
|
{
|
2013-10-01 20:46:03 -07:00
|
|
|
WriteParam(aMsg, static_cast<mozilla::WidgetGUIEvent>(aParam));
|
2012-04-24 20:00:02 -07:00
|
|
|
WriteParam(aMsg, aParam.modifiers);
|
2010-08-17 01:07:42 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
2013-10-01 20:46:03 -07:00
|
|
|
return ReadParam(aMsg, aIter,
|
|
|
|
static_cast<mozilla::WidgetGUIEvent*>(aResult)) &&
|
2012-04-24 20:00:02 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->modifiers);
|
2010-08-17 01:07:42 -07:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2011-05-16 17:23:23 -07:00
|
|
|
template<>
|
2013-10-01 00:23:02 -07:00
|
|
|
struct ParamTraits<mozilla::WidgetMouseEventBase>
|
2011-05-16 17:23:23 -07:00
|
|
|
{
|
2013-10-01 00:23:02 -07:00
|
|
|
typedef mozilla::WidgetMouseEventBase paramType;
|
2011-05-16 17:23:23 -07:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
|
|
{
|
2013-10-01 00:23:02 -07:00
|
|
|
WriteParam(aMsg, static_cast<mozilla::WidgetInputEvent>(aParam));
|
2011-05-16 17:23:23 -07:00
|
|
|
WriteParam(aMsg, aParam.button);
|
2012-04-24 20:00:01 -07:00
|
|
|
WriteParam(aMsg, aParam.buttons);
|
2011-05-16 17:23:23 -07:00
|
|
|
WriteParam(aMsg, aParam.pressure);
|
2015-03-06 13:45:59 -08:00
|
|
|
WriteParam(aMsg, aParam.hitCluster);
|
2011-05-16 17:23:23 -07:00
|
|
|
WriteParam(aMsg, aParam.inputSource);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
2013-10-01 00:23:02 -07:00
|
|
|
return ReadParam(aMsg, aIter,
|
|
|
|
static_cast<mozilla::WidgetInputEvent*>(aResult)) &&
|
2011-05-16 17:23:23 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->button) &&
|
2012-04-24 20:00:01 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->buttons) &&
|
2011-05-16 17:23:23 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->pressure) &&
|
2015-03-06 13:45:59 -08:00
|
|
|
ReadParam(aMsg, aIter, &aResult->hitCluster) &&
|
2011-05-16 17:23:23 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->inputSource);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-08-11 18:42:34 -07:00
|
|
|
template<>
|
2013-10-16 02:37:36 -07:00
|
|
|
struct ParamTraits<mozilla::WidgetWheelEvent>
|
2012-08-11 18:42:34 -07:00
|
|
|
{
|
2013-10-16 02:37:36 -07:00
|
|
|
typedef mozilla::WidgetWheelEvent paramType;
|
2012-08-11 18:42:34 -07:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
|
|
{
|
2013-10-01 00:23:02 -07:00
|
|
|
WriteParam(aMsg, static_cast<mozilla::WidgetMouseEventBase>(aParam));
|
2012-08-11 18:42:34 -07:00
|
|
|
WriteParam(aMsg, aParam.deltaX);
|
|
|
|
WriteParam(aMsg, aParam.deltaY);
|
|
|
|
WriteParam(aMsg, aParam.deltaZ);
|
|
|
|
WriteParam(aMsg, aParam.deltaMode);
|
2012-08-11 18:42:35 -07:00
|
|
|
WriteParam(aMsg, aParam.customizedByUserPrefs);
|
2012-08-11 18:42:36 -07:00
|
|
|
WriteParam(aMsg, aParam.isMomentum);
|
2014-07-07 02:54:14 -07:00
|
|
|
WriteParam(aMsg, aParam.mIsNoLineOrPageDelta);
|
2012-08-11 18:42:35 -07:00
|
|
|
WriteParam(aMsg, aParam.lineOrPageDeltaX);
|
|
|
|
WriteParam(aMsg, aParam.lineOrPageDeltaY);
|
2012-08-22 08:56:38 -07:00
|
|
|
WriteParam(aMsg, static_cast<int32_t>(aParam.scrollType));
|
2012-08-11 18:42:35 -07:00
|
|
|
WriteParam(aMsg, aParam.overflowDeltaX);
|
|
|
|
WriteParam(aMsg, aParam.overflowDeltaY);
|
2015-03-06 13:45:59 -08:00
|
|
|
WriteParam(aMsg, aParam.mViewPortIsOverscrolled);
|
2015-08-27 20:50:31 -07:00
|
|
|
WriteParam(aMsg, aParam.mCanTriggerSwipe);
|
2012-08-11 18:42:34 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
2012-08-22 08:56:38 -07:00
|
|
|
int32_t scrollType = 0;
|
2012-08-11 18:42:36 -07:00
|
|
|
bool rv =
|
2013-10-01 00:23:02 -07:00
|
|
|
ReadParam(aMsg, aIter,
|
|
|
|
static_cast<mozilla::WidgetMouseEventBase*>(aResult)) &&
|
2012-08-11 18:42:36 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->deltaX) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->deltaY) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->deltaZ) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->deltaMode) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->customizedByUserPrefs) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->isMomentum) &&
|
2014-07-07 02:54:14 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mIsNoLineOrPageDelta) &&
|
2012-08-11 18:42:36 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->lineOrPageDeltaX) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->lineOrPageDeltaY) &&
|
|
|
|
ReadParam(aMsg, aIter, &scrollType) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->overflowDeltaX) &&
|
2015-03-06 13:45:59 -08:00
|
|
|
ReadParam(aMsg, aIter, &aResult->overflowDeltaY) &&
|
2015-08-27 20:50:31 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mViewPortIsOverscrolled) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mCanTriggerSwipe);
|
2012-08-11 18:42:36 -07:00
|
|
|
aResult->scrollType =
|
2013-10-16 02:37:36 -07:00
|
|
|
static_cast<mozilla::WidgetWheelEvent::ScrollType>(scrollType);
|
2012-08-11 18:42:36 -07:00
|
|
|
return rv;
|
2012-08-11 18:42:34 -07:00
|
|
|
}
|
|
|
|
};
|
2011-06-21 17:32:43 -07:00
|
|
|
|
|
|
|
template<>
|
2013-10-01 23:38:27 -07:00
|
|
|
struct ParamTraits<mozilla::WidgetMouseEvent>
|
2011-06-21 17:32:43 -07:00
|
|
|
{
|
2013-10-01 23:38:27 -07:00
|
|
|
typedef mozilla::WidgetMouseEvent paramType;
|
2011-06-21 17:32:43 -07:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
|
|
{
|
2013-10-01 00:23:02 -07:00
|
|
|
WriteParam(aMsg, static_cast<mozilla::WidgetMouseEventBase>(aParam));
|
2011-06-21 17:32:43 -07:00
|
|
|
WriteParam(aMsg, aParam.ignoreRootScrollFrame);
|
2012-08-22 08:56:38 -07:00
|
|
|
WriteParam(aMsg, (uint8_t) aParam.reason);
|
|
|
|
WriteParam(aMsg, (uint8_t) aParam.context);
|
|
|
|
WriteParam(aMsg, (uint8_t) aParam.exit);
|
2011-06-21 17:32:43 -07:00
|
|
|
WriteParam(aMsg, aParam.clickCount);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
|
|
|
bool rv;
|
2012-08-22 08:56:38 -07:00
|
|
|
uint8_t reason = 0, context = 0, exit = 0;
|
2013-10-01 00:23:02 -07:00
|
|
|
rv = ReadParam(aMsg, aIter,
|
|
|
|
static_cast<mozilla::WidgetMouseEventBase*>(aResult)) &&
|
2011-06-21 17:32:43 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->ignoreRootScrollFrame) &&
|
|
|
|
ReadParam(aMsg, aIter, &reason) &&
|
|
|
|
ReadParam(aMsg, aIter, &context) &&
|
|
|
|
ReadParam(aMsg, aIter, &exit) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->clickCount);
|
2013-10-01 23:38:27 -07:00
|
|
|
aResult->reason =
|
|
|
|
static_cast<mozilla::WidgetMouseEvent::reasonType>(reason);
|
|
|
|
aResult->context =
|
|
|
|
static_cast<mozilla::WidgetMouseEvent::contextType>(context);
|
|
|
|
aResult->exit = static_cast<mozilla::WidgetMouseEvent::exitType>(exit);
|
2011-06-21 17:32:43 -07:00
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-04-08 11:48:11 -07:00
|
|
|
|
|
|
|
template<>
|
|
|
|
struct ParamTraits<mozilla::WidgetDragEvent>
|
|
|
|
{
|
|
|
|
typedef mozilla::WidgetDragEvent paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
|
|
{
|
|
|
|
WriteParam(aMsg, static_cast<mozilla::WidgetMouseEvent>(aParam));
|
|
|
|
WriteParam(aMsg, aParam.userCancelled);
|
|
|
|
WriteParam(aMsg, aParam.mDefaultPreventedOnContent);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
|
|
|
bool rv =
|
|
|
|
ReadParam(aMsg, aIter, static_cast<mozilla::WidgetMouseEvent*>(aResult)) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->userCancelled) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mDefaultPreventedOnContent);
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2013-11-20 21:44:22 -08:00
|
|
|
template<>
|
|
|
|
struct ParamTraits<mozilla::WidgetPointerEvent>
|
|
|
|
{
|
|
|
|
typedef mozilla::WidgetPointerEvent paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
|
|
{
|
|
|
|
WriteParam(aMsg, static_cast<mozilla::WidgetMouseEvent>(aParam));
|
|
|
|
WriteParam(aMsg, aParam.pointerId);
|
|
|
|
WriteParam(aMsg, aParam.width);
|
|
|
|
WriteParam(aMsg, aParam.height);
|
|
|
|
WriteParam(aMsg, aParam.tiltX);
|
|
|
|
WriteParam(aMsg, aParam.tiltY);
|
|
|
|
WriteParam(aMsg, aParam.isPrimary);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
|
|
|
bool rv =
|
|
|
|
ReadParam(aMsg, aIter, static_cast<mozilla::WidgetMouseEvent*>(aResult)) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->pointerId) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->width) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->height) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->tiltX) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->tiltY) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->isPrimary);
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-07-15 19:58:43 -07:00
|
|
|
template<>
|
2013-09-26 23:20:57 -07:00
|
|
|
struct ParamTraits<mozilla::WidgetTouchEvent>
|
2012-07-15 19:58:43 -07:00
|
|
|
{
|
2013-09-26 23:20:57 -07:00
|
|
|
typedef mozilla::WidgetTouchEvent paramType;
|
2012-07-15 19:58:43 -07:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
|
|
{
|
2013-10-01 00:23:02 -07:00
|
|
|
WriteParam(aMsg, static_cast<const mozilla::WidgetInputEvent&>(aParam));
|
2013-04-05 01:49:00 -07:00
|
|
|
// Sigh, Touch bites us again! We want to be able to do
|
2012-07-15 19:58:43 -07:00
|
|
|
// WriteParam(aMsg, aParam.touches);
|
2014-07-08 13:48:18 -07:00
|
|
|
const paramType::TouchArray& touches = aParam.touches;
|
2012-07-15 19:58:43 -07:00
|
|
|
WriteParam(aMsg, touches.Length());
|
|
|
|
for (uint32_t i = 0; i < touches.Length(); ++i) {
|
2013-07-10 02:53:09 -07:00
|
|
|
mozilla::dom::Touch* touch = touches[i];
|
2012-07-15 19:58:43 -07:00
|
|
|
WriteParam(aMsg, touch->mIdentifier);
|
|
|
|
WriteParam(aMsg, touch->mRefPoint);
|
|
|
|
WriteParam(aMsg, touch->mRadius);
|
|
|
|
WriteParam(aMsg, touch->mRotationAngle);
|
|
|
|
WriteParam(aMsg, touch->mForce);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
2014-07-08 13:48:18 -07:00
|
|
|
paramType::TouchArray::size_type numTouches;
|
2013-10-01 00:23:02 -07:00
|
|
|
if (!ReadParam(aMsg, aIter,
|
|
|
|
static_cast<mozilla::WidgetInputEvent*>(aResult)) ||
|
2012-07-15 19:58:43 -07:00
|
|
|
!ReadParam(aMsg, aIter, &numTouches)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
for (uint32_t i = 0; i < numTouches; ++i) {
|
2012-08-22 08:56:38 -07:00
|
|
|
int32_t identifier;
|
2013-08-02 00:05:16 -07:00
|
|
|
mozilla::LayoutDeviceIntPoint refPoint;
|
2012-07-15 19:58:43 -07:00
|
|
|
nsIntPoint radius;
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
aResult->touches.AppendElement(
|
2013-08-02 00:05:16 -07:00
|
|
|
new mozilla::dom::Touch(
|
2015-02-01 14:27:31 -08:00
|
|
|
identifier, refPoint, radius, rotationAngle, force));
|
2012-07-15 19:58:43 -07:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-07-23 04:05:45 -07: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);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
|
|
|
return ReadParam(aMsg, aIter, &aResult->mUnshiftedCharCode) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mShiftedCharCode);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-06-21 17:32:43 -07:00
|
|
|
template<>
|
2013-10-01 00:22:58 -07:00
|
|
|
struct ParamTraits<mozilla::WidgetKeyboardEvent>
|
2011-06-21 17:32:43 -07:00
|
|
|
{
|
2013-10-01 00:22:58 -07:00
|
|
|
typedef mozilla::WidgetKeyboardEvent paramType;
|
2011-06-21 17:32:43 -07:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
|
|
{
|
2013-10-01 00:23:02 -07:00
|
|
|
WriteParam(aMsg, static_cast<mozilla::WidgetInputEvent>(aParam));
|
2013-04-23 20:49:46 -07:00
|
|
|
WriteParam(aMsg, static_cast<uint32_t>(aParam.mKeyNameIndex));
|
2014-05-24 19:08:58 -07:00
|
|
|
WriteParam(aMsg, static_cast<uint32_t>(aParam.mCodeNameIndex));
|
2013-12-10 08:14:53 -08:00
|
|
|
WriteParam(aMsg, aParam.mKeyValue);
|
2014-05-24 19:08:58 -07:00
|
|
|
WriteParam(aMsg, aParam.mCodeValue);
|
2011-06-21 17:32:43 -07:00
|
|
|
WriteParam(aMsg, aParam.keyCode);
|
|
|
|
WriteParam(aMsg, aParam.charCode);
|
2014-07-23 04:05:45 -07:00
|
|
|
WriteParam(aMsg, aParam.alternativeCharCodes);
|
2011-06-21 17:32:43 -07:00
|
|
|
WriteParam(aMsg, aParam.isChar);
|
2013-11-07 03:17:32 -08:00
|
|
|
WriteParam(aMsg, aParam.mIsRepeat);
|
2012-05-03 01:35:01 -07:00
|
|
|
WriteParam(aMsg, aParam.location);
|
2013-09-06 06:11:15 -07:00
|
|
|
WriteParam(aMsg, aParam.mUniqueId);
|
2014-12-11 06:44:07 -08:00
|
|
|
#ifdef XP_MACOSX
|
|
|
|
WriteParam(aMsg, aParam.mNativeKeyCode);
|
|
|
|
WriteParam(aMsg, aParam.mNativeModifierFlags);
|
|
|
|
WriteParam(aMsg, aParam.mNativeCharacters);
|
|
|
|
WriteParam(aMsg, aParam.mNativeCharactersIgnoringModifiers);
|
2015-02-20 08:37:02 -08:00
|
|
|
WriteParam(aMsg, aParam.mPluginTextEventString);
|
2014-12-11 06:44:07 -08:00
|
|
|
#endif
|
2013-07-09 20:42:59 -07:00
|
|
|
// An OS-specific native event might be attached in |mNativeKeyEvent|, but
|
|
|
|
// that cannot be copied across process boundaries.
|
2011-06-21 17:32:43 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
2014-05-24 19:08:58 -07:00
|
|
|
uint32_t keyNameIndex = 0, codeNameIndex = 0;
|
2013-10-01 00:23:02 -07:00
|
|
|
if (ReadParam(aMsg, aIter,
|
|
|
|
static_cast<mozilla::WidgetInputEvent*>(aResult)) &&
|
2013-04-26 00:41:27 -07:00
|
|
|
ReadParam(aMsg, aIter, &keyNameIndex) &&
|
2014-05-24 19:08:58 -07:00
|
|
|
ReadParam(aMsg, aIter, &codeNameIndex) &&
|
2013-12-10 08:14:53 -08:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mKeyValue) &&
|
2014-05-24 19:08:58 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mCodeValue) &&
|
2013-04-26 00:41:27 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->keyCode) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->charCode) &&
|
2014-07-23 04:05:45 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->alternativeCharCodes) &&
|
2013-04-26 00:41:27 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->isChar) &&
|
2013-11-07 03:17:32 -08:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mIsRepeat) &&
|
2013-09-06 06:11:15 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->location) &&
|
2014-12-11 06:44:07 -08:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mUniqueId)
|
|
|
|
#ifdef XP_MACOSX
|
|
|
|
&& ReadParam(aMsg, aIter, &aResult->mNativeKeyCode)
|
|
|
|
&& ReadParam(aMsg, aIter, &aResult->mNativeModifierFlags)
|
|
|
|
&& ReadParam(aMsg, aIter, &aResult->mNativeCharacters)
|
|
|
|
&& ReadParam(aMsg, aIter, &aResult->mNativeCharactersIgnoringModifiers)
|
2015-02-20 08:37:02 -08:00
|
|
|
&& ReadParam(aMsg, aIter, &aResult->mPluginTextEventString)
|
2014-12-11 06:44:07 -08:00
|
|
|
#endif
|
|
|
|
)
|
2013-08-19 11:33:27 -07:00
|
|
|
{
|
2013-09-13 19:39:41 -07:00
|
|
|
aResult->mKeyNameIndex = static_cast<mozilla::KeyNameIndex>(keyNameIndex);
|
2014-05-24 19:08:58 -07:00
|
|
|
aResult->mCodeNameIndex =
|
|
|
|
static_cast<mozilla::CodeNameIndex>(codeNameIndex);
|
2013-10-28 07:05:51 -07:00
|
|
|
aResult->mNativeKeyEvent = nullptr;
|
2013-04-26 00:41:27 -07:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
2011-06-21 17:32:43 -07:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-11-02 23:05:12 -08:00
|
|
|
template<>
|
|
|
|
struct ParamTraits<mozilla::InternalBeforeAfterKeyboardEvent>
|
|
|
|
{
|
|
|
|
typedef mozilla::InternalBeforeAfterKeyboardEvent paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
|
|
{
|
|
|
|
WriteParam(aMsg, static_cast<mozilla::WidgetKeyboardEvent>(aParam));
|
|
|
|
WriteParam(aMsg, aParam.mEmbeddedCancelled.IsNull());
|
|
|
|
WriteParam(aMsg, aParam.mEmbeddedCancelled.Value());
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
|
|
|
bool isNull;
|
|
|
|
bool value;
|
|
|
|
bool rv =
|
|
|
|
ReadParam(aMsg, aIter,
|
|
|
|
static_cast<mozilla::WidgetKeyboardEvent*>(aResult)) &&
|
|
|
|
ReadParam(aMsg, aIter, &isNull) &&
|
|
|
|
ReadParam(aMsg, aIter, &value);
|
|
|
|
|
|
|
|
aResult->mEmbeddedCancelled = Nullable<bool>();
|
2014-11-02 23:06:05 -08:00
|
|
|
if (rv && !isNull) {
|
2014-11-02 23:05:12 -08:00
|
|
|
aResult->mEmbeddedCancelled.SetValue(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-08-17 01:07:42 -07:00
|
|
|
template<>
|
2013-10-01 00:22:59 -07:00
|
|
|
struct ParamTraits<mozilla::TextRangeStyle>
|
2010-08-17 01:07:42 -07:00
|
|
|
{
|
2013-10-01 00:22:59 -07:00
|
|
|
typedef mozilla::TextRangeStyle paramType;
|
2010-08-17 01:07:42 -07: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);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
|
|
|
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 00:22:59 -07:00
|
|
|
struct ParamTraits<mozilla::TextRange>
|
2010-08-17 01:07:42 -07:00
|
|
|
{
|
2013-10-01 00:22:59 -07:00
|
|
|
typedef mozilla::TextRange paramType;
|
2010-08-17 01:07:42 -07:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
|
|
{
|
|
|
|
WriteParam(aMsg, aParam.mStartOffset);
|
|
|
|
WriteParam(aMsg, aParam.mEndOffset);
|
|
|
|
WriteParam(aMsg, aParam.mRangeType);
|
|
|
|
WriteParam(aMsg, aParam.mRangeStyle);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
|
|
|
return ReadParam(aMsg, aIter, &aResult->mStartOffset) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mEndOffset) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mRangeType) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mRangeStyle);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-03-04 05:48:26 -08: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]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
2014-07-08 13:48:18 -07:00
|
|
|
paramType::size_type length;
|
2014-03-04 05:48:26 -08: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 01:07:42 -07:00
|
|
|
template<>
|
2013-10-01 00:23:00 -07:00
|
|
|
struct ParamTraits<mozilla::WidgetCompositionEvent>
|
2010-08-17 01:07:42 -07:00
|
|
|
{
|
2013-10-01 00:23:00 -07:00
|
|
|
typedef mozilla::WidgetCompositionEvent paramType;
|
2010-08-17 01:07:42 -07:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
|
|
{
|
2013-10-01 20:46:03 -07:00
|
|
|
WriteParam(aMsg, static_cast<mozilla::WidgetGUIEvent>(aParam));
|
2014-10-07 03:01:46 -07:00
|
|
|
WriteParam(aMsg, aParam.mData);
|
2014-10-07 03:01:47 -07:00
|
|
|
bool hasRanges = !!aParam.mRanges;
|
|
|
|
WriteParam(aMsg, hasRanges);
|
|
|
|
if (hasRanges) {
|
|
|
|
WriteParam(aMsg, *aParam.mRanges.get());
|
|
|
|
}
|
2010-08-17 01:07:42 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
2014-10-07 03:01:47 -07:00
|
|
|
bool hasRanges;
|
|
|
|
if (!ReadParam(aMsg, aIter,
|
|
|
|
static_cast<mozilla::WidgetGUIEvent*>(aResult)) ||
|
|
|
|
!ReadParam(aMsg, aIter, &aResult->mData) ||
|
|
|
|
!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 01:07:42 -07:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-01-30 23:17:12 -08: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);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
|
|
|
return ReadParam(aMsg, aIter, &aResult->mStartOffset) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mFontName) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mFontSize);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-08-17 01:07:42 -07:00
|
|
|
template<>
|
2013-10-01 00:23:00 -07:00
|
|
|
struct ParamTraits<mozilla::WidgetQueryContentEvent>
|
2010-08-17 01:07:42 -07:00
|
|
|
{
|
2013-10-01 00:23:00 -07:00
|
|
|
typedef mozilla::WidgetQueryContentEvent paramType;
|
2010-08-17 01:07:42 -07:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
|
|
{
|
2013-10-01 20:46:03 -07:00
|
|
|
WriteParam(aMsg, static_cast<mozilla::WidgetGUIEvent>(aParam));
|
2010-08-17 01:07:42 -07:00
|
|
|
WriteParam(aMsg, aParam.mSucceeded);
|
2014-04-25 16:52:12 -07:00
|
|
|
WriteParam(aMsg, aParam.mUseNativeLineBreak);
|
2015-01-30 23:17:12 -08:00
|
|
|
WriteParam(aMsg, aParam.mWithFontRanges);
|
2010-08-17 01:07:42 -07:00
|
|
|
WriteParam(aMsg, aParam.mInput.mOffset);
|
|
|
|
WriteParam(aMsg, aParam.mInput.mLength);
|
|
|
|
WriteParam(aMsg, aParam.mReply.mOffset);
|
2015-04-13 22:27:37 -07:00
|
|
|
WriteParam(aMsg, aParam.mReply.mTentativeCaretOffset);
|
2010-08-17 01:07:42 -07:00
|
|
|
WriteParam(aMsg, aParam.mReply.mString);
|
|
|
|
WriteParam(aMsg, aParam.mReply.mRect);
|
|
|
|
WriteParam(aMsg, aParam.mReply.mReversed);
|
|
|
|
WriteParam(aMsg, aParam.mReply.mHasSelection);
|
2011-03-01 13:15:23 -08:00
|
|
|
WriteParam(aMsg, aParam.mReply.mWidgetIsHit);
|
2015-01-30 23:17:12 -08:00
|
|
|
WriteParam(aMsg, aParam.mReply.mFontRanges);
|
2010-08-17 01:07:42 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
2013-10-01 20:46:03 -07:00
|
|
|
return ReadParam(aMsg, aIter,
|
|
|
|
static_cast<mozilla::WidgetGUIEvent*>(aResult)) &&
|
2010-08-17 01:07:42 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mSucceeded) &&
|
2014-04-25 16:52:12 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mUseNativeLineBreak) &&
|
2015-01-30 23:17:12 -08:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mWithFontRanges) &&
|
2010-08-17 01:07:42 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mInput.mOffset) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mInput.mLength) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mReply.mOffset) &&
|
2015-04-13 22:27:37 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mReply.mTentativeCaretOffset) &&
|
2010-08-17 01:07:42 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mReply.mString) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mReply.mRect) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mReply.mReversed) &&
|
2011-03-22 11:18:17 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mReply.mHasSelection) &&
|
2015-01-30 23:17:12 -08:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mReply.mWidgetIsHit) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mReply.mFontRanges);
|
2010-08-17 01:07:42 -07:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
template<>
|
2013-10-01 00:23:01 -07:00
|
|
|
struct ParamTraits<mozilla::WidgetSelectionEvent>
|
2010-08-17 01:07:42 -07:00
|
|
|
{
|
2013-10-01 00:23:01 -07:00
|
|
|
typedef mozilla::WidgetSelectionEvent paramType;
|
2010-08-17 01:07:42 -07:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
|
|
{
|
2013-10-01 20:46:03 -07:00
|
|
|
WriteParam(aMsg, static_cast<mozilla::WidgetGUIEvent>(aParam));
|
2010-08-17 01:07:42 -07:00
|
|
|
WriteParam(aMsg, aParam.mOffset);
|
|
|
|
WriteParam(aMsg, aParam.mLength);
|
|
|
|
WriteParam(aMsg, aParam.mReversed);
|
|
|
|
WriteParam(aMsg, aParam.mExpandToClusterBoundary);
|
|
|
|
WriteParam(aMsg, aParam.mSucceeded);
|
2014-04-25 16:52:12 -07:00
|
|
|
WriteParam(aMsg, aParam.mUseNativeLineBreak);
|
2010-08-17 01:07:42 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
2013-10-01 20:46:03 -07:00
|
|
|
return ReadParam(aMsg, aIter,
|
|
|
|
static_cast<mozilla::WidgetGUIEvent*>(aResult)) &&
|
2010-08-17 01:07:42 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mOffset) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mLength) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mReversed) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mExpandToClusterBoundary) &&
|
2014-04-25 16:52:12 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mSucceeded) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mUseNativeLineBreak);
|
2010-08-17 01:07:42 -07:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-09-23 20:28:15 -07:00
|
|
|
template<>
|
|
|
|
struct ParamTraits<nsIMEUpdatePreference>
|
|
|
|
{
|
|
|
|
typedef nsIMEUpdatePreference paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
|
|
{
|
|
|
|
WriteParam(aMsg, aParam.mWantUpdates);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
2014-01-29 01:32:35 -08:00
|
|
|
return ReadParam(aMsg, aIter, &aResult->mWantUpdates);
|
2010-09-23 20:28:15 -07:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-07-16 21:30:01 -07: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);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
|
|
|
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 09:43:41 -07:00
|
|
|
struct ParamTraits<mozilla::widget::IMENotification::SelectionChangeDataBase>
|
2015-07-16 21:30:01 -07:00
|
|
|
{
|
2015-08-21 09:43:41 -07:00
|
|
|
typedef mozilla::widget::IMENotification::SelectionChangeDataBase paramType;
|
2015-07-16 21:30:01 -07:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
|
|
{
|
2015-07-21 20:40:32 -07:00
|
|
|
MOZ_RELEASE_ASSERT(aParam.mString);
|
2015-07-16 21:30:01 -07:00
|
|
|
WriteParam(aMsg, aParam.mOffset);
|
2015-07-21 20:40:32 -07:00
|
|
|
WriteParam(aMsg, *aParam.mString);
|
2015-07-16 21:30:01 -07:00
|
|
|
WriteParam(aMsg, aParam.mWritingMode);
|
|
|
|
WriteParam(aMsg, aParam.mReversed);
|
|
|
|
WriteParam(aMsg, aParam.mCausedByComposition);
|
|
|
|
WriteParam(aMsg, aParam.mCausedBySelectionEvent);
|
2015-10-26 15:21:37 -07:00
|
|
|
WriteParam(aMsg, aParam.mOccurredDuringComposition);
|
2015-07-16 21:30:01 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
2015-07-21 20:40:32 -07:00
|
|
|
aResult->mString = new nsString();
|
2015-07-16 21:30:01 -07:00
|
|
|
return ReadParam(aMsg, aIter, &aResult->mOffset) &&
|
2015-07-21 20:40:32 -07:00
|
|
|
ReadParam(aMsg, aIter, aResult->mString) &&
|
2015-07-16 21:30:01 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mWritingMode) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mReversed) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mCausedByComposition) &&
|
2015-10-26 15:21:37 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mCausedBySelectionEvent) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mOccurredDuringComposition);
|
2015-07-16 21:30:01 -07: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);
|
|
|
|
WriteParam(aMsg, aParam.mCausedByComposition);
|
2015-10-26 15:21:37 -07:00
|
|
|
WriteParam(aMsg, aParam.mOccurredDuringComposition);
|
2015-07-16 21:30:01 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
|
|
|
return ReadParam(aMsg, aIter, &aResult->mStartOffset) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mRemovedEndOffset) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mAddedEndOffset) &&
|
2015-10-26 15:21:37 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mCausedByComposition) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mOccurredDuringComposition);
|
2015-07-16 21:30:01 -07: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);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
|
|
|
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 06:46:17 -07: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-16 21:30:01 -07:00
|
|
|
WriteParam(aMsg, aParam.mSelectionChangeData);
|
2014-09-11 06:46:17 -07:00
|
|
|
return;
|
|
|
|
case mozilla::widget::NOTIFY_IME_OF_TEXT_CHANGE:
|
2015-07-16 21:30:01 -07:00
|
|
|
WriteParam(aMsg, aParam.mTextChangeData);
|
2014-09-11 06:46:17 -07:00
|
|
|
return;
|
|
|
|
case mozilla::widget::NOTIFY_IME_OF_MOUSE_BUTTON_EVENT:
|
2015-07-16 21:30:01 -07:00
|
|
|
WriteParam(aMsg, aParam.mMouseButtonEventData);
|
2014-09-11 06:46:17 -07:00
|
|
|
return;
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
|
|
|
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-16 21:30:01 -07:00
|
|
|
return ReadParam(aMsg, aIter, &aResult->mSelectionChangeData);
|
2014-09-11 06:46:17 -07:00
|
|
|
case mozilla::widget::NOTIFY_IME_OF_TEXT_CHANGE:
|
2015-07-16 21:30:01 -07:00
|
|
|
return ReadParam(aMsg, aIter, &aResult->mTextChangeData);
|
2014-09-11 06:46:17 -07:00
|
|
|
case mozilla::widget::NOTIFY_IME_OF_MOUSE_BUTTON_EVENT:
|
2015-07-16 21:30:01 -07:00
|
|
|
return ReadParam(aMsg, aIter, &aResult->mMouseButtonEventData);
|
2014-09-11 06:46:17 -07:00
|
|
|
default:
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2011-05-10 21:52:44 -07:00
|
|
|
template<>
|
2013-09-26 23:20:54 -07:00
|
|
|
struct ParamTraits<mozilla::WidgetPluginEvent>
|
2011-05-10 21:52:44 -07:00
|
|
|
{
|
2013-09-26 23:20:54 -07:00
|
|
|
typedef mozilla::WidgetPluginEvent paramType;
|
2011-05-10 21:52:44 -07:00
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
|
|
{
|
2013-10-01 20:46:03 -07:00
|
|
|
WriteParam(aMsg, static_cast<mozilla::WidgetGUIEvent>(aParam));
|
2011-05-10 21:52:44 -07:00
|
|
|
WriteParam(aMsg, aParam.retargetToFocusedDocument);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
2013-10-01 20:46:03 -07:00
|
|
|
return ReadParam(aMsg, aIter,
|
|
|
|
static_cast<mozilla::WidgetGUIEvent*>(aResult)) &&
|
2011-05-10 21:52:44 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->retargetToFocusedDocument);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-12-04 18:15:43 -08:00
|
|
|
template<>
|
|
|
|
struct ParamTraits<mozilla::WritingMode>
|
|
|
|
{
|
|
|
|
typedef mozilla::WritingMode paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
|
|
{
|
|
|
|
WriteParam(aMsg, aParam.mWritingMode);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
|
|
|
return ReadParam(aMsg, aIter, &aResult->mWritingMode);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-06-05 02:28:19 -07:00
|
|
|
template<>
|
|
|
|
struct ParamTraits<mozilla::ContentCache>
|
|
|
|
{
|
|
|
|
typedef mozilla::ContentCache paramType;
|
|
|
|
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
|
|
{
|
|
|
|
WriteParam(aMsg, aParam.mText);
|
|
|
|
WriteParam(aMsg, aParam.mSelection.mAnchor);
|
|
|
|
WriteParam(aMsg, aParam.mSelection.mFocus);
|
|
|
|
WriteParam(aMsg, aParam.mSelection.mWritingMode);
|
2015-06-05 02:28:20 -07:00
|
|
|
WriteParam(aMsg, aParam.mSelection.mAnchorCharRect);
|
|
|
|
WriteParam(aMsg, aParam.mSelection.mFocusCharRect);
|
2015-06-07 19:46:17 -07:00
|
|
|
WriteParam(aMsg, aParam.mSelection.mRect);
|
2015-06-16 18:03:58 -07:00
|
|
|
WriteParam(aMsg, aParam.mFirstCharRect);
|
2015-06-05 02:28:19 -07: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);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
|
|
{
|
|
|
|
return ReadParam(aMsg, aIter, &aResult->mText) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mSelection.mAnchor) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mSelection.mFocus) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mSelection.mWritingMode) &&
|
2015-06-05 02:28:20 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mSelection.mAnchorCharRect) &&
|
|
|
|
ReadParam(aMsg, aIter, &aResult->mSelection.mFocusCharRect) &&
|
2015-06-07 19:46:17 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mSelection.mRect) &&
|
2015-06-16 18:03:58 -07:00
|
|
|
ReadParam(aMsg, aIter, &aResult->mFirstCharRect) &&
|
2015-06-05 02:28:19 -07: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);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2010-08-17 01:07:42 -07:00
|
|
|
} // namespace IPC
|
|
|
|
|
|
|
|
#endif // nsGUIEventIPC_h__
|
|
|
|
|