Style cleanup in alm: mostly clean includes.

This commit is contained in:
Alex Wilson
2012-05-03 08:44:31 +12:00
parent ddb65125f9
commit a25ffa4f04
13 changed files with 100 additions and 78 deletions
+10 -9
View File
@@ -7,22 +7,23 @@
#include <AbstractLayout.h>
#include <File.h>
#include <List.h>
#include <Size.h>
#include <SupportDefs.h>
#include <View.h>
#include "Area.h"
#include "Column.h"
#include "LinearSpec.h"
#include "Row.h"
#include "Tab.h"
class BView;
class BLayoutItem;
namespace BALM {
class Column;
class GroupItem;
class Row;
class RowColumnManager;
@@ -57,7 +58,7 @@ public:
YTab* Top() const;
YTab* Bottom() const;
LinearSpec* Solver() const;
LinearProgramming::LinearSpec* Solver() const;
void SetInsets(float insets);
void SetInsets(float x, float y);
@@ -139,8 +140,8 @@ private:
BReference<XTab> right,
BReference<YTab> bottom);
LinearSpec* fSolver;
LinearSpec fOwnSolver;
LinearProgramming::LinearSpec* fSolver;
LinearProgramming::LinearSpec fOwnSolver;
BReference<XTab> fLeft;
BReference<XTab> fRight;
+2
View File
@@ -9,6 +9,8 @@
#include "ALMLayout.h"
class BLayoutItem;
class BView;
class BWindow;
+37 -24
View File
@@ -8,24 +8,32 @@
#include <vector>
#include <Alignment.h>
#include <List.h>
#include <InterfaceDefs.h> // for enum orientation
#include <ObjectList.h>
#include <Referenceable.h>
#include <Size.h>
#include <SupportDefs.h>
#include <View.h>
#include "Column.h"
#include "LinearSpec.h"
#include "Row.h"
#include "Tab.h"
#include <String.h>
class Constraint;
class BLayoutItem;
class BView;
namespace LinearProgramming {
class LinearSpec;
class Constraint;
};
namespace BALM {
class Column;
class Row;
class XTab;
class YTab;
class GroupItem {
public:
GroupItem(BLayoutItem* item);
@@ -108,8 +116,11 @@ public:
BString ToString() const;
Constraint* SetWidthAs(Area* area, float factor = 1.0f);
Constraint* SetHeightAs(Area* area, float factor = 1.0f);
LinearProgramming::Constraint*
SetWidthAs(Area* area, float factor = 1.0f);
LinearProgramming::Constraint*
SetHeightAs(Area* area, float factor = 1.0f);
void InvalidateSizeConstraints();
@@ -118,10 +129,11 @@ public:
private:
Area(BLayoutItem* item);
void _Init(LinearSpec* ls, XTab* left, YTab* top,
XTab* right, YTab* bottom,
RowColumnManager* manager);
void _Init(LinearSpec* ls, Row* row, Column* column,
void _Init(LinearProgramming::LinearSpec* ls,
XTab* left, YTab* top, XTab* right,
YTab* bottom, RowColumnManager* manager);
void _Init(LinearProgramming::LinearSpec* ls,
Row* row, Column* column,
RowColumnManager* manager);
void _DoLayout();
@@ -132,7 +144,7 @@ private:
BLayoutItem* fLayoutItem;
int32 fID;
LinearSpec* fLS;
LinearProgramming::LinearSpec* fLS;
BReference<XTab> fLeft;
BReference<XTab> fRight;
@@ -148,15 +160,16 @@ private:
BSize fTopLeftInset;
BSize fRightBottomInset;
BObjectList<Constraint> fConstraints;
Constraint* fMinContentWidth;
Constraint* fMaxContentWidth;
Constraint* fMinContentHeight;
Constraint* fMaxContentHeight;
double fContentAspectRatio;
Constraint* fContentAspectRatioC;
RowColumnManager* fRowColumnManager;
BObjectList<LinearProgramming::Constraint> fConstraints;
LinearProgramming::Constraint* fMinContentWidth;
LinearProgramming::Constraint* fMaxContentWidth;
LinearProgramming::Constraint* fMinContentHeight;
LinearProgramming::Constraint* fMaxContentHeight;
LinearProgramming::Constraint* fContentAspectRatioC;
public:
friend class BALMLayout;
friend class RowColumnManager;
+16 -7
View File
@@ -6,9 +6,14 @@
#define COLUMN_H
#include "Constraint.h"
#include "LinearSpec.h"
#include "Tab.h"
#include <ObjectList.h>
#include <Referenceable.h>
namespace LinearProgramming {
class Constraint;
class LinearSpec;
};
namespace BALM {
@@ -17,6 +22,8 @@ namespace BALM {
class Area;
class BALMLayout;
class RowColumnManager;
class XTab;
class YTab;
/**
@@ -30,14 +37,16 @@ public:
XTab* Right() const;
private:
Column(LinearSpec* ls, XTab* left, XTab* right);
Column(LinearProgramming::LinearSpec* ls,
XTab* left, XTab* right);
LinearSpec* fLS;
BReference<XTab> fLeft;
BReference<XTab> fRight;
//! managed by RowColumnManager
Constraint* fPrefSizeConstraint;
LinearProgramming::LinearSpec* fLS;
LinearProgramming::Constraint* fPrefSizeConstraint;
// managed by RowColumnManager
BObjectList<Area> fAreas;
public:
+16 -7
View File
@@ -6,9 +6,14 @@
#define ROW_H
#include "Constraint.h"
#include "LinearSpec.h"
#include "Tab.h"
#include <ObjectList.h>
#include <Referenceable.h>
namespace LinearProgramming {
class Constraint;
class LinearSpec;
};
namespace BALM {
@@ -17,6 +22,8 @@ namespace BALM {
class Area;
class BALMLayout;
class RowColumnManager;
class XTab;
class YTab;
/**
@@ -30,14 +37,16 @@ public:
YTab* Bottom() const;
private:
Row(LinearSpec* ls, YTab* top, YTab* bottom);
Row(LinearProgramming::LinearSpec* ls,
YTab* top, YTab* bottom);
LinearSpec* fLS;
BReference<YTab> fTop;
BReference<YTab> fBottom;
//! managed by RowColumnManager
Constraint* fPrefSizeConstraint;
LinearProgramming::LinearSpec* fLS;
LinearProgramming::Constraint* fPrefSizeConstraint;
// managed by RowColumnManager
BObjectList<Area> fAreas;
public:
+3 -5
View File
@@ -7,7 +7,7 @@
#include <Referenceable.h>
#include "LinearSpec.h"
#include "Variable.h"
@@ -24,9 +24,8 @@ class XTab : public Variable, public BReferenceable {
public:
virtual ~XTab();
friend class BALMLayout;
protected:
friend class BALMLayout;
XTab(BALMLayout* layout);
private:
@@ -38,9 +37,8 @@ class YTab : public Variable, public BReferenceable {
public:
virtual ~YTab();
friend class BALMLayout;
protected:
friend class BALMLayout;
YTab(BALMLayout* layout);
private:
+1 -3
View File
@@ -6,9 +6,7 @@
*/
#include "ALMLayout.h"
#include <math.h> // for floor
#include <new>
#include <iostream>
#include <vector>
#include <ControlLook.h>
+2
View File
@@ -7,6 +7,8 @@
#include <Window.h>
#include "Area.h"
namespace BALM {
+7 -11
View File
@@ -4,22 +4,16 @@
* Copyright 2010, Clemens Zeidler <haiku@clemens-zeidler.de>
* Distributed under the terms of the MIT License.
*/
#include "Area.h"
#include <algorithm> // for max
#include <Button.h>
#include <CheckBox.h>
#include <Alignment.h>
#include <ControlLook.h>
#include <PictureButton.h>
#include <RadioButton.h>
#include <StatusBar.h>
#include <StringView.h>
#include <View.h>
#include "ALMLayout.h"
#include "RowColumnManager.h"
#include "Row.h"
#include "Column.h"
using namespace LinearProgramming;
@@ -595,12 +589,14 @@ Area::Area(BLayoutItem* item)
fShrinkPenalties(5, 5),
fGrowPenalties(5, 5),
fContentAspectRatio(-1),
fRowColumnManager(NULL),
fMinContentWidth(NULL),
fMaxContentWidth(NULL),
fMinContentHeight(NULL),
fMaxContentHeight(NULL),
fContentAspectRatio(-1),
fContentAspectRatioC(NULL)
{
fID = new_area_id();
+2 -3
View File
@@ -5,11 +5,10 @@
* Copyright 2010, Clemens Zeidler <haiku@clemens-zeidler.de>
* Distributed under the terms of the MIT License.
*/
#include "Column.h"
#include "ALMLayout.h"
#include "Area.h"
#include "Tab.h"
@@ -51,9 +50,9 @@ Column::~Column()
*/
Column::Column(LinearSpec* ls, XTab* left, XTab* right)
:
fLS(ls),
fLeft(left),
fRight(right),
fLS(ls),
fPrefSizeConstraint(NULL)
{
+2 -5
View File
@@ -5,15 +5,12 @@
* Copyright 2010, Clemens Zeidler <haiku@clemens-zeidler.de>
* Distributed under the terms of the MIT License.
*/
#include "Row.h"
#include "ALMLayout.h"
#include "Area.h"
#include "Tab.h"
#include <SupportDefs.h>
using namespace LinearProgramming;
@@ -53,9 +50,9 @@ Row::~Row()
*/
Row::Row(LinearSpec* ls, YTab* top, YTab* bottom)
:
fLS(ls),
fTop(top),
fBottom(bottom),
fLS(ls),
fPrefSizeConstraint(NULL)
{
+1 -2
View File
@@ -3,10 +3,9 @@
* Copyright 2011, Clemens Zeidler <haiku@clemens-zeidler.de>
* Distributed under the terms of the MIT License.
*/
#include "RowColumnManager.h"
#include <LayoutItem.h>
+1 -2
View File
@@ -2,10 +2,9 @@
* Copyright 2011, Clemens Zeidler <haiku@clemens-zeidler.de>
* Distributed under the terms of the MIT License.
*/
#include <Tab.h>
#include <ALMLayout.h>