Re: [Linuxwacom-devel] [PATCH libwacom] data: set the 22HD(T) to allow for touch strip modes

2016-10-28 Thread Bastien Nocera
On Fri, 2016-10-28 at 16:23 -0700, Ping Cheng wrote:
> On Thu, Oct 27, 2016 at 2:53 AM, Bastien Nocera <had...@hadess.net>
> wrote:
> > On Thu, 2016-10-27 at 13:39 +1000, Peter Hutterer wrote:
> > > There is no physical LED to show the current mode, but the tablet
> > > was
> > > clearly
> > > intended to be used that way [1] and we already reserve two
> > > buttons
> > > as mode
> > > switch buttons anyway. Declare it correctly and let the userspace
> > > stack worry
> > > about displaying mode switches (it's already responsible for
> > > changing
> > > LEDs
> > > anyway).
> > > 
> > > [1] "The ambidextrous design of the Cintiq 22HD touch features a
> > > pair
> > > of
> > > rear-mounted Touch Strips, along with accompanying Touch Strip
> > > Toggle
> > > buttons.
> > > Each controls up to four application-specific functions, such as
> > > brush size,
> > > zooming, scrolling and on-screen canvas rotation."
> > > https://buywacom.com.au/cintiq-22hd-touch.html
> > 
> > Looks like this would need user-space changes to show an OSD when
> > the
> > feature is being used. In the meanwhile, I'd hold off on making a
> > change until at least one front-end implemented the functionality.
> 
> Maybe it's not a bad idea to make the change now so front-end can
> rely
> on it when user-space is ready, as long as the change won't break the
> existing user-space implementation. Does that make sense?

If you made that change without the corresponding user-space changes,
you'd have a button that used to work as simply a button, and that now
would change modes without any feedback as to which mode it's using.

I would at least expect a bug filed explaining the intent (for GNOME I
guess), so that Carlos has a chance to look into how we'd hook the UI
for this.

It might be a one-liner once a lot of the calibration and setup UI has
moved into the shell but we won't know until we're there.

Cheers

--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom] data: set the 22HD(T) to allow for touch strip modes

2016-10-27 Thread Bastien Nocera
On Thu, 2016-10-27 at 13:39 +1000, Peter Hutterer wrote:
> There is no physical LED to show the current mode, but the tablet was
> clearly
> intended to be used that way [1] and we already reserve two buttons
> as mode
> switch buttons anyway. Declare it correctly and let the userspace
> stack worry
> about displaying mode switches (it's already responsible for changing
> LEDs
> anyway).
> 
> [1] "The ambidextrous design of the Cintiq 22HD touch features a pair
> of
> rear-mounted Touch Strips, along with accompanying Touch Strip Toggle
> buttons.
> Each controls up to four application-specific functions, such as
> brush size,
> zooming, scrolling and on-screen canvas rotation."
> https://buywacom.com.au/cintiq-22hd-touch.html

Looks like this would need user-space changes to show an OSD when the
feature is being used. In the meanwhile, I'd hold off on making a
change until at least one front-end implemented the functionality.

--
The Command Line: Reinvented for Modern Developers
Did the resurgence of CLI tooling catch you by surprise?
Reconnect with the command line and become more productive. 
Learn the new .NET and ASP.NET CLI. Get your free copy!
http://sdm.link/telerik
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 8/8] data: Standardize location of buttons on Intuos tablets

2016-06-21 Thread Bastien Nocera
On Tue, 2016-06-21 at 15:52 -0700, Jason Gerecke wrote:
> the postion so all devices in the family have their buttons on "top".

position

--
Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 4/8] data: Correct SVGs for 2nd-gen consumer "Intuos" devices

2016-06-21 Thread Bastien Nocera
On Tue, 2016-06-21 at 15:52 -0700, Jason Gerecke wrote:
> copy/pasted from the first generation, despite differences in
> apparenace.

appearance.

--
Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH] fix distortion at border by a polynomial of degree 4

2016-03-09 Thread Bastien Nocera
On Sun, 2016-02-07 at 13:09 +0100, Mario Geiger wrote:
> Hello,
> I'm back with my project to remove the distortions in the borders of
> the screen.
> 
> I have a new idea to do better calibration easier, 
> 
>  1. Take a real ruler 
>  2. make strait line
> 
> The distortion will bend the line and with the part of the line that
> is in the non distorted part of the screen the correction can be
> done.

I, and probably others on the list, don't understand what distortion
you're talking about.

Cheers

--
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://pubads.g.doubleclick.net/gampad/clk?id=278785111=/4140
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH v2 libwacom 1/3] use g_key_file_get_string_list to retrieve DeviceMatch

2015-03-13 Thread Bastien Nocera
On Fri, 2015-03-13 at 14:57 -0400, Benjamin Tissoires wrote:
 The match count (and update to the first correct) has to be done in 
 libwacom_parse_tablet_keyfile() now.
 ---
 
 New in v2 (requested by Bastien)
 
  libwacom/libwacom-database.c | 76 +-
 --
  1 file changed, 36 insertions(+), 40 deletions(-)
 
 diff --git a/libwacom/libwacom-database.c b/libwacom/libwacom-
 database.c index f4cb82a..8a2519a 100644
 --- a/libwacom/libwacom-database.c
 +++ b/libwacom/libwacom-database.c
 @@ -130,45 +130,31 @@ make_match_string (WacomBusType bus, int 
 vendor_id, int product_id)
  }
  
  static int

Seeing as you end up returning 0 or 1, just return a gboolean (and 
TRUE/FALSE) instead and...

 -libwacom_matchstr_to_matches(WacomDevice *device, const char *match)
 +libwacom_matchstr_to_match(WacomDevice *device, const char *match)
 snip
 +   for (i = 0; string_list[i]; i++) {
 +   nmatches += libwacom_matchstr_to_match 
 (device, string_list[i]);

if (libwacom_matchstr_to_match (device, string_list[i]))
   nmatches++;
etc.

Rest looks good.

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 2/2] Add Huion H610 Pro entry

2015-03-13 Thread Bastien Nocera
On Fri, 2015-03-13 at 11:30 -0400, Benjamin Tissoires wrote:
 +Name=General Pen w/o Eraser

Write this spelled out. This gets in the UI...

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 1/2] Allow matching on the name too

2015-03-13 Thread Bastien Nocera
On Fri, 2015-03-13 at 11:30 -0400, Benjamin Tissoires wrote:
 To support generic tablets, we need to extend the matching pattern 
 of libwacom. The Huion tablets reuse the same VID:PID accross all of 
 the products. To be able to differentiate between the models, we can 
 somewhat
 rely on the name of the product. It doesn't seem very reliable (for 
 instance, the H610 Pro and the W58 seems to share the same name), 
 but it should allow a good amount of them to be added to the DB.

Changes to gnome-settings-daemon will be necessary if you don't want 
all the variants to share the same configuration (unless I'm reading 
this wrong, obviously).

g-s-d uses libwacom_get_match() to uniquify the configuration.

libwacom_matchstr_to_matches should really use 
g_key_file_get_string_list() instead of parsing the field by hand by 
the way.

--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom] data: add Buttons entries to the various erasers

2015-02-26 Thread Bastien Nocera
On Tue, 2015-02-24 at 16:28 +1000, Peter Hutterer wrote:
 The stylus buttons still work with the eraser end of the pen.
 
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Would probably have been better to link the eraser to the pens, so that
the Buttons value is filled in automatically.

 ---
  data/libwacom.stylus | 18 ++
  1 file changed, 18 insertions(+)
 
 diff --git a/data/libwacom.stylus b/data/libwacom.stylus
 index d99bdee..ca4ae6b 100644
 --- a/data/libwacom.stylus
 +++ b/data/libwacom.stylus
 @@ -9,6 +9,7 @@ Type=General
  [0xe]
  Name=General Pen Eraser
  IsEraser=true
 +Buttons=2
  Axes=Tilt;Pressure;Distance;
  Type=General
  
 @@ -189,6 +190,7 @@ Type=Stroke
  # Intuos and Intuos2
  Name=Classic Pen Eraser
  IsEraser=true
 +Buttons=2
  Axes=Tilt;Pressure;Distance;
  Type=Classic
  
 @@ -196,6 +198,7 @@ Type=Classic
  # Intuos2
  Name=Grip Pen Eraser
  IsEraser=true
 +Buttons=2
  Axes=Tilt;Pressure;Distance;
  Type=General
  
 @@ -203,6 +206,7 @@ Type=General
  # Intuos2
  Name=Airbrush Pen Eraser
  IsEraser=true
 +Buttons=1
  Axes=Tilt;Pressure;Distance;
  Type=Airbrush
  
 @@ -210,6 +214,7 @@ Type=Airbrush
  # Intuos
  Name=Airbrush Pen Eraser
  IsEraser=true
 +Buttons=1
  Axes=Tilt;Pressure;Distance;
  Type=Airbrush
  
 @@ -221,6 +226,7 @@ IsEraser=true
  # Intuos3 and Cintiq 21UX
  Name=Grip Pen Eraser
  IsEraser=true
 +Buttons=2
  Axes=Tilt;Pressure;Distance;
  Type=General
  
 @@ -228,6 +234,7 @@ Type=General
  # Intuos3 and Cintiq 21UX
  Name=Classic Pen Eraser
  IsEraser=true
 +Buttons=2
  Axes=Tilt;Pressure;Distance;
  Type=Classic
  
 @@ -235,6 +242,7 @@ Type=Classic
  # Intuos3 and Cintiq 21UX
  Name=Airbrush Pen Eraser
  IsEraser=true
 +Buttons=1
  Axes=Tilt;Pressure;Distance;
  Type=Airbrush
  
 @@ -242,6 +250,7 @@ Type=Airbrush
  # Intuos4, 5 and Cintiq 21UX2, 24HD
  Name=Art Pen Eraser
  IsEraser=true
 +Buttons=2
  Axes=Tilt;Pressure;Distance;
  Type=Marker
  
 @@ -249,6 +258,7 @@ Type=Marker
  # Intuos4, 5 and Cintiq 21UX2, 24HD
  Name=Grip Pen Eraser
  IsEraser=true
 +Buttons=2
  Axes=Tilt;Pressure;Distance;
  Type=General
  
 @@ -256,6 +266,7 @@ Type=General
  # Intuos4, 5 and Cintiq 21UX2, 24HD
  Name=Classic Pen Eraser
  IsEraser=true
 +Buttons=2
  Axes=Tilt;Pressure;Distance;
  Type=Classic
  
 @@ -263,6 +274,7 @@ Type=Classic
  # Intuos4, 5 and Cintiq 21UX2, 24HD
  Name=Classic Pen Eraser
  IsEraser=true
 +Buttons=2
  Axes=Tilt;Pressure;Distance;
  Type=Classic
  
 @@ -270,6 +282,7 @@ Type=Classic
  # Intuos4, 5 and 13HD, 24HD Art Pen
  Name=Art Pen Eraser
  IsEraser=true
 +Buttons=2
  Axes=Tilt;Pressure;Distance;
  Type=Marker
  
 @@ -277,6 +290,7 @@ Type=Marker
  # Intuos4, 5 and Cintiq 21UX2, 24HD
  Name=Grip Pen Eraser
  IsEraser=true
 +Buttons=2
  Axes=Tilt;Pressure;Distance;
  Type=General
  
 @@ -284,6 +298,7 @@ Type=General
  # Cintiq 13HD
  Name=Pro Pen Eraser
  IsEraser=true
 +Buttons=2
  Axes=Tilt;Pressure;Distance;
  Type=Classic
  
 @@ -291,6 +306,7 @@ Type=Classic
  # DTH2242 Eraser
  Name=Pen Eraser
  IsEraser=true
 +Buttons=2
  Axes=Tilt;Pressure;Distance;
  Type=General
  
 @@ -298,6 +314,7 @@ Type=General
  # Intuos4, 5 and Cintiq 13HD, 22HD, 24HD Airbrush Eraser
  Name=Airbrush Pen Eraser
  IsEraser=true
 +Buttons=1
  Axes=Tilt;Pressure;Distance;
  Type=Airbrush
  
 @@ -305,6 +322,7 @@ Type=Airbrush
  # Intuos4, 5 and Cintiq 21UX2, 24HD
  Name=Airbrush Pen Eraser
  IsEraser=true
 +Buttons=1
  Axes=Tilt;Pressure;Distance;
  Type=Airbrush
  



--
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom] Rely on the PRODUCT attribute to fetch the bus, vid pid informations

2014-09-11 Thread Bastien Nocera
On Thu, 2014-09-11 at 14:07 -0400, Benjamin Tissoires wrote:
 PRODUCT attribute is set correctly for the input device, whether the
 device is USB or Bluetooth. We can use a common path for those two.
 uinput devices have their PRODUCT attribute set according to the
 registered device, so they work too.
 
 This change allows libwacom to properly detect the actual PID of the
 tablet connected through the wireless receiver when the following kernel
 patch (or its sucessor) will be merged in 3.18:
 https://patchwork.kernel.org/patch/4889811/
 
 Signed-off-by: Benjamin Tissoires benjamin.tissoi...@redhat.com
 ---
 
 Hi,
 
 so this is the second part of the kernel patch that can be found at
 https://patchwork.kernel.org/patch/4889811/
 
 There should not be any impact except for the wireless users.
 PRODUCT is set by the input device, so theorically, the serial ones should 
 also
 have it (I can not test this with my current setup).
 
 Cheers,
 Benjamin
 
  libwacom/libwacom.c | 130 
 +---
  1 file changed, 62 insertions(+), 68 deletions(-)
 
 diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
 index 2a99c95..0257fbe 100644
 --- a/libwacom/libwacom.c
 +++ b/libwacom/libwacom.c
 @@ -88,6 +88,57 @@ get_uinput_subsystem (GUdevDevice *device)
   return bus_str ? g_strdup (bus_str) : NULL;
  }
  
 +static gboolean
 +get_bus_vid_pid (GUdevDevice  *device,
 +  WacomBusType *bus,
 +  int  *vendor_id,
 +  int  *product_id,
 +  WacomError   *error)
 +{
 + GUdevDevice *parent;
 + const char *product_str;
 + int garbage;
 + int bus_id = -1;
 + gboolean retval = FALSE;
 +
 + /* Parse that:
 +  * E: PRODUCT=5/56a/81/100
 +  * into:
 +  * vendor 0x56a
 +  * product 0x81 */
snip
 + if (!product_str ||
 + (sscanf (product_str, %u/%x/%x/%d, bus_id, vendor_id, 
 product_id, garbage) != 4)) {
 + libwacom_error_set(error, WERROR_UNKNOWN_MODEL, Unable to 
 parse model identification);
 + goto bail;
 + }

I'd use g_strsplit() on the PRODUCT string, and parse each item
separately with strtol/strtoul.


--
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191iu=/4140/ostg.clktrk
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom] Rely on the PRODUCT attribute to fetch the bus, vid pid informations

2014-09-11 Thread Bastien Nocera
On Thu, 2014-09-11 at 14:45 -0400, Benjamin Tissoires wrote:
 +   /* Parse the PRODUCT attribute (for Bluetooth and USB) */
 +   retval = get_bus_vid_pid (device, bus, vendor_id, product_id,
 error);
 +   if (retval)
 +   goto bail;

Can you rename the bail label to out? I don't like it that it's going to
bail even though there was success :)

Other than that, looks good to me.


--
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191iu=/4140/ostg.clktrk
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom] Rely on the PRODUCT attribute to fetch the bus, vid pid informations

2014-09-11 Thread Bastien Nocera
On Thu, 2014-09-11 at 15:02 -0400, Benjamin Tissoires wrote:
 On Sep 11 2014 or thereabouts, Bastien Nocera wrote:
  On Thu, 2014-09-11 at 14:45 -0400, Benjamin Tissoires wrote:
   +   /* Parse the PRODUCT attribute (for Bluetooth and USB) */
   +   retval = get_bus_vid_pid (device, bus, vendor_id, product_id,
   error);
   +   if (retval)
   +   goto bail;
  
  Can you rename the bail label to out? I don't like it that it's going to
  bail even though there was success :)
 
 Sure
 
  
  Other than that, looks good to me.
  
 
 Can I put your Reviewed-by then?

Go for it


--
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191iu=/4140/ostg.clktrk
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH 10/13] tools: re-enable wait-for-tablet

2014-03-18 Thread Bastien Nocera


 On 18 Mar 2014, at 23:54, Peter Hutterer peter.hutte...@who-t.net wrote:
 
 We need this to actually time out, otherwise we can't tell whether we have the
 wrong baud rate set. That's fine for a debugger where a human will terminate,
 but not for the upcoming inputattach clone.fine for a debugger where a human
 will terminate, but not for the upcoming inputattach clone.fine for a debugger
 where a human will terminate, but not for the upcoming inputattach clone.fine
 for a debugger where a human will terminate, but not for the upcoming
 inputattach clone.

Paste error?


 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
 ---
 tools/tools-shared.c | 2 --
 1 file changed, 2 deletions(-)
 
 diff --git a/tools/tools-shared.c b/tools/tools-shared.c
 index 4d22cdf..2537211 100644
 --- a/tools/tools-shared.c
 +++ b/tools/tools-shared.c
 @@ -164,7 +164,6 @@ int start_tablet(int fd)
 
 int wait_for_tablet(int fd)
 {
 -#if 0
struct pollfd pfd = { fd, POLLIN, 0 };
int rc;
 
 @@ -179,7 +178,6 @@ int wait_for_tablet(int fd)
} else if (pfd.revents  POLLIN)
TRACE(data available.\n);
 
 -#endif
return 0;
 }
 
 -- 
 1.8.5.3
 
 
 --
 Learn Graph Databases - Download FREE O'Reilly Book
 Graph Databases is the definitive new guide to graph databases and their
 applications. Written by three acclaimed leaders in the field,
 this first edition is now available. Download your free book today!
 http://p.sf.net/sfu/13534_NeoTech
 ___
 Linuxwacom-devel mailing list
 Linuxwacom-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] Button Order Chaos

2014-03-13 Thread Bastien Nocera
On Wed, 2014-03-12 at 09:16 +0100, wiz4rd wrote:
 Thanks for the script, Jason.
 Works like a charm! I can assign all of the 4 pad buttons, plus they're in 
 their correct order *yay*
 
 
 On Tue, Mar 11, 2014 19:48, Jason Gerecke wrote:
 
  Button order chaos is perhaps a more apt description than you realize...
 
 Yep, that's what I assumed...
 
 
  [...] It also prints out the commands that create this
  mapping, in case you want to save them e.g. to a startup script.
 As for that, since the device IDs are changing each and every time, I'd 
 need to replace the device's ID with its full name in order to use it as 
 a startup script, right? Sorry, been too long since I fiddled around 
 with xsetwacom and stuff...
 
  As for why you can't set the buttons to produce left/middle/right
  mouse clicks through the control panel? Unfortunately, the GNOME
  developers don't feel that mouse buttons are worthwhile shortcuts and
  have resisted attempts to add them in. Worse, because GNOME's
  button-mapping magic works by intercepting mouse events sent from our
  driver, you can't use xsetwacom to force a specific button to make a
  click: the event will just be consumed by GNOME before anything can
  see it :(
 Wow, that's one great decision made by them developers... ;)

The said developers don't have access to any Bamboo tablets, and it's
not our fault that drivers (which are supposed to hide away differences
between models) are the thinnest of wrappers on top of the hardware.


--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] Button Order Chaos

2014-03-13 Thread Bastien Nocera
On Thu, 2014-03-13 at 10:23 +0100, wiz4rd wrote:
 On 13.03.2014 09:42, Bastien Nocera wrote
  On Wed, 2014-03-12 at 09:16 +0100, wiz4rd wrote:
  As for why you can't set the buttons to produce left/middle/right
  mouse clicks through the control panel? Unfortunately, the GNOME
  developers don't feel that mouse buttons are worthwhile shortcuts and
  have resisted attempts to add them in. Worse, because GNOME's
  button-mapping magic works by intercepting mouse events sent from our
  driver, you can't use xsetwacom to force a specific button to make a
  click: the event will just be consumed by GNOME before anything can
  see it :(
  Wow, that's one great decision made by them developers... ;)
  The said developers don't have access to any Bamboo tablets, and it's
  not our fault that drivers (which are supposed to hide away differences
  between models) are the thinnest of wrappers on top of the hardware.
 No offense, but IMO it seems to be less a problem of some driver but of 
 different ways to configure attached devices.
 xsetwacom seems to work just fine!

Yeah, right.

 Now, instead of simply putting a GUI on top of that, Gnome's wacom 
 control panel seems more to try to gain priority over xsetwacom by 
 intercepting and blocking at least parts of its basic funtionality...

Yes, because we wanted to make something that works. I don't think you
have any idea of the amount of work that went into the GNOME
configuration tools, or quite how much work was needed to get basic
functionality working evenly across the number of tablets (take a look
at the tablet definitions in libwacom, and have fun coming up with
schemes that would allow us to support absolutely all of them).

It's easy pointing the finger at GNOME (look, they didn't base their
tools on something that allows you to render your tablet useless with
the wrong configuration options), but you should surely be better
informed if you're going to make those claims.

Having wrote most of what is now the GNOME Wacom config tools, and
libwacom (and also a Wacom kernel driver), I'm positive in saying that
the drivers aren't helping us. You're certainly allowed to be frustrated
about your experience using those tools, but you can also be wrong in
assigning the blame.

Cheers 


--
Learn Graph Databases - Download FREE O'Reilly Book
Graph Databases is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] Default values for Wacom Tablet Area

2013-10-09 Thread Bastien Nocera
On Tue, 2013-10-08 at 11:35 -0700, Ping Cheng wrote:
 On Tue, Oct 8, 2013 at 11:18 AM, Bastien Nocera had...@hadess.net wrote:
  On Tue, 2013-10-08 at 11:08 -0700, Ping Cheng wrote:
  On Tue, Oct 8, 2013 at 12:07 AM, Bastien Nocera had...@hadess.net wrote:
   Hey,
  
   We're having some problems in GNOME with the calibration UI, especially
   after a calibration has been done because the factory values for Wacom
   Tablet Area have been modified, and we cannot use those (especially if
   a previous erroneous calibration has been made) to calibrate the device
   again.
 
  My apologies, I should have followed up on this. I've spent the day
  looking into the problem, and found the very many bugs.
 
   Is there a way to reset those values to the factory settings?
 
  xsetwacom set dev_id Area -1 -1 -1 -1 will set the area back to
  factory values. But I don't think we want to run xsetwacom when Gnome
  Control Center is running. So, another way is to set it through area
  property directly from X server. Refer to
  xf86-input-wacom/tools/xsetwacom.c for example.
 
  The -1 special value isn't handled in the driver though, is it? If it
  is, I've just wasted quite a bit of time implementing our own reset in
  GNOME :/
 
 Yes, -1's are handled in X driver.
 
 Next time. please ask before doing anything real ;-).

