| Index: mojo/dart/packages/mojo_services/lib/mojo/ui/input_connection.mojom.dart
|
| diff --git a/mojo/dart/packages/mojo_services/lib/mojo/display.mojom.dart b/mojo/dart/packages/mojo_services/lib/mojo/ui/input_connection.mojom.dart
|
| similarity index 56%
|
| copy from mojo/dart/packages/mojo_services/lib/mojo/display.mojom.dart
|
| copy to mojo/dart/packages/mojo_services/lib/mojo/ui/input_connection.mojom.dart
|
| index a8195cf0778b576d5cafb244b3b6da36db04f0cf..6e42a456192b807f4b626e18567fa46674f9ad88 100644
|
| --- a/mojo/dart/packages/mojo_services/lib/mojo/display.mojom.dart
|
| +++ b/mojo/dart/packages/mojo_services/lib/mojo/ui/input_connection.mojom.dart
|
| @@ -2,27 +2,25 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -library display_mojom;
|
| +library input_connection_mojom;
|
|
|
| import 'dart:async';
|
|
|
| import 'package:mojo/bindings.dart' as bindings;
|
| import 'package:mojo/core.dart' as core;
|
| -import 'package:mojo_services/mojo/context_provider.mojom.dart' as context_provider_mojom;
|
| -import 'package:mojo_services/mojo/viewport_parameter_listener.mojom.dart' as viewport_parameter_listener_mojom;
|
| -import 'package:mojo_services/mojo/surfaces.mojom.dart' as surfaces_mojom;
|
| +import 'package:mojo_services/mojo/input_events.mojom.dart' as input_events_mojom;
|
|
|
|
|
|
|
| -class _DisplaySubmitFrameParams extends bindings.Struct {
|
| +class _InputConnectionSetListenerParams extends bindings.Struct {
|
| static const List<bindings.StructDataHeader> kVersions = const [
|
| const bindings.StructDataHeader(16, 0)
|
| ];
|
| - surfaces_mojom.Frame frame = null;
|
| + Object listener = null;
|
|
|
| - _DisplaySubmitFrameParams() : super(kVersions.last.size);
|
| + _InputConnectionSetListenerParams() : super(kVersions.last.size);
|
|
|
| - static _DisplaySubmitFrameParams deserialize(bindings.Message message) {
|
| + static _InputConnectionSetListenerParams deserialize(bindings.Message message) {
|
| var decoder = new bindings.Decoder(message);
|
| var result = decode(decoder);
|
| if (decoder.excessHandles != null) {
|
| @@ -31,11 +29,11 @@ class _DisplaySubmitFrameParams extends bindings.Struct {
|
| return result;
|
| }
|
|
|
| - static _DisplaySubmitFrameParams decode(bindings.Decoder decoder0) {
|
| + static _InputConnectionSetListenerParams decode(bindings.Decoder decoder0) {
|
| if (decoder0 == null) {
|
| return null;
|
| }
|
| - _DisplaySubmitFrameParams result = new _DisplaySubmitFrameParams();
|
| + _InputConnectionSetListenerParams result = new _InputConnectionSetListenerParams();
|
|
|
| var mainDataHeader = decoder0.decodeStructDataHeader();
|
| if (mainDataHeader.version <= kVersions.last.version) {
|
| @@ -57,8 +55,7 @@ class _DisplaySubmitFrameParams extends bindings.Struct {
|
| }
|
| if (mainDataHeader.version >= 0) {
|
|
|
| - var decoder1 = decoder0.decodePointer(8, false);
|
| - result.frame = surfaces_mojom.Frame.decode(decoder1);
|
| + result.listener = decoder0.decodeServiceInterface(8, true, InputListenerProxy.newFromEndpoint);
|
| }
|
| return result;
|
| }
|
| @@ -66,30 +63,30 @@ class _DisplaySubmitFrameParams extends bindings.Struct {
|
| void encode(bindings.Encoder encoder) {
|
| var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
|
|
|
| - encoder0.encodeStruct(frame, 8, false);
|
| + encoder0.encodeInterface(listener, 8, true);
|
| }
|
|
|
| String toString() {
|
| - return "_DisplaySubmitFrameParams("
|
| - "frame: $frame" ")";
|
| + return "_InputConnectionSetListenerParams("
|
| + "listener: $listener" ")";
|
| }
|
|
|
| Map toJson() {
|
| - Map map = new Map();
|
| - map["frame"] = frame;
|
| - return map;
|
| + throw new bindings.MojoCodecError(
|
| + 'Object containing handles cannot be encoded to JSON.');
|
| }
|
| }
|
|
|
|
|
| -class DisplaySubmitFrameResponseParams extends bindings.Struct {
|
| +class _InputListenerOnEventParams extends bindings.Struct {
|
| static const List<bindings.StructDataHeader> kVersions = const [
|
| - const bindings.StructDataHeader(8, 0)
|
| + const bindings.StructDataHeader(16, 0)
|
| ];
|
| + input_events_mojom.Event event = null;
|
|
|
| - DisplaySubmitFrameResponseParams() : super(kVersions.last.size);
|
| + _InputListenerOnEventParams() : super(kVersions.last.size);
|
|
|
| - static DisplaySubmitFrameResponseParams deserialize(bindings.Message message) {
|
| + static _InputListenerOnEventParams deserialize(bindings.Message message) {
|
| var decoder = new bindings.Decoder(message);
|
| var result = decode(decoder);
|
| if (decoder.excessHandles != null) {
|
| @@ -98,11 +95,11 @@ class DisplaySubmitFrameResponseParams extends bindings.Struct {
|
| return result;
|
| }
|
|
|
| - static DisplaySubmitFrameResponseParams decode(bindings.Decoder decoder0) {
|
| + static _InputListenerOnEventParams decode(bindings.Decoder decoder0) {
|
| if (decoder0 == null) {
|
| return null;
|
| }
|
| - DisplaySubmitFrameResponseParams result = new DisplaySubmitFrameResponseParams();
|
| + _InputListenerOnEventParams result = new _InputListenerOnEventParams();
|
|
|
| var mainDataHeader = decoder0.decodeStructDataHeader();
|
| if (mainDataHeader.version <= kVersions.last.version) {
|
| @@ -122,35 +119,42 @@ class DisplaySubmitFrameResponseParams extends bindings.Struct {
|
| 'Message newer than the last known version cannot be shorter than '
|
| 'required by the last known version.');
|
| }
|
| + if (mainDataHeader.version >= 0) {
|
| +
|
| + var decoder1 = decoder0.decodePointer(8, false);
|
| + result.event = input_events_mojom.Event.decode(decoder1);
|
| + }
|
| return result;
|
| }
|
|
|
| void encode(bindings.Encoder encoder) {
|
| - encoder.getStructEncoderAtOffset(kVersions.last);
|
| + var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
|
| +
|
| + encoder0.encodeStruct(event, 8, false);
|
| }
|
|
|
| String toString() {
|
| - return "DisplaySubmitFrameResponseParams("")";
|
| + return "_InputListenerOnEventParams("
|
| + "event: $event" ")";
|
| }
|
|
|
| Map toJson() {
|
| Map map = new Map();
|
| + map["event"] = event;
|
| return map;
|
| }
|
| }
|
|
|
|
|
| -class _DisplayFactoryCreateParams extends bindings.Struct {
|
| +class InputListenerOnEventResponseParams extends bindings.Struct {
|
| static const List<bindings.StructDataHeader> kVersions = const [
|
| - const bindings.StructDataHeader(32, 0)
|
| + const bindings.StructDataHeader(16, 0)
|
| ];
|
| - Object contextProvider = null;
|
| - Object returner = null;
|
| - Object displayRequest = null;
|
| + bool consumed = false;
|
|
|
| - _DisplayFactoryCreateParams() : super(kVersions.last.size);
|
| + InputListenerOnEventResponseParams() : super(kVersions.last.size);
|
|
|
| - static _DisplayFactoryCreateParams deserialize(bindings.Message message) {
|
| + static InputListenerOnEventResponseParams deserialize(bindings.Message message) {
|
| var decoder = new bindings.Decoder(message);
|
| var result = decode(decoder);
|
| if (decoder.excessHandles != null) {
|
| @@ -159,11 +163,11 @@ class _DisplayFactoryCreateParams extends bindings.Struct {
|
| return result;
|
| }
|
|
|
| - static _DisplayFactoryCreateParams decode(bindings.Decoder decoder0) {
|
| + static InputListenerOnEventResponseParams decode(bindings.Decoder decoder0) {
|
| if (decoder0 == null) {
|
| return null;
|
| }
|
| - _DisplayFactoryCreateParams result = new _DisplayFactoryCreateParams();
|
| + InputListenerOnEventResponseParams result = new InputListenerOnEventResponseParams();
|
|
|
| var mainDataHeader = decoder0.decodeStructDataHeader();
|
| if (mainDataHeader.version <= kVersions.last.version) {
|
| @@ -185,15 +189,7 @@ class _DisplayFactoryCreateParams extends bindings.Struct {
|
| }
|
| if (mainDataHeader.version >= 0) {
|
|
|
| - result.contextProvider = decoder0.decodeServiceInterface(8, false, context_provider_mojom.ContextProviderProxy.newFromEndpoint);
|
| - }
|
| - if (mainDataHeader.version >= 0) {
|
| -
|
| - result.returner = decoder0.decodeServiceInterface(16, true, surfaces_mojom.ResourceReturnerProxy.newFromEndpoint);
|
| - }
|
| - if (mainDataHeader.version >= 0) {
|
| -
|
| - result.displayRequest = decoder0.decodeInterfaceRequest(24, false, DisplayStub.newFromEndpoint);
|
| + result.consumed = decoder0.decodeBool(8, 0);
|
| }
|
| return result;
|
| }
|
| @@ -201,71 +197,46 @@ class _DisplayFactoryCreateParams extends bindings.Struct {
|
| void encode(bindings.Encoder encoder) {
|
| var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last);
|
|
|
| - encoder0.encodeInterface(contextProvider, 8, false);
|
| -
|
| - encoder0.encodeInterface(returner, 16, true);
|
| -
|
| - encoder0.encodeInterfaceRequest(displayRequest, 24, false);
|
| + encoder0.encodeBool(consumed, 8, 0);
|
| }
|
|
|
| String toString() {
|
| - return "_DisplayFactoryCreateParams("
|
| - "contextProvider: $contextProvider" ", "
|
| - "returner: $returner" ", "
|
| - "displayRequest: $displayRequest" ")";
|
| + return "InputListenerOnEventResponseParams("
|
| + "consumed: $consumed" ")";
|
| }
|
|
|
| Map toJson() {
|
| - throw new bindings.MojoCodecError(
|
| - 'Object containing handles cannot be encoded to JSON.');
|
| + Map map = new Map();
|
| + map["consumed"] = consumed;
|
| + return map;
|
| }
|
| }
|
|
|
| -const int _Display_submitFrameName = 0;
|
| +const int _InputConnection_setListenerName = 0;
|
|
|
| -abstract class Display {
|
| - static const String serviceName = null;
|
| - dynamic submitFrame(surfaces_mojom.Frame frame,[Function responseFactory = null]);
|
| +abstract class InputConnection {
|
| + static const String serviceName = "mojo::ui::InputConnection";
|
| + void setListener(Object listener);
|
| }
|
|
|
|
|
| -class _DisplayProxyImpl extends bindings.Proxy {
|
| - _DisplayProxyImpl.fromEndpoint(
|
| +class _InputConnectionProxyImpl extends bindings.Proxy {
|
| + _InputConnectionProxyImpl.fromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
|
|
|
| - _DisplayProxyImpl.fromHandle(core.MojoHandle handle) :
|
| + _InputConnectionProxyImpl.fromHandle(core.MojoHandle handle) :
|
| super.fromHandle(handle);
|
|
|
| - _DisplayProxyImpl.unbound() : super.unbound();
|
| + _InputConnectionProxyImpl.unbound() : super.unbound();
|
|
|
| - static _DisplayProxyImpl newFromEndpoint(
|
| + static _InputConnectionProxyImpl newFromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint) {
|
| - assert(endpoint.setDescription("For _DisplayProxyImpl"));
|
| - return new _DisplayProxyImpl.fromEndpoint(endpoint);
|
| + assert(endpoint.setDescription("For _InputConnectionProxyImpl"));
|
| + return new _InputConnectionProxyImpl.fromEndpoint(endpoint);
|
| }
|
|
|
| void handleResponse(bindings.ServiceMessage message) {
|
| switch (message.header.type) {
|
| - case _Display_submitFrameName:
|
| - var r = DisplaySubmitFrameResponseParams.deserialize(
|
| - message.payload);
|
| - if (!message.header.hasRequestId) {
|
| - proxyError("Expected a message with a valid request Id.");
|
| - return;
|
| - }
|
| - Completer c = completerMap[message.header.requestId];
|
| - if (c == null) {
|
| - proxyError(
|
| - "Message had unknown request Id: ${message.header.requestId}");
|
| - return;
|
| - }
|
| - completerMap.remove(message.header.requestId);
|
| - if (c.isCompleted) {
|
| - proxyError("Response completer already completed");
|
| - return;
|
| - }
|
| - c.complete(r);
|
| - break;
|
| default:
|
| proxyError("Unexpected message type: ${message.header.type}");
|
| close(immediate: true);
|
| @@ -275,65 +246,65 @@ class _DisplayProxyImpl extends bindings.Proxy {
|
|
|
| String toString() {
|
| var superString = super.toString();
|
| - return "_DisplayProxyImpl($superString)";
|
| + return "_InputConnectionProxyImpl($superString)";
|
| }
|
| }
|
|
|
|
|
| -class _DisplayProxyCalls implements Display {
|
| - _DisplayProxyImpl _proxyImpl;
|
| +class _InputConnectionProxyCalls implements InputConnection {
|
| + _InputConnectionProxyImpl _proxyImpl;
|
|
|
| - _DisplayProxyCalls(this._proxyImpl);
|
| - dynamic submitFrame(surfaces_mojom.Frame frame,[Function responseFactory = null]) {
|
| - var params = new _DisplaySubmitFrameParams();
|
| - params.frame = frame;
|
| - return _proxyImpl.sendMessageWithRequestId(
|
| - params,
|
| - _Display_submitFrameName,
|
| - -1,
|
| - bindings.MessageHeader.kMessageExpectsResponse);
|
| + _InputConnectionProxyCalls(this._proxyImpl);
|
| + void setListener(Object listener) {
|
| + if (!_proxyImpl.isBound) {
|
| + _proxyImpl.proxyError("The Proxy is closed.");
|
| + return;
|
| + }
|
| + var params = new _InputConnectionSetListenerParams();
|
| + params.listener = listener;
|
| + _proxyImpl.sendMessage(params, _InputConnection_setListenerName);
|
| }
|
| }
|
|
|
|
|
| -class DisplayProxy implements bindings.ProxyBase {
|
| +class InputConnectionProxy implements bindings.ProxyBase {
|
| final bindings.Proxy impl;
|
| - Display ptr;
|
| + InputConnection ptr;
|
|
|
| - DisplayProxy(_DisplayProxyImpl proxyImpl) :
|
| + InputConnectionProxy(_InputConnectionProxyImpl proxyImpl) :
|
| impl = proxyImpl,
|
| - ptr = new _DisplayProxyCalls(proxyImpl);
|
| + ptr = new _InputConnectionProxyCalls(proxyImpl);
|
|
|
| - DisplayProxy.fromEndpoint(
|
| + InputConnectionProxy.fromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint) :
|
| - impl = new _DisplayProxyImpl.fromEndpoint(endpoint) {
|
| - ptr = new _DisplayProxyCalls(impl);
|
| + impl = new _InputConnectionProxyImpl.fromEndpoint(endpoint) {
|
| + ptr = new _InputConnectionProxyCalls(impl);
|
| }
|
|
|
| - DisplayProxy.fromHandle(core.MojoHandle handle) :
|
| - impl = new _DisplayProxyImpl.fromHandle(handle) {
|
| - ptr = new _DisplayProxyCalls(impl);
|
| + InputConnectionProxy.fromHandle(core.MojoHandle handle) :
|
| + impl = new _InputConnectionProxyImpl.fromHandle(handle) {
|
| + ptr = new _InputConnectionProxyCalls(impl);
|
| }
|
|
|
| - DisplayProxy.unbound() :
|
| - impl = new _DisplayProxyImpl.unbound() {
|
| - ptr = new _DisplayProxyCalls(impl);
|
| + InputConnectionProxy.unbound() :
|
| + impl = new _InputConnectionProxyImpl.unbound() {
|
| + ptr = new _InputConnectionProxyCalls(impl);
|
| }
|
|
|
| - factory DisplayProxy.connectToService(
|
| + factory InputConnectionProxy.connectToService(
|
| bindings.ServiceConnector s, String url, [String serviceName]) {
|
| - DisplayProxy p = new DisplayProxy.unbound();
|
| + InputConnectionProxy p = new InputConnectionProxy.unbound();
|
| s.connectToService(url, p, serviceName);
|
| return p;
|
| }
|
|
|
| - static DisplayProxy newFromEndpoint(
|
| + static InputConnectionProxy newFromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint) {
|
| - assert(endpoint.setDescription("For DisplayProxy"));
|
| - return new DisplayProxy.fromEndpoint(endpoint);
|
| + assert(endpoint.setDescription("For InputConnectionProxy"));
|
| + return new InputConnectionProxy.fromEndpoint(endpoint);
|
| }
|
|
|
| - String get serviceName => Display.serviceName;
|
| + String get serviceName => InputConnection.serviceName;
|
|
|
| Future close({bool immediate: false}) => impl.close(immediate: immediate);
|
|
|
| @@ -350,34 +321,30 @@ class DisplayProxy implements bindings.ProxyBase {
|
| }
|
|
|
| String toString() {
|
| - return "DisplayProxy($impl)";
|
| + return "InputConnectionProxy($impl)";
|
| }
|
| }
|
|
|
|
|
| -class DisplayStub extends bindings.Stub {
|
| - Display _impl = null;
|
| +class InputConnectionStub extends bindings.Stub {
|
| + InputConnection _impl = null;
|
|
|
| - DisplayStub.fromEndpoint(
|
| + InputConnectionStub.fromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint, [this._impl])
|
| : super.fromEndpoint(endpoint);
|
|
|
| - DisplayStub.fromHandle(core.MojoHandle handle, [this._impl])
|
| + InputConnectionStub.fromHandle(core.MojoHandle handle, [this._impl])
|
| : super.fromHandle(handle);
|
|
|
| - DisplayStub.unbound() : super.unbound();
|
| + InputConnectionStub.unbound() : super.unbound();
|
|
|
| - static DisplayStub newFromEndpoint(
|
| + static InputConnectionStub newFromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint) {
|
| - assert(endpoint.setDescription("For DisplayStub"));
|
| - return new DisplayStub.fromEndpoint(endpoint);
|
| + assert(endpoint.setDescription("For InputConnectionStub"));
|
| + return new InputConnectionStub.fromEndpoint(endpoint);
|
| }
|
|
|
|
|
| - DisplaySubmitFrameResponseParams _DisplaySubmitFrameResponseParamsFactory() {
|
| - var mojo_factory_result = new DisplaySubmitFrameResponseParams();
|
| - return mojo_factory_result;
|
| - }
|
|
|
| dynamic handleMessage(bindings.ServiceMessage message) {
|
| if (bindings.ControlMessageHandler.isControlMessage(message)) {
|
| @@ -387,27 +354,10 @@ class DisplayStub extends bindings.Stub {
|
| }
|
| assert(_impl != null);
|
| switch (message.header.type) {
|
| - case _Display_submitFrameName:
|
| - var params = _DisplaySubmitFrameParams.deserialize(
|
| + case _InputConnection_setListenerName:
|
| + var params = _InputConnectionSetListenerParams.deserialize(
|
| message.payload);
|
| - var response = _impl.submitFrame(params.frame,_DisplaySubmitFrameResponseParamsFactory);
|
| - if (response is Future) {
|
| - return response.then((response) {
|
| - if (response != null) {
|
| - return buildResponseWithId(
|
| - response,
|
| - _Display_submitFrameName,
|
| - message.header.requestId,
|
| - bindings.MessageHeader.kMessageIsResponse);
|
| - }
|
| - });
|
| - } else if (response != null) {
|
| - return buildResponseWithId(
|
| - response,
|
| - _Display_submitFrameName,
|
| - message.header.requestId,
|
| - bindings.MessageHeader.kMessageIsResponse);
|
| - }
|
| + _impl.setListener(params.listener);
|
| break;
|
| default:
|
| throw new bindings.MojoCodecError("Unexpected message name");
|
| @@ -416,45 +366,65 @@ class DisplayStub extends bindings.Stub {
|
| return null;
|
| }
|
|
|
| - Display get impl => _impl;
|
| - set impl(Display d) {
|
| + InputConnection get impl => _impl;
|
| + set impl(InputConnection d) {
|
| assert(_impl == null);
|
| _impl = d;
|
| }
|
|
|
| String toString() {
|
| var superString = super.toString();
|
| - return "DisplayStub($superString)";
|
| + return "InputConnectionStub($superString)";
|
| }
|
|
|
| int get version => 0;
|
| }
|
|
|
| -const int _DisplayFactory_createName = 0;
|
| +const int _InputListener_onEventName = 0;
|
|
|
| -abstract class DisplayFactory {
|
| - static const String serviceName = "mojo::DisplayFactory";
|
| - void create(Object contextProvider, Object returner, Object displayRequest);
|
| +abstract class InputListener {
|
| + static const String serviceName = null;
|
| + dynamic onEvent(input_events_mojom.Event event,[Function responseFactory = null]);
|
| }
|
|
|
|
|
| -class _DisplayFactoryProxyImpl extends bindings.Proxy {
|
| - _DisplayFactoryProxyImpl.fromEndpoint(
|
| +class _InputListenerProxyImpl extends bindings.Proxy {
|
| + _InputListenerProxyImpl.fromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
|
|
|
| - _DisplayFactoryProxyImpl.fromHandle(core.MojoHandle handle) :
|
| + _InputListenerProxyImpl.fromHandle(core.MojoHandle handle) :
|
| super.fromHandle(handle);
|
|
|
| - _DisplayFactoryProxyImpl.unbound() : super.unbound();
|
| + _InputListenerProxyImpl.unbound() : super.unbound();
|
|
|
| - static _DisplayFactoryProxyImpl newFromEndpoint(
|
| + static _InputListenerProxyImpl newFromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint) {
|
| - assert(endpoint.setDescription("For _DisplayFactoryProxyImpl"));
|
| - return new _DisplayFactoryProxyImpl.fromEndpoint(endpoint);
|
| + assert(endpoint.setDescription("For _InputListenerProxyImpl"));
|
| + return new _InputListenerProxyImpl.fromEndpoint(endpoint);
|
| }
|
|
|
| void handleResponse(bindings.ServiceMessage message) {
|
| switch (message.header.type) {
|
| + case _InputListener_onEventName:
|
| + var r = InputListenerOnEventResponseParams.deserialize(
|
| + message.payload);
|
| + if (!message.header.hasRequestId) {
|
| + proxyError("Expected a message with a valid request Id.");
|
| + return;
|
| + }
|
| + Completer c = completerMap[message.header.requestId];
|
| + if (c == null) {
|
| + proxyError(
|
| + "Message had unknown request Id: ${message.header.requestId}");
|
| + return;
|
| + }
|
| + completerMap.remove(message.header.requestId);
|
| + if (c.isCompleted) {
|
| + proxyError("Response completer already completed");
|
| + return;
|
| + }
|
| + c.complete(r);
|
| + break;
|
| default:
|
| proxyError("Unexpected message type: ${message.header.type}");
|
| close(immediate: true);
|
| @@ -464,67 +434,65 @@ class _DisplayFactoryProxyImpl extends bindings.Proxy {
|
|
|
| String toString() {
|
| var superString = super.toString();
|
| - return "_DisplayFactoryProxyImpl($superString)";
|
| + return "_InputListenerProxyImpl($superString)";
|
| }
|
| }
|
|
|
|
|
| -class _DisplayFactoryProxyCalls implements DisplayFactory {
|
| - _DisplayFactoryProxyImpl _proxyImpl;
|
| +class _InputListenerProxyCalls implements InputListener {
|
| + _InputListenerProxyImpl _proxyImpl;
|
|
|
| - _DisplayFactoryProxyCalls(this._proxyImpl);
|
| - void create(Object contextProvider, Object returner, Object displayRequest) {
|
| - if (!_proxyImpl.isBound) {
|
| - _proxyImpl.proxyError("The Proxy is closed.");
|
| - return;
|
| - }
|
| - var params = new _DisplayFactoryCreateParams();
|
| - params.contextProvider = contextProvider;
|
| - params.returner = returner;
|
| - params.displayRequest = displayRequest;
|
| - _proxyImpl.sendMessage(params, _DisplayFactory_createName);
|
| + _InputListenerProxyCalls(this._proxyImpl);
|
| + dynamic onEvent(input_events_mojom.Event event,[Function responseFactory = null]) {
|
| + var params = new _InputListenerOnEventParams();
|
| + params.event = event;
|
| + return _proxyImpl.sendMessageWithRequestId(
|
| + params,
|
| + _InputListener_onEventName,
|
| + -1,
|
| + bindings.MessageHeader.kMessageExpectsResponse);
|
| }
|
| }
|
|
|
|
|
| -class DisplayFactoryProxy implements bindings.ProxyBase {
|
| +class InputListenerProxy implements bindings.ProxyBase {
|
| final bindings.Proxy impl;
|
| - DisplayFactory ptr;
|
| + InputListener ptr;
|
|
|
| - DisplayFactoryProxy(_DisplayFactoryProxyImpl proxyImpl) :
|
| + InputListenerProxy(_InputListenerProxyImpl proxyImpl) :
|
| impl = proxyImpl,
|
| - ptr = new _DisplayFactoryProxyCalls(proxyImpl);
|
| + ptr = new _InputListenerProxyCalls(proxyImpl);
|
|
|
| - DisplayFactoryProxy.fromEndpoint(
|
| + InputListenerProxy.fromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint) :
|
| - impl = new _DisplayFactoryProxyImpl.fromEndpoint(endpoint) {
|
| - ptr = new _DisplayFactoryProxyCalls(impl);
|
| + impl = new _InputListenerProxyImpl.fromEndpoint(endpoint) {
|
| + ptr = new _InputListenerProxyCalls(impl);
|
| }
|
|
|
| - DisplayFactoryProxy.fromHandle(core.MojoHandle handle) :
|
| - impl = new _DisplayFactoryProxyImpl.fromHandle(handle) {
|
| - ptr = new _DisplayFactoryProxyCalls(impl);
|
| + InputListenerProxy.fromHandle(core.MojoHandle handle) :
|
| + impl = new _InputListenerProxyImpl.fromHandle(handle) {
|
| + ptr = new _InputListenerProxyCalls(impl);
|
| }
|
|
|
| - DisplayFactoryProxy.unbound() :
|
| - impl = new _DisplayFactoryProxyImpl.unbound() {
|
| - ptr = new _DisplayFactoryProxyCalls(impl);
|
| + InputListenerProxy.unbound() :
|
| + impl = new _InputListenerProxyImpl.unbound() {
|
| + ptr = new _InputListenerProxyCalls(impl);
|
| }
|
|
|
| - factory DisplayFactoryProxy.connectToService(
|
| + factory InputListenerProxy.connectToService(
|
| bindings.ServiceConnector s, String url, [String serviceName]) {
|
| - DisplayFactoryProxy p = new DisplayFactoryProxy.unbound();
|
| + InputListenerProxy p = new InputListenerProxy.unbound();
|
| s.connectToService(url, p, serviceName);
|
| return p;
|
| }
|
|
|
| - static DisplayFactoryProxy newFromEndpoint(
|
| + static InputListenerProxy newFromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint) {
|
| - assert(endpoint.setDescription("For DisplayFactoryProxy"));
|
| - return new DisplayFactoryProxy.fromEndpoint(endpoint);
|
| + assert(endpoint.setDescription("For InputListenerProxy"));
|
| + return new InputListenerProxy.fromEndpoint(endpoint);
|
| }
|
|
|
| - String get serviceName => DisplayFactory.serviceName;
|
| + String get serviceName => InputListener.serviceName;
|
|
|
| Future close({bool immediate: false}) => impl.close(immediate: immediate);
|
|
|
| @@ -541,30 +509,35 @@ class DisplayFactoryProxy implements bindings.ProxyBase {
|
| }
|
|
|
| String toString() {
|
| - return "DisplayFactoryProxy($impl)";
|
| + return "InputListenerProxy($impl)";
|
| }
|
| }
|
|
|
|
|
| -class DisplayFactoryStub extends bindings.Stub {
|
| - DisplayFactory _impl = null;
|
| +class InputListenerStub extends bindings.Stub {
|
| + InputListener _impl = null;
|
|
|
| - DisplayFactoryStub.fromEndpoint(
|
| + InputListenerStub.fromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint, [this._impl])
|
| : super.fromEndpoint(endpoint);
|
|
|
| - DisplayFactoryStub.fromHandle(core.MojoHandle handle, [this._impl])
|
| + InputListenerStub.fromHandle(core.MojoHandle handle, [this._impl])
|
| : super.fromHandle(handle);
|
|
|
| - DisplayFactoryStub.unbound() : super.unbound();
|
| + InputListenerStub.unbound() : super.unbound();
|
|
|
| - static DisplayFactoryStub newFromEndpoint(
|
| + static InputListenerStub newFromEndpoint(
|
| core.MojoMessagePipeEndpoint endpoint) {
|
| - assert(endpoint.setDescription("For DisplayFactoryStub"));
|
| - return new DisplayFactoryStub.fromEndpoint(endpoint);
|
| + assert(endpoint.setDescription("For InputListenerStub"));
|
| + return new InputListenerStub.fromEndpoint(endpoint);
|
| }
|
|
|
|
|
| + InputListenerOnEventResponseParams _InputListenerOnEventResponseParamsFactory(bool consumed) {
|
| + var mojo_factory_result = new InputListenerOnEventResponseParams();
|
| + mojo_factory_result.consumed = consumed;
|
| + return mojo_factory_result;
|
| + }
|
|
|
| dynamic handleMessage(bindings.ServiceMessage message) {
|
| if (bindings.ControlMessageHandler.isControlMessage(message)) {
|
| @@ -574,10 +547,27 @@ class DisplayFactoryStub extends bindings.Stub {
|
| }
|
| assert(_impl != null);
|
| switch (message.header.type) {
|
| - case _DisplayFactory_createName:
|
| - var params = _DisplayFactoryCreateParams.deserialize(
|
| + case _InputListener_onEventName:
|
| + var params = _InputListenerOnEventParams.deserialize(
|
| message.payload);
|
| - _impl.create(params.contextProvider, params.returner, params.displayRequest);
|
| + var response = _impl.onEvent(params.event,_InputListenerOnEventResponseParamsFactory);
|
| + if (response is Future) {
|
| + return response.then((response) {
|
| + if (response != null) {
|
| + return buildResponseWithId(
|
| + response,
|
| + _InputListener_onEventName,
|
| + message.header.requestId,
|
| + bindings.MessageHeader.kMessageIsResponse);
|
| + }
|
| + });
|
| + } else if (response != null) {
|
| + return buildResponseWithId(
|
| + response,
|
| + _InputListener_onEventName,
|
| + message.header.requestId,
|
| + bindings.MessageHeader.kMessageIsResponse);
|
| + }
|
| break;
|
| default:
|
| throw new bindings.MojoCodecError("Unexpected message name");
|
| @@ -586,15 +576,15 @@ class DisplayFactoryStub extends bindings.Stub {
|
| return null;
|
| }
|
|
|
| - DisplayFactory get impl => _impl;
|
| - set impl(DisplayFactory d) {
|
| + InputListener get impl => _impl;
|
| + set impl(InputListener d) {
|
| assert(_impl == null);
|
| _impl = d;
|
| }
|
|
|
| String toString() {
|
| var superString = super.toString();
|
| - return "DisplayFactoryStub($superString)";
|
| + return "InputListenerStub($superString)";
|
| }
|
|
|
| int get version => 0;
|
|
|