Re: [Linuxwacom-devel] libwacom: [PATCH] data: Add caption indicators to layouts

2012-11-29 Thread Olivier Fourdan
Favux ... said the following on 11/29/2012 07:08 AM:
> In drafting there is a technical name for lines connecting labels to
> the object they reference.
>
> Leaders
> Leaders or leader lines indicate the part or area of a drawing to
> which a number, note or other reference applies. They are solid lines
> and usually terminate in a single arrowhead.

Perfect, Thanks!

That's the word I was looking for (unfortunately Google didn't help 
here and I could not use any translator tool as I couldn't 
find/remember in any other language either... meh)

I shall send an updated patch shortly.

Cheers,
Olivier.

-- 
əɔıʌəp əɯos ɥʇıʍ əɹəɥʍəɯos ɯoɹɟ ʇuəs


--
Keep yourself connected to Go Parallel: 
VERIFY Test and improve your parallel project with help from experts 
and peers. http://goparallel.sourceforge.net
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] libwacom: [PATCH] data: Add caption indicators to layouts

2012-11-29 Thread Olivier Fourdan

Hi Peter,

Peter Hutterer said the following on 11/29/2012 06:34 AM:
> As Ping said, up/down on a ring is ambiguous. we use that 
> terminology in the driver, but I do think we have the chance here to 
> use CW/CCW instead.

Right, but is is it guaranteed that {Abs,Rel}Wheel*UP as received by 
the client is always CCW on the hardware and {Abs,Rel}Wheel*Down is 
always CW, for all devices out there?

Otherwise there would be no way to accurately match what's received 
from the driver with the CW/CWW naming convention.

Cheers,
Olivier.

--
Keep yourself connected to Go Parallel: 
VERIFY Test and improve your parallel project with help from experts 
and peers. http://goparallel.sourceforge.net
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] libwacom: [PATCH 3/3] lib: add "IntegratedIn" to device group

2012-11-29 Thread Olivier Fourdan

Hi Peter,

Peter Hutterer said the following on 11/28/2012 01:43 AM:
> [...]
> I have to admit, this confused me quite a bit during testing (reason was
> that I forgot to install the data files at first, so list-local-devices gave
> me wrong values).
>
> turns out integration_flags is the one read from the kernel and can only be
> DISPLAY or NONE, so we need this weird construct to keep the SYSTEM alive
> (if it is there in the database).
>
> Now, that brings up the question: do we really want to override
> the device database entries with kernel-queried ones?

It should be the other way around. The kernel flags are used only if 
the integration flags are not set in the database.

get_device_info() which is the routines that reads the kernel flags is 
called from libwacom_new_from_path();

libwacom_new_from_path() passes an "integration_flags" local variable 
to get_device_info() which is set based on the kernel flags.

Then only the display part of the flag is used to update the device flags:


 if (device) {
 if (integration_flags == WACOM_DEVICE_INTEGRATED_DISPLAY)
 ret->integration_flags |= WACOM_DEVICE_INTEGRATED_DISPLAY;
 else if (integration_flags == WACOM_DEVICE_INTEGRATED_NONE)
 ret->integration_flags &= ~WACOM_DEVICE_INTEGRATED_DISPLAY;

 return ret;
 }

(was like that with is_builtin, so nothing new here). The "system" 
part of the integration flags is left untouched and remains to 
whatever is set in the database (the kernel does not allow to 
automatically determine ISDs)

>> [...]
>> +WacomIntegrationFlags libwacom_get_integration_flags (WacomDevice *device)
>> +{
> sorry, I didn't spot this earlier, this should be const WacomDevice *device.
> (only noticed that when doing some printf testing on my device). Given that
> is_builtin, is_reversible, etc aren't const we should update all of them in
> a follow-up patch.
>

Yes, I simply copy/pasted from one of the previous functions... I'll 
send a separate global "constification" patch.

Cheers,
Olivier.

--
Keep yourself connected to Go Parallel: 
VERIFY Test and improve your parallel project with help from experts 
and peers. http://goparallel.sourceforge.net
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] libwacom: [PATCH 3/3] lib: add "IntegratedIn" to device group

