OLD | NEW |
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 sensors_mojom; | 5 library sensors_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; |
11 | 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; |
12 class SensorType extends bindings.MojoEnum { | 14 class SensorType extends bindings.MojoEnum { |
13 static const SensorType accelerometer = const SensorType._(0); | 15 static const SensorType accelerometer = const SensorType._(0); |
14 static const SensorType ambientTemperature = const SensorType._(1); | 16 static const SensorType ambientTemperature = const SensorType._(1); |
15 static const SensorType gameRotationVector = const SensorType._(2); | 17 static const SensorType gameRotationVector = const SensorType._(2); |
16 static const SensorType geomagneticRotationVector = const SensorType._(3); | 18 static const SensorType geomagneticRotationVector = const SensorType._(3); |
17 static const SensorType gravity = const SensorType._(4); | 19 static const SensorType gravity = const SensorType._(4); |
18 static const SensorType gyroscope = const SensorType._(5); | 20 static const SensorType gyroscope = const SensorType._(5); |
19 static const SensorType gyroscopeUncalibrated = const SensorType._(6); | 21 static const SensorType gyroscopeUncalibrated = const SensorType._(6); |
20 static const SensorType heartRate = const SensorType._(7); | 22 static const SensorType heartRate = const SensorType._(7); |
21 static const SensorType light = const SensorType._(8); | 23 static const SensorType light = const SensorType._(8); |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 case relativeHumidity: | 167 case relativeHumidity: |
166 return 'SensorType.relativeHumidity'; | 168 return 'SensorType.relativeHumidity'; |
167 case rotationVector: | 169 case rotationVector: |
168 return 'SensorType.rotationVector'; | 170 return 'SensorType.rotationVector'; |
169 case significantMotion: | 171 case significantMotion: |
170 return 'SensorType.significantMotion'; | 172 return 'SensorType.significantMotion'; |
171 case stepCounter: | 173 case stepCounter: |
172 return 'SensorType.stepCounter'; | 174 return 'SensorType.stepCounter'; |
173 case stepDetector: | 175 case stepDetector: |
174 return 'SensorType.stepDetector'; | 176 return 'SensorType.stepDetector'; |
| 177 default: |
| 178 return null; |
175 } | 179 } |
176 } | 180 } |
177 | 181 |
178 int toJson() => mojoEnumValue; | 182 int toJson() => mojoEnumValue; |
179 } | 183 } |
180 | 184 |
| 185 mojom_types.MojomEnum _sensors_SensorType__() { |
| 186 return new mojom_types.MojomEnum() |
| 187 ..declData = (new mojom_types.DeclarationData() |
| 188 ..shortName = 'SensorType' |
| 189 ..fullIdentifier = 'sensors.SensorType') |
| 190 ..values = <mojom_types.EnumValue>[new mojom_types.EnumValue() |
| 191 ..declData = (new mojom_types.DeclarationData()..shortName = 'Accelerome
ter') |
| 192 ..enumTypeKey = '_sensors_SensorType__' |
| 193 ..intValue = 0,new mojom_types.EnumValue() |
| 194 ..declData = (new mojom_types.DeclarationData()..shortName = 'AmbientTem
perature') |
| 195 ..enumTypeKey = '_sensors_SensorType__' |
| 196 ..intValue = 1,new mojom_types.EnumValue() |
| 197 ..declData = (new mojom_types.DeclarationData()..shortName = 'GameRotati
onVector') |
| 198 ..enumTypeKey = '_sensors_SensorType__' |
| 199 ..intValue = 2,new mojom_types.EnumValue() |
| 200 ..declData = (new mojom_types.DeclarationData()..shortName = 'Geomagneti
cRotationVector') |
| 201 ..enumTypeKey = '_sensors_SensorType__' |
| 202 ..intValue = 3,new mojom_types.EnumValue() |
| 203 ..declData = (new mojom_types.DeclarationData()..shortName = 'Gravity') |
| 204 ..enumTypeKey = '_sensors_SensorType__' |
| 205 ..intValue = 4,new mojom_types.EnumValue() |
| 206 ..declData = (new mojom_types.DeclarationData()..shortName = 'Gyroscope'
) |
| 207 ..enumTypeKey = '_sensors_SensorType__' |
| 208 ..intValue = 5,new mojom_types.EnumValue() |
| 209 ..declData = (new mojom_types.DeclarationData()..shortName = 'GyroscopeU
ncalibrated') |
| 210 ..enumTypeKey = '_sensors_SensorType__' |
| 211 ..intValue = 6,new mojom_types.EnumValue() |
| 212 ..declData = (new mojom_types.DeclarationData()..shortName = 'HeartRate'
) |
| 213 ..enumTypeKey = '_sensors_SensorType__' |
| 214 ..intValue = 7,new mojom_types.EnumValue() |
| 215 ..declData = (new mojom_types.DeclarationData()..shortName = 'Light') |
| 216 ..enumTypeKey = '_sensors_SensorType__' |
| 217 ..intValue = 8,new mojom_types.EnumValue() |
| 218 ..declData = (new mojom_types.DeclarationData()..shortName = 'LinearAcce
leration') |
| 219 ..enumTypeKey = '_sensors_SensorType__' |
| 220 ..intValue = 9,new mojom_types.EnumValue() |
| 221 ..declData = (new mojom_types.DeclarationData()..shortName = 'MagneticFi
eld') |
| 222 ..enumTypeKey = '_sensors_SensorType__' |
| 223 ..intValue = 10,new mojom_types.EnumValue() |
| 224 ..declData = (new mojom_types.DeclarationData()..shortName = 'MagneticFi
eldUncalibrated') |
| 225 ..enumTypeKey = '_sensors_SensorType__' |
| 226 ..intValue = 11,new mojom_types.EnumValue() |
| 227 ..declData = (new mojom_types.DeclarationData()..shortName = 'Pressure') |
| 228 ..enumTypeKey = '_sensors_SensorType__' |
| 229 ..intValue = 12,new mojom_types.EnumValue() |
| 230 ..declData = (new mojom_types.DeclarationData()..shortName = 'Proximity'
) |
| 231 ..enumTypeKey = '_sensors_SensorType__' |
| 232 ..intValue = 13,new mojom_types.EnumValue() |
| 233 ..declData = (new mojom_types.DeclarationData()..shortName = 'RelativeHu
midity') |
| 234 ..enumTypeKey = '_sensors_SensorType__' |
| 235 ..intValue = 14,new mojom_types.EnumValue() |
| 236 ..declData = (new mojom_types.DeclarationData()..shortName = 'RotationVe
ctor') |
| 237 ..enumTypeKey = '_sensors_SensorType__' |
| 238 ..intValue = 15,new mojom_types.EnumValue() |
| 239 ..declData = (new mojom_types.DeclarationData()..shortName = 'Significan
tMotion') |
| 240 ..enumTypeKey = '_sensors_SensorType__' |
| 241 ..intValue = 16,new mojom_types.EnumValue() |
| 242 ..declData = (new mojom_types.DeclarationData()..shortName = 'StepCounte
r') |
| 243 ..enumTypeKey = '_sensors_SensorType__' |
| 244 ..intValue = 17,new mojom_types.EnumValue() |
| 245 ..declData = (new mojom_types.DeclarationData()..shortName = 'StepDetect
or') |
| 246 ..enumTypeKey = '_sensors_SensorType__' |
| 247 ..intValue = 18,]; |
| 248 } |
| 249 |
181 | 250 |
182 | 251 |
183 class SensorData extends bindings.Struct { | 252 class SensorData extends bindings.Struct { |
184 static const List<bindings.StructDataHeader> kVersions = const [ | 253 static const List<bindings.StructDataHeader> kVersions = const [ |
185 const bindings.StructDataHeader(32, 0) | 254 const bindings.StructDataHeader(32, 0) |
186 ]; | 255 ]; |
187 int accuracy = 0; | 256 int accuracy = 0; |
188 int timeStamp = 0; | 257 int timeStamp = 0; |
189 List<double> values = null; | 258 List<double> values = null; |
190 | 259 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 } | 325 } |
257 | 326 |
258 Map toJson() { | 327 Map toJson() { |
259 Map map = new Map(); | 328 Map map = new Map(); |
260 map["accuracy"] = accuracy; | 329 map["accuracy"] = accuracy; |
261 map["timeStamp"] = timeStamp; | 330 map["timeStamp"] = timeStamp; |
262 map["values"] = values; | 331 map["values"] = values; |
263 return map; | 332 return map; |
264 } | 333 } |
265 } | 334 } |
| 335 mojom_types.MojomStruct _sensors_SensorData__() { |
| 336 return new mojom_types.MojomStruct() |
| 337 ..declData = (new mojom_types.DeclarationData() |
| 338 ..shortName = 'SensorData' |
| 339 ..fullIdentifier = 'sensors.SensorData') |
| 340 ..fields = <mojom_types.StructField>[ |
| 341 new mojom_types.StructField() |
| 342 ..declData = (new mojom_types.DeclarationData()..shortName = 'Accuracy') |
| 343 ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.in
t32), |
| 344 |
| 345 new mojom_types.StructField() |
| 346 ..declData = (new mojom_types.DeclarationData()..shortName = 'TimeStamp'
) |
| 347 ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.in
t64), |
| 348 |
| 349 new mojom_types.StructField() |
| 350 ..declData = (new mojom_types.DeclarationData()..shortName = 'Values') |
| 351 ..type = (new mojom_types.Type()..arrayType = (new mojom_types.ArrayType
() |
| 352 ..elementType = (new mojom_types.Type()..simpleType = mojom_types.SimpleType
.float))), |
| 353 ]; |
| 354 } |
266 | 355 |
267 | 356 |
268 class _SensorListenerOnAccuracyChangedParams extends bindings.Struct { | 357 class _SensorListenerOnAccuracyChangedParams extends bindings.Struct { |
269 static const List<bindings.StructDataHeader> kVersions = const [ | 358 static const List<bindings.StructDataHeader> kVersions = const [ |
270 const bindings.StructDataHeader(16, 0) | 359 const bindings.StructDataHeader(16, 0) |
271 ]; | 360 ]; |
272 int accuracy = 0; | 361 int accuracy = 0; |
273 | 362 |
274 _SensorListenerOnAccuracyChangedParams() : super(kVersions.last.size); | 363 _SensorListenerOnAccuracyChangedParams() : super(kVersions.last.size); |
275 | 364 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 return "_SensorListenerOnAccuracyChangedParams(" | 412 return "_SensorListenerOnAccuracyChangedParams(" |
324 "accuracy: $accuracy" ")"; | 413 "accuracy: $accuracy" ")"; |
325 } | 414 } |
326 | 415 |
327 Map toJson() { | 416 Map toJson() { |
328 Map map = new Map(); | 417 Map map = new Map(); |
329 map["accuracy"] = accuracy; | 418 map["accuracy"] = accuracy; |
330 return map; | 419 return map; |
331 } | 420 } |
332 } | 421 } |
| 422 mojom_types.MojomStruct _sensors_SensorListener_OnAccuracyChanged_Params__() { |
| 423 return new mojom_types.MojomStruct() |
| 424 ..declData = (new mojom_types.DeclarationData() |
| 425 ..shortName = '_SensorListenerOnAccuracyChangedParams' |
| 426 ..fullIdentifier = 'sensors._SensorListenerOnAccuracyChangedParams') |
| 427 ..fields = <mojom_types.StructField>[ |
| 428 new mojom_types.StructField() |
| 429 ..declData = (new mojom_types.DeclarationData()..shortName = 'Accuracy') |
| 430 ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.in
t32), |
| 431 ]; |
| 432 } |
333 | 433 |
334 | 434 |
335 class _SensorListenerOnSensorChangedParams extends bindings.Struct { | 435 class _SensorListenerOnSensorChangedParams extends bindings.Struct { |
336 static const List<bindings.StructDataHeader> kVersions = const [ | 436 static const List<bindings.StructDataHeader> kVersions = const [ |
337 const bindings.StructDataHeader(16, 0) | 437 const bindings.StructDataHeader(16, 0) |
338 ]; | 438 ]; |
339 SensorData data = null; | 439 SensorData data = null; |
340 | 440 |
341 _SensorListenerOnSensorChangedParams() : super(kVersions.last.size); | 441 _SensorListenerOnSensorChangedParams() : super(kVersions.last.size); |
342 | 442 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 return "_SensorListenerOnSensorChangedParams(" | 491 return "_SensorListenerOnSensorChangedParams(" |
392 "data: $data" ")"; | 492 "data: $data" ")"; |
393 } | 493 } |
394 | 494 |
395 Map toJson() { | 495 Map toJson() { |
396 Map map = new Map(); | 496 Map map = new Map(); |
397 map["data"] = data; | 497 map["data"] = data; |
398 return map; | 498 return map; |
399 } | 499 } |
400 } | 500 } |
| 501 mojom_types.MojomStruct _sensors_SensorListener_OnSensorChanged_Params__() { |
| 502 return new mojom_types.MojomStruct() |
| 503 ..declData = (new mojom_types.DeclarationData() |
| 504 ..shortName = '_SensorListenerOnSensorChangedParams' |
| 505 ..fullIdentifier = 'sensors._SensorListenerOnSensorChangedParams') |
| 506 ..fields = <mojom_types.StructField>[ |
| 507 new mojom_types.StructField() |
| 508 ..declData = (new mojom_types.DeclarationData()..shortName = 'Data') |
| 509 ..type = (new mojom_types.Type() |
| 510 ..typeReference = (new mojom_types.TypeReference() |
| 511 |
| 512 ..identifier = '_sensors_SensorData__' |
| 513 ..typeKey = '_sensors_SensorData__' |
| 514 )), |
| 515 ]; |
| 516 } |
401 | 517 |
402 | 518 |
403 class _SensorServiceAddListenerParams extends bindings.Struct { | 519 class _SensorServiceAddListenerParams extends bindings.Struct { |
404 static const List<bindings.StructDataHeader> kVersions = const [ | 520 static const List<bindings.StructDataHeader> kVersions = const [ |
405 const bindings.StructDataHeader(24, 0) | 521 const bindings.StructDataHeader(24, 0) |
406 ]; | 522 ]; |
407 SensorType type = null; | 523 SensorType type = null; |
408 Object listener = null; | 524 Object listener = null; |
409 | 525 |
410 _SensorServiceAddListenerParams() : super(kVersions.last.size); | 526 _SensorServiceAddListenerParams() : super(kVersions.last.size); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 return "_SensorServiceAddListenerParams(" | 585 return "_SensorServiceAddListenerParams(" |
470 "type: $type" ", " | 586 "type: $type" ", " |
471 "listener: $listener" ")"; | 587 "listener: $listener" ")"; |
472 } | 588 } |
473 | 589 |
474 Map toJson() { | 590 Map toJson() { |
475 throw new bindings.MojoCodecError( | 591 throw new bindings.MojoCodecError( |
476 'Object containing handles cannot be encoded to JSON.'); | 592 'Object containing handles cannot be encoded to JSON.'); |
477 } | 593 } |
478 } | 594 } |
| 595 mojom_types.MojomStruct _sensors_SensorService_AddListener_Params__() { |
| 596 return new mojom_types.MojomStruct() |
| 597 ..declData = (new mojom_types.DeclarationData() |
| 598 ..shortName = '_SensorServiceAddListenerParams' |
| 599 ..fullIdentifier = 'sensors._SensorServiceAddListenerParams') |
| 600 ..fields = <mojom_types.StructField>[ |
| 601 new mojom_types.StructField() |
| 602 ..declData = (new mojom_types.DeclarationData()..shortName = 'Type') |
| 603 ..type = (new mojom_types.Type() |
| 604 ..typeReference = (new mojom_types.TypeReference() |
| 605 |
| 606 ..identifier = '_sensors_SensorType__' |
| 607 ..typeKey = '_sensors_SensorType__' |
| 608 )), |
| 609 |
| 610 new mojom_types.StructField() |
| 611 ..declData = (new mojom_types.DeclarationData()..shortName = 'Listener') |
| 612 ..type = (new mojom_types.Type() |
| 613 ..typeReference = (new mojom_types.TypeReference() |
| 614 |
| 615 ..identifier = '_sensors_SensorListener__' |
| 616 ..typeKey = '_sensors_SensorListener__' |
| 617 )), |
| 618 ]; |
| 619 } |
| 620 |
479 | 621 |
480 const int _SensorListener_onAccuracyChangedName = 0; | 622 const int _SensorListener_onAccuracyChangedName = 0; |
481 const int _SensorListener_onSensorChangedName = 1; | 623 const int _SensorListener_onSensorChangedName = 1; |
482 | 624 |
| 625 mojom_types.MojomInterface _sensors_SensorListener__() { |
| 626 return new mojom_types.MojomInterface() |
| 627 ..declData = (new mojom_types.DeclarationData() |
| 628 ..shortName = 'SensorListener' |
| 629 ..fullIdentifier = 'sensors.SensorListener') |
| 630 ..interfaceName = 'SensorListener' |
| 631 ..methods = <int, mojom_types.MojomMethod>{ |
| 632 _SensorListener_onAccuracyChangedName: new mojom_types.MojomMethod() |
| 633 ..declData = (new mojom_types.DeclarationData()..shortName = 'OnAccuracy
Changed') |
| 634 ..ordinal = _SensorListener_onAccuracyChangedName..parameters = _sensors
_SensorListener_OnAccuracyChanged_Params__(),_SensorListener_onSensorChangedName
: new mojom_types.MojomMethod() |
| 635 ..declData = (new mojom_types.DeclarationData()..shortName = 'OnSensorCh
anged') |
| 636 ..ordinal = _SensorListener_onSensorChangedName..parameters = _sensors_S
ensorListener_OnSensorChanged_Params__(), |
| 637 }; |
| 638 } |
| 639 |
| 640 class _SensorListenerServiceDescription implements service_describer.ServiceDesc
ription { |
| 641 dynamic getTopLevelInterface([Function responseFactory = null]) { |
| 642 return _sensors_SensorListener__(); |
| 643 } |
| 644 dynamic getTypeDefinition(String typeKey,[Function responseFactory = null]) { |
| 645 return getAllMojomTypeDefinitions()[typeKey]; |
| 646 } |
| 647 dynamic getAllTypeDefinitions([Function responseFactory = null]) { |
| 648 return getAllMojomTypeDefinitions(); |
| 649 } |
| 650 } |
| 651 |
483 abstract class SensorListener { | 652 abstract class SensorListener { |
484 static const String serviceName = null; | 653 static const String serviceName = null; |
485 void onAccuracyChanged(int accuracy); | 654 void onAccuracyChanged(int accuracy); |
486 void onSensorChanged(SensorData data); | 655 void onSensorChanged(SensorData data); |
487 } | 656 } |
488 | 657 |
489 | 658 |
490 class _SensorListenerProxyImpl extends bindings.Proxy { | 659 class _SensorListenerProxyImpl extends bindings.Proxy { |
491 _SensorListenerProxyImpl.fromEndpoint( | 660 _SensorListenerProxyImpl.fromEndpoint( |
492 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 661 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
493 | 662 |
494 _SensorListenerProxyImpl.fromHandle(core.MojoHandle handle) : | 663 _SensorListenerProxyImpl.fromHandle(core.MojoHandle handle) : |
495 super.fromHandle(handle); | 664 super.fromHandle(handle); |
496 | 665 |
497 _SensorListenerProxyImpl.unbound() : super.unbound(); | 666 _SensorListenerProxyImpl.unbound() : super.unbound(); |
498 | 667 |
499 static _SensorListenerProxyImpl newFromEndpoint( | 668 static _SensorListenerProxyImpl newFromEndpoint( |
500 core.MojoMessagePipeEndpoint endpoint) { | 669 core.MojoMessagePipeEndpoint endpoint) { |
501 assert(endpoint.setDescription("For _SensorListenerProxyImpl")); | 670 assert(endpoint.setDescription("For _SensorListenerProxyImpl")); |
502 return new _SensorListenerProxyImpl.fromEndpoint(endpoint); | 671 return new _SensorListenerProxyImpl.fromEndpoint(endpoint); |
503 } | 672 } |
504 | 673 |
| 674 service_describer.ServiceDescription get serviceDescription => |
| 675 new _SensorListenerServiceDescription(); |
| 676 |
505 void handleResponse(bindings.ServiceMessage message) { | 677 void handleResponse(bindings.ServiceMessage message) { |
506 switch (message.header.type) { | 678 switch (message.header.type) { |
507 default: | 679 default: |
508 proxyError("Unexpected message type: ${message.header.type}"); | 680 proxyError("Unexpected message type: ${message.header.type}"); |
509 close(immediate: true); | 681 close(immediate: true); |
510 break; | 682 break; |
511 } | 683 } |
512 } | 684 } |
513 | 685 |
514 String toString() { | 686 String toString() { |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 assert(_impl == null); | 824 assert(_impl == null); |
653 _impl = d; | 825 _impl = d; |
654 } | 826 } |
655 | 827 |
656 String toString() { | 828 String toString() { |
657 var superString = super.toString(); | 829 var superString = super.toString(); |
658 return "SensorListenerStub($superString)"; | 830 return "SensorListenerStub($superString)"; |
659 } | 831 } |
660 | 832 |
661 int get version => 0; | 833 int get version => 0; |
| 834 |
| 835 |
| 836 service_describer.ServiceDescription get serviceDescription => |
| 837 new _SensorListenerServiceDescription(); |
662 } | 838 } |
663 | 839 |
664 const int _SensorService_addListenerName = 0; | 840 const int _SensorService_addListenerName = 0; |
665 | 841 |
| 842 mojom_types.MojomInterface _sensors_SensorService__() { |
| 843 return new mojom_types.MojomInterface() |
| 844 ..declData = (new mojom_types.DeclarationData() |
| 845 ..shortName = 'SensorService' |
| 846 ..fullIdentifier = 'sensors.SensorService') |
| 847 ..interfaceName = 'SensorService' |
| 848 ..methods = <int, mojom_types.MojomMethod>{ |
| 849 _SensorService_addListenerName: new mojom_types.MojomMethod() |
| 850 ..declData = (new mojom_types.DeclarationData()..shortName = 'AddListene
r') |
| 851 ..ordinal = _SensorService_addListenerName..parameters = _sensors_Sensor
Service_AddListener_Params__(), |
| 852 }; |
| 853 } |
| 854 |
| 855 class _SensorServiceServiceDescription implements service_describer.ServiceDescr
iption { |
| 856 dynamic getTopLevelInterface([Function responseFactory = null]) { |
| 857 return _sensors_SensorService__(); |
| 858 } |
| 859 dynamic getTypeDefinition(String typeKey,[Function responseFactory = null]) { |
| 860 return getAllMojomTypeDefinitions()[typeKey]; |
| 861 } |
| 862 dynamic getAllTypeDefinitions([Function responseFactory = null]) { |
| 863 return getAllMojomTypeDefinitions(); |
| 864 } |
| 865 } |
| 866 |
666 abstract class SensorService { | 867 abstract class SensorService { |
667 static const String serviceName = "sensors::SensorService"; | 868 static const String serviceName = "sensors::SensorService"; |
668 void addListener(SensorType type, Object listener); | 869 void addListener(SensorType type, Object listener); |
669 } | 870 } |
670 | 871 |
671 | 872 |
672 class _SensorServiceProxyImpl extends bindings.Proxy { | 873 class _SensorServiceProxyImpl extends bindings.Proxy { |
673 _SensorServiceProxyImpl.fromEndpoint( | 874 _SensorServiceProxyImpl.fromEndpoint( |
674 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 875 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
675 | 876 |
676 _SensorServiceProxyImpl.fromHandle(core.MojoHandle handle) : | 877 _SensorServiceProxyImpl.fromHandle(core.MojoHandle handle) : |
677 super.fromHandle(handle); | 878 super.fromHandle(handle); |
678 | 879 |
679 _SensorServiceProxyImpl.unbound() : super.unbound(); | 880 _SensorServiceProxyImpl.unbound() : super.unbound(); |
680 | 881 |
681 static _SensorServiceProxyImpl newFromEndpoint( | 882 static _SensorServiceProxyImpl newFromEndpoint( |
682 core.MojoMessagePipeEndpoint endpoint) { | 883 core.MojoMessagePipeEndpoint endpoint) { |
683 assert(endpoint.setDescription("For _SensorServiceProxyImpl")); | 884 assert(endpoint.setDescription("For _SensorServiceProxyImpl")); |
684 return new _SensorServiceProxyImpl.fromEndpoint(endpoint); | 885 return new _SensorServiceProxyImpl.fromEndpoint(endpoint); |
685 } | 886 } |
686 | 887 |
| 888 service_describer.ServiceDescription get serviceDescription => |
| 889 new _SensorServiceServiceDescription(); |
| 890 |
687 void handleResponse(bindings.ServiceMessage message) { | 891 void handleResponse(bindings.ServiceMessage message) { |
688 switch (message.header.type) { | 892 switch (message.header.type) { |
689 default: | 893 default: |
690 proxyError("Unexpected message type: ${message.header.type}"); | 894 proxyError("Unexpected message type: ${message.header.type}"); |
691 close(immediate: true); | 895 close(immediate: true); |
692 break; | 896 break; |
693 } | 897 } |
694 } | 898 } |
695 | 899 |
696 String toString() { | 900 String toString() { |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 assert(_impl == null); | 1025 assert(_impl == null); |
822 _impl = d; | 1026 _impl = d; |
823 } | 1027 } |
824 | 1028 |
825 String toString() { | 1029 String toString() { |
826 var superString = super.toString(); | 1030 var superString = super.toString(); |
827 return "SensorServiceStub($superString)"; | 1031 return "SensorServiceStub($superString)"; |
828 } | 1032 } |
829 | 1033 |
830 int get version => 0; | 1034 int get version => 0; |
| 1035 |
| 1036 |
| 1037 service_describer.ServiceDescription get serviceDescription => |
| 1038 new _SensorServiceServiceDescription(); |
831 } | 1039 } |
832 | 1040 |
833 | 1041 |
| 1042 |
| 1043 |
| 1044 |
| 1045 |
| 1046 |
| 1047 Map<String, mojom_types.UserDefinedType> _initDescriptions() { |
| 1048 var map = new HashMap<String, mojom_types.UserDefinedType>(); |
| 1049 map["_sensors_SensorType__"] = |
| 1050 new mojom_types.UserDefinedType() |
| 1051 ..enumType = _sensors_SensorType__(); |
| 1052 map["_sensors_SensorData__"] = |
| 1053 new mojom_types.UserDefinedType() |
| 1054 ..structType = _sensors_SensorData__(); |
| 1055 map["_sensors_SensorListener_OnAccuracyChanged_Params__"] = |
| 1056 new mojom_types.UserDefinedType() |
| 1057 ..structType = _sensors_SensorListener_OnAccuracyChanged_Params__(); |
| 1058 map["_sensors_SensorListener_OnSensorChanged_Params__"] = |
| 1059 new mojom_types.UserDefinedType() |
| 1060 ..structType = _sensors_SensorListener_OnSensorChanged_Params__(); |
| 1061 map["_sensors_SensorService_AddListener_Params__"] = |
| 1062 new mojom_types.UserDefinedType() |
| 1063 ..structType = _sensors_SensorService_AddListener_Params__(); |
| 1064 map["_sensors_SensorListener__"] = |
| 1065 new mojom_types.UserDefinedType() |
| 1066 ..interfaceType = _sensors_SensorListener__(); |
| 1067 map["_sensors_SensorService__"] = |
| 1068 new mojom_types.UserDefinedType() |
| 1069 ..interfaceType = _sensors_SensorService__(); |
| 1070 |
| 1071 return map; |
| 1072 } |
| 1073 |
| 1074 var _MojomDesc; |
| 1075 Map<String, mojom_types.UserDefinedType> getAllMojomTypeDefinitions() { |
| 1076 if (_MojomDesc == null) { |
| 1077 _MojomDesc = _initDescriptions(); |
| 1078 } |
| 1079 return _MojomDesc; |
| 1080 } |
| 1081 |
OLD | NEW |