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 <pi...@wacom.com>
---
 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/libwacom.h          |  6 +++++
 libwacom/libwacomint.h       |  3 ++-
 test/load.c                  |  1 +
 9 files changed, 167 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..0d5d75c
--- /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
+
+[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..0585ed2
--- /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..7c9d34d 100644
--- a/data/wacom.example
+++ b/data/wacom.example
@@ -91,6 +91,9 @@ Reversible=true
 # This tablet supports touch.
 Touch=false
 
+# 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 eaf07bc..ee21413 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 ("Tablet '%s' has Ring2 but no Ring. This is 
impossible", libwacom_get_match(device));
 
+       if (!(device->features & FEATURE_TOUCH) &&
+           (device->features & FEATURE_TOUCHSWITCH))
+               g_warning ("Tablet '%s' has touch switch but no touch tool. 
This is impossible", libwacom_get_match(device));
+
        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");
        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/libwacom.h b/libwacom/libwacom.h
index 6b0c019..476bcf7 100644
--- a/libwacom/libwacom.h
+++ b/libwacom/libwacom.h
@@ -434,6 +434,12 @@ int libwacom_has_ring2(const WacomDevice *device);
 
 /**
  * @param device The tablet to query
+ * @return non-zero if the device has a touch switch or zero otherwise
+ */
+int libwacom_has_touchswitch(const WacomDevice *device);
+
+/**
+ * @param device The tablet to query
  * @return the number of modes for the touchring if it has a mode switch
  */
 int libwacom_get_ring_num_modes(const WacomDevice *device);
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
diff --git a/test/load.c b/test/load.c
index e2db1dc..fcb8dcb 100644
--- a/test/load.c
+++ b/test/load.c
@@ -85,6 +85,7 @@ int main(int argc, char **argv)
        assert(!libwacom_has_touch(device));
        assert(libwacom_has_ring(device));
        assert(!libwacom_has_ring2(device));
+       assert(!libwacom_has_touchswitch(device));
        assert(libwacom_get_num_strips(device) == 0);
        assert(libwacom_get_integration_flags (device) == 
WACOM_DEVICE_INTEGRATED_NONE);
        assert(libwacom_get_width(device) == 8);
-- 
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
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to