Introduce SharedSolver class to improve BALMLayout's friend feature.

This commit is contained in:
Alex Wilson
2012-05-03 08:45:02 +12:00
parent 708a298e22
commit 419fe0b8ae
9 changed files with 452 additions and 113 deletions
+8 -9
View File
@@ -17,6 +17,10 @@
class BView;
class BLayoutItem;
namespace BPrivate {
class SharedSolver;
};
namespace BALM {
@@ -157,6 +161,7 @@ private:
template <class T>
friend class TabAddTransaction;
friend class BPrivate::SharedSolver;
friend class XTab;
friend class YTab;
@@ -165,6 +170,8 @@ private:
float InsetForTab(XTab* tab) const;
float InsetForTab(YTab* tab) const;
void UpdateConstraints(BLayoutContext* context);
void _RemoveSelfFromTab(XTab* tab);
void _RemoveSelfFromTab(YTab* tab);
bool _HasTabInLayout(XTab* tab);
@@ -174,15 +181,7 @@ private:
BLayoutItem* _LayoutItemToAdd(BView* view);
void _UpdateAreaConstraints();
BSize _CalculateMinSize();
BSize _CalculateMaxSize();
BSize _CalculatePreferredSize();
bool _TrySolve();
LinearProgramming::LinearSpec* fSolver;
BPrivate::SharedSolver* fSolver;
BReference<XTab> fLeft;
BReference<XTab> fRight;