rpms/linuxwacom/devel linuxwacom-0.8.2.2-hal-setup.patch, NONE, 1.1 10-linuxwacom.fdi, 1.6, 1.7 linuxwacom.spec, 1.75, 1.76

Matthew Garrett mjg59 at fedoraproject.org
Sat Mar 7 17:40:31 UTC 2009


Author: mjg59

Update of /cvs/pkgs/rpms/linuxwacom/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv2903

Modified Files:
	10-linuxwacom.fdi linuxwacom.spec 
Added Files:
	linuxwacom-0.8.2.2-hal-setup.patch 
Log Message:
* Sat Mar 10 2009 Matthew Garrett <mjg at redhat.com> 0.8.2.2-8
- linuxwacom-0.8.2.2-hal-setup.patch: Add a hal callout to set up secondary
  input types
- 10-linuxwacom.fdi: Add support for the callout


linuxwacom-0.8.2.2-hal-setup.patch:

--- NEW FILE linuxwacom-0.8.2.2-hal-setup.patch ---
--- linuxwacom-0.8.2-2.orig/configure.in	2009-03-07 16:36:22.000000000 +0000
+++ linuxwacom-0.8.2-2/configure.in	2009-03-07 16:54:20.000000000 +0000
@@ -421,6 +421,11 @@
 else
 	AM_CONDITIONAL(WCM_ENV_XFREE86, false)
 fi
+
+PKG_CHECK_MODULES(HAL, [hal])
+AC_SUBST([HAL_CFLAGS])
+AC_SUBST([HAL_LIBS])
+
 dnl Check for X.org SDK
 if test "$WCM_ENV_XFREE86" != yes; then
 	AC_ARG_WITH(xorg-sdk,
--- linuxwacom-0.8.2-2.orig/src/util/Makefile.am	2009-01-19 18:58:37.000000000 +0000
+++ linuxwacom-0.8.2-2/src/util/Makefile.am	2009-03-07 16:57:38.000000000 +0000
@@ -5,7 +5,7 @@
 wacomcfg_HEADERS = wacomcfg.h
 
 if WCM_ENV_XORGSDK
-WACOMCFG_INCLUDES = -I$(WCM_XORGSDK_DIR) $(X_CFLAGS)
+WACOMCFG_INCLUDES = -I$(WCM_XORGSDK_DIR) $(X_CFLAGS) $(HAL_CFLAGS)
 endif
 
 if WCM_ENV_XFREE86
@@ -17,7 +17,8 @@
 # These identify which programs, libraries, and headers could
 # potentially be built or installed depending on the results of
 # the configuration.
-EXTRA_PROGRAMS = wacdump xidump xsetwacom 
+EXTRA_PROGRAMS = wacdump xidump xsetwacom
+libexec_PROGRAMS = hal-setup-wacom
 
 # Source dependencies
 wacdump_SOURCES = wacdump.c wacscrn.c wacscrn.h \
@@ -40,3 +41,6 @@
 
 xsetwacom_SOURCES = xsetwacom.c wacomcfg.h wcmAction.c wcmAction.h ../include/Xwacom.h
 xsetwacom_LDADD = libwacomcfg.la
+
+hal_setup_wacom_SOURCES = hal-setup-wacom.c
+hal_setup_wacom_LDADD = $(HAL_LIBS)
\ No newline at end of file
--- linuxwacom-0.8.2-2.orig/src/util/hal-setup-wacom.c	1970-01-01 01:00:00.000000000 +0100
+++ linuxwacom-0.8.2-2/src/util/hal-setup-wacom.c	2009-03-06 04:05:30.000000000 +0000
@@ -0,0 +1,156 @@
+/*
+ * Licensed under the GNU General Public License Version 2
+ *
+ * Copyright (C) 2009 Red Hat <mjg at redhat.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+
+#include <hal/libhal.h>
+
+static LibHalContext *ctx = NULL;
+static char* udi;
+
+int
+main (int argc, char **argv)
+{
+	char *device;
+	char *newudi;
+	char *forcedev;
+	char *name;
+	char *subname;
+	char **types;
+	int i;
+	DBusError error;
+
+	udi = getenv ("UDI");
+	if (udi == NULL) {
+		fprintf (stderr, "hal-setup-wacom: Failed to get UDI\n");
+		return 1;
+	}
+
+	asprintf (&newudi, "%s_subdev", udi);
+
+	dbus_error_init (&error);
+	if ((ctx = libhal_ctx_init_direct (&error)) == NULL) {
+		fprintf (stderr, "hal-setup-wacom: Unable to initialise libhal context: %s\n", error.message);
+		return 1;
+	}
+
+	dbus_error_init (&error);
+	if (!libhal_device_addon_is_ready (ctx, udi, &error)) {
+		return 1;
+	}
+
+	dbus_error_init (&error);
+
+	/* get the device */
+	device = libhal_device_get_property_string (ctx, udi, "input.device",
+						    &error);
+	if (dbus_error_is_set (&error) == TRUE) {
+		fprintf (stderr,
+			 "hal-setup-wacom: Failed to get input device: '%s'\n",
+			 error.message);
+		return 1;
+	}
+
+	/* Is there a forcedevice? */
+	dbus_error_init (&error);
+	forcedev = libhal_device_get_property_string
+		(ctx, udi, "input.x11_options.ForceDevice", &error);
+
+	dbus_error_init (&error);
+	name = libhal_device_get_property_string (ctx, udi, "info.product",
+						  &error);
+
+	dbus_error_init (&error);
+	types = libhal_device_get_property_strlist (ctx, udi, "wacom.types",
+						    &error);
+
+	if (dbus_error_is_set (&error) == TRUE) {
+		fprintf (stderr,
+			 "hal-setup-wacom: Failed to get wacom types: '%s'\n",
+			 error.message);
+		return 1;
+	}
+
+	/* Set up the extra devices */
+	for (i=0; types[i] != NULL; i++) {
+		char *tmpdev;
+
+		dbus_error_init (&error);
+		tmpdev = libhal_new_device(ctx, &error);
+		if (dbus_error_is_set (&error) == TRUE) {
+			fprintf (stderr,
+				 "hal-setup-wacom: Failed to create input device: '%s'\n",
+				 error.message);
+			return 1;
+		}
+		dbus_error_init (&error);
+		libhal_device_set_property_string (ctx, tmpdev, "input.device",
+						   device, &error);
+		dbus_error_init (&error);
+		libhal_device_set_property_string (ctx, tmpdev,
+						   "input.x11_driver", "wacom",
+						   &error);
+		dbus_error_init (&error);
+		libhal_device_set_property_string (ctx, tmpdev,
+						   "input.x11_options.Type",
+						   types[i], &error);
+		dbus_error_init (&error);
+		libhal_device_set_property_string (ctx, tmpdev, "info.parent",
+						   udi, &error);
+		dbus_error_init (&error);
+		libhal_device_property_strlist_append (ctx, tmpdev,
+						       "info.capabilities",
+						       "input", &error);
+		if (forcedev) {
+			dbus_error_init (&error);
+			libhal_device_set_property_string (ctx, tmpdev,
+							   "input.x11_options.ForceDevice",
+							   forcedev, &error);
+		}
+		if (name) {
+			dbus_error_init (&error);
+			asprintf (&subname, "%s %s", name, types[i]);
+			libhal_device_set_property_string (ctx, tmpdev,
+							   "info.product",
+							   subname, &error);
+			free (subname);
+		}
+		dbus_error_init (&error);
+		libhal_device_commit_to_gdl (ctx, tmpdev, newudi, &error);
+
+		if (dbus_error_is_set (&error) == TRUE) {
+			fprintf (stderr,
+				 "hal-setup-wacom: Failed to add input device: '%s'\n",
+				 error.message);
+			return 1;
+		}
+	}
+
+	return 0;
+}
+


