/work/obj-fuzz/dist/include/ipc/nsGUIEventIPC.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
3 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
4 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
5 | | |
6 | | #ifndef nsGUIEventIPC_h__ |
7 | | #define nsGUIEventIPC_h__ |
8 | | |
9 | | #include "ipc/IPCMessageUtils.h" |
10 | | #include "mozilla/ContentCache.h" |
11 | | #include "mozilla/GfxMessageUtils.h" |
12 | | #include "mozilla/dom/Touch.h" |
13 | | #include "mozilla/MiscEvents.h" |
14 | | #include "mozilla/MouseEvents.h" |
15 | | #include "mozilla/TextEvents.h" |
16 | | #include "mozilla/TouchEvents.h" |
17 | | #include "mozilla/WheelHandlingHelper.h" // for WheelDeltaAdjustmentStrategy |
18 | | #include "mozilla/dom/Selection.h" |
19 | | #include "InputData.h" |
20 | | |
21 | | namespace IPC |
22 | | { |
23 | | |
24 | | template<> |
25 | | struct ParamTraits<mozilla::EventMessage> : |
26 | | public ContiguousEnumSerializer<mozilla::EventMessage, |
27 | | mozilla::EventMessage(0), |
28 | | mozilla::EventMessage::eEventMessage_MaxValue> |
29 | | {}; |
30 | | |
31 | | template<> |
32 | | struct ParamTraits<mozilla::BaseEventFlags> |
33 | | { |
34 | | typedef mozilla::BaseEventFlags paramType; |
35 | | |
36 | | static void Write(Message* aMsg, const paramType& aParam) |
37 | 0 | { |
38 | 0 | aMsg->WriteBytes(&aParam, sizeof(aParam)); |
39 | 0 | } |
40 | | |
41 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
42 | 0 | { |
43 | 0 | return aMsg->ReadBytesInto(aIter, aResult, sizeof(*aResult)); |
44 | 0 | } |
45 | | }; |
46 | | |
47 | | template<> |
48 | | struct ParamTraits<mozilla::WidgetEvent> |
49 | | { |
50 | | typedef mozilla::WidgetEvent paramType; |
51 | | |
52 | | static void Write(Message* aMsg, const paramType& aParam) |
53 | 0 | { |
54 | 0 | // Mark the event as posted to another process. |
55 | 0 | const_cast<mozilla::WidgetEvent&>(aParam).MarkAsPostedToRemoteProcess(); |
56 | 0 |
|
57 | 0 | WriteParam(aMsg, |
58 | 0 | static_cast<mozilla::EventClassIDType>(aParam.mClass)); |
59 | 0 | WriteParam(aMsg, aParam.mMessage); |
60 | 0 | WriteParam(aMsg, aParam.mRefPoint); |
61 | 0 | WriteParam(aMsg, aParam.mFocusSequenceNumber); |
62 | 0 | WriteParam(aMsg, aParam.mTime); |
63 | 0 | WriteParam(aMsg, aParam.mTimeStamp); |
64 | 0 | WriteParam(aMsg, aParam.mFlags); |
65 | 0 | } |
66 | | |
67 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
68 | 0 | { |
69 | 0 | mozilla::EventClassIDType eventClassID = 0; |
70 | 0 | bool ret = ReadParam(aMsg, aIter, &eventClassID) && |
71 | 0 | ReadParam(aMsg, aIter, &aResult->mMessage) && |
72 | 0 | ReadParam(aMsg, aIter, &aResult->mRefPoint) && |
73 | 0 | ReadParam(aMsg, aIter, &aResult->mFocusSequenceNumber) && |
74 | 0 | ReadParam(aMsg, aIter, &aResult->mTime) && |
75 | 0 | ReadParam(aMsg, aIter, &aResult->mTimeStamp) && |
76 | 0 | ReadParam(aMsg, aIter, &aResult->mFlags); |
77 | 0 | aResult->mClass = static_cast<mozilla::EventClassID>(eventClassID); |
78 | 0 | if (ret) { |
79 | 0 | // Reset cross process dispatching state here because the event has not |
80 | 0 | // been dispatched to different process from current process. |
81 | 0 | aResult->ResetCrossProcessDispatchingState(); |
82 | 0 | } |
83 | 0 | return ret; |
84 | 0 | } |
85 | | }; |
86 | | |
87 | | template<> |
88 | | struct ParamTraits<mozilla::NativeEventData> |
89 | | { |
90 | | typedef mozilla::NativeEventData paramType; |
91 | | |
92 | | static void Write(Message* aMsg, const paramType& aParam) |
93 | 0 | { |
94 | 0 | WriteParam(aMsg, aParam.mBuffer); |
95 | 0 | } |
96 | | |
97 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
98 | 0 | { |
99 | 0 | return ReadParam(aMsg, aIter, &aResult->mBuffer); |
100 | 0 | } |
101 | | }; |
102 | | |
103 | | template<> |
104 | | struct ParamTraits<mozilla::WidgetGUIEvent> |
105 | | { |
106 | | typedef mozilla::WidgetGUIEvent paramType; |
107 | | |
108 | | static void Write(Message* aMsg, const paramType& aParam) |
109 | 0 | { |
110 | 0 | WriteParam(aMsg, static_cast<const mozilla::WidgetEvent&>(aParam)); |
111 | 0 | WriteParam(aMsg, aParam.mPluginEvent); |
112 | 0 | } |
113 | | |
114 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
115 | 0 | { |
116 | 0 | return ReadParam(aMsg, aIter, static_cast<mozilla::WidgetEvent*>(aResult)) && |
117 | 0 | ReadParam(aMsg, aIter, &aResult->mPluginEvent); |
118 | 0 | } |
119 | | }; |
120 | | |
121 | | template<> |
122 | | struct ParamTraits<mozilla::WidgetInputEvent> |
123 | | { |
124 | | typedef mozilla::WidgetInputEvent paramType; |
125 | | |
126 | | static void Write(Message* aMsg, const paramType& aParam) |
127 | 0 | { |
128 | 0 | WriteParam(aMsg, static_cast<const mozilla::WidgetGUIEvent&>(aParam)); |
129 | 0 | WriteParam(aMsg, aParam.mModifiers); |
130 | 0 | } |
131 | | |
132 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
133 | 0 | { |
134 | 0 | return ReadParam(aMsg, aIter, |
135 | 0 | static_cast<mozilla::WidgetGUIEvent*>(aResult)) && |
136 | 0 | ReadParam(aMsg, aIter, &aResult->mModifiers); |
137 | 0 | } |
138 | | }; |
139 | | |
140 | | template<> |
141 | | struct ParamTraits<mozilla::WidgetMouseEventBase> |
142 | | { |
143 | | typedef mozilla::WidgetMouseEventBase paramType; |
144 | | |
145 | | static void Write(Message* aMsg, const paramType& aParam) |
146 | 0 | { |
147 | 0 | WriteParam(aMsg, static_cast<const mozilla::WidgetInputEvent&>(aParam)); |
148 | 0 | WriteParam(aMsg, aParam.button); |
149 | 0 | WriteParam(aMsg, aParam.buttons); |
150 | 0 | WriteParam(aMsg, aParam.pressure); |
151 | 0 | WriteParam(aMsg, aParam.hitCluster); |
152 | 0 | WriteParam(aMsg, aParam.inputSource); |
153 | 0 | } |
154 | | |
155 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
156 | 0 | { |
157 | 0 | return ReadParam(aMsg, aIter, |
158 | 0 | static_cast<mozilla::WidgetInputEvent*>(aResult)) && |
159 | 0 | ReadParam(aMsg, aIter, &aResult->button) && |
160 | 0 | ReadParam(aMsg, aIter, &aResult->buttons) && |
161 | 0 | ReadParam(aMsg, aIter, &aResult->pressure) && |
162 | 0 | ReadParam(aMsg, aIter, &aResult->hitCluster) && |
163 | 0 | ReadParam(aMsg, aIter, &aResult->inputSource); |
164 | 0 | } |
165 | | }; |
166 | | |
167 | | template<> |
168 | | struct ParamTraits<mozilla::WidgetWheelEvent> |
169 | | { |
170 | | typedef mozilla::WidgetWheelEvent paramType; |
171 | | |
172 | | static void Write(Message* aMsg, const paramType& aParam) |
173 | 0 | { |
174 | 0 | WriteParam(aMsg, static_cast<const mozilla::WidgetMouseEventBase&>(aParam)); |
175 | 0 | WriteParam(aMsg, aParam.mDeltaX); |
176 | 0 | WriteParam(aMsg, aParam.mDeltaY); |
177 | 0 | WriteParam(aMsg, aParam.mDeltaZ); |
178 | 0 | WriteParam(aMsg, aParam.mDeltaMode); |
179 | 0 | WriteParam(aMsg, aParam.mCustomizedByUserPrefs); |
180 | 0 | WriteParam(aMsg, aParam.mMayHaveMomentum); |
181 | 0 | WriteParam(aMsg, aParam.mIsMomentum); |
182 | 0 | WriteParam(aMsg, aParam.mIsNoLineOrPageDelta); |
183 | 0 | WriteParam(aMsg, aParam.mLineOrPageDeltaX); |
184 | 0 | WriteParam(aMsg, aParam.mLineOrPageDeltaY); |
185 | 0 | WriteParam(aMsg, static_cast<uint8_t>(aParam.mScrollType)); |
186 | 0 | WriteParam(aMsg, aParam.mOverflowDeltaX); |
187 | 0 | WriteParam(aMsg, aParam.mOverflowDeltaY); |
188 | 0 | WriteParam(aMsg, aParam.mViewPortIsOverscrolled); |
189 | 0 | WriteParam(aMsg, aParam.mCanTriggerSwipe); |
190 | 0 | WriteParam(aMsg, aParam.mAllowToOverrideSystemScrollSpeed); |
191 | 0 | WriteParam(aMsg, aParam.mDeltaValuesHorizontalizedForDefaultHandler); |
192 | 0 | } |
193 | | |
194 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
195 | 0 | { |
196 | 0 | uint8_t scrollType = 0; |
197 | 0 | bool rv = |
198 | 0 | ReadParam(aMsg, aIter, |
199 | 0 | static_cast<mozilla::WidgetMouseEventBase*>(aResult)) && |
200 | 0 | ReadParam(aMsg, aIter, &aResult->mDeltaX) && |
201 | 0 | ReadParam(aMsg, aIter, &aResult->mDeltaY) && |
202 | 0 | ReadParam(aMsg, aIter, &aResult->mDeltaZ) && |
203 | 0 | ReadParam(aMsg, aIter, &aResult->mDeltaMode) && |
204 | 0 | ReadParam(aMsg, aIter, &aResult->mCustomizedByUserPrefs) && |
205 | 0 | ReadParam(aMsg, aIter, &aResult->mMayHaveMomentum) && |
206 | 0 | ReadParam(aMsg, aIter, &aResult->mIsMomentum) && |
207 | 0 | ReadParam(aMsg, aIter, &aResult->mIsNoLineOrPageDelta) && |
208 | 0 | ReadParam(aMsg, aIter, &aResult->mLineOrPageDeltaX) && |
209 | 0 | ReadParam(aMsg, aIter, &aResult->mLineOrPageDeltaY) && |
210 | 0 | ReadParam(aMsg, aIter, &scrollType) && |
211 | 0 | ReadParam(aMsg, aIter, &aResult->mOverflowDeltaX) && |
212 | 0 | ReadParam(aMsg, aIter, &aResult->mOverflowDeltaY) && |
213 | 0 | ReadParam(aMsg, aIter, &aResult->mViewPortIsOverscrolled) && |
214 | 0 | ReadParam(aMsg, aIter, &aResult->mCanTriggerSwipe) && |
215 | 0 | ReadParam(aMsg, aIter, &aResult->mAllowToOverrideSystemScrollSpeed) && |
216 | 0 | ReadParam(aMsg, aIter, |
217 | 0 | &aResult->mDeltaValuesHorizontalizedForDefaultHandler); |
218 | 0 | aResult->mScrollType = |
219 | 0 | static_cast<mozilla::WidgetWheelEvent::ScrollType>(scrollType); |
220 | 0 | return rv; |
221 | 0 | } |
222 | | }; |
223 | | |
224 | | template<> |
225 | | struct ParamTraits<mozilla::WidgetPointerHelper> |
226 | | { |
227 | | typedef mozilla::WidgetPointerHelper paramType; |
228 | | |
229 | | static void Write(Message* aMsg, const paramType& aParam) |
230 | 0 | { |
231 | 0 | WriteParam(aMsg, aParam.pointerId); |
232 | 0 | WriteParam(aMsg, aParam.tiltX); |
233 | 0 | WriteParam(aMsg, aParam.tiltY); |
234 | 0 | WriteParam(aMsg, aParam.twist); |
235 | 0 | WriteParam(aMsg, aParam.tangentialPressure); |
236 | 0 | // We don't serialize convertToPointer since it's temporarily variable and |
237 | 0 | // should be reset to default. |
238 | 0 | } |
239 | | |
240 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
241 | 0 | { |
242 | 0 | bool rv; |
243 | 0 | rv = ReadParam(aMsg, aIter, &aResult->pointerId) && |
244 | 0 | ReadParam(aMsg, aIter, &aResult->tiltX) && |
245 | 0 | ReadParam(aMsg, aIter, &aResult->tiltY) && |
246 | 0 | ReadParam(aMsg, aIter, &aResult->twist) && |
247 | 0 | ReadParam(aMsg, aIter, &aResult->tangentialPressure); |
248 | 0 | return rv; |
249 | 0 | } |
250 | | }; |
251 | | |
252 | | template<> |
253 | | struct ParamTraits<mozilla::WidgetMouseEvent> |
254 | | { |
255 | | typedef mozilla::WidgetMouseEvent paramType; |
256 | | |
257 | | static void Write(Message* aMsg, const paramType& aParam) |
258 | 0 | { |
259 | 0 | WriteParam(aMsg, static_cast<const mozilla::WidgetMouseEventBase&>(aParam)); |
260 | 0 | WriteParam(aMsg, static_cast<const mozilla::WidgetPointerHelper&>(aParam)); |
261 | 0 | WriteParam(aMsg, aParam.mIgnoreRootScrollFrame); |
262 | 0 | WriteParam(aMsg, static_cast<paramType::ReasonType>(aParam.mReason)); |
263 | 0 | WriteParam(aMsg, static_cast<paramType::ContextMenuTriggerType>( |
264 | 0 | aParam.mContextMenuTrigger)); |
265 | 0 | WriteParam(aMsg, static_cast<paramType::ExitFromType>(aParam.mExitFrom)); |
266 | 0 | WriteParam(aMsg, aParam.mClickCount); |
267 | 0 | } |
268 | | |
269 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
270 | 0 | { |
271 | 0 | bool rv; |
272 | 0 | paramType::ReasonType reason = 0; |
273 | 0 | paramType::ContextMenuTriggerType contextMenuTrigger = 0; |
274 | 0 | paramType::ExitFromType exitFrom = 0; |
275 | 0 | rv = ReadParam(aMsg, aIter, |
276 | 0 | static_cast<mozilla::WidgetMouseEventBase*>(aResult)) && |
277 | 0 | ReadParam(aMsg, aIter, |
278 | 0 | static_cast<mozilla::WidgetPointerHelper*>(aResult)) && |
279 | 0 | ReadParam(aMsg, aIter, &aResult->mIgnoreRootScrollFrame) && |
280 | 0 | ReadParam(aMsg, aIter, &reason) && |
281 | 0 | ReadParam(aMsg, aIter, &contextMenuTrigger) && |
282 | 0 | ReadParam(aMsg, aIter, &exitFrom) && |
283 | 0 | ReadParam(aMsg, aIter, &aResult->mClickCount); |
284 | 0 | aResult->mReason = static_cast<paramType::Reason>(reason); |
285 | 0 | aResult->mContextMenuTrigger = |
286 | 0 | static_cast<paramType::ContextMenuTrigger>(contextMenuTrigger); |
287 | 0 | aResult->mExitFrom = static_cast<paramType::ExitFrom>(exitFrom); |
288 | 0 | return rv; |
289 | 0 | } |
290 | | }; |
291 | | |
292 | | |
293 | | template<> |
294 | | struct ParamTraits<mozilla::WidgetDragEvent> |
295 | | { |
296 | | typedef mozilla::WidgetDragEvent paramType; |
297 | | |
298 | | static void Write(Message* aMsg, const paramType& aParam) |
299 | 0 | { |
300 | 0 | WriteParam(aMsg, static_cast<const mozilla::WidgetMouseEvent&>(aParam)); |
301 | 0 | WriteParam(aMsg, aParam.mUserCancelled); |
302 | 0 | WriteParam(aMsg, aParam.mDefaultPreventedOnContent); |
303 | 0 | } |
304 | | |
305 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
306 | 0 | { |
307 | 0 | bool rv = |
308 | 0 | ReadParam(aMsg, aIter, static_cast<mozilla::WidgetMouseEvent*>(aResult)) && |
309 | 0 | ReadParam(aMsg, aIter, &aResult->mUserCancelled) && |
310 | 0 | ReadParam(aMsg, aIter, &aResult->mDefaultPreventedOnContent); |
311 | 0 | return rv; |
312 | 0 | } |
313 | | }; |
314 | | |
315 | | template<> |
316 | | struct ParamTraits<mozilla::WidgetPointerEvent> |
317 | | { |
318 | | typedef mozilla::WidgetPointerEvent paramType; |
319 | | |
320 | | static void Write(Message* aMsg, const paramType& aParam) |
321 | 0 | { |
322 | 0 | WriteParam(aMsg, static_cast<const mozilla::WidgetMouseEvent&>(aParam)); |
323 | 0 | WriteParam(aMsg, aParam.mWidth); |
324 | 0 | WriteParam(aMsg, aParam.mHeight); |
325 | 0 | WriteParam(aMsg, aParam.mIsPrimary); |
326 | 0 | } |
327 | | |
328 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
329 | 0 | { |
330 | 0 | bool rv = |
331 | 0 | ReadParam(aMsg, aIter, static_cast<mozilla::WidgetMouseEvent*>(aResult)) && |
332 | 0 | ReadParam(aMsg, aIter, &aResult->mWidth) && |
333 | 0 | ReadParam(aMsg, aIter, &aResult->mHeight) && |
334 | 0 | ReadParam(aMsg, aIter, &aResult->mIsPrimary); |
335 | 0 | return rv; |
336 | 0 | } |
337 | | }; |
338 | | |
339 | | template<> |
340 | | struct ParamTraits<mozilla::WidgetTouchEvent> |
341 | | { |
342 | | typedef mozilla::WidgetTouchEvent paramType; |
343 | | |
344 | | static void Write(Message* aMsg, const paramType& aParam) |
345 | 0 | { |
346 | 0 | WriteParam(aMsg, static_cast<const mozilla::WidgetInputEvent&>(aParam)); |
347 | 0 | // Sigh, Touch bites us again! We want to be able to do |
348 | 0 | // WriteParam(aMsg, aParam.mTouches); |
349 | 0 | const paramType::TouchArray& touches = aParam.mTouches; |
350 | 0 | WriteParam(aMsg, touches.Length()); |
351 | 0 | for (uint32_t i = 0; i < touches.Length(); ++i) { |
352 | 0 | mozilla::dom::Touch* touch = touches[i]; |
353 | 0 | WriteParam(aMsg, touch->mIdentifier); |
354 | 0 | WriteParam(aMsg, touch->mRefPoint); |
355 | 0 | WriteParam(aMsg, touch->mRadius); |
356 | 0 | WriteParam(aMsg, touch->mRotationAngle); |
357 | 0 | WriteParam(aMsg, touch->mForce); |
358 | 0 | } |
359 | 0 | } |
360 | | |
361 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
362 | 0 | { |
363 | 0 | paramType::TouchArray::size_type numTouches; |
364 | 0 | if (!ReadParam(aMsg, aIter, |
365 | 0 | static_cast<mozilla::WidgetInputEvent*>(aResult)) || |
366 | 0 | !ReadParam(aMsg, aIter, &numTouches)) { |
367 | 0 | return false; |
368 | 0 | } |
369 | 0 | for (uint32_t i = 0; i < numTouches; ++i) { |
370 | 0 | int32_t identifier; |
371 | 0 | mozilla::LayoutDeviceIntPoint refPoint; |
372 | 0 | mozilla::LayoutDeviceIntPoint radius; |
373 | 0 | float rotationAngle; |
374 | 0 | float force; |
375 | 0 | if (!ReadParam(aMsg, aIter, &identifier) || |
376 | 0 | !ReadParam(aMsg, aIter, &refPoint) || |
377 | 0 | !ReadParam(aMsg, aIter, &radius) || |
378 | 0 | !ReadParam(aMsg, aIter, &rotationAngle) || |
379 | 0 | !ReadParam(aMsg, aIter, &force)) { |
380 | 0 | return false; |
381 | 0 | } |
382 | 0 | aResult->mTouches.AppendElement( |
383 | 0 | new mozilla::dom::Touch( |
384 | 0 | identifier, refPoint, radius, rotationAngle, force)); |
385 | 0 | } |
386 | 0 | return true; |
387 | 0 | } |
388 | | }; |
389 | | |
390 | | template<> |
391 | | struct ParamTraits<mozilla::AlternativeCharCode> |
392 | | { |
393 | | typedef mozilla::AlternativeCharCode paramType; |
394 | | |
395 | | static void Write(Message* aMsg, const paramType& aParam) |
396 | 0 | { |
397 | 0 | WriteParam(aMsg, aParam.mUnshiftedCharCode); |
398 | 0 | WriteParam(aMsg, aParam.mShiftedCharCode); |
399 | 0 | } |
400 | | |
401 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
402 | 0 | { |
403 | 0 | return ReadParam(aMsg, aIter, &aResult->mUnshiftedCharCode) && |
404 | 0 | ReadParam(aMsg, aIter, &aResult->mShiftedCharCode); |
405 | 0 | } |
406 | | }; |
407 | | |
408 | | template<> |
409 | | struct ParamTraits<mozilla::ShortcutKeyCandidate> |
410 | | { |
411 | | typedef mozilla::ShortcutKeyCandidate paramType; |
412 | | |
413 | | static void Write(Message* aMsg, const paramType& aParam) |
414 | 0 | { |
415 | 0 | WriteParam(aMsg, aParam.mCharCode); |
416 | 0 | WriteParam(aMsg, aParam.mIgnoreShift); |
417 | 0 | } |
418 | | |
419 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
420 | 0 | { |
421 | 0 | return ReadParam(aMsg, aIter, &aResult->mCharCode) && |
422 | 0 | ReadParam(aMsg, aIter, &aResult->mIgnoreShift); |
423 | 0 | } |
424 | | }; |
425 | | |
426 | | template<> |
427 | | struct ParamTraits<mozilla::WidgetKeyboardEvent> |
428 | | { |
429 | | typedef mozilla::WidgetKeyboardEvent paramType; |
430 | | |
431 | | static void Write(Message* aMsg, const paramType& aParam) |
432 | 0 | { |
433 | 0 | WriteParam(aMsg, static_cast<const mozilla::WidgetInputEvent&>(aParam)); |
434 | 0 | WriteParam(aMsg, |
435 | 0 | static_cast<mozilla::KeyNameIndexType>(aParam.mKeyNameIndex)); |
436 | 0 | WriteParam(aMsg, |
437 | 0 | static_cast<mozilla::CodeNameIndexType>(aParam.mCodeNameIndex)); |
438 | 0 | WriteParam(aMsg, aParam.mKeyValue); |
439 | 0 | WriteParam(aMsg, aParam.mCodeValue); |
440 | 0 | WriteParam(aMsg, aParam.mKeyCode); |
441 | 0 | WriteParam(aMsg, aParam.mCharCode); |
442 | 0 | WriteParam(aMsg, aParam.mPseudoCharCode); |
443 | 0 | WriteParam(aMsg, aParam.mAlternativeCharCodes); |
444 | 0 | WriteParam(aMsg, aParam.mIsRepeat); |
445 | 0 | WriteParam(aMsg, aParam.mLocation); |
446 | 0 | WriteParam(aMsg, aParam.mUniqueId); |
447 | 0 | WriteParam(aMsg, aParam.mIsSynthesizedByTIP); |
448 | 0 | WriteParam(aMsg, aParam.mMaybeSkippableInRemoteProcess); |
449 | | #ifdef XP_MACOSX |
450 | | WriteParam(aMsg, aParam.mNativeKeyCode); |
451 | | WriteParam(aMsg, aParam.mNativeModifierFlags); |
452 | | WriteParam(aMsg, aParam.mNativeCharacters); |
453 | | WriteParam(aMsg, aParam.mNativeCharactersIgnoringModifiers); |
454 | | WriteParam(aMsg, aParam.mPluginTextEventString); |
455 | | #endif |
456 | |
|
457 | 0 | // An OS-specific native event might be attached in |mNativeKeyEvent|, but |
458 | 0 | // that cannot be copied across process boundaries. |
459 | 0 |
|
460 | 0 | WriteParam(aMsg, aParam.mEditCommandsForSingleLineEditor); |
461 | 0 | WriteParam(aMsg, aParam.mEditCommandsForMultiLineEditor); |
462 | 0 | WriteParam(aMsg, aParam.mEditCommandsForRichTextEditor); |
463 | 0 | WriteParam(aMsg, aParam.mEditCommandsForSingleLineEditorInitialized); |
464 | 0 | WriteParam(aMsg, aParam.mEditCommandsForMultiLineEditorInitialized); |
465 | 0 | WriteParam(aMsg, aParam.mEditCommandsForRichTextEditorInitialized); |
466 | 0 | } |
467 | | |
468 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
469 | 0 | { |
470 | 0 | mozilla::KeyNameIndexType keyNameIndex = 0; |
471 | 0 | mozilla::CodeNameIndexType codeNameIndex = 0; |
472 | 0 | if (ReadParam(aMsg, aIter, |
473 | 0 | static_cast<mozilla::WidgetInputEvent*>(aResult)) && |
474 | 0 | ReadParam(aMsg, aIter, &keyNameIndex) && |
475 | 0 | ReadParam(aMsg, aIter, &codeNameIndex) && |
476 | 0 | ReadParam(aMsg, aIter, &aResult->mKeyValue) && |
477 | 0 | ReadParam(aMsg, aIter, &aResult->mCodeValue) && |
478 | 0 | ReadParam(aMsg, aIter, &aResult->mKeyCode) && |
479 | 0 | ReadParam(aMsg, aIter, &aResult->mCharCode) && |
480 | 0 | ReadParam(aMsg, aIter, &aResult->mPseudoCharCode) && |
481 | 0 | ReadParam(aMsg, aIter, &aResult->mAlternativeCharCodes) && |
482 | 0 | ReadParam(aMsg, aIter, &aResult->mIsRepeat) && |
483 | 0 | ReadParam(aMsg, aIter, &aResult->mLocation) && |
484 | 0 | ReadParam(aMsg, aIter, &aResult->mUniqueId) && |
485 | 0 | ReadParam(aMsg, aIter, &aResult->mIsSynthesizedByTIP) && |
486 | 0 | ReadParam(aMsg, aIter, &aResult->mMaybeSkippableInRemoteProcess) && |
487 | | #ifdef XP_MACOSX |
488 | | ReadParam(aMsg, aIter, &aResult->mNativeKeyCode) && |
489 | | ReadParam(aMsg, aIter, &aResult->mNativeModifierFlags) && |
490 | | ReadParam(aMsg, aIter, &aResult->mNativeCharacters) && |
491 | | ReadParam(aMsg, aIter, &aResult->mNativeCharactersIgnoringModifiers) && |
492 | | ReadParam(aMsg, aIter, &aResult->mPluginTextEventString) && |
493 | | #endif |
494 | 0 | ReadParam(aMsg, aIter, &aResult->mEditCommandsForSingleLineEditor) && |
495 | 0 | ReadParam(aMsg, aIter, &aResult->mEditCommandsForMultiLineEditor) && |
496 | 0 | ReadParam(aMsg, aIter, &aResult->mEditCommandsForRichTextEditor) && |
497 | 0 | ReadParam(aMsg, aIter, |
498 | 0 | &aResult->mEditCommandsForSingleLineEditorInitialized) && |
499 | 0 | ReadParam(aMsg, aIter, |
500 | 0 | &aResult->mEditCommandsForMultiLineEditorInitialized) && |
501 | 0 | ReadParam(aMsg, aIter, |
502 | 0 | &aResult->mEditCommandsForRichTextEditorInitialized)) { |
503 | 0 | aResult->mKeyNameIndex = static_cast<mozilla::KeyNameIndex>(keyNameIndex); |
504 | 0 | aResult->mCodeNameIndex = |
505 | 0 | static_cast<mozilla::CodeNameIndex>(codeNameIndex); |
506 | 0 | aResult->mNativeKeyEvent = nullptr; |
507 | 0 | return true; |
508 | 0 | } |
509 | 0 | return false; |
510 | 0 | } |
511 | | }; |
512 | | |
513 | | template<> |
514 | | struct ParamTraits<mozilla::TextRangeStyle> |
515 | | { |
516 | | typedef mozilla::TextRangeStyle paramType; |
517 | | |
518 | | static void Write(Message* aMsg, const paramType& aParam) |
519 | 0 | { |
520 | 0 | WriteParam(aMsg, aParam.mDefinedStyles); |
521 | 0 | WriteParam(aMsg, aParam.mLineStyle); |
522 | 0 | WriteParam(aMsg, aParam.mIsBoldLine); |
523 | 0 | WriteParam(aMsg, aParam.mForegroundColor); |
524 | 0 | WriteParam(aMsg, aParam.mBackgroundColor); |
525 | 0 | WriteParam(aMsg, aParam.mUnderlineColor); |
526 | 0 | } |
527 | | |
528 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
529 | 0 | { |
530 | 0 | return ReadParam(aMsg, aIter, &aResult->mDefinedStyles) && |
531 | 0 | ReadParam(aMsg, aIter, &aResult->mLineStyle) && |
532 | 0 | ReadParam(aMsg, aIter, &aResult->mIsBoldLine) && |
533 | 0 | ReadParam(aMsg, aIter, &aResult->mForegroundColor) && |
534 | 0 | ReadParam(aMsg, aIter, &aResult->mBackgroundColor) && |
535 | 0 | ReadParam(aMsg, aIter, &aResult->mUnderlineColor); |
536 | 0 | } |
537 | | }; |
538 | | |
539 | | template<> |
540 | | struct ParamTraits<mozilla::TextRange> |
541 | | { |
542 | | typedef mozilla::TextRange paramType; |
543 | | |
544 | | static void Write(Message* aMsg, const paramType& aParam) |
545 | 0 | { |
546 | 0 | WriteParam(aMsg, aParam.mStartOffset); |
547 | 0 | WriteParam(aMsg, aParam.mEndOffset); |
548 | 0 | WriteParam(aMsg, mozilla::ToRawTextRangeType(aParam.mRangeType)); |
549 | 0 | WriteParam(aMsg, aParam.mRangeStyle); |
550 | 0 | } |
551 | | |
552 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
553 | 0 | { |
554 | 0 | mozilla::RawTextRangeType rawTextRangeType; |
555 | 0 | if (ReadParam(aMsg, aIter, &aResult->mStartOffset) && |
556 | 0 | ReadParam(aMsg, aIter, &aResult->mEndOffset) && |
557 | 0 | ReadParam(aMsg, aIter, &rawTextRangeType) && |
558 | 0 | ReadParam(aMsg, aIter, &aResult->mRangeStyle)) { |
559 | 0 | aResult->mRangeType = mozilla::ToTextRangeType(rawTextRangeType); |
560 | 0 | return true; |
561 | 0 | } |
562 | 0 | return false; |
563 | 0 | } |
564 | | }; |
565 | | |
566 | | template<> |
567 | | struct ParamTraits<mozilla::TextRangeArray> |
568 | | { |
569 | | typedef mozilla::TextRangeArray paramType; |
570 | | |
571 | | static void Write(Message* aMsg, const paramType& aParam) |
572 | 0 | { |
573 | 0 | WriteParam(aMsg, aParam.Length()); |
574 | 0 | for (uint32_t index = 0; index < aParam.Length(); index++) { |
575 | 0 | WriteParam(aMsg, aParam[index]); |
576 | 0 | } |
577 | 0 | } |
578 | | |
579 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
580 | 0 | { |
581 | 0 | paramType::size_type length; |
582 | 0 | if (!ReadParam(aMsg, aIter, &length)) { |
583 | 0 | return false; |
584 | 0 | } |
585 | 0 | for (uint32_t index = 0; index < length; index++) { |
586 | 0 | mozilla::TextRange textRange; |
587 | 0 | if (!ReadParam(aMsg, aIter, &textRange)) { |
588 | 0 | aResult->Clear(); |
589 | 0 | return false; |
590 | 0 | } |
591 | 0 | aResult->AppendElement(textRange); |
592 | 0 | } |
593 | 0 | return true; |
594 | 0 | } |
595 | | }; |
596 | | |
597 | | template<> |
598 | | struct ParamTraits<mozilla::WidgetCompositionEvent> |
599 | | { |
600 | | typedef mozilla::WidgetCompositionEvent paramType; |
601 | | |
602 | | static void Write(Message* aMsg, const paramType& aParam) |
603 | 0 | { |
604 | 0 | WriteParam(aMsg, static_cast<const mozilla::WidgetGUIEvent&>(aParam)); |
605 | 0 | WriteParam(aMsg, aParam.mData); |
606 | 0 | WriteParam(aMsg, aParam.mNativeIMEContext); |
607 | 0 | bool hasRanges = !!aParam.mRanges; |
608 | 0 | WriteParam(aMsg, hasRanges); |
609 | 0 | if (hasRanges) { |
610 | 0 | WriteParam(aMsg, *aParam.mRanges.get()); |
611 | 0 | } |
612 | 0 | } |
613 | | |
614 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
615 | 0 | { |
616 | 0 | bool hasRanges; |
617 | 0 | if (!ReadParam(aMsg, aIter, |
618 | 0 | static_cast<mozilla::WidgetGUIEvent*>(aResult)) || |
619 | 0 | !ReadParam(aMsg, aIter, &aResult->mData) || |
620 | 0 | !ReadParam(aMsg, aIter, &aResult->mNativeIMEContext) || |
621 | 0 | !ReadParam(aMsg, aIter, &hasRanges)) { |
622 | 0 | return false; |
623 | 0 | } |
624 | 0 | |
625 | 0 | if (!hasRanges) { |
626 | 0 | aResult->mRanges = nullptr; |
627 | 0 | } else { |
628 | 0 | aResult->mRanges = new mozilla::TextRangeArray(); |
629 | 0 | if (!ReadParam(aMsg, aIter, aResult->mRanges.get())) { |
630 | 0 | return false; |
631 | 0 | } |
632 | 0 | } |
633 | 0 | return true; |
634 | 0 | } |
635 | | }; |
636 | | |
637 | | template<> |
638 | | struct ParamTraits<mozilla::FontRange> |
639 | | { |
640 | | typedef mozilla::FontRange paramType; |
641 | | |
642 | | static void Write(Message* aMsg, const paramType& aParam) |
643 | 0 | { |
644 | 0 | WriteParam(aMsg, aParam.mStartOffset); |
645 | 0 | WriteParam(aMsg, aParam.mFontName); |
646 | 0 | WriteParam(aMsg, aParam.mFontSize); |
647 | 0 | } |
648 | | |
649 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
650 | 0 | { |
651 | 0 | return ReadParam(aMsg, aIter, &aResult->mStartOffset) && |
652 | 0 | ReadParam(aMsg, aIter, &aResult->mFontName) && |
653 | 0 | ReadParam(aMsg, aIter, &aResult->mFontSize); |
654 | 0 | } |
655 | | }; |
656 | | |
657 | | template<> |
658 | | struct ParamTraits<mozilla::WidgetQueryContentEvent::Input> |
659 | | { |
660 | | typedef mozilla::WidgetQueryContentEvent::Input paramType; |
661 | | typedef mozilla::WidgetQueryContentEvent event; |
662 | | |
663 | | static void Write(Message* aMsg, const paramType& aParam) |
664 | 0 | { |
665 | 0 | WriteParam(aMsg, aParam.mOffset); |
666 | 0 | WriteParam(aMsg, aParam.mLength); |
667 | 0 | WriteParam(aMsg, mozilla::ToRawSelectionType(aParam.mSelectionType)); |
668 | 0 | } |
669 | | |
670 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
671 | 0 | { |
672 | 0 | mozilla::RawSelectionType rawSelectionType = 0; |
673 | 0 | bool ok = ReadParam(aMsg, aIter, &aResult->mOffset) && |
674 | 0 | ReadParam(aMsg, aIter, &aResult->mLength) && |
675 | 0 | ReadParam(aMsg, aIter, &rawSelectionType); |
676 | 0 | aResult->mSelectionType = mozilla::ToSelectionType(rawSelectionType); |
677 | 0 | return ok; |
678 | 0 | } |
679 | | }; |
680 | | |
681 | | template<> |
682 | | struct ParamTraits<mozilla::WidgetQueryContentEvent> |
683 | | { |
684 | | typedef mozilla::WidgetQueryContentEvent paramType; |
685 | | |
686 | | static void Write(Message* aMsg, const paramType& aParam) |
687 | 0 | { |
688 | 0 | WriteParam(aMsg, static_cast<const mozilla::WidgetGUIEvent&>(aParam)); |
689 | 0 | WriteParam(aMsg, aParam.mSucceeded); |
690 | 0 | WriteParam(aMsg, aParam.mUseNativeLineBreak); |
691 | 0 | WriteParam(aMsg, aParam.mWithFontRanges); |
692 | 0 | WriteParam(aMsg, aParam.mInput); |
693 | 0 | WriteParam(aMsg, aParam.mReply.mOffset); |
694 | 0 | WriteParam(aMsg, aParam.mReply.mTentativeCaretOffset); |
695 | 0 | WriteParam(aMsg, aParam.mReply.mString); |
696 | 0 | WriteParam(aMsg, aParam.mReply.mRect); |
697 | 0 | WriteParam(aMsg, aParam.mReply.mReversed); |
698 | 0 | WriteParam(aMsg, aParam.mReply.mHasSelection); |
699 | 0 | WriteParam(aMsg, aParam.mReply.mWidgetIsHit); |
700 | 0 | WriteParam(aMsg, aParam.mReply.mFontRanges); |
701 | 0 | } |
702 | | |
703 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
704 | 0 | { |
705 | 0 | return ReadParam(aMsg, aIter, |
706 | 0 | static_cast<mozilla::WidgetGUIEvent*>(aResult)) && |
707 | 0 | ReadParam(aMsg, aIter, &aResult->mSucceeded) && |
708 | 0 | ReadParam(aMsg, aIter, &aResult->mUseNativeLineBreak) && |
709 | 0 | ReadParam(aMsg, aIter, &aResult->mWithFontRanges) && |
710 | 0 | ReadParam(aMsg, aIter, &aResult->mInput) && |
711 | 0 | ReadParam(aMsg, aIter, &aResult->mReply.mOffset) && |
712 | 0 | ReadParam(aMsg, aIter, &aResult->mReply.mTentativeCaretOffset) && |
713 | 0 | ReadParam(aMsg, aIter, &aResult->mReply.mString) && |
714 | 0 | ReadParam(aMsg, aIter, &aResult->mReply.mRect) && |
715 | 0 | ReadParam(aMsg, aIter, &aResult->mReply.mReversed) && |
716 | 0 | ReadParam(aMsg, aIter, &aResult->mReply.mHasSelection) && |
717 | 0 | ReadParam(aMsg, aIter, &aResult->mReply.mWidgetIsHit) && |
718 | 0 | ReadParam(aMsg, aIter, &aResult->mReply.mFontRanges); |
719 | 0 | } |
720 | | }; |
721 | | |
722 | | template<> |
723 | | struct ParamTraits<mozilla::WidgetSelectionEvent> |
724 | | { |
725 | | typedef mozilla::WidgetSelectionEvent paramType; |
726 | | |
727 | | static void Write(Message* aMsg, const paramType& aParam) |
728 | 0 | { |
729 | 0 | WriteParam(aMsg, static_cast<const mozilla::WidgetGUIEvent&>(aParam)); |
730 | 0 | WriteParam(aMsg, aParam.mOffset); |
731 | 0 | WriteParam(aMsg, aParam.mLength); |
732 | 0 | WriteParam(aMsg, aParam.mReversed); |
733 | 0 | WriteParam(aMsg, aParam.mExpandToClusterBoundary); |
734 | 0 | WriteParam(aMsg, aParam.mSucceeded); |
735 | 0 | WriteParam(aMsg, aParam.mUseNativeLineBreak); |
736 | 0 | } |
737 | | |
738 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
739 | 0 | { |
740 | 0 | return ReadParam(aMsg, aIter, |
741 | 0 | static_cast<mozilla::WidgetGUIEvent*>(aResult)) && |
742 | 0 | ReadParam(aMsg, aIter, &aResult->mOffset) && |
743 | 0 | ReadParam(aMsg, aIter, &aResult->mLength) && |
744 | 0 | ReadParam(aMsg, aIter, &aResult->mReversed) && |
745 | 0 | ReadParam(aMsg, aIter, &aResult->mExpandToClusterBoundary) && |
746 | 0 | ReadParam(aMsg, aIter, &aResult->mSucceeded) && |
747 | 0 | ReadParam(aMsg, aIter, &aResult->mUseNativeLineBreak); |
748 | 0 | } |
749 | | }; |
750 | | |
751 | | template<> |
752 | | struct ParamTraits<mozilla::widget::IMENotificationRequests> |
753 | | { |
754 | | typedef mozilla::widget::IMENotificationRequests paramType; |
755 | | |
756 | | static void Write(Message* aMsg, const paramType& aParam) |
757 | 0 | { |
758 | 0 | WriteParam(aMsg, aParam.mWantUpdates); |
759 | 0 | } |
760 | | |
761 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
762 | 0 | { |
763 | 0 | return ReadParam(aMsg, aIter, &aResult->mWantUpdates); |
764 | 0 | } |
765 | | }; |
766 | | |
767 | | template<> |
768 | | struct ParamTraits<mozilla::widget::NativeIMEContext> |
769 | | { |
770 | | typedef mozilla::widget::NativeIMEContext paramType; |
771 | | |
772 | | static void Write(Message* aMsg, const paramType& aParam) |
773 | 0 | { |
774 | 0 | WriteParam(aMsg, aParam.mRawNativeIMEContext); |
775 | 0 | WriteParam(aMsg, aParam.mOriginProcessID); |
776 | 0 | } |
777 | | |
778 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
779 | 0 | { |
780 | 0 | return ReadParam(aMsg, aIter, &aResult->mRawNativeIMEContext) && |
781 | 0 | ReadParam(aMsg, aIter, &aResult->mOriginProcessID); |
782 | 0 | } |
783 | | }; |
784 | | |
785 | | template<> |
786 | | struct ParamTraits<mozilla::widget::IMENotification::Point> |
787 | | { |
788 | | typedef mozilla::widget::IMENotification::Point paramType; |
789 | | |
790 | | static void Write(Message* aMsg, const paramType& aParam) |
791 | 0 | { |
792 | 0 | WriteParam(aMsg, aParam.mX); |
793 | 0 | WriteParam(aMsg, aParam.mY); |
794 | 0 | } |
795 | | |
796 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
797 | 0 | { |
798 | 0 | return ReadParam(aMsg, aIter, &aResult->mX) && |
799 | 0 | ReadParam(aMsg, aIter, &aResult->mY); |
800 | 0 | } |
801 | | }; |
802 | | |
803 | | template<> |
804 | | struct ParamTraits<mozilla::widget::IMENotification::Rect> |
805 | | { |
806 | | typedef mozilla::widget::IMENotification::Rect paramType; |
807 | | |
808 | | static void Write(Message* aMsg, const paramType& aParam) |
809 | 0 | { |
810 | 0 | WriteParam(aMsg, aParam.mX); |
811 | 0 | WriteParam(aMsg, aParam.mY); |
812 | 0 | WriteParam(aMsg, aParam.mWidth); |
813 | 0 | WriteParam(aMsg, aParam.mHeight); |
814 | 0 | } |
815 | | |
816 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
817 | 0 | { |
818 | 0 | return ReadParam(aMsg, aIter, &aResult->mX) && |
819 | 0 | ReadParam(aMsg, aIter, &aResult->mY) && |
820 | 0 | ReadParam(aMsg, aIter, &aResult->mWidth) && |
821 | 0 | ReadParam(aMsg, aIter, &aResult->mHeight); |
822 | 0 | } |
823 | | }; |
824 | | |
825 | | template<> |
826 | | struct ParamTraits<mozilla::widget::IMENotification::SelectionChangeDataBase> |
827 | | { |
828 | | typedef mozilla::widget::IMENotification::SelectionChangeDataBase paramType; |
829 | | |
830 | | static void Write(Message* aMsg, const paramType& aParam) |
831 | 0 | { |
832 | 0 | MOZ_RELEASE_ASSERT(aParam.mString); |
833 | 0 | WriteParam(aMsg, aParam.mOffset); |
834 | 0 | WriteParam(aMsg, *aParam.mString); |
835 | 0 | WriteParam(aMsg, aParam.mWritingMode); |
836 | 0 | WriteParam(aMsg, aParam.mReversed); |
837 | 0 | WriteParam(aMsg, aParam.mCausedByComposition); |
838 | 0 | WriteParam(aMsg, aParam.mCausedBySelectionEvent); |
839 | 0 | WriteParam(aMsg, aParam.mOccurredDuringComposition); |
840 | 0 | } |
841 | | |
842 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
843 | 0 | { |
844 | 0 | aResult->mString = new nsString(); |
845 | 0 | return ReadParam(aMsg, aIter, &aResult->mOffset) && |
846 | 0 | ReadParam(aMsg, aIter, aResult->mString) && |
847 | 0 | ReadParam(aMsg, aIter, &aResult->mWritingMode) && |
848 | 0 | ReadParam(aMsg, aIter, &aResult->mReversed) && |
849 | 0 | ReadParam(aMsg, aIter, &aResult->mCausedByComposition) && |
850 | 0 | ReadParam(aMsg, aIter, &aResult->mCausedBySelectionEvent) && |
851 | 0 | ReadParam(aMsg, aIter, &aResult->mOccurredDuringComposition); |
852 | 0 | } |
853 | | }; |
854 | | |
855 | | template<> |
856 | | struct ParamTraits<mozilla::widget::IMENotification::TextChangeDataBase> |
857 | | { |
858 | | typedef mozilla::widget::IMENotification::TextChangeDataBase paramType; |
859 | | |
860 | | static void Write(Message* aMsg, const paramType& aParam) |
861 | 0 | { |
862 | 0 | WriteParam(aMsg, aParam.mStartOffset); |
863 | 0 | WriteParam(aMsg, aParam.mRemovedEndOffset); |
864 | 0 | WriteParam(aMsg, aParam.mAddedEndOffset); |
865 | 0 | WriteParam(aMsg, aParam.mCausedOnlyByComposition); |
866 | 0 | WriteParam(aMsg, aParam.mIncludingChangesDuringComposition); |
867 | 0 | WriteParam(aMsg, aParam.mIncludingChangesWithoutComposition); |
868 | 0 | } |
869 | | |
870 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
871 | 0 | { |
872 | 0 | return ReadParam(aMsg, aIter, &aResult->mStartOffset) && |
873 | 0 | ReadParam(aMsg, aIter, &aResult->mRemovedEndOffset) && |
874 | 0 | ReadParam(aMsg, aIter, &aResult->mAddedEndOffset) && |
875 | 0 | ReadParam(aMsg, aIter, &aResult->mCausedOnlyByComposition) && |
876 | 0 | ReadParam(aMsg, aIter, |
877 | 0 | &aResult->mIncludingChangesDuringComposition) && |
878 | 0 | ReadParam(aMsg, aIter, |
879 | 0 | &aResult->mIncludingChangesWithoutComposition); |
880 | 0 | } |
881 | | }; |
882 | | |
883 | | template<> |
884 | | struct ParamTraits<mozilla::widget::IMENotification::MouseButtonEventData> |
885 | | { |
886 | | typedef mozilla::widget::IMENotification::MouseButtonEventData paramType; |
887 | | |
888 | | static void Write(Message* aMsg, const paramType& aParam) |
889 | 0 | { |
890 | 0 | WriteParam(aMsg, aParam.mEventMessage); |
891 | 0 | WriteParam(aMsg, aParam.mOffset); |
892 | 0 | WriteParam(aMsg, aParam.mCursorPos); |
893 | 0 | WriteParam(aMsg, aParam.mCharRect); |
894 | 0 | WriteParam(aMsg, aParam.mButton); |
895 | 0 | WriteParam(aMsg, aParam.mButtons); |
896 | 0 | WriteParam(aMsg, aParam.mModifiers); |
897 | 0 | } |
898 | | |
899 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
900 | 0 | { |
901 | 0 | return ReadParam(aMsg, aIter, &aResult->mEventMessage) && |
902 | 0 | ReadParam(aMsg, aIter, &aResult->mOffset) && |
903 | 0 | ReadParam(aMsg, aIter, &aResult->mCursorPos) && |
904 | 0 | ReadParam(aMsg, aIter, &aResult->mCharRect) && |
905 | 0 | ReadParam(aMsg, aIter, &aResult->mButton) && |
906 | 0 | ReadParam(aMsg, aIter, &aResult->mButtons) && |
907 | 0 | ReadParam(aMsg, aIter, &aResult->mModifiers); |
908 | 0 | } |
909 | | }; |
910 | | |
911 | | template<> |
912 | | struct ParamTraits<mozilla::widget::IMENotification> |
913 | | { |
914 | | typedef mozilla::widget::IMENotification paramType; |
915 | | |
916 | | static void Write(Message* aMsg, const paramType& aParam) |
917 | | { |
918 | | WriteParam(aMsg, |
919 | | static_cast<mozilla::widget::IMEMessageType>(aParam.mMessage)); |
920 | | switch (aParam.mMessage) { |
921 | | case mozilla::widget::NOTIFY_IME_OF_SELECTION_CHANGE: |
922 | | WriteParam(aMsg, aParam.mSelectionChangeData); |
923 | | return; |
924 | | case mozilla::widget::NOTIFY_IME_OF_TEXT_CHANGE: |
925 | | WriteParam(aMsg, aParam.mTextChangeData); |
926 | | return; |
927 | | case mozilla::widget::NOTIFY_IME_OF_MOUSE_BUTTON_EVENT: |
928 | | WriteParam(aMsg, aParam.mMouseButtonEventData); |
929 | | return; |
930 | | default: |
931 | | return; |
932 | | } |
933 | | } |
934 | | |
935 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
936 | 0 | { |
937 | 0 | mozilla::widget::IMEMessageType IMEMessage = 0; |
938 | 0 | if (!ReadParam(aMsg, aIter, &IMEMessage)) { |
939 | 0 | return false; |
940 | 0 | } |
941 | 0 | aResult->mMessage = static_cast<mozilla::widget::IMEMessage>(IMEMessage); |
942 | 0 | switch (aResult->mMessage) { |
943 | 0 | case mozilla::widget::NOTIFY_IME_OF_SELECTION_CHANGE: |
944 | 0 | return ReadParam(aMsg, aIter, &aResult->mSelectionChangeData); |
945 | 0 | case mozilla::widget::NOTIFY_IME_OF_TEXT_CHANGE: |
946 | 0 | return ReadParam(aMsg, aIter, &aResult->mTextChangeData); |
947 | 0 | case mozilla::widget::NOTIFY_IME_OF_MOUSE_BUTTON_EVENT: |
948 | 0 | return ReadParam(aMsg, aIter, &aResult->mMouseButtonEventData); |
949 | 0 | default: |
950 | 0 | return true; |
951 | 0 | } |
952 | 0 | } |
953 | | }; |
954 | | |
955 | | template<> |
956 | | struct ParamTraits<mozilla::widget::IMEState::Enabled> |
957 | | : ContiguousEnumSerializer<mozilla::widget::IMEState::Enabled, |
958 | | mozilla::widget::IMEState::Enabled::DISABLED, |
959 | | mozilla::widget::IMEState::Enabled::UNKNOWN> |
960 | | { |
961 | | }; |
962 | | |
963 | | template<> |
964 | | struct ParamTraits<mozilla::widget::IMEState::Open> |
965 | | : ContiguousEnumSerializerInclusive< |
966 | | mozilla::widget::IMEState::Open, |
967 | | mozilla::widget::IMEState::Open::OPEN_STATE_NOT_SUPPORTED, |
968 | | mozilla::widget::IMEState::Open::CLOSED> |
969 | | { |
970 | | }; |
971 | | |
972 | | template<> |
973 | | struct ParamTraits<mozilla::widget::IMEState> |
974 | | { |
975 | | typedef mozilla::widget::IMEState paramType; |
976 | | |
977 | | static void Write(Message* aMsg, const paramType& aParam) |
978 | 0 | { |
979 | 0 | WriteParam(aMsg, aParam.mEnabled); |
980 | 0 | WriteParam(aMsg, aParam.mOpen); |
981 | 0 | } |
982 | | |
983 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
984 | 0 | { |
985 | 0 | return ReadParam(aMsg, aIter, &aResult->mEnabled) && |
986 | 0 | ReadParam(aMsg, aIter, &aResult->mOpen); |
987 | 0 | } |
988 | | }; |
989 | | |
990 | | template<> |
991 | | struct ParamTraits<mozilla::widget::InputContext::Origin> |
992 | | : ContiguousEnumSerializerInclusive< |
993 | | mozilla::widget::InputContext::Origin, |
994 | | mozilla::widget::InputContext::Origin::ORIGIN_MAIN, |
995 | | mozilla::widget::InputContext::Origin::ORIGIN_CONTENT> |
996 | | { |
997 | | }; |
998 | | |
999 | | template<> |
1000 | | struct ParamTraits<mozilla::widget::InputContext> |
1001 | | { |
1002 | | typedef mozilla::widget::InputContext paramType; |
1003 | | |
1004 | | static void Write(Message* aMsg, const paramType& aParam) |
1005 | 0 | { |
1006 | 0 | WriteParam(aMsg, aParam.mIMEState); |
1007 | 0 | WriteParam(aMsg, aParam.mHTMLInputType); |
1008 | 0 | WriteParam(aMsg, aParam.mHTMLInputInputmode); |
1009 | 0 | WriteParam(aMsg, aParam.mActionHint); |
1010 | 0 | WriteParam(aMsg, aParam.mOrigin); |
1011 | 0 | WriteParam(aMsg, aParam.mMayBeIMEUnaware); |
1012 | 0 | WriteParam(aMsg, aParam.mHasHandledUserInput); |
1013 | 0 | WriteParam(aMsg, aParam.mInPrivateBrowsing); |
1014 | 0 | } |
1015 | | |
1016 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
1017 | 0 | { |
1018 | 0 | return ReadParam(aMsg, aIter, &aResult->mIMEState) && |
1019 | 0 | ReadParam(aMsg, aIter, &aResult->mHTMLInputType) && |
1020 | 0 | ReadParam(aMsg, aIter, &aResult->mHTMLInputInputmode) && |
1021 | 0 | ReadParam(aMsg, aIter, &aResult->mActionHint) && |
1022 | 0 | ReadParam(aMsg, aIter, &aResult->mOrigin) && |
1023 | 0 | ReadParam(aMsg, aIter, &aResult->mMayBeIMEUnaware) && |
1024 | 0 | ReadParam(aMsg, aIter, &aResult->mHasHandledUserInput) && |
1025 | 0 | ReadParam(aMsg, aIter, &aResult->mInPrivateBrowsing); |
1026 | 0 | } |
1027 | | }; |
1028 | | |
1029 | | template<> |
1030 | | struct ParamTraits<mozilla::widget::InputContextAction::Cause> |
1031 | | : ContiguousEnumSerializerInclusive< |
1032 | | mozilla::widget::InputContextAction::Cause, |
1033 | | mozilla::widget::InputContextAction::Cause::CAUSE_UNKNOWN, |
1034 | | mozilla::widget::InputContextAction::Cause:: |
1035 | | CAUSE_UNKNOWN_DURING_KEYBOARD_INPUT> |
1036 | | { |
1037 | | }; |
1038 | | |
1039 | | template<> |
1040 | | struct ParamTraits<mozilla::widget::InputContextAction::FocusChange> |
1041 | | : ContiguousEnumSerializerInclusive< |
1042 | | mozilla::widget::InputContextAction::FocusChange, |
1043 | | mozilla::widget::InputContextAction::FocusChange::FOCUS_NOT_CHANGED, |
1044 | | mozilla::widget::InputContextAction::FocusChange::WIDGET_CREATED> |
1045 | | { |
1046 | | }; |
1047 | | |
1048 | | template<> |
1049 | | struct ParamTraits<mozilla::widget::InputContextAction> |
1050 | | { |
1051 | | typedef mozilla::widget::InputContextAction paramType; |
1052 | | |
1053 | | static void Write(Message* aMsg, const paramType& aParam) |
1054 | 0 | { |
1055 | 0 | WriteParam(aMsg, aParam.mCause); |
1056 | 0 | WriteParam(aMsg, aParam.mFocusChange); |
1057 | 0 | } |
1058 | | |
1059 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
1060 | 0 | { |
1061 | 0 | return ReadParam(aMsg, aIter, &aResult->mCause) && |
1062 | 0 | ReadParam(aMsg, aIter, &aResult->mFocusChange); |
1063 | 0 | } |
1064 | | }; |
1065 | | |
1066 | | template<> |
1067 | | struct ParamTraits<mozilla::WidgetPluginEvent> |
1068 | | { |
1069 | | typedef mozilla::WidgetPluginEvent paramType; |
1070 | | |
1071 | | static void Write(Message* aMsg, const paramType& aParam) |
1072 | 0 | { |
1073 | 0 | WriteParam(aMsg, static_cast<const mozilla::WidgetGUIEvent&>(aParam)); |
1074 | 0 | WriteParam(aMsg, aParam.mRetargetToFocusedDocument); |
1075 | 0 | } |
1076 | | |
1077 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
1078 | 0 | { |
1079 | 0 | return ReadParam(aMsg, aIter, |
1080 | 0 | static_cast<mozilla::WidgetGUIEvent*>(aResult)) && |
1081 | 0 | ReadParam(aMsg, aIter, &aResult->mRetargetToFocusedDocument); |
1082 | 0 | } |
1083 | | }; |
1084 | | |
1085 | | template<> |
1086 | | struct ParamTraits<mozilla::WritingMode> |
1087 | | { |
1088 | | typedef mozilla::WritingMode paramType; |
1089 | | |
1090 | | static void Write(Message* aMsg, const paramType& aParam) |
1091 | 0 | { |
1092 | 0 | WriteParam(aMsg, aParam.mWritingMode); |
1093 | 0 | } |
1094 | | |
1095 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
1096 | 0 | { |
1097 | 0 | return ReadParam(aMsg, aIter, &aResult->mWritingMode); |
1098 | 0 | } |
1099 | | }; |
1100 | | |
1101 | | template<> |
1102 | | struct ParamTraits<mozilla::ContentCache> |
1103 | | { |
1104 | | typedef mozilla::ContentCache paramType; |
1105 | | |
1106 | | static void Write(Message* aMsg, const paramType& aParam) |
1107 | 0 | { |
1108 | 0 | WriteParam(aMsg, aParam.mCompositionStart); |
1109 | 0 | WriteParam(aMsg, aParam.mText); |
1110 | 0 | WriteParam(aMsg, aParam.mSelection.mAnchor); |
1111 | 0 | WriteParam(aMsg, aParam.mSelection.mFocus); |
1112 | 0 | WriteParam(aMsg, aParam.mSelection.mWritingMode); |
1113 | 0 | WriteParam(aMsg, aParam.mSelection.mAnchorCharRects[0]); |
1114 | 0 | WriteParam(aMsg, aParam.mSelection.mAnchorCharRects[1]); |
1115 | 0 | WriteParam(aMsg, aParam.mSelection.mFocusCharRects[0]); |
1116 | 0 | WriteParam(aMsg, aParam.mSelection.mFocusCharRects[1]); |
1117 | 0 | WriteParam(aMsg, aParam.mSelection.mRect); |
1118 | 0 | WriteParam(aMsg, aParam.mFirstCharRect); |
1119 | 0 | WriteParam(aMsg, aParam.mCaret.mOffset); |
1120 | 0 | WriteParam(aMsg, aParam.mCaret.mRect); |
1121 | 0 | WriteParam(aMsg, aParam.mTextRectArray.mStart); |
1122 | 0 | WriteParam(aMsg, aParam.mTextRectArray.mRects); |
1123 | 0 | WriteParam(aMsg, aParam.mEditorRect); |
1124 | 0 | } |
1125 | | |
1126 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
1127 | 0 | { |
1128 | 0 | return ReadParam(aMsg, aIter, &aResult->mCompositionStart) && |
1129 | 0 | ReadParam(aMsg, aIter, &aResult->mText) && |
1130 | 0 | ReadParam(aMsg, aIter, &aResult->mSelection.mAnchor) && |
1131 | 0 | ReadParam(aMsg, aIter, &aResult->mSelection.mFocus) && |
1132 | 0 | ReadParam(aMsg, aIter, &aResult->mSelection.mWritingMode) && |
1133 | 0 | ReadParam(aMsg, aIter, &aResult->mSelection.mAnchorCharRects[0]) && |
1134 | 0 | ReadParam(aMsg, aIter, &aResult->mSelection.mAnchorCharRects[1]) && |
1135 | 0 | ReadParam(aMsg, aIter, &aResult->mSelection.mFocusCharRects[0]) && |
1136 | 0 | ReadParam(aMsg, aIter, &aResult->mSelection.mFocusCharRects[1]) && |
1137 | 0 | ReadParam(aMsg, aIter, &aResult->mSelection.mRect) && |
1138 | 0 | ReadParam(aMsg, aIter, &aResult->mFirstCharRect) && |
1139 | 0 | ReadParam(aMsg, aIter, &aResult->mCaret.mOffset) && |
1140 | 0 | ReadParam(aMsg, aIter, &aResult->mCaret.mRect) && |
1141 | 0 | ReadParam(aMsg, aIter, &aResult->mTextRectArray.mStart) && |
1142 | 0 | ReadParam(aMsg, aIter, &aResult->mTextRectArray.mRects) && |
1143 | 0 | ReadParam(aMsg, aIter, &aResult->mEditorRect); |
1144 | 0 | } |
1145 | | }; |
1146 | | |
1147 | | template<> |
1148 | | struct ParamTraits<mozilla::widget::CandidateWindowPosition> |
1149 | | { |
1150 | | typedef mozilla::widget::CandidateWindowPosition paramType; |
1151 | | |
1152 | | static void Write(Message* aMsg, const paramType& aParam) |
1153 | 0 | { |
1154 | 0 | WriteParam(aMsg, aParam.mPoint); |
1155 | 0 | WriteParam(aMsg, aParam.mRect); |
1156 | 0 | WriteParam(aMsg, aParam.mExcludeRect); |
1157 | 0 | } |
1158 | | |
1159 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
1160 | 0 | { |
1161 | 0 | return ReadParam(aMsg, aIter, &aResult->mPoint) && |
1162 | 0 | ReadParam(aMsg, aIter, &aResult->mRect) && |
1163 | 0 | ReadParam(aMsg, aIter, &aResult->mExcludeRect); |
1164 | 0 | } |
1165 | | }; |
1166 | | |
1167 | | // InputData.h |
1168 | | |
1169 | | template<> |
1170 | | struct ParamTraits<mozilla::InputType> |
1171 | | : public ContiguousEnumSerializerInclusive< |
1172 | | mozilla::InputType, |
1173 | | mozilla::InputType::MULTITOUCH_INPUT, |
1174 | | mozilla::kHighestInputType> |
1175 | | {}; |
1176 | | |
1177 | | template<> |
1178 | | struct ParamTraits<mozilla::InputData> |
1179 | | { |
1180 | | typedef mozilla::InputData paramType; |
1181 | | |
1182 | | static void Write(Message* aMsg, const paramType& aParam) |
1183 | 0 | { |
1184 | 0 | WriteParam(aMsg, aParam.mInputType); |
1185 | 0 | WriteParam(aMsg, aParam.mTime); |
1186 | 0 | WriteParam(aMsg, aParam.mTimeStamp); |
1187 | 0 | WriteParam(aMsg, aParam.modifiers); |
1188 | 0 | WriteParam(aMsg, aParam.mFocusSequenceNumber); |
1189 | 0 | } |
1190 | | |
1191 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
1192 | 0 | { |
1193 | 0 | return ReadParam(aMsg, aIter, &aResult->mInputType) && |
1194 | 0 | ReadParam(aMsg, aIter, &aResult->mTime) && |
1195 | 0 | ReadParam(aMsg, aIter, &aResult->mTimeStamp) && |
1196 | 0 | ReadParam(aMsg, aIter, &aResult->modifiers) && |
1197 | 0 | ReadParam(aMsg, aIter, &aResult->mFocusSequenceNumber); |
1198 | 0 | } |
1199 | | }; |
1200 | | |
1201 | | template<> |
1202 | | struct ParamTraits<mozilla::SingleTouchData> |
1203 | | { |
1204 | | typedef mozilla::SingleTouchData paramType; |
1205 | | |
1206 | | static void Write(Message* aMsg, const paramType& aParam) |
1207 | 0 | { |
1208 | 0 | WriteParam(aMsg, aParam.mIdentifier); |
1209 | 0 | WriteParam(aMsg, aParam.mScreenPoint); |
1210 | 0 | WriteParam(aMsg, aParam.mLocalScreenPoint); |
1211 | 0 | WriteParam(aMsg, aParam.mRadius); |
1212 | 0 | WriteParam(aMsg, aParam.mRotationAngle); |
1213 | 0 | WriteParam(aMsg, aParam.mForce); |
1214 | 0 | } |
1215 | | |
1216 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
1217 | 0 | { |
1218 | 0 | return (ReadParam(aMsg, aIter, &aResult->mIdentifier) && |
1219 | 0 | ReadParam(aMsg, aIter, &aResult->mScreenPoint) && |
1220 | 0 | ReadParam(aMsg, aIter, &aResult->mLocalScreenPoint) && |
1221 | 0 | ReadParam(aMsg, aIter, &aResult->mRadius) && |
1222 | 0 | ReadParam(aMsg, aIter, &aResult->mRotationAngle) && |
1223 | 0 | ReadParam(aMsg, aIter, &aResult->mForce)); |
1224 | 0 | } |
1225 | | }; |
1226 | | |
1227 | | template<> |
1228 | | struct ParamTraits<mozilla::MultiTouchInput::MultiTouchType> |
1229 | | : public ContiguousEnumSerializerInclusive< |
1230 | | mozilla::MultiTouchInput::MultiTouchType, |
1231 | | mozilla::MultiTouchInput::MultiTouchType::MULTITOUCH_START, |
1232 | | mozilla::MultiTouchInput::sHighestMultiTouchType> |
1233 | | {}; |
1234 | | |
1235 | | template<> |
1236 | | struct ParamTraits<mozilla::MultiTouchInput> |
1237 | | { |
1238 | | typedef mozilla::MultiTouchInput paramType; |
1239 | | |
1240 | | static void Write(Message* aMsg, const paramType& aParam) |
1241 | 0 | { |
1242 | 0 | WriteParam(aMsg, static_cast<const mozilla::InputData&>(aParam)); |
1243 | 0 | WriteParam(aMsg, aParam.mType); |
1244 | 0 | WriteParam(aMsg, aParam.mTouches); |
1245 | 0 | WriteParam(aMsg, aParam.mHandledByAPZ); |
1246 | 0 | } |
1247 | | |
1248 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
1249 | 0 | { |
1250 | 0 | return ReadParam(aMsg, aIter, static_cast<mozilla::InputData*>(aResult)) && |
1251 | 0 | ReadParam(aMsg, aIter, &aResult->mType) && |
1252 | 0 | ReadParam(aMsg, aIter, &aResult->mTouches) && |
1253 | 0 | ReadParam(aMsg, aIter, &aResult->mHandledByAPZ); |
1254 | 0 | } |
1255 | | }; |
1256 | | |
1257 | | template<> |
1258 | | struct ParamTraits<mozilla::MouseInput::MouseType> |
1259 | | : public ContiguousEnumSerializerInclusive< |
1260 | | mozilla::MouseInput::MouseType, |
1261 | | mozilla::MouseInput::MouseType::MOUSE_NONE, |
1262 | | mozilla::MouseInput::sHighestMouseType> |
1263 | | {}; |
1264 | | |
1265 | | template<> |
1266 | | struct ParamTraits<mozilla::MouseInput::ButtonType> |
1267 | | : public ContiguousEnumSerializerInclusive< |
1268 | | mozilla::MouseInput::ButtonType, |
1269 | | mozilla::MouseInput::ButtonType::LEFT_BUTTON, |
1270 | | mozilla::MouseInput::sHighestButtonType> |
1271 | | {}; |
1272 | | |
1273 | | template<> |
1274 | | struct ParamTraits<mozilla::MouseInput> |
1275 | | { |
1276 | | typedef mozilla::MouseInput paramType; |
1277 | | |
1278 | | static void Write(Message* aMsg, const paramType& aParam) |
1279 | 0 | { |
1280 | 0 | WriteParam(aMsg, static_cast<const mozilla::InputData&>(aParam)); |
1281 | 0 | WriteParam(aMsg, aParam.mButtonType); |
1282 | 0 | WriteParam(aMsg, aParam.mType); |
1283 | 0 | WriteParam(aMsg, aParam.mInputSource); |
1284 | 0 | WriteParam(aMsg, aParam.mButtons); |
1285 | 0 | WriteParam(aMsg, aParam.mOrigin); |
1286 | 0 | WriteParam(aMsg, aParam.mLocalOrigin); |
1287 | 0 | WriteParam(aMsg, aParam.mHandledByAPZ); |
1288 | 0 | } |
1289 | | |
1290 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
1291 | 0 | { |
1292 | 0 | return ReadParam(aMsg, aIter, static_cast<mozilla::InputData*>(aResult)) && |
1293 | 0 | ReadParam(aMsg, aIter, &aResult->mButtonType) && |
1294 | 0 | ReadParam(aMsg, aIter, &aResult->mType) && |
1295 | 0 | ReadParam(aMsg, aIter, &aResult->mInputSource) && |
1296 | 0 | ReadParam(aMsg, aIter, &aResult->mButtons) && |
1297 | 0 | ReadParam(aMsg, aIter, &aResult->mOrigin) && |
1298 | 0 | ReadParam(aMsg, aIter, &aResult->mLocalOrigin) && |
1299 | 0 | ReadParam(aMsg, aIter, &aResult->mHandledByAPZ); |
1300 | 0 | } |
1301 | | }; |
1302 | | |
1303 | | template<> |
1304 | | struct ParamTraits<mozilla::PanGestureInput::PanGestureType> |
1305 | | : public ContiguousEnumSerializerInclusive< |
1306 | | mozilla::PanGestureInput::PanGestureType, |
1307 | | mozilla::PanGestureInput::PanGestureType::PANGESTURE_MAYSTART, |
1308 | | mozilla::PanGestureInput::sHighestPanGestureType> |
1309 | | {}; |
1310 | | |
1311 | | template<> |
1312 | | struct ParamTraits<mozilla::PanGestureInput> |
1313 | | { |
1314 | | typedef mozilla::PanGestureInput paramType; |
1315 | | |
1316 | | static void Write(Message* aMsg, const paramType& aParam) |
1317 | 0 | { |
1318 | 0 | WriteParam(aMsg, static_cast<const mozilla::InputData&>(aParam)); |
1319 | 0 | WriteParam(aMsg, aParam.mType); |
1320 | 0 | WriteParam(aMsg, aParam.mPanStartPoint); |
1321 | 0 | WriteParam(aMsg, aParam.mPanDisplacement); |
1322 | 0 | WriteParam(aMsg, aParam.mLocalPanStartPoint); |
1323 | 0 | WriteParam(aMsg, aParam.mLocalPanDisplacement); |
1324 | 0 | WriteParam(aMsg, aParam.mLineOrPageDeltaX); |
1325 | 0 | WriteParam(aMsg, aParam.mLineOrPageDeltaY); |
1326 | 0 | WriteParam(aMsg, aParam.mUserDeltaMultiplierX); |
1327 | 0 | WriteParam(aMsg, aParam.mUserDeltaMultiplierY); |
1328 | 0 | WriteParam(aMsg, aParam.mHandledByAPZ); |
1329 | 0 | WriteParam(aMsg, aParam.mFollowedByMomentum); |
1330 | 0 | WriteParam(aMsg, aParam.mRequiresContentResponseIfCannotScrollHorizontallyInStartDirection); |
1331 | 0 | WriteParam(aMsg, aParam.mOverscrollBehaviorAllowsSwipe); |
1332 | 0 | } |
1333 | | |
1334 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
1335 | 0 | { |
1336 | 0 | return ReadParam(aMsg, aIter, static_cast<mozilla::InputData*>(aResult)) && |
1337 | 0 | ReadParam(aMsg, aIter, &aResult->mType) && |
1338 | 0 | ReadParam(aMsg, aIter, &aResult->mPanStartPoint) && |
1339 | 0 | ReadParam(aMsg, aIter, &aResult->mPanDisplacement) && |
1340 | 0 | ReadParam(aMsg, aIter, &aResult->mLocalPanStartPoint) && |
1341 | 0 | ReadParam(aMsg, aIter, &aResult->mLocalPanDisplacement) && |
1342 | 0 | ReadParam(aMsg, aIter, &aResult->mLineOrPageDeltaX) && |
1343 | 0 | ReadParam(aMsg, aIter, &aResult->mLineOrPageDeltaY) && |
1344 | 0 | ReadParam(aMsg, aIter, &aResult->mUserDeltaMultiplierX) && |
1345 | 0 | ReadParam(aMsg, aIter, &aResult->mUserDeltaMultiplierY) && |
1346 | 0 | ReadParam(aMsg, aIter, &aResult->mHandledByAPZ) && |
1347 | 0 | ReadParam(aMsg, aIter, &aResult->mFollowedByMomentum) && |
1348 | 0 | ReadParam(aMsg, aIter, &aResult->mRequiresContentResponseIfCannotScrollHorizontallyInStartDirection) && |
1349 | 0 | ReadParam(aMsg, aIter, &aResult->mOverscrollBehaviorAllowsSwipe); |
1350 | 0 | } |
1351 | | }; |
1352 | | |
1353 | | template<> |
1354 | | struct ParamTraits<mozilla::PinchGestureInput::PinchGestureType> |
1355 | | : public ContiguousEnumSerializerInclusive< |
1356 | | mozilla::PinchGestureInput::PinchGestureType, |
1357 | | mozilla::PinchGestureInput::PinchGestureType::PINCHGESTURE_START, |
1358 | | mozilla::PinchGestureInput::sHighestPinchGestureType> |
1359 | | {}; |
1360 | | |
1361 | | template<> |
1362 | | struct ParamTraits<mozilla::PinchGestureInput> |
1363 | | { |
1364 | | typedef mozilla::PinchGestureInput paramType; |
1365 | | |
1366 | | static void Write(Message* aMsg, const paramType& aParam) |
1367 | 0 | { |
1368 | 0 | WriteParam(aMsg, static_cast<const mozilla::InputData&>(aParam)); |
1369 | 0 | WriteParam(aMsg, aParam.mType); |
1370 | 0 | WriteParam(aMsg, aParam.mFocusPoint); |
1371 | 0 | WriteParam(aMsg, aParam.mLocalFocusPoint); |
1372 | 0 | WriteParam(aMsg, aParam.mCurrentSpan); |
1373 | 0 | WriteParam(aMsg, aParam.mPreviousSpan); |
1374 | 0 | } |
1375 | | |
1376 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
1377 | 0 | { |
1378 | 0 | return ReadParam(aMsg, aIter, static_cast<mozilla::InputData*>(aResult)) && |
1379 | 0 | ReadParam(aMsg, aIter, &aResult->mType) && |
1380 | 0 | ReadParam(aMsg, aIter, &aResult->mFocusPoint) && |
1381 | 0 | ReadParam(aMsg, aIter, &aResult->mLocalFocusPoint) && |
1382 | 0 | ReadParam(aMsg, aIter, &aResult->mCurrentSpan) && |
1383 | 0 | ReadParam(aMsg, aIter, &aResult->mPreviousSpan); |
1384 | 0 | } |
1385 | | }; |
1386 | | |
1387 | | template<> |
1388 | | struct ParamTraits<mozilla::TapGestureInput::TapGestureType> |
1389 | | : public ContiguousEnumSerializerInclusive< |
1390 | | mozilla::TapGestureInput::TapGestureType, |
1391 | | mozilla::TapGestureInput::TapGestureType::TAPGESTURE_LONG, |
1392 | | mozilla::TapGestureInput::sHighestTapGestureType> |
1393 | | {}; |
1394 | | |
1395 | | template<> |
1396 | | struct ParamTraits<mozilla::TapGestureInput> |
1397 | | { |
1398 | | typedef mozilla::TapGestureInput paramType; |
1399 | | |
1400 | | static void Write(Message* aMsg, const paramType& aParam) |
1401 | 0 | { |
1402 | 0 | WriteParam(aMsg, static_cast<const mozilla::InputData&>(aParam)); |
1403 | 0 | WriteParam(aMsg, aParam.mType); |
1404 | 0 | WriteParam(aMsg, aParam.mPoint); |
1405 | 0 | WriteParam(aMsg, aParam.mLocalPoint); |
1406 | 0 | } |
1407 | | |
1408 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
1409 | 0 | { |
1410 | 0 | return ReadParam(aMsg, aIter, static_cast<mozilla::InputData*>(aResult)) && |
1411 | 0 | ReadParam(aMsg, aIter, &aResult->mType) && |
1412 | 0 | ReadParam(aMsg, aIter, &aResult->mPoint) && |
1413 | 0 | ReadParam(aMsg, aIter, &aResult->mLocalPoint); |
1414 | 0 | } |
1415 | | }; |
1416 | | |
1417 | | template<> |
1418 | | struct ParamTraits<mozilla::ScrollWheelInput::ScrollDeltaType> |
1419 | | : public ContiguousEnumSerializerInclusive< |
1420 | | mozilla::ScrollWheelInput::ScrollDeltaType, |
1421 | | mozilla::ScrollWheelInput::ScrollDeltaType::SCROLLDELTA_LINE, |
1422 | | mozilla::ScrollWheelInput::sHighestScrollDeltaType> |
1423 | | {}; |
1424 | | |
1425 | | template<> |
1426 | | struct ParamTraits<mozilla::ScrollWheelInput::ScrollMode> |
1427 | | : public ContiguousEnumSerializerInclusive< |
1428 | | mozilla::ScrollWheelInput::ScrollMode, |
1429 | | mozilla::ScrollWheelInput::ScrollMode::SCROLLMODE_INSTANT, |
1430 | | mozilla::ScrollWheelInput::sHighestScrollMode> |
1431 | | {}; |
1432 | | |
1433 | | template<> |
1434 | | struct ParamTraits<mozilla::WheelDeltaAdjustmentStrategy> : |
1435 | | public ContiguousEnumSerializer< |
1436 | | mozilla::WheelDeltaAdjustmentStrategy, |
1437 | | mozilla::WheelDeltaAdjustmentStrategy(0), |
1438 | | mozilla::WheelDeltaAdjustmentStrategy::eSentinel> |
1439 | | {}; |
1440 | | |
1441 | | template<> |
1442 | | struct ParamTraits<mozilla::ScrollWheelInput> |
1443 | | { |
1444 | | typedef mozilla::ScrollWheelInput paramType; |
1445 | | |
1446 | | static void Write(Message* aMsg, const paramType& aParam) |
1447 | 0 | { |
1448 | 0 | WriteParam(aMsg, static_cast<const mozilla::InputData&>(aParam)); |
1449 | 0 | WriteParam(aMsg, aParam.mDeltaType); |
1450 | 0 | WriteParam(aMsg, aParam.mScrollMode); |
1451 | 0 | WriteParam(aMsg, aParam.mOrigin); |
1452 | 0 | WriteParam(aMsg, aParam.mHandledByAPZ); |
1453 | 0 | WriteParam(aMsg, aParam.mDeltaX); |
1454 | 0 | WriteParam(aMsg, aParam.mDeltaY); |
1455 | 0 | WriteParam(aMsg, aParam.mLocalOrigin); |
1456 | 0 | WriteParam(aMsg, aParam.mLineOrPageDeltaX); |
1457 | 0 | WriteParam(aMsg, aParam.mLineOrPageDeltaY); |
1458 | 0 | WriteParam(aMsg, aParam.mScrollSeriesNumber); |
1459 | 0 | WriteParam(aMsg, aParam.mUserDeltaMultiplierX); |
1460 | 0 | WriteParam(aMsg, aParam.mUserDeltaMultiplierY); |
1461 | 0 | WriteParam(aMsg, aParam.mMayHaveMomentum); |
1462 | 0 | WriteParam(aMsg, aParam.mIsMomentum); |
1463 | 0 | WriteParam(aMsg, aParam.mAllowToOverrideSystemScrollSpeed); |
1464 | 0 | WriteParam(aMsg, aParam.mWheelDeltaAdjustmentStrategy); |
1465 | 0 | } |
1466 | | |
1467 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
1468 | 0 | { |
1469 | 0 | return ReadParam(aMsg, aIter, static_cast<mozilla::InputData*>(aResult)) && |
1470 | 0 | ReadParam(aMsg, aIter, &aResult->mDeltaType) && |
1471 | 0 | ReadParam(aMsg, aIter, &aResult->mScrollMode) && |
1472 | 0 | ReadParam(aMsg, aIter, &aResult->mOrigin) && |
1473 | 0 | ReadParam(aMsg, aIter, &aResult->mHandledByAPZ) && |
1474 | 0 | ReadParam(aMsg, aIter, &aResult->mDeltaX) && |
1475 | 0 | ReadParam(aMsg, aIter, &aResult->mDeltaY) && |
1476 | 0 | ReadParam(aMsg, aIter, &aResult->mLocalOrigin) && |
1477 | 0 | ReadParam(aMsg, aIter, &aResult->mLineOrPageDeltaX) && |
1478 | 0 | ReadParam(aMsg, aIter, &aResult->mLineOrPageDeltaY) && |
1479 | 0 | ReadParam(aMsg, aIter, &aResult->mScrollSeriesNumber) && |
1480 | 0 | ReadParam(aMsg, aIter, &aResult->mUserDeltaMultiplierX) && |
1481 | 0 | ReadParam(aMsg, aIter, &aResult->mUserDeltaMultiplierY) && |
1482 | 0 | ReadParam(aMsg, aIter, &aResult->mMayHaveMomentum) && |
1483 | 0 | ReadParam(aMsg, aIter, &aResult->mIsMomentum) && |
1484 | 0 | ReadParam(aMsg, aIter, |
1485 | 0 | &aResult->mAllowToOverrideSystemScrollSpeed) && |
1486 | 0 | ReadParam(aMsg, aIter, &aResult->mWheelDeltaAdjustmentStrategy); |
1487 | 0 | } |
1488 | | }; |
1489 | | |
1490 | | template <> |
1491 | | struct ParamTraits<mozilla::KeyboardInput::KeyboardEventType> |
1492 | | : public ContiguousEnumSerializer< |
1493 | | mozilla::KeyboardInput::KeyboardEventType, |
1494 | | mozilla::KeyboardInput::KeyboardEventType::KEY_DOWN, |
1495 | | mozilla::KeyboardInput::KeyboardEventType::KEY_SENTINEL> |
1496 | | {}; |
1497 | | |
1498 | | template<> |
1499 | | struct ParamTraits<mozilla::KeyboardInput> |
1500 | | { |
1501 | | typedef mozilla::KeyboardInput paramType; |
1502 | | |
1503 | | static void Write(Message* aMsg, const paramType& aParam) |
1504 | 0 | { |
1505 | 0 | WriteParam(aMsg, static_cast<const mozilla::InputData&>(aParam)); |
1506 | 0 | WriteParam(aMsg, aParam.mType); |
1507 | 0 | WriteParam(aMsg, aParam.mKeyCode); |
1508 | 0 | WriteParam(aMsg, aParam.mCharCode); |
1509 | 0 | WriteParam(aMsg, aParam.mShortcutCandidates); |
1510 | 0 | WriteParam(aMsg, aParam.mHandledByAPZ); |
1511 | 0 | } |
1512 | | |
1513 | | static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) |
1514 | 0 | { |
1515 | 0 | return ReadParam(aMsg, aIter, static_cast<mozilla::InputData*>(aResult)) && |
1516 | 0 | ReadParam(aMsg, aIter, &aResult->mType) && |
1517 | 0 | ReadParam(aMsg, aIter, &aResult->mKeyCode) && |
1518 | 0 | ReadParam(aMsg, aIter, &aResult->mCharCode) && |
1519 | 0 | ReadParam(aMsg, aIter, &aResult->mShortcutCandidates) && |
1520 | 0 | ReadParam(aMsg, aIter, &aResult->mHandledByAPZ); |
1521 | 0 | } |
1522 | | }; |
1523 | | |
1524 | | } // namespace IPC |
1525 | | |
1526 | | #endif // nsGUIEventIPC_h__ |