| 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_internal_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/geometry.mojom.dart' as geometry_mojom; |
| 12 import 'package:mojo_services/mojo/input_events.mojom.dart' as input_events_mojo
m; |
| 13 |
| 14 |
| 15 |
| 16 class _WindowManagerInternalCreateWindowManagerForViewManagerClientParams extend
s bindings.Struct { |
| 17 static const List<bindings.StructDataHeader> kVersions = const [ |
| 18 const bindings.StructDataHeader(16, 0) |
| 19 ]; |
| 20 int connectionId = 0; |
| 21 core.MojoMessagePipeEndpoint windowManagerPipe = null; |
| 22 |
| 23 _WindowManagerInternalCreateWindowManagerForViewManagerClientParams() : super(
kVersions.last.size); |
| 24 |
| 25 static _WindowManagerInternalCreateWindowManagerForViewManagerClientParams des
erialize(bindings.Message message) { |
| 26 var decoder = new bindings.Decoder(message); |
| 27 var result = decode(decoder); |
| 28 if (decoder.excessHandles != null) { |
| 29 decoder.excessHandles.forEach((h) => h.close()); |
| 30 } |
| 31 return result; |
| 32 } |
| 33 |
| 34 static _WindowManagerInternalCreateWindowManagerForViewManagerClientParams dec
ode(bindings.Decoder decoder0) { |
| 35 if (decoder0 == null) { |
| 36 return null; |
| 37 } |
| 38 _WindowManagerInternalCreateWindowManagerForViewManagerClientParams result =
new _WindowManagerInternalCreateWindowManagerForViewManagerClientParams(); |
| 39 |
| 40 var mainDataHeader = decoder0.decodeStructDataHeader(); |
| 41 if (mainDataHeader.version <= kVersions.last.version) { |
| 42 // Scan in reverse order to optimize for more recent versions. |
| 43 for (int i = kVersions.length - 1; i >= 0; --i) { |
| 44 if (mainDataHeader.version >= kVersions[i].version) { |
| 45 if (mainDataHeader.size == kVersions[i].size) { |
| 46 // Found a match. |
| 47 break; |
| 48 } |
| 49 throw new bindings.MojoCodecError( |
| 50 'Header size doesn\'t correspond to known version size.'); |
| 51 } |
| 52 } |
| 53 } else if (mainDataHeader.size < kVersions.last.size) { |
| 54 throw new bindings.MojoCodecError( |
| 55 'Message newer than the last known version cannot be shorter than ' |
| 56 'required by the last known version.'); |
| 57 } |
| 58 if (mainDataHeader.version >= 0) { |
| 59 |
| 60 result.connectionId = decoder0.decodeUint16(8); |
| 61 } |
| 62 if (mainDataHeader.version >= 0) { |
| 63 |
| 64 result.windowManagerPipe = decoder0.decodeMessagePipeHandle(12, false); |
| 65 } |
| 66 return result; |
| 67 } |
| 68 |
| 69 void encode(bindings.Encoder encoder) { |
| 70 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); |
| 71 |
| 72 encoder0.encodeUint16(connectionId, 8); |
| 73 |
| 74 encoder0.encodeMessagePipeHandle(windowManagerPipe, 12, false); |
| 75 } |
| 76 |
| 77 String toString() { |
| 78 return "_WindowManagerInternalCreateWindowManagerForViewManagerClientParams(
" |
| 79 "connectionId: $connectionId" ", " |
| 80 "windowManagerPipe: $windowManagerPipe" ")"; |
| 81 } |
| 82 |
| 83 Map toJson() { |
| 84 throw new bindings.MojoCodecError( |
| 85 'Object containing handles cannot be encoded to JSON.'); |
| 86 } |
| 87 } |
| 88 |
| 89 |
| 90 class _WindowManagerInternalSetViewManagerClientParams extends bindings.Struct { |
| 91 static const List<bindings.StructDataHeader> kVersions = const [ |
| 92 const bindings.StructDataHeader(16, 0) |
| 93 ]; |
| 94 core.MojoMessagePipeEndpoint viewManagerClientRequest = null; |
| 95 |
| 96 _WindowManagerInternalSetViewManagerClientParams() : super(kVersions.last.size
); |
| 97 |
| 98 static _WindowManagerInternalSetViewManagerClientParams deserialize(bindings.M
essage message) { |
| 99 var decoder = new bindings.Decoder(message); |
| 100 var result = decode(decoder); |
| 101 if (decoder.excessHandles != null) { |
| 102 decoder.excessHandles.forEach((h) => h.close()); |
| 103 } |
| 104 return result; |
| 105 } |
| 106 |
| 107 static _WindowManagerInternalSetViewManagerClientParams decode(bindings.Decode
r decoder0) { |
| 108 if (decoder0 == null) { |
| 109 return null; |
| 110 } |
| 111 _WindowManagerInternalSetViewManagerClientParams result = new _WindowManager
InternalSetViewManagerClientParams(); |
| 112 |
| 113 var mainDataHeader = decoder0.decodeStructDataHeader(); |
| 114 if (mainDataHeader.version <= kVersions.last.version) { |
| 115 // Scan in reverse order to optimize for more recent versions. |
| 116 for (int i = kVersions.length - 1; i >= 0; --i) { |
| 117 if (mainDataHeader.version >= kVersions[i].version) { |
| 118 if (mainDataHeader.size == kVersions[i].size) { |
| 119 // Found a match. |
| 120 break; |
| 121 } |
| 122 throw new bindings.MojoCodecError( |
| 123 'Header size doesn\'t correspond to known version size.'); |
| 124 } |
| 125 } |
| 126 } else if (mainDataHeader.size < kVersions.last.size) { |
| 127 throw new bindings.MojoCodecError( |
| 128 'Message newer than the last known version cannot be shorter than ' |
| 129 'required by the last known version.'); |
| 130 } |
| 131 if (mainDataHeader.version >= 0) { |
| 132 |
| 133 result.viewManagerClientRequest = decoder0.decodeMessagePipeHandle(8, fals
e); |
| 134 } |
| 135 return result; |
| 136 } |
| 137 |
| 138 void encode(bindings.Encoder encoder) { |
| 139 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); |
| 140 |
| 141 encoder0.encodeMessagePipeHandle(viewManagerClientRequest, 8, false); |
| 142 } |
| 143 |
| 144 String toString() { |
| 145 return "_WindowManagerInternalSetViewManagerClientParams(" |
| 146 "viewManagerClientRequest: $viewManagerClientRequest" ")"; |
| 147 } |
| 148 |
| 149 Map toJson() { |
| 150 throw new bindings.MojoCodecError( |
| 151 'Object containing handles cannot be encoded to JSON.'); |
| 152 } |
| 153 } |
| 154 |
| 155 |
| 156 class _WindowManagerInternalClientDispatchInputEventToViewParams extends binding
s.Struct { |
| 157 static const List<bindings.StructDataHeader> kVersions = const [ |
| 158 const bindings.StructDataHeader(24, 0) |
| 159 ]; |
| 160 int viewId = 0; |
| 161 input_events_mojom.Event event = null; |
| 162 |
| 163 _WindowManagerInternalClientDispatchInputEventToViewParams() : super(kVersions
.last.size); |
| 164 |
| 165 static _WindowManagerInternalClientDispatchInputEventToViewParams deserialize(
bindings.Message message) { |
| 166 var decoder = new bindings.Decoder(message); |
| 167 var result = decode(decoder); |
| 168 if (decoder.excessHandles != null) { |
| 169 decoder.excessHandles.forEach((h) => h.close()); |
| 170 } |
| 171 return result; |
| 172 } |
| 173 |
| 174 static _WindowManagerInternalClientDispatchInputEventToViewParams decode(bindi
ngs.Decoder decoder0) { |
| 175 if (decoder0 == null) { |
| 176 return null; |
| 177 } |
| 178 _WindowManagerInternalClientDispatchInputEventToViewParams result = new _Win
dowManagerInternalClientDispatchInputEventToViewParams(); |
| 179 |
| 180 var mainDataHeader = decoder0.decodeStructDataHeader(); |
| 181 if (mainDataHeader.version <= kVersions.last.version) { |
| 182 // Scan in reverse order to optimize for more recent versions. |
| 183 for (int i = kVersions.length - 1; i >= 0; --i) { |
| 184 if (mainDataHeader.version >= kVersions[i].version) { |
| 185 if (mainDataHeader.size == kVersions[i].size) { |
| 186 // Found a match. |
| 187 break; |
| 188 } |
| 189 throw new bindings.MojoCodecError( |
| 190 'Header size doesn\'t correspond to known version size.'); |
| 191 } |
| 192 } |
| 193 } else if (mainDataHeader.size < kVersions.last.size) { |
| 194 throw new bindings.MojoCodecError( |
| 195 'Message newer than the last known version cannot be shorter than ' |
| 196 'required by the last known version.'); |
| 197 } |
| 198 if (mainDataHeader.version >= 0) { |
| 199 |
| 200 result.viewId = decoder0.decodeUint32(8); |
| 201 } |
| 202 if (mainDataHeader.version >= 0) { |
| 203 |
| 204 var decoder1 = decoder0.decodePointer(16, false); |
| 205 result.event = input_events_mojom.Event.decode(decoder1); |
| 206 } |
| 207 return result; |
| 208 } |
| 209 |
| 210 void encode(bindings.Encoder encoder) { |
| 211 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); |
| 212 |
| 213 encoder0.encodeUint32(viewId, 8); |
| 214 |
| 215 encoder0.encodeStruct(event, 16, false); |
| 216 } |
| 217 |
| 218 String toString() { |
| 219 return "_WindowManagerInternalClientDispatchInputEventToViewParams(" |
| 220 "viewId: $viewId" ", " |
| 221 "event: $event" ")"; |
| 222 } |
| 223 |
| 224 Map toJson() { |
| 225 Map map = new Map(); |
| 226 map["viewId"] = viewId; |
| 227 map["event"] = event; |
| 228 return map; |
| 229 } |
| 230 } |
| 231 |
| 232 |
| 233 class _WindowManagerInternalClientSetViewportSizeParams extends bindings.Struct
{ |
| 234 static const List<bindings.StructDataHeader> kVersions = const [ |
| 235 const bindings.StructDataHeader(16, 0) |
| 236 ]; |
| 237 geometry_mojom.Size size = null; |
| 238 |
| 239 _WindowManagerInternalClientSetViewportSizeParams() : super(kVersions.last.siz
e); |
| 240 |
| 241 static _WindowManagerInternalClientSetViewportSizeParams deserialize(bindings.
Message message) { |
| 242 var decoder = new bindings.Decoder(message); |
| 243 var result = decode(decoder); |
| 244 if (decoder.excessHandles != null) { |
| 245 decoder.excessHandles.forEach((h) => h.close()); |
| 246 } |
| 247 return result; |
| 248 } |
| 249 |
| 250 static _WindowManagerInternalClientSetViewportSizeParams decode(bindings.Decod
er decoder0) { |
| 251 if (decoder0 == null) { |
| 252 return null; |
| 253 } |
| 254 _WindowManagerInternalClientSetViewportSizeParams result = new _WindowManage
rInternalClientSetViewportSizeParams(); |
| 255 |
| 256 var mainDataHeader = decoder0.decodeStructDataHeader(); |
| 257 if (mainDataHeader.version <= kVersions.last.version) { |
| 258 // Scan in reverse order to optimize for more recent versions. |
| 259 for (int i = kVersions.length - 1; i >= 0; --i) { |
| 260 if (mainDataHeader.version >= kVersions[i].version) { |
| 261 if (mainDataHeader.size == kVersions[i].size) { |
| 262 // Found a match. |
| 263 break; |
| 264 } |
| 265 throw new bindings.MojoCodecError( |
| 266 'Header size doesn\'t correspond to known version size.'); |
| 267 } |
| 268 } |
| 269 } else if (mainDataHeader.size < kVersions.last.size) { |
| 270 throw new bindings.MojoCodecError( |
| 271 'Message newer than the last known version cannot be shorter than ' |
| 272 'required by the last known version.'); |
| 273 } |
| 274 if (mainDataHeader.version >= 0) { |
| 275 |
| 276 var decoder1 = decoder0.decodePointer(8, false); |
| 277 result.size = geometry_mojom.Size.decode(decoder1); |
| 278 } |
| 279 return result; |
| 280 } |
| 281 |
| 282 void encode(bindings.Encoder encoder) { |
| 283 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); |
| 284 |
| 285 encoder0.encodeStruct(size, 8, false); |
| 286 } |
| 287 |
| 288 String toString() { |
| 289 return "_WindowManagerInternalClientSetViewportSizeParams(" |
| 290 "size: $size" ")"; |
| 291 } |
| 292 |
| 293 Map toJson() { |
| 294 Map map = new Map(); |
| 295 map["size"] = size; |
| 296 return map; |
| 297 } |
| 298 } |
| 299 |
| 300 |
| 301 class _WindowManagerInternalClientCloneAndAnimateParams extends bindings.Struct
{ |
| 302 static const List<bindings.StructDataHeader> kVersions = const [ |
| 303 const bindings.StructDataHeader(16, 0) |
| 304 ]; |
| 305 int viewId = 0; |
| 306 |
| 307 _WindowManagerInternalClientCloneAndAnimateParams() : super(kVersions.last.siz
e); |
| 308 |
| 309 static _WindowManagerInternalClientCloneAndAnimateParams deserialize(bindings.
Message message) { |
| 310 var decoder = new bindings.Decoder(message); |
| 311 var result = decode(decoder); |
| 312 if (decoder.excessHandles != null) { |
| 313 decoder.excessHandles.forEach((h) => h.close()); |
| 314 } |
| 315 return result; |
| 316 } |
| 317 |
| 318 static _WindowManagerInternalClientCloneAndAnimateParams decode(bindings.Decod
er decoder0) { |
| 319 if (decoder0 == null) { |
| 320 return null; |
| 321 } |
| 322 _WindowManagerInternalClientCloneAndAnimateParams result = new _WindowManage
rInternalClientCloneAndAnimateParams(); |
| 323 |
| 324 var mainDataHeader = decoder0.decodeStructDataHeader(); |
| 325 if (mainDataHeader.version <= kVersions.last.version) { |
| 326 // Scan in reverse order to optimize for more recent versions. |
| 327 for (int i = kVersions.length - 1; i >= 0; --i) { |
| 328 if (mainDataHeader.version >= kVersions[i].version) { |
| 329 if (mainDataHeader.size == kVersions[i].size) { |
| 330 // Found a match. |
| 331 break; |
| 332 } |
| 333 throw new bindings.MojoCodecError( |
| 334 'Header size doesn\'t correspond to known version size.'); |
| 335 } |
| 336 } |
| 337 } else if (mainDataHeader.size < kVersions.last.size) { |
| 338 throw new bindings.MojoCodecError( |
| 339 'Message newer than the last known version cannot be shorter than ' |
| 340 'required by the last known version.'); |
| 341 } |
| 342 if (mainDataHeader.version >= 0) { |
| 343 |
| 344 result.viewId = decoder0.decodeUint32(8); |
| 345 } |
| 346 return result; |
| 347 } |
| 348 |
| 349 void encode(bindings.Encoder encoder) { |
| 350 var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); |
| 351 |
| 352 encoder0.encodeUint32(viewId, 8); |
| 353 } |
| 354 |
| 355 String toString() { |
| 356 return "_WindowManagerInternalClientCloneAndAnimateParams(" |
| 357 "viewId: $viewId" ")"; |
| 358 } |
| 359 |
| 360 Map toJson() { |
| 361 Map map = new Map(); |
| 362 map["viewId"] = viewId; |
| 363 return map; |
| 364 } |
| 365 } |
| 366 |
| 367 const int _WindowManagerInternal_createWindowManagerForViewManagerClientName = 0
; |
| 368 const int _WindowManagerInternal_setViewManagerClientName = 1; |
| 369 |
| 370 abstract class WindowManagerInternal { |
| 371 static const String serviceName = "mojo::WindowManagerInternal"; |
| 372 void createWindowManagerForViewManagerClient(int connectionId, core.MojoMessag
ePipeEndpoint windowManagerPipe); |
| 373 void setViewManagerClient(core.MojoMessagePipeEndpoint viewManagerClientReques
t); |
| 374 } |
| 375 |
| 376 |
| 377 class _WindowManagerInternalProxyImpl extends bindings.Proxy { |
| 378 _WindowManagerInternalProxyImpl.fromEndpoint( |
| 379 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 380 |
| 381 _WindowManagerInternalProxyImpl.fromHandle(core.MojoHandle handle) : |
| 382 super.fromHandle(handle); |
| 383 |
| 384 _WindowManagerInternalProxyImpl.unbound() : super.unbound(); |
| 385 |
| 386 static _WindowManagerInternalProxyImpl newFromEndpoint( |
| 387 core.MojoMessagePipeEndpoint endpoint) { |
| 388 assert(endpoint.setDescription("For _WindowManagerInternalProxyImpl")); |
| 389 return new _WindowManagerInternalProxyImpl.fromEndpoint(endpoint); |
| 390 } |
| 391 |
| 392 void handleResponse(bindings.ServiceMessage message) { |
| 393 switch (message.header.type) { |
| 394 default: |
| 395 proxyError("Unexpected message type: ${message.header.type}"); |
| 396 close(immediate: true); |
| 397 break; |
| 398 } |
| 399 } |
| 400 |
| 401 String toString() { |
| 402 var superString = super.toString(); |
| 403 return "_WindowManagerInternalProxyImpl($superString)"; |
| 404 } |
| 405 } |
| 406 |
| 407 |
| 408 class _WindowManagerInternalProxyCalls implements WindowManagerInternal { |
| 409 _WindowManagerInternalProxyImpl _proxyImpl; |
| 410 |
| 411 _WindowManagerInternalProxyCalls(this._proxyImpl); |
| 412 void createWindowManagerForViewManagerClient(int connectionId, core.MojoMess
agePipeEndpoint windowManagerPipe) { |
| 413 if (!_proxyImpl.isBound) { |
| 414 _proxyImpl.proxyError("The Proxy is closed."); |
| 415 return; |
| 416 } |
| 417 var params = new _WindowManagerInternalCreateWindowManagerForViewManagerCl
ientParams(); |
| 418 params.connectionId = connectionId; |
| 419 params.windowManagerPipe = windowManagerPipe; |
| 420 _proxyImpl.sendMessage(params, _WindowManagerInternal_createWindowManagerF
orViewManagerClientName); |
| 421 } |
| 422 void setViewManagerClient(core.MojoMessagePipeEndpoint viewManagerClientRequ
est) { |
| 423 if (!_proxyImpl.isBound) { |
| 424 _proxyImpl.proxyError("The Proxy is closed."); |
| 425 return; |
| 426 } |
| 427 var params = new _WindowManagerInternalSetViewManagerClientParams(); |
| 428 params.viewManagerClientRequest = viewManagerClientRequest; |
| 429 _proxyImpl.sendMessage(params, _WindowManagerInternal_setViewManagerClient
Name); |
| 430 } |
| 431 } |
| 432 |
| 433 |
| 434 class WindowManagerInternalProxy implements bindings.ProxyBase { |
| 435 final bindings.Proxy impl; |
| 436 WindowManagerInternal ptr; |
| 437 |
| 438 WindowManagerInternalProxy(_WindowManagerInternalProxyImpl proxyImpl) : |
| 439 impl = proxyImpl, |
| 440 ptr = new _WindowManagerInternalProxyCalls(proxyImpl); |
| 441 |
| 442 WindowManagerInternalProxy.fromEndpoint( |
| 443 core.MojoMessagePipeEndpoint endpoint) : |
| 444 impl = new _WindowManagerInternalProxyImpl.fromEndpoint(endpoint) { |
| 445 ptr = new _WindowManagerInternalProxyCalls(impl); |
| 446 } |
| 447 |
| 448 WindowManagerInternalProxy.fromHandle(core.MojoHandle handle) : |
| 449 impl = new _WindowManagerInternalProxyImpl.fromHandle(handle) { |
| 450 ptr = new _WindowManagerInternalProxyCalls(impl); |
| 451 } |
| 452 |
| 453 WindowManagerInternalProxy.unbound() : |
| 454 impl = new _WindowManagerInternalProxyImpl.unbound() { |
| 455 ptr = new _WindowManagerInternalProxyCalls(impl); |
| 456 } |
| 457 |
| 458 factory WindowManagerInternalProxy.connectToService( |
| 459 bindings.ServiceConnector s, String url, [String serviceName]) { |
| 460 WindowManagerInternalProxy p = new WindowManagerInternalProxy.unbound(); |
| 461 s.connectToService(url, p, serviceName); |
| 462 return p; |
| 463 } |
| 464 |
| 465 static WindowManagerInternalProxy newFromEndpoint( |
| 466 core.MojoMessagePipeEndpoint endpoint) { |
| 467 assert(endpoint.setDescription("For WindowManagerInternalProxy")); |
| 468 return new WindowManagerInternalProxy.fromEndpoint(endpoint); |
| 469 } |
| 470 |
| 471 String get serviceName => WindowManagerInternal.serviceName; |
| 472 |
| 473 Future close({bool immediate: false}) => impl.close(immediate: immediate); |
| 474 |
| 475 Future responseOrError(Future f) => impl.responseOrError(f); |
| 476 |
| 477 Future get errorFuture => impl.errorFuture; |
| 478 |
| 479 int get version => impl.version; |
| 480 |
| 481 Future<int> queryVersion() => impl.queryVersion(); |
| 482 |
| 483 void requireVersion(int requiredVersion) { |
| 484 impl.requireVersion(requiredVersion); |
| 485 } |
| 486 |
| 487 String toString() { |
| 488 return "WindowManagerInternalProxy($impl)"; |
| 489 } |
| 490 } |
| 491 |
| 492 |
| 493 class WindowManagerInternalStub extends bindings.Stub { |
| 494 WindowManagerInternal _impl = null; |
| 495 |
| 496 WindowManagerInternalStub.fromEndpoint( |
| 497 core.MojoMessagePipeEndpoint endpoint, [this._impl]) |
| 498 : super.fromEndpoint(endpoint); |
| 499 |
| 500 WindowManagerInternalStub.fromHandle(core.MojoHandle handle, [this._impl]) |
| 501 : super.fromHandle(handle); |
| 502 |
| 503 WindowManagerInternalStub.unbound() : super.unbound(); |
| 504 |
| 505 static WindowManagerInternalStub newFromEndpoint( |
| 506 core.MojoMessagePipeEndpoint endpoint) { |
| 507 assert(endpoint.setDescription("For WindowManagerInternalStub")); |
| 508 return new WindowManagerInternalStub.fromEndpoint(endpoint); |
| 509 } |
| 510 |
| 511 |
| 512 |
| 513 dynamic handleMessage(bindings.ServiceMessage message) { |
| 514 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
| 515 return bindings.ControlMessageHandler.handleMessage(this, |
| 516 0, |
| 517 message); |
| 518 } |
| 519 assert(_impl != null); |
| 520 switch (message.header.type) { |
| 521 case _WindowManagerInternal_createWindowManagerForViewManagerClientName: |
| 522 var params = _WindowManagerInternalCreateWindowManagerForViewManagerClie
ntParams.deserialize( |
| 523 message.payload); |
| 524 _impl.createWindowManagerForViewManagerClient(params.connectionId, param
s.windowManagerPipe); |
| 525 break; |
| 526 case _WindowManagerInternal_setViewManagerClientName: |
| 527 var params = _WindowManagerInternalSetViewManagerClientParams.deserializ
e( |
| 528 message.payload); |
| 529 _impl.setViewManagerClient(params.viewManagerClientRequest); |
| 530 break; |
| 531 default: |
| 532 throw new bindings.MojoCodecError("Unexpected message name"); |
| 533 break; |
| 534 } |
| 535 return null; |
| 536 } |
| 537 |
| 538 WindowManagerInternal get impl => _impl; |
| 539 set impl(WindowManagerInternal d) { |
| 540 assert(_impl == null); |
| 541 _impl = d; |
| 542 } |
| 543 |
| 544 String toString() { |
| 545 var superString = super.toString(); |
| 546 return "WindowManagerInternalStub($superString)"; |
| 547 } |
| 548 |
| 549 int get version => 0; |
| 550 } |
| 551 |
| 552 const int _WindowManagerInternalClient_dispatchInputEventToViewName = 0; |
| 553 const int _WindowManagerInternalClient_setViewportSizeName = 1; |
| 554 const int _WindowManagerInternalClient_cloneAndAnimateName = 2; |
| 555 |
| 556 abstract class WindowManagerInternalClient { |
| 557 static const String serviceName = "mojo::WindowManagerInternalClient"; |
| 558 void dispatchInputEventToView(int viewId, input_events_mojom.Event event); |
| 559 void setViewportSize(geometry_mojom.Size size); |
| 560 void cloneAndAnimate(int viewId); |
| 561 } |
| 562 |
| 563 |
| 564 class _WindowManagerInternalClientProxyImpl extends bindings.Proxy { |
| 565 _WindowManagerInternalClientProxyImpl.fromEndpoint( |
| 566 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
| 567 |
| 568 _WindowManagerInternalClientProxyImpl.fromHandle(core.MojoHandle handle) : |
| 569 super.fromHandle(handle); |
| 570 |
| 571 _WindowManagerInternalClientProxyImpl.unbound() : super.unbound(); |
| 572 |
| 573 static _WindowManagerInternalClientProxyImpl newFromEndpoint( |
| 574 core.MojoMessagePipeEndpoint endpoint) { |
| 575 assert(endpoint.setDescription("For _WindowManagerInternalClientProxyImpl"))
; |
| 576 return new _WindowManagerInternalClientProxyImpl.fromEndpoint(endpoint); |
| 577 } |
| 578 |
| 579 void handleResponse(bindings.ServiceMessage message) { |
| 580 switch (message.header.type) { |
| 581 default: |
| 582 proxyError("Unexpected message type: ${message.header.type}"); |
| 583 close(immediate: true); |
| 584 break; |
| 585 } |
| 586 } |
| 587 |
| 588 String toString() { |
| 589 var superString = super.toString(); |
| 590 return "_WindowManagerInternalClientProxyImpl($superString)"; |
| 591 } |
| 592 } |
| 593 |
| 594 |
| 595 class _WindowManagerInternalClientProxyCalls implements WindowManagerInternalCli
ent { |
| 596 _WindowManagerInternalClientProxyImpl _proxyImpl; |
| 597 |
| 598 _WindowManagerInternalClientProxyCalls(this._proxyImpl); |
| 599 void dispatchInputEventToView(int viewId, input_events_mojom.Event event) { |
| 600 if (!_proxyImpl.isBound) { |
| 601 _proxyImpl.proxyError("The Proxy is closed."); |
| 602 return; |
| 603 } |
| 604 var params = new _WindowManagerInternalClientDispatchInputEventToViewParam
s(); |
| 605 params.viewId = viewId; |
| 606 params.event = event; |
| 607 _proxyImpl.sendMessage(params, _WindowManagerInternalClient_dispatchInputE
ventToViewName); |
| 608 } |
| 609 void setViewportSize(geometry_mojom.Size size) { |
| 610 if (!_proxyImpl.isBound) { |
| 611 _proxyImpl.proxyError("The Proxy is closed."); |
| 612 return; |
| 613 } |
| 614 var params = new _WindowManagerInternalClientSetViewportSizeParams(); |
| 615 params.size = size; |
| 616 _proxyImpl.sendMessage(params, _WindowManagerInternalClient_setViewportSiz
eName); |
| 617 } |
| 618 void cloneAndAnimate(int viewId) { |
| 619 if (!_proxyImpl.isBound) { |
| 620 _proxyImpl.proxyError("The Proxy is closed."); |
| 621 return; |
| 622 } |
| 623 var params = new _WindowManagerInternalClientCloneAndAnimateParams(); |
| 624 params.viewId = viewId; |
| 625 _proxyImpl.sendMessage(params, _WindowManagerInternalClient_cloneAndAnimat
eName); |
| 626 } |
| 627 } |
| 628 |
| 629 |
| 630 class WindowManagerInternalClientProxy implements bindings.ProxyBase { |
| 631 final bindings.Proxy impl; |
| 632 WindowManagerInternalClient ptr; |
| 633 |
| 634 WindowManagerInternalClientProxy(_WindowManagerInternalClientProxyImpl proxyIm
pl) : |
| 635 impl = proxyImpl, |
| 636 ptr = new _WindowManagerInternalClientProxyCalls(proxyImpl); |
| 637 |
| 638 WindowManagerInternalClientProxy.fromEndpoint( |
| 639 core.MojoMessagePipeEndpoint endpoint) : |
| 640 impl = new _WindowManagerInternalClientProxyImpl.fromEndpoint(endpoint) { |
| 641 ptr = new _WindowManagerInternalClientProxyCalls(impl); |
| 642 } |
| 643 |
| 644 WindowManagerInternalClientProxy.fromHandle(core.MojoHandle handle) : |
| 645 impl = new _WindowManagerInternalClientProxyImpl.fromHandle(handle) { |
| 646 ptr = new _WindowManagerInternalClientProxyCalls(impl); |
| 647 } |
| 648 |
| 649 WindowManagerInternalClientProxy.unbound() : |
| 650 impl = new _WindowManagerInternalClientProxyImpl.unbound() { |
| 651 ptr = new _WindowManagerInternalClientProxyCalls(impl); |
| 652 } |
| 653 |
| 654 factory WindowManagerInternalClientProxy.connectToService( |
| 655 bindings.ServiceConnector s, String url, [String serviceName]) { |
| 656 WindowManagerInternalClientProxy p = new WindowManagerInternalClientProxy.un
bound(); |
| 657 s.connectToService(url, p, serviceName); |
| 658 return p; |
| 659 } |
| 660 |
| 661 static WindowManagerInternalClientProxy newFromEndpoint( |
| 662 core.MojoMessagePipeEndpoint endpoint) { |
| 663 assert(endpoint.setDescription("For WindowManagerInternalClientProxy")); |
| 664 return new WindowManagerInternalClientProxy.fromEndpoint(endpoint); |
| 665 } |
| 666 |
| 667 String get serviceName => WindowManagerInternalClient.serviceName; |
| 668 |
| 669 Future close({bool immediate: false}) => impl.close(immediate: immediate); |
| 670 |
| 671 Future responseOrError(Future f) => impl.responseOrError(f); |
| 672 |
| 673 Future get errorFuture => impl.errorFuture; |
| 674 |
| 675 int get version => impl.version; |
| 676 |
| 677 Future<int> queryVersion() => impl.queryVersion(); |
| 678 |
| 679 void requireVersion(int requiredVersion) { |
| 680 impl.requireVersion(requiredVersion); |
| 681 } |
| 682 |
| 683 String toString() { |
| 684 return "WindowManagerInternalClientProxy($impl)"; |
| 685 } |
| 686 } |
| 687 |
| 688 |
| 689 class WindowManagerInternalClientStub extends bindings.Stub { |
| 690 WindowManagerInternalClient _impl = null; |
| 691 |
| 692 WindowManagerInternalClientStub.fromEndpoint( |
| 693 core.MojoMessagePipeEndpoint endpoint, [this._impl]) |
| 694 : super.fromEndpoint(endpoint); |
| 695 |
| 696 WindowManagerInternalClientStub.fromHandle(core.MojoHandle handle, [this._impl
]) |
| 697 : super.fromHandle(handle); |
| 698 |
| 699 WindowManagerInternalClientStub.unbound() : super.unbound(); |
| 700 |
| 701 static WindowManagerInternalClientStub newFromEndpoint( |
| 702 core.MojoMessagePipeEndpoint endpoint) { |
| 703 assert(endpoint.setDescription("For WindowManagerInternalClientStub")); |
| 704 return new WindowManagerInternalClientStub.fromEndpoint(endpoint); |
| 705 } |
| 706 |
| 707 |
| 708 |
| 709 dynamic handleMessage(bindings.ServiceMessage message) { |
| 710 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
| 711 return bindings.ControlMessageHandler.handleMessage(this, |
| 712 0, |
| 713 message); |
| 714 } |
| 715 assert(_impl != null); |
| 716 switch (message.header.type) { |
| 717 case _WindowManagerInternalClient_dispatchInputEventToViewName: |
| 718 var params = _WindowManagerInternalClientDispatchInputEventToViewParams.
deserialize( |
| 719 message.payload); |
| 720 _impl.dispatchInputEventToView(params.viewId, params.event); |
| 721 break; |
| 722 case _WindowManagerInternalClient_setViewportSizeName: |
| 723 var params = _WindowManagerInternalClientSetViewportSizeParams.deseriali
ze( |
| 724 message.payload); |
| 725 _impl.setViewportSize(params.size); |
| 726 break; |
| 727 case _WindowManagerInternalClient_cloneAndAnimateName: |
| 728 var params = _WindowManagerInternalClientCloneAndAnimateParams.deseriali
ze( |
| 729 message.payload); |
| 730 _impl.cloneAndAnimate(params.viewId); |
| 731 break; |
| 732 default: |
| 733 throw new bindings.MojoCodecError("Unexpected message name"); |
| 734 break; |
| 735 } |
| 736 return null; |
| 737 } |
| 738 |
| 739 WindowManagerInternalClient get impl => _impl; |
| 740 set impl(WindowManagerInternalClient d) { |
| 741 assert(_impl == null); |
| 742 _impl = d; |
| 743 } |
| 744 |
| 745 String toString() { |
| 746 var superString = super.toString(); |
| 747 return "WindowManagerInternalClientStub($superString)"; |
| 748 } |
| 749 |
| 750 int get version => 0; |
| 751 } |
| 752 |
| 753 |
| OLD | NEW |