Fix for bug 177753. Tree painting methods don't have to be virtual

r=bryner, sr=jag
This commit is contained in:
varga%netscape.com 2002-11-06 06:38:14 +00:00
Родитель 17eaecb35b
Коммит 5ec8d3a41e
2 изменённых файлов: 141 добавлений и 128 удалений

Просмотреть файл

@ -2051,11 +2051,12 @@ nsLineStyle nsTreeBodyFrame::ConvertBorderStyleToLineStyle(PRUint8 aBorderStyle)
}
// Painting routines
NS_IMETHODIMP nsTreeBodyFrame::Paint(nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer,
PRUint32 aFlags)
NS_IMETHODIMP
nsTreeBodyFrame::Paint(nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer,
PRUint32 aFlags)
{
// XXX This trap handles an odd bogus 1 pixel invalidation that we keep getting
// when scrolling.
@ -2145,12 +2146,13 @@ NS_IMETHODIMP nsTreeBodyFrame::Paint(nsIPresContext* aPresContext,
return NS_OK;
}
NS_IMETHODIMP nsTreeBodyFrame::PaintColumn(nsTreeColumn* aColumn,
const nsRect& aColumnRect,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer)
nsresult
nsTreeBodyFrame::PaintColumn(nsTreeColumn* aColumn,
const nsRect& aColumnRect,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer)
{
if (aColumnRect.width == 0)
return NS_OK; // Don't paint hidden columns.
@ -2188,12 +2190,14 @@ NS_IMETHODIMP nsTreeBodyFrame::PaintColumn(nsTreeColumn* aColumn,
return NS_OK;
}
NS_IMETHODIMP nsTreeBodyFrame::PaintRow(PRInt32 aRowIndex,
const nsRect& aRowRect,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer)
nsresult
nsTreeBodyFrame::PaintRow(PRInt32 aRowIndex,
const nsRect& aRowRect,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer)
{
// We have been given a rect for our row. We treat this row like a full-blown
// frame, meaning that it can have borders, margins, padding, and a background.
@ -2314,13 +2318,14 @@ NS_IMETHODIMP nsTreeBodyFrame::PaintRow(PRInt32 aRowIndex,
return NS_OK;
}
NS_IMETHODIMP nsTreeBodyFrame::PaintCell(PRInt32 aRowIndex,
nsTreeColumn* aColumn,
const nsRect& aCellRect,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer)
nsresult
nsTreeBodyFrame::PaintCell(PRInt32 aRowIndex,
nsTreeColumn* aColumn,
const nsRect& aCellRect,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer)
{
if (aCellRect.width == 0)
return NS_OK; // Don't paint cells in hidden columns.
@ -2499,7 +2504,7 @@ NS_IMETHODIMP nsTreeBodyFrame::PaintCell(PRInt32 aRowIndex,
return NS_OK;
}
NS_IMETHODIMP
nsresult
nsTreeBodyFrame::PaintTwisty(PRInt32 aRowIndex,
nsTreeColumn* aColumn,
const nsRect& aTwistyRect,
@ -2618,7 +2623,7 @@ nsTreeBodyFrame::PaintTwisty(PRInt32 aRowIndex,
return NS_OK;
}
NS_IMETHODIMP
nsresult
nsTreeBodyFrame::PaintImage(PRInt32 aRowIndex,
nsTreeColumn* aColumn,
const nsRect& aImageRect,
@ -2701,13 +2706,14 @@ nsTreeBodyFrame::PaintImage(PRInt32 aRowIndex,
return NS_OK;
}
NS_IMETHODIMP nsTreeBodyFrame::PaintText(PRInt32 aRowIndex,
nsTreeColumn* aColumn,
const nsRect& aTextRect,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer)
nsresult
nsTreeBodyFrame::PaintText(PRInt32 aRowIndex,
nsTreeColumn* aColumn,
const nsRect& aTextRect,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer)
{
// Now obtain the text for our cell.
nsAutoString text;
@ -2918,24 +2924,26 @@ NS_IMETHODIMP nsTreeBodyFrame::PaintText(PRInt32 aRowIndex,
return NS_OK;
}
NS_IMETHODIMP nsTreeBodyFrame::PaintCheckbox(PRInt32 aRowIndex,
nsTreeColumn* aColumn,
const nsRect& aCheckboxRect,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer)
nsresult
nsTreeBodyFrame::PaintCheckbox(PRInt32 aRowIndex,
nsTreeColumn* aColumn,
const nsRect& aCheckboxRect,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer)
{
return NS_OK;
}
NS_IMETHODIMP nsTreeBodyFrame::PaintProgressMeter(PRInt32 aRowIndex,
nsTreeColumn* aColumn,
const nsRect& aProgressMeterRect,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer)
nsresult
nsTreeBodyFrame::PaintProgressMeter(PRInt32 aRowIndex,
nsTreeColumn* aColumn,
const nsRect& aProgressMeterRect,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer)
{
// Resolve style for the progress meter. It contains all the info we need
@ -3004,10 +3012,11 @@ NS_IMETHODIMP nsTreeBodyFrame::PaintProgressMeter(PRInt32 aRowIndex
}
NS_IMETHODIMP nsTreeBodyFrame::PaintDropFeedback(nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer)
nsresult
nsTreeBodyFrame::PaintDropFeedback(nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer)
{
if (NS_FRAME_PAINT_LAYER_BACKGROUND == aWhichLayer) {
if (mDropOrient == nsITreeView::inDropBefore ||
@ -3120,10 +3129,12 @@ NS_IMETHODIMP nsTreeBodyFrame::PaintDropFeedback(nsIPresContext* aPresConte
return NS_OK;
}
NS_IMETHODIMP
nsTreeBodyFrame::PaintBackgroundLayer(nsIStyleContext* aStyleContext, nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aRect, const nsRect& aDirtyRect)
nsresult
nsTreeBodyFrame::PaintBackgroundLayer(nsIStyleContext* aStyleContext,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aRect,
const nsRect& aDirtyRect)
{
const nsStyleBackground* myColor = (const nsStyleBackground*)

Просмотреть файл

@ -272,90 +272,92 @@ public:
PRUint32 aFlags = 0);
// This method paints a specific column background of the tree.
NS_IMETHOD PaintColumn(nsTreeColumn* aColumn,
const nsRect& aColumnRect,
nsresult PaintColumn(nsTreeColumn* aColumn,
const nsRect& aColumnRect,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer);
// This method paints a single row in the tree.
nsresult PaintRow(PRInt32 aRowIndex,
const nsRect& aRowRect,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer);
// This method paints a specific cell in a given row of the tree.
nsresult PaintCell(PRInt32 aRowIndex,
nsTreeColumn* aColumn,
const nsRect& aCellRect,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer);
// This method paints the twisty inside a cell in the primary column of an tree.
nsresult PaintTwisty(PRInt32 aRowIndex,
nsTreeColumn* aColumn,
const nsRect& aTwistyRect,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer,
nscoord& aRemainingWidth,
nscoord& aCurrX);
// This method paints the image inside the cell of an tree.
nsresult PaintImage(PRInt32 aRowIndex,
nsTreeColumn* aColumn,
const nsRect& aImageRect,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer,
nscoord& aRemainingWidth,
nscoord& aCurrX);
// This method paints the text string inside a particular cell of the tree.
nsresult PaintText(PRInt32 aRowIndex,
nsTreeColumn* aColumn,
const nsRect& aTextRect,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer);
// This method paints the checkbox inside a particular cell of the tree.
nsresult PaintCheckbox(PRInt32 aRowIndex,
nsTreeColumn* aColumn,
const nsRect& aCheckboxRect,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer);
// This method paints a single row in the tree.
NS_IMETHOD PaintRow(PRInt32 aRowIndex,
const nsRect& aRowRect,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer);
// This method paints a specific cell in a given row of the tree.
NS_IMETHOD PaintCell(PRInt32 aRowIndex,
nsTreeColumn* aColumn,
const nsRect& aCellRect,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer);
// This method paints the twisty inside a cell in the primary column of an tree.
NS_IMETHOD PaintTwisty(PRInt32 aRowIndex,
nsTreeColumn* aColumn,
const nsRect& aTwistyRect,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer,
nscoord& aRemainingWidth,
nscoord& aCurrX);
// This method paints the image inside the cell of an tree.
NS_IMETHOD PaintImage(PRInt32 aRowIndex,
nsTreeColumn* aColumn,
const nsRect& aImageRect,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer,
nscoord& aRemainingWidth,
nscoord& aCurrX);
// This method paints the text string inside a particular cell of the tree.
NS_IMETHOD PaintText(PRInt32 aRowIndex,
nsTreeColumn* aColumn,
const nsRect& aTextRect,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer);
// This method paints the checkbox inside a particular cell of the tree.
NS_IMETHOD PaintCheckbox(PRInt32 aRowIndex,
nsTreeColumn* aColumn,
const nsRect& aCheckboxRect,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer);
// This method paints the progress meter inside a particular cell of the tree.
NS_IMETHOD PaintProgressMeter(PRInt32 aRowIndex,
nsTreeColumn* aColumn,
const nsRect& aProgressMeterRect,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer);
nsresult PaintProgressMeter(PRInt32 aRowIndex,
nsTreeColumn* aColumn,
const nsRect& aProgressMeterRect,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer);
// This method paints a drop feedback of the tree.
NS_IMETHOD PaintDropFeedback(nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer);
nsresult PaintDropFeedback(nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer);
// This method is called with a specific style context and rect to
// paint the background rect as if it were a full-blown frame.
NS_IMETHOD PaintBackgroundLayer(nsIStyleContext* aStyleContext, nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aRect, const nsRect& aDirtyRect);
nsresult PaintBackgroundLayer(nsIStyleContext* aStyleContext,
nsIPresContext* aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aRect,
const nsRect& aDirtyRect);
// This method is called whenever an treecol is added or removed and
// the column cache needs to be rebuilt.