Chromium Code Reviews| Index: mojo/dart/packages/_mojo_for_test_only/lib/imported/sample_import2.mojom.dart |
| diff --git a/mojo/dart/packages/_mojo_for_test_only/lib/imported/sample_import2.mojom.dart b/mojo/dart/packages/_mojo_for_test_only/lib/imported/sample_import2.mojom.dart |
| index 634e03855ffea086871ee682c035e4d29f221389..98ae0c533a0bd7015a4c93517e1657eb71f204d7 100644 |
| --- a/mojo/dart/packages/_mojo_for_test_only/lib/imported/sample_import2.mojom.dart |
| +++ b/mojo/dart/packages/_mojo_for_test_only/lib/imported/sample_import2.mojom.dart |
| @@ -5,11 +5,13 @@ |
| library sample_import2_mojom; |
| import 'dart:async'; |
| +import 'dart:collection'; |
| import 'package:mojo/bindings.dart' as bindings; |
| import 'package:mojo/core.dart' as core; |
| -import 'package:_mojo_for_test_only/imported/sample_import.mojom.dart' as sample_import_mojom; |
| +import 'package:mojo/mojo/bindings/types/mojom_types.mojom.dart' as mojom_types; |
|
zra
2016/01/27 18:15:11
Please leave this newline.
alexfandrianto
2016/01/28 03:45:12
I think I figured that one out. It was enums who d
|
| +import 'package:_mojo_for_test_only/imported/sample_import.mojom.dart' as sample_import_mojom; |
| class Color extends bindings.MojoEnum { |
| static const Color red = const Color._(0); |
| static const Color black = const Color._(1); |
| @@ -54,12 +56,32 @@ class Color extends bindings.MojoEnum { |
| return 'Color.red'; |
| case black: |
| return 'Color.black'; |
| + default: |
| + return null; |
| } |
| } |
| int toJson() => mojoEnumValue; |
| } |
| +mojom_types.MojomEnum _sampleImport2Color() { |
| + return new mojom_types.MojomEnum() |
| + ..declData = (new mojom_types.DeclarationData() |
| + ..shortName = 'Color' |
| + ..fullIdentifier = 'imported.Color') |
| + ..values = <mojom_types.EnumValue>[ |
| + new mojom_types.EnumValue() |
| + ..declData = (new mojom_types.DeclarationData() |
| + ..shortName = 'Red') |
| + ..enumTypeKey = 'sample_import2_Color__' |
| + ..intValue = 0, |
| + new mojom_types.EnumValue() |
| + ..declData = (new mojom_types.DeclarationData() |
| + ..shortName = 'Black') |
| + ..enumTypeKey = 'sample_import2_Color__' |
| + ..intValue = 1,]; |
| +} |
| + |
| class Size extends bindings.Struct { |
| @@ -137,6 +159,24 @@ class Size extends bindings.Struct { |
| } |
| } |
| +mojom_types.MojomStruct _sampleImport2Size() { |
| + return new mojom_types.MojomStruct() |
| + ..declData = (new mojom_types.DeclarationData() |
| + ..shortName = 'Size' |
| + ..fullIdentifier = 'imported.Size') |
| + ..fields = <mojom_types.StructField>[ |
| + new mojom_types.StructField() |
| + ..declData = (new mojom_types.DeclarationData() |
| + ..shortName = 'Width') |
| + ..type = (new mojom_types.Type() |
| + ..simpleType = mojom_types.SimpleType.int32), |
| + new mojom_types.StructField() |
| + ..declData = (new mojom_types.DeclarationData() |
| + ..shortName = 'Height') |
| + ..type = (new mojom_types.Type() |
| + ..simpleType = mojom_types.SimpleType.int32),]; |
| +} |
| + |
| class Thing extends bindings.Struct { |
| static const List<bindings.StructDataHeader> kVersions = const [ |
| @@ -241,4 +281,80 @@ class Thing extends bindings.Struct { |
| } |
| } |
| +mojom_types.MojomStruct _sampleImport2Thing() { |
| + return new mojom_types.MojomStruct() |
| + ..declData = (new mojom_types.DeclarationData() |
| + ..shortName = 'Thing' |
| + ..fullIdentifier = 'imported.Thing') |
| + ..fields = <mojom_types.StructField>[ |
| + new mojom_types.StructField() |
| + ..declData = (new mojom_types.DeclarationData() |
| + ..shortName = 'Shape') |
| + ..type = (new mojom_types.Type() |
| + ..typeReference = (new mojom_types.TypeReference() |
| + |
| + ..identifier = 'sample_import_Shape__' |
| + ..typeKey = 'sample_import_Shape__' |
| + )), |
| + new mojom_types.StructField() |
| + ..declData = (new mojom_types.DeclarationData() |
| + ..shortName = 'Color') |
| + ..type = (new mojom_types.Type() |
| + ..typeReference = (new mojom_types.TypeReference() |
| + |
| + ..identifier = 'sample_import2_Color__' |
| + ..typeKey = 'sample_import2_Color__' |
| + )), |
| + new mojom_types.StructField() |
| + ..declData = (new mojom_types.DeclarationData() |
| + ..shortName = 'Location') |
| + ..type = (new mojom_types.Type() |
| + ..typeReference = (new mojom_types.TypeReference() |
| + |
| + ..identifier = 'sample_import_Point__' |
| + ..typeKey = 'sample_import_Point__' |
| + )), |
| + new mojom_types.StructField() |
| + ..declData = (new mojom_types.DeclarationData() |
| + ..shortName = 'Size') |
| + ..type = (new mojom_types.Type() |
| + ..typeReference = (new mojom_types.TypeReference() |
| + |
| + ..identifier = 'sample_import2_Size__' |
| + ..typeKey = 'sample_import2_Size__' |
| + )),]; |
| +} |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| + |
| +Map<String, mojom_types.UserDefinedType> _initDescriptions() { |
| + var map = new HashMap<String, mojom_types.UserDefinedType>(); |
| +map["sample_import2_Color__"] = |
|
zra
2016/01/27 18:15:11
indentation
alexfandrianto
2016/01/28 03:45:12
I think it looks better now.
|
| + new mojom_types.UserDefinedType() |
| + ..enumType = _sampleImport2Color(); |
| +map["sample_import2_Size__"] = |
| + new mojom_types.UserDefinedType() |
| + ..structType = _sampleImport2Size(); |
| +map["sample_import2_Thing__"] = |
| + new mojom_types.UserDefinedType() |
| + ..structType = _sampleImport2Thing(); |
| +sample_import_mojom.getAllMojomTypeDefinitions().forEach((String s, mojom_types.UserDefinedType udt) { |
| + map[s] = udt; |
| +}); |
| + |
| + return map; |
| +} |
| + |
| +var _mojomDesc; |
| +Map<String, mojom_types.UserDefinedType> getAllMojomTypeDefinitions() { |
| + if (_mojomDesc == null) { |
| + _mojomDesc = _initDescriptions(); |
| + } |
| + return _mojomDesc; |
| +} |