Added XUL based layout manager.

git-svn-id: svn://10.0.0.236/trunk@25282 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
evaughan%netscape.com
1999-03-27 00:58:29 +00:00
parent 85003a48d1
commit cddf6f971f
14 changed files with 143 additions and 53 deletions

View File

@@ -27,12 +27,17 @@ nsButtonFrameRenderer::SetNameSpace(PRInt32 aNameSpace)
}
void
nsButtonFrameRenderer::SetFrame(nsIFrame* aFrame, nsIPresContext& aPresContext)
nsButtonFrameRenderer::SetFrame(nsFrame* aFrame, nsIPresContext& aPresContext)
{
mFrame = aFrame;
ReResolveStyles(aPresContext);
}
void
nsButtonFrameRenderer::Redraw()
{
mFrame->Invalidate(mOutlineRect, PR_TRUE);
}
nsString
nsButtonFrameRenderer::GetPseudoClassAttribute()
@@ -334,8 +339,14 @@ nsButtonFrameRenderer::PaintOutlineAndFocusBorders(nsIPresContext& aPresContext,
nsRect rect;
if (NS_FRAME_PAINT_LAYER_BACKGROUND == aWhichLayer)
if (NS_FRAME_PAINT_LAYER_BACKGROUND == aWhichLayer)
{
// because we have and outline rect we need to
// store our bounds for redraw. We will change
// these bounds when outline appears
mOutlineRect = rect;
mOutlineRect.width = 0;
mOutlineRect.height= 0;
if (mOuterFocusStyle) {
// ---------- paint the outer focus border -------------
@@ -360,11 +371,11 @@ nsButtonFrameRenderer::PaintOutlineAndFocusBorders(nsIPresContext& aPresContext,
}
}
if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer)
if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer)
{
if /*(mOutlineStyle) */ (PR_FALSE) {
if (mOutlineStyle) {
GetButtonOutlineRect(aRect, rect);
GetButtonOutlineRect(aRect, mOutlineRect);
const nsStyleSpacing* spacing = (const nsStyleSpacing*)mOutlineStyle ->GetStyleData(eStyleStruct_Spacing);
@@ -374,7 +385,7 @@ nsButtonFrameRenderer::PaintOutlineAndFocusBorders(nsIPresContext& aPresContext,
aRenderingContext.SetClipRect(rect, nsClipCombine_kReplace, clipEmpty);
nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, mFrame,
aDirtyRect, rect, *spacing, mOutlineStyle, 0);
aDirtyRect, mOutlineRect, *spacing, mOutlineStyle, 0);
aRenderingContext.PopState(clipEmpty);
}
@@ -529,10 +540,18 @@ nsButtonFrameRenderer::GetButtonOutlineBorderAndPadding()
return borderAndPadding;
}
// gets the full size of our border with all the focus borders
nsMargin
nsButtonFrameRenderer::GetFullButtonBorderAndPadding()
{
return GetButtonOuterFocusBorderAndPadding() + GetButtonBorderAndPadding() + GetButtonInnerFocusMargin() + GetButtonInnerFocusBorderAndPadding();
return GetAddedButtonBorderAndPadding() + GetButtonBorderAndPadding();
}
// gets all the focus borders and padding that will be added to the regular border
nsMargin
nsButtonFrameRenderer::GetAddedButtonBorderAndPadding()
{
return GetButtonOuterFocusBorderAndPadding() + GetButtonInnerFocusMargin() + GetButtonInnerFocusBorderAndPadding();
}
void