/*
* @author Valentin Simonov / http://va.lent.in/
*/
using TouchScript.Pointers;
namespace TouchScript.InputSources
{
///
/// An object which represents an input source.
///
///
/// In TouchScript all pointer points () come from input sources.
/// If you want to feed pointers to the library the best way to do it is to create a custom input source.
///
public interface IInputSource : IInputSourceLike, INTERNAL_IInputSource
{
}
///
/// Internal methods for . DO NOT CALL THESE METHODS DIRECTLY FROM YOUR CODE!
///
public interface INTERNAL_IInputSource
{
///
/// Used by to return a pointer to input source.
/// DO NOT CALL THIS METHOD DIRECTLY FROM YOUR CODE!
///
/// The pointer.
void INTERNAL_DiscardPointer(Pointer pointer);
///
/// Used by to return sync resolution on inputs.
/// DO NOT CALL THIS METHOD DIRECTLY FROM YOUR CODE!
///
void INTERNAL_UpdateResolution();
}
///
/// An object which is used by an to capture input from a device but is not itself an ,
///
public interface IInputHandler : IInputSourceLike
{
///
/// Returns a pointer to the handler.
///
/// The pointer.
/// True if the pointer was handled by the object; false otherwise.
bool DiscardPointer(Pointer pointer);
///
/// Updates resolution.
///
void UpdateResolution(int width, int height);
}
public interface IInputSourceLike
{
///
/// Gets or sets current coordinates remapper.
///
/// An object used to change coordinates of pointer points coming from this input source.
ICoordinatesRemapper CoordinatesRemapper { get; set; }
///
/// This method is called by to synchronously update the input.
///
/// True if the input source was updated; false otherwise.
bool UpdateInput();
///
/// Cancels the pointer.
///
/// The pointer.
/// if set to true returns the pointer back to the system with different id.
/// True if the pointer belongs to this Input and was successfully cancelled; false otherwise.
bool CancelPointer(Pointer pointer, bool shouldReturn);
}
}