Refactor mode hierarchy
authorAndrew Chadwick <a.t.chadwick@gmail.com>
Tue, 22 Jul 2014 00:37:38 +0000 (01:37 +0100)
committerAndrew Chadwick <a.t.chadwick@gmail.com>
Wed, 23 Jul 2014 22:06:08 +0000 (23:06 +0100)
commit56f26627041cecef79b3c532a4d48378330a579a
tree4d85a570f76f9162dbc3008c725c38b1cc4d84cb
parentc75affa25cc40fcfbc5a8f25db648b340b1df817
Refactor mode hierarchy

Apply a few simplifications and improvements to the mode class hierarchy
that have been pending for a while:

* Use ALL_CAPS for "const"s,
* Split concrete mode classes out of the base class module,
* Rename gui.canvasevent -> gui.mode.
* Registry: build list of registered mode classes to simplify refactoring.
* Remove spring-loaded mixin
  - All concrete spring-loaded mode classes were also DragModes and vv.
  - Push the behaviour down into the DragMode class
* All oneshot modes are drags, merge mixin into OneshotDragMode
16 files changed:
gui/brusheditor.py
gui/buttonmap.py
gui/canvasevent.py [deleted file]
gui/colorpicker.py
gui/document.py
gui/drawwindow.py
gui/fill.py
gui/framewindow.py
gui/freehand.py
gui/layermanip.py [new file with mode: 0644]
gui/linemode.py
gui/mode.py [new file with mode: 0644]
gui/preferenceswindow.py
gui/previewwindow.py
gui/viewmanip.py [new file with mode: 0644]
lib/document.py