To be fair, by the time you answered, I'd been working on the problem
for 11 hours. I wasn't going to sit on my hands :)

I might revisit that code once I have hardware to actually test this on.

Cheers


--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register 
http://pubads.g.doubleclick.net/gampad/clk?id=60134071iu=/4140/ostg.clktrk
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] Default values for Wacom Tablet Area

2013-10-09 Thread Bastien Nocera
On Tue, 2013-10-08 at 11:36 -0700, Jason Gerecke wrote:
 On Tue, Oct 8, 2013 at 11:18 AM, Bastien Nocera had...@hadess.net wrote:
  On Tue, 2013-10-08 at 11:08 -0700, Ping Cheng wrote:
  On Tue, Oct 8, 2013 at 12:07 AM, Bastien Nocera had...@hadess.net wrote:
   Hey,
  
   We're having some problems in GNOME with the calibration UI, especially
   after a calibration has been done because the factory values for Wacom
   Tablet Area have been modified, and we cannot use those (especially if
   a previous erroneous calibration has been made) to calibrate the device
   again.
 
  My apologies, I should have followed up on this. I've spent the day
  looking into the problem, and found the very many bugs.
 
   Is there a way to reset those values to the factory settings?
 
  xsetwacom set dev_id Area -1 -1 -1 -1 will set the area back to
  factory values. But I don't think we want to run xsetwacom when Gnome
  Control Center is running. So, another way is to set it through area
  property directly from X server. Refer to
  xf86-input-wacom/tools/xsetwacom.c for example.
 
  The -1 special value isn't handled in the driver though, is it? If it
  is, I've just wasted quite a bit of time implementing our own reset in
  GNOME :/
 
 Yes, that's a magic value that the driver interprets. If it's not
 working, then we've got a problem on our end. I like the thought
 behind `gsd_wacom_device_get_area` though :)

It was at least useful to get those values to the calibration tool, as
it needs real values to do the calculations, and -1, -1, -1, -1 won't
cut it.

   Are the default values available anywhere but in the driver? If the 
   values
   aren't computed, could we move those to libwacom so we can fix
   calibration?
 
  To provide Gnome with factory tablet area, we can add the values to
  libwacom. However, I wonder if retrieving the values from X server, or
  even better directly from the kernel, is feasible for Gnome. This
  approach avoids the extra middle-ware, which leads to less maintenance
  issue.
 
  To retrieve the factory values directly from kernel, you can use
  ioctl(fd, EVIOCGABS(ABS_X), absinfo), ABS_Y would be used for Y
  value. Details can be found at xf86-input-wacom/src/wcmUSB.c.
 
  Let me know if I've missed your point.
 
  I've poked at the valuators directly, as they include the default
  values.
 
  The good news is though, that after spending 12 hours on it, we have a
  working calibration again.
 
  Cheers
 
 
 As a side-effect, by resetting the area to default, you've also
 probably bandaged bug 703783 as well. The calibrator should *not*
 require you to reset the area to work properly; the math is supposed
 to take it into account, but for some reason fails when the
 calibration is particularly bad...

Which happened quite a bit as I was testing :)

For example, it was possible to get the cursor stuck in a corner. So if
you can't click the targets, you can do all the maths you want ;)

I'll mark 703783 as fixed for GNOME 3.10 then.

Cheers


--
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register 
http://pubads.g.doubleclick.net/gampad/clk?id=60134071iu=/4140/ostg.clktrk
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [linuxwacom:bugs] #227 touchscreen rotation for finger input does not work on x230t

2013-04-11 Thread Bastien Nocera
On Thu, 2013-04-11 at 11:45 +0200, Joaquim Rocha wrote:
 Yeah, I am currently tackling some Wacom bugs but on the control
 center part of things only (at least ATM).

Apologies, I meant to add yet at the end of my reply. Given time we
definitely want you to take this over ;)

 On 4/11/13, Bastien Nocera had...@hadess.net wrote:
  On Wed, 2013-04-10 at 12:38 -0700, Ping Cheng wrote:
  Both patches make sense to me. Joaquim Rocha, who is cc'd in this
  email, will be responsible for libwacom project. He has the final say
  about your patches ;-).
 
  Unless I'm mistaken, Peter is still responsible for libwacom, and I
  don't think Joaquim is in a position to make decisions about what goes
  in to the repository.
 
  Joaquim, welcome on board! Please subscribe to linuxwacom project if
  you have not done so. We can also grant you write access to git
  repository if you are ready to chime in...
 
 
 
 
 
 
 -- 
 Joaquim Rocha
 http://www.joaquimrocha.com



--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis  visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] libwacom: Mode-switches and libwacom API

2012-12-13 Thread Bastien Nocera
On Thu, 2012-12-13 at 11:52 +0100, Olivier Fourdan wrote:
 Hi all,
 
 It seems GNOME settings daemon was modelled after the I4, where you 
 have multiple modes (4 on the I4) and a single mode-switch button.
snip
 The hardware on the 24HD is different

Blame work, which bought me the wrong kind of hardware.

Seriously though, support for the modeswitches was rushed in for GNOME
3.4 and and I4 was all I had with a modeswitch.

 But GNOME setting daemon does not do that.

gnome-settings-daemon's modeswitch code was only ever tested on an I4,
by me at least. It's probably wrong for anything else.


--
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH] accept ID_INPUT_TOUCHSCREEN as a wacom device

2012-10-15 Thread Bastien Nocera
On Thu, 2012-10-11 at 09:06 -0700, Jason Gerecke wrote:
 Was going through my mail looking for patches I may have missed for
 the upcoming xf86-input-wacom release and noticed that this libwacom
 patch hadn't seen any activity.
 
 Would somebody more familiar with libwacom/GNOME care to give this a look-see?

Those are bad heuristics.

With this patch, the non-Wacom touchscreen in my desktop is recognised
as a wacom device, which it obviously isn't.

NAK, need to find other heuristics to avoid false positives.

$ ./test /dev/input/event10
[Device]
Name=Elo TouchSystems Elo TouchSystems 2515 IntelliTouch Plus USB
Touchmonitor
DeviceMatch=unknown::;usb:04e7:0022;
Class=Unknown
Width=0
Height=0
Styli=0xf;0xe;

[Features]
Reversible=true
Stylus=true
Ring=true
Ring2=false
BuiltIn=true
Touch=false
LEDs=
NumStrips=2
Buttons=4
[Buttons]
Left=
Right=
Top=
Bottom=
Touchstrip=
Touchstrip2=
OLEDs=
Ring=
Ring2=
RingNumModes=0
Ring2NumModes=0
StripsNumModes=0

From dc53e7d5fc6b833e35cb1f4be7bd1bb8f92c535e Mon Sep 17 00:00:00 2001
From: Bastien Nocera had...@hadess.net
Date: Mon, 15 Oct 2012 12:16:16 +0200
Subject: [PATCH] dump given device's details to stdout

---
 test/Makefile.am |  3 ++-
 test/test.c  | 75 
 2 files changed, 77 insertions(+), 1 deletion(-)
 create mode 100644 test/test.c

diff --git a/test/Makefile.am b/test/Makefile.am
index 6be4403..d45170f 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,4 +1,4 @@
-noinst_PROGRAMS=load dbverify tablet-validity
+noinst_PROGRAMS=load dbverify tablet-validity test
 
 TESTS=$(noinst_PROGRAMS)
 
@@ -7,6 +7,7 @@ AM_CPPFLAGS=-I$(top_srcdir)/libwacom -DTOPSRCDIR=\$(top_srcdir)\
 load_LDADD=$(top_builddir)/libwacom/libwacom.la
 dbverify_LDADD=$(top_builddir)/libwacom/libwacom.la
 tablet_validity_LDADD=$(top_builddir)/libwacom/libwacom.la
+test_LDADD = $(top_builddir)/libwacom/libwacom.la
 
 clean-local: clean-local-check
 .PHONY: clean-local-check
diff --git a/test/test.c b/test/test.c
new file mode 100644
index 000..cc613c0
--- /dev/null
+++ b/test/test.c
@@ -0,0 +1,75 @@
+/*
+ * Copyright © 2012 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ udo y and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of Red Hat
+ * not be used in advertising or publicity pertaining to distribution
+ * of the software without specific, written prior permission.  Red
+ * Hat makes no representations about the suitability of this software
+ * for any purpose.  It is provided as is without express or implied
+ * warranty.
+ *
+ * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+ * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Authors:
+ *	Peter Hutterer (peter.hutte...@redhat.com)
+ */
+
+#ifdef HAVE_CONFIG_H
+#include config.h
+#endif
+
+#define _GNU_SOURCE
+#include stdio.h
+#include stdlib.h
+#include string.h
+#include dirent.h
+#include sys/types.h
+#include sys/stat.h
+#include fcntl.h
+#include libwacom.h
+#include assert.h
+#include unistd.h
+
+int main(int argc, char **argv)
+{
+	WacomDeviceDatabase *db;
+	WacomDevice *device;
+	WacomError *error;
+
+	if (argv[1] == NULL) {
+		printf(Usage: %s [DEVICE PATH]\n, argv[0]);
+		return 1;
+	}
+
+	db = libwacom_database_new_for_path(TOPSRCDIR/data);
+	if (!db)
+		printf(Failed to load data from %s\n, TOPSRCDIR/data);
+	assert(db);
+
+	error = libwacom_error_new ();
+	device = libwacom_new_from_path(db, argv[1], WFALLBACK_GENERIC, error);
+	if (!device) {
+		printf(Failed to find device for %s: %s (%d)\n, argv[1],
+		   libwacom_error_get_message (error),
+		   libwacom_error_get_code (error));
+		libwacom_error_free (error);
+		return 1;
+	}
+	libwacom_print_device_description(1, device);
+
+	libwacom_database_destroy (db);
+
+	return 0;
+}
+
+/* vim: set noexpandtab tabstop=8 shiftwidth=8: */
-- 
1.7.12.1

--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https

Re: [Linuxwacom-devel] [PATCH] accept ID_INPUT_TOUCHSCREEN as a wacom device

2012-10-15 Thread Bastien Nocera
On Tue, 2012-10-16 at 11:40 +1000, Peter Hutterer wrote:
snip
 a few things:
 - please rename to print-device or something more explanatory
 - you'll need to split this up, ./test as part of TESTS would be run as part
 of make check and always fail (it expects the device name)

I'd be doing that if I wanted the patch committed. It's a test patch to
show that the original proposed patch isn't suitable.


--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH 0/2] add IntegratedIn feature for ISD

2012-10-09 Thread Bastien Nocera
On Tue, 2012-10-09 at 16:23 +0200, Olivier Fourdan wrote:
 Bastien Nocera said the following on 10/08/2012 06:24 PM:
  [...]
  Looks to me like builtin is tablet is integrated with the display
  and ISD is tablet is integrated with the computer.
 
  I'm sure we could deprecate the _is_builtin() function, and use a
  bitmask for this support instead?
 
  LIBWACOM_DEVICE_INTEGRATED_WITH_NONE = 0,
  LIBWACOM_DEVICE_INTEGRATED_WITH_DISPLAY = 1  0,
  LIBWACOM_DEVICE_INTEGRATED_WITH_COMPUTER = 1  2
 
 
 I am no big fan of integrated with computer either, why limiting us 
 to computer, I would rather see integrated with system (system 
 being a computer, a handhelp device, etc.) Additionally that matches 
 the ISD definition, integrated system device..
 
 I would like to keep things simple (as always) for both the developer 
 and user of the API, and also avoid complicated or convoluted 
 functions names.
 
 IMHO we should keep the database format similar enough to the function 
 names accessing it, ie if we deprecate _is_builtin() in the API it 
 should be also replaced in the database.
 
 In a nutshell what I a would do instead is:
 
 database definition use something like:
 
 IntegratedIn=Display;System
 
 for a tablet PC and
 
 IntegratedIn=Display
 
 for a screen tablet such as a Cintiq.
 
 This is now set in the Device section as it's not really a feature 
 (but a characteristic of the device).
 
 Now for the API:
 
 libwacom_is_builtin() is deprecated in favor of the WacomIntegrationFlags
 
 One pain point is the BuiltIn replacement, because BuiltIn is also 
 automatically set from the sysfs device/properties (see my other email 
 about the flags in sysfs), so we need an additional flag 
 WACOM_DEVICE_INTEGRATED_UNSET indicating that the database do not 
 provide the information. In that case,

WACOM_DEVICE_INTEGRATED_UNSET = -1
Then. The compiler will make it an int instead of an unsigned int.


--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH 0/2] add IntegratedIn feature for ISD

2012-10-09 Thread Bastien Nocera
On Tue, 2012-10-09 at 17:23 +0200, Olivier Fourdan wrote:
 Bastien Nocera said the following on 10/09/2012 05:18 PM:
  WACOM_DEVICE_INTEGRATED_UNSET = -1 Then. The compiler will make it 
  an int instead of an unsigned int. 
 
 Humm, nope, not what I want.
 
 -1 will have all bits set to 1 if I a not mistaken, so that means all 
 the bits mask will return true, which is not suited. Of course we 
 could test specifically for -1, but using a specific bit for UNSET has 
 an additional benefit imhop, it indicates that the info is not from 
 the database itself.

Then use 0 for unset, and something else for none...


--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH 0/2] add Integrated feature for ISD

2012-10-08 Thread Bastien Nocera
On Mon, 2012-10-08 at 17:39 +0200, Olivier Fourdan wrote:
 As discussed on linuxwacom-devel mailing list, add a new Integrated 
 feature
 for integrated system devices to identify eg. Tablet PC.
 
 Olivier Fourdan (2):
lib: add Integrated feature
data: add the Integrated field to ISD definitions

Can't we find a better name than this? It means nothing unless you've
been working on Wacom tablets for a long while...


--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH 0/2] add Integrated feature for ISD

2012-10-08 Thread Bastien Nocera
On Mon, 2012-10-08 at 18:12 +0200, Olivier Fourdan wrote:
 Hi Bastien,
 
 Bastien Nocera said the following on 10/08/2012 06:06 PM:
  On Mon, 2012-10-08 at 17:39 +0200, Olivier Fourdan wrote:
  As discussed on linuxwacom-devel mailing list, add a new Integrated
  feature
  for integrated system devices to identify eg. Tablet PC.
 
  Olivier Fourdan (2):
  lib: add Integrated feature
  data: add the Integrated field to ISD definitions
  Can't we find a better name than this? It means nothing unless you've
  been working on Wacom tablets for a long while...
 
 TabletPC was suggested, or ISD (but I find the later even more 
 cryptic).
 
 I did not choose TabletPC because I wasn't sure if all integrated 
 device would be TabletPC.
 
 But if TabletPC is preferable, I have no problem changing the names to 
 that.

Looks to me like builtin is tablet is integrated with the display
and ISD is tablet is integrated with the computer.

I'm sure we could deprecate the _is_builtin() function, and use a
bitmask for this support instead?

LIBWACOM_DEVICE_INTEGRATED_WITH_NONE = 0,
LIBWACOM_DEVICE_INTEGRATED_WITH_DISPLAY = 1  0,
LIBWACOM_DEVICE_INTEGRATED_WITH_COMPUTER = 1  2


--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] libwacom: libwacom_is_builtin() misleading?

2012-10-02 Thread Bastien Nocera
On Tue, 2012-10-02 at 15:20 +0200, Olivier Fourdan wrote:
 Hi all,
 
 While reviewing the libwacom API, I realized that 
 libwacom_is_builtin() could be misleading:
 
/**
 * @param device The tablet to query
 * @return non-zero if the device is built-in or zero if the device 
 is an
 * external tablet
 */
int libwacom_is_builtin(WacomDevice *device);
 
  From the description, I would expect built-in tablets (such as the 
 one used for Tablet PC) to have that set to true, and all other 
 external tablet to have that property set to false.
 
 Actually, what libwacom_is_builtin() means is that the tablet is a 
 screen tablet, so all Cintiq have that property set to true, even 
 though these are actually external tablets.

Built-in means that the tablet is built into the screen. Feel free to
change the documentation if it's not clear.

Cheers


--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] fdo bugs copied to this list?

2012-09-13 Thread Bastien Nocera
Em Thu, 2012-09-13 às 15:39 +0300, Timo Aaltonen escreveu:
   Hi
 
   I'd suggest to modify fdo bugzilla so that input/wacom bugmail would
 be copied here, so that bugs would get a wider audience.

No point, you can subscribe to the bugs through bugzilla directly. I
already don't like seeing patches fly here when they could be handled
through bugzilla as well (though I know Peter has a different opinion of
this).


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] fdo bugs copied to this list?

2012-09-13 Thread Bastien Nocera
Em Thu, 2012-09-13 às 09:39 -0700, Jason Gerecke escreveu:
 On Thu, Sep 13, 2012 at 6:00 AM, Bastien Nocera had...@hadess.net wrote:
  Em Thu, 2012-09-13 às 15:39 +0300, Timo Aaltonen escreveu:
Hi
 
I'd suggest to modify fdo bugzilla so that input/wacom bugmail would
  be copied here, so that bugs would get a wider audience.
 
 I'd like to see this as well, honestly. Having to monitor several
 places for bugs is really annoying. Between -devel, -discuss, SF, and
 FDO, there's a lot of places for bugs to be missed.
 
  No point, you can subscribe to the bugs through bugzilla directly. I
  already don't like seeing patches fly here when they could be handled
  through bugzilla as well (though I know Peter has a different opinion of
  this).
 
 I can't seem to find any good way to auto-subscribe to bugs of
 interest. The only mechanism I've found so far is the 'user watching'
 mechanism, but it would require the default  assignee to be changed
 for the wacom component (which is pretty much what Timo is looking
 for). Aside from that, I can add myself to the CC list on a per-bug
 basis, but that doesn't change anything -- I still have to check both
 my inbox and FDO for new bugs.
 
 Ideally I could subscribe to my saved search for terms like intuos,
 cintiq, 21UX, etc. to keep on top of bugs that are outside of our
 component but still affect our users.

I believe there's RSS feeds for saved searches.


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 1/3] libwacom: return 0 when comparing NULL to NULL

2012-06-22 Thread Bastien Nocera
On Fri, 2012-06-22 at 16:29 +1000, Peter Hutterer wrote:
 Pointless though, so let's complain about it.
 
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Reviewed-By: Bastien Nocera had...@hadess.net

 ---
  libwacom/libwacom.c |2 ++
  1 file changed, 2 insertions(+)
 
 diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
 index 482baa5..fe850a2 100644
 --- a/libwacom/libwacom.c
 +++ b/libwacom/libwacom.c
 @@ -334,6 +334,8 @@ compare_matches(WacomDevice *a, WacomDevice *b)
  int
  libwacom_compare(WacomDevice *a, WacomDevice *b, WacomCompareFlags flags)
  {
 + g_return_val_if_fail(a || b, 0);

I would have preferred:
g_return_val_if_fail(!a  !b, 0);

   if ((a  !b) || (b  !a))
   return 1;
  



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 3/3] test: shut up coverity

2012-06-22 Thread Bastien Nocera
On Fri, 2012-06-22 at 16:29 +1000, Peter Hutterer wrote:
 mkdtemp returns the modified string, but coverity doesn't seem to know that
 and complains about a leak. So just check for non-null and then carry on as
 usual, one false positive less.
 
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Reviewed-By: Bastien Nocera had...@hadess.net

 ---
  test/dbverify.c |3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)
 
 diff --git a/test/dbverify.c b/test/dbverify.c
 index 472f4ea..ae6dcb4 100644
 --- a/test/dbverify.c
 +++ b/test/dbverify.c
 @@ -127,8 +127,7 @@ compare_written_database(WacomDeviceDatabase *db)
   assert(*devices);
  
   dirname = strdup(tmp.dbverify.XX);
 - dirname = mkdtemp(dirname);
 - assert(dirname);
 + assert(mkdtemp(dirname));

Maybe adding a comment would be useful?

  
   for (device = devices, i = 0; *device; device++, i++) {
   int i;



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] PATCH: Add button order to libwacom

2012-06-06 Thread Bastien Nocera
On Tue, 2012-06-05 at 15:09 +0200, Olivier Fourdan wrote:
 The libwacom API does not provide any way for client applications to 
 get the buttons order as this may differ from the actual button 
 definition.
 
 For example, the Bamboo Fun PenTouch tablet maps buttons from top to 
 bottom (with pad on the left) as A, D, C, B instead of A, B, C, D as 
 expected, thus breaking the logic used to number the buttons in client 
 apps such as GNOME Wacom settings panel.

Not only does this require system level applications like
gnome-settings-daemon and gnome-control-center to have code to
specifically handle it, it will also break enumeration for the users
(shouldn't button A be before button B which would be before button C?).

This should be fixed in the driver. libwacom is a place to define things
that drivers cannot, not to work around hardware differences like this.

Big NAK.


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 1/3] data: define button positions for Bamboos

2012-06-06 Thread Bastien Nocera
On Tue, 2012-05-29 at 15:28 +1000, Peter Hutterer wrote:
 On Tue, May 29, 2012 at 02:25:11PM +1000, Peter Hutterer wrote:
  Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
 
 yikes. after running a few more tests I realised that this isn't actually
 enough. the bamboos define buttons 1, 3, 8 and 9 and we cannot currently
 handle non-continuous button ranges, neither in libwacom nor the gnome
 stack. So button 9 is unknown, as we expect buttons 1, 2, 3 and 8.
 
 So the below patch only solves the problem partially.
 
 as for solutions: I think claiming the bamboo has 5 buttons would be a good
 enough hack for now until we add non-continuous button range support.
 Opinions?

Make the driver fix it?


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom] Add LED0 and LED1 options for led-controlling buttons

2012-06-06 Thread Bastien Nocera
On Tue, 2012-05-29 at 17:09 -0700, Ping Cheng wrote:
 On Wed, May 23, 2012 at 7:17 PM, Peter Hutterer
 peter.hutte...@who-t.net wrote:
  These two button options specify which button controls which LED bank
  exposed by the kernel.
 
  Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
  ---
  Notably on the Cintiq, the layout of the banks is inverse to what one
  expects (0 is right, 1 is left). That can be fixed in the kernel but
  long-term it's better to rely on a specific flag to tell us.
 
 We may not want to fix it in the kernel. People should not assume 0 is
 for left. All Cintiqs have 0 for right, so far ;). You may mention
 Intuos4. But I4 only has one set of LEDs.
 
  Not sure about the 24HD here - three buttons that control the leds? is this
  correct?
 
 Every LED has its own button.

