/* * @author Valentin Simonov / http://va.lent.in/ */ #if TOUCHSCRIPT_DEBUG using System; using System.Collections.Generic; using TouchScript.Debugging.Filters; using TouchScript.InputSources; using TouchScript.Pointers; using UnityEngine; namespace TouchScript.Debugging.Loggers { /// /// A logger to record pointer events. /// public interface IPointerLogger { /// /// The number of different pointers recorded by this logger. /// int PointerCount { get; } /// /// Logs the specified event. /// /// The pointer. /// The event. void Log(Pointer pointer, PointerEvent evt); /// /// Returns a list of pointers. /// /// The filter to use. /// A list of objects. List GetFilteredPointerData(IPointerDataFilter filter = null); /// /// Returns a lost of pointer events for a pointer. /// /// The pointer id. /// The filter to use. /// A list of entries. List GetFilteredLogsForPointer(int id, IPointerLogFilter filter = null); /// /// Releases resources. /// void Dispose(); } /// /// Pointer event. /// [Serializable] public struct PointerLog { public int Id; public long Tick; public int PointerId; public PointerEvent Event; public PointerState State; } /// /// Pointer state during an event. /// [Serializable] public struct PointerState { public Pointer.PointerButtonState Buttons; public Vector2 Position; public Vector2 PreviousPosition; public uint Flags; public Transform Target; public string TargetPath; } /// /// Static pointer data. /// [Serializable] public struct PointerData { public int Id; public Pointer.PointerType Type; public IInputSource InputSource; } /// /// Pointer event type. /// public enum PointerEvent { None, IdAllocated, Added, Updated, Pressed, Released, Removed, Cancelled } } #endif