From f31bb184d73eac194c1a69944ea6e010ffa05bfa Mon Sep 17 00:00:00 2001 From: "tor%cs.brown.edu" Date: Sat, 29 May 2004 01:44:08 +0000 Subject: [PATCH] Bug 244895 - remove dead gfx methods. r+sr=roc --- gfx/public/nsIRenderingContext.h | 19 +------ gfx/src/beos/nsRenderingContextBeOS.cpp | 21 ------- gfx/src/beos/nsRenderingContextBeOS.h | 1 - gfx/src/gtk/nsRenderingContextGTK.cpp | 25 --------- gfx/src/gtk/nsRenderingContextGTK.h | 1 - gfx/src/mac/nsRenderingContextMac.cpp | 23 -------- gfx/src/mac/nsRenderingContextMac.h | 1 - gfx/src/nsRenderingContextImpl.h | 12 ---- gfx/src/os2/nsRenderingContextOS2.cpp | 30 ---------- gfx/src/os2/nsRenderingContextOS2.h | 3 - gfx/src/photon/nsRenderingContextPh.cpp | 18 ------ gfx/src/photon/nsRenderingContextPh.h | 1 - gfx/src/windows/nsRenderingContextWin.cpp | 67 ----------------------- gfx/src/windows/nsRenderingContextWin.h | 7 --- gfx/src/xlib/nsRenderingContextXlib.cpp | 31 ----------- gfx/src/xlib/nsRenderingContextXlib.h | 1 - 16 files changed, 1 insertion(+), 260 deletions(-) diff --git a/gfx/public/nsIRenderingContext.h b/gfx/public/nsIRenderingContext.h index 4e138dbe2d8d..f42f271d529a 100644 --- a/gfx/public/nsIRenderingContext.h +++ b/gfx/public/nsIRenderingContext.h @@ -95,7 +95,7 @@ typedef enum // IID for the nsIRenderingContext interface #define NS_IRENDERING_CONTEXT_IID \ - { 0x79be0166, 0x4491, 0x48e8,{0xb9, 0xe2, 0xce, 0xfb, 0xa1, 0xb1, 0x71, 0x99}} + { 0x0974d74c, 0x9000, 0x47ca,{0x86, 0xdb, 0x35, 0xb9, 0x05, 0xde, 0xa3, 0x5d}} //---------------------------------------------------------------------- @@ -349,16 +349,6 @@ public: */ NS_IMETHOD DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1) = 0; - - /** - * Draw a line without being transformed - * @param aXO starting horiztonal coord in twips - * @param aY0 starting vertical coord in twips - * @param aX1 end horiztonal coord in twips - * @param aY1 end vertical coord in twips - */ - NS_IMETHOD DrawStdLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1) = 0; - /** * Draw a polyline * @param aPoints array of endpoints @@ -436,13 +426,6 @@ public: */ NS_IMETHOD FillPolygon(const nsPoint aPoints[], PRInt32 aNumPoints) = 0; - /** - * Fill a poly in the current foreground color, without transformation taking place - * @param aPoints points to use for the drawing, last must equal first - * @param aNumPonts number of points in the polygon - */ - NS_IMETHOD FillStdPolygon(const nsPoint aPoints[], PRInt32 aNumPoints) = 0; - /** * Draw an ellipse in the current foreground color * @param aRect The rectangle define bounds of ellipse to draw diff --git a/gfx/src/beos/nsRenderingContextBeOS.cpp b/gfx/src/beos/nsRenderingContextBeOS.cpp index 3687eeab84c3..bed2611d77c0 100644 --- a/gfx/src/beos/nsRenderingContextBeOS.cpp +++ b/gfx/src/beos/nsRenderingContextBeOS.cpp @@ -512,27 +512,6 @@ NS_IMETHODIMP nsRenderingContextBeOS::DrawLine(nscoord aX0, nscoord aY0, nscoord return NS_OK; } -NS_IMETHODIMP nsRenderingContextBeOS::DrawStdLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1) { - if (mTranMatrix == nsnull) return NS_ERROR_FAILURE; - if (mSurface == nsnull) return NS_ERROR_FAILURE; - - nscoord diffX = aX1 - aX0; - nscoord diffY = aY1 - aY0; - - if (0 != diffX) { - diffX = (diffX > 0) ? 1 : -1; - } - if (0 != diffY) { - diffY = (diffY > 0) ? 1 : -1; - } - - if (LockAndUpdateView()) { - mView->StrokeLine(BPoint(aX0, aY0), BPoint(aX1 - diffX, aY1 - diffY)); - mView->UnlockLooper(); - } - return NS_OK; -} - NS_IMETHODIMP nsRenderingContextBeOS::DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints) { if (mTranMatrix == nsnull) return NS_ERROR_FAILURE; if (mSurface == nsnull) return NS_ERROR_FAILURE; diff --git a/gfx/src/beos/nsRenderingContextBeOS.h b/gfx/src/beos/nsRenderingContextBeOS.h index 4e5a0ebe0c49..2e65b36f4dfa 100644 --- a/gfx/src/beos/nsRenderingContextBeOS.h +++ b/gfx/src/beos/nsRenderingContextBeOS.h @@ -108,7 +108,6 @@ public: NS_IMETHOD DestroyDrawingSurface(nsDrawingSurface aDS); NS_IMETHOD DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1); - NS_IMETHOD DrawStdLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1); NS_IMETHOD DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints); NS_IMETHOD DrawRect(const nsRect &aRect); diff --git a/gfx/src/gtk/nsRenderingContextGTK.cpp b/gfx/src/gtk/nsRenderingContextGTK.cpp index 0706749cc17e..26dbd411f964 100644 --- a/gfx/src/gtk/nsRenderingContextGTK.cpp +++ b/gfx/src/gtk/nsRenderingContextGTK.cpp @@ -863,31 +863,6 @@ NS_IMETHODIMP nsRenderingContextGTK::DrawLine(nscoord aX0, nscoord aY0, nscoord return NS_OK; } -NS_IMETHODIMP nsRenderingContextGTK::DrawStdLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1) -{ - nscoord diffX,diffY; - - g_return_val_if_fail(mTranMatrix != NULL, NS_ERROR_FAILURE); - g_return_val_if_fail(mSurface != NULL, NS_ERROR_FAILURE); - - diffX = aX1 - aX0; - diffY = aY1 - aY0; - - if (0!=diffX) { - diffX = (diffX>0?1:-1); - } - if (0!=diffY) { - diffY = (diffY>0?1:-1); - } - - UpdateGC(); - - ::gdk_draw_line(mSurface->GetDrawable(),mGC,aX0, aY0, aX1-diffX, aY1-diffY); - - return NS_OK; -} - - NS_IMETHODIMP nsRenderingContextGTK::DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints) { PRInt32 i; diff --git a/gfx/src/gtk/nsRenderingContextGTK.h b/gfx/src/gtk/nsRenderingContextGTK.h index d092249bb1cd..463ef21bcf48 100644 --- a/gfx/src/gtk/nsRenderingContextGTK.h +++ b/gfx/src/gtk/nsRenderingContextGTK.h @@ -116,7 +116,6 @@ public: NS_IMETHOD DestroyDrawingSurface(nsDrawingSurface aDS); NS_IMETHOD DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1); - NS_IMETHOD DrawStdLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1); NS_IMETHOD DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints); NS_IMETHOD DrawRect(const nsRect& aRect); diff --git a/gfx/src/mac/nsRenderingContextMac.cpp b/gfx/src/mac/nsRenderingContextMac.cpp index 7ae3ed98a339..dc6e604d33fb 100644 --- a/gfx/src/mac/nsRenderingContextMac.cpp +++ b/gfx/src/mac/nsRenderingContextMac.cpp @@ -870,29 +870,6 @@ NS_IMETHODIMP nsRenderingContextMac::DrawLine(nscoord aX0, nscoord aY0, nscoord } -//------------------------------------------------------------------------ - -NS_IMETHODIMP nsRenderingContextMac::DrawStdLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1) -{ - SetupPortState(); - - // make the line one pixel shorter to match other platforms - nscoord diffX = aX1 - aX0; - if (diffX) - diffX -= (diffX > 0 ? 1 : -1); - - nscoord diffY = aY1 - aY0; - if (diffY) - diffY -= (diffY > 0 ? 1 : -1); - - // draw line - ::MoveTo(aX0, aY0); - ::Line(diffX, diffY); - - return NS_OK; -} - - //------------------------------------------------------------------------ NS_IMETHODIMP nsRenderingContextMac::DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints) diff --git a/gfx/src/mac/nsRenderingContextMac.h b/gfx/src/mac/nsRenderingContextMac.h index 842a8252940c..1da5ec8d1ebb 100644 --- a/gfx/src/mac/nsRenderingContextMac.h +++ b/gfx/src/mac/nsRenderingContextMac.h @@ -102,7 +102,6 @@ public: NS_IMETHOD CreateDrawingSurface(const nsRect& aBounds, PRUint32 aSurfFlags, nsDrawingSurface &aSurface); NS_IMETHOD DestroyDrawingSurface(nsDrawingSurface aDS); NS_IMETHOD DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1); - NS_IMETHOD DrawStdLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1); NS_IMETHOD DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints); NS_IMETHOD DrawRect(const nsRect& aRect); NS_IMETHOD DrawRect(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight); diff --git a/gfx/src/nsRenderingContextImpl.h b/gfx/src/nsRenderingContextImpl.h index 8663382074c8..a30c66043720 100644 --- a/gfx/src/nsRenderingContextImpl.h +++ b/gfx/src/nsRenderingContextImpl.h @@ -90,18 +90,6 @@ public: */ NS_IMETHOD SetPenMode(nsPenMode aPenMode) { return NS_ERROR_FAILURE;}; - /** --------------------------------------------------- - * See documentation in nsIRenderingContext.h - * @update 05/01/00 dwc - */ - NS_IMETHOD DrawStdLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1) { return NS_OK;} - - /** --------------------------------------------------- - * See documentation in nsIRenderingContext.h - * @update 05/01/00 dwc - */ - NS_IMETHOD FillStdPolygon(const nsPoint aPoints[], PRInt32 aNumPoints) { return NS_OK; } - NS_IMETHOD GetBackbuffer(const nsRect &aRequestedSize, const nsRect &aMaxSize, nsDrawingSurface &aBackbuffer); NS_IMETHOD ReleaseBackbuffer(void); NS_IMETHOD DestroyCachedBackbuffer(void); diff --git a/gfx/src/os2/nsRenderingContextOS2.cpp b/gfx/src/os2/nsRenderingContextOS2.cpp index aaccd2826505..4fa47df63579 100644 --- a/gfx/src/os2/nsRenderingContextOS2.cpp +++ b/gfx/src/os2/nsRenderingContextOS2.cpp @@ -917,30 +917,6 @@ NS_IMETHODIMP nsRenderingContextOS2::DrawLine( nscoord aX0, nscoord aY0, nscoord return NS_OK; } -NS_IMETHODIMP nsRenderingContextOS2::DrawStdLine( nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1) -{ - POINTL ptls[] = { { (long) aX0, (long) aY0 }, - { (long) aX1, (long) aY1 } }; - mSurface->NS2PM (ptls, 2); - - if (ptls[0].x > ptls[1].x) - ptls[0].x--; - else if (ptls[1].x > ptls[0].x) - ptls[1].x--; - - if (ptls[0].y < ptls[1].y) - ptls[0].y++; - else if (ptls[1].y < ptls[0].y) - ptls[1].y++; - - SetupLineColorAndStyle (); - - GFX (::GpiMove (mPS, ptls), FALSE); - GFX (::GpiLine (mPS, ptls + 1), GPI_ERROR); - - return NS_OK; -} - NS_IMETHODIMP nsRenderingContextOS2::DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints) { PMDrawPoly( aPoints, aNumPoints, PR_FALSE); @@ -959,12 +935,6 @@ NS_IMETHODIMP nsRenderingContextOS2::FillPolygon( const nsPoint aPoints[], PRInt return NS_OK; } -NS_IMETHODIMP nsRenderingContextOS2::FillStdPolygon( const nsPoint aPoints[], PRInt32 aNumPoints) -{ - PMDrawPoly( aPoints, aNumPoints, PR_TRUE, PR_FALSE ); - return NS_OK; -} - // bDoTransform defaults to PR_TRUE void nsRenderingContextOS2::PMDrawPoly( const nsPoint aPoints[], PRInt32 aNumPoints, PRBool bFilled, PRBool bDoTransform) { diff --git a/gfx/src/os2/nsRenderingContextOS2.h b/gfx/src/os2/nsRenderingContextOS2.h index 47a142cb9bdf..5858bd8ba91b 100644 --- a/gfx/src/os2/nsRenderingContextOS2.h +++ b/gfx/src/os2/nsRenderingContextOS2.h @@ -125,7 +125,6 @@ public: NS_IMETHOD DestroyDrawingSurface(nsDrawingSurface aDS); NS_IMETHOD DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1); - NS_IMETHOD DrawStdLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1); NS_IMETHOD DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints); NS_IMETHOD DrawRect(const nsRect& aRect); @@ -140,8 +139,6 @@ public: NS_IMETHOD DrawPolygon(const nsPoint aPoints[], PRInt32 aNumPoints); NS_IMETHOD FillPolygon(const nsPoint aPoints[], PRInt32 aNumPoints); - NS_IMETHOD FillStdPolygon(const nsPoint aPoints[], PRInt32 aNumPoints); - NS_IMETHOD DrawEllipse(const nsRect& aRect); NS_IMETHOD DrawEllipse(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight); NS_IMETHOD FillEllipse(const nsRect& aRect); diff --git a/gfx/src/photon/nsRenderingContextPh.cpp b/gfx/src/photon/nsRenderingContextPh.cpp index 1319a538869a..ae49d56e6e7d 100644 --- a/gfx/src/photon/nsRenderingContextPh.cpp +++ b/gfx/src/photon/nsRenderingContextPh.cpp @@ -471,24 +471,6 @@ NS_IMETHODIMP nsRenderingContextPh :: DrawLine( nscoord aX0, nscoord aY0, nscoor return NS_OK; } -NS_IMETHODIMP nsRenderingContextPh :: DrawStdLine( nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1 ) -{ - nscoord diffX, diffY; - - diffX = aX1 - aX0; - diffY = aY1 - aY0; - - if( diffX != 0 ) diffX = ( diffX > 0 ? 1 : -1 ); - if( diffY != 0 ) diffY = ( diffY > 0 ? 1 : -1 ); - - UpdateGC(); - PgSetStrokeColorCx( mGC, mCurrentColor ); - PgSetStrokeDashCx( mGC, sLineStyle[mCurrentLineStyle], sLineStyleLen[mCurrentLineStyle], 0x10000 ); - - PgDrawILineCx( mSurfaceDC, aX0, aY0, aX1-diffX, aY1-diffY ); - return NS_OK; -} - NS_IMETHODIMP nsRenderingContextPh :: DrawRect( nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight ) { nscoord x,y,w,h; diff --git a/gfx/src/photon/nsRenderingContextPh.h b/gfx/src/photon/nsRenderingContextPh.h index 865c323632aa..d398f76d4e94 100644 --- a/gfx/src/photon/nsRenderingContextPh.h +++ b/gfx/src/photon/nsRenderingContextPh.h @@ -213,7 +213,6 @@ public: } NS_IMETHOD DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1); - NS_IMETHOD DrawStdLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1); inline NS_IMETHODIMP DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints) { return DrawPolygon( aPoints, aNumPoints ); } diff --git a/gfx/src/windows/nsRenderingContextWin.cpp b/gfx/src/windows/nsRenderingContextWin.cpp index 169e75e582de..2d0c6cb44958 100644 --- a/gfx/src/windows/nsRenderingContextWin.cpp +++ b/gfx/src/windows/nsRenderingContextWin.cpp @@ -1074,39 +1074,6 @@ NS_IMETHODIMP nsRenderingContextWin :: DrawLine(nscoord aX0, nscoord aY0, nscoor return NS_OK; } - /** --------------------------------------------------- - * See documentation in nsIRenderingContextImpl.h - * @update 5/01/00 dwc - */ -NS_IMETHODIMP nsRenderingContextWin :: DrawStdLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1) -{ - - if (nsLineStyle_kNone == mCurrLineStyle) - return NS_OK; - - SetupPen(); - - if (nsLineStyle_kDotted == mCurrLineStyle) - { - lineddastruct dda_struct; - - dda_struct.nDottedPixel = 1; - dda_struct.dc = mDC; - dda_struct.crColor = mColor; - - LineDDA((int)(aX0),(int)(aY0),(int)(aX1),(int)(aY1),(LINEDDAPROC) LineDDAFunc,(long)&dda_struct); - } - else - { - ::MoveToEx(mDC, (int)(aX0), (int)(aY0), NULL); - ::LineTo(mDC, (int)(aX1), (int)(aY1)); - } - - return NS_OK; - -} - - NS_IMETHODIMP nsRenderingContextWin :: DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints) { @@ -1304,40 +1271,6 @@ NS_IMETHODIMP nsRenderingContextWin :: FillPolygon(const nsPoint aPoints[], PRIn } -NS_IMETHODIMP nsRenderingContextWin :: FillStdPolygon(const nsPoint aPoints[], PRInt32 aNumPoints) -{ - // First transform nsPoint's into POINT's; - POINT pts[20]; - POINT* pp0 = pts; - - if (aNumPoints > 20) - pp0 = new POINT[aNumPoints]; - - POINT* pp = pp0; - const nsPoint* np = &aPoints[0]; - - for (PRInt32 i = 0; i < aNumPoints; i++, pp++, np++){ - pp->x = np->x; - pp->y = np->y; - } - - // Fill the polygon - SetupSolidBrush(); - - if (NULL == mNullPen) - mNullPen = ::CreatePen(PS_NULL, 0, 0); - - HPEN oldPen = (HPEN)::SelectObject(mDC, mNullPen); - ::Polygon(mDC, pp0, int(aNumPoints)); - ::SelectObject(mDC, oldPen); - - // Release temporary storage if necessary - if (pp0 != pts) - delete [] pp0; - - return NS_OK; -} - NS_IMETHODIMP nsRenderingContextWin :: DrawEllipse(const nsRect& aRect) { return DrawEllipse(aRect.x, aRect.y, aRect.width, aRect.height); diff --git a/gfx/src/windows/nsRenderingContextWin.h b/gfx/src/windows/nsRenderingContextWin.h index 084aa7b89ab0..d3bd5d206b74 100644 --- a/gfx/src/windows/nsRenderingContextWin.h +++ b/gfx/src/windows/nsRenderingContextWin.h @@ -116,7 +116,6 @@ public: NS_IMETHOD DestroyDrawingSurface(nsDrawingSurface aDS); NS_IMETHOD DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1); - NS_IMETHOD DrawStdLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1); NS_IMETHOD DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints); NS_IMETHOD DrawRect(const nsRect& aRect); @@ -134,12 +133,6 @@ public: NS_IMETHOD SetPenMode(nsPenMode aPenMode); NS_IMETHOD GetPenMode(nsPenMode &aPenMode); - /** --------------------------------------------------- - * See documentation in nsIRenderingContext.h - * @update 05/01/00 dwc - */ - NS_IMETHOD FillStdPolygon(const nsPoint aPoints[], PRInt32 aNumPoints); - NS_IMETHOD DrawEllipse(const nsRect& aRect); NS_IMETHOD DrawEllipse(nscoord aX, nscoord aY, nscoord aWidth, nscoord aHeight); NS_IMETHOD FillEllipse(const nsRect& aRect); diff --git a/gfx/src/xlib/nsRenderingContextXlib.cpp b/gfx/src/xlib/nsRenderingContextXlib.cpp index 8ea55ffce41b..b5f105262831 100644 --- a/gfx/src/xlib/nsRenderingContextXlib.cpp +++ b/gfx/src/xlib/nsRenderingContextXlib.cpp @@ -828,37 +828,6 @@ nsRenderingContextXlib::DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord return NS_OK; } -NS_IMETHODIMP -nsRenderingContextXlib::DrawStdLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1) -{ - PR_LOG(RenderingContextXlibLM, PR_LOG_DEBUG, ("nsRenderingContextXlib::DrawStdLine()\n")); - - nscoord diffX, diffY; - - NS_ENSURE_TRUE(mTranMatrix != nsnull, NS_ERROR_FAILURE); - NS_ENSURE_TRUE(mSurface != nsnull, NS_ERROR_FAILURE); - - mTranMatrix->TransformCoord(&aX0,&aY0); - mTranMatrix->TransformCoord(&aX1,&aY1); - - diffX = aX1-aX0; - diffY = aY1-aY0; - - if (0!=diffX) { - diffX = (diffX>0?1:-1); - } - if (0!=diffY) { - diffY = (diffY>0?1:-1); - } - - UpdateGC(); - Drawable drawable; mSurface->GetDrawable(drawable); - ::XDrawLine(mDisplay, drawable, - *mGC, aX0, aY0, aX1 - diffX, aY1 - diffY); - - return NS_OK; -} - NS_IMETHODIMP nsRenderingContextXlib::DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints) { diff --git a/gfx/src/xlib/nsRenderingContextXlib.h b/gfx/src/xlib/nsRenderingContextXlib.h index b3407a588a41..e7ec73374b29 100644 --- a/gfx/src/xlib/nsRenderingContextXlib.h +++ b/gfx/src/xlib/nsRenderingContextXlib.h @@ -116,7 +116,6 @@ public: NS_IMETHOD DestroyDrawingSurface(nsDrawingSurface aDS); NS_IMETHOD DrawLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1); - NS_IMETHOD DrawStdLine(nscoord aX0, nscoord aY0, nscoord aX1, nscoord aY1); NS_IMETHOD DrawPolyline(const nsPoint aPoints[], PRInt32 aNumPoints); NS_IMETHOD DrawRect(const nsRect& aRect);