Back out 5167196c4b98 (bug 1125040) for not compiling on Linux

CLOSED TREE
This commit is contained in:
Phil Ringnalda 2015-02-01 15:27:14 -08:00
parent becb33393a
commit 828d8bca44
42 changed files with 124 additions and 112 deletions

View File

@ -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

View File

@ -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);

View File

@ -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);
}

View File

@ -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,

View File

@ -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),

View File

@ -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<uint32_t>(pixelThresholdX) ||
Abs(distance.y) > AssertedCast<uint32_t>(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);

View File

@ -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);

View File

@ -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),

View File

@ -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

View File

@ -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)

View File

@ -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);

View File

@ -71,7 +71,7 @@ public:
virtual nsresult ConfigureChildren(const nsTArray<Configuration>& 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; }

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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 {
/**

View File

@ -8474,9 +8474,9 @@ PresShell::AdjustContextMenuKeyEvent(WidgetMouseEvent* aEvent)
nsCOMPtr<nsIWidget> 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;

View File

@ -4812,7 +4812,7 @@ nsRect nsIFrame::GetScreenRectInAppUnits() const
nsCOMPtr<nsIWidget> 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);
}

View File

@ -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.

View File

@ -729,7 +729,7 @@ nsXULPopupManager::ShowTooltipAtScreen(nsIContent* aPopup,
if (rootPresContext) {
nsIWidget *rootWidget = rootPresContext->GetRootWidget();
if (rootWidget) {
mCachedMousePoint -= rootWidget->WidgetToScreenOffsetUntyped();
mCachedMousePoint -= rootWidget->WidgetToScreenOffset();
}
}

View File

@ -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));
}

View File

@ -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);

View File

@ -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;
}

View File

@ -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;

View File

@ -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);

View File

@ -401,7 +401,7 @@ public:
virtual void* GetNativeData(uint32_t aDataType) MOZ_OVERRIDE;
virtual nsresult ConfigureChildren(const nsTArray<Configuration>& 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)

View File

@ -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,

View File

@ -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;

View File

@ -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()

View File

@ -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) {

View File

@ -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);

View File

@ -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;

View File

@ -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

View File

@ -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,

View File

@ -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,

View File

@ -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*

View File

@ -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,

View File

@ -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

View File

@ -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);

View File

@ -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)

View File

@ -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);

View File

@ -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

View File

@ -172,7 +172,7 @@ public:
virtual nsresult ConfigureChildren(const nsTArray<Configuration>& aConfigurations);
virtual void* GetNativeData(uint32_t aDataType);
virtual void FreeNativeData(void * data, uint32_t aDataType);
virtual mozilla::LayoutDeviceIntPoint WidgetToScreenOffset();
virtual nsIntPoint WidgetToScreenOffset();
already_AddRefed<nsIPresShell> GetPresShell();