backing out evaughan's changes. tree closed.

This commit is contained in:
donm%netscape.com 1999-03-26 19:39:23 +00:00
Родитель bd5cb6588a
Коммит 9a4f6969a9
17 изменённых файлов: 53 добавлений и 238 удалений

Просмотреть файл

@ -66,9 +66,6 @@ public:
static nsIAtom* titledbutton;
static nsIAtom* mode;
static nsIAtom* box;
static nsIAtom* flex;
static nsIAtom* widget;
static nsIAtom* window;
};

Просмотреть файл

@ -48,8 +48,6 @@ nsIAtom* nsXULAtoms::progressmeter;
nsIAtom* nsXULAtoms::titledbutton;
nsIAtom* nsXULAtoms::mode;
nsIAtom* nsXULAtoms::box;
nsIAtom* nsXULAtoms::flex;
nsIAtom* nsXULAtoms::widget;
nsIAtom* nsXULAtoms::window;
@ -93,8 +91,6 @@ void nsXULAtoms::AddrefAtoms() {
titledbutton = NS_NewAtom("titledbutton");
mode = NS_NewAtom("mode");
box = NS_NewAtom("box");
flex = NS_NewAtom("flex");
widget = NS_NewAtom("widget");
window = NS_NewAtom("window");
@ -128,10 +124,6 @@ void nsXULAtoms::ReleaseAtoms() {
NS_RELEASE(progressmeter);
NS_RELEASE(mode);
NS_RELEASE(box);
NS_RELEASE(flex);
NS_RELEASE(widget);
NS_RELEASE(window);
NS_IF_RELEASE(gNameSpaceManager);

Просмотреть файл

@ -70,9 +70,10 @@ NS_NewProgressMeterFrame ( nsIFrame*& aNewFrame );
nsresult
NS_NewTitledButtonFrame ( nsIFrame*& aNewFrame );
nsresult
NS_NewBoxFrame ( nsIFrame*& aNewFrame );
/*
#include "nsProgressMeterFrame.h"
#include "nsTitledButtonFrame.h"
*/
#endif
//static NS_DEFINE_IID(kIStyleRuleIID, NS_ISTYLE_RULE_IID);
@ -1297,7 +1298,6 @@ nsCSSFrameConstructor::TableIsValidCellContent(nsIPresContext* aPresContext,
(nsXULAtoms::treeindentation == tag.get()) ||
(nsXULAtoms::toolbox == tag.get()) ||
(nsXULAtoms::toolbar == tag.get()) ||
(nsXULAtoms::box == tag.get()) ||
(nsXULAtoms::progressmeter == tag.get() )) {
return PR_TRUE;
}
@ -2246,14 +2246,6 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext,
}
// End of PROGRESS METER CONSTRUCTION logic
// BOX CONSTRUCTION
else if (aTag == nsXULAtoms::box) {
processChildren = PR_TRUE;
isReplaced = PR_TRUE;
rv = NS_NewBoxFrame(newFrame);
}
// End of BOX CONSTRUCTION logic
// TITLED BUTTON CONSTRUCTION
else if (aTag == nsXULAtoms::titledbutton) {
processChildren = PR_TRUE;

Просмотреть файл

@ -27,17 +27,12 @@ nsButtonFrameRenderer::SetNameSpace(PRInt32 aNameSpace)
}
void
nsButtonFrameRenderer::SetFrame(nsFrame* aFrame, nsIPresContext& aPresContext)
nsButtonFrameRenderer::SetFrame(nsIFrame* aFrame, nsIPresContext& aPresContext)
{
mFrame = aFrame;
ReResolveStyles(aPresContext);
}
void
nsButtonFrameRenderer::Redraw()
{
mFrame->Invalidate(mOutlineRect, PR_TRUE);
}
nsString
nsButtonFrameRenderer::GetPseudoClassAttribute()
@ -339,14 +334,8 @@ 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 -------------
@ -371,11 +360,11 @@ nsButtonFrameRenderer::PaintOutlineAndFocusBorders(nsIPresContext& aPresContext,
}
}
if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer)
if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer)
{
if (mOutlineStyle) {
if /*(mOutlineStyle) */ (PR_FALSE) {
GetButtonOutlineRect(aRect, mOutlineRect);
GetButtonOutlineRect(aRect, rect);
const nsStyleSpacing* spacing = (const nsStyleSpacing*)mOutlineStyle ->GetStyleData(eStyleStruct_Spacing);
@ -385,7 +374,7 @@ nsButtonFrameRenderer::PaintOutlineAndFocusBorders(nsIPresContext& aPresContext,
aRenderingContext.SetClipRect(rect, nsClipCombine_kReplace, clipEmpty);
nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, mFrame,
aDirtyRect, mOutlineRect, *spacing, mOutlineStyle, 0);
aDirtyRect, rect, *spacing, mOutlineStyle, 0);
aRenderingContext.PopState(clipEmpty);
}
@ -540,18 +529,10 @@ nsButtonFrameRenderer::GetButtonOutlineBorderAndPadding()
return borderAndPadding;
}
// gets the full size of our border with all the focus borders
nsMargin
nsButtonFrameRenderer::GetFullButtonBorderAndPadding()
{
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();
return GetButtonOuterFocusBorderAndPadding() + GetButtonBorderAndPadding() + GetButtonInnerFocusMargin() + GetButtonInnerFocusBorderAndPadding();
}
void

Просмотреть файл

@ -65,7 +65,7 @@ public:
const nsRect& aRect);
virtual void SetNameSpace(PRInt32 aNameSpace);
virtual void SetFrame(nsFrame* aFrame, nsIPresContext& aPresContext);
virtual void SetFrame(nsIFrame* aFrame, nsIPresContext& aPresContext);
virtual void SetActive(PRBool aActive, PRBool notify);
virtual void SetHover(PRBool aHover, PRBool notify);
@ -82,13 +82,12 @@ public:
virtual void GetButtonRect(const nsRect& aRect, nsRect& aResult);
virtual void GetButtonInnerFocusRect(const nsRect& aRect, nsRect& aResult);
virtual void GetButtonContentRect(const nsRect& aRect, nsRect& aResult);
virtual nsMargin GetButtonOuterFocusBorderAndPadding();
virtual nsMargin GetButtonBorderAndPadding();
virtual nsMargin GetButtonInnerFocusMargin();
virtual nsMargin GetButtonInnerFocusBorderAndPadding();
virtual nsMargin GetButtonOutlineBorderAndPadding();
virtual nsMargin GetFullButtonBorderAndPadding();
virtual nsMargin GetAddedButtonBorderAndPadding();
virtual nsMargin GetButtonOuterFocusBorderAndPadding();
virtual nsMargin GetButtonBorderAndPadding();
virtual nsMargin GetButtonInnerFocusMargin();
virtual nsMargin GetButtonInnerFocusBorderAndPadding();
virtual nsMargin GetButtonOutlineBorderAndPadding();
virtual nsMargin GetFullButtonBorderAndPadding();
virtual void ReResolveStyles(nsIPresContext& aPresContext);
@ -100,7 +99,6 @@ public:
nsHTMLReflowMetrics& aDesiredSize,
nsMargin& aBorderPadding);
virtual void Redraw();
protected:
@ -120,9 +118,7 @@ private:
nsCOMPtr<nsIStyleContext> mOutlineStyle;
PRInt32 mNameSpace;
nsFrame* mFrame;
nsRect mOutlineRect;
nsIFrame* mFrame;
};

Просмотреть файл

