/src/mozilla-central/layout/xul/nsBoxLayout.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | // |
8 | | // Eric Vaughan |
9 | | // Netscape Communications |
10 | | // |
11 | | // See documentation in associated header file |
12 | | // |
13 | | |
14 | | #include "nsBox.h" |
15 | | #include "nsCOMPtr.h" |
16 | | #include "nsContainerFrame.h" |
17 | | #include "nsBoxLayout.h" |
18 | | |
19 | | void |
20 | | nsBoxLayout::AddBorderAndPadding(nsIFrame* aBox, nsSize& aSize) |
21 | 0 | { |
22 | 0 | nsBox::AddBorderAndPadding(aBox, aSize); |
23 | 0 | } |
24 | | |
25 | | void |
26 | | nsBoxLayout::AddMargin(nsIFrame* aBox, nsSize& aSize) |
27 | 0 | { |
28 | 0 | nsBox::AddMargin(aBox, aSize); |
29 | 0 | } |
30 | | |
31 | | void |
32 | | nsBoxLayout::AddMargin(nsSize& aSize, const nsMargin& aMargin) |
33 | 0 | { |
34 | 0 | nsBox::AddMargin(aSize, aMargin); |
35 | 0 | } |
36 | | |
37 | | nsSize |
38 | | nsBoxLayout::GetXULPrefSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) |
39 | 0 | { |
40 | 0 | nsSize pref (0, 0); |
41 | 0 | AddBorderAndPadding(aBox, pref); |
42 | 0 |
|
43 | 0 | return pref; |
44 | 0 | } |
45 | | |
46 | | nsSize |
47 | | nsBoxLayout::GetXULMinSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) |
48 | 0 | { |
49 | 0 | nsSize minSize (0,0); |
50 | 0 | AddBorderAndPadding(aBox, minSize); |
51 | 0 | return minSize; |
52 | 0 | } |
53 | | |
54 | | nsSize |
55 | | nsBoxLayout::GetXULMaxSize(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) |
56 | 0 | { |
57 | 0 | //AddBorderAndPadding () never changes maxSize (NS_INTRINSICSIZE) |
58 | 0 | //AddBorderAndPadding(aBox, maxSize); |
59 | 0 | return nsSize (NS_INTRINSICSIZE,NS_INTRINSICSIZE); |
60 | 0 | } |
61 | | |
62 | | |
63 | | nscoord |
64 | | nsBoxLayout::GetAscent(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) |
65 | 0 | { |
66 | 0 | return 0; |
67 | 0 | } |
68 | | |
69 | | NS_IMETHODIMP |
70 | | nsBoxLayout::XULLayout(nsIFrame* aBox, nsBoxLayoutState& aBoxLayoutState) |
71 | 0 | { |
72 | 0 | return NS_OK; |
73 | 0 | } |
74 | | |
75 | | void |
76 | | nsBoxLayout::AddLargestSize(nsSize& aSize, const nsSize& aSize2) |
77 | 0 | { |
78 | 0 | if (aSize2.width > aSize.width) |
79 | 0 | aSize.width = aSize2.width; |
80 | 0 |
|
81 | 0 | if (aSize2.height > aSize.height) |
82 | 0 | aSize.height = aSize2.height; |
83 | 0 | } |
84 | | |
85 | | void |
86 | | nsBoxLayout::AddSmallestSize(nsSize& aSize, const nsSize& aSize2) |
87 | 0 | { |
88 | 0 | if (aSize2.width < aSize.width) |
89 | 0 | aSize.width = aSize2.width; |
90 | 0 |
|
91 | 0 | if (aSize2.height < aSize.height) |
92 | 0 | aSize.height = aSize2.height; |
93 | 0 | } |
94 | | |
95 | | NS_IMPL_ISUPPORTS(nsBoxLayout, nsBoxLayout) |