On Fri, Jan 17, 2014 at 02:23:39PM -0800, Ping Cheng wrote:
> A new key word, Touchswitch, is added to wacom.example to
> indicate if the device has touch switch or not.
>
> SVG file names are added in [Device] Layout= as comments.
> But they are not included in this commit. We need people
> with Inkscape experience to create the SVG files.
>
> Signed-off-by: Ping Cheng <[email protected]>
just picking the patch up after ETIMEOUT from Carlos, couple of minor
comments. Carlos, any comments given that GNOME is afaik the only consumer
of libwacom so far?
> ---
> data/intuos-m-pt.tablet | 53
> ++++++++++++++++++++++++++++++++++++++++++++
> data/intuos-s-p.tablet | 36 ++++++++++++++++++++++++++++++
> data/intuos-s-pt.tablet | 53
> ++++++++++++++++++++++++++++++++++++++++++++
> data/wacom.example | 3 +++
> libwacom/libwacom-database.c | 7 ++++++
> libwacom/libwacom.c | 6 +++++
> libwacom/libwacomint.h | 3 ++-
> 7 files changed, 160 insertions(+), 1 deletion(-)
> create mode 100644 data/intuos-m-pt.tablet
> create mode 100644 data/intuos-s-p.tablet
> create mode 100644 data/intuos-s-pt.tablet
>
> diff --git a/data/intuos-m-pt.tablet b/data/intuos-m-pt.tablet
> new file mode 100644
> index 0000000..59703ac
> --- /dev/null
> +++ b/data/intuos-m-pt.tablet
> @@ -0,0 +1,53 @@
> +# Wacom
> +# Intuos Pen & Touch Medium
> +# CTH-680
> +#
> +# Successor of Bamboo3 series
> +#
> +# stylus with two buttons and eraser; 16FG touch
> +# Pen active area: 8.5 x 5.3in
> +# Touch active area: 8.5 x 5.3in
> +#
> +# Button Map:
> +# (A=RIGHT, B=LEFT, C=FORWARD, D=BACKWARD)
> +#
> +# A C
> +# B D
> +# *-----------------------*
> +# | |
> +# | |
> +# | TABLET |
> +# | |
> +# | |
> +# *-----------------------*
> +#
> +# Touch Switch Map:
> +# (on the edge of top right corner; switch to right: touch off; switch to
> left: touch on)
> +#
> +# S
> +# *-----------------------*
> +# | |
> +# | |
> +# | TABLET |
> +# | |
> +# | |
> +# *-----------------------*
> +
> +[Device]
> +Name=Intuos Pen & Touch Medium
> +DeviceMatch=usb:056a:0303
> +Class=Bamboo
> +Width=9
> +Height=5
> +#Layout=intuos-m-pt.svg
> +IntegratedIn=
> +
> +[Features]
> +Stylus=true
> +Reversible=true
> +Touch=true
> +Buttons=4
> +Touchswitch=true
you're using Touchswitch here, but TouchSwitch in the code. Best to stick to
the latter for consistency with the rest. same goes for the example file.
> +
> +[Buttons]
> +Top=A;B;C;D
> diff --git a/data/intuos-s-p.tablet b/data/intuos-s-p.tablet
> new file mode 100644
> index 0000000..373b50d
> --- /dev/null
> +++ b/data/intuos-s-p.tablet
> @@ -0,0 +1,36 @@
> +# Wacom
> +# Intuos Pen Small
> +# CTL-480
> +#
> +# Successor of Bamboo3 series
> +#
> +# stylus with two buttons and eraser
> +# Pen active area: 6.0 x 3.7in
> +#
> +# Button Map:
> +# (A=RIGHT, B=LEFT, C=FORWARD, D=BACKWARD)
> +#
> +# A C
> +# B D
> +# *-----------------------*
> +# | |
> +# | TABLET |
> +# | |
> +# *-----------------------*
> +
> +[Device]
> +Name=Intuos Pen Small
> +DeviceMatch=usb:056a:030e
> +Class=Bamboo
> +Width=6
> +Height=4
> +#Layout=intuos-s-p.svg
> +IntegratedIn=
> +
> +[Features]
> +Stylus=true
> +Reversible=true
> +Buttons=4
> +
> +[Buttons]
> +Top=A;B;C;D
> diff --git a/data/intuos-s-pt.tablet b/data/intuos-s-pt.tablet
> new file mode 100644
> index 0000000..2855571
> --- /dev/null
> +++ b/data/intuos-s-pt.tablet
> @@ -0,0 +1,53 @@
> +# Wacom
> +# Intuos Pen & Touch Small
> +# CTH-480
> +#
> +# Successor of Bamboo3 series
> +#
> +# stylus with two buttons and eraser; 16FG touch
> +# Pen active area: 6.0 x 3.7in
> +# Touch active area: 6.0 x 3.7in
> +#
> +# Button Map:
> +# (A=RIGHT, B=LEFT, C=FORWARD, D=BACKWARD)
> +#
> +# A C
> +# B D
> +# *-----------------------*
> +# | |
> +# | |
> +# | TABLET |
> +# | |
> +# | |
> +# *-----------------------*
> +#
> +# Touch Switch Map:
> +# (on the edge of top right corner; switch to right: touch off; switch to
> left: touch on)
> +#
> +# S
> +# *-----------------------*
> +# | |
> +# | |
> +# | TABLET |
> +# | |
> +# | |
> +# *-----------------------*
> +
> +[Device]
> +Name=Intuos Pen & Touch Small
> +DeviceMatch=usb:056a:0302
> +Class=Bamboo
> +Width=6
> +Height=4
> +#Layout=intuos-s-pt.svg
> +IntegratedIn=
> +
> +[Features]
> +Stylus=true
> +Reversible=true
> +Touch=true
> +Buttons=4
> +Touchswitch=true
> +
> +[Buttons]
> +Top=A;B;C;D
> diff --git a/data/wacom.example b/data/wacom.example
> index 7be0d17..d570e88 100644
> --- a/data/wacom.example
> +++ b/data/wacom.example
> @@ -91,6 +91,9 @@ Reversible=true
> # This tablet supports touch.
> Touch=false
>
> +# This tablet supports hardware touch switch.
"This tablet provides a hardware touch switch"
> +Touchswitch=false
> +
> # This tablet has a touch ring (Intuos4 and Cintiq 24HD)
> # A touch ring is a circular button that responds to touch
> # (rather than clicks):
> diff --git a/libwacom/libwacom-database.c b/libwacom/libwacom-database.c
> index 14b5a4a..c46fcc9 100644
> --- a/libwacom/libwacom-database.c
> +++ b/libwacom/libwacom-database.c
> @@ -441,6 +441,9 @@ libwacom_parse_tablet_keyfile(const char *datadir, const
> char *filename)
> if (g_key_file_get_boolean(keyfile, FEATURES_GROUP, "Reversible", NULL))
> device->features |= FEATURE_REVERSIBLE;
>
> + if (g_key_file_get_boolean(keyfile, FEATURES_GROUP, "TouchSwitch",
> NULL))
> + device->features |= FEATURE_TOUCHSWITCH;
> +
> if (device->integration_flags != WACOM_DEVICE_INTEGRATED_UNSET &&
> device->integration_flags & WACOM_DEVICE_INTEGRATED_DISPLAY &&
> device->features & FEATURE_REVERSIBLE)
> @@ -450,6 +453,10 @@ libwacom_parse_tablet_keyfile(const char *datadir, const
> char *filename)
> (device->features & FEATURE_RING2))
> g_warning ("Table '%s' has Ring2 but no Ring. This is
> impossible", libwacom_get_match(device));
>
> + if (!(device->features & FEATURE_TOUCH) &&
> + (device->features & FEATURE_TOUCHSWITCH))
> + g_warning ("Table '%s' has touch switch but no touch tool. This
> is impossible", libwacom_get_match(device));
> +
"table"? should be fixed up above too.
> device->num_strips = g_key_file_get_integer(keyfile, FEATURES_GROUP,
> "NumStrips", NULL);
> device->num_buttons = g_key_file_get_integer(keyfile, FEATURES_GROUP,
> "Buttons", &error);
> if (device->num_buttons == 0 &&
> diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
> index 1b9b398..574e6f3 100644
> --- a/libwacom/libwacom.c
> +++ b/libwacom/libwacom.c
> @@ -730,6 +730,7 @@ libwacom_print_device_description(int fd, const
> WacomDevice *device)
> dprintf(fd, "Ring=%s\n", libwacom_has_ring(device) ?
> "true" : "false");
> dprintf(fd, "Ring2=%s\n", libwacom_has_ring2(device) ?
> "true" : "false");
> dprintf(fd, "Touch=%s\n", libwacom_has_touch(device) ?
> "true" : "false");
> + dprintf(fd, "TouchSwitch=%s\n", libwacom_has_touchswitch(device)?
> "true" : "false");
libwacom.c: In function 'libwacom_print_device_description':
libwacom.c:733:2: warning: implicit declaration of function
'libwacom_has_touchswitch' [-Wimplicit-function-declaration]
dprintf(fd, "TouchSwitch=%s\n", libwacom_has_touchswitch(device)? "true" :
"false");
I also noticed that the tests are missing of the new feature, so if we do
have a bug that doesn't print the device correctly we wouldn't notice. And,
coincidentally, running test/list-devices shows the tablets above with
TouchSwitch=false...
Cheers,
Peter
> print_supported_leds(fd, device);
>
> dprintf(fd, "NumStrips=%d\n", libwacom_get_num_strips(device));
> @@ -952,6 +953,11 @@ int libwacom_is_reversible(const WacomDevice *device)
> return !!(device->features & FEATURE_REVERSIBLE);
> }
>
> +int libwacom_has_touchswitch(const WacomDevice *device)
> +{
> + return !!(device->features & FEATURE_TOUCHSWITCH);
> +}
> +
> WacomIntegrationFlags libwacom_get_integration_flags (const WacomDevice
> *device)
> {
> /* "unset" is for internal use only */
> diff --git a/libwacom/libwacomint.h b/libwacom/libwacomint.h
> index 4afba4d..f6adb7c 100644
> --- a/libwacom/libwacomint.h
> +++ b/libwacom/libwacomint.h
> @@ -46,7 +46,8 @@ enum WacomFeature {
> FEATURE_TOUCH = (1 << 1),
> FEATURE_RING = (1 << 2),
> FEATURE_RING2 = (1 << 3),
> - FEATURE_REVERSIBLE = (1 << 4)
> + FEATURE_REVERSIBLE = (1 << 4),
> + FEATURE_TOUCHSWITCH = (1 << 5)
> };
>
> /* WARNING: When adding new members to this struct
> --
> 1.8.3.2
>
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel