Changed GetFrameState() and GetFrameType() to use pointer arguments instead of

references


git-svn-id: svn://10.0.0.236/trunk@20215 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
troy%netscape.com
1999-02-10 04:17:06 +00:00
parent 2be995a545
commit dbedf1803d
20 changed files with 44 additions and 40 deletions

View File

@@ -75,7 +75,7 @@ nsEventStateManager::PreHandleEvent(nsIPresContext& aPresContext,
mCurrentTarget = aTargetFrame;
nsFrameState state;
mCurrentTarget->GetFrameState(state);
mCurrentTarget->GetFrameState(&state);
state |= NS_FRAME_EXTERNAL_REFERENCE;
mCurrentTarget->SetFrameState(state);
@@ -109,7 +109,7 @@ nsEventStateManager::PostHandleEvent(nsIPresContext& aPresContext,
nsresult ret = NS_OK;
nsFrameState state;
mCurrentTarget->GetFrameState(state);
mCurrentTarget->GetFrameState(&state);
state |= NS_FRAME_EXTERNAL_REFERENCE;
mCurrentTarget->SetFrameState(state);

View File

@@ -395,7 +395,7 @@ public:
* filled in with the state bits. The return value has no
* meaning.
*/
NS_IMETHOD GetFrameState(nsFrameState& aResult) = 0;
NS_IMETHOD GetFrameState(nsFrameState* aResult) = 0;
/**
* Set the current frame-state value for this frame. The return
@@ -484,7 +484,7 @@ public:
*
* @see nsLayoutAtoms
*/
NS_IMETHOD GetFrameType(nsIAtom*& aType) const = 0;
NS_IMETHOD GetFrameType(nsIAtom** aType) const = 0;
/**
* Is this frame a "containing block"?

View File

@@ -75,7 +75,7 @@ nsEventStateManager::PreHandleEvent(nsIPresContext& aPresContext,
mCurrentTarget = aTargetFrame;
nsFrameState state;
mCurrentTarget->GetFrameState(state);
mCurrentTarget->GetFrameState(&state);
state |= NS_FRAME_EXTERNAL_REFERENCE;
mCurrentTarget->SetFrameState(state);
@@ -109,7 +109,7 @@ nsEventStateManager::PostHandleEvent(nsIPresContext& aPresContext,
nsresult ret = NS_OK;
nsFrameState state;
mCurrentTarget->GetFrameState(state);
mCurrentTarget->GetFrameState(&state);
state |= NS_FRAME_EXTERNAL_REFERENCE;
mCurrentTarget->SetFrameState(state);

View File

@@ -214,7 +214,7 @@ nsListControlFrame::GetFrameForPointUsing(const nsPoint& aPoint,
mContentFrame->FirstChild(aList, &kid);
while (nsnull != kid) {
nsFrameState state;
kid->GetFrameState(state);
kid->GetFrameState(&state);
if (NS_FRAME_OUTSIDE_CHILDREN & state) {
kid->GetRect(kidRect);
tmp.MoveTo(aPoint.x - kidRect.x, aPoint.y - kidRect.y);

View File

@@ -108,7 +108,7 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame,
// the frame state.
nsReflowReason reason = eReflowReason_Resize;
nsFrameState state;
aFrame->GetFrameState(state);
aFrame->GetFrameState(&state);
if (NS_FRAME_FIRST_REFLOW & state) {
reason = eReflowReason_Initial;
}
@@ -155,7 +155,7 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame,
aFrameReflowStatus);
mOuterReflowState.spaceManager->Translate(-tx, -ty);
aFrame->GetFrameState(state);
aFrame->GetFrameState(&state);
if (0 == (NS_FRAME_OUTSIDE_CHILDREN & state)) {
// Provide combined area for child that doesn't have any
mMetrics.mCombinedArea.x = 0;

View File

@@ -236,7 +236,7 @@ nsContainerFrame::PaintChild(nsIPresContext& aPresContext,
nsRect kidRect;
aFrame->GetRect(kidRect);
nsFrameState state;
aFrame->GetFrameState(state);
aFrame->GetFrameState(&state);
// Compute the constrained damage area; set the overlap flag to
// PR_TRUE if any portion of the child frame intersects the
@@ -318,7 +318,7 @@ nsContainerFrame::GetFrameForPointUsing(const nsPoint& aPoint,
FirstChild(aList, &kid);
while (nsnull != kid) {
nsFrameState state;
kid->GetFrameState(state);
kid->GetFrameState(&state);
if (NS_FRAME_OUTSIDE_CHILDREN & state) {
kid->GetRect(kidRect);
tmp.MoveTo(aPoint.x - kidRect.x, aPoint.y - kidRect.y);

View File

@@ -1223,9 +1223,10 @@ nsFrame::GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame)
// Resize and incremental reflow
NS_IMETHODIMP
nsFrame::GetFrameState(nsFrameState& aResult)
nsFrame::GetFrameState(nsFrameState* aResult)
{
aResult = mState;
NS_PRECONDITION(nsnull != aResult, "null OUT parameter pointer");
*aResult = mState;
return NS_OK;
}
@@ -1506,9 +1507,10 @@ NS_IMETHODIMP nsFrame::GetWindow(nsIWidget*& aWindow) const
}
NS_IMETHODIMP
nsFrame::GetFrameType(nsIAtom*& aType) const
nsFrame::GetFrameType(nsIAtom** aType) const
{
aType = nsnull;
NS_PRECONDITION(nsnull != aType, "null OUT parameter pointer");
*aType = nsnull;
return NS_OK;
}

View File

@@ -162,7 +162,7 @@ public:
PRInt32& aCursor);
NS_IMETHOD GetFrameForPoint(const nsPoint& aPoint,
nsIFrame** aFrame);
NS_IMETHOD GetFrameState(nsFrameState& aResult);
NS_IMETHOD GetFrameState(nsFrameState* aResult);
NS_IMETHOD SetFrameState(nsFrameState aNewState);
NS_IMETHOD ContentChanged(nsIPresContext* aPresContext,
@@ -191,7 +191,7 @@ public:
NS_IMETHOD GetParentWithView(nsIFrame*& aParent) const;
NS_IMETHOD GetOffsetFromView(nsPoint& aOffset, nsIView*& aView) const;
NS_IMETHOD GetWindow(nsIWidget*&) const;
NS_IMETHOD GetFrameType(nsIAtom*& aType) const;
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
NS_IMETHOD IsPercentageBase(PRBool& aBase) const;
NS_IMETHOD GetAutoMarginSize(PRUint8 aSide, nscoord& aSize) const;
NS_IMETHOD GetNextSibling(nsIFrame*& aNextSibling) const;

View File

@@ -288,7 +288,7 @@ RootFrame::Reflow(nsIPresContext& aPresContext,
// Set NS_FRAME_OUTSIDE_CHILDREN flag, or reset it, as appropriate
nsFrameState kidState;
kidFrame->GetFrameState(kidState);
kidFrame->GetFrameState(&kidState);
if (NS_FRAME_OUTSIDE_CHILDREN & kidState) {
nscoord kidXMost = kidReflowState.computedMargin.left +
kidDesiredSize.mCombinedArea.XMost();

View File

@@ -1190,7 +1190,7 @@ nsFrameReflowState::SetupChildReflowState(nsHTMLReflowState& aChildRS)
nsReflowReason reason = eReflowReason_Resize;
nsIFrame* frame = aChildRS.frame;
nsFrameState state;
frame->GetFrameState(state);
frame->GetFrameState(&state);
if (NS_FRAME_FIRST_REFLOW & state) {
reason = eReflowReason_Initial;
}

View File

@@ -395,7 +395,7 @@ public:
* filled in with the state bits. The return value has no
* meaning.
*/
NS_IMETHOD GetFrameState(nsFrameState& aResult) = 0;
NS_IMETHOD GetFrameState(nsFrameState* aResult) = 0;
/**
* Set the current frame-state value for this frame. The return
@@ -484,7 +484,7 @@ public:
*
* @see nsLayoutAtoms
*/
NS_IMETHOD GetFrameType(nsIAtom*& aType) const = 0;
NS_IMETHOD GetFrameType(nsIAtom** aType) const = 0;
/**
* Is this frame a "containing block"?

View File

@@ -108,7 +108,7 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame,
// the frame state.
nsReflowReason reason = eReflowReason_Resize;
nsFrameState state;
aFrame->GetFrameState(state);
aFrame->GetFrameState(&state);
if (NS_FRAME_FIRST_REFLOW & state) {
reason = eReflowReason_Initial;
}
@@ -155,7 +155,7 @@ nsBlockReflowContext::ReflowBlock(nsIFrame* aFrame,
aFrameReflowStatus);
mOuterReflowState.spaceManager->Translate(-tx, -ty);
aFrame->GetFrameState(state);
aFrame->GetFrameState(&state);
if (0 == (NS_FRAME_OUTSIDE_CHILDREN & state)) {
// Provide combined area for child that doesn't have any
mMetrics.mCombinedArea.x = 0;

View File

@@ -236,7 +236,7 @@ nsContainerFrame::PaintChild(nsIPresContext& aPresContext,
nsRect kidRect;
aFrame->GetRect(kidRect);
nsFrameState state;
aFrame->GetFrameState(state);
aFrame->GetFrameState(&state);
// Compute the constrained damage area; set the overlap flag to
// PR_TRUE if any portion of the child frame intersects the
@@ -318,7 +318,7 @@ nsContainerFrame::GetFrameForPointUsing(const nsPoint& aPoint,
FirstChild(aList, &kid);
while (nsnull != kid) {
nsFrameState state;
kid->GetFrameState(state);
kid->GetFrameState(&state);
if (NS_FRAME_OUTSIDE_CHILDREN & state) {
kid->GetRect(kidRect);
tmp.MoveTo(aPoint.x - kidRect.x, aPoint.y - kidRect.y);

View File

@@ -1223,9 +1223,10 @@ nsFrame::GetFrameForPoint(const nsPoint& aPoint, nsIFrame** aFrame)
// Resize and incremental reflow
NS_IMETHODIMP
nsFrame::GetFrameState(nsFrameState& aResult)
nsFrame::GetFrameState(nsFrameState* aResult)
{
aResult = mState;
NS_PRECONDITION(nsnull != aResult, "null OUT parameter pointer");
*aResult = mState;
return NS_OK;
}
@@ -1506,9 +1507,10 @@ NS_IMETHODIMP nsFrame::GetWindow(nsIWidget*& aWindow) const
}
NS_IMETHODIMP
nsFrame::GetFrameType(nsIAtom*& aType) const
nsFrame::GetFrameType(nsIAtom** aType) const
{
aType = nsnull;
NS_PRECONDITION(nsnull != aType, "null OUT parameter pointer");
*aType = nsnull;
return NS_OK;
}

View File

@@ -162,7 +162,7 @@ public:
PRInt32& aCursor);
NS_IMETHOD GetFrameForPoint(const nsPoint& aPoint,
nsIFrame** aFrame);
NS_IMETHOD GetFrameState(nsFrameState& aResult);
NS_IMETHOD GetFrameState(nsFrameState* aResult);
NS_IMETHOD SetFrameState(nsFrameState aNewState);
NS_IMETHOD ContentChanged(nsIPresContext* aPresContext,
@@ -191,7 +191,7 @@ public:
NS_IMETHOD GetParentWithView(nsIFrame*& aParent) const;
NS_IMETHOD GetOffsetFromView(nsPoint& aOffset, nsIView*& aView) const;
NS_IMETHOD GetWindow(nsIWidget*&) const;
NS_IMETHOD GetFrameType(nsIAtom*& aType) const;
NS_IMETHOD GetFrameType(nsIAtom** aType) const;
NS_IMETHOD IsPercentageBase(PRBool& aBase) const;
NS_IMETHOD GetAutoMarginSize(PRUint8 aSide, nscoord& aSize) const;
NS_IMETHOD GetNextSibling(nsIFrame*& aNextSibling) const;

View File

@@ -288,7 +288,7 @@ RootFrame::Reflow(nsIPresContext& aPresContext,
// Set NS_FRAME_OUTSIDE_CHILDREN flag, or reset it, as appropriate
nsFrameState kidState;
kidFrame->GetFrameState(kidState);
kidFrame->GetFrameState(&kidState);
if (NS_FRAME_OUTSIDE_CHILDREN & kidState) {
nscoord kidXMost = kidReflowState.computedMargin.left +
kidDesiredSize.mCombinedArea.XMost();

View File

@@ -1190,7 +1190,7 @@ nsFrameReflowState::SetupChildReflowState(nsHTMLReflowState& aChildRS)
nsReflowReason reason = eReflowReason_Resize;
nsIFrame* frame = aChildRS.frame;
nsFrameState state;
frame->GetFrameState(state);
frame->GetFrameState(&state);
if (NS_FRAME_FIRST_REFLOW & state) {
reason = eReflowReason_Initial;
}

View File

@@ -396,7 +396,7 @@ nsInlineReflow::ReflowFrame(PRBool aIsAdjacentWithTop,
nsReflowReason reason = eReflowReason_Resize;
nsIFrame* frame = pfd->mFrame;
nsFrameState state;
frame->GetFrameState(state);
frame->GetFrameState(&state);
if (NS_FRAME_FIRST_REFLOW & state) {
reason = eReflowReason_Initial;
}
@@ -444,7 +444,7 @@ nsInlineReflow::ReflowFrame(PRBool aIsAdjacentWithTop,
htmlReflow->Reflow(mPresContext, aMetrics, reflowState, aStatus);
// XXX could return this in aStatus to save a few cycles
// XXX could mandate that child sets up mCombinedArea too...
frame->GetFrameState(state);
frame->GetFrameState(&state);
if (NS_FRAME_OUTSIDE_CHILDREN & state) {
pfd->mCombinedArea = aMetrics.mCombinedArea;
}
@@ -463,7 +463,7 @@ nsInlineReflow::ReflowFrame(PRBool aIsAdjacentWithTop,
// the NS_FRAME_FIRST_REFLOW bit is cleared so that never give it an
// initial reflow reason again.
if (eReflowReason_Initial == reason) {
frame->GetFrameState(state);
frame->GetFrameState(&state);
frame->SetFrameState(state & ~NS_FRAME_FIRST_REFLOW);
}

View File

@@ -76,7 +76,7 @@ nsScrollFrame::SetInitialChildList(nsIPresContext& aPresContext,
// We need to allow the view's position to be different than the
// frame's position
nsFrameState state;
frame->GetFrameState(state);
frame->GetFrameState(&state);
state &= ~NS_FRAME_SYNC_FRAME_AND_VIEW;
frame->SetFrameState(state);
@@ -342,7 +342,7 @@ nsScrollFrame::Reflow(nsIPresContext& aPresContext,
// If the frame has child frames that stick outside its bounds, then take
// them into account, too
nsFrameState kidState;
kidFrame->GetFrameState(kidState);
kidFrame->GetFrameState(&kidState);
if (NS_FRAME_OUTSIDE_CHILDREN & kidState) {
kidDesiredSize.width = kidDesiredSize.mCombinedArea.width;
kidDesiredSize.height = kidDesiredSize.mCombinedArea.height;
@@ -401,7 +401,7 @@ nsScrollFrame::Reflow(nsIPresContext& aPresContext,
// If the frame has child frames that stick outside its bounds, then take
// them into account, too
nsFrameState kidState;
kidFrame->GetFrameState(kidState);
kidFrame->GetFrameState(&kidState);
if (NS_FRAME_OUTSIDE_CHILDREN & kidState) {
kidDesiredSize.width = kidDesiredSize.mCombinedArea.width;
kidDesiredSize.height = kidDesiredSize.mCombinedArea.height;

View File

@@ -214,7 +214,7 @@ nsListControlFrame::GetFrameForPointUsing(const nsPoint& aPoint,
mContentFrame->FirstChild(aList, &kid);
while (nsnull != kid) {
nsFrameState state;
kid->GetFrameState(state);
kid->GetFrameState(&state);
if (NS_FRAME_OUTSIDE_CHILDREN & state) {
kid->GetRect(kidRect);
tmp.MoveTo(aPoint.x - kidRect.x, aPoint.y - kidRect.y);