Index: 10-linuxwacom.fdi
===================================================================
RCS file: /cvs/pkgs/rpms/linuxwacom/devel/10-linuxwacom.fdi,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- 10-linuxwacom.fdi	4 Mar 2009 14:32:56 -0000	1.6
+++ 10-linuxwacom.fdi	7 Mar 2009 17:40:01 -0000	1.7
@@ -5,27 +5,26 @@
     <match key="info.category" contains="input">
       <match key="info.product" contains="Wacom">
 	<merge key="input.x11_driver" type="string">wacom</merge>
-        <!-- Wacom isn't yet suited well for hotplugging, as we need three
-             devices off one kernel device, but HAL only reports this device
-             once. This needs fixing in the driver.
-             Use stylus by default for this single device, if you want erasor
-             or cursor, specify in the line below.  -->
 	<merge key="input.x11_options.Type" type="string">stylus</merge>
+	<append key="info.callouts.add" type="strlist">hal-setup-wacom</append>
+	<append key="wacom.types" type="strlist">eraser</append>
+	<append key="wacom.types" type="strlist">cursor</append>
+	<append key="wacom.types" type="strlist">pad</append>
       </match>
     </match>
     <match key="info.capabilities" contains="serial">
       <match key="@info.parent:pnp.id" contains_outof="WACf001;WACf002;WACf003;WACf004;WACf005;WACf006;WACf007;WACf008;WACf009;WACf00a;WACf00b;WACf00c;FUJ02e5">
 	<append key="info.capabilities" type="strlist">input</append>
 	<merge key="input.x11_driver" type="string">wacom</merge>
