| OLD | NEW |
| 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 // Should become auto-generated. | 5 // Should become auto-generated. |
| 6 | 6 |
| 7 library todomvc_presenter_model; | 7 library todomvc_presenter_model; |
| 8 | 8 |
| 9 import 'todomvc_service.dart'; | 9 import 'todomvc_service.dart'; |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 From the description we would generate dart classes and their path descriptors | 43 From the description we would generate dart classes and their path descriptors |
| 44 for each struct together with the diff algorithm. For services we would create | 44 for each struct together with the diff algorithm. For services we would create |
| 45 command descriptors. All of these would come with serialization support for | 45 command descriptors. All of these would come with serialization support for |
| 46 wire transfer. | 46 wire transfer. |
| 47 | 47 |
| 48 Until then, all of the above is implemented below. | 48 Until then, all of the above is implemented below. |
| 49 | 49 |
| 50 */ | 50 */ |
| 51 | 51 |
| 52 // Tracing to ease debugging on fletch... | 52 // Tracing to ease debugging on dartino... |
| 53 bool TRACE = false; | 53 bool TRACE = false; |
| 54 void trace(obj) { if (TRACE) print(" $obj"); } | 54 void trace(obj) { if (TRACE) print(" $obj"); } |
| 55 | 55 |
| 56 // Some constants. | 56 // Some constants. |
| 57 | 57 |
| 58 const TAG_CONS_FST = 0; | 58 const TAG_CONS_FST = 0; |
| 59 const TAG_CONS_SND = 1; | 59 const TAG_CONS_SND = 1; |
| 60 const TAG_CONS_DELETE_EVENT = 2; | 60 const TAG_CONS_DELETE_EVENT = 2; |
| 61 const TAG_CONS_COMPLETE_EVENT = 3; | 61 const TAG_CONS_COMPLETE_EVENT = 3; |
| 62 const TAG_CONS_UNCOMPLETE_EVENT = 4; | 62 const TAG_CONS_UNCOMPLETE_EVENT = 4; |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 Immutable oldContent; | 369 Immutable oldContent; |
| 370 Patch(this.path, this.content, this.oldContent); | 370 Patch(this.path, this.content, this.oldContent); |
| 371 | 371 |
| 372 void serialize(PatchBuilder builder, EventManager events) { | 372 void serialize(PatchBuilder builder, EventManager events) { |
| 373 trace("Patch::serialize"); | 373 trace("Patch::serialize"); |
| 374 oldContent.unregisterEvents(events); | 374 oldContent.unregisterEvents(events); |
| 375 Path.serialize(path, builder); | 375 Path.serialize(path, builder); |
| 376 content.serialize(builder.initContent(), events); | 376 content.serialize(builder.initContent(), events); |
| 377 } | 377 } |
| 378 } | 378 } |
| OLD | NEW |