I would really rather have this fixed in the kernel. We already know
which devices have LEDs, and how many, having them correctly numbered
(or at least in a way that makes sense) in there is what we should do.

Cheers


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom] lib: ignore empty match strings

2012-05-23 Thread Bastien Nocera
On Wed, 2012-05-23 at 15:24 +1000, Peter Hutterer wrote:
 Match strings that terminate with a semi will have a final, empty, string
 after g_strsplit(). Ignore those too, not just NULL strings.
 
 Removes failed to match '' for product/vendor IDs. Skipping. warnings from
 tests.

This:
strlen(strs[i])  0
is pretty ugly.

*strs[i] != '\0'
instead?

 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
 ---
  libwacom/libwacom-database.c |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/libwacom/libwacom-database.c b/libwacom/libwacom-database.c
 index 6adeaa1..ef03c43 100644
 --- a/libwacom/libwacom-database.c
 +++ b/libwacom/libwacom-database.c
 @@ -142,7 +142,7 @@ libwacom_matchstr_to_matches(WacomDevice *device, const 
 char *match)
   return 0;
  
   strs = g_strsplit(match, ;, 0);
 - for (i = 0; strs[i] != NULL; i++) {
 + for (i = 0; strs[i] != NULL  strlen(strs[i])  0; i++) {
   char busstr[64];
   int vendor_id, product_id;
   WacomBusType bus;



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] libwacom new data file 'make check' error

2012-05-22 Thread Bastien Nocera
On Mon, 2012-05-21 at 22:28 -0500, Favux ... wrote:
 I'd appreciate some help on this one.  I do not know why I am seeing
 on 'make check':
 
 lt-tablet-validity: tablet-validity.c:94: verify_tablet: Assertion
 `nstyli == 1' failed.
 /bin/bash: line 5:  8362 Aborted (core dumped) ${dir}$tst
 FAIL: tablet-validity
 ===
 1 of 3 tests failed
 ===
 
 From this .tablet file.  It's the first of the 3 and they all seem OK
 to me.  Don't understand why the stylus is flagged.

Can't find this assertion in git master.


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] libwacom new data file 'make check' error

2012-05-22 Thread Bastien Nocera
On Tue, 2012-05-22 at 09:11 -0500, Favux ... wrote:
 On Tue, May 22, 2012 at 8:33 AM, Bastien Nocera had...@hadess.net wrote:
  On Mon, 2012-05-21 at 22:28 -0500, Favux ... wrote:
  I'd appreciate some help on this one.  I do not know why I am seeing
  on 'make check':
 
  lt-tablet-validity: tablet-validity.c:94: verify_tablet: Assertion
  `nstyli == 1' failed.
  /bin/bash: line 5:  8362 Aborted (core dumped) ${dir}$tst
  FAIL: tablet-validity
  ===
  1 of 3 tests failed
  ===
 
  From this .tablet file.  It's the first of the 3 and they all seem OK
  to me.  Don't understand why the stylus is flagged.
 
  Can't find this assertion in git master.
 
 Strange.  I have a vanilla clone:
 
 libwacom$ git branch -r
   origin/HEAD - origin/master
   origin/master

$ git grep assert | grep nstyli
test/tablet-validity.c: assert(nstyli = 1);
test/tablet-validity.c: assert(eraser_is_present (db, styli, 
nstyli, type));


 Alright then.  I'll submit the set to be looked at.
 
 Dave



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] libwacom new data file 'make check' error

2012-05-22 Thread Bastien Nocera
On Tue, 2012-05-22 at 10:01 -0500, Favux ... wrote:
 So commit 4a7a7f16564869b3af6701aa943e5c88927f451b ?
 
 test: Test each stylus with an eraser

The message you posted said it crashed on line 94. This is line 94:
 94 ↦   ↦   ↦   break;•


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom] test: remove special-case for DTI-520

2012-05-17 Thread Bastien Nocera
Em Fri, 2012-05-18 às 09:37 +1000, Peter Hutterer escreveu:
 We don't need to special-case the device, this device may be used with a pen
 that includes an eraser. Removing the special case means we expect all
 currently known devices to have at least two styli defined.

That's a wrong expectation. You should test whether they all have at
least one stylus defined, and for the stylus that claim to have an
eraser tip to have it defined and listed.

That'll stop broken definitions like this:
http://linuxwacom.git.sourceforge.net/git/gitweb.cgi?p=linuxwacom/libwacom;a=commit;h=e65080cd10ee9e5fca50d517bad2d1dd877d2b78