-        <!-- Wacom isn't yet suited well for hotplugging, as we need three
-             devices off one kernel device, but HAL only reports this device
-             once. This needs fixing in the driver.
-             Use stylus by default for this single device, if you want erasor
-             or cursor, specify in the line below.  -->
 	<merge key="input.x11_options.Type" type="string">stylus</merge>
 	<merge key="input.x11_options.ForceDevice" type="string">ISDV4</merge>
-	<merge key="input.x11_options.Device" type="copy_property">serial.device</merge>
 	<merge key="input.device" type="copy_property">serial.device</merge>
+	<append key="info.callouts.add" type="strlist">hal-setup-wacom</append>
+	<append key="wacom.types" type="strlist">eraser</append>
+        <match key="@info.parent:pnp.id" contains_outof="WACf008;WACf009">
+	  <!-- Serial tablets with touch capabilities -->
+	  <append key="wacom.types" type="strlist">touch</append>
+	</match>
       </match>
     </match>
   </device>
@@ -35,12 +34,10 @@
       <match key="info.product" contains="WACOM">
         <match key="info.product" contains="Tablet">
           <merge key="input.x11_driver" type="string">wacom</merge>
-          <!-- Wacom isn't yet suited well for hotplugging, as we need three
-               devices off one kernel device, but HAL only reports this device
-               once. This needs fixing in the driver.
-               Use stylus by default for this single device, if you want erasor
-               or cursor, specify in the line below.  -->
           <merge key="input.x11_options.Type" type="string">stylus</merge>
+	  <append key="info.callouts.add" type="strlist">hal-setup-wacom</append>
+	  <append key="wacom.types" type="strlist">eraser</append>
+	  <append key="wacom.types" type="strlist">cursor</append>
         </match>
       </match>
     </match>


Index: linuxwacom.spec
===================================================================
RCS file: /cvs/pkgs/rpms/linuxwacom/devel/linuxwacom.spec,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -r1.75 -r1.76
--- linuxwacom.spec	4 Mar 2009 14:32:56 -0000	1.75
+++ linuxwacom.spec	7 Mar 2009 17:40:01 -0000	1.76
@@ -3,7 +3,7 @@
 # Upstream's versioning is goofy.  Note the mapping from tarname to version.
 Name:		linuxwacom
 Version:	0.8.2.2
-Release:	7%{?dist}
+Release:	8%{?dist}
 Summary:	Wacom Drivers from Linux Wacom Project
 
 Group:		User Interface/X Hardware Support
@@ -19,11 +19,13 @@
 Patch5:		linuxwacom-0.8.2.2-export-module.patch
 Patch6:		linuxwacom-0.8.2.2-HAL.patch
 Patch7:		linuxwacom-0.8.2.2-wcmMaxX.patch
+Patch8:		linuxwacom-0.8.2.2-hal-setup.patch
 
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}
 BuildRequires:	libX11-devel libXi-devel ncurses-devel
 BuildRequires:  xorg-x11-server-devel >= 1.5.99.1
 BuildRequires:  autoconf automake libtool xorg-x11-server-Xorg
+BuildRequires:  hal-devel
 Requires:	xorg-x11-server-Xorg >= 1.5.99.1, udev >= 030-21
 ExclusiveArch:  %{ix86} x86_64 alpha ia64 ppc ppc64 sparcv9 sparc64
 
@@ -52,6 +54,7 @@
 %patch5 -p1
 %patch6 -p1
 %patch7 -p1
+%patch8 -p1
 
 %build
 
@@ -100,6 +103,7 @@
 %{_bindir}/wacdump
 %{_bindir}/xidump
 %{_bindir}/xsetwacom
+%{_libexecdir}/hal-setup-wacom
 %{_datadir}/hal/fdi/policy/20thirdparty/10-linuxwacom.fdi
 %{_libdir}/libwacomcfg*so.*
 %{_mandir}/man4/wacom.4*
@@ -113,6 +117,11 @@
 %{_libdir}/libwacomcfg*.so
 
 %changelog
+* Sat Mar 10 2009 Matthew Garrett <mjg at redhat.com> 0.8.2.2-8
+- linuxwacom-0.8.2.2-hal-setup.patch: Add a hal callout to set up secondary
+  input types
+- 10-linuxwacom.fdi: Add support for the callout
+
 * Wed Mar 04 2009 Adam Jackson <ajax at redhat.com> 0.8.2.2-7
 - 10-linuxwacom.fdi: "info.product", not "info,product".
 




More information about the fedora-extras-commits mailing list