[Linuxwacom-devel] [PATCH 2/4] Remove unnecesary device variables: current[XY]

2014-05-07 Thread Jason Gerecke
These variables are currently used only within wcmUpdateOldState
and can be passed in as arguments rather than held as variables
in the device struct.

Signed-off-by: Jason Gerecke killert...@gmail.com
---
 src/wcmCommon.c | 14 +-
 src/xf86WacomDefs.h |  2 --
 2 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/src/wcmCommon.c b/src/wcmCommon.c
index d27ad6d..eae1ad6 100644
--- a/src/wcmCommon.c
+++ b/src/wcmCommon.c
@@ -485,16 +485,15 @@ void wcmRotateAndScaleCoordinates(InputInfoPtr pInfo, 
int* x, int* y)
 }
 
 static void wcmUpdateOldState(const InputInfoPtr pInfo,
- const WacomDeviceState *ds)
+ const WacomDeviceState *ds, int currentX, int 
currentY)
 {
const WacomDevicePtr priv = (WacomDevicePtr) pInfo-private;
 
priv-oldWheel = ds-abswheel;
priv-oldWheel2 = ds-abswheel2;
priv-oldButtons = ds-buttons;
-
-   priv-oldX = priv-currentX;
-   priv-oldY = priv-currentY;
+   priv-oldX = currentX;
+   priv-oldY = currentY;
priv-oldZ = ds-pressure;
priv-oldTiltX = ds-tiltx;
priv-oldTiltY = ds-tilty;
@@ -695,13 +694,10 @@ void wcmSendEvents(InputInfoPtr pInfo, const 
WacomDeviceState* ds)
x, y, z, v3, v4, v5, v6, id, serial,
is_button ? true : false, ds-buttons);
 
-   priv-currentX = x;
-   priv-currentY = y;
-
/* update the old records */
if(!priv-oldProximity)
{
-   wcmUpdateOldState(pInfo, ds);
+   wcmUpdateOldState(pInfo, ds, x, y);
priv-oldButtons = 0;
}
 
@@ -723,7 +719,7 @@ void wcmSendEvents(InputInfoPtr pInfo, const 
WacomDeviceState* ds)
 
priv-oldProximity = ds-proximity;
if (ds-proximity)
-   wcmUpdateOldState(pInfo, ds);
+   wcmUpdateOldState(pInfo, ds, x, y);
else
{
priv-oldButtons = 0;
diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h
index 8be7103..f40f654 100644
--- a/src/xf86WacomDefs.h
+++ b/src/xf86WacomDefs.h
@@ -250,8 +250,6 @@ struct _WacomDeviceRec
WacomCommonPtr common;  /* common info pointer */
 
/* state fields in device coordinates */
-   int currentX;   /* current X position */
-   int currentY;   /* current Y position */
int oldX;   /* previous X position */
int oldY;   /* previous Y position */
int oldZ;   /* previous pressure */
-- 
1.9.2


--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
#149; 3 signs your SCM is hindering your productivity
#149; Requirements for releasing software faster
#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH] Remove vestiges of displaytoggle action mapping

2014-05-07 Thread Jason Gerecke
From: Jacob Nevins 0jacobnk@chiark.greenend.org.uk

This was removed from the driver in 2010 (910dc637). Stop claiming to
support it in xsetwacom(1), etc.

Source: http://sourceforge.net/p/linuxwacom/bugs/236/
Signed-off-by: Jason Gerecke killert...@gmail.com
---
 include/Xwacom.h  |  2 +-
 src/wcmXCommand.c |  1 -
 tools/xsetwacom.c | 15 ---
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/include/Xwacom.h b/include/Xwacom.h
index 3ca8573..49489ff 100644
--- a/include/Xwacom.h
+++ b/include/Xwacom.h
@@ -59,7 +59,7 @@
 #define AC_KEY  0x0001 /* Emit key events */
 #define AC_MODETOGGLE   0x0002 /* Toggle absolute/relative mode */
 #define AC_DBLCLICK 0x0003 /* DEPRECATED: use two button events 
instead */
-#define AC_DISPLAYTOGGLE0x0004 /* Toggle among screens */
+#define AC_DISPLAYTOGGLE0x0004  /* DEPRECATED: has no effect (used to 
toggle among screens) */
 #define AC_BUTTON   0x0008 /* Emit button events */
 #define AC_TYPE 0x000f /* The mask to isolate event type bits 
