зеркало из https://github.com/mozilla/gecko-dev.git
Not part of build.
This commit is contained in:
Родитель
51125818ef
Коммит
3af1eab1be
|
@ -82,6 +82,7 @@ XUL_ATOM(cycler, "cycler")
|
|||
XUL_ATOM(primary, "primary")
|
||||
XUL_ATOM(mozoutlinerrow, ":-moz-outliner-row")
|
||||
XUL_ATOM(mozoutlinercell, ":-moz-outliner-cell")
|
||||
XUL_ATOM(mozoutlinercolumn, ":-moz-outliner-column")
|
||||
XUL_ATOM(mozoutlinercelltext, ":-moz-outliner-cell-text")
|
||||
XUL_ATOM(mozoutlinertwisty, ":-moz-outliner-twisty")
|
||||
XUL_ATOM(mozoutlinerindentation, ":-moz-outliner-indentation")
|
||||
|
|
|
@ -4,6 +4,10 @@ outlinerbody {
|
|||
-moz-user-select: none;
|
||||
}
|
||||
|
||||
:-moz-outliner-column
|
||||
{
|
||||
}
|
||||
|
||||
:-moz-outliner-row(selected)
|
||||
{
|
||||
background-color: blue;
|
||||
|
|
|
@ -52,6 +52,10 @@ interface nsIOutlinerView : nsISupports
|
|||
// to be matched on the ::moz-outliner-cell pseudoelement.
|
||||
void getCellProperties(in long row, in wstring colID, in nsISupportsArray properties);
|
||||
|
||||
// Called to get properties to paint a column background. For shading the sort
|
||||
// column, etc.
|
||||
void getColumnProperties(in wstring colID, in nsIDOMElement colElt, in nsISupportsArray properties);
|
||||
|
||||
// Methods that can be used to test whether or not a twisty should be drawn,
|
||||
// and if so, whether an open or closed twisty should be used.
|
||||
boolean isContainer(in long index);
|
||||
|
|
|
@ -567,6 +567,21 @@ NS_IMETHODIMP nsOutlinerBodyFrame::Paint(nsIPresContext* aPresContext,
|
|||
// Ensure our column info is built.
|
||||
EnsureColumns();
|
||||
|
||||
// Loop through our columns and paint them (e.g., for sorting). This is only
|
||||
// relevant when painting backgrounds, since columns contain no content. Content
|
||||
// is contained in the rows.
|
||||
if (NS_FRAME_PAINT_LAYER_BACKGROUND == aWhichLayer) {
|
||||
nscoord currX = mInnerBox.x;
|
||||
for (nsOutlinerColumn* currCol = mColumns; currCol; currCol = currCol->GetNext()) {
|
||||
nsRect colRect(currX, mInnerBox.y, currCol->GetWidth(), mInnerBox.height);
|
||||
nsRect dirtyRect;
|
||||
if (dirtyRect.IntersectRect(aDirtyRect, colRect)) {
|
||||
PaintColumn(currCol, colRect, aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
||||
}
|
||||
currX += currCol->GetWidth();
|
||||
}
|
||||
}
|
||||
|
||||
// Loop through our on-screen rows.
|
||||
for (PRInt32 i = mTopRowIndex; i < rowCount && i < mTopRowIndex+mPageCount+1; i++) {
|
||||
nsRect rowRect(mInnerBox.x, mInnerBox.y+mRowHeight*(i-mTopRowIndex), mInnerBox.width, mRowHeight);
|
||||
|
@ -580,6 +595,37 @@ NS_IMETHODIMP nsOutlinerBodyFrame::Paint(nsIPresContext* aPresContext,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsOutlinerBodyFrame::PaintColumn(nsOutlinerColumn* aColumn,
|
||||
const nsRect& aColRect,
|
||||
nsIPresContext* aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect,
|
||||
nsFramePaintLayer aWhichLayer)
|
||||
{
|
||||
// Now obtain the properties for our cell.
|
||||
// XXX Automatically fill in the following props: open, container, selected, focused, and the col ID.
|
||||
PrefillPropertyArray(-1, aColumn->GetID());
|
||||
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(aColumn->GetElement()));
|
||||
mView->GetColumnProperties(aColumn->GetID(), elt, mScratchArray);
|
||||
|
||||
// Resolve style for the column. It contains all the info we need to lay ourselves
|
||||
// out and to paint.
|
||||
nsCOMPtr<nsIStyleContext> colContext;
|
||||
GetPseudoStyleContext(aPresContext, nsXULAtoms::mozoutlinercolumn, getter_AddRefs(colContext));
|
||||
|
||||
// Obtain the margins for the cell and then deflate our rect by that
|
||||
// amount. The cell is assumed to be contained within the deflated rect.
|
||||
nsRect colRect(aColRect);
|
||||
const nsStyleMargin* colMarginData = (const nsStyleMargin*)colContext->GetStyleData(eStyleStruct_Margin);
|
||||
nsMargin colMargin;
|
||||
colMarginData->GetMargin(colMargin);
|
||||
colRect.Deflate(colMargin);
|
||||
|
||||
PaintBackgroundLayer(colContext, aPresContext, aRenderingContext, colRect, aDirtyRect);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsOutlinerBodyFrame::PaintRow(int aRowIndex, const nsRect& aRowRect,
|
||||
nsIPresContext* aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
|
|
|
@ -139,6 +139,8 @@ public:
|
|||
void SetNext(nsOutlinerColumn* aNext) { mNext = aNext; };
|
||||
nsOutlinerColumn* GetNext() { return mNext; };
|
||||
|
||||
nsIContent* GetElement() { return mColElement; };
|
||||
|
||||
nscoord GetWidth();
|
||||
const PRUnichar* GetID() { return mID.GetUnicode(); };
|
||||
};
|
||||
|
@ -172,6 +174,14 @@ public:
|
|||
const nsRect& aDirtyRect,
|
||||
nsFramePaintLayer aWhichLayer);
|
||||
|
||||
// This method paints a specific column background of the outliner.
|
||||
NS_IMETHOD PaintColumn(nsOutlinerColumn* aColumn,
|
||||
const nsRect& aCellRect,
|
||||
nsIPresContext* aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect,
|
||||
nsFramePaintLayer aWhichLayer);
|
||||
|
||||
// This method paints a single row in the outliner.
|
||||
NS_IMETHOD PaintRow(int aRowIndex, const nsRect& aRowRect,
|
||||
nsIPresContext* aPresContext,
|
||||
|
|
|
@ -52,6 +52,10 @@ interface nsIOutlinerView : nsISupports
|
|||
// to be matched on the ::moz-outliner-cell pseudoelement.
|
||||
void getCellProperties(in long row, in wstring colID, in nsISupportsArray properties);
|
||||
|
||||
// Called to get properties to paint a column background. For shading the sort
|
||||
// column, etc.
|
||||
void getColumnProperties(in wstring colID, in nsIDOMElement colElt, in nsISupportsArray properties);
|
||||
|
||||
// Methods that can be used to test whether or not a twisty should be drawn,
|
||||
// and if so, whether an open or closed twisty should be used.
|
||||
boolean isContainer(in long index);
|
||||
|
|
|
@ -567,6 +567,21 @@ NS_IMETHODIMP nsOutlinerBodyFrame::Paint(nsIPresContext* aPresContext,
|
|||
// Ensure our column info is built.
|
||||
EnsureColumns();
|
||||
|
||||
// Loop through our columns and paint them (e.g., for sorting). This is only
|
||||
// relevant when painting backgrounds, since columns contain no content. Content
|
||||
// is contained in the rows.
|
||||
if (NS_FRAME_PAINT_LAYER_BACKGROUND == aWhichLayer) {
|
||||
nscoord currX = mInnerBox.x;
|
||||
for (nsOutlinerColumn* currCol = mColumns; currCol; currCol = currCol->GetNext()) {
|
||||
nsRect colRect(currX, mInnerBox.y, currCol->GetWidth(), mInnerBox.height);
|
||||
nsRect dirtyRect;
|
||||
if (dirtyRect.IntersectRect(aDirtyRect, colRect)) {
|
||||
PaintColumn(currCol, colRect, aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);
|
||||
}
|
||||
currX += currCol->GetWidth();
|
||||
}
|
||||
}
|
||||
|
||||
// Loop through our on-screen rows.
|
||||
for (PRInt32 i = mTopRowIndex; i < rowCount && i < mTopRowIndex+mPageCount+1; i++) {
|
||||
nsRect rowRect(mInnerBox.x, mInnerBox.y+mRowHeight*(i-mTopRowIndex), mInnerBox.width, mRowHeight);
|
||||
|
@ -580,6 +595,37 @@ NS_IMETHODIMP nsOutlinerBodyFrame::Paint(nsIPresContext* aPresContext,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsOutlinerBodyFrame::PaintColumn(nsOutlinerColumn* aColumn,
|
||||
const nsRect& aColRect,
|
||||
nsIPresContext* aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect,
|
||||
nsFramePaintLayer aWhichLayer)
|
||||
{
|
||||
// Now obtain the properties for our cell.
|
||||
// XXX Automatically fill in the following props: open, container, selected, focused, and the col ID.
|
||||
PrefillPropertyArray(-1, aColumn->GetID());
|
||||
nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(aColumn->GetElement()));
|
||||
mView->GetColumnProperties(aColumn->GetID(), elt, mScratchArray);
|
||||
|
||||
// Resolve style for the column. It contains all the info we need to lay ourselves
|
||||
// out and to paint.
|
||||
nsCOMPtr<nsIStyleContext> colContext;
|
||||
GetPseudoStyleContext(aPresContext, nsXULAtoms::mozoutlinercolumn, getter_AddRefs(colContext));
|
||||
|
||||
// Obtain the margins for the cell and then deflate our rect by that
|
||||
// amount. The cell is assumed to be contained within the deflated rect.
|
||||
nsRect colRect(aColRect);
|
||||
const nsStyleMargin* colMarginData = (const nsStyleMargin*)colContext->GetStyleData(eStyleStruct_Margin);
|
||||
nsMargin colMargin;
|
||||
colMarginData->GetMargin(colMargin);
|
||||
colRect.Deflate(colMargin);
|
||||
|
||||
PaintBackgroundLayer(colContext, aPresContext, aRenderingContext, colRect, aDirtyRect);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsOutlinerBodyFrame::PaintRow(int aRowIndex, const nsRect& aRowRect,
|
||||
nsIPresContext* aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
|
|
|
@ -139,6 +139,8 @@ public:
|
|||
void SetNext(nsOutlinerColumn* aNext) { mNext = aNext; };
|
||||
nsOutlinerColumn* GetNext() { return mNext; };
|
||||
|
||||
nsIContent* GetElement() { return mColElement; };
|
||||
|
||||
nscoord GetWidth();
|
||||
const PRUnichar* GetID() { return mID.GetUnicode(); };
|
||||
};
|
||||
|
@ -172,6 +174,14 @@ public:
|
|||
const nsRect& aDirtyRect,
|
||||
nsFramePaintLayer aWhichLayer);
|
||||
|
||||
// This method paints a specific column background of the outliner.
|
||||
NS_IMETHOD PaintColumn(nsOutlinerColumn* aColumn,
|
||||
const nsRect& aCellRect,
|
||||
nsIPresContext* aPresContext,
|
||||
nsIRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect,
|
||||
nsFramePaintLayer aWhichLayer);
|
||||
|
||||
// This method paints a single row in the outliner.
|
||||
NS_IMETHOD PaintRow(int aRowIndex, const nsRect& aRowRect,
|
||||
nsIPresContext* aPresContext,
|
||||
|
|
|
@ -82,6 +82,7 @@ XUL_ATOM(cycler, "cycler")
|
|||
XUL_ATOM(primary, "primary")
|
||||
XUL_ATOM(mozoutlinerrow, ":-moz-outliner-row")
|
||||
XUL_ATOM(mozoutlinercell, ":-moz-outliner-cell")
|
||||
XUL_ATOM(mozoutlinercolumn, ":-moz-outliner-column")
|
||||
XUL_ATOM(mozoutlinercelltext, ":-moz-outliner-cell-text")
|
||||
XUL_ATOM(mozoutlinertwisty, ":-moz-outliner-twisty")
|
||||
XUL_ATOM(mozoutlinerindentation, ":-moz-outliner-indentation")
|
||||
|
|
Загрузка…
Ссылка в новой задаче