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

Side by Side Diff: mojo/dart/packages/mojo_services/lib/input/input.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 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 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/mojom_types.mojom.dart' as mojom_types;
12 import 'package:mojo/mojo/service_describer.mojom.dart' as service_describer;
11 13
12 14
13 15
14 class InputClientOnBackButtonParams extends bindings.Struct { 16 class InputClientOnBackButtonParams extends bindings.Struct {
15 static const List<bindings.StructDataHeader> kVersions = const [ 17 static const List<bindings.StructDataHeader> kVersions = const [
16 const bindings.StructDataHeader(8, 0) 18 const bindings.StructDataHeader(8, 0)
17 ]; 19 ];
18 20
19 InputClientOnBackButtonParams() : super(kVersions.last.size); 21 InputClientOnBackButtonParams() : super(kVersions.last.size);
20 22
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 String toString() { 63 String toString() {
62 return "InputClientOnBackButtonParams("")"; 64 return "InputClientOnBackButtonParams("")";
63 } 65 }
64 66
65 Map toJson() { 67 Map toJson() {
66 Map map = new Map(); 68 Map map = new Map();
67 return map; 69 return map;
68 } 70 }
69 } 71 }
70 72
73 mojom_types.MojomStruct _input_InputClient_OnBackButton_Params__() {
74 return new mojom_types.MojomStruct()
75 ..declData = (new mojom_types.DeclarationData()..shortName = 'InputClientOnB ackButtonParams')
76 ..fields = <mojom_types.StructField>[];
77 }
78
71 79
72 class InputClientOnBackButtonResponseParams extends bindings.Struct { 80 class InputClientOnBackButtonResponseParams extends bindings.Struct {
73 static const List<bindings.StructDataHeader> kVersions = const [ 81 static const List<bindings.StructDataHeader> kVersions = const [
74 const bindings.StructDataHeader(8, 0) 82 const bindings.StructDataHeader(8, 0)
75 ]; 83 ];
76 84
77 InputClientOnBackButtonResponseParams() : super(kVersions.last.size); 85 InputClientOnBackButtonResponseParams() : super(kVersions.last.size);
78 86
79 static InputClientOnBackButtonResponseParams deserialize(bindings.Message mess age) { 87 static InputClientOnBackButtonResponseParams deserialize(bindings.Message mess age) {
80 var decoder = new bindings.Decoder(message); 88 var decoder = new bindings.Decoder(message);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 String toString() { 127 String toString() {
120 return "InputClientOnBackButtonResponseParams("")"; 128 return "InputClientOnBackButtonResponseParams("")";
121 } 129 }
122 130
123 Map toJson() { 131 Map toJson() {
124 Map map = new Map(); 132 Map map = new Map();
125 return map; 133 return map;
126 } 134 }
127 } 135 }
128 136
137 mojom_types.MojomStruct _input_InputClient_OnBackButton_ResponseParams__() {
138 return new mojom_types.MojomStruct()
139 ..declData = (new mojom_types.DeclarationData()..shortName = 'InputClientOnB ackButtonResponseParams')
140 ..fields = <mojom_types.StructField>[];
141 }
142
129 143
130 class InputServiceSetClientParams extends bindings.Struct { 144 class InputServiceSetClientParams extends bindings.Struct {
131 static const List<bindings.StructDataHeader> kVersions = const [ 145 static const List<bindings.StructDataHeader> kVersions = const [
132 const bindings.StructDataHeader(16, 0) 146 const bindings.StructDataHeader(16, 0)
133 ]; 147 ];
134 Object client = null; 148 Object client = null;
135 149
136 InputServiceSetClientParams() : super(kVersions.last.size); 150 InputServiceSetClientParams() : super(kVersions.last.size);
137 151
138 static InputServiceSetClientParams deserialize(bindings.Message message) { 152 static InputServiceSetClientParams deserialize(bindings.Message message) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 return "InputServiceSetClientParams(" 199 return "InputServiceSetClientParams("
186 "client: $client" ")"; 200 "client: $client" ")";
187 } 201 }
188 202
189 Map toJson() { 203 Map toJson() {
190 throw new bindings.MojoCodecError( 204 throw new bindings.MojoCodecError(
191 'Object containing handles cannot be encoded to JSON.'); 205 'Object containing handles cannot be encoded to JSON.');
192 } 206 }
193 } 207 }
194 208
209 mojom_types.MojomStruct _input_InputService_SetClient_Params__() {
210 return new mojom_types.MojomStruct()
211 ..declData = (new mojom_types.DeclarationData()..shortName = 'InputServiceSe tClientParams')
212 ..fields = <mojom_types.StructField>[
213 new mojom_types.StructField()
214 ..declData = (new mojom_types.DeclarationData()..shortName = 'Client')
215 ..type = (new mojom_types.Type()
216 ..typeReference = (new mojom_types.TypeReference()
217
218 ..identifier = '_input_InputClient__'
219 ..typeKey = '_input_InputClient__'
220 )),
221 ];
222 }
223
224
195 const int kInputClient_onBackButton_name = 0; 225 const int kInputClient_onBackButton_name = 0;
196 226
197 const String InputClientName = 227 const String InputClientName =
198 'input::InputClient'; 228 'input::InputClient';
199 229
230 mojom_types.MojomInterface _input_InputClient__() {
231 return new mojom_types.MojomInterface()
232 ..declData = (new mojom_types.DeclarationData()..shortName = "InputClient")
233 ..interfaceName = "InputClient"
234 ..methods = <int, mojom_types.MojomMethod>{
235 kInputClient_onBackButton_name: new mojom_types.MojomMethod()
236 ..declData = (new mojom_types.DeclarationData()..shortName = "OnBackButt on")
237 ..ordinal = kInputClient_onBackButton_name
238 ..responseParams = _input_InputClient_OnBackButton_ResponseParams__()..p arameters = _input_InputClient_OnBackButton_Params__(),
239 };
240 }
241
242 class _InputClientServiceDescription extends service_describer.ServiceDescriptio n {
243 // Avoid infinite loop by overriding serviceDescription field.
244 final service_describer.ServiceDescription serviceDescription = null;
245 dynamic getTopLevelInterface([Function responseFactory = null]) {
246 return _input_InputClient__();
247 }
248 dynamic getTypeDefinition(String typeKey,[Function responseFactory = null]) {
249 return getAllMojomTypeDefinitions()[typeKey];
250 }
251 dynamic getAllTypeDefinitions([Function responseFactory = null]) {
252 return getAllMojomTypeDefinitions();
253 }
254 }
255
200 abstract class InputClient { 256 abstract class InputClient {
201 dynamic onBackButton([Function responseFactory = null]); 257 dynamic onBackButton([Function responseFactory = null]);
202 258
203 } 259 }
204 260
205 261
206 class InputClientProxyImpl extends bindings.Proxy { 262 class InputClientProxyImpl extends bindings.Proxy {
207 InputClientProxyImpl.fromEndpoint( 263 InputClientProxyImpl.fromEndpoint(
208 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 264 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
209 265
210 InputClientProxyImpl.fromHandle(core.MojoHandle handle) : 266 InputClientProxyImpl.fromHandle(core.MojoHandle handle) :
211 super.fromHandle(handle); 267 super.fromHandle(handle);
212 268
213 InputClientProxyImpl.unbound() : super.unbound(); 269 InputClientProxyImpl.unbound() : super.unbound();
214 270
215 static InputClientProxyImpl newFromEndpoint( 271 static InputClientProxyImpl newFromEndpoint(
216 core.MojoMessagePipeEndpoint endpoint) { 272 core.MojoMessagePipeEndpoint endpoint) {
217 assert(endpoint.setDescription("For InputClientProxyImpl")); 273 assert(endpoint.setDescription("For InputClientProxyImpl"));
218 return new InputClientProxyImpl.fromEndpoint(endpoint); 274 return new InputClientProxyImpl.fromEndpoint(endpoint);
219 } 275 }
220 276
221 String get name => InputClientName; 277 String get name => InputClientName;
222 278
279 service_describer.ServiceDescription get serviceDescription =>
280 new _InputClientServiceDescription();
281
223 void handleResponse(bindings.ServiceMessage message) { 282 void handleResponse(bindings.ServiceMessage message) {
224 switch (message.header.type) { 283 switch (message.header.type) {
225 case kInputClient_onBackButton_name: 284 case kInputClient_onBackButton_name:
226 var r = InputClientOnBackButtonResponseParams.deserialize( 285 var r = InputClientOnBackButtonResponseParams.deserialize(
227 message.payload); 286 message.payload);
228 if (!message.header.hasRequestId) { 287 if (!message.header.hasRequestId) {
229 proxyError("Expected a message with a valid request Id."); 288 proxyError("Expected a message with a valid request Id.");
230 return; 289 return;
231 } 290 }
232 Completer c = completerMap[message.header.requestId]; 291 Completer c = completerMap[message.header.requestId];
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 assert(_impl == null); 456 assert(_impl == null);
398 _impl = d; 457 _impl = d;
399 } 458 }
400 459
401 String toString() { 460 String toString() {
402 var superString = super.toString(); 461 var superString = super.toString();
403 return "InputClientStub($superString)"; 462 return "InputClientStub($superString)";
404 } 463 }
405 464
406 int get version => 0; 465 int get version => 0;
466
467 service_describer.ServiceDescription get serviceDescription =>
468 new _InputClientServiceDescription();
407 } 469 }
408 470
409 const int kInputService_setClient_name = 0; 471 const int kInputService_setClient_name = 0;
410 472
411 const String InputServiceName = 473 const String InputServiceName =
412 'input::InputService'; 474 'input::InputService';
413 475
476 mojom_types.MojomInterface _input_InputService__() {
477 return new mojom_types.MojomInterface()
478 ..declData = (new mojom_types.DeclarationData()..shortName = "InputService")
479 ..interfaceName = "InputService"
480 ..methods = <int, mojom_types.MojomMethod>{
481 kInputService_setClient_name: new mojom_types.MojomMethod()
482 ..declData = (new mojom_types.DeclarationData()..shortName = "SetClient" )
483 ..ordinal = kInputService_setClient_name..parameters = _input_InputServi ce_SetClient_Params__(),
484 };
485 }
486
487 class _InputServiceServiceDescription extends service_describer.ServiceDescripti on {
488 // Avoid infinite loop by overriding serviceDescription field.
489 final service_describer.ServiceDescription serviceDescription = null;
490 dynamic getTopLevelInterface([Function responseFactory = null]) {
491 return _input_InputService__();
492 }
493 dynamic getTypeDefinition(String typeKey,[Function responseFactory = null]) {
494 return getAllMojomTypeDefinitions()[typeKey];
495 }
496 dynamic getAllTypeDefinitions([Function responseFactory = null]) {
497 return getAllMojomTypeDefinitions();
498 }
499 }
500
414 abstract class InputService { 501 abstract class InputService {
415 void setClient(Object client); 502 void setClient(Object client);
416 503
417 } 504 }
418 505
419 506
420 class InputServiceProxyImpl extends bindings.Proxy { 507 class InputServiceProxyImpl extends bindings.Proxy {
421 InputServiceProxyImpl.fromEndpoint( 508 InputServiceProxyImpl.fromEndpoint(
422 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 509 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
423 510
424 InputServiceProxyImpl.fromHandle(core.MojoHandle handle) : 511 InputServiceProxyImpl.fromHandle(core.MojoHandle handle) :
425 super.fromHandle(handle); 512 super.fromHandle(handle);
426 513
427 InputServiceProxyImpl.unbound() : super.unbound(); 514 InputServiceProxyImpl.unbound() : super.unbound();
428 515
429 static InputServiceProxyImpl newFromEndpoint( 516 static InputServiceProxyImpl newFromEndpoint(
430 core.MojoMessagePipeEndpoint endpoint) { 517 core.MojoMessagePipeEndpoint endpoint) {
431 assert(endpoint.setDescription("For InputServiceProxyImpl")); 518 assert(endpoint.setDescription("For InputServiceProxyImpl"));
432 return new InputServiceProxyImpl.fromEndpoint(endpoint); 519 return new InputServiceProxyImpl.fromEndpoint(endpoint);
433 } 520 }
434 521
435 String get name => InputServiceName; 522 String get name => InputServiceName;
436 523
524 service_describer.ServiceDescription get serviceDescription =>
525 new _InputServiceServiceDescription();
526
437 void handleResponse(bindings.ServiceMessage message) { 527 void handleResponse(bindings.ServiceMessage message) {
438 switch (message.header.type) { 528 switch (message.header.type) {
439 default: 529 default:
440 proxyError("Unexpected message type: ${message.header.type}"); 530 proxyError("Unexpected message type: ${message.header.type}");
441 close(immediate: true); 531 close(immediate: true);
442 break; 532 break;
443 } 533 }
444 } 534 }
445 535
446 String toString() { 536 String toString() {
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 assert(_impl == null); 662 assert(_impl == null);
573 _impl = d; 663 _impl = d;
574 } 664 }
575 665
576 String toString() { 666 String toString() {
577 var superString = super.toString(); 667 var superString = super.toString();
578 return "InputServiceStub($superString)"; 668 return "InputServiceStub($superString)";
579 } 669 }
580 670
581 int get version => 0; 671 int get version => 0;
672
673 service_describer.ServiceDescription get serviceDescription =>
674 new _InputServiceServiceDescription();
582 } 675 }
583 676
584 677
678
679
680
681
682
683
684 var _MojomDesc__ = _initDescriptions();
685
686 Map<String, mojom_types.UserDefinedType> _initDescriptions() {
687 var map = new Map<String, mojom_types.UserDefinedType>();
688
689 map["_input_InputClient_OnBackButton_Params__"] =
690 new mojom_types.UserDefinedType()
691 ..structType = _input_InputClient_OnBackButton_Params__();
692
693
694
695 map["_input_InputClient_OnBackButton_ResponseParams__"] =
696 new mojom_types.UserDefinedType()
697 ..structType = _input_InputClient_OnBackButton_ResponseParams__();
698
699
700
701 map["_input_InputService_SetClient_Params__"] =
702 new mojom_types.UserDefinedType()
703 ..structType = _input_InputService_SetClient_Params__();
704
705
706 map["_input_InputClient__"] =
707 new mojom_types.UserDefinedType()
708 ..interfaceType = _input_InputClient__();
709
710
711
712
713
714 map["_input_InputService__"] =
715 new mojom_types.UserDefinedType()
716 ..interfaceType = _input_InputService__();
717
718 return map;
719 }
720
721 Map<String, mojom_types.UserDefinedType> getAllMojomTypeDefinitions() {
722 return _MojomDesc__;
723 }
724
725
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698