Commit 5b42f83f authored by Ian Hickson's avatar Ian Hickson

Merge pull request #905 from Hixie/bindings

Rename Pointerer to Gesturer.
parents 53575aa7 d29970df
......@@ -16,7 +16,7 @@ import 'events.dart';
import 'hit_test.dart';
import 'pointer_router.dart';
abstract class Pointerer extends BindingBase implements HitTestTarget, HitTestable {
abstract class Gesturer extends BindingBase implements HitTestTarget, HitTestable {
void initInstances() {
super.initInstances();
......@@ -24,8 +24,8 @@ abstract class Pointerer extends BindingBase implements HitTestTarget, HitTestab
ui.window.onPointerPacket = _handlePointerPacket;
}
static Pointerer _instance;
static Pointerer get instance => _instance;
static Gesturer _instance;
static Gesturer get instance => _instance;
void _handlePointerPacket(ByteData serializedPacket) {
final mojo_bindings.Message message = new mojo_bindings.Message(
......
......@@ -86,7 +86,7 @@ class _RenderSlider extends RenderConstrainedBox {
_activeColor = activeColor,
super(additionalConstraints: const BoxConstraints.tightFor(width: _kTrackWidth + 2 * _kReactionRadius, height: 2 * _kReactionRadius)) {
assert(value != null && value >= 0.0 && value <= 1.0);
_drag = new HorizontalDragGestureRecognizer(router: Pointerer.instance.pointerRouter, gestureArena: Pointerer.instance.gestureArena)
_drag = new HorizontalDragGestureRecognizer(router: Gesturer.instance.pointerRouter, gestureArena: Gesturer.instance.gestureArena)
..onStart = _handleDragStart
..onUpdate = _handleDragUpdate
..onEnd = _handleDragEnd;
......
......@@ -115,7 +115,7 @@ class _RenderSwitch extends RenderToggleable {
) {
_activeTrackColor = activeTrackColor;
_inactiveTrackColor = inactiveTrackColor;
_drag = new HorizontalDragGestureRecognizer(router: Pointerer.instance.pointerRouter, gestureArena: Pointerer.instance.gestureArena)
_drag = new HorizontalDragGestureRecognizer(router: Gesturer.instance.pointerRouter, gestureArena: Gesturer.instance.gestureArena)
..onStart = _handleDragStart
..onUpdate = _handleDragUpdate
..onEnd = _handleDragEnd;
......
......@@ -29,7 +29,7 @@ abstract class RenderToggleable extends RenderConstrainedBox {
assert(value != null);
assert(activeColor != null);
assert(inactiveColor != null);
_tap = new TapGestureRecognizer(router: Pointerer.instance.pointerRouter, gestureArena: Pointerer.instance.gestureArena)
_tap = new TapGestureRecognizer(router: Gesturer.instance.pointerRouter, gestureArena: Gesturer.instance.gestureArena)
..onTapDown = _handleTapDown
..onTap = _handleTap
..onTapUp = _handleTapUp
......
......@@ -85,7 +85,7 @@ void debugDumpLayerTree() {
/// A concrete binding for applications that use the Rendering framework
/// directly. This is the glue that binds the framework to the Flutter engine.
class RenderingFlutterBinding extends BindingBase with Scheduler, Renderer, Pointerer {
class RenderingFlutterBinding extends BindingBase with Scheduler, Renderer, Gesturer {
RenderingFlutterBinding({ RenderBox root }) {
renderView.child = root;
}
......
......@@ -20,7 +20,7 @@ class BindingObserver {
/// A concrete binding for applications based on the Widgets framework.
/// This is the glue that binds the framework to the Flutter engine.
class WidgetFlutterBinding extends BindingBase with Scheduler, Pointerer, Renderer {
class WidgetFlutterBinding extends BindingBase with Scheduler, Gesturer, Renderer {
WidgetFlutterBinding._();
......
......@@ -96,7 +96,7 @@ class Draggable<T> extends DraggableBase<T> {
GestureRecognizer createRecognizer(PointerRouter router, DragStartCallback starter) {
return new MultiTapGestureRecognizer(
router: router,
gestureArena: Pointerer.instance.gestureArena,
gestureArena: Gesturer.instance.gestureArena,
onTapDown: starter
);
}
......@@ -123,7 +123,7 @@ class LongPressDraggable<T> extends DraggableBase<T> {
GestureRecognizer createRecognizer(PointerRouter router, DragStartCallback starter) {
return new MultiTapGestureRecognizer(
router: router,
gestureArena: Pointerer.instance.gestureArena,
gestureArena: Gesturer.instance.gestureArena,
longTapDelay: kLongPressTimeout,
onLongTapDown: (Point position, int pointer) {
userFeedback.performHapticFeedback(HapticFeedbackType.VIRTUAL_KEY);
......@@ -135,7 +135,7 @@ class LongPressDraggable<T> extends DraggableBase<T> {
class _DraggableState<T> extends State<DraggableBase<T>> implements GestureArenaMember {
PointerRouter get router => Pointerer.instance.pointerRouter;
PointerRouter get router => Gesturer.instance.pointerRouter;
void initState() {
super.initState();
......@@ -146,7 +146,7 @@ class _DraggableState<T> extends State<DraggableBase<T>> implements GestureArena
Map<int, GestureArenaEntry> _activePointers = <int, GestureArenaEntry>{};
void _routePointer(PointerEvent event) {
_activePointers[event.pointer] = Pointerer.instance.gestureArena.add(event.pointer, this);
_activePointers[event.pointer] = Gesturer.instance.gestureArena.add(event.pointer, this);
_recognizer.addPointer(event);
}
......
......@@ -121,7 +121,7 @@ class GestureDetector extends StatefulComponent {
}
class _GestureDetectorState extends State<GestureDetector> {
PointerRouter get _router => Pointerer.instance.pointerRouter;
PointerRouter get _router => Gesturer.instance.pointerRouter;
TapGestureRecognizer _tap;
DoubleTapGestureRecognizer _doubleTap;
......@@ -165,7 +165,7 @@ class _GestureDetectorState extends State<GestureDetector> {
if (config.onTapDown == null && config.onTapUp == null && config.onTap == null && config.onTapCancel == null) {
_tap = _ensureDisposed(_tap);
} else {
_tap ??= new TapGestureRecognizer(router: _router, gestureArena: Pointerer.instance.gestureArena);
_tap ??= new TapGestureRecognizer(router: _router, gestureArena: Gesturer.instance.gestureArena);
_tap
..onTapDown = config.onTapDown
..onTapUp = config.onTapUp
......@@ -178,7 +178,7 @@ class _GestureDetectorState extends State<GestureDetector> {
if (config.onDoubleTap == null) {
_doubleTap = _ensureDisposed(_doubleTap);
} else {
_doubleTap ??= new DoubleTapGestureRecognizer(router: _router, gestureArena: Pointerer.instance.gestureArena);
_doubleTap ??= new DoubleTapGestureRecognizer(router: _router, gestureArena: Gesturer.instance.gestureArena);
_doubleTap.onDoubleTap = config.onDoubleTap;
}
}
......@@ -187,7 +187,7 @@ class _GestureDetectorState extends State<GestureDetector> {
if (config.onLongPress == null) {
_longPress = _ensureDisposed(_longPress);
} else {
_longPress ??= new LongPressGestureRecognizer(router: _router, gestureArena: Pointerer.instance.gestureArena);
_longPress ??= new LongPressGestureRecognizer(router: _router, gestureArena: Gesturer.instance.gestureArena);
_longPress.onLongPress = config.onLongPress;
}
}
......@@ -196,7 +196,7 @@ class _GestureDetectorState extends State<GestureDetector> {
if (config.onVerticalDragStart == null && config.onVerticalDragUpdate == null && config.onVerticalDragEnd == null) {
_verticalDrag = _ensureDisposed(_verticalDrag);
} else {
_verticalDrag ??= new VerticalDragGestureRecognizer(router: _router, gestureArena: Pointerer.instance.gestureArena);
_verticalDrag ??= new VerticalDragGestureRecognizer(router: _router, gestureArena: Gesturer.instance.gestureArena);
_verticalDrag
..onStart = config.onVerticalDragStart
..onUpdate = config.onVerticalDragUpdate
......@@ -208,7 +208,7 @@ class _GestureDetectorState extends State<GestureDetector> {
if (config.onHorizontalDragStart == null && config.onHorizontalDragUpdate == null && config.onHorizontalDragEnd == null) {
_horizontalDrag = _ensureDisposed(_horizontalDrag);
} else {
_horizontalDrag ??= new HorizontalDragGestureRecognizer(router: _router, gestureArena: Pointerer.instance.gestureArena);
_horizontalDrag ??= new HorizontalDragGestureRecognizer(router: _router, gestureArena: Gesturer.instance.gestureArena);
_horizontalDrag
..onStart = config.onHorizontalDragStart
..onUpdate = config.onHorizontalDragUpdate
......@@ -221,7 +221,7 @@ class _GestureDetectorState extends State<GestureDetector> {
_pan = _ensureDisposed(_pan);
} else {
assert(_scale == null); // Scale is a superset of pan; just use scale
_pan ??= new PanGestureRecognizer(router: _router, gestureArena: Pointerer.instance.gestureArena);
_pan ??= new PanGestureRecognizer(router: _router, gestureArena: Gesturer.instance.gestureArena);
_pan
..onStart = config.onPanStart
..onUpdate = config.onPanUpdate
......@@ -234,7 +234,7 @@ class _GestureDetectorState extends State<GestureDetector> {
_scale = _ensureDisposed(_scale);
} else {
assert(_pan == null); // Scale is a superset of pan; just use scale
_scale ??= new ScaleGestureRecognizer(router: _router, gestureArena: Pointerer.instance.gestureArena);
_scale ??= new ScaleGestureRecognizer(router: _router, gestureArena: Gesturer.instance.gestureArena);
_scale
..onStart = config.onScaleStart
..onUpdate = config.onScaleUpdate
......
......@@ -25,7 +25,7 @@ enum EnginePhase {
composite
}
class TestRenderingFlutterBinding extends BindingBase with Scheduler, Renderer, Pointerer {
class TestRenderingFlutterBinding extends BindingBase with Scheduler, Renderer, Gesturer {
void initRenderView() {
if (renderView == null) {
renderView = new TestRenderView();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment