Source code

Revision control

Other Tools

1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim: set ts=8 sts=2 et sw=2 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
#ifndef mozilla_layers_DragMetrics_h
8
#define mozilla_layers_DragMetrics_h
9
10
#include "mozilla/layers/ScrollableLayerGuid.h"
11
#include "LayersTypes.h"
12
#include "mozilla/Maybe.h"
13
14
namespace IPC {
15
template <typename T>
16
struct ParamTraits;
17
} // namespace IPC
18
19
namespace mozilla {
20
21
namespace layers {
22
23
class AsyncDragMetrics {
24
friend struct IPC::ParamTraits<mozilla::layers::AsyncDragMetrics>;
25
26
public:
27
// IPC constructor
28
AsyncDragMetrics()
29
: mViewId(0),
30
mPresShellId(0),
31
mDragStartSequenceNumber(0),
32
mScrollbarDragOffset(0) {}
33
34
AsyncDragMetrics(const ScrollableLayerGuid::ViewID& aViewId,
35
uint32_t aPresShellId, uint64_t aDragStartSequenceNumber,
36
CSSCoord aScrollbarDragOffset, ScrollDirection aDirection)
37
: mViewId(aViewId),
38
mPresShellId(aPresShellId),
39
mDragStartSequenceNumber(aDragStartSequenceNumber),
40
mScrollbarDragOffset(aScrollbarDragOffset),
41
mDirection(Some(aDirection)) {}
42
43
ScrollableLayerGuid::ViewID mViewId;
44
uint32_t mPresShellId;
45
uint64_t mDragStartSequenceNumber;
46
CSSCoord mScrollbarDragOffset; // relative to the thumb's start offset
47
Maybe<ScrollDirection> mDirection;
48
};
49
50
} // namespace layers
51
} // namespace mozilla
52
53
#endif