26 lines
630 B
Text
26 lines
630 B
Text
|
undo/redo api proposal
|
||
|
|
||
|
|
||
|
|
||
|
o o o o o o o o
|
||
|
|
||
|
|
||
|
undoredo.create_method();
|
||
|
undoredo.add_do_method(node,"add_child",node_to_add);
|
||
|
undoredo.add_undo_method(node,"remove_child",node_to_add);
|
||
|
undoredo.add_add_data(node_to_add);
|
||
|
undoredo.commit()
|
||
|
|
||
|
undoredo.create_method();
|
||
|
undoredo.add_do_method(node,"remove_node",node_to_remove);
|
||
|
undoredo.add_undo_method(node,"add_node",node_to_remove);
|
||
|
undoredo.add_remove_data(node_to_remove);
|
||
|
undoredo.commit()
|
||
|
|
||
|
|
||
|
undoredo.create_property();
|
||
|
undoredo.add_do_set(node,"property",value);
|
||
|
undoredo.add_undo_set(node,"property",previous_value);
|
||
|
undoredo.add_remove_data(node_to_remove);
|
||
|
undoredo.commit()
|