@ -27,17 +27,12 @@ nsButtonFrameRenderer::SetNameSpace(PRInt32 aNameSpace)
}
void
nsButtonFrameRenderer::SetFrame(nsFrame* aFrame, nsIPresContext& aPresContext)
nsButtonFrameRenderer::SetFrame(nsIFrame* aFrame, nsIPresContext& aPresContext)
{
mFrame = aFrame;
ReResolveStyles(aPresContext);
}
void
nsButtonFrameRenderer::Redraw()
{
mFrame->Invalidate(mOutlineRect, PR_TRUE);
}
nsString
nsButtonFrameRenderer::GetPseudoClassAttribute()
@ -339,14 +334,8 @@ 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 -------------
@ -371,11 +360,11 @@ nsButtonFrameRenderer::PaintOutlineAndFocusBorders(nsIPresContext& aPresContext,
}
}
if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer)
if (NS_FRAME_PAINT_LAYER_FOREGROUND == aWhichLayer)
{
if (mOutlineStyle) {
if /*(mOutlineStyle) */ (PR_FALSE) {
GetButtonOutlineRect(aRect, mOutlineRect);
GetButtonOutlineRect(aRect, rect);
const nsStyleSpacing* spacing = (const nsStyleSpacing*)mOutlineStyle ->GetStyleData(eStyleStruct_Spacing);
@ -385,7 +374,7 @@ nsButtonFrameRenderer::PaintOutlineAndFocusBorders(nsIPresContext& aPresContext,
aRenderingContext.SetClipRect(rect, nsClipCombine_kReplace, clipEmpty);
nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, mFrame,
aDirtyRect, mOutlineRect, *spacing, mOutlineStyle, 0);
aDirtyRect, rect, *spacing, mOutlineStyle, 0);
aRenderingContext.PopState(clipEmpty);
}
@ -540,18 +529,10 @@ nsButtonFrameRenderer::GetButtonOutlineBorderAndPadding()
return borderAndPadding;
}
// gets the full size of our border with all the focus borders
nsMargin
nsButtonFrameRenderer::GetFullButtonBorderAndPadding()
{
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();
return GetButtonOuterFocusBorderAndPadding() + GetButtonBorderAndPadding() + GetButtonInnerFocusMargin() + GetButtonInnerFocusBorderAndPadding();
}
void

Просмотреть файл

@ -65,7 +65,7 @@ public:
const nsRect& aRect);
virtual void SetNameSpace(PRInt32 aNameSpace);
virtual void SetFrame(nsFrame* aFrame, nsIPresContext& aPresContext);
virtual void SetFrame(nsIFrame* aFrame, nsIPresContext& aPresContext);
virtual void SetActive(PRBool aActive, PRBool notify);
virtual void SetHover(PRBool aHover, PRBool notify);
@ -82,13 +82,12 @@ public:
virtual void GetButtonRect(const nsRect& aRect, nsRect& aResult);
virtual void GetButtonInnerFocusRect(const nsRect& aRect, nsRect& aResult);
virtual void GetButtonContentRect(const nsRect& aRect, nsRect& aResult);
virtual nsMargin GetButtonOuterFocusBorderAndPadding();
virtual nsMargin GetButtonBorderAndPadding();
virtual nsMargin GetButtonInnerFocusMargin();
virtual nsMargin GetButtonInnerFocusBorderAndPadding();
virtual nsMargin GetButtonOutlineBorderAndPadding();
virtual nsMargin GetFullButtonBorderAndPadding();
virtual nsMargin GetAddedButtonBorderAndPadding();
virtual nsMargin GetButtonOuterFocusBorderAndPadding();
virtual nsMargin GetButtonBorderAndPadding();
virtual nsMargin GetButtonInnerFocusMargin();
virtual nsMargin GetButtonInnerFocusBorderAndPadding();
virtual nsMargin GetButtonOutlineBorderAndPadding();
virtual nsMargin GetFullButtonBorderAndPadding();
virtual void ReResolveStyles(nsIPresContext& aPresContext);
@ -100,7 +99,6 @@ public:
nsHTMLReflowMetrics& aDesiredSize,
nsMargin& aBorderPadding);
virtual void Redraw();
protected:
@ -120,9 +118,7 @@ private:
nsCOMPtr<nsIStyleContext> mOutlineStyle;
PRInt32 mNameSpace;
nsFrame* mFrame;
nsRect mOutlineRect;
nsIFrame* mFrame;
};

Просмотреть файл

