Bug 1224403 (part 12) - Remove WidgetToScreenOffsetUntyped(). r=kats.
There are few enough calls now that using WidgetToScreenOffset() +
ToUnknownPoint() is a better approach.
--- a/widget/PuppetWidget.cpp
+++ b/widget/PuppetWidget.cpp
@@ -1167,17 +1167,17 @@ PuppetWidget::GetWindowPosition()
int32_t winX, winY, winW, winH;
NS_ENSURE_SUCCESS(GetOwningTabChild()->GetDimensions(0, &winX, &winY, &winW, &winH), nsIntPoint());
return nsIntPoint(winX, winY);
}
NS_METHOD
PuppetWidget::GetScreenBoundsUntyped(nsIntRect &aRect) {
- aRect.MoveTo(WidgetToScreenOffsetUntyped());
+ aRect.MoveTo(WidgetToScreenOffset().ToUnknownPoint());
aRect.SizeTo(mBounds.Size());
return NS_OK;
}
uint32_t PuppetWidget::GetMaxTouchPoints() const
{
static uint32_t sTouchPoints = 0;
static bool sIsInitialized = false;
--- a/widget/android/AndroidJavaWrappers.cpp
+++ b/widget/android/AndroidJavaWrappers.cpp
@@ -712,17 +712,17 @@ AndroidGeckoEvent::MakeMultiTouchInput(n
MultiTouchInput event(type, Time(), TimeStamp(), 0);
event.modifiers = DOMModifiers();
if (type < 0) {
// An event we don't know about
return event;
}
- const nsIntPoint& offset = widget->WidgetToScreenOffsetUntyped();
+ const nsIntPoint& offset = widget->WidgetToScreenOffset().ToUnknownPoint();
event.mTouches.SetCapacity(endIndex - startIndex);
for (int i = startIndex; i < endIndex; i++) {
nsIntPoint point = Points()[i] - offset;
nsIntPoint radius = PointRadii()[i];
SingleTouchData data(PointIndicies()[i],
ScreenIntPoint::FromUnknownPoint(
gfx::IntPoint(point.x, point.y)),
ScreenSize::FromUnknownSize(
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -917,25 +917,25 @@ NS_IMETHODIMP nsChildView::GetBoundsUnty
}
NS_IMETHODIMP nsChildView::GetClientBoundsUntyped(nsIntRect &aRect)
{
GetBoundsUntyped(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().ToUnknownPoint());
}
return NS_OK;
}
NS_IMETHODIMP nsChildView::GetScreenBoundsUntyped(nsIntRect &aRect)
{
GetBoundsUntyped(aRect);
- aRect.MoveTo(WidgetToScreenOffsetUntyped());
+ aRect.MoveTo(WidgetToScreenOffset().ToUnknownPoint());
return NS_OK;
}
double
nsChildView::GetDefaultScaleInternal()
{
return BackingScaleFactor();
}
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -1483,19 +1483,18 @@ nsWindow::SetFocus(bool aRaise)
NS_IMETHODIMP
nsWindow::GetScreenBoundsUntyped(nsIntRect &aRect)
{
if (mIsTopLevel && mContainer) {
// 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(GdkPointToDevicePixels({ x, y }).ToUnknownPoint());
- }
- else {
- aRect.MoveTo(WidgetToScreenOffsetUntyped());
+ } else {
+ aRect.MoveTo(WidgetToScreenOffset().ToUnknownPoint());
}
// mBounds.Size() is the window bounds, not the window-manager frame
// bounds (bug 581863). gdk_window_get_frame_extents would give the
// frame bounds, but mBounds.Size() is returned here for consistency
// with Resize.
aRect.SizeTo(mBounds.Size());
LOG(("GetScreenBoundsUntyped %d,%d | %dx%d\n",
aRect.x, aRect.y, aRect.width, aRect.height));
--- a/widget/nsIWidget.h
+++ b/widget/nsIWidget.h
@@ -1357,26 +1357,21 @@ class nsIWidget : public nsISupports {
* @param anIconSpec string specifying the icon to use; convention is to pass
* a resource: URL from which a platform-dependent resource
* file name will be constructed
*/
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 WidgetToScreenOffset().ToUnknownPoint();
- }
/**
* Given the specified client size, return the corresponding window size,
* which includes the area for the borders and titlebar. This method
* should work even when the window is not yet visible.
*/
virtual mozilla::LayoutDeviceIntSize ClientToWindowSize(
const mozilla::LayoutDeviceIntSize& aClientSize) = 0;
--- a/widget/qt/nsWindow.cpp
+++ b/widget/qt/nsWindow.cpp
@@ -1501,19 +1501,18 @@ void find_first_visible_parent(QWindow*
NS_IMETHODIMP
nsWindow::GetScreenBoundsUntyped(nsIntRect &aRect)
{
aRect = gfx::IntRect(gfx::IntPoint(0, 0), mBounds.Size());
if (mIsTopLevel) {
QPoint pos = mWidget->position();
aRect.MoveTo(pos.x(), pos.y());
- }
- else {
- aRect.MoveTo(WidgetToScreenOffsetUntyped());
+ } else {
+ aRect.MoveTo(WidgetToScreenOffset().ToUnknownPoint());
}
LOG(("GetScreenBounds %d %d | %d %d | %d %d\n",
aRect.x, aRect.y,
mBounds.width, mBounds.height,
aRect.width, aRect.height));
return NS_OK;
}