1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set sw=2 ts=8 et tw=80 : */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4  * License, v. 2.0. If a copy of the MPL was not distributed with this
5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 
7 #include "QueuedInput.h"
8 
9 #include "AsyncPanZoomController.h"
10 #include "InputBlockState.h"
11 #include "InputData.h"
12 #include "OverscrollHandoffState.h"
13 
14 namespace mozilla {
15 namespace layers {
16 
QueuedInput(const MultiTouchInput & aInput,TouchBlockState & aBlock)17 QueuedInput::QueuedInput(const MultiTouchInput& aInput, TouchBlockState& aBlock)
18   : mInput(MakeUnique<MultiTouchInput>(aInput))
19   , mBlock(&aBlock)
20 {
21 }
22 
QueuedInput(const ScrollWheelInput & aInput,WheelBlockState & aBlock)23 QueuedInput::QueuedInput(const ScrollWheelInput& aInput, WheelBlockState& aBlock)
24   : mInput(MakeUnique<ScrollWheelInput>(aInput))
25   , mBlock(&aBlock)
26 {
27 }
28 
QueuedInput(const MouseInput & aInput,DragBlockState & aBlock)29 QueuedInput::QueuedInput(const MouseInput& aInput, DragBlockState& aBlock)
30   : mInput(MakeUnique<MouseInput>(aInput))
31   , mBlock(&aBlock)
32 {
33 }
34 
QueuedInput(const PanGestureInput & aInput,PanGestureBlockState & aBlock)35 QueuedInput::QueuedInput(const PanGestureInput& aInput, PanGestureBlockState& aBlock)
36   : mInput(MakeUnique<PanGestureInput>(aInput))
37   , mBlock(&aBlock)
38 {
39 }
40 
41 InputData*
Input()42 QueuedInput::Input()
43 {
44   return mInput.get();
45 }
46 
47 CancelableBlockState*
Block()48 QueuedInput::Block()
49 {
50   return mBlock.get();
51 }
52 
53 } // namespace layers
54 } // namespace mozilla
55