OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 library window_manager_mojom; | |
6 | |
7 import 'dart:async'; | |
8 | |
9 import 'package:mojo/bindings.dart' as bindings; | |
10 import 'package:mojo/core.dart' as core; | |
11 import 'package:mojo_services/mojo/input_events.mojom.dart' as input_events_mojo
m; | |
12 import 'package:mojo/mojo/service_provider.mojom.dart' as service_provider_mojom
; | |
13 | |
14 | |
15 | |
16 class _WindowManagerEmbedParams extends bindings.Struct { | |
17 static const List<bindings.StructDataHeader> kVersions = const [ | |
18 const bindings.StructDataHeader(32, 0) | |
19 ]; | |
20 String url = null; | |
21 Object services = null; | |
22 Object exposedServices = null; | |
23 | |
24 _WindowManagerEmbedParams() : super(kVersions.last.size); | |
25 | |
26 static _WindowManagerEmbedParams deserialize(bindings.Message message) { | |
27 var decoder = new bindings.Decoder(message); | |
28 var result = decode(decoder); | |
29 if (decoder.excessHandles != null) { | |
30 decoder.excessHandles.forEach((h) => h.close()); | |
31 } | |
32 return result; | |
33 } | |
34 | |
35 static _WindowManagerEmbedParams decode(bindings.Decoder decoder0) { | |
36 if (decoder0 == null) { | |
37 return null; | |
38 } | |
39 _WindowManagerEmbedParams result = new _WindowManagerEmbedParams(); | |
40 | |
41 var mainDataHeader = decoder0.decodeStructDataHeader(); | |
42 if (mainDataHeader.version <= kVersions.last.version) { | |
43 // Scan in reverse order to optimize for more recent versions. | |
44 for (int i = kVersions.length - 1; i >= 0; --i) { | |
45 if (mainDataHeader.version >= kVersions[i].version) { | |
46 if (mainDataHeader.size == kVersions[i].size) { | |
47 // Found a match. | |
48 break; | |
49 } | |
50 throw new bindings.MojoCodecError( | |
51 'Header size doesn\'t correspond to known version size.'); | |
52 } | |
53 } | |
54 } else if (mainDataHeader.size < kVersions.last.size) { | |
55 throw new bindings.MojoCodecError( | |
56 'Message newer than the last known version cannot be shorter than ' | |
57 'required by the last known version.'); | |
58 } | |
59 if (mainDataHeader.version >= 0) { | |
60 | |
61 result.url = decoder0.decodeString(8, false); | |
62 } | |
63 if (mainDataHeader.version >= 0) { | |
64 | |
65 result.services = decoder0.decodeInterfaceRequest(16, true, service_provid
er_mojom.ServiceProviderStub.newFromEndpoint); | |
66 } | |
67 if (mainDataHeader.version >= 0) { | |
68 | |
69 result.exposedServices = decoder0.decodeServiceInterface(20, true, service
_provider_mojom.ServiceProviderProxy.newFromEndpoint); | |
70 } | |
71 return result; | |
72 } | |
73 | |
74 void encode(bindings.Encoder encoder) { | |
75 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); | |
76 | |
77 encoder0.encodeString(url, 8, false); | |
78 | |
79 encoder0.encodeInterfaceRequest(services, 16, true); | |
80 | |
81 encoder0.encodeInterface(exposedServices, 20, true); | |
82 } | |
83 | |
84 String toString() { | |
85 return "_WindowManagerEmbedParams(" | |
86 "url: $url" ", " | |
87 "services: $services" ", " | |
88 "exposedServices: $exposedServices" ")"; | |
89 } | |
90 | |
91 Map toJson() { | |
92 throw new bindings.MojoCodecError( | |
93 'Object containing handles cannot be encoded to JSON.'); | |
94 } | |
95 } | |
96 | |
97 | |
98 class _WindowManagerSetCaptureParams extends bindings.Struct { | |
99 static const List<bindings.StructDataHeader> kVersions = const [ | |
100 const bindings.StructDataHeader(16, 0) | |
101 ]; | |
102 int viewId = 0; | |
103 | |
104 _WindowManagerSetCaptureParams() : super(kVersions.last.size); | |
105 | |
106 static _WindowManagerSetCaptureParams deserialize(bindings.Message message) { | |
107 var decoder = new bindings.Decoder(message); | |
108 var result = decode(decoder); | |
109 if (decoder.excessHandles != null) { | |
110 decoder.excessHandles.forEach((h) => h.close()); | |
111 } | |
112 return result; | |
113 } | |
114 | |
115 static _WindowManagerSetCaptureParams decode(bindings.Decoder decoder0) { | |
116 if (decoder0 == null) { | |
117 return null; | |
118 } | |
119 _WindowManagerSetCaptureParams result = new _WindowManagerSetCaptureParams()
; | |
120 | |
121 var mainDataHeader = decoder0.decodeStructDataHeader(); | |
122 if (mainDataHeader.version <= kVersions.last.version) { | |
123 // Scan in reverse order to optimize for more recent versions. | |
124 for (int i = kVersions.length - 1; i >= 0; --i) { | |
125 if (mainDataHeader.version >= kVersions[i].version) { | |
126 if (mainDataHeader.size == kVersions[i].size) { | |
127 // Found a match. | |
128 break; | |
129 } | |
130 throw new bindings.MojoCodecError( | |
131 'Header size doesn\'t correspond to known version size.'); | |
132 } | |
133 } | |
134 } else if (mainDataHeader.size < kVersions.last.size) { | |
135 throw new bindings.MojoCodecError( | |
136 'Message newer than the last known version cannot be shorter than ' | |
137 'required by the last known version.'); | |
138 } | |
139 if (mainDataHeader.version >= 0) { | |
140 | |
141 result.viewId = decoder0.decodeUint32(8); | |
142 } | |
143 return result; | |
144 } | |
145 | |
146 void encode(bindings.Encoder encoder) { | |
147 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); | |
148 | |
149 encoder0.encodeUint32(viewId, 8); | |
150 } | |
151 | |
152 String toString() { | |
153 return "_WindowManagerSetCaptureParams(" | |
154 "viewId: $viewId" ")"; | |
155 } | |
156 | |
157 Map toJson() { | |
158 Map map = new Map(); | |
159 map["viewId"] = viewId; | |
160 return map; | |
161 } | |
162 } | |
163 | |
164 | |
165 class WindowManagerSetCaptureResponseParams extends bindings.Struct { | |
166 static const List<bindings.StructDataHeader> kVersions = const [ | |
167 const bindings.StructDataHeader(16, 0) | |
168 ]; | |
169 bool success = false; | |
170 | |
171 WindowManagerSetCaptureResponseParams() : super(kVersions.last.size); | |
172 | |
173 static WindowManagerSetCaptureResponseParams deserialize(bindings.Message mess
age) { | |
174 var decoder = new bindings.Decoder(message); | |
175 var result = decode(decoder); | |
176 if (decoder.excessHandles != null) { | |
177 decoder.excessHandles.forEach((h) => h.close()); | |
178 } | |
179 return result; | |
180 } | |
181 | |
182 static WindowManagerSetCaptureResponseParams decode(bindings.Decoder decoder0)
{ | |
183 if (decoder0 == null) { | |
184 return null; | |
185 } | |
186 WindowManagerSetCaptureResponseParams result = new WindowManagerSetCaptureRe
sponseParams(); | |
187 | |
188 var mainDataHeader = decoder0.decodeStructDataHeader(); | |
189 if (mainDataHeader.version <= kVersions.last.version) { | |
190 // Scan in reverse order to optimize for more recent versions. | |
191 for (int i = kVersions.length - 1; i >= 0; --i) { | |
192 if (mainDataHeader.version >= kVersions[i].version) { | |
193 if (mainDataHeader.size == kVersions[i].size) { | |
194 // Found a match. | |
195 break; | |
196 } | |
197 throw new bindings.MojoCodecError( | |
198 'Header size doesn\'t correspond to known version size.'); | |
199 } | |
200 } | |
201 } else if (mainDataHeader.size < kVersions.last.size) { | |
202 throw new bindings.MojoCodecError( | |
203 'Message newer than the last known version cannot be shorter than ' | |
204 'required by the last known version.'); | |
205 } | |
206 if (mainDataHeader.version >= 0) { | |
207 | |
208 result.success = decoder0.decodeBool(8, 0); | |
209 } | |
210 return result; | |
211 } | |
212 | |
213 void encode(bindings.Encoder encoder) { | |
214 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); | |
215 | |
216 encoder0.encodeBool(success, 8, 0); | |
217 } | |
218 | |
219 String toString() { | |
220 return "WindowManagerSetCaptureResponseParams(" | |
221 "success: $success" ")"; | |
222 } | |
223 | |
224 Map toJson() { | |
225 Map map = new Map(); | |
226 map["success"] = success; | |
227 return map; | |
228 } | |
229 } | |
230 | |
231 | |
232 class _WindowManagerFocusWindowParams extends bindings.Struct { | |
233 static const List<bindings.StructDataHeader> kVersions = const [ | |
234 const bindings.StructDataHeader(16, 0) | |
235 ]; | |
236 int viewId = 0; | |
237 | |
238 _WindowManagerFocusWindowParams() : super(kVersions.last.size); | |
239 | |
240 static _WindowManagerFocusWindowParams deserialize(bindings.Message message) { | |
241 var decoder = new bindings.Decoder(message); | |
242 var result = decode(decoder); | |
243 if (decoder.excessHandles != null) { | |
244 decoder.excessHandles.forEach((h) => h.close()); | |
245 } | |
246 return result; | |
247 } | |
248 | |
249 static _WindowManagerFocusWindowParams decode(bindings.Decoder decoder0) { | |
250 if (decoder0 == null) { | |
251 return null; | |
252 } | |
253 _WindowManagerFocusWindowParams result = new _WindowManagerFocusWindowParams
(); | |
254 | |
255 var mainDataHeader = decoder0.decodeStructDataHeader(); | |
256 if (mainDataHeader.version <= kVersions.last.version) { | |
257 // Scan in reverse order to optimize for more recent versions. | |
258 for (int i = kVersions.length - 1; i >= 0; --i) { | |
259 if (mainDataHeader.version >= kVersions[i].version) { | |
260 if (mainDataHeader.size == kVersions[i].size) { | |
261 // Found a match. | |
262 break; | |
263 } | |
264 throw new bindings.MojoCodecError( | |
265 'Header size doesn\'t correspond to known version size.'); | |
266 } | |
267 } | |
268 } else if (mainDataHeader.size < kVersions.last.size) { | |
269 throw new bindings.MojoCodecError( | |
270 'Message newer than the last known version cannot be shorter than ' | |
271 'required by the last known version.'); | |
272 } | |
273 if (mainDataHeader.version >= 0) { | |
274 | |
275 result.viewId = decoder0.decodeUint32(8); | |
276 } | |
277 return result; | |
278 } | |
279 | |
280 void encode(bindings.Encoder encoder) { | |
281 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); | |
282 | |
283 encoder0.encodeUint32(viewId, 8); | |
284 } | |
285 | |
286 String toString() { | |
287 return "_WindowManagerFocusWindowParams(" | |
288 "viewId: $viewId" ")"; | |
289 } | |
290 | |
291 Map toJson() { | |
292 Map map = new Map(); | |
293 map["viewId"] = viewId; | |
294 return map; | |
295 } | |
296 } | |
297 | |
298 | |
299 class WindowManagerFocusWindowResponseParams extends bindings.Struct { | |
300 static const List<bindings.StructDataHeader> kVersions = const [ | |
301 const bindings.StructDataHeader(16, 0) | |
302 ]; | |
303 bool success = false; | |
304 | |
305 WindowManagerFocusWindowResponseParams() : super(kVersions.last.size); | |
306 | |
307 static WindowManagerFocusWindowResponseParams deserialize(bindings.Message mes
sage) { | |
308 var decoder = new bindings.Decoder(message); | |
309 var result = decode(decoder); | |
310 if (decoder.excessHandles != null) { | |
311 decoder.excessHandles.forEach((h) => h.close()); | |
312 } | |
313 return result; | |
314 } | |
315 | |
316 static WindowManagerFocusWindowResponseParams decode(bindings.Decoder decoder0
) { | |
317 if (decoder0 == null) { | |
318 return null; | |
319 } | |
320 WindowManagerFocusWindowResponseParams result = new WindowManagerFocusWindow
ResponseParams(); | |
321 | |
322 var mainDataHeader = decoder0.decodeStructDataHeader(); | |
323 if (mainDataHeader.version <= kVersions.last.version) { | |
324 // Scan in reverse order to optimize for more recent versions. | |
325 for (int i = kVersions.length - 1; i >= 0; --i) { | |
326 if (mainDataHeader.version >= kVersions[i].version) { | |
327 if (mainDataHeader.size == kVersions[i].size) { | |
328 // Found a match. | |
329 break; | |
330 } | |
331 throw new bindings.MojoCodecError( | |
332 'Header size doesn\'t correspond to known version size.'); | |
333 } | |
334 } | |
335 } else if (mainDataHeader.size < kVersions.last.size) { | |
336 throw new bindings.MojoCodecError( | |
337 'Message newer than the last known version cannot be shorter than ' | |
338 'required by the last known version.'); | |
339 } | |
340 if (mainDataHeader.version >= 0) { | |
341 | |
342 result.success = decoder0.decodeBool(8, 0); | |
343 } | |
344 return result; | |
345 } | |
346 | |
347 void encode(bindings.Encoder encoder) { | |
348 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); | |
349 | |
350 encoder0.encodeBool(success, 8, 0); | |
351 } | |
352 | |
353 String toString() { | |
354 return "WindowManagerFocusWindowResponseParams(" | |
355 "success: $success" ")"; | |
356 } | |
357 | |
358 Map toJson() { | |
359 Map map = new Map(); | |
360 map["success"] = success; | |
361 return map; | |
362 } | |
363 } | |
364 | |
365 | |
366 class _WindowManagerActivateWindowParams extends bindings.Struct { | |
367 static const List<bindings.StructDataHeader> kVersions = const [ | |
368 const bindings.StructDataHeader(16, 0) | |
369 ]; | |
370 int viewId = 0; | |
371 | |
372 _WindowManagerActivateWindowParams() : super(kVersions.last.size); | |
373 | |
374 static _WindowManagerActivateWindowParams deserialize(bindings.Message message
) { | |
375 var decoder = new bindings.Decoder(message); | |
376 var result = decode(decoder); | |
377 if (decoder.excessHandles != null) { | |
378 decoder.excessHandles.forEach((h) => h.close()); | |
379 } | |
380 return result; | |
381 } | |
382 | |
383 static _WindowManagerActivateWindowParams decode(bindings.Decoder decoder0) { | |
384 if (decoder0 == null) { | |
385 return null; | |
386 } | |
387 _WindowManagerActivateWindowParams result = new _WindowManagerActivateWindow
Params(); | |
388 | |
389 var mainDataHeader = decoder0.decodeStructDataHeader(); | |
390 if (mainDataHeader.version <= kVersions.last.version) { | |
391 // Scan in reverse order to optimize for more recent versions. | |
392 for (int i = kVersions.length - 1; i >= 0; --i) { | |
393 if (mainDataHeader.version >= kVersions[i].version) { | |
394 if (mainDataHeader.size == kVersions[i].size) { | |
395 // Found a match. | |
396 break; | |
397 } | |
398 throw new bindings.MojoCodecError( | |
399 'Header size doesn\'t correspond to known version size.'); | |
400 } | |
401 } | |
402 } else if (mainDataHeader.size < kVersions.last.size) { | |
403 throw new bindings.MojoCodecError( | |
404 'Message newer than the last known version cannot be shorter than ' | |
405 'required by the last known version.'); | |
406 } | |
407 if (mainDataHeader.version >= 0) { | |
408 | |
409 result.viewId = decoder0.decodeUint32(8); | |
410 } | |
411 return result; | |
412 } | |
413 | |
414 void encode(bindings.Encoder encoder) { | |
415 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); | |
416 | |
417 encoder0.encodeUint32(viewId, 8); | |
418 } | |
419 | |
420 String toString() { | |
421 return "_WindowManagerActivateWindowParams(" | |
422 "viewId: $viewId" ")"; | |
423 } | |
424 | |
425 Map toJson() { | |
426 Map map = new Map(); | |
427 map["viewId"] = viewId; | |
428 return map; | |
429 } | |
430 } | |
431 | |
432 | |
433 class WindowManagerActivateWindowResponseParams extends bindings.Struct { | |
434 static const List<bindings.StructDataHeader> kVersions = const [ | |
435 const bindings.StructDataHeader(16, 0) | |
436 ]; | |
437 bool success = false; | |
438 | |
439 WindowManagerActivateWindowResponseParams() : super(kVersions.last.size); | |
440 | |
441 static WindowManagerActivateWindowResponseParams deserialize(bindings.Message
message) { | |
442 var decoder = new bindings.Decoder(message); | |
443 var result = decode(decoder); | |
444 if (decoder.excessHandles != null) { | |
445 decoder.excessHandles.forEach((h) => h.close()); | |
446 } | |
447 return result; | |
448 } | |
449 | |
450 static WindowManagerActivateWindowResponseParams decode(bindings.Decoder decod
er0) { | |
451 if (decoder0 == null) { | |
452 return null; | |
453 } | |
454 WindowManagerActivateWindowResponseParams result = new WindowManagerActivate
WindowResponseParams(); | |
455 | |
456 var mainDataHeader = decoder0.decodeStructDataHeader(); | |
457 if (mainDataHeader.version <= kVersions.last.version) { | |
458 // Scan in reverse order to optimize for more recent versions. | |
459 for (int i = kVersions.length - 1; i >= 0; --i) { | |
460 if (mainDataHeader.version >= kVersions[i].version) { | |
461 if (mainDataHeader.size == kVersions[i].size) { | |
462 // Found a match. | |
463 break; | |
464 } | |
465 throw new bindings.MojoCodecError( | |
466 'Header size doesn\'t correspond to known version size.'); | |
467 } | |
468 } | |
469 } else if (mainDataHeader.size < kVersions.last.size) { | |
470 throw new bindings.MojoCodecError( | |
471 'Message newer than the last known version cannot be shorter than ' | |
472 'required by the last known version.'); | |
473 } | |
474 if (mainDataHeader.version >= 0) { | |
475 | |
476 result.success = decoder0.decodeBool(8, 0); | |
477 } | |
478 return result; | |
479 } | |
480 | |
481 void encode(bindings.Encoder encoder) { | |
482 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); | |
483 | |
484 encoder0.encodeBool(success, 8, 0); | |
485 } | |
486 | |
487 String toString() { | |
488 return "WindowManagerActivateWindowResponseParams(" | |
489 "success: $success" ")"; | |
490 } | |
491 | |
492 Map toJson() { | |
493 Map map = new Map(); | |
494 map["success"] = success; | |
495 return map; | |
496 } | |
497 } | |
498 | |
499 | |
500 class _WindowManagerGetFocusedAndActiveViewsParams extends bindings.Struct { | |
501 static const List<bindings.StructDataHeader> kVersions = const [ | |
502 const bindings.StructDataHeader(16, 0) | |
503 ]; | |
504 Object observer = null; | |
505 | |
506 _WindowManagerGetFocusedAndActiveViewsParams() : super(kVersions.last.size); | |
507 | |
508 static _WindowManagerGetFocusedAndActiveViewsParams deserialize(bindings.Messa
ge message) { | |
509 var decoder = new bindings.Decoder(message); | |
510 var result = decode(decoder); | |
511 if (decoder.excessHandles != null) { | |
512 decoder.excessHandles.forEach((h) => h.close()); | |
513 } | |
514 return result; | |
515 } | |
516 | |
517 static _WindowManagerGetFocusedAndActiveViewsParams decode(bindings.Decoder de
coder0) { | |
518 if (decoder0 == null) { | |
519 return null; | |
520 } | |
521 _WindowManagerGetFocusedAndActiveViewsParams result = new _WindowManagerGetF
ocusedAndActiveViewsParams(); | |
522 | |
523 var mainDataHeader = decoder0.decodeStructDataHeader(); | |
524 if (mainDataHeader.version <= kVersions.last.version) { | |
525 // Scan in reverse order to optimize for more recent versions. | |
526 for (int i = kVersions.length - 1; i >= 0; --i) { | |
527 if (mainDataHeader.version >= kVersions[i].version) { | |
528 if (mainDataHeader.size == kVersions[i].size) { | |
529 // Found a match. | |
530 break; | |
531 } | |
532 throw new bindings.MojoCodecError( | |
533 'Header size doesn\'t correspond to known version size.'); | |
534 } | |
535 } | |
536 } else if (mainDataHeader.size < kVersions.last.size) { | |
537 throw new bindings.MojoCodecError( | |
538 'Message newer than the last known version cannot be shorter than ' | |
539 'required by the last known version.'); | |
540 } | |
541 if (mainDataHeader.version >= 0) { | |
542 | |
543 result.observer = decoder0.decodeServiceInterface(8, true, WindowManagerOb
serverProxy.newFromEndpoint); | |
544 } | |
545 return result; | |
546 } | |
547 | |
548 void encode(bindings.Encoder encoder) { | |
549 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); | |
550 | |
551 encoder0.encodeInterface(observer, 8, true); | |
552 } | |
553 | |
554 String toString() { | |
555 return "_WindowManagerGetFocusedAndActiveViewsParams(" | |
556 "observer: $observer" ")"; | |
557 } | |
558 | |
559 Map toJson() { | |
560 throw new bindings.MojoCodecError( | |
561 'Object containing handles cannot be encoded to JSON.'); | |
562 } | |
563 } | |
564 | |
565 | |
566 class WindowManagerGetFocusedAndActiveViewsResponseParams extends bindings.Struc
t { | |
567 static const List<bindings.StructDataHeader> kVersions = const [ | |
568 const bindings.StructDataHeader(24, 0) | |
569 ]; | |
570 int captureViewId = 0; | |
571 int focusedViewId = 0; | |
572 int activeViewId = 0; | |
573 | |
574 WindowManagerGetFocusedAndActiveViewsResponseParams() : super(kVersions.last.s
ize); | |
575 | |
576 static WindowManagerGetFocusedAndActiveViewsResponseParams deserialize(binding
s.Message message) { | |
577 var decoder = new bindings.Decoder(message); | |
578 var result = decode(decoder); | |
579 if (decoder.excessHandles != null) { | |
580 decoder.excessHandles.forEach((h) => h.close()); | |
581 } | |
582 return result; | |
583 } | |
584 | |
585 static WindowManagerGetFocusedAndActiveViewsResponseParams decode(bindings.Dec
oder decoder0) { | |
586 if (decoder0 == null) { | |
587 return null; | |
588 } | |
589 WindowManagerGetFocusedAndActiveViewsResponseParams result = new WindowManag
erGetFocusedAndActiveViewsResponseParams(); | |
590 | |
591 var mainDataHeader = decoder0.decodeStructDataHeader(); | |
592 if (mainDataHeader.version <= kVersions.last.version) { | |
593 // Scan in reverse order to optimize for more recent versions. | |
594 for (int i = kVersions.length - 1; i >= 0; --i) { | |
595 if (mainDataHeader.version >= kVersions[i].version) { | |
596 if (mainDataHeader.size == kVersions[i].size) { | |
597 // Found a match. | |
598 break; | |
599 } | |
600 throw new bindings.MojoCodecError( | |
601 'Header size doesn\'t correspond to known version size.'); | |
602 } | |
603 } | |
604 } else if (mainDataHeader.size < kVersions.last.size) { | |
605 throw new bindings.MojoCodecError( | |
606 'Message newer than the last known version cannot be shorter than ' | |
607 'required by the last known version.'); | |
608 } | |
609 if (mainDataHeader.version >= 0) { | |
610 | |
611 result.captureViewId = decoder0.decodeUint32(8); | |
612 } | |
613 if (mainDataHeader.version >= 0) { | |
614 | |
615 result.focusedViewId = decoder0.decodeUint32(12); | |
616 } | |
617 if (mainDataHeader.version >= 0) { | |
618 | |
619 result.activeViewId = decoder0.decodeUint32(16); | |
620 } | |
621 return result; | |
622 } | |
623 | |
624 void encode(bindings.Encoder encoder) { | |
625 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); | |
626 | |
627 encoder0.encodeUint32(captureViewId, 8); | |
628 | |
629 encoder0.encodeUint32(focusedViewId, 12); | |
630 | |
631 encoder0.encodeUint32(activeViewId, 16); | |
632 } | |
633 | |
634 String toString() { | |
635 return "WindowManagerGetFocusedAndActiveViewsResponseParams(" | |
636 "captureViewId: $captureViewId" ", " | |
637 "focusedViewId: $focusedViewId" ", " | |
638 "activeViewId: $activeViewId" ")"; | |
639 } | |
640 | |
641 Map toJson() { | |
642 Map map = new Map(); | |
643 map["captureViewId"] = captureViewId; | |
644 map["focusedViewId"] = focusedViewId; | |
645 map["activeViewId"] = activeViewId; | |
646 return map; | |
647 } | |
648 } | |
649 | |
650 | |
651 class _WindowManagerObserverOnCaptureChangedParams extends bindings.Struct { | |
652 static const List<bindings.StructDataHeader> kVersions = const [ | |
653 const bindings.StructDataHeader(16, 0) | |
654 ]; | |
655 int captureViewId = 0; | |
656 | |
657 _WindowManagerObserverOnCaptureChangedParams() : super(kVersions.last.size); | |
658 | |
659 static _WindowManagerObserverOnCaptureChangedParams deserialize(bindings.Messa
ge message) { | |
660 var decoder = new bindings.Decoder(message); | |
661 var result = decode(decoder); | |
662 if (decoder.excessHandles != null) { | |
663 decoder.excessHandles.forEach((h) => h.close()); | |
664 } | |
665 return result; | |
666 } | |
667 | |
668 static _WindowManagerObserverOnCaptureChangedParams decode(bindings.Decoder de
coder0) { | |
669 if (decoder0 == null) { | |
670 return null; | |
671 } | |
672 _WindowManagerObserverOnCaptureChangedParams result = new _WindowManagerObse
rverOnCaptureChangedParams(); | |
673 | |
674 var mainDataHeader = decoder0.decodeStructDataHeader(); | |
675 if (mainDataHeader.version <= kVersions.last.version) { | |
676 // Scan in reverse order to optimize for more recent versions. | |
677 for (int i = kVersions.length - 1; i >= 0; --i) { | |
678 if (mainDataHeader.version >= kVersions[i].version) { | |
679 if (mainDataHeader.size == kVersions[i].size) { | |
680 // Found a match. | |
681 break; | |
682 } | |
683 throw new bindings.MojoCodecError( | |
684 'Header size doesn\'t correspond to known version size.'); | |
685 } | |
686 } | |
687 } else if (mainDataHeader.size < kVersions.last.size) { | |
688 throw new bindings.MojoCodecError( | |
689 'Message newer than the last known version cannot be shorter than ' | |
690 'required by the last known version.'); | |
691 } | |
692 if (mainDataHeader.version >= 0) { | |
693 | |
694 result.captureViewId = decoder0.decodeUint32(8); | |
695 } | |
696 return result; | |
697 } | |
698 | |
699 void encode(bindings.Encoder encoder) { | |
700 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); | |
701 | |
702 encoder0.encodeUint32(captureViewId, 8); | |
703 } | |
704 | |
705 String toString() { | |
706 return "_WindowManagerObserverOnCaptureChangedParams(" | |
707 "captureViewId: $captureViewId" ")"; | |
708 } | |
709 | |
710 Map toJson() { | |
711 Map map = new Map(); | |
712 map["captureViewId"] = captureViewId; | |
713 return map; | |
714 } | |
715 } | |
716 | |
717 | |
718 class _WindowManagerObserverOnFocusChangedParams extends bindings.Struct { | |
719 static const List<bindings.StructDataHeader> kVersions = const [ | |
720 const bindings.StructDataHeader(16, 0) | |
721 ]; | |
722 int focusedViewId = 0; | |
723 | |
724 _WindowManagerObserverOnFocusChangedParams() : super(kVersions.last.size); | |
725 | |
726 static _WindowManagerObserverOnFocusChangedParams deserialize(bindings.Message
message) { | |
727 var decoder = new bindings.Decoder(message); | |
728 var result = decode(decoder); | |
729 if (decoder.excessHandles != null) { | |
730 decoder.excessHandles.forEach((h) => h.close()); | |
731 } | |
732 return result; | |
733 } | |
734 | |
735 static _WindowManagerObserverOnFocusChangedParams decode(bindings.Decoder deco
der0) { | |
736 if (decoder0 == null) { | |
737 return null; | |
738 } | |
739 _WindowManagerObserverOnFocusChangedParams result = new _WindowManagerObserv
erOnFocusChangedParams(); | |
740 | |
741 var mainDataHeader = decoder0.decodeStructDataHeader(); | |
742 if (mainDataHeader.version <= kVersions.last.version) { | |
743 // Scan in reverse order to optimize for more recent versions. | |
744 for (int i = kVersions.length - 1; i >= 0; --i) { | |
745 if (mainDataHeader.version >= kVersions[i].version) { | |
746 if (mainDataHeader.size == kVersions[i].size) { | |
747 // Found a match. | |
748 break; | |
749 } | |
750 throw new bindings.MojoCodecError( | |
751 'Header size doesn\'t correspond to known version size.'); | |
752 } | |
753 } | |
754 } else if (mainDataHeader.size < kVersions.last.size) { | |
755 throw new bindings.MojoCodecError( | |
756 'Message newer than the last known version cannot be shorter than ' | |
757 'required by the last known version.'); | |
758 } | |
759 if (mainDataHeader.version >= 0) { | |
760 | |
761 result.focusedViewId = decoder0.decodeUint32(8); | |
762 } | |
763 return result; | |
764 } | |
765 | |
766 void encode(bindings.Encoder encoder) { | |
767 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); | |
768 | |
769 encoder0.encodeUint32(focusedViewId, 8); | |
770 } | |
771 | |
772 String toString() { | |
773 return "_WindowManagerObserverOnFocusChangedParams(" | |
774 "focusedViewId: $focusedViewId" ")"; | |
775 } | |
776 | |
777 Map toJson() { | |
778 Map map = new Map(); | |
779 map["focusedViewId"] = focusedViewId; | |
780 return map; | |
781 } | |
782 } | |
783 | |
784 | |
785 class _WindowManagerObserverOnActiveWindowChangedParams extends bindings.Struct
{ | |
786 static const List<bindings.StructDataHeader> kVersions = const [ | |
787 const bindings.StructDataHeader(16, 0) | |
788 ]; | |
789 int focusedViewId = 0; | |
790 | |
791 _WindowManagerObserverOnActiveWindowChangedParams() : super(kVersions.last.siz
e); | |
792 | |
793 static _WindowManagerObserverOnActiveWindowChangedParams deserialize(bindings.
Message message) { | |
794 var decoder = new bindings.Decoder(message); | |
795 var result = decode(decoder); | |
796 if (decoder.excessHandles != null) { | |
797 decoder.excessHandles.forEach((h) => h.close()); | |
798 } | |
799 return result; | |
800 } | |
801 | |
802 static _WindowManagerObserverOnActiveWindowChangedParams decode(bindings.Decod
er decoder0) { | |
803 if (decoder0 == null) { | |
804 return null; | |
805 } | |
806 _WindowManagerObserverOnActiveWindowChangedParams result = new _WindowManage
rObserverOnActiveWindowChangedParams(); | |
807 | |
808 var mainDataHeader = decoder0.decodeStructDataHeader(); | |
809 if (mainDataHeader.version <= kVersions.last.version) { | |
810 // Scan in reverse order to optimize for more recent versions. | |
811 for (int i = kVersions.length - 1; i >= 0; --i) { | |
812 if (mainDataHeader.version >= kVersions[i].version) { | |
813 if (mainDataHeader.size == kVersions[i].size) { | |
814 // Found a match. | |
815 break; | |
816 } | |
817 throw new bindings.MojoCodecError( | |
818 'Header size doesn\'t correspond to known version size.'); | |
819 } | |
820 } | |
821 } else if (mainDataHeader.size < kVersions.last.size) { | |
822 throw new bindings.MojoCodecError( | |
823 'Message newer than the last known version cannot be shorter than ' | |
824 'required by the last known version.'); | |
825 } | |
826 if (mainDataHeader.version >= 0) { | |
827 | |
828 result.focusedViewId = decoder0.decodeUint32(8); | |
829 } | |
830 return result; | |
831 } | |
832 | |
833 void encode(bindings.Encoder encoder) { | |
834 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); | |
835 | |
836 encoder0.encodeUint32(focusedViewId, 8); | |
837 } | |
838 | |
839 String toString() { | |
840 return "_WindowManagerObserverOnActiveWindowChangedParams(" | |
841 "focusedViewId: $focusedViewId" ")"; | |
842 } | |
843 | |
844 Map toJson() { | |
845 Map map = new Map(); | |
846 map["focusedViewId"] = focusedViewId; | |
847 return map; | |
848 } | |
849 } | |
850 | |
851 const int _WindowManager_embedName = 0; | |
852 const int _WindowManager_setCaptureName = 1; | |
853 const int _WindowManager_focusWindowName = 2; | |
854 const int _WindowManager_activateWindowName = 3; | |
855 const int _WindowManager_getFocusedAndActiveViewsName = 4; | |
856 | |
857 abstract class WindowManager { | |
858 static const String serviceName = "mojo::WindowManager"; | |
859 void embed(String url, Object services, Object exposedServices); | |
860 dynamic setCapture(int viewId,[Function responseFactory = null]); | |
861 dynamic focusWindow(int viewId,[Function responseFactory = null]); | |
862 dynamic activateWindow(int viewId,[Function responseFactory = null]); | |
863 dynamic getFocusedAndActiveViews(Object observer,[Function responseFactory = n
ull]); | |
864 } | |
865 | |
866 | |
867 class _WindowManagerProxyImpl extends bindings.Proxy { | |
868 _WindowManagerProxyImpl.fromEndpoint( | |
869 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | |
870 | |
871 _WindowManagerProxyImpl.fromHandle(core.MojoHandle handle) : | |
872 super.fromHandle(handle); | |
873 | |
874 _WindowManagerProxyImpl.unbound() : super.unbound(); | |
875 | |
876 static _WindowManagerProxyImpl newFromEndpoint( | |
877 core.MojoMessagePipeEndpoint endpoint) { | |
878 assert(endpoint.setDescription("For _WindowManagerProxyImpl")); | |
879 return new _WindowManagerProxyImpl.fromEndpoint(endpoint); | |
880 } | |
881 | |
882 void handleResponse(bindings.ServiceMessage message) { | |
883 switch (message.header.type) { | |
884 case _WindowManager_setCaptureName: | |
885 var r = WindowManagerSetCaptureResponseParams.deserialize( | |
886 message.payload); | |
887 if (!message.header.hasRequestId) { | |
888 proxyError("Expected a message with a valid request Id."); | |
889 return; | |
890 } | |
891 Completer c = completerMap[message.header.requestId]; | |
892 if (c == null) { | |
893 proxyError( | |
894 "Message had unknown request Id: ${message.header.requestId}"); | |
895 return; | |
896 } | |
897 completerMap.remove(message.header.requestId); | |
898 if (c.isCompleted) { | |
899 proxyError("Response completer already completed"); | |
900 return; | |
901 } | |
902 c.complete(r); | |
903 break; | |
904 case _WindowManager_focusWindowName: | |
905 var r = WindowManagerFocusWindowResponseParams.deserialize( | |
906 message.payload); | |
907 if (!message.header.hasRequestId) { | |
908 proxyError("Expected a message with a valid request Id."); | |
909 return; | |
910 } | |
911 Completer c = completerMap[message.header.requestId]; | |
912 if (c == null) { | |
913 proxyError( | |
914 "Message had unknown request Id: ${message.header.requestId}"); | |
915 return; | |
916 } | |
917 completerMap.remove(message.header.requestId); | |
918 if (c.isCompleted) { | |
919 proxyError("Response completer already completed"); | |
920 return; | |
921 } | |
922 c.complete(r); | |
923 break; | |
924 case _WindowManager_activateWindowName: | |
925 var r = WindowManagerActivateWindowResponseParams.deserialize( | |
926 message.payload); | |
927 if (!message.header.hasRequestId) { | |
928 proxyError("Expected a message with a valid request Id."); | |
929 return; | |
930 } | |
931 Completer c = completerMap[message.header.requestId]; | |
932 if (c == null) { | |
933 proxyError( | |
934 "Message had unknown request Id: ${message.header.requestId}"); | |
935 return; | |
936 } | |
937 completerMap.remove(message.header.requestId); | |
938 if (c.isCompleted) { | |
939 proxyError("Response completer already completed"); | |
940 return; | |
941 } | |
942 c.complete(r); | |
943 break; | |
944 case _WindowManager_getFocusedAndActiveViewsName: | |
945 var r = WindowManagerGetFocusedAndActiveViewsResponseParams.deserialize( | |
946 message.payload); | |
947 if (!message.header.hasRequestId) { | |
948 proxyError("Expected a message with a valid request Id."); | |
949 return; | |
950 } | |
951 Completer c = completerMap[message.header.requestId]; | |
952 if (c == null) { | |
953 proxyError( | |
954 "Message had unknown request Id: ${message.header.requestId}"); | |
955 return; | |
956 } | |
957 completerMap.remove(message.header.requestId); | |
958 if (c.isCompleted) { | |
959 proxyError("Response completer already completed"); | |
960 return; | |
961 } | |
962 c.complete(r); | |
963 break; | |
964 default: | |
965 proxyError("Unexpected message type: ${message.header.type}"); | |
966 close(immediate: true); | |
967 break; | |
968 } | |
969 } | |
970 | |
971 String toString() { | |
972 var superString = super.toString(); | |
973 return "_WindowManagerProxyImpl($superString)"; | |
974 } | |
975 } | |
976 | |
977 | |
978 class _WindowManagerProxyCalls implements WindowManager { | |
979 _WindowManagerProxyImpl _proxyImpl; | |
980 | |
981 _WindowManagerProxyCalls(this._proxyImpl); | |
982 void embed(String url, Object services, Object exposedServices) { | |
983 if (!_proxyImpl.isBound) { | |
984 _proxyImpl.proxyError("The Proxy is closed."); | |
985 return; | |
986 } | |
987 var params = new _WindowManagerEmbedParams(); | |
988 params.url = url; | |
989 params.services = services; | |
990 params.exposedServices = exposedServices; | |
991 _proxyImpl.sendMessage(params, _WindowManager_embedName); | |
992 } | |
993 dynamic setCapture(int viewId,[Function responseFactory = null]) { | |
994 var params = new _WindowManagerSetCaptureParams(); | |
995 params.viewId = viewId; | |
996 return _proxyImpl.sendMessageWithRequestId( | |
997 params, | |
998 _WindowManager_setCaptureName, | |
999 -1, | |
1000 bindings.MessageHeader.kMessageExpectsResponse); | |
1001 } | |
1002 dynamic focusWindow(int viewId,[Function responseFactory = null]) { | |
1003 var params = new _WindowManagerFocusWindowParams(); | |
1004 params.viewId = viewId; | |
1005 return _proxyImpl.sendMessageWithRequestId( | |
1006 params, | |
1007 _WindowManager_focusWindowName, | |
1008 -1, | |
1009 bindings.MessageHeader.kMessageExpectsResponse); | |
1010 } | |
1011 dynamic activateWindow(int viewId,[Function responseFactory = null]) { | |
1012 var params = new _WindowManagerActivateWindowParams(); | |
1013 params.viewId = viewId; | |
1014 return _proxyImpl.sendMessageWithRequestId( | |
1015 params, | |
1016 _WindowManager_activateWindowName, | |
1017 -1, | |
1018 bindings.MessageHeader.kMessageExpectsResponse); | |
1019 } | |
1020 dynamic getFocusedAndActiveViews(Object observer,[Function responseFactory =
null]) { | |
1021 var params = new _WindowManagerGetFocusedAndActiveViewsParams(); | |
1022 params.observer = observer; | |
1023 return _proxyImpl.sendMessageWithRequestId( | |
1024 params, | |
1025 _WindowManager_getFocusedAndActiveViewsName, | |
1026 -1, | |
1027 bindings.MessageHeader.kMessageExpectsResponse); | |
1028 } | |
1029 } | |
1030 | |
1031 | |
1032 class WindowManagerProxy implements bindings.ProxyBase { | |
1033 final bindings.Proxy impl; | |
1034 WindowManager ptr; | |
1035 | |
1036 WindowManagerProxy(_WindowManagerProxyImpl proxyImpl) : | |
1037 impl = proxyImpl, | |
1038 ptr = new _WindowManagerProxyCalls(proxyImpl); | |
1039 | |
1040 WindowManagerProxy.fromEndpoint( | |
1041 core.MojoMessagePipeEndpoint endpoint) : | |
1042 impl = new _WindowManagerProxyImpl.fromEndpoint(endpoint) { | |
1043 ptr = new _WindowManagerProxyCalls(impl); | |
1044 } | |
1045 | |
1046 WindowManagerProxy.fromHandle(core.MojoHandle handle) : | |
1047 impl = new _WindowManagerProxyImpl.fromHandle(handle) { | |
1048 ptr = new _WindowManagerProxyCalls(impl); | |
1049 } | |
1050 | |
1051 WindowManagerProxy.unbound() : | |
1052 impl = new _WindowManagerProxyImpl.unbound() { | |
1053 ptr = new _WindowManagerProxyCalls(impl); | |
1054 } | |
1055 | |
1056 factory WindowManagerProxy.connectToService( | |
1057 bindings.ServiceConnector s, String url, [String serviceName]) { | |
1058 WindowManagerProxy p = new WindowManagerProxy.unbound(); | |
1059 s.connectToService(url, p, serviceName); | |
1060 return p; | |
1061 } | |
1062 | |
1063 static WindowManagerProxy newFromEndpoint( | |
1064 core.MojoMessagePipeEndpoint endpoint) { | |
1065 assert(endpoint.setDescription("For WindowManagerProxy")); | |
1066 return new WindowManagerProxy.fromEndpoint(endpoint); | |
1067 } | |
1068 | |
1069 String get serviceName => WindowManager.serviceName; | |
1070 | |
1071 Future close({bool immediate: false}) => impl.close(immediate: immediate); | |
1072 | |
1073 Future responseOrError(Future f) => impl.responseOrError(f); | |
1074 | |
1075 Future get errorFuture => impl.errorFuture; | |
1076 | |
1077 int get version => impl.version; | |
1078 | |
1079 Future<int> queryVersion() => impl.queryVersion(); | |
1080 | |
1081 void requireVersion(int requiredVersion) { | |
1082 impl.requireVersion(requiredVersion); | |
1083 } | |
1084 | |
1085 String toString() { | |
1086 return "WindowManagerProxy($impl)"; | |
1087 } | |
1088 } | |
1089 | |
1090 | |
1091 class WindowManagerStub extends bindings.Stub { | |
1092 WindowManager _impl = null; | |
1093 | |
1094 WindowManagerStub.fromEndpoint( | |
1095 core.MojoMessagePipeEndpoint endpoint, [this._impl]) | |
1096 : super.fromEndpoint(endpoint); | |
1097 | |
1098 WindowManagerStub.fromHandle(core.MojoHandle handle, [this._impl]) | |
1099 : super.fromHandle(handle); | |
1100 | |
1101 WindowManagerStub.unbound() : super.unbound(); | |
1102 | |
1103 static WindowManagerStub newFromEndpoint( | |
1104 core.MojoMessagePipeEndpoint endpoint) { | |
1105 assert(endpoint.setDescription("For WindowManagerStub")); | |
1106 return new WindowManagerStub.fromEndpoint(endpoint); | |
1107 } | |
1108 | |
1109 | |
1110 WindowManagerSetCaptureResponseParams _WindowManagerSetCaptureResponseParamsFa
ctory(bool success) { | |
1111 var mojo_factory_result = new WindowManagerSetCaptureResponseParams(); | |
1112 mojo_factory_result.success = success; | |
1113 return mojo_factory_result; | |
1114 } | |
1115 WindowManagerFocusWindowResponseParams _WindowManagerFocusWindowResponseParams
Factory(bool success) { | |
1116 var mojo_factory_result = new WindowManagerFocusWindowResponseParams(); | |
1117 mojo_factory_result.success = success; | |
1118 return mojo_factory_result; | |
1119 } | |
1120 WindowManagerActivateWindowResponseParams _WindowManagerActivateWindowResponse
ParamsFactory(bool success) { | |
1121 var mojo_factory_result = new WindowManagerActivateWindowResponseParams(); | |
1122 mojo_factory_result.success = success; | |
1123 return mojo_factory_result; | |
1124 } | |
1125 WindowManagerGetFocusedAndActiveViewsResponseParams _WindowManagerGetFocusedAn
dActiveViewsResponseParamsFactory(int captureViewId, int focusedViewId, int acti
veViewId) { | |
1126 var mojo_factory_result = new WindowManagerGetFocusedAndActiveViewsResponseP
arams(); | |
1127 mojo_factory_result.captureViewId = captureViewId; | |
1128 mojo_factory_result.focusedViewId = focusedViewId; | |
1129 mojo_factory_result.activeViewId = activeViewId; | |
1130 return mojo_factory_result; | |
1131 } | |
1132 | |
1133 dynamic handleMessage(bindings.ServiceMessage message) { | |
1134 if (bindings.ControlMessageHandler.isControlMessage(message)) { | |
1135 return bindings.ControlMessageHandler.handleMessage(this, | |
1136 0, | |
1137 message); | |
1138 } | |
1139 assert(_impl != null); | |
1140 switch (message.header.type) { | |
1141 case _WindowManager_embedName: | |
1142 var params = _WindowManagerEmbedParams.deserialize( | |
1143 message.payload); | |
1144 _impl.embed(params.url, params.services, params.exposedServices); | |
1145 break; | |
1146 case _WindowManager_setCaptureName: | |
1147 var params = _WindowManagerSetCaptureParams.deserialize( | |
1148 message.payload); | |
1149 var response = _impl.setCapture(params.viewId,_WindowManagerSetCaptureRe
sponseParamsFactory); | |
1150 if (response is Future) { | |
1151 return response.then((response) { | |
1152 if (response != null) { | |
1153 return buildResponseWithId( | |
1154 response, | |
1155 _WindowManager_setCaptureName, | |
1156 message.header.requestId, | |
1157 bindings.MessageHeader.kMessageIsResponse); | |
1158 } | |
1159 }); | |
1160 } else if (response != null) { | |
1161 return buildResponseWithId( | |
1162 response, | |
1163 _WindowManager_setCaptureName, | |
1164 message.header.requestId, | |
1165 bindings.MessageHeader.kMessageIsResponse); | |
1166 } | |
1167 break; | |
1168 case _WindowManager_focusWindowName: | |
1169 var params = _WindowManagerFocusWindowParams.deserialize( | |
1170 message.payload); | |
1171 var response = _impl.focusWindow(params.viewId,_WindowManagerFocusWindow
ResponseParamsFactory); | |
1172 if (response is Future) { | |
1173 return response.then((response) { | |
1174 if (response != null) { | |
1175 return buildResponseWithId( | |
1176 response, | |
1177 _WindowManager_focusWindowName, | |
1178 message.header.requestId, | |
1179 bindings.MessageHeader.kMessageIsResponse); | |
1180 } | |
1181 }); | |
1182 } else if (response != null) { | |
1183 return buildResponseWithId( | |
1184 response, | |
1185 _WindowManager_focusWindowName, | |
1186 message.header.requestId, | |
1187 bindings.MessageHeader.kMessageIsResponse); | |
1188 } | |
1189 break; | |
1190 case _WindowManager_activateWindowName: | |
1191 var params = _WindowManagerActivateWindowParams.deserialize( | |
1192 message.payload); | |
1193 var response = _impl.activateWindow(params.viewId,_WindowManagerActivate
WindowResponseParamsFactory); | |
1194 if (response is Future) { | |
1195 return response.then((response) { | |
1196 if (response != null) { | |
1197 return buildResponseWithId( | |
1198 response, | |
1199 _WindowManager_activateWindowName, | |
1200 message.header.requestId, | |
1201 bindings.MessageHeader.kMessageIsResponse); | |
1202 } | |
1203 }); | |
1204 } else if (response != null) { | |
1205 return buildResponseWithId( | |
1206 response, | |
1207 _WindowManager_activateWindowName, | |
1208 message.header.requestId, | |
1209 bindings.MessageHeader.kMessageIsResponse); | |
1210 } | |
1211 break; | |
1212 case _WindowManager_getFocusedAndActiveViewsName: | |
1213 var params = _WindowManagerGetFocusedAndActiveViewsParams.deserialize( | |
1214 message.payload); | |
1215 var response = _impl.getFocusedAndActiveViews(params.observer,_WindowMan
agerGetFocusedAndActiveViewsResponseParamsFactory); | |
1216 if (response is Future) { | |
1217 return response.then((response) { | |
1218 if (response != null) { | |
1219 return buildResponseWithId( | |
1220 response, | |
1221 _WindowManager_getFocusedAndActiveViewsName, | |
1222 message.header.requestId, | |
1223 bindings.MessageHeader.kMessageIsResponse); | |
1224 } | |
1225 }); | |
1226 } else if (response != null) { | |
1227 return buildResponseWithId( | |
1228 response, | |
1229 _WindowManager_getFocusedAndActiveViewsName, | |
1230 message.header.requestId, | |
1231 bindings.MessageHeader.kMessageIsResponse); | |
1232 } | |
1233 break; | |
1234 default: | |
1235 throw new bindings.MojoCodecError("Unexpected message name"); | |
1236 break; | |
1237 } | |
1238 return null; | |
1239 } | |
1240 | |
1241 WindowManager get impl => _impl; | |
1242 set impl(WindowManager d) { | |
1243 assert(_impl == null); | |
1244 _impl = d; | |
1245 } | |
1246 | |
1247 String toString() { | |
1248 var superString = super.toString(); | |
1249 return "WindowManagerStub($superString)"; | |
1250 } | |
1251 | |
1252 int get version => 0; | |
1253 } | |
1254 | |
1255 const int _WindowManagerObserver_onCaptureChangedName = 0; | |
1256 const int _WindowManagerObserver_onFocusChangedName = 1; | |
1257 const int _WindowManagerObserver_onActiveWindowChangedName = 2; | |
1258 | |
1259 abstract class WindowManagerObserver { | |
1260 static const String serviceName = null; | |
1261 void onCaptureChanged(int captureViewId); | |
1262 void onFocusChanged(int focusedViewId); | |
1263 void onActiveWindowChanged(int focusedViewId); | |
1264 } | |
1265 | |
1266 | |
1267 class _WindowManagerObserverProxyImpl extends bindings.Proxy { | |
1268 _WindowManagerObserverProxyImpl.fromEndpoint( | |
1269 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | |
1270 | |
1271 _WindowManagerObserverProxyImpl.fromHandle(core.MojoHandle handle) : | |
1272 super.fromHandle(handle); | |
1273 | |
1274 _WindowManagerObserverProxyImpl.unbound() : super.unbound(); | |
1275 | |
1276 static _WindowManagerObserverProxyImpl newFromEndpoint( | |
1277 core.MojoMessagePipeEndpoint endpoint) { | |
1278 assert(endpoint.setDescription("For _WindowManagerObserverProxyImpl")); | |
1279 return new _WindowManagerObserverProxyImpl.fromEndpoint(endpoint); | |
1280 } | |
1281 | |
1282 void handleResponse(bindings.ServiceMessage message) { | |
1283 switch (message.header.type) { | |
1284 default: | |
1285 proxyError("Unexpected message type: ${message.header.type}"); | |
1286 close(immediate: true); | |
1287 break; | |
1288 } | |
1289 } | |
1290 | |
1291 String toString() { | |
1292 var superString = super.toString(); | |
1293 return "_WindowManagerObserverProxyImpl($superString)"; | |
1294 } | |
1295 } | |
1296 | |
1297 | |
1298 class _WindowManagerObserverProxyCalls implements WindowManagerObserver { | |
1299 _WindowManagerObserverProxyImpl _proxyImpl; | |
1300 | |
1301 _WindowManagerObserverProxyCalls(this._proxyImpl); | |
1302 void onCaptureChanged(int captureViewId) { | |
1303 if (!_proxyImpl.isBound) { | |
1304 _proxyImpl.proxyError("The Proxy is closed."); | |
1305 return; | |
1306 } | |
1307 var params = new _WindowManagerObserverOnCaptureChangedParams(); | |
1308 params.captureViewId = captureViewId; | |
1309 _proxyImpl.sendMessage(params, _WindowManagerObserver_onCaptureChangedName
); | |
1310 } | |
1311 void onFocusChanged(int focusedViewId) { | |
1312 if (!_proxyImpl.isBound) { | |
1313 _proxyImpl.proxyError("The Proxy is closed."); | |
1314 return; | |
1315 } | |
1316 var params = new _WindowManagerObserverOnFocusChangedParams(); | |
1317 params.focusedViewId = focusedViewId; | |
1318 _proxyImpl.sendMessage(params, _WindowManagerObserver_onFocusChangedName); | |
1319 } | |
1320 void onActiveWindowChanged(int focusedViewId) { | |
1321 if (!_proxyImpl.isBound) { | |
1322 _proxyImpl.proxyError("The Proxy is closed."); | |
1323 return; | |
1324 } | |
1325 var params = new _WindowManagerObserverOnActiveWindowChangedParams(); | |
1326 params.focusedViewId = focusedViewId; | |
1327 _proxyImpl.sendMessage(params, _WindowManagerObserver_onActiveWindowChange
dName); | |
1328 } | |
1329 } | |
1330 | |
1331 | |
1332 class WindowManagerObserverProxy implements bindings.ProxyBase { | |
1333 final bindings.Proxy impl; | |
1334 WindowManagerObserver ptr; | |
1335 | |
1336 WindowManagerObserverProxy(_WindowManagerObserverProxyImpl proxyImpl) : | |
1337 impl = proxyImpl, | |
1338 ptr = new _WindowManagerObserverProxyCalls(proxyImpl); | |
1339 | |
1340 WindowManagerObserverProxy.fromEndpoint( | |
1341 core.MojoMessagePipeEndpoint endpoint) : | |
1342 impl = new _WindowManagerObserverProxyImpl.fromEndpoint(endpoint) { | |
1343 ptr = new _WindowManagerObserverProxyCalls(impl); | |
1344 } | |
1345 | |
1346 WindowManagerObserverProxy.fromHandle(core.MojoHandle handle) : | |
1347 impl = new _WindowManagerObserverProxyImpl.fromHandle(handle) { | |
1348 ptr = new _WindowManagerObserverProxyCalls(impl); | |
1349 } | |
1350 | |
1351 WindowManagerObserverProxy.unbound() : | |
1352 impl = new _WindowManagerObserverProxyImpl.unbound() { | |
1353 ptr = new _WindowManagerObserverProxyCalls(impl); | |
1354 } | |
1355 | |
1356 factory WindowManagerObserverProxy.connectToService( | |
1357 bindings.ServiceConnector s, String url, [String serviceName]) { | |
1358 WindowManagerObserverProxy p = new WindowManagerObserverProxy.unbound(); | |
1359 s.connectToService(url, p, serviceName); | |
1360 return p; | |
1361 } | |
1362 | |
1363 static WindowManagerObserverProxy newFromEndpoint( | |
1364 core.MojoMessagePipeEndpoint endpoint) { | |
1365 assert(endpoint.setDescription("For WindowManagerObserverProxy")); | |
1366 return new WindowManagerObserverProxy.fromEndpoint(endpoint); | |
1367 } | |
1368 | |
1369 String get serviceName => WindowManagerObserver.serviceName; | |
1370 | |
1371 Future close({bool immediate: false}) => impl.close(immediate: immediate); | |
1372 | |
1373 Future responseOrError(Future f) => impl.responseOrError(f); | |
1374 | |
1375 Future get errorFuture => impl.errorFuture; | |
1376 | |
1377 int get version => impl.version; | |
1378 | |
1379 Future<int> queryVersion() => impl.queryVersion(); | |
1380 | |
1381 void requireVersion(int requiredVersion) { | |
1382 impl.requireVersion(requiredVersion); | |
1383 } | |
1384 | |
1385 String toString() { | |
1386 return "WindowManagerObserverProxy($impl)"; | |
1387 } | |
1388 } | |
1389 | |
1390 | |
1391 class WindowManagerObserverStub extends bindings.Stub { | |
1392 WindowManagerObserver _impl = null; | |
1393 | |
1394 WindowManagerObserverStub.fromEndpoint( | |
1395 core.MojoMessagePipeEndpoint endpoint, [this._impl]) | |
1396 : super.fromEndpoint(endpoint); | |
1397 | |
1398 WindowManagerObserverStub.fromHandle(core.MojoHandle handle, [this._impl]) | |
1399 : super.fromHandle(handle); | |
1400 | |
1401 WindowManagerObserverStub.unbound() : super.unbound(); | |
1402 | |
1403 static WindowManagerObserverStub newFromEndpoint( | |
1404 core.MojoMessagePipeEndpoint endpoint) { | |
1405 assert(endpoint.setDescription("For WindowManagerObserverStub")); | |
1406 return new WindowManagerObserverStub.fromEndpoint(endpoint); | |
1407 } | |
1408 | |
1409 | |
1410 | |
1411 dynamic handleMessage(bindings.ServiceMessage message) { | |
1412 if (bindings.ControlMessageHandler.isControlMessage(message)) { | |
1413 return bindings.ControlMessageHandler.handleMessage(this, | |
1414 0, | |
1415 message); | |
1416 } | |
1417 assert(_impl != null); | |
1418 switch (message.header.type) { | |
1419 case _WindowManagerObserver_onCaptureChangedName: | |
1420 var params = _WindowManagerObserverOnCaptureChangedParams.deserialize( | |
1421 message.payload); | |
1422 _impl.onCaptureChanged(params.captureViewId); | |
1423 break; | |
1424 case _WindowManagerObserver_onFocusChangedName: | |
1425 var params = _WindowManagerObserverOnFocusChangedParams.deserialize( | |
1426 message.payload); | |
1427 _impl.onFocusChanged(params.focusedViewId); | |
1428 break; | |
1429 case _WindowManagerObserver_onActiveWindowChangedName: | |
1430 var params = _WindowManagerObserverOnActiveWindowChangedParams.deseriali
ze( | |
1431 message.payload); | |
1432 _impl.onActiveWindowChanged(params.focusedViewId); | |
1433 break; | |
1434 default: | |
1435 throw new bindings.MojoCodecError("Unexpected message name"); | |
1436 break; | |
1437 } | |
1438 return null; | |
1439 } | |
1440 | |
1441 WindowManagerObserver get impl => _impl; | |
1442 set impl(WindowManagerObserver d) { | |
1443 assert(_impl == null); | |
1444 _impl = d; | |
1445 } | |
1446 | |
1447 String toString() { | |
1448 var superString = super.toString(); | |
1449 return "WindowManagerObserverStub($superString)"; | |
1450 } | |
1451 | |
1452 int get version => 0; | |
1453 } | |
1454 | |
1455 | |
OLD | NEW |