2012-11-29 Thread Olivier Fourdan
Olivier Fourdan said the following on 11/29/2012 05:49 PM:
> [...]
> It should be the other way around. The kernel flags are used only if 
> the integration flags are not set in the database. 

Sorry please ignore that sentence in my previous reply, it was left 
over from a first draft... meh :(

Cheers,
Olivier.

--
Keep yourself connected to Go Parallel: 
VERIFY Test and improve your parallel project with help from experts 
and peers. http://goparallel.sourceforge.net
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] libwacom: [PATCH] lib: constify parameters in API

2012-11-29 Thread Olivier Fourdan

[...]

Olivier Fourdan said the following on 11/29/2012 05:49 PM:

sorry, I didn't spot this earlier, this should be const WacomDevice *device.
>  (only noticed that when doing some printf testing on my device). Given that
>  is_builtin, is_reversible, etc aren't const we should update all of them in
>  a follow-up patch.
>

Yes, I simply copy/pasted from one of the previous functions... I'll
send a separate global "constification" patch.


The /big/ constification patch... goes on top of the integration bits.

Cheers,
Olivier.
>From 36a4afefcc4fcf89fa7c1e917c97926e3945a152 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan 
Date: Thu, 29 Nov 2012 18:52:36 +0100
Subject: [PATCH] lib: constify parameters in API

Signed-off-by: Olivier Fourdan 
---
 libwacom/libwacom-database.c |2 +-
 libwacom/libwacom.c  |   86 -
 libwacom/libwacom.h  |   70 +-
 3 files changed, 78 insertions(+), 80 deletions(-)

diff --git a/libwacom/libwacom-database.c b/libwacom/libwacom-database.c
index e0ee52e..9813a4e 100644
--- a/libwacom/libwacom-database.c
+++ b/libwacom/libwacom-database.c
@@ -622,7 +622,7 @@ libwacom_database_destroy(WacomDeviceDatabase *db)
 }
 
 WacomDevice**
