|
|
|
@ -30,6 +30,8 @@ namespace Avalonia.Input.Raw |
|
|
|
/// </summary>
|
|
|
|
public class RawPointerEventArgs : RawInputEventArgs |
|
|
|
{ |
|
|
|
private RawPointerPoint _point; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Initializes a new instance of the <see cref="RawPointerEventArgs"/> class.
|
|
|
|
/// </summary>
|
|
|
|
@ -55,11 +57,50 @@ namespace Avalonia.Input.Raw |
|
|
|
Type = type; |
|
|
|
InputModifiers = inputModifiers; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Initializes a new instance of the <see cref="RawPointerEventArgs"/> class.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="device">The associated device.</param>
|
|
|
|
/// <param name="timestamp">The event timestamp.</param>
|
|
|
|
/// <param name="root">The root from which the event originates.</param>
|
|
|
|
/// <param name="type">The type of the event.</param>
|
|
|
|
/// <param name="point">The point properties and position, in client DIPs.</param>
|
|
|
|
/// <param name="inputModifiers">The input modifiers.</param>
|
|
|
|
public RawPointerEventArgs( |
|
|
|
IInputDevice device, |
|
|
|
ulong timestamp, |
|
|
|
IInputRoot root, |
|
|
|
RawPointerEventType type, |
|
|
|
RawPointerPoint point, |
|
|
|
RawInputModifiers inputModifiers) |
|
|
|
: base(device, timestamp, root) |
|
|
|
{ |
|
|
|
Contract.Requires<ArgumentNullException>(device != null); |
|
|
|
Contract.Requires<ArgumentNullException>(root != null); |
|
|
|
|
|
|
|
Point = point; |
|
|
|
Type = type; |
|
|
|
InputModifiers = inputModifiers; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the pointer properties and position, in client DIPs.
|
|
|
|
/// </summary>
|
|
|
|
public RawPointerPoint Point |
|
|
|
{ |
|
|
|
get => _point; |
|
|
|
set => _point = value; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the mouse position, in client DIPs.
|
|
|
|
/// </summary>
|
|
|
|
public Point Position { get; set; } |
|
|
|
public Point Position |
|
|
|
{ |
|
|
|
get => _point.Position; |
|
|
|
set => _point.Position = value; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets the type of the event.
|
|
|
|
@ -75,6 +116,19 @@ namespace Avalonia.Input.Raw |
|
|
|
/// Points that were traversed by a pointer since the previous relevant event,
|
|
|
|
/// only valid for Move and TouchUpdate
|
|
|
|
/// </summary>
|
|
|
|
public IReadOnlyList<Point>? IntermediatePoints { get; set; } |
|
|
|
public Lazy<IReadOnlyList<RawPointerPoint>?>? IntermediatePoints { get; set; } |
|
|
|
} |
|
|
|
|
|
|
|
public struct RawPointerPoint |
|
|
|
{ |
|
|
|
/// <summary>
|
|
|
|
/// Pointer position, in client DIPs.
|
|
|
|
/// </summary>
|
|
|
|
public Point Position { get; set; } |
|
|
|
|
|
|
|
public RawPointerPoint() |
|
|
|
{ |
|
|
|
Position = default; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|