Blame SOURCES/wacom-pro-pen-3d.patch

2b60b1
From e71872002edec18a28ff4f2d7e197cf2d2533eeb Mon Sep 17 00:00:00 2001
2b60b1
From: Jason Gerecke <killertofu@gmail.com>
2b60b1
Date: Tue, 10 Oct 2017 07:57:29 -0700
2b60b1
Subject: [PATCH 1/4] wacom: Set combo-topbutton to current value for styli
2b60b1
 with > 2 buttons
2b60b1
2b60b1
Although the Wacom panel doesn't have explicit support for styli with more
2b60b1
than two buttons, it tries to at least allow configuration of the upper and
2b60b1
lower buttons. This commit fixes an incorrect conditional which prevents
2b60b1
the panel from setting the combo box for the upper switch to the current
2b60b1
setting.
2b60b1
2b60b1
https://bugzilla.gnome.org/show_bug.cgi?id=790028
2b60b1
---
2b60b1
 panels/wacom/cc-wacom-stylus-page.c | 2 +-
2b60b1
 1 file changed, 1 insertion(+), 1 deletion(-)
2b60b1
2b60b1
diff --git a/panels/wacom/cc-wacom-stylus-page.c b/panels/wacom/cc-wacom-stylus-page.c
2b60b1
index c3829454e..ff1ea5d13 100644
2b60b1
--- a/panels/wacom/cc-wacom-stylus-page.c
2b60b1
+++ b/panels/wacom/cc-wacom-stylus-page.c
2b60b1
@@ -450,7 +450,7 @@ cc_wacom_stylus_page_new (CcWacomTool *stylus)
2b60b1
 
2b60b1
 	update_stylus_ui (page, layout);
2b60b1
 
2b60b1
-	if (num_buttons == 2)
2b60b1
+	if (num_buttons >= 2)
2b60b1
 		set_button_mapping_from_gsettings (GTK_COMBO_BOX (WID ("combo-topbutton")),
2b60b1
 						   priv->stylus_settings, "secondary-button-action");
2b60b1
 	if (num_buttons >= 1)
2b60b1
-- 
2b60b1
2.17.0
2b60b1
2b60b1
2b60b1
From 60202dcbc4feae2543e0970f53b5cd4936abf140 Mon Sep 17 00:00:00 2001
2b60b1
From: Jason Gerecke <killertofu@gmail.com>
2b60b1
Date: Tue, 10 Oct 2017 07:44:02 -0700
2b60b1
Subject: [PATCH 2/4] wacom: Make remove_buttons dynamic
2b60b1
2b60b1
Both 'remove_buttons' and 'remove_button' perform the same general task and
2b60b1
can be unified into a single function. This makes supporting an arbitrary
2b60b1
number of stylus buttons more straightforward.
2b60b1
2b60b1
https://bugzilla.gnome.org/show_bug.cgi?id=790028
2b60b1
---
2b60b1
 panels/wacom/cc-wacom-stylus-page.c | 35 +++++++++++++----------------
2b60b1
 1 file changed, 15 insertions(+), 20 deletions(-)
2b60b1
2b60b1
diff --git a/panels/wacom/cc-wacom-stylus-page.c b/panels/wacom/cc-wacom-stylus-page.c
2b60b1
index ff1ea5d13..644d5b22a 100644
2b60b1
--- a/panels/wacom/cc-wacom-stylus-page.c
2b60b1
+++ b/panels/wacom/cc-wacom-stylus-page.c
2b60b1
@@ -331,20 +331,17 @@ enum {
2b60b1
 };
2b60b1
 
2b60b1
 static void
2b60b1
-remove_buttons (CcWacomStylusPagePrivate *priv)
2b60b1
+remove_buttons (CcWacomStylusPagePrivate *priv, int n)
2b60b1
 {
2b60b1
-	gtk_widget_destroy (WID ("combo-topbutton"));
2b60b1
-	gtk_widget_destroy (WID ("combo-bottombutton"));
2b60b1
-	gtk_widget_destroy (WID ("label-top-button"));
2b60b1
-	gtk_widget_destroy (WID ("label-lower-button"));
2b60b1
-}
2b60b1
-
2b60b1
-static void
2b60b1
-remove_button (CcWacomStylusPagePrivate *priv)
2b60b1
-{
2b60b1
-	gtk_widget_destroy (WID ("combo-topbutton"));
2b60b1
-	gtk_widget_destroy (WID ("label-top-button"));
2b60b1
-	gtk_label_set_text (GTK_LABEL (WID ("label-lower-button")), _("Button"));
2b60b1
+	if (n < 2) {
2b60b1
+		gtk_widget_destroy (WID ("combo-topbutton"));
2b60b1
+		gtk_widget_destroy (WID ("label-top-button"));
2b60b1
+		gtk_label_set_text (GTK_LABEL (WID ("label-lower-button")), _("Button"));
2b60b1
+	}
2b60b1
+	if (n < 1) {
2b60b1
+		gtk_widget_destroy (WID ("combo-bottombutton"));
2b60b1
+		gtk_widget_destroy (WID ("label-lower-button"));
2b60b1
+	}
2b60b1
 }
