| 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 } | 272 } |
| 273 } | 273 } |
| 274 | 274 |
| 275 typedef void GestureEventListener(sky.GestureEvent e); | 275 typedef void GestureEventListener(sky.GestureEvent e); |
| 276 typedef void PointerEventListener(sky.PointerEvent e); | 276 typedef void PointerEventListener(sky.PointerEvent e); |
| 277 typedef void EventListener(sky.Event e); | 277 typedef void EventListener(sky.Event e); |
| 278 | 278 |
| 279 class Listener extends TagNode { | 279 class Listener extends TagNode { |
| 280 | 280 |
| 281 Listener({ | 281 Listener({ |
| 282 String key, |
| 282 Widget child, | 283 Widget child, |
| 283 EventListener onWheel, | 284 EventListener onWheel, |
| 284 GestureEventListener onGestureFlingCancel, | 285 GestureEventListener onGestureFlingCancel, |
| 285 GestureEventListener onGestureFlingStart, | 286 GestureEventListener onGestureFlingStart, |
| 286 GestureEventListener onGestureScrollStart, | 287 GestureEventListener onGestureScrollStart, |
| 287 GestureEventListener onGestureScrollUpdate, | 288 GestureEventListener onGestureScrollUpdate, |
| 288 GestureEventListener onGestureTap, | 289 GestureEventListener onGestureTap, |
| 289 GestureEventListener onGestureTapDown, | 290 GestureEventListener onGestureTapDown, |
| 290 PointerEventListener onPointerCancel, | 291 PointerEventListener onPointerCancel, |
| 291 PointerEventListener onPointerDown, | 292 PointerEventListener onPointerDown, |
| 292 PointerEventListener onPointerMove, | 293 PointerEventListener onPointerMove, |
| 293 PointerEventListener onPointerUp, | 294 PointerEventListener onPointerUp, |
| 294 Map<String, sky.EventListener> custom | 295 Map<String, sky.EventListener> custom |
| 295 }) : listeners = _createListeners( | 296 }) : listeners = _createListeners( |
| 296 onWheel: onWheel, | 297 onWheel: onWheel, |
| 297 onGestureFlingCancel: onGestureFlingCancel, | 298 onGestureFlingCancel: onGestureFlingCancel, |
| 298 onGestureFlingStart: onGestureFlingStart, | 299 onGestureFlingStart: onGestureFlingStart, |
| 299 onGestureScrollUpdate: onGestureScrollUpdate, | 300 onGestureScrollUpdate: onGestureScrollUpdate, |
| 300 onGestureScrollStart: onGestureScrollStart, | 301 onGestureScrollStart: onGestureScrollStart, |
| 301 onGestureTap: onGestureTap, | 302 onGestureTap: onGestureTap, |
| 302 onGestureTapDown: onGestureTapDown, | 303 onGestureTapDown: onGestureTapDown, |
| 303 onPointerCancel: onPointerCancel, | 304 onPointerCancel: onPointerCancel, |
| 304 onPointerDown: onPointerDown, | 305 onPointerDown: onPointerDown, |
| 305 onPointerMove: onPointerMove, | 306 onPointerMove: onPointerMove, |
| 306 onPointerUp: onPointerUp, | 307 onPointerUp: onPointerUp, |
| 307 custom: custom | 308 custom: custom |
| 308 ), | 309 ), |
| 309 super(child); | 310 super(child, key: key); |
| 310 | 311 |
| 311 final Map<String, sky.EventListener> listeners; | 312 final Map<String, sky.EventListener> listeners; |
| 312 | 313 |
| 313 static Map<String, sky.EventListener> _createListeners({ | 314 static Map<String, sky.EventListener> _createListeners({ |
| 314 EventListener onWheel, | 315 EventListener onWheel, |
| 315 GestureEventListener onGestureFlingCancel, | 316 GestureEventListener onGestureFlingCancel, |
| 316 GestureEventListener onGestureFlingStart, | 317 GestureEventListener onGestureFlingStart, |
| 317 GestureEventListener onGestureScrollStart, | 318 GestureEventListener onGestureScrollStart, |
| 318 GestureEventListener onGestureScrollUpdate, | 319 GestureEventListener onGestureScrollUpdate, |
| 319 GestureEventListener onGestureTap, | 320 GestureEventListener onGestureTap, |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1013 if (root.parent == null) { | 1014 if (root.parent == null) { |
| 1014 // we haven't attached it yet | 1015 // we haven't attached it yet |
| 1015 assert(_container.child == null); | 1016 assert(_container.child == null); |
| 1016 _container.child = root; | 1017 _container.child = root; |
| 1017 } | 1018 } |
| 1018 assert(root.parent == _container); | 1019 assert(root.parent == _container); |
| 1019 } | 1020 } |
| 1020 | 1021 |
| 1021 Widget build() => builder(); | 1022 Widget build() => builder(); |
| 1022 } | 1023 } |
| OLD | NEW |