Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1161)

Unified Diff: mojo/dart/packages/_mojo_for_test_only/lib/imported/sample_import.mojom.dart

Issue 1433183002: Generate Mojom Types for Dart (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Simplify identifier_store for Go and Dart Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 46e5b1d6c6d9093bb5470dabdae54e9dd65c4a1a..e4eff1d1b68cc8a4a7024b48187b0550d4445918 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
@@ -8,6 +8,8 @@ import 'dart:async';
import 'package:mojo/bindings.dart' as bindings;
import 'package:mojo/core.dart' as core;
+import 'package:mojo/mojo/mojom_types.mojom.dart' as mojom_types;
+import 'package:mojo/mojo/service_describer.mojom.dart' as service_describer;
class Shape extends bindings.MojoEnum {
static const RECTANGLE = const Shape._(1);
static const CIRCLE = const Shape._(2);
@@ -66,11 +68,31 @@ class Shape extends bindings.MojoEnum {
return 'Shape.TRIANGLE';
case LAST:
return 'Shape.LAST';
+ default:
+ return null;
}
}
int toJson() => value;
}
+
+mojom_types.MojomEnum _sample_import_Shape__() {
+ return new mojom_types.MojomEnum()
+ ..declData = (new mojom_types.DeclarationData()..shortName = "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 RECTANGLE = const AnotherShape._(10);
static const CIRCLE = const AnotherShape._(11);
@@ -122,11 +144,28 @@ class AnotherShape extends bindings.MojoEnum {
return 'AnotherShape.CIRCLE';
case TRIANGLE:
return 'AnotherShape.TRIANGLE';
+ default:
+ return null;
}
}
int toJson() => value;
}
+
+mojom_types.MojomEnum _sample_import_AnotherShape__() {
+ return new mojom_types.MojomEnum()
+ ..declData = (new mojom_types.DeclarationData()..shortName = "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 RECTANGLE = const YetAnotherShape._(20);
static const CIRCLE = const YetAnotherShape._(21);
@@ -178,12 +217,29 @@ class YetAnotherShape extends bindings.MojoEnum {
return 'YetAnotherShape.CIRCLE';
case TRIANGLE:
return 'YetAnotherShape.TRIANGLE';
+ default:
+ return null;
}
}
int toJson() => value;
}
+mojom_types.MojomEnum _sample_import_YetAnotherShape__() {
+ return new mojom_types.MojomEnum()
+ ..declData = (new mojom_types.DeclarationData()..shortName = "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 {
@@ -261,6 +317,20 @@ class Point extends bindings.Struct {
}
}
+mojom_types.MojomStruct _sample_import_Point__() {
+ return new mojom_types.MojomStruct()
+ ..declData = (new mojom_types.DeclarationData()..shortName = '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 {
static const List<bindings.StructDataHeader> kVersions = const [
@@ -319,11 +389,43 @@ class ImportedInterfaceDoSomethingParams extends bindings.Struct {
}
}
+mojom_types.MojomStruct _sample_import_ImportedInterface_DoSomething_Params__() {
+ return new mojom_types.MojomStruct()
+ ..declData = (new mojom_types.DeclarationData()..shortName = 'ImportedInterfaceDoSomethingParams')
+ ..fields = <mojom_types.StructField>[];
+}
+
+
const int kImportedInterface_doSomething_name = 0;
const String ImportedInterfaceName =
'imported::ImportedInterface';
+mojom_types.MojomInterface _sample_import_ImportedInterface__() {
+ return new mojom_types.MojomInterface()
+ ..declData = (new mojom_types.DeclarationData()..shortName = "ImportedInterface")
+ ..interfaceName = "ImportedInterface"
+ ..methods = <int, mojom_types.MojomMethod>{
+kImportedInterface_doSomething_name: new mojom_types.MojomMethod()
+ ..declData = (new mojom_types.DeclarationData()..shortName = "DoSomething")
+ ..ordinal = kImportedInterface_doSomething_name..parameters = _sample_import_ImportedInterface_DoSomething_Params__(),
+ };
+}
+
+class _ImportedInterfaceServiceDescription extends service_describer.ServiceDescription {
+ // Avoid infinite loop by overriding serviceDescription field.
+ final service_describer.ServiceDescription serviceDescription = null;
+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 {
void doSomething();
@@ -347,6 +449,9 @@ class ImportedInterfaceProxyImpl extends bindings.Proxy {
String get name => ImportedInterfaceName;
+ service_describer.ServiceDescription get serviceDescription =>
+ new _ImportedInterfaceServiceDescription();
+
void handleResponse(bindings.ServiceMessage message) {
switch (message.header.type) {
default:
@@ -491,6 +596,63 @@ class ImportedInterfaceStub extends bindings.Stub {
}
int get version => 0;
+
+ service_describer.ServiceDescription get serviceDescription =>
+ new _ImportedInterfaceServiceDescription();
+}
+
+
+
+
+
+
+
+
+var _MojomDesc__ = _initDescriptions();
+
+Map<String, mojom_types.UserDefinedType> _initDescriptions() {
+ var map = new Map<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;
+}
+
+Map<String, mojom_types.UserDefinedType> getAllMojomTypeDefinitions() {
+ return _MojomDesc__;
}

Powered by Google App Engine
This is Rietveld 408576698