local Prop = require("gfx.prop")
local Orientation = Prop:new{ defaultState = false, uid = "ORIENTATION" }

function Orientation:with(elementType)
  local propSelf = self
  function elementType:setVertical(vertical)
    local state = self:isVertical()
    if state ~= vertical then
        self:setDirty()
        propSelf:setState(self, vertical)
    end
  end

  function elementType:isVertical()
    return propSelf:getState(self)
  end

  function elementType:isHorizontal()
    return not self:isVertical()
  end

  return elementType
end

Orientation.VERTICAL = true
Orientation.HORIZONTAL = false

return Orientation