3 // Cassowary Incremental Constraint Solver
4 // Original Smalltalk Implementation by Alan Borning
5 // This C++ Implementation by Greg J. Badros, <gjb@cs.washington.edu>
6 // http://www.cs.washington.edu/homes/gjb
7 // (C) 1998, 1999 Greg J. Badros and Alan Borning
8 // See ../LICENSE for legal details regarding this software
15 #if defined(HAVE_CONFIG_H) && !defined(CONFIG_H_INCLUDED) && !defined(CONFIG_INLINE_H_INCLUDED)
16 #include <cassowary/config-inline.h>
17 #define CONFIG_INLINE_H_INCLUDED
22 #include "Cassowary.h"
23 #include "ClSymbolicWeight.h"
29 const ClStrength &ClsRequired();
30 const ClStrength &ClsStrong();
31 const ClStrength &ClsMedium();
32 const ClStrength &ClsWeak();
37 ClStrength(const string &Name, const ClSymbolicWeight &symbolicWeight) :
38 _name(Name), _symbolicWeight(symbolicWeight)
41 // special case for when nLevels = 3, should assert nLevels() == 3
42 ClStrength(const string &Name, double w1, double w2, double w3);
47 virtual bool IsRequired() const
48 { return (_symbolicWeight == ClsRequired()._symbolicWeight); }
51 virtual ostream &PrintOn(ostream &xo) const
55 xo << ":" << symbolicWeight();
59 friend ostream& operator<<(ostream &xos, const ClStrength &Cls)
60 { Cls.PrintOn(xos); return xos; }
64 virtual const ClSymbolicWeight &symbolicWeight() const
65 { return _symbolicWeight; }
77 void SetName(string Name)
80 void SetSymbolicWeight(const ClSymbolicWeight &symbolicWeight)
81 { _symbolicWeight = symbolicWeight; }
85 ClSymbolicWeight _symbolicWeight;