tor-browser

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

PositionedEventTargeting.h (1263B)


      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_PositionedEventTargeting_h
      8 #define mozilla_PositionedEventTargeting_h
      9 
     10 #include <stdint.h>
     11 
     12 #include "RelativeTo.h"
     13 #include "mozilla/EventForwards.h"
     14 
     15 class nsIFrame;
     16 struct nsPoint;
     17 
     18 namespace mozilla {
     19 
     20 enum { INPUT_IGNORE_ROOT_SCROLL_FRAME = 0x01 };
     21 /**
     22 * Finds the target frame for a pointer event given the event type and location.
     23 * This can look for frames within a rectangle surrounding the actual location
     24 * that are suitable targets, to account for inaccurate pointing devices.
     25 */
     26 nsIFrame* FindFrameTargetedByInputEvent(
     27    WidgetGUIEvent* aEvent, RelativeTo aRootFrame,
     28    const nsPoint& aPointRelativeToRootFrame, uint32_t aFlags = 0);
     29 
     30 class MOZ_RAII EventRetargetSuppression {
     31 public:
     32  EventRetargetSuppression();
     33  ~EventRetargetSuppression();
     34  static bool IsActive();
     35 
     36 private:
     37  static uint32_t sSuppressionCount;
     38 };
     39 
     40 }  // namespace mozilla
     41 
     42 #endif /* mozilla_PositionedEventTargeting_h */