-libwacom_list_devices_from_database(WacomDeviceDatabase *db, WacomError *error)
+libwacom_list_devices_from_database(const WacomDeviceDatabase *db, WacomError *error)
 {
 	GList *cur, *devices;
 	WacomDevice **list, **p;
diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
index 23f3b08..b03fe0b 100644
--- a/libwacom/libwacom.c
+++ b/libwacom/libwacom.c
@@ -48,7 +48,7 @@
 #endif
 
 static const WacomDevice *
-libwacom_get_device(WacomDeviceDatabase *db, const char *match)
+libwacom_get_device(const WacomDeviceDatabase *db, const char *match)
 {
 	return (WacomDevice *) g_hash_table_lookup (db->device_ht, match);
 }
@@ -337,7 +337,7 @@ libwacom_copy(const WacomDevice *device)
 
 
 static int
-compare_matches(WacomDevice *a, WacomDevice *b)
+compare_matches(const WacomDevice *a, const WacomDevice *b)
 {
 	const WacomMatch **ma, **mb, **match_a, **match_b;
 
@@ -359,7 +359,7 @@ compare_matches(WacomDevice *a, WacomDevice *b)
 
 /* Compare layouts based on file name, stripping the full path */
 static gboolean
-libwacom_same_layouts (WacomDevice *a, WacomDevice *b)
+libwacom_same_layouts (const WacomDevice *a, const WacomDevice *b)
 {
 	gchar *file1, *file2;
 
@@ -378,7 +378,7 @@ libwacom_same_layouts (WacomDevice *a, WacomDevice *b)
 }
 
 int
-libwacom_compare(WacomDevice *a, WacomDevice *b, WacomCompareFlags flags)
+libwacom_compare(const WacomDevice *a, const WacomDevice *b, WacomCompareFlags flags)
 {
 	g_return_val_if_fail(a || b, 0);
 
@@ -442,7 +442,7 @@ libwacom_compare(WacomDevice *a, WacomDevice *b, WacomCompareFlags flags)
 }
 
 static const WacomDevice *
-libwacom_new (WacomDeviceDatabase *db, int vendor_id, int product_id, WacomBusType bus, WacomError *error)
+libwacom_new (const WacomDeviceDatabase *db, int vendor_id, int product_id, WacomBusType bus, WacomError *error)
 {
 	const WacomDevice *device;
 	char *match;
@@ -460,7 +460,7 @@ libwacom_new (WacomDeviceDatabase *db, int vendor_id, int product_id, WacomBusTy
 }
 
 WacomDevice*
-libwacom_new_from_path(WacomDeviceDatabase *db, const char *path, WacomFallbackFlags fallback, WacomError *error)
+libwacom_new_from_path(const WacomDeviceDatabase *db, const char *path, WacomFallbackFlags fallback, WacomError *error)
 {
 	int vendor_id, product_id;
 	WacomBusType bus;
@@ -522,7 +522,7 @@ bail:
 }
 
 WacomDevice*
-libwacom_new_from_usbid(WacomDeviceDatabase *db, int vendor_id, int product_id, WacomError *error)
+libwacom_new_from_usbid(const WacomDeviceDatabase *db, int vendor_id, int product_id, WacomError *error)
 {
 	const WacomDevice *device;
 
@@ -541,7 +541,7 @@ libwacom_new_from_usbid(WacomDeviceDatabase *db, int vendor_id, int product_id,
 }
 
 WacomDevice*
-libwacom_new_from_name(WacomDeviceDatabase *db, const char *name, WacomError *error)
+libwacom_new_from_name(const WacomDeviceDatabase *db, const char *name, WacomError *error)
 {
 	const WacomDevice *device;
 	GList *keys, *l;
@@ -570,7 +570,7 @@ libwacom_new_from_name(WacomDeviceDatabase *db, const char *name, WacomError *er
 	return NULL;
 }
 
-static void print_styli_for_device (int fd, WacomDevice *device)
+static void print_styli_for_device (int fd, const WacomDevice *device)
 {
 	int nstyli;
 	const int *styli;
@@ -587,7 +587,7 @@ static void print_styli_for_device (int fd, WacomDevice *device)
 	dprintf(fd, "\n");
 }
 
-static void print_layout_for_device (int fd, WacomDevice *device)
+static void print_layout_for_device (int fd, const WacomDevice *device)
 {
 	const char *layout_filename;
 	gchar  *base_name;
@@ -600,7 +600,7 @@ static void print_layout_for_device (int fd, WacomDevice *device)
 	}
 }
 
-static void print_supported_leds (int fd, WacomDevice *device)
+static void print_supported_leds (int fd, const WacomDevice *device)

Re: [Linuxwacom-devel] libwacom: [PATCH] data: Add caption indicators to layouts

2012-11-29 Thread Olivier Fourdan
Olivier Fourdan said the following on 11/29/2012 05:34 PM:
> Updated patch.
>
> Uses CW and CCW instead of Up and Down for touch rings, adds 
> (optional) arrows to show rotation on touch rings, renamed 
> "indicator" as "leader" as per previous reviews.

Patch is slightly larger than the limit for the list (40.2Kb > 40Kb, 
sigh) and gets block waiting for moderator approval.

In the meantime it can be downloaded from here:

http://people.redhat.com/ofourdan/libwacom/patches/0001-data-Add-leaders-to-layouts.patch

Cheers,
Olivier.

--
Keep yourself connected to Go Parallel: 
VERIFY Test and improve your parallel project with help from experts 
and peers. http://goparallel.sourceforge.net
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] libwacom: [PATCH] data: Add caption indicators to layouts

2012-11-29 Thread Jason Gerecke
On Thu, Nov 29, 2012 at 12:45 AM, Olivier Fourdan wrote:

>
> Hi Peter,
>
> Peter Hutterer said the following on 11/29/2012 06:34 AM:
> > As Ping said, up/down on a ring is ambiguous. we use that
> > terminology in the driver, but I do think we have the chance here to
> > use CW/CCW instead.
>
> Right, but is is it guaranteed that {Abs,Rel}Wheel*UP as received by
> the client is always CCW on the hardware and {Abs,Rel}Wheel*Down is
> always CW, for all devices out there?
>
> Otherwise there would be no way to accurately match what's received
> from the driver with the CW/CWW naming convention.
>
> Cheers,
> Olivier.
>

I would consider this to be behavior you can rely on. On a dial-type
control, "forward", "bigger", etc. are universally achieved through CW
rotation. Even if the hardware were wired backwards for some reason, we'd
still almost certainly correct it in software to ensure an appropriate user
experience. It would be exceedingly strange for a device to *intend* for
rotation to work backwards.

Jason

---
When you're rife with devastation / There's a simple explanation:
You're a toymaker's creation / Trapped inside a crystal ball.
And whichever way he tilts it / Know that we must be resilient
We won't let them break our spirits / As we sing our silly song.


>
>
> --
> Keep yourself connected to Go Parallel:
> VERIFY Test and improve your parallel project with help from experts
> and peers. http://goparallel.sourceforge.net
> ___
> Linuxwacom-devel mailing list
> Linuxwacom-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
>
--
Keep yourself connected to Go Parallel: 
VERIFY Test and improve your parallel project with help from experts 
and peers. http://goparallel.sourceforge.net___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] libwacom: [PATCH] data: Add caption indicators to layouts

2012-11-29 Thread Peter Hutterer
On Thu, Nov 29, 2012 at 05:34:28PM +0100, Olivier Fourdan wrote:
> Updated patch.
> 
> Uses CW and CCW instead of Up and Down for touch rings, adds
> (optional) arrows to show rotation on touch rings, renamed
> "indicator" as "leader" as per previous reviews.

ack to the leader part of it, but the other comments still stand
(change of colours, timeout change, splitting the API change for print_label
into a separate patch)


one more nitpick, but you don't have to address this one if you don't agree:
> - markup = g_strdup_printf (" ACTIVE_COLOR "\" weight=\"bold\">Button %c", button);

make this
g_strdup_printf(" From b877ff84ee108ce2115a40b4d7c8edfd47382b73 Mon Sep 17 00:00:00 2001
> From: Olivier Fourdan 
> Date: Tue, 27 Nov 2012 09:52:42 +0100
> Subject: [PATCH] data: Add leaders to layouts
> 
> To match the buttons with their corresponding labels, the
> layout SVG must also provide a leader line for each label
> in the form of a line that links each button and its
> label.
> 
> Improves the layout SVG for the Cintiq 12WX and Intuos 5 M
> by adding details and rounded buttons to match the look of
> the real device.
> 
> Buttons, labels and indicators are now grouped in the SVG
> layout for better clarity of the SVG.
> 
> Adds indicators to the SVG check test iprogram so that
> incomplete layouts would be detected.
> 
> Replace use of ambiguous "Up" and "Down" in ring
> controls with "CW" (Clockwise) and "CCW" (Counter
> Clockwise) which are more appropriate for circular
> motion (note that "CCW" is used in place of "Up"
> and "CW" in place of "Down").
> 
> Add possible use of "fake" buttons to materialize
> the type of motion expected in touch strips/rings
> (optional, not mandatory as not present on the
> real device).
> 
> Improves the SVG layout display sample program to show
> touch ring/touch strips labels and label indicators.
> 
> Signed-off-by: Olivier Fourdan 
> ---
>  data/layouts/README  | 124 +++---
>  data/layouts/cintiq-12wx.svg | 118 ++---
>  data/layouts/intuos5-m.svg   |  87 +++--
>  test/tablet-svg-validity.c   |  83 ++--
>  tools/show-svg-image.c   | 176 
> +--
>  5 files changed, 448 insertions(+), 140 deletions(-)
> 
> diff --git a/data/layouts/README b/data/layouts/README
> index 37b644d..fda7814 100644
> --- a/data/layouts/README
> +++ b/data/layouts/README
> @@ -56,6 +56,56 @@ Touch rings use the following convention:
>  id="Strip2"
>  class="Strip2 TouchStrip"
>  
> +Note: Additional "fake" buttons (ie actual controls not found on the real
> +device) can be added to touch controls to help showing the type of action
> +expected on the control, like for example circular motion on a touch ring
> +or vertical motion on a touch strip.
> +
> +These controls can be named:
> +
> + - First touch ring, rotating clockwise:
> +
> +id="RingCW"
> +class="RingCW Button"
> +
> + - First touch ring, rotating counter clockwise:
> +
> +id="RingCCW"
> +class="RingCCW Button"
> +
> + - Second touch ring, rotating clockwise:
> +
> +id="Ring2CW"
> +class="Ring2CW Button"
> +
> + - Second touch ring, rotating counter clockwise:
> +
> +id="Ring2CCW"
> +class="Ring2CCW Button"
> +
> + - First touch strip, moving up:
> +
> +id="StripUp"
> +class="StripUp Button"
> +
> + - First touch strip, moving down:
> +
> +id="StripDown"
> +class="StripDown Button"
> +
> + - Second touch strip, moving up:
> +
> +id="Strip2Up"
> +class="Strip2Up Button"
> +
> + - Second touch strip, moving down:
> +
> +id="Strip2Down"
> +class="Strip2Down Button"
> +
> +The use of those "fake" buttons is left at the discretion of the designer 
> +and is not mandatory nor enforced.
> +
>  * Labels
>  
>  The role of the labels in the SVG is to give applications an indication on
> @@ -71,6 +121,7 @@ Each button's label ID in the SVG is made of the string 
> "Label" with ID of the
>  button to which it applies, between 'A' and 'Z'.
>  
>  Class includes both the button ID and the string "Label".
> +
>  id="LabelA"
>  class="A Label"
>  
> @@ -84,23 +135,23 @@ For the special case of mode-switch buttons, the class 
> also list "ModeSwitch":
>  Touch-rings and touch-strips generate Up and Down events, therefore 2 
> different
>  labels are needed for each touch-ring/touch-strip control.
>  
> -id="LabelRingUp"
> -class="RingUp Ring Label"
> +id="LabelRingCCW"
> +class="RingCCW Ring Label"
>  
>and
>  
> -id="LabelRingDown"
> -class="RingDown Ring Label"
> +id="LabelRingCW"
> +class="RingCW Ring Label"
>  
>  The second touch-ring button is identified by "Ring2" in place of "Ring":
>  
> -id="LabelRing2Up"
> -class="Ring2Up Ring2 Label"
> +id="LabelRing2CCW"
> +class="Ring2CCW Ring2 Label"
>  
>and
>  
> -id="LabelRingDown"
> -class="Ring2Down Ring2 La

Re: [Linuxwacom-devel] libwacom: [PATCH] data: Add caption indicators to layouts

2012-11-29 Thread Olivier Fourdan

Updated patch.

Uses CW and CCW instead of Up and Down for touch rings, adds 
(optional) arrows to show rotation on touch rings, renamed "indicator" 
as "leader" as per previous reviews.
>From b877ff84ee108ce2115a40b4d7c8edfd47382b73 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan 
Date: Tue, 27 Nov 2012 09:52:42 +0100
Subject: [PATCH] data: Add leaders to layouts

To match the buttons with their corresponding labels, the
layout SVG must also provide a leader line for each label
in the form of a line that links each button and its
label.

Improves the layout SVG for the Cintiq 12WX and Intuos 5 M
by adding details and rounded buttons to match the look of
the real device.

Buttons, labels and indicators are now grouped in the SVG
layout for better clarity of the SVG.

Adds indicators to the SVG check test iprogram so that
incomplete layouts would be detected.

Replace use of ambiguous "Up" and "Down" in ring
controls with "CW" (Clockwise) and "CCW" (Counter
Clockwise) which are more appropriate for circular
motion (note that "CCW" is used in place of "Up"
and "CW" in place of "Down").

Add possible use of "fake" buttons to materialize
the type of motion expected in touch strips/rings
(optional, not mandatory as not present on the
real device).

Improves the SVG layout display sample program to show
touch ring/touch strips labels and label indicators.

Signed-off-by: Olivier Fourdan 
---
 data/layouts/README  | 124 +++---
 data/layouts/cintiq-12wx.svg | 118 ++---
 data/layouts/intuos5-m.svg   |  87 +++--
 test/tablet-svg-validity.c   |  83 ++--
 tools/show-svg-image.c   | 176 +--
 5 files changed, 448 insertions(+), 140 deletions(-)

diff --git a/data/layouts/README b/data/layouts/README
index 37b644d..fda7814 100644
--- a/data/layouts/README
+++ b/data/layouts/README
@@ -56,6 +56,56 @@ Touch rings use the following convention:
 id="Strip2"
 class="Strip2 TouchStrip"
 
+Note: Additional "fake" buttons (ie actual controls not found on the real
+device) can be added to touch controls to help showing the type of action
+expected on the control, like for example circular motion on a touch ring
+or vertical motion on a touch strip.
+
+These controls can be named:
+
+ - First touch ring, rotating clockwise:
+
+id="RingCW"
+class="RingCW Button"
+
+ - First touch ring, rotating counter clockwise:
+
+id="RingCCW"
+class="RingCCW Button"
+
+ - Second touch ring, rotating clockwise:
+
+id="Ring2CW"
+class="Ring2CW Button"
+
+ - Second touch ring, rotating counter clockwise:
+
+id="Ring2CCW"
+class="Ring2CCW Button"
+
+ - First touch strip, moving up:
+
+id="StripUp"
+class="StripUp Button"
+
+ - First touch strip, moving down:
+
+id="StripDown"
+class="StripDown Button"
+
+ - Second touch strip, moving up:
+
+id="Strip2Up"
+class="Strip2Up Button"
+
+ - Second touch strip, moving down:
+
+id="Strip2Down"
+class="Strip2Down Button"
+
+The use of those "fake" buttons is left at the discretion of the designer 
+and is not mandatory nor enforced.
+
 * Labels
 
 The role of the labels in the SVG is to give applications an indication on
@@ -71,6 +121,7 @@ Each button's label ID in the SVG is made of the string "Label" with ID of the
 button to which it applies, between 'A' and 'Z'.
 
 Class includes both the button ID and the string "Label".
+
 id="LabelA"
 class="A Label"
 
@@ -84,23 +135,23 @@ For the special case of mode-switch buttons, the class also list "ModeSwitch":
 Touch-rings and touch-strips generate Up and Down events, therefore 2 different
 labels are needed for each touch-ring/touch-strip control.
 
-id="LabelRingUp"
-class="RingUp Ring Label"
+id="LabelRingCCW"
+class="RingCCW Ring Label"
 
   and
 
-id="LabelRingDown"
-class="RingDown Ring Label"
+id="LabelRingCW"
+class="RingCW Ring Label"
 
 The second touch-ring button is identified by "Ring2" in place of "Ring":
 
-id="LabelRing2Up"
-class="Ring2Up Ring2 Label"
+id="LabelRing2CCW"
+class="Ring2CCW Ring2 Label"
 
   and
 
-id="LabelRingDown"
-class="Ring2Down Ring2 Label"
+id="LabelRingCW"
+class="Ring2CW Ring2 Label"
 
 Touchstrips button follow the same naming scheme, using "Strip" and "Strip2"
 to name the first and second touch-strip.
@@ -120,5 +171,60 @@ Second touch-strip:
 
   and
 
-id="LabelRingDown"
+id="LabelRingCW"
 class="Strip2Down Strip2 Label"
+
+ - Caption leader lines
+
+To match the buttons with their corresponding labels, the SVG must also
+provide a leader line for each label in the form of a line that links
+each button and its label.
+
+Each leader line follows the same naming convention as the labels, using
+the special name "Leader" in place of "Label", ie:
+
+id="LeaderA"
+class="A Leader"
+
+Touch-rings and touch-strips have 2 different l