remove unused font APIs from nsIWidget. b=388369 r/sr=pav a=pav

This commit is contained in:
joshmoz@gmail.com 2007-08-02 12:16:27 -07:00
parent b294a2e73e
commit 09bf2cb250
11 changed files with 0 additions and 130 deletions

View File

@ -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.
*

View File

@ -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;
}
//-------------------------------------------------------------------------
//

View File

@ -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);

View File

@ -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);

View File

@ -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)
{

View File

@ -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();

View File

@ -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

View File

@ -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)
{

View File

@ -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);

View File

@ -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

View File

@ -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;