Bug 670148, remove nsIBoxLayout, r=roc

This commit is contained in:
Neil Deakin 2011-07-11 10:05:10 -04:00
parent f6bd0911ea
commit 4bf3881ba3
36 changed files with 86 additions and 206 deletions

View File

@ -107,7 +107,7 @@
#include "nsLayoutUtils.h"
#include "nsAutoPtr.h"
#include "nsBoxFrame.h"
#include "nsIBoxLayout.h"
#include "nsBoxLayout.h"
#include "nsImageFrame.h"
#include "nsIObjectLoadingContent.h"
#include "nsContentErrors.h"
@ -318,7 +318,7 @@ NS_NewTreeBodyFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
// grid
nsresult
NS_NewGridLayout2 ( nsIPresShell* aPresShell, nsIBoxLayout** aNewLayout );
NS_NewGridLayout2 ( nsIPresShell* aPresShell, nsBoxLayout** aNewLayout );
nsIFrame*
NS_NewGridRowLeafFrame (nsIPresShell* aPresShell, nsStyleContext* aContext);
nsIFrame*
@ -3947,7 +3947,7 @@ static
nsIFrame* NS_NewGridBoxFrame(nsIPresShell* aPresShell,
nsStyleContext* aStyleContext)
{
nsCOMPtr<nsIBoxLayout> layout;
nsCOMPtr<nsBoxLayout> layout;
NS_NewGridLayout2(aPresShell, getter_AddRefs(layout));
if (!layout) {
return nsnull;

View File

@ -91,7 +91,7 @@ class nsIWidget;
class nsIDOMRange;
class nsISelectionController;
class nsBoxLayoutState;
class nsIBoxLayout;
class nsBoxLayout;
class nsILineIterator;
#ifdef ACCESSIBILITY
class nsAccessible;
@ -2594,8 +2594,8 @@ NS_PTR_TO_INT32(frame->Properties().Get(nsIFrame::EmbeddingLevelProperty()))
NS_IMETHOD GetBorder(nsMargin& aBorder)=0;
NS_IMETHOD GetPadding(nsMargin& aBorderAndPadding)=0;
NS_IMETHOD GetMargin(nsMargin& aMargin)=0;
virtual void SetLayoutManager(nsIBoxLayout* aLayout) { }
virtual nsIBoxLayout* GetLayoutManager() { return nsnull; }
virtual void SetLayoutManager(nsBoxLayout* aLayout) { }
virtual nsBoxLayout* GetLayoutManager() { return nsnull; }
NS_HIDDEN_(nsresult) GetClientRect(nsRect& aContentRect);
// For nsSprocketLayout

View File

@ -596,7 +596,7 @@ nsGrid::GetPartFromBox(nsIBox* aBox)
if (!aBox)
return nsnull;
nsIBoxLayout* layout = aBox->GetLayoutManager();
nsBoxLayout* layout = aBox->GetLayoutManager();
return layout ? layout->AsGridPart() : nsnull;
}

View File

@ -50,7 +50,7 @@
#include "nsSprocketLayout.h"
nsresult
NS_NewGridLayout2( nsIPresShell* aPresShell, nsIBoxLayout** aNewLayout)
NS_NewGridLayout2( nsIPresShell* aPresShell, nsBoxLayout** aNewLayout)
{
*aNewLayout = new nsGridLayout2(aPresShell);
NS_IF_ADDREF(*aNewLayout);

View File

@ -53,14 +53,14 @@ class nsBoxLayoutState;
class nsGridCell;
/**
* The nsIBoxLayout implementation for a grid.
* The nsBoxLayout implementation for a grid.
*/
class nsGridLayout2 : public nsStackLayout,
public nsIGridPart
{
public:
friend nsresult NS_NewGridLayout2(nsIPresShell* aPresShell, nsIBoxLayout** aNewLayout);
friend nsresult NS_NewGridLayout2(nsIPresShell* aPresShell, nsBoxLayout** aNewLayout);
NS_DECL_ISUPPORTS_INHERITED

View File

@ -48,13 +48,13 @@
#include "nsBoxLayoutState.h"
#include "nsGridLayout2.h"
already_AddRefed<nsIBoxLayout> NS_NewGridRowGroupLayout();
already_AddRefed<nsBoxLayout> NS_NewGridRowGroupLayout();
nsIFrame*
NS_NewGridRowGroupFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext)
{
nsCOMPtr<nsIBoxLayout> layout = NS_NewGridRowGroupLayout();
nsCOMPtr<nsBoxLayout> layout = NS_NewGridRowGroupLayout();
if (!layout) {
return nsnull;
}

View File

@ -68,7 +68,7 @@ public:
nsGridRowGroupFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
nsIBoxLayout* aLayoutManager):
nsBoxLayout* aLayoutManager):
nsBoxFrame(aPresShell, aContext, PR_FALSE, aLayoutManager) {}
virtual nscoord GetFlex(nsBoxLayoutState& aBoxLayoutState);

View File

@ -54,9 +54,9 @@
#include "nsGridLayout2.h"
#include "nsGridRow.h"
already_AddRefed<nsIBoxLayout> NS_NewGridRowGroupLayout()
already_AddRefed<nsBoxLayout> NS_NewGridRowGroupLayout()
{
nsIBoxLayout* layout = new nsGridRowGroupLayout();
nsBoxLayout* layout = new nsGridRowGroupLayout();
NS_IF_ADDREF(layout);
return layout;
}

View File

@ -48,13 +48,13 @@
#include "nsGridRowLayout.h"
/**
* The nsIBoxLayout implementation for nsGridRowGroupFrame.
* The nsBoxLayout implementation for nsGridRowGroupFrame.
*/
class nsGridRowGroupLayout : public nsGridRowLayout
{
public:
friend already_AddRefed<nsIBoxLayout> NS_NewGridRowGroupLayout();
friend already_AddRefed<nsBoxLayout> NS_NewGridRowGroupLayout();
virtual nsGridRowGroupLayout* CastToRowGroupLayout() { return this; }
virtual nsSize GetMinSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);

View File

@ -128,7 +128,7 @@ nsGridRowLayout::GetGrid(nsIBox* aBox, PRInt32* aIndex, nsGridRowLayout* aReques
// if there is a scrollframe walk inside it to its child
nsIBox* childBox = nsGrid::GetScrolledBox(child);
nsIBoxLayout* layout = childBox->GetLayoutManager();
nsBoxLayout* layout = childBox->GetLayoutManager();
nsIGridPart* gridRow = nsGrid::GetPartFromBox(childBox);
if (gridRow)
{

View File

@ -53,8 +53,8 @@ class nsBoxLayoutState;
class nsGrid;
/**
* A common base class for nsGridRowLeafLayout (the nsIBoxLayout object
* for a grid row or column) and nsGridRowGroupLayout (the nsIBoxLayout
* A common base class for nsGridRowLeafLayout (the nsBoxLayout object
* for a grid row or column) and nsGridRowGroupLayout (the nsBoxLayout
* object for a grid row group or column group).
*/
// XXXldb This needs a name that indicates that it's a base class for

View File

@ -48,13 +48,13 @@
#include "nsBoxLayoutState.h"
#include "nsGridLayout2.h"
already_AddRefed<nsIBoxLayout> NS_NewGridRowLeafLayout();
already_AddRefed<nsBoxLayout> NS_NewGridRowLeafLayout();
nsIFrame*
NS_NewGridRowLeafFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext)
{
nsCOMPtr<nsIBoxLayout> layout = NS_NewGridRowLeafLayout();
nsCOMPtr<nsBoxLayout> layout = NS_NewGridRowLeafLayout();
if (!layout) {
return nsnull;
}

View File

@ -73,7 +73,7 @@ public:
nsGridRowLeafFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
PRBool aIsRoot,
nsIBoxLayout* aLayoutManager):
nsBoxLayout* aLayoutManager):
nsBoxFrame(aPresShell, aContext, aIsRoot, aLayoutManager) {}
NS_IMETHOD GetBorderAndPadding(nsMargin& aBorderAndPadding);

View File

@ -51,9 +51,9 @@
#include "nsBoxFrame.h"
#include "nsGridLayout2.h"
already_AddRefed<nsIBoxLayout> NS_NewGridRowLeafLayout()
already_AddRefed<nsBoxLayout> NS_NewGridRowLeafLayout()
{
nsIBoxLayout* layout = new nsGridRowLeafLayout();
nsBoxLayout* layout = new nsGridRowLeafLayout();
NS_IF_ADDREF(layout);
return layout;
}

View File

@ -49,7 +49,7 @@
#include "nsCOMPtr.h"
/**
* The nsIBoxLayout implementation for nsGridRowLeafFrame.
* The nsBoxLayout implementation for nsGridRowLeafFrame.
*/
// XXXldb This needs a better name that indicates that it's for any grid
// row.
@ -57,7 +57,7 @@ class nsGridRowLeafLayout : public nsGridRowLayout
{
public:
friend already_AddRefed<nsIBoxLayout> NS_NewGridRowLeafLayout();
friend already_AddRefed<nsBoxLayout> NS_NewGridRowLeafLayout();
virtual nsSize GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
virtual nsSize GetMinSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);

View File

@ -53,7 +53,7 @@ class nsGridLayout2;
{ 0xb3, 0x6c, 0x69, 0xf7, 0xc1, 0x95, 0x67, 0x7b } }
/**
* An additional interface implemented by nsIBoxLayout implementations
* An additional interface implemented by nsBoxLayout implementations
* for parts of a grid (excluding cells, which are not special).
*/
class nsIGridPart : public nsISupports {

View File

@ -53,7 +53,7 @@
#include "nsIDocument.h"
#include "nsITheme.h"
#include "nsIServiceManager.h"
#include "nsIBoxLayout.h"
#include "nsBoxLayout.h"
#include "FrameLayerBuilder.h"
using namespace mozilla;

View File

@ -78,7 +78,7 @@
#include "nsIPresShell.h"
#include "nsCSSRendering.h"
#include "nsIServiceManager.h"
#include "nsIBoxLayout.h"
#include "nsBoxLayout.h"
#include "nsSprocketLayout.h"
#include "nsIDocument.h"
#include "nsIScrollableFrame.h"
@ -120,7 +120,7 @@ nsIBox* nsBoxFrame::mDebugChild = nsnull;
#endif
nsIFrame*
NS_NewBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsRoot, nsIBoxLayout* aLayoutManager)
NS_NewBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsRoot, nsBoxLayout* aLayoutManager)
{
return new (aPresShell) nsBoxFrame(aPresShell, aContext, aIsRoot, aLayoutManager);
}
@ -136,7 +136,7 @@ NS_IMPL_FRAMEARENA_HELPERS(nsBoxFrame)
nsBoxFrame::nsBoxFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
PRBool aIsRoot,
nsIBoxLayout* aLayoutManager) :
nsBoxLayout* aLayoutManager) :
nsContainerFrame(aContext)
{
mState |= NS_STATE_IS_HORIZONTAL;
@ -149,7 +149,7 @@ nsBoxFrame::nsBoxFrame(nsIPresShell* aPresShell,
mHalign = hAlign_Left;
// if no layout manager specified us the static sprocket layout
nsCOMPtr<nsIBoxLayout> layout = aLayoutManager;
nsCOMPtr<nsBoxLayout> layout = aLayoutManager;
if (layout == nsnull) {
NS_NewSprocketLayout(aPresShell, layout);

View File

@ -71,7 +71,7 @@ class nsBoxLayoutState;
nsIFrame* NS_NewBoxFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
PRBool aIsRoot,
nsIBoxLayout* aLayoutManager);
nsBoxLayout* aLayoutManager);
nsIFrame* NS_NewBoxFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext);
@ -83,7 +83,7 @@ public:
friend nsIFrame* NS_NewBoxFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
PRBool aIsRoot,
nsIBoxLayout* aLayoutManager);
nsBoxLayout* aLayoutManager);
friend nsIFrame* NS_NewBoxFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext);
@ -91,8 +91,8 @@ public:
// call this method to get the rect so you don't draw on the debug border or outer border.
// ------ nsIBox -------------
virtual void SetLayoutManager(nsIBoxLayout* aLayout) { mLayoutManager = aLayout; }
virtual nsIBoxLayout* GetLayoutManager() { return mLayoutManager; }
virtual void SetLayoutManager(nsBoxLayout* aLayout) { mLayoutManager = aLayout; }
virtual nsBoxLayout* GetLayoutManager() { return mLayoutManager; }
NS_IMETHOD RelayoutChildAtOrdinal(nsBoxLayoutState& aState, nsIBox* aChild);
@ -181,7 +181,7 @@ public:
virtual ~nsBoxFrame();
nsBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsRoot = PR_FALSE, nsIBoxLayout* aLayoutManager = nsnull);
nsBoxFrame(nsIPresShell* aPresShell, nsStyleContext* aContext, PRBool aIsRoot = PR_FALSE, nsBoxLayout* aLayoutManager = nsnull);
// virtual so nsStackFrame, nsButtonBoxFrame, nsSliderFrame and nsMenuFrame
// can override it
@ -240,7 +240,7 @@ protected:
nscoord mFlex;
nscoord mAscent;
nsCOMPtr<nsIBoxLayout> mLayoutManager;
nsCOMPtr<nsBoxLayout> mLayoutManager;
protected:
nsresult RegUnregAccessKey(PRBool aDoReg);

View File

@ -44,17 +44,10 @@
//
#include "nsBox.h"
#include "nsPresContext.h"
#include "nsCOMPtr.h"
#include "nsIContent.h"
#include "nsHTMLContainerFrame.h"
#include "nsIFrame.h"
#include "nsBoxLayout.h"
nsBoxLayout::nsBoxLayout()
{
}
void
nsBoxLayout::AddBorderAndPadding(nsIBox* aBox, nsSize& aSize)
{
@ -131,42 +124,4 @@ nsBoxLayout::AddSmallestSize(nsSize& aSize, const nsSize& aSize2)
aSize.height = aSize2.height;
}
void
nsBoxLayout::ChildrenInserted(nsIBox* aBox, nsBoxLayoutState& aState,
nsIBox* aPrevBox,
const nsFrameList::Slice& aNewChildren)
{
}
void
nsBoxLayout::ChildrenAppended(nsIBox* aBox, nsBoxLayoutState& aState,
const nsFrameList::Slice& aNewChildren)
{
}
void
nsBoxLayout::ChildrenRemoved(nsIBox* aBox, nsBoxLayoutState& aState, nsIBox* aChildList)
{
}
void
nsBoxLayout::ChildrenSet(nsIBox* aBox, nsBoxLayoutState& aState, nsIBox* aChildList)
{
}
void
nsBoxLayout::IntrinsicWidthsDirty(nsIBox* aBox, nsBoxLayoutState& aState)
{
}
// nsISupports
NS_IMPL_ADDREF(nsBoxLayout)
NS_IMPL_RELEASE(nsBoxLayout)
//
// QueryInterface
//
NS_INTERFACE_MAP_BEGIN(nsBoxLayout)
NS_INTERFACE_MAP_ENTRY(nsIBoxLayout)
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
NS_IMPL_ISUPPORTS1(nsBoxLayout, nsBoxLayout)

