| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'dart:collection'; | 6 import 'dart:collection'; |
| 7 import 'dart:mirrors'; | 7 import 'dart:mirrors'; |
| 8 import 'dart:sky' as sky; | 8 import 'dart:sky' as sky; |
| 9 | 9 |
| 10 import '../base/hit_test.dart'; | 10 import '../base/hit_test.dart'; |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 } | 271 } |
| 272 } | 272 } |
| 273 | 273 |
| 274 typedef void GestureEventListener(sky.GestureEvent e); | 274 typedef void GestureEventListener(sky.GestureEvent e); |
| 275 typedef void PointerEventListener(sky.PointerEvent e); | 275 typedef void PointerEventListener(sky.PointerEvent e); |
| 276 typedef void EventListener(sky.Event e); | 276 typedef void EventListener(sky.Event e); |
| 277 | 277 |
| 278 class Listener extends TagNode { | 278 class Listener extends TagNode { |
| 279 | 279 |
| 280 Listener({ | 280 Listener({ |
| 281 String key, |
| 281 Widget child, | 282 Widget child, |
| 282 EventListener onWheel, | 283 EventListener onWheel, |
| 283 GestureEventListener onGestureFlingCancel, | 284 GestureEventListener onGestureFlingCancel, |
| 284 GestureEventListener onGestureFlingStart, | 285 GestureEventListener onGestureFlingStart, |
| 285 GestureEventListener onGestureScrollStart, | 286 GestureEventListener onGestureScrollStart, |
| 286 GestureEventListener onGestureScrollUpdate, | 287 GestureEventListener onGestureScrollUpdate, |
| 287 GestureEventListener onGestureTap, | 288 GestureEventListener onGestureTap, |
| 288 GestureEventListener onGestureTapDown, | 289 GestureEventListener onGestureTapDown, |
| 289 PointerEventListener onPointerCancel, | 290 PointerEventListener onPointerCancel, |
| 290 PointerEventListener onPointerDown, | 291 PointerEventListener onPointerDown, |
| 291 PointerEventListener onPointerMove, | 292 PointerEventListener onPointerMove, |
| 292 PointerEventListener onPointerUp, | 293 PointerEventListener onPointerUp, |
| 293 Map<String, sky.EventListener> custom | 294 Map<String, sky.EventListener> custom |
| 294 }) : listeners = _createListeners( | 295 }) : listeners = _createListeners( |
| 295 onWheel: onWheel, | 296 onWheel: onWheel, |
| 296 onGestureFlingCancel: onGestureFlingCancel, | 297 onGestureFlingCancel: onGestureFlingCancel, |
| 297 onGestureFlingStart: onGestureFlingStart, | 298 onGestureFlingStart: onGestureFlingStart, |
| 298 onGestureScrollUpdate: onGestureScrollUpdate, | 299 onGestureScrollUpdate: onGestureScrollUpdate, |
| 299 onGestureScrollStart: onGestureScrollStart, | 300 onGestureScrollStart: onGestureScrollStart, |
| 300 onGestureTap: onGestureTap, | 301 onGestureTap: onGestureTap, |
| 301 onGestureTapDown: onGestureTapDown, | 302 onGestureTapDown: onGestureTapDown, |
| 302 onPointerCancel: onPointerCancel, | 303 onPointerCancel: onPointerCancel, |
| 303 onPointerDown: onPointerDown, | 304 onPointerDown: onPointerDown, |
| 304 onPointerMove: onPointerMove, | 305 onPointerMove: onPointerMove, |
| 305 onPointerUp: onPointerUp, | 306 onPointerUp: onPointerUp, |
| 306 custom: custom | 307 custom: custom |
| 307 ), | 308 ), |
| 308 super(child); | 309 super(child, key: key); |
| 309 | 310 |
| 310 final Map<String, sky.EventListener> listeners; | 311 final Map<String, sky.EventListener> listeners; |
| 311 | 312 |
| 312 static Map<String, sky.EventListener> _createListeners({ | 313 static Map<String, sky.EventListener> _createListeners({ |
| 313 EventListener onWheel, | 314 EventListener onWheel, |
| 314 GestureEventListener onGestureFlingCancel, | 315 GestureEventListener onGestureFlingCancel, |
| 315 GestureEventListener onGestureFlingStart, | 316 GestureEventListener onGestureFlingStart, |
| 316 GestureEventListener onGestureScrollStart, | 317 GestureEventListener onGestureScrollStart, |
| 317 GestureEventListener onGestureScrollUpdate, | 318 GestureEventListener onGestureScrollUpdate, |
| 318 GestureEventListener onGestureTap, | 319 GestureEventListener onGestureTap, |
| (...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 999 if (root.parent == null) { | 1000 if (root.parent == null) { |
| 1000 // we haven't attached it yet | 1001 // we haven't attached it yet |
| 1001 assert(_container.child == null); | 1002 assert(_container.child == null); |
| 1002 _container.child = root; | 1003 _container.child = root; |
| 1003 } | 1004 } |
| 1004 assert(root.parent == _container); | 1005 assert(root.parent == _container); |
| 1005 } | 1006 } |
| 1006 | 1007 |
| 1007 Widget build() => builder(); | 1008 Widget build() => builder(); |
| 1008 } | 1009 } |
| OLD | NEW |