rpms/xorg-x11-drv-aiptek/devel aiptek-1.2.0-abi.patch, NONE, 1.1 xorg-x11-drv-aiptek.spec, 1.19, 1.20

Peter Hutterer whot at fedoraproject.org
Thu Jul 16 07:07:57 UTC 2009


Author: whot

Update of /cvs/pkgs/rpms/xorg-x11-drv-aiptek/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv17886

Modified Files:
	xorg-x11-drv-aiptek.spec 
Added Files:
	aiptek-1.2.0-abi.patch 
Log Message:
* Thu Jul 16 2009 Peter Hutterer <peter.hutterer at redhat.com> 1.2.0-2
- aiptek-1.2.0-abi.patch: cope with XINPUT ABI 7.


aiptek-1.2.0-abi.patch:

--- NEW FILE aiptek-1.2.0-abi.patch ---
>From f440e333bb535854ed25e258fc502b1b6a8d5e44 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer at who-t.net>
Date: Mon, 22 Jun 2009 14:12:23 +1000
Subject: [PATCH] Cope with ABI_XINPUT_VERSION 7 - requires button/axes labeling

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/xf86Aiptek.c |   52 +++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 47 insertions(+), 5 deletions(-)

diff --git a/src/xf86Aiptek.c b/src/xf86Aiptek.c
index a26ca60..8402c85 100644
--- a/src/xf86Aiptek.c
+++ b/src/xf86Aiptek.c
@@ -126,6 +126,12 @@
 #include <string.h>
 #include <math.h>
 
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+#include <X11/Xatom.h>
+#include <xserver-properties.h>
+#endif
+
+
 static const char identification[] = "$Identification: 0 $";
 static InputDriverPtr aiptekDrv;
 static int debug_level = INI_DEBUG_LEVEL;
@@ -1499,6 +1505,9 @@ xf86AiptekOpenDevice(DeviceIntPtr pDriver)
      */
     InitValuatorAxisStruct(pDriver,                 /* X resolution */
                0,                                   /* axis_id */
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+               XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X),
+#endif
                0,                                   /* min value */
                device->xBottom - device->xTop,      /* max value */
                LPI2CPM(375),                        /* resolution */
@@ -1507,6 +1516,9 @@ xf86AiptekOpenDevice(DeviceIntPtr pDriver)
 
     InitValuatorAxisStruct(pDriver,                 /* Y Resolution */
                1,                                   /* axis_id */
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+               XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y),
+#endif
                0,                                   /* min value */
                device->yBottom - device->yTop,      /* max value */
                LPI2CPM(375),                        /* resolution */
