OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 library terminal_mojom; | 5 library terminal_mojom; |
6 import 'dart:async'; | 6 import 'dart:async'; |
7 import 'package:mojo/bindings.dart' as bindings; | 7 import 'package:mojo/bindings.dart' as bindings; |
8 import 'package:mojo/core.dart' as core; | 8 import 'package:mojo/core.dart' as core; |
9 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; | 9 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic
e_describer; |
10 import 'package:mojo_services/mojo/files/file.mojom.dart' as file_mojom; | 10 import 'package:mojo_services/mojo/files/file.mojom.dart' as file_mojom; |
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 } | 715 } |
716 | 716 |
717 abstract class Terminal { | 717 abstract class Terminal { |
718 static const String serviceName = "mojo::terminal::Terminal"; | 718 static const String serviceName = "mojo::terminal::Terminal"; |
719 dynamic connect(Object terminalFile,bool force,[Function responseFactory = nul
l]); | 719 dynamic connect(Object terminalFile,bool force,[Function responseFactory = nul
l]); |
720 dynamic connectToClient(Object terminalClient,bool force,[Function responseFac
tory = null]); | 720 dynamic connectToClient(Object terminalClient,bool force,[Function responseFac
tory = null]); |
721 dynamic getSize([Function responseFactory = null]); | 721 dynamic getSize([Function responseFactory = null]); |
722 dynamic setSize(int rows,int columns,bool reset,[Function responseFactory = nu
ll]); | 722 dynamic setSize(int rows,int columns,bool reset,[Function responseFactory = nu
ll]); |
723 } | 723 } |
724 | 724 |
725 | 725 class _TerminalProxyControl |
726 class _TerminalProxyControl extends bindings.ProxyMessageHandler | 726 extends bindings.ProxyMessageHandler |
727 implements bindings.ProxyControl { | 727 implements bindings.ProxyControl { |
728 _TerminalProxyControl.fromEndpoint( | 728 _TerminalProxyControl.fromEndpoint( |
729 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 729 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
730 | 730 |
731 _TerminalProxyControl.fromHandle( | 731 _TerminalProxyControl.fromHandle( |
732 core.MojoHandle handle) : super.fromHandle(handle); | 732 core.MojoHandle handle) : super.fromHandle(handle); |
733 | 733 |
734 _TerminalProxyControl.unbound() : super.unbound(); | 734 _TerminalProxyControl.unbound() : super.unbound(); |
735 | 735 |
736 service_describer.ServiceDescription get serviceDescription => | 736 service_describer.ServiceDescription get serviceDescription => |
737 new _TerminalServiceDescription(); | 737 new _TerminalServiceDescription(); |
738 | 738 |
739 String get serviceName => Terminal.serviceName; | 739 String get serviceName => Terminal.serviceName; |
740 | 740 |
741 @override | |
742 void handleResponse(bindings.ServiceMessage message) { | 741 void handleResponse(bindings.ServiceMessage message) { |
743 switch (message.header.type) { | 742 switch (message.header.type) { |
744 case _terminalMethodConnectName: | 743 case _terminalMethodConnectName: |
745 var r = TerminalConnectResponseParams.deserialize( | 744 var r = TerminalConnectResponseParams.deserialize( |
746 message.payload); | 745 message.payload); |
747 if (!message.header.hasRequestId) { | 746 if (!message.header.hasRequestId) { |
748 proxyError("Expected a message with a valid request Id."); | 747 proxyError("Expected a message with a valid request Id."); |
749 return; | 748 return; |
750 } | 749 } |
751 Completer c = completerMap[message.header.requestId]; | 750 Completer c = completerMap[message.header.requestId]; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 } | 827 } |
829 } | 828 } |
830 | 829 |
831 @override | 830 @override |
832 String toString() { | 831 String toString() { |
833 var superString = super.toString(); | 832 var superString = super.toString(); |
834 return "_TerminalProxyControl($superString)"; | 833 return "_TerminalProxyControl($superString)"; |
835 } | 834 } |
836 } | 835 } |
837 | 836 |
838 | 837 class TerminalProxy |
839 class TerminalProxy extends bindings.Proxy | 838 extends bindings.Proxy |
840 implements Terminal { | 839 implements Terminal { |
841 TerminalProxy.fromEndpoint( | 840 TerminalProxy.fromEndpoint( |
842 core.MojoMessagePipeEndpoint endpoint) | 841 core.MojoMessagePipeEndpoint endpoint) |
843 : super(new _TerminalProxyControl.fromEndpoint(endpoint)); | 842 : super(new _TerminalProxyControl.fromEndpoint(endpoint)); |
844 | 843 |
845 TerminalProxy.fromHandle(core.MojoHandle handle) | 844 TerminalProxy.fromHandle(core.MojoHandle handle) |
846 : super(new _TerminalProxyControl.fromHandle(handle)); | 845 : super(new _TerminalProxyControl.fromHandle(handle)); |
847 | 846 |
848 TerminalProxy.unbound() | 847 TerminalProxy.unbound() |
849 : super(new _TerminalProxyControl.unbound()); | 848 : super(new _TerminalProxyControl.unbound()); |
850 | 849 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 params.columns = columns; | 895 params.columns = columns; |
897 params.reset = reset; | 896 params.reset = reset; |
898 return ctrl.sendMessageWithRequestId( | 897 return ctrl.sendMessageWithRequestId( |
899 params, | 898 params, |
900 _terminalMethodSetSizeName, | 899 _terminalMethodSetSizeName, |
901 -1, | 900 -1, |
902 bindings.MessageHeader.kMessageExpectsResponse); | 901 bindings.MessageHeader.kMessageExpectsResponse); |
903 } | 902 } |
904 } | 903 } |
905 | 904 |
906 | 905 class _TerminalStubControl |
907 class TerminalStub extends bindings.Stub { | 906 extends bindings.StubMessageHandler |
| 907 implements bindings.StubControl<Terminal> { |
908 Terminal _impl; | 908 Terminal _impl; |
909 | 909 |
910 TerminalStub.fromEndpoint( | 910 _TerminalStubControl.fromEndpoint( |
911 core.MojoMessagePipeEndpoint endpoint, [Terminal impl]) | 911 core.MojoMessagePipeEndpoint endpoint, [Terminal impl]) |
912 : super.fromEndpoint(endpoint, autoBegin: impl != null) { | 912 : super.fromEndpoint(endpoint, autoBegin: impl != null) { |
913 _impl = impl; | 913 _impl = impl; |
914 } | 914 } |
915 | 915 |
916 TerminalStub.fromHandle( | 916 _TerminalStubControl.fromHandle( |
917 core.MojoHandle handle, [Terminal impl]) | 917 core.MojoHandle handle, [Terminal impl]) |
918 : super.fromHandle(handle, autoBegin: impl != null) { | 918 : super.fromHandle(handle, autoBegin: impl != null) { |
919 _impl = impl; | 919 _impl = impl; |
920 } | 920 } |
921 | 921 |
922 TerminalStub.unbound([this._impl]) : super.unbound(); | 922 _TerminalStubControl.unbound([this._impl]) : super.unbound(); |
923 | |
924 static TerminalStub newFromEndpoint( | |
925 core.MojoMessagePipeEndpoint endpoint) { | |
926 assert(endpoint.setDescription("For TerminalStub")); | |
927 return new TerminalStub.fromEndpoint(endpoint); | |
928 } | |
929 | 923 |
930 | 924 |
931 TerminalConnectResponseParams _terminalConnectResponseParamsFactory(types_mojo
m.Error error) { | 925 TerminalConnectResponseParams _terminalConnectResponseParamsFactory(types_mojo
m.Error error) { |
932 var result = new TerminalConnectResponseParams(); | 926 var result = new TerminalConnectResponseParams(); |
933 result.error = error; | 927 result.error = error; |
934 return result; | 928 return result; |
935 } | 929 } |
936 TerminalConnectToClientResponseParams _terminalConnectToClientResponseParamsFa
ctory(types_mojom.Error error) { | 930 TerminalConnectToClientResponseParams _terminalConnectToClientResponseParamsFa
ctory(types_mojom.Error error) { |
937 var result = new TerminalConnectToClientResponseParams(); | 931 var result = new TerminalConnectToClientResponseParams(); |
938 result.error = error; | 932 result.error = error; |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1068 } | 1062 } |
1069 | 1063 |
1070 @override | 1064 @override |
1071 void bind(core.MojoMessagePipeEndpoint endpoint) { | 1065 void bind(core.MojoMessagePipeEndpoint endpoint) { |
1072 super.bind(endpoint); | 1066 super.bind(endpoint); |
1073 if (!isOpen && (_impl != null)) { | 1067 if (!isOpen && (_impl != null)) { |
1074 beginHandlingEvents(); | 1068 beginHandlingEvents(); |
1075 } | 1069 } |
1076 } | 1070 } |
1077 | 1071 |
| 1072 @override |
1078 String toString() { | 1073 String toString() { |
1079 var superString = super.toString(); | 1074 var superString = super.toString(); |
1080 return "TerminalStub($superString)"; | 1075 return "_TerminalStubControl($superString)"; |
1081 } | 1076 } |
1082 | 1077 |
1083 int get version => 0; | 1078 int get version => 0; |
1084 | 1079 |
1085 static service_describer.ServiceDescription _cachedServiceDescription; | 1080 static service_describer.ServiceDescription _cachedServiceDescription; |
1086 static service_describer.ServiceDescription get serviceDescription { | 1081 static service_describer.ServiceDescription get serviceDescription { |
1087 if (_cachedServiceDescription == null) { | 1082 if (_cachedServiceDescription == null) { |
1088 _cachedServiceDescription = new _TerminalServiceDescription(); | 1083 _cachedServiceDescription = new _TerminalServiceDescription(); |
1089 } | 1084 } |
1090 return _cachedServiceDescription; | 1085 return _cachedServiceDescription; |
1091 } | 1086 } |
1092 } | 1087 } |
1093 | 1088 |
| 1089 class TerminalStub |
| 1090 extends bindings.Stub<Terminal> |
| 1091 implements Terminal { |
| 1092 TerminalStub.fromEndpoint( |
| 1093 core.MojoMessagePipeEndpoint endpoint, [Terminal impl]) |
| 1094 : super(new _TerminalStubControl.fromEndpoint(endpoint, impl)); |
| 1095 |
| 1096 TerminalStub.fromHandle( |
| 1097 core.MojoHandle handle, [Terminal impl]) |
| 1098 : super(new _TerminalStubControl.fromHandle(handle, impl)); |
| 1099 |
| 1100 TerminalStub.unbound([Terminal impl]) |
| 1101 : super(new _TerminalStubControl.unbound(impl)); |
| 1102 |
| 1103 static TerminalStub newFromEndpoint( |
| 1104 core.MojoMessagePipeEndpoint endpoint) { |
| 1105 assert(endpoint.setDescription("For TerminalStub")); |
| 1106 return new TerminalStub.fromEndpoint(endpoint); |
| 1107 } |
| 1108 |
| 1109 static service_describer.ServiceDescription get serviceDescription => |
| 1110 _TerminalStubControl.serviceDescription; |
| 1111 |
| 1112 |
| 1113 dynamic connect(Object terminalFile,bool force,[Function responseFactory = nul
l]) { |
| 1114 return impl.connect(terminalFile,force,responseFactory); |
| 1115 } |
| 1116 dynamic connectToClient(Object terminalClient,bool force,[Function responseFac
tory = null]) { |
| 1117 return impl.connectToClient(terminalClient,force,responseFactory); |
| 1118 } |
| 1119 dynamic getSize([Function responseFactory = null]) { |
| 1120 return impl.getSize(responseFactory); |
| 1121 } |
| 1122 dynamic setSize(int rows,int columns,bool reset,[Function responseFactory = nu
ll]) { |
| 1123 return impl.setSize(rows,columns,reset,responseFactory); |
| 1124 } |
| 1125 } |
| 1126 |
1094 | 1127 |
1095 | 1128 |
OLD | NEW |