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 input_connection_mojom; | 5 library input_connection_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/bindings/types/mojom_types.mojom.dart' as mojom_types; |
| 12 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; |
11 import 'package:mojo_services/mojo/input_events.mojom.dart' as input_events_mojo
m; | 13 import 'package:mojo_services/mojo/input_events.mojom.dart' as input_events_mojo
m; |
12 | 14 |
13 | 15 |
14 | 16 |
15 class _InputConnectionSetListenerParams extends bindings.Struct { | 17 class _InputConnectionSetListenerParams extends bindings.Struct { |
16 static const List<bindings.StructDataHeader> kVersions = const [ | 18 static const List<bindings.StructDataHeader> kVersions = const [ |
17 const bindings.StructDataHeader(16, 0) | 19 const bindings.StructDataHeader(16, 0) |
18 ]; | 20 ]; |
19 Object listener = null; | 21 Object listener = null; |
20 | 22 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 "listener: $listener" ")"; | 73 "listener: $listener" ")"; |
72 } | 74 } |
73 | 75 |
74 Map toJson() { | 76 Map toJson() { |
75 throw new bindings.MojoCodecError( | 77 throw new bindings.MojoCodecError( |
76 'Object containing handles cannot be encoded to JSON.'); | 78 'Object containing handles cannot be encoded to JSON.'); |
77 } | 79 } |
78 } | 80 } |
79 | 81 |
80 | 82 |
| 83 |
| 84 |
81 class _InputListenerOnEventParams extends bindings.Struct { | 85 class _InputListenerOnEventParams extends bindings.Struct { |
82 static const List<bindings.StructDataHeader> kVersions = const [ | 86 static const List<bindings.StructDataHeader> kVersions = const [ |
83 const bindings.StructDataHeader(16, 0) | 87 const bindings.StructDataHeader(16, 0) |
84 ]; | 88 ]; |
85 input_events_mojom.Event event = null; | 89 input_events_mojom.Event event = null; |
86 | 90 |
87 _InputListenerOnEventParams() : super(kVersions.last.size); | 91 _InputListenerOnEventParams() : super(kVersions.last.size); |
88 | 92 |
89 static _InputListenerOnEventParams deserialize(bindings.Message message) { | 93 static _InputListenerOnEventParams deserialize(bindings.Message message) { |
90 var decoder = new bindings.Decoder(message); | 94 var decoder = new bindings.Decoder(message); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 } | 143 } |
140 | 144 |
141 Map toJson() { | 145 Map toJson() { |
142 Map map = new Map(); | 146 Map map = new Map(); |
143 map["event"] = event; | 147 map["event"] = event; |
144 return map; | 148 return map; |
145 } | 149 } |
146 } | 150 } |
147 | 151 |
148 | 152 |
| 153 |
| 154 |
149 class InputListenerOnEventResponseParams extends bindings.Struct { | 155 class InputListenerOnEventResponseParams extends bindings.Struct { |
150 static const List<bindings.StructDataHeader> kVersions = const [ | 156 static const List<bindings.StructDataHeader> kVersions = const [ |
151 const bindings.StructDataHeader(16, 0) | 157 const bindings.StructDataHeader(16, 0) |
152 ]; | 158 ]; |
153 bool consumed = false; | 159 bool consumed = false; |
154 | 160 |
155 InputListenerOnEventResponseParams() : super(kVersions.last.size); | 161 InputListenerOnEventResponseParams() : super(kVersions.last.size); |
156 | 162 |
157 static InputListenerOnEventResponseParams deserialize(bindings.Message message
) { | 163 static InputListenerOnEventResponseParams deserialize(bindings.Message message
) { |
158 var decoder = new bindings.Decoder(message); | 164 var decoder = new bindings.Decoder(message); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 "consumed: $consumed" ")"; | 211 "consumed: $consumed" ")"; |
206 } | 212 } |
207 | 213 |
208 Map toJson() { | 214 Map toJson() { |
209 Map map = new Map(); | 215 Map map = new Map(); |
210 map["consumed"] = consumed; | 216 map["consumed"] = consumed; |
211 return map; | 217 return map; |
212 } | 218 } |
213 } | 219 } |
214 | 220 |
| 221 |
| 222 |
| 223 |
215 const int _InputConnection_setListenerName = 0; | 224 const int _InputConnection_setListenerName = 0; |
216 | 225 |
| 226 |
| 227 |
| 228 class _InputConnectionServiceDescription implements service_describer.ServiceDes
cription { |
| 229 dynamic getTopLevelInterface([Function responseFactory]) => null; |
| 230 |
| 231 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => null; |
| 232 |
| 233 dynamic getAllTypeDefinitions([Function responseFactory]) => null; |
| 234 } |
| 235 |
217 abstract class InputConnection { | 236 abstract class InputConnection { |
218 static const String serviceName = "mojo::ui::InputConnection"; | 237 static const String serviceName = "mojo::ui::InputConnection"; |
219 void setListener(Object listener); | 238 void setListener(Object listener); |
220 } | 239 } |
221 | 240 |
222 | 241 |
223 class _InputConnectionProxyImpl extends bindings.Proxy { | 242 class _InputConnectionProxyImpl extends bindings.Proxy { |
224 _InputConnectionProxyImpl.fromEndpoint( | 243 _InputConnectionProxyImpl.fromEndpoint( |
225 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 244 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
226 | 245 |
227 _InputConnectionProxyImpl.fromHandle(core.MojoHandle handle) : | 246 _InputConnectionProxyImpl.fromHandle(core.MojoHandle handle) : |
228 super.fromHandle(handle); | 247 super.fromHandle(handle); |
229 | 248 |
230 _InputConnectionProxyImpl.unbound() : super.unbound(); | 249 _InputConnectionProxyImpl.unbound() : super.unbound(); |
231 | 250 |
232 static _InputConnectionProxyImpl newFromEndpoint( | 251 static _InputConnectionProxyImpl newFromEndpoint( |
233 core.MojoMessagePipeEndpoint endpoint) { | 252 core.MojoMessagePipeEndpoint endpoint) { |
234 assert(endpoint.setDescription("For _InputConnectionProxyImpl")); | 253 assert(endpoint.setDescription("For _InputConnectionProxyImpl")); |
235 return new _InputConnectionProxyImpl.fromEndpoint(endpoint); | 254 return new _InputConnectionProxyImpl.fromEndpoint(endpoint); |
236 } | 255 } |
237 | 256 |
| 257 service_describer.ServiceDescription get serviceDescription => |
| 258 new _InputConnectionServiceDescription(); |
| 259 |
238 void handleResponse(bindings.ServiceMessage message) { | 260 void handleResponse(bindings.ServiceMessage message) { |
239 switch (message.header.type) { | 261 switch (message.header.type) { |
240 default: | 262 default: |
241 proxyError("Unexpected message type: ${message.header.type}"); | 263 proxyError("Unexpected message type: ${message.header.type}"); |
242 close(immediate: true); | 264 close(immediate: true); |
243 break; | 265 break; |
244 } | 266 } |
245 } | 267 } |
246 | 268 |
247 String toString() { | 269 String toString() { |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 assert(_impl == null); | 393 assert(_impl == null); |
372 _impl = d; | 394 _impl = d; |
373 } | 395 } |
374 | 396 |
375 String toString() { | 397 String toString() { |
376 var superString = super.toString(); | 398 var superString = super.toString(); |
377 return "InputConnectionStub($superString)"; | 399 return "InputConnectionStub($superString)"; |
378 } | 400 } |
379 | 401 |
380 int get version => 0; | 402 int get version => 0; |
| 403 |
| 404 service_describer.ServiceDescription get serviceDescription => |
| 405 new _InputConnectionServiceDescription(); |
381 } | 406 } |
382 | 407 |
383 const int _InputListener_onEventName = 0; | 408 const int _InputListener_onEventName = 0; |
384 | 409 |
| 410 |
| 411 |
| 412 class _InputListenerServiceDescription implements service_describer.ServiceDescr
iption { |
| 413 dynamic getTopLevelInterface([Function responseFactory]) => null; |
| 414 |
| 415 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => null; |
| 416 |
| 417 dynamic getAllTypeDefinitions([Function responseFactory]) => null; |
| 418 } |
| 419 |
385 abstract class InputListener { | 420 abstract class InputListener { |
386 static const String serviceName = null; | 421 static const String serviceName = null; |
387 dynamic onEvent(input_events_mojom.Event event,[Function responseFactory = nul
l]); | 422 dynamic onEvent(input_events_mojom.Event event,[Function responseFactory = nul
l]); |
388 } | 423 } |
389 | 424 |
390 | 425 |
391 class _InputListenerProxyImpl extends bindings.Proxy { | 426 class _InputListenerProxyImpl extends bindings.Proxy { |
392 _InputListenerProxyImpl.fromEndpoint( | 427 _InputListenerProxyImpl.fromEndpoint( |
393 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 428 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
394 | 429 |
395 _InputListenerProxyImpl.fromHandle(core.MojoHandle handle) : | 430 _InputListenerProxyImpl.fromHandle(core.MojoHandle handle) : |
396 super.fromHandle(handle); | 431 super.fromHandle(handle); |
397 | 432 |
398 _InputListenerProxyImpl.unbound() : super.unbound(); | 433 _InputListenerProxyImpl.unbound() : super.unbound(); |
399 | 434 |
400 static _InputListenerProxyImpl newFromEndpoint( | 435 static _InputListenerProxyImpl newFromEndpoint( |
401 core.MojoMessagePipeEndpoint endpoint) { | 436 core.MojoMessagePipeEndpoint endpoint) { |
402 assert(endpoint.setDescription("For _InputListenerProxyImpl")); | 437 assert(endpoint.setDescription("For _InputListenerProxyImpl")); |
403 return new _InputListenerProxyImpl.fromEndpoint(endpoint); | 438 return new _InputListenerProxyImpl.fromEndpoint(endpoint); |
404 } | 439 } |
405 | 440 |
| 441 service_describer.ServiceDescription get serviceDescription => |
| 442 new _InputListenerServiceDescription(); |
| 443 |
406 void handleResponse(bindings.ServiceMessage message) { | 444 void handleResponse(bindings.ServiceMessage message) { |
407 switch (message.header.type) { | 445 switch (message.header.type) { |
408 case _InputListener_onEventName: | 446 case _InputListener_onEventName: |
409 var r = InputListenerOnEventResponseParams.deserialize( | 447 var r = InputListenerOnEventResponseParams.deserialize( |
410 message.payload); | 448 message.payload); |
411 if (!message.header.hasRequestId) { | 449 if (!message.header.hasRequestId) { |
412 proxyError("Expected a message with a valid request Id."); | 450 proxyError("Expected a message with a valid request Id."); |
413 return; | 451 return; |
414 } | 452 } |
415 Completer c = completerMap[message.header.requestId]; | 453 Completer c = completerMap[message.header.requestId]; |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 assert(_impl == null); | 619 assert(_impl == null); |
582 _impl = d; | 620 _impl = d; |
583 } | 621 } |
584 | 622 |
585 String toString() { | 623 String toString() { |
586 var superString = super.toString(); | 624 var superString = super.toString(); |
587 return "InputListenerStub($superString)"; | 625 return "InputListenerStub($superString)"; |
588 } | 626 } |
589 | 627 |
590 int get version => 0; | 628 int get version => 0; |
| 629 |
| 630 service_describer.ServiceDescription get serviceDescription => |
| 631 new _InputListenerServiceDescription(); |
591 } | 632 } |
592 | 633 |
593 | 634 |
| 635 |
OLD | NEW |