Advertisement
awatch

MER Mtev patch

Nov 27th, 2013
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.45 KB | None | 0 0
  1. diff -Naurp xorg-x11-drv-mtev-0.1.13-orig/src/multitouch.c xorg-x11-drv-mtev-0.1.13/src/multitouch.c
  2. --- xorg-x11-drv-mtev-0.1.13-orig/src/multitouch.c  2011-05-17 19:38:39.103481362 +0800
  3. +++ xorg-x11-drv-mtev-0.1.13/src/multitouch.c   2011-05-18 02:06:33.383651975 +0800
  4. @@ -33,6 +33,11 @@
  5.  #include "common.h"
  6.  #include "mtouch.h"
  7.  
  8. +typedef InputInfoPtr LocalDevicePtr;
  9. +#define XI86_POINTER_CAPABLE   0x40 /* capable of being a core pointer */
  10. +#define XI86_SEND_DRAG_EVENTS  0x08
  11. +#define XI86_CONFIGURED        0x02 /* the device has been configured */
  12. +
  13.  static const char* const axis_labels_str[] = {
  14.     AXIS_LABEL_PROP_ABS_MT_POSITION_X,
  15.     AXIS_LABEL_PROP_ABS_MT_POSITION_Y,
  16. @@ -208,7 +213,7 @@ static int device_init(DeviceIntPtr dev,
  17.             xf86InitValuatorAxisStruct(dev, val, axes_labels[val],
  18.                            min,
  19.                            max,
  20. -                          1, 0, 1);
  21. +                          1, 0, 1, Absolute);
  22.             xf86InitValuatorDefaults(dev, val);
  23.         }
  24.     }
  25. @@ -354,17 +359,18 @@ static Bool device_control(DeviceIntPtr
  26.     }
  27.  }
  28.  
  29. -static InputInfoPtr preinit(InputDriverPtr drv, IDevPtr dev, int flags)
  30. +static int preinit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
  31.  {
  32.     struct mtev_mtouch *mt;
  33. -   InputInfoPtr local = xf86AllocateInput(drv, 0);
  34. -   if (!local)
  35. -       goto error;
  36. +   //InputInfoPtr local = xf86AllocateInput(drv, 0);
  37. +   //if (!local)
  38. +   //  goto error;
  39. +   InputInfoPtr local = pInfo;
  40.     mt = calloc(1, sizeof(struct mtev_mtouch));
  41.     if (!mt)
  42.         goto error;
  43.  
  44. -   local->name = dev->identifier;
  45. +   //local->name = dev->identifier;
  46.     local->type_name = XI_TOUCHSCREEN;
  47.     local->device_control = device_control;
  48.     local->read_input = read_input;
  49. @@ -372,9 +378,9 @@ static InputInfoPtr preinit(InputDriverP
  50.     local->flags = XI86_POINTER_CAPABLE |
  51.         XI86_SEND_DRAG_EVENTS;
  52.  
  53. -   local->conf_idev = dev;
  54. +   //local->conf_idev = dev;
  55.  
  56. -   xf86CollectInputOptions(local, NULL, NULL);
  57. +   xf86CollectInputOptions(local, NULL);
  58.     //xf86OptionListReport(local->options);
  59.     xf86ProcessCommonOptions(local, local->options);
  60.  
  61. @@ -385,8 +391,9 @@ static InputInfoPtr preinit(InputDriverP
  62.  
  63.     local->flags |= XI86_CONFIGURED;
  64.  
  65. +   return Success;
  66.  error:
  67. -   return local;
  68. +   return !Success;
  69.  }
  70.  
  71.  static void uninit(InputDriverPtr drv, InputInfoPtr local, int flags)
  72. @@ -403,7 +410,7 @@ static InputDriverRec MTEV = {
  73.     .PreInit = preinit,
  74.     .UnInit = uninit,
  75.     .module = NULL,
  76. -   .refCount = 0
  77. +   .default_options = NULL
  78.  };
  79.  
  80.  static XF86ModuleVersionInfo VERSION = {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement