1/* -*- Mode: C++; tab-width: 8; 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
6include "ipc/nsGUIEventIPC.h";
7
8using LayoutDeviceIntPoint from "Units.h";
9using struct mozilla::layers::ScrollableLayerGuid from "mozilla/layers/ScrollableLayerGuid.h";
10using struct mozilla::layers::APZEventResult from "mozilla/layers/APZInputBridge.h";
11using struct mozilla::layers::APZHandledResult from "mozilla/layers/APZInputBridge.h";
12
13using EventMessage from "mozilla/EventForwards.h";
14using class mozilla::MultiTouchInput from "InputData.h";
15using class mozilla::MouseInput from "InputData.h";
16using class mozilla::PanGestureInput from "InputData.h";
17using class mozilla::PinchGestureInput from "InputData.h";
18using class mozilla::TapGestureInput from "InputData.h";
19using class mozilla::ScrollWheelInput from "InputData.h";
20using class mozilla::KeyboardInput from "InputData.h";
21
22using mozilla::layers::LayersId from "mozilla/layers/LayersTypes.h";
23
24namespace mozilla {
25namespace layers {
26
27/**
28 * This protocol is used to send input events from the UI process to the
29 * GPU process for handling by APZ. There is one instance per top-level
30 * compositor, or in other words, one instance per concrete APZCTreeManager
31 * instance. The child side lives on the controller thread in the UI process,
32 * ie the main thread on most platforms, but the Android UI thread on Android.
33 * The parent side lives on the main thread in the GPU process. If there is no
34 * GPU process, then this protocol is not instantiated.
35 */
36sync protocol PAPZInputBridge
37{
38parent:
39  // The following messages are used to
40  // implement the ReceiveInputEvent methods
41
42  sync ReceiveMultiTouchInputEvent(MultiTouchInput aEvent, bool aWantsCallback)
43      returns(APZEventResult aOutResult, MultiTouchInput aOutEvent);
44
45  sync ReceiveMouseInputEvent(MouseInput aEvent, bool aWantsCallback)
46    returns (APZEventResult aOutResult,
47             MouseInput     aOutEvent);
48
49  sync ReceivePanGestureInputEvent(PanGestureInput aEvent, bool aWantsCallback)
50    returns (APZEventResult  aOutResult,
51             PanGestureInput aOutEvent);
52
53  sync ReceivePinchGestureInputEvent(PinchGestureInput aEvent,
54                                     bool aWantsCallback)
55    returns (APZEventResult    aOutResult,
56             PinchGestureInput aOutEvent);
57
58  sync ReceiveTapGestureInputEvent(TapGestureInput aEvent, bool aWantsCallback)
59    returns (APZEventResult  aOutResult,
60             TapGestureInput aOutEvent);
61
62  sync ReceiveScrollWheelInputEvent(ScrollWheelInput aEvent,
63                                    bool aWantsCallback)
64    returns (APZEventResult   aOutResult,
65             ScrollWheelInput aOutEvent);
66
67  sync ReceiveKeyboardInputEvent(KeyboardInput aEvent, bool aWantsCallback)
68    returns (APZEventResult aOutResult,
69             KeyboardInput  aOutEvent);
70
71  async UpdateWheelTransaction(LayoutDeviceIntPoint aRefPoint,
72                               EventMessage aEventMessage,
73                               ScrollableLayerGuid? aTargetGuid);
74
75  sync ProcessUnhandledEvent(LayoutDeviceIntPoint aRefPoint)
76    returns (LayoutDeviceIntPoint   aOutRefPoint,
77             ScrollableLayerGuid    aOutTargetGuid,
78             uint64_t               aOutFocusSequenceNumber,
79             LayersId               aOutLayersId);
80
81child:
82  async CallInputBlockCallback(uint64_t aInputBlockId,
83                               APZHandledResult aHandledResult);
84};
85
86} // namespace gfx
87} // namespace mozilla
88