[gnome-settings-daemon] wacom: Print the number of buttons on stylus
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] wacom: Print the number of buttons on stylus
- Date: Mon, 16 Jan 2012 17:30:38 +0000 (UTC)
commit 576a47621cab9717108be144791f97310babc955
Author: Bastien Nocera <hadess hadess net>
Date: Mon Jan 16 17:07:10 2012 +0000
wacom: Print the number of buttons on stylus
plugins/wacom/list-wacom.c | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/plugins/wacom/list-wacom.c b/plugins/wacom/list-wacom.c
index b7b4a88..150e823 100644
--- a/plugins/wacom/list-wacom.c
+++ b/plugins/wacom/list-wacom.c
@@ -144,8 +144,22 @@ list_devices (GList *devices)
g_print ("\t\tIcon name: %s\n", gsd_wacom_stylus_get_icon_name (stylus));
- if (gsd_wacom_device_get_device_type (device) == WACOM_TYPE_STYLUS)
+ if (gsd_wacom_device_get_device_type (device) == WACOM_TYPE_STYLUS) {
+ int num_buttons;
+ char *buttons;
+
g_print ("\t\tHas Eraser: %s\n", BOOL_AS_STR(gsd_wacom_stylus_get_has_eraser (stylus)));
+
+ num_buttons = gsd_wacom_stylus_get_num_buttons (stylus);
+ if (num_buttons < 0)
+ num_buttons = 2;
+ if (num_buttons > 0)
+ buttons = g_strdup_printf ("%d buttons", num_buttons);
+ else
+ buttons = g_strdup ("no button");
+ g_print ("\t\tButtons: %s\n", buttons);
+ g_free (buttons);
+ }
}
g_list_free (styli);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]