diff --git a/widget/public/nsIWidget.h b/widget/public/nsIWidget.h index 6ae095db8058..07612abea564 100644 --- a/widget/public/nsIWidget.h +++ b/widget/public/nsIWidget.h @@ -352,6 +352,10 @@ class nsIWidget : public nsISupports { * Perform platform-dependent sanity check on a potential window position. * This is guaranteed to work only for top-level windows. * + * @param aAllowSlop: if true, allow the window to slop offscreen; + * the window should be partially visible. if false, + * force the entire window onscreen (or at least + * the upper-left corner, if it's too large). * @param aX in: an x position expressed in screen coordinates. * out: the x position constrained to fit on the screen(s). * @param aY in: an y position expressed in screen coordinates. @@ -359,7 +363,9 @@ class nsIWidget : public nsISupports { * @return vapid success indication. but see also the parameters. * **/ - NS_IMETHOD ConstrainPosition(PRInt32 *aX, PRInt32 *aY) = 0; + NS_IMETHOD ConstrainPosition(PRBool aAllowSlop, + PRInt32 *aX, + PRInt32 *aY) = 0; /** * Move this widget. diff --git a/widget/src/beos/nsWindow.cpp b/widget/src/beos/nsWindow.cpp index 805f57a46965..f5994c040255 100644 --- a/widget/src/beos/nsWindow.cpp +++ b/widget/src/beos/nsWindow.cpp @@ -981,7 +981,7 @@ NS_METHOD nsWindow::IsVisible(PRBool & bState) // Sanity check potential move coordinates // //------------------------------------------------------------------------- -NS_METHOD nsWindow::ConstrainPosition(PRInt32 *aX, PRInt32 *aY) +NS_METHOD nsWindow::ConstrainPosition(PRBool aAllowSlop, PRInt32 *aX, PRInt32 *aY) { NS_WARNING("nsWindow::ConstrainPosition - not implemented"); return NS_OK; diff --git a/widget/src/beos/nsWindow.h b/widget/src/beos/nsWindow.h index 320490e26e7b..45d50833c21d 100644 --- a/widget/src/beos/nsWindow.h +++ b/widget/src/beos/nsWindow.h @@ -113,7 +113,8 @@ public: NS_IMETHOD CaptureRollupEvents(nsIRollupListener *aListener, PRBool aDoCapture, PRBool aConsumeRollupEvent); NS_IMETHOD IsVisible(PRBool & aState); - NS_IMETHOD ConstrainPosition(PRInt32 *aX, PRInt32 *aY); + NS_IMETHOD ConstrainPosition(PRBool aAllowSlop, + PRInt32 *aX, PRInt32 *aY); NS_IMETHOD Move(PRInt32 aX, PRInt32 aY); NS_IMETHOD Resize(PRInt32 aWidth, PRInt32 aHeight, diff --git a/widget/src/cocoa/nsChildView.h b/widget/src/cocoa/nsChildView.h index 569849396f34..c38b59644bb8 100644 --- a/widget/src/cocoa/nsChildView.h +++ b/widget/src/cocoa/nsChildView.h @@ -150,7 +150,8 @@ public: NS_IMETHOD ModalEventFilter(PRBool aRealEvent, void *aEvent, PRBool *aForWindow); - NS_IMETHOD ConstrainPosition(PRInt32 *aX, PRInt32 *aY); + NS_IMETHOD ConstrainPosition(PRBool aAllowSlop, + PRInt32 *aX, PRInt32 *aY); NS_IMETHOD Move(PRInt32 aX, PRInt32 aY); NS_IMETHOD Resize(PRInt32 aWidth,PRInt32 aHeight, PRBool aRepaint); NS_IMETHOD Resize(PRInt32 aX, PRInt32 aY,PRInt32 aWidth,PRInt32 aHeight, PRBool aRepaint); diff --git a/widget/src/cocoa/nsChildView.mm b/widget/src/cocoa/nsChildView.mm index 8aa55abab61f..4c301444346f 100644 --- a/widget/src/cocoa/nsChildView.mm +++ b/widget/src/cocoa/nsChildView.mm @@ -799,7 +799,8 @@ NS_METHOD nsChildView::SetBounds(const nsRect &aRect) } -NS_IMETHODIMP nsChildView::ConstrainPosition(PRInt32 *aX, PRInt32 *aY) +NS_IMETHODIMP nsChildView::ConstrainPosition(PRBool aAllowSlop, + PRInt32 *aX, PRInt32 *aY) { return NS_OK; } diff --git a/widget/src/cocoa/nsCocoaWindow.h b/widget/src/cocoa/nsCocoaWindow.h index 8f54904e934f..c1fb6f92fd7b 100644 --- a/widget/src/cocoa/nsCocoaWindow.h +++ b/widget/src/cocoa/nsCocoaWindow.h @@ -125,7 +125,8 @@ public: virtual void* GetNativeData(PRUint32 aDataType) ; - NS_IMETHOD ConstrainPosition(PRInt32 *aX, PRInt32 *aY); + NS_IMETHOD ConstrainPosition(PRBool aAllowSlop, + PRInt32 *aX, PRInt32 *aY); NS_IMETHOD Move(PRInt32 aX, PRInt32 aY); NS_IMETHOD PlaceBehind(nsIWidget *aWidget, PRBool aActivate); NS_IMETHOD SetSizeMode(PRInt32 aMode); diff --git a/widget/src/cocoa/nsCocoaWindow.mm b/widget/src/cocoa/nsCocoaWindow.mm index 5f6bf5e8534b..6b41ea10c6b6 100644 --- a/widget/src/cocoa/nsCocoaWindow.mm +++ b/widget/src/cocoa/nsCocoaWindow.mm @@ -920,7 +920,8 @@ NS_METHOD nsWindow::Restore(void) } */ -NS_IMETHODIMP nsCocoaWindow::ConstrainPosition(PRInt32 *aX, PRInt32 *aY) +NS_IMETHODIMP nsCocoaWindow::ConstrainPosition(PRBool aAllowSlop, + PRInt32 *aX, PRInt32 *aY) { #if 0 if (eWindowType_popup == mWindowType || !mWindowMadeHere) @@ -1737,4 +1738,4 @@ void StopResizing ( ) printf("did move\n"); } -@end \ No newline at end of file +@end diff --git a/widget/src/gtk/nsWidget.cpp b/widget/src/gtk/nsWidget.cpp index 930e8998caf8..702e463bd9f0 100644 --- a/widget/src/gtk/nsWidget.cpp +++ b/widget/src/gtk/nsWidget.cpp @@ -480,7 +480,8 @@ NS_IMETHODIMP nsWidget::IsVisible(PRBool &aState) // //------------------------------------------------------------------------- -NS_IMETHODIMP nsWidget::ConstrainPosition(PRInt32 *aX, PRInt32 *aY) +NS_IMETHODIMP nsWidget::ConstrainPosition(PRBool aAllowSlop, + PRInt32 *aX, PRInt32 *aY) { return NS_OK; } diff --git a/widget/src/gtk/nsWidget.h b/widget/src/gtk/nsWidget.h index e5d4f83ea36f..9654220a6f01 100644 --- a/widget/src/gtk/nsWidget.h +++ b/widget/src/gtk/nsWidget.h @@ -113,7 +113,7 @@ public: NS_IMETHOD CaptureRollupEvents(nsIRollupListener *aListener, PRBool aDoCapture, PRBool aConsumeRollupEvent); NS_IMETHOD IsVisible(PRBool &aState); - NS_IMETHOD ConstrainPosition(PRInt32 *aX, PRInt32 *aY); + NS_IMETHOD ConstrainPosition(PRBool aAllowSlop, PRInt32 *aX, PRInt32 *aY); NS_IMETHOD Move(PRInt32 aX, PRInt32 aY); NS_IMETHOD Resize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint); NS_IMETHOD Resize(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, diff --git a/widget/src/gtk/nsWindow.h b/widget/src/gtk/nsWindow.h index 100a28d2a6ea..d9064e529da9 100644 --- a/widget/src/gtk/nsWindow.h +++ b/widget/src/gtk/nsWindow.h @@ -86,7 +86,8 @@ public: NS_IMETHOD Show(PRBool aShow); NS_IMETHOD CaptureMouse(PRBool aCapture); - NS_IMETHOD ConstrainPosition(PRInt32 *aX, PRInt32 *aY); + NS_IMETHOD ConstrainPosition(PRBool aAllowSlop, + PRInt32 *aX, PRInt32 *aY); NS_IMETHOD Move(PRInt32 aX, PRInt32 aY); NS_IMETHOD Resize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint); diff --git a/widget/src/gtk2/nsScrollbar.cpp b/widget/src/gtk2/nsScrollbar.cpp index 7b5c7ac8969d..0485f8f6f85a 100644 --- a/widget/src/gtk2/nsScrollbar.cpp +++ b/widget/src/gtk2/nsScrollbar.cpp @@ -119,7 +119,7 @@ nsScrollbar::IsVisible(PRBool & aState) } NS_IMETHODIMP -nsScrollbar::ConstrainPosition(PRInt32 *aX, PRInt32 *aY) +nsScrollbar::ConstrainPosition(PRBool aAllowSlop, PRInt32 *aX, PRInt32 *aY) { return NS_ERROR_NOT_IMPLEMENTED; } diff --git a/widget/src/gtk2/nsScrollbar.h b/widget/src/gtk2/nsScrollbar.h index 8529beb3beb5..936c7123d900 100644 --- a/widget/src/gtk2/nsScrollbar.h +++ b/widget/src/gtk2/nsScrollbar.h @@ -65,7 +65,7 @@ class nsScrollbar : public nsCommonWidget, nsWidgetInitData *aInitData = nsnull); NS_IMETHOD Destroy(void); NS_IMETHOD IsVisible(PRBool & aState); - NS_IMETHOD ConstrainPosition(PRInt32 *aX, PRInt32 *aY); + NS_IMETHOD ConstrainPosition(PRBool aAllowSlop, PRInt32 *aX, PRInt32 *aY); NS_IMETHOD Move(PRInt32 aX, PRInt32 aY); NS_IMETHOD Enable(PRBool aState); NS_IMETHOD SetFocus(PRBool aRaise = PR_FALSE); diff --git a/widget/src/gtk2/nsWindow.cpp b/widget/src/gtk2/nsWindow.cpp index b68447f988f3..b08c0d50c3b9 100644 --- a/widget/src/gtk2/nsWindow.cpp +++ b/widget/src/gtk2/nsWindow.cpp @@ -194,7 +194,7 @@ nsWindow::IsVisible(PRBool & aState) } NS_IMETHODIMP -nsWindow::ConstrainPosition(PRInt32 *aX, PRInt32 *aY) +nsWindow::ConstrainPosition(PRBool aAllowSlop, PRInt32 *aX, PRInt32 *aY) { return NS_ERROR_NOT_IMPLEMENTED; } diff --git a/widget/src/gtk2/nsWindow.h b/widget/src/gtk2/nsWindow.h index a7abed783013..427c8ef08b8b 100644 --- a/widget/src/gtk2/nsWindow.h +++ b/widget/src/gtk2/nsWindow.h @@ -63,7 +63,8 @@ class nsWindow : public nsCommonWidget { NS_IMETHOD Destroy(void); NS_IMETHOD SetModal(PRBool aModal); NS_IMETHOD IsVisible(PRBool & aState); - NS_IMETHOD ConstrainPosition(PRInt32 *aX, + NS_IMETHOD ConstrainPosition(PRBool aAllowSlop, + PRInt32 *aX, PRInt32 *aY); NS_IMETHOD Move(PRInt32 aX, PRInt32 aY); diff --git a/widget/src/mac/nsMacWindow.h b/widget/src/mac/nsMacWindow.h index f5b06cbb4dc5..481baf7c113a 100644 --- a/widget/src/mac/nsMacWindow.h +++ b/widget/src/mac/nsMacWindow.h @@ -107,7 +107,8 @@ public: nsNativeWidget aNativeParent = nsnull); NS_IMETHOD Show(PRBool aState); - NS_IMETHOD ConstrainPosition(PRInt32 *aX, PRInt32 *aY); + NS_IMETHOD ConstrainPosition(PRBool aAllowSlop, + PRInt32 *aX, PRInt32 *aY); NS_IMETHOD Move(PRInt32 aX, PRInt32 aY); NS_IMETHOD PlaceBehind(nsIWidget *aWidget, PRBool aActivate); NS_IMETHOD SetSizeMode(PRInt32 aMode); diff --git a/widget/src/mac/nsWindow.cpp b/widget/src/mac/nsWindow.cpp index 1014a6b1398c..8acc2dbbb522 100644 --- a/widget/src/mac/nsWindow.cpp +++ b/widget/src/mac/nsWindow.cpp @@ -782,7 +782,8 @@ NS_METHOD nsWindow::SetBounds(const nsRect &aRect) } -NS_IMETHODIMP nsWindow::ConstrainPosition(PRInt32 *aX, PRInt32 *aY) +NS_IMETHODIMP nsWindow::ConstrainPosition(PRBool aAllowSlop, + PRInt32 *aX, PRInt32 *aY) { return NS_OK; } diff --git a/widget/src/mac/nsWindow.h b/widget/src/mac/nsWindow.h index 5f21e013f9d8..75e889b76484 100644 --- a/widget/src/mac/nsWindow.h +++ b/widget/src/mac/nsWindow.h @@ -128,7 +128,8 @@ public: NS_IMETHOD ModalEventFilter(PRBool aRealEvent, void *aEvent, PRBool *aForWindow); - NS_IMETHOD ConstrainPosition(PRInt32 *aX, PRInt32 *aY); + NS_IMETHOD ConstrainPosition(PRBool aAllowSlop, + PRInt32 *aX, PRInt32 *aY); NS_IMETHOD Move(PRInt32 aX, PRInt32 aY); NS_IMETHOD Resize(PRInt32 aWidth,PRInt32 aHeight, PRBool aRepaint); NS_IMETHOD Resize(PRInt32 aX, PRInt32 aY,PRInt32 aWidth,PRInt32 aHeight, PRBool aRepaint); diff --git a/widget/src/os2/nsWindow.cpp b/widget/src/os2/nsWindow.cpp index e0bc1be30c1b..46d0e589aa0a 100644 --- a/widget/src/os2/nsWindow.cpp +++ b/widget/src/os2/nsWindow.cpp @@ -1189,7 +1189,8 @@ NS_METHOD nsWindow::ModalEventFilter(PRBool aRealEvent, void *aEvent, // Constrain a potential move to fit onscreen // //------------------------------------------------------------------------- -NS_METHOD nsWindow::ConstrainPosition(PRInt32 *aX, PRInt32 *aY) +NS_METHOD nsWindow::ConstrainPosition(PRBool aAllowSlop, + PRInt32 *aX, PRInt32 *aY) { return NS_OK; } diff --git a/widget/src/os2/nsWindow.h b/widget/src/os2/nsWindow.h index 365a193ec6dc..3613ca845c0e 100644 --- a/widget/src/os2/nsWindow.h +++ b/widget/src/os2/nsWindow.h @@ -104,7 +104,7 @@ class nsWindow : public nsBaseWidget, // Physical properties NS_IMETHOD Show( PRBool bState); - NS_IMETHOD ConstrainPosition(PRInt32 *aX, PRInt32 *aY); + NS_IMETHOD ConstrainPosition(PRBool aAllowSlop, PRInt32 *aX, PRInt32 *aY); NS_IMETHOD Move( PRInt32 aX, PRInt32 aY); NS_IMETHOD Resize( PRInt32 aWidth, PRInt32 aHeight, diff --git a/widget/src/photon/nsWidget.cpp b/widget/src/photon/nsWidget.cpp index fedc8c2ba5a0..1ba113709734 100644 --- a/widget/src/photon/nsWidget.cpp +++ b/widget/src/photon/nsWidget.cpp @@ -371,9 +371,10 @@ NS_METHOD nsWidget::IsVisible( PRBool &aState ) { // Constrain a potential move to see if it fits onscreen // //------------------------------------------------------------------------- -NS_METHOD nsWidget::ConstrainPosition( PRInt32 *aX, PRInt32 *aY ) { +NS_METHOD nsWidget::ConstrainPosition( PRBool aAllowSlop, + PRInt32 *aX, PRInt32 *aY ) { return NS_OK; - } +} //------------------------------------------------------------------------- // diff --git a/widget/src/photon/nsWidget.h b/widget/src/photon/nsWidget.h index 6bf96b4049f2..04751f04ec6c 100644 --- a/widget/src/photon/nsWidget.h +++ b/widget/src/photon/nsWidget.h @@ -99,7 +99,7 @@ public: NS_IMETHOD CaptureRollupEvents(nsIRollupListener *aListener, PRBool aDoCapture, PRBool aConsumeRollupEvent); NS_IMETHOD IsVisible(PRBool &aState); - NS_IMETHOD ConstrainPosition(PRInt32 *aX, PRInt32 *aY); + NS_IMETHOD ConstrainPosition(PRBool aAllowSlop, PRInt32 *aX, PRInt32 *aY); NS_IMETHOD Move(PRInt32 aX, PRInt32 aY); NS_IMETHOD Resize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint); NS_IMETHOD Resize(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, diff --git a/widget/src/photon/nsWindow.cpp b/widget/src/photon/nsWindow.cpp index e007bbd77d42..d68fa45f74b5 100644 --- a/widget/src/photon/nsWindow.cpp +++ b/widget/src/photon/nsWindow.cpp @@ -1107,9 +1107,10 @@ NS_IMETHODIMP nsWindow::CaptureMouse( PRBool aCapture ) { return NS_OK; } -NS_METHOD nsWindow::ConstrainPosition( PRInt32 *aX, PRInt32 *aY ) { +NS_METHOD nsWindow::ConstrainPosition( PRBool aAllowSlop, + PRInt32 *aX, PRInt32 *aY ) { return NS_OK; - } +} //------------------------------------------------------------------------- // diff --git a/widget/src/photon/nsWindow.h b/widget/src/photon/nsWindow.h index 4fd864047b13..a5ddd890ac49 100644 --- a/widget/src/photon/nsWindow.h +++ b/widget/src/photon/nsWindow.h @@ -80,7 +80,8 @@ public: NS_IMETHOD SetTitle(const nsString& aTitle); NS_IMETHOD CaptureMouse(PRBool aCapture); - NS_IMETHOD ConstrainPosition(PRInt32 *aX, PRInt32 *aY); + NS_IMETHOD ConstrainPosition(PRBool aAllowSlop, + PRInt32 *aX, PRInt32 *aY); NS_IMETHOD Move(PRInt32 aX, PRInt32 aY); NS_IMETHOD Resize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint); diff --git a/widget/src/qt/nsWidget.cpp b/widget/src/qt/nsWidget.cpp index 6c9727fe8a98..5fc7da7cc813 100644 --- a/widget/src/qt/nsWidget.cpp +++ b/widget/src/qt/nsWidget.cpp @@ -244,7 +244,8 @@ NS_METHOD nsWidget::IsVisible(PRBool &aState) //------------------------------------------------------------------------- // Constrain a potential move so that it remains onscreen //------------------------------------------------------------------------- -NS_METHOD nsWidget::ConstrainPosition(PRInt32 *aX, PRInt32 *aY) +NS_METHOD nsWidget::ConstrainPosition(PRBool aAllowSlop, + PRInt32 *aX, PRInt32 *aY) { return NS_OK; } diff --git a/widget/src/qt/nsWidget.h b/widget/src/qt/nsWidget.h index c832e13d6bde..9d50d184b797 100644 --- a/widget/src/qt/nsWidget.h +++ b/widget/src/qt/nsWidget.h @@ -84,7 +84,7 @@ public: PRBool aConsumeRollupEvent); NS_IMETHOD IsVisible(PRBool &aState); - NS_IMETHOD ConstrainPosition(PRInt32 *aX, PRInt32 *aY); + NS_IMETHOD ConstrainPosition(PRBool aAllowSlop, PRInt32 *aX, PRInt32 *aY); NS_IMETHOD Move(PRInt32 aX, PRInt32 aY); NS_IMETHOD Resize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint); NS_IMETHOD Resize(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight, diff --git a/widget/src/qt/nsWindow.cpp b/widget/src/qt/nsWindow.cpp index 58efa2c20d54..54fcdbb6690f 100644 --- a/widget/src/qt/nsWindow.cpp +++ b/widget/src/qt/nsWindow.cpp @@ -458,7 +458,8 @@ PRBool nsWindow::OnScroll(nsScrollbarEvent &aEvent, PRUint32 cPos) return PR_FALSE; } -NS_METHOD nsWindow::ConstrainPosition(PRInt32 *aX, PRInt32 *aY) +NS_METHOD nsWindow::ConstrainPosition(PRBool aAllowSlop, + PRInt32 *aX, PRInt32 *aY) { return NS_OK; } diff --git a/widget/src/qt/nsWindow.h b/widget/src/qt/nsWindow.h index 78889c2ec8e8..82e270b6ddce 100644 --- a/widget/src/qt/nsWindow.h +++ b/widget/src/qt/nsWindow.h @@ -58,7 +58,7 @@ public: NS_IMETHOD SetColorMap(nsColorMap *aColorMap); NS_IMETHOD Scroll(PRInt32 aDx,PRInt32 aDy,nsRect *aClipRect); - NS_IMETHOD ConstrainPosition(PRInt32 *aX,PRInt32 *aY); + NS_IMETHOD ConstrainPosition(PRBool aAllowSlop, PRInt32 *aX,PRInt32 *aY); NS_IMETHOD Move(PRInt32 aX,PRInt32 aY); NS_IMETHOD CaptureRollupEvents(nsIRollupListener *aListener, diff --git a/widget/src/windows/nsWindow.h b/widget/src/windows/nsWindow.h index 5d15b0dff458..176bf1e9b0dc 100644 --- a/widget/src/windows/nsWindow.h +++ b/widget/src/windows/nsWindow.h @@ -247,7 +247,8 @@ public: PRBool *aForWindow); NS_IMETHOD CaptureMouse(PRBool aCapture); - NS_IMETHOD ConstrainPosition(PRInt32 *aX, PRInt32 *aY); + NS_IMETHOD ConstrainPosition(PRBool aAllowSlop, + PRInt32 *aX, PRInt32 *aY); NS_IMETHOD Move(PRInt32 aX, PRInt32 aY); NS_IMETHOD Resize(PRInt32 aWidth, PRInt32 aHeight, diff --git a/widget/src/xlib/nsWidget.cpp b/widget/src/xlib/nsWidget.cpp index 64e507529673..78e363bb60e0 100644 --- a/widget/src/xlib/nsWidget.cpp +++ b/widget/src/xlib/nsWidget.cpp @@ -385,7 +385,8 @@ NS_IMETHODIMP nsWidget::Destroy() } -NS_IMETHODIMP nsWidget::ConstrainPosition(PRInt32 *aX, PRInt32 *aY) +NS_IMETHODIMP nsWidget::ConstrainPosition(PRBool aAllowSlop, + PRInt32 *aX, PRInt32 *aY) { return NS_OK; } diff --git a/widget/src/xlib/nsWidget.h b/widget/src/xlib/nsWidget.h index 6f43b0160780..9a8cfacb89dc 100644 --- a/widget/src/xlib/nsWidget.h +++ b/widget/src/xlib/nsWidget.h @@ -91,7 +91,7 @@ public: NS_IMETHOD Show(PRBool bState); NS_IMETHOD IsVisible(PRBool &aState); - NS_IMETHOD ConstrainPosition(PRInt32 *aX, PRInt32 *aY); + NS_IMETHOD ConstrainPosition(PRBool aAllowSlop, PRInt32 *aX, PRInt32 *aY); NS_IMETHOD Move(PRInt32 aX, PRInt32 aY); NS_IMETHOD Resize(PRInt32 aWidth, PRInt32 aHeight,