*/
 #define AC_KEYBTNPRESS  0x0010  /* bit set for key/button presses */
diff --git a/src/wcmXCommand.c b/src/wcmXCommand.c
index 0ec8737..19cb63b 100644
--- a/src/wcmXCommand.c
+++ b/src/wcmXCommand.c
@@ -431,7 +431,6 @@ static int wcmCheckActionProperty(WacomDevicePtr priv, Atom 
property, XIProperty
return BadValue;
}
break;
-   case AC_DISPLAYTOGGLE:
case AC_MODETOGGLE:
break;
default:
diff --git a/tools/xsetwacom.c b/tools/xsetwacom.c
index eca86c5..26b3513 100644
--- a/tools/xsetwacom.c
+++ b/tools/xsetwacom.c
@@ -985,16 +985,17 @@ static int special_map_modetoggle(Display *dpy, int argc, 
char **argv, unsigned
return 0;
 }
 
+/* the displaytoggle keyword isn't supported anymore, we just have this
+   here to tell people that. */
 static int special_map_displaytoggle(Display *dpy, int argc, char **argv, 
unsigned long *ndata, unsigned long *data, const size_t size)
 {
-   if (*ndata + 1  size) {
-   fprintf(stderr, Insufficient space to store all commands.\n);
-   return 0;
+   static int once_only = 1;
+   if (once_only)
+   {
+   printf (Note: The \displaytoggle\ keyword is not supported 
+   anymore and will be ignored.\n);
+   once_only = 0;
}
-   data[*ndata] = AC_DISPLAYTOGGLE;
-
-   *ndata += 1;
-
return 0;
 }
 
-- 
1.9.2


--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
#149; 3 signs your SCM is hindering your productivity
#149; Requirements for releasing software faster
#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] [PATCH] Improve button action mapping documentation

2014-05-07 Thread Jason Gerecke
From: Jacob Nevins 0jacobnk@chiark.greenend.org.uk

Source: http://sourceforge.net/p/linuxwacom/patches/88/
Signed-off-by: Jason Gerecke killert...@gmail.com
---
 man/wacom.man |  2 ++
 man/xsetwacom.man | 42 +-
 2 files changed, 35 insertions(+), 9 deletions(-)

diff --git a/man/wacom.man b/man/wacom.man
index ae042f6..cd33438 100644
--- a/man/wacom.man
+++ b/man/wacom.man
@@ -147,6 +147,8 @@ server will think they are the same physical button.
 The default action reported to the X server is mouse button M click. Because
 X uses buttons 4, 5, 6, and 7 as the four scrolling directions, physical
 buttons 4 and higher are mapped to 8 and higher by default.
+Only simple button presses can be configured here; for more complex
+actions, use xsetwacom(__appmansuffix__).
 To ignore the button click, i.e., to not report any button click event 
 to the X server,  use 0 or button 0.
 .TP 4
diff --git a/man/xsetwacom.man b/man/xsetwacom.man
index 35ee9fe..1930d67 100644
--- a/man/xsetwacom.man
+++ b/man/xsetwacom.man
@@ -56,8 +56,8 @@ or the
 command. Note that not all parameters are available on all device types.
 .TP
 \fBlist\fR modifiers
-List the available list of modifiers to be used when setting key or button
-actions.
+List the aliases for modifiers and other keys that can be used when setting
+button action mappings.
 
 .SS GET COMMANDS
 .TP
@@ -104,17 +104,41 @@ is provided, the default mapping is restored.
 
 Numeric button mappings indicate what X11 button number the given button-number
 should correspond to. For example, a mapping of 3 means a press of the given
-button-number will produce as a press of X11 button 3 (i.e. right click).
+button-number will produce a press of X11 button 3 (i.e. right click).
 
 Action mappings allow button presses to perform many events. They take the form
-of a string of keywords and arguments. For example, key +a +shift b -shift -a
-converts the button into a series of keystrokes, in this example press a, 
press
-shift, press and release b, release shift, release a. In addition to the key
-keyword, button and modetoggle are also recognized. Multiple keywords may
-be present in one action if desired: for example key +ctrl button 5 key 
-ctrl.
+of a string of keywords and arguments.
+
+The key keyword is following by a list of key names. These can optionally
+be preceded by + for press and - for release. If +/- is not given,
+press-and-release is assumed, except for modifier keys which are left pressed.
+Key names can be X11 KeySyms or some aliases such as 'shift' or 'f1' (the
+full list can be seen with the
+.B list modifiers
+command).
+
+For example, key +a +shift b -shift -a converts the button into a series of
+keystrokes, in this example press a, press shift, press and release b,
+release shift, release a.
+
+The button keyword is similar except that its arguments are X11 button
+numbers.
+
+The modetoggle keyword is also recognized; it takes no arguments,
+and toggles the device mode between relative and absolute pointer tracking.
+
+The events in the action mapping are sent when the physical button is pressed.
+If the action mapping leaves any buttons or keys pressed (such as a modifier
+key), they will be released when the physical button is released.
+
+Multiple keywords may be present in one action if desired: for example
+key +ctrl button 5 key -ctrl. Each keyword takes all arguments until the
+next keyword.
+
+A maximum of 256 presses and/or releases can be specified in an action mapping.
 
 The driver can only simulate physical key events but not keysyms and
-xetwacom translates the mapping sequence into such events. Thus,
+xsetwacom translates the mapping sequence into such events. Thus,
 symbols on the same physical key will generate the same event. For
 example, '1' and '!' are on the same key on a US keyboard and thus have the
 same keycode).  For access to keys on a higher shift level, the sequence
