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

Side by Side Diff: mojo/dart/packages/mojo_services/lib/input/input.mojom.dart

Issue 1539673003: Generate Mojom Types in Dart (Take 2) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Update to master and regenerate mojoms Created 4 years, 11 months 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 unified diff | Download patch
OLDNEW
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 input_mojom; 5 library input_mojom;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection';
8 9
9 import 'package:mojo/bindings.dart' as bindings; 10 import 'package:mojo/bindings.dart' as bindings;
10 import 'package:mojo/core.dart' as core; 11 import 'package:mojo/core.dart' as core;
12 import 'package:mojo/mojo/bindings/types/mojom_types.mojom.dart' as mojom_types;
13 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic e_describer;
11 14
12 15
13 16
14 class _InputClientOnBackButtonParams extends bindings.Struct { 17 class _InputClientOnBackButtonParams extends bindings.Struct {
15 static const List<bindings.StructDataHeader> kVersions = const [ 18 static const List<bindings.StructDataHeader> kVersions = const [
16 const bindings.StructDataHeader(8, 0) 19 const bindings.StructDataHeader(8, 0)
17 ]; 20 ];
18 21
19 _InputClientOnBackButtonParams() : super(kVersions.last.size); 22 _InputClientOnBackButtonParams() : super(kVersions.last.size);
20 23
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 63
61 String toString() { 64 String toString() {
62 return "_InputClientOnBackButtonParams("")"; 65 return "_InputClientOnBackButtonParams("")";
63 } 66 }
64 67
65 Map toJson() { 68 Map toJson() {
66 Map map = new Map(); 69 Map map = new Map();
67 return map; 70 return map;
68 } 71 }
69 } 72 }
73 mojom_types.MojomStruct _input_InputClient_OnBackButton_Params__() {
74 return new mojom_types.MojomStruct()
75 ..declData = (new mojom_types.DeclarationData()
76 ..shortName = '_InputClientOnBackButtonParams'
77 ..fullIdentifier = 'input._InputClientOnBackButtonParams')
78 ..fields = <mojom_types.StructField>[];
79 }
70 80
71 81
72 class InputClientOnBackButtonResponseParams extends bindings.Struct { 82 class InputClientOnBackButtonResponseParams extends bindings.Struct {
73 static const List<bindings.StructDataHeader> kVersions = const [ 83 static const List<bindings.StructDataHeader> kVersions = const [
74 const bindings.StructDataHeader(8, 0) 84 const bindings.StructDataHeader(8, 0)
75 ]; 85 ];
76 86
77 InputClientOnBackButtonResponseParams() : super(kVersions.last.size); 87 InputClientOnBackButtonResponseParams() : super(kVersions.last.size);
78 88
79 static InputClientOnBackButtonResponseParams deserialize(bindings.Message mess age) { 89 static InputClientOnBackButtonResponseParams deserialize(bindings.Message mess age) {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 128
119 String toString() { 129 String toString() {
120 return "InputClientOnBackButtonResponseParams("")"; 130 return "InputClientOnBackButtonResponseParams("")";
121 } 131 }
122 132
123 Map toJson() { 133 Map toJson() {
124 Map map = new Map(); 134 Map map = new Map();
125 return map; 135 return map;
126 } 136 }
127 } 137 }
138 mojom_types.MojomStruct _input_InputClient_OnBackButton_ResponseParams__() {
139 return new mojom_types.MojomStruct()
140 ..declData = (new mojom_types.DeclarationData()
141 ..shortName = 'InputClientOnBackButtonResponseParams'
142 ..fullIdentifier = 'input.InputClientOnBackButtonResponseParams')
143 ..fields = <mojom_types.StructField>[];
144 }
128 145
129 146
130 class _InputServiceSetClientParams extends bindings.Struct { 147 class _InputServiceSetClientParams extends bindings.Struct {
131 static const List<bindings.StructDataHeader> kVersions = const [ 148 static const List<bindings.StructDataHeader> kVersions = const [
132 const bindings.StructDataHeader(16, 0) 149 const bindings.StructDataHeader(16, 0)
133 ]; 150 ];
134 Object client = null; 151 Object client = null;
135 152
136 _InputServiceSetClientParams() : super(kVersions.last.size); 153 _InputServiceSetClientParams() : super(kVersions.last.size);
137 154
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 String toString() { 201 String toString() {
185 return "_InputServiceSetClientParams(" 202 return "_InputServiceSetClientParams("
186 "client: $client" ")"; 203 "client: $client" ")";
187 } 204 }
188 205
189 Map toJson() { 206 Map toJson() {
190 throw new bindings.MojoCodecError( 207 throw new bindings.MojoCodecError(
191 'Object containing handles cannot be encoded to JSON.'); 208 'Object containing handles cannot be encoded to JSON.');
192 } 209 }
193 } 210 }
211 mojom_types.MojomStruct _input_InputService_SetClient_Params__() {
212 return new mojom_types.MojomStruct()
213 ..declData = (new mojom_types.DeclarationData()
214 ..shortName = '_InputServiceSetClientParams'
215 ..fullIdentifier = 'input._InputServiceSetClientParams')
216 ..fields = <mojom_types.StructField>[
217 new mojom_types.StructField()
218 ..declData = (new mojom_types.DeclarationData()..shortName = 'Client')
219 ..type = (new mojom_types.Type()
220 ..typeReference = (new mojom_types.TypeReference()
221
222 ..identifier = '_input_InputClient__'
223 ..typeKey = '_input_InputClient__'
224 )),
225 ];
226 }
227
194 228
195 const int _InputClient_onBackButtonName = 0; 229 const int _InputClient_onBackButtonName = 0;
196 230
231 mojom_types.MojomInterface _input_InputClient__() {
232 return new mojom_types.MojomInterface()
233 ..declData = (new mojom_types.DeclarationData()
234 ..shortName = 'InputClient'
235 ..fullIdentifier = 'input.InputClient')
236 ..interfaceName = 'InputClient'
237 ..methods = <int, mojom_types.MojomMethod>{
238 _InputClient_onBackButtonName: new mojom_types.MojomMethod()
239 ..declData = (new mojom_types.DeclarationData()..shortName = 'OnBackButt on')
240 ..ordinal = _InputClient_onBackButtonName
241 ..responseParams = _input_InputClient_OnBackButton_ResponseParams__()..p arameters = _input_InputClient_OnBackButton_Params__(),
242 };
243 }
244
245 class _InputClientServiceDescription implements service_describer.ServiceDescrip tion {
246 dynamic getTopLevelInterface([Function responseFactory = null]) {
247 return _input_InputClient__();
248 }
249 dynamic getTypeDefinition(String typeKey,[Function responseFactory = null]) {
250 return getAllMojomTypeDefinitions()[typeKey];
251 }
252 dynamic getAllTypeDefinitions([Function responseFactory = null]) {
253 return getAllMojomTypeDefinitions();
254 }
255 }
256
197 abstract class InputClient { 257 abstract class InputClient {
198 static const String serviceName = null; 258 static const String serviceName = null;
199 dynamic onBackButton([Function responseFactory = null]); 259 dynamic onBackButton([Function responseFactory = null]);
200 } 260 }
201 261
202 262
203 class _InputClientProxyImpl extends bindings.Proxy { 263 class _InputClientProxyImpl extends bindings.Proxy {
204 _InputClientProxyImpl.fromEndpoint( 264 _InputClientProxyImpl.fromEndpoint(
205 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 265 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
206 266
207 _InputClientProxyImpl.fromHandle(core.MojoHandle handle) : 267 _InputClientProxyImpl.fromHandle(core.MojoHandle handle) :
208 super.fromHandle(handle); 268 super.fromHandle(handle);
209 269
210 _InputClientProxyImpl.unbound() : super.unbound(); 270 _InputClientProxyImpl.unbound() : super.unbound();
211 271
212 static _InputClientProxyImpl newFromEndpoint( 272 static _InputClientProxyImpl newFromEndpoint(
213 core.MojoMessagePipeEndpoint endpoint) { 273 core.MojoMessagePipeEndpoint endpoint) {
214 assert(endpoint.setDescription("For _InputClientProxyImpl")); 274 assert(endpoint.setDescription("For _InputClientProxyImpl"));
215 return new _InputClientProxyImpl.fromEndpoint(endpoint); 275 return new _InputClientProxyImpl.fromEndpoint(endpoint);
216 } 276 }
217 277
278 service_describer.ServiceDescription get serviceDescription =>
279 new _InputClientServiceDescription();
280
218 void handleResponse(bindings.ServiceMessage message) { 281 void handleResponse(bindings.ServiceMessage message) {
219 switch (message.header.type) { 282 switch (message.header.type) {
220 case _InputClient_onBackButtonName: 283 case _InputClient_onBackButtonName:
221 var r = InputClientOnBackButtonResponseParams.deserialize( 284 var r = InputClientOnBackButtonResponseParams.deserialize(
222 message.payload); 285 message.payload);
223 if (!message.header.hasRequestId) { 286 if (!message.header.hasRequestId) {
224 proxyError("Expected a message with a valid request Id."); 287 proxyError("Expected a message with a valid request Id.");
225 return; 288 return;
226 } 289 }
227 Completer c = completerMap[message.header.requestId]; 290 Completer c = completerMap[message.header.requestId];
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 assert(_impl == null); 454 assert(_impl == null);
392 _impl = d; 455 _impl = d;
393 } 456 }
394 457
395 String toString() { 458 String toString() {
396 var superString = super.toString(); 459 var superString = super.toString();
397 return "InputClientStub($superString)"; 460 return "InputClientStub($superString)";
398 } 461 }
399 462
400 int get version => 0; 463 int get version => 0;
464
465
466 service_describer.ServiceDescription get serviceDescription =>
467 new _InputClientServiceDescription();
401 } 468 }
402 469
403 const int _InputService_setClientName = 0; 470 const int _InputService_setClientName = 0;
404 471
472 mojom_types.MojomInterface _input_InputService__() {
473 return new mojom_types.MojomInterface()
474 ..declData = (new mojom_types.DeclarationData()
475 ..shortName = 'InputService'
476 ..fullIdentifier = 'input.InputService')
477 ..interfaceName = 'InputService'
478 ..methods = <int, mojom_types.MojomMethod>{
479 _InputService_setClientName: new mojom_types.MojomMethod()
480 ..declData = (new mojom_types.DeclarationData()..shortName = 'SetClient' )
481 ..ordinal = _InputService_setClientName..parameters = _input_InputServic e_SetClient_Params__(),
482 };
483 }
484
485 class _InputServiceServiceDescription implements service_describer.ServiceDescri ption {
486 dynamic getTopLevelInterface([Function responseFactory = null]) {
487 return _input_InputService__();
488 }
489 dynamic getTypeDefinition(String typeKey,[Function responseFactory = null]) {
490 return getAllMojomTypeDefinitions()[typeKey];
491 }
492 dynamic getAllTypeDefinitions([Function responseFactory = null]) {
493 return getAllMojomTypeDefinitions();
494 }
495 }
496
405 abstract class InputService { 497 abstract class InputService {
406 static const String serviceName = "input::InputService"; 498 static const String serviceName = "input::InputService";
407 void setClient(Object client); 499 void setClient(Object client);
408 } 500 }
409 501
410 502
411 class _InputServiceProxyImpl extends bindings.Proxy { 503 class _InputServiceProxyImpl extends bindings.Proxy {
412 _InputServiceProxyImpl.fromEndpoint( 504 _InputServiceProxyImpl.fromEndpoint(
413 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 505 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
414 506
415 _InputServiceProxyImpl.fromHandle(core.MojoHandle handle) : 507 _InputServiceProxyImpl.fromHandle(core.MojoHandle handle) :
416 super.fromHandle(handle); 508 super.fromHandle(handle);
417 509
418 _InputServiceProxyImpl.unbound() : super.unbound(); 510 _InputServiceProxyImpl.unbound() : super.unbound();
419 511
420 static _InputServiceProxyImpl newFromEndpoint( 512 static _InputServiceProxyImpl newFromEndpoint(
421 core.MojoMessagePipeEndpoint endpoint) { 513 core.MojoMessagePipeEndpoint endpoint) {
422 assert(endpoint.setDescription("For _InputServiceProxyImpl")); 514 assert(endpoint.setDescription("For _InputServiceProxyImpl"));
423 return new _InputServiceProxyImpl.fromEndpoint(endpoint); 515 return new _InputServiceProxyImpl.fromEndpoint(endpoint);
424 } 516 }
425 517
518 service_describer.ServiceDescription get serviceDescription =>
519 new _InputServiceServiceDescription();
520
426 void handleResponse(bindings.ServiceMessage message) { 521 void handleResponse(bindings.ServiceMessage message) {
427 switch (message.header.type) { 522 switch (message.header.type) {
428 default: 523 default:
429 proxyError("Unexpected message type: ${message.header.type}"); 524 proxyError("Unexpected message type: ${message.header.type}");
430 close(immediate: true); 525 close(immediate: true);
431 break; 526 break;
432 } 527 }
433 } 528 }
434 529
435 String toString() { 530 String toString() {
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 assert(_impl == null); 654 assert(_impl == null);
560 _impl = d; 655 _impl = d;
561 } 656 }
562 657
563 String toString() { 658 String toString() {
564 var superString = super.toString(); 659 var superString = super.toString();
565 return "InputServiceStub($superString)"; 660 return "InputServiceStub($superString)";
566 } 661 }
567 662
568 int get version => 0; 663 int get version => 0;
664
665
666 service_describer.ServiceDescription get serviceDescription =>
667 new _InputServiceServiceDescription();
569 } 668 }
570 669
571 670
671
672
673
674
675
676 Map<String, mojom_types.UserDefinedType> _initDescriptions() {
677 var map = new HashMap<String, mojom_types.UserDefinedType>();
678 map["_input_InputClient_OnBackButton_Params__"] =
679 new mojom_types.UserDefinedType()
680 ..structType = _input_InputClient_OnBackButton_Params__();
681 map["_input_InputClient_OnBackButton_ResponseParams__"] =
682 new mojom_types.UserDefinedType()
683 ..structType = _input_InputClient_OnBackButton_ResponseParams__();
684 map["_input_InputService_SetClient_Params__"] =
685 new mojom_types.UserDefinedType()
686 ..structType = _input_InputService_SetClient_Params__();
687 map["_input_InputClient__"] =
688 new mojom_types.UserDefinedType()
689 ..interfaceType = _input_InputClient__();
690 map["_input_InputService__"] =
691 new mojom_types.UserDefinedType()
692 ..interfaceType = _input_InputService__();
693
694 return map;
695 }
696
697 var _MojomDesc;
698 Map<String, mojom_types.UserDefinedType> getAllMojomTypeDefinitions() {
699 if (_MojomDesc == null) {
700 _MojomDesc = _initDescriptions();
701 }
702 return _MojomDesc;
703 }
704
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698