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 1448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
1469 class _KeyboardClientProxyImpl extends bindings.Proxy { | 1469 class _KeyboardClientProxyControl extends bindings.ProxyMessageHandler |
1470 _KeyboardClientProxyImpl.fromEndpoint( | 1470 implements bindings.ProxyControl { |
| 1471 _KeyboardClientProxyControl.fromEndpoint( |
1471 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 1472 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
1472 | 1473 |
1473 _KeyboardClientProxyImpl.fromHandle(core.MojoHandle handle) : | 1474 _KeyboardClientProxyControl.fromHandle( |
1474 super.fromHandle(handle); | 1475 core.MojoHandle handle) : super.fromHandle(handle); |
1475 | 1476 |
1476 _KeyboardClientProxyImpl.unbound() : super.unbound(); | 1477 _KeyboardClientProxyControl.unbound() : super.unbound(); |
1477 | |
1478 static _KeyboardClientProxyImpl newFromEndpoint( | |
1479 core.MojoMessagePipeEndpoint endpoint) { | |
1480 assert(endpoint.setDescription("For _KeyboardClientProxyImpl")); | |
1481 return new _KeyboardClientProxyImpl.fromEndpoint(endpoint); | |
1482 } | |
1483 | 1478 |
1484 service_describer.ServiceDescription get serviceDescription => | 1479 service_describer.ServiceDescription get serviceDescription => |
1485 new _KeyboardClientServiceDescription(); | 1480 new _KeyboardClientServiceDescription(); |
1486 | 1481 |
| 1482 String get serviceName => KeyboardClient.serviceName; |
| 1483 |
| 1484 @override |
1487 void handleResponse(bindings.ServiceMessage message) { | 1485 void handleResponse(bindings.ServiceMessage message) { |
1488 switch (message.header.type) { | 1486 switch (message.header.type) { |
1489 default: | 1487 default: |
1490 proxyError("Unexpected message type: ${message.header.type}"); | 1488 proxyError("Unexpected message type: ${message.header.type}"); |
1491 close(immediate: true); | 1489 close(immediate: true); |
1492 break; | 1490 break; |
1493 } | 1491 } |
1494 } | 1492 } |
1495 | 1493 |
| 1494 @override |
1496 String toString() { | 1495 String toString() { |
1497 var superString = super.toString(); | 1496 var superString = super.toString(); |
1498 return "_KeyboardClientProxyImpl($superString)"; | 1497 return "_KeyboardClientProxyControl($superString)"; |
1499 } | 1498 } |
1500 } | 1499 } |
1501 | 1500 |
1502 | 1501 |
1503 class _KeyboardClientProxyCalls implements KeyboardClient { | 1502 class KeyboardClientProxy extends bindings.Proxy |
1504 _KeyboardClientProxyImpl _proxyImpl; | 1503 implements KeyboardClient { |
| 1504 KeyboardClientProxy.fromEndpoint( |
| 1505 core.MojoMessagePipeEndpoint endpoint) |
| 1506 : super(new _KeyboardClientProxyControl.fromEndpoint(endpoint)); |
1505 | 1507 |
1506 _KeyboardClientProxyCalls(this._proxyImpl); | 1508 KeyboardClientProxy.fromHandle(core.MojoHandle handle) |
1507 void commitCompletion(CompletionData completion) { | 1509 : super(new _KeyboardClientProxyControl.fromHandle(handle)); |
1508 if (!_proxyImpl.isBound) { | |
1509 _proxyImpl.proxyError("The Proxy is closed."); | |
1510 return; | |
1511 } | |
1512 var params = new _KeyboardClientCommitCompletionParams(); | |
1513 params.completion = completion; | |
1514 _proxyImpl.sendMessage(params, _keyboardClientMethodCommitCompletionName); | |
1515 } | |
1516 void commitCorrection(CorrectionData correction) { | |
1517 if (!_proxyImpl.isBound) { | |
1518 _proxyImpl.proxyError("The Proxy is closed."); | |
1519 return; | |
1520 } | |
1521 var params = new _KeyboardClientCommitCorrectionParams(); | |
1522 params.correction = correction; | |
1523 _proxyImpl.sendMessage(params, _keyboardClientMethodCommitCorrectionName); | |
1524 } | |
1525 void commitText(String text, int newCursorPosition) { | |
1526 if (!_proxyImpl.isBound) { | |
1527 _proxyImpl.proxyError("The Proxy is closed."); | |
1528 return; | |
1529 } | |
1530 var params = new _KeyboardClientCommitTextParams(); | |
1531 params.text = text; | |
1532 params.newCursorPosition = newCursorPosition; | |
1533 _proxyImpl.sendMessage(params, _keyboardClientMethodCommitTextName); | |
1534 } | |
1535 void deleteSurroundingText(int beforeLength, int afterLength) { | |
1536 if (!_proxyImpl.isBound) { | |
1537 _proxyImpl.proxyError("The Proxy is closed."); | |
1538 return; | |
1539 } | |
1540 var params = new _KeyboardClientDeleteSurroundingTextParams(); | |
1541 params.beforeLength = beforeLength; | |
1542 params.afterLength = afterLength; | |
1543 _proxyImpl.sendMessage(params, _keyboardClientMethodDeleteSurroundingTextN
ame); | |
1544 } | |
1545 void setComposingRegion(int start, int end) { | |
1546 if (!_proxyImpl.isBound) { | |
1547 _proxyImpl.proxyError("The Proxy is closed."); | |
1548 return; | |
1549 } | |
1550 var params = new _KeyboardClientSetComposingRegionParams(); | |
1551 params.start = start; | |
1552 params.end = end; | |
1553 _proxyImpl.sendMessage(params, _keyboardClientMethodSetComposingRegionName
); | |
1554 } | |
1555 void setComposingText(String text, int newCursorPosition) { | |
1556 if (!_proxyImpl.isBound) { | |
1557 _proxyImpl.proxyError("The Proxy is closed."); | |
1558 return; | |
1559 } | |
1560 var params = new _KeyboardClientSetComposingTextParams(); | |
1561 params.text = text; | |
1562 params.newCursorPosition = newCursorPosition; | |
1563 _proxyImpl.sendMessage(params, _keyboardClientMethodSetComposingTextName); | |
1564 } | |
1565 void setSelection(int start, int end) { | |
1566 if (!_proxyImpl.isBound) { | |
1567 _proxyImpl.proxyError("The Proxy is closed."); | |
1568 return; | |
1569 } | |
1570 var params = new _KeyboardClientSetSelectionParams(); | |
1571 params.start = start; | |
1572 params.end = end; | |
1573 _proxyImpl.sendMessage(params, _keyboardClientMethodSetSelectionName); | |
1574 } | |
1575 void submit(SubmitAction action) { | |
1576 if (!_proxyImpl.isBound) { | |
1577 _proxyImpl.proxyError("The Proxy is closed."); | |
1578 return; | |
1579 } | |
1580 var params = new _KeyboardClientSubmitParams(); | |
1581 params.action = action; | |
1582 _proxyImpl.sendMessage(params, _keyboardClientMethodSubmitName); | |
1583 } | |
1584 } | |
1585 | 1510 |
| 1511 KeyboardClientProxy.unbound() |
| 1512 : super(new _KeyboardClientProxyControl.unbound()); |
1586 | 1513 |
1587 class KeyboardClientProxy implements bindings.ProxyBase { | 1514 static KeyboardClientProxy newFromEndpoint( |
1588 final bindings.Proxy impl; | 1515 core.MojoMessagePipeEndpoint endpoint) { |
1589 KeyboardClient ptr; | 1516 assert(endpoint.setDescription("For KeyboardClientProxy")); |
1590 | 1517 return new KeyboardClientProxy.fromEndpoint(endpoint); |
1591 KeyboardClientProxy(_KeyboardClientProxyImpl proxyImpl) : | |
1592 impl = proxyImpl, | |
1593 ptr = new _KeyboardClientProxyCalls(proxyImpl); | |
1594 | |
1595 KeyboardClientProxy.fromEndpoint( | |
1596 core.MojoMessagePipeEndpoint endpoint) : | |
1597 impl = new _KeyboardClientProxyImpl.fromEndpoint(endpoint) { | |
1598 ptr = new _KeyboardClientProxyCalls(impl); | |
1599 } | |
1600 | |
1601 KeyboardClientProxy.fromHandle(core.MojoHandle handle) : | |
1602 impl = new _KeyboardClientProxyImpl.fromHandle(handle) { | |
1603 ptr = new _KeyboardClientProxyCalls(impl); | |
1604 } | |
1605 | |
1606 KeyboardClientProxy.unbound() : | |
1607 impl = new _KeyboardClientProxyImpl.unbound() { | |
1608 ptr = new _KeyboardClientProxyCalls(impl); | |
1609 } | 1518 } |
1610 | 1519 |
1611 factory KeyboardClientProxy.connectToService( | 1520 factory KeyboardClientProxy.connectToService( |
1612 bindings.ServiceConnector s, String url, [String serviceName]) { | 1521 bindings.ServiceConnector s, String url, [String serviceName]) { |
1613 KeyboardClientProxy p = new KeyboardClientProxy.unbound(); | 1522 KeyboardClientProxy p = new KeyboardClientProxy.unbound(); |
1614 s.connectToService(url, p, serviceName); | 1523 s.connectToService(url, p, serviceName); |
1615 return p; | 1524 return p; |
1616 } | 1525 } |
1617 | 1526 |
1618 static KeyboardClientProxy newFromEndpoint( | 1527 |
1619 core.MojoMessagePipeEndpoint endpoint) { | 1528 void commitCompletion(CompletionData completion) { |
1620 assert(endpoint.setDescription("For KeyboardClientProxy")); | 1529 if (!ctrl.isBound) { |
1621 return new KeyboardClientProxy.fromEndpoint(endpoint); | 1530 ctrl.proxyError("The Proxy is closed."); |
| 1531 return; |
| 1532 } |
| 1533 var params = new _KeyboardClientCommitCompletionParams(); |
| 1534 params.completion = completion; |
| 1535 ctrl.sendMessage(params, |
| 1536 _keyboardClientMethodCommitCompletionName); |
1622 } | 1537 } |
1623 | 1538 void commitCorrection(CorrectionData correction) { |
1624 String get serviceName => KeyboardClient.serviceName; | 1539 if (!ctrl.isBound) { |
1625 | 1540 ctrl.proxyError("The Proxy is closed."); |
1626 Future close({bool immediate: false}) => impl.close(immediate: immediate); | 1541 return; |
1627 | 1542 } |
1628 Future responseOrError(Future f) => impl.responseOrError(f); | 1543 var params = new _KeyboardClientCommitCorrectionParams(); |
1629 | 1544 params.correction = correction; |
1630 Future get errorFuture => impl.errorFuture; | 1545 ctrl.sendMessage(params, |
1631 | 1546 _keyboardClientMethodCommitCorrectionName); |
1632 int get version => impl.version; | |
1633 | |
1634 Future<int> queryVersion() => impl.queryVersion(); | |
1635 | |
1636 void requireVersion(int requiredVersion) { | |
1637 impl.requireVersion(requiredVersion); | |
1638 } | 1547 } |
1639 | 1548 void commitText(String text, int newCursorPosition) { |
1640 String toString() { | 1549 if (!ctrl.isBound) { |
1641 return "KeyboardClientProxy($impl)"; | 1550 ctrl.proxyError("The Proxy is closed."); |
| 1551 return; |
| 1552 } |
| 1553 var params = new _KeyboardClientCommitTextParams(); |
| 1554 params.text = text; |
| 1555 params.newCursorPosition = newCursorPosition; |
| 1556 ctrl.sendMessage(params, |
| 1557 _keyboardClientMethodCommitTextName); |
| 1558 } |
| 1559 void deleteSurroundingText(int beforeLength, int afterLength) { |
| 1560 if (!ctrl.isBound) { |
| 1561 ctrl.proxyError("The Proxy is closed."); |
| 1562 return; |
| 1563 } |
| 1564 var params = new _KeyboardClientDeleteSurroundingTextParams(); |
| 1565 params.beforeLength = beforeLength; |
| 1566 params.afterLength = afterLength; |
| 1567 ctrl.sendMessage(params, |
| 1568 _keyboardClientMethodDeleteSurroundingTextName); |
| 1569 } |
| 1570 void setComposingRegion(int start, int end) { |
| 1571 if (!ctrl.isBound) { |
| 1572 ctrl.proxyError("The Proxy is closed."); |
| 1573 return; |
| 1574 } |
| 1575 var params = new _KeyboardClientSetComposingRegionParams(); |
| 1576 params.start = start; |
| 1577 params.end = end; |
| 1578 ctrl.sendMessage(params, |
| 1579 _keyboardClientMethodSetComposingRegionName); |
| 1580 } |
| 1581 void setComposingText(String text, int newCursorPosition) { |
| 1582 if (!ctrl.isBound) { |
| 1583 ctrl.proxyError("The Proxy is closed."); |
| 1584 return; |
| 1585 } |
| 1586 var params = new _KeyboardClientSetComposingTextParams(); |
| 1587 params.text = text; |
| 1588 params.newCursorPosition = newCursorPosition; |
| 1589 ctrl.sendMessage(params, |
| 1590 _keyboardClientMethodSetComposingTextName); |
| 1591 } |
| 1592 void setSelection(int start, int end) { |
| 1593 if (!ctrl.isBound) { |
| 1594 ctrl.proxyError("The Proxy is closed."); |
| 1595 return; |
| 1596 } |
| 1597 var params = new _KeyboardClientSetSelectionParams(); |
| 1598 params.start = start; |
| 1599 params.end = end; |
| 1600 ctrl.sendMessage(params, |
| 1601 _keyboardClientMethodSetSelectionName); |
| 1602 } |
| 1603 void submit(SubmitAction action) { |
| 1604 if (!ctrl.isBound) { |
| 1605 ctrl.proxyError("The Proxy is closed."); |
| 1606 return; |
| 1607 } |
| 1608 var params = new _KeyboardClientSubmitParams(); |
| 1609 params.action = action; |
| 1610 ctrl.sendMessage(params, |
| 1611 _keyboardClientMethodSubmitName); |
1642 } | 1612 } |
1643 } | 1613 } |
1644 | 1614 |
1645 | 1615 |
1646 class KeyboardClientStub extends bindings.Stub { | 1616 class KeyboardClientStub extends bindings.Stub { |
1647 KeyboardClient _impl; | 1617 KeyboardClient _impl; |
1648 | 1618 |
1649 KeyboardClientStub.fromEndpoint( | 1619 KeyboardClientStub.fromEndpoint( |
1650 core.MojoMessagePipeEndpoint endpoint, [KeyboardClient impl]) | 1620 core.MojoMessagePipeEndpoint endpoint, [KeyboardClient impl]) |
1651 : super.fromEndpoint(endpoint, autoBegin: impl != null) { | 1621 : super.fromEndpoint(endpoint, autoBegin: impl != null) { |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1780 abstract class KeyboardService { | 1750 abstract class KeyboardService { |
1781 static const String serviceName = "keyboard::KeyboardService"; | 1751 static const String serviceName = "keyboard::KeyboardService"; |
1782 void show(Object client, KeyboardType type); | 1752 void show(Object client, KeyboardType type); |
1783 void showByRequest(); | 1753 void showByRequest(); |
1784 void hide(); | 1754 void hide(); |
1785 void setText(String text); | 1755 void setText(String text); |
1786 void setSelection(int start, int end); | 1756 void setSelection(int start, int end); |
1787 } | 1757 } |
1788 | 1758 |
1789 | 1759 |
1790 class _KeyboardServiceProxyImpl extends bindings.Proxy { | 1760 class _KeyboardServiceProxyControl extends bindings.ProxyMessageHandler |
1791 _KeyboardServiceProxyImpl.fromEndpoint( | 1761 implements bindings.ProxyControl { |
| 1762 _KeyboardServiceProxyControl.fromEndpoint( |
1792 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 1763 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
1793 | 1764 |
1794 _KeyboardServiceProxyImpl.fromHandle(core.MojoHandle handle) : | 1765 _KeyboardServiceProxyControl.fromHandle( |
1795 super.fromHandle(handle); | 1766 core.MojoHandle handle) : super.fromHandle(handle); |
1796 | 1767 |
1797 _KeyboardServiceProxyImpl.unbound() : super.unbound(); | 1768 _KeyboardServiceProxyControl.unbound() : super.unbound(); |
1798 | |
1799 static _KeyboardServiceProxyImpl newFromEndpoint( | |
1800 core.MojoMessagePipeEndpoint endpoint) { | |
1801 assert(endpoint.setDescription("For _KeyboardServiceProxyImpl")); | |
1802 return new _KeyboardServiceProxyImpl.fromEndpoint(endpoint); | |
1803 } | |
1804 | 1769 |
1805 service_describer.ServiceDescription get serviceDescription => | 1770 service_describer.ServiceDescription get serviceDescription => |
1806 new _KeyboardServiceServiceDescription(); | 1771 new _KeyboardServiceServiceDescription(); |
1807 | 1772 |
| 1773 String get serviceName => KeyboardService.serviceName; |
| 1774 |
| 1775 @override |
1808 void handleResponse(bindings.ServiceMessage message) { | 1776 void handleResponse(bindings.ServiceMessage message) { |
1809 switch (message.header.type) { | 1777 switch (message.header.type) { |
1810 default: | 1778 default: |
1811 proxyError("Unexpected message type: ${message.header.type}"); | 1779 proxyError("Unexpected message type: ${message.header.type}"); |
1812 close(immediate: true); | 1780 close(immediate: true); |
1813 break; | 1781 break; |
1814 } | 1782 } |
1815 } | 1783 } |
1816 | 1784 |
| 1785 @override |
1817 String toString() { | 1786 String toString() { |
1818 var superString = super.toString(); | 1787 var superString = super.toString(); |
1819 return "_KeyboardServiceProxyImpl($superString)"; | 1788 return "_KeyboardServiceProxyControl($superString)"; |
1820 } | 1789 } |
1821 } | 1790 } |
1822 | 1791 |
1823 | 1792 |
1824 class _KeyboardServiceProxyCalls implements KeyboardService { | 1793 class KeyboardServiceProxy extends bindings.Proxy |
1825 _KeyboardServiceProxyImpl _proxyImpl; | 1794 implements KeyboardService { |
| 1795 KeyboardServiceProxy.fromEndpoint( |
| 1796 core.MojoMessagePipeEndpoint endpoint) |
| 1797 : super(new _KeyboardServiceProxyControl.fromEndpoint(endpoint)); |
1826 | 1798 |
1827 _KeyboardServiceProxyCalls(this._proxyImpl); | 1799 KeyboardServiceProxy.fromHandle(core.MojoHandle handle) |
1828 void show(Object client, KeyboardType type) { | 1800 : super(new _KeyboardServiceProxyControl.fromHandle(handle)); |
1829 if (!_proxyImpl.isBound) { | |
1830 _proxyImpl.proxyError("The Proxy is closed."); | |
1831 return; | |
1832 } | |
1833 var params = new _KeyboardServiceShowParams(); | |
1834 params.client = client; | |
1835 params.type = type; | |
1836 _proxyImpl.sendMessage(params, _keyboardServiceMethodShowName); | |
1837 } | |
1838 void showByRequest() { | |
1839 if (!_proxyImpl.isBound) { | |
1840 _proxyImpl.proxyError("The Proxy is closed."); | |
1841 return; | |
1842 } | |
1843 var params = new _KeyboardServiceShowByRequestParams(); | |
1844 _proxyImpl.sendMessage(params, _keyboardServiceMethodShowByRequestName); | |
1845 } | |
1846 void hide() { | |
1847 if (!_proxyImpl.isBound) { | |
1848 _proxyImpl.proxyError("The Proxy is closed."); | |
1849 return; | |
1850 } | |
1851 var params = new _KeyboardServiceHideParams(); | |
1852 _proxyImpl.sendMessage(params, _keyboardServiceMethodHideName); | |
1853 } | |
1854 void setText(String text) { | |
1855 if (!_proxyImpl.isBound) { | |
1856 _proxyImpl.proxyError("The Proxy is closed."); | |
1857 return; | |
1858 } | |
1859 var params = new _KeyboardServiceSetTextParams(); | |
1860 params.text = text; | |
1861 _proxyImpl.sendMessage(params, _keyboardServiceMethodSetTextName); | |
1862 } | |
1863 void setSelection(int start, int end) { | |
1864 if (!_proxyImpl.isBound) { | |
1865 _proxyImpl.proxyError("The Proxy is closed."); | |
1866 return; | |
1867 } | |
1868 var params = new _KeyboardServiceSetSelectionParams(); | |
1869 params.start = start; | |
1870 params.end = end; | |
1871 _proxyImpl.sendMessage(params, _keyboardServiceMethodSetSelectionName); | |
1872 } | |
1873 } | |
1874 | 1801 |
| 1802 KeyboardServiceProxy.unbound() |
| 1803 : super(new _KeyboardServiceProxyControl.unbound()); |
1875 | 1804 |
1876 class KeyboardServiceProxy implements bindings.ProxyBase { | 1805 static KeyboardServiceProxy newFromEndpoint( |
1877 final bindings.Proxy impl; | 1806 core.MojoMessagePipeEndpoint endpoint) { |
1878 KeyboardService ptr; | 1807 assert(endpoint.setDescription("For KeyboardServiceProxy")); |
1879 | 1808 return new KeyboardServiceProxy.fromEndpoint(endpoint); |
1880 KeyboardServiceProxy(_KeyboardServiceProxyImpl proxyImpl) : | |
1881 impl = proxyImpl, | |
1882 ptr = new _KeyboardServiceProxyCalls(proxyImpl); | |
1883 | |
1884 KeyboardServiceProxy.fromEndpoint( | |
1885 core.MojoMessagePipeEndpoint endpoint) : | |
1886 impl = new _KeyboardServiceProxyImpl.fromEndpoint(endpoint) { | |
1887 ptr = new _KeyboardServiceProxyCalls(impl); | |
1888 } | |
1889 | |
1890 KeyboardServiceProxy.fromHandle(core.MojoHandle handle) : | |
1891 impl = new _KeyboardServiceProxyImpl.fromHandle(handle) { | |
1892 ptr = new _KeyboardServiceProxyCalls(impl); | |
1893 } | |
1894 | |
1895 KeyboardServiceProxy.unbound() : | |
1896 impl = new _KeyboardServiceProxyImpl.unbound() { | |
1897 ptr = new _KeyboardServiceProxyCalls(impl); | |
1898 } | 1809 } |
1899 | 1810 |
1900 factory KeyboardServiceProxy.connectToService( | 1811 factory KeyboardServiceProxy.connectToService( |
1901 bindings.ServiceConnector s, String url, [String serviceName]) { | 1812 bindings.ServiceConnector s, String url, [String serviceName]) { |
1902 KeyboardServiceProxy p = new KeyboardServiceProxy.unbound(); | 1813 KeyboardServiceProxy p = new KeyboardServiceProxy.unbound(); |
1903 s.connectToService(url, p, serviceName); | 1814 s.connectToService(url, p, serviceName); |
1904 return p; | 1815 return p; |
1905 } | 1816 } |
1906 | 1817 |
1907 static KeyboardServiceProxy newFromEndpoint( | 1818 |
1908 core.MojoMessagePipeEndpoint endpoint) { | 1819 void show(Object client, KeyboardType type) { |
1909 assert(endpoint.setDescription("For KeyboardServiceProxy")); | 1820 if (!ctrl.isBound) { |
1910 return new KeyboardServiceProxy.fromEndpoint(endpoint); | 1821 ctrl.proxyError("The Proxy is closed."); |
| 1822 return; |
| 1823 } |
| 1824 var params = new _KeyboardServiceShowParams(); |
| 1825 params.client = client; |
| 1826 params.type = type; |
| 1827 ctrl.sendMessage(params, |
| 1828 _keyboardServiceMethodShowName); |
1911 } | 1829 } |
1912 | 1830 void showByRequest() { |
1913 String get serviceName => KeyboardService.serviceName; | 1831 if (!ctrl.isBound) { |
1914 | 1832 ctrl.proxyError("The Proxy is closed."); |
1915 Future close({bool immediate: false}) => impl.close(immediate: immediate); | 1833 return; |
1916 | 1834 } |
1917 Future responseOrError(Future f) => impl.responseOrError(f); | 1835 var params = new _KeyboardServiceShowByRequestParams(); |
1918 | 1836 ctrl.sendMessage(params, |
1919 Future get errorFuture => impl.errorFuture; | 1837 _keyboardServiceMethodShowByRequestName); |
1920 | |
1921 int get version => impl.version; | |
1922 | |
1923 Future<int> queryVersion() => impl.queryVersion(); | |
1924 | |
1925 void requireVersion(int requiredVersion) { | |
1926 impl.requireVersion(requiredVersion); | |
1927 } | 1838 } |
1928 | 1839 void hide() { |
1929 String toString() { | 1840 if (!ctrl.isBound) { |
1930 return "KeyboardServiceProxy($impl)"; | 1841 ctrl.proxyError("The Proxy is closed."); |
| 1842 return; |
| 1843 } |
| 1844 var params = new _KeyboardServiceHideParams(); |
| 1845 ctrl.sendMessage(params, |
| 1846 _keyboardServiceMethodHideName); |
| 1847 } |
| 1848 void setText(String text) { |
| 1849 if (!ctrl.isBound) { |
| 1850 ctrl.proxyError("The Proxy is closed."); |
| 1851 return; |
| 1852 } |
| 1853 var params = new _KeyboardServiceSetTextParams(); |
| 1854 params.text = text; |
| 1855 ctrl.sendMessage(params, |
| 1856 _keyboardServiceMethodSetTextName); |
| 1857 } |
| 1858 void setSelection(int start, int end) { |
| 1859 if (!ctrl.isBound) { |
| 1860 ctrl.proxyError("The Proxy is closed."); |
| 1861 return; |
| 1862 } |
| 1863 var params = new _KeyboardServiceSetSelectionParams(); |
| 1864 params.start = start; |
| 1865 params.end = end; |
| 1866 ctrl.sendMessage(params, |
| 1867 _keyboardServiceMethodSetSelectionName); |
1931 } | 1868 } |
1932 } | 1869 } |
1933 | 1870 |
1934 | 1871 |
1935 class KeyboardServiceStub extends bindings.Stub { | 1872 class KeyboardServiceStub extends bindings.Stub { |
1936 KeyboardService _impl; | 1873 KeyboardService _impl; |
1937 | 1874 |
1938 KeyboardServiceStub.fromEndpoint( | 1875 KeyboardServiceStub.fromEndpoint( |
1939 core.MojoMessagePipeEndpoint endpoint, [KeyboardService impl]) | 1876 core.MojoMessagePipeEndpoint endpoint, [KeyboardService impl]) |
1940 : super.fromEndpoint(endpoint, autoBegin: impl != null) { | 1877 : super.fromEndpoint(endpoint, autoBegin: impl != null) { |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2042 dynamic getAllTypeDefinitions([Function responseFactory]) => | 1979 dynamic getAllTypeDefinitions([Function responseFactory]) => |
2043 responseFactory(null); | 1980 responseFactory(null); |
2044 } | 1981 } |
2045 | 1982 |
2046 abstract class KeyboardServiceFactory { | 1983 abstract class KeyboardServiceFactory { |
2047 static const String serviceName = "keyboard::KeyboardServiceFactory"; | 1984 static const String serviceName = "keyboard::KeyboardServiceFactory"; |
2048 void createKeyboardService(Object keyEventDispatcher, Object serviceRequest); | 1985 void createKeyboardService(Object keyEventDispatcher, Object serviceRequest); |
2049 } | 1986 } |
2050 | 1987 |
2051 | 1988 |
2052 class _KeyboardServiceFactoryProxyImpl extends bindings.Proxy { | 1989 class _KeyboardServiceFactoryProxyControl extends bindings.ProxyMessageHandler |
2053 _KeyboardServiceFactoryProxyImpl.fromEndpoint( | 1990 implements bindings.ProxyControl { |
| 1991 _KeyboardServiceFactoryProxyControl.fromEndpoint( |
2054 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); | 1992 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
2055 | 1993 |
2056 _KeyboardServiceFactoryProxyImpl.fromHandle(core.MojoHandle handle) : | 1994 _KeyboardServiceFactoryProxyControl.fromHandle( |
2057 super.fromHandle(handle); | 1995 core.MojoHandle handle) : super.fromHandle(handle); |
2058 | 1996 |
2059 _KeyboardServiceFactoryProxyImpl.unbound() : super.unbound(); | 1997 _KeyboardServiceFactoryProxyControl.unbound() : super.unbound(); |
2060 | |
2061 static _KeyboardServiceFactoryProxyImpl newFromEndpoint( | |
2062 core.MojoMessagePipeEndpoint endpoint) { | |
2063 assert(endpoint.setDescription("For _KeyboardServiceFactoryProxyImpl")); | |
2064 return new _KeyboardServiceFactoryProxyImpl.fromEndpoint(endpoint); | |
2065 } | |
2066 | 1998 |
2067 service_describer.ServiceDescription get serviceDescription => | 1999 service_describer.ServiceDescription get serviceDescription => |
2068 new _KeyboardServiceFactoryServiceDescription(); | 2000 new _KeyboardServiceFactoryServiceDescription(); |
2069 | 2001 |
| 2002 String get serviceName => KeyboardServiceFactory.serviceName; |
| 2003 |
| 2004 @override |
2070 void handleResponse(bindings.ServiceMessage message) { | 2005 void handleResponse(bindings.ServiceMessage message) { |
2071 switch (message.header.type) { | 2006 switch (message.header.type) { |
2072 default: | 2007 default: |
2073 proxyError("Unexpected message type: ${message.header.type}"); | 2008 proxyError("Unexpected message type: ${message.header.type}"); |
2074 close(immediate: true); | 2009 close(immediate: true); |
2075 break; | 2010 break; |
2076 } | 2011 } |
2077 } | 2012 } |
2078 | 2013 |
| 2014 @override |
2079 String toString() { | 2015 String toString() { |
2080 var superString = super.toString(); | 2016 var superString = super.toString(); |
2081 return "_KeyboardServiceFactoryProxyImpl($superString)"; | 2017 return "_KeyboardServiceFactoryProxyControl($superString)"; |
2082 } | 2018 } |
2083 } | 2019 } |
2084 | 2020 |
2085 | 2021 |
2086 class _KeyboardServiceFactoryProxyCalls implements KeyboardServiceFactory { | 2022 class KeyboardServiceFactoryProxy extends bindings.Proxy |
2087 _KeyboardServiceFactoryProxyImpl _proxyImpl; | 2023 implements KeyboardServiceFactory { |
| 2024 KeyboardServiceFactoryProxy.fromEndpoint( |
| 2025 core.MojoMessagePipeEndpoint endpoint) |
| 2026 : super(new _KeyboardServiceFactoryProxyControl.fromEndpoint(endpoint)); |
2088 | 2027 |
2089 _KeyboardServiceFactoryProxyCalls(this._proxyImpl); | 2028 KeyboardServiceFactoryProxy.fromHandle(core.MojoHandle handle) |
2090 void createKeyboardService(Object keyEventDispatcher, Object serviceRequest)
{ | 2029 : super(new _KeyboardServiceFactoryProxyControl.fromHandle(handle)); |
2091 if (!_proxyImpl.isBound) { | |
2092 _proxyImpl.proxyError("The Proxy is closed."); | |
2093 return; | |
2094 } | |
2095 var params = new _KeyboardServiceFactoryCreateKeyboardServiceParams(); | |
2096 params.keyEventDispatcher = keyEventDispatcher; | |
2097 params.serviceRequest = serviceRequest; | |
2098 _proxyImpl.sendMessage(params, _keyboardServiceFactoryMethodCreateKeyboard
ServiceName); | |
2099 } | |
2100 } | |
2101 | 2030 |
| 2031 KeyboardServiceFactoryProxy.unbound() |
| 2032 : super(new _KeyboardServiceFactoryProxyControl.unbound()); |
2102 | 2033 |
2103 class KeyboardServiceFactoryProxy implements bindings.ProxyBase { | 2034 static KeyboardServiceFactoryProxy newFromEndpoint( |
2104 final bindings.Proxy impl; | 2035 core.MojoMessagePipeEndpoint endpoint) { |
2105 KeyboardServiceFactory ptr; | 2036 assert(endpoint.setDescription("For KeyboardServiceFactoryProxy")); |
2106 | 2037 return new KeyboardServiceFactoryProxy.fromEndpoint(endpoint); |
2107 KeyboardServiceFactoryProxy(_KeyboardServiceFactoryProxyImpl proxyImpl) : | |
2108 impl = proxyImpl, | |
2109 ptr = new _KeyboardServiceFactoryProxyCalls(proxyImpl); | |
2110 | |
2111 KeyboardServiceFactoryProxy.fromEndpoint( | |
2112 core.MojoMessagePipeEndpoint endpoint) : | |
2113 impl = new _KeyboardServiceFactoryProxyImpl.fromEndpoint(endpoint) { | |
2114 ptr = new _KeyboardServiceFactoryProxyCalls(impl); | |
2115 } | |
2116 | |
2117 KeyboardServiceFactoryProxy.fromHandle(core.MojoHandle handle) : | |
2118 impl = new _KeyboardServiceFactoryProxyImpl.fromHandle(handle) { | |
2119 ptr = new _KeyboardServiceFactoryProxyCalls(impl); | |
2120 } | |
2121 | |
2122 KeyboardServiceFactoryProxy.unbound() : | |
2123 impl = new _KeyboardServiceFactoryProxyImpl.unbound() { | |
2124 ptr = new _KeyboardServiceFactoryProxyCalls(impl); | |
2125 } | 2038 } |
2126 | 2039 |
2127 factory KeyboardServiceFactoryProxy.connectToService( | 2040 factory KeyboardServiceFactoryProxy.connectToService( |
2128 bindings.ServiceConnector s, String url, [String serviceName]) { | 2041 bindings.ServiceConnector s, String url, [String serviceName]) { |
2129 KeyboardServiceFactoryProxy p = new KeyboardServiceFactoryProxy.unbound(); | 2042 KeyboardServiceFactoryProxy p = new KeyboardServiceFactoryProxy.unbound(); |
2130 s.connectToService(url, p, serviceName); | 2043 s.connectToService(url, p, serviceName); |
2131 return p; | 2044 return p; |
2132 } | 2045 } |
2133 | 2046 |
2134 static KeyboardServiceFactoryProxy newFromEndpoint( | |
2135 core.MojoMessagePipeEndpoint endpoint) { | |
2136 assert(endpoint.setDescription("For KeyboardServiceFactoryProxy")); | |
2137 return new KeyboardServiceFactoryProxy.fromEndpoint(endpoint); | |
2138 } | |
2139 | 2047 |
2140 String get serviceName => KeyboardServiceFactory.serviceName; | 2048 void createKeyboardService(Object keyEventDispatcher, Object serviceRequest) { |
2141 | 2049 if (!ctrl.isBound) { |
2142 Future close({bool immediate: false}) => impl.close(immediate: immediate); | 2050 ctrl.proxyError("The Proxy is closed."); |
2143 | 2051 return; |
2144 Future responseOrError(Future f) => impl.responseOrError(f); | 2052 } |
2145 | 2053 var params = new _KeyboardServiceFactoryCreateKeyboardServiceParams(); |
2146 Future get errorFuture => impl.errorFuture; | 2054 params.keyEventDispatcher = keyEventDispatcher; |
2147 | 2055 params.serviceRequest = serviceRequest; |
2148 int get version => impl.version; | 2056 ctrl.sendMessage(params, |
2149 | 2057 _keyboardServiceFactoryMethodCreateKeyboardServiceName); |
2150 Future<int> queryVersion() => impl.queryVersion(); | |
2151 | |
2152 void requireVersion(int requiredVersion) { | |
2153 impl.requireVersion(requiredVersion); | |
2154 } | |
2155 | |
2156 String toString() { | |
2157 return "KeyboardServiceFactoryProxy($impl)"; | |
2158 } | 2058 } |
2159 } | 2059 } |
2160 | 2060 |
2161 | 2061 |
2162 class KeyboardServiceFactoryStub extends bindings.Stub { | 2062 class KeyboardServiceFactoryStub extends bindings.Stub { |
2163 KeyboardServiceFactory _impl; | 2063 KeyboardServiceFactory _impl; |
2164 | 2064 |
2165 KeyboardServiceFactoryStub.fromEndpoint( | 2065 KeyboardServiceFactoryStub.fromEndpoint( |
2166 core.MojoMessagePipeEndpoint endpoint, [KeyboardServiceFactory impl]) | 2066 core.MojoMessagePipeEndpoint endpoint, [KeyboardServiceFactory impl]) |
2167 : super.fromEndpoint(endpoint, autoBegin: impl != null) { | 2067 : super.fromEndpoint(endpoint, autoBegin: impl != null) { |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2236 static service_describer.ServiceDescription get serviceDescription { | 2136 static service_describer.ServiceDescription get serviceDescription { |
2237 if (_cachedServiceDescription == null) { | 2137 if (_cachedServiceDescription == null) { |
2238 _cachedServiceDescription = new _KeyboardServiceFactoryServiceDescription(
); | 2138 _cachedServiceDescription = new _KeyboardServiceFactoryServiceDescription(
); |
2239 } | 2139 } |
2240 return _cachedServiceDescription; | 2140 return _cachedServiceDescription; |
2241 } | 2141 } |
2242 } | 2142 } |
2243 | 2143 |
2244 | 2144 |
2245 | 2145 |
OLD | NEW |