tor-browser

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

QueuedInput.h (1964B)


      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_QueuedInput_h
      8 #define mozilla_layers_QueuedInput_h
      9 
     10 #include "mozilla/RefPtr.h"
     11 #include "mozilla/UniquePtr.h"
     12 
     13 namespace mozilla {
     14 
     15 class InputData;
     16 class MultiTouchInput;
     17 class ScrollWheelInput;
     18 class MouseInput;
     19 class PanGestureInput;
     20 class PinchGestureInput;
     21 class KeyboardInput;
     22 
     23 namespace layers {
     24 
     25 class InputBlockState;
     26 class TouchBlockState;
     27 class WheelBlockState;
     28 class DragBlockState;
     29 class PanGestureBlockState;
     30 class PinchGestureBlockState;
     31 class KeyboardBlockState;
     32 
     33 /**
     34 * This lightweight class holds a pointer to an input event that has not yet
     35 * been completely processed, along with the input block that the input event
     36 * is associated with.
     37 */
     38 class QueuedInput {
     39 public:
     40  QueuedInput(const MultiTouchInput& aInput, TouchBlockState& aBlock);
     41  QueuedInput(const ScrollWheelInput& aInput, WheelBlockState& aBlock);
     42  QueuedInput(const MouseInput& aInput, DragBlockState& aBlock);
     43  QueuedInput(const PanGestureInput& aInput, PanGestureBlockState& aBlock);
     44  QueuedInput(const PinchGestureInput& aInput, PinchGestureBlockState& aBlock);
     45  QueuedInput(const KeyboardInput& aInput, KeyboardBlockState& aBlock);
     46 
     47  InputData* Input();
     48  InputBlockState* Block();
     49 
     50 private:
     51  // A copy of the input event that is provided to the constructor. This must
     52  // be non-null, and is owned by this QueuedInput instance (hence the
     53  // UniquePtr).
     54  UniquePtr<InputData> mInput;
     55  // A pointer to the block that the input event is associated with. This must
     56  // be non-null.
     57  RefPtr<InputBlockState> mBlock;
     58 };
     59 
     60 }  // namespace layers
     61 }  // namespace mozilla
     62 
     63 #endif  // mozilla_layers_QueuedInput_h