本文整理汇总了C++中PlatformWheelEvent::position方法的典型用法代码示例。如果您正苦于以下问题:C++ PlatformWheelEvent::position方法的具体用法?C++ PlatformWheelEvent::position怎么用?C++ PlatformWheelEvent::position使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlatformWheelEvent
的用法示例。
在下文中一共展示了PlatformWheelEvent::position方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: constructRelativeWheelEvent
static PlatformWheelEvent constructRelativeWheelEvent(const PlatformWheelEvent& e, FramelessScrollView* parent, FramelessScrollView* child)
{
IntPoint pos = parent->convertSelfToChild(child, e.position());
// FIXME: This is a horrible hack since PlatformWheelEvent has no setters for x/y.
PlatformWheelEvent relativeEvent = e;
IntPoint& relativePos = const_cast<IntPoint&>(relativeEvent.position());
relativePos.setX(pos.x());
relativePos.setY(pos.y());
return relativeEvent;
}
示例2: shouldHandleWheelEventSynchronously
bool ScrollingTree::shouldHandleWheelEventSynchronously(const PlatformWheelEvent& wheelEvent)
{
// This method is invoked by the event handling thread
MutexLocker lock(m_mutex);
if (m_hasWheelEventHandlers)
return true;
bool shouldSetLatch = wheelEvent.shouldConsiderLatching();
if (hasLatchedNode() && !shouldSetLatch)
return false;
if (shouldSetLatch)
m_latchedNode = 0;
if (!m_nonFastScrollableRegion.isEmpty()) {
// FIXME: This is not correct for non-default scroll origins.
FloatPoint position = wheelEvent.position();
position.moveBy(m_mainFrameScrollPosition);
if (m_nonFastScrollableRegion.contains(roundedIntPoint(position)))
return true;
}
return false;
}
示例3: shouldTurnVerticalTicksIntoHorizontal
// GTK+ must scroll horizontally if the mouse pointer is on top of the
// horizontal scrollbar while scrolling with the wheel; we need to
// add the deltas and ticks here so that this behavior is consistent
// for styled scrollbars.
bool EventHandler::shouldTurnVerticalTicksIntoHorizontal(const HitTestResult& result, const PlatformWheelEvent& event) const
{
FrameView* view = m_frame.view();
Scrollbar* scrollbar = view ? view->scrollbarAtPoint(event.position()) : nullptr;
if (!scrollbar)
scrollbar = result.scrollbar();
return scrollbar && scrollbar->orientation() == HorizontalScrollbar;
}
示例4: setEvent
WheelEventDispatchMediator::WheelEventDispatchMediator(const PlatformWheelEvent& event, PassRefPtr<AbstractView> view)
{
if (!(event.deltaX() || event.deltaY()))
return;
setEvent(WheelEvent::create(FloatPoint(event.wheelTicksX(), event.wheelTicksY()), FloatPoint(event.deltaX(), event.deltaY()),
deltaMode(event), view, event.globalPosition(), event.position(),
event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), event.directionInvertedFromDevice()));
}
示例5: adoptRefWillBeNoop
PassRefPtrWillBeRawPtr<WheelEvent> WheelEvent::create(const PlatformWheelEvent& event, PassRefPtrWillBeRawPtr<AbstractView> view)
{
return adoptRefWillBeNoop(new WheelEvent(FloatPoint(event.wheelTicksX(), event.wheelTicksY()), FloatPoint(event.deltaX(), event.deltaY()),
convertDeltaMode(event), view, event.globalPosition(), event.position(),
event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(),
MouseEvent::platformModifiersToButtons(event.modifiers()),
event.canScroll(), event.hasPreciseScrollingDeltas(),
static_cast<Event::RailsMode>(event.railsMode())));
}
示例6: handleWheelEvent
bool PopupListBox::handleWheelEvent(const PlatformWheelEvent& event)
{
if (!isPointInBounds(event.position())) {
abandon();
return true;
}
ScrollableArea::handleWheelEvent(event);
return true;
}
示例7: tryToHandleWheelEvent
ScrollingTree::EventResult ScrollingTree::tryToHandleWheelEvent(const PlatformWheelEvent& wheelEvent)
{
{
MutexLocker lock(m_mutex);
if (m_hasWheelEventHandlers)
return SendToMainThread;
if (!m_nonFastScrollableRegion.isEmpty()) {
// FIXME: This is not correct for non-default scroll origins.
IntPoint position = wheelEvent.position();
position.moveBy(m_mainFrameScrollPosition);
if (m_nonFastScrollableRegion.contains(position))
return SendToMainThread;
}
}
if (willWheelEventStartSwipeGesture(wheelEvent))
return DidNotHandleEvent;
ScrollingThread::dispatch(bind(&ScrollingTree::handleWheelEvent, this, wheelEvent));
return DidHandleEvent;
}
示例8: MouseEvent
WheelEvent::WheelEvent(const PlatformWheelEvent& event, PassRefPtr<AbstractView> view)
: MouseEvent(eventNames().wheelEvent, true, true, event.timestamp(), view, 0, event.globalPosition().x(), event.globalPosition().y(), event.position().x(), event.position().y()
#if ENABLE(POINTER_LOCK)
, 0, 0
#endif
, event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), 0, 0, 0, 0, false)
, m_wheelDelta(event.wheelTicksX() * TickMultiplier, event.wheelTicksY() * TickMultiplier)
, m_deltaX(-event.deltaX())
, m_deltaY(-event.deltaY())
, m_deltaZ(0)
, m_deltaMode(determineDeltaMode(event))
, m_wheelEvent(event)
, m_initializedWithPlatformWheelEvent(true)
{
}