shoes/shoes4 — pull request #467 by PragTob (2013-10-27 23:17:07+00:00)
Title: Margins implementation for Dimensions

Takes care of #465

* with this dimensions can understand all the different margin option values
* introduced `actual_width` and `actual_height` to refer to dimension + margins (needed for layouting etc.) - naming recommendations **welcome**
* removed the margins module and its includes everywhere

**Caution: derivations from Shoes3**
I chose derivate from shoes3 in some places, here is the what and the why (up for discussion):

* **Handling of how margin influences width:** In shoes3 the margin basically gets subtracted from the width e.g. leaving less space for the elements. So for a slot with a width of 100 and a margin of 10 the elements would just have a space of 80 while on the outside it would still just be 100 wide. In the current implementation (easy to change) the elements would still have a space of 100 but the slot would take up 120 to the outside (as returned by actual_width). I chose to go this way because to the best of my knowledge this is what CSS does and Shoes is inspired by CSS. We also already changed some other semantics in favor of CSS semantics over old shoes3 semantics. For reference here is the ![css box model](http://upload.wikimedia.org/wikipedia/commons/a/ab/Boxmodell-detail.gif)
* **return value of `margin`:** Imo in shoes3 it was inconsistent. Not set it would return `nil` (while I consider that a margin of 0). If margin was set to a number it would return the number. If it were set to an array it returned that Array. If margins were initialized through margin_{left, top, right, bottom} then `margin` would still return nil. I chose to always return an Array of all the specific margins (left, top, right, bottom).

(Just noticed that I don't always return that, will push a fix soon)

So yeah input welcome, would love to get this merged quickly.