您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
106 行
3.4 KiB
106 行
3.4 KiB
using System;
|
|
using Unity.UIWidgets.foundation;
|
|
using Unity.UIWidgets.ui;
|
|
|
|
namespace Unity.UIWidgets.gestures {
|
|
public class DragDownDetails {
|
|
public DragDownDetails(
|
|
Offset globalPosition = null,
|
|
Offset localPosition = null
|
|
) {
|
|
this.globalPosition = globalPosition ?? Offset.zero;
|
|
this.localPosition = localPosition ?? this.globalPosition;
|
|
}
|
|
|
|
public readonly Offset globalPosition;
|
|
public readonly Offset localPosition;
|
|
|
|
public override string ToString() {
|
|
return this.GetType() + "(" + this.globalPosition + ")";
|
|
}
|
|
}
|
|
|
|
public delegate void GestureDragDownCallback(DragDownDetails details);
|
|
|
|
public class DragStartDetails {
|
|
public DragStartDetails(
|
|
TimeSpan sourceTimeStamp,
|
|
Offset globalPosition = null,
|
|
Offset localPosition = null
|
|
) {
|
|
this.sourceTimeStamp = sourceTimeStamp;
|
|
this.globalPosition = globalPosition ?? Offset.zero;
|
|
this.localPosition = localPosition ?? this.globalPosition;
|
|
}
|
|
|
|
public readonly TimeSpan sourceTimeStamp;
|
|
|
|
public readonly Offset globalPosition;
|
|
public readonly Offset localPosition;
|
|
|
|
public override string ToString() {
|
|
return this.GetType() + "(" + this.globalPosition + ")";
|
|
}
|
|
}
|
|
|
|
public delegate void GestureDragStartCallback(DragStartDetails details);
|
|
|
|
public class DragUpdateDetails {
|
|
public DragUpdateDetails(
|
|
TimeSpan sourceTimeStamp,
|
|
Offset delta = null,
|
|
float? primaryDelta = null,
|
|
Offset globalPosition = null,
|
|
Offset localPosition = null,
|
|
bool isScroll = false) {
|
|
this.sourceTimeStamp = sourceTimeStamp;
|
|
this.delta = delta ?? Offset.zero;
|
|
this.primaryDelta = primaryDelta;
|
|
this.globalPosition = globalPosition ?? Offset.zero;
|
|
this.localPosition = localPosition ?? this.globalPosition;
|
|
this.isScroll = isScroll;
|
|
D.assert(primaryDelta == null
|
|
|| primaryDelta == this.delta.dx && this.delta.dy == 0.0
|
|
|| primaryDelta == this.delta.dy && this.delta.dx == 0.0);
|
|
}
|
|
|
|
public readonly TimeSpan sourceTimeStamp;
|
|
|
|
public readonly Offset delta;
|
|
|
|
public readonly float? primaryDelta;
|
|
|
|
public readonly Offset globalPosition;
|
|
public readonly Offset localPosition;
|
|
|
|
public readonly bool isScroll;
|
|
|
|
public override string ToString() {
|
|
return this.GetType() + "(" + this.delta + ")";
|
|
}
|
|
}
|
|
|
|
public delegate void GestureDragUpdateCallback(DragUpdateDetails details);
|
|
|
|
public class DragEndDetails {
|
|
public DragEndDetails(
|
|
Velocity velocity = null,
|
|
float? primaryVelocity = null
|
|
) {
|
|
this.velocity = velocity ?? Velocity.zero;
|
|
this.primaryVelocity = primaryVelocity;
|
|
|
|
D.assert(primaryVelocity == null
|
|
|| primaryVelocity == this.velocity.pixelsPerSecond.dx
|
|
|| primaryVelocity == this.velocity.pixelsPerSecond.dy);
|
|
}
|
|
|
|
public readonly Velocity velocity;
|
|
|
|
public readonly float? primaryVelocity;
|
|
|
|
public override string ToString() {
|
|
return this.GetType() + "(" + this.velocity + ")";
|
|
}
|
|
}
|
|
}
|