Drop a couple of unused patches
This commit is contained in:
parent
ee0d993232
commit
12385e2f03
@ -1,27 +0,0 @@
|
||||
commit 952a58a5f0c50c461d079788c9102bf4a09357c3
|
||||
Author: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Fri Feb 24 11:19:01 2012 +0100
|
||||
|
||||
Add Bamboo One definition
|
||||
|
||||
diff --git a/data/bamboo-one.tablet b/data/bamboo-one.tablet
|
||||
new file mode 100644
|
||||
index 0000000..67f0114
|
||||
--- /dev/null
|
||||
+++ b/data/bamboo-one.tablet
|
||||
@@ -0,0 +1,15 @@
|
||||
+[Device]
|
||||
+# Bamboo One (CTF-430/SO-B)
|
||||
+Name=Bamboo One
|
||||
+DeviceMatch=usb:056a:0069
|
||||
+Width=5.0
|
||||
+Height=3.6
|
||||
+
|
||||
+[Features]
|
||||
+Reversible=true
|
||||
+Stylus=true
|
||||
+Touch=false
|
||||
+Ring=false
|
||||
+NumStrips=0
|
||||
+Buttons=0
|
||||
+BuiltIn=false
|
||||
@ -1,64 +0,0 @@
|
||||
commit 93dc2413517f4c7760e6218143bad6eec59cfd71
|
||||
Author: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Fri Feb 24 11:56:57 2012 +0100
|
||||
|
||||
lib: Add API to list all items in the database
|
||||
|
||||
diff --git a/libwacom/libwacom-database.c b/libwacom/libwacom-database.c
|
||||
index b30cc10..c9f31b6 100644
|
||||
--- a/libwacom/libwacom-database.c
|
||||
+++ b/libwacom/libwacom-database.c
|
||||
@@ -466,4 +466,29 @@ libwacom_database_destroy(WacomDeviceDatabase *db)
|
||||
g_free (db);
|
||||
}
|
||||
|
||||
+WacomDevice**
|
||||
+libwacom_list_devices_from_database(WacomDeviceDatabase *db, WacomError *error)
|
||||
+{
|
||||
+ GList *cur, *devices;
|
||||
+ WacomDevice **list, **p;
|
||||
+
|
||||
+ if (!db) {
|
||||
+ libwacom_error_set(error, WERROR_INVALID_DB, "db is NULL");
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ devices = g_hash_table_get_values (db->device_ht);
|
||||
+ list = calloc (g_list_length (devices) + 1, sizeof (WacomDevice *));
|
||||
+ if (!list) {
|
||||
+ libwacom_error_set(error, WERROR_BAD_ALLOC, "Memory allocation failed");
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ for (p = list, cur = devices; cur; cur = g_list_next (cur))
|
||||
+ *p++ = (WacomDevice *) cur->data;
|
||||
+ g_list_free (devices);
|
||||
+
|
||||
+ return list;
|
||||
+}
|
||||
+
|
||||
/* vim: set noexpandtab tabstop=8 shiftwidth=8: */
|
||||
diff --git a/libwacom/libwacom.h b/libwacom/libwacom.h
|
||||
index b1122eb..4f537c4 100644
|
||||
--- a/libwacom/libwacom.h
|
||||
+++ b/libwacom/libwacom.h
|
||||
@@ -244,6 +244,19 @@ WacomDevice* libwacom_new_from_usbid(WacomDeviceDatabase *db, int vendor_id, int
|
||||
WacomDevice* libwacom_new_from_name(WacomDeviceDatabase *db, const char *name, WacomError *error);
|
||||
|
||||
/**
|
||||
+ * Returns the list of devices in the given database.
|
||||
+ *
|
||||
+ * @param db A device database
|
||||
+ * @param error If not NULL, set to the error if any occurs
|
||||
+ *
|
||||
+ * @return A NULL terminated list of pointers to all the devices inside the
|
||||
+ * database.
|
||||
+ * The content of the list is owned by the database and should not be
|
||||
+ * modified of freed. Use free() to free the list.
|
||||
+ */
|
||||
+WacomDevice** libwacom_list_devices_from_database(WacomDeviceDatabase *db, WacomError *error);
|
||||
+
|
||||
+/**
|
||||
* Remove the device and free all memory and references to it.
|
||||
*
|
||||
* @param device The device to delete
|
||||
@ -1,127 +0,0 @@
|
||||
commit 8f1d640b4e8416c181b3a08b697aaac67ba6005a
|
||||
Author: Olivier Fourdan <ofourdan@redhat.com>
|
||||
Date: Fri Feb 24 12:05:19 2012 +0100
|
||||
|
||||
data: Add tool to generate udev rules from the DB
|
||||
|
||||
diff --git a/data/Makefile.am b/data/Makefile.am
|
||||
index 9f2e8d2..c307b6d 100644
|
||||
--- a/data/Makefile.am
|
||||
+++ b/data/Makefile.am
|
||||
@@ -4,4 +4,10 @@ dist_libwacomtablet_DATA = $(shell find $(top_srcdir)/data -name "*.tablet" -pr
|
||||
libwacomstylusdir = $(datadir)/libwacom
|
||||
dist_libwacomstylus_DATA = $(shell find $(top_srcdir)/data -name "*.stylus" -printf "%P\n")
|
||||
|
||||
+INCLUDES=-I$(top_srcdir)/libwacom -DTOPSRCDIR="\"$(top_srcdir)\""
|
||||
+
|
||||
+noinst_PROGRAMS = list
|
||||
+list_SOURCES = list.c
|
||||
+list_LDADD=$(top_builddir)/libwacom/libwacom.la
|
||||
+
|
||||
EXTRA_DIST = wacom.example
|
||||
diff --git a/data/list.c b/data/list.c
|
||||
new file mode 100644
|
||||
index 0000000..de3986f
|
||||
--- /dev/null
|
||||
+++ b/data/list.c
|
||||
@@ -0,0 +1,100 @@
|
||||
+/*
|
||||
+ * Copyright © 2012 Red Hat, Inc.
|
||||
+ *
|
||||
+ * Permission to use, copy, modify, distribute, and sell this software
|
||||
+ * and its documentation for any purpose is hereby granted without
|
||||
+ * fee, provided that the above copyright notice appear in all copies
|
||||
+ * and that both that copyright notice and this permission notice
|
||||
+ * appear in supporting documentation, and that the name of Red Hat
|
||||
+ * not be used in advertising or publicity pertaining to distribution
|
||||
+ * of the software without specific, written prior permission. Red
|
||||
+ * Hat makes no representations about the suitability of this software
|
||||
+ * for any purpose. It is provided "as is" without express or implied
|
||||
+ * warranty.
|
||||
+ *
|
||||
+ * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||
+ * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
+ *
|
||||
+ * Authors:
|
||||
+ * Olivier Fourdan (ofourdan@redhat.com)
|
||||
+ */
|
||||
+
|
||||
+#ifdef HAVE_CONFIG_H
|
||||
+#include "config.h"
|
||||
+#endif
|
||||
+
|
||||
+#include <stdio.h>
|
||||
+#include <string.h>
|
||||
+#include "libwacom.h"
|
||||
+
|
||||
+static void print_udev_header (void)
|
||||
+{
|
||||
+ printf ("# udev rules for libwacom supported devices\n");
|
||||
+ printf ("\n");
|
||||
+ printf ("ACTION!=\"add|change\", GOTO=\"libwacom_end\"\n");
|
||||
+ printf ("KERNEL!=\"event[0-9]*\", GOTO=\"libwacom_end\"\n");
|
||||
+ printf ("\n");
|
||||
+}
|
||||
+
|
||||
+static void print_udev_entry (WacomDevice *device)
|
||||
+{
|
||||
+ WacomBusType type = libwacom_get_bustype (device);
|
||||
+ int vendor = libwacom_get_vendor_id (device);
|
||||
+ int product = libwacom_get_product_id (device);
|
||||
+ int has_touch = libwacom_has_touch (device);
|
||||
+ static char *touchpad;
|
||||
+
|
||||
+ if (has_touch)
|
||||
+ touchpad = ", ENV{ID_INPUT_TOUCHPAD}=\"1\"";
|
||||
+ else
|
||||
+ touchpad = "";
|
||||
+
|
||||
+ switch (type) {
|
||||
+ case WBUSTYPE_USB:
|
||||
+ printf ("ENV{ID_BUS}==\"usb\", ENV{ID_VENDOR_ID}==\"%04x\", ENV{ID_MODEL_ID}==\"%04x\", ENV{ID_INPUT}=\"1\", ENV{ID_INPUT_TABLET}=\"1\"%s\n", vendor, product, touchpad);
|
||||
+ break;
|
||||
+ case WBUSTYPE_BLUETOOTH:
|
||||
+ printf ("ENV{ID_BUS}==\"bluetooth\", ENV{ID_VENDOR_ID}==\"%04x\", ENV{ID_MODEL_ID}==\"%04x\", ENV{ID_INPUT}=\"1\", ENV{ID_INPUT_TABLET}=\"1\"%s\n", vendor, product, touchpad);
|
||||
+ break;
|
||||
+ default:
|
||||
+ /* Not sure how to deal with serials */
|
||||
+ break;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void print_udev_trailer (void)
|
||||
+{
|
||||
+ printf ("\n");
|
||||
+ printf ("# Match all serial wacom tablets with a serial ID starting with WACf\n");
|
||||
+ printf ("ENV{ID_BUS}==\"tty|pnp\", ATTRS{id}==\"WACf*\", ENV{ID_INPUT}=\"1\", ENV{ID_INPUT_TABLET}=\"1\"\n");
|
||||
+ printf ("ENV{ID_BUS}==\"tty|pnp\", ATTRS{id}==\"FUJ*\", ENV{ID_INPUT}=\"1\", ENV{ID_INPUT_TABLET}=\"1\"\n");
|
||||
+ printf ("\n");
|
||||
+ printf ("LABEL=\"libwacom_end\"\n");
|
||||
+}
|
||||
+
|
||||
+
|
||||
+int main(int argc, char **argv)
|
||||
+{
|
||||
+ WacomDeviceDatabase *db;
|
||||
+ WacomDevice **list, **p;
|
||||
+
|
||||
+ db = libwacom_database_new_for_path(TOPSRCDIR"/data");
|
||||
+
|
||||
+ list = libwacom_list_devices_from_database(db, NULL);
|
||||
+
|
||||
+ print_udev_header ();
|
||||
+ for (p = list; *p; p++)
|
||||
+ print_udev_entry ((WacomDevice *) *p);
|
||||
+ print_udev_trailer ();
|
||||
+
|
||||
+ libwacom_database_destroy (db);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+/* vim: set noexpandtab tabstop=8 shiftwidth=8: */
|
||||
Loading…
Reference in New Issue
Block a user