Changeset 93053 in webkit
- Timestamp:
- Aug 15, 2011 12:31:06 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r93051 r93053 1 2011-08-15 Emil A Eklund <eae@chromium.org> 2 3 Switch mouse events to to new layout types 4 https://bugs.webkit.org/show_bug.cgi?id=66179 5 6 Reviewed by Eric Seidel. 7 8 Convert mouse events to new layout abstraction as a part of the ongoing 9 conversion work. 10 11 No new tests, no new functionality. 12 13 * dom/MouseRelatedEvent.cpp: 14 (WebCore::contentsScrollOffset): 15 (WebCore::MouseRelatedEvent::MouseRelatedEvent): 16 (WebCore::MouseRelatedEvent::initCoordinates): 17 (WebCore::MouseRelatedEvent::computePageLocation): 18 (WebCore::MouseRelatedEvent::computeRelativePosition): 19 (WebCore::MouseRelatedEvent::pageLocation): 20 * dom/MouseRelatedEvent.h: 21 (WebCore::MouseRelatedEvent::screenLocation): 22 (WebCore::MouseRelatedEvent::clientLocation): 23 (WebCore::MouseRelatedEvent::absoluteLocation): 24 (WebCore::MouseRelatedEvent::setAbsoluteLocation): 25 * page/EventHandler.cpp: 26 (WebCore::EventHandler::clear): 27 (WebCore::EventHandler::handleMousePressEventSingleClick): 28 (WebCore::selectionExtentRespectingEditingBoundary): 29 (WebCore::EventHandler::hitTestResultAtPoint): 30 (WebCore::EventHandler::currentMousePosition): 31 (WebCore::documentPointForWindowPoint): 32 (WebCore::EventHandler::handleMousePressEvent): 33 (WebCore::EventHandler::mouseMoved): 34 (WebCore::EventHandler::handleWheelEvent): 35 (WebCore::EventHandler::sendContextMenuEvent): 36 (WebCore::EventHandler::sendContextMenuEventForKey): 37 (WebCore::EventHandler::fakeMouseMoveEventTimerFired): 38 (WebCore::EventHandler::dragHysteresisExceeded): 39 (WebCore::EventHandler::handleDrag): 40 (WebCore::EventHandler::handleTouchEvent): 41 * page/EventHandler.h: 42 * platform/PlatformMouseEvent.h: 43 (WebCore::PlatformMouseEvent::PlatformMouseEvent): 44 (WebCore::PlatformMouseEvent::pos): 45 (WebCore::PlatformMouseEvent::x): 46 (WebCore::PlatformMouseEvent::y): 47 (WebCore::PlatformMouseEvent::globalX): 48 (WebCore::PlatformMouseEvent::globalY): 49 * platform/mac/PlatformMouseEventMac.mm: 50 (WebCore::globalPoint): 51 (WebCore::pointForEvent): 52 (WebCore::globalPointForEvent): 53 1 54 2011-08-15 Ryosuke Niwa <rniwa@webkit.org> 2 55 -
trunk/Source/WebCore/dom/MouseRelatedEvent.cpp
r87865 r93053 39 39 } 40 40 41 static IntSize contentsScrollOffset(AbstractView* abstractView)41 static LayoutSize contentsScrollOffset(AbstractView* abstractView) 42 42 { 43 43 if (!abstractView) 44 return IntSize();44 return LayoutSize(); 45 45 Frame* frame = abstractView->frame(); 46 46 if (!frame) 47 return IntSize();47 return LayoutSize(); 48 48 FrameView* frameView = frame->view(); 49 49 if (!frameView) 50 return IntSize();51 return IntSize(frameView->scrollX() / frame->pageZoomFactor(),50 return LayoutSize(); 51 return LayoutSize(frameView->scrollX() / frame->pageZoomFactor(), 52 52 frameView->scrollY() / frame->pageZoomFactor()); 53 53 } 54 54 55 55 MouseRelatedEvent::MouseRelatedEvent(const AtomicString& eventType, bool canBubble, bool cancelable, PassRefPtr<AbstractView> abstractView, 56 int detail, const IntPoint& screenLocation, const IntPoint& windowLocation,56 int detail, const LayoutPoint& screenLocation, const LayoutPoint& windowLocation, 57 57 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool isSimulated) 58 58 : UIEventWithKeyState(eventType, canBubble, cancelable, abstractView, detail, ctrlKey, altKey, shiftKey, metaKey) … … 60 60 , m_isSimulated(isSimulated) 61 61 { 62 IntPoint adjustedPageLocation;63 IntPoint scrollPosition;62 LayoutPoint adjustedPageLocation; 63 LayoutPoint scrollPosition; 64 64 65 65 Frame* frame = view() ? view()->frame() : 0; … … 74 74 75 75 // FIXME: Change this to use float math and proper rounding (or 76 // better yet, use IntPoint::scale).76 // better yet, use LayoutPoint::scale). 77 77 scrollPosition.setX(scrollPosition.x() / pageZoom); 78 78 scrollPosition.setY(scrollPosition.y() / pageZoom); … … 98 98 } 99 99 100 void MouseRelatedEvent::initCoordinates(const IntPoint& clientLocation)100 void MouseRelatedEvent::initCoordinates(const LayoutPoint& clientLocation) 101 101 { 102 102 // Set up initial values for coordinates. … … 126 126 { 127 127 float zoomFactor = pageZoomFactor(this); 128 setAbsoluteLocation(rounded IntPoint(FloatPoint(pageX() * zoomFactor, pageY() * zoomFactor)));128 setAbsoluteLocation(roundedLayoutPoint(FloatPoint(pageX() * zoomFactor, pageY() * zoomFactor))); 129 129 } 130 130 … … 151 151 if (RenderObject* r = targetNode->renderer()) { 152 152 FloatPoint localPos = r->absoluteToLocal(absoluteLocation(), false, true); 153 m_offsetLocation = rounded IntPoint(localPos);153 m_offsetLocation = roundedLayoutPoint(localPos); 154 154 float scaleFactor = 1 / pageZoomFactor(this); 155 155 if (scaleFactor != 1.0f) … … 216 216 } 217 217 218 const IntPoint& MouseRelatedEvent::pageLocation() const218 const LayoutPoint& MouseRelatedEvent::pageLocation() const 219 219 { 220 220 return m_pageLocation; -
trunk/Source/WebCore/dom/MouseRelatedEvent.h
r87865 r93053 25 25 #define MouseRelatedEvent_h 26 26 27 #include " IntPoint.h"27 #include "LayoutTypes.h" 28 28 #include "UIEventWithKeyState.h" 29 29 … … 37 37 int screenX() const { return m_screenLocation.x(); } 38 38 int screenY() const { return m_screenLocation.y(); } 39 const IntPoint& screenLocation() const { return m_screenLocation; }39 const LayoutPoint& screenLocation() const { return m_screenLocation; } 40 40 int clientX() const { return m_clientLocation.x(); } 41 41 int clientY() const { return m_clientLocation.y(); } 42 const IntPoint& clientLocation() const { return m_clientLocation; }42 const LayoutPoint& clientLocation() const { return m_clientLocation; } 43 43 int layerX(); 44 44 int layerY(); … … 48 48 virtual int pageX() const; 49 49 virtual int pageY() const; 50 virtual const IntPoint& pageLocation() const;50 virtual const LayoutPoint& pageLocation() const; 51 51 int x() const; 52 52 int y() const; … … 54 54 // Page point in "absolute" coordinates (i.e. post-zoomed, page-relative coords, 55 55 // usable with RenderObject::absoluteToLocal). 56 const IntPoint& absoluteLocation() const { return m_absoluteLocation; }57 void setAbsoluteLocation(const IntPoint& p) { m_absoluteLocation = p; }56 const LayoutPoint& absoluteLocation() const { return m_absoluteLocation; } 57 void setAbsoluteLocation(const LayoutPoint& p) { m_absoluteLocation = p; } 58 58 59 59 protected: 60 60 MouseRelatedEvent(); 61 61 MouseRelatedEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView>, 62 int detail, const IntPoint& screenLocation, const IntPoint& windowLocation,62 int detail, const LayoutPoint& screenLocation, const LayoutPoint& windowLocation, 63 63 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool isSimulated = false); 64 64 65 65 void initCoordinates(); 66 void initCoordinates(const IntPoint& clientLocation);66 void initCoordinates(const LayoutPoint& clientLocation); 67 67 virtual void receivedTarget(); 68 68 … … 71 71 72 72 // Expose these so MouseEvent::initMouseEvent can set them. 73 IntPoint m_screenLocation;74 IntPoint m_clientLocation;73 LayoutPoint m_screenLocation; 74 LayoutPoint m_clientLocation; 75 75 76 76 private: 77 IntPoint m_pageLocation;78 IntPoint m_layerLocation;79 IntPoint m_offsetLocation;80 IntPoint m_absoluteLocation;77 LayoutPoint m_pageLocation; 78 LayoutPoint m_layerLocation; 79 LayoutPoint m_offsetLocation; 80 LayoutPoint m_absoluteLocation; 81 81 bool m_isSimulated; 82 82 bool m_hasCachedRelativePosition; -
trunk/Source/WebCore/page/EventHandler.cpp
r92234 r93053 243 243 m_shouldOnlyFireDragOverEvent = false; 244 244 #endif 245 m_currentMousePosition = IntPoint();245 m_currentMousePosition = LayoutPoint(); 246 246 m_mousePressNode = 0; 247 247 m_mousePressed = false; … … 397 397 // existing selection so we can allow for text dragging. 398 398 if (FrameView* view = m_frame->view()) { 399 IntPoint vPoint = view->windowToContents(event.event().pos());399 LayoutPoint vPoint = view->windowToContents(event.event().pos()); 400 400 if (!extendSelection && m_frame->selection()->contains(vPoint)) { 401 401 m_mouseDownWasSingleClickInSelection = true; … … 641 641 } 642 642 643 static VisiblePosition selectionExtentRespectingEditingBoundary(const VisibleSelection& selection, const IntPoint& localPoint, Node* targetNode)644 { 645 IntPoint selectionEndPoint = localPoint;643 static VisiblePosition selectionExtentRespectingEditingBoundary(const VisibleSelection& selection, const LayoutPoint& localPoint, Node* targetNode) 644 { 645 LayoutPoint selectionEndPoint = localPoint; 646 646 Element* editableElement = selection.rootEditableElement(); 647 647 … … 654 654 655 655 FloatPoint absolutePoint = targetNode->renderer()->localToAbsolute(FloatPoint(selectionEndPoint)); 656 selectionEndPoint = rounded IntPoint(editableElement->renderer()->absoluteToLocal(absolutePoint));656 selectionEndPoint = roundedLayoutPoint(editableElement->renderer()->absoluteToLocal(absolutePoint)); 657 657 targetNode = editableElement; 658 658 } … … 923 923 #endif // ENABLE(DRAG_SUPPORT) 924 924 925 HitTestResult EventHandler::hitTestResultAtPoint(const IntPoint& point, bool allowShadowContent, bool ignoreClipping, HitTestScrollbars testScrollbars, HitTestRequest::HitTestRequestType hitType, const IntSize& padding)925 HitTestResult EventHandler::hitTestResultAtPoint(const LayoutPoint& point, bool allowShadowContent, bool ignoreClipping, HitTestScrollbars testScrollbars, HitTestRequest::HitTestRequestType hitType, const LayoutSize& padding) 926 926 { 927 927 HitTestResult result(point, padding.height(), padding.width(), padding.height(), padding.width()); … … 944 944 break; 945 945 FrameView* view = static_cast<FrameView*>(widget); 946 IntPoint widgetPoint(result.localPoint().x() + view->scrollX() - renderWidget->borderLeft() - renderWidget->paddingLeft(),946 LayoutPoint widgetPoint(result.localPoint().x() + view->scrollX() - renderWidget->borderLeft() - renderWidget->paddingLeft(), 947 947 result.localPoint().y() + view->scrollY() - renderWidget->borderTop() - renderWidget->paddingTop()); 948 948 HitTestResult widgetHitTestResult(widgetPoint, padding.height(), padding.width(), padding.height(), padding.width()); … … 966 966 FrameView* mainView = mainFrame->view(); 967 967 if (resultView && mainView) { 968 IntPoint windowPoint = resultView->contentsToWindow(result.point());969 IntPoint mainFramePoint = mainView->windowToContents(windowPoint);968 LayoutPoint windowPoint = resultView->contentsToWindow(result.point()); 969 LayoutPoint mainFramePoint = mainView->windowToContents(windowPoint); 970 970 result = mainFrame->eventHandler()->hitTestResultAtPoint(mainFramePoint, allowShadowContent, ignoreClipping, testScrollbars, hitType, padding); 971 971 } … … 1123 1123 } 1124 1124 1125 IntPoint EventHandler::currentMousePosition() const1125 LayoutPoint EventHandler::currentMousePosition() const 1126 1126 { 1127 1127 return m_currentMousePosition; … … 1319 1319 } 1320 1320 1321 static IntPoint documentPointForWindowPoint(Frame* frame, const IntPoint& windowPoint)1321 static LayoutPoint documentPointForWindowPoint(Frame* frame, const LayoutPoint& windowPoint) 1322 1322 { 1323 1323 FrameView* view = frame->view(); … … 1375 1375 // Save the document point we generate in case the window coordinate is invalidated by what happens 1376 1376 // when we dispatch the event. 1377 IntPoint documentPoint = documentPointForWindowPoint(m_frame, mouseEvent.pos());1377 LayoutPoint documentPoint = documentPointForWindowPoint(m_frame, mouseEvent.pos()); 1378 1378 MouseEventWithHitTestResults mev = m_frame->document()->prepareMouseEvent(request, documentPoint, mouseEvent); 1379 1379 … … 1422 1422 if (FrameView* view = m_frame->view()) { 1423 1423 RenderLayer* layer = m_clickNode->renderer() ? m_clickNode->renderer()->enclosingLayer() : 0; 1424 IntPoint p = view->windowToContents(mouseEvent.pos());1424 LayoutPoint p = view->windowToContents(mouseEvent.pos()); 1425 1425 if (layer && layer->isPointInResizeControl(p)) { 1426 1426 layer->setInResizeMode(true); … … 1533 1533 bool EventHandler::mouseMoved(const PlatformMouseEvent& event) 1534 1534 { 1535 HitTestResult hoveredNode = HitTestResult( IntPoint());1535 HitTestResult hoveredNode = HitTestResult(LayoutPoint()); 1536 1536 bool result = handleMouseMoveEvent(event, &hoveredNode); 1537 1537 … … 2129 2129 return false; 2130 2130 setFrameWasScrolledByUser(); 2131 IntPoint vPoint = view->windowToContents(e.pos());2131 LayoutPoint vPoint = view->windowToContents(e.pos()); 2132 2132 2133 2133 Node* node; … … 2261 2261 2262 2262 bool swallowEvent; 2263 IntPoint viewportPos = v->windowToContents(event.pos());2263 LayoutPoint viewportPos = v->windowToContents(event.pos()); 2264 2264 HitTestRequest request(HitTestRequest::Active); 2265 2265 MouseEventWithHitTestResults mev = doc->prepareMouseEvent(request, viewportPos, event); … … 2297 2297 int rightAligned = 0; 2298 2298 #endif 2299 IntPoint location;2299 LayoutPoint location; 2300 2300 2301 2301 Node* focusedNode = doc->focusedNode(); … … 2305 2305 if (start.deprecatedNode() && (selection->rootEditableElement() || selection->isRange())) { 2306 2306 RefPtr<Range> selectionRange = selection->toNormalizedRange(); 2307 IntRect firstRect = m_frame->editor()->firstRectForRange(selectionRange.get());2308 2309 int x = rightAligned ? firstRect.maxX() : firstRect.x();2310 location = IntPoint(x, firstRect.maxY());2307 LayoutRect firstRect = m_frame->editor()->firstRectForRange(selectionRange.get()); 2308 2309 LayoutUnit x = rightAligned ? firstRect.maxX() : firstRect.x(); 2310 location = LayoutPoint(x, firstRect.maxY()); 2311 2311 } else if (focusedNode) { 2312 2312 RenderBoxModelObject* box = focusedNode->renderBoxModelObject(); 2313 2313 if (!box) 2314 2314 return false; 2315 IntRect clippedRect = box->absoluteClippedOverflowRect();2316 location = IntPoint(clippedRect.x(), clippedRect.maxY() - 1);2315 LayoutRect clippedRect = box->absoluteClippedOverflowRect(); 2316 location = LayoutPoint(clippedRect.x(), clippedRect.maxY() - 1); 2317 2317 } else { 2318 location = IntPoint(2318 location = LayoutPoint( 2319 2319 rightAligned ? view->contentsWidth() - kContextMenuMargin : kContextMenuMargin, 2320 2320 kContextMenuMargin); … … 2323 2323 m_frame->view()->setCursor(pointerCursor()); 2324 2324 2325 IntPoint position = view->contentsToWindow(location);2326 IntPoint globalPosition = view->contentsToScreen(IntRect(location, IntSize())).location();2325 LayoutPoint position = view->contentsToWindow(location); 2326 LayoutPoint globalPosition = view->contentsToScreen(LayoutRect(location, LayoutSize())).location(); 2327 2327 2328 2328 Node* targetNode = doc->focusedNode(); … … 2400 2400 bool metaKey; 2401 2401 PlatformKeyboardEvent::getCurrentModifierState(shiftKey, ctrlKey, altKey, metaKey); 2402 IntPoint globalPoint = view->contentsToScreen(IntRect(view->windowToContents(m_currentMousePosition), IntSize())).location();2402 LayoutPoint globalPoint = view->contentsToScreen(LayoutRect(view->windowToContents(m_currentMousePosition), LayoutSize())).location(); 2403 2403 PlatformMouseEvent fakeMouseMoveEvent(m_currentMousePosition, globalPoint, NoButton, MouseEventMoved, 0, shiftKey, ctrlKey, altKey, metaKey, currentTime()); 2404 2404 mouseMoved(fakeMouseMoveEvent); … … 2698 2698 2699 2699 #if ENABLE(DRAG_SUPPORT) 2700 bool EventHandler::dragHysteresisExceeded(const FloatPoint& floatDragViewportLocation) const2701 { 2702 IntPoint dragViewportLocation((int)floatDragViewportLocation.x(), (int)floatDragViewportLocation.y());2700 bool EventHandler::dragHysteresisExceeded(const IntPoint& floatDragViewportLocation) const 2701 { 2702 FloatPoint dragViewportLocation(floatDragViewportLocation.x(), floatDragViewportLocation.y()); 2703 2703 return dragHysteresisExceeded(dragViewportLocation); 2704 2704 } 2705 2706 bool EventHandler::dragHysteresisExceeded(const IntPoint& dragViewportLocation) const2705 2706 bool EventHandler::dragHysteresisExceeded(const FloatPoint& dragViewportLocation) const 2707 2707 { 2708 2708 FrameView* view = m_frame->view(); 2709 2709 if (!view) 2710 2710 return false; 2711 IntPoint dragLocation = view->windowToContents(dragViewportLocation);2712 IntSize delta = dragLocation - m_mouseDownPos;2711 LayoutPoint dragLocation = view->windowToContents(flooredLayoutPoint(dragViewportLocation)); 2712 LayoutSize delta = dragLocation - m_mouseDownPos; 2713 2713 2714 2714 int threshold = GeneralDragHysteresis; … … 2862 2862 // FIXME: This doesn't work correctly with transforms. 2863 2863 FloatPoint absPos = renderer->localToAbsolute(); 2864 IntSize delta = m_mouseDownPos - roundedIntPoint(absPos);2864 LayoutSize delta = m_mouseDownPos - roundedLayoutPoint(absPos); 2865 2865 dragState().m_dragClipboard->setDragImageElement(dragState().m_dragSrc.get(), toPoint(delta)); 2866 2866 } else { … … 3180 3180 const PlatformTouchPoint& point = points[i]; 3181 3181 PlatformTouchPoint::State pointState = point.state(); 3182 IntPoint pagePoint = documentPointForWindowPoint(m_frame, point.pos());3182 LayoutPoint pagePoint = documentPointForWindowPoint(m_frame, point.pos()); 3183 3183 3184 3184 HitTestRequest::HitTestRequestType hitType = HitTestRequest::Active | HitTestRequest::ReadOnly; -
trunk/Source/WebCore/page/EventHandler.h
r92234 r93053 115 115 void dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad&); 116 116 117 HitTestResult hitTestResultAtPoint(const IntPoint&, bool allowShadowContent, bool ignoreClipping = false,117 HitTestResult hitTestResultAtPoint(const LayoutPoint&, bool allowShadowContent, bool ignoreClipping = false, 118 118 HitTestScrollbars scrollbars = DontHitTestScrollbars, 119 119 HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active, 120 const IntSize& padding = IntSize());120 const LayoutSize& padding = LayoutSize()); 121 121 122 122 bool mousePressed() const { return m_mousePressed; } … … 137 137 void resizeLayerDestroyed(); 138 138 139 IntPoint currentMousePosition() const;139 LayoutPoint currentMousePosition() const; 140 140 141 141 static Frame* subframeForTargetNode(Node*); … … 354 354 355 355 #if ENABLE(DRAG_SUPPORT) 356 IntPoint m_dragStartPos;356 LayoutPoint m_dragStartPos; 357 357 #endif 358 358 … … 399 399 RefPtr<HTMLFrameSetElement> m_frameSetBeingResized; 400 400 401 IntSize m_offsetFromResizeCorner; // in the coords of m_resizeLayer402 403 IntPoint m_currentMousePosition;404 IntPoint m_mouseDownPos; // in our view's coords401 LayoutSize m_offsetFromResizeCorner; // In the coords of m_resizeLayer. 402 403 LayoutPoint m_currentMousePosition; 404 LayoutPoint m_mouseDownPos; // In our view's coords. 405 405 double m_mouseDownTimestamp; 406 406 PlatformMouseEvent m_mouseDown; -
trunk/Source/WebCore/platform/PlatformMouseEvent.h
r75040 r93053 27 27 #define PlatformMouseEvent_h 28 28 29 #include " IntPoint.h"29 #include "LayoutTypes.h" 30 30 31 31 #if PLATFORM(GTK) … … 94 94 } 95 95 96 PlatformMouseEvent(const IntPoint& position, const IntPoint& globalPosition, MouseButton button, MouseEventType eventType,96 PlatformMouseEvent(const LayoutPoint& position, const LayoutPoint& globalPosition, MouseButton button, MouseEventType eventType, 97 97 int clickCount, bool shift, bool ctrl, bool alt, bool meta, double timestamp) 98 98 : m_position(position) … … 115 115 } 116 116 117 const IntPoint& pos() const { return m_position; }118 int x() const { return m_position.x(); }119 int y() const { return m_position.y(); }120 int globalX() const { return m_globalPosition.x(); }121 int globalY() const { return m_globalPosition.y(); }117 const LayoutPoint& pos() const { return m_position; } 118 LayoutUnit x() const { return m_position.x(); } 119 LayoutUnit y() const { return m_position.y(); } 120 LayoutUnit globalX() const { return m_globalPosition.x(); } 121 LayoutUnit globalY() const { return m_globalPosition.y(); } 122 122 MouseButton button() const { return m_button; } 123 123 MouseEventType eventType() const { return m_eventType; } … … 179 179 180 180 protected: 181 IntPoint m_position;182 IntPoint m_globalPosition;181 LayoutPoint m_position; 182 LayoutPoint m_globalPosition; 183 183 MouseButton m_button; 184 184 MouseEventType m_eventType; … … 199 199 200 200 #if PLATFORM(MAC) && defined(__OBJC__) 201 IntPoint globalPoint(const NSPoint& windowPoint, NSWindow *);202 IntPoint pointForEvent(NSEvent *, NSView *windowView);203 IntPoint globalPointForEvent(NSEvent *);201 LayoutPoint globalPoint(const NSPoint& windowPoint, NSWindow *); 202 LayoutPoint pointForEvent(NSEvent *, NSView *windowView); 203 LayoutPoint globalPointForEvent(NSEvent *); 204 204 #endif 205 205 -
trunk/Source/WebCore/platform/mac/PlatformMouseEventMac.mm
r52063 r93053 69 69 } 70 70 71 IntPoint globalPoint(const NSPoint& windowPoint, NSWindow *window)71 LayoutPoint globalPoint(const NSPoint& windowPoint, NSWindow *window) 72 72 { 73 return IntPoint(flipScreenPoint([window convertBaseToScreen:windowPoint], screenForWindow(window)));73 return LayoutPoint(flipScreenPoint([window convertBaseToScreen:windowPoint], screenForWindow(window))); 74 74 } 75 75 76 IntPoint pointForEvent(NSEvent *event, NSView *windowView)76 LayoutPoint pointForEvent(NSEvent *event, NSView *windowView) 77 77 { 78 78 switch ([event type]) { … … 93 93 if (windowView) 94 94 location = [windowView convertPoint:location fromView:nil]; 95 return IntPoint(location);95 return LayoutPoint(location); 96 96 } 97 97 default: 98 return IntPoint();98 return LayoutPoint(); 99 99 } 100 100 } 101 101 102 IntPoint globalPointForEvent(NSEvent *event)102 LayoutPoint globalPointForEvent(NSEvent *event) 103 103 { 104 104 switch ([event type]) { … … 116 116 return globalPoint([event locationInWindow], [event window]); 117 117 default: 118 return IntPoint();118 return LayoutPoint(); 119 119 } 120 120 }
Note: See TracChangeset
for help on using the changeset viewer.