| 74 | | 1. The observer always generates events based on 'function' calls. Even for |
|---|
| 75 | | class method invokations. This is because, when calling a method (say |
|---|
| 76 | | Tree.add) it's the im_func field is executed, which is a function type |
|---|
| 77 | | object. |
|---|
| 78 | | |
|---|
| 79 | | 2. It's important to know if an event came from invoking a method or a simple |
|---|
| 80 | | function. With methods, the first argument always is an instance. This can |
|---|
| 81 | | be handy when writing an undo management systems in case multiple calls |
|---|
| 82 | | from the same instance do not have to be registered (e.g. if a method |
|---|
| 83 | | set_point() is called with exact coordinates (in stead of deltas), only the |
|---|
| 84 | | first call to set_point needs to be remembered. |
|---|
| | 76 | 1. The observer always generates events based on 'function' calls. Even for |
|---|
| | 77 | class method invokations. This is because, when calling a method (say |
|---|
| | 78 | Tree.add) it's the im_func field is executed, which is a function type |
|---|
| | 79 | object. |
|---|
| | 80 | |
|---|
| | 81 | 2. It's important to know if an event came from invoking a method or a simple |
|---|
| | 82 | function. With methods, the first argument always is an instance. This can |
|---|
| | 83 | be handy when writing an undo management systems in case multiple calls |
|---|
| | 84 | from the same instance do not have to be registered (e.g. if a method |
|---|
| | 85 | set_point() is called with exact coordinates (in stead of deltas), only the |
|---|
| | 86 | first call to set_point needs to be remembered. |
|---|
| 92 | | 1. Property setters should be declared with reversible_property() |
|---|
| 93 | | 2. Method (or function) pairs that implement each others reverse operation |
|---|
| 94 | | (e.g. add and remove) should be registered as reversible_pair()'s in the |
|---|
| 95 | | reverser engine. |
|---|
| 96 | | The reverser will construct a tuple (callable, arguments) which are send |
|---|
| 97 | | to every handler registered in the subscribers list. Arguments is a dict(). |
|---|
| 98 | | |
|---|
| 99 | | First thing to do is to actually enable the revert_handler: |
|---|
| | 94 | 1. Property setters should be declared with reversible_property() |
|---|
| | 95 | 2. Method (or function) pairs that implement each others reverse operation |
|---|
| | 96 | (e.g. add and remove) should be registered as reversible_pair()'s in the |
|---|
| | 97 | reverser engine. |
|---|
| | 98 | The reverser will construct a tuple (callable, arguments) which are send |
|---|
| | 99 | to every handler registered in the subscribers list. Arguments is a dict(). |
|---|
| | 100 | |
|---|
| | 101 | First thing to do is to actually enable the ``revert_handler``: |
|---|
| 172 | | canvas.py: |
|---|
| 173 | | Canvas: |
|---|
| 174 | | add() and remove() |
|---|
| 175 | | |
|---|
| 176 | | item.py: |
|---|
| 177 | | Handle: |
|---|
| 178 | | x, y, connectable, movable, visible, connected_to and disconnect properties |
|---|
| 179 | | Item: |
|---|
| 180 | | canvas and matrix properties |
|---|
| 181 | | Element: |
|---|
| 182 | | min_height and min_width properties |
|---|
| 183 | | Line: |
|---|
| 184 | | line_width, fuzziness, orthogonal and horizontal properties; |
|---|
| 185 | | split_segment() and merge_segment() |
|---|
| 186 | | |
|---|
| 187 | | solver.py: |
|---|
| 188 | | Variable: |
|---|
| 189 | | strength and value properties |
|---|
| 190 | | Solver: |
|---|
| 191 | | add_constraint() and remove_constraint() |
|---|
| 192 | | |
|---|
| 193 | | tree.py: |
|---|
| 194 | | Tree: |
|---|
| 195 | | add() and remove() |
|---|
| 196 | | |
|---|
| 197 | | matrix.py: |
|---|
| 198 | | Matrix: |
|---|
| 199 | | invert, translate, rotate and scale |
|---|
| | 167 | canvas.py: |
|---|
| | 168 | Canvas: |
|---|
| | 169 | add() and remove() |
|---|
| | 170 | |
|---|
| | 171 | item.py: |
|---|
| | 172 | Handle: |
|---|
| | 173 | x, y, connectable, movable, visible, connected_to and disconnect properties |
|---|
| | 174 | Item: |
|---|
| | 175 | canvas and matrix properties |
|---|
| | 176 | Element: |
|---|
| | 177 | min_height and min_width properties |
|---|
| | 178 | Line: |
|---|
| | 179 | line_width, fuzziness, orthogonal and horizontal properties; |
|---|
| | 180 | split_segment() and merge_segment() |
|---|
| | 181 | |
|---|
| | 182 | solver.py: |
|---|
| | 183 | Variable: |
|---|
| | 184 | strength and value properties |
|---|
| | 185 | Solver: |
|---|
| | 186 | add_constraint() and remove_constraint() |
|---|
| | 187 | |
|---|
| | 188 | tree.py: |
|---|
| | 189 | Tree: |
|---|
| | 190 | add() and remove() |
|---|
| | 191 | |
|---|
| | 192 | matrix.py: |
|---|
| | 193 | Matrix: |
|---|
| | 194 | invert, translate, rotate and scale |
|---|