>From d918d94efb9dde1cd290142093c206ea21e6da81 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofour...@redhat.com>
Date: Mon, 29 Oct 2012 18:25:24 +0100
Subject: [PATCH 4/4] data: add missing button direction
 test: check presence of direction for all known buttons

Make it mandatory to provide the existing buttons location
(top/left/right/bottom) as client apps that need to locate
or set orientation for labels need this information.
---
 data/bamboo-2fg-4x5.tablet        |    3 +++
 data/bamboo-2fg-6x8.tablet        |    3 +++
 data/bamboo-2fg.tablet            |    3 +++
 data/bamboo-craft.tablet          |    3 +++
 data/graphire-wireless-8x6.tablet |    3 +++
 test/tablet-validity.c            |   20 ++++++++++++++++++++
 6 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/data/bamboo-2fg-4x5.tablet b/data/bamboo-2fg-4x5.tablet
index 96804bd..fb0cb90 100644
--- a/data/bamboo-2fg-4x5.tablet
+++ b/data/bamboo-2fg-4x5.tablet
@@ -21,3 +21,6 @@ Reversible=true
 Touch=true
 Buttons=4
 BuiltIn=false
+
+[Buttons]
+Left=A;B;C;D
diff --git a/data/bamboo-2fg-6x8.tablet b/data/bamboo-2fg-6x8.tablet
index 0f204ea..d7bf97c 100644
--- a/data/bamboo-2fg-6x8.tablet
+++ b/data/bamboo-2fg-6x8.tablet
@@ -21,3 +21,6 @@ Reversible=true
 Touch=true
 Buttons=4
 BuiltIn=false
+
+[Buttons]
+Left=A;B;C;D
diff --git a/data/bamboo-2fg.tablet b/data/bamboo-2fg.tablet
index 6037775..4e74ccd 100644
--- a/data/bamboo-2fg.tablet
+++ b/data/bamboo-2fg.tablet
@@ -20,3 +20,6 @@ Reversible=true
 Touch=true
 Buttons=4
 BuiltIn=false
+
+[Buttons]
+Left=A;B;C;D
diff --git a/data/bamboo-craft.tablet b/data/bamboo-craft.tablet
index 8dba88c..e68ca5d 100644
--- a/data/bamboo-craft.tablet
+++ b/data/bamboo-craft.tablet
@@ -21,3 +21,6 @@ Reversible=true
 Touch=true
 Buttons=4
 BuiltIn=false
+
+[Buttons]
+Left=A;B;C;D
diff --git a/data/graphire-wireless-8x6.tablet b/data/graphire-wireless-8x6.tablet
index 648d1b7..5cc5f71 100644
--- a/data/graphire-wireless-8x6.tablet
+++ b/data/graphire-wireless-8x6.tablet
@@ -11,3 +11,6 @@ Stylus=true
 Ring=false
 Buttons=2
 BuiltIn=false
+
+[Buttons]
+Top=A;B
diff --git a/test/tablet-validity.c b/test/tablet-validity.c
index 38fd0ef..75fe265 100644
--- a/test/tablet-validity.c
+++ b/test/tablet-validity.c
@@ -40,6 +40,25 @@
 #include <assert.h>
 #include <unistd.h>
 
+static int buttons_have_direction (WacomDevice *device)
+{
+	char               button;
+	int                num_buttons;
+
+	num_buttons = libwacom_get_num_buttons (device);
+	if (num_buttons == 0)
+		return 1;
+
+	for (button = 'A'; button < 'A' + num_buttons; button++) {
+		WacomButtonFlags  flags;
+		flags = libwacom_get_button_flag(device, button);
+		if (flags & WACOM_BUTTON_DIRECTION)
+			return 1;
+	}
+
+	return 0;
+}
+
 static int eraser_is_present(WacomDeviceDatabase *db, const int *styli, int nstyli, WacomStylusType type)
 {
 	int i;
@@ -126,6 +145,7 @@ static void verify_tablet(WacomDeviceDatabase *db, WacomDevice *device)
 	assert(libwacom_get_num_strips(device) >= 0);
 	assert(libwacom_get_strips_num_modes(device) >= 0);
 	assert(libwacom_get_bustype(device) != WBUSTYPE_UNKNOWN);
+	assert(buttons_have_direction(device) > 0);
 }
 
 int main(int argc, char **argv)
-- 
1.7.1

------------------------------------------------------------------------------
The Windows 8 Center - In partnership with Sourceforge
Your idea - your app - 30 days.
Get started!
http://windows8center.sourceforge.net/
what-html-developers-need-to-know-about-coding-windows-8-metro-style-apps/
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to