@@ -1515,6 +1527,9 @@ xf86AiptekOpenDevice(DeviceIntPtr pDriver)
 
     InitValuatorAxisStruct(pDriver,                 /* Pressure */
                2,                                   /* axis_id */
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+               XIGetKnownProperty(AXIS_LABEL_PROP_ABS_PRESSURE),
+#endif
                0,                                   /* min value */
                511,                                 /* max value */
                512,                                 /* resolution */
@@ -1523,6 +1538,9 @@ xf86AiptekOpenDevice(DeviceIntPtr pDriver)
 
     InitValuatorAxisStruct(pDriver,                 /* xTilt */
                3,                                   /* axis id */
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+               XIGetKnownProperty(AXIS_LABEL_PROP_ABS_TILT_X),
+#endif
                -128,                                /* min value */
                127,                                 /* max value */
                256,                                 /* resolution */
@@ -1531,6 +1549,9 @@ xf86AiptekOpenDevice(DeviceIntPtr pDriver)
 
     InitValuatorAxisStruct(pDriver,                 /* yTilt */
                4,                                   /* axis_id */
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+               XIGetKnownProperty(AXIS_LABEL_PROP_ABS_TILT_Y),
+#endif
                -128,                                /* min value */
                127,                                 /* max value */
                256,                                 /* resolution */
@@ -1554,11 +1575,15 @@ static int
 xf86AiptekProc(DeviceIntPtr pAiptek, int requestCode)
 {
     CARD8           map[512+1];
-    int             numAxes;
-    int             numButtons;
+    int             numAxes = 5; /* X, Y, Z, xTilt, yTilt */
+    int             numButtons = 5;
     int             loop;
     LocalDevicePtr  local  = (LocalDevicePtr)pAiptek->public.devicePrivate;
     AiptekDevicePtr device = (AiptekDevicePtr)PRIVATE(pAiptek);
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+    Atom            btn_labels[numAxes];
+    Atom            axes_labels[numButtons];
+#endif
 
     DBG(2, ErrorF("xf86AiptekProc() type=%s flags=%d request=%d\n",
               (DEVICE_ID(device->flags) == STYLUS_ID) ? "stylus" :
@@ -1570,15 +1595,27 @@ xf86AiptekProc(DeviceIntPtr pAiptek, int requestCode)
         case DEVICE_INIT:
         {
             DBG(1, ErrorF("xf86AiptekProc request=INIT\n"));
-            numAxes    = 5;            /* X, Y, Z, xTilt, yTilt */
-            numButtons = 5;
 
             for(loop=1; loop<=numButtons; ++loop)
             {
                 map[loop] = loop;
             }
 
-            if (InitButtonClassDeviceStruct(pAiptek,numButtons,map) == FALSE)
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+            btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT);
+            btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE);
+            btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT);
+            btn_labels[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP);
+            btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN);
+
+            memset(axes_labels, 0, sizeof(axes_labels));
+#endif
+
+            if (InitButtonClassDeviceStruct(pAiptek,numButtons,
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+                        btn_labels,
+#endif
+                        map) == FALSE)
             {
                 ErrorF("Unable to init Button Class Device\n");
                 return !Success;
@@ -1609,8 +1646,13 @@ xf86AiptekProc(DeviceIntPtr pAiptek, int requestCode)
                 return !Success;
             }
 
+            /* we don't label the axes here, done later in
+             * xf86AiptedOpenDevice */
             if (InitValuatorClassDeviceStruct(pAiptek,
                    numAxes,
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
+                   axes_labels,
+#endif
 #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3
                    xf86GetMotionEvents,
 #endif
-- 
1.6.3.rc1.2.g0164.dirty



Index: xorg-x11-drv-aiptek.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-aiptek/devel/xorg-x11-drv-aiptek.spec,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -p -r1.19 -r1.20
--- xorg-x11-drv-aiptek.spec	15 Jul 2009 15:45:17 -0000	1.19
+++ xorg-x11-drv-aiptek.spec	16 Jul 2009 07:07:25 -0000	1.20
@@ -5,7 +5,7 @@
 Summary:   Xorg X11 aiptek input driver
 Name:      xorg-x11-drv-aiptek
 Version: 1.2.0
-Release: 1%{?dist}.1
+Release: 2%{?dist}
 URL:       http://www.x.org
 License:   MIT
 Group:     User Interface/X Hardware Support
@@ -13,6 +13,8 @@ BuildRoot: %{_tmppath}/%{name}-%{version
 
 Source0:   ftp://ftp.x.org/pub/individual/driver/%{tarball}-%{version}.tar.bz2
 
+Patch1:    aiptek-1.2.0-abi.patch
+
 ExcludeArch: s390 s390x
 
 BuildRequires: xorg-x11-server-sdk >= 1.3.0.0-6
@@ -24,6 +26,7 @@ X.Org X11 aiptek input driver.
 
 %prep
 %setup -q -n %{tarball}-%{version}
+%patch1 -p1
 
 %build
 %configure --disable-static
@@ -47,6 +50,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man4/aiptek.4*
 
 %changelog
+* Thu Jul 16 2009 Peter Hutterer <peter.hutterer at redhat.com> 1.2.0-2
+- aiptek-1.2.0-abi.patch: cope with XINPUT ABI 7.
+
 * Wed Jul 15 2009 Adam Jackson <ajax at redhat.com> - 1.2.0-1.1
 - ABI bump
 




More information about the scm-commits mailing list