2b60b1
 
2b60b1
 static void
2b60b1
@@ -362,10 +359,10 @@ update_stylus_ui (CcWacomStylusPage *page,
2b60b1
 
2b60b1
 	switch (layout) {
2b60b1
 	case LAYOUT_NORMAL:
2b60b1
-		/* easy! */
2b60b1
+		remove_buttons (page->priv, 2);
2b60b1
 		break;
2b60b1
 	case LAYOUT_INKING:
2b60b1
-		remove_buttons (page->priv);
2b60b1
+		remove_buttons (page->priv, 0);
2b60b1
 		remove_eraser (page->priv);
2b60b1
 		gtk_container_child_set (CWID ("stylus-controls-grid"),
2b60b1
 					 WID ("label-tip-feel"),
2b60b1
@@ -375,7 +372,7 @@ update_stylus_ui (CcWacomStylusPage *page,
2b60b1
 					 "top_attach", 0, NULL);
2b60b1
 		break;
2b60b1
 	case LAYOUT_AIRBRUSH:
2b60b1
-		remove_button (page->priv);
2b60b1
+		remove_buttons (page->priv, 1);
2b60b1
 		gtk_container_child_set (CWID ("stylus-controls-grid"),
2b60b1
 					 WID ("label-lower-button"),
2b60b1
 					 "top_attach", 1, NULL);
2b60b1
@@ -390,6 +387,7 @@ update_stylus_ui (CcWacomStylusPage *page,
2b60b1
 					 "top_attach", 2, NULL);
2b60b1
 		break;
2b60b1
 	case LAYOUT_GENERIC_2_BUTTONS_NO_ERASER:
2b60b1
+		remove_buttons (page->priv, 2);
2b60b1
 		remove_eraser (page->priv);
2b60b1
 		break;
2b60b1
 	case LAYOUT_OTHER:
2b60b1
@@ -435,10 +433,7 @@ cc_wacom_stylus_page_new (CcWacomTool *stylus)
2b60b1
 		layout = LAYOUT_GENERIC_2_BUTTONS_NO_ERASER;
2b60b1
 	else {
2b60b1
 		layout = LAYOUT_OTHER;
2b60b1
-		if (num_buttons == 0)
2b60b1
-			remove_buttons (priv);
2b60b1
-		else if (num_buttons == 1)
2b60b1
-			remove_button (priv);
2b60b1
+		remove_buttons (priv, num_buttons);
2b60b1
 
2b60b1
 		/* Gray out eraser if not available */
2b60b1
 		gtk_widget_set_sensitive (WID ("eraser-box"), has_eraser);
2b60b1
-- 
2b60b1
2.17.0
2b60b1
2b60b1
2b60b1
From 6a39001ebcc36fd91d2afc345fa9f6f3b5a7d25b Mon Sep 17 00:00:00 2001
2b60b1
From: Jason Gerecke <killertofu@gmail.com>
2b60b1
Date: Tue, 10 Oct 2017 07:57:49 -0700
2b60b1
Subject: [PATCH 3/4] wacom: Add support for three-button styli
2b60b1
2b60b1
Wacom has introduced its new "Pro Pen 3D" stylus which includes a third
2b60b1
button. This commit adds support for arbitrary three-button styli.
2b60b1
2b60b1
https://bugzilla.gnome.org/show_bug.cgi?id=790028
2b60b1
---
2b60b1
 panels/wacom/cc-wacom-stylus-page.c          |  27 +++-
2b60b1
 panels/wacom/cc-wacom-tool.c                 |  15 +-
2b60b1
 panels/wacom/wacom-stylus-3btn-no-eraser.svg | 132 ++++++++++++++++++
2b60b1
 panels/wacom/wacom-stylus-3btn.svg           | 138 +++++++++++++++++++
2b60b1
 panels/wacom/wacom-stylus-page.ui            |  33 ++++-
2b60b1
 panels/wacom/wacom.gresource.xml             |   2 +
2b60b1
 6 files changed, 341 insertions(+), 6 deletions(-)
2b60b1
 create mode 100644 panels/wacom/wacom-stylus-3btn-no-eraser.svg
2b60b1
 create mode 100644 panels/wacom/wacom-stylus-3btn.svg
2b60b1
2b60b1
diff --git a/panels/wacom/cc-wacom-stylus-page.c b/panels/wacom/cc-wacom-stylus-page.c
2b60b1
index 644d5b22a..8adc7bca7 100644
2b60b1
--- a/panels/wacom/cc-wacom-stylus-page.c
2b60b1
+++ b/panels/wacom/cc-wacom-stylus-page.c
2b60b1
@@ -160,7 +160,8 @@ button_changed_cb (GtkComboBox *combo, gpointer user_data)
2b60b1
 	GtkTreeIter		iter;
2b60b1
 	GtkListStore		*liststore;
2b60b1
 	gint			mapping_b2,
2b60b1
-				mapping_b3;
2b60b1
+				mapping_b3,
2b60b1
+				mapping_b4;
2b60b1
 
2b60b1
 	if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (WID ("combo-bottombutton")), &iter))
2b60b1
 		return;
2b60b1
@@ -181,8 +182,20 @@ button_changed_cb (GtkComboBox *combo, gpointer user_data)
2b60b1
 		mapping_b3 = 0;
2b60b1
 	}
2b60b1
 
2b60b1
+	if (cc_wacom_tool_get_num_buttons (priv->stylus) > 2) {
2b60b1
+		if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (WID ("combo-thirdbutton")), &iter))
2b60b1
+			return;
2b60b1
+
2b60b1
+		gtk_tree_model_get (GTK_TREE_MODEL (liststore), &iter,
2b60b1
+				    BUTTONNUMBER_COLUMN, &mapping_b4,
2b60b1
+				    -1);
2b60b1
+	} else {
2b60b1
+		mapping_b4 = 0;
2b60b1
+	}
2b60b1
+
2b60b1
 	g_settings_set_enum (priv->stylus_settings, "button-action", mapping_b2);
