Commit f57a1925 authored by Jason Gerecke's avatar Jason Gerecke Committed by Carlos Garnacho

wacom: Support the WSTYLUS_3D stylus type

Wacom's new "Pro Pen 3D" stylus is declared as a new stylus type within
libwacom: WSTYLUS_3D. Now that the Wacom panel supports arbitrary three-
button styli, we can add specific support for this new stylus type to
suppress the warning message that is generated.

https://bugzilla.gnome.org/show_bug.cgi?id=790028
parent 039f30a5
......@@ -205,11 +205,15 @@ if host_is_linux_not_s390
# Wacom
assert(clutter_gtk_dep.found(), 'clutter-gtk library is required for wacom support, but is not available.')
libwacom_dep = dependency('libwacom', version: '>= 0.7')
wacom_deps = [
clutter_gtk_dep,
libwacom_dep,
dependency('clutter-1.0', version: '>= 1.11.3'),
dependency('libwacom', version: '>= 0.7')
]
config_h.set('HAVE_WACOM_3D_STYLUS', libwacom_dep.version().version_compare('>= 0.27'),
description: 'Define to 1 if libwacom provides definition for 3D styli')
else
message('Bluetooth and Wacom panels will not be built (no USB support on this platform)')
endif
......
......@@ -345,6 +345,7 @@ enum {
LAYOUT_INKING, /* tip */
LAYOUT_AIRBRUSH, /* eraser, 1 button, tip */
LAYOUT_GENERIC_2_BUTTONS_NO_ERASER, /* 2 buttons, tip, no eraser */
LAYOUT_3DPEN, /* 3 buttons, tip, no eraser */
LAYOUT_OTHER
};
......@@ -412,6 +413,10 @@ update_stylus_ui (CcWacomStylusPage *page,
remove_buttons (page->priv, 2);
remove_eraser (page->priv);
break;
case LAYOUT_3DPEN:
remove_buttons (page->priv, 3);
remove_eraser (page->priv);
break;
case LAYOUT_OTHER:
/* We already warn about it in cc_wacom_stylus_page_new () */
break;
......@@ -453,6 +458,8 @@ cc_wacom_stylus_page_new (CcWacomTool *stylus)
layout = LAYOUT_AIRBRUSH;
else if (num_buttons == 2 && !has_eraser)
layout = LAYOUT_GENERIC_2_BUTTONS_NO_ERASER;
else if (num_buttons == 3 && !has_eraser)
layout = LAYOUT_3DPEN;
else {
layout = LAYOUT_OTHER;
remove_buttons (priv, num_buttons);
......
......@@ -18,6 +18,8 @@
*
*/
#include "config.h"
#include "cc-wacom-tool.h"
enum {
......@@ -252,6 +254,10 @@ get_icon_name_from_type (const WacomStylus *wstylus)
return "wacom-stylus-art-pen";
case WSTYLUS_CLASSIC:
return "wacom-stylus-classic";
#ifdef HAVE_WACOM_3D_STYLUS
case WSTYLUS_3D:
return "wacom-stylus-3btn-no-eraser";
#endif
default:
if (!libwacom_stylus_has_eraser (wstylus)) {
if (libwacom_stylus_get_num_buttons (wstylus) >= 3)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment