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 input_dispatcher_mojom; | 4 library input_dispatcher_mojom; |
5 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'package:mojo/bindings.dart' as bindings; | 6 import 'package:mojo/bindings.dart' as bindings; |
7 import 'package:mojo/core.dart' as core; | 7 import 'package:mojo/core.dart' as core; |
8 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; | 8 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; |
9 import 'package:mojo_services/mojo/input_events.mojom.dart' as input_events_mojo
m; | 9 import 'package:mojo_services/mojo/input_events.mojom.dart' as input_events_mojo
m; |
10 | 10 |
11 | 11 |
12 | 12 |
13 class _InputDispatcherDispatchEventParams extends bindings.Struct { | 13 class _InputDispatcherDispatchEventParams extends bindings.Struct { |
14 static const List<bindings.StructDataHeader> kVersions = const [ | 14 static const List<bindings.StructDataHeader> kVersions = const [ |
15 const bindings.StructDataHeader(16, 0) | 15 const bindings.StructDataHeader(16, 0) |
16 ]; | 16 ]; |
17 input_events_mojom.Event event = null; | 17 input_events_mojom.Event event = null; |
18 | 18 |
19 _InputDispatcherDispatchEventParams() : super(kVersions.last.size); | 19 _InputDispatcherDispatchEventParams() : super(kVersions.last.size); |
20 | 20 |
| 21 _InputDispatcherDispatchEventParams.init( |
| 22 input_events_mojom.Event this.event |
| 23 ) : super(kVersions.last.size); |
| 24 |
21 static _InputDispatcherDispatchEventParams deserialize(bindings.Message messag
e) { | 25 static _InputDispatcherDispatchEventParams deserialize(bindings.Message messag
e) { |
22 var decoder = new bindings.Decoder(message); | 26 var decoder = new bindings.Decoder(message); |
23 var result = decode(decoder); | 27 var result = decode(decoder); |
24 if (decoder.excessHandles != null) { | 28 if (decoder.excessHandles != null) { |
25 decoder.excessHandles.forEach((h) => h.close()); | 29 decoder.excessHandles.forEach((h) => h.close()); |
26 } | 30 } |
27 return result; | 31 return result; |
28 } | 32 } |
29 | 33 |
30 static _InputDispatcherDispatchEventParams decode(bindings.Decoder decoder0) { | 34 static _InputDispatcherDispatchEventParams decode(bindings.Decoder decoder0) { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 Map toJson() { | 82 Map toJson() { |
79 Map map = new Map(); | 83 Map map = new Map(); |
80 map["event"] = event; | 84 map["event"] = event; |
81 return map; | 85 return map; |
82 } | 86 } |
83 } | 87 } |
84 | 88 |
85 const int _inputDispatcherMethodDispatchEventName = 0; | 89 const int _inputDispatcherMethodDispatchEventName = 0; |
86 | 90 |
87 class _InputDispatcherServiceDescription implements service_describer.ServiceDes
cription { | 91 class _InputDispatcherServiceDescription implements service_describer.ServiceDes
cription { |
88 dynamic getTopLevelInterface([Function responseFactory]) => | 92 void getTopLevelInterface(Function responder) { |
89 responseFactory(null); | 93 responder(null); |
| 94 } |
90 | 95 |
91 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 96 void getTypeDefinition(String typeKey, Function responder) { |
92 responseFactory(null); | 97 responder(null); |
| 98 } |
93 | 99 |
94 dynamic getAllTypeDefinitions([Function responseFactory]) => | 100 void getAllTypeDefinitions(Function responder) { |
95 responseFactory(null); | 101 responder(null); |
| 102 } |
96 } | 103 } |
97 | 104 |
98 abstract class InputDispatcher { | 105 abstract class InputDispatcher { |
99 static const String serviceName = "mojo::ui::InputDispatcher"; | 106 static const String serviceName = "mojo::ui::InputDispatcher"; |
100 | 107 |
101 static service_describer.ServiceDescription _cachedServiceDescription; | 108 static service_describer.ServiceDescription _cachedServiceDescription; |
102 static service_describer.ServiceDescription get serviceDescription { | 109 static service_describer.ServiceDescription get serviceDescription { |
103 if (_cachedServiceDescription == null) { | 110 if (_cachedServiceDescription == null) { |
104 _cachedServiceDescription = new _InputDispatcherServiceDescription(); | 111 _cachedServiceDescription = new _InputDispatcherServiceDescription(); |
105 } | 112 } |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 : super.fromHandle(handle, autoBegin: impl != null) { | 242 : super.fromHandle(handle, autoBegin: impl != null) { |
236 _impl = impl; | 243 _impl = impl; |
237 } | 244 } |
238 | 245 |
239 _InputDispatcherStubControl.unbound([this._impl]) : super.unbound(); | 246 _InputDispatcherStubControl.unbound([this._impl]) : super.unbound(); |
240 | 247 |
241 String get serviceName => InputDispatcher.serviceName; | 248 String get serviceName => InputDispatcher.serviceName; |
242 | 249 |
243 | 250 |
244 | 251 |
245 dynamic handleMessage(bindings.ServiceMessage message) { | 252 void handleMessage(bindings.ServiceMessage message) { |
246 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 253 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
247 return bindings.ControlMessageHandler.handleMessage(this, | 254 bindings.ControlMessageHandler.handleMessage( |
248 0, | 255 this, 0, message); |
249 message); | 256 return; |
250 } | 257 } |
251 if (_impl == null) { | 258 if (_impl == null) { |
252 throw new core.MojoApiError("$this has no implementation set"); | 259 throw new core.MojoApiError("$this has no implementation set"); |
253 } | 260 } |
254 switch (message.header.type) { | 261 switch (message.header.type) { |
255 case _inputDispatcherMethodDispatchEventName: | 262 case _inputDispatcherMethodDispatchEventName: |
256 var params = _InputDispatcherDispatchEventParams.deserialize( | 263 var params = _InputDispatcherDispatchEventParams.deserialize( |
257 message.payload); | 264 message.payload); |
258 _impl.dispatchEvent(params.event); | 265 _impl.dispatchEvent(params.event); |
259 break; | 266 break; |
260 default: | 267 default: |
261 throw new bindings.MojoCodecError("Unexpected message name"); | 268 throw new bindings.MojoCodecError("Unexpected message name"); |
262 break; | 269 break; |
263 } | 270 } |
264 return null; | |
265 } | 271 } |
266 | 272 |
267 InputDispatcher get impl => _impl; | 273 InputDispatcher get impl => _impl; |
268 set impl(InputDispatcher d) { | 274 set impl(InputDispatcher d) { |
269 if (d == null) { | 275 if (d == null) { |
270 throw new core.MojoApiError("$this: Cannot set a null implementation"); | 276 throw new core.MojoApiError("$this: Cannot set a null implementation"); |
271 } | 277 } |
272 if (isBound && (_impl == null)) { | 278 if (isBound && (_impl == null)) { |
273 beginHandlingEvents(); | 279 beginHandlingEvents(); |
274 } | 280 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 } | 321 } |
316 | 322 |
317 | 323 |
318 void dispatchEvent(input_events_mojom.Event event) { | 324 void dispatchEvent(input_events_mojom.Event event) { |
319 return impl.dispatchEvent(event); | 325 return impl.dispatchEvent(event); |
320 } | 326 } |
321 } | 327 } |
322 | 328 |
323 | 329 |
324 | 330 |
OLD | NEW |