From e457732aea01309f3158f44bcb74e548ab1d3458 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Wed, 20 Dec 2006 02:04:00 +0000 Subject: [PATCH] Remove the GetScrollBarDimensions API from device contexts. Bug 364345, r+sr=roc git-svn-id: svn://10.0.0.236/trunk@217224 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/gfx/public/nsIDeviceContext.h | 13 ++----- mozilla/gfx/src/beos/nsDeviceContextBeOS.cpp | 13 ------- mozilla/gfx/src/beos/nsDeviceContextBeOS.h | 3 -- mozilla/gfx/src/gtk/nsDeviceContextGTK.cpp | 34 ------------------- mozilla/gfx/src/gtk/nsDeviceContextGTK.h | 3 -- mozilla/gfx/src/mac/nsDeviceContextMac.cpp | 14 -------- mozilla/gfx/src/mac/nsDeviceContextMac.h | 1 - mozilla/gfx/src/os2/nsDeviceContextOS2.cpp | 8 ----- mozilla/gfx/src/os2/nsDeviceContextOS2.h | 1 - mozilla/gfx/src/photon/nsDeviceContextPh.cpp | 4 --- mozilla/gfx/src/photon/nsDeviceContextPh.h | 13 ------- mozilla/gfx/src/ps/nsDeviceContextPS.cpp | 16 --------- mozilla/gfx/src/ps/nsDeviceContextPS.h | 2 -- mozilla/gfx/src/qt/nsDeviceContextQt.cpp | 24 ------------- mozilla/gfx/src/qt/nsDeviceContextQt.h | 3 -- .../gfx/src/thebes/nsThebesDeviceContext.cpp | 22 ------------ .../gfx/src/thebes/nsThebesDeviceContext.h | 2 -- .../gfx/src/windows/nsDeviceContextWin.cpp | 11 ------ mozilla/gfx/src/windows/nsDeviceContextWin.h | 1 - mozilla/gfx/src/xlib/nsDeviceContextXlib.cpp | 12 ------- mozilla/gfx/src/xlib/nsDeviceContextXlib.h | 1 - mozilla/gfx/src/xprint/nsDeviceContextXP.cpp | 15 -------- mozilla/gfx/src/xprint/nsDeviceContextXP.h | 2 -- mozilla/widget/src/mac/nsDeviceContextMac.cpp | 15 -------- mozilla/widget/src/mac/nsDeviceContextMac.h | 1 - 25 files changed, 2 insertions(+), 232 deletions(-) diff --git a/mozilla/gfx/public/nsIDeviceContext.h b/mozilla/gfx/public/nsIDeviceContext.h index 36b87c7d526..a6098b2e3b9 100644 --- a/mozilla/gfx/public/nsIDeviceContext.h +++ b/mozilla/gfx/public/nsIDeviceContext.h @@ -174,8 +174,8 @@ const PRUint8 kUseAltDCFor_SURFACE_DIM = 0x08; // Use it for getting the Sur #endif #define NS_IDEVICE_CONTEXT_IID \ -{ 0xb31ad9ce, 0x40cb, 0x43c4, \ - { 0x90, 0xf8, 0x0f, 0x30, 0x53, 0xf6, 0xb8, 0xea } } +{ 0xb05ae6b9, 0x280c, 0x4b16, \ + { 0xb1, 0x36, 0x86, 0x7c, 0x48, 0xd2, 0x15, 0x54 } } //a cross platform way of specifying a native palette handle typedef void * nsPalette; @@ -361,15 +361,6 @@ public: */ NS_IMETHOD SetCanonicalPixelScale(float aScale) = 0; - /** - * Get the width of a vertical scroll bar and the height - * of a horizontal scrollbar in application units. - * @param aWidth out parameter for width - * @param aHeight out parameter for height - * @return error status - */ - NS_IMETHOD GetScrollBarDimensions(float &aWidth, float &aHeight) const = 0; - /** * Fill in an nsFont based on the ID of a system font. This function * may or may not fill in the size, so the size should be set to a diff --git a/mozilla/gfx/src/beos/nsDeviceContextBeOS.cpp b/mozilla/gfx/src/beos/nsDeviceContextBeOS.cpp index c0558cc3c93..3b34bb16845 100644 --- a/mozilla/gfx/src/beos/nsDeviceContextBeOS.cpp +++ b/mozilla/gfx/src/beos/nsDeviceContextBeOS.cpp @@ -155,9 +155,6 @@ NS_IMETHODIMP nsDeviceContextBeOS::Init(nsNativeWidget aNativeWidget) SetDPI(mDpi); - mScrollbarHeight = PRInt16(B_H_SCROLL_BAR_HEIGHT); - mScrollbarWidth = PRInt16(B_V_SCROLL_BAR_WIDTH); - menu_info info; get_menu_info(&info); mMenuFont.SetFamilyAndStyle(info.f_family,info.f_style); @@ -230,16 +227,6 @@ NS_IMETHODIMP nsDeviceContextBeOS::SupportsNativeWidgets(PRBool &aSupportsWidget return NS_OK; } -NS_IMETHODIMP nsDeviceContextBeOS::GetScrollBarDimensions(float &aWidth, float &aHeight) const -{ - float scale; - GetCanonicalPixelScale(scale); - aWidth = mScrollbarWidth * mPixelsToTwips * scale; - aHeight = mScrollbarHeight * mPixelsToTwips * scale; - - return NS_OK; -} - NS_IMETHODIMP nsDeviceContextBeOS::GetSystemFont(nsSystemFontID aID, nsFont *aFont) const { nsresult status = NS_OK; diff --git a/mozilla/gfx/src/beos/nsDeviceContextBeOS.h b/mozilla/gfx/src/beos/nsDeviceContextBeOS.h index 7a591a3b336..6ce9c2d53bf 100644 --- a/mozilla/gfx/src/beos/nsDeviceContextBeOS.h +++ b/mozilla/gfx/src/beos/nsDeviceContextBeOS.h @@ -60,7 +60,6 @@ public: NS_IMETHOD SupportsNativeWidgets(PRBool &aSupportsWidgets); - NS_IMETHOD GetScrollBarDimensions(float &aWidth, float &aHeight) const; NS_IMETHOD GetSystemFont(nsSystemFontID anID, nsFont *aFont) const; NS_IMETHOD CheckFontExistence(const nsString& aFontName); @@ -87,8 +86,6 @@ private: PRUint32 mDepth; PRBool mWriteable; PRUint32 mNumCells; - PRInt16 mScrollbarHeight; - PRInt16 mScrollbarWidth; BFont mMenuFont; static nscoord mDpi; diff --git a/mozilla/gfx/src/gtk/nsDeviceContextGTK.cpp b/mozilla/gfx/src/gtk/nsDeviceContextGTK.cpp index 9f8d8744b8d..336e0ceea58 100644 --- a/mozilla/gfx/src/gtk/nsDeviceContextGTK.cpp +++ b/mozilla/gfx/src/gtk/nsDeviceContextGTK.cpp @@ -248,30 +248,6 @@ NS_IMETHODIMP nsDeviceContextGTK::Init(nsNativeWidget aNativeWidget) SetDPI(mDpi); // to setup p2t and t2p } - sb = gtk_vscrollbar_new(NULL); - gtk_widget_ref(sb); - gtk_object_sink(GTK_OBJECT(sb)); -#ifdef MOZ_WIDGET_GTK2 - gtk_widget_ensure_style(sb); - gtk_widget_queue_resize(sb); -#endif /* MOZ_WIDGET_GTK2 */ - gtk_widget_size_request(sb,&req); - mScrollbarWidth = req.width; - gtk_widget_destroy(sb); - gtk_widget_unref(sb); - - sb = gtk_hscrollbar_new(NULL); - gtk_widget_ref(sb); - gtk_object_sink(GTK_OBJECT(sb)); -#ifdef MOZ_WIDGET_GTK2 - gtk_widget_ensure_style(sb); - gtk_widget_queue_resize(sb); -#endif /* MOZ_WIDGET_GTK2 */ - gtk_widget_size_request(sb,&req); - mScrollbarHeight = req.height; - gtk_widget_destroy(sb); - gtk_widget_unref(sb); - #ifdef DEBUG static PRBool once = PR_TRUE; if (once) { @@ -376,16 +352,6 @@ NS_IMETHODIMP nsDeviceContextGTK::SupportsNativeWidgets(PRBool &aSupportsWidgets return NS_OK; } -NS_IMETHODIMP nsDeviceContextGTK::GetScrollBarDimensions(float &aWidth, float &aHeight) const -{ - float scale; - GetCanonicalPixelScale(scale); - aWidth = mScrollbarWidth * mPixelsToTwips * scale; - aHeight = mScrollbarHeight * mPixelsToTwips * scale; - - return NS_OK; -} - NS_IMETHODIMP nsDeviceContextGTK::GetSystemFont(nsSystemFontID aID, nsFont *aFont) const { nsresult status = NS_OK; diff --git a/mozilla/gfx/src/gtk/nsDeviceContextGTK.h b/mozilla/gfx/src/gtk/nsDeviceContextGTK.h index 6b33037754c..11388659400 100644 --- a/mozilla/gfx/src/gtk/nsDeviceContextGTK.h +++ b/mozilla/gfx/src/gtk/nsDeviceContextGTK.h @@ -65,7 +65,6 @@ public: NS_IMETHOD SupportsNativeWidgets(PRBool &aSupportsWidgets); - NS_IMETHOD GetScrollBarDimensions(float &aWidth, float &aHeight) const; NS_IMETHOD GetSystemFont(nsSystemFontID anID, nsFont *aFont) const; NS_IMETHOD CheckFontExistence(const nsString& aFontName); @@ -97,8 +96,6 @@ private: PRUint32 mDepth; PRBool mWriteable; PRUint32 mNumCells; - PRInt16 mScrollbarHeight; - PRInt16 mScrollbarWidth; static nscoord mDpi; float mWidthFloat; diff --git a/mozilla/gfx/src/mac/nsDeviceContextMac.cpp b/mozilla/gfx/src/mac/nsDeviceContextMac.cpp index ce51368b01f..878e0afcb7d 100644 --- a/mozilla/gfx/src/mac/nsDeviceContextMac.cpp +++ b/mozilla/gfx/src/mac/nsDeviceContextMac.cpp @@ -187,20 +187,6 @@ NS_IMETHODIMP nsDeviceContextMac :: SupportsNativeWidgets(PRBool &aSupportsWidge } -/** --------------------------------------------------- - * See documentation in nsIDeviceContext.h - * @update 12/9/98 dwc - */ -NS_IMETHODIMP nsDeviceContextMac :: GetScrollBarDimensions(float &aWidth, float &aHeight) const -{ - // XXX Should we push this to widget library - float scale; - GetCanonicalPixelScale(scale); - aWidth = 16 * mDevUnitsToAppUnits * scale; - aHeight = 16 * mDevUnitsToAppUnits * scale; - return NS_OK; -} - // helper function to get the system font for a specific script #define FONTNAME_MAX_UNICHRS sizeof(fontName255) * 2 nsresult diff --git a/mozilla/gfx/src/mac/nsDeviceContextMac.h b/mozilla/gfx/src/mac/nsDeviceContextMac.h index 0047fa8205a..6fe8a6a1321 100644 --- a/mozilla/gfx/src/mac/nsDeviceContextMac.h +++ b/mozilla/gfx/src/mac/nsDeviceContextMac.h @@ -64,7 +64,6 @@ public: NS_IMETHOD CreateRenderingContext(nsIRenderingContext *&aContext); NS_IMETHOD SupportsNativeWidgets(PRBool &aSupportsWidgets); - NS_IMETHOD GetScrollBarDimensions(float &aWidth, float &aHeight) const; NS_IMETHOD GetSystemFont(nsSystemFontID anID, nsFont *aFont) const; NS_IMETHOD CheckFontExistence(const nsString& aFontName); diff --git a/mozilla/gfx/src/os2/nsDeviceContextOS2.cpp b/mozilla/gfx/src/os2/nsDeviceContextOS2.cpp index 374a890394e..5c9dea8a1fc 100644 --- a/mozilla/gfx/src/os2/nsDeviceContextOS2.cpp +++ b/mozilla/gfx/src/os2/nsDeviceContextOS2.cpp @@ -351,14 +351,6 @@ NS_IMETHODIMP nsDeviceContextOS2 :: SupportsNativeWidgets(PRBool &aSupportsWidge return NS_OK; } -NS_IMETHODIMP nsDeviceContextOS2 :: GetScrollBarDimensions(float &aWidth, float &aHeight) const -{ - float scale = mCPixelScale; - aWidth = ::WinQuerySysValue( HWND_DESKTOP, SV_CXVSCROLL) * mDevUnitsToAppUnits * scale; - aHeight = ::WinQuerySysValue( HWND_DESKTOP, SV_CYHSCROLL) * mDevUnitsToAppUnits * scale; - return NS_OK; -} - nscolor GetSysColorInfo(int iSysColor) { long lColor = ::WinQuerySysColor( HWND_DESKTOP, iSysColor, 0); diff --git a/mozilla/gfx/src/os2/nsDeviceContextOS2.h b/mozilla/gfx/src/os2/nsDeviceContextOS2.h index 5570152e412..0b7f1a2fefb 100644 --- a/mozilla/gfx/src/os2/nsDeviceContextOS2.h +++ b/mozilla/gfx/src/os2/nsDeviceContextOS2.h @@ -58,7 +58,6 @@ public: NS_IMETHOD SupportsNativeWidgets(PRBool &aSupportsWidgets); - NS_IMETHOD GetScrollBarDimensions(float &aWidth, float &aHeight) const; NS_IMETHOD GetSystemFont(nsSystemFontID anID, nsFont *aFont) const; NS_IMETHOD CheckFontExistence(const nsString& aFontName); diff --git a/mozilla/gfx/src/photon/nsDeviceContextPh.cpp b/mozilla/gfx/src/photon/nsDeviceContextPh.cpp index 2d3648c8961..6413c7fc0f4 100644 --- a/mozilla/gfx/src/photon/nsDeviceContextPh.cpp +++ b/mozilla/gfx/src/photon/nsDeviceContextPh.cpp @@ -205,10 +205,6 @@ void nsDeviceContextPh :: CommonInit( nsNativeDeviceContext aDC ) { /* Turn off virtual console support... */ mWidthFloat = (float) aWidth; mHeightFloat = (float) aHeight; - - /* Revisit: the scroll bar sizes is a gross guess based on Phab */ - mScrollbarHeight = 17; - mScrollbarWidth = 17; } NS_IMETHODIMP nsDeviceContextPh :: CreateRenderingContext( nsIRenderingContext *&aContext ) { diff --git a/mozilla/gfx/src/photon/nsDeviceContextPh.h b/mozilla/gfx/src/photon/nsDeviceContextPh.h index b0a5008c116..46706e89b2b 100644 --- a/mozilla/gfx/src/photon/nsDeviceContextPh.h +++ b/mozilla/gfx/src/photon/nsDeviceContextPh.h @@ -70,17 +70,6 @@ public: return NS_OK; } - inline - NS_IMETHODIMP GetScrollBarDimensions(float &aWidth, float &aHeight) const - { - /* Revisit: the scroll bar sizes is a gross guess based on Phab */ - float scale; - GetCanonicalPixelScale(scale); - aWidth = mScrollbarWidth * mPixelsToTwips * scale; - aHeight = mScrollbarHeight * mPixelsToTwips * scale; - return NS_OK; - } - NS_IMETHOD GetSystemFont(nsSystemFontID anID, nsFont *aFont) const; //get a low level drawing surface for rendering. the rendering context @@ -133,8 +122,6 @@ protected: nsIDrawingSurface* mSurface; PRUint32 mDepth; // bit depth of device float mPixelScale; - PRInt16 mScrollbarHeight; - PRInt16 mScrollbarWidth; float mWidthFloat; float mHeightFloat; diff --git a/mozilla/gfx/src/ps/nsDeviceContextPS.cpp b/mozilla/gfx/src/ps/nsDeviceContextPS.cpp index 2c40a81227c..f3c80af8e93 100644 --- a/mozilla/gfx/src/ps/nsDeviceContextPS.cpp +++ b/mozilla/gfx/src/ps/nsDeviceContextPS.cpp @@ -319,22 +319,6 @@ NS_IMETHODIMP nsDeviceContextPS::PrepareNativeWidget(nsIWidget* aWidget, void ** return NS_OK; } -/** --------------------------------------------------- - * See documentation in nsIDeviceContext.h - * @update 12/21/98 dwc - */ -NS_IMETHODIMP nsDeviceContextPS::GetScrollBarDimensions(float &aWidth, float &aHeight) const -{ - PR_LOG(nsDeviceContextPSLM, PR_LOG_DEBUG, ("nsDeviceContextPS::GetScrollBarDimensions()\n")); - - //XXX: Hardcoded values for Postscript - float scale; - GetCanonicalPixelScale(scale); - aWidth = 20.f * scale; - aHeight = 20.f * scale; - return NS_OK; -} - /** --------------------------------------------------- * See documentation in nsIDeviceContext.h * @update 12/21/98 dwc diff --git a/mozilla/gfx/src/ps/nsDeviceContextPS.h b/mozilla/gfx/src/ps/nsDeviceContextPS.h index 8050d3fddde..a447077a40d 100644 --- a/mozilla/gfx/src/ps/nsDeviceContextPS.h +++ b/mozilla/gfx/src/ps/nsDeviceContextPS.h @@ -78,8 +78,6 @@ public: NS_IMETHOD SupportsNativeWidgets(PRBool &aSupportsWidgets); NS_IMETHOD PrepareNativeWidget(nsIWidget* aWidget, void ** aOut); - NS_IMETHOD GetScrollBarDimensions(float &aWidth, float &aHeight) const; - NS_IMETHOD CheckFontExistence(const nsString& aFontName); NS_IMETHOD GetDepth(PRUint32& aDepth); diff --git a/mozilla/gfx/src/qt/nsDeviceContextQt.cpp b/mozilla/gfx/src/qt/nsDeviceContextQt.cpp index bc2e256db4b..252ee24f5a0 100644 --- a/mozilla/gfx/src/qt/nsDeviceContextQt.cpp +++ b/mozilla/gfx/src/qt/nsDeviceContextQt.cpp @@ -105,17 +105,9 @@ nsDeviceContextQt::~nsDeviceContextQt() NS_IMETHODIMP nsDeviceContextQt::Init(nsNativeWidget aNativeWidget) { PRBool bCleanUp = PR_FALSE; - QWidget *pWidget = nsnull; mWidget = (QWidget*)aNativeWidget; - if (mWidget != nsnull) - pWidget = mWidget; - else { - pWidget = new QWidget(); - bCleanUp = PR_TRUE; - } - nsresult ignore; nsCOMPtr sm(do_GetService("@mozilla.org/gfx/screenmanager;1", &ignore)); @@ -165,13 +157,8 @@ NS_IMETHODIMP nsDeviceContextQt::Init(nsNativeWidget aNativeWidget) } #endif - QStyle &style = pWidget->style(); - mScrollbarWidth = mScrollbarHeight = style.pixelMetric(QStyle::PM_ScrollBarExtent); - DeviceContextImpl::CommonInit(); - if (bCleanUp) - delete pWidget; return NS_OK; } @@ -234,17 +221,6 @@ nsDeviceContextQt::SupportsNativeWidgets(PRBool &aSupportsWidgets) return NS_OK; } -NS_IMETHODIMP nsDeviceContextQt::GetScrollBarDimensions(float &aWidth, - float &aHeight) const -{ - float scale; - GetCanonicalPixelScale(scale); - aWidth = mScrollbarWidth * mPixelsToTwips * scale; - aHeight = mScrollbarHeight * mPixelsToTwips * scale; - - return NS_OK; -} - NS_IMETHODIMP nsDeviceContextQt::GetSystemFont(nsSystemFontID anID, nsFont *aFont) const { diff --git a/mozilla/gfx/src/qt/nsDeviceContextQt.h b/mozilla/gfx/src/qt/nsDeviceContextQt.h index f76941aba18..3ab823e4790 100644 --- a/mozilla/gfx/src/qt/nsDeviceContextQt.h +++ b/mozilla/gfx/src/qt/nsDeviceContextQt.h @@ -67,7 +67,6 @@ public: NS_IMETHOD SupportsNativeWidgets(PRBool &aSupportsWidgets); - NS_IMETHOD GetScrollBarDimensions(float &aWidth,float &aHeight) const; NS_IMETHOD GetSystemFont(nsSystemFontID anID, nsFont *aFont) const; NS_IMETHOD CheckFontExistence(const nsString &aFontName); @@ -96,8 +95,6 @@ public: private: PRUint32 mDepth; - PRInt16 mScrollbarHeight; - PRInt16 mScrollbarWidth; QWidget *mWidget; PRInt32 mWidth; PRInt32 mHeight; diff --git a/mozilla/gfx/src/thebes/nsThebesDeviceContext.cpp b/mozilla/gfx/src/thebes/nsThebesDeviceContext.cpp index 9f10b87ae4f..1ad09565004 100644 --- a/mozilla/gfx/src/thebes/nsThebesDeviceContext.cpp +++ b/mozilla/gfx/src/thebes/nsThebesDeviceContext.cpp @@ -376,28 +376,6 @@ nsThebesDeviceContext::SupportsNativeWidgets(PRBool &aSupportsWidgets) return NS_OK; } -NS_IMETHODIMP -nsThebesDeviceContext::GetScrollBarDimensions(float &aWidth, float &aHeight) const -{ - float scale; - GetCanonicalPixelScale(scale); - - //XXXispiked initialize these to something in case nsILookAndFeel barfs - PRInt32 tmpWidth = 16; - PRInt32 tmpHeight = 16; - // Get the scrollbar width and height from nsILookAndFeel - nsCOMPtr lookAndFeel = do_GetService("@mozilla.org/widget/lookandfeel;1"); - if(lookAndFeel) { - lookAndFeel->GetMetric(nsILookAndFeel::eMetric_ScrollbarWidth, tmpWidth); - lookAndFeel->GetMetric(nsILookAndFeel::eMetric_ScrollbarHeight, tmpHeight); - } - - aWidth = tmpWidth * mDevUnitsToAppUnits * scale; - aHeight = tmpHeight * mDevUnitsToAppUnits * scale; - - return NS_OK; -} - NS_IMETHODIMP nsThebesDeviceContext::GetSystemFont(nsSystemFontID aID, nsFont *aFont) const { diff --git a/mozilla/gfx/src/thebes/nsThebesDeviceContext.h b/mozilla/gfx/src/thebes/nsThebesDeviceContext.h index 9417ebd1971..87715b69ee3 100644 --- a/mozilla/gfx/src/thebes/nsThebesDeviceContext.h +++ b/mozilla/gfx/src/thebes/nsThebesDeviceContext.h @@ -78,8 +78,6 @@ public: NS_IMETHOD SupportsNativeWidgets(PRBool &aSupportsWidgets); NS_IMETHOD PrepareNativeWidget(nsIWidget* aWidget, void** aOut); - NS_IMETHOD GetScrollBarDimensions(float &aWidth, float &aHeight) const; - NS_IMETHOD GetSystemFont(nsSystemFontID aID, nsFont *aFont) const; NS_IMETHOD CheckFontExistence(const nsString& aFaceName); diff --git a/mozilla/gfx/src/windows/nsDeviceContextWin.cpp b/mozilla/gfx/src/windows/nsDeviceContextWin.cpp index e44a4f58788..7607c878bfd 100644 --- a/mozilla/gfx/src/windows/nsDeviceContextWin.cpp +++ b/mozilla/gfx/src/windows/nsDeviceContextWin.cpp @@ -309,17 +309,6 @@ NS_IMETHODIMP nsDeviceContextWin :: SetCanonicalPixelScale(float aScale) } -NS_IMETHODIMP nsDeviceContextWin :: GetScrollBarDimensions(float &aWidth, float &aHeight) const -{ - float scale; - GetCanonicalPixelScale(scale); - - aWidth = ::GetSystemMetrics(SM_CXVSCROLL) * mDevUnitsToAppUnits * scale; - aHeight = ::GetSystemMetrics(SM_CXHSCROLL) * mDevUnitsToAppUnits * scale; - - return NS_OK; -} - nsresult nsDeviceContextWin::CopyLogFontToNSFont(HDC* aHDC, const LOGFONT* ptrLogFont, nsFont* aFont, PRBool aIsWide) const { diff --git a/mozilla/gfx/src/windows/nsDeviceContextWin.h b/mozilla/gfx/src/windows/nsDeviceContextWin.h index 0939e6ad869..6a02af01b93 100644 --- a/mozilla/gfx/src/windows/nsDeviceContextWin.h +++ b/mozilla/gfx/src/windows/nsDeviceContextWin.h @@ -59,7 +59,6 @@ public: NS_IMETHOD GetCanonicalPixelScale(float &aScale) const; NS_IMETHOD SetCanonicalPixelScale(float aScale); - NS_IMETHOD GetScrollBarDimensions(float &aWidth, float &aHeight) const; NS_IMETHOD GetSystemFont(nsSystemFontID anID, nsFont *aFont) const; //get a low level drawing surface for rendering. the rendering context diff --git a/mozilla/gfx/src/xlib/nsDeviceContextXlib.cpp b/mozilla/gfx/src/xlib/nsDeviceContextXlib.cpp index 6ba9d9ac24d..09776739980 100644 --- a/mozilla/gfx/src/xlib/nsDeviceContextXlib.cpp +++ b/mozilla/gfx/src/xlib/nsDeviceContextXlib.cpp @@ -281,18 +281,6 @@ NS_IMETHODIMP nsDeviceContextXlib::SupportsNativeWidgets(PRBool &aSupportsWidget return NS_OK; } -NS_IMETHODIMP nsDeviceContextXlib::GetScrollBarDimensions(float &aWidth, float &aHeight) const -{ - PR_LOG(DeviceContextXlibLM, PR_LOG_DEBUG, ("nsDeviceContextXlib::GetScrollBarDimensions()\n")); - float scale; - GetCanonicalPixelScale(scale); - // XXX Oh, yeah. These are hard coded. - aWidth = 15 * mPixelsToTwips * scale; - aHeight = 15 * mPixelsToTwips * scale; - - return NS_OK; -} - NS_IMETHODIMP nsDeviceContextXlib::GetSystemFont(nsSystemFontID anID, nsFont *aFont) const { PR_LOG(DeviceContextXlibLM, PR_LOG_DEBUG, ("nsDeviceContextXlib::GetSystemFont()\n")); diff --git a/mozilla/gfx/src/xlib/nsDeviceContextXlib.h b/mozilla/gfx/src/xlib/nsDeviceContextXlib.h index 471541e65cb..42ae141ae00 100644 --- a/mozilla/gfx/src/xlib/nsDeviceContextXlib.h +++ b/mozilla/gfx/src/xlib/nsDeviceContextXlib.h @@ -61,7 +61,6 @@ public: NS_IMETHOD SupportsNativeWidgets(PRBool &aSupportsWidgets); - NS_IMETHOD GetScrollBarDimensions(float &aWidth, float &aHeight) const; NS_IMETHOD GetSystemFont(nsSystemFontID anID, nsFont *aFont) const; NS_IMETHOD CheckFontExistence(const nsString& aFontName); diff --git a/mozilla/gfx/src/xprint/nsDeviceContextXP.cpp b/mozilla/gfx/src/xprint/nsDeviceContextXP.cpp index e18b879ca18..16678f7f721 100644 --- a/mozilla/gfx/src/xprint/nsDeviceContextXP.cpp +++ b/mozilla/gfx/src/xprint/nsDeviceContextXP.cpp @@ -212,21 +212,6 @@ NS_IMETHODIMP nsDeviceContextXp :: SupportsNativeWidgets(PRBool &aSupportsWidget return NS_OK; } -/** --------------------------------------------------- - * See documentation in nsIDeviceContext.h - */ -NS_IMETHODIMP nsDeviceContextXp :: GetScrollBarDimensions(float &aWidth, - float &aHeight) const -{ - // XXX Oh, yeah. These are hard coded. - float scale; - GetCanonicalPixelScale(scale); - aWidth = 15.f * mPixelsToTwips * scale; - aHeight = 15.f * mPixelsToTwips * scale; - - return NS_OK; -} - /** --------------------------------------------------- * See documentation in nsIDeviceContext.h * @update 12/21/98 dwc diff --git a/mozilla/gfx/src/xprint/nsDeviceContextXP.h b/mozilla/gfx/src/xprint/nsDeviceContextXP.h index 8e39201181d..e05449a8089 100644 --- a/mozilla/gfx/src/xprint/nsDeviceContextXP.h +++ b/mozilla/gfx/src/xprint/nsDeviceContextXP.h @@ -74,8 +74,6 @@ public: NS_IMETHOD CreateRenderingContextInstance(nsIRenderingContext *&aContext); NS_IMETHOD SupportsNativeWidgets(PRBool &aSupportsWidgets); - NS_IMETHOD GetScrollBarDimensions(float &aWidth, float &aHeight) const; - NS_IMETHOD CheckFontExistence(const nsString& aFontName); NS_IMETHOD GetDeviceSurfaceDimensions(PRInt32 &aWidth, PRInt32 &aHeight); diff --git a/mozilla/widget/src/mac/nsDeviceContextMac.cpp b/mozilla/widget/src/mac/nsDeviceContextMac.cpp index 130c0354c72..d244b9bf5ef 100644 --- a/mozilla/widget/src/mac/nsDeviceContextMac.cpp +++ b/mozilla/widget/src/mac/nsDeviceContextMac.cpp @@ -189,21 +189,6 @@ NS_IMETHODIMP nsDeviceContextMac :: SupportsNativeWidgets(PRBool &aSupportsWidge } -/** --------------------------------------------------- - * See documentation in nsIDeviceContext.h - * @update 12/9/98 dwc - */ -NS_IMETHODIMP nsDeviceContextMac :: GetScrollBarDimensions(float &aWidth, float &aHeight) const -{ - // XXX Should we push this to widget library - float scale; - GetCanonicalPixelScale(scale); - aWidth = 16 * mDevUnitsToAppUnits * scale; - aHeight = 16 * mDevUnitsToAppUnits * scale; - return NS_OK; -} - - /** --------------------------------------------------- * See documentation in nsIDeviceContext.h * @update 12/9/98 dwc diff --git a/mozilla/widget/src/mac/nsDeviceContextMac.h b/mozilla/widget/src/mac/nsDeviceContextMac.h index 0047fa8205a..6fe8a6a1321 100644 --- a/mozilla/widget/src/mac/nsDeviceContextMac.h +++ b/mozilla/widget/src/mac/nsDeviceContextMac.h @@ -64,7 +64,6 @@ public: NS_IMETHOD CreateRenderingContext(nsIRenderingContext *&aContext); NS_IMETHOD SupportsNativeWidgets(PRBool &aSupportsWidgets); - NS_IMETHOD GetScrollBarDimensions(float &aWidth, float &aHeight) const; NS_IMETHOD GetSystemFont(nsSystemFontID anID, nsFont *aFont) const; NS_IMETHOD CheckFontExistence(const nsString& aFontName);