OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
3.9 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../xf86-input-fpit/0001-Cope-with-XINPUT-ABI-7.patch
  5. # Copyright (C) 2010 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. From ae95bf640db6c171609e6937bcd60fa710ce23ad Mon Sep 17 00:00:00 2001
  17. From: Peter Hutterer <peter.hutterer@who-t.net>
  18. Date: Fri, 17 Jul 2009 14:38:31 +1000
  19. Subject: [PATCH 1/3] Cope with XINPUT ABI 7.
  20. ---
  21. src/xf86Fpit.c | 40 +++++++++++++++++++++++++++++++++++-----
  22. 1 files changed, 35 insertions(+), 5 deletions(-)
  23. diff --git a/src/xf86Fpit.c b/src/xf86Fpit.c
  24. index 528ebb9..f40c6a9 100644
  25. --- a/src/xf86Fpit.c
  26. +++ b/src/xf86Fpit.c
  27. @@ -188,6 +188,9 @@ static void xf86FpitSetUpAxes(DeviceIntPtr dev, FpitPrivatePtr priv)
  28. * screen to fit one meter.
  29. */
  30. int quarter_turns;
  31. +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
  32. + Atom axis_labels[2] = { 0, 0 };
  33. +#endif
  34. priv->screen_width = screenInfo.screens[priv->screen_no]->width;
  35. priv->screen_height = screenInfo.screens[priv->screen_no]->height;
  36. @@ -212,14 +215,30 @@ static void xf86FpitSetUpAxes(DeviceIntPtr dev, FpitPrivatePtr priv)
  37. }
  38. if (priv->fpitTotalOrientation & FPIT_THEN_SWAP_XY) {
  39. - InitValuatorAxisStruct(dev, 1, priv->fpitMinX, priv->fpitMaxX, 9500, 0 /* min_res */ ,
  40. + InitValuatorAxisStruct(dev, 1,
  41. +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
  42. + axis_labels[1],
  43. +#endif
  44. + priv->fpitMinX, priv->fpitMaxX, 9500, 0 /* min_res */ ,
  45. 9500 /* max_res */ );
  46. - InitValuatorAxisStruct(dev, 0, priv->fpitMinY, priv->fpitMaxY, 10500, 0 /* min_res */ ,
  47. + InitValuatorAxisStruct(dev, 0,
  48. +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
  49. + axis_labels[0],
  50. +#endif
  51. + priv->fpitMinY, priv->fpitMaxY, 10500, 0 /* min_res */ ,
  52. 10500 /* max_res */ );
  53. } else {
  54. - InitValuatorAxisStruct(dev, 0, priv->fpitMinX, priv->fpitMaxX, 9500, 0 /* min_res */ ,
  55. + InitValuatorAxisStruct(dev, 0,
  56. +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
  57. + axis_labels[0],
  58. +#endif
  59. + priv->fpitMinY, priv->fpitMaxY, 9500, 0 /* min_res */ ,
  60. 9500 /* max_res */ );
  61. - InitValuatorAxisStruct(dev, 1, priv->fpitMinY, priv->fpitMaxY, 10500, 0 /* min_res */ ,
  62. + InitValuatorAxisStruct(dev, 1,
  63. +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
  64. + axis_labels[1],
  65. +#endif
  66. + priv->fpitMinY, priv->fpitMaxY, 10500, 0 /* min_res */ ,
  67. 10500 /* max_res */ );
  68. }
  69. }
  70. @@ -408,6 +427,10 @@ static Bool xf86FpitControl(DeviceIntPtr dev, int mode)
  71. unsigned char map[] = {
  72. 0, 1, 2, 3 /* DMC: changed this so we can use all three buttons */
  73. };
  74. +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
  75. + Atom btn_labels[3] = { 0 };
  76. + Atom axis_labels[2] = { 0, 0 };
  77. +#endif
  78. switch (mode) {
  79. @@ -420,7 +443,11 @@ static Bool xf86FpitControl(DeviceIntPtr dev, int mode)
  80. /*
  81. * Device reports button press for up to 3 buttons.
  82. */
  83. - if (InitButtonClassDeviceStruct(dev, 3, map) == FALSE) {
  84. + if (InitButtonClassDeviceStruct(dev, 3,
  85. +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
  86. + btn_labels,
  87. +#endif
  88. + map) == FALSE) {
  89. ErrorF("Unable to allocate Fpit touchscreen ButtonClassDeviceStruct\n");
  90. return !Success;
  91. }
  92. @@ -435,6 +462,9 @@ static Bool xf86FpitControl(DeviceIntPtr dev, int mode)
  93. }
  94. if (InitValuatorClassDeviceStruct(dev, 2,
  95. +#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
  96. + axis_labels,
  97. +#endif
  98. #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3
  99. xf86GetMotionEvents,
  100. #endif
  101. --
  102. 1.6.5.3