So should be:
assert(nstyli = 1);

 Quote Ping Cheng, 17 May 2012,
 linuxwacom-devel, Thread: Add support for the DTI-520
 DTI-520 is a protocol 4 (V4) device. It does not support serial number
 and tool IDs. [...] This is the same as Graphires. Even if the pen included
 in the box does not have eraser, user may use a pen with eraser.
 
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
 ---
 Fixes make check regression introduced with 8227f3f6 and 4a7a7f16
 
  test/tablet-validity.c |   14 +-
  1 file changed, 1 insertion(+), 13 deletions(-)
 
 diff --git a/test/tablet-validity.c b/test/tablet-validity.c
 index 8f33cb5..c8510e9 100644
 --- a/test/tablet-validity.c
 +++ b/test/tablet-validity.c
 @@ -59,7 +59,6 @@ static void verify_tablet(WacomDeviceDatabase *db, 
 WacomDevice *device)
  {
   const char *name;
   const int *styli;
 - unsigned int product;
   int nstyli, i;
  
   name = libwacom_get_name(device);
 @@ -85,18 +84,7 @@ static void verify_tablet(WacomDeviceDatabase *db, 
 WacomDevice *device)
  
   styli = libwacom_get_supported_styli(device, nstyli);
   assert(styli != NULL);
 - assert(nstyli  0);
 -
 - product = libwacom_get_vendor_id(device)  16 | 
 libwacom_get_product_id(device);
 - switch(product) {
 - /* Devices known not have erasers. */
 - case 0x056a003a: /* DTI520*/
 - assert(nstyli == 1);
 - break;
 - default:
 - assert(nstyli  1);
 - break;
 - }
 + assert(nstyli  1);
  
   switch(libwacom_get_class(device)) {
   case WCLASS_BAMBOO:



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [RFC] LEDs OLEDs on Intuos4 tablets

2012-05-16 Thread Bastien Nocera
On Wed, 2012-05-16 at 17:13 +0100, Przemo Firszt wrote:
 What is the long term plan for handling LEDs and OLEDs on Intuos4 tablets?
 
 In kernel
  - USB - full support for LED/OLED (we have to discuss changing it, but
 it's there for now)
  - bluetooth - LED will be soon in the mainline, OLEDS hopefully will
 follow soon
 In xorg driver (I'm not sure about it):
  - USB - LED - yes, OLED - no
  - bluetooth - LED - no, OLED - no (obvios, as it's not yet in the kernel)

There's no LED or OLED support in the X.org driver.

 In gnome panel

gnome-settings-daemon pokes the kernel directly using a PolicyKit
helper.


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [RFC] LEDs OLEDs on Intuos4 tablets

2012-05-16 Thread Bastien Nocera
On Wed, 2012-05-16 at 11:56 -0500, Favux ... wrote:
 Hi Prezmo,
 
 Peter vetoed the xsetwacom implementation for the Intuos4 OLEDs:
 http://sourceforge.net/mailarchive/message.php?msg_id=28814445
 
 From this thread:
 http://sourceforge.net/mailarchive/forum.php?thread_name=CAF8JNhK6%3DvdFtXAYK6iX7UJo6%3DxSduaaUK63d94pGkg5V15s0Q%40mail.gmail.comforum_name=linuxwacom-devel
 
 Other than the work Bastien mentions on the g-s-d/Wacom Tablet applet
 there is another applet then has been around a while.

The gsd code only supports LEDs. I plan on adding support for OLEDs at
some point. We're mostly missing art, and a good algorithm to transform
the actions or keyboard combinations into 3 small drawings.

   It's by
 Christoph Karg:  http://braindump.kargulus.de/  And San (sanette) has
 posted several versions with modifications on the Ubuntu forums, the
 last:  http://ubuntuforums.org/showpost.php?p=10921962postcount=214
 Christoph posted his applet once or twice on linuxwacom-discuss, not
 sure if San ever did.
 
 Christoph should have give the applet a name, don't you think?
 
 Favux



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [RFC] LEDs OLEDs on Intuos4 tablets

2012-05-16 Thread Bastien Nocera
On Wed, 2012-05-16 at 18:40 +0100, Przemo Firszt wrote:
 Dnia 2012-05-16, śro o godzinie 18:23 +0100, Bastien Nocera pisze:
  On Wed, 2012-05-16 at 11:56 -0500, Favux ... wrote:
   Hi Prezmo,
   
   Peter vetoed the xsetwacom implementation for the Intuos4 OLEDs:
   http://sourceforge.net/mailarchive/message.php?msg_id=28814445
   
   From this thread:
   http://sourceforge.net/mailarchive/forum.php?thread_name=CAF8JNhK6%3DvdFtXAYK6iX7UJo6%3DxSduaaUK63d94pGkg5V15s0Q%40mail.gmail.comforum_name=linuxwacom-devel
   
   Other than the work Bastien mentions on the g-s-d/Wacom Tablet applet
   there is another applet then has been around a while.
  
  The gsd code only supports LEDs. I plan on adding support for OLEDs at
  some point. We're mostly missing art, and a good algorithm to transform
  the actions or keyboard combinations into 3 small drawings.
  
 Good, you're reading my mind :-)
 I'd start with something simple (see my other email). What do you mean
 by a good algorithm to transform the actions or keyboard combinations
 into 3 small drawings? What about letting user define a text that
 describes the action and convert the text to image? Windows driver is
 using that method. (I might be missing something simple here as I
 haven't started to work on OLEDs yet)

Because it would look pretty dreadful. There's a limited amount of
pixels, and you really need specially made art for it to look like you
intend to.

I've asked the Wacom guys whether they could make the art available
under a free license, but didn't get any answers.



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] GNOME Wacom Graphics Tablet applet, libwacom and non-Wacom tablets.

2012-04-30 Thread Bastien Nocera
On Mon, 2012-04-30 at 16:26 +1000, Peter Hutterer wrote:
 On Mon, Apr 30, 2012 at 01:12:13AM -0500, Favux ... wrote:
  I have a question for the list.  Is it intended that non-wacom tablets
  on the xf86-input-driver, like the Hanwang, N-Trig, and Waltop, be
  able to configure their styli through the applet?
 
 yes.

It will only work with tablets that use the wacom X11 driver.

  It seems to me I recall several saying their tablet was detected and
  they could configure pressure etc. with the GNOME 3.2 version.  I have
  a Waltop user in Ubuntu Precise (GNOME 3.4) reporting that the applet
  doesn't detect his tablet although we have verified it is on the Wacom
  X driver with working pressure.  The tablet is not seen in the
  gnome-settings-daemon key values under peripherals.wacom with
  dconf-editor either.
 
 the gnome tool relies on libwacom, and libwacom has it's own database of
 device information (location of buttons, features, etc.). right now, if
 libwacom doesn't know about the device, it won't show up in the control
 center.

No, it will show up, but with generic details.

 Adding the required data files should make the device appear.

Cheers


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 01/11] lib: constify libwacom_get_styli()

2012-04-30 Thread Bastien Nocera
On Mon, 2012-04-30 at 15:53 +1000, Peter Hutterer wrote:
 We return internal memory here, make sure it's const.
 
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Reviewed-By: Bastien Nocera had...@hadess.net

 ---
  libwacom/libwacom.c |5 +++--
  libwacom/libwacom.h |2 +-
  test/dbverify.c |3 ++-
  3 files changed, 6 insertions(+), 4 deletions(-)
 
 diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
 index b966280..1c019b5 100644
 --- a/libwacom/libwacom.c
 +++ b/libwacom/libwacom.c
 @@ -456,7 +456,8 @@ libwacom_new_from_name(WacomDeviceDatabase *db, const 
 char *name, WacomError *er
  
  static void print_styli_for_device (int fd, WacomDevice *device)
  {
 - int nstyli, *styli;
 + int nstyli;
 + const int *styli;
   int i;
  
   if (!libwacom_has_stylus(device))
 @@ -681,7 +682,7 @@ int libwacom_get_num_buttons(WacomDevice *device)
   return device-num_buttons;
  }
  
 -int *libwacom_get_supported_styli(WacomDevice *device, int *num_styli)
 +const int *libwacom_get_supported_styli(WacomDevice *device, int *num_styli)
  {
   *num_styli = device-num_styli;
   return device-supported_styli;
 diff --git a/libwacom/libwacom.h b/libwacom/libwacom.h
 index 96634f0..1efcf7d 100644
 --- a/libwacom/libwacom.h
 +++ b/libwacom/libwacom.h
 @@ -388,7 +388,7 @@ int libwacom_get_num_buttons(WacomDevice *device);
   * @param num_styli Return location for the number of listed styli
   * @return an array of Styli IDs supported by the device
   */
 -int *libwacom_get_supported_styli(WacomDevice *device, int *num_styli);
 +const int *libwacom_get_supported_styli(WacomDevice *device, int *num_styli);
  
  /**
   * @param device The tablet to query
 diff --git a/test/dbverify.c b/test/dbverify.c
 index d0e539c..6a9149b 100644
 --- a/test/dbverify.c
 +++ b/test/dbverify.c
 @@ -134,7 +134,8 @@ compare_written_database(WacomDeviceDatabase *db)
   int i;
   int fd;
   char *path = NULL;
 - int nstyli, *styli;
 + int nstyli;
 + const int *styli;
  
   asprintf(path, %s/%d-%04x-%04x.tablet, dirname,
   libwacom_get_bustype(*device),



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 03/11] data: rename Graphire Wireless .tablet file

2012-04-30 Thread Bastien Nocera
On Mon, 2012-04-30 at 15:53 +1000, Peter Hutterer wrote:
 Easier to find now
 
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Reviewed-By: Bastien Nocera had...@hadess.net

 ---
  data/graphire-wireless-8x6.tablet |   13 +
  data/wireless-pen-tablet.tablet   |   13 -
  2 files changed, 13 insertions(+), 13 deletions(-)
  create mode 100644 data/graphire-wireless-8x6.tablet
  delete mode 100644 data/wireless-pen-tablet.tablet
 
 diff --git a/data/graphire-wireless-8x6.tablet 
 b/data/graphire-wireless-8x6.tablet
 new file mode 100644
 index 000..648d1b7
 --- /dev/null
 +++ b/data/graphire-wireless-8x6.tablet
 @@ -0,0 +1,13 @@
 +[Device]
 +Name=Wacom Graphire Wireless
 +DeviceMatch=bluetooth:056a:81
 +Class=Graphire
 +Width=8
 +Height=6
 +
 +[Features]
 +Reversible=false
 +Stylus=true
 +Ring=false
 +Buttons=2
 +BuiltIn=false
 diff --git a/data/wireless-pen-tablet.tablet b/data/wireless-pen-tablet.tablet
 deleted file mode 100644
 index 648d1b7..000
 --- a/data/wireless-pen-tablet.tablet
 +++ /dev/null
 @@ -1,13 +0,0 @@
 -[Device]
 -Name=Wacom Graphire Wireless
 -DeviceMatch=bluetooth:056a:81
 -Class=Graphire
 -Width=8
 -Height=6
 -
 -[Features]
 -Reversible=false
 -Stylus=true
 -Ring=false
 -Buttons=2
 -BuiltIn=false



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 04/11] lib: add missing ISDV4 class string conversion

2012-04-30 Thread Bastien Nocera
On Mon, 2012-04-30 at 15:53 +1000, Peter Hutterer wrote:
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Reviewed-By: Bastien Nocera had...@hadess.net

 ---
  libwacom/libwacom-database.c |2 ++
  1 file changed, 2 insertions(+)
 
 diff --git a/libwacom/libwacom-database.c b/libwacom/libwacom-database.c
 index 8351e06..dd69fd7 100644
 --- a/libwacom/libwacom-database.c
 +++ b/libwacom/libwacom-database.c
 @@ -64,6 +64,8 @@ libwacom_class_string_to_enum(const char *class)
   return WCLASS_INTUOS;
   if (strcmp(class, Intuos2) == 0)
   return WCLASS_INTUOS2;
 + if (strcmp(class, ISDV4) == 0)
 + return WCLASS_ISDV4;
  
   return WCLASS_UNKNOWN;
  }



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 05/11] lib: if no stylus is defined, assume the generic stylus

2012-04-30 Thread Bastien Nocera
On Mon, 2012-04-30 at 15:53 +1000, Peter Hutterer wrote:
 There is no touch-only wacom tablet at this point, so it's safe to assume
 that all tablets have some stylus.
 
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Reviewed-By: Bastien Nocera had...@hadess.net

 ---
  libwacom/libwacom-database.c |4 
  1 file changed, 4 insertions(+)
 
 diff --git a/libwacom/libwacom-database.c b/libwacom/libwacom-database.c
 index dd69fd7..70b93ca 100644
 --- a/libwacom/libwacom-database.c
 +++ b/libwacom/libwacom-database.c
 @@ -366,6 +366,10 @@ libwacom_parse_tablet_keyfile(const char *path)
   }
   g_strfreev (styli_list);
   device-supported_styli = (int *) g_array_free (array, FALSE);
 + } else {
 + device-supported_styli = g_new (int, 1);
 + *device-supported_styli = 0xf;
 + device-num_styli = 1;
   }
  
   /* Features */



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 06/11] lib: add PenDisplay as class type

2012-04-30 Thread Bastien Nocera
On Mon, 2012-04-30 at 15:53 +1000, Peter Hutterer wrote:
 Listed as Interactive Pen Display on the Wacom website

Link?

 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Reviewed-By: Bastien Nocera had...@hadess.net

 ---
  data/dtf-720.tablet  |1 +
  data/dti-520.tablet  |1 +
  data/dtu-1631.tablet |1 +
  data/dtu-2231.tablet |1 +
  libwacom/libwacom-database.c |2 ++
  libwacom/libwacom.c  |1 +
  libwacom/libwacom.h  |1 +
  7 files changed, 8 insertions(+)
 
 diff --git a/data/dtf-720.tablet b/data/dtf-720.tablet
 index 1325877..9bcf19f 100644
 --- a/data/dtf-720.tablet
 +++ b/data/dtf-720.tablet
 @@ -8,6 +8,7 @@ Name=Wacom DTF-720
  DeviceMatch=usb:056a:00c0
  Width=13
  Height=11
 +Class=PenDisplay
  
  [Features]
  Stylus=true
 diff --git a/data/dti-520.tablet b/data/dti-520.tablet
 index a8b23d3..1e7f9d4 100644
 --- a/data/dti-520.tablet
 +++ b/data/dti-520.tablet
 @@ -17,6 +17,7 @@
  [Device]
  Name=Wacom DTI520UB/L
  DeviceMatch=usb:056a:003a
 +Class=PenDisplay
  Width=14
  Height=12
  Styli=0xf;
 diff --git a/data/dtu-1631.tablet b/data/dtu-1631.tablet
 index 09ed3d3..13b6014 100644
 --- a/data/dtu-1631.tablet
 +++ b/data/dtu-1631.tablet
 @@ -8,6 +8,7 @@ Name=Wacom DTU-1631
  DeviceMatch=usb:056a:00f0
  Width=14
  Height=8
 +Class=PenDisplay
  
  [Features]
  Stylus=true
 diff --git a/data/dtu-2231.tablet b/data/dtu-2231.tablet
 index 24011b9..9cf0ef6 100644
 --- a/data/dtu-2231.tablet
 +++ b/data/dtu-2231.tablet
 @@ -5,6 +5,7 @@
  [Device]
  Name=Wacom DTU-2231
  DeviceMatch=usb:056a:00ce
 +Class=PenDisplay
  Width=19
  Height=11
  
 diff --git a/libwacom/libwacom-database.c b/libwacom/libwacom-database.c
 index 70b93ca..0c60d6d 100644
 --- a/libwacom/libwacom-database.c
 +++ b/libwacom/libwacom-database.c
 @@ -66,6 +66,8 @@ libwacom_class_string_to_enum(const char *class)
   return WCLASS_INTUOS2;
   if (strcmp(class, ISDV4) == 0)
   return WCLASS_ISDV4;
 + if (strcmp(class, PenDisplay) == 0)
 + return WCLASS_PEN_DISPLAYS;
  
   return WCLASS_UNKNOWN;
  }
 diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
 index 432d6e6..811948a 100644
 --- a/libwacom/libwacom.c
 +++ b/libwacom/libwacom.c
 @@ -526,6 +526,7 @@ libwacom_print_device_description(int fd, WacomDevice 
 *device)
   case WCLASS_ISDV4:  class_name = ISDV4;   break;
   case WCLASS_INTUOS: class_name = Intuos;  break;
   case WCLASS_INTUOS2:class_name = Intuos2; break;
 + case WCLASS_PEN_DISPLAYS:   class_name = PenDisplay;  
 break;
   default:g_assert_not_reached(); break;
   }
  
 diff --git a/libwacom/libwacom.h b/libwacom/libwacom.h
 index b397865..f7e6cf9 100644
 --- a/libwacom/libwacom.h
 +++ b/libwacom/libwacom.h
 @@ -128,6 +128,7 @@ typedef enum {
   WCLASS_ISDV4,   /** Any serial ISDV4 device */
   WCLASS_INTUOS,  /** Any Intuos series */
   WCLASS_INTUOS2, /** Any Intuos2 series */
 + WCLASS_PEN_DISPLAYS,/** Any interactive pen display */
  } WacomClass;
  
  /**



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 07/11] data: fix bamboo class and size

2012-04-30 Thread Bastien Nocera
On Mon, 2012-04-30 at 15:53 +1000, Peter Hutterer wrote:
 Fractional sizes don't get parse properly, round up to the nearest inch
 
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Reviewed-By: Bastien Nocera had...@hadess.net

 ---
  data/bamboo-one.tablet   |5 +++--
  data/bamboo-pen-and-touch.tablet |4 ++--
  2 files changed, 5 insertions(+), 4 deletions(-)
 
 diff --git a/data/bamboo-one.tablet b/data/bamboo-one.tablet
 index 67f0114..feacf54 100644
 --- a/data/bamboo-one.tablet
 +++ b/data/bamboo-one.tablet
 @@ -2,8 +2,9 @@
  # Bamboo One (CTF-430/SO-B)
  Name=Bamboo One
  DeviceMatch=usb:056a:0069
 -Width=5.0
 -Height=3.6
 +Class=Bamboo
 +Width=5
 +Height=4
  
  [Features]
  Reversible=true
 diff --git a/data/bamboo-pen-and-touch.tablet 
 b/data/bamboo-pen-and-touch.tablet
 index feea4dd..125db37 100644
 --- a/data/bamboo-pen-and-touch.tablet
 +++ b/data/bamboo-pen-and-touch.tablet
 @@ -9,8 +9,8 @@ Class=Bamboo
  # There are two widths and heigths, one for pen input, one for touch.
  # The one for pen is bigger, but in linux, only the smaller one works.
  # But as the width is advertised as the bigger one for pen input, I put the 
 pen input here.
 -Width=5.8
 -Height=3.6
 +Width=6
 +Height=4
  
  # The other stylusses don't match it, it has two buttons and an eraser.
  Styli=0xf



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 08/11] data: fix class and dimensions for isdv4-e4 and isdv4-e6

2012-04-30 Thread Bastien Nocera
On Mon, 2012-04-30 at 15:53 +1000, Peter Hutterer wrote:
 E6 was simply measured, E3 calculated from dimensions found on the tm2 tech
 specs. Both rounded to the nearest inch.

Is this really useful when the size depends on what laptop make this is
in?

 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Reviewed-By: Bastien Nocera had...@hadess.net

 ---
  data/isdv4-e3.tablet |3 +++
  data/isdv4-e6.tablet |3 +++
  2 files changed, 6 insertions(+)
 
 diff --git a/data/isdv4-e3.tablet b/data/isdv4-e3.tablet
 index a676f35..5f56f73 100644
 --- a/data/isdv4-e3.tablet
 +++ b/data/isdv4-e3.tablet
 @@ -3,6 +3,9 @@
  [Device]
  Name=Wacom ISDv4 E3
  DeviceMatch=usb:056a:00e3;serial:056a:00e3
 +Class=ISDV4
 +Width=10
 +Height=8
  
  [Features]
  Stylus=true
 diff --git a/data/isdv4-e6.tablet b/data/isdv4-e6.tablet
 index 579831b..328a702 100644
 --- a/data/isdv4-e6.tablet
 +++ b/data/isdv4-e6.tablet
 @@ -3,6 +3,9 @@
  [Device]
  Name=Wacom ISDv4 E6
  DeviceMatch=usb:056a:00e6
 +Class=ISDV4
 +Width=11
 +Height=6
  
  [Features]
  Stylus=true



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 09/11] data: Fix class and dimensions for WACf004

2012-04-30 Thread Bastien Nocera
On Mon, 2012-04-30 at 15:53 +1000, Peter Hutterer wrote:
 This thing ships in the HP 2710p, calculated from screen res, round to the
 nearest inch.

Same question as for patch 8

 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
 ---
  data/serial-wacf004.tablet |3 +++
  1 file changed, 3 insertions(+)
 
 diff --git a/data/serial-wacf004.tablet b/data/serial-wacf004.tablet
 index 3d2f0e3..8270d0f 100644
 --- a/data/serial-wacf004.tablet
 +++ b/data/serial-wacf004.tablet
 @@ -1,6 +1,9 @@
  [Device]
  Name=Wacom Serial Tablet WACf004
  DeviceMatch=serial::
 +Class=ISDV4
 +Width=10
 +Height=8
  
  [Features]
  Stylus=true



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 10/11] test: add test for database entry validity

2012-04-30 Thread Bastien Nocera
On Mon, 2012-04-30 at 15:53 +1000, Peter Hutterer wrote:
 Test each tablet returned for some basic sanity (largely = 0 values)

Are you going to hook that up?

 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Reviewed-By: Bastien Nocera had...@hadess.net

 ---
  test/Makefile.am   |3 +-
  test/tablet-validity.c |   95 
 
  2 files changed, 97 insertions(+), 1 deletion(-)
  create mode 100644 test/tablet-validity.c
 
 diff --git a/test/Makefile.am b/test/Makefile.am
 index 7ef0e52..090a1e2 100644
 --- a/test/Makefile.am
 +++ b/test/Makefile.am
 @@ -1,4 +1,4 @@
 -noinst_PROGRAMS=load dbverify
 +noinst_PROGRAMS=load dbverify tablet-validity
  
  TESTS=$(noinst_PROGRAMS)
  
 @@ -6,3 +6,4 @@ INCLUDES=-I$(top_srcdir)/libwacom 
 -DTOPSRCDIR=\$(top_srcdir)\
  
  load_LDADD=$(top_builddir)/libwacom/libwacom.la
  dbverify_LDADD=$(top_builddir)/libwacom/libwacom.la
 +tablet_validity_LDADD=$(top_builddir)/libwacom/libwacom.la
 diff --git a/test/tablet-validity.c b/test/tablet-validity.c
 new file mode 100644
 index 000..ac53903
 --- /dev/null
 +++ b/test/tablet-validity.c
 @@ -0,0 +1,95 @@
 +/*
 + * Copyright © 2012 Red Hat, Inc.
 + *
 + * Permission to use, copy, modify, distribute, and sell this software
 + udo y and its documentation for any purpose is hereby granted without
 + * fee, provided that the above copyright notice appear in all copies
 + * and that both that copyright notice and this permission notice
 + * appear in supporting documentation, and that the name of Red Hat
 + * not be used in advertising or publicity pertaining to distribution
 + * of the software without specific, written prior permission.  Red
 + * Hat makes no representations about the suitability of this software
 + * for any purpose.  It is provided as is without express or implied
 + * warranty.
 + *
 + * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
 + * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
 + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
 + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
 + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 + *
 + * Authors:
 + *   Peter Hutterer (peter.hutte...@redhat.com)
 + */
 +
 +#ifdef HAVE_CONFIG_H
 +#include config.h
 +#endif
 +
 +#define _GNU_SOURCE
 +#include stdio.h
 +#include stdlib.h
 +#include string.h
 +#include dirent.h
 +#include sys/types.h
 +#include sys/stat.h
 +#include fcntl.h
 +#include libwacom.h
 +#include assert.h
 +#include unistd.h
 +
 +static void verify_tablet(WacomDevice *device)
 +{
 + const char *name;
 + int nstyli;
 +
 + name = libwacom_get_name(device);
 + if (strcmp(name, Generic) == 0)
 + return;
 +
 + printf(Verifying tablet %s\n, name);
 + assert(libwacom_get_class(device) != WCLASS_UNKNOWN);
 + assert(name  strlen(name)  0);
 + if (libwacom_get_bustype(device) != WBUSTYPE_SERIAL) {
 + assert(libwacom_get_vendor_id(device)  0);
 + assert(libwacom_get_product_id(device)  0);
 + }
 + assert(libwacom_get_match(device) != NULL);
 + assert(libwacom_get_matches(device) != NULL);
 + assert(libwacom_get_width(device)  0);
 + assert(libwacom_get_height(device)  0);
 + assert(libwacom_get_num_buttons(device) = 0);
 + assert(libwacom_get_supported_styli(device, nstyli) != NULL);
 + assert(nstyli  0);
 + assert(libwacom_get_ring_num_modes(device) = 0);
 + assert(libwacom_get_ring2_num_modes(device) = 0);
 + assert(libwacom_get_num_strips(device) = 0);
 + assert(libwacom_get_strips_num_modes(device) = 0);
 + assert(libwacom_get_bustype(device) != WBUSTYPE_UNKNOWN);
 +}
 +
 +int main(int argc, char **argv)
 +{
 + WacomDeviceDatabase *db;
 + WacomDevice **device, **devices;
 +
 + db = libwacom_database_new_for_path(TOPSRCDIR/data);
 + if (!db)
 + printf(Failed to load data from %s, TOPSRCDIR/data);
 + assert(db);
 +
 + devices = libwacom_list_devices_from_database(db, NULL);
 + assert(devices);
 + assert(*devices);
 +
 + for (device = devices; *device; device++)
 + verify_tablet(*device);
 +
 + libwacom_database_destroy (db);
 +
 + return 0;
 +}
 +
 +/* vim: set noexpandtab tabstop=8 shiftwidth=8: */



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel

Re: [Linuxwacom-devel] [PATCH libwacom 11/11] Replace INCLUDES with AM_CPPFLAGS

2012-04-30 Thread Bastien Nocera
On Mon, 2012-04-30 at 15:53 +1000, Peter Hutterer wrote:
 INCLUDES is deprecated in favour of the latter

In the future, no need to send those for review, use your best
judgement.

 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Reviewed-By: Bastien Nocera had...@hadess.net

 ---
  test/Makefile.am  |2 +-
  tools/Makefile.am |2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/test/Makefile.am b/test/Makefile.am
 index 090a1e2..72edbaa 100644
 --- a/test/Makefile.am
 +++ b/test/Makefile.am
 @@ -2,7 +2,7 @@ noinst_PROGRAMS=load dbverify tablet-validity
  
  TESTS=$(noinst_PROGRAMS)
  
 -INCLUDES=-I$(top_srcdir)/libwacom -DTOPSRCDIR=\$(top_srcdir)\
 +AM_CPPFLAGS=-I$(top_srcdir)/libwacom -DTOPSRCDIR=\$(top_srcdir)\
  
  load_LDADD=$(top_builddir)/libwacom/libwacom.la
  dbverify_LDADD=$(top_builddir)/libwacom/libwacom.la
 diff --git a/tools/Makefile.am b/tools/Makefile.am
 index b8b0aef..fcc2069 100644
 --- a/tools/Makefile.am
 +++ b/tools/Makefile.am
 @@ -1,4 +1,4 @@
 -INCLUDES=-I$(top_srcdir)/libwacom -DTOPSRCDIR=\$(top_srcdir)\
 +AM_CPPFLAGS=-I$(top_srcdir)/libwacom -DTOPSRCDIR=\$(top_srcdir)\
  
  noinst_PROGRAMS = generate-udev-rules list-devices
  generate_udev_rules_SOURCES = generate-udev-rules.c



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom v3 3/7] tools: Add --database option to list-local-devices

2012-04-27 Thread Bastien Nocera
On Fri, 2012-04-27 at 13:07 +1000, Peter Hutterer wrote:
 Let the caller specify the database path (for local testing), otherwise use
 the system-installed database.
 
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Minor style comment below

Reviewed-By: Bastien Nocera had...@hadess.net

 ---
 Changes to v3
 - use G_OPTION_ARG_FILENAME
 - returned path isn't const, it needs to be freed
 
  tools/Makefile.am  |1 +
  tools/list-local-devices.c |   33 -
  2 files changed, 33 insertions(+), 1 deletion(-)
 
 diff --git a/tools/Makefile.am b/tools/Makefile.am
 index 2238cec..b8b0aef 100644
 --- a/tools/Makefile.am
 +++ b/tools/Makefile.am
 @@ -10,4 +10,5 @@ list_devices_LDADD=$(top_builddir)/libwacom/libwacom.la
  bin_PROGRAMS = libwacom-list-local-devices
  libwacom_list_local_devices_SOURCES = list-local-devices.c
  libwacom_list_local_devices_LDADD=$(top_builddir)/libwacom/libwacom.la
 +libwacom_list_local_devices_CFLAGS=$(GLIB_CFLAGS)
  
 diff --git a/tools/list-local-devices.c b/tools/list-local-devices.c
 index 3dbba3d..911407f 100644
 --- a/tools/list-local-devices.c
 +++ b/tools/list-local-devices.c
 @@ -33,8 +33,17 @@
  #include string.h
  #include assert.h
  #include dirent.h
 +#include glib/gi18n.h
 +#include glib.h
  #include libwacom.h
  
 +static char *database_path;
 +
 +static GOptionEntry opts[] = {
 +{database, 0, 0, G_OPTION_ARG_FILENAME, database_path, N_(Path 
 to device database), NULL },
 + {NULL}
 +};
 +
  static int event_devices_only(const struct dirent *dir) {
   return strncmp(event, dir-d_name, 5) == 0;
  }
 @@ -45,8 +54,30 @@ int main(int argc, char **argv)
   WacomDevice *dev;
   int i;
   struct dirent **namelist = NULL;
 + GOptionContext *context;
 + GError *error;
 +
 + context = g_option_context_new (NULL);
 +
 + g_option_context_add_main_entries (context, opts, NULL);
 + error = NULL;
 +
 + if (!g_option_context_parse (context, argc, argv, error)) {
 + if (error != NULL) {
 + fprintf (stderr, %s\n, error-message);
 + g_error_free (error);
 + }
 + return EXIT_FAILURE;
 + }
 +
 + g_option_context_free (context);
 +
 + if (database_path) {
 + db = libwacom_database_new_for_path(database_path);
 + g_free (database_path);
 + } else
 + db = libwacom_database_new();

I'd put braces in for both branches of the conditional, otherwise it
looks weird.

 - db = libwacom_database_new_for_path(TOPSRCDIR/data);
   if (!db) {
   fprintf(stderr, Failed to initialize device database\n);
   return 1;



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom v2 6/7] lib: run up the parent to find the PRODUCT

2012-04-27 Thread Bastien Nocera
On Fri, 2012-04-27 at 12:49 +1000, Peter Hutterer wrote:
 On Thu, Apr 26, 2012 at 10:00:47AM +0100, Bastien Nocera wrote:
  On Thu, 2012-04-26 at 15:50 +1000, Peter Hutterer wrote:
   For bluetooth devices, the PRODUCT is set on the event device. For
   inputattached serial devices, the PRODUCT Is on the parent instead.
   
   Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
   ---
   Changes to v1:
   - don't unref the parent while we're still using product_str
   - get parent from old_parent (no functional change)
   - gheck for parent != NULL before fetching product. If parent is NULL, 
   this
 will just move the segfault down to the assert(product_str)
   
libwacom/libwacom.c |   21 +++--
1 file changed, 15 insertions(+), 6 deletions(-)
   
   diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
   index 1aeadcd..b966280 100644
   --- a/libwacom/libwacom.c
   +++ b/libwacom/libwacom.c
   @@ -156,7 +156,8 @@ get_device_info (const char   *path,

 *vendor_id = strtol (vendor_str, NULL, 16);
 *product_id = strtol (product_str, NULL, 16);
   - } else if (*bus == WBUSTYPE_BLUETOOTH) {
   + } else if (*bus == WBUSTYPE_BLUETOOTH || *bus == WBUSTYPE_SERIAL) {
   + GUdevDevice *parent;
  
  Isn't this shadowing another declaration? You have a parent being used
  in another branch of a conditional below:
  snip
   - } else if (*bus == WBUSTYPE_SERIAL) {
   - /* FIXME This matches the declaration in serial-wacf004.tablet
   -  * Might not be good enough though */
   - *vendor_id = 0;
   - *product_id = 0;
   + if (parent)
   + g_object_unref (parent);
  
  Here.
 
 this is just a bad diff. the parent here is the one declared in the hunk
 above (the WBUSTYPE_SERIAL condition was moved, so they fall together now).
 
 There is one more parent object but that's local too and expires before we
 get to this block.

Ok, looks good then.

Reviewed-By: Bastien Nocera had...@hadess.net


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom] tools: Split custom CFLAGS into AM_CPPFLAGS, not INCLUDES

2012-04-27 Thread Bastien Nocera
On Fri, 2012-04-27 at 12:50 +1000, Peter Hutterer wrote:
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
 ---
  tools/Makefile.am |4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
 
 diff --git a/tools/Makefile.am b/tools/Makefile.am
 index b8b0aef..dc1d272 100644
 --- a/tools/Makefile.am
 +++ b/tools/Makefile.am
 @@ -1,4 +1,6 @@
 -INCLUDES=-I$(top_srcdir)/libwacom -DTOPSRCDIR=\$(top_srcdir)\
 +INCLUDES=-I$(top_srcdir)/libwacom
 +
 +AM_CPPFLAGS = -DTOPSRCDIR=\$(top_srcdir)\

You're not supposed to override the AM_* variables, they're not yours to
play with.

  noinst_PROGRAMS = generate-udev-rules list-devices
  generate_udev_rules_SOURCES = generate-udev-rules.c



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom v2 6/7] lib: run up the parent to find the PRODUCT

2012-04-26 Thread Bastien Nocera
On Thu, 2012-04-26 at 15:50 +1000, Peter Hutterer wrote:
 For bluetooth devices, the PRODUCT is set on the event device. For
 inputattached serial devices, the PRODUCT Is on the parent instead.
 
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
 ---
 Changes to v1:
 - don't unref the parent while we're still using product_str
 - get parent from old_parent (no functional change)
 - gheck for parent != NULL before fetching product. If parent is NULL, this
   will just move the segfault down to the assert(product_str)
 
  libwacom/libwacom.c |   21 +++--
  1 file changed, 15 insertions(+), 6 deletions(-)
 
 diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
 index 1aeadcd..b966280 100644
 --- a/libwacom/libwacom.c
 +++ b/libwacom/libwacom.c
 @@ -156,7 +156,8 @@ get_device_info (const char   *path,
  
   *vendor_id = strtol (vendor_str, NULL, 16);
   *product_id = strtol (product_str, NULL, 16);
 - } else if (*bus == WBUSTYPE_BLUETOOTH) {
 + } else if (*bus == WBUSTYPE_BLUETOOTH || *bus == WBUSTYPE_SERIAL) {
 + GUdevDevice *parent;

Isn't this shadowing another declaration? You have a parent being used
in another branch of a conditional below:
snip
 - } else if (*bus == WBUSTYPE_SERIAL) {
 - /* FIXME This matches the declaration in serial-wacf004.tablet
 -  * Might not be good enough though */
 - *vendor_id = 0;
 - *product_id = 0;
 + if (parent)
 + g_object_unref (parent);

Here.


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom v2 5/7] lib: check the grandparent's subsystem for the bus string

2012-04-26 Thread Bastien Nocera
On Thu, 2012-04-26 at 15:47 +1000, Peter Hutterer wrote:
 The device and its parent have input, but the grandparent has the
 actual subsystem this device is connected through.
 
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Reviewed-By: Bastien Nocera had...@hadess.net

 ---
 Changes to v1:
 - remove superfluous () around g_strcmp0
 - get parent from old_parent (no functional change)
 - strdup the bus string, the original string is not valid after
   g_object_unref(parent)
 
 
  libwacom/libwacom.c |   53 
 ---
  1 file changed, 33 insertions(+), 20 deletions(-)
 
 diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
 index accb941..1aeadcd 100644
 --- a/libwacom/libwacom.c
 +++ b/libwacom/libwacom.c
 @@ -47,6 +47,34 @@ is_tablet_or_touchpad (GUdevDevice *device)
   g_udev_device_get_property_as_boolean (device, 
 ID_INPUT_TOUCHPAD);
  }
  
 +static char *
 +get_bus (GUdevDevice *device)
 +{
 + const char *subsystem;
 + char *bus_str;
 + GUdevDevice *parent;
 +
 + subsystem = g_udev_device_get_subsystem (device);
 + parent = g_object_ref (device);
 +
 + while (parent  g_strcmp0 (subsystem, input) == 0) {
 + GUdevDevice *old_parent = parent;
 + parent = g_udev_device_get_parent (old_parent);
 + subsystem = g_udev_device_get_subsystem (parent);
 + g_object_unref (old_parent);
 + }
 +
 + if (g_strcmp0 (subsystem, tty) == 0 || g_strcmp0 (subsystem, serio) 
 == 0)
 + bus_str = g_strdup (serial);
 + else
 + bus_str = g_strdup (subsystem);
 +
 + if (parent)
 + g_object_unref (parent);
 +
 + return bus_str;
 +}
 +
  static gboolean
  get_device_info (const char   *path,
int  *vendor_id,
 @@ -60,7 +88,7 @@ get_device_info (const char   *path,
   GUdevDevice *device;
   const char * const subsystems[] = { input, NULL };
   gboolean retval;
 - const char *bus_str;
 + char *bus_str;
   const char *devname;
  
   g_type_init();
 @@ -68,6 +96,7 @@ get_device_info (const char   *path,
   retval = FALSE;
   *builtin = IS_BUILTIN_UNSET;
   *name = NULL;
 + bus_str = NULL;
   client = g_udev_client_new (subsystems);
   device = g_udev_client_query_by_device_file (client, path);
   if (device == NULL) {
 @@ -88,25 +117,7 @@ get_device_info (const char   *path,
   g_object_unref (parent);
   }
  
 - /* FIXME: ID_BUS on the device is usb even for bluetooth devices,
 -  * but ID_BUS on the parent is NULL.
 -  */
 - bus_str = g_udev_device_get_property (device, ID_BUS);
 - /* Serial devices are weird */
 - if (bus_str == NULL) {
 - if (g_strcmp0 (g_udev_device_get_subsystem (device), tty) == 
 0)
 - bus_str = serial;
 - }
 - /* Poke the parent device for Bluetooth models */
 - if (bus_str == NULL) {
 - GUdevDevice *parent;
 -
 - parent = g_udev_device_get_parent (device);
 -
 - g_object_unref (device);
 - device = parent;
 - bus_str = bluetooth;
 - }
 + bus_str = get_bus (device);
  
   /* Is the device builtin? */
   devname = g_udev_device_get_name (device);
 @@ -179,6 +190,8 @@ get_device_info (const char   *path,
   retval = TRUE;
  
  bail:
 + if (bus_str != NULL)
 + g_free (bus_str);
   if (retval == FALSE)
   g_free (*name);
   if (device != NULL)



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 3/7] tools: try the system-installed database if the local one fails

2012-04-26 Thread Bastien Nocera
On Thu, 2012-04-26 at 15:24 +1000, Peter Hutterer wrote:
 On Tue, Apr 24, 2012 at 03:48:17PM +0100, Bastien Nocera wrote:
  On Tue, 2012-04-24 at 15:02 +1000, Peter Hutterer wrote:
   Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
  
  Is this wise? The tool isn't supposed to be installed, or is it? If it
  is, then we shouldn't be starting with trying to read the DB from the
  local source tree.
 
 The tool is installed as libwacom-list-local-devices. I know the approach
 isn't ideal, but this is the closest I found to having both the local
 database work as well as the installed one.
 
 The database searchpath is defined through TOPSRCDIR and unless we can
 somehow change this on install, we'd otherwise have to go for either always
 using the system database or always the local one.

The best would be to have 2 compilations of the program then, with
different defines. Otherwise the details of the build tree would be
leaked out (or it needs to find another way to detect that it's in the
source tree).


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 1/7] lib: free stylus keyfile after use

2012-04-24 Thread Bastien Nocera
On Tue, 2012-04-24 at 15:02 +1000, Peter Hutterer wrote:
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Reviewed-By: Bastien Nocera had...@hadess.net

 ---
  libwacom/libwacom-database.c |2 ++
  1 file changed, 2 insertions(+)
 
 diff --git a/libwacom/libwacom-database.c b/libwacom/libwacom-database.c
 index 308ba6d..652a94e 100644
 --- a/libwacom/libwacom-database.c
 +++ b/libwacom/libwacom-database.c
 @@ -219,6 +219,8 @@ libwacom_parse_stylus_keyfile(WacomDeviceDatabase *db, 
 const char *path)
   g_hash_table_insert (db-stylus_ht, GINT_TO_POINTER (id), 
 stylus);
   }
   g_strfreev (groups);
 + if (keyfile)
 + g_key_file_free (keyfile);
  }
  
  struct {



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 2/7] tools: print error if db failed to initialise

2012-04-24 Thread Bastien Nocera
On Tue, 2012-04-24 at 15:02 +1000, Peter Hutterer wrote:
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Reviewed-By: Bastien Nocera had...@hadess.net

 ---
  tools/list-local-devices.c |4 
  1 file changed, 4 insertions(+)
 
 diff --git a/tools/list-local-devices.c b/tools/list-local-devices.c
 index 1f7bd56..3dbba3d 100644
 --- a/tools/list-local-devices.c
 +++ b/tools/list-local-devices.c
 @@ -47,6 +47,10 @@ int main(int argc, char **argv)
   struct dirent **namelist = NULL;
  
   db = libwacom_database_new_for_path(TOPSRCDIR/data);
 + if (!db) {
 + fprintf(stderr, Failed to initialize device database\n);
 + return 1;
 + }
  
   i = scandir(/dev/input, namelist, event_devices_only, alphasort);
  



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 3/7] tools: try the system-installed database if the local one fails

