>From 641d75994eaf4d98af0ebf50255edd4e482536b2 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <ofour...@redhat.com>
Date: Mon, 8 Oct 2012 16:00:41 +0200
Subject: [PATCH 1/2] lib: add "Integrated" feature

to describe ISD, integrated system devices.

Not to be confused with "BuiltIn" which denotes screen tablets
(description of libwacom_is_builtin() API is updated to avoid
potential confusion)
---
 libwacom/libwacom-database.c |    3 +++
 libwacom/libwacom.c          |    6 ++++++
 libwacom/libwacom.h          |   11 +++++++++--
 libwacom/libwacomint.h       |    3 ++-
 4 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/libwacom/libwacom-database.c b/libwacom/libwacom-database.c
index d39305d..9699054 100644
--- a/libwacom/libwacom-database.c
+++ b/libwacom/libwacom-database.c
@@ -405,6 +405,9 @@ libwacom_parse_tablet_keyfile(const char *path)
 	if (g_key_file_get_boolean(keyfile, FEATURES_GROUP, "Reversible", NULL))
 		device->features |= FEATURE_REVERSIBLE;
 
+	if (g_key_file_get_boolean(keyfile, FEATURES_GROUP, "Integrated", NULL))
+		device->features |= FEATURE_INTEGRATED;
+
 	if (device->features & FEATURE_BUILTIN &&
 	    device->features & FEATURE_REVERSIBLE)
 		g_warning ("Tablet '%s' is both reversible and builtin. This is impossible", libwacom_get_match(device));
diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
index 4f8c5f9..b384560 100644
--- a/libwacom/libwacom.c
+++ b/libwacom/libwacom.c
@@ -643,6 +643,7 @@ libwacom_print_device_description(int fd, WacomDevice *device)
 
 	dprintf(fd, "[Features]\n");
 	dprintf(fd, "Reversible=%s\n", libwacom_is_reversible(device)	? "true" : "false");
+	dprintf(fd, "Integrated=%s\n",	 libwacom_is_integrated(device)	? "true" : "false");
 	dprintf(fd, "Stylus=%s\n",	 libwacom_has_stylus(device)	? "true" : "false");
 	dprintf(fd, "Ring=%s\n",	 libwacom_has_ring(device)	? "true" : "false");
 	dprintf(fd, "Ring2=%s\n",	 libwacom_has_ring2(device)	? "true" : "false");
@@ -866,6 +867,11 @@ int libwacom_is_reversible(WacomDevice *device)
 	return !!(device->features & FEATURE_REVERSIBLE);
 }
 
+int libwacom_is_integrated(WacomDevice *device)
+{
+	return !!(device->features & FEATURE_INTEGRATED);
+}
+
 WacomBusType libwacom_get_bustype(WacomDevice *device)
 {
 	g_return_val_if_fail(device->match >= 0, -1);
diff --git a/libwacom/libwacom.h b/libwacom/libwacom.h
index 8830db8..370fc10 100644
--- a/libwacom/libwacom.h
+++ b/libwacom/libwacom.h
@@ -456,8 +456,8 @@ int libwacom_get_button_led_group (WacomDevice *device,
 
 /**
  * @param device The tablet to query
- * @return non-zero if the device is built-in or zero if the device is an
- * external tablet
+ * @return non-zero if the device is built into the screen (ie a screen tablet)
+ * or zero if the device is an external tablet
  */
 int libwacom_is_builtin(WacomDevice *device);
 
@@ -470,6 +470,13 @@ int libwacom_is_reversible(WacomDevice *device);
 
 /**
  * @param device The tablet to query
+ * @return non-zero if the device is an integrated system device (ISD) or zero
+ * if the device is a regular tablet
+ */
+int libwacom_is_integrated(WacomDevice *device);
+
+/**
+ * @param device The tablet to query
  * @return The bustype of this device.
  */
 WacomBusType libwacom_get_bustype(WacomDevice *device);
diff --git a/libwacom/libwacomint.h b/libwacom/libwacomint.h
index 55436e9..e30d047 100644
--- a/libwacom/libwacomint.h
+++ b/libwacom/libwacomint.h
@@ -52,7 +52,8 @@ enum WacomFeature {
 	FEATURE_RING		= (1 << 2),
 	FEATURE_RING2		= (1 << 3),
 	FEATURE_BUILTIN		= (1 << 4),
-	FEATURE_REVERSIBLE	= (1 << 5)
+	FEATURE_REVERSIBLE	= (1 << 5),
+	FEATURE_INTEGRATED      = (1 << 6)
 };
 
 /* WARNING: When adding new members to this struct
-- 
1.7.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://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to