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 keyboard_mojom; | 5 library keyboard_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/native_viewport_event_dispatcher.mojom.dart'
as native_viewport_event_dispatcher_mojom; | 10 import 'package:mojo_services/mojo/native_viewport_event_dispatcher.mojom.dart'
as native_viewport_event_dispatcher_mojom; |
(...skipping 1447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1458 void commitCompletion(CompletionData completion); | 1458 void commitCompletion(CompletionData completion); |
1459 void commitCorrection(CorrectionData correction); | 1459 void commitCorrection(CorrectionData correction); |
1460 void commitText(String text, int newCursorPosition); | 1460 void commitText(String text, int newCursorPosition); |
1461 void deleteSurroundingText(int beforeLength, int afterLength); | 1461 void deleteSurroundingText(int beforeLength, int afterLength); |
1462 void setComposingRegion(int start, int end); | 1462 void setComposingRegion(int start, int end); |
1463 void setComposingText(String text, int newCursorPosition); | 1463 void setComposingText(String text, int newCursorPosition); |
1464 void setSelection(int start, int end); | 1464 void setSelection(int start, int end); |
1465 void submit(SubmitAction action); | 1465 void submit(SubmitAction action); |
1466 } | 1466 } |
1467 | 1467 |
1468 | 1468 class _KeyboardClientProxyControl |
1469 class _KeyboardClientProxyControl extends bindings.ProxyMessageHandler | 1469 extends bindings.ProxyMessageHandler |
1470 implements bindings.ProxyControl { | 1470 implements bindings.ProxyControl { |
1471 _KeyboardClientProxyControl.fromEndpoint( | 1471 _KeyboardClientProxyControl.fromEndpoint( |
1472 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 1472 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
1473 | 1473 |
1474 _KeyboardClientProxyControl.fromHandle( | 1474 _KeyboardClientProxyControl.fromHandle( |
1475 core.MojoHandle handle) : super.fromHandle(handle); | 1475 core.MojoHandle handle) : super.fromHandle(handle); |
1476 | 1476 |
1477 _KeyboardClientProxyControl.unbound() : super.unbound(); | 1477 _KeyboardClientProxyControl.unbound() : super.unbound(); |
1478 | 1478 |
1479 service_describer.ServiceDescription get serviceDescription => | 1479 service_describer.ServiceDescription get serviceDescription => |
1480 new _KeyboardClientServiceDescription(); | 1480 new _KeyboardClientServiceDescription(); |
1481 | 1481 |
1482 String get serviceName => KeyboardClient.serviceName; | 1482 String get serviceName => KeyboardClient.serviceName; |
1483 | 1483 |
1484 @override | |
1485 void handleResponse(bindings.ServiceMessage message) { | 1484 void handleResponse(bindings.ServiceMessage message) { |
1486 switch (message.header.type) { | 1485 switch (message.header.type) { |
1487 default: | 1486 default: |
1488 proxyError("Unexpected message type: ${message.header.type}"); | 1487 proxyError("Unexpected message type: ${message.header.type}"); |
1489 close(immediate: true); | 1488 close(immediate: true); |
1490 break; | 1489 break; |
1491 } | 1490 } |
1492 } | 1491 } |
1493 | 1492 |
1494 @override | 1493 @override |
1495 String toString() { | 1494 String toString() { |
1496 var superString = super.toString(); | 1495 var superString = super.toString(); |
1497 return "_KeyboardClientProxyControl($superString)"; | 1496 return "_KeyboardClientProxyControl($superString)"; |
1498 } | 1497 } |
1499 } | 1498 } |
1500 | 1499 |
1501 | 1500 class KeyboardClientProxy |
1502 class KeyboardClientProxy extends bindings.Proxy | 1501 extends bindings.Proxy |
1503 implements KeyboardClient { | 1502 implements KeyboardClient { |
1504 KeyboardClientProxy.fromEndpoint( | 1503 KeyboardClientProxy.fromEndpoint( |
1505 core.MojoMessagePipeEndpoint endpoint) | 1504 core.MojoMessagePipeEndpoint endpoint) |
1506 : super(new _KeyboardClientProxyControl.fromEndpoint(endpoint)); | 1505 : super(new _KeyboardClientProxyControl.fromEndpoint(endpoint)); |
1507 | 1506 |
1508 KeyboardClientProxy.fromHandle(core.MojoHandle handle) | 1507 KeyboardClientProxy.fromHandle(core.MojoHandle handle) |
1509 : super(new _KeyboardClientProxyControl.fromHandle(handle)); | 1508 : super(new _KeyboardClientProxyControl.fromHandle(handle)); |
1510 | 1509 |
1511 KeyboardClientProxy.unbound() | 1510 KeyboardClientProxy.unbound() |
1512 : super(new _KeyboardClientProxyControl.unbound()); | 1511 : super(new _KeyboardClientProxyControl.unbound()); |
1513 | 1512 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1605 ctrl.proxyError("The Proxy is closed."); | 1604 ctrl.proxyError("The Proxy is closed."); |
1606 return; | 1605 return; |
1607 } | 1606 } |
1608 var params = new _KeyboardClientSubmitParams(); | 1607 var params = new _KeyboardClientSubmitParams(); |
1609 params.action = action; | 1608 params.action = action; |
1610 ctrl.sendMessage(params, | 1609 ctrl.sendMessage(params, |
1611 _keyboardClientMethodSubmitName); | 1610 _keyboardClientMethodSubmitName); |
1612 } | 1611 } |
1613 } | 1612 } |
1614 | 1613 |
1615 | 1614 class _KeyboardClientStubControl |
1616 class KeyboardClientStub extends bindings.Stub { | 1615 extends bindings.StubMessageHandler |
| 1616 implements bindings.StubControl<KeyboardClient> { |
1617 KeyboardClient _impl; | 1617 KeyboardClient _impl; |
1618 | 1618 |
1619 KeyboardClientStub.fromEndpoint( | 1619 _KeyboardClientStubControl.fromEndpoint( |
1620 core.MojoMessagePipeEndpoint endpoint, [KeyboardClient impl]) | 1620 core.MojoMessagePipeEndpoint endpoint, [KeyboardClient impl]) |
1621 : super.fromEndpoint(endpoint, autoBegin: impl != null) { | 1621 : super.fromEndpoint(endpoint, autoBegin: impl != null) { |
1622 _impl = impl; | 1622 _impl = impl; |
1623 } | 1623 } |
1624 | 1624 |
1625 KeyboardClientStub.fromHandle( | 1625 _KeyboardClientStubControl.fromHandle( |
1626 core.MojoHandle handle, [KeyboardClient impl]) | 1626 core.MojoHandle handle, [KeyboardClient impl]) |
1627 : super.fromHandle(handle, autoBegin: impl != null) { | 1627 : super.fromHandle(handle, autoBegin: impl != null) { |
1628 _impl = impl; | 1628 _impl = impl; |
1629 } | 1629 } |
1630 | 1630 |
1631 KeyboardClientStub.unbound([this._impl]) : super.unbound(); | 1631 _KeyboardClientStubControl.unbound([this._impl]) : super.unbound(); |
1632 | |
1633 static KeyboardClientStub newFromEndpoint( | |
1634 core.MojoMessagePipeEndpoint endpoint) { | |
1635 assert(endpoint.setDescription("For KeyboardClientStub")); | |
1636 return new KeyboardClientStub.fromEndpoint(endpoint); | |
1637 } | |
1638 | 1632 |
1639 | 1633 |
1640 | 1634 |
1641 dynamic handleMessage(bindings.ServiceMessage message) { | 1635 dynamic handleMessage(bindings.ServiceMessage message) { |
1642 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 1636 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
1643 return bindings.ControlMessageHandler.handleMessage(this, | 1637 return bindings.ControlMessageHandler.handleMessage(this, |
1644 0, | 1638 0, |
1645 message); | 1639 message); |
1646 } | 1640 } |
1647 if (_impl == null) { | 1641 if (_impl == null) { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1707 } | 1701 } |
1708 | 1702 |
1709 @override | 1703 @override |
1710 void bind(core.MojoMessagePipeEndpoint endpoint) { | 1704 void bind(core.MojoMessagePipeEndpoint endpoint) { |
1711 super.bind(endpoint); | 1705 super.bind(endpoint); |
1712 if (!isOpen && (_impl != null)) { | 1706 if (!isOpen && (_impl != null)) { |
1713 beginHandlingEvents(); | 1707 beginHandlingEvents(); |
1714 } | 1708 } |
1715 } | 1709 } |
1716 | 1710 |
| 1711 @override |
1717 String toString() { | 1712 String toString() { |
1718 var superString = super.toString(); | 1713 var superString = super.toString(); |
1719 return "KeyboardClientStub($superString)"; | 1714 return "_KeyboardClientStubControl($superString)"; |
1720 } | 1715 } |
1721 | 1716 |
1722 int get version => 0; | 1717 int get version => 0; |
1723 | 1718 |
1724 static service_describer.ServiceDescription _cachedServiceDescription; | 1719 static service_describer.ServiceDescription _cachedServiceDescription; |
1725 static service_describer.ServiceDescription get serviceDescription { | 1720 static service_describer.ServiceDescription get serviceDescription { |
1726 if (_cachedServiceDescription == null) { | 1721 if (_cachedServiceDescription == null) { |
1727 _cachedServiceDescription = new _KeyboardClientServiceDescription(); | 1722 _cachedServiceDescription = new _KeyboardClientServiceDescription(); |
1728 } | 1723 } |
1729 return _cachedServiceDescription; | 1724 return _cachedServiceDescription; |
1730 } | 1725 } |
1731 } | 1726 } |
1732 | 1727 |
| 1728 class KeyboardClientStub |
| 1729 extends bindings.Stub<KeyboardClient> |
| 1730 implements KeyboardClient { |
| 1731 KeyboardClientStub.fromEndpoint( |
| 1732 core.MojoMessagePipeEndpoint endpoint, [KeyboardClient impl]) |
| 1733 : super(new _KeyboardClientStubControl.fromEndpoint(endpoint, impl)); |
| 1734 |
| 1735 KeyboardClientStub.fromHandle( |
| 1736 core.MojoHandle handle, [KeyboardClient impl]) |
| 1737 : super(new _KeyboardClientStubControl.fromHandle(handle, impl)); |
| 1738 |
| 1739 KeyboardClientStub.unbound([KeyboardClient impl]) |
| 1740 : super(new _KeyboardClientStubControl.unbound(impl)); |
| 1741 |
| 1742 static KeyboardClientStub newFromEndpoint( |
| 1743 core.MojoMessagePipeEndpoint endpoint) { |
| 1744 assert(endpoint.setDescription("For KeyboardClientStub")); |
| 1745 return new KeyboardClientStub.fromEndpoint(endpoint); |
| 1746 } |
| 1747 |
| 1748 static service_describer.ServiceDescription get serviceDescription => |
| 1749 _KeyboardClientStubControl.serviceDescription; |
| 1750 |
| 1751 |
| 1752 void commitCompletion(CompletionData completion) { |
| 1753 return impl.commitCompletion(completion); |
| 1754 } |
| 1755 void commitCorrection(CorrectionData correction) { |
| 1756 return impl.commitCorrection(correction); |
| 1757 } |
| 1758 void commitText(String text, int newCursorPosition) { |
| 1759 return impl.commitText(text, newCursorPosition); |
| 1760 } |
| 1761 void deleteSurroundingText(int beforeLength, int afterLength) { |
| 1762 return impl.deleteSurroundingText(beforeLength, afterLength); |
| 1763 } |
| 1764 void setComposingRegion(int start, int end) { |
| 1765 return impl.setComposingRegion(start, end); |
| 1766 } |
| 1767 void setComposingText(String text, int newCursorPosition) { |
| 1768 return impl.setComposingText(text, newCursorPosition); |
| 1769 } |
| 1770 void setSelection(int start, int end) { |
| 1771 return impl.setSelection(start, end); |
| 1772 } |
| 1773 void submit(SubmitAction action) { |
| 1774 return impl.submit(action); |
| 1775 } |
| 1776 } |
| 1777 |
1733 const int _keyboardServiceMethodShowName = 0; | 1778 const int _keyboardServiceMethodShowName = 0; |
1734 const int _keyboardServiceMethodShowByRequestName = 1; | 1779 const int _keyboardServiceMethodShowByRequestName = 1; |
1735 const int _keyboardServiceMethodHideName = 2; | 1780 const int _keyboardServiceMethodHideName = 2; |
1736 const int _keyboardServiceMethodSetTextName = 3; | 1781 const int _keyboardServiceMethodSetTextName = 3; |
1737 const int _keyboardServiceMethodSetSelectionName = 4; | 1782 const int _keyboardServiceMethodSetSelectionName = 4; |
1738 | 1783 |
1739 class _KeyboardServiceServiceDescription implements service_describer.ServiceDes
cription { | 1784 class _KeyboardServiceServiceDescription implements service_describer.ServiceDes
cription { |
1740 dynamic getTopLevelInterface([Function responseFactory]) => | 1785 dynamic getTopLevelInterface([Function responseFactory]) => |
1741 responseFactory(null); | 1786 responseFactory(null); |
1742 | 1787 |
1743 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 1788 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => |
1744 responseFactory(null); | 1789 responseFactory(null); |
1745 | 1790 |
1746 dynamic getAllTypeDefinitions([Function responseFactory]) => | 1791 dynamic getAllTypeDefinitions([Function responseFactory]) => |
1747 responseFactory(null); | 1792 responseFactory(null); |
1748 } | 1793 } |
1749 | 1794 |
1750 abstract class KeyboardService { | 1795 abstract class KeyboardService { |
1751 static const String serviceName = "keyboard::KeyboardService"; | 1796 static const String serviceName = "keyboard::KeyboardService"; |
1752 void show(Object client, KeyboardType type); | 1797 void show(Object client, KeyboardType type); |
1753 void showByRequest(); | 1798 void showByRequest(); |
1754 void hide(); | 1799 void hide(); |
1755 void setText(String text); | 1800 void setText(String text); |
1756 void setSelection(int start, int end); | 1801 void setSelection(int start, int end); |
1757 } | 1802 } |
1758 | 1803 |
1759 | 1804 class _KeyboardServiceProxyControl |
1760 class _KeyboardServiceProxyControl extends bindings.ProxyMessageHandler | 1805 extends bindings.ProxyMessageHandler |
1761 implements bindings.ProxyControl { | 1806 implements bindings.ProxyControl { |
1762 _KeyboardServiceProxyControl.fromEndpoint( | 1807 _KeyboardServiceProxyControl.fromEndpoint( |
1763 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 1808 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
1764 | 1809 |
1765 _KeyboardServiceProxyControl.fromHandle( | 1810 _KeyboardServiceProxyControl.fromHandle( |
1766 core.MojoHandle handle) : super.fromHandle(handle); | 1811 core.MojoHandle handle) : super.fromHandle(handle); |
1767 | 1812 |
1768 _KeyboardServiceProxyControl.unbound() : super.unbound(); | 1813 _KeyboardServiceProxyControl.unbound() : super.unbound(); |
1769 | 1814 |
1770 service_describer.ServiceDescription get serviceDescription => | 1815 service_describer.ServiceDescription get serviceDescription => |
1771 new _KeyboardServiceServiceDescription(); | 1816 new _KeyboardServiceServiceDescription(); |
1772 | 1817 |
1773 String get serviceName => KeyboardService.serviceName; | 1818 String get serviceName => KeyboardService.serviceName; |
1774 | 1819 |
1775 @override | |
1776 void handleResponse(bindings.ServiceMessage message) { | 1820 void handleResponse(bindings.ServiceMessage message) { |
1777 switch (message.header.type) { | 1821 switch (message.header.type) { |
1778 default: | 1822 default: |
1779 proxyError("Unexpected message type: ${message.header.type}"); | 1823 proxyError("Unexpected message type: ${message.header.type}"); |
1780 close(immediate: true); | 1824 close(immediate: true); |
1781 break; | 1825 break; |
1782 } | 1826 } |
1783 } | 1827 } |
1784 | 1828 |
1785 @override | 1829 @override |
1786 String toString() { | 1830 String toString() { |
1787 var superString = super.toString(); | 1831 var superString = super.toString(); |
1788 return "_KeyboardServiceProxyControl($superString)"; | 1832 return "_KeyboardServiceProxyControl($superString)"; |
1789 } | 1833 } |
1790 } | 1834 } |
1791 | 1835 |
1792 | 1836 class KeyboardServiceProxy |
1793 class KeyboardServiceProxy extends bindings.Proxy | 1837 extends bindings.Proxy |
1794 implements KeyboardService { | 1838 implements KeyboardService { |
1795 KeyboardServiceProxy.fromEndpoint( | 1839 KeyboardServiceProxy.fromEndpoint( |
1796 core.MojoMessagePipeEndpoint endpoint) | 1840 core.MojoMessagePipeEndpoint endpoint) |
1797 : super(new _KeyboardServiceProxyControl.fromEndpoint(endpoint)); | 1841 : super(new _KeyboardServiceProxyControl.fromEndpoint(endpoint)); |
1798 | 1842 |
1799 KeyboardServiceProxy.fromHandle(core.MojoHandle handle) | 1843 KeyboardServiceProxy.fromHandle(core.MojoHandle handle) |
1800 : super(new _KeyboardServiceProxyControl.fromHandle(handle)); | 1844 : super(new _KeyboardServiceProxyControl.fromHandle(handle)); |
1801 | 1845 |
1802 KeyboardServiceProxy.unbound() | 1846 KeyboardServiceProxy.unbound() |
1803 : super(new _KeyboardServiceProxyControl.unbound()); | 1847 : super(new _KeyboardServiceProxyControl.unbound()); |
1804 | 1848 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1861 return; | 1905 return; |
1862 } | 1906 } |
1863 var params = new _KeyboardServiceSetSelectionParams(); | 1907 var params = new _KeyboardServiceSetSelectionParams(); |
1864 params.start = start; | 1908 params.start = start; |
1865 params.end = end; | 1909 params.end = end; |
1866 ctrl.sendMessage(params, | 1910 ctrl.sendMessage(params, |
1867 _keyboardServiceMethodSetSelectionName); | 1911 _keyboardServiceMethodSetSelectionName); |
1868 } | 1912 } |
1869 } | 1913 } |
1870 | 1914 |
1871 | 1915 class _KeyboardServiceStubControl |
1872 class KeyboardServiceStub extends bindings.Stub { | 1916 extends bindings.StubMessageHandler |
| 1917 implements bindings.StubControl<KeyboardService> { |
1873 KeyboardService _impl; | 1918 KeyboardService _impl; |
1874 | 1919 |
1875 KeyboardServiceStub.fromEndpoint( | 1920 _KeyboardServiceStubControl.fromEndpoint( |
1876 core.MojoMessagePipeEndpoint endpoint, [KeyboardService impl]) | 1921 core.MojoMessagePipeEndpoint endpoint, [KeyboardService impl]) |
1877 : super.fromEndpoint(endpoint, autoBegin: impl != null) { | 1922 : super.fromEndpoint(endpoint, autoBegin: impl != null) { |
1878 _impl = impl; | 1923 _impl = impl; |
1879 } | 1924 } |
1880 | 1925 |
1881 KeyboardServiceStub.fromHandle( | 1926 _KeyboardServiceStubControl.fromHandle( |
1882 core.MojoHandle handle, [KeyboardService impl]) | 1927 core.MojoHandle handle, [KeyboardService impl]) |
1883 : super.fromHandle(handle, autoBegin: impl != null) { | 1928 : super.fromHandle(handle, autoBegin: impl != null) { |
1884 _impl = impl; | 1929 _impl = impl; |
1885 } | 1930 } |
1886 | 1931 |
1887 KeyboardServiceStub.unbound([this._impl]) : super.unbound(); | 1932 _KeyboardServiceStubControl.unbound([this._impl]) : super.unbound(); |
1888 | |
1889 static KeyboardServiceStub newFromEndpoint( | |
1890 core.MojoMessagePipeEndpoint endpoint) { | |
1891 assert(endpoint.setDescription("For KeyboardServiceStub")); | |
1892 return new KeyboardServiceStub.fromEndpoint(endpoint); | |
1893 } | |
1894 | 1933 |
1895 | 1934 |
1896 | 1935 |
1897 dynamic handleMessage(bindings.ServiceMessage message) { | 1936 dynamic handleMessage(bindings.ServiceMessage message) { |
1898 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 1937 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
1899 return bindings.ControlMessageHandler.handleMessage(this, | 1938 return bindings.ControlMessageHandler.handleMessage(this, |
1900 0, | 1939 0, |
1901 message); | 1940 message); |
1902 } | 1941 } |
1903 if (_impl == null) { | 1942 if (_impl == null) { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1944 } | 1983 } |
1945 | 1984 |
1946 @override | 1985 @override |
1947 void bind(core.MojoMessagePipeEndpoint endpoint) { | 1986 void bind(core.MojoMessagePipeEndpoint endpoint) { |
1948 super.bind(endpoint); | 1987 super.bind(endpoint); |
1949 if (!isOpen && (_impl != null)) { | 1988 if (!isOpen && (_impl != null)) { |
1950 beginHandlingEvents(); | 1989 beginHandlingEvents(); |
1951 } | 1990 } |
1952 } | 1991 } |
1953 | 1992 |
| 1993 @override |
1954 String toString() { | 1994 String toString() { |
1955 var superString = super.toString(); | 1995 var superString = super.toString(); |
1956 return "KeyboardServiceStub($superString)"; | 1996 return "_KeyboardServiceStubControl($superString)"; |
1957 } | 1997 } |
1958 | 1998 |
1959 int get version => 0; | 1999 int get version => 0; |
1960 | 2000 |
1961 static service_describer.ServiceDescription _cachedServiceDescription; | 2001 static service_describer.ServiceDescription _cachedServiceDescription; |
1962 static service_describer.ServiceDescription get serviceDescription { | 2002 static service_describer.ServiceDescription get serviceDescription { |
1963 if (_cachedServiceDescription == null) { | 2003 if (_cachedServiceDescription == null) { |
1964 _cachedServiceDescription = new _KeyboardServiceServiceDescription(); | 2004 _cachedServiceDescription = new _KeyboardServiceServiceDescription(); |
1965 } | 2005 } |
1966 return _cachedServiceDescription; | 2006 return _cachedServiceDescription; |
1967 } | 2007 } |
1968 } | 2008 } |
1969 | 2009 |
| 2010 class KeyboardServiceStub |
| 2011 extends bindings.Stub<KeyboardService> |
| 2012 implements KeyboardService { |
| 2013 KeyboardServiceStub.fromEndpoint( |
| 2014 core.MojoMessagePipeEndpoint endpoint, [KeyboardService impl]) |
| 2015 : super(new _KeyboardServiceStubControl.fromEndpoint(endpoint, impl)); |
| 2016 |
| 2017 KeyboardServiceStub.fromHandle( |
| 2018 core.MojoHandle handle, [KeyboardService impl]) |
| 2019 : super(new _KeyboardServiceStubControl.fromHandle(handle, impl)); |
| 2020 |
| 2021 KeyboardServiceStub.unbound([KeyboardService impl]) |
| 2022 : super(new _KeyboardServiceStubControl.unbound(impl)); |
| 2023 |
| 2024 static KeyboardServiceStub newFromEndpoint( |
| 2025 core.MojoMessagePipeEndpoint endpoint) { |
| 2026 assert(endpoint.setDescription("For KeyboardServiceStub")); |
| 2027 return new KeyboardServiceStub.fromEndpoint(endpoint); |
| 2028 } |
| 2029 |
| 2030 static service_describer.ServiceDescription get serviceDescription => |
| 2031 _KeyboardServiceStubControl.serviceDescription; |
| 2032 |
| 2033 |
| 2034 void show(Object client, KeyboardType type) { |
| 2035 return impl.show(client, type); |
| 2036 } |
| 2037 void showByRequest() { |
| 2038 return impl.showByRequest(); |
| 2039 } |
| 2040 void hide() { |
| 2041 return impl.hide(); |
| 2042 } |
| 2043 void setText(String text) { |
| 2044 return impl.setText(text); |
| 2045 } |
| 2046 void setSelection(int start, int end) { |
| 2047 return impl.setSelection(start, end); |
| 2048 } |
| 2049 } |
| 2050 |
1970 const int _keyboardServiceFactoryMethodCreateKeyboardServiceName = 0; | 2051 const int _keyboardServiceFactoryMethodCreateKeyboardServiceName = 0; |
1971 | 2052 |
1972 class _KeyboardServiceFactoryServiceDescription implements service_describer.Ser
viceDescription { | 2053 class _KeyboardServiceFactoryServiceDescription implements service_describer.Ser
viceDescription { |
1973 dynamic getTopLevelInterface([Function responseFactory]) => | 2054 dynamic getTopLevelInterface([Function responseFactory]) => |
1974 responseFactory(null); | 2055 responseFactory(null); |
1975 | 2056 |
1976 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => | 2057 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => |
1977 responseFactory(null); | 2058 responseFactory(null); |
1978 | 2059 |
1979 dynamic getAllTypeDefinitions([Function responseFactory]) => | 2060 dynamic getAllTypeDefinitions([Function responseFactory]) => |
1980 responseFactory(null); | 2061 responseFactory(null); |
1981 } | 2062 } |
1982 | 2063 |
1983 abstract class KeyboardServiceFactory { | 2064 abstract class KeyboardServiceFactory { |
1984 static const String serviceName = "keyboard::KeyboardServiceFactory"; | 2065 static const String serviceName = "keyboard::KeyboardServiceFactory"; |
1985 void createKeyboardService(Object keyEventDispatcher, Object serviceRequest); | 2066 void createKeyboardService(Object keyEventDispatcher, Object serviceRequest); |
1986 } | 2067 } |
1987 | 2068 |
1988 | 2069 class _KeyboardServiceFactoryProxyControl |
1989 class _KeyboardServiceFactoryProxyControl extends bindings.ProxyMessageHandler | 2070 extends bindings.ProxyMessageHandler |
1990 implements bindings.ProxyControl { | 2071 implements bindings.ProxyControl { |
1991 _KeyboardServiceFactoryProxyControl.fromEndpoint( | 2072 _KeyboardServiceFactoryProxyControl.fromEndpoint( |
1992 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 2073 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
1993 | 2074 |
1994 _KeyboardServiceFactoryProxyControl.fromHandle( | 2075 _KeyboardServiceFactoryProxyControl.fromHandle( |
1995 core.MojoHandle handle) : super.fromHandle(handle); | 2076 core.MojoHandle handle) : super.fromHandle(handle); |
1996 | 2077 |
1997 _KeyboardServiceFactoryProxyControl.unbound() : super.unbound(); | 2078 _KeyboardServiceFactoryProxyControl.unbound() : super.unbound(); |
1998 | 2079 |
1999 service_describer.ServiceDescription get serviceDescription => | 2080 service_describer.ServiceDescription get serviceDescription => |
2000 new _KeyboardServiceFactoryServiceDescription(); | 2081 new _KeyboardServiceFactoryServiceDescription(); |
2001 | 2082 |
2002 String get serviceName => KeyboardServiceFactory.serviceName; | 2083 String get serviceName => KeyboardServiceFactory.serviceName; |
2003 | 2084 |
2004 @override | |
2005 void handleResponse(bindings.ServiceMessage message) { | 2085 void handleResponse(bindings.ServiceMessage message) { |
2006 switch (message.header.type) { | 2086 switch (message.header.type) { |
2007 default: | 2087 default: |
2008 proxyError("Unexpected message type: ${message.header.type}"); | 2088 proxyError("Unexpected message type: ${message.header.type}"); |
2009 close(immediate: true); | 2089 close(immediate: true); |
2010 break; | 2090 break; |
2011 } | 2091 } |
2012 } | 2092 } |
2013 | 2093 |
2014 @override | 2094 @override |
2015 String toString() { | 2095 String toString() { |
2016 var superString = super.toString(); | 2096 var superString = super.toString(); |
2017 return "_KeyboardServiceFactoryProxyControl($superString)"; | 2097 return "_KeyboardServiceFactoryProxyControl($superString)"; |
2018 } | 2098 } |
2019 } | 2099 } |
2020 | 2100 |
2021 | 2101 class KeyboardServiceFactoryProxy |
2022 class KeyboardServiceFactoryProxy extends bindings.Proxy | 2102 extends bindings.Proxy |
2023 implements KeyboardServiceFactory { | 2103 implements KeyboardServiceFactory { |
2024 KeyboardServiceFactoryProxy.fromEndpoint( | 2104 KeyboardServiceFactoryProxy.fromEndpoint( |
2025 core.MojoMessagePipeEndpoint endpoint) | 2105 core.MojoMessagePipeEndpoint endpoint) |
2026 : super(new _KeyboardServiceFactoryProxyControl.fromEndpoint(endpoint)); | 2106 : super(new _KeyboardServiceFactoryProxyControl.fromEndpoint(endpoint)); |
2027 | 2107 |
2028 KeyboardServiceFactoryProxy.fromHandle(core.MojoHandle handle) | 2108 KeyboardServiceFactoryProxy.fromHandle(core.MojoHandle handle) |
2029 : super(new _KeyboardServiceFactoryProxyControl.fromHandle(handle)); | 2109 : super(new _KeyboardServiceFactoryProxyControl.fromHandle(handle)); |
2030 | 2110 |
2031 KeyboardServiceFactoryProxy.unbound() | 2111 KeyboardServiceFactoryProxy.unbound() |
2032 : super(new _KeyboardServiceFactoryProxyControl.unbound()); | 2112 : super(new _KeyboardServiceFactoryProxyControl.unbound()); |
2033 | 2113 |
(...skipping 17 matching lines...) Expand all Loading... |
2051 return; | 2131 return; |
2052 } | 2132 } |
2053 var params = new _KeyboardServiceFactoryCreateKeyboardServiceParams(); | 2133 var params = new _KeyboardServiceFactoryCreateKeyboardServiceParams(); |
2054 params.keyEventDispatcher = keyEventDispatcher; | 2134 params.keyEventDispatcher = keyEventDispatcher; |
2055 params.serviceRequest = serviceRequest; | 2135 params.serviceRequest = serviceRequest; |
2056 ctrl.sendMessage(params, | 2136 ctrl.sendMessage(params, |
2057 _keyboardServiceFactoryMethodCreateKeyboardServiceName); | 2137 _keyboardServiceFactoryMethodCreateKeyboardServiceName); |
2058 } | 2138 } |
2059 } | 2139 } |
2060 | 2140 |
2061 | 2141 class _KeyboardServiceFactoryStubControl |
2062 class KeyboardServiceFactoryStub extends bindings.Stub { | 2142 extends bindings.StubMessageHandler |
| 2143 implements bindings.StubControl<KeyboardServiceFactory> { |
2063 KeyboardServiceFactory _impl; | 2144 KeyboardServiceFactory _impl; |
2064 | 2145 |
2065 KeyboardServiceFactoryStub.fromEndpoint( | 2146 _KeyboardServiceFactoryStubControl.fromEndpoint( |
2066 core.MojoMessagePipeEndpoint endpoint, [KeyboardServiceFactory impl]) | 2147 core.MojoMessagePipeEndpoint endpoint, [KeyboardServiceFactory impl]) |
2067 : super.fromEndpoint(endpoint, autoBegin: impl != null) { | 2148 : super.fromEndpoint(endpoint, autoBegin: impl != null) { |
2068 _impl = impl; | 2149 _impl = impl; |
2069 } | 2150 } |
2070 | 2151 |
2071 KeyboardServiceFactoryStub.fromHandle( | 2152 _KeyboardServiceFactoryStubControl.fromHandle( |
2072 core.MojoHandle handle, [KeyboardServiceFactory impl]) | 2153 core.MojoHandle handle, [KeyboardServiceFactory impl]) |
2073 : super.fromHandle(handle, autoBegin: impl != null) { | 2154 : super.fromHandle(handle, autoBegin: impl != null) { |
2074 _impl = impl; | 2155 _impl = impl; |
2075 } | 2156 } |
2076 | 2157 |
2077 KeyboardServiceFactoryStub.unbound([this._impl]) : super.unbound(); | 2158 _KeyboardServiceFactoryStubControl.unbound([this._impl]) : super.unbound(); |
2078 | |
2079 static KeyboardServiceFactoryStub newFromEndpoint( | |
2080 core.MojoMessagePipeEndpoint endpoint) { | |
2081 assert(endpoint.setDescription("For KeyboardServiceFactoryStub")); | |
2082 return new KeyboardServiceFactoryStub.fromEndpoint(endpoint); | |
2083 } | |
2084 | 2159 |
2085 | 2160 |
2086 | 2161 |
2087 dynamic handleMessage(bindings.ServiceMessage message) { | 2162 dynamic handleMessage(bindings.ServiceMessage message) { |
2088 if (bindings.ControlMessageHandler.isControlMessage(message)) { | 2163 if (bindings.ControlMessageHandler.isControlMessage(message)) { |
2089 return bindings.ControlMessageHandler.handleMessage(this, | 2164 return bindings.ControlMessageHandler.handleMessage(this, |
2090 0, | 2165 0, |
2091 message); | 2166 message); |
2092 } | 2167 } |
2093 if (_impl == null) { | 2168 if (_impl == null) { |
(...skipping 24 matching lines...) Expand all Loading... |
2118 } | 2193 } |
2119 | 2194 |
2120 @override | 2195 @override |
2121 void bind(core.MojoMessagePipeEndpoint endpoint) { | 2196 void bind(core.MojoMessagePipeEndpoint endpoint) { |
2122 super.bind(endpoint); | 2197 super.bind(endpoint); |
2123 if (!isOpen && (_impl != null)) { | 2198 if (!isOpen && (_impl != null)) { |
2124 beginHandlingEvents(); | 2199 beginHandlingEvents(); |
2125 } | 2200 } |
2126 } | 2201 } |
2127 | 2202 |
| 2203 @override |
2128 String toString() { | 2204 String toString() { |
2129 var superString = super.toString(); | 2205 var superString = super.toString(); |
2130 return "KeyboardServiceFactoryStub($superString)"; | 2206 return "_KeyboardServiceFactoryStubControl($superString)"; |
2131 } | 2207 } |
2132 | 2208 |
2133 int get version => 0; | 2209 int get version => 0; |
2134 | 2210 |
2135 static service_describer.ServiceDescription _cachedServiceDescription; | 2211 static service_describer.ServiceDescription _cachedServiceDescription; |
2136 static service_describer.ServiceDescription get serviceDescription { | 2212 static service_describer.ServiceDescription get serviceDescription { |
2137 if (_cachedServiceDescription == null) { | 2213 if (_cachedServiceDescription == null) { |
2138 _cachedServiceDescription = new _KeyboardServiceFactoryServiceDescription(
); | 2214 _cachedServiceDescription = new _KeyboardServiceFactoryServiceDescription(
); |
2139 } | 2215 } |
2140 return _cachedServiceDescription; | 2216 return _cachedServiceDescription; |
2141 } | 2217 } |
2142 } | 2218 } |
2143 | 2219 |
| 2220 class KeyboardServiceFactoryStub |
| 2221 extends bindings.Stub<KeyboardServiceFactory> |
| 2222 implements KeyboardServiceFactory { |
| 2223 KeyboardServiceFactoryStub.fromEndpoint( |
| 2224 core.MojoMessagePipeEndpoint endpoint, [KeyboardServiceFactory impl]) |
| 2225 : super(new _KeyboardServiceFactoryStubControl.fromEndpoint(endpoint, impl
)); |
| 2226 |
| 2227 KeyboardServiceFactoryStub.fromHandle( |
| 2228 core.MojoHandle handle, [KeyboardServiceFactory impl]) |
| 2229 : super(new _KeyboardServiceFactoryStubControl.fromHandle(handle, impl)); |
| 2230 |
| 2231 KeyboardServiceFactoryStub.unbound([KeyboardServiceFactory impl]) |
| 2232 : super(new _KeyboardServiceFactoryStubControl.unbound(impl)); |
| 2233 |
| 2234 static KeyboardServiceFactoryStub newFromEndpoint( |
| 2235 core.MojoMessagePipeEndpoint endpoint) { |
| 2236 assert(endpoint.setDescription("For KeyboardServiceFactoryStub")); |
| 2237 return new KeyboardServiceFactoryStub.fromEndpoint(endpoint); |
| 2238 } |
| 2239 |
| 2240 static service_describer.ServiceDescription get serviceDescription => |
| 2241 _KeyboardServiceFactoryStubControl.serviceDescription; |
| 2242 |
| 2243 |
| 2244 void createKeyboardService(Object keyEventDispatcher, Object serviceRequest) { |
| 2245 return impl.createKeyboardService(keyEventDispatcher, serviceRequest); |
| 2246 } |
| 2247 } |
| 2248 |
2144 | 2249 |
2145 | 2250 |
OLD | NEW |