Aggregates for GSequence
Submitted by Allison (desrt)
Link to original bug (#695938)
Description
We should consider adding support for aggregates to GSequence.
I would suggest supporting only the most obvious simple case (since it happens to be the only one for which we have usecases): integers with an (left) aggregate operation of addition.
In effect this would allow for each node in the sequence to have a 'width' and we could determine:
a) the total 'width' of the sequence
b) the item in the sequence that occupies a particular 'space', taking widths into consideration
The usecases here are for GtkTreeView, GtkTextView and a special GMenuModel that flattens sections. The 'width' would be the number of items 'under' a particular node, plus the size of the node itself. This means that we could quickly convert between real space on the screen and logical space within a model.