Change to nsIFrame API

This commit is contained in:
troy
1998-05-12 04:17:56 +00:00
parent e7921b5065
commit a4f9d76cd7
81 changed files with 937 additions and 891 deletions
+30 -30
View File
@@ -273,8 +273,8 @@ PRBool nsTableRowFrame::ReflowMappedChildren(nsIPresContext* aPresContext,
nsSize kidAvailSize(aState.availSize);
if (0>=kidAvailSize.height)
kidAvailSize.height = 1; // XXX: HaCk - we don't handle negative heights yet
nsReflowMetrics desiredSize;
nsIFrame::ReflowStatus status;
nsReflowMetrics desiredSize;
nsReflowStatus status;
// Get top margin for this kid
nsIStyleContext* kidSC;
@@ -322,12 +322,12 @@ PRBool nsTableRowFrame::ReflowMappedChildren(nsIPresContext* aPresContext,
{
if (nsnull!=pKidMaxElementSize)
printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n",
status==frComplete?"complete":"NOT complete",
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
desiredSize.width, desiredSize.height,
pKidMaxElementSize->width, pKidMaxElementSize->height);
else
printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n",
status==frComplete?"complete":"NOT complete",
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
desiredSize.width, desiredSize.height);
}
}
@@ -372,7 +372,7 @@ PRBool nsTableRowFrame::ReflowMappedChildren(nsIPresContext* aPresContext,
prevKidFrame = kidFrame;
// Update mLastContentIsComplete now that this kid fits
mLastContentIsComplete = PRBool(status == frComplete);
mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status);
/* Rows should not create continuing frames for cells
* unless they absolutely have to!
@@ -380,7 +380,7 @@ PRBool nsTableRowFrame::ReflowMappedChildren(nsIPresContext* aPresContext,
* otherwise PushChildren and bail.
*/
// Special handling for incomplete children
if (frNotComplete == status) {
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
// XXX It's good to assume that we might still have room
// even if the child didn't complete (floaters will want this)
nsIFrame* kidNextInFlow;
@@ -530,7 +530,7 @@ PRBool nsTableRowFrame::PullUpChildren(nsIPresContext* aPresContext,
while (nsnull != nextInFlow) {
nsReflowMetrics desiredSize;
ReflowStatus status;
nsReflowStatus status;
// Get the next child
nsIFrame* kidFrame = nextInFlow->mFirstChild;
@@ -586,12 +586,12 @@ PRBool nsTableRowFrame::PullUpChildren(nsIPresContext* aPresContext,
{
if (nsnull!=pKidMaxElementSize)
printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n",
status==frComplete?"complete":"NOT complete",
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
desiredSize.width, desiredSize.height,
pKidMaxElementSize->width, pKidMaxElementSize->height);
else
printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n",
status==frComplete?"complete":"NOT complete",
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
desiredSize.width, desiredSize.height);
}
}
@@ -646,8 +646,8 @@ PRBool nsTableRowFrame::PullUpChildren(nsIPresContext* aPresContext,
prevLastContentIsComplete = mLastContentIsComplete;
// Is the child we just pulled up complete?
mLastContentIsComplete = PRBool(status == frComplete);
if (frNotComplete == status) {
mLastContentIsComplete = NS_FRAME_IS_COMPLETE(status);
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
// No the child isn't complete
nsIFrame* kidNextInFlow;
@@ -746,10 +746,10 @@ PRBool nsTableRowFrame::PullUpChildren(nsIPresContext* aPresContext,
*
* @param aPresContext presentation context to use
* @param aState current inline state
* @return frComplete if all content has been mapped and frNotComplete
* @return NS_FRAME_COMPLETE if all content has been mapped and NS_FRAME_NOT_COMPLETE
* if we should be continued
*/
nsIFrame::ReflowStatus
nsReflowStatus
nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext,
RowReflowState& aState,
nsSize* aMaxElementSize)
@@ -758,7 +758,7 @@ nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext,
VerifyLastIsComplete();
#endif
nsIFrame* kidPrevInFlow = nsnull;
ReflowStatus result = frNotComplete;
nsReflowStatus result = 0; // not complete
// If we have no children and we have a prev-in-flow then we need to pick
// up where it left off. If we have children, e.g. we're being resized, then
@@ -789,13 +789,13 @@ nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext,
// Get the next content object
nsIContent* cell = mContent->ChildAt(kidIndex);
if (nsnull == cell) {
result = frComplete;
result = NS_FRAME_COMPLETE;
break;
}
// Make sure we still have room left
if (aState.availSize.height <= 0) {
// Note: return status was set to frNotComplete above...
// Note: return status was set to NS_FRAME_NOT_COMPLETE above...
NS_RELEASE(cell); // cell: REFCNT--(a)
break;
}
@@ -826,7 +826,7 @@ nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext,
// Try to reflow the child into the available space. It might not
// fit or might need continuing.
nsReflowMetrics desiredSize;
ReflowStatus status;
nsReflowStatus status;
if (NS_UNCONSTRAINEDSIZE == aState.availSize.width)
{
// Reflow the child into the available space
@@ -854,12 +854,12 @@ nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext,
{
if (nsnull!=pKidMaxElementSize)
printf("reflow of cell returned result = %s with desired=%d,%d, min = %d,%d\n",
status==frComplete?"complete":"NOT complete",
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
desiredSize.width, desiredSize.height,
pKidMaxElementSize->width, pKidMaxElementSize->height);
else
printf("reflow of cell returned result = %s with desired=%d,%d, min = nsnull\n",
status==frComplete?"complete":"NOT complete",
NS_FRAME_IS_COMPLETE(status)?"complete":"NOT complete",
desiredSize.width, desiredSize.height);
}
}
@@ -900,7 +900,7 @@ nsTableRowFrame::ReflowUnmappedChildren( nsIPresContext* aPresContext,
kidIndex++;
// Did the child complete?
if (frNotComplete == status) {
if (NS_FRAME_IS_NOT_COMPLETE(status)) {
// If the child isn't complete then it means that we've used up
// all of our available space
mLastContentIsComplete = PR_FALSE;
@@ -934,7 +934,7 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext,
nsReflowMetrics& aDesiredSize,
const nsSize& aMaxSize,
nsSize* aMaxElementSize,
ReflowStatus& aStatus)
nsReflowStatus& aStatus)
{
if (gsDebug1==PR_TRUE)
printf("nsTableRowFrame::ResizeReflow - aMaxSize = %d, %d\n",
@@ -954,7 +954,7 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext,
PRBool reflowMappedOK = PR_TRUE;
aStatus = frComplete;
aStatus = NS_FRAME_COMPLETE;
// Check for an overflow list
MoveOverflowToChildList();
@@ -966,7 +966,7 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext,
if (nsnull != mFirstChild) {
reflowMappedOK = ReflowMappedChildren(aPresContext, state, aMaxElementSize);
if (PR_FALSE == reflowMappedOK) {
aStatus = frNotComplete;
aStatus = NS_FRAME_NOT_COMPLETE;
}
}
@@ -976,7 +976,7 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext,
if (state.availSize.height <= 0) {
// No space left. Don't try to pull-up children or reflow unmapped
if (NextChildOffset() < mContent->ChildCount()) {
aStatus = frNotComplete;
aStatus = NS_FRAME_NOT_COMPLETE;
}
} else if (NextChildOffset() < mContent->ChildCount()) {
// Try and pull-up some children from a next-in-flow
@@ -988,12 +988,12 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext,
} else {
// We were unable to pull-up all the existing frames from the
// next in flow
aStatus = frNotComplete;
aStatus = NS_FRAME_NOT_COMPLETE;
}
}
}
if (frComplete == aStatus) {
if (NS_FRAME_IS_COMPLETE(aStatus)) {
// Don't forget to add in the bottom margin from our last child.
// Only add it in if there's room for it.
nscoord margin = state.prevMaxPosBottomMargin -
@@ -1012,12 +1012,12 @@ nsTableRowFrame::ResizeReflow(nsIPresContext* aPresContext,
{
if (nsnull!=aMaxElementSize)
printf("nsTableRowFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=%d,%d\n",
aStatus==frComplete?"Complete":"Not Complete",
NS_FRAME_IS_COMPLETE(aStatus)?"Complete":"Not Complete",
aDesiredSize.width, aDesiredSize.height,
aMaxElementSize->width, aMaxElementSize->height);
else
printf("nsTableRowFrame::RR returning: %s with aDesiredSize=%d,%d, aMES=NSNULL\n",
aStatus==frComplete?"Complete":"Not Complete",
NS_FRAME_IS_COMPLETE(aStatus)?"Complete":"Not Complete",
aDesiredSize.width, aDesiredSize.height);
}
@@ -1030,10 +1030,10 @@ nsTableRowFrame::IncrementalReflow(nsIPresContext* aPresContext,
nsReflowMetrics& aDesiredSize,
const nsSize& aMaxSize,
nsReflowCommand& aReflowCommand,
ReflowStatus& aStatus)
nsReflowStatus& aStatus)
{
if (gsDebug1==PR_TRUE) printf("nsTableRowFrame::IncrementalReflow\n");
aStatus = frComplete;
aStatus = NS_FRAME_COMPLETE;
return NS_OK;
}