summaryrefslogtreecommitdiffstats
path: root/gfx/layers/ipc/PAPZCTreeManager.ipdl
blob: 21d899f91cd669bd2291016e850a00b7e6258cd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */

include "mozilla/GfxMessageUtils.h";
include "ipc/nsGUIEventIPC.h";

include protocol PCompositorBridge;

using CSSRect from "Units.h";
using LayoutDeviceCoord from "Units.h";
using LayoutDeviceIntPoint from "Units.h";
using mozilla::LayoutDevicePoint from "Units.h";
using ScreenPoint from "Units.h";
using struct mozilla::layers::ScrollableLayerGuid from "FrameMetrics.h";
using mozilla::layers::MaybeZoomConstraints from "FrameMetrics.h";
using mozilla::layers::TouchBehaviorFlags from "mozilla/layers/APZUtils.h";
using mozilla::layers::AsyncDragMetrics from "mozilla/layers/AsyncDragMetrics.h";
using mozilla::layers::GeckoContentController::TapType from "mozilla/layers/GeckoContentController.h";

using nsEventStatus from "mozilla/EventForwards.h";
using EventMessage from "mozilla/EventForwards.h";
using mozilla::Modifiers from "mozilla/EventForwards.h";
using class mozilla::WidgetInputEvent from "mozilla/BasicEvents.h";
using class mozilla::WidgetMouseEventBase from "mozilla/MouseEvents.h";
using mozilla::WidgetMouseEvent::Reason from "mozilla/MouseEvents.h";
using class mozilla::WidgetTouchEvent from "mozilla/TouchEvents.h";
using class mozilla::WidgetWheelEvent from "mozilla/MouseEvents.h";
using class mozilla::InputData from "InputData.h";
using class mozilla::MultiTouchInput from "InputData.h";
using class mozilla::MouseInput from "InputData.h";
using class mozilla::PanGestureInput from "InputData.h";
using class mozilla::PinchGestureInput from "InputData.h";
using mozilla::PinchGestureInput::PinchGestureType from "InputData.h";
using class mozilla::TapGestureInput from "InputData.h";
using class mozilla::ScrollWheelInput from "InputData.h";

namespace mozilla {
namespace layers {

/**
 * PAPZCTreeManager is a protocol for remoting an IAPZCTreeManager. PAPZCTreeManager
 * lives on the PCompositorBridge protocol which either connects to the compositor
 * thread in the main process, or to the compositor thread in the gpu processs.
 *
 * PAPZCTreeManagerParent lives in the compositor thread, while PAPZCTreeManagerChild
 * lives in the main thread of the main or the content process. APZCTreeManagerParent
 * and APZCTreeManagerChild implement this protocol.
 */
sync protocol PAPZCTreeManager
{
manager PCompositorBridge;

parent:

  // These messages correspond to the methods
  // on the IAPZCTreeManager interface

  async ZoomToRect(ScrollableLayerGuid aGuid, CSSRect aRect, uint32_t Flags);

  async ContentReceivedInputBlock(uint64_t aInputBlockId, bool PreventDefault);

  async SetTargetAPZC(uint64_t aInputBlockId, ScrollableLayerGuid[] Targets);

  async UpdateZoomConstraints(ScrollableLayerGuid aGuid, MaybeZoomConstraints aConstraints);

  async CancelAnimation(ScrollableLayerGuid aGuid);

  async AdjustScrollForSurfaceShift(ScreenPoint aShift);

  async SetDPI(float aDpiValue);

  async SetAllowedTouchBehavior(uint64_t aInputBlockId, TouchBehaviorFlags[] aValues);

  async StartScrollbarDrag(ScrollableLayerGuid aGuid, AsyncDragMetrics aDragMetrics);

  async SetLongTapEnabled(bool aTapGestureEnabled);

  async ProcessTouchVelocity(uint32_t aTimestampMs, float aSpeedY);

  // The following messages are used to
  // implement the ReceiveInputEvent methods

  sync ReceiveMultiTouchInputEvent(MultiTouchInput aEvent)
    returns (nsEventStatus       aOutStatus,
             MultiTouchInput     aOutEvent,
             ScrollableLayerGuid aOutTargetGuid,
             uint64_t            aOutInputBlockId);

  sync ReceiveMouseInputEvent(MouseInput aEvent)
    returns (nsEventStatus       aOutStatus,
             MouseInput          aOutEvent,
             ScrollableLayerGuid aOutTargetGuid,
             uint64_t            aOutInputBlockId);

  sync ReceivePanGestureInputEvent(PanGestureInput aEvent)
    returns (nsEventStatus       aOutStatus,
             PanGestureInput     aOutEvent,
             ScrollableLayerGuid aOutTargetGuid,
             uint64_t            aOutInputBlockId);

  sync ReceivePinchGestureInputEvent(PinchGestureInput aEvent)
    returns (nsEventStatus       aOutStatus,
             PinchGestureInput   aOutEvent,
             ScrollableLayerGuid aOutTargetGuid,
             uint64_t            aOutInputBlockId);

  sync ReceiveTapGestureInputEvent(TapGestureInput aEvent)
    returns (nsEventStatus       aOutStatus,
             TapGestureInput     aOutEvent,
             ScrollableLayerGuid aOutTargetGuid,
             uint64_t            aOutInputBlockId);

  sync ReceiveScrollWheelInputEvent(ScrollWheelInput aEvent)
    returns (nsEventStatus       aOutStatus,
             ScrollWheelInput    aOutEvent,
             ScrollableLayerGuid aOutTargetGuid,
             uint64_t            aOutInputBlockId);

  async UpdateWheelTransaction(LayoutDeviceIntPoint aRefPoint, EventMessage aEventMessage);

  sync TransformEventRefPoint(LayoutDeviceIntPoint aRefPoint)
    returns (LayoutDeviceIntPoint   aOutRefPoint,
             ScrollableLayerGuid    aOutTargetGuid);

  async __delete__();

child:

  async HandleTap(TapType aType, LayoutDevicePoint point, Modifiers aModifiers,
                  ScrollableLayerGuid aGuid, uint64_t aInputBlockId);

  async NotifyPinchGesture(PinchGestureType aType, ScrollableLayerGuid aGuid,
                           LayoutDeviceCoord aSpanChange, Modifiers aModifiers);
};

} // namespace gfx
} // namespace mozilla