diff --git a/widget/src/os2/Makefile.in b/widget/src/os2/Makefile.in index d29056f4042..275416c8f4a 100644 --- a/widget/src/os2/Makefile.in +++ b/widget/src/os2/Makefile.in @@ -84,7 +84,6 @@ CPPSRCS = \ nsFrameWindow.cpp \ nsLookAndFeel.cpp \ nsOS2Uni.cpp \ - nsPaletteOS2.cpp \ nsPrintOS2.cpp \ nsSound.cpp \ nsToolkit.cpp \ diff --git a/widget/src/os2/nsPaletteOS2.cpp b/widget/src/os2/nsPaletteOS2.cpp deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/os2/nsPaletteOS2.h b/widget/src/os2/nsPaletteOS2.h deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/widget/src/os2/nsWindow.cpp b/widget/src/os2/nsWindow.cpp index 8fd1c56ce5f..b3280f94d44 100644 --- a/widget/src/os2/nsWindow.cpp +++ b/widget/src/os2/nsWindow.cpp @@ -79,7 +79,6 @@ #include "nsIFile.h" #include "nsOS2Uni.h" -#include "nsPaletteOS2.h" #include "imgIContainer.h" #include "gfxIImageFrame.h" @@ -956,7 +955,7 @@ void nsWindow::RealDoCreate( HWND hwndP, #endif // Create a window: create hidden & then size to avoid swp_noadjust problems - // owner == parent except for 'borderless top-level' -- see nsCanvas.cpp + // owner == parent except for 'borderless top-level' mWnd = WinCreateWindow( hwndP, WindowClass(), 0, // text @@ -2233,7 +2232,6 @@ void* nsWindow::GetNativeData(PRUint32 aDataType) CheckDragStatus(ACTION_DRAW, &hps); if (!hps) hps = WinGetPS(mWnd); - nsPaletteOS2::SelectGlobalPalette(hps, mWnd); return (void*)hps; } @@ -2940,10 +2938,6 @@ PRBool nsWindow::ProcessMessage( ULONG msg, MPARAM mp1, MPARAM mp2, MRESULT &rc) break; - case WM_REALIZEPALETTE: // hopefully only nsCanvas & nsFrame - result = OnRealizePalette(); // will need this - break; - case WM_PRESPARAMCHANGED: // This is really for font-change notifies. Do that first. rc = GetPrevWP()( mWnd, msg, mp1, mp2); @@ -3015,26 +3009,6 @@ PRBool nsWindow::OnReposition( PSWP pSwp) return result; } -PRBool nsWindow::OnRealizePalette() -{ - if (WinQueryWindowUShort(mWnd, QWS_ID) == FID_CLIENT) { - HWND hwndFocus = WinQueryFocus(HWND_DESKTOP); - if (WinIsChild(hwndFocus, mWnd)) { - /* We are getting the focus */ - HPS hps = WinGetPS(hwndFocus); - nsPaletteOS2::SelectGlobalPalette(hps, hwndFocus); - WinReleasePS(hps); - WinInvalidateRect( mWnd, 0, TRUE); - } else { - /* We are losing the focus */ - WinInvalidateRect( mWnd, 0, TRUE); - } - } - - // Always call the default window procedure - return PR_TRUE; -} - PRBool nsWindow::OnPresParamChanged( MPARAM mp1, MPARAM mp2) { return PR_FALSE; @@ -3142,7 +3116,6 @@ PRBool nsWindow::OnPaint() HPS hpsDrag = 0; CheckDragStatus(ACTION_PAINT, &hpsDrag); HPS hPS = WinBeginPaint(mWnd, hpsDrag, &rcl); - nsPaletteOS2::SelectGlobalPalette(hPS, mWnd); // if the update rect is empty, suppress the paint event if (!WinIsRectEmpty(0, &rcl)) { diff --git a/widget/src/os2/nsWindow.h b/widget/src/os2/nsWindow.h index 729b1ba277f..22e8921f0a1 100644 --- a/widget/src/os2/nsWindow.h +++ b/widget/src/os2/nsWindow.h @@ -75,12 +75,9 @@ class imgIContainer; // Base widget class. // This is abstract. Controls (labels, radio buttons, listboxen) derive // from here. A thing called a child window derives from here, and the -// frame window class derives from the child. The content-displaying -// classes are off on their own branch to avoid creating a palette for -// every window we create. This may turn out to be what's required, in -// which case the paint & palette code from nsChildWindow needs to be -// munged in here. nsFrameWindow is separate because work needs to be done -// there to decide whether methods apply to frame or client. +// frame window class derives from the child. +// nsFrameWindow is separate because work needs to be done there to decide +// whether methods apply to frame or client. /* Possible states of the window, used to emulate windows better... */ // default state; Create() not called @@ -234,7 +231,7 @@ protected: long cx, long cy, unsigned long flags); // Message handlers - may wish to override. Default implementation for - // palette, control, paint & scroll is to do nothing. + // control, paint & scroll is to do nothing. // Return whether message has been processed. virtual PRBool ProcessMessage( ULONG m, MPARAM p1, MPARAM p2, MRESULT &r); @@ -244,7 +241,6 @@ protected: virtual PRBool OnResize( PRInt32 aX, PRInt32 aY); virtual PRBool OnMove( PRInt32 aX, PRInt32 aY); virtual PRBool OnKey( MPARAM mp1, MPARAM mp2); - virtual PRBool OnRealizePalette(); virtual PRBool DispatchFocus( PRUint32 aEventType, PRBool isMozWindowTakingFocus); virtual PRBool OnScroll( ULONG msgid, MPARAM mp1, MPARAM mp2); virtual PRBool OnVScroll( MPARAM mp1, MPARAM mp2); @@ -383,28 +379,4 @@ extern PRUint32 WMChar2KeyCode( MPARAM mp1, MPARAM mp2); extern nsWindow *NS_HWNDToWindow( HWND hwnd); -#define NSCANVASCLASS "WarpzillaCanvas" - -#if 0 - -// Need to do this because the cross-platform widgets (toolbars) assume -// that the name of the NS_CHILD_CID is ChildWindow and that it gets -// defined in "nsWindow.h". -// -// However, if we've included this header *from nsCanvas.h*, then we -// get a lovely circular dependency, and so special-case this. -// -// Yes, I suppose I'm just being perverse by having three separate classes -// here, but I just baulk at naming a class 'ChildWindow'. -// -// (and don't tell me there's a JLib class called JMother. Believe me, -// I know, and I regret it at least twice a week...) -// -#ifndef _nscanvas_h -#include "nsCanvas.h" -typedef nsCanvas ChildWindow; -#endif - -#endif - #endif