2b60b1
 	g_settings_set_enum (priv->stylus_settings, "secondary-button-action", mapping_b3);
2b60b1
+	g_settings_set_enum (priv->stylus_settings, "tertiary-button-action", mapping_b4);
2b60b1
 }
2b60b1
 
2b60b1
 static void
2b60b1
@@ -299,6 +312,11 @@ cc_wacom_stylus_page_init (CcWacomStylusPage *self)
2b60b1
 	g_signal_connect (G_OBJECT (combo), "changed",
2b60b1
 			  G_CALLBACK (button_changed_cb), self);
2b60b1
 
2b60b1
+	combo = GTK_COMBO_BOX (WID ("combo-thirdbutton"));
2b60b1
+	combobox_text_cellrenderer (combo, BUTTONNAME_COLUMN);
2b60b1
+	g_signal_connect (G_OBJECT (combo), "changed",
2b60b1
+			  G_CALLBACK (button_changed_cb), self);
2b60b1
+
2b60b1
 	priv->nav = cc_wacom_nav_button_new ();
2b60b1
         gtk_widget_set_halign (priv->nav, GTK_ALIGN_END);
2b60b1
         gtk_widget_set_margin_start (priv->nav, 10);
2b60b1
@@ -333,6 +351,10 @@ enum {
2b60b1
 static void
2b60b1
 remove_buttons (CcWacomStylusPagePrivate *priv, int n)
2b60b1
 {
2b60b1
+	if (n < 3) {
2b60b1
+		gtk_widget_destroy (WID ("combo-thirdbutton"));
2b60b1
+		gtk_widget_destroy (WID ("label-third-button"));
2b60b1
+	}
2b60b1
 	if (n < 2) {
2b60b1
 		gtk_widget_destroy (WID ("combo-topbutton"));
2b60b1
 		gtk_widget_destroy (WID ("label-top-button"));
2b60b1
@@ -445,6 +467,9 @@ cc_wacom_stylus_page_new (CcWacomTool *stylus)
2b60b1
 
2b60b1
 	update_stylus_ui (page, layout);
2b60b1
 
2b60b1
+	if (num_buttons >= 3)
2b60b1
+		set_button_mapping_from_gsettings (GTK_COMBO_BOX (WID ("combo-thirdbutton")),
2b60b1
+						   priv->stylus_settings, "tertiary-button-action");
2b60b1
 	if (num_buttons >= 2)
2b60b1
 		set_button_mapping_from_gsettings (GTK_COMBO_BOX (WID ("combo-topbutton")),
2b60b1
 						   priv->stylus_settings, "secondary-button-action");
2b60b1
diff --git a/panels/wacom/cc-wacom-tool.c b/panels/wacom/cc-wacom-tool.c
2b60b1
index 21050875d..7c74e93e5 100644
2b60b1
--- a/panels/wacom/cc-wacom-tool.c
2b60b1
+++ b/panels/wacom/cc-wacom-tool.c
2b60b1
@@ -253,9 +253,18 @@ get_icon_name_from_type (const WacomStylus *wstylus)
2b60b1
 	case WSTYLUS_CLASSIC:
2b60b1
 		return "wacom-stylus-classic";
2b60b1
 	default:
2b60b1
-		if (!libwacom_stylus_has_eraser (wstylus))
2b60b1
-			return "wacom-stylus-no-eraser";
2b60b1
-		return "wacom-stylus";
2b60b1
+		if (!libwacom_stylus_has_eraser (wstylus)) {
2b60b1
+			if (libwacom_stylus_get_num_buttons (wstylus) >= 3)
2b60b1
+				return "wacom-stylus-3btn-no-eraser";
2b60b1
+			else
2b60b1
+				return "wacom-stylus-no-eraser";
2b60b1
+		}
2b60b1
+		else {
2b60b1
+			if (libwacom_stylus_get_num_buttons (wstylus) >= 3)
2b60b1
+				return "wacom-stylus-3btn";
2b60b1
+			else
2b60b1
+				return "wacom-stylus";
2b60b1
+		}
2b60b1
 	}
2b60b1
 }
2b60b1
 
2b60b1
diff --git a/panels/wacom/wacom-stylus-3btn-no-eraser.svg b/panels/wacom/wacom-stylus-3btn-no-eraser.svg
2b60b1
new file mode 100644
2b60b1
index 000000000..60642d7bb
2b60b1
--- /dev/null
2b60b1
+++ b/panels/wacom/wacom-stylus-3btn-no-eraser.svg
2b60b1
@@ -0,0 +1,132 @@
2b60b1
+
2b60b1
+
2b60b1
+
2b60b1
+
2b60b1
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
2b60b1
+   xmlns:cc="http://creativecommons.org/ns#"
2b60b1
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
2b60b1
+   xmlns:svg="http://www.w3.org/2000/svg"
2b60b1
+   xmlns="http://www.w3.org/2000/svg"
2b60b1
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
2b60b1
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
2b60b1
+   id="svg86343"
2b60b1
+   version="1.1"
2b60b1
+   inkscape:version="0.91 r13725"
2b60b1
+   width="148"
2b60b1
+   height="192"
2b60b1
+   sodipodi:docname="wacom-stylus-3btn-no-eraser.svg">
2b60b1
+  
2b60b1
+     id="metadata86349">
2b60b1
+    <rdf:RDF>
2b60b1
+      
2b60b1
+         rdf:about="">
2b60b1
+        <dc:format>image/svg+xml</dc:format>
2b60b1
+        
2b60b1
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
2b60b1
+        <dc:title />
2b60b1
+      </cc:Work>
2b60b1
+    </rdf:RDF>
2b60b1
+  </metadata>
2b60b1
+  
2b60b1
+     id="defs86347" />
2b60b1
+  
2b60b1
+     pagecolor="#ffffff"
2b60b1
+     bordercolor="#666666"
2b60b1
+     borderopacity="1"
2b60b1
+     objecttolerance="10"
2b60b1
+     gridtolerance="10"
2b60b1
+     guidetolerance="10"
2b60b1
+     inkscape:pageopacity="0"
2b60b1
+     inkscape:pageshadow="2"
2b60b1
+     inkscape:window-width="960"
2b60b1
+     inkscape:window-height="1014"
2b60b1
+     id="namedview86345"
2b60b1
+     showgrid="false"
2b60b1
+     inkscape:snap-nodes="false"
2b60b1
+     inkscape:snap-bbox="true"
2b60b1
+     inkscape:zoom="2.4748737"
2b60b1
+     inkscape:cx="176.8759"
2b60b1
+     inkscape:cy="81.687362"
2b60b1
+     inkscape:window-x="1920"
2b60b1
+     inkscape:window-y="27"
2b60b1
+     inkscape:window-maximized="0"
2b60b1
+     inkscape:current-layer="g10631"
2b60b1
+     borderlayer="true"
2b60b1
+     inkscape:showpageshadow="false">
2b60b1
+    
2b60b1
+       type="xygrid"
2b60b1
+       id="grid86802"
2b60b1
+       empspacing="5"
2b60b1
+       visible="true"
2b60b1
+       enabled="true"
2b60b1
+       snapvisiblegridlinesonly="true" />
2b60b1
+  </sodipodi:namedview>
2b60b1
+  
2b60b1
+     style="display:inline"
2b60b1
+     transform="translate(592.43375,-287.62088)"
2b60b1
+     id="g10545">
2b60b1
+    
2b60b1
+       sodipodi:nodetypes="cscscccccccccccccscscc"
2b60b1
+       inkscape:connector-curvature="0"
2b60b1
+       id="rect10526"
2b60b1
+       transform="translate(-928.4063,-95.84375)"
2b60b1
+       d="m 344.125,384.88832 c -1.9944,0 -3.59375,1.59935 -3.59375,3.59375 L 340.53125,516 338,545.125 c -0.1873,2.15512 1.62589,3.92035 3.75,4.125 l 4.625,10.90625 1.53125,0 0,2.15625 3.61536,8.57242 1.18546,0.0214 0.44918,3.78119 0.33938,-3.7414 1.14797,-0.0687 3.76265,-8.53366 0,-2.1875 1.53125,0 4.65625,-10.96875 c 1.96694,-0.35188 3.54637,-2.02216 3.40625,-4.0625 L 365.53125,516 l 0,-127.51793 c 0,-1.9944 -1.59935,-3.59375 -3.59375,-3.59375 z"
2b60b1
+       style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#d3d7cf;fill-opacity:1;fill-rule:nonzero;stroke:#babdb6;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate" />
2b60b1
+    
2b60b1
+       style="color:#000000;fill:#eeeeec;fill-opacity:1;fill-rule:nonzero;stroke:#babdb6;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
2b60b1
+       id="rect10541"
2b60b1
+       width="8.75"
2b60b1
+       height="22"
2b60b1
+       x="-579.65631"
2b60b1
+       y="385.90625"
2b60b1
+       rx="3.25"
2b60b1
+       ry="3.25" />
2b60b1
+    
2b60b1
+       style="color:#000000;fill:#eeeeec;fill-opacity:1;fill-rule:nonzero;stroke:#babdb6;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
2b60b1
+       id="rect10543"
2b60b1
+       width="8.75"
2b60b1
+       height="12.25"
2b60b1
+       x="-579.65631"
2b60b1
+       y="410.90625"
2b60b1
+       rx="3.25"
2b60b1
+       ry="3.2500002" />
2b60b1
+    
2b60b1
+       style="color:#000000;fill:#eeeeec;fill-opacity:1;fill-rule:nonzero;stroke:#babdb6;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
2b60b1
+       id="rect10544"
2b60b1
+       width="8.75"
2b60b1
+       height="8.75"
2b60b1
+       x="-579.65631"
2b60b1
+       y="429.15625"
2b60b1
+       rx="3.25"
2b60b1
+       ry="3.2500002" />
2b60b1
+  </g>
2b60b1
+  
2b60b1
+     style="opacity:0.2;display:inline"
2b60b1
+     id="g10631"
2b60b1
+     transform="translate(592.43375,-302.48416)">
2b60b1
+    
2b60b1
+       style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
2b60b1
+       d="m -571.1563,413.06786 35.28033,0 0,-89.17947 82.46967,0"
2b60b1
+       id="path3342"
2b60b1
+       inkscape:connector-curvature="0"
2b60b1
+       sodipodi:nodetypes="cccc" />
2b60b1
+    
2b60b1
+       style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
2b60b1
+       d="m -571.1563,430.06786 48.28033,0 0,-64.17947 69.46967,0"
2b60b1
+       id="path3344"
2b60b1
+       inkscape:connector-curvature="0"
2b60b1
+       sodipodi:nodetypes="cccc" />
2b60b1
+    
2b60b1
+       style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
2b60b1
+       d="m -571.1563,448.31786 61.28033,0 0,-40.43396 56.46967,0"
2b60b1
+       id="path3344"
2b60b1
+       inkscape:connector-curvature="0"
2b60b1
+       sodipodi:nodetypes="cccc" />
2b60b1
+    
2b60b1
+       style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
2b60b1
+       d="m -575.4063,492.06786 78.53033,0 0,-43.17947 43.46967,0"
2b60b1
+       id="path10629"
2b60b1
+       inkscape:connector-curvature="0"
2b60b1
+       sodipodi:nodetypes="cccc" />
2b60b1
+  </g>
2b60b1
+</svg>
2b60b1
diff --git a/panels/wacom/wacom-stylus-3btn.svg b/panels/wacom/wacom-stylus-3btn.svg
2b60b1
new file mode 100644
2b60b1
index 000000000..2f3db9aa4
2b60b1
--- /dev/null
2b60b1
+++ b/panels/wacom/wacom-stylus-3btn.svg
2b60b1
@@ -0,0 +1,138 @@
2b60b1
+
2b60b1
+
2b60b1
+
2b60b1
+
2b60b1
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
2b60b1
+   xmlns:cc="http://creativecommons.org/ns#"
2b60b1
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
2b60b1
+   xmlns:svg="http://www.w3.org/2000/svg"
2b60b1
+   xmlns="http://www.w3.org/2000/svg"
2b60b1
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
2b60b1
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
2b60b1
+   id="svg86343"
2b60b1
+   version="1.1"
2b60b1
+   inkscape:version="0.48.2 r9819"
2b60b1
+   width="148"
2b60b1
+   height="192"
2b60b1
+   sodipodi:docname="wacom-stylus-3btn.svg">
2b60b1
+  
2b60b1
+     id="metadata86349">
2b60b1
+    <rdf:RDF>
2b60b1
+      
2b60b1
+         rdf:about="">
2b60b1
+        <dc:format>image/svg+xml</dc:format>
2b60b1
+        
2b60b1
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
2b60b1
+        <dc:title />
2b60b1
+      </cc:Work>
2b60b1
+    </rdf:RDF>
2b60b1
+  </metadata>
2b60b1
+  
2b60b1
+     id="defs86347" />
2b60b1
+  
2b60b1
+     pagecolor="#ffffff"
2b60b1
+     bordercolor="#666666"
2b60b1
+     borderopacity="1"
2b60b1
+     objecttolerance="10"
2b60b1
+     gridtolerance="10"
2b60b1
+     guidetolerance="10"
2b60b1
+     inkscape:pageopacity="0"
2b60b1
+     inkscape:pageshadow="2"
2b60b1
+     inkscape:window-width="1280"
2b60b1
+     inkscape:window-height="742"
2b60b1
+     id="namedview86345"
2b60b1
+     showgrid="false"
2b60b1
+     inkscape:snap-nodes="false"
2b60b1
+     inkscape:snap-bbox="true"
2b60b1
+     inkscape:zoom="7"
2b60b1
+     inkscape:cx="93.888956"
2b60b1
+     inkscape:cy="186.10424"
2b60b1
+     inkscape:window-x="0"
2b60b1
+     inkscape:window-y="26"
2b60b1
+     inkscape:window-maximized="1"
2b60b1
+     inkscape:current-layer="svg86343"
2b60b1
+     borderlayer="true"
2b60b1
+     inkscape:showpageshadow="false">
2b60b1
+    
2b60b1
+       type="xygrid"
2b60b1
+       id="grid86802"
2b60b1
+       empspacing="5"
2b60b1
+       visible="true"
2b60b1
+       enabled="true"
2b60b1
+       snapvisiblegridlinesonly="true" />
2b60b1
+  </sodipodi:namedview>
2b60b1
+  
2b60b1
+     style="display:inline"
2b60b1
+     transform="translate(592.43375,-287.62088)"
2b60b1
+     id="g10545">
2b60b1
+    
2b60b1
+       sodipodi:nodetypes="sscsscscccccccccccccscsscsss"
2b60b1
+       inkscape:connector-curvature="0"
2b60b1
+       id="rect10526"
2b60b1
+       transform="translate(-928.4063,-95.84375)"
2b60b1
+       d="m 349.69531,384.96463 c -2.3083,0 -3.2326,1.49535 -3.69531,4.51323 L 345.53125,396 344.125,396 c -1.9944,0 -3.59375,1.59935 -3.59375,3.59375 L 340.53125,516 338,545.125 c -0.1873,2.15512 1.62589,3.92035 3.75,4.125 l 4.625,10.90625 1.53125,0 0,2.15625 3.61536,8.57242 1.18546,0.0214 0.44918,3.78119 0.33938,-3.7414 1.14797,-0.0687 3.76265,-8.53366 0,-2.1875 1.53125,0 4.65625,-10.96875 c 1.96694,-0.35188 3.54637,-2.02216 3.40625,-4.0625 L 365.53125,516 l 0,-116.40625 c 0,-1.9944 -1.59935,-3.59375 -3.59375,-3.59375 l -1.40625,0 L 360,389.47786 c -0.23272,-2.85711 -1.26201,-4.51323 -3.69531,-4.51323 z"
2b60b1
+       style="color:#000000;fill:#d3d7cf;fill-opacity:1;fill-rule:nonzero;stroke:#babdb6;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
2b60b1
+    
2b60b1
+       style="color:#000000;fill:#eeeeec;fill-opacity:1;fill-rule:nonzero;stroke:#babdb6;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
2b60b1
+       id="rect10541"
2b60b1
+       width="8.75"
2b60b1
+       height="22"
2b60b1
+       x="-579.65631"
2b60b1
+       y="385.90625"
2b60b1
+       rx="3.25"
2b60b1
+       ry="3.25" />
2b60b1
+    
2b60b1
+       style="color:#000000;fill:#eeeeec;fill-opacity:1;fill-rule:nonzero;stroke:#babdb6;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
2b60b1
+       id="rect10543"
2b60b1
+       width="8.75"
2b60b1
+       height="12.25"
2b60b1
+       x="-579.65631"
2b60b1
+       y="410.90625"
2b60b1
+       rx="3.25"
2b60b1
+       ry="3.2500002" />
2b60b1
+    
2b60b1
+       style="color:#000000;fill:#eeeeec;fill-opacity:1;fill-rule:nonzero;stroke:#babdb6;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
2b60b1
+       id="rect10544"
2b60b1
+       width="8.75"
2b60b1
+       height="8.75"
2b60b1
+       x="-579.65631"
2b60b1
+       y="429.15625"
2b60b1
+       rx="3.25"
2b60b1
+       ry="3.2500002" />
2b60b1
+  </g>
2b60b1
+  
2b60b1
+     style="opacity:0.2;display:inline"
2b60b1
+     id="g10631"
2b60b1
+     transform="translate(592.43375,-302.48416)">
2b60b1
+    
2b60b1
+       style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
2b60b1
+       d="m -568.1563,309.03125 32.25,0 0,14.85714 82.5,0"
2b60b1
+       id="path10556"
2b60b1
+       inkscape:connector-curvature="0"
2b60b1
+       sodipodi:nodetypes="cccc" />
2b60b1
+    
2b60b1
+       style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
2b60b1
+       d="m -571.1563,413.06786 35.28033,0 0,-52.14286 82.46967,0"
2b60b1
+       id="path10552"
2b60b1
+       inkscape:connector-curvature="0"
2b60b1
+       sodipodi:nodetypes="cccc" />
2b60b1
+    
2b60b1
+       style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
2b60b1
+       d="m -571.1563,430.06786 48.28033,0 0,-27.14286 69.46967,0"
2b60b1
+       id="path86913"
2b60b1
+       inkscape:connector-curvature="0"
2b60b1
+       sodipodi:nodetypes="cccc" />
2b60b1
+    
2b60b1
+       style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
2b60b1
+       d="m -571.1563,448.31786 61.28033,0 0,-3.39286 56.46967,0"
2b60b1
+       id="path3344"
2b60b1
+       inkscape:connector-curvature="0"
2b60b1
+       sodipodi:nodetypes="cccc" />
2b60b1
+    
2b60b1
+       style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
2b60b1
+       d="m -575.4063,492.06786 78.53033,0 0,-5.14286 43.46967,0"
2b60b1
+       id="path10629"
2b60b1
+       inkscape:connector-curvature="0"
2b60b1
+       sodipodi:nodetypes="cccc" />
2b60b1
+  </g>
2b60b1
+</svg>
2b60b1
diff --git a/panels/wacom/wacom-stylus-page.ui b/panels/wacom/wacom-stylus-page.ui
2b60b1
index 6e3cbfb02..b6f152d7f 100644
2b60b1
--- a/panels/wacom/wacom-stylus-page.ui
2b60b1
+++ b/panels/wacom/wacom-stylus-page.ui
2b60b1
@@ -290,6 +290,35 @@
2b60b1
                 <property name="top_attach">2</property>
2b60b1
               </packing>
2b60b1
             </child>
2b60b1
+            <child>
2b60b1
+              <object class="GtkLabel" id="label-third-button">
2b60b1
+                <property name="visible">True</property>
2b60b1
+                <property name="can_focus">False</property>
2b60b1
+                <property name="halign">end</property>
2b60b1
+                <property name="valign">center</property>
2b60b1
+                <property name="label" translatable="yes">Lowest Button</property>
2b60b1
+                <property name="justify">right</property>
2b60b1
+                <style>
2b60b1
+                  <class name="dim-label"/>
2b60b1
+                </style>
2b60b1
+              </object>
2b60b1
+              <packing>
2b60b1
+                <property name="left_attach">0</property>
2b60b1
+                <property name="top_attach">3</property>
2b60b1
+              </packing>
2b60b1
+            </child>
2b60b1
+            <child>
2b60b1
+              <object class="GtkComboBox" id="combo-thirdbutton">
2b60b1
+                <property name="visible">True</property>
2b60b1
+                <property name="can_focus">False</property>
2b60b1
+                <property name="valign">center</property>
2b60b1
+                <property name="model">liststore-buttons</property>
2b60b1
+              </object>
2b60b1
+              <packing>
2b60b1
+                <property name="left_attach">1</property>
2b60b1
+                <property name="top_attach">3</property>
2b60b1
+              </packing>
2b60b1
+            </child>
2b60b1
             <child>
2b60b1
               <object class="GtkLabel" id="label-tip-feel">
2b60b1
                 <property name="visible">True</property>
2b60b1
@@ -304,7 +333,7 @@
2b60b1
               </object>
2b60b1
               <packing>
2b60b1
                 <property name="left_attach">0</property>
2b60b1
-                <property name="top_attach">3</property>
2b60b1
+                <property name="top_attach">4</property>
2b60b1
               </packing>
2b60b1
             </child>
2b60b1
             <child>
2b60b1
@@ -360,7 +389,7 @@
2b60b1
               </object>
2b60b1
               <packing>
2b60b1
                 <property name="left_attach">1</property>
2b60b1
-                <property name="top_attach">3</property>
2b60b1
+                <property name="top_attach">4</property>
2b60b1
               </packing>
2b60b1
             </child>
2b60b1
           </object>
2b60b1
diff --git a/panels/wacom/wacom.gresource.xml b/panels/wacom/wacom.gresource.xml
2b60b1
index 7683b4d38..a18ffb1ed 100644
2b60b1
--- a/panels/wacom/wacom.gresource.xml
2b60b1
+++ b/panels/wacom/wacom.gresource.xml
2b60b1
@@ -6,6 +6,8 @@
2b60b1
     <file preprocess="xml-stripblanks">button-mapping.ui</file>
2b60b1
     <file>wacom-tablet.svg</file>
2b60b1
     <file>wacom-stylus.svg</file>
2b60b1
+    <file>wacom-stylus-3btn-no-eraser.svg</file>
2b60b1
+    <file>wacom-stylus-3btn.svg</file>
2b60b1
     <file>wacom-stylus-no-eraser.svg</file>
2b60b1
     <file>wacom-stylus-airbrush.svg</file>
2b60b1
     <file>wacom-stylus-inking.svg</file>
2b60b1
-- 
2b60b1
2.17.0
2b60b1
2b60b1
2b60b1
From c65f5feb695e7c6737aa60c6e96086e58aa43244 Mon Sep 17 00:00:00 2001
2b60b1
From: Jason Gerecke <killertofu@gmail.com>
2b60b1
Date: Tue, 10 Oct 2017 07:56:17 -0700
2b60b1
Subject: [PATCH 4/4] wacom: Support the WSTYLUS_3D stylus type
2b60b1
2b60b1
Wacom's new "Pro Pen 3D" stylus is declared as a new stylus type within
2b60b1
libwacom: WSTYLUS_3D. Now that the Wacom panel supports arbitrary three-
2b60b1
button styli, we can add specific support for this new stylus type to
2b60b1
suppress the warning message that is generated.
2b60b1
2b60b1
https://bugzilla.gnome.org/show_bug.cgi?id=790028
2b60b1
---
2b60b1
 panels/wacom/cc-wacom-stylus-page.c | 7 +++++++
2b60b1
 panels/wacom/cc-wacom-tool.c        | 6 ++++++
2b60b1
 2 files changed, 13 insertions(+)
2b60b1
2b60b1
diff --git a/panels/wacom/cc-wacom-stylus-page.c b/panels/wacom/cc-wacom-stylus-page.c
2b60b1
index 8adc7bca7..56aeeef3a 100644
2b60b1
--- a/panels/wacom/cc-wacom-stylus-page.c
2b60b1
+++ b/panels/wacom/cc-wacom-stylus-page.c
2b60b1
@@ -345,6 +345,7 @@ enum {
2b60b1
 	LAYOUT_INKING,                      /* tip */
2b60b1
 	LAYOUT_AIRBRUSH,                    /* eraser, 1 button, tip */
2b60b1
 	LAYOUT_GENERIC_2_BUTTONS_NO_ERASER, /* 2 buttons, tip, no eraser */
2b60b1
+	LAYOUT_3DPEN,                       /* 3 buttons, tip, no eraser */
2b60b1
 	LAYOUT_OTHER
2b60b1
 };
2b60b1
 
2b60b1
@@ -412,6 +413,10 @@ update_stylus_ui (CcWacomStylusPage *page,
2b60b1
 		remove_buttons (page->priv, 2);
2b60b1
 		remove_eraser (page->priv);
2b60b1
 		break;
2b60b1
+	case LAYOUT_3DPEN:
2b60b1
+		remove_buttons (page->priv, 3);
2b60b1
+		remove_eraser (page->priv);
2b60b1
+		break;
2b60b1
 	case LAYOUT_OTHER:
2b60b1
 		/* We already warn about it in cc_wacom_stylus_page_new () */
2b60b1
 		break;
2b60b1
@@ -453,6 +458,8 @@ cc_wacom_stylus_page_new (CcWacomTool *stylus)
2b60b1
 		layout = LAYOUT_AIRBRUSH;
2b60b1
 	else if (num_buttons == 2 && !has_eraser)
2b60b1
 		layout = LAYOUT_GENERIC_2_BUTTONS_NO_ERASER;
2b60b1
+	else if (num_buttons == 3 && !has_eraser)
2b60b1
+		layout = LAYOUT_3DPEN;
2b60b1
 	else {
2b60b1
 		layout = LAYOUT_OTHER;
2b60b1
 		remove_buttons (priv, num_buttons);
2b60b1
diff --git a/panels/wacom/cc-wacom-tool.c b/panels/wacom/cc-wacom-tool.c
2b60b1
index 7c74e93e5..1330c8dc8 100644
2b60b1
--- a/panels/wacom/cc-wacom-tool.c
2b60b1
+++ b/panels/wacom/cc-wacom-tool.c
2b60b1
@@ -18,8 +18,12 @@
2b60b1
  *
2b60b1
  */
2b60b1
 
2b60b1
+#include "config.h"
2b60b1
+
2b60b1
 #include "cc-wacom-tool.h"
2b60b1
 
2b60b1
+#define WSTYLUS_3D 8
2b60b1
+
2b60b1
 enum {
2b60b1
 	PROP_0,
2b60b1
 	PROP_SERIAL,
2b60b1
@@ -252,6 +256,8 @@ get_icon_name_from_type (const WacomStylus *wstylus)
2b60b1
 		return "wacom-stylus-art-pen";
2b60b1
 	case WSTYLUS_CLASSIC:
2b60b1
 		return "wacom-stylus-classic";
2b60b1
+	case WSTYLUS_3D:
2b60b1
+		return "wacom-stylus-3btn-no-eraser";
2b60b1
 	default:
2b60b1
 		if (!libwacom_stylus_has_eraser (wstylus)) {
2b60b1
 			if (libwacom_stylus_get_num_buttons (wstylus) >= 3)
2b60b1
-- 
2b60b1
2.17.0
2b60b1