michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: // michael@0: // Eric Vaughan michael@0: // Netscape Communications michael@0: // michael@0: // See documentation in associated header file michael@0: // michael@0: michael@0: #include "nsBox.h" michael@0: #include "nsCOMPtr.h" michael@0: #include "nsContainerFrame.h" michael@0: #include "nsBoxLayout.h" michael@0: michael@0: void michael@0: nsBoxLayout::AddBorderAndPadding(nsIFrame* aBox, nsSize& aSize) michael@0: { michael@0: nsBox::AddBorderAndPadding(aBox, aSize); michael@0: } michael@0: michael@0: void michael@0: nsBoxLayout::AddMargin(nsIFrame* aBox, nsSize& aSize) michael@0: { michael@0: nsBox::AddMargin(aBox, aSize); michael@0: } michael@0: michael@0: void michael@0: nsBoxLayout::AddMargin(nsSize& aSize, const nsMargin& aMargin) michael@0: { michael@0: nsBox::AddMargin(aSize, aMargin); michael@0: } michael@0: michael@0: nsSize michael@0: nsBoxLayout::GetPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) michael@0: { michael@0: nsSize pref (0, 0); michael@0: AddBorderAndPadding(aBox, pref); michael@0: michael@0: return pref; michael@0: } michael@0: michael@0: nsSize michael@0: nsBoxLayout::GetMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) michael@0: { michael@0: nsSize minSize (0,0); michael@0: AddBorderAndPadding(aBox, minSize); michael@0: return minSize; michael@0: } michael@0: michael@0: nsSize michael@0: nsBoxLayout::GetMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) michael@0: { michael@0: //AddBorderAndPadding () never changes maxSize (NS_INTRINSICSIZE) michael@0: //AddBorderAndPadding(aBox, maxSize); michael@0: return nsSize (NS_INTRINSICSIZE,NS_INTRINSICSIZE); michael@0: } michael@0: michael@0: michael@0: nscoord michael@0: nsBoxLayout::GetAscent(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) michael@0: { michael@0: return 0; michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: nsBoxLayout::Layout(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) michael@0: { michael@0: return NS_OK; michael@0: } michael@0: michael@0: void michael@0: nsBoxLayout::AddLargestSize(nsSize& aSize, const nsSize& aSize2) michael@0: { michael@0: if (aSize2.width > aSize.width) michael@0: aSize.width = aSize2.width; michael@0: michael@0: if (aSize2.height > aSize.height) michael@0: aSize.height = aSize2.height; michael@0: } michael@0: michael@0: void michael@0: nsBoxLayout::AddSmallestSize(nsSize& aSize, const nsSize& aSize2) michael@0: { michael@0: if (aSize2.width < aSize.width) michael@0: aSize.width = aSize2.width; michael@0: michael@0: if (aSize2.height < aSize.height) michael@0: aSize.height = aSize2.height; michael@0: } michael@0: michael@0: NS_IMPL_ISUPPORTS(nsBoxLayout, nsBoxLayout)