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