patch-evtouch_c 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. --- xf86-input-evtouch-0.8.8.orig/evtouch.c 2008-11-11 09:47:55.000000000 +0100
  2. +++ xf86-input-evtouch-0.8.8/evtouch.c 2010-01-08 17:14:02.000000000 +0100
  3. @@ -30,8 +30,8 @@
  4. #define _evdev_touch_C_
  5. -#include <xf86Version.h>
  6. -#if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(3,9,0,0,0)
  7. +#include <xorgVersion.h>
  8. +#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(3,9,0,0,0)
  9. #define XFREE86_V4
  10. #endif
  11. @@ -74,7 +74,6 @@
  12. #include "xf86_OSproc.h"
  13. #include "xf86Xinput.h"
  14. #include "exevents.h"
  15. -#include "xf86OSmouse.h"
  16. #include "randrstr.h"
  17. #ifndef NEED_XF86_TYPES
  18. @@ -139,7 +138,7 @@ static XF86ModuleVersionInfo VersionRec
  19. "Kenan Esau",
  20. MODINFOSTRING1,
  21. MODINFOSTRING2,
  22. - XF86_VERSION_CURRENT,
  23. + XORG_VERSION_CURRENT,
  24. 0, 8, 8,
  25. ABI_CLASS_XINPUT,
  26. ABI_XINPUT_VERSION,
  27. @@ -167,7 +166,7 @@ Unplug(pointer p)
  28. }
  29. -XF86ModuleData evtouchModuleData = {&VersionRec, Plug, Unplug };
  30. +_X_EXPORT XF86ModuleData evtouchModuleData = {&VersionRec, Plug, Unplug };
  31. #endif /* XFree86LOADER */
  32. @@ -306,7 +305,7 @@ void EVTouchProcessAbs(EVTouchPrivatePtr
  33. }
  34. if (pos_changed == 1) {
  35. -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 2
  36. +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 2
  37. ConvertProc(priv->local, 0, 2,
  38. priv->raw_x, priv->raw_y,
  39. 0, 0, 0, 0,
  40. @@ -370,7 +369,7 @@ void EVTouchProcessRel(EVTouchPrivatePtr
  41. priv->raw_y = priv->min_y;
  42. }
  43. -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 2
  44. +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 2
  45. ConvertProc(priv->local, 0, 2,
  46. priv->raw_x, priv->raw_y,
  47. 0, 0, 0, 0,
  48. @@ -591,6 +590,10 @@ DeviceInit (DeviceIntPtr dev)
  49. EVTouchPrivatePtr priv = (EVTouchPrivatePtr) (local->private);
  50. unsigned char map[EV_MAX_BUTTONS];
  51. int i;
  52. +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
  53. + Atom btn_label;
  54. + Atom axis_labels[2] = { 0, 0 };
  55. +#endif
  56. for (i = 0; i < EV_MAX_BUTTONS; i++)
  57. map[i] = i;
  58. @@ -629,7 +632,11 @@ DeviceInit (DeviceIntPtr dev)
  59. /*
  60. * Device reports button press for 5 buttons.
  61. */
  62. - if (InitButtonClassDeviceStruct (dev, EV_MAX_BUTTONS, map) == FALSE)
  63. + if (InitButtonClassDeviceStruct (dev, EV_MAX_BUTTONS,
  64. +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
  65. + &btn_label,
  66. +#endif
  67. + map) == FALSE)
  68. {
  69. ErrorF("Unable to allocate EVTouch touchscreen ButtonClassDeviceStruct\n");
  70. return BadAlloc;
  71. @@ -653,28 +660,34 @@ DeviceInit (DeviceIntPtr dev)
  72. * Device reports motions on 2 axes in absolute coordinates.
  73. * Axes min and max values are reported in raw coordinates.
  74. */
  75. - if (InitValuatorClassDeviceStruct(dev, 2, xf86GetMotionEvents,
  76. - local->history_size, Absolute) == FALSE)
  77. + if (InitValuatorClassDeviceStruct(dev, 2,
  78. +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
  79. + axis_labels,
  80. +#endif
  81. + local->history_size, Absolute) == FALSE)
  82. {
  83. ErrorF ("Unable to allocate EVTouch touchscreen ValuatorClassDeviceStruct\n");
  84. return !Success;
  85. }
  86. -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 2
  87. - xf86InitValuatorAxisStruct(dev, 0, 0, priv->screen_width,
  88. + xf86InitValuatorAxisStruct(dev, 0,
  89. +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
  90. + axis_labels[0],
  91. +#endif
  92. + 0, priv->screen_width,
  93. 1024,
  94. EV_AXIS_MIN_RES /* min_res */ ,
  95. EV_AXIS_MAX_RES /* max_res */ );
  96. xf86InitValuatorDefaults(dev, 0);
  97. - xf86InitValuatorAxisStruct(dev, 1, 0, priv->screen_height,
  98. + xf86InitValuatorAxisStruct(dev, 1,
  99. +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
  100. + axis_labels[1],
  101. +#endif
  102. + 0, priv->screen_height,
  103. 1024,
  104. EV_AXIS_MIN_RES /* min_res */ ,
  105. EV_AXIS_MAX_RES /* max_res */ );
  106. xf86InitValuatorDefaults(dev, 1);
  107. -#else
  108. - xf86InitValuatorAxisStruct(dev, 0, priv->min_x, priv->max_x,
  109. - xf86InitValuatorDefaults(dev, 1);
  110. -#endif
  111. /* Initial position of pointer on screen: Centered */
  112. priv->cur_x=(priv->max_x - priv->min_x)/2;