Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef mozilla_dom_Touch_h_ |
michael@0 | 7 | #define mozilla_dom_Touch_h_ |
michael@0 | 8 | |
michael@0 | 9 | #include "mozilla/Attributes.h" |
michael@0 | 10 | #include "mozilla/EventForwards.h" |
michael@0 | 11 | #include "mozilla/MouseEvents.h" |
michael@0 | 12 | #include "nsWrapperCache.h" |
michael@0 | 13 | #include "nsAutoPtr.h" |
michael@0 | 14 | #include "Units.h" |
michael@0 | 15 | |
michael@0 | 16 | class nsPresContext; |
michael@0 | 17 | |
michael@0 | 18 | namespace mozilla { |
michael@0 | 19 | namespace dom { |
michael@0 | 20 | |
michael@0 | 21 | class EventTarget; |
michael@0 | 22 | |
michael@0 | 23 | class Touch MOZ_FINAL : public nsISupports |
michael@0 | 24 | , public nsWrapperCache |
michael@0 | 25 | , public WidgetPointerHelper |
michael@0 | 26 | { |
michael@0 | 27 | public: |
michael@0 | 28 | static bool PrefEnabled(JSContext* aCx, JSObject* aGlobal); |
michael@0 | 29 | |
michael@0 | 30 | Touch(EventTarget* aTarget, |
michael@0 | 31 | int32_t aIdentifier, |
michael@0 | 32 | int32_t aPageX, |
michael@0 | 33 | int32_t aPageY, |
michael@0 | 34 | int32_t aScreenX, |
michael@0 | 35 | int32_t aScreenY, |
michael@0 | 36 | int32_t aClientX, |
michael@0 | 37 | int32_t aClientY, |
michael@0 | 38 | int32_t aRadiusX, |
michael@0 | 39 | int32_t aRadiusY, |
michael@0 | 40 | float aRotationAngle, |
michael@0 | 41 | float aForce); |
michael@0 | 42 | Touch(int32_t aIdentifier, |
michael@0 | 43 | nsIntPoint aPoint, |
michael@0 | 44 | nsIntPoint aRadius, |
michael@0 | 45 | float aRotationAngle, |
michael@0 | 46 | float aForce); |
michael@0 | 47 | |
michael@0 | 48 | ~Touch(); |
michael@0 | 49 | |
michael@0 | 50 | NS_DECL_CYCLE_COLLECTING_ISUPPORTS |
michael@0 | 51 | NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Touch) |
michael@0 | 52 | |
michael@0 | 53 | void InitializePoints(nsPresContext* aPresContext, WidgetEvent* aEvent); |
michael@0 | 54 | |
michael@0 | 55 | void SetTarget(EventTarget* aTarget); |
michael@0 | 56 | |
michael@0 | 57 | bool Equals(Touch* aTouch); |
michael@0 | 58 | |
michael@0 | 59 | virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; |
michael@0 | 60 | |
michael@0 | 61 | EventTarget* GetParentObject(); |
michael@0 | 62 | |
michael@0 | 63 | // WebIDL |
michael@0 | 64 | int32_t Identifier() const { return mIdentifier; } |
michael@0 | 65 | EventTarget* Target() const; |
michael@0 | 66 | int32_t ScreenX() const { return mScreenPoint.x; } |
michael@0 | 67 | int32_t ScreenY() const { return mScreenPoint.y; } |
michael@0 | 68 | int32_t ClientX() const { return mClientPoint.x; } |
michael@0 | 69 | int32_t ClientY() const { return mClientPoint.y; } |
michael@0 | 70 | int32_t PageX() const { return mPagePoint.x; } |
michael@0 | 71 | int32_t PageY() const { return mPagePoint.y; } |
michael@0 | 72 | int32_t RadiusX() const { return mRadius.x; } |
michael@0 | 73 | int32_t RadiusY() const { return mRadius.y; } |
michael@0 | 74 | float RotationAngle() const { return mRotationAngle; } |
michael@0 | 75 | float Force() const { return mForce; } |
michael@0 | 76 | |
michael@0 | 77 | nsCOMPtr<EventTarget> mTarget; |
michael@0 | 78 | nsIntPoint mRefPoint; |
michael@0 | 79 | bool mChanged; |
michael@0 | 80 | uint32_t mMessage; |
michael@0 | 81 | int32_t mIdentifier; |
michael@0 | 82 | CSSIntPoint mPagePoint; |
michael@0 | 83 | CSSIntPoint mClientPoint; |
michael@0 | 84 | nsIntPoint mScreenPoint; |
michael@0 | 85 | nsIntPoint mRadius; |
michael@0 | 86 | float mRotationAngle; |
michael@0 | 87 | float mForce; |
michael@0 | 88 | protected: |
michael@0 | 89 | bool mPointsInitialized; |
michael@0 | 90 | }; |
michael@0 | 91 | |
michael@0 | 92 | } // namespace dom |
michael@0 | 93 | } // namespace mozilla |
michael@0 | 94 | |
michael@0 | 95 | #endif // mozilla_dom_Touch_h_ |