/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/****************************************************************************** * mozilla::WidgetGestureNotifyEvent * * This event is the first event generated when the user touches * the screen with a finger, and it's meant to decide what kind * of action we'll use for that touch interaction. * * The event is dispatched to the layout and based on what is underneath * the initial contact point it's then decided if we should pan * (finger scrolling) or drag the target element.
******************************************************************************/
class WidgetGestureNotifyEvent : public WidgetGUIEvent { public: virtual WidgetGestureNotifyEvent* AsGestureNotifyEvent() override { returnthis;
}
virtual WidgetEvent* Duplicate() const override { // XXX Looks like this event is handled only in PostHandleEvent() of // EventStateManager. Therefore, it might be possible to handle this // in PreHandleEvent() and not to dispatch as a DOM event into the DOM // tree like ContentQueryEvent. Then, this event doesn't need to // support Duplicate().
MOZ_ASSERT(mClass == eGestureNotifyEventClass, "Duplicate() must be overridden by sub class"); // Not copying widget, it is a weak reference.
WidgetGestureNotifyEvent* result = new WidgetGestureNotifyEvent(false, mMessage, nullptr, this);
result->AssignGestureNotifyEventData(*this, true);
result->mFlags = mFlags; return result;
}
virtual WidgetEvent* Duplicate() const override {
MOZ_ASSERT(mClass == eSimpleGestureEventClass, "Duplicate() must be overridden by sub class"); // Not copying widget, it is a weak reference.
WidgetSimpleGestureEvent* result = new WidgetSimpleGestureEvent(false, mMessage, nullptr, this);
result->AssignSimpleGestureEventData(*this, true);
result->mFlags = mFlags; return result;
}
// See SimpleGestureEvent.webidl for values
uint32_t mAllowedDirections; // See SimpleGestureEvent.webidl for values
uint32_t mDirection; // The number of taps for tap events
uint32_t mClickCount; // Delta for magnify and rotate events double mDelta;
// XXX Not tested by test_assign_event_data.html void AssignSimpleGestureEventData(const WidgetSimpleGestureEvent& aEvent, bool aCopyTargets) {
AssignMouseEventBaseData(aEvent, aCopyTargets);
WidgetEvent* Duplicate() const override {
MOZ_ASSERT(mClass == eTouchEventClass, "Duplicate() must be overridden by sub class"); // Not copying widget, it is a weak reference.
WidgetTouchEvent* result = new WidgetTouchEvent(false, mMessage, nullptr, this);
result->AssignTouchEventData(*this, true);
result->mFlags = mFlags; return result;
}
// Assign*EventData() assume that they're called only new instance.
MOZ_ASSERT(mTouches.IsEmpty());
mTouches.AppendElements(aEvent.mTouches);
mInputSource = aEvent.mInputSource;
}
};
} // namespace mozilla
#endif// mozilla_TouchEvents_h__
¤ Dauer der Verarbeitung: 0.15 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.