diff --git a/widget/public/nsIWidget.h b/widget/public/nsIWidget.h index 5283934e7f59..ca7905a5ed13 100644 --- a/widget/public/nsIWidget.h +++ b/widget/public/nsIWidget.h @@ -102,9 +102,10 @@ typedef nsEventStatus (* EVENT_CALLBACK)(nsGUIEvent *event); #define NS_NATIVE_TSF_DISPLAY_ATTR_MGR 102 #endif +// {5F8D1A5E-C380-4c60-978A-030335BE1D6A} #define NS_IWIDGET_IID \ - { 0x9b8d70bd, 0x068e, 0x4465, \ - { 0x8a, 0xd2, 0x4c, 0xf7, 0x96, 0x67, 0xe4, 0xfc } } + { 0x5f8d1a5e, 0xc380, 0x4c60, \ + { 0x97, 0x8a, 0x03, 0x03, 0x35, 0xbe, 0x1d, 0x6a } } /* * Window shadow styles @@ -781,24 +782,6 @@ class nsIWidget : public nsISupports { virtual nsIntPoint WidgetToScreenOffset() = 0; - /** - * When adjustments are to made to a whole set of child widgets, call this - * before resizing/positioning the child windows to minimize repaints. Must - * be followed by EndResizingChildren() after child windows have been - * adjusted. - * - */ - - NS_IMETHOD BeginResizingChildren(void) = 0; - - /** - * Call this when finished adjusting child windows. Must be preceded by - * BeginResizingChildren(). - * - */ - - NS_IMETHOD EndResizingChildren(void) = 0; - /** * Dispatches an event to the widget * diff --git a/widget/src/beos/nsWindow.cpp b/widget/src/beos/nsWindow.cpp index e9d09611de85..40c9f2e0e8be 100644 --- a/widget/src/beos/nsWindow.cpp +++ b/widget/src/beos/nsWindow.cpp @@ -329,20 +329,6 @@ nsWindow::~nsWindow() NS_IF_RELEASE(mFontMetrics); } -NS_METHOD nsWindow::BeginResizingChildren(void) -{ - // HideKids(PR_TRUE) may be used here - NS_NOTYETIMPLEMENTED("BeginResizingChildren not yet implemented"); // to be implemented - return NS_OK; -} - -NS_METHOD nsWindow::EndResizingChildren(void) -{ - // HideKids(PR_FALSE) may be used here - NS_NOTYETIMPLEMENTED("EndResizingChildren not yet implemented"); // to be implemented - return NS_OK; -} - NS_METHOD nsWindow::WidgetToScreen(const nsRect& aOldRect, nsRect& aNewRect) { BPoint point; @@ -1629,8 +1615,6 @@ NS_METHOD nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect) mIsScrolling = PR_TRUE; //Preventing main view invalidation loop-chain when children are moving //by by hiding children nsWidgets. - //Maybe this method must be used wider, in move and resize chains - // and implemented in BeginResizingChildren or in Reset*Visibility() methods //Children will be unhidden in ::Update() when called by other than gkview::Scroll() method. HideKids(PR_TRUE); if (mView && mView->LockLooper()) diff --git a/widget/src/beos/nsWindow.h b/widget/src/beos/nsWindow.h index 59a35f03a00a..44d572e7c161 100644 --- a/widget/src/beos/nsWindow.h +++ b/widget/src/beos/nsWindow.h @@ -165,8 +165,6 @@ public: NS_IMETHOD ShowMenuBar(PRBool aShow) { return NS_ERROR_FAILURE; } NS_IMETHOD WidgetToScreen(const nsRect& aOldRect, nsRect& aNewRect); NS_IMETHOD ScreenToWidget(const nsRect& aOldRect, nsRect& aNewRect); - NS_IMETHOD BeginResizingChildren(void); - NS_IMETHOD EndResizingChildren(void); NS_IMETHOD DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus); NS_IMETHOD HideWindowChrome(PRBool aShouldHide); diff --git a/widget/src/cocoa/nsChildView.h b/widget/src/cocoa/nsChildView.h index 6ec33046d45b..5e3a3cf91968 100644 --- a/widget/src/cocoa/nsChildView.h +++ b/widget/src/cocoa/nsChildView.h @@ -354,8 +354,6 @@ public: const nsIntRect& aSource, const nsTArray& aConfigurations); virtual nsIntPoint WidgetToScreenOffset(); - NS_IMETHOD BeginResizingChildren(void); - NS_IMETHOD EndResizingChildren(void); virtual PRBool ShowsResizeIndicator(nsIntRect* aResizerRect); static PRBool ConvertStatus(nsEventStatus aStatus) diff --git a/widget/src/cocoa/nsChildView.mm b/widget/src/cocoa/nsChildView.mm index c1caddda97b9..5ce1c4e2c482 100644 --- a/widget/src/cocoa/nsChildView.mm +++ b/widget/src/cocoa/nsChildView.mm @@ -1186,17 +1186,6 @@ NS_IMETHODIMP nsChildView::Resize(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt3 NS_OBJC_END_TRY_ABORT_BLOCK_NSRESULT; } -NS_IMETHODIMP nsChildView::BeginResizingChildren(void) -{ - return NS_OK; -} - - -NS_IMETHODIMP nsChildView::EndResizingChildren(void) -{ - return NS_OK; -} - static const PRInt32 resizeIndicatorWidth = 15; static const PRInt32 resizeIndicatorHeight = 15; PRBool nsChildView::ShowsResizeIndicator(nsIntRect* aResizerRect) diff --git a/widget/src/cocoa/nsCocoaWindow.h b/widget/src/cocoa/nsCocoaWindow.h index f07bf88403eb..51ce3cf6f9da 100644 --- a/widget/src/cocoa/nsCocoaWindow.h +++ b/widget/src/cocoa/nsCocoaWindow.h @@ -230,8 +230,6 @@ public: virtual nsresult ConfigureChildren(const nsTArray& aConfigurations); virtual void Scroll(const nsIntPoint& aDelta, const nsIntRect& aSource, const nsTArray& aConfigurations); - NS_IMETHOD BeginResizingChildren(void) { return NS_OK; } - NS_IMETHOD EndResizingChildren(void) { return NS_OK; } NS_IMETHOD DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus) ; NS_IMETHOD CaptureRollupEvents(nsIRollupListener * aListener, PRBool aDoCapture, PRBool aConsumeRollupEvent); NS_IMETHOD GetAttention(PRInt32 aCycleCount); diff --git a/widget/src/gtk2/nsWindow.cpp b/widget/src/gtk2/nsWindow.cpp index 8a7b084487cf..90a4fe9ab1ef 100644 --- a/widget/src/gtk2/nsWindow.cpp +++ b/widget/src/gtk2/nsWindow.cpp @@ -1906,18 +1906,6 @@ nsWindow::WidgetToScreenOffset() return nsIntPoint(x, y); } -NS_IMETHODIMP -nsWindow::BeginResizingChildren(void) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -NS_IMETHODIMP -nsWindow::EndResizingChildren(void) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - NS_IMETHODIMP nsWindow::EnableDragDrop(PRBool aEnable) { diff --git a/widget/src/gtk2/nsWindow.h b/widget/src/gtk2/nsWindow.h index 95065771f1f5..64fc8408169a 100644 --- a/widget/src/gtk2/nsWindow.h +++ b/widget/src/gtk2/nsWindow.h @@ -194,8 +194,6 @@ public: NS_IMETHOD SetIcon(const nsAString& aIconSpec); NS_IMETHOD SetWindowClass(const nsAString& xulWinType); virtual nsIntPoint WidgetToScreenOffset(); - NS_IMETHOD BeginResizingChildren(void); - NS_IMETHOD EndResizingChildren(void); NS_IMETHOD EnableDragDrop(PRBool aEnable); NS_IMETHOD PreCreateWidget(nsWidgetInitData *aWidgetInitData); NS_IMETHOD CaptureMouse(PRBool aCapture); diff --git a/widget/src/os2/nsWindow.cpp b/widget/src/os2/nsWindow.cpp index 96324b8c26cf..b9eebad772c9 100644 --- a/widget/src/os2/nsWindow.cpp +++ b/widget/src/os2/nsWindow.cpp @@ -313,59 +313,6 @@ NS_METHOD nsWindow::CaptureMouse(PRBool aCapture) return NS_OK; } - -//------------------------------------------------------------------------- -// -// Deferred Window positioning -// -//------------------------------------------------------------------------- - -NS_METHOD nsWindow::BeginResizingChildren(void) -{ - if( !mSWPs) - { - mlHave = 10; - mlUsed = 0; - mSWPs = (PSWP) malloc( 10 * sizeof( SWP)); - } - return NS_OK; -} - -void nsWindow::DeferPosition( HWND hwnd, HWND hwndInsertBehind, - long x, long y, long cx, long cy, ULONG flags) -{ - if( mSWPs) - { - if( mlHave == mlUsed) // need more swps - { - mlHave += 10; - mSWPs = (PSWP) realloc( mSWPs, mlHave * sizeof( SWP)); - } - mSWPs[ mlUsed].hwnd = hwnd; - mSWPs[ mlUsed].hwndInsertBehind = hwndInsertBehind; - mSWPs[ mlUsed].x = x; - mSWPs[ mlUsed].y = y; - mSWPs[ mlUsed].cx = cx; - mSWPs[ mlUsed].cy = cy; - mSWPs[ mlUsed].fl = flags; - mSWPs[ mlUsed].ulReserved1 = 0; - mSWPs[ mlUsed].ulReserved2 = 0; - mlUsed++; - } -} - -NS_METHOD nsWindow::EndResizingChildren(void) -{ - if( nsnull != mSWPs) - { - WinSetMultWindowPos( 0/*hab*/, mSWPs, mlUsed); - free( mSWPs); - mSWPs = nsnull; - mlUsed = mlHave = 0; - } - return NS_OK; -} - nsIntPoint nsWindow::WidgetToScreenOffset() { POINTL point = { 0, 0 }; diff --git a/widget/src/os2/nsWindow.h b/widget/src/os2/nsWindow.h index 88e7bc37fd83..3012cb007652 100644 --- a/widget/src/os2/nsWindow.h +++ b/widget/src/os2/nsWindow.h @@ -154,8 +154,6 @@ class nsWindow : public nsBaseWidget, NS_IMETHOD CaptureMouse(PRBool aCapture); - NS_IMETHOD BeginResizingChildren(); - NS_IMETHOD EndResizingChildren(); virtual nsIntPoint WidgetToScreenOffset(); NS_IMETHOD DispatchEvent( struct nsGUIEvent *event, nsEventStatus &aStatus); NS_IMETHOD CaptureRollupEvents(nsIRollupListener * aListener, PRBool aDoCapture, PRBool aConsumeRollupEvent); diff --git a/widget/src/photon/nsWidget.h b/widget/src/photon/nsWidget.h index 3331ac507ab7..b7253437cfee 100644 --- a/widget/src/photon/nsWidget.h +++ b/widget/src/photon/nsWidget.h @@ -157,18 +157,6 @@ public: NS_IMETHOD WidgetToScreen(const nsRect &aOldRect, nsRect &aNewRect); NS_IMETHOD ScreenToWidget(const nsRect &aOldRect, nsRect &aNewRect); - inline NS_IMETHOD BeginResizingChildren(void) - { - PtHold(); - return NS_OK; - } - - inline NS_IMETHOD EndResizingChildren(void) - { - PtRelease(); - return NS_OK; - } - // Use this to set the name of a widget for normal widgets.. not the same as the nsWindow version inline NS_IMETHOD SetTitle(const nsAString& aTitle) { return NS_OK; } diff --git a/widget/src/qt/nsWindow.cpp b/widget/src/qt/nsWindow.cpp index 547e2784418c..f1b4157f9863 100644 --- a/widget/src/qt/nsWindow.cpp +++ b/widget/src/qt/nsWindow.cpp @@ -799,18 +799,6 @@ nsWindow::WidgetToScreenOffset() return nsIntPoint(origin.x(), origin.y()); } -NS_IMETHODIMP -nsWindow::BeginResizingChildren(void) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - -NS_IMETHODIMP -nsWindow::EndResizingChildren(void) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - NS_IMETHODIMP nsWindow::EnableDragDrop(PRBool aEnable) { diff --git a/widget/src/qt/nsWindow.h b/widget/src/qt/nsWindow.h index 1d40542bb849..dfa11bffb1c3 100644 --- a/widget/src/qt/nsWindow.h +++ b/widget/src/qt/nsWindow.h @@ -179,8 +179,6 @@ public: NS_IMETHOD SetTitle(const nsAString& aTitle); NS_IMETHOD SetIcon(const nsAString& aIconSpec); virtual nsIntPoint WidgetToScreenOffset(); - NS_IMETHOD BeginResizingChildren(void); - NS_IMETHOD EndResizingChildren(void); NS_IMETHOD DispatchEvent(nsGUIEvent *aEvent, nsEventStatus &aStatus); NS_IMETHOD EnableDragDrop(PRBool aEnable); diff --git a/widget/src/windows/nsWindow.cpp b/widget/src/windows/nsWindow.cpp index 949a7e512e29..ceb45baa39d1 100644 --- a/widget/src/windows/nsWindow.cpp +++ b/widget/src/windows/nsWindow.cpp @@ -318,7 +318,6 @@ nsWindow::nsWindow() : nsBaseWidget() mWnd = nsnull; mPaintDC = nsnull; mPrevWndProc = nsnull; - mDeferredPositioner = nsnull; mOldIMC = nsnull; mNativeDragTarget = nsnull; mInDtor = PR_FALSE; @@ -1271,25 +1270,10 @@ NS_METHOD nsWindow::Move(PRInt32 aX, PRInt32 aY) } } #endif - - nsIWidget *par = GetParent(); - HDWP deferrer = NULL; - - if (nsnull != par) { - deferrer = ((nsWindow *)par)->mDeferredPositioner; - } - - if (NULL != deferrer) { - VERIFY(((nsWindow *)par)->mDeferredPositioner = ::DeferWindowPos(deferrer, - mWnd, NULL, aX, aY, 0, 0, - SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSIZE)); - } - else { - ClearThemeRegion(); - VERIFY(::SetWindowPos(mWnd, NULL, aX, aY, 0, 0, - SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSIZE)); - SetThemeRegion(); - } + ClearThemeRegion(); + VERIFY(::SetWindowPos(mWnd, NULL, aX, aY, 0, 0, + SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSIZE)); + SetThemeRegion(); } return NS_OK; } @@ -1310,29 +1294,17 @@ NS_METHOD nsWindow::Resize(PRInt32 aWidth, PRInt32 aHeight, PRBool aRepaint) mBounds.height = aHeight; if (mWnd) { - nsIWidget *par = GetParent(); - HDWP deferrer = NULL; - - if (nsnull != par) { - deferrer = ((nsWindow *)par)->mDeferredPositioner; - } - UINT flags = SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE; + #ifndef WINCE if (!aRepaint) { flags |= SWP_NOREDRAW; } #endif - if (NULL != deferrer) { - VERIFY(((nsWindow *)par)->mDeferredPositioner = ::DeferWindowPos(deferrer, - mWnd, NULL, 0, 0, aWidth, GetHeight(aHeight), flags)); - } - else { - ClearThemeRegion(); - VERIFY(::SetWindowPos(mWnd, NULL, 0, 0, aWidth, GetHeight(aHeight), flags)); - SetThemeRegion(); - } + ClearThemeRegion(); + VERIFY(::SetWindowPos(mWnd, NULL, 0, 0, aWidth, GetHeight(aHeight), flags)); + SetThemeRegion(); } if (aRepaint) @@ -1359,13 +1331,6 @@ NS_METHOD nsWindow::Resize(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeig mBounds.height = aHeight; if (mWnd) { - nsIWidget *par = GetParent(); - HDWP deferrer = NULL; - - if (nsnull != par) { - deferrer = ((nsWindow *)par)->mDeferredPositioner; - } - UINT flags = SWP_NOZORDER | SWP_NOACTIVATE; #ifndef WINCE if (!aRepaint) { @@ -1373,15 +1338,9 @@ NS_METHOD nsWindow::Resize(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeig } #endif - if (NULL != deferrer) { - VERIFY(((nsWindow *)par)->mDeferredPositioner = ::DeferWindowPos(deferrer, - mWnd, NULL, aX, aY, aWidth, GetHeight(aHeight), flags)); - } - else { - ClearThemeRegion(); - VERIFY(::SetWindowPos(mWnd, NULL, aX, aY, aWidth, GetHeight(aHeight), flags)); - SetThemeRegion(); - } + ClearThemeRegion(); + VERIFY(::SetWindowPos(mWnd, NULL, aX, aY, aWidth, GetHeight(aHeight), flags)); + SetThemeRegion(); } if (aRepaint) @@ -2542,51 +2501,6 @@ nsIntPoint nsWindow::WidgetToScreenOffset() return nsIntPoint(point.x, point.y); } -/************************************************************** - * - * SECTION: Deferred window positioning. - * - * nsIWidget::BeginResizingChildren, - * nsIWidget::EndResizingChildren - * - * Filters child paint events during a resize operation. - * - **************************************************************/ - -NS_METHOD nsWindow::BeginResizingChildren(void) -{ - if (NULL == mDeferredPositioner) - mDeferredPositioner = ::BeginDeferWindowPos(1); - return NS_OK; -} - -NS_METHOD nsWindow::EndResizingChildren(void) -{ - if (NULL != mDeferredPositioner) { - ::EndDeferWindowPos(mDeferredPositioner); - mDeferredPositioner = NULL; - } - return NS_OK; -} - -LPARAM nsWindow::lParamToScreen(LPARAM lParam) -{ - POINT pt; - pt.x = GET_X_LPARAM(lParam); - pt.y = GET_Y_LPARAM(lParam); - ::ClientToScreen(mWnd, &pt); - return MAKELPARAM(pt.x, pt.y); -} - -LPARAM nsWindow::lParamToClient(LPARAM lParam) -{ - POINT pt; - pt.x = GET_X_LPARAM(lParam); - pt.y = GET_Y_LPARAM(lParam); - ::ScreenToClient(mWnd, &pt); - return MAKELPARAM(pt.x, pt.y); -} - /************************************************************** * * SECTION: nsIWidget::EnableDragDrop @@ -5698,13 +5612,6 @@ void nsWindow::OnDestroy() mtrailer->SetCaptureWindow(nsnull); } - // If we were in the middle of deferred window positioning then free the memory for the - // multiple-window position structure. - if (mDeferredPositioner) { - VERIFY(::EndDeferWindowPos(mDeferredPositioner)); - mDeferredPositioner = NULL; - } - // Free GDI window class objects if (mBrush) { VERIFY(::DeleteObject(mBrush)); @@ -6637,6 +6544,24 @@ PRBool nsWindow::CanTakeFocus() return PR_FALSE; } +LPARAM nsWindow::lParamToScreen(LPARAM lParam) +{ + POINT pt; + pt.x = GET_X_LPARAM(lParam); + pt.y = GET_Y_LPARAM(lParam); + ::ClientToScreen(mWnd, &pt); + return MAKELPARAM(pt.x, pt.y); +} + +LPARAM nsWindow::lParamToClient(LPARAM lParam) +{ + POINT pt; + pt.x = GET_X_LPARAM(lParam); + pt.y = GET_Y_LPARAM(lParam); + ::ScreenToClient(mWnd, &pt); + return MAKELPARAM(pt.x, pt.y); +} + /************************************************************** ************************************************************** ** @@ -6688,4 +6613,4 @@ DWORD ChildWindow::WindowStyle() style |= WS_CHILD; // WS_POPUP and WS_CHILD are mutually exclusive. VERIFY_WINDOW_STYLE(style); return style; -} +} \ No newline at end of file diff --git a/widget/src/windows/nsWindow.h b/widget/src/windows/nsWindow.h index c2883b020d0d..62819e614499 100644 --- a/widget/src/windows/nsWindow.h +++ b/widget/src/windows/nsWindow.h @@ -154,8 +154,6 @@ public: NS_IMETHOD SetTitle(const nsAString& aTitle); NS_IMETHOD SetIcon(const nsAString& aIconSpec); virtual nsIntPoint WidgetToScreenOffset(); - NS_IMETHOD BeginResizingChildren(void); - NS_IMETHOD EndResizingChildren(void); NS_IMETHOD DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus); NS_IMETHOD EnableDragDrop(PRBool aEnable); NS_IMETHOD CaptureMouse(PRBool aCapture); @@ -432,7 +430,6 @@ protected: PRUint32 mBlurSuppressLevel; nsContentType mContentType; PRInt32 mMenuCmdId; - HDWP mDeferredPositioner; DWORD_PTR mOldStyle; DWORD_PTR mOldExStyle; HIMC mOldIMC;