@ -70,9 +70,10 @@ NS_NewProgressMeterFrame ( nsIFrame*& aNewFrame );
nsresult
NS_NewTitledButtonFrame ( nsIFrame*& aNewFrame );
nsresult
NS_NewBoxFrame ( nsIFrame*& aNewFrame );
/*
#include "nsProgressMeterFrame.h"
#include "nsTitledButtonFrame.h"
*/
#endif
//static NS_DEFINE_IID(kIStyleRuleIID, NS_ISTYLE_RULE_IID);
@ -1297,7 +1298,6 @@ nsCSSFrameConstructor::TableIsValidCellContent(nsIPresContext* aPresContext,
(nsXULAtoms::treeindentation == tag.get()) ||
(nsXULAtoms::toolbox == tag.get()) ||
(nsXULAtoms::toolbar == tag.get()) ||
(nsXULAtoms::box == tag.get()) ||
(nsXULAtoms::progressmeter == tag.get() )) {
return PR_TRUE;
}
@ -2246,14 +2246,6 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext,
}
// End of PROGRESS METER CONSTRUCTION logic
// BOX CONSTRUCTION
else if (aTag == nsXULAtoms::box) {
processChildren = PR_TRUE;
isReplaced = PR_TRUE;
rv = NS_NewBoxFrame(newFrame);
}
// End of BOX CONSTRUCTION logic
// TITLED BUTTON CONSTRUCTION
else if (aTag == nsXULAtoms::titledbutton) {
processChildren = PR_TRUE;

Двоичные данные
layout/macbuild/layout.mcp

Двоичный файл не отображается.

Просмотреть файл

@ -35,8 +35,7 @@ LOCAL_INCLUDES = \
# Note the sophisticated alphabetical ordering :-|
CPPSRCS = \
nsBoxFrame.cpp \
nsProgressMeterFrame.cpp \
nsProgressMeterFrame.cpp \
nsTitledButtonFrame.cpp \
nsToolbarFrame.cpp \
nsToolboxFrame.cpp \

Просмотреть файл

@ -24,7 +24,6 @@ REQUIRES=xpcom raptor pref
DEFINES=-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN
CPPSRCS= \
nsBoxFrame.cpp \
nsProgressMeterFrame.cpp \
nsTitledButtonFrame.cpp \
nsToolboxFrame.cpp \
@ -35,7 +34,6 @@ CPPSRCS= \
$(NULL)
CPP_OBJS= \
.\$(OBJDIR)\nsBoxFrame.obj \
.\$(OBJDIR)\nsProgressMeterFrame.obj \
.\$(OBJDIR)\nsTitledButtonFrame.obj \
.\$(OBJDIR)\nsToolboxFrame.obj \

Просмотреть файл

Просмотреть файл

@ -1,95 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Mozilla Communicator client code.
*
* The Initial Developer of the Original Code is Netscape Communications
* Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved.
*/
/**
Eric D Vaughan
This class lays out its children either vertically or horizontally
**/
#include "nsHTMLContainerFrame.h"
class nsBoxDataSpring;
class nsBoxFrame : public nsHTMLContainerFrame
{
public:
friend nsresult NS_NewBoxFrame(nsIFrame*& aNewFrame);
NS_IMETHOD FlowChildAt(nsIFrame* frame,
nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus,
const nsSize& size);
NS_IMETHOD Init(nsIPresContext& aPresContext,
nsIContent* aContent,
nsIFrame* aParent,
nsIStyleContext* aContext,
nsIFrame* asPrevInFlow);
NS_IMETHOD ReResolveStyleContext ( nsIPresContext* aPresContext,
nsIStyleContext* aParentContext,
PRInt32 aParentChange,
nsStyleChangeList* aChangeList,
PRInt32* aLocalChange) ;
NS_IMETHOD AttributeChanged(nsIPresContext* aPresContext,
nsIContent* aChild,
nsIAtom* aAttribute,
PRInt32 aHint);
// nsIHTMLReflow overrides
NS_IMETHOD Reflow(nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus);
NS_IMETHOD Paint(nsIPresContext& aPresContext,
nsIRenderingContext& aRenderingContext,
const nsRect& aDirtyRect,
nsFramePaintLayer aWhichLayer);
NS_IMETHOD HandleEvent(nsIPresContext& aPresContext,
nsGUIEvent* aEvent,
nsEventStatus& aEventStatus);
protected:
virtual void GetDesiredSize(nsIPresContext* aPresContext,
const nsHTMLReflowState& aReflowState,
nsHTMLReflowMetrics& aDesiredSize);
virtual PRIntn GetSkipSides() const { return 0; }
nsBoxFrame();
virtual void Stretch(nsBoxDataSpring* springs, PRInt32 nSprings, nscoord& size);
private:
PRBool mHorizontal;
}; // class nsBoxFrame

Просмотреть файл

@ -601,7 +601,10 @@ nsProgressMeterFrame :: Reflow ( nsIPresContext& aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
{
ReResolveStyleContext(&aPresContext, mStyleContext, NS_STYLE_HINT_REFLOW, nsnull, nsnull);
if (mUndetermined)
gStripeAnimator->AddFrame(this);
else

Просмотреть файл

@ -193,7 +193,11 @@ nsTitledButtonFrame::AttributeChanged(nsIPresContext* aPresContext,
mNeedsLayout = PR_TRUE;
UpdateAttributes(*aPresContext);
mRenderer.Redraw();
// redraw
nsRect frameRect;
GetRect(frameRect);
nsRect rect(0,0,frameRect.width, frameRect.height);
Invalidate(rect, PR_TRUE);
return NS_OK;
}
@ -796,28 +800,18 @@ nsTitledButtonFrame::GetDesiredSize(nsIPresContext* aPresContext,
nsRect minSize(0,0,mMinSize.width, mMinSize.height);
// we need to factory or focus stuff into our computed size.
nscoord computedWidth = aReflowState.computedWidth;
nscoord computedHeight = aReflowState.computedHeight;
nsMargin added = mRenderer.GetAddedButtonBorderAndPadding();
computedWidth -= (added.left + added.right);
computedHeight -= (added.top + added.bottom);
// if the width is set
if (fixedWidthContent)
if (computedWidth >= minSize.width)
aDesiredSize.width = computedWidth;
if (aReflowState.computedWidth >= minSize.width)
aDesiredSize.width = aReflowState.computedWidth;
else
aDesiredSize.width = minSize.width;
aDesiredSize.width = minSize.width;
// if the height is set
if (fixedHeightContent)
if (computedHeight >= minSize.height)
aDesiredSize.height = computedHeight;
if (aReflowState.computedWidth >= minSize.height)
aDesiredSize.height = aReflowState.computedHeight;
else
aDesiredSize.height = minSize.height;
}

Просмотреть файл

@ -48,8 +48,6 @@ nsIAtom* nsXULAtoms::progressmeter;
nsIAtom* nsXULAtoms::titledbutton;
nsIAtom* nsXULAtoms::mode;
nsIAtom* nsXULAtoms::box;
nsIAtom* nsXULAtoms::flex;
nsIAtom* nsXULAtoms::widget;
nsIAtom* nsXULAtoms::window;
@ -93,8 +91,6 @@ void nsXULAtoms::AddrefAtoms() {
titledbutton = NS_NewAtom("titledbutton");
mode = NS_NewAtom("mode");
box = NS_NewAtom("box");
flex = NS_NewAtom("flex");
widget = NS_NewAtom("widget");
window = NS_NewAtom("window");
@ -128,10 +124,6 @@ void nsXULAtoms::ReleaseAtoms() {
NS_RELEASE(progressmeter);
NS_RELEASE(mode);
NS_RELEASE(box);
NS_RELEASE(flex);
NS_RELEASE(widget);
NS_RELEASE(window);
NS_IF_RELEASE(gNameSpaceManager);

Просмотреть файл

@ -66,9 +66,6 @@ public:
static nsIAtom* titledbutton;
static nsIAtom* mode;
static nsIAtom* box;
static nsIAtom* flex;
static nsIAtom* widget;
static nsIAtom* window;
};