2012-04-24 Thread Bastien Nocera
On Tue, 2012-04-24 at 15:02 +1000, Peter Hutterer wrote:
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Is this wise? The tool isn't supposed to be installed, or is it? If it
is, then we shouldn't be starting with trying to read the DB from the
local source tree.

 ---
  tools/list-local-devices.c |2 ++
  1 file changed, 2 insertions(+)
 
 diff --git a/tools/list-local-devices.c b/tools/list-local-devices.c
 index 3dbba3d..1702790 100644
 --- a/tools/list-local-devices.c
 +++ b/tools/list-local-devices.c
 @@ -47,6 +47,8 @@ int main(int argc, char **argv)
   struct dirent **namelist = NULL;
  
   db = libwacom_database_new_for_path(TOPSRCDIR/data);
 + if (!db)
 + db = libwacom_database_new();
   if (!db) {
   fprintf(stderr, Failed to initialize device database\n);
   return 1;



--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom v3 9/9] lib: Try to match the parent for ID_INPUT_* as well

2012-04-20 Thread Bastien Nocera
Em Fri, 2012-04-20 às 15:10 +1000, Peter Hutterer escreveu:
 
 +   if (!parent || !is_tablet_or_touchpad(parent)) {
 +   libwacom_error_set(error, WERROR_INVALID_PATH,
 Device '%s' is not a tablet, path);
 +   goto bail;
 +   } 

You're leaking parent if it's not a tablet or touchpad.

Reviewed-By: Bastien Nocera had...@hadess.net


--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom] lib: harden the API against invalid matches

2012-04-20 Thread Bastien Nocera
Em Fri, 2012-04-20 às 14:49 +1000, Peter Hutterer escreveu:
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
 ---
 New patch, I didn't want to jump through the rebase hoops (indentation patch
 is in between the original and this one).

Reviewed-By: Bastien Nocera had...@hadess.net

  libwacom/libwacom.c |8 
  1 file changed, 8 insertions(+)
 
 diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
 index 632bece..ccd7789 100644
 --- a/libwacom/libwacom.c
 +++ b/libwacom/libwacom.c
 @@ -596,6 +596,8 @@ libwacom_update_match(WacomDevice *device, WacomBusType 
 bus, int vendor_id, int
  
  int libwacom_get_vendor_id(WacomDevice *device)
  {
 + g_return_val_if_fail(device-match = 0, -1);
 + g_return_val_if_fail(device-match  device-nmatches, -1);
   return device-matches[device-match]-vendor_id;
  }
  
 @@ -606,11 +608,15 @@ const char* libwacom_get_name(WacomDevice *device)
  
  int libwacom_get_product_id(WacomDevice *device)
  {
 + g_return_val_if_fail(device-match = 0, -1);
 + g_return_val_if_fail(device-match  device-nmatches, -1);
   return device-matches[device-match]-product_id;
  }
  
  const char* libwacom_get_match(WacomDevice *device)
  {
 + g_return_val_if_fail(device-match = 0, NULL);
 + g_return_val_if_fail(device-match  device-nmatches, NULL);
   return device-matches[device-match]-match;
  }
  
 @@ -697,6 +703,8 @@ int libwacom_is_reversible(WacomDevice *device)
  
  WacomBusType libwacom_get_bustype(WacomDevice *device)
  {
 + g_return_val_if_fail(device-match = 0, -1);
 + g_return_val_if_fail(device-match  device-nmatches, -1);
   return device-matches[device-match]-bus;
  }
  



--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 1/6] lib: add documentation hunk about button naming

2012-04-19 Thread Bastien Nocera
On Thu, 2012-04-19 at 09:40 +1000, Peter Hutterer wrote:
 On Wed, Apr 18, 2012 at 10:42:03AM +0100, Bastien Nocera wrote:
  On Wed, 2012-04-18 at 14:52 +1000, Peter Hutterer wrote:
   Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
  
  Signed-off-by: Bastien Nocera had...@hadess.net
 
 thanks. fwiw, the s-o-b tag usually signifies that you wrote or passed on
 the patch.
 http://sourceforge.net/apps/mediawiki/linuxwacom/index.php?title=SubmittingPatches
 (which largely links to the kernel doc anyway)

Shows you how much I use that.

 We've been using Acked-by or Reviewed-by, depending on how confident you are
 with the patch content and review. Can I assume that all yours are
 Reviewed-by then?

Yes.


--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 6/6] lib: allow for multiple stylus definition files

2012-04-19 Thread Bastien Nocera
On Thu, 2012-04-19 at 09:23 +1000, Peter Hutterer wrote:
 On Wed, Apr 18, 2012 at 10:44:39AM +0100, Bastien Nocera wrote:
  On Wed, 2012-04-18 at 14:52 +1000, Peter Hutterer wrote:
   Don't hardcode a single stylus definition file, scan the directory for
   .stylus files
  
  What's the use?
 
 largely for the test-case in the third patchset I've sent out. I'm also not
 sure why we have named .tablet files but only one hardcoded .stylus file.
 having libwacom just take the same approach for both seems more consistent.

Having separate files for each tablet was necessary given the sheer
number of tablets. The stylus definitions are smaller and
self-contained. But if this allows for automated testing, I'm all for
it.

 Cheers,
   Peter
 
  
   Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
   ---
libwacom/libwacom-database.c |   37 +++--
libwacom/libwacomint.h   |1 -
2 files changed, 35 insertions(+), 3 deletions(-)
   
   diff --git a/libwacom/libwacom-database.c b/libwacom/libwacom-database.c
   index 5a6d212..fcc9f03 100644
   --- a/libwacom/libwacom-database.c
   +++ b/libwacom/libwacom-database.c
   @@ -37,6 +37,7 @@
#include stdio.h

#define TABLET_SUFFIX .tablet
   +#define STYLUS_SUFFIX .stylus
#define FEATURES_GROUP Features
#define DEVICE_GROUP Device
#define BUTTONS_GROUP Buttons
   @@ -396,6 +397,24 @@ scandir_tablet_filter(const struct dirent *entry)
 return !strcmp(name[len - suffix_len], TABLET_SUFFIX);
}

   +static int
   +scandir_stylus_filter(const struct dirent *entry)
   +{
   + const char *name = entry-d_name;
   + int len, suffix_len;
   +
   + if (!name || name[0] == '.')
   + return 0;
   +
   + len = strlen(name);
   + suffix_len = strlen(STYLUS_SUFFIX);
   + if (len = suffix_len)
   + return 0;
   +
   + return !strcmp(name[len - suffix_len], STYLUS_SUFFIX);
   +}
   +
   +
WacomDeviceDatabase *
libwacom_database_new_for_path (const char *datadir)
{
   @@ -435,12 +454,26 @@ libwacom_database_new_for_path (const char *datadir)
free(files);

/* Load styli */
   -path = g_build_filename (datadir, STYLUS_DATA_FILE, NULL);
   +n = scandir(datadir, files, scandir_stylus_filter, alphasort);
   +if (n = 0) {
   + libwacom_database_destroy(db);
   + return NULL;
   +}
   +
db-stylus_ht = g_hash_table_new_full (g_direct_hash,
g_direct_equal,
NULL,
(GDestroyNotify) 
   libwacom_stylus_destroy);
   -libwacom_parse_stylus_keyfile(db, path);
   +nfiles = n;
   +while(n--) {
   + path = g_build_filename (datadir, files[n]-d_name, NULL);
   + libwacom_parse_stylus_keyfile(db, path);
   + g_free(path);
   +}
   +
   +while(nfiles--)
   + free(files[nfiles]);
   +free(files);

/* If we couldn't load _anything_ then something's wrong */
if (g_hash_table_size (db-device_ht) == 0 
   diff --git a/libwacom/libwacomint.h b/libwacom/libwacomint.h
   index 66202b0..5dcff6a 100644
   --- a/libwacom/libwacomint.h
   +++ b/libwacom/libwacomint.h
   @@ -54,7 +54,6 @@

   
#define GENERIC_DEVICE_MATCH generic
   -#define STYLUS_DATA_FILE libwacom.stylus

typedef enum {
 IS_BUILTIN_UNSET= -1,
  
  



--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 3/9] lib: update to take multiple match types in the struct

2012-04-19 Thread Bastien Nocera
On Thu, 2012-04-19 at 10:56 +1000, Peter Hutterer wrote:
 On Wed, Apr 18, 2012 at 11:41:31AM +0100, Bastien Nocera wrote:
  On Wed, 2012-04-18 at 14:57 +1000, Peter Hutterer wrote:
   Add a new type WacomMatch that holds device matching information.
   A WacomDevice in libwacom now has a bunch of possible matches that can be
   queried. The first possible match is the default match unless the device 
   was
   updated otherwise (e.g. libwacom_device_new_from_path will set the correct
   match).
   
   Previous calls to get bustype, vendor_id, product_id now return the set
   match's values.
   
   Basic refcounting was added to the WacomDevice to allow for the device to 
   be
   stored multiple times in the device hashtable.
   
   Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
   ---
 [...]
   + device-matches[device-nmatches-1] = libwacom_copy_match(match);
   + device-match = device-nmatches - 1;
   + g_free(newmatch);
}

int libwacom_get_vendor_id(WacomDevice *device)
{
   -return device-vendor_id;
   +return device-matches[device-match]-vendor_id;
}
  
  Add guards around public API.
 
 I'm not sure what you mean here. Asserts?
 all other comments addressed in v2.

Something akin to that:
g_return_val_if_fail (device != NULL, -1);
g_return_val_if_fail (device-match  device-num_matches, -1);
etc.

(Showing those as programmer errors, rather than crashing). The previous
case (passing NULL to the function) would have been instantly
recognisable in a stack trace. Addressing a particular offset inside an
array that's inside a struct strikes me as particularly fragile.


--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom v2 3/8] lib: add a function to print the device description

2012-04-19 Thread Bastien Nocera
On Thu, 2012-04-19 at 13:10 +1000, Peter Hutterer wrote:
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Reviewed-By: Bastien Nocera had...@hadess.net

 ---
 Changes since v1:
 - update for new libwacom_get_matches() API
 - change from FILE to fd
 - squash together with same function for stylus descriptions
 
  libwacom/libwacom.c|  139 
 
  libwacom/libwacom.h|   17 ++
  libwacom/libwacomint.h |3 +-
  3 files changed, 158 insertions(+), 1 deletion(-)
 
 diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
 index 010cd5f..8fe2b59 100644
 --- a/libwacom/libwacom.c
 +++ b/libwacom/libwacom.c
 @@ -356,6 +356,118 @@ libwacom_new_from_name(WacomDeviceDatabase *db, const 
 char *name, WacomError *er
   return NULL;
  }
  
 +static void print_styli_for_device (int fd, WacomDevice *device)
 +{
 + int nstyli, *styli;
 + int i;
 +
 + if (!libwacom_has_stylus(device))
 + return;
 +
 + styli = libwacom_get_supported_styli(device, nstyli);
 +
 + dprintf(fd, Styli=);
 + for (i = 0; i  nstyli; i++)
 + dprintf(fd, %#x;, styli[i]);
 + dprintf(fd, \n);
 +}
 +
 +static void print_button_flag_if(int fd, WacomDevice *device, const char 
 *label, int flag)
 +{
 + int nbuttons = libwacom_get_num_buttons(device);
 + char b;
 + dprintf(fd, %s=, label);
 + for (b = 'A'; b  'A' + nbuttons; b++)
 + if (libwacom_get_button_flag(device, b)  flag)
 + dprintf(fd, %c;, b);
 + dprintf(fd, \n);
 +}
 +
 +static void print_buttons_for_device (int fd, WacomDevice *device)
 +{
 + int nbuttons = libwacom_get_num_buttons(device);
 +
 + if (nbuttons == 0)
 + return;
 +
 + dprintf(fd, [Buttons]\n);
 +
 + print_button_flag_if(fd, device, Left, WACOM_BUTTON_POSITION_LEFT);
 + print_button_flag_if(fd, device, Right, WACOM_BUTTON_POSITION_RIGHT);
 + print_button_flag_if(fd, device, Top, WACOM_BUTTON_POSITION_TOP);
 + print_button_flag_if(fd, device, Bottom, 
 WACOM_BUTTON_POSITION_BOTTOM);
 + print_button_flag_if(fd, device, Touchstrip, 
 WACOM_BUTTON_TOUCHSTRIP_MODESWITCH);
 + print_button_flag_if(fd, device, Touchstrip2, 
 WACOM_BUTTON_TOUCHSTRIP2_MODESWITCH);
 + print_button_flag_if(fd, device, OLEDs, WACOM_BUTTON_OLED);
 + print_button_flag_if(fd, device, Ring, WACOM_BUTTON_RING_MODESWITCH);
 + print_button_flag_if(fd, device, Ring2, 
 WACOM_BUTTON_RING2_MODESWITCH);
 + dprintf(fd, RingNumModes=%d\n, libwacom_get_ring_num_modes(device));
 + dprintf(fd, Ring2NumModes=%d\n, libwacom_get_ring2_num_modes(device));
 + dprintf(fd, StripsNumModes=%d\n, 
 libwacom_get_strips_num_modes(device));
 +
 + dprintf(fd, \n);
 +}
 +
 +void
 +libwacom_print_device_description(int fd, WacomDevice *device)
 +{
 + const WacomMatch **match;
 + WacomClass class;
 + const char *bus_name, *class_name;
 +
 + class  = libwacom_get_class(device);
 + switch(class) {
 + case WCLASS_UNKNOWN:class_name = Unknown; break;
 + case WCLASS_INTUOS3:class_name = Intuos3; break;
 + case WCLASS_INTUOS4:class_name = Intuos4; break;
 + case WCLASS_INTUOS5:class_name = Intuos5; break;
 + case WCLASS_CINTIQ: class_name = Cintiq;  break;
 + case WCLASS_BAMBOO: class_name = Bamboo;  break;
 + case WCLASS_GRAPHIRE:   class_name = Graphire;break;
 + case WCLASS_ISDV4:  class_name = ISDV4;   break;
 + default:g_assert_not_reached(); break;
 + }
 +
 + dprintf(fd, [Device]\n);
 + dprintf(fd, Name=%s\n, libwacom_get_name(device));
 + dprintf(fd, DeviceMatch=);
 + for (match = libwacom_get_matches(device); *match; match++) {
 + WacomBusType type   = libwacom_match_get_bustype(*match);
 + int  vendor = libwacom_match_get_vendor_id(*match);
 + int  product= libwacom_match_get_product_id(*match);
 +
 + switch(type) {
 + case WBUSTYPE_BLUETOOTH:bus_name = bluetooth; 
 break;
 + case WBUSTYPE_USB:  bus_name = usb;   
 break;
 + case WBUSTYPE_SERIAL:   bus_name = serial;
 break;
 + case WBUSTYPE_UNKNOWN:  bus_name = unknown;   
 break;
 + default:g_assert_not_reached(); 
 break;
 + }
 + dprintf(fd, %s:%04x:%04x;, bus_name, vendor, product);
 + }
 + dprintf(fd, \n);
 +
 + dprintf(fd, Class=%s\n,   class_name);
 + dprintf(fd, Width=%d\n,   libwacom_get_width(device));
 + dprintf(fd, Height=%d\n,  libwacom_get_height(device));
 + print_styli_for_device(fd, device);
 + dprintf(fd, \n);
 +
 + dprintf(fd, [Features]\n);
 + dprintf(fd

Re: [Linuxwacom-devel] [PATCH libwacom v2 9/9] lib: Try to match the parent for ID_INPUT_* as well

2012-04-19 Thread Bastien Nocera
On Thu, 2012-04-19 at 13:16 +1000, Peter Hutterer wrote:
 Bluetooth devices tagged with ID_INPUT_TABLET aren't tagged on the device,
 but on the parent instead. Match the parent for a tag before bailing out.
 
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
 ---
 Changes to v1:
 - localise parent usage
 - use temporary variables for is_tablet/is_touchpad

I thought more:
static gboolean
is_tablet_or_touchpad (GUdevDevice *device)
{
   return g_udev_device_get_property_as_boolean (device, ID_INPUT_TABLET) ||
  g_udev_device_get_property_as_boolean (device, ID_INPUT_TOUCHPAD);
}

And use that in the 2 locations below.

 I'll have another test of this tomorrow, but I do remember it working on th
 e I4 WL.
 
  libwacom/libwacom.c |   18 +++---
  1 file changed, 15 insertions(+), 3 deletions(-)
 
 diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
 index dd6ba1c..9e32618 100644
 --- a/libwacom/libwacom.c
 +++ b/libwacom/libwacom.c
 @@ -71,10 +71,23 @@ get_device_info (const char   *path,
   /* Touchpads are only for the Finger part of Bamboo devices */
   if (g_udev_device_get_property_as_boolean (device, ID_INPUT_TABLET) 
 == FALSE 
   g_udev_device_get_property_as_boolean (device, ID_INPUT_TOUCHPAD) 
 == FALSE) {
 - libwacom_error_set(error, WERROR_INVALID_PATH, Device '%s' is 
 not a tablet, path);
 - goto bail;
 + GUdevDevice *parent;
 + gboolean is_tablet, is_touchpad;
 +
 +
 + parent = g_udev_device_get_parent(device);
 + is_tablet = g_udev_device_get_property_as_boolean (parent, 
 ID_INPUT_TABLET);
 + is_touchpad = g_udev_device_get_property_as_boolean (parent, 
 ID_INPUT_TOUCHPAD);
 + if (!parent || (!is_tablet  !is_touchpad)) {
 + libwacom_error_set(error, WERROR_INVALID_PATH, 
 Device '%s' is not a tablet, path);
 + goto bail;
 + }
 + g_object_unref (parent);
   }
  
 + /* FIXME: ID_BUS on the device is usb even for bluetooth devices,
 +  * but ID_BUS on the parent is NULL.
 +  */
   bus_str = g_udev_device_get_property (device, ID_BUS);
   /* Serial devices are weird */
   if (bus_str == NULL) {
 @@ -86,7 +99,6 @@ get_device_info (const char   *path,
   GUdevDevice *parent;
  
   parent = g_udev_device_get_parent (device);
 -
   g_object_unref (device);
   device = parent;
   bus_str = bluetooth;



--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom v2 5/9] test: add basic test for multiple device check

2012-04-19 Thread Bastien Nocera
On Thu, 2012-04-19 at 13:17 +1000, Peter Hutterer wrote:
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Reviewed-By: Bastien Nocera had...@hadess.net

 ---
 Changes to v1: 
 - update for new libwacom_get_matches() API
 
  test/load.c |   26 ++
  1 file changed, 26 insertions(+)
 
 diff --git a/test/load.c b/test/load.c
 index 96479a0..173b762 100644
 --- a/test/load.c
 +++ b/test/load.c
 @@ -33,6 +33,29 @@
  #include libwacom.h
  #include assert.h
  
 +static void check_multiple_match(WacomDevice *device)
 +{
 +const WacomMatch **match;
 +int nmatches = 0;
 +int found_bus = 0,
 + found_vendor_id = 0,
 + found_product_id = 0;
 +
 +for (match = libwacom_get_matches(device); *match; match++)
 +{
 + nmatches++;
 + if (libwacom_match_get_bustype(*match) == 
 libwacom_get_bustype(device))
 + found_bus = 1;
 + if (libwacom_match_get_vendor_id(*match) == 
 libwacom_get_vendor_id(device))
 + found_vendor_id = 1;
 + if (libwacom_match_get_product_id(*match) == 
 libwacom_get_product_id(device))
 + found_product_id = 1;
 +}
 +
 +assert(nmatches == 2);
 +assert(found_bus  found_vendor_id  found_product_id);
 +}
 +
  int main(int argc, char **argv)
  {
  WacomDeviceDatabase *db;
 @@ -67,6 +90,9 @@ int main(int argc, char **argv)
  assert(libwacom_get_width(device) == 8);
  assert(libwacom_get_height(device) == 5);
  
 +/* I4 WL has two matches */
 +check_multiple_match(device);
 +
  libwacom_destroy(device);
  
  device = libwacom_new_from_usbid(db, 0x56a, 0x00b9, NULL);



--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 1/6] lib: add documentation hunk about button naming

2012-04-18 Thread Bastien Nocera
On Wed, 2012-04-18 at 14:52 +1000, Peter Hutterer wrote:
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Signed-off-by: Bastien Nocera had...@hadess.net

 ---
  libwacom/libwacom.h |2 ++
  1 file changed, 2 insertions(+)
 
 diff --git a/libwacom/libwacom.h b/libwacom/libwacom.h
 index 7591f64..e8d0b80 100644
 --- a/libwacom/libwacom.h
 +++ b/libwacom/libwacom.h
 @@ -329,6 +329,8 @@ int libwacom_has_stylus(WacomDevice *device);
  int libwacom_has_touch(WacomDevice *device);
  
  /**
 + * Tablet buttons are numbered 'A' through to 'A' + number of buttons.
 + *
   * @param device The tablet to query
   * @return The number of buttons on the tablet
   */




--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 2/6] lib: Update usage example in top comment

2012-04-18 Thread Bastien Nocera
On Wed, 2012-04-18 at 14:52 +1000, Peter Hutterer wrote:
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Signed-off-by: Bastien Nocera had...@hadess.net

 ---
  libwacom/libwacom.h |9 +++--
  1 file changed, 7 insertions(+), 2 deletions(-)
 
 diff --git a/libwacom/libwacom.h b/libwacom/libwacom.h
 index e8d0b80..bdc12b0 100644
 --- a/libwacom/libwacom.h
 +++ b/libwacom/libwacom.h
 @@ -47,16 +47,21 @@
   The usage of libwacom in an application could look like this:
  
   pre
 +  WacomDeviceDatabase *db;
WacomDevice *device;
 +  WacomError *error;
  
 -  device = libwacom_new_from_path(/dev/input/event0);
 +  db = libwacom_database_new();
 +  error = libwacom_error_new();
 +  device = libwacom_new_from_path(db, /dev/input/event0, 0, error);
if (!device)
 return; // should check for error here
  
if (libwacom_device_is_builtin(device))
 printf(This is a built-in device\n);
  
 -  libwacom_destroy(device);
 +  libwacom_destroy(device);
 +  libwacom_database_destroy(db);
   /pre
  
   For a full API reference to see libwacom.h.



--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 4/6] lib: add BUG_WARN and BUG_WARN_MSG macros

2012-04-18 Thread Bastien Nocera
On Wed, 2012-04-18 at 14:52 +1000, Peter Hutterer wrote:
 Taken from the X server's misc.h, these macros just print nasty warnings for
 bugs.
 
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

We already use glib internally, and there's g_warning, g_assert() and
g_assert_not_reached() available for use internally.

 ---
  libwacom/libwacomint.h |   15 +++
  1 file changed, 15 insertions(+)
 
 diff --git a/libwacom/libwacomint.h b/libwacom/libwacomint.h
 index 60644ce..66202b0 100644
 --- a/libwacom/libwacomint.h
 +++ b/libwacom/libwacomint.h
 @@ -38,6 +38,21 @@
  #define DBG(...) \
   printf(__VA_ARGS__)
  
 +/* Don't use this directly, use BUG_WARN or BUG_WARN_MSG instead */
 +#define __BUG_WARN_MSG(cond, with_msg, ...)\
 +   do { if (cond) { \
 +   fprintf(stderr, BUG: triggered 'if ( #cond )'\n); 
  \
 +   fprintf(stderr, BUG: %s:%d in %s()\n,   
 \
 +   __FILE__, __LINE__, __func__);
  \
 +   if (with_msg) fprintf(stderr, __VA_ARGS__);   
  \
 +   } } while(0)
 +
 +#define BUG_WARN_MSG(cond, ...)   \
 +   __BUG_WARN_MSG(cond, 1, __VA_ARGS__)
 +
 +#define BUG_WARN(cond)  __BUG_WARN_MSG(cond, 0,  )
 +
 +
  #define GENERIC_DEVICE_MATCH generic
  #define STYLUS_DATA_FILE libwacom.stylus
  



--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 1/9] lib: Add internal libwacom_update_match() helper

2012-04-18 Thread Bastien Nocera
On Wed, 2012-04-18 at 14:57 +1000, Peter Hutterer wrote:
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Signed-off-by: Bastien Nocera had...@hadess.net

 ---
  libwacom/libwacom.c|   17 -
  libwacom/libwacomint.h |2 ++
  2 files changed, 14 insertions(+), 5 deletions(-)
 
 diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
 index 5b9bdd2..05ac6f1 100644
 --- a/libwacom/libwacom.c
 +++ b/libwacom/libwacom.c
 @@ -100,6 +100,7 @@ get_device_info (const char   *path,
   sysfs_path = g_build_filename (/sys/class/input, devname, 
 device/properties, NULL);
   if (g_file_get_contents (sysfs_path, contents, NULL, NULL)) {
   int flag;
 +
   /* 0x01: POINTER flag
* 0x02: DIRECT flag */
   flag = atoi(contents);
 @@ -255,11 +256,7 @@ libwacom_new_from_path(WacomDeviceDatabase *db, const 
 char *path, int fallback,
   g_free (ret-name);
   ret-name = name;
   }
 - ret-vendor_id = vendor_id;
 - ret-product_id = product_id;
 - ret-bus = bus;
 - g_free (ret-match);
 - ret-match = g_strdup_printf (%s:0x%x:0x%x, bus_to_str (bus), 
 vendor_id, product_id);
 + libwacom_update_match(ret, bus, vendor_id, product_id);
  } else {
   g_free (name);
  }
 @@ -339,6 +336,16 @@ libwacom_destroy(WacomDevice *device)
   g_free (device);
  }
  
 +void
 +libwacom_update_match(WacomDevice *device, WacomBusType bus, int vendor_id, 
 int product_id)
 +{
 + device-vendor_id = vendor_id;
 + device-product_id = product_id;
 + device-bus = bus;
 + g_free(device-match);
 + device-match = g_strdup_printf(%s:0x%x:0x%x, bus_to_str (bus), 
 vendor_id, product_id);
 +}
 +
  int libwacom_get_vendor_id(WacomDevice *device)
  {
  return device-vendor_id;
 diff --git a/libwacom/libwacomint.h b/libwacom/libwacomint.h
 index 5dcff6a..9d5ed7a 100644
 --- a/libwacom/libwacomint.h
 +++ b/libwacom/libwacomint.h
 @@ -120,10 +120,12 @@ struct _WacomError {
  /* INTERNAL */
  void libwacom_error_set(WacomError *error, enum WacomErrorCode code, const 
 char *msg, ...);
  void libwacom_stylus_destroy(WacomStylus *stylus);
 +void libwacom_update_match(WacomDevice *device, WacomBusType bus, int 
 vendor_id, int product_id);
  
  WacomBusType  bus_from_str (const char *str);
  const char   *bus_to_str   (WacomBusType bus);
  
 +
  #endif /* _LIBWACOMINT_H_ */
  
  /* vim: set noexpandtab shiftwidth=8: */



--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 5/9] test: add basic test for multiple device check

2012-04-18 Thread Bastien Nocera
On Wed, 2012-04-18 at 14:57 +1000, Peter Hutterer wrote:
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Pending API change in patch 3.

Signed-off-by: Bastien Nocera had...@hadess.net

 ---
  test/load.c |   26 ++
  1 file changed, 26 insertions(+)
 
 diff --git a/test/load.c b/test/load.c
 index 96479a0..ff4c85f 100644
 --- a/test/load.c
 +++ b/test/load.c
 @@ -33,6 +33,29 @@
  #include libwacom.h
  #include assert.h
  
 +static void check_multiple_match(WacomDevice *device)
 +{
 +WacomMatch **matches;
 +int nmatches;
 +int found_bus = 0,
 + found_vendor_id = 0,
 + found_product_id = 0;
 +
 +matches = libwacom_get_matches(device, nmatches);
 +assert(nmatches == 2);
 +while(nmatches--)
 +{
 + if (libwacom_match_get_bustype(matches[nmatches]) == 
 libwacom_get_bustype(device))
 + found_bus = 1;
 + if (libwacom_match_get_vendor_id(matches[nmatches]) == 
 libwacom_get_vendor_id(device))
 + found_vendor_id = 1;
 + if (libwacom_match_get_product_id(matches[nmatches]) == 
 libwacom_get_product_id(device))
 + found_product_id = 1;
 +}
 +
 +assert(found_bus  found_vendor_id  found_product_id);
 +}
 +
  int main(int argc, char **argv)
  {
  WacomDeviceDatabase *db;
 @@ -67,6 +90,9 @@ int main(int argc, char **argv)
  assert(libwacom_get_width(device) == 8);
  assert(libwacom_get_height(device) == 5);
  
 +/* I4 WL has two matches */
 +check_multiple_match(device);
 +
  libwacom_destroy(device);
  
  device = libwacom_new_from_usbid(db, 0x56a, 0x00b9, NULL);



--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 6/9] Re-indent data/generate-udev-rules and test/load for 8 space tabs

2012-04-18 Thread Bastien Nocera
On Wed, 2012-04-18 at 14:57 +1000, Peter Hutterer wrote:
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Signed-off-by: Bastien Nocera had...@hadess.net

 ---
  data/generate-udev-rules.c |  104 -
  test/load.c|  138 
 ++--
  2 files changed, 121 insertions(+), 121 deletions(-)
 
 diff --git a/data/generate-udev-rules.c b/data/generate-udev-rules.c
 index 93f7bba..d6a40ad 100644
 --- a/data/generate-udev-rules.c
 +++ b/data/generate-udev-rules.c
 @@ -34,81 +34,81 @@
  
  static void print_udev_header (void)
  {
 -printf (# udev rules for libwacom supported devices\n);
 -printf (\n);
 -printf (ACTION!=\add|change\, GOTO=\libwacom_end\\n);
 -printf (KERNEL!=\event[0-9]*\, GOTO=\libwacom_end\\n);
 -printf (\n);
 + printf (# udev rules for libwacom supported devices\n);
 + printf (\n);
 + printf (ACTION!=\add|change\, GOTO=\libwacom_end\\n);
 + printf (KERNEL!=\event[0-9]*\, GOTO=\libwacom_end\\n);
 + printf (\n);
  }
  
  static void print_udev_entry_for_match (WacomDevice *device, const 
 WacomMatch *match)
  {
 -WacomBusType type   = libwacom_match_get_bustype (match);
 -int  vendor = libwacom_match_get_vendor_id (match);
 -int  product= libwacom_match_get_product_id (match);
 -int  has_touch  = libwacom_has_touch (device);
 -static char *touchpad;
 -
 -if (has_touch)
 -touchpad = , ENV{ID_INPUT_TOUCHPAD}=\1\;
 -else
 -touchpad = ;
 -
 -switch (type) {
 -case WBUSTYPE_USB:
 -printf (ENV{ID_BUS}==\usb\, ENV{ID_VENDOR_ID}==\%04x\, 
 ENV{ID_MODEL_ID}==\%04x\, ENV{ID_INPUT}=\1\, 
 ENV{ID_INPUT_TABLET}=\1\%s\n, vendor, product, touchpad);
 -break;
 -case WBUSTYPE_BLUETOOTH:
 -printf (ENV{ID_BUS}==\bluetooth\, 
 ENV{ID_VENDOR_ID}==\%04x\, ENV{ID_MODEL_ID}==\%04x\, ENV{ID_INPUT}=\1\, 
 ENV{ID_INPUT_TABLET}=\1\%s\n, vendor, product, touchpad);
 -break;
 -default:
 -/* Not sure how to deal with serials  */
 -break;
 -}
 + WacomBusType type   = libwacom_match_get_bustype (match);
 + int  vendor = libwacom_match_get_vendor_id (match);
 + int  product= libwacom_match_get_product_id (match);
 + int  has_touch  = libwacom_has_touch (device);
 + static char *touchpad;
 +
 + if (has_touch)
 + touchpad = , ENV{ID_INPUT_TOUCHPAD}=\1\;
 + else
 + touchpad = ;
 +
 + switch (type) {
 + case WBUSTYPE_USB:
 + printf (ENV{ID_BUS}==\usb\, 
 ENV{ID_VENDOR_ID}==\%04x\, ENV{ID_MODEL_ID}==\%04x\, ENV{ID_INPUT}=\1\, 
 ENV{ID_INPUT_TABLET}=\1\%s\n, vendor, product, touchpad);
 + break;
 + case WBUSTYPE_BLUETOOTH:
 + printf (ENV{ID_BUS}==\bluetooth\, 
 ENV{ID_VENDOR_ID}==\%04x\, ENV{ID_MODEL_ID}==\%04x\, ENV{ID_INPUT}=\1\, 
 ENV{ID_INPUT_TABLET}=\1\%s\n, vendor, product, touchpad);
 + break;
 + default:
 + /* Not sure how to deal with serials  */
 + break;
 + }
  }
  
  static void print_udev_entry (WacomDevice *device)
  {
 -WacomMatch **matches;
 -int nmatches;
 + WacomMatch **matches;
 + int nmatches;
  
 -matches = libwacom_get_matches(device, nmatches);
 -while(nmatches--)
 -print_udev_entry_for_match(device, matches[nmatches]);
 + matches = libwacom_get_matches(device, nmatches);
 + while(nmatches--)
 + print_udev_entry_for_match(device, matches[nmatches]);
  }
  
  static void print_udev_trailer (void)
  {
 -printf (\n);
 -printf (# Match all serial wacom tablets with a serial ID starting with 
 WACf\n);
 -printf (ENV{ID_BUS}==\tty|pnp\, ATTRS{id}==\WACf*\, 
 ENV{ID_INPUT}=\1\, ENV{ID_INPUT_TABLET}=\1\\n);
 -printf (ENV{ID_BUS}==\tty|pnp\, ATTRS{id}==\FUJ*\, 
 ENV{ID_INPUT}=\1\, ENV{ID_INPUT_TABLET}=\1\\n);
 -printf (\n);
 -printf (LABEL=\libwacom_end\\n);
 + printf (\n);
 + printf (# Match all serial wacom tablets with a serial ID starting 
 with WACf\n);
 + printf (ENV{ID_BUS}==\tty|pnp\, ATTRS{id}==\WACf*\, 
 ENV{ID_INPUT}=\1\, ENV{ID_INPUT_TABLET}=\1\\n);
 + printf (ENV{ID_BUS}==\tty|pnp\, ATTRS{id}==\FUJ*\, 
 ENV{ID_INPUT}=\1\, ENV{ID_INPUT_TABLET}=\1\\n);
 + printf (\n);
 + printf (LABEL=\libwacom_end\\n);
  }
  
 
  int main(int argc, char **argv)
  {
 -WacomDeviceDatabase *db;
 -WacomDevice **list, **p;
 + WacomDeviceDatabase *db;
 + WacomDevice **list, **p;
  
 -db = libwacom_database_new_for_path(TOPSRCDIR/data);
 + db = libwacom_database_new_for_path(TOPSRCDIR/data);
  
 -list = libwacom_list_devices_from_database(db, NULL);
 -if (!list) {
 -fprintf(stderr, Failed to load device database.\n);
 -return 1

Re: [Linuxwacom-devel] [PATCH libwacom 8/9] data: udev rules for bluetooth devices can only match on the PRODUCT

2012-04-18 Thread Bastien Nocera
On Wed, 2012-04-18 at 14:57 +1000, Peter Hutterer wrote:
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Signed-off-by: Bastien Nocera had...@hadess.net

 ---
  data/generate-udev-rules.c |   19 ++-
  1 file changed, 14 insertions(+), 5 deletions(-)
 
 diff --git a/data/generate-udev-rules.c b/data/generate-udev-rules.c
 index d6a40ad..be8f514 100644
 --- a/data/generate-udev-rules.c
 +++ b/data/generate-udev-rules.c
 @@ -41,7 +41,8 @@ static void print_udev_header (void)
   printf (\n);
  }
  
 -static void print_udev_entry_for_match (WacomDevice *device, const 
 WacomMatch *match)
 +static void print_udev_entry_for_match (WacomDevice *device, const 
 WacomMatch *match,
 + WacomBusType bus_type_filter)
  {
   WacomBusType type   = libwacom_match_get_bustype (match);
   int  vendor = libwacom_match_get_vendor_id (match);
 @@ -49,6 +50,9 @@ static void print_udev_entry_for_match (WacomDevice 
 *device, const WacomMatch *m
   int  has_touch  = libwacom_has_touch (device);
   static char *touchpad;
  
 + if (bus_type_filter != type)
 + return;
 +
   if (has_touch)
   touchpad = , ENV{ID_INPUT_TOUCHPAD}=\1\;
   else
 @@ -59,7 +63,9 @@ static void print_udev_entry_for_match (WacomDevice 
 *device, const WacomMatch *m
   printf (ENV{ID_BUS}==\usb\, 
 ENV{ID_VENDOR_ID}==\%04x\, ENV{ID_MODEL_ID}==\%04x\, ENV{ID_INPUT}=\1\, 
 ENV{ID_INPUT_TABLET}=\1\%s\n, vendor, product, touchpad);
   break;
   case WBUSTYPE_BLUETOOTH:
 - printf (ENV{ID_BUS}==\bluetooth\, 
 ENV{ID_VENDOR_ID}==\%04x\, ENV{ID_MODEL_ID}==\%04x\, ENV{ID_INPUT}=\1\, 
 ENV{ID_INPUT_TABLET}=\1\%s\n, vendor, product, touchpad);
 + /* Bluetooth tablets do not have 
 ID_VENDOR_ID/ID_MODEL_ID etc set correctly. They
 +  * do have the PRODUCT set though. */
 + printf (ENV{PRODUCT}==\5/%x/%x/*\, 
 ENV{ID_INPUT}=\1\, ENV{ID_INPUT_TABLET}=\1\%s\n, vendor, product, 
 touchpad);
   break;
   default:
   /* Not sure how to deal with serials  */
 @@ -67,14 +73,14 @@ static void print_udev_entry_for_match (WacomDevice 
 *device, const WacomMatch *m
   }
  }
  
 -static void print_udev_entry (WacomDevice *device)
 +static void print_udev_entry (WacomDevice *device, WacomBusType 
 bus_type_filter)
  {
   WacomMatch **matches;
   int nmatches;
  
   matches = libwacom_get_matches(device, nmatches);
   while(nmatches--)
 - print_udev_entry_for_match(device, matches[nmatches]);
 + print_udev_entry_for_match(device, matches[nmatches], 
 bus_type_filter);
  }
  
  static void print_udev_trailer (void)
 @@ -103,9 +109,12 @@ int main(int argc, char **argv)
  
   print_udev_header ();
   for (p = list; *p; p++)
 - print_udev_entry ((WacomDevice *) *p);
 + print_udev_entry ((WacomDevice *) *p, WBUSTYPE_USB);
   print_udev_trailer ();
  
 + for (p = list; *p; p++)
 + print_udev_entry ((WacomDevice *) *p, WBUSTYPE_BLUETOOTH);
 +
   libwacom_database_destroy (db);
  
   return 0;



--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 1/8] tools: Move udev generation to a new tools/ directory

2012-04-18 Thread Bastien Nocera
On Wed, 2012-04-18 at 15:00 +1000, Peter Hutterer wrote:
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Signed-off-by: Bastien Nocera had...@hadess.net

 ---
  Makefile.am |2 +-
  configure.ac|1 +
  data/Makefile.am|6 ---
  data/generate-udev-rules.c  |  123 
 ---
  tools/Makefile.am   |5 ++
  tools/generate-udev-rules.c |  123 
 +++
  6 files changed, 130 insertions(+), 130 deletions(-)
  delete mode 100644 data/generate-udev-rules.c
  create mode 100644 tools/Makefile.am
  create mode 100644 tools/generate-udev-rules.c
 
 diff --git a/Makefile.am b/Makefile.am
 index 4537943..0eb1f7d 100644
 --- a/Makefile.am
 +++ b/Makefile.am
 @@ -1,4 +1,4 @@
 -SUBDIRS = libwacom data doc test
 +SUBDIRS = libwacom data doc test tools
  
  pkgconfigdir = $(libdir)/pkgconfig
  pkgconfig_DATA = libwacom.pc
 diff --git a/configure.ac b/configure.ac
 index 8e59aac..0905206 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -37,6 +37,7 @@ AC_CONFIG_FILES([Makefile
   data/Makefile
   doc/Makefile
   test/Makefile
 + tools/Makefile
   libwacom/Makefile
   libwacom.pc])
  AC_OUTPUT
 diff --git a/data/Makefile.am b/data/Makefile.am
 index 897f4ca..9f2e8d2 100644
 --- a/data/Makefile.am
 +++ b/data/Makefile.am
 @@ -4,10 +4,4 @@ dist_libwacomtablet_DATA =  $(shell find $(top_srcdir)/data 
 -name *.tablet -pr
  libwacomstylusdir = $(datadir)/libwacom
  dist_libwacomstylus_DATA =  $(shell find $(top_srcdir)/data -name *.stylus 
 -printf %P\n)
  
 -INCLUDES=-I$(top_srcdir)/libwacom -DTOPSRCDIR=\$(top_srcdir)\
 -
 -noinst_PROGRAMS = generate-udev-rules
 -generate_udev_rules_SOURCES = generate-udev-rules.c
 -generate_udev_rules_LDADD=$(top_builddir)/libwacom/libwacom.la
 -
  EXTRA_DIST = wacom.example
 diff --git a/data/generate-udev-rules.c b/data/generate-udev-rules.c
 deleted file mode 100644
 index be8f514..000
 --- a/data/generate-udev-rules.c
 +++ /dev/null
 @@ -1,123 +0,0 @@
 -/*
 - * Copyright © 2012 Red Hat, Inc.
 - *
 - * Permission to use, copy, modify, distribute, and sell this software
 - * and its documentation for any purpose is hereby granted without
 - * fee, provided that the above copyright notice appear in all copies
 - * and that both that copyright notice and this permission notice
 - * appear in supporting documentation, and that the name of Red Hat
 - * not be used in advertising or publicity pertaining to distribution
 - * of the software without specific, written prior permission.  Red
 - * Hat makes no representations about the suitability of this software
 - * for any purpose.  It is provided as is without express or implied
 - * warranty.
 - *
 - * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
 - * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
 - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
 - * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
 - * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 - *
 - * Authors:
 - *Olivier Fourdan (ofour...@redhat.com)
 - */
 -
 -#ifdef HAVE_CONFIG_H
 -#include config.h
 -#endif
 -
 -#include stdio.h
 -#include string.h
 -#include libwacom.h
 -
 -static void print_udev_header (void)
 -{
 - printf (# udev rules for libwacom supported devices\n);
 - printf (\n);
 - printf (ACTION!=\add|change\, GOTO=\libwacom_end\\n);
 - printf (KERNEL!=\event[0-9]*\, GOTO=\libwacom_end\\n);
 - printf (\n);
 -}
 -
 -static void print_udev_entry_for_match (WacomDevice *device, const 
 WacomMatch *match,
 - WacomBusType bus_type_filter)
 -{
 - WacomBusType type   = libwacom_match_get_bustype (match);
 - int  vendor = libwacom_match_get_vendor_id (match);
 - int  product= libwacom_match_get_product_id (match);
 - int  has_touch  = libwacom_has_touch (device);
 - static char *touchpad;
 -
 - if (bus_type_filter != type)
 - return;
 -
 - if (has_touch)
 - touchpad = , ENV{ID_INPUT_TOUCHPAD}=\1\;
 - else
 - touchpad = ;
 -
 - switch (type) {
 - case WBUSTYPE_USB:
 - printf (ENV{ID_BUS}==\usb\, 
 ENV{ID_VENDOR_ID}==\%04x\, ENV{ID_MODEL_ID}==\%04x\, ENV{ID_INPUT}=\1\, 
 ENV{ID_INPUT_TABLET}=\1\%s\n, vendor, product, touchpad);
 - break;
 - case WBUSTYPE_BLUETOOTH:
 - /* Bluetooth tablets do not have 
 ID_VENDOR_ID/ID_MODEL_ID etc set correctly. They
 -  * do have the PRODUCT set though. */
 - printf (ENV{PRODUCT}==\5/%x/%x/*\, 
 ENV

Re: [Linuxwacom-devel] [PATCH libwacom 2/8] lib: use a enum for fallback instructions

2012-04-18 Thread Bastien Nocera
On Wed, 2012-04-18 at 15:00 +1000, Peter Hutterer wrote:
 WFALLBACK_NONE and WFALLBACK_GENERIC are more expressive than 0/1.
 
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Signed-off-by: Bastien Nocera had...@hadess.net

 ---
  libwacom/libwacom.c |6 +++---
  libwacom/libwacom.h |9 +++--
  2 files changed, 10 insertions(+), 5 deletions(-)
 
 diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
 index e54175d..29ce625 100644
 --- a/libwacom/libwacom.c
 +++ b/libwacom/libwacom.c
 @@ -241,7 +241,7 @@ libwacom_new (WacomDeviceDatabase *db, int vendor_id, int 
 product_id, WacomBusTy
  }
  
  WacomDevice*
 -libwacom_new_from_path(WacomDeviceDatabase *db, const char *path, int 
 fallback, WacomError *error)
 +libwacom_new_from_path(WacomDeviceDatabase *db, const char *path, 
 WacomFallbackFlags fallback, WacomError *error)
  {
   int vendor_id, product_id;
   WacomBusType bus;
 @@ -266,10 +266,10 @@ libwacom_new_from_path(WacomDeviceDatabase *db, const 
 char *path, int fallback,
   device = libwacom_new (db, vendor_id, product_id, bus, error);
   if (device != NULL)
   ret = libwacom_copy(device);
 - else if (!fallback)
 + else if (fallback == WFALLBACK_NONE)
   goto bail;
  
 - if (device == NULL  fallback) {
 + if (device == NULL  fallback == WFALLBACK_GENERIC) {
   device = libwacom_get_device(db, generic);
   if (device == NULL)
   goto bail;
 diff --git a/libwacom/libwacom.h b/libwacom/libwacom.h
 index 6ba96eb..d44eb89 100644
 --- a/libwacom/libwacom.h
 +++ b/libwacom/libwacom.h
 @@ -54,7 +54,7 @@
  
db = libwacom_database_new();
error = libwacom_error_new();
 -  device = libwacom_new_from_path(db, /dev/input/event0, 0, error);
 +  device = libwacom_new_from_path(db, /dev/input/event0, 
 WFALLBACK_NONE, error);
if (!device)
 return; // should check for error here
  
 @@ -161,6 +161,11 @@ typedef enum {
   WACOM_BUTTON_TOUCHSTRIPS_MODESWITCH = 
 (WACOM_BUTTON_TOUCHSTRIP_MODESWITCH | WACOM_BUTTON_TOUCHSTRIP2_MODESWITCH),
  } WacomButtonFlags;
  
 +typedef enum {
 + WFALLBACK_NONE = 0,
 + WFALLBACK_GENERIC = 1
 +} WacomFallbackFlags;
 +
  /**
   * Allocate a new structure for error reporting.
   *
 @@ -225,7 +230,7 @@ void libwacom_database_destroy(WacomDeviceDatabase *db);
   *
   * @return A new reference to this device or NULL on errror.
   */
 -WacomDevice* libwacom_new_from_path(WacomDeviceDatabase *db, const char 
 *path, int fallback, WacomError *error);
 +WacomDevice* libwacom_new_from_path(WacomDeviceDatabase *db, const char 
 *path, WacomFallbackFlags fallback, WacomError *error);
  
  /**
   * Create a new device reference from the given vendor/product IDs.



--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 3/8] lib: add a function to print the device description

2012-04-18 Thread Bastien Nocera
On Wed, 2012-04-18 at 15:00 +1000, Peter Hutterer wrote:
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Signed-off-by: Bastien Nocera had...@hadess.net

 ---
  libwacom/libwacom.c|  112 
 
  libwacom/libwacom.h|   10 +
  libwacom/libwacomint.h |3 +-
  3 files changed, 124 insertions(+), 1 deletion(-)
 
 diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
 index 29ce625..eaf5e2c 100644
 --- a/libwacom/libwacom.c
 +++ b/libwacom/libwacom.c
 @@ -351,6 +351,118 @@ libwacom_new_from_name(WacomDeviceDatabase *db, const 
 char *name, WacomError *er
   return NULL;
  }
  
 +static void print_styli_for_device (FILE *file, WacomDevice *device)
 +{
 + int nstyli, *styli;
 + int i;
 +
 + if (!libwacom_has_stylus(device))
 + return;
 +
 + styli = libwacom_get_supported_styli(device, nstyli);
 +
 + fprintf(file, Styli=);
 + for (i = 0; i  nstyli; i++)
 + fprintf(file, %#x;, styli[i]);
 + fprintf(file, \n);
 +}
 +
 +static void print_button_flag_if(FILE *file, WacomDevice *device, const char 
 *label, int flag)
 +{
 + int nbuttons = libwacom_get_num_buttons(device);
 + char b;
 + fprintf(file, %s=, label);
 + for (b = 'A'; b  'A' + nbuttons; b++)
 + if (libwacom_get_button_flag(device, b)  flag)
 + fprintf(file, %c;, b);
 + fprintf(file, \n);
 +}
 +
 +static void print_buttons_for_device (FILE *file, WacomDevice *device)
 +{
 + int nbuttons = libwacom_get_num_buttons(device);
 +
 + if (nbuttons == 0)
 + return;
 +
 + fprintf(file, [Buttons]\n);
 +
 + print_button_flag_if(file, device, Left, WACOM_BUTTON_POSITION_LEFT);
 + print_button_flag_if(file, device, Right, 
 WACOM_BUTTON_POSITION_RIGHT);
 + print_button_flag_if(file, device, Top, WACOM_BUTTON_POSITION_TOP);
 + print_button_flag_if(file, device, Bottom, 
 WACOM_BUTTON_POSITION_BOTTOM);
 + print_button_flag_if(file, device, Touchstrip, 
 WACOM_BUTTON_TOUCHSTRIP_MODESWITCH);
 + print_button_flag_if(file, device, Touchstrip2, 
 WACOM_BUTTON_TOUCHSTRIP2_MODESWITCH);
 + print_button_flag_if(file, device, OLEDs, WACOM_BUTTON_OLED);
 + print_button_flag_if(file, device, Ring, 
 WACOM_BUTTON_RING_MODESWITCH);
 + print_button_flag_if(file, device, Ring2, 
 WACOM_BUTTON_RING2_MODESWITCH);
 + fprintf(file, RingNumModes=%d\n, libwacom_get_ring_num_modes(device));
 + fprintf(file, Ring2NumModes=%d\n, 
 libwacom_get_ring2_num_modes(device));
 + fprintf(file, StripsNumModes=%d\n, 
 libwacom_get_strips_num_modes(device));
 +
 + fprintf(file, \n);
 +}
 +
 +void
 +libwacom_print_device_description(FILE *file, WacomDevice *device)

Do we really want FILE* in the public API? An fd would be nicer IMO.

 +{
 + int nmatches;
 + WacomClass   class  = libwacom_get_class(device);
 + WacomMatch   **matches  = libwacom_get_matches(device, nmatches);
 + const char *bus_name, *class_name;
 +
 + switch(class) {
 + case WCLASS_UNKNOWN:class_name = Unknown; break;
 + case WCLASS_INTUOS3:class_name = Intuos3; break;
 + case WCLASS_INTUOS4:class_name = Intuos4; break;
 + case WCLASS_INTUOS5:class_name = Intuos5; break;
 + case WCLASS_CINTIQ: class_name = Cintiq;  break;
 + case WCLASS_BAMBOO: class_name = Bamboo;  break;
 + case WCLASS_GRAPHIRE:   class_name = Graphire;break;
 + case WCLASS_ISDV4:  class_name = ISDV4;   break;
 + default:BUG_WARN(class); break;
 + }
 +
 + fprintf(file, [Device]\n);
 + fprintf(file, Name=%s\n,  libwacom_get_name(device));
 + fprintf(file, DeviceMatch=);
 + while (nmatches--) {
 + WacomBusType type   = 
 libwacom_match_get_bustype(matches[nmatches]);
 + int  vendor = 
 libwacom_match_get_vendor_id(matches[nmatches]);
 + int  product= 
 libwacom_match_get_product_id(matches[nmatches]);
 +
 + switch(type) {
 + case WBUSTYPE_BLUETOOTH:bus_name = bluetooth; 
 break;
 + case WBUSTYPE_USB:  bus_name = usb;   
 break;
 + case WBUSTYPE_SERIAL:   bus_name = serial;
 break;
 + case WBUSTYPE_UNKNOWN:  bus_name = unknown;   
 break;
 + default:BUG_WARN(type); break;
 + }
 + fprintf(file, %s:%04x:%04x;, bus_name, vendor, product);
 + }
 + fprintf(file, \n);
 +
 + fprintf(file, Class=%s\n, class_name);
 + fprintf(file, Width=%d\n, libwacom_get_width(device));
 + fprintf(file, Height=%d\n,libwacom_get_height(device));
 + print_styli_for_device(file, device);
 + fprintf(file, \n

Re: [Linuxwacom-devel] [PATCH libwacom 6/8] tools: add a tool to list the device database

2012-04-18 Thread Bastien Nocera
On Wed, 2012-04-18 at 15:00 +1000, Peter Hutterer wrote:
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Signed-off-by: Bastien Nocera had...@hadess.net

 ---
  tools/Makefile.am|5 +++-
  tools/list-devices.c |   80 
 ++
  2 files changed, 84 insertions(+), 1 deletion(-)
  create mode 100644 tools/list-devices.c
 
 diff --git a/tools/Makefile.am b/tools/Makefile.am
 index 0c2ffdb..0385be3 100644
 --- a/tools/Makefile.am
 +++ b/tools/Makefile.am
 @@ -1,5 +1,8 @@
  INCLUDES=-I$(top_srcdir)/libwacom -DTOPSRCDIR=\$(top_srcdir)\
  
 -noinst_PROGRAMS = generate-udev-rules
 +noinst_PROGRAMS = generate-udev-rules list-devices
  generate_udev_rules_SOURCES = generate-udev-rules.c
  generate_udev_rules_LDADD=$(top_builddir)/libwacom/libwacom.la
 +
 +list_devices_SOURCES = list-devices.c
 +list_devices_LDADD=$(top_builddir)/libwacom/libwacom.la
 diff --git a/tools/list-devices.c b/tools/list-devices.c
 new file mode 100644
 index 000..943c05f
 --- /dev/null
 +++ b/tools/list-devices.c
 @@ -0,0 +1,80 @@
 +/*
 + * Copyright © 2012 Red Hat, Inc.
 + *
 + * Permission to use, copy, modify, distribute, and sell this software
 + * and its documentation for any purpose is hereby granted without
 + * fee, provided that the above copyright notice appear in all copies
 + * and that both that copyright notice and this permission notice
 + * appear in supporting documentation, and that the name of Red Hat
 + * not be used in advertising or publicity pertaining to distribution
 + * of the software without specific, written prior permission.  Red
 + * Hat makes no representations about the suitability of this software
 + * for any purpose.  It is provided as is without express or implied
 + * warranty.
 + *
 + * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
 + * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
 + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
 + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
 + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 + *
 + * Authors:
 + *Peter Hutterer peter.hutte...@redhat.com
 + */
 +
 +#ifdef HAVE_CONFIG_H
 +#include config.h
 +#endif
 +
 +#include stdio.h
 +#include string.h
 +#include assert.h
 +#include libwacom.h
 +
 +static void print_device_info (WacomDevice *device, WacomBusType 
 bus_type_filter)
 +{
 + WacomMatch **matches;
 + int nmatches;
 +
 + matches = libwacom_get_matches(device, nmatches);
 + while(nmatches--)
 + {
 + WacomBusType type = 
 libwacom_match_get_bustype(matches[nmatches]);
 + if (type != bus_type_filter)
 + libwacom_print_device_description(stdout, device);
 + }
 +}
 +
 +int main(int argc, char **argv)
 +{
 + WacomDeviceDatabase *db;
 + WacomDevice **list, **p;
 +
 + db = libwacom_database_new_for_path(TOPSRCDIR/data);
 +
 + list = libwacom_list_devices_from_database(db, NULL);
 + if (!list) {
 + fprintf(stderr, Failed to load device database.\n);
 + return 1;
 + }
 +
 + for (p = list; *p; p++)
 + print_device_info ((WacomDevice *) *p, WBUSTYPE_USB);
 +
 + for (p = list; *p; p++)
 + print_device_info ((WacomDevice *) *p, WBUSTYPE_BLUETOOTH);
 +
 + for (p = list; *p; p++)
 + print_device_info ((WacomDevice *) *p, WBUSTYPE_SERIAL);
 +
 + for (p = list; *p; p++)
 + print_device_info ((WacomDevice *) *p, WBUSTYPE_UNKNOWN);
 +
 + libwacom_database_destroy (db);
 +
 + return 0;
 +}
 +
 +/* vim: set noexpandtab tabstop=8 shiftwidth=8: */



--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 7/8] tools: add tool to show locally connected devices

2012-04-18 Thread Bastien Nocera
On Wed, 2012-04-18 at 15:00 +1000, Peter Hutterer wrote:
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
 ---
  tools/Makefile.am  |5 ++-
  tools/show-local-devices.c |   79 
 
  2 files changed, 83 insertions(+), 1 deletion(-)
  create mode 100644 tools/show-local-devices.c
 
 diff --git a/tools/Makefile.am b/tools/Makefile.am
 index 0385be3..feca57f 100644
 --- a/tools/Makefile.am
 +++ b/tools/Makefile.am
 @@ -1,8 +1,11 @@
  INCLUDES=-I$(top_srcdir)/libwacom -DTOPSRCDIR=\$(top_srcdir)\
  
 -noinst_PROGRAMS = generate-udev-rules list-devices
 +noinst_PROGRAMS = generate-udev-rules list-devices show-local-devices
  generate_udev_rules_SOURCES = generate-udev-rules.c
  generate_udev_rules_LDADD=$(top_builddir)/libwacom/libwacom.la
  
  list_devices_SOURCES = list-devices.c
  list_devices_LDADD=$(top_builddir)/libwacom/libwacom.la
 +
 +show_local_devices_SOURCES = show-local-devices.c
 +show_local_devices_LDADD=$(top_builddir)/libwacom/libwacom.la
 diff --git a/tools/show-local-devices.c b/tools/show-local-devices.c
 new file mode 100644
 index 000..82691b1
 --- /dev/null
 +++ b/tools/show-local-devices.c

Want to choose a different name, if we want to install that tool?

 @@ -0,0 +1,79 @@
 +/*
 + * Copyright © 2012 Red Hat, Inc.
 + *
 + * Permission to use, copy, modify, distribute, and sell this software
 + * and its documentation for any purpose is hereby granted without
 + * fee, provided that the above copyright notice appear in all copies
 + * and that both that copyright notice and this permission notice
 + * appear in supporting documentation, and that the name of Red Hat
 + * not be used in advertising or publicity pertaining to distribution
 + * of the software without specific, written prior permission.  Red
 + * Hat makes no representations about the suitability of this software
 + * for any purpose.  It is provided as is without express or implied
 + * warranty.
 + *
 + * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
 + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
 + * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
 + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
 + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
 + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 + *
 + * Authors:
 + *Peter Hutterer peter.hutte...@redhat.com
 + */
 +
 +#ifdef HAVE_CONFIG_H
 +#include config.h
 +#endif
 +
 +#include stdio.h
 +#include stdlib.h
 +#include string.h
 +#include assert.h
 +#include dirent.h
 +#include libwacom.h
 +
 +static int event_devices_only(const struct dirent *dir) {
 + return strncmp(event, dir-d_name, 5) == 0;
 +}
 +
 +int main(int argc, char **argv)
 +{
 + WacomDeviceDatabase *db;
 + WacomDevice *dev;
 + int i;
 + struct dirent **namelist = NULL;
 +
 + db = libwacom_database_new_for_path(TOPSRCDIR/data);
 +
 + i = scandir(/dev/input, namelist, event_devices_only, alphasort);
 +
 + if (i  0 || i == 0) {
 + fprintf(stderr, Failed to find any devices.\n);
 + goto out;
 + }
 +
 + while (i--) {
 + char fname[64];
 +
 + sprintf(fname, /dev/input/%s, namelist[i]-d_name);

snprintf.

 + dev = libwacom_new_from_path(db, fname, WFALLBACK_NONE, NULL);
 + if (!dev)
 + continue;
 + libwacom_print_device_description(stdout, dev);
 + libwacom_destroy(dev);
 +
 + fprintf(stdout, 
 ---\n);
 + }
 +
 +out:
 + if (namelist)
 + free(namelist);
 +
 + libwacom_database_destroy (db);
 + return 0;
 +}
 +
 +/* vim: set noexpandtab tabstop=8 shiftwidth=8: */



--
Better than sec? Nothing is better than sec when it comes to
monitoring Big Data applications. Try Boundary one-second 
resolution app monitoring today. Free.
http://p.sf.net/sfu/Boundary-dev2dev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 7/9] lib: fix 4-space indentation to shiftwidth 8 tabs

2012-04-18 Thread Bastien Nocera
On Wed, 2012-04-18 at 14:57 +1000, Peter Hutterer wrote:
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Signed-off-by: Bastien Nocera had...@hadess.net

 ---
  libwacom/libwacom.c |  239 
 +--
  libwacom/libwacom.h |   60 ++---
  2 files changed, 149 insertions(+), 150 deletions(-)
 
 diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
 index a8fcc7e..f8d104a 100644
 --- a/libwacom/libwacom.c
 +++ b/libwacom/libwacom.c
 @@ -216,130 +216,130 @@ libwacom_copy(const WacomDevice *device)
  static const WacomDevice *
  libwacom_new (WacomDeviceDatabase *db, int vendor_id, int product_id, 
 WacomBusType bus, WacomError *error)
  {
 -const WacomDevice *device;
 -char *match;
 + const WacomDevice *device;
 + char *match;
  
 -if (!db) {
 -libwacom_error_set(error, WERROR_INVALID_DB, db is NULL);
 -return NULL;
 -}
 + if (!db) {
 + libwacom_error_set(error, WERROR_INVALID_DB, db is NULL);
 + return NULL;
 + }
  
 -match = make_match_string(bus, vendor_id, product_id);
 -device = libwacom_get_device(db, match);
 -g_free (match);
 + match = make_match_string(bus, vendor_id, product_id);
 + device = libwacom_get_device(db, match);
 + g_free (match);
  
 -return device;
 + return device;
  }
  
  WacomDevice*
  libwacom_new_from_path(WacomDeviceDatabase *db, const char *path, int 
 fallback, WacomError *error)
  {
 -int vendor_id, product_id;
 -WacomBusType bus;
 -const WacomDevice *device;
 -WacomDevice *ret;
 -IsBuiltin builtin;
 -char *name;
 -
 -if (!db) {
 -libwacom_error_set(error, WERROR_INVALID_DB, db is NULL);
 -return NULL;
 -}
 -
 -if (!path) {
 -libwacom_error_set(error, WERROR_INVALID_PATH, path is NULL);
 -return NULL;
 -}
 -
 -if (!get_device_info (path, vendor_id, product_id, name, bus, 
 builtin, error))
 -return NULL;
 -
 -device = libwacom_new (db, vendor_id, product_id, bus, error);
 -if (device != NULL)
 - ret = libwacom_copy(device);
 -else if (!fallback)
 - goto bail;
 -
 -if (device == NULL  fallback) {
 - device = libwacom_get_device(db, generic);
 - if (device == NULL)
 - goto bail;
 -
 - ret = libwacom_copy(device);
 -
 - if (name != NULL) {
 - g_free (ret-name);
 - ret-name = name;
 - }
 -} else {
 - g_free (name);
 -}
 -
 -/* for multiple-match devices, set to the one we requested */
 -libwacom_update_match(ret, bus, vendor_id, product_id);
 -
 -if (device) {
 - if (builtin == IS_BUILTIN_TRUE)
 - ret-features |= FEATURE_BUILTIN;
 - else if (builtin == IS_BUILTIN_FALSE)
 - ret-features = ~FEATURE_BUILTIN;
 -
 - return ret;
 -}
 + int vendor_id, product_id;
 + WacomBusType bus;
 + const WacomDevice *device;
 + WacomDevice *ret;
 + IsBuiltin builtin;
 + char *name;
 +
 + if (!db) {
 + libwacom_error_set(error, WERROR_INVALID_DB, db is NULL);
 + return NULL;
 + }
 +
 + if (!path) {
 + libwacom_error_set(error, WERROR_INVALID_PATH, path is NULL);
 + return NULL;
 + }
 +
 + if (!get_device_info (path, vendor_id, product_id, name, bus, 
 builtin, error))
 + return NULL;
 +
 + device = libwacom_new (db, vendor_id, product_id, bus, error);
 + if (device != NULL)
 + ret = libwacom_copy(device);
 + else if (!fallback)
 + goto bail;
 +
 + if (device == NULL  fallback) {
 + device = libwacom_get_device(db, generic);
 + if (device == NULL)
 + goto bail;
 +
 + ret = libwacom_copy(device);
 +
 + if (name != NULL) {
 + g_free (ret-name);
 + ret-name = name;
 + }
 + } else {
 + g_free (name);
 + }
 +
 + /* for multiple-match devices, set to the one we requested */
 + libwacom_update_match(ret, bus, vendor_id, product_id);
 +
 + if (device) {
 + if (builtin == IS_BUILTIN_TRUE)
 + ret-features |= FEATURE_BUILTIN;
 + else if (builtin == IS_BUILTIN_FALSE)
 + ret-features = ~FEATURE_BUILTIN;
 +
 + return ret;
 + }
  
  bail:
 -g_free (name);
 -libwacom_error_set(error, WERROR_UNKNOWN_MODEL, NULL);
 -return NULL;
 + g_free (name);
 + libwacom_error_set(error, WERROR_UNKNOWN_MODEL, NULL);
 + return NULL;
  }
  
  WacomDevice*
  libwacom_new_from_usbid(WacomDeviceDatabase *db, int vendor_id, int 
 product_id, WacomError *error)
  {
 -const WacomDevice *device;
 + const WacomDevice *device;
  
 -if (!db) {
 -libwacom_error_set(error, WERROR_INVALID_DB, db

Re: [Linuxwacom-devel] [PATCH libwacom] data: rename 'list' to 'generate-udev-rules'

2012-04-16 Thread Bastien Nocera
On Mon, 2012-04-16 at 14:03 +1000, Peter Hutterer wrote:
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net

Fine by me. Feel free to commit.


--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 1/4] data: add ISDV4 E6 tablet

2012-04-16 Thread Bastien Nocera
On Fri, 2012-04-13 at 10:03 +1000, Peter Hutterer wrote:
 ---
  data/isdv4-e6.tablet |   11 +++
  1 file changed, 11 insertions(+)
  create mode 100644 data/isdv4-e6.tablet

Looks good


--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 2/4] Fix two vim tags

2012-04-16 Thread Bastien Nocera
On Fri, 2012-04-13 at 10:03 +1000, Peter Hutterer wrote:
 Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
 ---
  libwacom/libwacom.c |2 +-
  libwacom/libwacom.h |2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

Fine by me.


--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 3/4] test: if load fails to load the database, print it.

2012-04-16 Thread Bastien Nocera
On Fri, 2012-04-13 at 10:03 +1000, Peter Hutterer wrote:
 TOPSRCDIR is relative, so load must be called from the pwd.

Looks good


--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH libwacom 4/4] lib: fix error message

2012-04-16 Thread Bastien Nocera
On Fri, 2012-04-13 at 10:03 +1000, Peter Hutterer wrote:
 device-match is NULL since we haven't assigned it yet.

Good catch.


--
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH linuxwacom] Specify correct buffer size in wacom_query_tablet_data

2012-03-28 Thread Bastien Nocera
Em Wed, 2012-03-28 às 10:12 -0700, Jason Gerecke escreveu:
 Changes the spciefied buffer size from 3 bytes to 2 bytes to match
  
  specified
 the amount we allocated. Hasn't caused problems yet, but probably
 could.

Cheers


--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH] Add support for the Intuos5

2012-03-12 Thread Bastien Nocera
Em Mon, 2012-03-12 às 15:22 -0700, Jason Gerecke escreveu:
 Signed-off-by: Jason Gerecke killert...@gmail.com

Can I have the same one for libwacom? :)


--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH] Export current tool ID in the property too

2012-02-22 Thread Bastien Nocera
Em Wed, 2012-02-22 às 16:54 +1000, Peter Hutterer escreveu:
 Previously, we exported old serial number, old tool ID and current serial
 number. Export the current tool ID as well.

Just what I needed. I changed the code in gnome-settings-daemon and
gnome-control-center to check for the current tool ID before the old
one, and the panel switches styli as needed.

Tested-by: Bastien Nocera had...@hadess.net

Cheers


--
Virtualization  Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] Tool ID not updating

2012-02-20 Thread Bastien Nocera
Heya,

I'm having a bit of trouble with this code:
http://git.gnome.org/browse/gnome-settings-daemon/tree/plugins/common/gsd-input-helper.c#n292

It's supposed to send the last used tool ID, except that it doesn't seem
to update when I bring my pen closer, only when I remove it. Which
offset of Wacom Serial IDs is supposed to contain the _current_ tool
ID? All my attempts so far have resulted in even more bizarre
occurrences.

I'm confused. This is stopping me from implementing automatic page
switching in the GNOME panel based on the last used stylus.

Cheers


--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH v3] Enable LED status change through xsetwacom

2012-02-18 Thread Bastien Nocera
Peter Hutterer peter.hutterer@... writes:
 On Wed, Feb 08, 2012 at 08:30:58AM -0800, Jason Gerecke wrote:
  Any feedback on the changes or ideas on exposing the properties?
 
 sorry for the delay. short answer - I don't think we should merge this
 support as properties. properties are not well-suited for this, they are too
 generic and too much knowledge must reside in the client setting them.

Exactly. But the client should be the one handling the mode switching, and the
button actions in the first place. So I don't see what's wrong with exposing
it as a property. It would make it available now, and make it possible for me 
to make the mode switching work in GNOME 3.4 (I really don't want to have mode
switching enabled if I can't show the user that the mode has indeed switched).

So I'm in favour of one property per LED group, and a bitmask as to which one
is lit up (if even just an index, if we want to force 1 LED lit at all times).

 Instead, we should extend the protocol for XI 2.3 to add a LED class and the
 required requests to modify the LEDs support. This gives us
 more flexibility handling LEDs and less driver-dependent behaviour.

That's nice. It doesn't require using properties. but it does still require
the client having special knowledge of the device. It's not like one would set
the LEDs the same way on a Wacom tablet and a PS3 joypad for example.

Cheers


--
Virtualization  Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] GNOME Wacom panel implementation questions

2012-02-08 Thread Bastien Nocera
On Wed, 2012-02-08 at 10:42 -0600, Chris Bagwell wrote:
 On Wed, Feb 8, 2012 at 9:28 AM, Peter Hutterer peter.hutte...@who-t.net 
 wrote:
  On Thu, Feb 02, 2012 at 06:54:23PM +, Bastien Nocera wrote:
  Heya,
 
  Instead of hitting just Peter with this sort of question[1], I'm
  guessing that there are quite a few people on the list that could answer
  my questions (or point me to the relevant Wiki pages).
 
  For the fun that's about to be had with the Intuos4 LEDs, a couple of
  questions:
  - is there/will there be a way to avoid getting/updating/setting all the
  LEDs when changing one? What format do the LEDs graphics needs to be in?
 
  I think this was mentioned in another thread but LEDs are the little ones
  next to the ring and OLEDs are the ones that can display pretty pictures.
  I don't really have a good idea on the OLED approach yet. From a driver's
  POV the best approach may be to set a property to a Pixmap, with the driver
  the converting to the actual format the kernel wants.
  There are plenty of tools that can convert from $FILEFORMAT to pixmap, and
  IIRC we had a xsetwacom patch for this at some point.
 
  - can wacom provide a library of pixmaps for us to use for the LEDs, so
  that they look like they already do on Windows or MacOS X, or would we
  have the time consuming task of re-doing them? If the problem is simply
  that the data isn't easily available, we can certainly try and nab it
  from the other drivers.
  - will we need to handle rotation ourselves, and rotate the LED drawings
  ourselves?
 
  yes, whatever triggers the rotation should rotate the OLEDs.
 
  - what metadata does one need to associate a button with an LED
  placement?
 
  I'm not sure what you mean here, can you elaborate?
 
 
 If/when you guys get to the touch ring LED's, I'd like to jump in.
 Maybe the above metadata question is related to following.
 
 I'm a little interested in the click button in the center of it and
 how it affects an LED (not OLED).  The LED's represent a mode of
 ring.  What the exact mode means I think is an application specific
 issue but toggling between modes and how it changes LED's is probably
 something like g-s-d's job.
 
 The good news is that the sysfs interface for this LED is also mode
 based.  You can only light 1 LED at a time.
 
 What I'd like you guys to consider is simple tablets that do not
 have touch rings nor the related mode LEDs.  It would be nice if you
 could assign any random button on tablet to be a more generic mode
 feature.  The mode feature is something like increasing a # between
 0-2 each time button is pressed with a roll over at max value.
 
 By default on Intuos and Cintiq, libwacom would say that ring button
 is for mode feature but for a Bamboo it would say no button is.
 Hopefully, we have a GUI that allows user to pick one of Bamboo's 4
 buttons for mode feature though.
 
 In Intous/Cintiq case, the mode would also control a sysfs LED.  For
 Bamboo, there is no LED nor sysfs entry but the current mode could be
 monitored via DBUS/gsettings/X property/etc and we could make an
 applet to show virtual LED like those capslock LED applets when that
 is missing.
 
 The mode LED is meant to track how touch ring's scroll events are
 treated (zoom, scroll, brush size, etc) but I don't see why we
 couldn't use it for any random mode concept such as airbrush vs. pen
 vs. eraser modes.  Basically, a way of increasing the # of
 ExpressKey's your tablet has.

I have no plans on exposing modes for devices that don't have the LEDs
to show which mode is selected. The code is still there for you to
modify if you want though. Modifying your tablet's definition might be
sufficient to achieve that in the future.


--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] libwacom

2012-02-06 Thread Bastien Nocera
On Sun, 2012-02-05 at 10:49 -0600, Favux ... wrote:
 I've long suspected that if the stylus will work with the digitizer on
 a consumer tablet then all the stylus hardware will work too.  So if
 your BambooPT was a Pen model without an eraser a Bamboo Pen  Touch
 model stylus with an eraser would have a working eraser even on the
 Pen.  And the same with the tablet PCs.  However I can recall only a
 few folks reporting this; apparently getting a new stylus isn't very
 common.  So it is good you confirm it Jason.
 
 Given that is true then we don't want to restrict stylus or other
 capabilities for consumer tablets in libwacom.  So the upshot is
 whether the different capabilities of the stylus need to be take into
 account in the applet.  For example something that has been constantly
 seen since the xorg.conf days is folks having a section for the cursor
 even though their tablet doesn't come with a mouse/puck.  However just
 like the stylus I suspect if the base model supports a puck then their
 tablet would even though it was packaged without one.  Apparently a
 lot think the cursor refers to the pointer arrow rather than another
 input tool.  If the applet is presenting them with options to
 configure a non-existent cursor, stylus side switch or eraser people
 will be trying to configure them.  And then asking why that doesn't
 work.  A lot of people with their first Wacom tablet don't realize
 what a Wacom eraser looks like and don't know if they have one or not
 or that it only works in eraser enabled programs.

We don't apply any configuration to the Wacom tablet mice in GNOME. We
consider them to be a way to save some desk space. We also don't support
the Lens cursor (which I gather is just a mouse with a crosshair
attached).

 It would be a good thing if the Wacom tablet applet's interface
 somehow helped clear up confusion over the input tools.  Through tool
 tips?  May be asking too much, but at least something to keep in the
 back of the mind.

What do you want the UI to do? The name will already be generic
stylus. I don't think we can go much further than that.


--
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH 4/4] data: Add additional metadata that isn't yet representable

2012-02-02 Thread Bastien Nocera
Jason Gerecke killertofu@... writes:
 Thankfully, not too terribly long. I've got representatives of most of
 the tablets handy, though some with different button layouts (e.g.
 Intuos4 Small) were guesses.

I've updated 2 of the definitions you provided, which claimed to have both a 
builtin device and 
one that was reversible. That's not possible, for those devices the tablet 
rotation follows the 
screen rotation, so you'd just change the screen's rotation instead.

I've also noticed problems with the Ring value. At least the Cintiq 21UX2 has 
touch rings on 
each side of the device, but the definition says Ring=false.

I've also noticed that those rings weren't explicitely mentioned in the 
schemas. Finally, those 
schemas have the button numbering wrong. For example, the Intuos4 6x9 that I 
have in front of 
me. In the definition, you have:
# Button Map:
# (A=1, B=2, C=3, ...)
#
#*---*
#|   |
#  B |   |
#  C |   |
#  D |   |
#  E |   |
#  A |TABLET |
#  F |   |
#  G |   |
#  H |   |
#  I |   |
#|   |
#*---*

When in reality it should be:
# Button Map:
# (A=1, B=2, C=3, ...)
#
#  *---*
#  |   |
#   B  |   |
#   C  |   |
#   H  |   |
#   I  |   |
#  (A) |TABLET |
#   J  |   |
#   K  |   |
#   L  |   |
#   M  |   |
#  |   |
#  *---*
# (A) is a touch ring, middle-click 1, 4/5 through the scroll wheel

Would it be possible for you to update the schematics to reflect that?

I will probably also change the Ring property to a number of rings, rather than 
a simple 
boolean.

  I'll need to transform that data into something usable programmatically 
soon to
  get the button mapping on its way.

This is going to get slightly complicated. 

In the definitions, we will need to:
- name all the buttons (that'll need to be translated)
- which mouse button they correspond to
- and possibly include some metadata for LED setting if necessary (which I have 
no idea what 
this should look like)

Does that sound appropriate?


--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] libwacom

2012-02-02 Thread Bastien Nocera
Favux ... favux.is@... writes:
 An initial libwacom page:
 https://sourceforge.net/apps/mediawiki/linuxwacom/index.php?title=Libwacom

I think the information about filling in the definition files should be in 
wacom.example directly, and nothing (that would most likely end up being 
outdated) in the Wiki.

The contributors list, which you seem to have snarfed from my blog entry, are 
the 
contributors to the GNOME wacom support, not to libwacom. For example, Jason 
didn't contribute until I committed his extensive definition files.

Other than that, the content is interesting, thanks.

  is now posted on the Developer Pages:
 https://sourceforge.net/apps/mediawiki/linuxwacom/index.php?
title=Category:DeveloperPages
 
 I do have another question.  When I look at the GNOME 3.4 Control
 Panel Wacom tablet applet rotation seems to apply the stylus parent
 device.  I can't tell if touch is also rotated for USB tablet PCs and
 BambooPTs with their separate parent device for touch.  Is it?

Does it show up as a separate tool? If so, we don't support it yet in 
GsdWacomDevice, but adding it should be enough to get all the tools rotated at 
once. Can you file a bug against gnome-settings-daemon in the GNOME Bugzilla 
for 
that?

Cheers


--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH] hid-wacom: add support to Intuos4 pad buttons and dial

2012-02-02 Thread Bastien Nocera
On Thu, 2012-02-02 at 11:08 -0500, Aristeu Rozanski wrote:
  I do not know if these Bluetooth Intuos4 support mouse pucks. 

From what I've read (before stupidly buying the USB-only version), plug
in the Intuos4 WL via USB and it's the same as the Intuos4 L. So I'm
guessing it supports the exact same tools.


--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] libwacom

2012-02-02 Thread Bastien Nocera
On Thu, 2012-02-02 at 11:55 -0600, Favux ... wrote:
 Hi Bastien,
 
 Thanks for reviewing the wiki page.
 
 On Thu, Feb 2, 2012 at 10:31 AM, Bastien Nocera had...@hadess.net wrote:
 
  I think the information about filling in the definition files should be in
  wacom.example directly, and nothing (that would most likely end up being
  outdated) in the Wiki.

I rather meant the advices about the naming of the device for example.
You also probably want to use a definition that doesn't have FIXME in it
as the example ;)

  The contributors list, which you seem to have snarfed from my blog entry, 
  are
  the
  contributors to the GNOME wacom support, not to libwacom. For example, Jason
  didn't contribute until I committed his extensive definition files.
 
 Will correct that then.  Yes everything is cribbed off your blog and
 other posts and interviews.  And some of Peter's stuff.  If there is
 any original content it is probably accidental.  :)