View File

@ -38,17 +38,26 @@
#ifndef nsBoxLayout_h___
#define nsBoxLayout_h___
#include "nsIBoxLayout.h"
#include "nsISupports.h"
#include "nsIFrame.h"
class nsBoxLayout : public nsIBoxLayout {
#define NS_BOX_LAYOUT_IID \
{ 0x09d522a7, 0x304c, 0x4137, \
{ 0xaf, 0xc9, 0xe0, 0x80, 0x2e, 0x89, 0xb7, 0xe8 } }
class nsIGridPart;
class nsBoxLayout : public nsISupports {
public:
nsBoxLayout();
nsBoxLayout() {}
virtual ~nsBoxLayout() {}
NS_DECL_ISUPPORTS
NS_DECLARE_STATIC_IID_ACCESSOR(NS_BOX_LAYOUT_IID)
NS_IMETHOD Layout(nsIBox* aBox, nsBoxLayoutState& aState);
virtual nsSize GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
@ -57,12 +66,12 @@ public:
virtual nscoord GetAscent(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
virtual void ChildrenInserted(nsIBox* aBox, nsBoxLayoutState& aState,
nsIBox* aPrevBox,
const nsFrameList::Slice& aNewChildren);
const nsFrameList::Slice& aNewChildren) {}
virtual void ChildrenAppended(nsIBox* aBox, nsBoxLayoutState& aState,
const nsFrameList::Slice& aNewChildren);
virtual void ChildrenRemoved(nsIBox* aBox, nsBoxLayoutState& aState, nsIBox* aChildList);
virtual void ChildrenSet(nsIBox* aBox, nsBoxLayoutState& aState, nsIBox* aChildList);
virtual void IntrinsicWidthsDirty(nsIBox* aBox, nsBoxLayoutState& aState);
const nsFrameList::Slice& aNewChildren) {}
virtual void ChildrenRemoved(nsIBox* aBox, nsBoxLayoutState& aState, nsIBox* aChildList) {}
virtual void ChildrenSet(nsIBox* aBox, nsBoxLayoutState& aState, nsIBox* aChildList) {}
virtual void IntrinsicWidthsDirty(nsIBox* aBox, nsBoxLayoutState& aState) {}
virtual void AddBorderAndPadding(nsIBox* aBox, nsSize& aSize);
virtual void AddMargin(nsIBox* aChild, nsSize& aSize);
@ -74,5 +83,7 @@ public:
static void AddSmallestSize(nsSize& aSize, const nsSize& aToAdd);
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsBoxLayout, NS_BOX_LAYOUT_IID)
#endif

View File

@ -70,7 +70,7 @@ NS_IMPL_FRAMEARENA_HELPERS(nsDeckFrame)
nsDeckFrame::nsDeckFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
: nsBoxFrame(aPresShell, aContext), mIndex(0)
{
nsCOMPtr<nsIBoxLayout> layout;
nsCOMPtr<nsBoxLayout> layout;
NS_NewStackLayout(aPresShell, layout);
SetLayoutManager(layout);
}

View File

@ -1,85 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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/MPL/
*
* 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 the Initial Developer are Copyright (C) 1998
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsIBoxLayout_h___
#define nsIBoxLayout_h___
#include "nsISupports.h"
#include "nsIFrame.h"
class nsBoxLayout;
class nsBoxLayoutState;
class nsRenderingContext;
class nsIGridPart;
struct nsRect;
// 6a529924-c73d-4fae-af7a-0e8084e701d5
#define NS_IBOX_LAYOUT_IID \
{ 0x6a529924, 0xc73d, 0x4fae, \
{ 0xaf, 0x7a, 0x0e, 0x80, 0x84, 0xe7, 0x01, 0xd5 } }
class nsIBoxLayout : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IBOX_LAYOUT_IID)
NS_IMETHOD Layout(nsIBox* aBox, nsBoxLayoutState& aState)=0;
virtual nsSize GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)=0;
virtual nsSize GetMinSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)=0;
virtual nsSize GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)=0;
virtual nscoord GetAscent(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)=0;
// FIXME: Bug 507416. The Children* notifications don't actually
// use all those arguments. Can we just simplify the signatures?
virtual void ChildrenInserted(nsIBox* aBox, nsBoxLayoutState& aState,
nsIBox* aPrevBox,
const nsFrameList::Slice& aNewChildren)=0;
virtual void ChildrenAppended(nsIBox* aBox, nsBoxLayoutState& aState,
const nsFrameList::Slice& aNewChildren)=0;
virtual void ChildrenRemoved(nsIBox* aBox, nsBoxLayoutState& aState, nsIBox* aChildList)=0;
virtual void ChildrenSet(nsIBox* aBox, nsBoxLayoutState& aState, nsIBox* aChildList)=0;
virtual void IntrinsicWidthsDirty(nsIBox* aBox, nsBoxLayoutState& aState)=0;
// Returns this if it is an nsIGridPart, not refcounted
virtual nsIGridPart* AsGridPart() = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIBoxLayout, NS_IBOX_LAYOUT_IID)
#endif

