| Index: mojo/dart/packages/_mojo_for_test_only/lib/imported/sample_import.mojom.dart
|
| diff --git a/mojo/dart/packages/_mojo_for_test_only/lib/imported/sample_import.mojom.dart b/mojo/dart/packages/_mojo_for_test_only/lib/imported/sample_import.mojom.dart
|
| index 83d2763d63fd08503d0f0e3d9d7122f706b83fe8..e797fc71f480d38ef114fe6379cbd010c8e413e8 100644
|
| --- a/mojo/dart/packages/_mojo_for_test_only/lib/imported/sample_import.mojom.dart
|
| +++ b/mojo/dart/packages/_mojo_for_test_only/lib/imported/sample_import.mojom.dart
|
| @@ -5,10 +5,12 @@
|
| library sample_import_mojom;
|
|
|
| import 'dart:async';
|
| +import 'dart:collection';
|
|
|
| import 'package:mojo/bindings.dart' as bindings;
|
| import 'package:mojo/core.dart' as core;
|
| -
|
| +import 'package:mojo/mojo/bindings/types/mojom_types.mojom.dart' as mojom_types;
|
| +import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as service_describer;
|
| class Shape extends bindings.MojoEnum {
|
| static const Shape rectangle = const Shape._(1);
|
| static const Shape circle = const Shape._(2);
|
| @@ -67,12 +69,33 @@ class Shape extends bindings.MojoEnum {
|
| return 'Shape.triangle';
|
| case last:
|
| return 'Shape.last';
|
| + default:
|
| + return null;
|
| }
|
| }
|
|
|
| int toJson() => mojoEnumValue;
|
| }
|
|
|
| +mojom_types.MojomEnum _sample_import_Shape__() {
|
| + return new mojom_types.MojomEnum()
|
| + ..declData = (new mojom_types.DeclarationData()
|
| + ..shortName = 'Shape'
|
| + ..fullIdentifier = 'imported.Shape')
|
| + ..values = <mojom_types.EnumValue>[new mojom_types.EnumValue()
|
| + ..declData = (new mojom_types.DeclarationData()..shortName = 'Rectangle')
|
| + ..enumTypeKey = '_sample_import_Shape__'
|
| + ..intValue = 1,new mojom_types.EnumValue()
|
| + ..declData = (new mojom_types.DeclarationData()..shortName = 'Circle')
|
| + ..enumTypeKey = '_sample_import_Shape__'
|
| + ..intValue = 2,new mojom_types.EnumValue()
|
| + ..declData = (new mojom_types.DeclarationData()..shortName = 'Triangle')
|
| + ..enumTypeKey = '_sample_import_Shape__'
|
| + ..intValue = 3,new mojom_types.EnumValue()
|
| + ..declData = (new mojom_types.DeclarationData()..shortName = 'Last')
|
| + ..enumTypeKey = '_sample_import_Shape__'
|
| + ..intValue = 3,];
|
| +}
|
| class AnotherShape extends bindings.MojoEnum {
|
| static const AnotherShape rectangle = const AnotherShape._(10);
|
| static const AnotherShape circle = const AnotherShape._(11);
|
| @@ -124,12 +147,30 @@ class AnotherShape extends bindings.MojoEnum {
|
| return 'AnotherShape.circle';
|
| case triangle:
|
| return 'AnotherShape.triangle';
|
| + default:
|
| + return null;
|
| }
|
| }
|
|
|
| int toJson() => mojoEnumValue;
|
| }
|
|
|
| +mojom_types.MojomEnum _sample_import_AnotherShape__() {
|
| + return new mojom_types.MojomEnum()
|
| + ..declData = (new mojom_types.DeclarationData()
|
| + ..shortName = 'AnotherShape'
|
| + ..fullIdentifier = 'imported.AnotherShape')
|
| + ..values = <mojom_types.EnumValue>[new mojom_types.EnumValue()
|
| + ..declData = (new mojom_types.DeclarationData()..shortName = 'Rectangle')
|
| + ..enumTypeKey = '_sample_import_AnotherShape__'
|
| + ..intValue = 10,new mojom_types.EnumValue()
|
| + ..declData = (new mojom_types.DeclarationData()..shortName = 'Circle')
|
| + ..enumTypeKey = '_sample_import_AnotherShape__'
|
| + ..intValue = 11,new mojom_types.EnumValue()
|
| + ..declData = (new mojom_types.DeclarationData()..shortName = 'Triangle')
|
| + ..enumTypeKey = '_sample_import_AnotherShape__'
|
| + ..intValue = 12,];
|
| +}
|
| class YetAnotherShape extends bindings.MojoEnum {
|
| static const YetAnotherShape rectangle = const YetAnotherShape._(20);
|
| static const YetAnotherShape circle = const YetAnotherShape._(21);
|
| @@ -181,12 +222,31 @@ class YetAnotherShape extends bindings.MojoEnum {
|
| return 'YetAnotherShape.circle';
|
| case triangle:
|
| return 'YetAnotherShape.triangle';
|
| + default:
|
| + return null;
|
| }
|
| }
|
|
|
| int toJson() => mojoEnumValue;
|
| }
|
|
|
| +mojom_types.MojomEnum _sample_import_YetAnotherShape__() {
|
| + return new mojom_types.MojomEnum()
|
| + ..declData = (new mojom_types.DeclarationData()
|
| + ..shortName = 'YetAnotherShape'
|
| + ..fullIdentifier = 'imported.YetAnotherShape')
|
| + ..values = <mojom_types.EnumValue>[new mojom_types.EnumValue()
|
| + ..declData = (new mojom_types.DeclarationData()..shortName = 'Rectangle')
|
| + ..enumTypeKey = '_sample_import_YetAnotherShape__'
|
| + ..intValue = 20,new mojom_types.EnumValue()
|
| + ..declData = (new mojom_types.DeclarationData()..shortName = 'Circle')
|
| + ..enumTypeKey = '_sample_import_YetAnotherShape__'
|
| + ..intValue = 21,new mojom_types.EnumValue()
|
| + ..declData = (new mojom_types.DeclarationData()..shortName = 'Triangle')
|
| + ..enumTypeKey = '_sample_import_YetAnotherShape__'
|
| + ..intValue = 22,];
|
| +}
|
| +
|
|
|
|
|
| class Point extends bindings.Struct {
|
| @@ -263,6 +323,21 @@ class Point extends bindings.Struct {
|
| return map;
|
| }
|
| }
|
| +mojom_types.MojomStruct _sample_import_Point__() {
|
| + return new mojom_types.MojomStruct()
|
| + ..declData = (new mojom_types.DeclarationData()
|
| + ..shortName = 'Point'
|
| + ..fullIdentifier = 'imported.Point')
|
| + ..fields = <mojom_types.StructField>[
|
| + new mojom_types.StructField()
|
| + ..declData = (new mojom_types.DeclarationData()..shortName = 'X')
|
| + ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.int32),
|
| +
|
| + new mojom_types.StructField()
|
| + ..declData = (new mojom_types.DeclarationData()..shortName = 'Y')
|
| + ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.int32),
|
| + ];
|
| +}
|
|
|
|
|
| class _ImportedInterfaceDoSomethingParams extends bindings.Struct {
|
| @@ -321,9 +396,42 @@ class _ImportedInterfaceDoSomethingParams extends bindings.Struct {
|
| return map;
|
| }
|
| }
|
| +mojom_types.MojomStruct _sample_import_ImportedInterface_DoSomething_Params__() {
|
| + return new mojom_types.MojomStruct()
|
| + ..declData = (new mojom_types.DeclarationData()
|
| + ..shortName = '_ImportedInterfaceDoSomethingParams'
|
| + ..fullIdentifier = 'imported._ImportedInterfaceDoSomethingParams')
|
| + ..fields = <mojom_types.StructField>[];
|
| +}
|
| +
|
|
|
| const int _ImportedInterface_doSomethingName = 0;
|
|
|
| +mojom_types.MojomInterface _sample_import_ImportedInterface__() {
|
| + return new mojom_types.MojomInterface()
|
| + ..declData = (new mojom_types.DeclarationData()
|
| + ..shortName = 'ImportedInterface'
|
| + ..fullIdentifier = 'imported.ImportedInterface')
|
| + ..interfaceName = 'ImportedInterface'
|
| + ..methods = <int, mojom_types.MojomMethod>{
|
| +_ImportedInterface_doSomethingName: new mojom_types.MojomMethod()
|
| + ..declData = (new mojom_types.DeclarationData()..shortName = 'DoSomething')
|
| + ..ordinal = _ImportedInterface_doSomethingName..parameters = _sample_import_ImportedInterface_DoSomething_Params__(),
|
| + };
|
| +}
|
| +
|
| +class _ImportedInterfaceServiceDescription implements service_describer.ServiceDescription {
|
| +dynamic getTopLevelInterface([Function responseFactory = null]) {
|
| + return _sample_import_ImportedInterface__();
|
| + }
|
| + dynamic getTypeDefinition(String typeKey,[Function responseFactory = null]) {
|
| + return getAllMojomTypeDefinitions()[typeKey];
|
| + }
|
| + dynamic getAllTypeDefinitions([Function responseFactory = null]) {
|
| + return getAllMojomTypeDefinitions();
|
| + }
|
| +}
|
| +
|
| abstract class ImportedInterface {
|
| static const String serviceName = null;
|
| void doSomething();
|
| @@ -345,6 +453,9 @@ class _ImportedInterfaceProxyImpl extends bindings.Proxy {
|
| return new _ImportedInterfaceProxyImpl.fromEndpoint(endpoint);
|
| }
|
|
|
| + service_describer.ServiceDescription get serviceDescription =>
|
| + new _ImportedInterfaceServiceDescription();
|
| +
|
| void handleResponse(bindings.ServiceMessage message) {
|
| switch (message.header.type) {
|
| default:
|
| @@ -487,6 +598,47 @@ class ImportedInterfaceStub extends bindings.Stub {
|
| }
|
|
|
| int get version => 0;
|
| +
|
| +
|
| + service_describer.ServiceDescription get serviceDescription =>
|
| + new _ImportedInterfaceServiceDescription();
|
| +}
|
| +
|
| +
|
| +
|
| +
|
| +
|
| +
|
| +
|
| +Map<String, mojom_types.UserDefinedType> _initDescriptions() {
|
| + var map = new HashMap<String, mojom_types.UserDefinedType>();
|
| +map["_sample_import_Shape__"] =
|
| + new mojom_types.UserDefinedType()
|
| + ..enumType = _sample_import_Shape__();
|
| +map["_sample_import_AnotherShape__"] =
|
| + new mojom_types.UserDefinedType()
|
| + ..enumType = _sample_import_AnotherShape__();
|
| +map["_sample_import_YetAnotherShape__"] =
|
| + new mojom_types.UserDefinedType()
|
| + ..enumType = _sample_import_YetAnotherShape__();
|
| +map["_sample_import_Point__"] =
|
| + new mojom_types.UserDefinedType()
|
| + ..structType = _sample_import_Point__();
|
| +map["_sample_import_ImportedInterface_DoSomething_Params__"] =
|
| + new mojom_types.UserDefinedType()
|
| + ..structType = _sample_import_ImportedInterface_DoSomething_Params__();
|
| +map["_sample_import_ImportedInterface__"] =
|
| + new mojom_types.UserDefinedType()
|
| + ..interfaceType = _sample_import_ImportedInterface__();
|
| +
|
| + return map;
|
| }
|
|
|
| +var _MojomDesc;
|
| +Map<String, mojom_types.UserDefinedType> getAllMojomTypeDefinitions() {
|
| + if (_MojomDesc == null) {
|
| + _MojomDesc = _initDescriptions();
|
| + }
|
| + return _MojomDesc;
|
| +}
|
|
|
|
|