Index: mojo/dart/packages/mojo_services/lib/mojo/gfx/composition/hit_tests.mojom.dart |
diff --git a/mojo/dart/packages/mojo_services/lib/mojo/cookie_store.mojom.dart b/mojo/dart/packages/mojo_services/lib/mojo/gfx/composition/hit_tests.mojom.dart |
similarity index 56% |
copy from mojo/dart/packages/mojo_services/lib/mojo/cookie_store.mojom.dart |
copy to mojo/dart/packages/mojo_services/lib/mojo/gfx/composition/hit_tests.mojom.dart |
index b207a51c165641ebf3e116a08898a8eb0fbfa0bb..c08228bae83b8e09db688b923831d970afa53d9c 100644 |
--- a/mojo/dart/packages/mojo_services/lib/mojo/cookie_store.mojom.dart |
+++ b/mojo/dart/packages/mojo_services/lib/mojo/gfx/composition/hit_tests.mojom.dart |
@@ -2,24 +2,31 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-library cookie_store_mojom; |
+library hit_tests_mojom; |
import 'dart:async'; |
import 'package:mojo/bindings.dart' as bindings; |
import 'package:mojo/core.dart' as core; |
+import 'package:mojo_services/mojo/geometry.mojom.dart' as geometry_mojom; |
+import 'package:mojo_services/mojo/gfx/composition/scene_token.mojom.dart' as scene_token_mojom; |
+const int kHitIdNone = 0; |
-class _CookieStoreGetParams extends bindings.Struct { |
+class Hit extends bindings.Struct { |
static const List<bindings.StructDataHeader> kVersions = const [ |
- const bindings.StructDataHeader(16, 0) |
+ const bindings.StructDataHeader(40, 0) |
]; |
- String url = null; |
+ scene_token_mojom.SceneToken sceneToken = null; |
+ int sceneVersion = 0; |
+ int nodeId = 0; |
+ int hitId = 0; |
+ geometry_mojom.Point intersection = null; |
- _CookieStoreGetParams() : super(kVersions.last.size); |
+ Hit() : super(kVersions.last.size); |
- static _CookieStoreGetParams deserialize(bindings.Message message) { |
+ static Hit deserialize(bindings.Message message) { |
var decoder = new bindings.Decoder(message); |
var result = decode(decoder); |
if (decoder.excessHandles != null) { |
@@ -28,11 +35,11 @@ class _CookieStoreGetParams extends bindings.Struct { |
return result; |
} |
- static _CookieStoreGetParams decode(bindings.Decoder decoder0) { |
+ static Hit decode(bindings.Decoder decoder0) { |
if (decoder0 == null) { |
return null; |
} |
- _CookieStoreGetParams result = new _CookieStoreGetParams(); |
+ Hit result = new Hit(); |
var mainDataHeader = decoder0.decodeStructDataHeader(); |
if (mainDataHeader.version <= kVersions.last.version) { |
@@ -54,7 +61,25 @@ class _CookieStoreGetParams extends bindings.Struct { |
} |
if (mainDataHeader.version >= 0) { |
- result.url = decoder0.decodeString(8, false); |
+ var decoder1 = decoder0.decodePointer(8, false); |
+ result.sceneToken = scene_token_mojom.SceneToken.decode(decoder1); |
+ } |
+ if (mainDataHeader.version >= 0) { |
+ |
+ result.sceneVersion = decoder0.decodeUint32(16); |
+ } |
+ if (mainDataHeader.version >= 0) { |
+ |
+ result.nodeId = decoder0.decodeUint32(20); |
+ } |
+ if (mainDataHeader.version >= 0) { |
+ |
+ result.hitId = decoder0.decodeUint32(24); |
+ } |
+ if (mainDataHeader.version >= 0) { |
+ |
+ var decoder1 = decoder0.decodePointer(32, false); |
+ result.intersection = geometry_mojom.Point.decode(decoder1); |
} |
return result; |
} |
@@ -62,31 +87,47 @@ class _CookieStoreGetParams extends bindings.Struct { |
void encode(bindings.Encoder encoder) { |
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); |
- encoder0.encodeString(url, 8, false); |
+ encoder0.encodeStruct(sceneToken, 8, false); |
+ |
+ encoder0.encodeUint32(sceneVersion, 16); |
+ |
+ encoder0.encodeUint32(nodeId, 20); |
+ |
+ encoder0.encodeUint32(hitId, 24); |
+ |
+ encoder0.encodeStruct(intersection, 32, false); |
} |
String toString() { |
- return "_CookieStoreGetParams(" |
- "url: $url" ")"; |
+ return "Hit(" |
+ "sceneToken: $sceneToken" ", " |
+ "sceneVersion: $sceneVersion" ", " |
+ "nodeId: $nodeId" ", " |
+ "hitId: $hitId" ", " |
+ "intersection: $intersection" ")"; |
} |
Map toJson() { |
Map map = new Map(); |
- map["url"] = url; |
+ map["sceneToken"] = sceneToken; |
+ map["sceneVersion"] = sceneVersion; |
+ map["nodeId"] = nodeId; |
+ map["hitId"] = hitId; |
+ map["intersection"] = intersection; |
return map; |
} |
} |
-class CookieStoreGetResponseParams extends bindings.Struct { |
+class HitTestResult extends bindings.Struct { |
static const List<bindings.StructDataHeader> kVersions = const [ |
const bindings.StructDataHeader(16, 0) |
]; |
- String cookies = null; |
+ List<Hit> hits = null; |
- CookieStoreGetResponseParams() : super(kVersions.last.size); |
+ HitTestResult() : super(kVersions.last.size); |
- static CookieStoreGetResponseParams deserialize(bindings.Message message) { |
+ static HitTestResult deserialize(bindings.Message message) { |
var decoder = new bindings.Decoder(message); |
var result = decode(decoder); |
if (decoder.excessHandles != null) { |
@@ -95,11 +136,11 @@ class CookieStoreGetResponseParams extends bindings.Struct { |
return result; |
} |
- static CookieStoreGetResponseParams decode(bindings.Decoder decoder0) { |
+ static HitTestResult decode(bindings.Decoder decoder0) { |
if (decoder0 == null) { |
return null; |
} |
- CookieStoreGetResponseParams result = new CookieStoreGetResponseParams(); |
+ HitTestResult result = new HitTestResult(); |
var mainDataHeader = decoder0.decodeStructDataHeader(); |
if (mainDataHeader.version <= kVersions.last.version) { |
@@ -121,7 +162,16 @@ class CookieStoreGetResponseParams extends bindings.Struct { |
} |
if (mainDataHeader.version >= 0) { |
- result.cookies = decoder0.decodeString(8, false); |
+ var decoder1 = decoder0.decodePointer(8, false); |
+ { |
+ var si1 = decoder1.decodeDataHeaderForPointerArray(bindings.kUnspecifiedArrayLength); |
+ result.hits = new List<Hit>(si1.numElements); |
+ for (int i1 = 0; i1 < si1.numElements; ++i1) { |
+ |
+ var decoder2 = decoder1.decodePointer(bindings.ArrayDataHeader.kHeaderSize + bindings.kPointerSize * i1, false); |
+ result.hits[i1] = Hit.decode(decoder2); |
+ } |
+ } |
} |
return result; |
} |
@@ -129,32 +179,39 @@ class CookieStoreGetResponseParams extends bindings.Struct { |
void encode(bindings.Encoder encoder) { |
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); |
- encoder0.encodeString(cookies, 8, false); |
+ if (hits == null) { |
+ encoder0.encodeNullPointer(8, false); |
+ } else { |
+ var encoder1 = encoder0.encodePointerArray(hits.length, 8, bindings.kUnspecifiedArrayLength); |
+ for (int i0 = 0; i0 < hits.length; ++i0) { |
+ |
+ encoder1.encodeStruct(hits[i0], bindings.ArrayDataHeader.kHeaderSize + bindings.kPointerSize * i0, false); |
+ } |
+ } |
} |
String toString() { |
- return "CookieStoreGetResponseParams(" |
- "cookies: $cookies" ")"; |
+ return "HitTestResult(" |
+ "hits: $hits" ")"; |
} |
Map toJson() { |
Map map = new Map(); |
- map["cookies"] = cookies; |
+ map["hits"] = hits; |
return map; |
} |
} |
-class _CookieStoreSetParams extends bindings.Struct { |
+class _HitTesterHitTestParams extends bindings.Struct { |
static const List<bindings.StructDataHeader> kVersions = const [ |
- const bindings.StructDataHeader(24, 0) |
+ const bindings.StructDataHeader(16, 0) |
]; |
- String url = null; |
- String cookie = null; |
+ geometry_mojom.Point point = null; |
- _CookieStoreSetParams() : super(kVersions.last.size); |
+ _HitTesterHitTestParams() : super(kVersions.last.size); |
- static _CookieStoreSetParams deserialize(bindings.Message message) { |
+ static _HitTesterHitTestParams deserialize(bindings.Message message) { |
var decoder = new bindings.Decoder(message); |
var result = decode(decoder); |
if (decoder.excessHandles != null) { |
@@ -163,11 +220,11 @@ class _CookieStoreSetParams extends bindings.Struct { |
return result; |
} |
- static _CookieStoreSetParams decode(bindings.Decoder decoder0) { |
+ static _HitTesterHitTestParams decode(bindings.Decoder decoder0) { |
if (decoder0 == null) { |
return null; |
} |
- _CookieStoreSetParams result = new _CookieStoreSetParams(); |
+ _HitTesterHitTestParams result = new _HitTesterHitTestParams(); |
var mainDataHeader = decoder0.decodeStructDataHeader(); |
if (mainDataHeader.version <= kVersions.last.version) { |
@@ -189,11 +246,8 @@ class _CookieStoreSetParams extends bindings.Struct { |
} |
if (mainDataHeader.version >= 0) { |
- result.url = decoder0.decodeString(8, false); |
- } |
- if (mainDataHeader.version >= 0) { |
- |
- result.cookie = decoder0.decodeString(16, false); |
+ var decoder1 = decoder0.decodePointer(8, false); |
+ result.point = geometry_mojom.Point.decode(decoder1); |
} |
return result; |
} |
@@ -201,35 +255,31 @@ class _CookieStoreSetParams extends bindings.Struct { |
void encode(bindings.Encoder encoder) { |
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); |
- encoder0.encodeString(url, 8, false); |
- |
- encoder0.encodeString(cookie, 16, false); |
+ encoder0.encodeStruct(point, 8, false); |
} |
String toString() { |
- return "_CookieStoreSetParams(" |
- "url: $url" ", " |
- "cookie: $cookie" ")"; |
+ return "_HitTesterHitTestParams(" |
+ "point: $point" ")"; |
} |
Map toJson() { |
Map map = new Map(); |
- map["url"] = url; |
- map["cookie"] = cookie; |
+ map["point"] = point; |
return map; |
} |
} |
-class CookieStoreSetResponseParams extends bindings.Struct { |
+class HitTesterHitTestResponseParams extends bindings.Struct { |
static const List<bindings.StructDataHeader> kVersions = const [ |
const bindings.StructDataHeader(16, 0) |
]; |
- bool success = false; |
+ HitTestResult result = null; |
- CookieStoreSetResponseParams() : super(kVersions.last.size); |
+ HitTesterHitTestResponseParams() : super(kVersions.last.size); |
- static CookieStoreSetResponseParams deserialize(bindings.Message message) { |
+ static HitTesterHitTestResponseParams deserialize(bindings.Message message) { |
var decoder = new bindings.Decoder(message); |
var result = decode(decoder); |
if (decoder.excessHandles != null) { |
@@ -238,11 +288,11 @@ class CookieStoreSetResponseParams extends bindings.Struct { |
return result; |
} |
- static CookieStoreSetResponseParams decode(bindings.Decoder decoder0) { |
+ static HitTesterHitTestResponseParams decode(bindings.Decoder decoder0) { |
if (decoder0 == null) { |
return null; |
} |
- CookieStoreSetResponseParams result = new CookieStoreSetResponseParams(); |
+ HitTesterHitTestResponseParams result = new HitTesterHitTestResponseParams(); |
var mainDataHeader = decoder0.decodeStructDataHeader(); |
if (mainDataHeader.version <= kVersions.last.version) { |
@@ -264,7 +314,8 @@ class CookieStoreSetResponseParams extends bindings.Struct { |
} |
if (mainDataHeader.version >= 0) { |
- result.success = decoder0.decodeBool(8, 0); |
+ var decoder1 = decoder0.decodePointer(8, false); |
+ result.result = HitTestResult.decode(decoder1); |
} |
return result; |
} |
@@ -272,70 +323,48 @@ class CookieStoreSetResponseParams extends bindings.Struct { |
void encode(bindings.Encoder encoder) { |
var encoder0 = encoder.getStructEncoderAtOffset(kVersions.last); |
- encoder0.encodeBool(success, 8, 0); |
+ encoder0.encodeStruct(result, 8, false); |
} |
String toString() { |
- return "CookieStoreSetResponseParams(" |
- "success: $success" ")"; |
+ return "HitTesterHitTestResponseParams(" |
+ "result: $result" ")"; |
} |
Map toJson() { |
Map map = new Map(); |
- map["success"] = success; |
+ map["result"] = result; |
return map; |
} |
} |
-const int _CookieStore_getName = 0; |
-const int _CookieStore_setName = 1; |
+const int _HitTester_hitTestName = 0; |
-abstract class CookieStore { |
+abstract class HitTester { |
static const String serviceName = null; |
- dynamic get(String url,[Function responseFactory = null]); |
- dynamic set(String url,String cookie,[Function responseFactory = null]); |
+ dynamic hitTest(geometry_mojom.Point point,[Function responseFactory = null]); |
} |
-class _CookieStoreProxyImpl extends bindings.Proxy { |
- _CookieStoreProxyImpl.fromEndpoint( |
+class _HitTesterProxyImpl extends bindings.Proxy { |
+ _HitTesterProxyImpl.fromEndpoint( |
core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); |
- _CookieStoreProxyImpl.fromHandle(core.MojoHandle handle) : |
+ _HitTesterProxyImpl.fromHandle(core.MojoHandle handle) : |
super.fromHandle(handle); |
- _CookieStoreProxyImpl.unbound() : super.unbound(); |
+ _HitTesterProxyImpl.unbound() : super.unbound(); |
- static _CookieStoreProxyImpl newFromEndpoint( |
+ static _HitTesterProxyImpl newFromEndpoint( |
core.MojoMessagePipeEndpoint endpoint) { |
- assert(endpoint.setDescription("For _CookieStoreProxyImpl")); |
- return new _CookieStoreProxyImpl.fromEndpoint(endpoint); |
+ assert(endpoint.setDescription("For _HitTesterProxyImpl")); |
+ return new _HitTesterProxyImpl.fromEndpoint(endpoint); |
} |
void handleResponse(bindings.ServiceMessage message) { |
switch (message.header.type) { |
- case _CookieStore_getName: |
- var r = CookieStoreGetResponseParams.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; |
- case _CookieStore_setName: |
- var r = CookieStoreSetResponseParams.deserialize( |
+ case _HitTester_hitTestName: |
+ var r = HitTesterHitTestResponseParams.deserialize( |
message.payload); |
if (!message.header.hasRequestId) { |
proxyError("Expected a message with a valid request Id."); |
@@ -363,75 +392,65 @@ class _CookieStoreProxyImpl extends bindings.Proxy { |
String toString() { |
var superString = super.toString(); |
- return "_CookieStoreProxyImpl($superString)"; |
+ return "_HitTesterProxyImpl($superString)"; |
} |
} |
-class _CookieStoreProxyCalls implements CookieStore { |
- _CookieStoreProxyImpl _proxyImpl; |
+class _HitTesterProxyCalls implements HitTester { |
+ _HitTesterProxyImpl _proxyImpl; |
- _CookieStoreProxyCalls(this._proxyImpl); |
- dynamic get(String url,[Function responseFactory = null]) { |
- var params = new _CookieStoreGetParams(); |
- params.url = url; |
- return _proxyImpl.sendMessageWithRequestId( |
- params, |
- _CookieStore_getName, |
- -1, |
- bindings.MessageHeader.kMessageExpectsResponse); |
- } |
- dynamic set(String url,String cookie,[Function responseFactory = null]) { |
- var params = new _CookieStoreSetParams(); |
- params.url = url; |
- params.cookie = cookie; |
+ _HitTesterProxyCalls(this._proxyImpl); |
+ dynamic hitTest(geometry_mojom.Point point,[Function responseFactory = null]) { |
+ var params = new _HitTesterHitTestParams(); |
+ params.point = point; |
return _proxyImpl.sendMessageWithRequestId( |
params, |
- _CookieStore_setName, |
+ _HitTester_hitTestName, |
-1, |
bindings.MessageHeader.kMessageExpectsResponse); |
} |
} |
-class CookieStoreProxy implements bindings.ProxyBase { |
+class HitTesterProxy implements bindings.ProxyBase { |
final bindings.Proxy impl; |
- CookieStore ptr; |
+ HitTester ptr; |
- CookieStoreProxy(_CookieStoreProxyImpl proxyImpl) : |
+ HitTesterProxy(_HitTesterProxyImpl proxyImpl) : |
impl = proxyImpl, |
- ptr = new _CookieStoreProxyCalls(proxyImpl); |
+ ptr = new _HitTesterProxyCalls(proxyImpl); |
- CookieStoreProxy.fromEndpoint( |
+ HitTesterProxy.fromEndpoint( |
core.MojoMessagePipeEndpoint endpoint) : |
- impl = new _CookieStoreProxyImpl.fromEndpoint(endpoint) { |
- ptr = new _CookieStoreProxyCalls(impl); |
+ impl = new _HitTesterProxyImpl.fromEndpoint(endpoint) { |
+ ptr = new _HitTesterProxyCalls(impl); |
} |
- CookieStoreProxy.fromHandle(core.MojoHandle handle) : |
- impl = new _CookieStoreProxyImpl.fromHandle(handle) { |
- ptr = new _CookieStoreProxyCalls(impl); |
+ HitTesterProxy.fromHandle(core.MojoHandle handle) : |
+ impl = new _HitTesterProxyImpl.fromHandle(handle) { |
+ ptr = new _HitTesterProxyCalls(impl); |
} |
- CookieStoreProxy.unbound() : |
- impl = new _CookieStoreProxyImpl.unbound() { |
- ptr = new _CookieStoreProxyCalls(impl); |
+ HitTesterProxy.unbound() : |
+ impl = new _HitTesterProxyImpl.unbound() { |
+ ptr = new _HitTesterProxyCalls(impl); |
} |
- factory CookieStoreProxy.connectToService( |
+ factory HitTesterProxy.connectToService( |
bindings.ServiceConnector s, String url, [String serviceName]) { |
- CookieStoreProxy p = new CookieStoreProxy.unbound(); |
+ HitTesterProxy p = new HitTesterProxy.unbound(); |
s.connectToService(url, p, serviceName); |
return p; |
} |
- static CookieStoreProxy newFromEndpoint( |
+ static HitTesterProxy newFromEndpoint( |
core.MojoMessagePipeEndpoint endpoint) { |
- assert(endpoint.setDescription("For CookieStoreProxy")); |
- return new CookieStoreProxy.fromEndpoint(endpoint); |
+ assert(endpoint.setDescription("For HitTesterProxy")); |
+ return new HitTesterProxy.fromEndpoint(endpoint); |
} |
- String get serviceName => CookieStore.serviceName; |
+ String get serviceName => HitTester.serviceName; |
Future close({bool immediate: false}) => impl.close(immediate: immediate); |
@@ -448,38 +467,33 @@ class CookieStoreProxy implements bindings.ProxyBase { |
} |
String toString() { |
- return "CookieStoreProxy($impl)"; |
+ return "HitTesterProxy($impl)"; |
} |
} |
-class CookieStoreStub extends bindings.Stub { |
- CookieStore _impl = null; |
+class HitTesterStub extends bindings.Stub { |
+ HitTester _impl = null; |
- CookieStoreStub.fromEndpoint( |
+ HitTesterStub.fromEndpoint( |
core.MojoMessagePipeEndpoint endpoint, [this._impl]) |
: super.fromEndpoint(endpoint); |
- CookieStoreStub.fromHandle(core.MojoHandle handle, [this._impl]) |
+ HitTesterStub.fromHandle(core.MojoHandle handle, [this._impl]) |
: super.fromHandle(handle); |
- CookieStoreStub.unbound() : super.unbound(); |
+ HitTesterStub.unbound() : super.unbound(); |
- static CookieStoreStub newFromEndpoint( |
+ static HitTesterStub newFromEndpoint( |
core.MojoMessagePipeEndpoint endpoint) { |
- assert(endpoint.setDescription("For CookieStoreStub")); |
- return new CookieStoreStub.fromEndpoint(endpoint); |
+ assert(endpoint.setDescription("For HitTesterStub")); |
+ return new HitTesterStub.fromEndpoint(endpoint); |
} |
- CookieStoreGetResponseParams _CookieStoreGetResponseParamsFactory(String cookies) { |
- var mojo_factory_result = new CookieStoreGetResponseParams(); |
- mojo_factory_result.cookies = cookies; |
- return mojo_factory_result; |
- } |
- CookieStoreSetResponseParams _CookieStoreSetResponseParamsFactory(bool success) { |
- var mojo_factory_result = new CookieStoreSetResponseParams(); |
- mojo_factory_result.success = success; |
+ HitTesterHitTestResponseParams _HitTesterHitTestResponseParamsFactory(HitTestResult result) { |
+ var mojo_factory_result = new HitTesterHitTestResponseParams(); |
+ mojo_factory_result.result = result; |
return mojo_factory_result; |
} |
@@ -491,38 +505,16 @@ class CookieStoreStub extends bindings.Stub { |
} |
assert(_impl != null); |
switch (message.header.type) { |
- case _CookieStore_getName: |
- var params = _CookieStoreGetParams.deserialize( |
- message.payload); |
- var response = _impl.get(params.url,_CookieStoreGetResponseParamsFactory); |
- if (response is Future) { |
- return response.then((response) { |
- if (response != null) { |
- return buildResponseWithId( |
- response, |
- _CookieStore_getName, |
- message.header.requestId, |
- bindings.MessageHeader.kMessageIsResponse); |
- } |
- }); |
- } else if (response != null) { |
- return buildResponseWithId( |
- response, |
- _CookieStore_getName, |
- message.header.requestId, |
- bindings.MessageHeader.kMessageIsResponse); |
- } |
- break; |
- case _CookieStore_setName: |
- var params = _CookieStoreSetParams.deserialize( |
+ case _HitTester_hitTestName: |
+ var params = _HitTesterHitTestParams.deserialize( |
message.payload); |
- var response = _impl.set(params.url,params.cookie,_CookieStoreSetResponseParamsFactory); |
+ var response = _impl.hitTest(params.point,_HitTesterHitTestResponseParamsFactory); |
if (response is Future) { |
return response.then((response) { |
if (response != null) { |
return buildResponseWithId( |
response, |
- _CookieStore_setName, |
+ _HitTester_hitTestName, |
message.header.requestId, |
bindings.MessageHeader.kMessageIsResponse); |
} |
@@ -530,7 +522,7 @@ class CookieStoreStub extends bindings.Stub { |
} else if (response != null) { |
return buildResponseWithId( |
response, |
- _CookieStore_setName, |
+ _HitTester_hitTestName, |
message.header.requestId, |
bindings.MessageHeader.kMessageIsResponse); |
} |
@@ -542,15 +534,15 @@ class CookieStoreStub extends bindings.Stub { |
return null; |
} |
- CookieStore get impl => _impl; |
- set impl(CookieStore d) { |
+ HitTester get impl => _impl; |
+ set impl(HitTester d) { |
assert(_impl == null); |
_impl = d; |
} |
String toString() { |
var superString = super.toString(); |
- return "CookieStoreStub($superString)"; |
+ return "HitTesterStub($superString)"; |
} |
int get version => 0; |