mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-15 21:36:20 +00:00
Added methods for counting the number of placed frames; switched the pres-context to a ref from a pointer; removed some debris
This commit is contained in:
parent
d8dc49bad0
commit
a62b3d9000
@ -26,6 +26,7 @@ struct nsBlockReflowState;
|
||||
class nsPlaceholderFrame;
|
||||
struct nsStyleDisplay;
|
||||
struct nsStylePosition;
|
||||
struct nsStyleSpacing;
|
||||
|
||||
// This structure represents a run of text. In mText are the
|
||||
// nsIFrame's that are considered text frames.
|
||||
@ -56,14 +57,43 @@ protected:
|
||||
|
||||
class nsLineLayout {
|
||||
public:
|
||||
nsLineLayout(nsIPresContext* aPresContext,
|
||||
nsLineLayout(nsIPresContext& aPresContext,
|
||||
nsISpaceManager* aSpaceManager);
|
||||
~nsLineLayout();
|
||||
|
||||
void Init(nsBlockReflowState* aReflowState) {
|
||||
void Init(nsBlockReflowState* aReflowState) {/* XXX ctor arg really */
|
||||
mBlockReflowState = aReflowState;
|
||||
}
|
||||
|
||||
// Prepare this line-layout for the reflow of a new line
|
||||
void Reset() {
|
||||
mTotalPlacedFrames = 0;
|
||||
mColumn = 0;
|
||||
mSkipLeadingWS = PR_TRUE;
|
||||
#ifdef NS_DEBUG
|
||||
mPlacedFrames.Clear();
|
||||
#endif
|
||||
}
|
||||
|
||||
// Add to the placed-frame count
|
||||
#ifdef NS_DEBUG
|
||||
void AddPlacedFrame(nsIFrame* aFrame) {
|
||||
mTotalPlacedFrames++;
|
||||
mPlacedFrames.AppendElement(aFrame);
|
||||
}
|
||||
#else
|
||||
void AddPlacedFrame() {
|
||||
mTotalPlacedFrames++;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Get the placed-frame count
|
||||
PRInt32 GetPlacedFrames() const {
|
||||
return mTotalPlacedFrames;
|
||||
}
|
||||
|
||||
// --------------------------------------------------
|
||||
|
||||
// Reset the text-run information in preparation for a FindTextRuns
|
||||
void ResetTextRuns();
|
||||
|
||||
@ -79,13 +109,6 @@ public:
|
||||
// FindTextRuns. The internal text-run state is reset.
|
||||
nsTextRun* TakeTextRuns();
|
||||
|
||||
// Prepare this line-layout for the reflow of a new line
|
||||
void Prepare(nscoord aLeftEdge) {
|
||||
mLeftEdge = aLeftEdge;
|
||||
mColumn = 0;
|
||||
mSkipLeadingWS = PR_TRUE;
|
||||
}
|
||||
|
||||
PRInt32 GetColumn() {
|
||||
return mColumn;
|
||||
}
|
||||
@ -103,13 +126,13 @@ public:
|
||||
static PRBool TreatFrameAsBlock(const nsStyleDisplay* aDisplay,
|
||||
const nsStylePosition* aPosition);
|
||||
|
||||
nsIPresContext* mPresContext;
|
||||
nsIPresContext& mPresContext;
|
||||
nsISpaceManager* mSpaceManager;
|
||||
nsBlockReflowState* mBlockReflowState;
|
||||
|
||||
PRBool mListPositionOutside;
|
||||
PRInt32 mLineNumber;
|
||||
nscoord mLeftEdge;
|
||||
// nscoord mLeftEdge;
|
||||
PRInt32 mColumn;
|
||||
|
||||
//XXX temporary?
|
||||
@ -122,6 +145,11 @@ public:
|
||||
PRBool mSkipLeadingWS;
|
||||
|
||||
protected:
|
||||
PRInt32 mTotalPlacedFrames;
|
||||
#ifdef NS_DEBUG
|
||||
nsVoidArray mPlacedFrames;
|
||||
#endif
|
||||
|
||||
// These slots are used during FindTextRuns
|
||||
nsTextRun* mTextRuns;
|
||||
nsTextRun** mTextRunP;
|
||||
|
@ -26,6 +26,7 @@ struct nsBlockReflowState;
|
||||
class nsPlaceholderFrame;
|
||||
struct nsStyleDisplay;
|
||||
struct nsStylePosition;
|
||||
struct nsStyleSpacing;
|
||||
|
||||
// This structure represents a run of text. In mText are the
|
||||
// nsIFrame's that are considered text frames.
|
||||
@ -56,14 +57,43 @@ protected:
|
||||
|
||||
class nsLineLayout {
|
||||
public:
|
||||
nsLineLayout(nsIPresContext* aPresContext,
|
||||
nsLineLayout(nsIPresContext& aPresContext,
|
||||
nsISpaceManager* aSpaceManager);
|
||||
~nsLineLayout();
|
||||
|
||||
void Init(nsBlockReflowState* aReflowState) {
|
||||
void Init(nsBlockReflowState* aReflowState) {/* XXX ctor arg really */
|
||||
mBlockReflowState = aReflowState;
|
||||
}
|
||||
|
||||
// Prepare this line-layout for the reflow of a new line
|
||||
void Reset() {
|
||||
mTotalPlacedFrames = 0;
|
||||
mColumn = 0;
|
||||
mSkipLeadingWS = PR_TRUE;
|
||||
#ifdef NS_DEBUG
|
||||
mPlacedFrames.Clear();
|
||||
#endif
|
||||
}
|
||||
|
||||
// Add to the placed-frame count
|
||||
#ifdef NS_DEBUG
|
||||
void AddPlacedFrame(nsIFrame* aFrame) {
|
||||
mTotalPlacedFrames++;
|
||||
mPlacedFrames.AppendElement(aFrame);
|
||||
}
|
||||
#else
|
||||
void AddPlacedFrame() {
|
||||
mTotalPlacedFrames++;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Get the placed-frame count
|
||||
PRInt32 GetPlacedFrames() const {
|
||||
return mTotalPlacedFrames;
|
||||
}
|
||||
|
||||
// --------------------------------------------------
|
||||
|
||||
// Reset the text-run information in preparation for a FindTextRuns
|
||||
void ResetTextRuns();
|
||||
|
||||
@ -79,13 +109,6 @@ public:
|
||||
// FindTextRuns. The internal text-run state is reset.
|
||||
nsTextRun* TakeTextRuns();
|
||||
|
||||
// Prepare this line-layout for the reflow of a new line
|
||||
void Prepare(nscoord aLeftEdge) {
|
||||
mLeftEdge = aLeftEdge;
|
||||
mColumn = 0;
|
||||
mSkipLeadingWS = PR_TRUE;
|
||||
}
|
||||
|
||||
PRInt32 GetColumn() {
|
||||
return mColumn;
|
||||
}
|
||||
@ -103,13 +126,13 @@ public:
|
||||
static PRBool TreatFrameAsBlock(const nsStyleDisplay* aDisplay,
|
||||
const nsStylePosition* aPosition);
|
||||
|
||||
nsIPresContext* mPresContext;
|
||||
nsIPresContext& mPresContext;
|
||||
nsISpaceManager* mSpaceManager;
|
||||
nsBlockReflowState* mBlockReflowState;
|
||||
|
||||
PRBool mListPositionOutside;
|
||||
PRInt32 mLineNumber;
|
||||
nscoord mLeftEdge;
|
||||
// nscoord mLeftEdge;
|
||||
PRInt32 mColumn;
|
||||
|
||||
//XXX temporary?
|
||||
@ -122,6 +145,11 @@ public:
|
||||
PRBool mSkipLeadingWS;
|
||||
|
||||
protected:
|
||||
PRInt32 mTotalPlacedFrames;
|
||||
#ifdef NS_DEBUG
|
||||
nsVoidArray mPlacedFrames;
|
||||
#endif
|
||||
|
||||
// These slots are used during FindTextRuns
|
||||
nsTextRun* mTextRuns;
|
||||
nsTextRun** mTextRunP;
|
||||
|
Loading…
x
Reference in New Issue
Block a user