2012-08-09 09:45:04 +00:00
|
|
|
using System;
|
2012-08-22 09:51:35 +00:00
|
|
|
using ANX.Framework.NonXNA;
|
|
|
|
using ANX.Framework.NonXNA.InputSystem;
|
2011-11-17 20:35:25 +00:00
|
|
|
|
2012-08-09 09:45:04 +00:00
|
|
|
// This file is part of the ANX.Framework created by the
|
|
|
|
// "ANX.Framework developer group" and released under the Ms-PL license.
|
|
|
|
// For details see: http://anxframework.codeplex.com/license
|
2011-11-17 20:35:25 +00:00
|
|
|
|
|
|
|
namespace ANX.Framework.Input.Touch
|
|
|
|
{
|
2012-01-16 20:08:38 +00:00
|
|
|
public static class TouchPanel
|
2011-11-17 20:35:25 +00:00
|
|
|
{
|
2012-08-22 09:51:35 +00:00
|
|
|
#region Private
|
|
|
|
private static ITouchPanel nativeTouchPanel;
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region Public
|
2012-01-16 20:08:38 +00:00
|
|
|
public static GestureType EnabledGestures
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
2012-08-22 09:51:35 +00:00
|
|
|
return nativeTouchPanel.EnabledGestures;
|
2012-01-16 20:08:38 +00:00
|
|
|
}
|
|
|
|
set
|
|
|
|
{
|
2012-08-22 09:51:35 +00:00
|
|
|
nativeTouchPanel.EnabledGestures = value;
|
2012-01-16 20:08:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static bool IsGestureAvailable
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
2012-08-22 09:51:35 +00:00
|
|
|
return nativeTouchPanel.IsGestureAvailable;
|
2012-01-16 20:08:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static IntPtr WindowHandle
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
2012-08-22 09:51:35 +00:00
|
|
|
return nativeTouchPanel.WindowHandle;
|
2012-01-16 20:08:38 +00:00
|
|
|
}
|
|
|
|
set
|
|
|
|
{
|
2012-08-22 09:51:35 +00:00
|
|
|
nativeTouchPanel.WindowHandle = value;
|
2012-01-16 20:08:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static DisplayOrientation DisplayOrientation
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
2012-08-22 09:51:35 +00:00
|
|
|
return nativeTouchPanel.DisplayOrientation;
|
2012-01-16 20:08:38 +00:00
|
|
|
}
|
|
|
|
set
|
|
|
|
{
|
2012-08-22 09:51:35 +00:00
|
|
|
nativeTouchPanel.DisplayOrientation = value;
|
2012-01-16 20:08:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static int DisplayWidth
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
2012-08-22 09:51:35 +00:00
|
|
|
return nativeTouchPanel.DisplayWidth;
|
2012-01-16 20:08:38 +00:00
|
|
|
}
|
|
|
|
set
|
|
|
|
{
|
2012-08-22 09:51:35 +00:00
|
|
|
nativeTouchPanel.DisplayWidth = value;
|
2012-01-16 20:08:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static int DisplayHeight
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
2012-08-22 09:51:35 +00:00
|
|
|
return nativeTouchPanel.DisplayHeight;
|
2012-01-16 20:08:38 +00:00
|
|
|
}
|
|
|
|
set
|
|
|
|
{
|
2012-08-22 09:51:35 +00:00
|
|
|
nativeTouchPanel.DisplayHeight = value;
|
2012-01-16 20:08:38 +00:00
|
|
|
}
|
|
|
|
}
|
2012-08-22 09:51:35 +00:00
|
|
|
#endregion
|
|
|
|
|
|
|
|
#region Constructor
|
|
|
|
static TouchPanel()
|
|
|
|
{
|
|
|
|
nativeTouchPanel = AddInSystemFactory.Instance.GetDefaultCreator<IInputSystemCreator>().TouchPanel;
|
|
|
|
}
|
|
|
|
#endregion
|
2012-01-16 20:08:38 +00:00
|
|
|
|
2012-08-22 09:51:35 +00:00
|
|
|
#region GetCapabilities
|
2012-01-16 20:08:38 +00:00
|
|
|
public static TouchPanelCapabilities GetCapabilities()
|
|
|
|
{
|
2012-08-22 09:51:35 +00:00
|
|
|
return nativeTouchPanel.GetCapabilities();
|
2012-01-16 20:08:38 +00:00
|
|
|
}
|
2012-08-22 09:51:35 +00:00
|
|
|
#endregion
|
2012-01-16 20:08:38 +00:00
|
|
|
|
2012-08-22 09:51:35 +00:00
|
|
|
#region ReadGesture
|
2012-01-16 20:08:38 +00:00
|
|
|
public static GestureSample ReadGesture()
|
|
|
|
{
|
2012-08-22 09:51:35 +00:00
|
|
|
return nativeTouchPanel.ReadGesture();
|
2012-01-16 20:08:38 +00:00
|
|
|
}
|
2012-08-22 09:51:35 +00:00
|
|
|
#endregion
|
2012-01-16 20:08:38 +00:00
|
|
|
|
2012-08-22 09:51:35 +00:00
|
|
|
#region GetState
|
2012-01-16 20:08:38 +00:00
|
|
|
public static TouchCollection GetState()
|
|
|
|
{
|
2012-08-22 09:51:35 +00:00
|
|
|
return nativeTouchPanel.GetState();
|
2012-01-16 20:08:38 +00:00
|
|
|
}
|
2012-08-22 09:51:35 +00:00
|
|
|
#endregion
|
2011-11-17 20:35:25 +00:00
|
|
|
}
|
|
|
|
}
|