-- 
1.9.2


--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
#149; 3 signs your SCM is hindering your productivity
#149; Requirements for releasing software faster
#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH 1/4] Do not store a second copy of old touchstrip values in oldTilt[XY]

2014-05-07 Thread Ping Cheng
On Wed, May 7, 2014 at 2:29 PM, Jason Gerecke killert...@gmail.com wrote:
 The touchstrip values are already stored in oldStrip[XY], and appear to
 also be stored in oldTilt[XY] as a quirk of history. The value of oldTilt[XY]
 itself is only read in wcmSendNonPadEvents (which is not called for the pad
 device for obvious reasons ;)). At this point in time, there is absolutely
 no reason to store a second copy of the strip values in oldTilt[XY].

 Signed-off-by: Jason Gerecke killert...@gmail.com

Nice cleanup, especially the third one!

Reviewed-by: Ping Cheng pi...@wacom.com for the whole set.

Ping

 ---
  src/wcmCommon.c | 15 ++-
  1 file changed, 2 insertions(+), 13 deletions(-)

 diff --git a/src/wcmCommon.c b/src/wcmCommon.c
 index 7f78d0c..d27ad6d 100644
 --- a/src/wcmCommon.c
 +++ b/src/wcmCommon.c
 @@ -488,27 +488,16 @@ static void wcmUpdateOldState(const InputInfoPtr pInfo,
   const WacomDeviceState *ds)
  {
 const WacomDevicePtr priv = (WacomDevicePtr) pInfo-private;
 -   int tx, ty;

 priv-oldWheel = ds-abswheel;
 priv-oldWheel2 = ds-abswheel2;
 priv-oldButtons = ds-buttons;

 -   if (IsPad(priv))
 -   {
 -   tx = ds-stripx;
 -   ty = ds-stripy;
 -   } else
 -   {
 -   tx = ds-tiltx;
 -   ty = ds-tilty;
 -   }
 -
 priv-oldX = priv-currentX;
 priv-oldY = priv-currentY;
 priv-oldZ = ds-pressure;
 -   priv-oldTiltX = tx;
 -   priv-oldTiltY = ty;
 +   priv-oldTiltX = ds-tiltx;
 +   priv-oldTiltY = ds-tilty;
 priv-oldStripX = ds-stripx;
 priv-oldStripY = ds-stripy;
 priv-oldRot = ds-rotation;
 --
 1.9.2


 --
 Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
 #149; 3 signs your SCM is hindering your productivity
 #149; Requirements for releasing software faster
 #149; Expert tips and advice for migrating your SCM now
 http://p.sf.net/sfu/perforce
 ___
 Linuxwacom-devel mailing list
 Linuxwacom-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

--
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
#149; 3 signs your SCM is hindering your productivity
#149; Requirements for releasing software faster
#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel