[gnome-settings-daemon] wacom: use the new libwacom integration API
- From: Olivier Fourdan <ofourdan src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] wacom: use the new libwacom integration API
- Date: Thu, 20 Dec 2012 09:17:50 +0000 (UTC)
commit 4aa83b2439318d55b765269299182e190136bfaa
Author: Olivier Fourdan <ofourdan redhat com>
Date: Mon Dec 3 16:34:39 2012 +0100
wacom: use the new libwacom integration API
libwacom 0.7 introduced a new API to identify ISD,
Integrated System Devices.
Add a new field in the device definition and API to
identify ISD.
https://bugzilla.gnome.org/show_bug.cgi?id=689687
plugins/wacom/gsd-wacom-device.c | 16 ++++++++++++++--
plugins/wacom/gsd-wacom-device.h | 1 +
plugins/wacom/list-wacom.c | 1 +
3 files changed, 16 insertions(+), 2 deletions(-)
---
diff --git a/plugins/wacom/gsd-wacom-device.c b/plugins/wacom/gsd-wacom-device.c
index bcc4154..c92f153 100644
--- a/plugins/wacom/gsd-wacom-device.c
+++ b/plugins/wacom/gsd-wacom-device.c
@@ -331,6 +331,7 @@ struct GsdWacomDevicePrivate
char *tool_name;
gboolean reversible;
gboolean is_screen_tablet;
+ gboolean is_isd; /* integrated system device */
gboolean is_fallback;
GList *styli;
GsdWacomStylus *last_stylus;
@@ -1321,6 +1322,7 @@ gsd_wacom_device_update_from_db (GsdWacomDevice *device,
const char *identifier)
{
char *settings_path;
+ WacomIntegrationFlags integration_flags;
settings_path = g_strdup_printf (WACOM_DEVICE_CONFIG_BASE,
device->priv->machine_id,
@@ -1330,9 +1332,11 @@ gsd_wacom_device_update_from_db (GsdWacomDevice *device,
device->priv->name = g_strdup (libwacom_get_name (wacom_device));
device->priv->reversible = libwacom_is_reversible (wacom_device);
- device->priv->is_screen_tablet = libwacom_is_builtin (wacom_device);
+ integration_flags = libwacom_get_integration_flags (wacom_device);
+ device->priv->is_screen_tablet = (integration_flags & WACOM_DEVICE_INTEGRATED_DISPLAY);
+ device->priv->is_isd = (integration_flags & WACOM_DEVICE_INTEGRATED_SYSTEM);
if (device->priv->is_screen_tablet) {
- if (libwacom_get_class (wacom_device) == WCLASS_CINTIQ)
+ if (!device->priv->is_isd)
device->priv->icon_name = "wacom-tablet-cintiq";
else
device->priv->icon_name = "wacom-tablet-pc";
@@ -1665,6 +1669,14 @@ gsd_wacom_device_is_screen_tablet (GsdWacomDevice *device)
}
gboolean
+gsd_wacom_device_is_isd (GsdWacomDevice *device)
+{
+ g_return_val_if_fail (GSD_IS_WACOM_DEVICE (device), FALSE);
+
+ return device->priv->is_isd;
+}
+
+gboolean
gsd_wacom_device_is_fallback (GsdWacomDevice *device)
{
g_return_val_if_fail (GSD_IS_WACOM_DEVICE (device), FALSE);
diff --git a/plugins/wacom/gsd-wacom-device.h b/plugins/wacom/gsd-wacom-device.h
index d68353e..1c20c6c 100644
--- a/plugins/wacom/gsd-wacom-device.h
+++ b/plugins/wacom/gsd-wacom-device.h
@@ -143,6 +143,7 @@ const char * gsd_wacom_device_get_icon_name (GsdWacomDevice *device);
const char * gsd_wacom_device_get_tool_name (GsdWacomDevice *device);
gboolean gsd_wacom_device_reversible (GsdWacomDevice *device);
gboolean gsd_wacom_device_is_screen_tablet (GsdWacomDevice *device);
+gboolean gsd_wacom_device_is_isd (GsdWacomDevice *device);
gboolean gsd_wacom_device_is_fallback (GsdWacomDevice *device);
gint gsd_wacom_device_get_num_strips (GsdWacomDevice *device);
gint gsd_wacom_device_get_num_rings (GsdWacomDevice *device);
diff --git a/plugins/wacom/list-wacom.c b/plugins/wacom/list-wacom.c
index 76f462b..0c1672d 100644
--- a/plugins/wacom/list-wacom.c
+++ b/plugins/wacom/list-wacom.c
@@ -197,6 +197,7 @@ list_devices (GList *devices)
gsd_wacom_device_type_to_string (gsd_wacom_device_get_device_type (device)));
g_print ("\tReversible: %s\n", BOOL_AS_STR (gsd_wacom_device_reversible (device)));
g_print ("\tScreen Tablet: %s\n", BOOL_AS_STR (gsd_wacom_device_is_screen_tablet (device)));
+ g_print ("\tIntegrated Device: %s\n", BOOL_AS_STR (gsd_wacom_device_is_isd (device)));
g_print ("\tUnknown (fallback) device: %s\n", BOOL_AS_STR(gsd_wacom_device_is_fallback (device)));
loc = get_loc (gsd_wacom_device_get_settings (device));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]