committed by
GitHub
17 changed files with 243 additions and 174 deletions
@ -0,0 +1,37 @@ |
|||
namespace Avalonia.Input.GestureRecognizers |
|||
{ |
|||
public abstract class GestureRecognizer : StyledElement |
|||
{ |
|||
protected internal IInputElement? Target { get; internal set; } |
|||
|
|||
protected abstract void PointerPressed(PointerPressedEventArgs e); |
|||
protected abstract void PointerReleased(PointerReleasedEventArgs e); |
|||
protected abstract void PointerMoved(PointerEventArgs e); |
|||
protected abstract void PointerCaptureLost(IPointer pointer); |
|||
|
|||
internal void PointerPressedInternal(PointerPressedEventArgs e) |
|||
{ |
|||
PointerPressed(e); |
|||
} |
|||
|
|||
internal void PointerReleasedInternal(PointerReleasedEventArgs e) |
|||
{ |
|||
PointerReleased(e); |
|||
} |
|||
|
|||
internal void PointerMovedInternal(PointerEventArgs e) |
|||
{ |
|||
PointerMoved(e); |
|||
} |
|||
|
|||
internal void PointerCaptureLostInternal(IPointer pointer) |
|||
{ |
|||
PointerCaptureLost(pointer); |
|||
} |
|||
|
|||
protected void Capture(IPointer pointer) |
|||
{ |
|||
(pointer as Pointer)?.CaptureGestureRecognizer(this); |
|||
} |
|||
} |
|||
} |
|||
@ -1,23 +0,0 @@ |
|||
namespace Avalonia.Input.GestureRecognizers |
|||
{ |
|||
public interface IGestureRecognizer |
|||
{ |
|||
void Initialize(IInputElement target, IGestureRecognizerActionsDispatcher actions); |
|||
void PointerPressed(PointerPressedEventArgs e); |
|||
void PointerReleased(PointerReleasedEventArgs e); |
|||
void PointerMoved(PointerEventArgs e); |
|||
void PointerCaptureLost(IPointer pointer); |
|||
} |
|||
|
|||
public interface IGestureRecognizerActionsDispatcher |
|||
{ |
|||
void Capture(IPointer pointer, IGestureRecognizer recognizer); |
|||
} |
|||
|
|||
public enum GestureRecognizerResult |
|||
{ |
|||
None, |
|||
Capture, |
|||
ReleaseCapture |
|||
} |
|||
} |
|||
Loading…
Reference in new issue