tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

AsyncDragMetrics.h (1620B)


      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                   OuterCSSCoord aScrollbarDragOffset,
     37                   ScrollDirection aDirection)
     38      : mViewId(aViewId),
     39        mPresShellId(aPresShellId),
     40        mDragStartSequenceNumber(aDragStartSequenceNumber),
     41        mScrollbarDragOffset(aScrollbarDragOffset),
     42        mDirection(Some(aDirection)) {}
     43 
     44  ScrollableLayerGuid::ViewID mViewId;
     45  uint32_t mPresShellId;
     46  uint64_t mDragStartSequenceNumber;
     47  OuterCSSCoord mScrollbarDragOffset;  // relative to the thumb's start offset
     48  Maybe<ScrollDirection> mDirection;
     49 };
     50 
     51 }  // namespace layers
     52 }  // namespace mozilla
     53 
     54 #endif