first steps in merging cBox into constraint packer
This commit is contained in:
parent
860d43697c
commit
af60c50990
@ -30,12 +30,13 @@ namespace ArdourCanvas
|
||||
|
||||
class Rectangle;
|
||||
class ConstrainedItem;
|
||||
class BoxConstrainedItem;
|
||||
|
||||
class LIBCANVAS_API ConstraintPacker : public Container
|
||||
{
|
||||
public:
|
||||
ConstraintPacker (Canvas *);
|
||||
ConstraintPacker (Item *);
|
||||
ConstraintPacker (Canvas *, Orientation o = Horizontal);
|
||||
ConstraintPacker (Item *, Orientation o = Horizontal);
|
||||
|
||||
void add (Item *);
|
||||
void add_front (Item *);
|
||||
@ -72,6 +73,12 @@ public:
|
||||
|
||||
void non_const_preferred_size (Duple& mininum, Duple& natural);
|
||||
virtual void update_constraints ();
|
||||
|
||||
private:
|
||||
Orientation _orientation;
|
||||
typedef std::list<BoxConstrainedItem*> BoxPackedItems;
|
||||
BoxPackedItems vpacked;
|
||||
BoxPackedItems hpacked;
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -37,12 +37,13 @@ using std::vector;
|
||||
using kiwi::Constraint;
|
||||
using namespace kiwi;
|
||||
|
||||
ConstraintPacker::ConstraintPacker (Canvas* canvas)
|
||||
ConstraintPacker::ConstraintPacker (Canvas* canvas, Orientation o)
|
||||
: Container (canvas)
|
||||
, width (X_("packer width"))
|
||||
, height (X_("packer height"))
|
||||
, in_alloc (false)
|
||||
, _need_constraint_update (false)
|
||||
, _orientation (o)
|
||||
{
|
||||
set_fill (false);
|
||||
set_outline (false);
|
||||
@ -52,12 +53,13 @@ ConstraintPacker::ConstraintPacker (Canvas* canvas)
|
||||
_solver.addEditVariable (height, kiwi::strength::strong);
|
||||
}
|
||||
|
||||
ConstraintPacker::ConstraintPacker (Item* parent)
|
||||
ConstraintPacker::ConstraintPacker (Item* parent, Orientation o)
|
||||
: Container (parent)
|
||||
, width (X_("packer width"))
|
||||
, height (X_("packer height"))
|
||||
, in_alloc (false)
|
||||
, _need_constraint_update (false)
|
||||
, _orientation (o)
|
||||
{
|
||||
set_fill (false);
|
||||
set_outline (false);
|
||||
|
Loading…
Reference in New Issue
Block a user