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 terminal_client_mojom; | 4 library terminal_client_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/files/file.mojom.dart' as file_mojom; | 9 import 'package:mojo_services/mojo/files/file.mojom.dart' as file_mojom; |
10 | 10 |
11 | 11 |
12 | 12 |
13 class _TerminalClientConnectToTerminalParams extends bindings.Struct { | 13 class _TerminalClientConnectToTerminalParams 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 file_mojom.FileInterface terminal = null; | 17 file_mojom.FileInterface terminal = null; |
18 | 18 |
19 _TerminalClientConnectToTerminalParams() : super(kVersions.last.size); | 19 _TerminalClientConnectToTerminalParams() : super(kVersions.last.size); |
20 | 20 |
| 21 _TerminalClientConnectToTerminalParams.init( |
| 22 file_mojom.FileInterface this.terminal |
| 23 ) : super(kVersions.last.size); |
| 24 |
21 static _TerminalClientConnectToTerminalParams deserialize(bindings.Message mes
sage) { | 25 static _TerminalClientConnectToTerminalParams deserialize(bindings.Message mes
sage) { |
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 _TerminalClientConnectToTerminalParams decode(bindings.Decoder decoder0
) { | 34 static _TerminalClientConnectToTerminalParams decode(bindings.Decoder decoder0
) { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 80 |
77 Map toJson() { | 81 Map toJson() { |
78 throw new bindings.MojoCodecError( | 82 throw new bindings.MojoCodecError( |
79 'Object containing handles cannot be encoded to JSON.'); | 83 'Object containing handles cannot be encoded to JSON.'); |
80 } | 84 } |
81 } | 85 } |
82 | 86 |
83 const int _terminalClientMethodConnectToTerminalName = 0; | 87 const int _terminalClientMethodConnectToTerminalName = 0; |
84 | 88 |
85 class _TerminalClientServiceDescription implements service_describer.ServiceDesc
ription { | 89 class _TerminalClientServiceDescription implements service_describer.ServiceDesc
ription { |
86 dynamic getTopLevelInterface([Function responseFactory]) => | 90 void getTopLevelInterface(Function responder) { |
87 responseFactory(null); | 91 responder(null); |
| 92 } |
88 | 93 |
89 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 94 void getTypeDefinition(String typeKey, Function responder) { |
90 responseFactory(null); | 95 responder(null); |
| 96 } |
91 | 97 |
92 dynamic getAllTypeDefinitions([Function responseFactory]) => | 98 void getAllTypeDefinitions(Function responder) { |
93 responseFactory(null); | 99 responder(null); |
| 100 } |
94 } | 101 } |
95 | 102 |
96 abstract class TerminalClient { | 103 abstract class TerminalClient { |
97 static const String serviceName = "mojo::terminal::TerminalClient"; | 104 static const String serviceName = "mojo::terminal::TerminalClient"; |
98 | 105 |
99 static service_describer.ServiceDescription _cachedServiceDescription; | 106 static service_describer.ServiceDescription _cachedServiceDescription; |
100 static service_describer.ServiceDescription get serviceDescription { | 107 static service_describer.ServiceDescription get serviceDescription { |
101 if (_cachedServiceDescription == null) { | 108 if (_cachedServiceDescription == null) { |
102 _cachedServiceDescription = new _TerminalClientServiceDescription(); | 109 _cachedServiceDescription = new _TerminalClientServiceDescription(); |
103 } | 110 } |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 : super.fromHandle(handle, autoBegin: impl != null) { | 240 : super.fromHandle(handle, autoBegin: impl != null) { |
234 _impl = impl; | 241 _impl = impl; |
235 } | 242 } |
236 | 243 |
237 _TerminalClientStubControl.unbound([this._impl]) : super.unbound(); | 244 _TerminalClientStubControl.unbound([this._impl]) : super.unbound(); |
238 | 245 |
239 String get serviceName => TerminalClient.serviceName; | 246 String get serviceName => TerminalClient.serviceName; |
240 | 247 |
241 | 248 |
242 | 249 |
243 dynamic handleMessage(bindings.ServiceMessage message) { | 250 void handleMessage(bindings.ServiceMessage message) { |
244 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 251 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
245 return bindings.ControlMessageHandler.handleMessage(this, | 252 bindings.ControlMessageHandler.handleMessage( |
246 0, | 253 this, 0, message); |
247 message); | 254 return; |
248 } | 255 } |
249 if (_impl == null) { | 256 if (_impl == null) { |
250 throw new core.MojoApiError("$this has no implementation set"); | 257 throw new core.MojoApiError("$this has no implementation set"); |
251 } | 258 } |
252 switch (message.header.type) { | 259 switch (message.header.type) { |
253 case _terminalClientMethodConnectToTerminalName: | 260 case _terminalClientMethodConnectToTerminalName: |
254 var params = _TerminalClientConnectToTerminalParams.deserialize( | 261 var params = _TerminalClientConnectToTerminalParams.deserialize( |
255 message.payload); | 262 message.payload); |
256 _impl.connectToTerminal(params.terminal); | 263 _impl.connectToTerminal(params.terminal); |
257 break; | 264 break; |
258 default: | 265 default: |
259 throw new bindings.MojoCodecError("Unexpected message name"); | 266 throw new bindings.MojoCodecError("Unexpected message name"); |
260 break; | 267 break; |
261 } | 268 } |
262 return null; | |
263 } | 269 } |
264 | 270 |
265 TerminalClient get impl => _impl; | 271 TerminalClient get impl => _impl; |
266 set impl(TerminalClient d) { | 272 set impl(TerminalClient d) { |
267 if (d == null) { | 273 if (d == null) { |
268 throw new core.MojoApiError("$this: Cannot set a null implementation"); | 274 throw new core.MojoApiError("$this: Cannot set a null implementation"); |
269 } | 275 } |
270 if (isBound && (_impl == null)) { | 276 if (isBound && (_impl == null)) { |
271 beginHandlingEvents(); | 277 beginHandlingEvents(); |
272 } | 278 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 } | 319 } |
314 | 320 |
315 | 321 |
316 void connectToTerminal(file_mojom.FileInterface terminal) { | 322 void connectToTerminal(file_mojom.FileInterface terminal) { |
317 return impl.connectToTerminal(terminal); | 323 return impl.connectToTerminal(terminal); |
318 } | 324 } |
319 } | 325 } |
320 | 326 |
321 | 327 |
322 | 328 |
OLD | NEW |