summaryrefslogtreecommitdiff
path: root/gtk/gtkconstraintsolverprivate.h
Commit message (Collapse)AuthorAgeFilesLines
* Use explicit values for constraint strengthEmmanuele Bassi2019-07-011-34/+3
| | | | | | | | | | | | | | | | | | Instead of playing games with mapping negative symbolic values to positive ones, let's use the appropriate constants everywhere. This allows us to use: GTK_CONSTRAINT_STRENGTH_WEAK * 2 Or GTK_CONSTRAINT_STRENGTH_STRONG + 1 In code using the public API. We also store the strength values as integers, so we can compare them properly, and only turn them into doubles when they are inserted into the solver, just like every other variable.
* solver: Add private statistics apiMatthias Clasen2019-07-011-0/+3
| | | | | No point in keeping these counters without a way to show them.
* Add GtkConstraintLayoutEmmanuele Bassi2019-06-301-0/+31
| | | | | A layout manager using GtkConstraintSolver to measure and allocate children.
* Add constraint solverEmmanuele Bassi2019-06-301-0/+114
GtkConstraintSolver is an implementation of the Cassowary constraint solving algorithm: http://constraints.cs.washington.edu/cassowary/ The Cassowary method allows to incrementally solve a tableau of linear equations, in the form of: x = y × coefficient + constant with different weights, or strengths, applied to each one. These equations can be used to describe constraints applied to a layout of UI elements, which allows layout managers using the Cassowary method to quickly, and efficiently, lay out widgets in complex relations between themselves and their parent container.