Haha.

  Other than that, the content is interesting, thanks.
 
 I don't know if you are interested but if you want to have at it and
 edit it Peter can add you to the wiki editor list.
 
  I do have another question.  When I look at the GNOME 3.4 Control
  Panel Wacom tablet applet rotation seems to apply the stylus parent
  device.  I can't tell if touch is also rotated for USB tablet PCs and
  BambooPTs with their separate parent device for touch.  Is it?
 
  Does it show up as a separate tool? If so, we don't support it yet in
  GsdWacomDevice, but adding it should be enough to get all the tools rotated 
  at
  once. Can you file a bug against gnome-settings-daemon in the GNOME Bugzilla
  for
  that?
 
 When tested touch rotates fine for my BambooPT but not for my usb
 tablet PC.  That's with GNOME 3.2 as I haven't tested it yet with the
 GNOME 3.4 Control Panel.  The BambooPT's pad buttons don't rotate of
 course, but you haven't started working on those.
 
 
 A further issue concerns the generic styli.  The LLC (low low cost)
 consumer tablets like the Bamboo Pen and the Bamboo Ones have a stylus
 + 2 buttons but no eraser.

Ha, I didn't know that. We need to create some new styli for those
devices then.

Peter, Jason, any advice on what tool IDs we could use for those?

   That's true of some of the tablet PCs
 also.  Additionally if I recall correctly some tablet PCs have a
 stylus + 1 button.

