From f55829d7eb8f9844be0b6e61d647261b654f5e5e Mon Sep 17 00:00:00 2001 From: Phil Ringnalda Date: Sun, 1 Feb 2015 15:27:14 -0800 Subject: [PATCH] Back out 5167196c4b98 (bug 1125040) for not compiling on Linux CLOSED TREE --- accessible/generic/HyperTextAccessible.cpp | 2 +- dom/base/nsDOMWindowUtils.cpp | 3 ++- dom/base/nsQueryContentEventResult.cpp | 4 ++-- dom/events/ContentEventHandler.cpp | 8 +++++--- dom/events/Event.cpp | 3 ++- dom/events/EventStateManager.cpp | 21 +++++++++++-------- dom/events/IMEContentObserver.cpp | 9 ++++---- dom/events/UIEvent.h | 3 ++- dom/events/WheelHandlingHelper.cpp | 4 ++-- dom/plugins/base/nsPluginInstanceOwner.cpp | 3 ++- embedding/browser/nsDocShellTreeOwner.cpp | 2 +- gfx/tests/gtest/TestCompositor.cpp | 2 +- layout/base/PositionedEventTargeting.cpp | 4 ++-- layout/base/nsLayoutUtils.cpp | 24 +++++++++++----------- layout/base/nsLayoutUtils.h | 7 +++---- layout/base/nsPresShell.cpp | 4 ++-- layout/generic/nsFrame.cpp | 2 +- layout/xul/nsResizerFrame.cpp | 6 ++++-- layout/xul/nsXULPopupManager.cpp | 2 +- view/nsView.cpp | 2 +- widget/PuppetWidget.h | 4 ++-- widget/android/AndroidJavaWrappers.cpp | 7 ++++--- widget/android/nsWindow.cpp | 9 ++++---- widget/android/nsWindow.h | 2 +- widget/cocoa/nsChildView.h | 2 +- widget/cocoa/nsChildView.mm | 10 ++++----- widget/cocoa/nsCocoaWindow.h | 2 +- widget/cocoa/nsCocoaWindow.mm | 6 +++--- widget/gonk/nsWindow.cpp | 4 ++-- widget/gonk/nsWindow.h | 2 +- widget/gtk/nsDragService.cpp | 2 +- widget/gtk/nsWindow.cpp | 23 ++++++++++++--------- widget/gtk/nsWindow.h | 2 +- widget/nsIWidget.h | 8 ++------ widget/qt/nsWindow.cpp | 4 ++-- widget/qt/nsWindow.h | 2 +- widget/windows/nsIMM32Handler.cpp | 8 ++++---- widget/windows/nsTextStore.cpp | 8 ++++---- widget/windows/nsWindow.cpp | 8 ++++---- widget/windows/nsWindow.h | 2 +- widget/windows/winrt/MetroWidget.cpp | 4 ++-- widget/windows/winrt/MetroWidget.h | 2 +- 42 files changed, 124 insertions(+), 112 deletions(-) diff --git a/accessible/generic/HyperTextAccessible.cpp b/accessible/generic/HyperTextAccessible.cpp index 5681aa01331..3d394e24a0f 100644 --- a/accessible/generic/HyperTextAccessible.cpp +++ b/accessible/generic/HyperTextAccessible.cpp @@ -1344,7 +1344,7 @@ HyperTextAccessible::GetCaretRect(nsIWidget** aWidget) nsIntRect caretRect; caretRect = rect.ToOutsidePixels(frame->PresContext()->AppUnitsPerDevPixel()); // ((content screen origin) - (content offset in the widget)) = widget origin on the screen - caretRect.MoveBy((*aWidget)->WidgetToScreenOffsetUntyped() - (*aWidget)->GetClientOffset()); + caretRect.MoveBy((*aWidget)->WidgetToScreenOffset() - (*aWidget)->GetClientOffset()); // Correct for character size, so that caret always matches the size of // the character. This is important for font size transitions, and is diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp index 6787241774c..638b13eabf6 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -2195,7 +2195,8 @@ nsDOMWindowUtils::SendQueryContentEvent(uint32_t aType, } } - pt += widget->WidgetToScreenOffset() - targetWidget->WidgetToScreenOffset(); + pt += LayoutDeviceIntPoint::FromUntyped( + widget->WidgetToScreenOffset() - targetWidget->WidgetToScreenOffset()); WidgetQueryContentEvent queryEvent(true, aType, targetWidget); InitEvent(queryEvent, &pt); diff --git a/dom/base/nsQueryContentEventResult.cpp b/dom/base/nsQueryContentEventResult.cpp index c451952a03f..bd2b7aee63b 100644 --- a/dom/base/nsQueryContentEventResult.cpp +++ b/dom/base/nsQueryContentEventResult.cpp @@ -147,7 +147,7 @@ nsQueryContentEventResult::SetEventResult(nsIWidget* aWidget, } // Convert the top widget related coordinates to the given widget's. - LayoutDeviceIntPoint offset = + nsIntPoint offset = aWidget->WidgetToScreenOffset() - topWidget->WidgetToScreenOffset(); - mRect.MoveBy(-LayoutDeviceIntPoint::ToUntyped(offset)); + mRect.MoveBy(-offset); } diff --git a/dom/events/ContentEventHandler.cpp b/dom/events/ContentEventHandler.cpp index 3c3665a50a9..f5e83a2e89b 100644 --- a/dom/events/ContentEventHandler.cpp +++ b/dom/events/ContentEventHandler.cpp @@ -1149,8 +1149,9 @@ ContentEventHandler::OnQueryCharacterAtPoint(WidgetQueryContentEvent* aEvent) eventOnRoot.mUseNativeLineBreak = aEvent->mUseNativeLineBreak; eventOnRoot.refPoint = aEvent->refPoint; if (rootWidget != aEvent->widget) { - eventOnRoot.refPoint += aEvent->widget->WidgetToScreenOffset() - - rootWidget->WidgetToScreenOffset(); + eventOnRoot.refPoint += LayoutDeviceIntPoint::FromUntyped( + aEvent->widget->WidgetToScreenOffset() - + rootWidget->WidgetToScreenOffset()); } nsPoint ptInRoot = nsLayoutUtils::GetEventCoordinatesRelativeTo(&eventOnRoot, rootFrame); @@ -1213,7 +1214,8 @@ ContentEventHandler::OnQueryDOMWidgetHittest(WidgetQueryContentEvent* aEvent) nsIFrame* docFrame = mPresShell->GetRootFrame(); NS_ENSURE_TRUE(docFrame, NS_ERROR_FAILURE); - LayoutDeviceIntPoint eventLoc = aEvent->refPoint + aEvent->widget->WidgetToScreenOffset(); + LayoutDeviceIntPoint eventLoc = aEvent->refPoint + + LayoutDeviceIntPoint::FromUntyped(aEvent->widget->WidgetToScreenOffset()); nsIntRect docFrameRect = docFrame->GetScreenRect(); // Returns CSS pixels CSSIntPoint eventLocCSS( mPresContext->DevPixelsToIntCSSPixels(eventLoc.x) - docFrameRect.x, diff --git a/dom/events/Event.cpp b/dom/events/Event.cpp index 04dbbf56b06..e7d967814d3 100644 --- a/dom/events/Event.cpp +++ b/dom/events/Event.cpp @@ -902,7 +902,8 @@ Event::GetScreenCoords(nsPresContext* aPresContext, return LayoutDeviceIntPoint::ToUntyped(aPoint); } - LayoutDeviceIntPoint offset = aPoint + guiEvent->widget->WidgetToScreenOffset(); + LayoutDeviceIntPoint offset = aPoint + + LayoutDeviceIntPoint::FromUntyped(guiEvent->widget->WidgetToScreenOffset()); nscoord factor = aPresContext->DeviceContext()->AppUnitsPerDevPixelAtUnitFullZoom(); return nsIntPoint(nsPresContext::AppUnitsToIntCSSPixels(offset.x * factor), diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp index 81dd8ad630f..371990d1b8b 100644 --- a/dom/events/EventStateManager.cpp +++ b/dom/events/EventStateManager.cpp @@ -1505,7 +1505,8 @@ EventStateManager::BeginTrackingDragGesture(nsPresContext* aPresContext, // Note that |inDownEvent| could be either a mouse down event or a // synthesized mouse move event. - mGestureDownPoint = inDownEvent->refPoint + inDownEvent->widget->WidgetToScreenOffset(); + mGestureDownPoint = inDownEvent->refPoint + + LayoutDeviceIntPoint::FromUntyped(inDownEvent->widget->WidgetToScreenOffset()); inDownFrame->GetContentForEvent(inDownEvent, getter_AddRefs(mGestureDownContent)); @@ -1543,7 +1544,8 @@ EventStateManager::FillInEventFromGestureDown(WidgetMouseEvent* aEvent) // Set the coordinates in the new event to the coordinates of // the old event, adjusted for the fact that the widget might be // different - aEvent->refPoint = mGestureDownPoint - aEvent->widget->WidgetToScreenOffset(); + aEvent->refPoint = mGestureDownPoint - + LayoutDeviceIntPoint::FromUntyped(aEvent->widget->WidgetToScreenOffset()); aEvent->modifiers = mGestureModifiers; aEvent->buttons = mGestureDownButtons; } @@ -1599,7 +1601,8 @@ EventStateManager::GenerateDragGesture(nsPresContext* aPresContext, } // fire drag gesture if mouse has moved enough - LayoutDeviceIntPoint pt = aEvent->refPoint + aEvent->widget->WidgetToScreenOffset(); + LayoutDeviceIntPoint pt = aEvent->refPoint + + LayoutDeviceIntPoint::FromUntyped(aEvent->widget->WidgetToScreenOffset()); LayoutDeviceIntPoint distance = pt - mGestureDownPoint; if (Abs(distance.x) > AssertedCast(pixelThresholdX) || Abs(distance.y) > AssertedCast(pixelThresholdY)) { @@ -3213,9 +3216,9 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext, WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent(); event.refPoint = mouseEvent->refPoint; if (mouseEvent->widget) { - event.refPoint += mouseEvent->widget->WidgetToScreenOffset(); + event.refPoint += LayoutDeviceIntPoint::FromUntyped(mouseEvent->widget->WidgetToScreenOffset()); } - event.refPoint -= widget->WidgetToScreenOffset(); + event.refPoint -= LayoutDeviceIntPoint::FromUntyped(widget->WidgetToScreenOffset()); event.modifiers = mouseEvent->modifiers; event.buttons = mouseEvent->buttons; event.inputSource = mouseEvent->inputSource; @@ -4020,8 +4023,8 @@ EventStateManager::GenerateMouseEnterExit(WidgetMouseEvent* aMouseEvent) // in the other branch here. sSynthCenteringPoint = center; aMouseEvent->widget->SynthesizeNativeMouseMove( - LayoutDeviceIntPoint::ToUntyped(center + - aMouseEvent->widget->WidgetToScreenOffset())); + LayoutDeviceIntPoint::ToUntyped(center) + + aMouseEvent->widget->WidgetToScreenOffset()); } else if (aMouseEvent->refPoint == sSynthCenteringPoint) { // This is the "synthetic native" event we dispatched to re-center the // pointer. Cancel it so we don't expose the centering move to content. @@ -4157,7 +4160,7 @@ EventStateManager::SetPointerLock(nsIWidget* aWidget, aWidget, mPresContext); aWidget->SynthesizeNativeMouseMove( - LayoutDeviceIntPoint::ToUntyped(sLastRefPoint + aWidget->WidgetToScreenOffset())); + LayoutDeviceIntPoint::ToUntyped(sLastRefPoint) + aWidget->WidgetToScreenOffset()); // Retarget all events to this element via capture. nsIPresShell::SetCapturingContent(aElement, CAPTURE_POINTERLOCK); @@ -4173,7 +4176,7 @@ EventStateManager::SetPointerLock(nsIWidget* aWidget, // no movement. sLastRefPoint = mPreLockPoint; aWidget->SynthesizeNativeMouseMove( - LayoutDeviceIntPoint::ToUntyped(mPreLockPoint + aWidget->WidgetToScreenOffset())); + LayoutDeviceIntPoint::ToUntyped(mPreLockPoint) + aWidget->WidgetToScreenOffset()); // Don't retarget events to this element any more. nsIPresShell::SetCapturingContent(nullptr, CAPTURE_POINTERLOCK); diff --git a/dom/events/IMEContentObserver.cpp b/dom/events/IMEContentObserver.cpp index ac9de57b071..836c6882abc 100644 --- a/dom/events/IMEContentObserver.cpp +++ b/dom/events/IMEContentObserver.cpp @@ -449,14 +449,15 @@ IMEContentObserver::OnMouseButtonEvent(nsPresContext* aPresContext, nsIWidget* topLevelWidget = mWidget->GetTopLevelWidget(); if (topLevelWidget && topLevelWidget != mWidget) { charAtPt.mReply.mRect.MoveBy( - topLevelWidget->WidgetToScreenOffsetUntyped() - - mWidget->WidgetToScreenOffsetUntyped()); + topLevelWidget->WidgetToScreenOffset() - + mWidget->WidgetToScreenOffset()); } // The refPt is relative to its widget. // We should notify it with offset in the widget. if (aMouseEvent->widget != mWidget) { - charAtPt.refPoint += aMouseEvent->widget->WidgetToScreenOffset() - - mWidget->WidgetToScreenOffset(); + charAtPt.refPoint += LayoutDeviceIntPoint::FromUntyped( + aMouseEvent->widget->WidgetToScreenOffset() - + mWidget->WidgetToScreenOffset()); } IMENotification notification(NOTIFY_IME_OF_MOUSE_BUTTON_EVENT); diff --git a/dom/events/UIEvent.h b/dom/events/UIEvent.h index 81b6097286b..d13dc788019 100644 --- a/dom/events/UIEvent.h +++ b/dom/events/UIEvent.h @@ -57,7 +57,8 @@ public: return LayoutDeviceIntPoint::ToUntyped(aEvent->refPoint); } - LayoutDeviceIntPoint offset = aEvent->refPoint + event->widget->WidgetToScreenOffset(); + LayoutDeviceIntPoint offset = aEvent->refPoint + + LayoutDeviceIntPoint::FromUntyped(event->widget->WidgetToScreenOffset()); nscoord factor = aPresContext->DeviceContext()->AppUnitsPerDevPixelAtUnitFullZoom(); return nsIntPoint(nsPresContext::AppUnitsToIntCSSPixels(offset.x * factor), diff --git a/dom/events/WheelHandlingHelper.cpp b/dom/events/WheelHandlingHelper.cpp index 35441dd930a..ba586cfc368 100644 --- a/dom/events/WheelHandlingHelper.cpp +++ b/dom/events/WheelHandlingHelper.cpp @@ -293,8 +293,8 @@ WheelTransaction::GetScreenPoint(WidgetGUIEvent* aEvent) { NS_ASSERTION(aEvent, "aEvent is null"); NS_ASSERTION(aEvent->widget, "aEvent-widget is null"); - return LayoutDeviceIntPoint::ToUntyped(aEvent->refPoint + - aEvent->widget->WidgetToScreenOffset()); + return LayoutDeviceIntPoint::ToUntyped(aEvent->refPoint) + + aEvent->widget->WidgetToScreenOffset(); } /* static */ uint32_t diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp index e3c6e1ef578..13f8d8484bf 100644 --- a/dom/plugins/base/nsPluginInstanceOwner.cpp +++ b/dom/plugins/base/nsPluginInstanceOwner.cpp @@ -2121,7 +2121,8 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent) // Get reference point relative to screen: LayoutDeviceIntPoint rootPoint(-1, -1); if (widget) - rootPoint = anEvent.refPoint + widget->WidgetToScreenOffset(); + rootPoint = anEvent.refPoint + + LayoutDeviceIntPoint::FromUntyped(widget->WidgetToScreenOffset()); #ifdef MOZ_WIDGET_GTK Window root = GDK_ROOT_WINDOW(); #elif defined(MOZ_WIDGET_QT) diff --git a/embedding/browser/nsDocShellTreeOwner.cpp b/embedding/browser/nsDocShellTreeOwner.cpp index 4787a2c2408..e4490a61e9e 100644 --- a/embedding/browser/nsDocShellTreeOwner.cpp +++ b/embedding/browser/nsDocShellTreeOwner.cpp @@ -1452,7 +1452,7 @@ ChromeTooltipListener::sTooltipCallback(nsITimer *aTimer, if (textFound) { nsString tipText(tooltipText); - LayoutDeviceIntPoint screenDot = widget->WidgetToScreenOffset(); + nsIntPoint screenDot = widget->WidgetToScreenOffset(); self->ShowTooltip(self->mMouseScreenX - screenDot.x, self->mMouseScreenY - screenDot.y, tipText); diff --git a/gfx/tests/gtest/TestCompositor.cpp b/gfx/tests/gtest/TestCompositor.cpp index a8cf3c2674b..cf0b9bf3664 100644 --- a/gfx/tests/gtest/TestCompositor.cpp +++ b/gfx/tests/gtest/TestCompositor.cpp @@ -71,7 +71,7 @@ public: virtual nsresult ConfigureChildren(const nsTArray& aConfigurations) MOZ_OVERRIDE { return NS_OK; } NS_IMETHOD Invalidate(const nsIntRect &aRect) MOZ_OVERRIDE { return NS_OK; } NS_IMETHOD SetTitle(const nsAString& title) MOZ_OVERRIDE { return NS_OK; } - virtual LayoutDeviceIntPoint WidgetToScreenOffset() MOZ_OVERRIDE { return LayoutDeviceIntPoint(0, 0); } + virtual nsIntPoint WidgetToScreenOffset() MOZ_OVERRIDE { return nsIntPoint(0, 0); } NS_IMETHOD DispatchEvent(mozilla::WidgetGUIEvent* aEvent, nsEventStatus& aStatus) MOZ_OVERRIDE { return NS_OK; } NS_IMETHOD CaptureRollupEvents(nsIRollupListener * aListener, bool aDoCapture) MOZ_OVERRIDE { return NS_OK; } diff --git a/layout/base/PositionedEventTargeting.cpp b/layout/base/PositionedEventTargeting.cpp index 21c87473ab7..99c26818c86 100644 --- a/layout/base/PositionedEventTargeting.cpp +++ b/layout/base/PositionedEventTargeting.cpp @@ -473,11 +473,11 @@ FindFrameTargetedByInputEvent(WidgetGUIEvent* aEvent, if (!view) { return target; } - LayoutDeviceIntPoint widgetPoint = nsLayoutUtils::TranslateViewToWidget( + nsIntPoint widgetPoint = nsLayoutUtils::TranslateViewToWidget( aRootFrame->PresContext(), view, point, aEvent->widget); if (widgetPoint.x != NS_UNCONSTRAINEDSIZE) { // If that succeeded, we update the point in the event - aEvent->refPoint = widgetPoint; + aEvent->refPoint = LayoutDeviceIntPoint::FromUntyped(widgetPoint); } return target; } diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 8fe15aef9ff..47812759ce5 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -2627,8 +2627,8 @@ nsLayoutUtils::TransformFrameRectToAncestor(nsIFrame* aFrame, NSFloatPixelsToAppUnits(float(result.height), destAppUnitsPerDevPixel)); } -static LayoutDeviceIntPoint GetWidgetOffset(nsIWidget* aWidget, nsIWidget*& aRootWidget) { - LayoutDeviceIntPoint offset(0, 0); +static nsIntPoint GetWidgetOffset(nsIWidget* aWidget, nsIWidget*& aRootWidget) { + nsIntPoint offset(0, 0); while ((aWidget->WindowType() == eWindowType_child || aWidget->IsPlugin())) { nsIWidget* parent = aWidget->GetParent(); @@ -2637,19 +2637,18 @@ static LayoutDeviceIntPoint GetWidgetOffset(nsIWidget* aWidget, nsIWidget*& aRoo } nsIntRect bounds; aWidget->GetBounds(bounds); - offset += LayoutDeviceIntPoint::FromUntyped(bounds.TopLeft()); + offset += bounds.TopLeft(); aWidget = parent; } aRootWidget = aWidget; return offset; } -static LayoutDeviceIntPoint -WidgetToWidgetOffset(nsIWidget* aFrom, nsIWidget* aTo) { +static nsIntPoint WidgetToWidgetOffset(nsIWidget* aFrom, nsIWidget* aTo) { nsIWidget* fromRoot; - LayoutDeviceIntPoint fromOffset = GetWidgetOffset(aFrom, fromRoot); + nsIntPoint fromOffset = GetWidgetOffset(aFrom, fromRoot); nsIWidget* toRoot; - LayoutDeviceIntPoint toOffset = GetWidgetOffset(aTo, toRoot); + nsIntPoint toOffset = GetWidgetOffset(aTo, toRoot); if (fromRoot == toRoot) { return fromOffset - toOffset; @@ -2668,13 +2667,14 @@ nsLayoutUtils::TranslateWidgetToView(nsPresContext* aPresContext, return nsPoint(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE); } - LayoutDeviceIntPoint widgetPoint = aPt + WidgetToWidgetOffset(aWidget, viewWidget); + LayoutDeviceIntPoint widgetPoint = aPt + + LayoutDeviceIntPoint::FromUntyped(WidgetToWidgetOffset(aWidget, viewWidget)); nsPoint widgetAppUnits(aPresContext->DevPixelsToAppUnits(widgetPoint.x), aPresContext->DevPixelsToAppUnits(widgetPoint.y)); return widgetAppUnits - viewOffset; } -LayoutDeviceIntPoint +nsIntPoint nsLayoutUtils::TranslateViewToWidget(nsPresContext* aPresContext, nsView* aView, nsPoint aPt, nsIWidget* aWidget) @@ -2682,11 +2682,11 @@ nsLayoutUtils::TranslateViewToWidget(nsPresContext* aPresContext, nsPoint viewOffset; nsIWidget* viewWidget = aView->GetNearestWidget(&viewOffset); if (!viewWidget) { - return LayoutDeviceIntPoint(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE); + return nsIntPoint(NS_UNCONSTRAINEDSIZE, NS_UNCONSTRAINEDSIZE); } - LayoutDeviceIntPoint relativeToViewWidget(aPresContext->AppUnitsToDevPixels(aPt.x + viewOffset.x), - aPresContext->AppUnitsToDevPixels(aPt.y + viewOffset.y)); + nsIntPoint relativeToViewWidget(aPresContext->AppUnitsToDevPixels(aPt.x + viewOffset.x), + aPresContext->AppUnitsToDevPixels(aPt.y + viewOffset.y)); return relativeToViewWidget + WidgetToWidgetOffset(viewWidget, aWidget); } diff --git a/layout/base/nsLayoutUtils.h b/layout/base/nsLayoutUtils.h index e733e72ebdf..d2a03472511 100644 --- a/layout/base/nsLayoutUtils.h +++ b/layout/base/nsLayoutUtils.h @@ -728,10 +728,9 @@ public: * @param aWidget the widget to which returned coordinates are relative * @return the point in the view's coordinates */ - static mozilla::LayoutDeviceIntPoint - TranslateViewToWidget(nsPresContext* aPresContext, - nsView* aView, nsPoint aPt, - nsIWidget* aWidget); + static nsIntPoint TranslateViewToWidget(nsPresContext* aPresContext, + nsView* aView, nsPoint aPt, + nsIWidget* aWidget); enum FrameForPointFlags { /** diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 4f1c7bd62a8..78d299df069 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -8474,9 +8474,9 @@ PresShell::AdjustContextMenuKeyEvent(WidgetMouseEvent* aEvent) nsCOMPtr widget = popupFrame->GetNearestWidget(); aEvent->widget = widget; - LayoutDeviceIntPoint widgetPoint = widget->WidgetToScreenOffset(); + nsIntPoint widgetPoint = widget->WidgetToScreenOffset(); aEvent->refPoint = LayoutDeviceIntPoint::FromUntyped( - itemFrame->GetScreenRect().BottomLeft()) - widgetPoint; + itemFrame->GetScreenRect().BottomLeft() - widgetPoint); mCurrentEventContent = itemFrame->GetContent(); mCurrentEventFrame = itemFrame; diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index cd4b0f7376b..a26dff22b19 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -4812,7 +4812,7 @@ nsRect nsIFrame::GetScreenRectInAppUnits() const nsCOMPtr rootWidget; presContext->PresShell()->GetViewManager()->GetRootWidget(getter_AddRefs(rootWidget)); if (rootWidget) { - LayoutDeviceIntPoint rootDevPx = rootWidget->WidgetToScreenOffset(); + nsIntPoint rootDevPx = rootWidget->WidgetToScreenOffset(); rootScreenPos.x = presContext->DevPixelsToAppUnits(rootDevPx.x); rootScreenPos.y = presContext->DevPixelsToAppUnits(rootDevPx.y); } diff --git a/layout/xul/nsResizerFrame.cpp b/layout/xul/nsResizerFrame.cpp index afdab2b2291..228fbd77ae0 100644 --- a/layout/xul/nsResizerFrame.cpp +++ b/layout/xul/nsResizerFrame.cpp @@ -117,7 +117,8 @@ nsResizerFrame::HandleEvent(nsPresContext* aPresContext, LayoutDeviceIntPoint refPoint; if (!GetEventPoint(aEvent, refPoint)) return NS_OK; - mMouseDownPoint = refPoint + aEvent->widget->WidgetToScreenOffset(); + mMouseDownPoint = refPoint + + LayoutDeviceIntPoint::FromUntyped(aEvent->widget->WidgetToScreenOffset()); // we're tracking mTrackingMouseMove = true; @@ -165,7 +166,8 @@ nsResizerFrame::HandleEvent(nsPresContext* aPresContext, LayoutDeviceIntPoint refPoint; if (!GetEventPoint(aEvent, refPoint)) return NS_OK; - LayoutDeviceIntPoint screenPoint = refPoint + aEvent->widget->WidgetToScreenOffset(); + LayoutDeviceIntPoint screenPoint = refPoint + + LayoutDeviceIntPoint::FromUntyped(aEvent->widget->WidgetToScreenOffset()); LayoutDeviceIntPoint mouseMove(screenPoint - mMouseDownPoint); // Determine which direction to resize by checking the dir attribute. diff --git a/layout/xul/nsXULPopupManager.cpp b/layout/xul/nsXULPopupManager.cpp index eb5e7b1ae0c..220749bedc2 100644 --- a/layout/xul/nsXULPopupManager.cpp +++ b/layout/xul/nsXULPopupManager.cpp @@ -729,7 +729,7 @@ nsXULPopupManager::ShowTooltipAtScreen(nsIContent* aPopup, if (rootPresContext) { nsIWidget *rootWidget = rootPresContext->GetRootWidget(); if (rootWidget) { - mCachedMousePoint -= rootWidget->WidgetToScreenOffsetUntyped(); + mCachedMousePoint -= rootWidget->WidgetToScreenOffset(); } } diff --git a/view/nsView.cpp b/view/nsView.cpp index 63b0e4ba46e..7ca917cb8a6 100644 --- a/view/nsView.cpp +++ b/view/nsView.cpp @@ -220,7 +220,7 @@ nsIntRect nsView::CalcWidgetBounds(nsWindowType aType) if (parentWidget && aType == eWindowType_popup && IsEffectivelyVisible()) { // put offset into screen coordinates. (based on client area origin) - LayoutDeviceIntPoint screenPoint = parentWidget->WidgetToScreenOffset(); + nsIntPoint screenPoint = parentWidget->WidgetToScreenOffset(); viewBounds += nsPoint(NSIntPixelsToAppUnits(screenPoint.x, p2a), NSIntPixelsToAppUnits(screenPoint.y, p2a)); } diff --git a/widget/PuppetWidget.h b/widget/PuppetWidget.h index 95f9b77083f..d9c5dd6d00b 100644 --- a/widget/PuppetWidget.h +++ b/widget/PuppetWidget.h @@ -126,8 +126,8 @@ public: { return NS_ERROR_UNEXPECTED; } // PuppetWidgets are always at <0, 0>. - virtual mozilla::LayoutDeviceIntPoint WidgetToScreenOffset() MOZ_OVERRIDE - { return mozilla::LayoutDeviceIntPoint(0, 0); } + virtual nsIntPoint WidgetToScreenOffset() MOZ_OVERRIDE + { return nsIntPoint(0, 0); } void InitEvent(WidgetGUIEvent& aEvent, nsIntPoint* aPoint = nullptr); diff --git a/widget/android/AndroidJavaWrappers.cpp b/widget/android/AndroidJavaWrappers.cpp index 27e9ffed4d7..a3aefec79b2 100644 --- a/widget/android/AndroidJavaWrappers.cpp +++ b/widget/android/AndroidJavaWrappers.cpp @@ -730,7 +730,7 @@ AndroidGeckoEvent::MakeTouchEvent(nsIWidget* widget) event.modifiers = DOMModifiers(); event.time = Time(); - const LayoutDeviceIntPoint& offset = widget->WidgetToScreenOffset(); + const nsIntPoint& offset = widget->WidgetToScreenOffset(); event.touches.SetCapacity(endIndex - startIndex); for (int i = startIndex; i < endIndex; i++) { // In this code branch, we are dispatching this event directly @@ -796,7 +796,7 @@ AndroidGeckoEvent::MakeMultiTouchInput(nsIWidget* widget) return event; } - const nsIntPoint& offset = widget->WidgetToScreenOffsetUntyped(); + const nsIntPoint& offset = widget->WidgetToScreenOffset(); event.mTouches.SetCapacity(endIndex - startIndex); for (int i = startIndex; i < endIndex; i++) { nsIntPoint point = Points()[i] - offset; @@ -853,10 +853,11 @@ AndroidGeckoEvent::MakeMouseEvent(nsIWidget* widget) // We are dispatching this event directly into Gecko (as opposed to going // through the AsyncPanZoomController), and the Points() array has points // in CSS pixels, which we need to convert to LayoutDevice pixels. - const LayoutDeviceIntPoint& offset = widget->WidgetToScreenOffset(); + const nsIntPoint& offset = widget->WidgetToScreenOffset(); CSSToLayoutDeviceScale scale = widget->GetDefaultScale(); event.refPoint = LayoutDeviceIntPoint((Points()[0].x * scale.scale) - offset.x, (Points()[0].y * scale.scale) - offset.y); + return event; } diff --git a/widget/android/nsWindow.cpp b/widget/android/nsWindow.cpp index 84edc194d12..6d7bf270c97 100644 --- a/widget/android/nsWindow.cpp +++ b/widget/android/nsWindow.cpp @@ -630,7 +630,7 @@ nsWindow::BringToFront() NS_IMETHODIMP nsWindow::GetScreenBounds(nsIntRect &aRect) { - LayoutDeviceIntPoint p = WidgetToScreenOffset(); + nsIntPoint p = WidgetToScreenOffset(); aRect.x = p.x; aRect.y = p.y; @@ -640,10 +640,10 @@ nsWindow::GetScreenBounds(nsIntRect &aRect) return NS_OK; } -LayoutDeviceIntPoint +nsIntPoint nsWindow::WidgetToScreenOffset() { - LayoutDeviceIntPoint p(0, 0); + nsIntPoint p(0, 0); nsWindow *w = this; while (w && !w->IsTopLevel()) { @@ -1041,7 +1041,8 @@ nsWindow::OnContextmenuEvent(AndroidGeckoEvent *ae) WidgetMouseEvent contextMenuEvent(true, NS_CONTEXTMENU, this, WidgetMouseEvent::eReal, WidgetMouseEvent::eNormal); contextMenuEvent.refPoint = - RoundedToInt(pt * GetDefaultScale()) - WidgetToScreenOffset(); + LayoutDeviceIntPoint(RoundedToInt(pt * GetDefaultScale())) - + LayoutDeviceIntPoint::FromUntyped(WidgetToScreenOffset()); contextMenuEvent.ignoreRootScrollFrame = true; contextMenuEvent.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_TOUCH; diff --git a/widget/android/nsWindow.h b/widget/android/nsWindow.h index e21edf050c1..0c8f5d13380 100644 --- a/widget/android/nsWindow.h +++ b/widget/android/nsWindow.h @@ -100,7 +100,7 @@ public: NS_IMETHOD Invalidate(const nsIntRect &aRect); NS_IMETHOD SetFocus(bool aRaise = false); NS_IMETHOD GetScreenBounds(nsIntRect &aRect); - virtual mozilla::LayoutDeviceIntPoint WidgetToScreenOffset(); + virtual nsIntPoint WidgetToScreenOffset(); NS_IMETHOD DispatchEvent(mozilla::WidgetGUIEvent* aEvent, nsEventStatus& aStatus); nsEventStatus DispatchEvent(mozilla::WidgetGUIEvent* aEvent); diff --git a/widget/cocoa/nsChildView.h b/widget/cocoa/nsChildView.h index a1be2604df4..65aaef78f2f 100644 --- a/widget/cocoa/nsChildView.h +++ b/widget/cocoa/nsChildView.h @@ -401,7 +401,7 @@ public: virtual void* GetNativeData(uint32_t aDataType) MOZ_OVERRIDE; virtual nsresult ConfigureChildren(const nsTArray& aConfigurations) MOZ_OVERRIDE; - virtual mozilla::LayoutDeviceIntPoint WidgetToScreenOffset() MOZ_OVERRIDE; + virtual nsIntPoint WidgetToScreenOffset() MOZ_OVERRIDE; virtual bool ShowsResizeIndicator(nsIntRect* aResizerRect) MOZ_OVERRIDE; static bool ConvertStatus(nsEventStatus aStatus) diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index 369eadd17ed..2bbf250b33e 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -923,7 +923,7 @@ NS_IMETHODIMP nsChildView::GetClientBounds(nsIntRect &aRect) if (!mParentWidget) { // For top level widgets we want the position on screen, not the position // of this view inside the window. - aRect.MoveTo(WidgetToScreenOffsetUntyped()); + aRect.MoveTo(WidgetToScreenOffset()); } return NS_OK; } @@ -931,7 +931,7 @@ NS_IMETHODIMP nsChildView::GetClientBounds(nsIntRect &aRect) NS_IMETHODIMP nsChildView::GetScreenBounds(nsIntRect &aRect) { GetBounds(aRect); - aRect.MoveTo(WidgetToScreenOffsetUntyped()); + aRect.MoveTo(WidgetToScreenOffset()); return NS_OK; } @@ -1482,7 +1482,7 @@ void nsChildView::ReportSizeEvent() // Return the offset between this child view and the screen. // @return -- widget origin in device-pixel coords -LayoutDeviceIntPoint nsChildView::WidgetToScreenOffset() +nsIntPoint nsChildView::WidgetToScreenOffset() { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN; @@ -1500,9 +1500,9 @@ LayoutDeviceIntPoint nsChildView::WidgetToScreenOffset() FlipCocoaScreenCoordinate(origin); // convert to device pixels - return LayoutDeviceIntPoint::FromUntyped(CocoaPointsToDevPixels(origin)); + return CocoaPointsToDevPixels(origin); - NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(LayoutDeviceIntPoint(0,0)); + NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(nsIntPoint(0,0)); } NS_IMETHODIMP nsChildView::CaptureRollupEvents(nsIRollupListener * aListener, diff --git a/widget/cocoa/nsCocoaWindow.h b/widget/cocoa/nsCocoaWindow.h index 530f05c4a58..814cd73b019 100644 --- a/widget/cocoa/nsCocoaWindow.h +++ b/widget/cocoa/nsCocoaWindow.h @@ -260,7 +260,7 @@ public: NS_IMETHOD SetModal(bool aState) MOZ_OVERRIDE; virtual bool IsVisible() const MOZ_OVERRIDE; NS_IMETHOD SetFocus(bool aState=false) MOZ_OVERRIDE; - virtual mozilla::LayoutDeviceIntPoint WidgetToScreenOffset() MOZ_OVERRIDE; + virtual nsIntPoint WidgetToScreenOffset() MOZ_OVERRIDE; virtual nsIntPoint GetClientOffset() MOZ_OVERRIDE; virtual nsIntSize ClientToWindowSize(const nsIntSize& aClientSize) MOZ_OVERRIDE; diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm index f75d2195bc1..d5936bec478 100644 --- a/widget/cocoa/nsCocoaWindow.mm +++ b/widget/cocoa/nsCocoaWindow.mm @@ -1812,7 +1812,7 @@ NS_IMETHODIMP nsCocoaWindow::SetFocus(bool aState) return NS_OK; } -LayoutDeviceIntPoint nsCocoaWindow::WidgetToScreenOffset() +nsIntPoint nsCocoaWindow::WidgetToScreenOffset() { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN; @@ -1823,9 +1823,9 @@ LayoutDeviceIntPoint nsCocoaWindow::WidgetToScreenOffset() } r = nsCocoaUtils::CocoaRectToGeckoRectDevPix(rect, BackingScaleFactor()); - return LayoutDeviceIntPoint::FromUntyped(r.TopLeft()); + return r.TopLeft(); - NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(LayoutDeviceIntPoint(0,0)); + NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(nsIntPoint(0,0)); } nsIntPoint nsCocoaWindow::GetClientOffset() diff --git a/widget/gonk/nsWindow.cpp b/widget/gonk/nsWindow.cpp index ea9131dccea..732d3a33e7a 100644 --- a/widget/gonk/nsWindow.cpp +++ b/widget/gonk/nsWindow.cpp @@ -522,10 +522,10 @@ nsWindow::Invalidate(const nsIntRect &aRect) return NS_OK; } -LayoutDeviceIntPoint +nsIntPoint nsWindow::WidgetToScreenOffset() { - LayoutDeviceIntPoint p(0, 0); + nsIntPoint p(0, 0); nsWindow *w = this; while (w && w->mParent) { diff --git a/widget/gonk/nsWindow.h b/widget/gonk/nsWindow.h index 925623a72d6..cf5d140c4ad 100644 --- a/widget/gonk/nsWindow.h +++ b/widget/gonk/nsWindow.h @@ -86,7 +86,7 @@ public: { return NS_OK; } - virtual mozilla::LayoutDeviceIntPoint WidgetToScreenOffset(); + virtual nsIntPoint WidgetToScreenOffset(); void DispatchTouchInputViaAPZ(mozilla::MultiTouchInput& aInput); NS_IMETHOD DispatchEvent(mozilla::WidgetGUIEvent* aEvent, nsEventStatus& aStatus); diff --git a/widget/gtk/nsDragService.cpp b/widget/gtk/nsDragService.cpp index cc16157ea81..3fe0abb39bf 100644 --- a/widget/gtk/nsDragService.cpp +++ b/widget/gtk/nsDragService.cpp @@ -1755,7 +1755,7 @@ nsDragService::ScheduleDropEvent(nsWindow *aWindow, return FALSE; } - SetDragEndPoint(aWindowPoint + aWindow->WidgetToScreenOffsetUntyped()); + SetDragEndPoint(aWindowPoint + aWindow->WidgetToScreenOffset()); // We'll reply with gtk_drag_finish(). return TRUE; diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp index f37863dd864..cf945b0765d 100644 --- a/widget/gtk/nsWindow.cpp +++ b/widget/gtk/nsWindow.cpp @@ -1473,10 +1473,10 @@ nsWindow::GetScreenBounds(nsIntRect &aRect) // use the point including window decorations gint x, y; gdk_window_get_root_origin(gtk_widget_get_window(GTK_WIDGET(mContainer)), &x, &y); - aRect.MoveTo(LayoutDevicePixel::ToUntyped(GdkPointToDevicePixels({ x, y }))); + aRect.MoveTo(GdkPointToDevicePixels({ x, y })); } else { - aRect.MoveTo(WidgetToScreenOffsetUntyped()); + aRect.MoveTo(WidgetToScreenOffset()); } // mBounds.Size() is the window bounds, not the window-manager frame // bounds (bug 581863). gdk_window_get_frame_extents would give the @@ -1797,7 +1797,7 @@ nsWindow::SetIcon(const nsAString& aIconSpec) } -LayoutDeviceIntPoint +nsIntPoint nsWindow::WidgetToScreenOffset() { gint x = 0, y = 0; @@ -2617,7 +2617,8 @@ nsWindow::OnMotionNotifyEvent(GdkEventMotion *aEvent) } else { LayoutDeviceIntPoint point(NSToIntFloor(aEvent->x_root), NSToIntFloor(aEvent->y_root)); - event.refPoint = point - WidgetToScreenOffset(); + event.refPoint = point - + LayoutDeviceIntPoint::FromUntyped(WidgetToScreenOffset()); } modifierState = aEvent->state; @@ -2695,7 +2696,8 @@ nsWindow::InitButtonEvent(WidgetMouseEvent& aEvent, } else { LayoutDeviceIntPoint point(NSToIntFloor(aGdkEvent->x_root), NSToIntFloor(aGdkEvent->y_root)); - aEvent.refPoint = point - WidgetToScreenOffset(); + aEvent.refPoint = point - + LayoutDeviceIntPoint::FromUntyped(WidgetToScreenOffset()); } guint modifierState = aGdkEvent->state; @@ -3207,7 +3209,8 @@ nsWindow::OnScrollEvent(GdkEventScroll *aEvent) // coordinates relative to this widget. LayoutDeviceIntPoint point(NSToIntFloor(aEvent->x_root), NSToIntFloor(aEvent->y_root)); - wheelEvent.refPoint = point - WidgetToScreenOffset(); + wheelEvent.refPoint = point - + LayoutDeviceIntPoint::FromUntyped(WidgetToScreenOffset()); } KeymapWrapper::InitInputEvent(wheelEvent, aEvent->state); @@ -6335,7 +6338,7 @@ nsWindow::GetDragInfo(WidgetMouseEvent* aMouseEvent, // moved since the mousedown. (On the other hand, it's quite likely // that the mouse has moved, which is why we use the mouse position // from the event.) - LayoutDeviceIntPoint offset = aMouseEvent->widget->WidgetToScreenOffset(); + nsIntPoint offset = aMouseEvent->widget->WidgetToScreenOffset(); *aRootX = aMouseEvent->refPoint.x + offset.x; *aRootY = aMouseEvent->refPoint.y + offset.y; @@ -6496,11 +6499,11 @@ nsWindow::GdkCoordToDevicePixels(gint coord) { return coord * GdkScaleFactor(); } -LayoutDeviceIntPoint +nsIntPoint nsWindow::GdkPointToDevicePixels(GdkPoint point) { gint scale = GdkScaleFactor(); - return LayoutDeviceIntPoint(point.x * scale, - point.y * scale); + return nsIntPoint(point.x * scale, + point.y * scale); } nsIntRect diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h index 456e2bf2a39..f8665036627 100644 --- a/widget/gtk/nsWindow.h +++ b/widget/gtk/nsWindow.h @@ -138,7 +138,7 @@ public: NS_IMETHOD SetTitle(const nsAString& aTitle) MOZ_OVERRIDE; NS_IMETHOD SetIcon(const nsAString& aIconSpec) MOZ_OVERRIDE; NS_IMETHOD SetWindowClass(const nsAString& xulWinType) MOZ_OVERRIDE; - virtual mozilla::LayoutDeviceIntPoint WidgetToScreenOffset() MOZ_OVERRIDE; + virtual nsIntPoint WidgetToScreenOffset() MOZ_OVERRIDE; NS_IMETHOD EnableDragDrop(bool aEnable) MOZ_OVERRIDE; NS_IMETHOD CaptureMouse(bool aCapture) MOZ_OVERRIDE; NS_IMETHOD CaptureRollupEvents(nsIRollupListener *aListener, diff --git a/widget/nsIWidget.h b/widget/nsIWidget.h index 2983a6158bb..ee76fed042f 100644 --- a/widget/nsIWidget.h +++ b/widget/nsIWidget.h @@ -1668,16 +1668,12 @@ class nsIWidget : public nsISupports { NS_IMETHOD SetIcon(const nsAString& anIconSpec) = 0; /** - * Return this widget's origin in screen coordinates. The untyped version - * exists temporarily to ease conversion to typed coordinates. + * Return this widget's origin in screen coordinates. * * @return screen coordinates stored in the x,y members */ - virtual mozilla::LayoutDeviceIntPoint WidgetToScreenOffset() = 0; - virtual nsIntPoint WidgetToScreenOffsetUntyped() { - return mozilla::LayoutDeviceIntPoint::ToUntyped(WidgetToScreenOffset()); - } + virtual nsIntPoint WidgetToScreenOffset() = 0; /** * Given the specified client size, return the corresponding window size, diff --git a/widget/qt/nsWindow.cpp b/widget/qt/nsWindow.cpp index 680356b530b..193d39e22be 100644 --- a/widget/qt/nsWindow.cpp +++ b/widget/qt/nsWindow.cpp @@ -626,7 +626,7 @@ nsWindow::Invalidate(const nsIntRect &aRect) return NS_OK; } -LayoutDeviceIntPoint +nsIntPoint nsWindow::WidgetToScreenOffset() { NS_ENSURE_TRUE(mWidget, nsIntPoint(0,0)); @@ -634,7 +634,7 @@ nsWindow::WidgetToScreenOffset() QPoint origin(0, 0); origin = mWidget->mapToGlobal(origin); - return LayoutDeviceIntPoint(origin.x(), origin.y()); + return nsIntPoint(origin.x(), origin.y()); } void* diff --git a/widget/qt/nsWindow.h b/widget/qt/nsWindow.h index bf970a09120..70db05e6087 100644 --- a/widget/qt/nsWindow.h +++ b/widget/qt/nsWindow.h @@ -124,7 +124,7 @@ public: { return NS_OK; } - virtual mozilla::LayoutDeviceIntPoint WidgetToScreenOffset(); + virtual nsIntPoint WidgetToScreenOffset(); NS_IMETHOD DispatchEvent(mozilla::WidgetGUIEvent* aEvent, nsEventStatus& aStatus); NS_IMETHOD CaptureRollupEvents(nsIRollupListener *aListener, diff --git a/widget/windows/nsIMM32Handler.cpp b/widget/windows/nsIMM32Handler.cpp index 21834da35ba..6aaae7bc45a 100644 --- a/widget/windows/nsIMM32Handler.cpp +++ b/widget/windows/nsIMM32Handler.cpp @@ -1957,7 +1957,7 @@ nsIMM32Handler::SetIMERelatedWindowsPosOnPlugin(nsWindow* aWindow, // window needs to be specified the position in the client area. nsWindow* toplevelWindow = aWindow->GetTopLevelWindow(false); nsIntRect pluginRectInScreen = - editorRectEvent.mReply.mRect + toplevelWindow->WidgetToScreenOffsetUntyped(); + editorRectEvent.mReply.mRect + toplevelWindow->WidgetToScreenOffset(); nsIntRect winRectInScreen; aWindow->GetClientBounds(winRectInScreen); // composition window cannot be positioned on the edge of client area. @@ -1974,7 +1974,7 @@ nsIMM32Handler::SetIMERelatedWindowsPosOnPlugin(nsWindow* aWindow, int32_t yMost = std::min(pluginRectInScreen.YMost(), winRectInScreen.YMost()); clippedPluginRect.width = std::max(0, xMost - clippedPluginRect.x); clippedPluginRect.height = std::max(0, yMost - clippedPluginRect.y); - clippedPluginRect -= aWindow->WidgetToScreenOffsetUntyped(); + clippedPluginRect -= aWindow->WidgetToScreenOffset(); // Cover the plugin with native caret. This prevents IME's window and plugin // overlap. @@ -2013,10 +2013,10 @@ nsIMM32Handler::ResolveIMECaretPos(nsIWidget* aReferenceWidget, return; if (aReferenceWidget) - aOutRect.MoveBy(aReferenceWidget->WidgetToScreenOffsetUntyped()); + aOutRect.MoveBy(aReferenceWidget->WidgetToScreenOffset()); if (aNewOriginWidget) - aOutRect.MoveBy(-aNewOriginWidget->WidgetToScreenOffsetUntyped()); + aOutRect.MoveBy(-aNewOriginWidget->WidgetToScreenOffset()); } /* static */ nsresult diff --git a/widget/windows/nsTextStore.cpp b/widget/windows/nsTextStore.cpp index ae7d53a8b0f..8156c4248d4 100644 --- a/widget/windows/nsTextStore.cpp +++ b/widget/windows/nsTextStore.cpp @@ -3198,7 +3198,7 @@ nsTextStore::GetTextExt(TsViewCookie vcView, return E_FAIL; } - event.mReply.mRect.MoveBy(refWindow->WidgetToScreenOffsetUntyped()); + event.mReply.mRect.MoveBy(refWindow->WidgetToScreenOffset()); } // get bounding screen rect to test for clipping @@ -3336,7 +3336,7 @@ nsTextStore::GetScreenExtInternal(RECT &aScreenExt) // Clip frame rect to window rect boundRect.IntersectRect(event.mReply.mRect, boundRect); if (!boundRect.IsEmpty()) { - boundRect.MoveBy(refWindow->WidgetToScreenOffsetUntyped()); + boundRect.MoveBy(refWindow->WidgetToScreenOffset()); ::SetRect(&aScreenExt, boundRect.x, boundRect.y, boundRect.XMost(), boundRect.YMost()); } else { @@ -4325,8 +4325,8 @@ nsTextStore::CreateNativeCaret() } if (toplevelWindow != window) { - caretRect.MoveBy(toplevelWindow->WidgetToScreenOffsetUntyped()); - caretRect.MoveBy(-window->WidgetToScreenOffsetUntyped()); + caretRect.MoveBy(toplevelWindow->WidgetToScreenOffset()); + caretRect.MoveBy(-window->WidgetToScreenOffset()); } ::SetCaretPos(caretRect.x, caretRect.y); diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index 46340afd430..5bd07ff155e 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -1991,7 +1991,7 @@ nsIntPoint nsWindow::GetClientOffset() RECT r1; GetWindowRect(mWnd, &r1); - LayoutDeviceIntPoint pt = WidgetToScreenOffset(); + nsIntPoint pt = WidgetToScreenOffset(); return nsIntPoint(pt.x - r1.left, pt.y - r1.top); } @@ -3061,13 +3061,13 @@ NS_METHOD nsWindow::SetIcon(const nsAString& aIconSpec) * **************************************************************/ -LayoutDeviceIntPoint nsWindow::WidgetToScreenOffset() +nsIntPoint nsWindow::WidgetToScreenOffset() { POINT point; point.x = 0; point.y = 0; ::ClientToScreen(mWnd, &point); - return LayoutDeviceIntPoint(point.x, point.y); + return nsIntPoint(point.x, point.y); } nsIntSize nsWindow::ClientToWindowSize(const nsIntSize& aClientSize) @@ -3819,7 +3819,7 @@ bool nsWindow::DispatchMouseEvent(uint32_t aEventType, WPARAM wParam, aInputSource == nsIDOMMouseEvent::MOZ_SOURCE_PEN || !(WinUtils::GetIsMouseFromTouch(aEventType) && mTouchWindow); - nsIntPoint mpScreen = eventPoint + WidgetToScreenOffsetUntyped(); + nsIntPoint mpScreen = eventPoint + WidgetToScreenOffset(); // Suppress mouse moves caused by widget creation if (aEventType == NS_MOUSE_MOVE) diff --git a/widget/windows/nsWindow.h b/widget/windows/nsWindow.h index d76931dd824..e580254debe 100644 --- a/widget/windows/nsWindow.h +++ b/widget/windows/nsWindow.h @@ -136,7 +136,7 @@ public: virtual void FreeNativeData(void * data, uint32_t aDataType); NS_IMETHOD SetTitle(const nsAString& aTitle); NS_IMETHOD SetIcon(const nsAString& aIconSpec); - virtual mozilla::LayoutDeviceIntPoint WidgetToScreenOffset(); + virtual nsIntPoint WidgetToScreenOffset(); virtual nsIntSize ClientToWindowSize(const nsIntSize& aClientSize); NS_IMETHOD DispatchEvent(mozilla::WidgetGUIEvent* aEvent, nsEventStatus& aStatus); diff --git a/widget/windows/winrt/MetroWidget.cpp b/widget/windows/winrt/MetroWidget.cpp index a194f128663..2c4ad6e0603 100644 --- a/widget/windows/winrt/MetroWidget.cpp +++ b/widget/windows/winrt/MetroWidget.cpp @@ -1492,10 +1492,10 @@ MetroWidget::SetTitle(const nsAString& aTitle) return NS_OK; } -LayoutDeviceIntPoint +nsIntPoint MetroWidget::WidgetToScreenOffset() { - return LayoutDeviceIntPoint(0,0); + return nsIntPoint(0,0); } NS_IMETHODIMP diff --git a/widget/windows/winrt/MetroWidget.h b/widget/windows/winrt/MetroWidget.h index bd6c2d46566..74742d98705 100644 --- a/widget/windows/winrt/MetroWidget.h +++ b/widget/windows/winrt/MetroWidget.h @@ -172,7 +172,7 @@ public: virtual nsresult ConfigureChildren(const nsTArray& aConfigurations); virtual void* GetNativeData(uint32_t aDataType); virtual void FreeNativeData(void * data, uint32_t aDataType); - virtual mozilla::LayoutDeviceIntPoint WidgetToScreenOffset(); + virtual nsIntPoint WidgetToScreenOffset(); already_AddRefed GetPresShell();