diff --git a/mozilla/widget/public/nsIWidget.h b/mozilla/widget/public/nsIWidget.h index 48e7ec27ed7..ca6b7f5bd7b 100644 --- a/mozilla/widget/public/nsIWidget.h +++ b/mozilla/widget/public/nsIWidget.h @@ -618,22 +618,6 @@ class nsIWidget : public nsISupports { NS_IMETHOD SetBackgroundColor(const nscolor &aColor) = 0; - /** - * Get the font for this widget - * - * @return the font metrics - */ - - virtual nsIFontMetrics* GetFont(void) = 0; - - /** - * Set the font for this widget - * - * @param aFont font to display. See nsFont for allowable fonts - */ - - NS_IMETHOD SetFont(const nsFont &aFont) = 0; - /** * Get the cursor for this widget. * diff --git a/mozilla/widget/src/beos/nsWindow.cpp b/mozilla/widget/src/beos/nsWindow.cpp index 992a67dea9d..17789dcbb86 100644 --- a/mozilla/widget/src/beos/nsWindow.cpp +++ b/mozilla/widget/src/beos/nsWindow.cpp @@ -1253,31 +1253,6 @@ NS_METHOD nsWindow::SetBackgroundColor(const nscolor &aColor) return NS_OK; } -//------------------------------------------------------------------------- -// -// Get this component font -// -//------------------------------------------------------------------------- -nsIFontMetrics* nsWindow::GetFont(void) -{ - return mFontMetrics; -} - - -//------------------------------------------------------------------------- -// -// Set this component font -// -//------------------------------------------------------------------------- -NS_METHOD nsWindow::SetFont(const nsFont &aFont) -{ - // Cache Font for owner draw - NS_IF_RELEASE(mFontMetrics); - if (mContext) - mContext->GetMetricsFor(aFont, mFontMetrics); - return NS_OK; -} - //------------------------------------------------------------------------- // diff --git a/mozilla/widget/src/beos/nsWindow.h b/mozilla/widget/src/beos/nsWindow.h index ef4c8f8585a..611ba30e88d 100644 --- a/mozilla/widget/src/beos/nsWindow.h +++ b/mozilla/widget/src/beos/nsWindow.h @@ -158,8 +158,6 @@ public: NS_IMETHOD SetFocus(PRBool aRaise); NS_IMETHOD GetScreenBounds(nsRect &aRect); NS_IMETHOD SetBackgroundColor(const nscolor &aColor); - virtual nsIFontMetrics* GetFont(void); - NS_IMETHOD SetFont(const nsFont &aFont); NS_IMETHOD SetCursor(nsCursor aCursor); NS_IMETHOD Invalidate(PRBool aIsSynchronous); NS_IMETHOD Invalidate(const nsRect & aRect, PRBool aIsSynchronous); diff --git a/mozilla/widget/src/cocoa/nsChildView.h b/mozilla/widget/src/cocoa/nsChildView.h index 913d8f62bdc..aa22c9d2262 100644 --- a/mozilla/widget/src/cocoa/nsChildView.h +++ b/mozilla/widget/src/cocoa/nsChildView.h @@ -251,8 +251,6 @@ public: NS_IMETHOD SetBounds(const nsRect &aRect); NS_IMETHOD GetBounds(nsRect &aRect); - virtual nsIFontMetrics* GetFont(void); - NS_IMETHOD SetFont(const nsFont &aFont); NS_IMETHOD Invalidate(PRBool aIsSynchronous); NS_IMETHOD Invalidate(const nsRect &aRect,PRBool aIsSynchronous); NS_IMETHOD InvalidateRegion(const nsIRegion *aRegion, PRBool aIsSynchronous); diff --git a/mozilla/widget/src/cocoa/nsChildView.mm b/mozilla/widget/src/cocoa/nsChildView.mm index ce71e61e670..47b0f7ed525 100644 --- a/mozilla/widget/src/cocoa/nsChildView.mm +++ b/mozilla/widget/src/cocoa/nsChildView.mm @@ -731,18 +731,6 @@ NS_IMETHODIMP nsChildView::SetFocus(PRBool aRaise) } -nsIFontMetrics* nsChildView::GetFont(void) -{ - return nsnull; -} - - -NS_IMETHODIMP nsChildView::SetFont(const nsFont &aFont) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - - // Set the colormap of the window NS_IMETHODIMP nsChildView::SetColorMap(nsColorMap *aColorMap) { diff --git a/mozilla/widget/src/cocoa/nsCocoaWindow.h b/mozilla/widget/src/cocoa/nsCocoaWindow.h index 94e51c9688f..76b1d28d02d 100644 --- a/mozilla/widget/src/cocoa/nsCocoaWindow.h +++ b/mozilla/widget/src/cocoa/nsCocoaWindow.h @@ -179,8 +179,6 @@ public: NS_IMETHOD SetTitle(const nsAString& aTitle); - virtual nsIFontMetrics* GetFont(void) { return nsnull; } - NS_IMETHOD SetFont(const nsFont &aFont) { return NS_OK; } NS_IMETHOD Invalidate(const nsRect & aRect, PRBool aIsSynchronous); NS_IMETHOD Invalidate(PRBool aIsSynchronous); NS_IMETHOD Update(); diff --git a/mozilla/widget/src/cocoa/nsDeviceContextSpecX.h b/mozilla/widget/src/cocoa/nsDeviceContextSpecX.h index 1ee9bbaa112..9a46aaa2b83 100644 --- a/mozilla/widget/src/cocoa/nsDeviceContextSpecX.h +++ b/mozilla/widget/src/cocoa/nsDeviceContextSpecX.h @@ -54,7 +54,6 @@ public: nsDeviceContextSpecX(); NS_DECL_ISUPPORTS -#ifdef MOZ_CAIRO_GFX NS_IMETHOD GetSurfaceForPrinter(gfxASurface **surface); NS_IMETHOD BeginDocument(PRUnichar* aTitle, PRUnichar* aPrintToFileName, @@ -63,7 +62,6 @@ public: NS_IMETHOD EndDocument(); NS_IMETHOD BeginPage(); NS_IMETHOD EndPage(); -#endif /** * Initialize the nsDeviceContextSpecX for use. This will allocate a printrecord for use diff --git a/mozilla/widget/src/gtk2/nsWindow.cpp b/mozilla/widget/src/gtk2/nsWindow.cpp index bebacaf365e..66b990b328c 100644 --- a/mozilla/widget/src/gtk2/nsWindow.cpp +++ b/mozilla/widget/src/gtk2/nsWindow.cpp @@ -904,18 +904,6 @@ nsWindow::SetBackgroundColor(const nscolor &aColor) return NS_ERROR_NOT_IMPLEMENTED; } -nsIFontMetrics* -nsWindow::GetFont(void) -{ - return nsnull; -} - -NS_IMETHODIMP -nsWindow::SetFont(const nsFont &aFont) -{ - return NS_ERROR_NOT_IMPLEMENTED; -} - NS_IMETHODIMP nsWindow::SetCursor(nsCursor aCursor) { diff --git a/mozilla/widget/src/gtk2/nsWindow.h b/mozilla/widget/src/gtk2/nsWindow.h index 30ceedbc19c..a4842ba04f9 100644 --- a/mozilla/widget/src/gtk2/nsWindow.h +++ b/mozilla/widget/src/gtk2/nsWindow.h @@ -114,8 +114,6 @@ public: NS_IMETHOD GetScreenBounds(nsRect &aRect); NS_IMETHOD SetForegroundColor(const nscolor &aColor); NS_IMETHOD SetBackgroundColor(const nscolor &aColor); - virtual nsIFontMetrics* GetFont(void); - NS_IMETHOD SetFont(const nsFont &aFont); NS_IMETHOD SetCursor(nsCursor aCursor); NS_IMETHOD SetCursor(imgIContainer* aCursor, PRUint32 aHotspotX, PRUint32 aHotspotY); diff --git a/mozilla/widget/src/windows/nsWindow.cpp b/mozilla/widget/src/windows/nsWindow.cpp index 93fe035336b..88cebe7f8b2 100644 --- a/mozilla/widget/src/windows/nsWindow.cpp +++ b/mozilla/widget/src/windows/nsWindow.cpp @@ -796,7 +796,6 @@ nsWindow::nsWindow() : nsBaseWidget() mLastPoint.y = 0; mPreferredWidth = 0; mPreferredHeight = 0; - mFont = nsnull; mIsVisible = PR_FALSE; mHas3DBorder = PR_FALSE; #ifdef MOZ_XUL @@ -891,9 +890,6 @@ nsWindow::~nsWindow() Destroy(); } - //XXX Temporary: Should not be caching the font - delete mFont; - if (mCursor == -1) { // A successfull SetCursor call will destroy the custom cursor, if it's ours SetCursor(eCursor_standard); @@ -2392,52 +2388,6 @@ NS_METHOD nsWindow::SetBackgroundColor(const nscolor &aColor) return NS_OK; } - -//------------------------------------------------------------------------- -// -// Get this component font -// -//------------------------------------------------------------------------- -nsIFontMetrics* nsWindow::GetFont(void) -{ - NS_NOTYETIMPLEMENTED("GetFont not yet implemented"); // to be implemented - return NULL; -} - - -//------------------------------------------------------------------------- -// -// Set this component font -// -//------------------------------------------------------------------------- -NS_METHOD nsWindow::SetFont(const nsFont &aFont) -{ - // Cache Font for owner draw - if (mFont == nsnull) { - mFont = new nsFont(aFont); - } else { - *mFont = aFont; - } - - // Bail out if there is no context - if (nsnull == mContext) { - return NS_ERROR_FAILURE; - } - - nsIFontMetrics* metrics; - mContext->GetMetricsFor(aFont, metrics); - nsFontHandle fontHandle; - metrics->GetFontHandle(fontHandle); - HFONT hfont = (HFONT)fontHandle; - - // Draw in the new font - ::SendMessageW(mWnd, WM_SETFONT, (WPARAM)hfont, (LPARAM)0); - NS_RELEASE(metrics); - - return NS_OK; -} - - //------------------------------------------------------------------------- // // Set this component cursor diff --git a/mozilla/widget/src/windows/nsWindow.h b/mozilla/widget/src/windows/nsWindow.h index edc15305f98..e59522de9cc 100644 --- a/mozilla/widget/src/windows/nsWindow.h +++ b/mozilla/widget/src/windows/nsWindow.h @@ -166,8 +166,6 @@ public: NS_IMETHOD GetClientBounds(nsRect &aRect); NS_IMETHOD GetScreenBounds(nsRect &aRect); NS_IMETHOD SetBackgroundColor(const nscolor &aColor); - virtual nsIFontMetrics* GetFont(void); - NS_IMETHOD SetFont(const nsFont &aFont); NS_IMETHOD SetCursor(nsCursor aCursor); NS_IMETHOD SetCursor(imgIContainer* aCursor, PRUint32 aHotspotX, PRUint32 aHotspotY); @@ -438,9 +436,6 @@ protected: PRUint32 mBlurEventSuppressionLevel; nsContentType mContentType; - // XXX Temporary, should not be caching the font - nsFont * mFont; - PRInt32 mPreferredWidth; PRInt32 mPreferredHeight;