touchui: support XInput2 multitouch

Use XI2 multitouch events instead of mouse events as touch event input for touchui build.

Note: XI MT will be supported in X server 1.12 and XI2.2. Please use build switch "use_xi2_mt=<minor version number>" to specify the minimum XI2 minor version. It is useful to test on experimental XI2.1 with MT support (e.g. build with use_xi2_mt=1).

BUG=95150
TEST=(1) build with touchui=1 use_xi2_mt=1 (2) test on ubuntu 11.04 (X server 1.10 and XI2.1 with experimental MT support). (3) manually test if touch works on browser UI and JS touch events.

Review URL: http://codereview.chromium.org/7792094
Patch from Ningxin Hu <[email protected]>.

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102668 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/build/common.gypi b/build/common.gypi
index 80692ab2..d58062d 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -207,6 +207,12 @@
       # Webrtc compilation is enabled by default. Set to 0 to disable.
       'enable_webrtc%': 1,
 
+      # XInput2 multitouch support is disabled by default (use_xi2_mt=0).
+      # Setting to non-zero value enables XI2 MT. When XI2 MT is enabled,
+      # the input value also defines the required XI2 minor minimum version.
+      # For example, use_xi2_mt=2 means XI2.2 or above version is required.
+      'use_xi2_mt%': 0,
+
       'conditions': [
         # TODO(epoger): Figure out how to set use_skia=1 for Mac outside of
         # the 'conditions' clause.  Initial attempts resulted in chromium and
@@ -313,6 +319,7 @@
     'enable_flapper_hacks%': '<(enable_flapper_hacks)',
     'chromeos%': '<(chromeos)',
     'touchui%': '<(touchui)',
+    'use_xi2_mt%':'<(use_xi2_mt)',
     'file_manager_extension%': '<(file_manager_extension)',
     'webui_task_manager%': '<(webui_task_manager)',
     'inside_chromium_build%': '<(inside_chromium_build)',
@@ -868,6 +875,9 @@
       ['touchui==1', {
         'defines': ['TOUCH_UI=1'],
       }],
+      ['use_xi2_mt!=0', {
+        'defines': ['USE_XI2_MT=<(use_xi2_mt)'],
+      }],
       ['use_wayland==1', {
         'defines': ['USE_WAYLAND=1', 'WL_EGL_PLATFORM=1'],
       }],