It's really the same problem. My Bluetooth graphire-based tablet has 2
buttons, and an eraser. We need separate styli definition for them.

   Not sure if those styli have erasers or not.  On
 those models the driver tends to report a spurious eraser and pad
 (with the tablets) in say 'xinput list'.  Since libwacom removes the
 reporting of a spurious pad (Buttons=0) doing the same for the eraser
 or spurious side button would be nice.  Maybe Peter can tell us which
 styli those are?

We don't count the tips. So a stylus always has one button, and an
eraser always has one button. We would use HasEraser=false for the
stylus though.

Cheers


--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] GNOME Wacom panel implementation questions

2012-02-02 Thread Bastien Nocera
Heya,

Instead of hitting just Peter with this sort of question[1], I'm
guessing that there are quite a few people on the list that could answer
my questions (or point me to the relevant Wiki pages).

For the fun that's about to be had with the Intuos4 LEDs, a couple of
questions:
- is there/will there be a way to avoid getting/updating/setting all the
LEDs when changing one? What format do the LEDs graphics needs to be in?
- can wacom provide a library of pixmaps for us to use for the LEDs, so
that they look like they already do on Windows or MacOS X, or would we
have the time consuming task of re-doing them? If the problem is simply
that the data isn't easily available, we can certainly try and nab it
from the other drivers.
- will we need to handle rotation ourselves, and rotate the LED drawings
ourselves?
- what metadata does one need to associate a button with an LED
placement?
- Any ideas what a sane API would look like (eg. if you didn't have to
use device properties, how would you have implemented it? :)

-How does one grab events from the touchring when used with the stylus?
xev refuses to show anything.

Cheers

[1]: Instead I get him to check whether we support all 22 mouse
buttons on the Cintiq 21UX2 :)
https://bugs.freedesktop.org/show_bug.cgi?id=45557


--
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] [PATCH 4/4] data: Add additional metadata that isn't yet representable

2012-02-02 Thread Bastien Nocera
On Thu, 2012-02-02 at 11:16 -0800, Jason Gerecke wrote:
 On Thu, Feb 2, 2012 at 7:56 AM, Bastien Nocera had...@hadess.net wrote:
  Jason Gerecke killertofu@... writes:
  Thankfully, not too terribly long. I've got representatives of most of
  the tablets handy, though some with different button layouts (e.g.
  Intuos4 Small) were guesses.
 
  I've updated 2 of the definitions you provided, which claimed to have both a
  builtin device and
  one that was reversible. That's not possible, for those devices the tablet
  rotation follows the
  screen rotation, so you'd just change the screen's rotation instead.
 
 It was a little unclear under what circumstances reversible should
 be set, but that makes sense.
 
  I've also noticed problems with the Ring value. At least the Cintiq 21UX2 
  has
  touch rings on
  each side of the device, but the definition says Ring=false.
 
  I've also noticed that those rings weren't explicitely mentioned in the
  schemas.
 The 21UX2 has two touch strips (on the back side of the tablet -- you
 won't usually see them in photos), but no touch rings. Looking at the
 metadata again, it all seems correct.

What are the circular buttons between the groups of buttons here?
http://www.wacom.com/en/Products/Cintiq/~/media/Images/Products/DTK-2100-1.ashx

  Finally, those
  schemas have the button numbering wrong. For example, the Intuos4 6x9 that I
  have in front of
  me. In the definition, you have:
  # Button Map:
  # (A=1, B=2, C=3, ...)
  #
  #*---*
  #|   |
  #  B |   |
  #  C |   |
  #  D |   |
  #  E |   |
  #  A |TABLET |
  #  F |   |
  #  G |   |
  #  H |   |
  #  I |   |
  #|   |
  #*---*
 
  When in reality it should be:
  # Button Map:
  # (A=1, B=2, C=3, ...)
  #
  #  *---*
  #  |   |
  #   B  |   |
  #   C  |   |
  #   H  |   |
  #   I  |   |
  #  (A) |TABLET |
  #   J  |   |
  #   K  |   |
  #   L  |   |
  #   M  |   |
  #  |   |
  #  *---*
  # (A) is a touch ring, middle-click 1, 4/5 through the scroll wheel
 
  Would it be possible for you to update the schematics to reflect that?
 
 Those button maps are in terms of the physical reality of the tablet,
 which I think will be a better representation in the end.

OK.

  How
 xf86-input-wacom transforms the data for use by X applications is
 subject to change (indeed, we've discussed removing the artificial
 gap every tablet has from D-G) but the hardware isn't. Rather than
 hard-coding the effect of our driver's transformations in the .tablet
 definitions, it'd make more sense to put that knowledge into libwacom
 itself.

I'm fine with doing that, but how do we get from the reality/that
definition to knowing that the bottom-left button is mouse button 13
so we can reassign it?

  I will probably also change the Ring property to a number of rings, rather 
  than
  a simple
  boolean.
 
 Strips should follow the same convention as well. HStrip and
 VStrip always seemed poor labels anyway (especially since HStrip
 is often just another vertical strip!)

I'm not familiar with strips. What should I change there?

Could you also mention to me which of the tablets have 2 rings, if any?

   I'll need to transform that data into something usable programmatically
  soon to
   get the button mapping on its way.
 
  This is going to get slightly complicated.
 
  In the definitions, we will need to:
  - name all the buttons (that'll need to be translated)
  - which mouse button they correspond to
  - and possibly include some metadata for LED setting if necessary (which I 
  have
  no idea what
  this should look like)
 
  Does that sound appropriate?
 
 It sounds like you're trying to define the default mouse button that
 is associated with each physical button. That's actually trivial --
 xf86-input-wacom uses: (mouse_button = physical_button  4 ?
 physical_button : physical_button + 4).

I'm guessing that answers my above question.
So it would be:
- name all the buttons (that'll need to be translated)
- and which physical button it corresponds to

I think we're getting confused over the LEDs. I'm talking about the LEDs
next to the square buttons, with the pictograms in them:
http://www.wacom.com/en/Products/Intuos/~/media/Images/Products/ptk840-2.ashx

I see now that there are LEDs next to the touchring on that device. What
are they used for? Is this something we will need to support too?

  My maps were more intended to
 define the location of the physical buttons on the tablet, since it
 can

  1   2   >