View File

@ -164,7 +164,7 @@ NS_IMPL_ISUPPORTS1(nsListScrollSmoother, nsITimerCallback)
nsListBoxBodyFrame::nsListBoxBodyFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
nsIBoxLayout* aLayoutManager)
nsBoxLayout* aLayoutManager)
: nsBoxFrame(aPresShell, aContext, PR_FALSE, aLayoutManager),
mTopFrame(nsnull),
mBottomFrame(nsnull),
@ -1508,12 +1508,12 @@ nsListBoxBodyFrame::RemoveChildFrame(nsBoxLayoutState &aState,
// Creation Routines ///////////////////////////////////////////////////////////////////////
already_AddRefed<nsIBoxLayout> NS_NewListBoxLayout();
already_AddRefed<nsBoxLayout> NS_NewListBoxLayout();
nsIFrame*
NS_NewListBoxBodyFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
nsCOMPtr<nsIBoxLayout> layout = NS_NewListBoxLayout();
nsCOMPtr<nsBoxLayout> layout = NS_NewListBoxLayout();
if (!layout) {
return nsnull;
}

View File

@ -60,7 +60,7 @@ class nsListBoxBodyFrame : public nsBoxFrame,
public nsIReflowCallback
{
nsListBoxBodyFrame(nsIPresShell* aPresShell, nsStyleContext* aContext,
nsIBoxLayout* aLayoutManager);
nsBoxLayout* aLayoutManager);
virtual ~nsListBoxBodyFrame();
public:

View File

@ -53,7 +53,7 @@ nsListBoxLayout::nsListBoxLayout() : nsGridRowGroupLayout()
{
}
////////// nsIBoxLayout //////////////
////////// nsBoxLayout //////////////
nsSize
nsListBoxLayout::GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState)
@ -242,9 +242,9 @@ nsListBoxLayout::LayoutInternal(nsIBox* aBox, nsBoxLayoutState& aState)
// Creation Routines ///////////////////////////////////////////////////////////////////////
already_AddRefed<nsIBoxLayout> NS_NewListBoxLayout()
already_AddRefed<nsBoxLayout> NS_NewListBoxLayout()
{
nsIBoxLayout* layout = new nsListBoxLayout();
nsBoxLayout* layout = new nsListBoxLayout();
NS_IF_ADDREF(layout);
return layout;
}

View File

@ -50,7 +50,7 @@ class nsListBoxLayout : public nsGridRowGroupLayout
public:
nsListBoxLayout();
// nsIBoxLayout
// nsBoxLayout
NS_IMETHOD Layout(nsIBox* aBox, nsBoxLayoutState& aState);
virtual nsSize GetPrefSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);
virtual nsSize GetMinSize(nsIBox* aBox, nsBoxLayoutState& aBoxLayoutState);

View File

@ -43,12 +43,12 @@
#include "nsINameSpaceManager.h"
#include "nsGkAtoms.h"
#include "nsDisplayList.h"
#include "nsIBoxLayout.h"
#include "nsBoxLayout.h"
nsListItemFrame::nsListItemFrame(nsIPresShell* aPresShell,
nsStyleContext* aContext,
PRBool aIsRoot,
nsIBoxLayout* aLayoutManager)
nsBoxLayout* aLayoutManager)
: nsGridRowLeafFrame(aPresShell, aContext, aIsRoot, aLayoutManager)
{
}
@ -85,12 +85,12 @@ nsListItemFrame::BuildDisplayListForChildren(nsDisplayListBuilder* aBuilder,
// Creation Routine ///////////////////////////////////////////////////////////////////////
already_AddRefed<nsIBoxLayout> NS_NewGridRowLeafLayout();
already_AddRefed<nsBoxLayout> NS_NewGridRowLeafLayout();
nsIFrame*
NS_NewListItemFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
nsCOMPtr<nsIBoxLayout> layout = NS_NewGridRowLeafLayout();
nsCOMPtr<nsBoxLayout> layout = NS_NewGridRowLeafLayout();
if (!layout) {
return nsnull;
}

View File

@ -64,7 +64,7 @@ protected:
nsListItemFrame(nsIPresShell* aPresShell,
nsStyleContext *aContext,
PRBool aIsRoot = nsnull,
nsIBoxLayout* aLayoutManager = nsnull);
nsBoxLayout* aLayoutManager = nsnull);
virtual ~nsListItemFrame();
}; // class nsListItemFrame

View File

@ -74,7 +74,6 @@
#include "nsContentUtils.h"
#include "nsCSSFrameConstructor.h"
#include "nsEventStateManager.h"
#include "nsIBoxLayout.h"
#include "nsIPopupBoxObject.h"
#include "nsPIWindowRoot.h"
#include "nsIReflowCallback.h"

View File

@ -149,7 +149,7 @@ nsRootBoxFrame::nsRootBoxFrame(nsIPresShell* aShell, nsStyleContext* aContext):
{
mPopupSetFrame = nsnull;
nsCOMPtr<nsIBoxLayout> layout;
nsCOMPtr<nsBoxLayout> layout;
NS_NewStackLayout(aShell, layout);
SetLayoutManager(layout);
}

View File

@ -54,7 +54,7 @@
#include "nsBoxFrame.h"
#include "nsBoxFrame.h"
nsIBoxLayout* nsSprocketLayout::gInstance = nsnull;
nsBoxLayout* nsSprocketLayout::gInstance = nsnull;
//#define DEBUG_GROW
@ -64,7 +64,7 @@ nsIBoxLayout* nsSprocketLayout::gInstance = nsnull;
nsresult
NS_NewSprocketLayout( nsIPresShell* aPresShell, nsCOMPtr<nsIBoxLayout>& aNewLayout)
NS_NewSprocketLayout( nsIPresShell* aPresShell, nsCOMPtr<nsBoxLayout>& aNewLayout)
{
if (!nsSprocketLayout::gInstance) {
nsSprocketLayout::gInstance = new nsSprocketLayout();

View File

@ -89,13 +89,13 @@ public:
#define SET_COORD(aX, aY, coord, isHorizontal) if (isHorizontal) { aX = (coord); } else { aY = (coord); }
nsresult NS_NewSprocketLayout(nsIPresShell* aPresShell, nsCOMPtr<nsIBoxLayout>& aNewLayout);
nsresult NS_NewSprocketLayout(nsIPresShell* aPresShell, nsCOMPtr<nsBoxLayout>& aNewLayout);
class nsSprocketLayout : public nsBoxLayout {
public:
friend nsresult NS_NewSprocketLayout(nsIPresShell* aPresShell, nsCOMPtr<nsIBoxLayout>& aNewLayout);
friend nsresult NS_NewSprocketLayout(nsIPresShell* aPresShell, nsCOMPtr<nsBoxLayout>& aNewLayout);
static void Shutdown();
NS_IMETHOD Layout(nsIBox* aBox, nsBoxLayoutState& aState);
@ -162,8 +162,8 @@ private:
// because the sprocket layout manager has no instance variables. We
// can make a static on and reuse it everywhere.
static nsIBoxLayout* gInstance;
// can make a static one and reuse it everywhere.
static nsBoxLayout* gInstance;
};

View File

@ -64,7 +64,7 @@ NS_IMPL_FRAMEARENA_HELPERS(nsStackFrame)
nsStackFrame::nsStackFrame(nsIPresShell* aPresShell, nsStyleContext* aContext):
nsBoxFrame(aPresShell, aContext)
{
nsCOMPtr<nsIBoxLayout> layout;
nsCOMPtr<nsBoxLayout> layout;
NS_NewStackLayout(aPresShell, layout);
SetLayoutManager(layout);
}

View File

@ -52,7 +52,7 @@
#include "nsIContent.h"
#include "nsINameSpaceManager.h"
nsIBoxLayout* nsStackLayout::gInstance = nsnull;
nsBoxLayout* nsStackLayout::gInstance = nsnull;
#define SPECIFIED_LEFT (1 << NS_SIDE_LEFT)
#define SPECIFIED_RIGHT (1 << NS_SIDE_RIGHT)
@ -60,7 +60,7 @@ nsIBoxLayout* nsStackLayout::gInstance = nsnull;
#define SPECIFIED_BOTTOM (1 << NS_SIDE_BOTTOM)
nsresult
NS_NewStackLayout( nsIPresShell* aPresShell, nsCOMPtr<nsIBoxLayout>& aNewLayout)
NS_NewStackLayout( nsIPresShell* aPresShell, nsCOMPtr<nsBoxLayout>& aNewLayout)
{
if (!nsStackLayout::gInstance) {
nsStackLayout::gInstance = new nsStackLayout();

View File

@ -50,13 +50,13 @@
#include "nsBoxLayout.h"
#include "nsCOMPtr.h"
nsresult NS_NewStackLayout(nsIPresShell* aPresShell, nsCOMPtr<nsIBoxLayout>& aNewLayout);
nsresult NS_NewStackLayout(nsIPresShell* aPresShell, nsCOMPtr<nsBoxLayout>& aNewLayout);
class nsStackLayout : public nsBoxLayout
{
public:
friend nsresult NS_NewStackLayout(nsIPresShell* aPresShell, nsCOMPtr<nsIBoxLayout>& aNewLayout);
friend nsresult NS_NewStackLayout(nsIPresShell* aPresShell, nsCOMPtr<nsBoxLayout>& aNewLayout);
static void Shutdown();
nsStackLayout();
@ -75,7 +75,7 @@ public:
static PRUint8 GetOffset(nsBoxLayoutState& aState, nsIBox* aChild, nsMargin& aMargin);
private:
static nsIBoxLayout* gInstance;
static nsBoxLayout* gInstance;
}; // class nsStackLayout