This patch adds the possibility to update the state of a layout modifier when
modifying the underlying layout before it is run(i.e. using modifyLayout).
The modified state is also passed to the subsequent call of redoLayout, whose
return takes precedence if both functions return modified states of the layout
modifier.
This removes the emptyLayoutMod method from the LayoutModifier class, and
change the Stack parameter to redoLayout to a Maybe Stack one. It also changes
all affected code. This should should be a refactoring without any change in
program behaviour.
Many layouts are written as layout modifiers because they need to
change the stack of the rectangle before executing doLayout.
This is a major source of bugs. all layout modifiers should be using the
LayoutModifier class. This method (modifyLayout) can be used to
manipulate the rectangle and the stack before running doLayout by the
layout modifier.