| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 library nodes_mojom; | 5 library nodes_mojom; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:mojo/bindings.dart' as bindings; | 9 import 'package:mojo/bindings.dart' as bindings; |
| 10 import 'package:mojo/core.dart' as core; | 10 import 'package:mojo/core.dart' as core; |
| 11 import 'package:mojo/mojo/bindings/types/mojom_types.mojom.dart' as mojom_types; |
| 12 |
| 11 import 'package:mojo_services/mojo/geometry.mojom.dart' as geometry_mojom; | 13 import 'package:mojo_services/mojo/geometry.mojom.dart' as geometry_mojom; |
| 12 import 'package:mojo_services/mojo/gfx/composition/hit_tests.mojom.dart' as hit_
tests_mojom; | 14 import 'package:mojo_services/mojo/gfx/composition/hit_tests.mojom.dart' as hit_
tests_mojom; |
| 13 | 15 |
| 14 | 16 |
| 15 | 17 |
| 16 class NodeCombinator extends bindings.MojoEnum { | 18 class NodeCombinator extends bindings.MojoEnum { |
| 17 static const NodeCombinator merge = const NodeCombinator._(0); | 19 static const NodeCombinator merge = const NodeCombinator._(0); |
| 18 static const NodeCombinator prune = const NodeCombinator._(1); | 20 static const NodeCombinator prune = const NodeCombinator._(1); |
| 19 static const NodeCombinator fallback = const NodeCombinator._(2); | 21 static const NodeCombinator fallback = const NodeCombinator._(2); |
| 20 | 22 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 } | 59 } |
| 58 | 60 |
| 59 String toString() { | 61 String toString() { |
| 60 switch(this) { | 62 switch(this) { |
| 61 case merge: | 63 case merge: |
| 62 return 'NodeCombinator.merge'; | 64 return 'NodeCombinator.merge'; |
| 63 case prune: | 65 case prune: |
| 64 return 'NodeCombinator.prune'; | 66 return 'NodeCombinator.prune'; |
| 65 case fallback: | 67 case fallback: |
| 66 return 'NodeCombinator.fallback'; | 68 return 'NodeCombinator.fallback'; |
| 69 default: |
| 70 return null; |
| 67 } | 71 } |
| 68 } | 72 } |
| 69 | 73 |
| 70 int toJson() => mojoEnumValue; | 74 int toJson() => mojoEnumValue; |
| 71 } | 75 } |
| 72 | 76 |
| 77 |
| 78 |
| 73 class Node extends bindings.Struct { | 79 class Node extends bindings.Struct { |
| 74 static const List<bindings.StructDataHeader> kVersions = const [ | 80 static const List<bindings.StructDataHeader> kVersions = const [ |
| 75 const bindings.StructDataHeader(56, 0) | 81 const bindings.StructDataHeader(56, 0) |
| 76 ]; | 82 ]; |
| 77 geometry_mojom.Transform contentTransform = null; | 83 geometry_mojom.Transform contentTransform = null; |
| 78 geometry_mojom.Rect contentClip = null; | 84 geometry_mojom.Rect contentClip = null; |
| 79 int hitId = 0; | 85 int hitId = 0; |
| 80 NodeCombinator combinator = new NodeCombinator(0); | 86 NodeCombinator combinator = new NodeCombinator(0); |
| 81 List<int> childNodeIds = null; | 87 List<int> childNodeIds = null; |
| 82 NodeOp op = null; | 88 NodeOp op = null; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 map["contentClip"] = contentClip; | 187 map["contentClip"] = contentClip; |
| 182 map["hitId"] = hitId; | 188 map["hitId"] = hitId; |
| 183 map["combinator"] = combinator; | 189 map["combinator"] = combinator; |
| 184 map["childNodeIds"] = childNodeIds; | 190 map["childNodeIds"] = childNodeIds; |
| 185 map["op"] = op; | 191 map["op"] = op; |
| 186 return map; | 192 return map; |
| 187 } | 193 } |
| 188 } | 194 } |
| 189 | 195 |
| 190 | 196 |
| 197 |
| 198 |
| 191 class RectNodeOp extends bindings.Struct { | 199 class RectNodeOp extends bindings.Struct { |
| 192 static const List<bindings.StructDataHeader> kVersions = const [ | 200 static const List<bindings.StructDataHeader> kVersions = const [ |
| 193 const bindings.StructDataHeader(24, 0) | 201 const bindings.StructDataHeader(24, 0) |
| 194 ]; | 202 ]; |
| 195 geometry_mojom.Rect contentRect = null; | 203 geometry_mojom.Rect contentRect = null; |
| 196 Color color = null; | 204 Color color = null; |
| 197 | 205 |
| 198 RectNodeOp() : super(kVersions.last.size); | 206 RectNodeOp() : super(kVersions.last.size); |
| 199 | 207 |
| 200 static RectNodeOp deserialize(bindings.Message message) { | 208 static RectNodeOp deserialize(bindings.Message message) { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 | 267 |
| 260 Map toJson() { | 268 Map toJson() { |
| 261 Map map = new Map(); | 269 Map map = new Map(); |
| 262 map["contentRect"] = contentRect; | 270 map["contentRect"] = contentRect; |
| 263 map["color"] = color; | 271 map["color"] = color; |
| 264 return map; | 272 return map; |
| 265 } | 273 } |
| 266 } | 274 } |
| 267 | 275 |
| 268 | 276 |
| 277 |
| 278 |
| 269 class ImageNodeOp extends bindings.Struct { | 279 class ImageNodeOp extends bindings.Struct { |
| 270 static const List<bindings.StructDataHeader> kVersions = const [ | 280 static const List<bindings.StructDataHeader> kVersions = const [ |
| 271 const bindings.StructDataHeader(40, 0) | 281 const bindings.StructDataHeader(40, 0) |
| 272 ]; | 282 ]; |
| 273 geometry_mojom.Rect contentRect = null; | 283 geometry_mojom.Rect contentRect = null; |
| 274 geometry_mojom.Rect imageRect = null; | 284 geometry_mojom.Rect imageRect = null; |
| 275 int imageResourceId = 0; | 285 int imageResourceId = 0; |
| 276 Blend blend = null; | 286 Blend blend = null; |
| 277 | 287 |
| 278 ImageNodeOp() : super(kVersions.last.size); | 288 ImageNodeOp() : super(kVersions.last.size); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 Map map = new Map(); | 366 Map map = new Map(); |
| 357 map["contentRect"] = contentRect; | 367 map["contentRect"] = contentRect; |
| 358 map["imageRect"] = imageRect; | 368 map["imageRect"] = imageRect; |
| 359 map["imageResourceId"] = imageResourceId; | 369 map["imageResourceId"] = imageResourceId; |
| 360 map["blend"] = blend; | 370 map["blend"] = blend; |
| 361 return map; | 371 return map; |
| 362 } | 372 } |
| 363 } | 373 } |
| 364 | 374 |
| 365 | 375 |
| 376 |
| 377 |
| 366 class SceneNodeOp extends bindings.Struct { | 378 class SceneNodeOp extends bindings.Struct { |
| 367 static const List<bindings.StructDataHeader> kVersions = const [ | 379 static const List<bindings.StructDataHeader> kVersions = const [ |
| 368 const bindings.StructDataHeader(16, 0) | 380 const bindings.StructDataHeader(16, 0) |
| 369 ]; | 381 ]; |
| 370 int sceneResourceId = 0; | 382 int sceneResourceId = 0; |
| 371 int sceneVersion = 0; | 383 int sceneVersion = 0; |
| 372 | 384 |
| 373 SceneNodeOp() : super(kVersions.last.size); | 385 SceneNodeOp() : super(kVersions.last.size); |
| 374 | 386 |
| 375 static SceneNodeOp deserialize(bindings.Message message) { | 387 static SceneNodeOp deserialize(bindings.Message message) { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 | 444 |
| 433 Map toJson() { | 445 Map toJson() { |
| 434 Map map = new Map(); | 446 Map map = new Map(); |
| 435 map["sceneResourceId"] = sceneResourceId; | 447 map["sceneResourceId"] = sceneResourceId; |
| 436 map["sceneVersion"] = sceneVersion; | 448 map["sceneVersion"] = sceneVersion; |
| 437 return map; | 449 return map; |
| 438 } | 450 } |
| 439 } | 451 } |
| 440 | 452 |
| 441 | 453 |
| 454 |
| 455 |
| 442 class LayerNodeOp extends bindings.Struct { | 456 class LayerNodeOp extends bindings.Struct { |
| 443 static const List<bindings.StructDataHeader> kVersions = const [ | 457 static const List<bindings.StructDataHeader> kVersions = const [ |
| 444 const bindings.StructDataHeader(24, 0) | 458 const bindings.StructDataHeader(24, 0) |
| 445 ]; | 459 ]; |
| 446 geometry_mojom.Size layerSize = null; | 460 geometry_mojom.Size layerSize = null; |
| 447 Blend blend = null; | 461 Blend blend = null; |
| 448 | 462 |
| 449 LayerNodeOp() : super(kVersions.last.size); | 463 LayerNodeOp() : super(kVersions.last.size); |
| 450 | 464 |
| 451 static LayerNodeOp deserialize(bindings.Message message) { | 465 static LayerNodeOp deserialize(bindings.Message message) { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 | 524 |
| 511 Map toJson() { | 525 Map toJson() { |
| 512 Map map = new Map(); | 526 Map map = new Map(); |
| 513 map["layerSize"] = layerSize; | 527 map["layerSize"] = layerSize; |
| 514 map["blend"] = blend; | 528 map["blend"] = blend; |
| 515 return map; | 529 return map; |
| 516 } | 530 } |
| 517 } | 531 } |
| 518 | 532 |
| 519 | 533 |
| 534 |
| 535 |
| 520 class Color extends bindings.Struct { | 536 class Color extends bindings.Struct { |
| 521 static const List<bindings.StructDataHeader> kVersions = const [ | 537 static const List<bindings.StructDataHeader> kVersions = const [ |
| 522 const bindings.StructDataHeader(16, 0) | 538 const bindings.StructDataHeader(16, 0) |
| 523 ]; | 539 ]; |
| 524 int red = 0; | 540 int red = 0; |
| 525 int green = 0; | 541 int green = 0; |
| 526 int blue = 0; | 542 int blue = 0; |
| 527 int alpha = 0; | 543 int alpha = 0; |
| 528 | 544 |
| 529 Color() : super(kVersions.last.size); | 545 Color() : super(kVersions.last.size); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 Map map = new Map(); | 620 Map map = new Map(); |
| 605 map["red"] = red; | 621 map["red"] = red; |
| 606 map["green"] = green; | 622 map["green"] = green; |
| 607 map["blue"] = blue; | 623 map["blue"] = blue; |
| 608 map["alpha"] = alpha; | 624 map["alpha"] = alpha; |
| 609 return map; | 625 return map; |
| 610 } | 626 } |
| 611 } | 627 } |
| 612 | 628 |
| 613 | 629 |
| 630 |
| 631 |
| 614 class Blend extends bindings.Struct { | 632 class Blend extends bindings.Struct { |
| 615 static const List<bindings.StructDataHeader> kVersions = const [ | 633 static const List<bindings.StructDataHeader> kVersions = const [ |
| 616 const bindings.StructDataHeader(16, 0) | 634 const bindings.StructDataHeader(16, 0) |
| 617 ]; | 635 ]; |
| 618 int alpha = 255; | 636 int alpha = 255; |
| 619 | 637 |
| 620 Blend() : super(kVersions.last.size); | 638 Blend() : super(kVersions.last.size); |
| 621 | 639 |
| 622 static Blend deserialize(bindings.Message message) { | 640 static Blend deserialize(bindings.Message message) { |
| 623 var decoder = new bindings.Decoder(message); | 641 var decoder = new bindings.Decoder(message); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 | 690 |
| 673 Map toJson() { | 691 Map toJson() { |
| 674 Map map = new Map(); | 692 Map map = new Map(); |
| 675 map["alpha"] = alpha; | 693 map["alpha"] = alpha; |
| 676 return map; | 694 return map; |
| 677 } | 695 } |
| 678 } | 696 } |
| 679 | 697 |
| 680 | 698 |
| 681 | 699 |
| 700 |
| 701 |
| 682 enum NodeOpTag { | 702 enum NodeOpTag { |
| 683 rect, | 703 rect, |
| 684 image, | 704 image, |
| 685 scene, | 705 scene, |
| 686 layer, | 706 layer, |
| 687 unknown | 707 unknown |
| 688 } | 708 } |
| 689 | 709 |
| 690 class NodeOp extends bindings.Union { | 710 class NodeOp extends bindings.Union { |
| 691 static final _tag_to_int = const { | 711 static final _tag_to_int = const { |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 result += "layer"; | 850 result += "layer"; |
| 831 break; | 851 break; |
| 832 default: | 852 default: |
| 833 result += "unknown"; | 853 result += "unknown"; |
| 834 } | 854 } |
| 835 result += ": $_data)"; | 855 result += ": $_data)"; |
| 836 return result; | 856 return result; |
| 837 } | 857 } |
| 838 } | 858 } |
| 839 | 859 |
| 860 |
| 861 |
| 862 |
| 863 |
| OLD | NEW |