OLD | NEW |
1 // WARNING: DO NOT EDIT. This file was generated by a program. | 1 // WARNING: DO NOT EDIT. This file was generated by a program. |
2 // See $MOJO_SDK/tools/bindings/mojom_bindings_generator.py. | 2 // See $MOJO_SDK/tools/bindings/mojom_bindings_generator.py. |
3 | 3 |
4 library sample_import_mojom; | 4 library sample_import_mojom; |
5 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:collection'; | 6 import 'dart:collection'; |
7 import 'dart:convert'; | 7 import 'dart:convert'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 import 'dart:typed_data'; | 9 import 'dart:typed_data'; |
10 import 'package:mojo/bindings.dart' as bindings; | 10 import 'package:mojo/bindings.dart' as bindings; |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 | 200 |
201 class Point extends bindings.Struct { | 201 class Point extends bindings.Struct { |
202 static const List<bindings.StructDataHeader> kVersions = const [ | 202 static const List<bindings.StructDataHeader> kVersions = const [ |
203 const bindings.StructDataHeader(16, 0) | 203 const bindings.StructDataHeader(16, 0) |
204 ]; | 204 ]; |
205 int x = 0; | 205 int x = 0; |
206 int y = 0; | 206 int y = 0; |
207 | 207 |
208 Point() : super(kVersions.last.size); | 208 Point() : super(kVersions.last.size); |
209 | 209 |
| 210 Point.init( |
| 211 int this.x, |
| 212 int this.y |
| 213 ) : super(kVersions.last.size); |
| 214 |
210 static Point deserialize(bindings.Message message) { | 215 static Point deserialize(bindings.Message message) { |
211 var decoder = new bindings.Decoder(message); | 216 var decoder = new bindings.Decoder(message); |
212 var result = decode(decoder); | 217 var result = decode(decoder); |
213 if (decoder.excessHandles != null) { | 218 if (decoder.excessHandles != null) { |
214 decoder.excessHandles.forEach((h) => h.close()); | 219 decoder.excessHandles.forEach((h) => h.close()); |
215 } | 220 } |
216 return result; | 221 return result; |
217 } | 222 } |
218 | 223 |
219 static Point decode(bindings.Decoder decoder0) { | 224 static Point decode(bindings.Decoder decoder0) { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 } | 289 } |
285 | 290 |
286 | 291 |
287 class _ImportedInterfaceDoSomethingParams extends bindings.Struct { | 292 class _ImportedInterfaceDoSomethingParams extends bindings.Struct { |
288 static const List<bindings.StructDataHeader> kVersions = const [ | 293 static const List<bindings.StructDataHeader> kVersions = const [ |
289 const bindings.StructDataHeader(8, 0) | 294 const bindings.StructDataHeader(8, 0) |
290 ]; | 295 ]; |
291 | 296 |
292 _ImportedInterfaceDoSomethingParams() : super(kVersions.last.size); | 297 _ImportedInterfaceDoSomethingParams() : super(kVersions.last.size); |
293 | 298 |
| 299 _ImportedInterfaceDoSomethingParams.init( |
| 300 ) : super(kVersions.last.size); |
| 301 |
294 static _ImportedInterfaceDoSomethingParams deserialize(bindings.Message messag
e) { | 302 static _ImportedInterfaceDoSomethingParams deserialize(bindings.Message messag
e) { |
295 var decoder = new bindings.Decoder(message); | 303 var decoder = new bindings.Decoder(message); |
296 var result = decode(decoder); | 304 var result = decode(decoder); |
297 if (decoder.excessHandles != null) { | 305 if (decoder.excessHandles != null) { |
298 decoder.excessHandles.forEach((h) => h.close()); | 306 decoder.excessHandles.forEach((h) => h.close()); |
299 } | 307 } |
300 return result; | 308 return result; |
301 } | 309 } |
302 | 310 |
303 static _ImportedInterfaceDoSomethingParams decode(bindings.Decoder decoder0) { | 311 static _ImportedInterfaceDoSomethingParams decode(bindings.Decoder decoder0) { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 | 345 |
338 Map toJson() { | 346 Map toJson() { |
339 Map map = new Map(); | 347 Map map = new Map(); |
340 return map; | 348 return map; |
341 } | 349 } |
342 } | 350 } |
343 | 351 |
344 const int _importedInterfaceMethodDoSomethingName = 0; | 352 const int _importedInterfaceMethodDoSomethingName = 0; |
345 | 353 |
346 class _ImportedInterfaceServiceDescription implements service_describer.ServiceD
escription { | 354 class _ImportedInterfaceServiceDescription implements service_describer.ServiceD
escription { |
347 dynamic getTopLevelInterface([Function responseFactory]) => | 355 void getTopLevelInterface(Function responder) { |
348 responseFactory(null); | 356 responder(null); |
| 357 } |
349 | 358 |
350 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 359 void getTypeDefinition(String typeKey, Function responder) { |
351 responseFactory(null); | 360 responder(null); |
| 361 } |
352 | 362 |
353 dynamic getAllTypeDefinitions([Function responseFactory]) => | 363 void getAllTypeDefinitions(Function responder) { |
354 responseFactory(null); | 364 responder(null); |
| 365 } |
355 } | 366 } |
356 | 367 |
357 abstract class ImportedInterface { | 368 abstract class ImportedInterface { |
358 static const String serviceName = null; | 369 static const String serviceName = null; |
359 | 370 |
360 static service_describer.ServiceDescription _cachedServiceDescription; | 371 static service_describer.ServiceDescription _cachedServiceDescription; |
361 static service_describer.ServiceDescription get serviceDescription { | 372 static service_describer.ServiceDescription get serviceDescription { |
362 if (_cachedServiceDescription == null) { | 373 if (_cachedServiceDescription == null) { |
363 _cachedServiceDescription = new _ImportedInterfaceServiceDescription(); | 374 _cachedServiceDescription = new _ImportedInterfaceServiceDescription(); |
364 } | 375 } |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 : super.fromHandle(handle, autoBegin: impl != null) { | 504 : super.fromHandle(handle, autoBegin: impl != null) { |
494 _impl = impl; | 505 _impl = impl; |
495 } | 506 } |
496 | 507 |
497 _ImportedInterfaceStubControl.unbound([this._impl]) : super.unbound(); | 508 _ImportedInterfaceStubControl.unbound([this._impl]) : super.unbound(); |
498 | 509 |
499 String get serviceName => ImportedInterface.serviceName; | 510 String get serviceName => ImportedInterface.serviceName; |
500 | 511 |
501 | 512 |
502 | 513 |
503 dynamic handleMessage(bindings.ServiceMessage message) { | 514 void handleMessage(bindings.ServiceMessage message) { |
504 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 515 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
505 return bindings.ControlMessageHandler.handleMessage(this, | 516 bindings.ControlMessageHandler.handleMessage( |
506 0, | 517 this, 0, message); |
507 message); | 518 return; |
508 } | 519 } |
509 if (_impl == null) { | 520 if (_impl == null) { |
510 throw new core.MojoApiError("$this has no implementation set"); | 521 throw new core.MojoApiError("$this has no implementation set"); |
511 } | 522 } |
512 switch (message.header.type) { | 523 switch (message.header.type) { |
513 case _importedInterfaceMethodDoSomethingName: | 524 case _importedInterfaceMethodDoSomethingName: |
514 _impl.doSomething(); | 525 _impl.doSomething(); |
515 break; | 526 break; |
516 default: | 527 default: |
517 throw new bindings.MojoCodecError("Unexpected message name"); | 528 throw new bindings.MojoCodecError("Unexpected message name"); |
518 break; | 529 break; |
519 } | 530 } |
520 return null; | |
521 } | 531 } |
522 | 532 |
523 ImportedInterface get impl => _impl; | 533 ImportedInterface get impl => _impl; |
524 set impl(ImportedInterface d) { | 534 set impl(ImportedInterface d) { |
525 if (d == null) { | 535 if (d == null) { |
526 throw new core.MojoApiError("$this: Cannot set a null implementation"); | 536 throw new core.MojoApiError("$this: Cannot set a null implementation"); |
527 } | 537 } |
528 if (isBound && (_impl == null)) { | 538 if (isBound && (_impl == null)) { |
529 beginHandlingEvents(); | 539 beginHandlingEvents(); |
530 } | 540 } |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 | 592 |
583 Map<String, mojom_types.UserDefinedType> getAllMojomTypeDefinitions() { | 593 Map<String, mojom_types.UserDefinedType> getAllMojomTypeDefinitions() { |
584 return getRuntimeTypeInfo().typeMap; | 594 return getRuntimeTypeInfo().typeMap; |
585 } | 595 } |
586 | 596 |
587 var _runtimeTypeInfo; | 597 var _runtimeTypeInfo; |
588 mojom_types.RuntimeTypeInfo _initRuntimeTypeInfo() { | 598 mojom_types.RuntimeTypeInfo _initRuntimeTypeInfo() { |
589 // serializedRuntimeTypeInfo contains the bytes of the Mojo serialization of | 599 // serializedRuntimeTypeInfo contains the bytes of the Mojo serialization of |
590 // a mojom_types.RuntimeTypeInfo struct describing the Mojom types in this | 600 // a mojom_types.RuntimeTypeInfo struct describing the Mojom types in this |
591 // file. The string contains the base64 encoding of the gzip-compressed bytes. | 601 // file. The string contains the base64 encoding of the gzip-compressed bytes. |
592 var serializedRuntimeTypeInfo = "H4sIAAAJbogC/8yYzW7TQBCA10kLKU2LEf1vARcKBBBxj
xWnViUiERWK2hxSLv2LIUb1D7YjwRvwGDwKj9Mjx95gHc9ie7yb2ChxutJoY+84u/PtzHi8KyRoMvTb0
OP7rC+hHusRKfyfaSoVuF2H3ob+B/Q/oX9G5SGV1nGzdvK+dvxGN2zL8bROdc+0vK7mHHXPbI2QV1TnC
VevAT8apqc5n84utP7/PqKyzNVvWrrpDRgPJnxBxza548eaF19av7XBbhnZ7V8XqfyaCq99VNulOD97N
n5ducfnfA39Lom3bXT/D7Qm4bcFKmUq2JQHVBapCLYhsZ77YPdHKodU1K5laKrT61iGbmqOalhfLNV1L
oIfdu/8Ur9QdbZVrnqumx3d/OyqnuZ6ruqeGfaldhLMXvWfMYJ5FODI5t8Ff2sWgBcJ9WJ+C3p3MnJrC
7j52zLj21rbb+19eHdQg/vPwee43KqhNubn70MhB37MDxkHzAu32SG8dlL62TyVW1T2G4f7Pqwt+ntDy
IlpJf1sMSdOw7iUR8RFhlzaOmz0HYPlQT4XppXksjRhLrIUvxZxqSMupwIuqxBj/KxOyGMqa1FOAkXMa
Qt8f9yc8LwrEb+R0P5Lkfcp5nsl4CPiSyJ8efdJJF/7sf3WOqIAvC61ibvupzn5lYI4XaE+jb1+2xHYu
w42R+x97Whfe3RV/DoG2rjtLgn8YAWto0T4nH6z54vZ8tGugNMcvMeD6ijIK/PROIMBzMt/593OKa4K0
bpUitu9g9Y1TdK1tPFUETw/A/v3TVAXK7CH4+aTlcPUf3CQUnD4LuCwmROHQfFU4ORlOWW+yRpHrF5Ox
BEM4Plnc6qjK7D3Cqqj61BHN4uD62n2EpNG9B0iqqcV2KM4t7CQxvzKOdfRUso6upDRr+op6+jEdxoqo
DGfuRtSPxdHxAPXz+x7HvH4VzhjHvMT4iHDvNcj5lGGuD7YO2pF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Bb6gorq8BnW5nh5cn2eUwOfNf3/fyOpzFdYqyK9fmGOO2THV5
UrEujwV089KEevy0HcgKsgxp7kJq8fTI+KC63F+boC4/C3EMZf5MXPJcR9RRsslC/G+v3tY9ddNiAsfD
nG5Pea6UUXxI1tn2fnQdZ3LLAMbfMoUyltIAc9nZcznMhXgoQ85l+F12ELMvH8SM+8/h29DGb8CegDzX
B3TPrAQcR9YvKbzmdB5FuYGipjX2oTtB0sx+dQi7gf8nFjKp39EI/Sr9YQ5/QkAAP//SWnGfvgXAAA="
; |
593 | 603 |
594 // Deserialize RuntimeTypeInfo | 604 // Deserialize RuntimeTypeInfo |
595 var bytes = BASE64.decode(serializedRuntimeTypeInfo); | 605 var bytes = BASE64.decode(serializedRuntimeTypeInfo); |
596 var unzippedBytes = new ZLibDecoder().convert(bytes); | 606 var unzippedBytes = new ZLibDecoder().convert(bytes); |
597 var bdata = new ByteData.view(unzippedBytes.buffer); | 607 var bdata = new ByteData.view(unzippedBytes.buffer); |
598 var message = new bindings.Message(bdata, null, unzippedBytes.length, 0); | 608 var message = new bindings.Message(bdata, null, unzippedBytes.length, 0); |
599 _runtimeTypeInfo = mojom_types.RuntimeTypeInfo.deserialize(message); | 609 _runtimeTypeInfo = mojom_types.RuntimeTypeInfo.deserialize(message); |
600 return _runtimeTypeInfo; | 610 return _runtimeTypeInfo; |
601 } | 611 } |
OLD | NEW |