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 | 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 class SensorType extends bindings.MojoEnum { | 13 class SensorType extends bindings.MojoEnum { |
12 static const ACCELEROMETER = const SensorType._(0); | 14 static const ACCELEROMETER = const SensorType._(0); |
13 static const AMBIENT_TEMPERATURE = const SensorType._(1); | 15 static const AMBIENT_TEMPERATURE = const SensorType._(1); |
14 static const GAME_ROTATION_VECTOR = const SensorType._(2); | 16 static const GAME_ROTATION_VECTOR = const SensorType._(2); |
15 static const GEOMAGNETIC_ROTATION_VECTOR = const SensorType._(3); | 17 static const GEOMAGNETIC_ROTATION_VECTOR = const SensorType._(3); |
16 static const GRAVITY = const SensorType._(4); | 18 static const GRAVITY = const SensorType._(4); |
17 static const GYROSCOPE = const SensorType._(5); | 19 static const GYROSCOPE = const SensorType._(5); |
18 static const GYROSCOPE_UNCALIBRATED = const SensorType._(6); | 20 static const GYROSCOPE_UNCALIBRATED = const SensorType._(6); |
19 static const HEART_RATE = const SensorType._(7); | 21 static const HEART_RATE = const SensorType._(7); |
20 static const LIGHT = const SensorType._(8); | 22 static const LIGHT = const SensorType._(8); |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 case RELATIVE_HUMIDITY: | 166 case RELATIVE_HUMIDITY: |
165 return 'SensorType.RELATIVE_HUMIDITY'; | 167 return 'SensorType.RELATIVE_HUMIDITY'; |
166 case ROTATION_VECTOR: | 168 case ROTATION_VECTOR: |
167 return 'SensorType.ROTATION_VECTOR'; | 169 return 'SensorType.ROTATION_VECTOR'; |
168 case SIGNIFICANT_MOTION: | 170 case SIGNIFICANT_MOTION: |
169 return 'SensorType.SIGNIFICANT_MOTION'; | 171 return 'SensorType.SIGNIFICANT_MOTION'; |
170 case STEP_COUNTER: | 172 case STEP_COUNTER: |
171 return 'SensorType.STEP_COUNTER'; | 173 return 'SensorType.STEP_COUNTER'; |
172 case STEP_DETECTOR: | 174 case STEP_DETECTOR: |
173 return 'SensorType.STEP_DETECTOR'; | 175 return 'SensorType.STEP_DETECTOR'; |
| 176 default: |
| 177 return null; |
174 } | 178 } |
175 } | 179 } |
176 | 180 |
177 int toJson() => value; | 181 int toJson() => value; |
178 } | 182 } |
179 | 183 |
| 184 mojom_types.MojomEnum _sensors_SensorType__() { |
| 185 return new mojom_types.MojomEnum() |
| 186 ..declData = (new mojom_types.DeclarationData()..shortName = "SensorType") |
| 187 ..values = <mojom_types.EnumValue>[new mojom_types.EnumValue() |
| 188 ..declData = (new mojom_types.DeclarationData()..shortName = "ACCELEROME
TER") |
| 189 ..enumTypeKey = '_sensors_SensorType__' |
| 190 ..intValue = 0,new mojom_types.EnumValue() |
| 191 ..declData = (new mojom_types.DeclarationData()..shortName = "AMBIENT_TE
MPERATURE") |
| 192 ..enumTypeKey = '_sensors_SensorType__' |
| 193 ..intValue = 1,new mojom_types.EnumValue() |
| 194 ..declData = (new mojom_types.DeclarationData()..shortName = "GAME_ROTAT
ION_VECTOR") |
| 195 ..enumTypeKey = '_sensors_SensorType__' |
| 196 ..intValue = 2,new mojom_types.EnumValue() |
| 197 ..declData = (new mojom_types.DeclarationData()..shortName = "GEOMAGNETI
C_ROTATION_VECTOR") |
| 198 ..enumTypeKey = '_sensors_SensorType__' |
| 199 ..intValue = 3,new mojom_types.EnumValue() |
| 200 ..declData = (new mojom_types.DeclarationData()..shortName = "GRAVITY") |
| 201 ..enumTypeKey = '_sensors_SensorType__' |
| 202 ..intValue = 4,new mojom_types.EnumValue() |
| 203 ..declData = (new mojom_types.DeclarationData()..shortName = "GYROSCOPE"
) |
| 204 ..enumTypeKey = '_sensors_SensorType__' |
| 205 ..intValue = 5,new mojom_types.EnumValue() |
| 206 ..declData = (new mojom_types.DeclarationData()..shortName = "GYROSCOPE_
UNCALIBRATED") |
| 207 ..enumTypeKey = '_sensors_SensorType__' |
| 208 ..intValue = 6,new mojom_types.EnumValue() |
| 209 ..declData = (new mojom_types.DeclarationData()..shortName = "HEART_RATE
") |
| 210 ..enumTypeKey = '_sensors_SensorType__' |
| 211 ..intValue = 7,new mojom_types.EnumValue() |
| 212 ..declData = (new mojom_types.DeclarationData()..shortName = "LIGHT") |
| 213 ..enumTypeKey = '_sensors_SensorType__' |
| 214 ..intValue = 8,new mojom_types.EnumValue() |
| 215 ..declData = (new mojom_types.DeclarationData()..shortName = "LINEAR_ACC
ELERATION") |
| 216 ..enumTypeKey = '_sensors_SensorType__' |
| 217 ..intValue = 9,new mojom_types.EnumValue() |
| 218 ..declData = (new mojom_types.DeclarationData()..shortName = "MAGNETIC_F
IELD") |
| 219 ..enumTypeKey = '_sensors_SensorType__' |
| 220 ..intValue = 10,new mojom_types.EnumValue() |
| 221 ..declData = (new mojom_types.DeclarationData()..shortName = "MAGNETIC_F
IELD_UNCALIBRATED") |
| 222 ..enumTypeKey = '_sensors_SensorType__' |
| 223 ..intValue = 11,new mojom_types.EnumValue() |
| 224 ..declData = (new mojom_types.DeclarationData()..shortName = "PRESSURE") |
| 225 ..enumTypeKey = '_sensors_SensorType__' |
| 226 ..intValue = 12,new mojom_types.EnumValue() |
| 227 ..declData = (new mojom_types.DeclarationData()..shortName = "PROXIMITY"
) |
| 228 ..enumTypeKey = '_sensors_SensorType__' |
| 229 ..intValue = 13,new mojom_types.EnumValue() |
| 230 ..declData = (new mojom_types.DeclarationData()..shortName = "RELATIVE_H
UMIDITY") |
| 231 ..enumTypeKey = '_sensors_SensorType__' |
| 232 ..intValue = 14,new mojom_types.EnumValue() |
| 233 ..declData = (new mojom_types.DeclarationData()..shortName = "ROTATION_V
ECTOR") |
| 234 ..enumTypeKey = '_sensors_SensorType__' |
| 235 ..intValue = 15,new mojom_types.EnumValue() |
| 236 ..declData = (new mojom_types.DeclarationData()..shortName = "SIGNIFICAN
T_MOTION") |
| 237 ..enumTypeKey = '_sensors_SensorType__' |
| 238 ..intValue = 16,new mojom_types.EnumValue() |
| 239 ..declData = (new mojom_types.DeclarationData()..shortName = "STEP_COUNT
ER") |
| 240 ..enumTypeKey = '_sensors_SensorType__' |
| 241 ..intValue = 17,new mojom_types.EnumValue() |
| 242 ..declData = (new mojom_types.DeclarationData()..shortName = "STEP_DETEC
TOR") |
| 243 ..enumTypeKey = '_sensors_SensorType__' |
| 244 ..intValue = 18,]; |
| 245 } |
| 246 |
180 | 247 |
181 | 248 |
182 class SensorData extends bindings.Struct { | 249 class SensorData extends bindings.Struct { |
183 static const List<bindings.StructDataHeader> kVersions = const [ | 250 static const List<bindings.StructDataHeader> kVersions = const [ |
184 const bindings.StructDataHeader(32, 0) | 251 const bindings.StructDataHeader(32, 0) |
185 ]; | 252 ]; |
186 int accuracy = 0; | 253 int accuracy = 0; |
187 int timeStamp = 0; | 254 int timeStamp = 0; |
188 List<double> values = null; | 255 List<double> values = null; |
189 | 256 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 | 323 |
257 Map toJson() { | 324 Map toJson() { |
258 Map map = new Map(); | 325 Map map = new Map(); |
259 map["accuracy"] = accuracy; | 326 map["accuracy"] = accuracy; |
260 map["timeStamp"] = timeStamp; | 327 map["timeStamp"] = timeStamp; |
261 map["values"] = values; | 328 map["values"] = values; |
262 return map; | 329 return map; |
263 } | 330 } |
264 } | 331 } |
265 | 332 |
| 333 mojom_types.MojomStruct _sensors_SensorData__() { |
| 334 return new mojom_types.MojomStruct() |
| 335 ..declData = (new mojom_types.DeclarationData()..shortName = 'SensorData') |
| 336 ..fields = <mojom_types.StructField>[ |
| 337 new mojom_types.StructField() |
| 338 ..declData = (new mojom_types.DeclarationData()..shortName = 'Accuracy') |
| 339 ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.IN
T32), |
| 340 |
| 341 new mojom_types.StructField() |
| 342 ..declData = (new mojom_types.DeclarationData()..shortName = 'TimeStamp'
) |
| 343 ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.IN
T64), |
| 344 |
| 345 new mojom_types.StructField() |
| 346 ..declData = (new mojom_types.DeclarationData()..shortName = 'Values') |
| 347 ..type = (new mojom_types.Type()..arrayType = (new mojom_types.ArrayType
() |
| 348 ..elementType = (new mojom_types.Type()..simpleType = mojom_types.SimpleType
.FLOAT))), |
| 349 ]; |
| 350 } |
| 351 |
266 | 352 |
267 class SensorListenerOnAccuracyChangedParams extends bindings.Struct { | 353 class SensorListenerOnAccuracyChangedParams extends bindings.Struct { |
268 static const List<bindings.StructDataHeader> kVersions = const [ | 354 static const List<bindings.StructDataHeader> kVersions = const [ |
269 const bindings.StructDataHeader(16, 0) | 355 const bindings.StructDataHeader(16, 0) |
270 ]; | 356 ]; |
271 int accuracy = 0; | 357 int accuracy = 0; |
272 | 358 |
273 SensorListenerOnAccuracyChangedParams() : super(kVersions.last.size); | 359 SensorListenerOnAccuracyChangedParams() : super(kVersions.last.size); |
274 | 360 |
275 static SensorListenerOnAccuracyChangedParams deserialize(bindings.Message mess
age) { | 361 static SensorListenerOnAccuracyChangedParams deserialize(bindings.Message mess
age) { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 "accuracy: $accuracy" ")"; | 409 "accuracy: $accuracy" ")"; |
324 } | 410 } |
325 | 411 |
326 Map toJson() { | 412 Map toJson() { |
327 Map map = new Map(); | 413 Map map = new Map(); |
328 map["accuracy"] = accuracy; | 414 map["accuracy"] = accuracy; |
329 return map; | 415 return map; |
330 } | 416 } |
331 } | 417 } |
332 | 418 |
| 419 mojom_types.MojomStruct _sensors_SensorListener_OnAccuracyChanged_Params__() { |
| 420 return new mojom_types.MojomStruct() |
| 421 ..declData = (new mojom_types.DeclarationData()..shortName = 'SensorListener
OnAccuracyChangedParams') |
| 422 ..fields = <mojom_types.StructField>[ |
| 423 new mojom_types.StructField() |
| 424 ..declData = (new mojom_types.DeclarationData()..shortName = 'Accuracy') |
| 425 ..type = (new mojom_types.Type()..simpleType = mojom_types.SimpleType.IN
T32), |
| 426 ]; |
| 427 } |
| 428 |
333 | 429 |
334 class SensorListenerOnSensorChangedParams extends bindings.Struct { | 430 class SensorListenerOnSensorChangedParams extends bindings.Struct { |
335 static const List<bindings.StructDataHeader> kVersions = const [ | 431 static const List<bindings.StructDataHeader> kVersions = const [ |
336 const bindings.StructDataHeader(16, 0) | 432 const bindings.StructDataHeader(16, 0) |
337 ]; | 433 ]; |
338 SensorData data = null; | 434 SensorData data = null; |
339 | 435 |
340 SensorListenerOnSensorChangedParams() : super(kVersions.last.size); | 436 SensorListenerOnSensorChangedParams() : super(kVersions.last.size); |
341 | 437 |
342 static SensorListenerOnSensorChangedParams deserialize(bindings.Message messag
e) { | 438 static SensorListenerOnSensorChangedParams deserialize(bindings.Message messag
e) { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 "data: $data" ")"; | 487 "data: $data" ")"; |
392 } | 488 } |
393 | 489 |
394 Map toJson() { | 490 Map toJson() { |
395 Map map = new Map(); | 491 Map map = new Map(); |
396 map["data"] = data; | 492 map["data"] = data; |
397 return map; | 493 return map; |
398 } | 494 } |
399 } | 495 } |
400 | 496 |
| 497 mojom_types.MojomStruct _sensors_SensorListener_OnSensorChanged_Params__() { |
| 498 return new mojom_types.MojomStruct() |
| 499 ..declData = (new mojom_types.DeclarationData()..shortName = 'SensorListener
OnSensorChangedParams') |
| 500 ..fields = <mojom_types.StructField>[ |
| 501 new mojom_types.StructField() |
| 502 ..declData = (new mojom_types.DeclarationData()..shortName = 'Data') |
| 503 ..type = (new mojom_types.Type() |
| 504 ..typeReference = (new mojom_types.TypeReference() |
| 505 |
| 506 ..identifier = '_sensors_SensorData__' |
| 507 ..typeKey = '_sensors_SensorData__' |
| 508 )), |
| 509 ]; |
| 510 } |
| 511 |
401 | 512 |
402 class SensorServiceAddListenerParams extends bindings.Struct { | 513 class SensorServiceAddListenerParams extends bindings.Struct { |
403 static const List<bindings.StructDataHeader> kVersions = const [ | 514 static const List<bindings.StructDataHeader> kVersions = const [ |
404 const bindings.StructDataHeader(24, 0) | 515 const bindings.StructDataHeader(24, 0) |
405 ]; | 516 ]; |
406 SensorType type = null; | 517 SensorType type = null; |
407 Object listener = null; | 518 Object listener = null; |
408 | 519 |
409 SensorServiceAddListenerParams() : super(kVersions.last.size); | 520 SensorServiceAddListenerParams() : super(kVersions.last.size); |
410 | 521 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 "type: $type" ", " | 580 "type: $type" ", " |
470 "listener: $listener" ")"; | 581 "listener: $listener" ")"; |
471 } | 582 } |
472 | 583 |
473 Map toJson() { | 584 Map toJson() { |
474 throw new bindings.MojoCodecError( | 585 throw new bindings.MojoCodecError( |
475 'Object containing handles cannot be encoded to JSON.'); | 586 'Object containing handles cannot be encoded to JSON.'); |
476 } | 587 } |
477 } | 588 } |
478 | 589 |
| 590 mojom_types.MojomStruct _sensors_SensorService_AddListener_Params__() { |
| 591 return new mojom_types.MojomStruct() |
| 592 ..declData = (new mojom_types.DeclarationData()..shortName = 'SensorServiceA
ddListenerParams') |
| 593 ..fields = <mojom_types.StructField>[ |
| 594 new mojom_types.StructField() |
| 595 ..declData = (new mojom_types.DeclarationData()..shortName = 'Type') |
| 596 ..type = (new mojom_types.Type() |
| 597 ..typeReference = (new mojom_types.TypeReference() |
| 598 |
| 599 ..identifier = '_sensors_SensorType__' |
| 600 ..typeKey = '_sensors_SensorType__' |
| 601 )), |
| 602 |
| 603 new mojom_types.StructField() |
| 604 ..declData = (new mojom_types.DeclarationData()..shortName = 'Listener') |
| 605 ..type = (new mojom_types.Type() |
| 606 ..typeReference = (new mojom_types.TypeReference() |
| 607 |
| 608 ..identifier = '_sensors_SensorListener__' |
| 609 ..typeKey = '_sensors_SensorListener__' |
| 610 )), |
| 611 ]; |
| 612 } |
| 613 |
| 614 |
479 const int kSensorListener_onAccuracyChanged_name = 0; | 615 const int kSensorListener_onAccuracyChanged_name = 0; |
480 const int kSensorListener_onSensorChanged_name = 1; | 616 const int kSensorListener_onSensorChanged_name = 1; |
481 | 617 |
482 const String SensorListenerName = | 618 const String SensorListenerName = |
483 'sensors::SensorListener'; | 619 'sensors::SensorListener'; |
484 | 620 |
| 621 mojom_types.MojomInterface _sensors_SensorListener__() { |
| 622 return new mojom_types.MojomInterface() |
| 623 ..declData = (new mojom_types.DeclarationData()..shortName = "SensorListener
") |
| 624 ..interfaceName = "SensorListener" |
| 625 ..methods = <int, mojom_types.MojomMethod>{ |
| 626 kSensorListener_onAccuracyChanged_name: new mojom_types.MojomMethod() |
| 627 ..declData = (new mojom_types.DeclarationData()..shortName = "OnAccuracy
Changed") |
| 628 ..ordinal = kSensorListener_onAccuracyChanged_name..parameters = _sensor
s_SensorListener_OnAccuracyChanged_Params__(),kSensorListener_onSensorChanged_na
me: new mojom_types.MojomMethod() |
| 629 ..declData = (new mojom_types.DeclarationData()..shortName = "OnSensorCh
anged") |
| 630 ..ordinal = kSensorListener_onSensorChanged_name..parameters = _sensors_
SensorListener_OnSensorChanged_Params__(), |
| 631 }; |
| 632 } |
| 633 |
| 634 class _SensorListenerServiceDescription extends service_describer.ServiceDescrip
tion { |
| 635 // Avoid infinite loop by overriding serviceDescription field. |
| 636 final service_describer.ServiceDescription serviceDescription = null; |
| 637 dynamic getTopLevelInterface([Function responseFactory = null]) { |
| 638 return _sensors_SensorListener__(); |
| 639 } |
| 640 dynamic getTypeDefinition(String typeKey,[Function responseFactory = null]) { |
| 641 return getAllMojomTypeDefinitions()[typeKey]; |
| 642 } |
| 643 dynamic getAllTypeDefinitions([Function responseFactory = null]) { |
| 644 return getAllMojomTypeDefinitions(); |
| 645 } |
| 646 } |
| 647 |
485 abstract class SensorListener { | 648 abstract class SensorListener { |
486 void onAccuracyChanged(int accuracy); | 649 void onAccuracyChanged(int accuracy); |
487 void onSensorChanged(SensorData data); | 650 void onSensorChanged(SensorData data); |
488 | 651 |
489 } | 652 } |
490 | 653 |
491 | 654 |
492 class SensorListenerProxyImpl extends bindings.Proxy { | 655 class SensorListenerProxyImpl extends bindings.Proxy { |
493 SensorListenerProxyImpl.fromEndpoint( | 656 SensorListenerProxyImpl.fromEndpoint( |
494 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 657 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
495 | 658 |
496 SensorListenerProxyImpl.fromHandle(core.MojoHandle handle) : | 659 SensorListenerProxyImpl.fromHandle(core.MojoHandle handle) : |
497 super.fromHandle(handle); | 660 super.fromHandle(handle); |
498 | 661 |
499 SensorListenerProxyImpl.unbound() : super.unbound(); | 662 SensorListenerProxyImpl.unbound() : super.unbound(); |
500 | 663 |
501 static SensorListenerProxyImpl newFromEndpoint( | 664 static SensorListenerProxyImpl newFromEndpoint( |
502 core.MojoMessagePipeEndpoint endpoint) { | 665 core.MojoMessagePipeEndpoint endpoint) { |
503 assert(endpoint.setDescription("For SensorListenerProxyImpl")); | 666 assert(endpoint.setDescription("For SensorListenerProxyImpl")); |
504 return new SensorListenerProxyImpl.fromEndpoint(endpoint); | 667 return new SensorListenerProxyImpl.fromEndpoint(endpoint); |
505 } | 668 } |
506 | 669 |
507 String get name => SensorListenerName; | 670 String get name => SensorListenerName; |
508 | 671 |
| 672 service_describer.ServiceDescription get serviceDescription => |
| 673 new _SensorListenerServiceDescription(); |
| 674 |
509 void handleResponse(bindings.ServiceMessage message) { | 675 void handleResponse(bindings.ServiceMessage message) { |
510 switch (message.header.type) { | 676 switch (message.header.type) { |
511 default: | 677 default: |
512 proxyError("Unexpected message type: ${message.header.type}"); | 678 proxyError("Unexpected message type: ${message.header.type}"); |
513 close(immediate: true); | 679 close(immediate: true); |
514 break; | 680 break; |
515 } | 681 } |
516 } | 682 } |
517 | 683 |
518 String toString() { | 684 String toString() { |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 assert(_impl == null); | 825 assert(_impl == null); |
660 _impl = d; | 826 _impl = d; |
661 } | 827 } |
662 | 828 |
663 String toString() { | 829 String toString() { |
664 var superString = super.toString(); | 830 var superString = super.toString(); |
665 return "SensorListenerStub($superString)"; | 831 return "SensorListenerStub($superString)"; |
666 } | 832 } |
667 | 833 |
668 int get version => 0; | 834 int get version => 0; |
| 835 |
| 836 service_describer.ServiceDescription get serviceDescription => |
| 837 new _SensorListenerServiceDescription(); |
669 } | 838 } |
670 | 839 |
671 const int kSensorService_addListener_name = 0; | 840 const int kSensorService_addListener_name = 0; |
672 | 841 |
673 const String SensorServiceName = | 842 const String SensorServiceName = |
674 'sensors::SensorService'; | 843 'sensors::SensorService'; |
675 | 844 |
| 845 mojom_types.MojomInterface _sensors_SensorService__() { |
| 846 return new mojom_types.MojomInterface() |
| 847 ..declData = (new mojom_types.DeclarationData()..shortName = "SensorService"
) |
| 848 ..interfaceName = "SensorService" |
| 849 ..methods = <int, mojom_types.MojomMethod>{ |
| 850 kSensorService_addListener_name: new mojom_types.MojomMethod() |
| 851 ..declData = (new mojom_types.DeclarationData()..shortName = "AddListene
r") |
| 852 ..ordinal = kSensorService_addListener_name..parameters = _sensors_Senso
rService_AddListener_Params__(), |
| 853 }; |
| 854 } |
| 855 |
| 856 class _SensorServiceServiceDescription extends service_describer.ServiceDescript
ion { |
| 857 // Avoid infinite loop by overriding serviceDescription field. |
| 858 final service_describer.ServiceDescription serviceDescription = null; |
| 859 dynamic getTopLevelInterface([Function responseFactory = null]) { |
| 860 return _sensors_SensorService__(); |
| 861 } |
| 862 dynamic getTypeDefinition(String typeKey,[Function responseFactory = null]) { |
| 863 return getAllMojomTypeDefinitions()[typeKey]; |
| 864 } |
| 865 dynamic getAllTypeDefinitions([Function responseFactory = null]) { |
| 866 return getAllMojomTypeDefinitions(); |
| 867 } |
| 868 } |
| 869 |
676 abstract class SensorService { | 870 abstract class SensorService { |
677 void addListener(SensorType type, Object listener); | 871 void addListener(SensorType type, Object listener); |
678 | 872 |
679 } | 873 } |
680 | 874 |
681 | 875 |
682 class SensorServiceProxyImpl extends bindings.Proxy { | 876 class SensorServiceProxyImpl extends bindings.Proxy { |
683 SensorServiceProxyImpl.fromEndpoint( | 877 SensorServiceProxyImpl.fromEndpoint( |
684 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 878 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
685 | 879 |
686 SensorServiceProxyImpl.fromHandle(core.MojoHandle handle) : | 880 SensorServiceProxyImpl.fromHandle(core.MojoHandle handle) : |
687 super.fromHandle(handle); | 881 super.fromHandle(handle); |
688 | 882 |
689 SensorServiceProxyImpl.unbound() : super.unbound(); | 883 SensorServiceProxyImpl.unbound() : super.unbound(); |
690 | 884 |
691 static SensorServiceProxyImpl newFromEndpoint( | 885 static SensorServiceProxyImpl newFromEndpoint( |
692 core.MojoMessagePipeEndpoint endpoint) { | 886 core.MojoMessagePipeEndpoint endpoint) { |
693 assert(endpoint.setDescription("For SensorServiceProxyImpl")); | 887 assert(endpoint.setDescription("For SensorServiceProxyImpl")); |
694 return new SensorServiceProxyImpl.fromEndpoint(endpoint); | 888 return new SensorServiceProxyImpl.fromEndpoint(endpoint); |
695 } | 889 } |
696 | 890 |
697 String get name => SensorServiceName; | 891 String get name => SensorServiceName; |
698 | 892 |
| 893 service_describer.ServiceDescription get serviceDescription => |
| 894 new _SensorServiceServiceDescription(); |
| 895 |
699 void handleResponse(bindings.ServiceMessage message) { | 896 void handleResponse(bindings.ServiceMessage message) { |
700 switch (message.header.type) { | 897 switch (message.header.type) { |
701 default: | 898 default: |
702 proxyError("Unexpected message type: ${message.header.type}"); | 899 proxyError("Unexpected message type: ${message.header.type}"); |
703 close(immediate: true); | 900 close(immediate: true); |
704 break; | 901 break; |
705 } | 902 } |
706 } | 903 } |
707 | 904 |
708 String toString() { | 905 String toString() { |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
835 assert(_impl == null); | 1032 assert(_impl == null); |
836 _impl = d; | 1033 _impl = d; |
837 } | 1034 } |
838 | 1035 |
839 String toString() { | 1036 String toString() { |
840 var superString = super.toString(); | 1037 var superString = super.toString(); |
841 return "SensorServiceStub($superString)"; | 1038 return "SensorServiceStub($superString)"; |
842 } | 1039 } |
843 | 1040 |
844 int get version => 0; | 1041 int get version => 0; |
| 1042 |
| 1043 service_describer.ServiceDescription get serviceDescription => |
| 1044 new _SensorServiceServiceDescription(); |
845 } | 1045 } |
846 | 1046 |
847 | 1047 |
| 1048 |
| 1049 |
| 1050 |
| 1051 |
| 1052 |
| 1053 |
| 1054 var _MojomDesc__ = _initDescriptions(); |
| 1055 |
| 1056 Map<String, mojom_types.UserDefinedType> _initDescriptions() { |
| 1057 var map = new Map<String, mojom_types.UserDefinedType>(); |
| 1058 |
| 1059 map["_sensors_SensorType__"] = |
| 1060 new mojom_types.UserDefinedType() |
| 1061 ..enumType = _sensors_SensorType__(); |
| 1062 |
| 1063 |
| 1064 map["_sensors_SensorData__"] = |
| 1065 new mojom_types.UserDefinedType() |
| 1066 ..structType = _sensors_SensorData__(); |
| 1067 |
| 1068 |
| 1069 |
| 1070 |
| 1071 |
| 1072 |
| 1073 |
| 1074 |
| 1075 |
| 1076 map["_sensors_SensorListener_OnAccuracyChanged_Params__"] = |
| 1077 new mojom_types.UserDefinedType() |
| 1078 ..structType = _sensors_SensorListener_OnAccuracyChanged_Params__(); |
| 1079 |
| 1080 |
| 1081 |
| 1082 |
| 1083 |
| 1084 map["_sensors_SensorListener_OnSensorChanged_Params__"] = |
| 1085 new mojom_types.UserDefinedType() |
| 1086 ..structType = _sensors_SensorListener_OnSensorChanged_Params__(); |
| 1087 |
| 1088 |
| 1089 |
| 1090 |
| 1091 |
| 1092 map["_sensors_SensorService_AddListener_Params__"] = |
| 1093 new mojom_types.UserDefinedType() |
| 1094 ..structType = _sensors_SensorService_AddListener_Params__(); |
| 1095 |
| 1096 |
| 1097 |
| 1098 |
| 1099 map["_sensors_SensorListener__"] = |
| 1100 new mojom_types.UserDefinedType() |
| 1101 ..interfaceType = _sensors_SensorListener__(); |
| 1102 |
| 1103 |
| 1104 |
| 1105 |
| 1106 |
| 1107 map["_sensors_SensorService__"] = |
| 1108 new mojom_types.UserDefinedType() |
| 1109 ..interfaceType = _sensors_SensorService__(); |
| 1110 |
| 1111 return map; |
| 1112 } |
| 1113 |
| 1114 Map<String, mojom_types.UserDefinedType> getAllMojomTypeDefinitions() { |
| 1115 return _MojomDesc__; |
| 1116 } |
| 1117 |
| 1118 |
OLD | NEW |