public WindowsTouch(Window window, ScreenSpace screen)
 {
     var positionTranslator = new CursorPositionTranslater(window, screen);
     touches = new TouchCollection(positionTranslator);
     hook = new TouchHook(window);
     IsAvailable = CheckIfWindows7OrHigher();
 }
 private void CheckQuadraticSpaceInLandscape(ScreenSpace screen)
 {
     var quadSize = screen.FromPixelSpace(new Point(0, 0));
     Assert.AreEqual(new Point(0f, 0.2f), quadSize);
     quadSize = screen.FromPixelSpace(new Point(800, 480));
     Assert.AreEqual(new Point(1, 0.8f), quadSize);
 }
 private void CheckPixelSpaceInPortrait(ScreenSpace screen)
 {
     var pixelSize = screen.ToPixelSpace(new Point(0.2f, 0));
     Assert.AreEqual(Point.Zero, pixelSize);
     pixelSize = screen.ToPixelSpace(new Point(0.8f, 1));
     Assert.AreEqual(new Point(480, 800), pixelSize);
 }
 private void CheckPixelSpaceInLandscape(ScreenSpace screen)
 {
     var pixelSize = screen.ToPixelSpace(new Point(0f, 0.2f));
     Assert.AreEqual(Point.Zero, pixelSize);
     pixelSize = screen.ToPixelSpace(new Point(1, 0.8f));
     Assert.AreEqual(new Point(800, 480), pixelSize);
 }
 public TouchCollectionUpdater(ScreenSpace screen)
 {
     this.screen = screen;
     states = new State[MaxNumberOfTouches];
     locations = new Point[MaxNumberOfTouches];
     ids = new int[MaxNumberOfTouches];
     for (int index = 0; index < MaxNumberOfTouches; index++)
         ids[index] = -1;
 }
 public CursorPositionTranslater(Window window, ScreenSpace screen)
 {
     this.window = window;
     this.screen = screen;
 }
 public XnaMockTouch(Window window, ScreenSpace screen)
 {
     TouchPanel.WindowHandle = window.Handle;
     IsAvailable = TouchPanel.GetCapabilities().IsConnected;
     touches = new TouchCollectionUpdater(screen);
 }
 private void CheckQuadraticSpaceInPortrait(ScreenSpace screen)
 {
     var quadSize = screen.FromPixelSpace(new Point(0, 0));
     Assert.AreEqual(new Point(0.2f, 0f), quadSize);
     quadSize = screen.FromPixelSpace(new Point(480, 800));
     Assert.AreEqual(new Point(0.8f, 1), quadSize);
 }