wok rev 6641

xorg-xf86-input-evtouch: update to new xorg
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Oct 10 22:25:46 2010 +0200 (2010-10-10)
parents 7130b9831b50
children abe49bb6afff
files xorg-xf86-input-evtouch/receipt xorg-xf86-input-evtouch/stuff/evtouch.u
line diff
     1.1 --- a/xorg-xf86-input-evtouch/receipt	Sun Oct 10 15:15:08 2010 +0000
     1.2 +++ b/xorg-xf86-input-evtouch/receipt	Sun Oct 10 22:25:46 2010 +0200
     1.3 @@ -17,6 +17,7 @@
     1.4  compile_rules()
     1.5  {
     1.6      cd $src
     1.7 +    grep -qs dummy evtouch.c && patch -p1 < ../stuff/evtouch.u
     1.8      ./configure \
     1.9      	--prefix=/usr \
    1.10      	--sysconfdir=/etc \
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/xorg-xf86-input-evtouch/stuff/evtouch.u	Sun Oct 10 22:25:46 2010 +0200
     2.3 @@ -0,0 +1,178 @@
     2.4 +Remove unused variables and code just to make gcc happy
     2.5 +
     2.6 +Index: xserver-xorg-input-evtouch/evtouch.c
     2.7 +===================================================================
     2.8 +--- xserver-xorg-input-evtouch.orig/evtouch.c	2009-01-21 20:06:50.647249439 +0900
     2.9 ++++ xserver-xorg-input-evtouch/evtouch.c	2009-01-21 20:07:39.518253785 +0900
    2.10 +@@ -352,7 +352,6 @@ void EVTouchProcessAbs(EVTouchPrivatePtr
    2.11 + void EVTouchProcessRel(EVTouchPrivatePtr priv)
    2.12 + {
    2.13 +         struct input_event *ev; /* packet being/just read */
    2.14 +-        int dummy;
    2.15 + 
    2.16 +         ev = &priv->ev;
    2.17 +         if ( ev->code == REL_X ) {
    2.18 +@@ -745,17 +744,6 @@ EVTouchNewPacket (EVTouchPrivatePtr priv
    2.19 + 
    2.20 + 
    2.21 + 
    2.22 +-static unsigned char
    2.23 +-EVTouchRead(EVTouchPrivatePtr priv)
    2.24 +-{
    2.25 +-        unsigned char c;
    2.26 +-        XisbBlockDuration (priv->buffer, EV_TIMEOUT);
    2.27 +-        c = XisbRead(priv->buffer);
    2.28 +-        return (c);
    2.29 +-}
    2.30 +-
    2.31 +-
    2.32 +-
    2.33 + static Bool
    2.34 + EVTouchGetPacket (EVTouchPrivatePtr priv)
    2.35 + {
    2.36 +From: Thomas Jaeger <ThJaeger@gmail.com>
    2.37 +Date: Sun, 22 Mar 2009 20:58:58 -0400
    2.38 +Subject: Make calibration work on xserver-1.6
    2.39 +
    2.40 +Stolen from Ubuntu.
    2.41 +
    2.42 +Index: xserver-xorg-input-evtouch/ev_calibrate.c
    2.43 +===================================================================
    2.44 +--- xserver-xorg-input-evtouch.orig/ev_calibrate.c
    2.45 ++++ xserver-xorg-input-evtouch/ev_calibrate.c
    2.46 +@@ -218,7 +218,7 @@
    2.47 +         int cap_style = CapButt;        /* style of the line's edje and */
    2.48 +         int join_style = JoinBevel;        /*  joined lines.                */
    2.49 + 
    2.50 +-        int event_mask = ExposureMask | ButtonReleaseMask | PointerMotionMask | KeyPressMask;
    2.51 ++        int event_mask = ExposureMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask | KeyPressMask;
    2.52 + 
    2.53 +         int depth;
    2.54 +         int screen_num;
    2.55 +Index: xserver-xorg-input-evtouch/evtouch.c
    2.56 +===================================================================
    2.57 +--- xserver-xorg-input-evtouch.orig/evtouch.c
    2.58 ++++ xserver-xorg-input-evtouch/evtouch.c
    2.59 +@@ -306,7 +306,7 @@
    2.60 + 	}
    2.61 + 
    2.62 +         if (pos_changed == 1) {
    2.63 +-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 2
    2.64 ++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 2
    2.65 +                 ConvertProc(priv->local, 0, 2, 
    2.66 +                             priv->raw_x, priv->raw_y,
    2.67 +                             0, 0, 0, 0, 
    2.68 +@@ -369,7 +369,7 @@
    2.69 +                         priv->raw_y = priv->min_y;
    2.70 +         }
    2.71 + 
    2.72 +-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 2
    2.73 ++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 2
    2.74 +         ConvertProc(priv->local, 0, 2,
    2.75 +                     priv->raw_x, priv->raw_y,
    2.76 +                     0, 0, 0, 0,
    2.77 +Index: xserver-xorg-input-evtouch/evtouch.c
    2.78 +===================================================================
    2.79 +--- xserver-xorg-input-evtouch.orig/evtouch.c
    2.80 ++++ xserver-xorg-input-evtouch/evtouch.c
    2.81 +@@ -30,10 +30,8 @@
    2.82 + 
    2.83 + #define _evdev_touch_C_
    2.84 + 
    2.85 +-#include <xf86Version.h>
    2.86 +-#if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(3,9,0,0,0)
    2.87 ++#include <xorgVersion.h>
    2.88 + #define XFREE86_V4
    2.89 +-#endif
    2.90 + 
    2.91 + /*****************************************************************************
    2.92 +  *        Standard Headers
    2.93 +@@ -74,7 +72,6 @@
    2.94 + #include "xf86_OSproc.h"
    2.95 + #include "xf86Xinput.h"
    2.96 + #include "exevents.h"
    2.97 +-#include "xf86OSmouse.h"
    2.98 + #include "randrstr.h"
    2.99 + 
   2.100 + #ifndef NEED_XF86_TYPES
   2.101 +@@ -139,7 +136,7 @@
   2.102 +         "Kenan Esau",
   2.103 +         MODINFOSTRING1,
   2.104 +         MODINFOSTRING2,
   2.105 +-        XF86_VERSION_CURRENT,
   2.106 ++        XORG_VERSION_CURRENT,
   2.107 +         0, 8, 8,
   2.108 +         ABI_CLASS_XINPUT,
   2.109 +         ABI_XINPUT_VERSION,
   2.110 +@@ -590,6 +587,10 @@
   2.111 +         EVTouchPrivatePtr priv = (EVTouchPrivatePtr) (local->private);
   2.112 +         unsigned char map[EV_MAX_BUTTONS];
   2.113 +         int i;
   2.114 ++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
   2.115 ++	Atom btn_label;
   2.116 ++	Atom axis_labels[2] = { 0, 0 };
   2.117 ++#endif
   2.118 + 
   2.119 +         for (i = 0; i < EV_MAX_BUTTONS; i++)
   2.120 +                 map[i] = i;
   2.121 +@@ -628,7 +629,11 @@
   2.122 +         /* 
   2.123 +          * Device reports button press for 5 buttons.
   2.124 +          */
   2.125 +-        if (InitButtonClassDeviceStruct (dev, EV_MAX_BUTTONS, map) == FALSE)
   2.126 ++        if (InitButtonClassDeviceStruct (dev, EV_MAX_BUTTONS,
   2.127 ++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
   2.128 ++					 &btn_label,
   2.129 ++#endif
   2.130 ++					 map) == FALSE)
   2.131 +         {
   2.132 +                 ErrorF("Unable to allocate EVTouch touchscreen ButtonClassDeviceStruct\n");
   2.133 +                 return BadAlloc;
   2.134 +@@ -652,26 +657,43 @@
   2.135 +          * Device reports motions on 2 axes in absolute coordinates.
   2.136 +          * Axes min and max values are reported in raw coordinates.
   2.137 +          */
   2.138 +-        if (InitValuatorClassDeviceStruct(dev, 2, xf86GetMotionEvents,
   2.139 ++        if (InitValuatorClassDeviceStruct(dev, 2,
   2.140 ++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
   2.141 ++					  axis_labels,
   2.142 ++#endif
   2.143 ++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3
   2.144 ++                                          xf86GetMotionEvents,
   2.145 ++#endif
   2.146 +                                           local->history_size, Absolute) == FALSE)
   2.147 +         {
   2.148 +                 ErrorF ("Unable to allocate EVTouch touchscreen ValuatorClassDeviceStruct\n");
   2.149 +                 return !Success;
   2.150 +         }
   2.151 + 
   2.152 +-#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 2
   2.153 +-        xf86InitValuatorAxisStruct(dev, 0, 0, priv->screen_width,
   2.154 ++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 2
   2.155 ++        xf86InitValuatorAxisStruct(dev, 0,
   2.156 ++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
   2.157 ++				   axis_labels[0],
   2.158 ++#endif
   2.159 ++				   0, priv->screen_width,
   2.160 +                                    1024,
   2.161 +                                    EV_AXIS_MIN_RES /* min_res */ ,
   2.162 +                                    EV_AXIS_MAX_RES /* max_res */ );
   2.163 +         xf86InitValuatorDefaults(dev, 0);
   2.164 +-        xf86InitValuatorAxisStruct(dev, 1, 0, priv->screen_height,
   2.165 ++        xf86InitValuatorAxisStruct(dev, 1,
   2.166 ++#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
   2.167 ++				   axis_labels[1],
   2.168 ++#endif
   2.169 ++				   0, priv->screen_height,
   2.170 +                                    1024,
   2.171 +                                    EV_AXIS_MIN_RES /* min_res */ ,
   2.172 +                                    EV_AXIS_MAX_RES /* max_res */ );
   2.173 +         xf86InitValuatorDefaults(dev, 1);
   2.174 + #else
   2.175 + 	xf86InitValuatorAxisStruct(dev, 0, priv->min_x, priv->max_x,
   2.176 ++                                   1024,
   2.177 ++                                   EV_AXIS_MIN_RES /* min_res */ ,
   2.178 ++                                   EV_AXIS_MAX_RES /* max_res */ );
   2.179 +         xf86InitValuatorDefaults(dev, 1);
   2.180 + #endif
   2.181 +