From 6dce39846999951353c2e866019a79d568c99dfa Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Mon, 25 Jul 2011 18:42:24 +0100 Subject: the beginnings of the udev work --- configure.ac | 2 ++ src/device-menu-mgr.c | 8 +++--- src/udev-mgr.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++---- src/udev-mgr.h | 14 ++++++++--- 4 files changed, 80 insertions(+), 12 deletions(-) diff --git a/configure.ac b/configure.ac index 369f12b..e32ac4a 100644 --- a/configure.ac +++ b/configure.ac @@ -58,12 +58,14 @@ AS_IF([test "x$with_gtk" = x3], [PKG_CHECK_MODULES(SESSIONSERVICE, dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION dbus-glib-1 + gudev-1.0 gio-unix-2.0 indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION) ], [test "x$with_gtk" = x2], [PKG_CHECK_MODULES(SESSIONSERVICE, dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION + gudev-1.0 dbus-glib-1 gio-unix-2.0 indicator-0.4 >= $INDICATOR_REQUIRED_VERSION) diff --git a/src/device-menu-mgr.c b/src/device-menu-mgr.c index 324b3f1..063045e 100644 --- a/src/device-menu-mgr.c +++ b/src/device-menu-mgr.c @@ -27,7 +27,7 @@ with this program. If not, see . #include "lock-helper.h" #include "upower-client.h" #include "apt-watcher.h" - +#include "udev-mgr.h" #define UP_ADDRESS "org.freedesktop.UPower" #define UP_OBJECT "/org/freedesktop/UPower" @@ -41,6 +41,7 @@ struct _DeviceMenuMgr DbusmenuMenuitem* root_item; SessionDbus* session_dbus_interface; AptWatcher* apt_watcher; + UdevMgr* udev_mgr; }; static GConfClient *gconf_client = NULL; @@ -214,7 +215,6 @@ machine_sleep_with_context (DeviceMenuMgr* self, gchar* type) screensaver_throttle(type); lock_if_possible (self); - dbus_g_proxy_begin_call(up_main_proxy, type, sleep_response, @@ -681,7 +681,9 @@ device_menu_mgr_build_static_items (DeviceMenuMgr* self) restart_shutdown_logout_mi->logout_mi = logout_mi; restart_shutdown_logout_mi->shutdown_mi = shutdown_mi; - update_menu_entries(restart_shutdown_logout_mi); + update_menu_entries(restart_shutdown_logout_mi); + // Time to create the udev mgr and hand it the static relevant items. + self->udev_mgr = udev_mgr_new (webcam_menuitem, scanners_menuitem); } diff --git a/src/udev-mgr.c b/src/udev-mgr.c index 6575ca5..b5c1936 100644 --- a/src/udev-mgr.c +++ b/src/udev-mgr.c @@ -18,21 +18,63 @@ with this program. If not, see . */ #include "udev-mgr.h" +#include + +static void udevice_mgr_device_list_iterator (gpointer data, + gpointer userdata); +static void udev_mgr_uevent_cb (GUdevClient *client, + gchar *action, + GUdevDevice *device, + gpointer user_data); +struct _UdevMgr +{ + GObject parent_instance; + DbusmenuMenuitem* scanner_item; + DbusmenuMenuitem* webcam_item; + GUdevClient* client; +}; G_DEFINE_TYPE (UdevMgr, udev_mgr, G_TYPE_OBJECT); static void -udev_mgr_init (UdevMgr *object) +udev_mgr_init (UdevMgr* self) +{ + self->client = NULL; + const gchar *subsystems[1] = {"usb"}; + self->client = g_udev_client_new (subsystems); + const gchar* usb_subsystem = "usb"; + + GList* devices_available = g_udev_client_query_by_subsystem (self->client, + usb_subsystem); + + if (FALSE){ + g_list_foreach (devices_available, udevice_mgr_device_list_iterator, self); + } + //g_list_free (devices_available); + if (FALSE){ + g_signal_connect (G_OBJECT (self->client), + "u-event", + G_CALLBACK (udev_mgr_uevent_cb), + self); + } +} + +static void +udevice_mgr_device_list_iterator (gpointer data, gpointer userdata) { - /* TODO: Add initialization code here */ + g_return_if_fail (G_UDEV_IS_DEVICE (data)); + GUdevDevice* device = G_UDEV_DEVICE (data); + const gchar* name = g_udev_device_get_name (device); + + g_debug ("UDEV MGR - the name of the device = %s", name); + // for now tidy up here. + g_object_unref (device); } static void udev_mgr_finalize (GObject *object) { - /* TODO: Add deinitalization code here */ - G_OBJECT_CLASS (udev_mgr_parent_class)->finalize (object); } @@ -40,7 +82,23 @@ static void udev_mgr_class_init (UdevMgrClass *klass) { GObjectClass* object_class = G_OBJECT_CLASS (klass); - object_class->finalize = udev_mgr_finalize; } +static void udev_mgr_uevent_cb (GUdevClient *client, + gchar *action, + GUdevDevice *device, + gpointer user_data) +{ + g_debug ("just received a UEVENT with an action : %s", action); + g_return_if_fail (UDEV_IS_MGR (user_data)); +} + +UdevMgr* udev_mgr_new (DbusmenuMenuitem* scanner, + DbusmenuMenuitem* webcam) +{ + UdevMgr* mgr = g_object_new (UDEV_TYPE_MGR, NULL); + mgr->scanner_item = scanner; + mgr->webcam_item = webcam; + return mgr; +} diff --git a/src/udev-mgr.h b/src/udev-mgr.h index 1c5ae73..323364a 100644 --- a/src/udev-mgr.h +++ b/src/udev-mgr.h @@ -21,6 +21,14 @@ with this program. If not, see . #define _UDEV_MGR_H_ #include +#include + +#include +#if GTK_CHECK_VERSION(3, 0, 0) +#include +#else +#include +#endif G_BEGIN_DECLS @@ -39,12 +47,10 @@ struct _UdevMgrClass GObjectClass parent_class; }; -struct _UdevMgr -{ - GObject parent_instance; -}; GType udev_mgr_get_type (void) G_GNUC_CONST; +UdevMgr* udev_mgr_new (DbusmenuMenuitem* scanner_item, + DbusmenuMenuitem* webcam_item); G_END_DECLS -- cgit v1.2.3 From bdfda68f33615dd7f24b35f425c44c9ef63a1675 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 26 Jul 2011 12:48:56 +0100 Subject: fixed gudev segfault --- src/udev-mgr.c | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/src/udev-mgr.c b/src/udev-mgr.c index b5c1936..e100f16 100644 --- a/src/udev-mgr.c +++ b/src/udev-mgr.c @@ -26,6 +26,7 @@ static void udev_mgr_uevent_cb (GUdevClient *client, gchar *action, GUdevDevice *device, gpointer user_data); + struct _UdevMgr { GObject parent_instance; @@ -34,6 +35,8 @@ struct _UdevMgr GUdevClient* client; }; +const char *subsystems[1] = {"usb"}; +const gchar* usb_subsystem = "usb"; G_DEFINE_TYPE (UdevMgr, udev_mgr, G_TYPE_OBJECT); @@ -41,37 +44,19 @@ static void udev_mgr_init (UdevMgr* self) { self->client = NULL; - const gchar *subsystems[1] = {"usb"}; self->client = g_udev_client_new (subsystems); - const gchar* usb_subsystem = "usb"; GList* devices_available = g_udev_client_query_by_subsystem (self->client, usb_subsystem); - if (FALSE){ - g_list_foreach (devices_available, udevice_mgr_device_list_iterator, self); - } - //g_list_free (devices_available); - if (FALSE){ + g_list_foreach (devices_available, udevice_mgr_device_list_iterator, self); + g_list_free (devices_available); g_signal_connect (G_OBJECT (self->client), - "u-event", + "uevent", G_CALLBACK (udev_mgr_uevent_cb), self); - } } -static void -udevice_mgr_device_list_iterator (gpointer data, gpointer userdata) -{ - g_return_if_fail (G_UDEV_IS_DEVICE (data)); - GUdevDevice* device = G_UDEV_DEVICE (data); - const gchar* name = g_udev_device_get_name (device); - - g_debug ("UDEV MGR - the name of the device = %s", name); - // for now tidy up here. - g_object_unref (device); -} - static void udev_mgr_finalize (GObject *object) { @@ -85,6 +70,18 @@ udev_mgr_class_init (UdevMgrClass *klass) object_class->finalize = udev_mgr_finalize; } +static void +udevice_mgr_device_list_iterator (gpointer data, gpointer userdata) +{ + g_return_if_fail (G_UDEV_IS_DEVICE (data)); + GUdevDevice* device = G_UDEV_DEVICE (data); + const gchar* name = g_udev_device_get_name (device); + + g_debug ("UDEV MGR - the name of the device = %s", name); + // for now tidy up here. + g_object_unref (device); +} + static void udev_mgr_uevent_cb (GUdevClient *client, gchar *action, GUdevDevice *device, @@ -94,6 +91,7 @@ static void udev_mgr_uevent_cb (GUdevClient *client, g_return_if_fail (UDEV_IS_MGR (user_data)); } + UdevMgr* udev_mgr_new (DbusmenuMenuitem* scanner, DbusmenuMenuitem* webcam) { -- cgit v1.2.3 From e3b36473ed5400c60f4f08b8cc88bc4e384f3b32 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 26 Jul 2011 16:38:53 +0100 Subject: research trace for devices in udev --- src/sane_rules.h | 0 src/udev-mgr.c | 42 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 src/sane_rules.h diff --git a/src/sane_rules.h b/src/sane_rules.h new file mode 100644 index 0000000..e69de29 diff --git a/src/udev-mgr.c b/src/udev-mgr.c index e100f16..4dde1b8 100644 --- a/src/udev-mgr.c +++ b/src/udev-mgr.c @@ -20,6 +20,11 @@ with this program. If not, see . #include "udev-mgr.h" #include +#include +#include +#include +#include + static void udevice_mgr_device_list_iterator (gpointer data, gpointer userdata); static void udev_mgr_uevent_cb (GUdevClient *client, @@ -87,8 +92,43 @@ static void udev_mgr_uevent_cb (GUdevClient *client, GUdevDevice *device, gpointer user_data) { - g_debug ("just received a UEVENT with an action : %s", action); g_return_if_fail (UDEV_IS_MGR (user_data)); + + g_debug ("just received a UEVENT with an action : %s", action); + + const gchar* vendor; + const gchar* product; + const gchar* number; + + vendor = g_udev_device_get_property (device, "ID_VENDOR_ID"); + product = g_udev_device_get_property (device, "ID_MODEL_ID"); + number = g_udev_device_get_number (device); + g_debug ("device vendor id %s and product id of %s and number of %s", + g_strdup(vendor), + g_strdup(product), + g_strdup(number)); + + const gchar *const *list; + const gchar *const *iter; + char propstr[500]; + guint32 namelen = 0, i; + + list = g_udev_device_get_property_keys(device); + + for (iter = list; iter && *iter; iter++) { + if (strlen(*iter) > namelen) + namelen = strlen(*iter); + } + namelen++; + + for (iter = list; iter && *iter; iter++) { + strcpy(propstr, *iter); + strcat(propstr, ":"); + for (i = 0; i < namelen - strlen(*iter); i++) + strcat(propstr, " "); + strcat(propstr, g_udev_device_get_property(device, *iter)); + g_debug("%s", propstr); + } } -- cgit v1.2.3 From 8e8a2b83bd5e5f5d293a64bfb5e5a163b80fad0d Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 26 Jul 2011 18:23:59 +0100 Subject: pattern established as to how to handle these sane rules --- src/Makefile.am | 3 ++- src/sane-rules.h | 20 ++++++++++++++++++++ src/sane_rules.h | 0 src/udev-mgr.c | 27 +++++++++++++++++++++------ 4 files changed, 43 insertions(+), 7 deletions(-) create mode 100644 src/sane-rules.h delete mode 100644 src/sane_rules.h diff --git a/src/Makefile.am b/src/Makefile.am index 83d12bb..36a1d1f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -101,7 +101,8 @@ indicator_session_service_SOURCES = \ apt-transaction.h \ apt-transaction.c \ udev-mgr.h \ - udev-mgr.c + udev-mgr.c \ + sane-rules.h indicator_session_service_CFLAGS = \ $(SESSIONSERVICE_CFLAGS) \ $(GCONF_CFLAGS) \ diff --git a/src/sane-rules.h b/src/sane-rules.h new file mode 100644 index 0000000..fc43e39 --- /dev/null +++ b/src/sane-rules.h @@ -0,0 +1,20 @@ + + +void populate_usb_scanners (GHashTable* scanners) +{ + GList* epson = NULL; + + epson = g_list_append (epson, g_strdup("0101")); + epson = g_list_append (epson, g_strdup("0103")); + epson = g_list_append (epson, g_strdup("0104")); + epson = g_list_append (epson, g_strdup("0105")); + epson = g_list_append (epson, g_strdup("0106")); + epson = g_list_append (epson, g_strdup("0107")); + epson = g_list_append (epson, g_strdup("0109")); + epson = g_list_append (epson, g_strdup("010a")); + epson = g_list_append (epson, g_strdup("010b")); + + g_hash_table_insert (scanners, + g_strdup("04b8"), + g_list_copy(epson)); +} diff --git a/src/sane_rules.h b/src/sane_rules.h deleted file mode 100644 index e69de29..0000000 diff --git a/src/udev-mgr.c b/src/udev-mgr.c index 4dde1b8..31ccb63 100644 --- a/src/udev-mgr.c +++ b/src/udev-mgr.c @@ -17,27 +17,29 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "udev-mgr.h" #include - +// TEMP #include #include #include #include +#include "udev-mgr.h" +#include "sane-rules.h" + static void udevice_mgr_device_list_iterator (gpointer data, gpointer userdata); static void udev_mgr_uevent_cb (GUdevClient *client, gchar *action, GUdevDevice *device, - gpointer user_data); - + gpointer user_data); struct _UdevMgr { GObject parent_instance; DbusmenuMenuitem* scanner_item; DbusmenuMenuitem* webcam_item; GUdevClient* client; + GHashTable* supported_scanners; }; const char *subsystems[1] = {"usb"}; @@ -45,12 +47,24 @@ const gchar* usb_subsystem = "usb"; G_DEFINE_TYPE (UdevMgr, udev_mgr, G_TYPE_OBJECT); +static void +test_usb_scanners(gpointer data, gpointer user_data) +{ + gchar* model = (gchar*)data; + g_debug ("in hash table for epsom model %s was found", model); +} + static void udev_mgr_init (UdevMgr* self) { self->client = NULL; - self->client = g_udev_client_new (subsystems); - + self->supported_scanners = NULL; + + self->client = g_udev_client_new (subsystems); + self->supported_scanners = g_hash_table_new (g_str_hash, g_str_equal); + populate_usb_scanners(self->supported_scanners); + GList* epsom = g_hash_table_lookup(self->supported_scanners, "04b8"); + g_list_foreach(epsom, test_usb_scanners, NULL); GList* devices_available = g_udev_client_query_by_subsystem (self->client, usb_subsystem); @@ -62,6 +76,7 @@ udev_mgr_init (UdevMgr* self) self); } + static void udev_mgr_finalize (GObject *object) { -- cgit v1.2.3 From b806cc0e1da3010055c196de59eff15ced2a51b5 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Wed, 27 Jul 2011 12:50:24 +0100 Subject: udev scanner detection working at startup --- src/sane-rules.h | 3 ++- src/udev-mgr.c | 52 +++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 47 insertions(+), 8 deletions(-) diff --git a/src/sane-rules.h b/src/sane-rules.h index fc43e39..356acc6 100644 --- a/src/sane-rules.h +++ b/src/sane-rules.h @@ -3,7 +3,8 @@ void populate_usb_scanners (GHashTable* scanners) { GList* epson = NULL; - + // For testing + epson = g_list_append (epson, g_strdup("0001")); epson = g_list_append (epson, g_strdup("0101")); epson = g_list_append (epson, g_strdup("0103")); epson = g_list_append (epson, g_strdup("0104")); diff --git a/src/udev-mgr.c b/src/udev-mgr.c index 31ccb63..8a5f539 100644 --- a/src/udev-mgr.c +++ b/src/udev-mgr.c @@ -18,6 +18,7 @@ with this program. If not, see . */ #include + // TEMP #include #include @@ -32,7 +33,10 @@ static void udevice_mgr_device_list_iterator (gpointer data, static void udev_mgr_uevent_cb (GUdevClient *client, gchar *action, GUdevDevice *device, - gpointer user_data); + gpointer user_data); +/*static gboolean udev_mgr_compare_models (gconstpointer data1, + gconstpointer data2); +*/ struct _UdevMgr { GObject parent_instance; @@ -47,12 +51,12 @@ const gchar* usb_subsystem = "usb"; G_DEFINE_TYPE (UdevMgr, udev_mgr, G_TYPE_OBJECT); -static void +/*static void test_usb_scanners(gpointer data, gpointer user_data) { gchar* model = (gchar*)data; g_debug ("in hash table for epsom model %s was found", model); -} +}*/ static void udev_mgr_init (UdevMgr* self) @@ -63,8 +67,6 @@ udev_mgr_init (UdevMgr* self) self->client = g_udev_client_new (subsystems); self->supported_scanners = g_hash_table_new (g_str_hash, g_str_equal); populate_usb_scanners(self->supported_scanners); - GList* epsom = g_hash_table_lookup(self->supported_scanners, "04b8"); - g_list_foreach(epsom, test_usb_scanners, NULL); GList* devices_available = g_udev_client_query_by_subsystem (self->client, usb_subsystem); @@ -94,11 +96,40 @@ static void udevice_mgr_device_list_iterator (gpointer data, gpointer userdata) { g_return_if_fail (G_UDEV_IS_DEVICE (data)); + g_return_if_fail (UDEV_IS_MGR (userdata)); + + UdevMgr* self = UDEV_MGR (userdata); + GUdevDevice* device = G_UDEV_DEVICE (data); + const gchar* name = g_udev_device_get_name (device); - g_debug ("UDEV MGR - the name of the device = %s", name); - // for now tidy up here. + const gchar* vendor = NULL; + const gchar* product = NULL; + GList* vendor_list = NULL; + + vendor = g_udev_device_get_property (device, "ID_VENDOR_ID"); + + if (vendor == NULL){ + g_object_unref (device); + return; + } + + product = g_udev_device_get_property (device, "ID_MODEL_ID"); + vendor_list = g_hash_table_lookup(self->supported_scanners, (gpointer)vendor); + + GList* model = NULL; + + if (vendor_list != NULL){ + model = g_list_find_custom(vendor_list, product, (GCompareFunc)g_strcmp0); + if (model == NULL){ + g_debug ("CANT FIND THE MODEL %s FOR VENDOR %s", product, vendor); + } + else{ + dbusmenu_menuitem + g_debug ("WE HAVE A SUCCESSFUL MATCH!"); + } + } g_object_unref (device); } @@ -118,6 +149,7 @@ static void udev_mgr_uevent_cb (GUdevClient *client, vendor = g_udev_device_get_property (device, "ID_VENDOR_ID"); product = g_udev_device_get_property (device, "ID_MODEL_ID"); number = g_udev_device_get_number (device); + g_debug ("device vendor id %s and product id of %s and number of %s", g_strdup(vendor), g_strdup(product), @@ -146,6 +178,12 @@ static void udev_mgr_uevent_cb (GUdevClient *client, } } +/*static gboolean +udev_mgr_compare_models (gconstpointer data1, + gconstpointer data2) +{ + return FALSE; +}*/ UdevMgr* udev_mgr_new (DbusmenuMenuitem* scanner, DbusmenuMenuitem* webcam) -- cgit v1.2.3 From b4fd0a59df355527593522e66120a12778af11b2 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Wed, 27 Jul 2011 16:15:36 +0100 Subject: refactor with a more generic utility function --- src/device-menu-mgr.c | 3 +-- src/udev-mgr.c | 50 +++++++++++++++++++++++++++++++------------------- 2 files changed, 32 insertions(+), 21 deletions(-) diff --git a/src/device-menu-mgr.c b/src/device-menu-mgr.c index 063045e..2c559ee 100644 --- a/src/device-menu-mgr.c +++ b/src/device-menu-mgr.c @@ -555,7 +555,6 @@ device_menu_mgr_build_static_items (DeviceMenuMgr* self) dbusmenu_menuitem_child_add_position (self->root_item, scanners_menuitem, 8); - //tmp dbusmenu_menuitem_property_set_bool (scanners_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); @@ -683,7 +682,7 @@ device_menu_mgr_build_static_items (DeviceMenuMgr* self) update_menu_entries(restart_shutdown_logout_mi); // Time to create the udev mgr and hand it the static relevant items. - self->udev_mgr = udev_mgr_new (webcam_menuitem, scanners_menuitem); + self->udev_mgr = udev_mgr_new (scanners_menuitem, webcam_menuitem); } diff --git a/src/udev-mgr.c b/src/udev-mgr.c index 8a5f539..80e49dd 100644 --- a/src/udev-mgr.c +++ b/src/udev-mgr.c @@ -34,9 +34,8 @@ static void udev_mgr_uevent_cb (GUdevClient *client, gchar *action, GUdevDevice *device, gpointer user_data); -/*static gboolean udev_mgr_compare_models (gconstpointer data1, - gconstpointer data2); -*/ +static void udev_mgr_update_menuitems (UdevMgr* self); + struct _UdevMgr { GObject parent_instance; @@ -44,6 +43,7 @@ struct _UdevMgr DbusmenuMenuitem* webcam_item; GUdevClient* client; GHashTable* supported_scanners; + gint scanners_present; }; const char *subsystems[1] = {"usb"}; @@ -63,15 +63,11 @@ udev_mgr_init (UdevMgr* self) { self->client = NULL; self->supported_scanners = NULL; - + self->scanners_present = 0; + self->client = g_udev_client_new (subsystems); self->supported_scanners = g_hash_table_new (g_str_hash, g_str_equal); populate_usb_scanners(self->supported_scanners); - GList* devices_available = g_udev_client_query_by_subsystem (self->client, - usb_subsystem); - - g_list_foreach (devices_available, udevice_mgr_device_list_iterator, self); - g_list_free (devices_available); g_signal_connect (G_OBJECT (self->client), "uevent", G_CALLBACK (udev_mgr_uevent_cb), @@ -101,9 +97,7 @@ udevice_mgr_device_list_iterator (gpointer data, gpointer userdata) UdevMgr* self = UDEV_MGR (userdata); GUdevDevice* device = G_UDEV_DEVICE (data); - - const gchar* name = g_udev_device_get_name (device); - + const gchar* vendor = NULL; const gchar* product = NULL; GList* vendor_list = NULL; @@ -126,13 +120,22 @@ udevice_mgr_device_list_iterator (gpointer data, gpointer userdata) g_debug ("CANT FIND THE MODEL %s FOR VENDOR %s", product, vendor); } else{ - dbusmenu_menuitem + self->scanners_present += 1; g_debug ("WE HAVE A SUCCESSFUL MATCH!"); - } + } } + g_debug ("JUST SET SCANNERS TO TRUE"); g_object_unref (device); } + +static void udev_mgr_update_menuitems (UdevMgr* self) +{ + dbusmenu_menuitem_property_set_bool (self->scanner_item, + DBUSMENU_MENUITEM_PROP_VISIBLE, + self->scanners_present > 0); +} + static void udev_mgr_uevent_cb (GUdevClient *client, gchar *action, GUdevDevice *device, @@ -178,12 +181,12 @@ static void udev_mgr_uevent_cb (GUdevClient *client, } } -/*static gboolean -udev_mgr_compare_models (gconstpointer data1, - gconstpointer data2) +static gboolean +udev_mgr_is_this_a_supported_scanner (UdevMgr* self, + GUdevDevice *device) { - return FALSE; -}*/ + +} UdevMgr* udev_mgr_new (DbusmenuMenuitem* scanner, DbusmenuMenuitem* webcam) @@ -191,5 +194,14 @@ UdevMgr* udev_mgr_new (DbusmenuMenuitem* scanner, UdevMgr* mgr = g_object_new (UDEV_TYPE_MGR, NULL); mgr->scanner_item = scanner; mgr->webcam_item = webcam; + + GList* devices_available = g_udev_client_query_by_subsystem (mgr->client, + usb_subsystem); + + g_list_foreach (devices_available, + udevice_mgr_device_list_iterator, + mgr); + g_list_free (devices_available); + udev_mgr_update_menuitems (mgr); return mgr; } -- cgit v1.2.3 From 764a81d40737fdb3acb76103c7c895b77e18d300 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Wed, 27 Jul 2011 17:23:28 +0100 Subject: convenience method added to handle the insertion and startup detection of scanners --- src/udev-mgr.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++----------- src/udev-mgr.h | 5 ++++ 2 files changed, 71 insertions(+), 15 deletions(-) diff --git a/src/udev-mgr.c b/src/udev-mgr.c index 80e49dd..f4b357d 100644 --- a/src/udev-mgr.c +++ b/src/udev-mgr.c @@ -35,7 +35,10 @@ static void udev_mgr_uevent_cb (GUdevClient *client, GUdevDevice *device, gpointer user_data); static void udev_mgr_update_menuitems (UdevMgr* self); - +static void udev_mgr_check_if_device_is_supported (UdevMgr* self, + GUdevDevice *device, + UdevMgrDeviceAction action); + struct _UdevMgr { GObject parent_instance; @@ -43,10 +46,10 @@ struct _UdevMgr DbusmenuMenuitem* webcam_item; GUdevClient* client; GHashTable* supported_scanners; - gint scanners_present; + GHashTable* scanners_present; }; -const char *subsystems[1] = {"usb"}; +const char *subsystems[2] = {"usb", "scsi"}; const gchar* usb_subsystem = "usb"; G_DEFINE_TYPE (UdevMgr, udev_mgr, G_TYPE_OBJECT); @@ -63,21 +66,23 @@ udev_mgr_init (UdevMgr* self) { self->client = NULL; self->supported_scanners = NULL; - self->scanners_present = 0; - + self->scanners_present = NULL; + self->client = g_udev_client_new (subsystems); self->supported_scanners = g_hash_table_new (g_str_hash, g_str_equal); + self->scanners_present = g_hash_table_new (g_str_hash, g_str_equal); + populate_usb_scanners(self->supported_scanners); g_signal_connect (G_OBJECT (self->client), "uevent", G_CALLBACK (udev_mgr_uevent_cb), self); } - static void udev_mgr_finalize (GObject *object) { + // TODO tidy up hashtables. G_OBJECT_CLASS (udev_mgr_parent_class)->finalize (object); } @@ -97,8 +102,9 @@ udevice_mgr_device_list_iterator (gpointer data, gpointer userdata) UdevMgr* self = UDEV_MGR (userdata); GUdevDevice* device = G_UDEV_DEVICE (data); - - const gchar* vendor = NULL; + udev_mgr_check_if_device_is_supported (self, device, ADD); + + /*const gchar* vendor = NULL; const gchar* product = NULL; GList* vendor_list = NULL; @@ -124,7 +130,7 @@ udevice_mgr_device_list_iterator (gpointer data, gpointer userdata) g_debug ("WE HAVE A SUCCESSFUL MATCH!"); } } - g_debug ("JUST SET SCANNERS TO TRUE"); + g_debug ("JUST SET SCANNERS TO TRUE");*/ g_object_unref (device); } @@ -133,7 +139,7 @@ static void udev_mgr_update_menuitems (UdevMgr* self) { dbusmenu_menuitem_property_set_bool (self->scanner_item, DBUSMENU_MENUITEM_PROP_VISIBLE, - self->scanners_present > 0); + g_hash_table_size (self->scanners_present) > 0); } static void udev_mgr_uevent_cb (GUdevClient *client, @@ -142,9 +148,15 @@ static void udev_mgr_uevent_cb (GUdevClient *client, gpointer user_data) { g_return_if_fail (UDEV_IS_MGR (user_data)); - + UdevMgr* self = UDEV_MGR (user_data); g_debug ("just received a UEVENT with an action : %s", action); + + UdevMgrDeviceAction udev_mgr_action = ADD; + if (g_strcmp0 (action, "remove") == 0){ + udev_mgr_action = REMOVE; + } + udev_mgr_check_if_device_is_supported (self, device, udev_mgr_action); const gchar* vendor; const gchar* product; const gchar* number; @@ -178,14 +190,53 @@ static void udev_mgr_uevent_cb (GUdevClient *client, strcat(propstr, " "); strcat(propstr, g_udev_device_get_property(device, *iter)); g_debug("%s", propstr); - } + } } -static gboolean -udev_mgr_is_this_a_supported_scanner (UdevMgr* self, - GUdevDevice *device) +static void +udev_mgr_check_if_device_is_supported (UdevMgr* self, + GUdevDevice *device, + UdevMgrDeviceAction action) { + const gchar* vendor = NULL; + vendor = g_udev_device_get_property (device, "ID_VENDOR_ID"); + if (vendor == NULL) + return; + + GList* vendor_list = NULL; + vendor_list = g_hash_table_lookup (self->supported_scanners, + (gpointer)vendor); + if (vendor_list == NULL) + return; + + const gchar* model_id = NULL; + model_id = g_udev_device_get_property (device, "ID_MODEL_ID"); + + if (model_id == NULL) + return; + + GList* model_entry = NULL; + model_entry = g_list_find_custom(vendor_list, model_id, (GCompareFunc)g_strcmp0); + + if (model_entry != NULL){ + if (action == REMOVE){ + // TODO handle the case where its removed + // remove it if present from the hash and call update_menuitems + } + else{ + g_hash_table_insert (self->scanners_present, + g_strdup(vendor), + g_strdup(model_id)); + } + } + // DEBUG purposes. + if (model_entry == NULL){ + g_debug ("CANT FIND THE MODEL %s FOR VENDOR %s", model_id, vendor); + } + else{ + g_debug ("WE HAVE A SUCCESSFUL MATCH!"); + } } UdevMgr* udev_mgr_new (DbusmenuMenuitem* scanner, diff --git a/src/udev-mgr.h b/src/udev-mgr.h index 323364a..5119803 100644 --- a/src/udev-mgr.h +++ b/src/udev-mgr.h @@ -52,6 +52,11 @@ GType udev_mgr_get_type (void) G_GNUC_CONST; UdevMgr* udev_mgr_new (DbusmenuMenuitem* scanner_item, DbusmenuMenuitem* webcam_item); +typedef enum { + ADD, + REMOVE +}UdevMgrDeviceAction; + G_END_DECLS #endif /* _UDEV_MGR_H_ */ -- cgit v1.2.3 From 435c58bec6f9af0779bb47312cc9cd6bc5e67846 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Fri, 29 Jul 2011 19:54:51 +0100 Subject: half way through those usb scanner udev rules --- src/sane-rules.h | 1077 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 1074 insertions(+), 3 deletions(-) diff --git a/src/sane-rules.h b/src/sane-rules.h index 356acc6..92c7ad7 100644 --- a/src/sane-rules.h +++ b/src/sane-rules.h @@ -1,10 +1,1081 @@ - void populate_usb_scanners (GHashTable* scanners) { GList* epson = NULL; - // For testing - epson = g_list_append (epson, g_strdup("0001")); + GList* hp = NULL; + + hp = g_list_append (hp, g_strdup ("0101")); + hp = g_list_append (hp, g_strdup ("0105")); + hp = g_list_append (hp, g_strdup ("0201")); + hp = g_list_append (hp, g_strdup ("0205")); + hp = g_list_append (hp, g_strdup ("0305")); + hp = g_list_append (hp, g_strdup ("0401")); + hp = g_list_append (hp, g_strdup ("0405")); + hp = g_list_append (hp, g_strdup ("0505")); + hp = g_list_append (hp, g_strdup ("0601")); + hp = g_list_append (hp, g_strdup ("0605")); + hp = g_list_append (hp, g_strdup ("0701")); + hp = g_list_append (hp, g_strdup ("0705")); + hp = g_list_append (hp, g_strdup ("0801")); + hp = g_list_append (hp, g_strdup ("0805")); + hp = g_list_append (hp, g_strdup ("0901")); + hp = g_list_append (hp, g_strdup ("0a01")); + hp = g_list_append (hp, g_strdup ("0b01")); + hp = g_list_append (hp, g_strdup ("1005")); + hp = g_list_append (hp, g_strdup ("1105")); + hp = g_list_append (hp, g_strdup ("1205")); + hp = g_list_append (hp, g_strdup ("1305")); + hp = g_list_append (hp, g_strdup ("1405")); + hp = g_list_append (hp, g_strdup ("1705")); + hp = g_list_append (hp, g_strdup ("1805")); + hp = g_list_append (hp, g_strdup ("2005")); + hp = g_list_append (hp, g_strdup ("2205")); + hp = g_list_append (hp, g_strdup ("2305")); + hp = g_list_append (hp, g_strdup ("2405")); + hp = g_list_append (hp, g_strdup ("2605")); + hp = g_list_append (hp, g_strdup ("2805")); + hp = g_list_append (hp, g_strdup ("3805")); + hp = g_list_append (hp, g_strdup ("3905")); + hp = g_list_append (hp, g_strdup ("3B17")); + hp = g_list_append (hp, g_strdup ("4105")); + hp = g_list_append (hp, g_strdup ("4205")); + hp = g_list_append (hp, g_strdup ("4305")); + hp = g_list_append (hp, g_strdup ("4505")); + hp = g_list_append (hp, g_strdup ("4605")); + hp = g_list_append (hp, g_strdup ("5617")); + hp = g_list_append (hp, g_strdup ("5717")); + + g_hash_table_insert (scanners, + g_strdup("03f0"), + g_list_copy(hp)); + + GList* mustek = NULL; + + mustek = g_list_append (mustek, g_strdup ("1000")); + mustek = g_list_append (mustek, g_strdup ("1001")); + + g_hash_table_insert (scanners, + g_strdup("03f0"), + g_list_copy(mustek)); + + GList* kodak = NULL; + + kodak = g_list_append (kodak, g_strdup ("6001")); + kodak = g_list_append (kodak, g_strdup ("6002")); + kodak = g_list_append (kodak, g_strdup ("6003")); + kodak = g_list_append (kodak, g_strdup ("6004")); + kodak = g_list_append (kodak, g_strdup ("6005")); + + g_hash_table_insert (scanners, + g_strdup("040a"), + g_list_copy(kodak)); + + GList* creative = NULL; + + creative = g_list_append (creative, g_strdup ("4007")); + + g_hash_table_insert (scanners, + g_strdup("041e"), + g_list_copy(creative)); + + GList* lexmark = NULL; + + lexmark = g_list_append (lexmark, g_strdup("002d")); + lexmark = g_list_append (lexmark, g_strdup("0060")); + lexmark = g_list_append (lexmark, g_strdup("007c")); + lexmark = g_list_append (lexmark, g_strdup("007d")); + + g_hash_table_insert (scanners, + g_strdup("043d"), + g_list_copy(lexmark)); + + + GList* genius = NULL; + genius = g_list_append (genius, g_strdup("2004")); + genius = g_list_append (genius, g_strdup("2007")); + genius = g_list_append (genius, g_strdup("2008")); + genius = g_list_append (genius, g_strdup("2009")); + genius = g_list_append (genius, g_strdup("2011")); + genius = g_list_append (genius, g_strdup("2013")); + genius = g_list_append (genius, g_strdup("2014")); + genius = g_list_append (genius, g_strdup("2015")); + genius = g_list_append (genius, g_strdup("2016")); + genius = g_list_append (genius, g_strdup("2017")); + genius = g_list_append (genius, g_strdup("201a")); + genius = g_list_append (genius, g_strdup("201b")); + genius = g_list_append (genius, g_strdup("201d")); + genius = g_list_append (genius, g_strdup("201e")); + genius = g_list_append (genius, g_strdup("201f")); + genius = g_list_append (genius, g_strdup("20c1")); + g_hash_table_insert (scanners, + g_strdup("0458"), + g_list_copy(genius)); + + GList* medion = NULL; + medion = g_list_append (medion, g_strdup("0377")); + g_hash_table_insert (scanners, + g_strdup("0461"), + g_list_copy(medion)); + + GList* trust = NULL; + trust = g_list_append (trust, g_strdup("1000")); + trust = g_list_append (trust, g_strdup("1002")); + g_hash_table_insert (scanners, + g_strdup("047b"), + g_list_copy(trust)); + + GList* kyocera = NULL; + kyocera = g_list_append (kyocera, g_strdup("0335")); + g_hash_table_insert (scanners, + g_strdup("0482"), + g_list_copy(kyocera)); + + GList* compaq = NULL; + compaq = g_list_append (compaq, g_strdup("001a")); + g_hash_table_insert (scanners, + g_strdup("049f"), + g_list_copy(compaq)); + GList* benq = NULL; + benq = g_list_append (benq, g_strdup("1a20")); + benq = g_list_append (benq, g_strdup("1a2a")); + benq = g_list_append (benq, g_strdup("2022")); + benq = g_list_append (benq, g_strdup("2040")); + benq = g_list_append (benq, g_strdup("2060")); + benq = g_list_append (benq, g_strdup("207e")); + benq = g_list_append (benq, g_strdup("20b0")); + benq = g_list_append (benq, g_strdup("20be")); + benq = g_list_append (benq, g_strdup("20c0")); + benq = g_list_append (benq, g_strdup("20de")); + benq = g_list_append (benq, g_strdup("20f8")); + benq = g_list_append (benq, g_strdup("20fc")); + benq = g_list_append (benq, g_strdup("20fe")); + benq = g_list_append (benq, g_strdup("2137")); + benq = g_list_append (benq, g_strdup("2211")); + g_hash_table_insert (scanners, + g_strdup("04a5"), + g_list_copy(benq)); + + GList* visioneer = NULL; + visioneer = g_list_append (visioneer, g_strdup("0229")); + visioneer = g_list_append (visioneer, g_strdup("0390")); + visioneer = g_list_append (visioneer, g_strdup("0420")); + visioneer = g_list_append (visioneer, g_strdup("0421")); + visioneer = g_list_append (visioneer, g_strdup("0422")); + visioneer = g_list_append (visioneer, g_strdup("0423")); + visioneer = g_list_append (visioneer, g_strdup("0424")); + visioneer = g_list_append (visioneer, g_strdup("0426")); + visioneer = g_list_append (visioneer, g_strdup("0427")); + visioneer = g_list_append (visioneer, g_strdup("0444")); + visioneer = g_list_append (visioneer, g_strdup("0446")); + visioneer = g_list_append (visioneer, g_strdup("0447")); + visioneer = g_list_append (visioneer, g_strdup("0448")); + visioneer = g_list_append (visioneer, g_strdup("0449")); + visioneer = g_list_append (visioneer, g_strdup("044c")); + visioneer = g_list_append (visioneer, g_strdup("0474")); + visioneer = g_list_append (visioneer, g_strdup("0475")); + visioneer = g_list_append (visioneer, g_strdup("0477")); + visioneer = g_list_append (visioneer, g_strdup("0478")); + visioneer = g_list_append (visioneer, g_strdup("0479")); + visioneer = g_list_append (visioneer, g_strdup("047a")); + visioneer = g_list_append (visioneer, g_strdup("047b")); + visioneer = g_list_append (visioneer, g_strdup("047c")); + visioneer = g_list_append (visioneer, g_strdup("048c")); + visioneer = g_list_append (visioneer, g_strdup("048d")); + visioneer = g_list_append (visioneer, g_strdup("048e")); + visioneer = g_list_append (visioneer, g_strdup("048f")); + visioneer = g_list_append (visioneer, g_strdup("0490")); + visioneer = g_list_append (visioneer, g_strdup("0491")); + visioneer = g_list_append (visioneer, g_strdup("0492")); + visioneer = g_list_append (visioneer, g_strdup("0493")); + visioneer = g_list_append (visioneer, g_strdup("0494")); + visioneer = g_list_append (visioneer, g_strdup("0495")); + visioneer = g_list_append (visioneer, g_strdup("0497")); + visioneer = g_list_append (visioneer, g_strdup("0498")); + visioneer = g_list_append (visioneer, g_strdup("0499")); + visioneer = g_list_append (visioneer, g_strdup("049a")); + visioneer = g_list_append (visioneer, g_strdup("049b")); + visioneer = g_list_append (visioneer, g_strdup("049c")); + visioneer = g_list_append (visioneer, g_strdup("049d")); + visioneer = g_list_append (visioneer, g_strdup("04a7")); + visioneer = g_list_append (visioneer, g_strdup("04ac")); + g_hash_table_insert (scanners, + g_strdup("04a7"), + g_list_copy(visioneer)); + +# Canon DR-2080C +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1601", ENV{libsane_matched}="yes" +# Canon CR-180 | Canon CR-180II +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1602", ENV{libsane_matched}="yes" +# Canon DR-9080C +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1603", ENV{libsane_matched}="yes" +# Canon DR-7080C +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1604", ENV{libsane_matched}="yes" +# Canon DR-5010C +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1606", ENV{libsane_matched}="yes" +# Canon DR-6080 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1607", ENV{libsane_matched}="yes" +# Canon DR-2580C +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1608", ENV{libsane_matched}="yes" +# Canon DR-3080CII +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1609", ENV{libsane_matched}="yes" +# Canon DR-2050C | Canon DR-2050SP +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="160a", ENV{libsane_matched}="yes" +# Canon DR-7580 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="160b", ENV{libsane_matched}="yes" +# Canon PIXMA MP750 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1706", ENV{libsane_matched}="yes" +# Canon PIXMA MP780 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1707", ENV{libsane_matched}="yes" +# Canon PIXMA MP760 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1708", ENV{libsane_matched}="yes" +# Canon PIXMA MP150 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1709", ENV{libsane_matched}="yes" +# Canon PIXMA MP170 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="170a", ENV{libsane_matched}="yes" +# Canon PIXMA MP450 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="170b", ENV{libsane_matched}="yes" +# Canon PIXMA MP500 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="170c", ENV{libsane_matched}="yes" +# Canon PIXMA MP800 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="170d", ENV{libsane_matched}="yes" +# Canon PIXMA MP800R +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="170e", ENV{libsane_matched}="yes" +# Canon PIXMA MP530 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1712", ENV{libsane_matched}="yes" +# Canon PIXMA MP830 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1713", ENV{libsane_matched}="yes" +# Canon PIXMA MP160 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1714", ENV{libsane_matched}="yes" +# Canon PIXMA MP180 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1715", ENV{libsane_matched}="yes" +# Canon PIXMA MP460 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1716", ENV{libsane_matched}="yes" +# Canon PIXMA MP510 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1717", ENV{libsane_matched}="yes" +# Canon PIXMA MP600 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1718", ENV{libsane_matched}="yes" +# Canon PIXMA MP600R +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1719", ENV{libsane_matched}="yes" +# Canon PIXMA MP810 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="171a", ENV{libsane_matched}="yes" +# Canon PIXMA MP960 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="171b", ENV{libsane_matched}="yes" +# Canon PIXMA MX7600 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="171c", ENV{libsane_matched}="yes" +# Canon PIXMA MP210 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1721", ENV{libsane_matched}="yes" +# Canon PIXMA MP220 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1722", ENV{libsane_matched}="yes" +# Canon PIXMA MP470 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1723", ENV{libsane_matched}="yes" +# Canon PIXMA MP520 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1724", ENV{libsane_matched}="yes" +# Canon PIXMA MP610 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1725", ENV{libsane_matched}="yes" +# Canon PIXMA MP970 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1726", ENV{libsane_matched}="yes" +# Canon PIXMA MX300 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1727", ENV{libsane_matched}="yes" +# Canon PIXMA MX310 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1728", ENV{libsane_matched}="yes" +# Canon PIXMA MX700 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1729", ENV{libsane_matched}="yes" +# Canon PIXMA MP140 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="172b", ENV{libsane_matched}="yes" +# Canon PIXMA MX850 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="172c", ENV{libsane_matched}="yes" +# Canon PIXMA MP980 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="172d", ENV{libsane_matched}="yes" +# Canon PIXMA MP630 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="172e", ENV{libsane_matched}="yes" +# Canon PIXMA MP620 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="172f", ENV{libsane_matched}="yes" +# Canon PIXMA MP540 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1730", ENV{libsane_matched}="yes" +# Canon PIXMA MP480 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1731", ENV{libsane_matched}="yes" +# Canon PIXMA MP240 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1732", ENV{libsane_matched}="yes" +# Canon PIXMA MP260 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1733", ENV{libsane_matched}="yes" +# Canon PIXMA MP190 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1734", ENV{libsane_matched}="yes" +# Canon PIXMA MX860 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1735", ENV{libsane_matched}="yes" +# Canon PIXMA MX320 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1736", ENV{libsane_matched}="yes" +# Canon PIXMA MX330 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1737", ENV{libsane_matched}="yes" +# Canon PIXMA MP250 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="173a", ENV{libsane_matched}="yes" +# Canon PIXMA MP270 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="173b", ENV{libsane_matched}="yes" +# Canon PIXMA MP490 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="173c", ENV{libsane_matched}="yes" +# Canon PIXMA MP550 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="173d", ENV{libsane_matched}="yes" +# Canon PIXMA MP560 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="173e", ENV{libsane_matched}="yes" +# Canon PIXMA MP640 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="173f", ENV{libsane_matched}="yes" +# Canon PIXMA MP990 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1740", ENV{libsane_matched}="yes" +# Canon PIXMA MX340 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1741", ENV{libsane_matched}="yes" +# Canon PIXMA MX350 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1742", ENV{libsane_matched}="yes" +# Canon PIXMA MX870 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1743", ENV{libsane_matched}="yes" +# Canon CanoScan 8800F +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1901", ENV{libsane_matched}="yes" +# Canon CanoScan LiDE 100 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1904", ENV{libsane_matched}="yes" +# Canon CanoScan LiDE 200 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1905", ENV{libsane_matched}="yes" +# Canon CanoScan LiDE 110 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1909", ENV{libsane_matched}="yes" +# Canon CanoScan LiDE 210 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="190a", ENV{libsane_matched}="yes" +# Canon CanoScan fb630u | Canon CanoScan fb636u +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="2204", ENV{libsane_matched}="yes" +# Canon CanoScan N650U/N656U +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="2206", ENV{libsane_matched}="yes" +# Canon CanoScan N1220U +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="2207", ENV{libsane_matched}="yes" +# Canon CanoScan D660U +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="2208", ENV{libsane_matched}="yes" +# Canon CanoScan N670U/N676U/LiDE20 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="220d", ENV{libsane_matched}="yes" +# Canon CanoScan N1240U/LiDE30 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="220e", ENV{libsane_matched}="yes" +# Canon CanoScan LiDE 35 | Canon CanoScan LiDE 40 | Canon CanoScan LiDE 50 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="2213", ENV{libsane_matched}="yes" +# Canon CanoScan LiDE 60 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="221c", ENV{libsane_matched}="yes" +# Canon CanoScan LiDE25 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="2220", ENV{libsane_matched}="yes" +# Canon DR-1210C +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="2222", ENV{libsane_matched}="yes" +# Canon PIXMA MP730 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="262f", ENV{libsane_matched}="yes" +# Canon PIXMA MP700 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="2630", ENV{libsane_matched}="yes" +# Canon PIXMA MP360 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="263c", ENV{libsane_matched}="yes" +# Canon PIXMA MP370 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="263d", ENV{libsane_matched}="yes" +# Canon PIXMA MP390 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="263e", ENV{libsane_matched}="yes" +# Canon PIXMA MP375R +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="263f", ENV{libsane_matched}="yes" +# Canon PIXMA MP740 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="264c", ENV{libsane_matched}="yes" +# Canon PIXMA MP710 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="264d", ENV{libsane_matched}="yes" +# Canon imageCLASS MF5630 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="264e", ENV{libsane_matched}="yes" +# Canon laserBase MF5650 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="264f", ENV{libsane_matched}="yes" +# Canon imageCLASS MF8170c +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="2659", ENV{libsane_matched}="yes" +# Canon imageCLASS MF5730 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="265d", ENV{libsane_matched}="yes" +# Canon imageCLASS MF5750 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="265e", ENV{libsane_matched}="yes" +# Canon imageCLASS MF5770 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="265f", ENV{libsane_matched}="yes" +# Canon imageCLASS MF3110 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="2660", ENV{libsane_matched}="yes" +# Canon imageCLASS MF3240 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="2684", ENV{libsane_matched}="yes" +# Canon imageCLASS MF6500 series +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="2686", ENV{libsane_matched}="yes" +# Canon imageCLASS MF4120 | Canon imageCLASS MF4122 | Canon imageCLASS MF4140 +# Canon imageCLASS MF4150 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="26a3", ENV{libsane_matched}="yes" +# Canon imageCLASS MF4690 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="26b0", ENV{libsane_matched}="yes" +# Canon imageCLASS MF4010 | Canon imageCLASS MF4018 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="26b4", ENV{libsane_matched}="yes" +# Canon imageCLASS MF4270 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="26b5", ENV{libsane_matched}="yes" +# Canon imageCLASS MF4370dn | Canon imageCLASS MF4380dn +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="26ec", ENV{libsane_matched}="yes" +# Canon imageCLASS D480 +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="26ed", ENV{libsane_matched}="yes" +# Canon I-SENSYS MF4320d | Canon I-SENSYS MF4330d | Canon imageCLASS MF4350d +ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="26ee", ENV{libsane_matched}="yes" +# Nikon LS 40 ED | Nikon LS 40 ED | Nikon Coolspan IV +ATTRS{idVendor}=="04b0", ATTRS{idProduct}=="4000", ENV{libsane_matched}="yes" +# Nikon LS 50 ED | Nikon Coolscan V ED | Nikon LS 50 ED +# Nikon Coolscan V ED +ATTRS{idVendor}=="04b0", ATTRS{idProduct}=="4001", ENV{libsane_matched}="yes" +# Nikon Super Coolscan LS-5000 ED | Nikon Super Coolscan LS-5000 ED +ATTRS{idVendor}=="04b0", ATTRS{idProduct}=="4002", ENV{libsane_matched}="yes" +# Epson Perfection 636U | Epson GT-7000U | Epson Perfection 636U +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0101", ENV{libsane_matched}="yes" +# Epson Perfection 610 | Epson GT-6600U | Epson Perfection 610 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0103", ENV{libsane_matched}="yes" +# Epson Perfection 1200U | Epson Perfection 1200Photo | Epson GT-7600U +# Epson GT-7600UF | Epson Perfection 1200U | Epson Perfection 1200U PHOTO +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0104", ENV{libsane_matched}="yes" +# Epson Stylus Scan 2000 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0105", ENV{libsane_matched}="yes" +# Epson Stylus Scan 2500 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0106", ENV{libsane_matched}="yes" +# Epson Expression 1600 | Epson ES-2000 | Epson Expression 1600 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0107", ENV{libsane_matched}="yes" +# Epson ES-8500 | Epson Expression 1640XL +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0109", ENV{libsane_matched}="yes" +# Epson Perfection 1640 | Epson GT-8700 | Epson GT-8700F +# Epson Perfection 1640SU | Epson Perfection 1640SU PHOTO +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="010a", ENV{libsane_matched}="yes" +# Epson Perfection 1240 | Epson GT-7700U | Epson Perfection 1240U +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="010b", ENV{libsane_matched}="yes" +# Epson Perfection 640 | Epson GT-6700U | Epson Perfection 640U +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="010c", ENV{libsane_matched}="yes" +# Epson Expression 1680 | Epson ES-2200 | Epson Expression 1680 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="010e", ENV{libsane_matched}="yes" +# Epson Perfection 1250 | Epson Perfection 1250Photo +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="010f", ENV{libsane_matched}="yes" +# Epson Perfection 1650 | Epson GT-8200U | Epson GT-8200UF +# Epson Perfection 1650 | Epson Perfection 1650 PHOTO +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0110", ENV{libsane_matched}="yes" +# Epson Perfection 2450 | Epson GT-9700F | Epson Perfection 2450 PHOTO +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0112", ENV{libsane_matched}="yes" +# Epson Perfection 660 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0114", ENV{libsane_matched}="yes" +# Epson Perfection 2400 | Epson GT-9300UF | Epson Perfection 2400 PHOTO +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="011b", ENV{libsane_matched}="yes" +# Epson Perfection 3200 | Epson GT-9800F | Epson Perfection 3200 PHOTO +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="011c", ENV{libsane_matched}="yes" +# Epson Perfection 1260 | Epson Perfection 1260Photo +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="011d", ENV{libsane_matched}="yes" +# Epson Perfection 1660 | Epson GT-8300UF | Epson Perfection 1660 PHOTO +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="011e", ENV{libsane_matched}="yes" +# Epson Perfection 1670 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="011f", ENV{libsane_matched}="yes" +# Epson Perfection 1270 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0120", ENV{libsane_matched}="yes" +# Epson Perfection 2480 | Epson Perfection 2580 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0121", ENV{libsane_matched}="yes" +# Epson Perfection 3490 | Epson Perfection 3590 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0122", ENV{libsane_matched}="yes" +# Epson ES-7000H | Epson GT-15000 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0126", ENV{libsane_matched}="yes" +# Epson Perfection 4870 | Epson GT-X700 | Epson Perfection 4870 PHOTO +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0128", ENV{libsane_matched}="yes" +# Epson ES-10000G | Epson Expression 10000XL +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0129", ENV{libsane_matched}="yes" +# Epson Perfection 4990 | Epson GT-X800 | Epson Perfection 4990 PHOTO +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="012a", ENV{libsane_matched}="yes" +# Epson ES-H300 | Epson GT-2500 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="012b", ENV{libsane_matched}="yes" +# Epson V700 | Epson V750 | Epson GT-X900 +# Epson Perfection V700 Photo | Epson Perfection V750 Photo +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="012c", ENV{libsane_matched}="yes" +# Epson GT-X970 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0135", ENV{libsane_matched}="yes" +# Epson CX-5200 | Epson CX-5400 | Epson CC-600PX +# Epson Stylus CX5100 | Epson Stylus CX5200 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0801", ENV{libsane_matched}="yes" +# Epson CX-3200 | Epson CC-570L | Epson Stylus CX3100 +# Epson Stylus CX3200 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0802", ENV{libsane_matched}="yes" +# Epson CX-6300 | Epson CX-6400 | Epson Stylus CX6300 +# Epson Stylus CX6400 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0805", ENV{libsane_matched}="yes" +# Epson RX-600 | Epson PM-A850 | Epson Stylus Photo RX600 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0806", ENV{libsane_matched}="yes" +# Epson RX-500 | Epson Stylus Photo RX500 | Epson Stylus Photo RX510 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0807", ENV{libsane_matched}="yes" +# Epson CX-5400 | Epson Stylus CX5300 | Epson Stylus CX5400 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0808", ENV{libsane_matched}="yes" +# Epson Stylus CX-1500 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="080c", ENV{libsane_matched}="yes" +# Epson CX-4600 | Epson Stylus CX4500 | Epson Stylus CX4600 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="080d", ENV{libsane_matched}="yes" +# Epson CX-3600 | Epson CX-3650 | Epson PX-A550 +# Epson Stylus CX3500 | Epson Stylus CX3600 | Epson Stylus CX3650 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="080e", ENV{libsane_matched}="yes" +# Epson RX-425 | Epson Stylus Photo RX420 | Epson Stylus Photo RX425 +# Epson Stylus Photo RX430 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="080f", ENV{libsane_matched}="yes" +# Epson RX-700 | Epson PM-A900 | Epson Stylus Photo RX700 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0810", ENV{libsane_matched}="yes" +# Epson RX-620 | Epson PM-A870 | Epson Stylus Photo RX620 +# Epson Stylus Photo RX630 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0811", ENV{libsane_matched}="yes" +# Epson CX-6500 | Epson CX-6600 | Epson Stylus CX6500 +# Epson Stylus CX6600 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0813", ENV{libsane_matched}="yes" +# Epson PM-A700 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0814", ENV{libsane_matched}="yes" +# Epson AcuLaser CX11 | Epson AcuLaser CX11NF | Epson AcuLaser CX11 +# Epson AcuLaser CX11NF | Epson LP-A500 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0815", ENV{libsane_matched}="yes" +# Epson LP-M5500 | Epson LP-M5500F +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0817", ENV{libsane_matched}="yes" +# Epson DX-3850 | Epson CX-3700 | Epson CX-3800 +# Epson DX-3800 | Epson Stylus CX3700 | Epson Stylus CX3800 +# Epson Stylus DX3800 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0818", ENV{libsane_matched}="yes" +# Epson CX-4800 | Epson PX-A650 | Epson Stylus CX4700 +# Epson Stylus CX4800 | Epson Stylus DX4800 | Epson Stylus DX4850 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0819", ENV{libsane_matched}="yes" +# Epson PM-A750 | Epson Stylus Photo RX520 | Epson Stylus Photo RX530 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="081a", ENV{libsane_matched}="yes" +# Epson PM-A890 | Epson Stylus Photo RX640 | Epson Stylus Photo RX650 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="081c", ENV{libsane_matched}="yes" +# Epson PM-A950 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="081d", ENV{libsane_matched}="yes" +# Epson Stylus CX7700 | Epson Stylus CX7800 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="081f", ENV{libsane_matched}="yes" +# Epson CX-4200 | Epson Stylus CX4100 | Epson Stylus CX4200 +# Epson Stylus DX4200 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0820", ENV{libsane_matched}="yes" +# Epson PM-A820 | Epson Stylus Photo RX560 | Epson Stylus Photo RX580 +# Epson Stylus Photo RX590 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0827", ENV{libsane_matched}="yes" +# Epson PM-A970 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0828", ENV{libsane_matched}="yes" +# Epson PM-T990 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0829", ENV{libsane_matched}="yes" +# Epson PM-A920 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="082a", ENV{libsane_matched}="yes" +# Epson CX-5000 | Epson DX-5000 | Epson DX-5050 +# Epson Stylus CX4900 | Epson Stylus CX5000 | Epson Stylus DX5000 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="082b", ENV{libsane_matched}="yes" +# Epson DX-6000 | Epson PX-A720 | Epson Stylus CX5900 +# Epson Stylus CX6000 | Epson Stylus DX6000 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="082e", ENV{libsane_matched}="yes" +# Epson DX-4050 | Epson PX-A620 | Epson Stylus CX3900 +# Epson Stylus DX4000 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="082f", ENV{libsane_matched}="yes" +# Epson ME 200 | Epson Stylus CX2800 | Epson Stylus CX2900 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0830", ENV{libsane_matched}="yes" +# Epson LP-M5600 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0833", ENV{libsane_matched}="yes" +# Epson LP-M6000 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0834", ENV{libsane_matched}="yes" +# Epson AcuLaser CX21 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0835", ENV{libsane_matched}="yes" +# Epson PM-T960 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0836", ENV{libsane_matched}="yes" +# Epson PM-A940 | Epson Stylus Photo RX680 | Epson Stylus Photo RX685 +# Epson Stylus Photo RX690 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0837", ENV{libsane_matched}="yes" +# Epson DX-7400 | Epson PX-A640 | Epson Stylus CX7300 +# Epson Stylus CX7400 | Epson Stylus DX7400 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0838", ENV{libsane_matched}="yes" +# Epson PX-A740 | Epson Stylus CX8300 | Epson Stylus CX8400 +# Epson Stylus DX8400 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0839", ENV{libsane_matched}="yes" +# Epson PX-FA700 | Epson Stylus CX9300F | Epson Stylus CX9400Fax +# Epson Stylus DX9400F +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="083a", ENV{libsane_matched}="yes" +# Epson PM-A840 | Epson PM-A840S | Epson Stylus Photo RX585 +# Epson Stylus Photo RX595 | Epson Stylus Photo RX610 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="083c", ENV{libsane_matched}="yes" +# Epson ME 300 | Epson PX-401A | Epson Stylus NX100 +# Epson Stylus SX100 | Epson Stylus TX100 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0841", ENV{libsane_matched}="yes" +# Epson LP-M5000 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0843", ENV{libsane_matched}="yes" +# Epson Artisan 800 | Epson EP-901A | Epson EP-901F +# Epson Stylus Photo PX800FW | Epson Stylus Photo TX800FW +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0844", ENV{libsane_matched}="yes" +# Epson Artisan 700 | Epson EP-801A | Epson Stylus Photo PX700W +# Epson Stylus Photo TX700W +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0846", ENV{libsane_matched}="yes" +# Epson ME Office 700FW | Epson PX-601F | Epson Stylus Office BX600FW +# Epson Stylus Office TX600FW | Epson Stylus SX600FW | Epson WorkForce 600 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0847", ENV{libsane_matched}="yes" +# Epson ME Office 600F | Epson Stylus Office BX300F | Epson Stylus Office TX300F +# Epson Stylus NX300 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0848", ENV{libsane_matched}="yes" +# Epson Stylus NX200 | Epson Stylus SX200 | Epson Stylus SX205 +# Epson Stylus TX200 | Epson Stylus TX203 | Epson Stylus TX209 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0849", ENV{libsane_matched}="yes" +# Epson PX-501A | Epson Stylus NX400 | Epson Stylus SX400 +# Epson Stylus SX405 | Epson Stylus TX400 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="084a", ENV{libsane_matched}="yes" +# Epson WorkForce 500 +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="084c", ENV{libsane_matched}="yes" +# Epson PX-402A | Epson Stylus NX110 Series | Epson Stylus SX110 Series +# Epson Stylus TX110 Series +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="084d", ENV{libsane_matched}="yes" +# Epson ME OFFICE 510 | Epson Stylus NX210 Series | Epson Stylus SX210 Series +# Epson Stylus TX210 Series +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="084f", ENV{libsane_matched}="yes" +# Epson Stylus NX410 Series | Epson Stylus SX410 Series | Epson Stylus TX410 Series +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0851", ENV{libsane_matched}="yes" +# Epson ME OFFICE 650FN Series | Epson Stylus Office BX310FN Series | Epson Stylus Office TX510FN Series +# Epson WorkForce 310 Series +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0854", ENV{libsane_matched}="yes" +# Epson PX-502A | Epson Stylus NX510 Series | Epson Stylus SX510W Series +# Epson Stylus TX550W Series +ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0856", ENV{libsane_matched}="yes" +# Fujitsu fi-4010CU +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1029", ENV{libsane_matched}="yes" +# Fujitsu fi-4120C +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1041", ENV{libsane_matched}="yes" +# Fujitsu fi-4220C +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1042", ENV{libsane_matched}="yes" +# Fujitsu fi-4530C +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1078", ENV{libsane_matched}="yes" +# Fujitsu fi-5750C +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1095", ENV{libsane_matched}="yes" +# Fujitsu fi-5110EOX/2 +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1096", ENV{libsane_matched}="yes" +# Fujitsu fi-5110C +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1097", ENV{libsane_matched}="yes" +# Fujitsu fi-5650C +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="10ad", ENV{libsane_matched}="yes" +# Fujitsu fi-4120C2 +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="10ae", ENV{libsane_matched}="yes" +# Fujitsu fi-4220C2 +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="10af", ENV{libsane_matched}="yes" +# Fujitsu fi-60F +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="10c7", ENV{libsane_matched}="yes" +# Fujitsu fi-4340C +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="10cf", ENV{libsane_matched}="yes" +# Fujitsu fi-5120C +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="10e0", ENV{libsane_matched}="yes" +# Fujitsu fi-5220C +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="10e1", ENV{libsane_matched}="yes" +# Fujitsu fi-5530C +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="10e2", ENV{libsane_matched}="yes" +# Fujitsu fi-5110EOX3 +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="10e6", ENV{libsane_matched}="yes" +# Fujitsu fi-5900C +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="10e7", ENV{libsane_matched}="yes" +# Fujitsu fi-5015C +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="10ef", ENV{libsane_matched}="yes" +# Fujitsu fi-5110EOXM +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="10f2", ENV{libsane_matched}="yes" +# Fujitsu ScanSnap S500 +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="10fe", ENV{libsane_matched}="yes" +# Fujitsu ScanSnap S500M +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1135", ENV{libsane_matched}="yes" +# Fujitsu fi-5530C2 +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="114a", ENV{libsane_matched}="yes" +# Fujitsu fi-6140 +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="114d", ENV{libsane_matched}="yes" +# Fujitsu fi-6240 +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="114e", ENV{libsane_matched}="yes" +# Fujitsu fi-6130 +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="114f", ENV{libsane_matched}="yes" +# Fujitsu fi-6230 +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1150", ENV{libsane_matched}="yes" +# Fujitsu ScanSnap S510 +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1155", ENV{libsane_matched}="yes" +# Fujitsu ScanSnap S300 +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1156", ENV{libsane_matched}="yes" +# Fujitsu ScanSnap S510M +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="116f", ENV{libsane_matched}="yes" +# Fujitsu fi-6770 +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1174", ENV{libsane_matched}="yes" +# Fujitsu fi-6770A +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1175", ENV{libsane_matched}="yes" +# Fujitsu fi-6670 +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1176", ENV{libsane_matched}="yes" +# Fujitsu fi-6670A +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1177", ENV{libsane_matched}="yes" +# Fujitsu fi-6750S +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1178", ENV{libsane_matched}="yes" +# Fujitsu ScanSnap S300M +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="117f", ENV{libsane_matched}="yes" +# Fujitsu fi-6800 +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="119d", ENV{libsane_matched}="yes" +# Fujitsu fi-6800-CGA +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="119e", ENV{libsane_matched}="yes" +# Fujitsu fi-6900 +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="119f", ENV{libsane_matched}="yes" +# Fujitsu fi-6900-CGA +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="11a0", ENV{libsane_matched}="yes" +# Fujitsu ScanSnap S1500 | Fujitsu ScanSnap S1500M +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="11a2", ENV{libsane_matched}="yes" +# Fujitsu ScanSnap S1300 +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="11ed", ENV{libsane_matched}="yes" +# Fujitsu fi-6125 +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="11ee", ENV{libsane_matched}="yes" +# Fujitsu fi-6225 +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="11ef", ENV{libsane_matched}="yes" +# Fujitsu fi-6145 +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="11f1", ENV{libsane_matched}="yes" +# Fujitsu fi-6245 +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="11f2", ENV{libsane_matched}="yes" +# Fujitsu fi-6135 +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="11f3", ENV{libsane_matched}="yes" +# Fujitsu fi-6235 +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="11f4", ENV{libsane_matched}="yes" +# Fujitsu fi-6110 +ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="11fc", ENV{libsane_matched}="yes" +# Konica e-mini +ATTRS{idVendor}=="04c8", ATTRS{idProduct}=="0722", ENV{libsane_matched}="yes" +# Panasonic KV-S2026C +ATTRS{idVendor}=="04da", ATTRS{idProduct}=="1000", ENV{libsane_matched}="yes" +# Panasonic KV-S2046C +ATTRS{idVendor}=="04da", ATTRS{idProduct}=="1001", ENV{libsane_matched}="yes" +# Panasonic KV-S1025C +ATTRS{idVendor}=="04da", ATTRS{idProduct}=="1006", ENV{libsane_matched}="yes" +# Panasonic KV-S1020C +ATTRS{idVendor}=="04da", ATTRS{idProduct}=="1007", ENV{libsane_matched}="yes" +# Panasonic KV-S2048C +ATTRS{idVendor}=="04da", ATTRS{idProduct}=="1009", ENV{libsane_matched}="yes" +# Panasonic KV-S2028C +ATTRS{idVendor}=="04da", ATTRS{idProduct}=="100a", ENV{libsane_matched}="yes" +# Panasonic KV-SS080 +ATTRS{idVendor}=="04da", ATTRS{idProduct}=="100f", ENV{libsane_matched}="yes" +# Panasonic KV-S1045C +ATTRS{idVendor}=="04da", ATTRS{idProduct}=="1010", ENV{libsane_matched}="yes" +# Samsung SCX-4200 +ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="341b", ENV{libsane_matched}="yes" +# Samsung SCX4725-FN +ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="341f", ENV{libsane_matched}="yes" +# Samsung SCX-4500 +ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="3426", ENV{libsane_matched}="yes" +# Samsung CLX-3170fn | Samsung CLX-3175FW +ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="342a", ENV{libsane_matched}="yes" +# Samsung SCX-4500W +ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="342b", ENV{libsane_matched}="yes" +# Samsung SCX-4824 +ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="342c", ENV{libsane_matched}="yes" +# Samsung SCX-4300 +ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="342e", ENV{libsane_matched}="yes" +# Samsung SCX-4600 +ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="3433", ENV{libsane_matched}="yes" +# Samsung SCX-4623 +ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="3434", ENV{libsane_matched}="yes" +# Samsung SCX-4825FN +ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="343c", ENV{libsane_matched}="yes" +# Samsung SCX-4623FW +ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="3440", ENV{libsane_matched}="yes" +# Pentax DSmobile 600 +ATTRS{idVendor}=="04f9", ATTRS{idProduct}=="2038", ENV{libsane_matched}="yes" +# Aiptek Aiptek Pencam +ATTRS{idVendor}=="0553", ATTRS{idProduct}=="0202", ENV{libsane_matched}="yes" +# Mustek ScanExpress 1200 CU +ATTRS{idVendor}=="055f", ATTRS{idProduct}=="0001", ENV{libsane_matched}="yes" +# Mustek ScanExpress 600 CU +ATTRS{idVendor}=="055f", ATTRS{idProduct}=="0002", ENV{libsane_matched}="yes" +# Mustek ScanExpress 1200 UB | Trust Compact Scan USB 19200 +ATTRS{idVendor}=="055f", ATTRS{idProduct}=="0006", ENV{libsane_matched}="yes" +# Mustek ScanExpress 1200 CU Plus +ATTRS{idVendor}=="055f", ATTRS{idProduct}=="0008", ENV{libsane_matched}="yes" +# Mustek BearPaw 1200 F +ATTRS{idVendor}=="055f", ATTRS{idProduct}=="0010", ENV{libsane_matched}="yes" +# Mustek ScanExpress A3 USB +ATTRS{idVendor}=="055f", ATTRS{idProduct}=="0210", ENV{libsane_matched}="yes" +# Mustek BearPaw 2400 CS | Mustek BearPaw 2400 TA | Trust 240TH Easy Webscan Gold +ATTRS{idVendor}=="055f", ATTRS{idProduct}=="0218", ENV{libsane_matched}="yes" +# Mustek BearPaw 2400 CS Plus | Mustek BearPaw 2400 TA Plus | Mustek Plug-n-Scan 2400 MT +# Mustek Plug-n-Scan 2400 M | Packard Bell Diamond 2450 +ATTRS{idVendor}=="055f", ATTRS{idProduct}=="0219", ENV{libsane_matched}="yes" +# Mustek BearPaw 2448 CS Plus | Mustek BearPaw 2448 TA Plus +ATTRS{idVendor}=="055f", ATTRS{idProduct}=="021a", ENV{libsane_matched}="yes" +# Mustek BearPaw 1200 CU Plus | Packard Bell Diamond 1200 Plus +ATTRS{idVendor}=="055f", ATTRS{idProduct}=="021b", ENV{libsane_matched}="yes" +# Mustek BearPaw 1200 CU Plus | Mustek BearPaw 1248 CU | Packard Bell Diamond 1200 Plus +# Trust Direct WebScan 19200 +ATTRS{idVendor}=="055f", ATTRS{idProduct}=="021c", ENV{libsane_matched}="yes" +# Mustek BearPaw 2400 CU Plus +ATTRS{idVendor}=="055f", ATTRS{idProduct}=="021d", ENV{libsane_matched}="yes" +# Mustek BearPaw 1200 CS | Mustek BearPaw 1200 TA +ATTRS{idVendor}=="055f", ATTRS{idProduct}=="021e", ENV{libsane_matched}="yes" +# Mustek ScanExpress 1248 UB +ATTRS{idVendor}=="055f", ATTRS{idProduct}=="021f", ENV{libsane_matched}="yes" +# Mustek BearPaw 2448TA Pro +ATTRS{idVendor}=="055f", ATTRS{idProduct}=="0409", ENV{libsane_matched}="yes" +# Artec/Ultima Ultima 2000 | Artec/Ultima Ultima 2000 e+ | Boeder Sm@rtScan Slim Edition +# Fujitsu 1200CUS | Googlegear 2000 | Medion/Lifetec/Tevion/Cytron MD 4394 +# Medion/Lifetec/Tevion/Cytron MD/LT 9375 | Medion/Lifetec/Tevion/Cytron MD/LT 9385 | Medion/Lifetec/Tevion/Cytron LT 9452 +# Medion/Lifetec/Tevion/Cytron MD 9458 | Mustek BearPaw 1200 CU | Mustek BearPaw 2400 CU +# Mustek ScanExpress 1200 UB Plus | Mustek ScanExpress 2400 USB | Mustek ScanMagic 1200 UB Plus +# Packard Bell Diamond 1200 | Trust Compact Scan USB 19200 | Trust Flat Scan USB 19200 +ATTRS{idVendor}=="05d8", ATTRS{idProduct}=="4002", ENV{libsane_matched}="yes" +# Artec/Ultima E+ 48U | Medion/Lifetec/Tevion/Cytron MD9693 | Medion/Lifetec/Tevion/Cytron MD9705 +# Medion/Lifetec/Tevion/Cytron MD4394 | Microstar MR 9791 +ATTRS{idVendor}=="05d8", ATTRS{idProduct}=="4003", ENV{libsane_matched}="yes" +# Artec/Ultima E+ Pro +ATTRS{idVendor}=="05d8", ATTRS{idProduct}=="4004", ENV{libsane_matched}="yes" +# Memorex MEM 48U +ATTRS{idVendor}=="05d8", ATTRS{idProduct}=="4005", ENV{libsane_matched}="yes" +# Trust Easy Webscan 19200 +ATTRS{idVendor}=="05d8", ATTRS{idProduct}=="4006", ENV{libsane_matched}="yes" +# Trust 240H Easy Webscan Gold +ATTRS{idVendor}=="05d8", ATTRS{idProduct}=="4007", ENV{libsane_matched}="yes" +# UMAX AstraSlim SE +ATTRS{idVendor}=="05d8", ATTRS{idProduct}=="4009", ENV{libsane_matched}="yes" +# UMAX AstraSlim 1200 SE +ATTRS{idVendor}=="05d8", ATTRS{idProduct}=="4010", ENV{libsane_matched}="yes" +# Yakumo Scan50 +ATTRS{idVendor}=="05d8", ATTRS{idProduct}=="4011", ENV{libsane_matched}="yes" +# Microtek ScanMaker X6USB +ATTRS{idVendor}=="05da", ATTRS{idProduct}=="0099", ENV{libsane_matched}="yes" +# Microtek SlimScan C6 +ATTRS{idVendor}=="05da", ATTRS{idProduct}=="009a", ENV{libsane_matched}="yes" +# Microtek ScanMaker V6USL +ATTRS{idVendor}=="05da", ATTRS{idProduct}=="00a3", ENV{libsane_matched}="yes" +# Microtek ScanMaker V6UPL +ATTRS{idVendor}=="05da", ATTRS{idProduct}=="00b6", ENV{libsane_matched}="yes" +# Microtek ScanMaker 4800 +ATTRS{idVendor}=="05da", ATTRS{idProduct}=="30cf", ENV{libsane_matched}="yes" +# Microtek ScanMaker 3840 +ATTRS{idVendor}=="05da", ATTRS{idProduct}=="30d4", ENV{libsane_matched}="yes" +# Microtek ScanMaker 3600 +ATTRS{idVendor}=="05da", ATTRS{idProduct}=="40b3", ENV{libsane_matched}="yes" +# Microtek ScanMaker 3700 +ATTRS{idVendor}=="05da", ATTRS{idProduct}=="40b8", ENV{libsane_matched}="yes" +# Microtek ScanMaker 3600 +ATTRS{idVendor}=="05da", ATTRS{idProduct}=="40ca", ENV{libsane_matched}="yes" +# Microtek ScanMaker 3700 +ATTRS{idVendor}=="05da", ATTRS{idProduct}=="40cb", ENV{libsane_matched}="yes" +# Microtek ScanMaker 3750 +ATTRS{idVendor}=="05da", ATTRS{idProduct}=="40dd", ENV{libsane_matched}="yes" +# Microtek ScanMaker 3600 +ATTRS{idVendor}=="05da", ATTRS{idProduct}=="40ff", ENV{libsane_matched}="yes" +# Microtek ScanMaker V6USL +ATTRS{idVendor}=="05da", ATTRS{idProduct}=="80a3", ENV{libsane_matched}="yes" +# iVina 1200U +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0268", ENV{libsane_matched}="yes" +# Minolta Dimage Scan Dual II +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="026a", ENV{libsane_matched}="yes" +# Avision AV600U +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a13", ENV{libsane_matched}="yes" +# Minolta-QMS SC-110 +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a15", ENV{libsane_matched}="yes" +# Avision DS610CU Scancopier | Minolta-QMS SC-215 | OKI S700 Scancopier +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a16", ENV{libsane_matched}="yes" +# Avision AV600U Plus +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a18", ENV{libsane_matched}="yes" +# Avision AV610 +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a19", ENV{libsane_matched}="yes" +# Avision AV220 +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a23", ENV{libsane_matched}="yes" +# Avision AV210 +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a24", ENV{libsane_matched}="yes" +# Avision AV210 +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a25", ENV{libsane_matched}="yes" +# Avision AV120 +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a27", ENV{libsane_matched}="yes" +# Avision AV220C2 +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a2a", ENV{libsane_matched}="yes" +# Avision AV220D2 +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a2b", ENV{libsane_matched}="yes" +# Avision AV220+ +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a2c", ENV{libsane_matched}="yes" +# Avision AV220C2-G +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a2d", ENV{libsane_matched}="yes" +# Avision AV220C2-B +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a2e", ENV{libsane_matched}="yes" +# Avision AV210C2-G +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a2f", ENV{libsane_matched}="yes" +# Avision AV122 +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a33", ENV{libsane_matched}="yes" +# Avision AV210C2 +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a3a", ENV{libsane_matched}="yes" +# Avision AV121 +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a3c", ENV{libsane_matched}="yes" +# Avision AV8300 +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a40", ENV{libsane_matched}="yes" +# Avision AM3000 Series +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a41", ENV{libsane_matched}="yes" +# Avision @V5100 +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a45", ENV{libsane_matched}="yes" +# Avision AV8050U +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a4d", ENV{libsane_matched}="yes" +# Avision AV3200SU +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a4e", ENV{libsane_matched}="yes" +# Avision AV3730SU +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a4f", ENV{libsane_matched}="yes" +# Avision AV610C2 +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a5e", ENV{libsane_matched}="yes" +# Avision IT8300 +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a61", ENV{libsane_matched}="yes" +# Avision AV3750SU +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a65", ENV{libsane_matched}="yes" +# Avision AV3850SU +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a66", ENV{libsane_matched}="yes" +# Avision AV8350 +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a68", ENV{libsane_matched}="yes" +# Avision FB6080E +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a82", ENV{libsane_matched}="yes" +# Avision FB2080E +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a84", ENV{libsane_matched}="yes" +# Avision AV122 C2 +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a93", ENV{libsane_matched}="yes" +# Avision AV220-G +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a94", ENV{libsane_matched}="yes" +# Avision @V2500 +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0aa1", ENV{libsane_matched}="yes" +# Avision AV210D2+ +ATTRS{idVendor}=="0638", ATTRS{idProduct}=="1a35", ENV{libsane_matched}="yes" +# Minolta Elite II +ATTRS{idVendor}=="0686", ATTRS{idProduct}=="4004", ENV{libsane_matched}="yes" +# Minolta Dimage Scan Dual III +ATTRS{idVendor}=="0686", ATTRS{idProduct}=="400d", ENV{libsane_matched}="yes" +# Minolta Dimage Scan Elite 5400 +ATTRS{idVendor}=="0686", ATTRS{idProduct}=="400e", ENV{libsane_matched}="yes" +# AGFA SnapScan 1212U +ATTRS{idVendor}=="06bd", ATTRS{idProduct}=="0001", ENV{libsane_matched}="yes" +# AGFA SnapScan 1236u +ATTRS{idVendor}=="06bd", ATTRS{idProduct}=="0002", ENV{libsane_matched}="yes" +# Agfa Snapscan Touch +ATTRS{idVendor}=="06bd", ATTRS{idProduct}=="0100", ENV{libsane_matched}="yes" +# AGFA SnapScan 1212U_2 +ATTRS{idVendor}=="06bd", ATTRS{idProduct}=="2061", ENV{libsane_matched}="yes" +# AGFA SnapScan e40 +ATTRS{idVendor}=="06bd", ATTRS{idProduct}=="208d", ENV{libsane_matched}="yes" +# AGFA SnapScan e50 +ATTRS{idVendor}=="06bd", ATTRS{idProduct}=="208f", ENV{libsane_matched}="yes" +# AGFA SnapScan e20 +ATTRS{idVendor}=="06bd", ATTRS{idProduct}=="2091", ENV{libsane_matched}="yes" +# AGFA SnapScan e10 +ATTRS{idVendor}=="06bd", ATTRS{idProduct}=="2093", ENV{libsane_matched}="yes" +# AGFA SnapScan e25 +ATTRS{idVendor}=="06bd", ATTRS{idProduct}=="2095", ENV{libsane_matched}="yes" +# AGFA SnapScan e26 +ATTRS{idVendor}=="06bd", ATTRS{idProduct}=="2097", ENV{libsane_matched}="yes" +# AGFA SnapScan e52 +ATTRS{idVendor}=="06bd", ATTRS{idProduct}=="20fd", ENV{libsane_matched}="yes" +# AGFA SnapScan e42 +ATTRS{idVendor}=="06bd", ATTRS{idProduct}=="20ff", ENV{libsane_matched}="yes" +# UMAX Astra 4900 +ATTRS{idVendor}=="06dc", ATTRS{idProduct}=="0020", ENV{libsane_matched}="yes" +# Plustek OpticPro U12 | Plustek OpticPro UT12 | Plustek OpticPro 1212U +# RevScan RevScan Orange R48Ti | Genius ColorPage Vivid III USB +ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0001", ENV{libsane_matched}="yes" +# Plustek OpticPro U12 +ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0010", ENV{libsane_matched}="yes" +# Plustek OpticPro U24 +ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0011", ENV{libsane_matched}="yes" +# Plustek OpticPro UT12 +ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0013", ENV{libsane_matched}="yes" +# Plustek OpticPro U24 +ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0015", ENV{libsane_matched}="yes" +# Plustek OpticPro UT12 | Plustek OpticPro UT16 | Plustek OpticPro UT24 +ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0017", ENV{libsane_matched}="yes" +# Plustek OpticPro 1248U | RevScan 19200i +ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0400", ENV{libsane_matched}="yes" +# Plustek OpticPro 1248U +ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0401", ENV{libsane_matched}="yes" +# Plustek OpticPro U16B +ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0402", ENV{libsane_matched}="yes" +# Plustek OpticPro U16B+ | Plustek OpticPro UT16B +ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0403", ENV{libsane_matched}="yes" +# Nortek MyScan 1200 | Plustek OpticPro S12 | Plustek OpticPro ST12 +ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="040b", ENV{libsane_matched}="yes" +# Plustek OpticPro S24 +ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="040e", ENV{libsane_matched}="yes" +# NeatReceipts Scanalizer Professional 2.5 | Plustek OpticSlim M12 +ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0412", ENV{libsane_matched}="yes" +# Plustek OpticSlim 1200 +ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0413", ENV{libsane_matched}="yes" +# Plustek OpticSlim 2400 +ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0422", ENV{libsane_matched}="yes" +# Plustek OpticSlim 2400 plus +ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0454", ENV{libsane_matched}="yes" +# Plustek Iriscan Express 2 +ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="045f", ENV{libsane_matched}="yes" +# NeatReceipts Mobile Scanner +ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0462", ENV{libsane_matched}="yes" +# Plustek OpticBook 3600 +ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0900", ENV{libsane_matched}="yes" +# Corex 600c +ATTRS{idVendor}=="08f0", ATTRS{idProduct}=="0002", ENV{libsane_matched}="yes" +# Corex 800c +ATTRS{idVendor}=="08f0", ATTRS{idProduct}=="0005", ENV{libsane_matched}="yes" +# Xerox Phaser 6110MFP +ATTRS{idVendor}=="0924", ATTRS{idProduct}=="3d5d", ENV{libsane_matched}="yes" +# Xerox Phaser 3200MFP +ATTRS{idVendor}=="0924", ATTRS{idProduct}=="3da4", ENV{libsane_matched}="yes" +# Xerox WorkCentre 4118 Series +ATTRS{idVendor}=="0924", ATTRS{idProduct}=="420c", ENV{libsane_matched}="yes" +# Xerox WorkCentre 3119 Series +ATTRS{idVendor}=="0924", ATTRS{idProduct}=="4265", ENV{libsane_matched}="yes" +# Xerox WorkCentre 3210 +ATTRS{idVendor}=="0924", ATTRS{idProduct}=="4293", ENV{libsane_matched}="yes" +# Xerox WorkCentre 3220 +ATTRS{idVendor}=="0924", ATTRS{idProduct}=="4294", ENV{libsane_matched}="yes" +# Pentax DSmobile 600 +ATTRS{idVendor}=="0a17", ATTRS{idProduct}=="3210", ENV{libsane_matched}="yes" +# Portable Peripheral Co., Ltd. Q-Scan USB001 (A4 portable scanner) +ATTRS{idVendor}=="0a53", ATTRS{idProduct}=="1000", ENV{libsane_matched}="yes" +# Syscan TravelScan 460/464 | Ambir Visigo A4 +ATTRS{idVendor}=="0a82", ATTRS{idProduct}=="4600", ENV{libsane_matched}="yes" +# Syscan DocketPort 465 +ATTRS{idVendor}=="0a82", ATTRS{idProduct}=="4802", ENV{libsane_matched}="yes" +# Syscan DocketPort 665 +ATTRS{idVendor}=="0a82", ATTRS{idProduct}=="4803", ENV{libsane_matched}="yes" +# Syscan DocketPort 685/ Ambir DS685 +ATTRS{idVendor}=="0a82", ATTRS{idProduct}=="480c", ENV{libsane_matched}="yes" +# Syscan DocketPort 485 +ATTRS{idVendor}=="0a82", ATTRS{idProduct}=="4810", ENV{libsane_matched}="yes" +# Syscan TravelScan 662 +ATTRS{idVendor}=="0a82", ATTRS{idProduct}=="6620", ENV{libsane_matched}="yes" +# Canon CR-55 +ATTRS{idVendor}=="1083", ATTRS{idProduct}=="160c", ENV{libsane_matched}="yes" +# Canon DR-1210C +ATTRS{idVendor}=="1083", ATTRS{idProduct}=="160f", ENV{libsane_matched}="yes" +# Canon DR-4010C +ATTRS{idVendor}=="1083", ATTRS{idProduct}=="1614", ENV{libsane_matched}="yes" +# Canon DR-2510C +ATTRS{idVendor}=="1083", ATTRS{idProduct}=="1617", ENV{libsane_matched}="yes" +# Canon DR-X10C +ATTRS{idVendor}=="1083", ATTRS{idProduct}=="1618", ENV{libsane_matched}="yes" +# Canon CR-25 +ATTRS{idVendor}=="1083", ATTRS{idProduct}=="161a", ENV{libsane_matched}="yes" +# Canon DR-2010C +ATTRS{idVendor}=="1083", ATTRS{idProduct}=="161b", ENV{libsane_matched}="yes" +# Canon DR-3010C +ATTRS{idVendor}=="1083", ATTRS{idProduct}=="161d", ENV{libsane_matched}="yes" +# Canon DR-7090C +ATTRS{idVendor}=="1083", ATTRS{idProduct}=="1620", ENV{libsane_matched}="yes" +# Canon DR-9050C +ATTRS{idVendor}=="1083", ATTRS{idProduct}=="1622", ENV{libsane_matched}="yes" +# Canon DR-7550C +ATTRS{idVendor}=="1083", ATTRS{idProduct}=="1623", ENV{libsane_matched}="yes" +# Canon DR-6050C +ATTRS{idVendor}=="1083", ATTRS{idProduct}=="1624", ENV{libsane_matched}="yes" +# Canon DR-6010C +ATTRS{idVendor}=="1083", ATTRS{idProduct}=="1626", ENV{libsane_matched}="yes" +# Canon CR-190i +ATTRS{idVendor}=="1083", ATTRS{idProduct}=="162b", ENV{libsane_matched}="yes" +# Canon DR-6030C +ATTRS{idVendor}=="1083", ATTRS{idProduct}=="1638", ENV{libsane_matched}="yes" +# Canon CR-135i +ATTRS{idVendor}=="1083", ATTRS{idProduct}=="1639", ENV{libsane_matched}="yes" +# Digital Dream l' espion XS +ATTRS{idVendor}=="1183", ATTRS{idProduct}=="0001", ENV{libsane_matched}="yes" +# KONICA MINOLTA magicolor 1690MF +ATTRS{idVendor}=="132b", ATTRS{idProduct}=="2089", ENV{libsane_matched}="yes" +# UMAX Astra 1220U +ATTRS{idVendor}=="1606", ATTRS{idProduct}=="0010", ENV{libsane_matched}="yes" +# UMAX Astra 1600U | UMAX Astra 2000U +ATTRS{idVendor}=="1606", ATTRS{idProduct}=="0030", ENV{libsane_matched}="yes" +# Umax UMAX 3400 +ATTRS{idVendor}=="1606", ATTRS{idProduct}=="0050", ENV{libsane_matched}="yes" +# Umax UMAX 3400 | Umax UMAX Astranet ia101 | Umax UMAX 3450 +ATTRS{idVendor}=="1606", ATTRS{idProduct}=="0060", ENV{libsane_matched}="yes" +# UMAX Astra 4400 | UMAX Astra 4450 +ATTRS{idVendor}=="1606", ATTRS{idProduct}=="0070", ENV{libsane_matched}="yes" +# UMAX Astra 2100U +ATTRS{idVendor}=="1606", ATTRS{idProduct}=="0130", ENV{libsane_matched}="yes" +# Umax UMAX 5400 +ATTRS{idVendor}=="1606", ATTRS{idProduct}=="0160", ENV{libsane_matched}="yes" +# UMAX Astra 2200 (SU) +ATTRS{idVendor}=="1606", ATTRS{idProduct}=="0230", ENV{libsane_matched}="yes" +# DCT DocketPort 487 +ATTRS{idVendor}=="1dcc", ATTRS{idProduct}=="4810", ENV{libsane_matched}="yes" +# Dell A920 +ATTRS{idVendor}=="413c", ATTRS{idProduct}=="5105", ENV{libsane_matched}="yes" +# Dell Dell MFP Laser Printer 1815dn +ATTRS{idVendor}=="413c", ATTRS{idProduct}=="5124", ENV{libsane_matched}="yes" +# Dell 1600n +ATTRS{idVendor}=="413c", ATTRS{idProduct}=="5250", ENV{libsane_matched}="yes" + epson = g_list_append (epson, g_strdup("0101")); epson = g_list_append (epson, g_strdup("0103")); epson = g_list_append (epson, g_strdup("0104")); -- cgit v1.2.3 From 8abccb8353d0fb473956e6967e345eacc4d6c812 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Mon, 1 Aug 2011 12:05:19 +0100 Subject: usb scanner rules almost there --- src/sane-rules.h | 919 +++++++++++++++++++------------------------------------ 1 file changed, 318 insertions(+), 601 deletions(-) diff --git a/src/sane-rules.h b/src/sane-rules.h index 92c7ad7..ae361b8 100644 --- a/src/sane-rules.h +++ b/src/sane-rules.h @@ -1,9 +1,7 @@ void populate_usb_scanners (GHashTable* scanners) { - GList* epson = NULL; GList* hp = NULL; - hp = g_list_append (hp, g_strdup ("0101")); hp = g_list_append (hp, g_strdup ("0105")); hp = g_list_append (hp, g_strdup ("0201")); @@ -201,593 +199,325 @@ void populate_usb_scanners (GHashTable* scanners) g_hash_table_insert (scanners, g_strdup("04a7"), g_list_copy(visioneer)); + GList* canon = NULL; + canon = g_list_append (canon, g_strdup("1601")); + canon = g_list_append (canon, g_strdup("1602")); + canon = g_list_append (canon, g_strdup("1603")); + canon = g_list_append (canon, g_strdup("1604")); + canon = g_list_append (canon, g_strdup("1606")); + canon = g_list_append (canon, g_strdup("1607")); + canon = g_list_append (canon, g_strdup("1608")); + canon = g_list_append (canon, g_strdup("1609")); + canon = g_list_append (canon, g_strdup("160a")); + canon = g_list_append (canon, g_strdup("160b")); + canon = g_list_append (canon, g_strdup("1706")); + canon = g_list_append (canon, g_strdup("1707")); + canon = g_list_append (canon, g_strdup("1708")); + canon = g_list_append (canon, g_strdup("1709")); + canon = g_list_append (canon, g_strdup("170a")); + canon = g_list_append (canon, g_strdup("170b")); + canon = g_list_append (canon, g_strdup("170c")); + canon = g_list_append (canon, g_strdup("170d")); + canon = g_list_append (canon, g_strdup("170e")); + canon = g_list_append (canon, g_strdup("1712")); + canon = g_list_append (canon, g_strdup("1713")); + canon = g_list_append (canon, g_strdup("1714")); + canon = g_list_append (canon, g_strdup("1715")); + canon = g_list_append (canon, g_strdup("1716")); + canon = g_list_append (canon, g_strdup("1717")); + canon = g_list_append (canon, g_strdup("1718")); + canon = g_list_append (canon, g_strdup("1719")); + canon = g_list_append (canon, g_strdup("171a")); + canon = g_list_append (canon, g_strdup("171b")); + canon = g_list_append (canon, g_strdup("171c")); + canon = g_list_append (canon, g_strdup("1721")); + canon = g_list_append (canon, g_strdup("1722")); + canon = g_list_append (canon, g_strdup("1723")); + canon = g_list_append (canon, g_strdup("1724")); + canon = g_list_append (canon, g_strdup("1725")); + canon = g_list_append (canon, g_strdup("1726")); + canon = g_list_append (canon, g_strdup("1727")); + canon = g_list_append (canon, g_strdup("1728")); + canon = g_list_append (canon, g_strdup("1729")); + canon = g_list_append (canon, g_strdup("172b")); + canon = g_list_append (canon, g_strdup("172c")); + canon = g_list_append (canon, g_strdup("172d")); + canon = g_list_append (canon, g_strdup("172e")); + canon = g_list_append (canon, g_strdup("172f")); + canon = g_list_append (canon, g_strdup("1730")); + canon = g_list_append (canon, g_strdup("1731")); + canon = g_list_append (canon, g_strdup("1732")); + canon = g_list_append (canon, g_strdup("1733")); + canon = g_list_append (canon, g_strdup("1734")); + canon = g_list_append (canon, g_strdup("1735")); + canon = g_list_append (canon, g_strdup("1736")); + canon = g_list_append (canon, g_strdup("173a")); + canon = g_list_append (canon, g_strdup("173b")); + canon = g_list_append (canon, g_strdup("173c")); + canon = g_list_append (canon, g_strdup("173d")); + canon = g_list_append (canon, g_strdup("173e")); + canon = g_list_append (canon, g_strdup("173f")); + canon = g_list_append (canon, g_strdup("1740")); + canon = g_list_append (canon, g_strdup("1741")); + canon = g_list_append (canon, g_strdup("1742")); + canon = g_list_append (canon, g_strdup("1901")); + canon = g_list_append (canon, g_strdup("1904")); + canon = g_list_append (canon, g_strdup("1905")); + canon = g_list_append (canon, g_strdup("1909")); + canon = g_list_append (canon, g_strdup("190a")); + canon = g_list_append (canon, g_strdup("2204")); + canon = g_list_append (canon, g_strdup("2206")); + canon = g_list_append (canon, g_strdup("2207")); + canon = g_list_append (canon, g_strdup("2208")); + canon = g_list_append (canon, g_strdup("220d")); + canon = g_list_append (canon, g_strdup("220e")); + canon = g_list_append (canon, g_strdup("2213")); + canon = g_list_append (canon, g_strdup("221c")); + canon = g_list_append (canon, g_strdup("2220")); + canon = g_list_append (canon, g_strdup("2222")); + canon = g_list_append (canon, g_strdup("262f")); + canon = g_list_append (canon, g_strdup("2630")); + canon = g_list_append (canon, g_strdup("263c")); + canon = g_list_append (canon, g_strdup("263d")); + canon = g_list_append (canon, g_strdup("263e")); + canon = g_list_append (canon, g_strdup("263f")); + canon = g_list_append (canon, g_strdup("264c")); + canon = g_list_append (canon, g_strdup("264d")); + canon = g_list_append (canon, g_strdup("264e")); + canon = g_list_append (canon, g_strdup("264f")); + canon = g_list_append (canon, g_strdup("2659")); + canon = g_list_append (canon, g_strdup("265d")); + canon = g_list_append (canon, g_strdup("265e")); + canon = g_list_append (canon, g_strdup("265f")); + canon = g_list_append (canon, g_strdup("2660")); + canon = g_list_append (canon, g_strdup("2684")); + canon = g_list_append (canon, g_strdup("2686")); + canon = g_list_append (canon, g_strdup("26a3")); + canon = g_list_append (canon, g_strdup("26b0")); + canon = g_list_append (canon, g_strdup("26b4")); + canon = g_list_append (canon, g_strdup("26b5")); + canon = g_list_append (canon, g_strdup("26ec")); + canon = g_list_append (canon, g_strdup("26ed")); + canon = g_list_append (canon, g_strdup("26ee")); + g_hash_table_insert (scanners, + g_strdup("04a9"), + g_list_copy(canon)); + + GList* nikon = NULL; + nikon = g_list_append (nikon, g_strdup ("4000")); + nikon = g_list_append (nikon, g_strdup ("4001")); + nikon = g_list_append (nikon, g_strdup ("4002")); + g_hash_table_insert (scanners, + g_strdup("04b0"), + g_list_copy(nikon)); + + GList* epson = NULL; + epson = g_list_append (epson, g_strdup("0101")); + epson = g_list_append (epson, g_strdup("0103")); + epson = g_list_append (epson, g_strdup("0104")); + epson = g_list_append (epson, g_strdup("0105")); + epson = g_list_append (epson, g_strdup("0106")); + epson = g_list_append (epson, g_strdup("0107")); + epson = g_list_append (epson, g_strdup("0109")); + epson = g_list_append (epson, g_strdup("010a")); + epson = g_list_append (epson, g_strdup("010b")); + epson = g_list_append (epson, g_strdup("010c")); + epson = g_list_append (epson, g_strdup("010e")); + epson = g_list_append (epson, g_strdup("010f")); + epson = g_list_append (epson, g_strdup("0110")); + epson = g_list_append (epson, g_strdup("0112")); + epson = g_list_append (epson, g_strdup("0114")); + epson = g_list_append (epson, g_strdup("011b")); + epson = g_list_append (epson, g_strdup("011c")); + epson = g_list_append (epson, g_strdup("011d")); + epson = g_list_append (epson, g_strdup("011e")); + epson = g_list_append (epson, g_strdup("011f")); + epson = g_list_append (epson, g_strdup("0120")); + epson = g_list_append (epson, g_strdup("0121")); + epson = g_list_append (epson, g_strdup("0122")); + epson = g_list_append (epson, g_strdup("0126")); + epson = g_list_append (epson, g_strdup("0128")); + epson = g_list_append (epson, g_strdup("0129")); + epson = g_list_append (epson, g_strdup("012a")); + epson = g_list_append (epson, g_strdup("012b")); + epson = g_list_append (epson, g_strdup("012c")); + epson = g_list_append (epson, g_strdup("0135")); + epson = g_list_append (epson, g_strdup("0801")); + epson = g_list_append (epson, g_strdup("0802")); + epson = g_list_append (epson, g_strdup("0805")); + epson = g_list_append (epson, g_strdup("0806")); + epson = g_list_append (epson, g_strdup("0807")); + epson = g_list_append (epson, g_strdup("0808")); + epson = g_list_append (epson, g_strdup("080c")); + epson = g_list_append (epson, g_strdup("080d")); + epson = g_list_append (epson, g_strdup("080e")); + epson = g_list_append (epson, g_strdup("080f")); + epson = g_list_append (epson, g_strdup("0810")); + epson = g_list_append (epson, g_strdup("0811")); + epson = g_list_append (epson, g_strdup("0813")); + epson = g_list_append (epson, g_strdup("0814")); + epson = g_list_append (epson, g_strdup("0815")); + epson = g_list_append (epson, g_strdup("0817")); + epson = g_list_append (epson, g_strdup("0818")); + epson = g_list_append (epson, g_strdup("0819")); + epson = g_list_append (epson, g_strdup("081a")); + epson = g_list_append (epson, g_strdup("081c")); + epson = g_list_append (epson, g_strdup("081d")); + epson = g_list_append (epson, g_strdup("081f")); + epson = g_list_append (epson, g_strdup("0820")); + epson = g_list_append (epson, g_strdup("0827")); + epson = g_list_append (epson, g_strdup("0828")); + epson = g_list_append (epson, g_strdup("0829")); + epson = g_list_append (epson, g_strdup("082a")); + epson = g_list_append (epson, g_strdup("082b")); + epson = g_list_append (epson, g_strdup("082e")); + epson = g_list_append (epson, g_strdup("082f")); + epson = g_list_append (epson, g_strdup("0830")); + epson = g_list_append (epson, g_strdup("0833")); + epson = g_list_append (epson, g_strdup("0834")); + epson = g_list_append (epson, g_strdup("0835")); + epson = g_list_append (epson, g_strdup("0836")); + epson = g_list_append (epson, g_strdup("0837")); + epson = g_list_append (epson, g_strdup("0838")); + epson = g_list_append (epson, g_strdup("0839")); + epson = g_list_append (epson, g_strdup("083a")); + epson = g_list_append (epson, g_strdup("083c")); + epson = g_list_append (epson, g_strdup("0841")); + epson = g_list_append (epson, g_strdup("0843")); + epson = g_list_append (epson, g_strdup("0844")); + epson = g_list_append (epson, g_strdup("0846")); + epson = g_list_append (epson, g_strdup("0847")); + epson = g_list_append (epson, g_strdup("0848")); + epson = g_list_append (epson, g_strdup("0849")); + epson = g_list_append (epson, g_strdup("084a")); + epson = g_list_append (epson, g_strdup("084c")); + epson = g_list_append (epson, g_strdup("084d")); + epson = g_list_append (epson, g_strdup("084f")); + epson = g_list_append (epson, g_strdup("0851")); + epson = g_list_append (epson, g_strdup("0854")); + epson = g_list_append (epson, g_strdup("0856")); + g_hash_table_insert (scanners, + g_strdup("04b8"), + g_list_copy(epson)); + + GList* fujitsu = NULL; + fujitsu = g_list_append (fujitsu, g_strdup ("1029")); + fujitsu = g_list_append (fujitsu, g_strdup ("1041")); + fujitsu = g_list_append (fujitsu, g_strdup ("1042")); + fujitsu = g_list_append (fujitsu, g_strdup ("1078")); + fujitsu = g_list_append (fujitsu, g_strdup ("1095")); + fujitsu = g_list_append (fujitsu, g_strdup ("1096")); + fujitsu = g_list_append (fujitsu, g_strdup ("1097")); + fujitsu = g_list_append (fujitsu, g_strdup ("10ad")); + fujitsu = g_list_append (fujitsu, g_strdup ("10ae")); + fujitsu = g_list_append (fujitsu, g_strdup ("10af")); + fujitsu = g_list_append (fujitsu, g_strdup ("10c7")); + fujitsu = g_list_append (fujitsu, g_strdup ("10cf")); + fujitsu = g_list_append (fujitsu, g_strdup ("10e0")); + fujitsu = g_list_append (fujitsu, g_strdup ("10e1")); + fujitsu = g_list_append (fujitsu, g_strdup ("10e2")); + fujitsu = g_list_append (fujitsu, g_strdup ("10e6")); + fujitsu = g_list_append (fujitsu, g_strdup ("10e7")); + fujitsu = g_list_append (fujitsu, g_strdup ("10ef")); + fujitsu = g_list_append (fujitsu, g_strdup ("10f2")); + fujitsu = g_list_append (fujitsu, g_strdup ("10fe")); + fujitsu = g_list_append (fujitsu, g_strdup ("1135")); + fujitsu = g_list_append (fujitsu, g_strdup ("114a")); + fujitsu = g_list_append (fujitsu, g_strdup ("114d")); + fujitsu = g_list_append (fujitsu, g_strdup ("114e")); + fujitsu = g_list_append (fujitsu, g_strdup ("114f")); + fujitsu = g_list_append (fujitsu, g_strdup ("1150")); + fujitsu = g_list_append (fujitsu, g_strdup ("1155")); + fujitsu = g_list_append (fujitsu, g_strdup ("1156")); + fujitsu = g_list_append (fujitsu, g_strdup ("116f")); + fujitsu = g_list_append (fujitsu, g_strdup ("1174")); + fujitsu = g_list_append (fujitsu, g_strdup ("1175")); + fujitsu = g_list_append (fujitsu, g_strdup ("1176")); + fujitsu = g_list_append (fujitsu, g_strdup ("1177")); + fujitsu = g_list_append (fujitsu, g_strdup ("1178")); + fujitsu = g_list_append (fujitsu, g_strdup ("117f")); + fujitsu = g_list_append (fujitsu, g_strdup ("119d")); + fujitsu = g_list_append (fujitsu, g_strdup ("119e")); + fujitsu = g_list_append (fujitsu, g_strdup ("119f")); + fujitsu = g_list_append (fujitsu, g_strdup ("11a0")); + fujitsu = g_list_append (fujitsu, g_strdup ("11a2")); + fujitsu = g_list_append (fujitsu, g_strdup ("11ed")); + fujitsu = g_list_append (fujitsu, g_strdup ("11ee")); + fujitsu = g_list_append (fujitsu, g_strdup ("11ef")); + fujitsu = g_list_append (fujitsu, g_strdup ("11f1")); + fujitsu = g_list_append (fujitsu, g_strdup ("11f2")); + fujitsu = g_list_append (fujitsu, g_strdup ("11f3")); + fujitsu = g_list_append (fujitsu, g_strdup ("11f4")); + fujitsu = g_list_append (fujitsu, g_strdup ("11fc")); + g_hash_table_insert (scanners, + g_strdup("04c5"), + g_list_copy(fujitsu)); + GList* konica = NULL; + konica = g_list_append (konica, g_strdup ("0722")); + g_hash_table_insert (scanners, + g_strdup("04c8"), + g_list_copy(konica)); + GList* panasonic = NULL; + panasonic = g_list_append (panasonic, g_strdup ("1000")); + panasonic = g_list_append (panasonic, g_strdup ("1001")); + panasonic = g_list_append (panasonic, g_strdup ("1006")); + panasonic = g_list_append (panasonic, g_strdup ("1007")); + panasonic = g_list_append (panasonic, g_strdup ("1009")); + panasonic = g_list_append (panasonic, g_strdup ("100a")); + panasonic = g_list_append (panasonic, g_strdup ("100f")); + panasonic = g_list_append (panasonic, g_strdup ("1010")); + g_hash_table_insert (scanners, + g_strdup("04da"), + g_list_copy(panasonic)); + + GList* samsung = NULL; + + samsung = g_list_append (samsung, g_strdup ("341b")); + samsung = g_list_append (samsung, g_strdup ("341f")); + samsung = g_list_append (samsung, g_strdup ("3426")); + samsung = g_list_append (samsung, g_strdup ("342a")); + samsung = g_list_append (samsung, g_strdup ("342b")); + samsung = g_list_append (samsung, g_strdup ("342c")); + samsung = g_list_append (samsung, g_strdup ("3433")); + samsung = g_list_append (samsung, g_strdup ("3434")); + samsung = g_list_append (samsung, g_strdup ("343c")); + samsung = g_list_append (samsung, g_strdup ("3434")); + g_hash_table_insert (scanners, + g_strdup("04e8"), + g_list_copy(samsung)); + + GList* pentax; + pentax = g_list_append (pentax, g_strdup ("2038")); + g_hash_table_insert (scanners, + g_strdup("04f9"), + g_list_copy(pentax)); + + GList* apitek; + apitek = g_list_append (apitek, g_strdup ("0202")); + g_hash_table_insert (scanners, + g_strdup("0553"), + g_list_copy(apitek)); + + GList* mustek; + mustek = g_list_append (mustek, g_strdup ("0001")); + mustek = g_list_append (mustek, g_strdup ("0002")); + mustek = g_list_append (mustek, g_strdup ("0006")); + mustek = g_list_append (mustek, g_strdup ("0008")); + mustek = g_list_append (mustek, g_strdup ("0010")); + mustek = g_list_append (mustek, g_strdup ("0210")); + mustek = g_list_append (mustek, g_strdup ("0218")); + mustek = g_list_append (mustek, g_strdup ("0219")); + mustek = g_list_append (mustek, g_strdup ("021a")); + mustek = g_list_append (mustek, g_strdup ("021b")); + mustek = g_list_append (mustek, g_strdup ("021c")); + mustek = g_list_append (mustek, g_strdup ("021d")); + mustek = g_list_append (mustek, g_strdup ("021e")); + mustek = g_list_append (mustek, g_strdup ("021f")); + mustek = g_list_append (mustek, g_strdup ("0409")); + g_hash_table_insert (scanners, + g_strdup("055f"), + g_list_copy(mustek)); -# Canon DR-2080C -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1601", ENV{libsane_matched}="yes" -# Canon CR-180 | Canon CR-180II -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1602", ENV{libsane_matched}="yes" -# Canon DR-9080C -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1603", ENV{libsane_matched}="yes" -# Canon DR-7080C -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1604", ENV{libsane_matched}="yes" -# Canon DR-5010C -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1606", ENV{libsane_matched}="yes" -# Canon DR-6080 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1607", ENV{libsane_matched}="yes" -# Canon DR-2580C -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1608", ENV{libsane_matched}="yes" -# Canon DR-3080CII -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1609", ENV{libsane_matched}="yes" -# Canon DR-2050C | Canon DR-2050SP -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="160a", ENV{libsane_matched}="yes" -# Canon DR-7580 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="160b", ENV{libsane_matched}="yes" -# Canon PIXMA MP750 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1706", ENV{libsane_matched}="yes" -# Canon PIXMA MP780 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1707", ENV{libsane_matched}="yes" -# Canon PIXMA MP760 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1708", ENV{libsane_matched}="yes" -# Canon PIXMA MP150 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1709", ENV{libsane_matched}="yes" -# Canon PIXMA MP170 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="170a", ENV{libsane_matched}="yes" -# Canon PIXMA MP450 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="170b", ENV{libsane_matched}="yes" -# Canon PIXMA MP500 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="170c", ENV{libsane_matched}="yes" -# Canon PIXMA MP800 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="170d", ENV{libsane_matched}="yes" -# Canon PIXMA MP800R -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="170e", ENV{libsane_matched}="yes" -# Canon PIXMA MP530 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1712", ENV{libsane_matched}="yes" -# Canon PIXMA MP830 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1713", ENV{libsane_matched}="yes" -# Canon PIXMA MP160 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1714", ENV{libsane_matched}="yes" -# Canon PIXMA MP180 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1715", ENV{libsane_matched}="yes" -# Canon PIXMA MP460 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1716", ENV{libsane_matched}="yes" -# Canon PIXMA MP510 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1717", ENV{libsane_matched}="yes" -# Canon PIXMA MP600 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1718", ENV{libsane_matched}="yes" -# Canon PIXMA MP600R -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1719", ENV{libsane_matched}="yes" -# Canon PIXMA MP810 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="171a", ENV{libsane_matched}="yes" -# Canon PIXMA MP960 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="171b", ENV{libsane_matched}="yes" -# Canon PIXMA MX7600 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="171c", ENV{libsane_matched}="yes" -# Canon PIXMA MP210 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1721", ENV{libsane_matched}="yes" -# Canon PIXMA MP220 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1722", ENV{libsane_matched}="yes" -# Canon PIXMA MP470 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1723", ENV{libsane_matched}="yes" -# Canon PIXMA MP520 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1724", ENV{libsane_matched}="yes" -# Canon PIXMA MP610 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1725", ENV{libsane_matched}="yes" -# Canon PIXMA MP970 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1726", ENV{libsane_matched}="yes" -# Canon PIXMA MX300 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1727", ENV{libsane_matched}="yes" -# Canon PIXMA MX310 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1728", ENV{libsane_matched}="yes" -# Canon PIXMA MX700 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1729", ENV{libsane_matched}="yes" -# Canon PIXMA MP140 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="172b", ENV{libsane_matched}="yes" -# Canon PIXMA MX850 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="172c", ENV{libsane_matched}="yes" -# Canon PIXMA MP980 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="172d", ENV{libsane_matched}="yes" -# Canon PIXMA MP630 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="172e", ENV{libsane_matched}="yes" -# Canon PIXMA MP620 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="172f", ENV{libsane_matched}="yes" -# Canon PIXMA MP540 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1730", ENV{libsane_matched}="yes" -# Canon PIXMA MP480 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1731", ENV{libsane_matched}="yes" -# Canon PIXMA MP240 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1732", ENV{libsane_matched}="yes" -# Canon PIXMA MP260 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1733", ENV{libsane_matched}="yes" -# Canon PIXMA MP190 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1734", ENV{libsane_matched}="yes" -# Canon PIXMA MX860 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1735", ENV{libsane_matched}="yes" -# Canon PIXMA MX320 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1736", ENV{libsane_matched}="yes" -# Canon PIXMA MX330 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1737", ENV{libsane_matched}="yes" -# Canon PIXMA MP250 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="173a", ENV{libsane_matched}="yes" -# Canon PIXMA MP270 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="173b", ENV{libsane_matched}="yes" -# Canon PIXMA MP490 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="173c", ENV{libsane_matched}="yes" -# Canon PIXMA MP550 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="173d", ENV{libsane_matched}="yes" -# Canon PIXMA MP560 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="173e", ENV{libsane_matched}="yes" -# Canon PIXMA MP640 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="173f", ENV{libsane_matched}="yes" -# Canon PIXMA MP990 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1740", ENV{libsane_matched}="yes" -# Canon PIXMA MX340 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1741", ENV{libsane_matched}="yes" -# Canon PIXMA MX350 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1742", ENV{libsane_matched}="yes" -# Canon PIXMA MX870 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1743", ENV{libsane_matched}="yes" -# Canon CanoScan 8800F -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1901", ENV{libsane_matched}="yes" -# Canon CanoScan LiDE 100 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1904", ENV{libsane_matched}="yes" -# Canon CanoScan LiDE 200 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1905", ENV{libsane_matched}="yes" -# Canon CanoScan LiDE 110 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="1909", ENV{libsane_matched}="yes" -# Canon CanoScan LiDE 210 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="190a", ENV{libsane_matched}="yes" -# Canon CanoScan fb630u | Canon CanoScan fb636u -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="2204", ENV{libsane_matched}="yes" -# Canon CanoScan N650U/N656U -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="2206", ENV{libsane_matched}="yes" -# Canon CanoScan N1220U -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="2207", ENV{libsane_matched}="yes" -# Canon CanoScan D660U -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="2208", ENV{libsane_matched}="yes" -# Canon CanoScan N670U/N676U/LiDE20 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="220d", ENV{libsane_matched}="yes" -# Canon CanoScan N1240U/LiDE30 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="220e", ENV{libsane_matched}="yes" -# Canon CanoScan LiDE 35 | Canon CanoScan LiDE 40 | Canon CanoScan LiDE 50 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="2213", ENV{libsane_matched}="yes" -# Canon CanoScan LiDE 60 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="221c", ENV{libsane_matched}="yes" -# Canon CanoScan LiDE25 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="2220", ENV{libsane_matched}="yes" -# Canon DR-1210C -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="2222", ENV{libsane_matched}="yes" -# Canon PIXMA MP730 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="262f", ENV{libsane_matched}="yes" -# Canon PIXMA MP700 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="2630", ENV{libsane_matched}="yes" -# Canon PIXMA MP360 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="263c", ENV{libsane_matched}="yes" -# Canon PIXMA MP370 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="263d", ENV{libsane_matched}="yes" -# Canon PIXMA MP390 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="263e", ENV{libsane_matched}="yes" -# Canon PIXMA MP375R -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="263f", ENV{libsane_matched}="yes" -# Canon PIXMA MP740 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="264c", ENV{libsane_matched}="yes" -# Canon PIXMA MP710 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="264d", ENV{libsane_matched}="yes" -# Canon imageCLASS MF5630 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="264e", ENV{libsane_matched}="yes" -# Canon laserBase MF5650 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="264f", ENV{libsane_matched}="yes" -# Canon imageCLASS MF8170c -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="2659", ENV{libsane_matched}="yes" -# Canon imageCLASS MF5730 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="265d", ENV{libsane_matched}="yes" -# Canon imageCLASS MF5750 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="265e", ENV{libsane_matched}="yes" -# Canon imageCLASS MF5770 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="265f", ENV{libsane_matched}="yes" -# Canon imageCLASS MF3110 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="2660", ENV{libsane_matched}="yes" -# Canon imageCLASS MF3240 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="2684", ENV{libsane_matched}="yes" -# Canon imageCLASS MF6500 series -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="2686", ENV{libsane_matched}="yes" -# Canon imageCLASS MF4120 | Canon imageCLASS MF4122 | Canon imageCLASS MF4140 -# Canon imageCLASS MF4150 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="26a3", ENV{libsane_matched}="yes" -# Canon imageCLASS MF4690 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="26b0", ENV{libsane_matched}="yes" -# Canon imageCLASS MF4010 | Canon imageCLASS MF4018 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="26b4", ENV{libsane_matched}="yes" -# Canon imageCLASS MF4270 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="26b5", ENV{libsane_matched}="yes" -# Canon imageCLASS MF4370dn | Canon imageCLASS MF4380dn -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="26ec", ENV{libsane_matched}="yes" -# Canon imageCLASS D480 -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="26ed", ENV{libsane_matched}="yes" -# Canon I-SENSYS MF4320d | Canon I-SENSYS MF4330d | Canon imageCLASS MF4350d -ATTRS{idVendor}=="04a9", ATTRS{idProduct}=="26ee", ENV{libsane_matched}="yes" -# Nikon LS 40 ED | Nikon LS 40 ED | Nikon Coolspan IV -ATTRS{idVendor}=="04b0", ATTRS{idProduct}=="4000", ENV{libsane_matched}="yes" -# Nikon LS 50 ED | Nikon Coolscan V ED | Nikon LS 50 ED -# Nikon Coolscan V ED -ATTRS{idVendor}=="04b0", ATTRS{idProduct}=="4001", ENV{libsane_matched}="yes" -# Nikon Super Coolscan LS-5000 ED | Nikon Super Coolscan LS-5000 ED -ATTRS{idVendor}=="04b0", ATTRS{idProduct}=="4002", ENV{libsane_matched}="yes" -# Epson Perfection 636U | Epson GT-7000U | Epson Perfection 636U -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0101", ENV{libsane_matched}="yes" -# Epson Perfection 610 | Epson GT-6600U | Epson Perfection 610 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0103", ENV{libsane_matched}="yes" -# Epson Perfection 1200U | Epson Perfection 1200Photo | Epson GT-7600U -# Epson GT-7600UF | Epson Perfection 1200U | Epson Perfection 1200U PHOTO -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0104", ENV{libsane_matched}="yes" -# Epson Stylus Scan 2000 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0105", ENV{libsane_matched}="yes" -# Epson Stylus Scan 2500 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0106", ENV{libsane_matched}="yes" -# Epson Expression 1600 | Epson ES-2000 | Epson Expression 1600 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0107", ENV{libsane_matched}="yes" -# Epson ES-8500 | Epson Expression 1640XL -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0109", ENV{libsane_matched}="yes" -# Epson Perfection 1640 | Epson GT-8700 | Epson GT-8700F -# Epson Perfection 1640SU | Epson Perfection 1640SU PHOTO -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="010a", ENV{libsane_matched}="yes" -# Epson Perfection 1240 | Epson GT-7700U | Epson Perfection 1240U -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="010b", ENV{libsane_matched}="yes" -# Epson Perfection 640 | Epson GT-6700U | Epson Perfection 640U -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="010c", ENV{libsane_matched}="yes" -# Epson Expression 1680 | Epson ES-2200 | Epson Expression 1680 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="010e", ENV{libsane_matched}="yes" -# Epson Perfection 1250 | Epson Perfection 1250Photo -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="010f", ENV{libsane_matched}="yes" -# Epson Perfection 1650 | Epson GT-8200U | Epson GT-8200UF -# Epson Perfection 1650 | Epson Perfection 1650 PHOTO -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0110", ENV{libsane_matched}="yes" -# Epson Perfection 2450 | Epson GT-9700F | Epson Perfection 2450 PHOTO -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0112", ENV{libsane_matched}="yes" -# Epson Perfection 660 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0114", ENV{libsane_matched}="yes" -# Epson Perfection 2400 | Epson GT-9300UF | Epson Perfection 2400 PHOTO -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="011b", ENV{libsane_matched}="yes" -# Epson Perfection 3200 | Epson GT-9800F | Epson Perfection 3200 PHOTO -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="011c", ENV{libsane_matched}="yes" -# Epson Perfection 1260 | Epson Perfection 1260Photo -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="011d", ENV{libsane_matched}="yes" -# Epson Perfection 1660 | Epson GT-8300UF | Epson Perfection 1660 PHOTO -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="011e", ENV{libsane_matched}="yes" -# Epson Perfection 1670 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="011f", ENV{libsane_matched}="yes" -# Epson Perfection 1270 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0120", ENV{libsane_matched}="yes" -# Epson Perfection 2480 | Epson Perfection 2580 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0121", ENV{libsane_matched}="yes" -# Epson Perfection 3490 | Epson Perfection 3590 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0122", ENV{libsane_matched}="yes" -# Epson ES-7000H | Epson GT-15000 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0126", ENV{libsane_matched}="yes" -# Epson Perfection 4870 | Epson GT-X700 | Epson Perfection 4870 PHOTO -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0128", ENV{libsane_matched}="yes" -# Epson ES-10000G | Epson Expression 10000XL -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0129", ENV{libsane_matched}="yes" -# Epson Perfection 4990 | Epson GT-X800 | Epson Perfection 4990 PHOTO -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="012a", ENV{libsane_matched}="yes" -# Epson ES-H300 | Epson GT-2500 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="012b", ENV{libsane_matched}="yes" -# Epson V700 | Epson V750 | Epson GT-X900 -# Epson Perfection V700 Photo | Epson Perfection V750 Photo -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="012c", ENV{libsane_matched}="yes" -# Epson GT-X970 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0135", ENV{libsane_matched}="yes" -# Epson CX-5200 | Epson CX-5400 | Epson CC-600PX -# Epson Stylus CX5100 | Epson Stylus CX5200 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0801", ENV{libsane_matched}="yes" -# Epson CX-3200 | Epson CC-570L | Epson Stylus CX3100 -# Epson Stylus CX3200 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0802", ENV{libsane_matched}="yes" -# Epson CX-6300 | Epson CX-6400 | Epson Stylus CX6300 -# Epson Stylus CX6400 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0805", ENV{libsane_matched}="yes" -# Epson RX-600 | Epson PM-A850 | Epson Stylus Photo RX600 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0806", ENV{libsane_matched}="yes" -# Epson RX-500 | Epson Stylus Photo RX500 | Epson Stylus Photo RX510 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0807", ENV{libsane_matched}="yes" -# Epson CX-5400 | Epson Stylus CX5300 | Epson Stylus CX5400 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0808", ENV{libsane_matched}="yes" -# Epson Stylus CX-1500 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="080c", ENV{libsane_matched}="yes" -# Epson CX-4600 | Epson Stylus CX4500 | Epson Stylus CX4600 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="080d", ENV{libsane_matched}="yes" -# Epson CX-3600 | Epson CX-3650 | Epson PX-A550 -# Epson Stylus CX3500 | Epson Stylus CX3600 | Epson Stylus CX3650 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="080e", ENV{libsane_matched}="yes" -# Epson RX-425 | Epson Stylus Photo RX420 | Epson Stylus Photo RX425 -# Epson Stylus Photo RX430 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="080f", ENV{libsane_matched}="yes" -# Epson RX-700 | Epson PM-A900 | Epson Stylus Photo RX700 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0810", ENV{libsane_matched}="yes" -# Epson RX-620 | Epson PM-A870 | Epson Stylus Photo RX620 -# Epson Stylus Photo RX630 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0811", ENV{libsane_matched}="yes" -# Epson CX-6500 | Epson CX-6600 | Epson Stylus CX6500 -# Epson Stylus CX6600 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0813", ENV{libsane_matched}="yes" -# Epson PM-A700 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0814", ENV{libsane_matched}="yes" -# Epson AcuLaser CX11 | Epson AcuLaser CX11NF | Epson AcuLaser CX11 -# Epson AcuLaser CX11NF | Epson LP-A500 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0815", ENV{libsane_matched}="yes" -# Epson LP-M5500 | Epson LP-M5500F -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0817", ENV{libsane_matched}="yes" -# Epson DX-3850 | Epson CX-3700 | Epson CX-3800 -# Epson DX-3800 | Epson Stylus CX3700 | Epson Stylus CX3800 -# Epson Stylus DX3800 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0818", ENV{libsane_matched}="yes" -# Epson CX-4800 | Epson PX-A650 | Epson Stylus CX4700 -# Epson Stylus CX4800 | Epson Stylus DX4800 | Epson Stylus DX4850 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0819", ENV{libsane_matched}="yes" -# Epson PM-A750 | Epson Stylus Photo RX520 | Epson Stylus Photo RX530 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="081a", ENV{libsane_matched}="yes" -# Epson PM-A890 | Epson Stylus Photo RX640 | Epson Stylus Photo RX650 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="081c", ENV{libsane_matched}="yes" -# Epson PM-A950 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="081d", ENV{libsane_matched}="yes" -# Epson Stylus CX7700 | Epson Stylus CX7800 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="081f", ENV{libsane_matched}="yes" -# Epson CX-4200 | Epson Stylus CX4100 | Epson Stylus CX4200 -# Epson Stylus DX4200 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0820", ENV{libsane_matched}="yes" -# Epson PM-A820 | Epson Stylus Photo RX560 | Epson Stylus Photo RX580 -# Epson Stylus Photo RX590 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0827", ENV{libsane_matched}="yes" -# Epson PM-A970 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0828", ENV{libsane_matched}="yes" -# Epson PM-T990 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0829", ENV{libsane_matched}="yes" -# Epson PM-A920 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="082a", ENV{libsane_matched}="yes" -# Epson CX-5000 | Epson DX-5000 | Epson DX-5050 -# Epson Stylus CX4900 | Epson Stylus CX5000 | Epson Stylus DX5000 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="082b", ENV{libsane_matched}="yes" -# Epson DX-6000 | Epson PX-A720 | Epson Stylus CX5900 -# Epson Stylus CX6000 | Epson Stylus DX6000 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="082e", ENV{libsane_matched}="yes" -# Epson DX-4050 | Epson PX-A620 | Epson Stylus CX3900 -# Epson Stylus DX4000 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="082f", ENV{libsane_matched}="yes" -# Epson ME 200 | Epson Stylus CX2800 | Epson Stylus CX2900 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0830", ENV{libsane_matched}="yes" -# Epson LP-M5600 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0833", ENV{libsane_matched}="yes" -# Epson LP-M6000 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0834", ENV{libsane_matched}="yes" -# Epson AcuLaser CX21 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0835", ENV{libsane_matched}="yes" -# Epson PM-T960 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0836", ENV{libsane_matched}="yes" -# Epson PM-A940 | Epson Stylus Photo RX680 | Epson Stylus Photo RX685 -# Epson Stylus Photo RX690 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0837", ENV{libsane_matched}="yes" -# Epson DX-7400 | Epson PX-A640 | Epson Stylus CX7300 -# Epson Stylus CX7400 | Epson Stylus DX7400 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0838", ENV{libsane_matched}="yes" -# Epson PX-A740 | Epson Stylus CX8300 | Epson Stylus CX8400 -# Epson Stylus DX8400 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0839", ENV{libsane_matched}="yes" -# Epson PX-FA700 | Epson Stylus CX9300F | Epson Stylus CX9400Fax -# Epson Stylus DX9400F -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="083a", ENV{libsane_matched}="yes" -# Epson PM-A840 | Epson PM-A840S | Epson Stylus Photo RX585 -# Epson Stylus Photo RX595 | Epson Stylus Photo RX610 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="083c", ENV{libsane_matched}="yes" -# Epson ME 300 | Epson PX-401A | Epson Stylus NX100 -# Epson Stylus SX100 | Epson Stylus TX100 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0841", ENV{libsane_matched}="yes" -# Epson LP-M5000 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0843", ENV{libsane_matched}="yes" -# Epson Artisan 800 | Epson EP-901A | Epson EP-901F -# Epson Stylus Photo PX800FW | Epson Stylus Photo TX800FW -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0844", ENV{libsane_matched}="yes" -# Epson Artisan 700 | Epson EP-801A | Epson Stylus Photo PX700W -# Epson Stylus Photo TX700W -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0846", ENV{libsane_matched}="yes" -# Epson ME Office 700FW | Epson PX-601F | Epson Stylus Office BX600FW -# Epson Stylus Office TX600FW | Epson Stylus SX600FW | Epson WorkForce 600 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0847", ENV{libsane_matched}="yes" -# Epson ME Office 600F | Epson Stylus Office BX300F | Epson Stylus Office TX300F -# Epson Stylus NX300 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0848", ENV{libsane_matched}="yes" -# Epson Stylus NX200 | Epson Stylus SX200 | Epson Stylus SX205 -# Epson Stylus TX200 | Epson Stylus TX203 | Epson Stylus TX209 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0849", ENV{libsane_matched}="yes" -# Epson PX-501A | Epson Stylus NX400 | Epson Stylus SX400 -# Epson Stylus SX405 | Epson Stylus TX400 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="084a", ENV{libsane_matched}="yes" -# Epson WorkForce 500 -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="084c", ENV{libsane_matched}="yes" -# Epson PX-402A | Epson Stylus NX110 Series | Epson Stylus SX110 Series -# Epson Stylus TX110 Series -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="084d", ENV{libsane_matched}="yes" -# Epson ME OFFICE 510 | Epson Stylus NX210 Series | Epson Stylus SX210 Series -# Epson Stylus TX210 Series -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="084f", ENV{libsane_matched}="yes" -# Epson Stylus NX410 Series | Epson Stylus SX410 Series | Epson Stylus TX410 Series -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0851", ENV{libsane_matched}="yes" -# Epson ME OFFICE 650FN Series | Epson Stylus Office BX310FN Series | Epson Stylus Office TX510FN Series -# Epson WorkForce 310 Series -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0854", ENV{libsane_matched}="yes" -# Epson PX-502A | Epson Stylus NX510 Series | Epson Stylus SX510W Series -# Epson Stylus TX550W Series -ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="0856", ENV{libsane_matched}="yes" -# Fujitsu fi-4010CU -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1029", ENV{libsane_matched}="yes" -# Fujitsu fi-4120C -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1041", ENV{libsane_matched}="yes" -# Fujitsu fi-4220C -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1042", ENV{libsane_matched}="yes" -# Fujitsu fi-4530C -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1078", ENV{libsane_matched}="yes" -# Fujitsu fi-5750C -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1095", ENV{libsane_matched}="yes" -# Fujitsu fi-5110EOX/2 -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1096", ENV{libsane_matched}="yes" -# Fujitsu fi-5110C -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1097", ENV{libsane_matched}="yes" -# Fujitsu fi-5650C -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="10ad", ENV{libsane_matched}="yes" -# Fujitsu fi-4120C2 -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="10ae", ENV{libsane_matched}="yes" -# Fujitsu fi-4220C2 -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="10af", ENV{libsane_matched}="yes" -# Fujitsu fi-60F -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="10c7", ENV{libsane_matched}="yes" -# Fujitsu fi-4340C -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="10cf", ENV{libsane_matched}="yes" -# Fujitsu fi-5120C -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="10e0", ENV{libsane_matched}="yes" -# Fujitsu fi-5220C -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="10e1", ENV{libsane_matched}="yes" -# Fujitsu fi-5530C -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="10e2", ENV{libsane_matched}="yes" -# Fujitsu fi-5110EOX3 -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="10e6", ENV{libsane_matched}="yes" -# Fujitsu fi-5900C -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="10e7", ENV{libsane_matched}="yes" -# Fujitsu fi-5015C -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="10ef", ENV{libsane_matched}="yes" -# Fujitsu fi-5110EOXM -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="10f2", ENV{libsane_matched}="yes" -# Fujitsu ScanSnap S500 -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="10fe", ENV{libsane_matched}="yes" -# Fujitsu ScanSnap S500M -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1135", ENV{libsane_matched}="yes" -# Fujitsu fi-5530C2 -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="114a", ENV{libsane_matched}="yes" -# Fujitsu fi-6140 -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="114d", ENV{libsane_matched}="yes" -# Fujitsu fi-6240 -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="114e", ENV{libsane_matched}="yes" -# Fujitsu fi-6130 -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="114f", ENV{libsane_matched}="yes" -# Fujitsu fi-6230 -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1150", ENV{libsane_matched}="yes" -# Fujitsu ScanSnap S510 -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1155", ENV{libsane_matched}="yes" -# Fujitsu ScanSnap S300 -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1156", ENV{libsane_matched}="yes" -# Fujitsu ScanSnap S510M -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="116f", ENV{libsane_matched}="yes" -# Fujitsu fi-6770 -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1174", ENV{libsane_matched}="yes" -# Fujitsu fi-6770A -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1175", ENV{libsane_matched}="yes" -# Fujitsu fi-6670 -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1176", ENV{libsane_matched}="yes" -# Fujitsu fi-6670A -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1177", ENV{libsane_matched}="yes" -# Fujitsu fi-6750S -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="1178", ENV{libsane_matched}="yes" -# Fujitsu ScanSnap S300M -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="117f", ENV{libsane_matched}="yes" -# Fujitsu fi-6800 -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="119d", ENV{libsane_matched}="yes" -# Fujitsu fi-6800-CGA -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="119e", ENV{libsane_matched}="yes" -# Fujitsu fi-6900 -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="119f", ENV{libsane_matched}="yes" -# Fujitsu fi-6900-CGA -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="11a0", ENV{libsane_matched}="yes" -# Fujitsu ScanSnap S1500 | Fujitsu ScanSnap S1500M -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="11a2", ENV{libsane_matched}="yes" -# Fujitsu ScanSnap S1300 -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="11ed", ENV{libsane_matched}="yes" -# Fujitsu fi-6125 -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="11ee", ENV{libsane_matched}="yes" -# Fujitsu fi-6225 -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="11ef", ENV{libsane_matched}="yes" -# Fujitsu fi-6145 -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="11f1", ENV{libsane_matched}="yes" -# Fujitsu fi-6245 -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="11f2", ENV{libsane_matched}="yes" -# Fujitsu fi-6135 -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="11f3", ENV{libsane_matched}="yes" -# Fujitsu fi-6235 -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="11f4", ENV{libsane_matched}="yes" -# Fujitsu fi-6110 -ATTRS{idVendor}=="04c5", ATTRS{idProduct}=="11fc", ENV{libsane_matched}="yes" -# Konica e-mini -ATTRS{idVendor}=="04c8", ATTRS{idProduct}=="0722", ENV{libsane_matched}="yes" -# Panasonic KV-S2026C -ATTRS{idVendor}=="04da", ATTRS{idProduct}=="1000", ENV{libsane_matched}="yes" -# Panasonic KV-S2046C -ATTRS{idVendor}=="04da", ATTRS{idProduct}=="1001", ENV{libsane_matched}="yes" -# Panasonic KV-S1025C -ATTRS{idVendor}=="04da", ATTRS{idProduct}=="1006", ENV{libsane_matched}="yes" -# Panasonic KV-S1020C -ATTRS{idVendor}=="04da", ATTRS{idProduct}=="1007", ENV{libsane_matched}="yes" -# Panasonic KV-S2048C -ATTRS{idVendor}=="04da", ATTRS{idProduct}=="1009", ENV{libsane_matched}="yes" -# Panasonic KV-S2028C -ATTRS{idVendor}=="04da", ATTRS{idProduct}=="100a", ENV{libsane_matched}="yes" -# Panasonic KV-SS080 -ATTRS{idVendor}=="04da", ATTRS{idProduct}=="100f", ENV{libsane_matched}="yes" -# Panasonic KV-S1045C -ATTRS{idVendor}=="04da", ATTRS{idProduct}=="1010", ENV{libsane_matched}="yes" -# Samsung SCX-4200 -ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="341b", ENV{libsane_matched}="yes" -# Samsung SCX4725-FN -ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="341f", ENV{libsane_matched}="yes" -# Samsung SCX-4500 -ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="3426", ENV{libsane_matched}="yes" -# Samsung CLX-3170fn | Samsung CLX-3175FW -ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="342a", ENV{libsane_matched}="yes" -# Samsung SCX-4500W -ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="342b", ENV{libsane_matched}="yes" -# Samsung SCX-4824 -ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="342c", ENV{libsane_matched}="yes" -# Samsung SCX-4300 -ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="342e", ENV{libsane_matched}="yes" -# Samsung SCX-4600 -ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="3433", ENV{libsane_matched}="yes" -# Samsung SCX-4623 -ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="3434", ENV{libsane_matched}="yes" -# Samsung SCX-4825FN -ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="343c", ENV{libsane_matched}="yes" -# Samsung SCX-4623FW -ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="3440", ENV{libsane_matched}="yes" -# Pentax DSmobile 600 -ATTRS{idVendor}=="04f9", ATTRS{idProduct}=="2038", ENV{libsane_matched}="yes" -# Aiptek Aiptek Pencam -ATTRS{idVendor}=="0553", ATTRS{idProduct}=="0202", ENV{libsane_matched}="yes" -# Mustek ScanExpress 1200 CU -ATTRS{idVendor}=="055f", ATTRS{idProduct}=="0001", ENV{libsane_matched}="yes" -# Mustek ScanExpress 600 CU -ATTRS{idVendor}=="055f", ATTRS{idProduct}=="0002", ENV{libsane_matched}="yes" -# Mustek ScanExpress 1200 UB | Trust Compact Scan USB 19200 -ATTRS{idVendor}=="055f", ATTRS{idProduct}=="0006", ENV{libsane_matched}="yes" -# Mustek ScanExpress 1200 CU Plus -ATTRS{idVendor}=="055f", ATTRS{idProduct}=="0008", ENV{libsane_matched}="yes" -# Mustek BearPaw 1200 F -ATTRS{idVendor}=="055f", ATTRS{idProduct}=="0010", ENV{libsane_matched}="yes" -# Mustek ScanExpress A3 USB -ATTRS{idVendor}=="055f", ATTRS{idProduct}=="0210", ENV{libsane_matched}="yes" -# Mustek BearPaw 2400 CS | Mustek BearPaw 2400 TA | Trust 240TH Easy Webscan Gold -ATTRS{idVendor}=="055f", ATTRS{idProduct}=="0218", ENV{libsane_matched}="yes" -# Mustek BearPaw 2400 CS Plus | Mustek BearPaw 2400 TA Plus | Mustek Plug-n-Scan 2400 MT -# Mustek Plug-n-Scan 2400 M | Packard Bell Diamond 2450 -ATTRS{idVendor}=="055f", ATTRS{idProduct}=="0219", ENV{libsane_matched}="yes" -# Mustek BearPaw 2448 CS Plus | Mustek BearPaw 2448 TA Plus -ATTRS{idVendor}=="055f", ATTRS{idProduct}=="021a", ENV{libsane_matched}="yes" -# Mustek BearPaw 1200 CU Plus | Packard Bell Diamond 1200 Plus -ATTRS{idVendor}=="055f", ATTRS{idProduct}=="021b", ENV{libsane_matched}="yes" -# Mustek BearPaw 1200 CU Plus | Mustek BearPaw 1248 CU | Packard Bell Diamond 1200 Plus -# Trust Direct WebScan 19200 -ATTRS{idVendor}=="055f", ATTRS{idProduct}=="021c", ENV{libsane_matched}="yes" -# Mustek BearPaw 2400 CU Plus -ATTRS{idVendor}=="055f", ATTRS{idProduct}=="021d", ENV{libsane_matched}="yes" -# Mustek BearPaw 1200 CS | Mustek BearPaw 1200 TA -ATTRS{idVendor}=="055f", ATTRS{idProduct}=="021e", ENV{libsane_matched}="yes" -# Mustek ScanExpress 1248 UB -ATTRS{idVendor}=="055f", ATTRS{idProduct}=="021f", ENV{libsane_matched}="yes" -# Mustek BearPaw 2448TA Pro -ATTRS{idVendor}=="055f", ATTRS{idProduct}=="0409", ENV{libsane_matched}="yes" # Artec/Ultima Ultima 2000 | Artec/Ultima Ultima 2000 e+ | Boeder Sm@rtScan Slim Edition # Fujitsu 1200CUS | Googlegear 2000 | Medion/Lifetec/Tevion/Cytron MD 4394 # Medion/Lifetec/Tevion/Cytron MD/LT 9375 | Medion/Lifetec/Tevion/Cytron MD/LT 9385 | Medion/Lifetec/Tevion/Cytron LT 9452 @@ -1076,17 +806,4 @@ ATTRS{idVendor}=="413c", ATTRS{idProduct}=="5124", ENV{libsane_matched}="yes" # Dell 1600n ATTRS{idVendor}=="413c", ATTRS{idProduct}=="5250", ENV{libsane_matched}="yes" - epson = g_list_append (epson, g_strdup("0101")); - epson = g_list_append (epson, g_strdup("0103")); - epson = g_list_append (epson, g_strdup("0104")); - epson = g_list_append (epson, g_strdup("0105")); - epson = g_list_append (epson, g_strdup("0106")); - epson = g_list_append (epson, g_strdup("0107")); - epson = g_list_append (epson, g_strdup("0109")); - epson = g_list_append (epson, g_strdup("010a")); - epson = g_list_append (epson, g_strdup("010b")); - - g_hash_table_insert (scanners, - g_strdup("04b8"), - g_list_copy(epson)); } -- cgit v1.2.3 From 3469e378ef4d34e5efd10549b499cd35a865c5f4 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Mon, 1 Aug 2011 15:53:28 +0100 Subject: usb scanners in place --- src/sane-rules.h | 532 ++++++++++++++++++++++++------------------------------- 1 file changed, 234 insertions(+), 298 deletions(-) diff --git a/src/sane-rules.h b/src/sane-rules.h index ae361b8..4c36698 100644 --- a/src/sane-rules.h +++ b/src/sane-rules.h @@ -47,23 +47,19 @@ void populate_usb_scanners (GHashTable* scanners) g_strdup("03f0"), g_list_copy(hp)); - GList* mustek = NULL; - - mustek = g_list_append (mustek, g_strdup ("1000")); - mustek = g_list_append (mustek, g_strdup ("1001")); - + GList* mustek_2 = NULL; + mustek_2 = g_list_append (mustek_2, g_strdup ("1000")); + mustek_2 = g_list_append (mustek_2, g_strdup ("1001")); g_hash_table_insert (scanners, g_strdup("03f0"), - g_list_copy(mustek)); + g_list_copy(mustek_2)); GList* kodak = NULL; - kodak = g_list_append (kodak, g_strdup ("6001")); kodak = g_list_append (kodak, g_strdup ("6002")); kodak = g_list_append (kodak, g_strdup ("6003")); kodak = g_list_append (kodak, g_strdup ("6004")); kodak = g_list_append (kodak, g_strdup ("6005")); - g_hash_table_insert (scanners, g_strdup("040a"), g_list_copy(kodak)); @@ -486,19 +482,19 @@ void populate_usb_scanners (GHashTable* scanners) g_strdup("04e8"), g_list_copy(samsung)); - GList* pentax; + GList* pentax = NULL; pentax = g_list_append (pentax, g_strdup ("2038")); g_hash_table_insert (scanners, g_strdup("04f9"), g_list_copy(pentax)); - GList* apitek; + GList* apitek = NULL; apitek = g_list_append (apitek, g_strdup ("0202")); g_hash_table_insert (scanners, g_strdup("0553"), g_list_copy(apitek)); - GList* mustek; + GList* mustek = NULL; mustek = g_list_append (mustek, g_strdup ("0001")); mustek = g_list_append (mustek, g_strdup ("0002")); mustek = g_list_append (mustek, g_strdup ("0006")); @@ -517,293 +513,233 @@ void populate_usb_scanners (GHashTable* scanners) g_hash_table_insert (scanners, g_strdup("055f"), g_list_copy(mustek)); + GList* artec = NULL; + artec = g_list_append (artec, g_strdup ("4002")); + artec = g_list_append (artec, g_strdup ("4003")); + artec = g_list_append (artec, g_strdup ("4004")); + artec = g_list_append (artec, g_strdup ("4005")); + artec = g_list_append (artec, g_strdup ("4006")); + artec = g_list_append (artec, g_strdup ("4007")); + artec = g_list_append (artec, g_strdup ("4009")); + artec = g_list_append (artec, g_strdup ("4010")); + artec = g_list_append (artec, g_strdup ("4011")); + g_hash_table_insert (scanners, + g_strdup("05d8"), + g_list_copy(artec)); + + GList* microtek = NULL; + microtek = g_list_append (microtek, g_strdup ("0099")); + microtek = g_list_append (microtek, g_strdup ("009a")); + microtek = g_list_append (microtek, g_strdup ("00a3")); + microtek = g_list_append (microtek, g_strdup ("00b6")); + microtek = g_list_append (microtek, g_strdup ("30cf")); + microtek = g_list_append (microtek, g_strdup ("30d4")); + microtek = g_list_append (microtek, g_strdup ("40b3")); + microtek = g_list_append (microtek, g_strdup ("40b8")); + microtek = g_list_append (microtek, g_strdup ("40ca")); + microtek = g_list_append (microtek, g_strdup ("40cb")); + microtek = g_list_append (microtek, g_strdup ("40dd")); + microtek = g_list_append (microtek, g_strdup ("40ff")); + microtek = g_list_append (microtek, g_strdup ("80a3")); + g_hash_table_insert (scanners, + g_strdup("05da"), + g_list_copy(microtek)); + + GList* avision = NULL; + avision = g_list_append (avision, g_strdup ("0268")); + avision = g_list_append (avision, g_strdup ("026a")); + avision = g_list_append (avision, g_strdup ("0a13")); + avision = g_list_append (avision, g_strdup ("0a15")); + avision = g_list_append (avision, g_strdup ("0a16")); + avision = g_list_append (avision, g_strdup ("0a18")); + avision = g_list_append (avision, g_strdup ("0a19")); + avision = g_list_append (avision, g_strdup ("0a23")); + avision = g_list_append (avision, g_strdup ("0a24")); + avision = g_list_append (avision, g_strdup ("0a25")); + avision = g_list_append (avision, g_strdup ("0a27")); + avision = g_list_append (avision, g_strdup ("0a2a")); + avision = g_list_append (avision, g_strdup ("0a2b")); + avision = g_list_append (avision, g_strdup ("0a2c")); + avision = g_list_append (avision, g_strdup ("0a2d")); + avision = g_list_append (avision, g_strdup ("0a2e")); + avision = g_list_append (avision, g_strdup ("0a2f")); + avision = g_list_append (avision, g_strdup ("0a33")); + avision = g_list_append (avision, g_strdup ("0a3a")); + avision = g_list_append (avision, g_strdup ("0a3c")); + avision = g_list_append (avision, g_strdup ("0a40")); + avision = g_list_append (avision, g_strdup ("0a41")); + avision = g_list_append (avision, g_strdup ("0a45")); + avision = g_list_append (avision, g_strdup ("0a4d")); + avision = g_list_append (avision, g_strdup ("0a4e")); + avision = g_list_append (avision, g_strdup ("0a4f")); + avision = g_list_append (avision, g_strdup ("0a5e")); + avision = g_list_append (avision, g_strdup ("0a61")); + avision = g_list_append (avision, g_strdup ("0a65")); + avision = g_list_append (avision, g_strdup ("0a66")); + avision = g_list_append (avision, g_strdup ("0a68")); + avision = g_list_append (avision, g_strdup ("0a82")); + avision = g_list_append (avision, g_strdup ("0a84")); + avision = g_list_append (avision, g_strdup ("0a93")); + avision = g_list_append (avision, g_strdup ("0a94")); + avision = g_list_append (avision, g_strdup ("0aa1")); + avision = g_list_append (avision, g_strdup ("1a35")); + g_hash_table_insert (scanners, + g_strdup("0638"), + g_list_copy(avision)); + GList* minolta = NULL; + minolta = g_list_append (minolta, g_strdup ("4004")); + minolta = g_list_append (minolta, g_strdup ("400d")); + minolta = g_list_append (minolta, g_strdup ("400e")); + g_hash_table_insert (scanners, + g_strdup("0686"), + g_list_copy(minolta)); + + GList* agfa = NULL; + agfa = g_list_append (agfa, g_strdup ("0001")); + agfa = g_list_append (agfa, g_strdup ("0002")); + agfa = g_list_append (agfa, g_strdup ("0100")); + agfa = g_list_append (agfa, g_strdup ("2061")); + agfa = g_list_append (agfa, g_strdup ("208d")); + agfa = g_list_append (agfa, g_strdup ("208f")); + agfa = g_list_append (agfa, g_strdup ("2091")); + agfa = g_list_append (agfa, g_strdup ("2093")); + agfa = g_list_append (agfa, g_strdup ("2095")); + agfa = g_list_append (agfa, g_strdup ("2097")); + agfa = g_list_append (agfa, g_strdup ("20fd")); + agfa = g_list_append (agfa, g_strdup ("20ff")); + g_hash_table_insert (scanners, + g_strdup("06bd"), + g_list_copy(minolta)); + + GList* umax_2 = NULL; + umax_2 = g_list_append (umax_2, g_strdup ("0020")); + g_hash_table_insert (scanners, + g_strdup("06dc"), + g_list_copy(umax_2)); + + GList* plustek = NULL; + + plustek = g_list_append (plustek, g_strdup ("0001")); + plustek = g_list_append (plustek, g_strdup ("0010")); + plustek = g_list_append (plustek, g_strdup ("0011")); + plustek = g_list_append (plustek, g_strdup ("0013")); + plustek = g_list_append (plustek, g_strdup ("0015")); + plustek = g_list_append (plustek, g_strdup ("0017")); + plustek = g_list_append (plustek, g_strdup ("0400")); + plustek = g_list_append (plustek, g_strdup ("0401")); + plustek = g_list_append (plustek, g_strdup ("0402")); + plustek = g_list_append (plustek, g_strdup ("0403")); + plustek = g_list_append (plustek, g_strdup ("040b")); + plustek = g_list_append (plustek, g_strdup ("040e")); + plustek = g_list_append (plustek, g_strdup ("0412")); + plustek = g_list_append (plustek, g_strdup ("0413")); + plustek = g_list_append (plustek, g_strdup ("0422")); + plustek = g_list_append (plustek, g_strdup ("0454")); + plustek = g_list_append (plustek, g_strdup ("045f")); + plustek = g_list_append (plustek, g_strdup ("0462")); + plustek = g_list_append (plustek, g_strdup ("0900")); + g_hash_table_insert (scanners, + g_strdup("07b3"), + g_list_copy(plustek)); -# Artec/Ultima Ultima 2000 | Artec/Ultima Ultima 2000 e+ | Boeder Sm@rtScan Slim Edition -# Fujitsu 1200CUS | Googlegear 2000 | Medion/Lifetec/Tevion/Cytron MD 4394 -# Medion/Lifetec/Tevion/Cytron MD/LT 9375 | Medion/Lifetec/Tevion/Cytron MD/LT 9385 | Medion/Lifetec/Tevion/Cytron LT 9452 -# Medion/Lifetec/Tevion/Cytron MD 9458 | Mustek BearPaw 1200 CU | Mustek BearPaw 2400 CU -# Mustek ScanExpress 1200 UB Plus | Mustek ScanExpress 2400 USB | Mustek ScanMagic 1200 UB Plus -# Packard Bell Diamond 1200 | Trust Compact Scan USB 19200 | Trust Flat Scan USB 19200 -ATTRS{idVendor}=="05d8", ATTRS{idProduct}=="4002", ENV{libsane_matched}="yes" -# Artec/Ultima E+ 48U | Medion/Lifetec/Tevion/Cytron MD9693 | Medion/Lifetec/Tevion/Cytron MD9705 -# Medion/Lifetec/Tevion/Cytron MD4394 | Microstar MR 9791 -ATTRS{idVendor}=="05d8", ATTRS{idProduct}=="4003", ENV{libsane_matched}="yes" -# Artec/Ultima E+ Pro -ATTRS{idVendor}=="05d8", ATTRS{idProduct}=="4004", ENV{libsane_matched}="yes" -# Memorex MEM 48U -ATTRS{idVendor}=="05d8", ATTRS{idProduct}=="4005", ENV{libsane_matched}="yes" -# Trust Easy Webscan 19200 -ATTRS{idVendor}=="05d8", ATTRS{idProduct}=="4006", ENV{libsane_matched}="yes" -# Trust 240H Easy Webscan Gold -ATTRS{idVendor}=="05d8", ATTRS{idProduct}=="4007", ENV{libsane_matched}="yes" -# UMAX AstraSlim SE -ATTRS{idVendor}=="05d8", ATTRS{idProduct}=="4009", ENV{libsane_matched}="yes" -# UMAX AstraSlim 1200 SE -ATTRS{idVendor}=="05d8", ATTRS{idProduct}=="4010", ENV{libsane_matched}="yes" -# Yakumo Scan50 -ATTRS{idVendor}=="05d8", ATTRS{idProduct}=="4011", ENV{libsane_matched}="yes" -# Microtek ScanMaker X6USB -ATTRS{idVendor}=="05da", ATTRS{idProduct}=="0099", ENV{libsane_matched}="yes" -# Microtek SlimScan C6 -ATTRS{idVendor}=="05da", ATTRS{idProduct}=="009a", ENV{libsane_matched}="yes" -# Microtek ScanMaker V6USL -ATTRS{idVendor}=="05da", ATTRS{idProduct}=="00a3", ENV{libsane_matched}="yes" -# Microtek ScanMaker V6UPL -ATTRS{idVendor}=="05da", ATTRS{idProduct}=="00b6", ENV{libsane_matched}="yes" -# Microtek ScanMaker 4800 -ATTRS{idVendor}=="05da", ATTRS{idProduct}=="30cf", ENV{libsane_matched}="yes" -# Microtek ScanMaker 3840 -ATTRS{idVendor}=="05da", ATTRS{idProduct}=="30d4", ENV{libsane_matched}="yes" -# Microtek ScanMaker 3600 -ATTRS{idVendor}=="05da", ATTRS{idProduct}=="40b3", ENV{libsane_matched}="yes" -# Microtek ScanMaker 3700 -ATTRS{idVendor}=="05da", ATTRS{idProduct}=="40b8", ENV{libsane_matched}="yes" -# Microtek ScanMaker 3600 -ATTRS{idVendor}=="05da", ATTRS{idProduct}=="40ca", ENV{libsane_matched}="yes" -# Microtek ScanMaker 3700 -ATTRS{idVendor}=="05da", ATTRS{idProduct}=="40cb", ENV{libsane_matched}="yes" -# Microtek ScanMaker 3750 -ATTRS{idVendor}=="05da", ATTRS{idProduct}=="40dd", ENV{libsane_matched}="yes" -# Microtek ScanMaker 3600 -ATTRS{idVendor}=="05da", ATTRS{idProduct}=="40ff", ENV{libsane_matched}="yes" -# Microtek ScanMaker V6USL -ATTRS{idVendor}=="05da", ATTRS{idProduct}=="80a3", ENV{libsane_matched}="yes" -# iVina 1200U -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0268", ENV{libsane_matched}="yes" -# Minolta Dimage Scan Dual II -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="026a", ENV{libsane_matched}="yes" -# Avision AV600U -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a13", ENV{libsane_matched}="yes" -# Minolta-QMS SC-110 -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a15", ENV{libsane_matched}="yes" -# Avision DS610CU Scancopier | Minolta-QMS SC-215 | OKI S700 Scancopier -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a16", ENV{libsane_matched}="yes" -# Avision AV600U Plus -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a18", ENV{libsane_matched}="yes" -# Avision AV610 -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a19", ENV{libsane_matched}="yes" -# Avision AV220 -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a23", ENV{libsane_matched}="yes" -# Avision AV210 -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a24", ENV{libsane_matched}="yes" -# Avision AV210 -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a25", ENV{libsane_matched}="yes" -# Avision AV120 -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a27", ENV{libsane_matched}="yes" -# Avision AV220C2 -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a2a", ENV{libsane_matched}="yes" -# Avision AV220D2 -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a2b", ENV{libsane_matched}="yes" -# Avision AV220+ -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a2c", ENV{libsane_matched}="yes" -# Avision AV220C2-G -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a2d", ENV{libsane_matched}="yes" -# Avision AV220C2-B -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a2e", ENV{libsane_matched}="yes" -# Avision AV210C2-G -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a2f", ENV{libsane_matched}="yes" -# Avision AV122 -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a33", ENV{libsane_matched}="yes" -# Avision AV210C2 -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a3a", ENV{libsane_matched}="yes" -# Avision AV121 -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a3c", ENV{libsane_matched}="yes" -# Avision AV8300 -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a40", ENV{libsane_matched}="yes" -# Avision AM3000 Series -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a41", ENV{libsane_matched}="yes" -# Avision @V5100 -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a45", ENV{libsane_matched}="yes" -# Avision AV8050U -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a4d", ENV{libsane_matched}="yes" -# Avision AV3200SU -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a4e", ENV{libsane_matched}="yes" -# Avision AV3730SU -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a4f", ENV{libsane_matched}="yes" -# Avision AV610C2 -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a5e", ENV{libsane_matched}="yes" -# Avision IT8300 -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a61", ENV{libsane_matched}="yes" -# Avision AV3750SU -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a65", ENV{libsane_matched}="yes" -# Avision AV3850SU -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a66", ENV{libsane_matched}="yes" -# Avision AV8350 -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a68", ENV{libsane_matched}="yes" -# Avision FB6080E -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a82", ENV{libsane_matched}="yes" -# Avision FB2080E -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a84", ENV{libsane_matched}="yes" -# Avision AV122 C2 -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a93", ENV{libsane_matched}="yes" -# Avision AV220-G -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0a94", ENV{libsane_matched}="yes" -# Avision @V2500 -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="0aa1", ENV{libsane_matched}="yes" -# Avision AV210D2+ -ATTRS{idVendor}=="0638", ATTRS{idProduct}=="1a35", ENV{libsane_matched}="yes" -# Minolta Elite II -ATTRS{idVendor}=="0686", ATTRS{idProduct}=="4004", ENV{libsane_matched}="yes" -# Minolta Dimage Scan Dual III -ATTRS{idVendor}=="0686", ATTRS{idProduct}=="400d", ENV{libsane_matched}="yes" -# Minolta Dimage Scan Elite 5400 -ATTRS{idVendor}=="0686", ATTRS{idProduct}=="400e", ENV{libsane_matched}="yes" -# AGFA SnapScan 1212U -ATTRS{idVendor}=="06bd", ATTRS{idProduct}=="0001", ENV{libsane_matched}="yes" -# AGFA SnapScan 1236u -ATTRS{idVendor}=="06bd", ATTRS{idProduct}=="0002", ENV{libsane_matched}="yes" -# Agfa Snapscan Touch -ATTRS{idVendor}=="06bd", ATTRS{idProduct}=="0100", ENV{libsane_matched}="yes" -# AGFA SnapScan 1212U_2 -ATTRS{idVendor}=="06bd", ATTRS{idProduct}=="2061", ENV{libsane_matched}="yes" -# AGFA SnapScan e40 -ATTRS{idVendor}=="06bd", ATTRS{idProduct}=="208d", ENV{libsane_matched}="yes" -# AGFA SnapScan e50 -ATTRS{idVendor}=="06bd", ATTRS{idProduct}=="208f", ENV{libsane_matched}="yes" -# AGFA SnapScan e20 -ATTRS{idVendor}=="06bd", ATTRS{idProduct}=="2091", ENV{libsane_matched}="yes" -# AGFA SnapScan e10 -ATTRS{idVendor}=="06bd", ATTRS{idProduct}=="2093", ENV{libsane_matched}="yes" -# AGFA SnapScan e25 -ATTRS{idVendor}=="06bd", ATTRS{idProduct}=="2095", ENV{libsane_matched}="yes" -# AGFA SnapScan e26 -ATTRS{idVendor}=="06bd", ATTRS{idProduct}=="2097", ENV{libsane_matched}="yes" -# AGFA SnapScan e52 -ATTRS{idVendor}=="06bd", ATTRS{idProduct}=="20fd", ENV{libsane_matched}="yes" -# AGFA SnapScan e42 -ATTRS{idVendor}=="06bd", ATTRS{idProduct}=="20ff", ENV{libsane_matched}="yes" -# UMAX Astra 4900 -ATTRS{idVendor}=="06dc", ATTRS{idProduct}=="0020", ENV{libsane_matched}="yes" -# Plustek OpticPro U12 | Plustek OpticPro UT12 | Plustek OpticPro 1212U -# RevScan RevScan Orange R48Ti | Genius ColorPage Vivid III USB -ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0001", ENV{libsane_matched}="yes" -# Plustek OpticPro U12 -ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0010", ENV{libsane_matched}="yes" -# Plustek OpticPro U24 -ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0011", ENV{libsane_matched}="yes" -# Plustek OpticPro UT12 -ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0013", ENV{libsane_matched}="yes" -# Plustek OpticPro U24 -ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0015", ENV{libsane_matched}="yes" -# Plustek OpticPro UT12 | Plustek OpticPro UT16 | Plustek OpticPro UT24 -ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0017", ENV{libsane_matched}="yes" -# Plustek OpticPro 1248U | RevScan 19200i -ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0400", ENV{libsane_matched}="yes" -# Plustek OpticPro 1248U -ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0401", ENV{libsane_matched}="yes" -# Plustek OpticPro U16B -ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0402", ENV{libsane_matched}="yes" -# Plustek OpticPro U16B+ | Plustek OpticPro UT16B -ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0403", ENV{libsane_matched}="yes" -# Nortek MyScan 1200 | Plustek OpticPro S12 | Plustek OpticPro ST12 -ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="040b", ENV{libsane_matched}="yes" -# Plustek OpticPro S24 -ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="040e", ENV{libsane_matched}="yes" -# NeatReceipts Scanalizer Professional 2.5 | Plustek OpticSlim M12 -ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0412", ENV{libsane_matched}="yes" -# Plustek OpticSlim 1200 -ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0413", ENV{libsane_matched}="yes" -# Plustek OpticSlim 2400 -ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0422", ENV{libsane_matched}="yes" -# Plustek OpticSlim 2400 plus -ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0454", ENV{libsane_matched}="yes" -# Plustek Iriscan Express 2 -ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="045f", ENV{libsane_matched}="yes" -# NeatReceipts Mobile Scanner -ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0462", ENV{libsane_matched}="yes" -# Plustek OpticBook 3600 -ATTRS{idVendor}=="07b3", ATTRS{idProduct}=="0900", ENV{libsane_matched}="yes" -# Corex 600c -ATTRS{idVendor}=="08f0", ATTRS{idProduct}=="0002", ENV{libsane_matched}="yes" -# Corex 800c -ATTRS{idVendor}=="08f0", ATTRS{idProduct}=="0005", ENV{libsane_matched}="yes" -# Xerox Phaser 6110MFP -ATTRS{idVendor}=="0924", ATTRS{idProduct}=="3d5d", ENV{libsane_matched}="yes" -# Xerox Phaser 3200MFP -ATTRS{idVendor}=="0924", ATTRS{idProduct}=="3da4", ENV{libsane_matched}="yes" -# Xerox WorkCentre 4118 Series -ATTRS{idVendor}=="0924", ATTRS{idProduct}=="420c", ENV{libsane_matched}="yes" -# Xerox WorkCentre 3119 Series -ATTRS{idVendor}=="0924", ATTRS{idProduct}=="4265", ENV{libsane_matched}="yes" -# Xerox WorkCentre 3210 -ATTRS{idVendor}=="0924", ATTRS{idProduct}=="4293", ENV{libsane_matched}="yes" -# Xerox WorkCentre 3220 -ATTRS{idVendor}=="0924", ATTRS{idProduct}=="4294", ENV{libsane_matched}="yes" -# Pentax DSmobile 600 -ATTRS{idVendor}=="0a17", ATTRS{idProduct}=="3210", ENV{libsane_matched}="yes" -# Portable Peripheral Co., Ltd. Q-Scan USB001 (A4 portable scanner) -ATTRS{idVendor}=="0a53", ATTRS{idProduct}=="1000", ENV{libsane_matched}="yes" -# Syscan TravelScan 460/464 | Ambir Visigo A4 -ATTRS{idVendor}=="0a82", ATTRS{idProduct}=="4600", ENV{libsane_matched}="yes" -# Syscan DocketPort 465 -ATTRS{idVendor}=="0a82", ATTRS{idProduct}=="4802", ENV{libsane_matched}="yes" -# Syscan DocketPort 665 -ATTRS{idVendor}=="0a82", ATTRS{idProduct}=="4803", ENV{libsane_matched}="yes" -# Syscan DocketPort 685/ Ambir DS685 -ATTRS{idVendor}=="0a82", ATTRS{idProduct}=="480c", ENV{libsane_matched}="yes" -# Syscan DocketPort 485 -ATTRS{idVendor}=="0a82", ATTRS{idProduct}=="4810", ENV{libsane_matched}="yes" -# Syscan TravelScan 662 -ATTRS{idVendor}=="0a82", ATTRS{idProduct}=="6620", ENV{libsane_matched}="yes" -# Canon CR-55 -ATTRS{idVendor}=="1083", ATTRS{idProduct}=="160c", ENV{libsane_matched}="yes" -# Canon DR-1210C -ATTRS{idVendor}=="1083", ATTRS{idProduct}=="160f", ENV{libsane_matched}="yes" -# Canon DR-4010C -ATTRS{idVendor}=="1083", ATTRS{idProduct}=="1614", ENV{libsane_matched}="yes" -# Canon DR-2510C -ATTRS{idVendor}=="1083", ATTRS{idProduct}=="1617", ENV{libsane_matched}="yes" -# Canon DR-X10C -ATTRS{idVendor}=="1083", ATTRS{idProduct}=="1618", ENV{libsane_matched}="yes" -# Canon CR-25 -ATTRS{idVendor}=="1083", ATTRS{idProduct}=="161a", ENV{libsane_matched}="yes" -# Canon DR-2010C -ATTRS{idVendor}=="1083", ATTRS{idProduct}=="161b", ENV{libsane_matched}="yes" -# Canon DR-3010C -ATTRS{idVendor}=="1083", ATTRS{idProduct}=="161d", ENV{libsane_matched}="yes" -# Canon DR-7090C -ATTRS{idVendor}=="1083", ATTRS{idProduct}=="1620", ENV{libsane_matched}="yes" -# Canon DR-9050C -ATTRS{idVendor}=="1083", ATTRS{idProduct}=="1622", ENV{libsane_matched}="yes" -# Canon DR-7550C -ATTRS{idVendor}=="1083", ATTRS{idProduct}=="1623", ENV{libsane_matched}="yes" -# Canon DR-6050C -ATTRS{idVendor}=="1083", ATTRS{idProduct}=="1624", ENV{libsane_matched}="yes" -# Canon DR-6010C -ATTRS{idVendor}=="1083", ATTRS{idProduct}=="1626", ENV{libsane_matched}="yes" -# Canon CR-190i -ATTRS{idVendor}=="1083", ATTRS{idProduct}=="162b", ENV{libsane_matched}="yes" -# Canon DR-6030C -ATTRS{idVendor}=="1083", ATTRS{idProduct}=="1638", ENV{libsane_matched}="yes" -# Canon CR-135i -ATTRS{idVendor}=="1083", ATTRS{idProduct}=="1639", ENV{libsane_matched}="yes" -# Digital Dream l' espion XS -ATTRS{idVendor}=="1183", ATTRS{idProduct}=="0001", ENV{libsane_matched}="yes" -# KONICA MINOLTA magicolor 1690MF -ATTRS{idVendor}=="132b", ATTRS{idProduct}=="2089", ENV{libsane_matched}="yes" -# UMAX Astra 1220U -ATTRS{idVendor}=="1606", ATTRS{idProduct}=="0010", ENV{libsane_matched}="yes" -# UMAX Astra 1600U | UMAX Astra 2000U -ATTRS{idVendor}=="1606", ATTRS{idProduct}=="0030", ENV{libsane_matched}="yes" -# Umax UMAX 3400 -ATTRS{idVendor}=="1606", ATTRS{idProduct}=="0050", ENV{libsane_matched}="yes" -# Umax UMAX 3400 | Umax UMAX Astranet ia101 | Umax UMAX 3450 -ATTRS{idVendor}=="1606", ATTRS{idProduct}=="0060", ENV{libsane_matched}="yes" -# UMAX Astra 4400 | UMAX Astra 4450 -ATTRS{idVendor}=="1606", ATTRS{idProduct}=="0070", ENV{libsane_matched}="yes" -# UMAX Astra 2100U -ATTRS{idVendor}=="1606", ATTRS{idProduct}=="0130", ENV{libsane_matched}="yes" -# Umax UMAX 5400 -ATTRS{idVendor}=="1606", ATTRS{idProduct}=="0160", ENV{libsane_matched}="yes" -# UMAX Astra 2200 (SU) -ATTRS{idVendor}=="1606", ATTRS{idProduct}=="0230", ENV{libsane_matched}="yes" -# DCT DocketPort 487 -ATTRS{idVendor}=="1dcc", ATTRS{idProduct}=="4810", ENV{libsane_matched}="yes" -# Dell A920 -ATTRS{idVendor}=="413c", ATTRS{idProduct}=="5105", ENV{libsane_matched}="yes" -# Dell Dell MFP Laser Printer 1815dn -ATTRS{idVendor}=="413c", ATTRS{idProduct}=="5124", ENV{libsane_matched}="yes" -# Dell 1600n -ATTRS{idVendor}=="413c", ATTRS{idProduct}=="5250", ENV{libsane_matched}="yes" + GList* corex = NULL; + corex = g_list_append (corex, g_strdup ("0002")); + corex = g_list_append (corex, g_strdup ("0005")); + g_hash_table_insert (scanners, + g_strdup("08f0"), + g_list_copy(corex)); + + GList* xerox = NULL; + xerox = g_list_append (xerox, g_strdup ("3d5d")); + xerox = g_list_append (xerox, g_strdup ("3da4")); + xerox = g_list_append (xerox, g_strdup ("420c")); + xerox = g_list_append (xerox, g_strdup ("4265")); + xerox = g_list_append (xerox, g_strdup ("4293")); + xerox = g_list_append (xerox, g_strdup ("4294")); + g_hash_table_insert (scanners, + g_strdup("0924"), + g_list_copy(xerox)); + + GList* pentax_2 = NULL; + pentax_2 = g_list_append (pentax_2, g_strdup ("3210")); + g_hash_table_insert (scanners, + g_strdup("0a17"), + g_list_copy(pentax_2)); + + GList* portable = NULL; + portable = g_list_append (portable, g_strdup ("1000")); + g_hash_table_insert (scanners, + g_strdup("0a53"), + g_list_copy(portable)); + + GList* syscan = NULL; + syscan = g_list_append (syscan, g_strdup ("4600")); + syscan = g_list_append (syscan, g_strdup ("4802")); + syscan = g_list_append (syscan, g_strdup ("4803")); + syscan = g_list_append (syscan, g_strdup ("480c")); + syscan = g_list_append (syscan, g_strdup ("4810")); + syscan = g_list_append (syscan, g_strdup ("6620")); + g_hash_table_insert (scanners, + g_strdup("0a82"), + g_list_copy(syscan)); + + GList* canon_2 = NULL; + canon_2 = g_list_append (canon_2, g_strdup ("160c")); + canon_2 = g_list_append (canon_2, g_strdup ("160f")); + canon_2 = g_list_append (canon_2, g_strdup ("1614")); + canon_2 = g_list_append (canon_2, g_strdup ("1617")); + canon_2 = g_list_append (canon_2, g_strdup ("1618")); + canon_2 = g_list_append (canon_2, g_strdup ("161a")); + canon_2 = g_list_append (canon_2, g_strdup ("161b")); + canon_2 = g_list_append (canon_2, g_strdup ("161d")); + canon_2 = g_list_append (canon_2, g_strdup ("1620")); + canon_2 = g_list_append (canon_2, g_strdup ("1622")); + canon_2 = g_list_append (canon_2, g_strdup ("1623")); + canon_2 = g_list_append (canon_2, g_strdup ("1624")); + canon_2 = g_list_append (canon_2, g_strdup ("1626")); + canon_2 = g_list_append (canon_2, g_strdup ("162b")); + canon_2 = g_list_append (canon_2, g_strdup ("1638")); + canon_2 = g_list_append (canon_2, g_strdup ("1639")); + g_hash_table_insert (scanners, + g_strdup("1083"), + g_list_copy(canon_2)); + + GList* digital = NULL; + digital = g_list_append (digital, g_strdup ("0001")); + g_hash_table_insert (scanners, + g_strdup("1183"), + g_list_copy(digital)); + + GList* konica_2 = NULL; + konica_2 = g_list_append (konica_2, g_strdup ("2089")); + g_hash_table_insert (scanners, + g_strdup("132b"), + g_list_copy(konica_2)); + GList* umax = NULL; + umax = g_list_append (umax, g_strdup ("0010")); + umax = g_list_append (umax, g_strdup ("0030")); + umax = g_list_append (umax, g_strdup ("0050")); + umax = g_list_append (umax, g_strdup ("0060")); + umax = g_list_append (umax, g_strdup ("0070")); + umax = g_list_append (umax, g_strdup ("0130")); + umax = g_list_append (umax, g_strdup ("0160")); + umax = g_list_append (umax, g_strdup ("0230")); + g_hash_table_insert (scanners, + g_strdup("1606"), + g_list_copy(umax)); + + GList* docketport = NULL; + docketport = g_list_append (docketport, g_strdup ("4810")); + g_hash_table_insert (scanners, + g_strdup("1dcc"), + g_list_copy(docketport)); + + GList* dell = NULL; + dell = g_list_append (dell, g_strdup ("5105")); + dell = g_list_append (dell, g_strdup ("5124")); + dell = g_list_append (dell, g_strdup ("5250")); + g_hash_table_insert (scanners, + g_strdup("413c"), + g_list_copy(dell)); } -- cgit v1.2.3 From 933bbfd1c0ea8b59c9d40ad85584e97fcfe8f874 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 2 Aug 2011 18:14:54 +0100 Subject: certain usb webcams sorted --- src/udev-mgr.c | 100 ++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 84 insertions(+), 16 deletions(-) diff --git a/src/udev-mgr.c b/src/udev-mgr.c index f4b357d..5a455d1 100644 --- a/src/udev-mgr.c +++ b/src/udev-mgr.c @@ -35,17 +35,21 @@ static void udev_mgr_uevent_cb (GUdevClient *client, GUdevDevice *device, gpointer user_data); static void udev_mgr_update_menuitems (UdevMgr* self); -static void udev_mgr_check_if_device_is_supported (UdevMgr* self, - GUdevDevice *device, - UdevMgrDeviceAction action); - +static void udev_mgr_check_if_usb_device_is_supported (UdevMgr* self, + GUdevDevice *device, + UdevMgrDeviceAction action); + +static void udev_mgr_check_if_scsi_device_is_supported (UdevMgr* self, + GUdevDevice *device, + UdevMgrDeviceAction action); + struct _UdevMgr { GObject parent_instance; DbusmenuMenuitem* scanner_item; DbusmenuMenuitem* webcam_item; GUdevClient* client; - GHashTable* supported_scanners; + GHashTable* supported_usb_scanners; GHashTable* scanners_present; }; @@ -65,14 +69,14 @@ static void udev_mgr_init (UdevMgr* self) { self->client = NULL; - self->supported_scanners = NULL; + self->supported_usb_scanners = NULL; self->scanners_present = NULL; self->client = g_udev_client_new (subsystems); - self->supported_scanners = g_hash_table_new (g_str_hash, g_str_equal); + self->supported_usb_scanners = g_hash_table_new (g_str_hash, g_str_equal); self->scanners_present = g_hash_table_new (g_str_hash, g_str_equal); - populate_usb_scanners(self->supported_scanners); + populate_usb_scanners(self->supported_usb_scanners); g_signal_connect (G_OBJECT (self->client), "uevent", G_CALLBACK (udev_mgr_uevent_cb), @@ -102,7 +106,7 @@ udevice_mgr_device_list_iterator (gpointer data, gpointer userdata) UdevMgr* self = UDEV_MGR (userdata); GUdevDevice* device = G_UDEV_DEVICE (data); - udev_mgr_check_if_device_is_supported (self, device, ADD); + udev_mgr_check_if_usb_device_is_supported (self, device, ADD); /*const gchar* vendor = NULL; const gchar* product = NULL; @@ -149,6 +153,8 @@ static void udev_mgr_uevent_cb (GUdevClient *client, { g_return_if_fail (UDEV_IS_MGR (user_data)); UdevMgr* self = UDEV_MGR (user_data); + g_return_if_fail (device != NULL); + g_debug ("just received a UEVENT with an action : %s", action); UdevMgrDeviceAction udev_mgr_action = ADD; @@ -156,7 +162,56 @@ static void udev_mgr_uevent_cb (GUdevClient *client, if (g_strcmp0 (action, "remove") == 0){ udev_mgr_action = REMOVE; } - udev_mgr_check_if_device_is_supported (self, device, udev_mgr_action); + const gchar* subsystem = NULL; + const gchar* device_type = NULL; + + device_type = g_udev_device_get_devtype (device); + subsystem = g_udev_device_get_subsystem (device); + + g_debug ("And the subsystem is %s", subsystem); + g_debug ("And the device_type is %s", device_type); + + if (g_strcmp0 (subsystem, "usb") == 0){ + if ( g_udev_device_has_property (device, "ID_USB_INTERFACES")){ + const gchar* id_usb_interfaces = NULL; + id_usb_interfaces = g_udev_device_get_property (device, "ID_USB_INTERFACES"); + + GError* error = NULL; + GMatchInfo *match_info = NULL; + GRegex* webcam_regex = NULL; + + webcam_regex = g_regex_new (":0e[0-9]{4}:*", + 0, + 0, + &error); + // This seems to be case with certain webcams + //#":ff[f|0]{4} + if (error != NULL){ + g_debug ("Errors creating the regex : %s", error->message); + } + gboolean result = g_regex_match (webcam_regex, + id_usb_interfaces, + 0, + & match_info); + + g_debug ("we have found the id usb interfaces : %s", id_usb_interfaces); + + if (result == TRUE){ + g_debug ("SUCCESSFUL MATCH"); + } + else { + g_debug ("NO MATCH"); + } + } + + udev_mgr_check_if_usb_device_is_supported (self, device, udev_mgr_action); + } + else if (g_strcmp0 (subsystem, "scsi") == 0){ + udev_mgr_check_if_scsi_device_is_supported (self, device, udev_mgr_action); + } + + return; + const gchar* vendor; const gchar* product; const gchar* number; @@ -193,19 +248,31 @@ static void udev_mgr_uevent_cb (GUdevClient *client, } } + +static void +udev_mgr_check_if_scsi_device_is_supported (UdevMgr* self, + GUdevDevice *device, + UdevMgrDeviceAction action) +{ +} + static void -udev_mgr_check_if_device_is_supported (UdevMgr* self, - GUdevDevice *device, - UdevMgrDeviceAction action) +udev_mgr_check_if_usb_device_is_supported (UdevMgr* self, + GUdevDevice *device, + UdevMgrDeviceAction action) { + g_debug ("got a uevent"); const gchar* vendor = NULL; + vendor = g_udev_device_get_property (device, "ID_VENDOR_ID"); if (vendor == NULL) return; + g_debug ("vendor = %s", vendor); + GList* vendor_list = NULL; - vendor_list = g_hash_table_lookup (self->supported_scanners, + vendor_list = g_hash_table_lookup (self->supported_usb_scanners, (gpointer)vendor); if (vendor_list == NULL) return; @@ -223,8 +290,10 @@ udev_mgr_check_if_device_is_supported (UdevMgr* self, if (action == REMOVE){ // TODO handle the case where its removed // remove it if present from the hash and call update_menuitems - } + } else{ + // TODO: populate it with the name of the device + // this will be needed for the menuitem g_hash_table_insert (self->scanners_present, g_strdup(vendor), g_strdup(model_id)); @@ -248,7 +317,6 @@ UdevMgr* udev_mgr_new (DbusmenuMenuitem* scanner, GList* devices_available = g_udev_client_query_by_subsystem (mgr->client, usb_subsystem); - g_list_foreach (devices_available, udevice_mgr_device_list_iterator, mgr); -- cgit v1.2.3 From 88d74cf2b768eda753cd2bc85013203be6d9ca3b Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Wed, 3 Aug 2011 17:26:12 +0100 Subject: webcams working nicely --- src/udev-mgr.c | 211 ++++++++++++++++++++++++++++++--------------------------- 1 file changed, 113 insertions(+), 98 deletions(-) diff --git a/src/udev-mgr.c b/src/udev-mgr.c index 5a455d1..5c650b6 100644 --- a/src/udev-mgr.c +++ b/src/udev-mgr.c @@ -42,6 +42,14 @@ static void udev_mgr_check_if_usb_device_is_supported (UdevMgr* self, static void udev_mgr_check_if_scsi_device_is_supported (UdevMgr* self, GUdevDevice *device, UdevMgrDeviceAction action); +static void udev_mgr_handle_webcam (UdevMgr* self, + GUdevDevice* device, + UdevMgrDeviceAction action); + +static void debug_device (UdevMgr* self, + GUdevDevice* device, + UdevMgrDeviceAction action); + struct _UdevMgr { @@ -51,19 +59,15 @@ struct _UdevMgr GUdevClient* client; GHashTable* supported_usb_scanners; GHashTable* scanners_present; + GHashTable* webcams_present; }; -const char *subsystems[2] = {"usb", "scsi"}; +const char *subsystems[3] = {"usb", "scsi", "video4linux"}; const gchar* usb_subsystem = "usb"; +const gchar* video4linux_subsystem = "video4linux"; -G_DEFINE_TYPE (UdevMgr, udev_mgr, G_TYPE_OBJECT); -/*static void -test_usb_scanners(gpointer data, gpointer user_data) -{ - gchar* model = (gchar*)data; - g_debug ("in hash table for epsom model %s was found", model); -}*/ +G_DEFINE_TYPE (UdevMgr, udev_mgr, G_TYPE_OBJECT); static void udev_mgr_init (UdevMgr* self) @@ -71,12 +75,16 @@ udev_mgr_init (UdevMgr* self) self->client = NULL; self->supported_usb_scanners = NULL; self->scanners_present = NULL; - + self->webcams_present = NULL; + self->client = g_udev_client_new (subsystems); self->supported_usb_scanners = g_hash_table_new (g_str_hash, g_str_equal); self->scanners_present = g_hash_table_new (g_str_hash, g_str_equal); + self->webcams_present = g_hash_table_new (g_str_hash, g_str_equal); + // load into memory all supported scanners ... populate_usb_scanners(self->supported_usb_scanners); + g_signal_connect (G_OBJECT (self->client), "uevent", G_CALLBACK (udev_mgr_uevent_cb), @@ -106,35 +114,16 @@ udevice_mgr_device_list_iterator (gpointer data, gpointer userdata) UdevMgr* self = UDEV_MGR (userdata); GUdevDevice* device = G_UDEV_DEVICE (data); - udev_mgr_check_if_usb_device_is_supported (self, device, ADD); - /*const gchar* vendor = NULL; - const gchar* product = NULL; - GList* vendor_list = NULL; - - vendor = g_udev_device_get_property (device, "ID_VENDOR_ID"); - - if (vendor == NULL){ - g_object_unref (device); - return; - } + const gchar* subsystem = NULL; + subsystem = g_udev_device_get_subsystem (device); - product = g_udev_device_get_property (device, "ID_MODEL_ID"); - vendor_list = g_hash_table_lookup(self->supported_scanners, (gpointer)vendor); - - GList* model = NULL; - - if (vendor_list != NULL){ - model = g_list_find_custom(vendor_list, product, (GCompareFunc)g_strcmp0); - if (model == NULL){ - g_debug ("CANT FIND THE MODEL %s FOR VENDOR %s", product, vendor); - } - else{ - self->scanners_present += 1; - g_debug ("WE HAVE A SUCCESSFUL MATCH!"); - } + if (g_strcmp0 (subsystem, "usb") == 0){ + udev_mgr_check_if_usb_device_is_supported (self, device, ADD); + } + else if (g_strcmp0 (subsystem, "video4linux") == 0){ + udev_mgr_handle_webcam (self, device, ADD); } - g_debug ("JUST SET SCANNERS TO TRUE");*/ g_object_unref (device); } @@ -144,6 +133,11 @@ static void udev_mgr_update_menuitems (UdevMgr* self) dbusmenu_menuitem_property_set_bool (self->scanner_item, DBUSMENU_MENUITEM_PROP_VISIBLE, g_hash_table_size (self->scanners_present) > 0); + + dbusmenu_menuitem_property_set_bool (self->webcam_item, + DBUSMENU_MENUITEM_PROP_VISIBLE, + g_hash_table_size (self->webcams_present) > 0); + } static void udev_mgr_uevent_cb (GUdevClient *client, @@ -162,68 +156,79 @@ static void udev_mgr_uevent_cb (GUdevClient *client, if (g_strcmp0 (action, "remove") == 0){ udev_mgr_action = REMOVE; } - const gchar* subsystem = NULL; - const gchar* device_type = NULL; - device_type = g_udev_device_get_devtype (device); + const gchar* subsystem = NULL; subsystem = g_udev_device_get_subsystem (device); - g_debug ("And the subsystem is %s", subsystem); - g_debug ("And the device_type is %s", device_type); - if (g_strcmp0 (subsystem, "usb") == 0){ - if ( g_udev_device_has_property (device, "ID_USB_INTERFACES")){ - const gchar* id_usb_interfaces = NULL; - id_usb_interfaces = g_udev_device_get_property (device, "ID_USB_INTERFACES"); - - GError* error = NULL; - GMatchInfo *match_info = NULL; - GRegex* webcam_regex = NULL; - - webcam_regex = g_regex_new (":0e[0-9]{4}:*", - 0, - 0, - &error); - // This seems to be case with certain webcams - //#":ff[f|0]{4} - if (error != NULL){ - g_debug ("Errors creating the regex : %s", error->message); - } - gboolean result = g_regex_match (webcam_regex, - id_usb_interfaces, - 0, - & match_info); - - g_debug ("we have found the id usb interfaces : %s", id_usb_interfaces); - - if (result == TRUE){ - g_debug ("SUCCESSFUL MATCH"); - } - else { - g_debug ("NO MATCH"); - } - } - - udev_mgr_check_if_usb_device_is_supported (self, device, udev_mgr_action); + udev_mgr_check_if_usb_device_is_supported (self, + device, + udev_mgr_action); + } + else if (g_strcmp0 (subsystem, "video4linux") == 0){ + udev_mgr_handle_webcam (self, device, udev_mgr_action); } else if (g_strcmp0 (subsystem, "scsi") == 0){ udev_mgr_check_if_scsi_device_is_supported (self, device, udev_mgr_action); } +} + +static void +udev_mgr_handle_webcam (UdevMgr* self, + GUdevDevice* device, + UdevMgrDeviceAction action) +{ + if (FALSE) + debug_device (self, device, action); + + const gchar* vendor; + const gchar* product; - return; + vendor = g_udev_device_get_property (device, "ID_VENDOR_ID"); + product = g_udev_device_get_property (device, "ID_MODEL_ID"); + if (action == REMOVE){ + if (g_hash_table_lookup (self->webcams_present, product) == NULL){ + g_warning ("Got a remove event on a webcam device but we don't have that device in our webcam cache"); + return; + } + g_hash_table_remove (self->webcams_present, + g_strdup (product)); + + } + else { + if (g_hash_table_lookup (self->webcams_present, product) != NULL){ + g_warning ("Got an ADD event on a webcam device but we already have that device in our webcam cache"); + return; + } + g_hash_table_insert (self->webcams_present, + g_strdup (product), + g_strdup (vendor)); + + } + udev_mgr_update_menuitems (self); +} + +static void +debug_device (UdevMgr* self, + GUdevDevice* device, + UdevMgrDeviceAction action) +{ const gchar* vendor; const gchar* product; const gchar* number; + const gchar* name; vendor = g_udev_device_get_property (device, "ID_VENDOR_ID"); product = g_udev_device_get_property (device, "ID_MODEL_ID"); number = g_udev_device_get_number (device); - - g_debug ("device vendor id %s and product id of %s and number of %s", + name = g_udev_device_get_name (device); + + g_debug ("device vendor id %s , product id of %s , number of %s and name of %s", g_strdup(vendor), g_strdup(product), - g_strdup(number)); + g_strdup(number), + g_strdup(name)); const gchar *const *list; const gchar *const *iter; @@ -245,7 +250,7 @@ static void udev_mgr_uevent_cb (GUdevClient *client, strcat(propstr, " "); strcat(propstr, g_udev_device_get_property(device, *iter)); g_debug("%s", propstr); - } + } } @@ -261,7 +266,6 @@ udev_mgr_check_if_usb_device_is_supported (UdevMgr* self, GUdevDevice *device, UdevMgrDeviceAction action) { - g_debug ("got a uevent"); const gchar* vendor = NULL; vendor = g_udev_device_get_property (device, "ID_VENDOR_ID"); @@ -288,24 +292,25 @@ udev_mgr_check_if_usb_device_is_supported (UdevMgr* self, if (model_entry != NULL){ if (action == REMOVE){ - // TODO handle the case where its removed - // remove it if present from the hash and call update_menuitems + if (g_hash_table_lookup (self->scanners_present, g_strdup(vendor)) == NULL){ + g_warning ("Got an REMOVE event on a scanner device but we dont have that device in our scanners cache"); + } + else{ + g_hash_table_remove (self->scanners_present, g_strdup(vendor)); + } } else{ - // TODO: populate it with the name of the device - // this will be needed for the menuitem - g_hash_table_insert (self->scanners_present, - g_strdup(vendor), - g_strdup(model_id)); + if (g_hash_table_lookup (self->scanners_present, g_strdup(vendor)) != NULL){ + g_warning ("Got an ADD event on a scanner device but we already have that device in our scanners cache"); + } + else{ + g_hash_table_insert (self->scanners_present, + g_strdup(vendor), + g_strdup(model_id)); + } } + udev_mgr_update_menuitems (self); } - // DEBUG purposes. - if (model_entry == NULL){ - g_debug ("CANT FIND THE MODEL %s FOR VENDOR %s", model_id, vendor); - } - else{ - g_debug ("WE HAVE A SUCCESSFUL MATCH!"); - } } UdevMgr* udev_mgr_new (DbusmenuMenuitem* scanner, @@ -315,12 +320,22 @@ UdevMgr* udev_mgr_new (DbusmenuMenuitem* scanner, mgr->scanner_item = scanner; mgr->webcam_item = webcam; - GList* devices_available = g_udev_client_query_by_subsystem (mgr->client, + GList* usb_devices_available = g_udev_client_query_by_subsystem (mgr->client, usb_subsystem); - g_list_foreach (devices_available, + g_list_foreach (usb_devices_available, + udevice_mgr_device_list_iterator, + mgr); + + g_list_free (usb_devices_available); + + GList* video_devices_available = g_udev_client_query_by_subsystem (mgr->client, + video4linux_subsystem); + g_list_foreach (video_devices_available, udevice_mgr_device_list_iterator, mgr); - g_list_free (devices_available); - udev_mgr_update_menuitems (mgr); + + g_list_free (video_devices_available); + + //udev_mgr_update_menuitems (mgr); return mgr; } -- cgit v1.2.3 From 85e9bcfb399e489eaa6fbf467f940baa69239bf2 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Wed, 3 Aug 2011 18:01:32 +0100 Subject: refactor of the udev mgr - working nicely --- src/device-menu-mgr.c | 6 +++--- src/sane-rules.h | 5 +++++ src/udev-mgr.c | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/device-menu-mgr.c b/src/device-menu-mgr.c index 2c559ee..1be113c 100644 --- a/src/device-menu-mgr.c +++ b/src/device-menu-mgr.c @@ -547,7 +547,7 @@ device_menu_mgr_build_static_items (DeviceMenuMgr* self) scanners_menuitem = dbusmenu_menuitem_new(); dbusmenu_menuitem_property_set (scanners_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, - _("HP Scanners")); + _("Scanners")); g_signal_connect (G_OBJECT(scanners_menuitem), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_system_settings_with_context), @@ -562,11 +562,11 @@ device_menu_mgr_build_static_items (DeviceMenuMgr* self) webcam_menuitem = dbusmenu_menuitem_new(); dbusmenu_menuitem_property_set (webcam_menuitem, DBUSMENU_MENUITEM_PROP_LABEL, - _("HP Webcam")); + _("Webcam")); g_signal_connect (G_OBJECT(webcam_menuitem), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(show_system_settings_with_context), - "HP Webcam"); + "Webcam"); dbusmenu_menuitem_child_add_position (self->root_item, webcam_menuitem, 10); diff --git a/src/sane-rules.h b/src/sane-rules.h index 4c36698..871565b 100644 --- a/src/sane-rules.h +++ b/src/sane-rules.h @@ -2,6 +2,7 @@ void populate_usb_scanners (GHashTable* scanners) { GList* hp = NULL; + hp = g_list_append (hp, g_strdup ("0101")); hp = g_list_append (hp, g_strdup ("0105")); hp = g_list_append (hp, g_strdup ("0201")); @@ -308,6 +309,10 @@ void populate_usb_scanners (GHashTable* scanners) g_list_copy(nikon)); GList* epson = NULL; + + // for testing (its a printer not a scanner!) + //epson = g_list_append (epson, g_strdup ("0001")); + epson = g_list_append (epson, g_strdup("0101")); epson = g_list_append (epson, g_strdup("0103")); epson = g_list_append (epson, g_strdup("0104")); diff --git a/src/udev-mgr.c b/src/udev-mgr.c index 5c650b6..6ddd97d 100644 --- a/src/udev-mgr.c +++ b/src/udev-mgr.c @@ -203,8 +203,7 @@ udev_mgr_handle_webcam (UdevMgr* self, } g_hash_table_insert (self->webcams_present, g_strdup (product), - g_strdup (vendor)); - + g_strdup (vendor)); } udev_mgr_update_menuitems (self); } @@ -267,6 +266,7 @@ udev_mgr_check_if_usb_device_is_supported (UdevMgr* self, UdevMgrDeviceAction action) { const gchar* vendor = NULL; + debug_device (self, device, action); vendor = g_udev_device_get_property (device, "ID_VENDOR_ID"); -- cgit v1.2.3 From 6ec15c2d51f83a10f81d94ad1be2da8761c9553c Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 4 Aug 2011 11:59:50 +0100 Subject: add scsi scanner detection support --- src/sane-rules.h | 26 ++++++++++++ src/udev-mgr.c | 127 +++++++++++++++++++++++++++++++++++++++++++------------ 2 files changed, 125 insertions(+), 28 deletions(-) diff --git a/src/sane-rules.h b/src/sane-rules.h index 871565b..5483b28 100644 --- a/src/sane-rules.h +++ b/src/sane-rules.h @@ -1,3 +1,29 @@ +void populate_scsi_scanners (GHashTable* scanners) +{ + GList* epson = NULL; + epson = g_list_append (epson, g_strdup ("GT-9700")); + epson = g_list_append (epson, g_strdup ("GT-9800")); + epson = g_list_append (epson, g_strdup ("Perfection1200")); + epson = g_list_append (epson, g_strdup ("Perfection636")); + epson = g_list_append (epson, g_strdup ("SCANNER GT-7000")); + g_hash_table_insert (scanners, + g_strdup("EPSON"), + g_list_copy(epson)); + + + GList* hp = NULL; + hp = g_list_append (hp, g_strdup ("C1130A")); + hp = g_list_append (hp, g_strdup ("C1750A")); + hp = g_list_append (hp, g_strdup ("C1790A")); + hp = g_list_append (hp, g_strdup ("C2500A")); + hp = g_list_append (hp, g_strdup ("C2520A")); + hp = g_list_append (hp, g_strdup ("C5110A")); + hp = g_list_append (hp, g_strdup ("C6270A")); + hp = g_list_append (hp, g_strdup ("C7670A")); + g_hash_table_insert (scanners, + g_strdup("HP"), + g_list_copy(hp)); +} void populate_usb_scanners (GHashTable* scanners) { diff --git a/src/udev-mgr.c b/src/udev-mgr.c index 6ddd97d..d110304 100644 --- a/src/udev-mgr.c +++ b/src/udev-mgr.c @@ -37,19 +37,17 @@ static void udev_mgr_uevent_cb (GUdevClient *client, static void udev_mgr_update_menuitems (UdevMgr* self); static void udev_mgr_check_if_usb_device_is_supported (UdevMgr* self, GUdevDevice *device, - UdevMgrDeviceAction action); - -static void udev_mgr_check_if_scsi_device_is_supported (UdevMgr* self, - GUdevDevice *device, - UdevMgrDeviceAction action); + UdevMgrDeviceAction action); static void udev_mgr_handle_webcam (UdevMgr* self, GUdevDevice* device, - UdevMgrDeviceAction action); - + UdevMgrDeviceAction action); +static void udev_mgr_handle_scsi_device (UdevMgr* self, + GUdevDevice* device, + UdevMgrDeviceAction action); + static void debug_device (UdevMgr* self, GUdevDevice* device, UdevMgrDeviceAction action); - struct _UdevMgr { @@ -58,12 +56,14 @@ struct _UdevMgr DbusmenuMenuitem* webcam_item; GUdevClient* client; GHashTable* supported_usb_scanners; + GHashTable* supported_scsi_scanners; GHashTable* scanners_present; GHashTable* webcams_present; }; const char *subsystems[3] = {"usb", "scsi", "video4linux"}; const gchar* usb_subsystem = "usb"; +const gchar* scsi_subsystem = "scsi"; const gchar* video4linux_subsystem = "video4linux"; @@ -76,15 +76,29 @@ udev_mgr_init (UdevMgr* self) self->supported_usb_scanners = NULL; self->scanners_present = NULL; self->webcams_present = NULL; - + g_debug ("About to create hash tables"); self->client = g_udev_client_new (subsystems); - self->supported_usb_scanners = g_hash_table_new (g_str_hash, g_str_equal); - self->scanners_present = g_hash_table_new (g_str_hash, g_str_equal); - self->webcams_present = g_hash_table_new (g_str_hash, g_str_equal); + self->supported_usb_scanners = g_hash_table_new_full (g_str_hash, + g_str_equal, + g_free, + g_free); + self->supported_scsi_scanners = g_hash_table_new_full (g_str_hash, + g_str_equal, + g_free, + g_free); + self->scanners_present = g_hash_table_new_full (g_str_hash, + g_str_equal, + g_free, + g_free); + self->webcams_present = g_hash_table_new_full (g_str_hash, + g_str_equal, + g_free, + g_free); + g_debug ("After creating hash tables"); // load into memory all supported scanners ... - populate_usb_scanners(self->supported_usb_scanners); - + populate_usb_scanners (self->supported_usb_scanners); + populate_scsi_scanners (self->supported_scsi_scanners); g_signal_connect (G_OBJECT (self->client), "uevent", G_CALLBACK (udev_mgr_uevent_cb), @@ -124,6 +138,10 @@ udevice_mgr_device_list_iterator (gpointer data, gpointer userdata) else if (g_strcmp0 (subsystem, "video4linux") == 0){ udev_mgr_handle_webcam (self, device, ADD); } + else if (g_strcmp0 (subsystem, "scsi") == 0){ + udev_mgr_handle_scsi_device (self, device, ADD); + } + g_object_unref (device); } @@ -169,10 +187,11 @@ static void udev_mgr_uevent_cb (GUdevClient *client, udev_mgr_handle_webcam (self, device, udev_mgr_action); } else if (g_strcmp0 (subsystem, "scsi") == 0){ - udev_mgr_check_if_scsi_device_is_supported (self, device, udev_mgr_action); + udev_mgr_handle_scsi_device (self, device, udev_mgr_action); } } + static void udev_mgr_handle_webcam (UdevMgr* self, GUdevDevice* device, @@ -193,7 +212,7 @@ udev_mgr_handle_webcam (UdevMgr* self, return; } g_hash_table_remove (self->webcams_present, - g_strdup (product)); + product); } else { @@ -252,13 +271,55 @@ debug_device (UdevMgr* self, } } - -static void -udev_mgr_check_if_scsi_device_is_supported (UdevMgr* self, - GUdevDevice *device, - UdevMgrDeviceAction action) +static void udev_mgr_handle_scsi_device (UdevMgr* self, + GUdevDevice* device, + UdevMgrDeviceAction action) { -} + const gchar* vendor = NULL; + vendor = g_udev_device_get_property (device, "VENDOR"); + + if (vendor == NULL) + return; + + GList* vendor_list = NULL; + vendor_list = g_hash_table_lookup (self->supported_scsi_scanners, + (gpointer)vendor); + if (vendor_list == NULL) + return; + + const gchar* model_id = NULL; + model_id = g_udev_device_get_property (device, "MODEL"); + + if (model_id == NULL) + return; + + GList* model_entry = NULL; + model_entry = g_list_find_custom (vendor_list, + model_id, + (GCompareFunc)g_strcmp0); + + if (model_entry != NULL){ + if (action == REMOVE){ + if (g_hash_table_lookup (self->scanners_present, g_strdup(vendor)) == NULL){ + g_warning ("Got an REMOVE event on a scanner device but we dont have that device in our scanners cache"); + } + else{ + g_hash_table_remove (self->scanners_present, vendor); + } + } + else{ + if (g_hash_table_lookup (self->scanners_present, g_strdup(vendor)) != NULL){ + g_warning ("Got an ADD event on a scanner device but we already have that device in our scanners cache"); + } + else{ + g_hash_table_insert (self->scanners_present, + g_strdup(vendor), + g_strdup(model_id)); + } + } + udev_mgr_update_menuitems (self); + } +} static void udev_mgr_check_if_usb_device_is_supported (UdevMgr* self, @@ -273,7 +334,7 @@ udev_mgr_check_if_usb_device_is_supported (UdevMgr* self, if (vendor == NULL) return; - g_debug ("vendor = %s", vendor); + //g_debug ("vendor = %s", vendor); GList* vendor_list = NULL; vendor_list = g_hash_table_lookup (self->supported_usb_scanners, @@ -296,7 +357,7 @@ udev_mgr_check_if_usb_device_is_supported (UdevMgr* self, g_warning ("Got an REMOVE event on a scanner device but we dont have that device in our scanners cache"); } else{ - g_hash_table_remove (self->scanners_present, g_strdup(vendor)); + g_hash_table_remove (self->scanners_present, vendor); } } else{ @@ -319,15 +380,17 @@ UdevMgr* udev_mgr_new (DbusmenuMenuitem* scanner, UdevMgr* mgr = g_object_new (UDEV_TYPE_MGR, NULL); mgr->scanner_item = scanner; mgr->webcam_item = webcam; - + + // Check for USB devices GList* usb_devices_available = g_udev_client_query_by_subsystem (mgr->client, - usb_subsystem); + usb_subsystem); g_list_foreach (usb_devices_available, udevice_mgr_device_list_iterator, mgr); g_list_free (usb_devices_available); - + + // Check for webcams GList* video_devices_available = g_udev_client_query_by_subsystem (mgr->client, video4linux_subsystem); g_list_foreach (video_devices_available, @@ -335,7 +398,15 @@ UdevMgr* udev_mgr_new (DbusmenuMenuitem* scanner, mgr); g_list_free (video_devices_available); + + // Check for SCSI devices + GList* scsi_devices_available = g_udev_client_query_by_subsystem (mgr->client, + scsi_subsystem); + g_list_foreach (scsi_devices_available, + udevice_mgr_device_list_iterator, + mgr); + + g_list_free (usb_devices_available); - //udev_mgr_update_menuitems (mgr); return mgr; } -- cgit v1.2.3 From c6d97d1fae6783d5b671de8b7af4ae23116f46a0 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 4 Aug 2011 12:32:50 +0100 Subject: duplicate key input error --- src/sane-rules.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sane-rules.h b/src/sane-rules.h index 5483b28..4d6c7cc 100644 --- a/src/sane-rules.h +++ b/src/sane-rules.h @@ -25,6 +25,8 @@ void populate_scsi_scanners (GHashTable* scanners) g_list_copy(hp)); } + + void populate_usb_scanners (GHashTable* scanners) { GList* hp = NULL; @@ -78,7 +80,7 @@ void populate_usb_scanners (GHashTable* scanners) mustek_2 = g_list_append (mustek_2, g_strdup ("1000")); mustek_2 = g_list_append (mustek_2, g_strdup ("1001")); g_hash_table_insert (scanners, - g_strdup("03f0"), + g_strdup("0400"), g_list_copy(mustek_2)); GList* kodak = NULL; -- cgit v1.2.3 From 9cf6aa224e626832f2b4c1e4e53d5fd604484396 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 4 Aug 2011 13:05:39 +0100 Subject: stop leaking tonnes of glists --- src/sane-rules.h | 84 ++++++++++++++++++++++++++++---------------------------- src/udev-mgr.c | 4 +-- 2 files changed, 44 insertions(+), 44 deletions(-) diff --git a/src/sane-rules.h b/src/sane-rules.h index 4d6c7cc..0b72e52 100644 --- a/src/sane-rules.h +++ b/src/sane-rules.h @@ -8,7 +8,7 @@ void populate_scsi_scanners (GHashTable* scanners) epson = g_list_append (epson, g_strdup ("SCANNER GT-7000")); g_hash_table_insert (scanners, g_strdup("EPSON"), - g_list_copy(epson)); + epson); GList* hp = NULL; @@ -22,7 +22,7 @@ void populate_scsi_scanners (GHashTable* scanners) hp = g_list_append (hp, g_strdup ("C7670A")); g_hash_table_insert (scanners, g_strdup("HP"), - g_list_copy(hp)); + hp); } @@ -74,14 +74,14 @@ void populate_usb_scanners (GHashTable* scanners) g_hash_table_insert (scanners, g_strdup("03f0"), - g_list_copy(hp)); + hp); GList* mustek_2 = NULL; mustek_2 = g_list_append (mustek_2, g_strdup ("1000")); mustek_2 = g_list_append (mustek_2, g_strdup ("1001")); g_hash_table_insert (scanners, g_strdup("0400"), - g_list_copy(mustek_2)); + mustek_2); GList* kodak = NULL; kodak = g_list_append (kodak, g_strdup ("6001")); @@ -91,7 +91,7 @@ void populate_usb_scanners (GHashTable* scanners) kodak = g_list_append (kodak, g_strdup ("6005")); g_hash_table_insert (scanners, g_strdup("040a"), - g_list_copy(kodak)); + kodak); GList* creative = NULL; @@ -99,7 +99,7 @@ void populate_usb_scanners (GHashTable* scanners) g_hash_table_insert (scanners, g_strdup("041e"), - g_list_copy(creative)); + creative); GList* lexmark = NULL; @@ -110,7 +110,7 @@ void populate_usb_scanners (GHashTable* scanners) g_hash_table_insert (scanners, g_strdup("043d"), - g_list_copy(lexmark)); + lexmark); GList* genius = NULL; @@ -132,32 +132,32 @@ void populate_usb_scanners (GHashTable* scanners) genius = g_list_append (genius, g_strdup("20c1")); g_hash_table_insert (scanners, g_strdup("0458"), - g_list_copy(genius)); + genius); GList* medion = NULL; medion = g_list_append (medion, g_strdup("0377")); g_hash_table_insert (scanners, g_strdup("0461"), - g_list_copy(medion)); + medion); GList* trust = NULL; trust = g_list_append (trust, g_strdup("1000")); trust = g_list_append (trust, g_strdup("1002")); g_hash_table_insert (scanners, g_strdup("047b"), - g_list_copy(trust)); + trust); GList* kyocera = NULL; kyocera = g_list_append (kyocera, g_strdup("0335")); g_hash_table_insert (scanners, g_strdup("0482"), - g_list_copy(kyocera)); + kyocera); GList* compaq = NULL; compaq = g_list_append (compaq, g_strdup("001a")); g_hash_table_insert (scanners, g_strdup("049f"), - g_list_copy(compaq)); + compaq); GList* benq = NULL; benq = g_list_append (benq, g_strdup("1a20")); benq = g_list_append (benq, g_strdup("1a2a")); @@ -176,7 +176,7 @@ void populate_usb_scanners (GHashTable* scanners) benq = g_list_append (benq, g_strdup("2211")); g_hash_table_insert (scanners, g_strdup("04a5"), - g_list_copy(benq)); + benq); GList* visioneer = NULL; visioneer = g_list_append (visioneer, g_strdup("0229")); @@ -223,7 +223,7 @@ void populate_usb_scanners (GHashTable* scanners) visioneer = g_list_append (visioneer, g_strdup("04ac")); g_hash_table_insert (scanners, g_strdup("04a7"), - g_list_copy(visioneer)); + visioneer); GList* canon = NULL; canon = g_list_append (canon, g_strdup("1601")); canon = g_list_append (canon, g_strdup("1602")); @@ -326,7 +326,7 @@ void populate_usb_scanners (GHashTable* scanners) canon = g_list_append (canon, g_strdup("26ee")); g_hash_table_insert (scanners, g_strdup("04a9"), - g_list_copy(canon)); + canon); GList* nikon = NULL; nikon = g_list_append (nikon, g_strdup ("4000")); @@ -334,7 +334,7 @@ void populate_usb_scanners (GHashTable* scanners) nikon = g_list_append (nikon, g_strdup ("4002")); g_hash_table_insert (scanners, g_strdup("04b0"), - g_list_copy(nikon)); + nikon); GList* epson = NULL; @@ -427,7 +427,7 @@ void populate_usb_scanners (GHashTable* scanners) epson = g_list_append (epson, g_strdup("0856")); g_hash_table_insert (scanners, g_strdup("04b8"), - g_list_copy(epson)); + epson); GList* fujitsu = NULL; fujitsu = g_list_append (fujitsu, g_strdup ("1029")); @@ -480,12 +480,12 @@ void populate_usb_scanners (GHashTable* scanners) fujitsu = g_list_append (fujitsu, g_strdup ("11fc")); g_hash_table_insert (scanners, g_strdup("04c5"), - g_list_copy(fujitsu)); + fujitsu); GList* konica = NULL; konica = g_list_append (konica, g_strdup ("0722")); g_hash_table_insert (scanners, g_strdup("04c8"), - g_list_copy(konica)); + konica); GList* panasonic = NULL; panasonic = g_list_append (panasonic, g_strdup ("1000")); panasonic = g_list_append (panasonic, g_strdup ("1001")); @@ -497,7 +497,7 @@ void populate_usb_scanners (GHashTable* scanners) panasonic = g_list_append (panasonic, g_strdup ("1010")); g_hash_table_insert (scanners, g_strdup("04da"), - g_list_copy(panasonic)); + panasonic); GList* samsung = NULL; @@ -513,19 +513,19 @@ void populate_usb_scanners (GHashTable* scanners) samsung = g_list_append (samsung, g_strdup ("3434")); g_hash_table_insert (scanners, g_strdup("04e8"), - g_list_copy(samsung)); + samsung); GList* pentax = NULL; pentax = g_list_append (pentax, g_strdup ("2038")); g_hash_table_insert (scanners, g_strdup("04f9"), - g_list_copy(pentax)); + pentax); GList* apitek = NULL; apitek = g_list_append (apitek, g_strdup ("0202")); g_hash_table_insert (scanners, g_strdup("0553"), - g_list_copy(apitek)); + apitek); GList* mustek = NULL; mustek = g_list_append (mustek, g_strdup ("0001")); @@ -545,7 +545,7 @@ void populate_usb_scanners (GHashTable* scanners) mustek = g_list_append (mustek, g_strdup ("0409")); g_hash_table_insert (scanners, g_strdup("055f"), - g_list_copy(mustek)); + mustek); GList* artec = NULL; artec = g_list_append (artec, g_strdup ("4002")); artec = g_list_append (artec, g_strdup ("4003")); @@ -558,7 +558,7 @@ void populate_usb_scanners (GHashTable* scanners) artec = g_list_append (artec, g_strdup ("4011")); g_hash_table_insert (scanners, g_strdup("05d8"), - g_list_copy(artec)); + artec); GList* microtek = NULL; microtek = g_list_append (microtek, g_strdup ("0099")); @@ -576,7 +576,7 @@ void populate_usb_scanners (GHashTable* scanners) microtek = g_list_append (microtek, g_strdup ("80a3")); g_hash_table_insert (scanners, g_strdup("05da"), - g_list_copy(microtek)); + microtek); GList* avision = NULL; avision = g_list_append (avision, g_strdup ("0268")); @@ -618,14 +618,14 @@ void populate_usb_scanners (GHashTable* scanners) avision = g_list_append (avision, g_strdup ("1a35")); g_hash_table_insert (scanners, g_strdup("0638"), - g_list_copy(avision)); + avision); GList* minolta = NULL; minolta = g_list_append (minolta, g_strdup ("4004")); minolta = g_list_append (minolta, g_strdup ("400d")); minolta = g_list_append (minolta, g_strdup ("400e")); g_hash_table_insert (scanners, g_strdup("0686"), - g_list_copy(minolta)); + minolta); GList* agfa = NULL; agfa = g_list_append (agfa, g_strdup ("0001")); @@ -642,13 +642,13 @@ void populate_usb_scanners (GHashTable* scanners) agfa = g_list_append (agfa, g_strdup ("20ff")); g_hash_table_insert (scanners, g_strdup("06bd"), - g_list_copy(minolta)); + minolta); GList* umax_2 = NULL; umax_2 = g_list_append (umax_2, g_strdup ("0020")); g_hash_table_insert (scanners, g_strdup("06dc"), - g_list_copy(umax_2)); + umax_2); GList* plustek = NULL; @@ -673,14 +673,14 @@ void populate_usb_scanners (GHashTable* scanners) plustek = g_list_append (plustek, g_strdup ("0900")); g_hash_table_insert (scanners, g_strdup("07b3"), - g_list_copy(plustek)); + plustek); GList* corex = NULL; corex = g_list_append (corex, g_strdup ("0002")); corex = g_list_append (corex, g_strdup ("0005")); g_hash_table_insert (scanners, g_strdup("08f0"), - g_list_copy(corex)); + corex); GList* xerox = NULL; xerox = g_list_append (xerox, g_strdup ("3d5d")); @@ -691,19 +691,19 @@ void populate_usb_scanners (GHashTable* scanners) xerox = g_list_append (xerox, g_strdup ("4294")); g_hash_table_insert (scanners, g_strdup("0924"), - g_list_copy(xerox)); + xerox); GList* pentax_2 = NULL; pentax_2 = g_list_append (pentax_2, g_strdup ("3210")); g_hash_table_insert (scanners, g_strdup("0a17"), - g_list_copy(pentax_2)); + pentax_2); GList* portable = NULL; portable = g_list_append (portable, g_strdup ("1000")); g_hash_table_insert (scanners, g_strdup("0a53"), - g_list_copy(portable)); + portable); GList* syscan = NULL; syscan = g_list_append (syscan, g_strdup ("4600")); @@ -714,7 +714,7 @@ void populate_usb_scanners (GHashTable* scanners) syscan = g_list_append (syscan, g_strdup ("6620")); g_hash_table_insert (scanners, g_strdup("0a82"), - g_list_copy(syscan)); + syscan); GList* canon_2 = NULL; canon_2 = g_list_append (canon_2, g_strdup ("160c")); @@ -735,19 +735,19 @@ void populate_usb_scanners (GHashTable* scanners) canon_2 = g_list_append (canon_2, g_strdup ("1639")); g_hash_table_insert (scanners, g_strdup("1083"), - g_list_copy(canon_2)); + canon_2); GList* digital = NULL; digital = g_list_append (digital, g_strdup ("0001")); g_hash_table_insert (scanners, g_strdup("1183"), - g_list_copy(digital)); + digital); GList* konica_2 = NULL; konica_2 = g_list_append (konica_2, g_strdup ("2089")); g_hash_table_insert (scanners, g_strdup("132b"), - g_list_copy(konica_2)); + konica_2); GList* umax = NULL; umax = g_list_append (umax, g_strdup ("0010")); @@ -760,13 +760,13 @@ void populate_usb_scanners (GHashTable* scanners) umax = g_list_append (umax, g_strdup ("0230")); g_hash_table_insert (scanners, g_strdup("1606"), - g_list_copy(umax)); + umax); GList* docketport = NULL; docketport = g_list_append (docketport, g_strdup ("4810")); g_hash_table_insert (scanners, g_strdup("1dcc"), - g_list_copy(docketport)); + docketport); GList* dell = NULL; dell = g_list_append (dell, g_strdup ("5105")); @@ -774,5 +774,5 @@ void populate_usb_scanners (GHashTable* scanners) dell = g_list_append (dell, g_strdup ("5250")); g_hash_table_insert (scanners, g_strdup("413c"), - g_list_copy(dell)); + dell); } diff --git a/src/udev-mgr.c b/src/udev-mgr.c index d110304..6749157 100644 --- a/src/udev-mgr.c +++ b/src/udev-mgr.c @@ -81,11 +81,11 @@ udev_mgr_init (UdevMgr* self) self->supported_usb_scanners = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, - g_free); + (GDestroyNotify)g_list_free); self->supported_scsi_scanners = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, - g_free); + (GDestroyNotify)g_list_free); self->scanners_present = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, -- cgit v1.2.3 From 5ba9266a7798e03013af14d4e5003725151e665e Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 4 Aug 2011 13:33:06 +0100 Subject: destroying hash tables in finalize --- src/udev-mgr.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/udev-mgr.c b/src/udev-mgr.c index 6749157..df491aa 100644 --- a/src/udev-mgr.c +++ b/src/udev-mgr.c @@ -76,7 +76,6 @@ udev_mgr_init (UdevMgr* self) self->supported_usb_scanners = NULL; self->scanners_present = NULL; self->webcams_present = NULL; - g_debug ("About to create hash tables"); self->client = g_udev_client_new (subsystems); self->supported_usb_scanners = g_hash_table_new_full (g_str_hash, g_str_equal, @@ -94,7 +93,6 @@ udev_mgr_init (UdevMgr* self) g_str_equal, g_free, g_free); - g_debug ("After creating hash tables"); // load into memory all supported scanners ... populate_usb_scanners (self->supported_usb_scanners); @@ -108,7 +106,11 @@ udev_mgr_init (UdevMgr* self) static void udev_mgr_finalize (GObject *object) { - // TODO tidy up hashtables. + UdevMgr* self = UDEV_MGR (object); + g_hash_table_destroy (self->supported_scsi_scanners); + g_hash_table_destroy (self->supported_usb_scanners); + g_hash_table_destroy (self->scanners_present); + g_hash_table_destroy (self->webcams_present); G_OBJECT_CLASS (udev_mgr_parent_class)->finalize (object); } -- cgit v1.2.3 From c1ee13d61894607f7e916d1041c1db0b2c99c93a Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 4 Aug 2011 17:25:19 +0100 Subject: trace around this seg fault --- src/device-menu-mgr.c | 25 ++++++++++++++++++++----- src/user-menu-mgr.c | 20 ++++++++++++++++---- 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/src/device-menu-mgr.c b/src/device-menu-mgr.c index 1be113c..9706598 100644 --- a/src/device-menu-mgr.c +++ b/src/device-menu-mgr.c @@ -81,8 +81,11 @@ static void machine_sleep_with_context (DeviceMenuMgr* self, gchar* type); static void show_system_settings_with_context (DbusmenuMenuitem * mi, guint timestamp, - gchar * type); - + gchar * type); + +static void show_simple_scan (DbusmenuMenuitem * mi, + guint timestamp, + gchar * type); static void machine_sleep_from_hibernate (DbusmenuMenuitem * mi, guint timestamp, @@ -460,6 +463,18 @@ show_system_settings_with_context (DbusmenuMenuitem * mi, g_free(control_centre_command); } +static void show_simple_scan (DbusmenuMenuitem * mi, + guint timestamp, + gchar * type) +{ + GError * error = NULL; + if (!g_spawn_command_line_async("simple-scan", &error)) + { + g_warning("Unable to launch simple-scan: %s", error->message); + g_error_free(error); + } +} + static void device_menu_mgr_build_static_items (DeviceMenuMgr* self) { @@ -550,14 +565,14 @@ device_menu_mgr_build_static_items (DeviceMenuMgr* self) _("Scanners")); g_signal_connect (G_OBJECT(scanners_menuitem), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, - G_CALLBACK(show_system_settings_with_context), - "scanners"); + G_CALLBACK(show_simple_scan), + NULL); dbusmenu_menuitem_child_add_position (self->root_item, scanners_menuitem, 8); dbusmenu_menuitem_property_set_bool (scanners_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, - FALSE); + TRUE); webcam_menuitem = dbusmenu_menuitem_new(); dbusmenu_menuitem_property_set (webcam_menuitem, diff --git a/src/user-menu-mgr.c b/src/user-menu-mgr.c index 611bcc7..bf3b77f 100644 --- a/src/user-menu-mgr.c +++ b/src/user-menu-mgr.c @@ -149,10 +149,9 @@ user_menu_mgr_rebuild_items (UserMenuMgr *self) for (u = users; u != NULL; u = g_list_next (u)) { user = u->data; + g_debug ("%p: %s", user, user->real_name); user->service = self->users_dbus_interface; - g_debug ("%i %s", (gint)user->uid, user->user_name); - if (g_strcmp0(user->user_name, "guest") == 0) { /* Check to see if the guest has sessions and so therefore should get a check mark. */ @@ -171,13 +170,26 @@ user_menu_mgr_rebuild_items (UserMenuMgr *self) if (self->user_count > MINIMUM_USERS && self->user_count < MAXIMUM_USERS) { mi = dbusmenu_menuitem_new (); - dbusmenu_menuitem_property_set (mi, DBUSMENU_MENUITEM_PROP_TYPE, USER_ITEM_TYPE); + dbusmenu_menuitem_property_set (mi, + DBUSMENU_MENUITEM_PROP_TYPE, + USER_ITEM_TYPE); if (user->real_name_conflict) { gchar * conflictedname = g_strdup_printf("%s (%s)", user->real_name, user->user_name); dbusmenu_menuitem_property_set (mi, USER_ITEM_PROP_NAME, conflictedname); g_free(conflictedname); } else { - dbusmenu_menuitem_property_set (mi, USER_ITEM_PROP_NAME, user->real_name); + //g_debug ("%i %s", (gint)user->uid, user->real_name); + //g_debug ("users uid = %i", (gint)user->uid); + //g_debug ("users real name = %s", user->real_name); + if (user == NULL){ + g_debug ("USER pointer is NULL"); + return; + } + g_debug ("%p: %s", user, user->real_name); + + dbusmenu_menuitem_property_set (mi, + USER_ITEM_PROP_NAME, + user->real_name); } dbusmenu_menuitem_property_set_bool (mi, USER_ITEM_PROP_LOGGED_IN, -- cgit v1.2.3 From 8cf9d6a47573502d4f32b002129c81a3026447f0 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 4 Aug 2011 17:53:28 +0100 Subject: correct callbacks in place for scanners and webcams --- src/device-menu-mgr.c | 50 +++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/src/device-menu-mgr.c b/src/device-menu-mgr.c index 9706598..e9143f7 100644 --- a/src/device-menu-mgr.c +++ b/src/device-menu-mgr.c @@ -83,9 +83,13 @@ static void show_system_settings_with_context (DbusmenuMenuitem * mi, guint timestamp, gchar * type); -static void show_simple_scan (DbusmenuMenuitem * mi, - guint timestamp, - gchar * type); +static void device_menu_mgr_show_simple_scan (DbusmenuMenuitem * mi, + guint timestamp, + gchar * type); +static void device_menu_mgr_show_cheese (DbusmenuMenuitem * mi, + guint timestamp, + gchar * type); + static void machine_sleep_from_hibernate (DbusmenuMenuitem * mi, guint timestamp, @@ -463,15 +467,40 @@ show_system_settings_with_context (DbusmenuMenuitem * mi, g_free(control_centre_command); } -static void show_simple_scan (DbusmenuMenuitem * mi, - guint timestamp, - gchar * type) +// TODO: refactor both of these down to the one method. +static void device_menu_mgr_show_simple_scan (DbusmenuMenuitem * mi, + guint timestamp, + gchar * type) { GError * error = NULL; if (!g_spawn_command_line_async("simple-scan", &error)) { g_warning("Unable to launch simple-scan: %s", error->message); g_error_free(error); + if (!g_spawn_command_line_async("software-center simple-scan", &error)) + { + g_warning ("Unable to launch software-centre simple-scan: %s", + error->message); + g_error_free(error); + } + } +} + +static void device_menu_mgr_show_cheese (DbusmenuMenuitem * mi, + guint timestamp, + gchar * type) +{ + GError * error = NULL; + if (!g_spawn_command_line_async("cheese", &error)) + { + g_warning("Unable to launch cheese: %s", error->message); + g_error_free(error); + if (!g_spawn_command_line_async("software-center cheese", &error)) + { + g_warning ("Unable to launch software-centre cheese: %s", + error->message); + g_error_free(error); + } } } @@ -565,14 +594,14 @@ device_menu_mgr_build_static_items (DeviceMenuMgr* self) _("Scanners")); g_signal_connect (G_OBJECT(scanners_menuitem), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, - G_CALLBACK(show_simple_scan), + G_CALLBACK(device_menu_mgr_show_simple_scan), NULL); dbusmenu_menuitem_child_add_position (self->root_item, scanners_menuitem, 8); dbusmenu_menuitem_property_set_bool (scanners_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, - TRUE); + FALSE); webcam_menuitem = dbusmenu_menuitem_new(); dbusmenu_menuitem_property_set (webcam_menuitem, @@ -580,12 +609,11 @@ device_menu_mgr_build_static_items (DeviceMenuMgr* self) _("Webcam")); g_signal_connect (G_OBJECT(webcam_menuitem), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, - G_CALLBACK(show_system_settings_with_context), - "Webcam"); + G_CALLBACK(device_menu_mgr_show_cheese), + NULL); dbusmenu_menuitem_child_add_position (self->root_item, webcam_menuitem, 10); - //tmp dbusmenu_menuitem_property_set_bool (webcam_menuitem, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); -- cgit v1.2.3 From 7ccf396039ca441059913c9caa407d4662ed7b19 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Fri, 5 Aug 2011 10:20:17 +0100 Subject: cater for scsi type 3 and 6 devices --- src/udev-mgr.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/udev-mgr.c b/src/udev-mgr.c index df491aa..cbb7dcb 100644 --- a/src/udev-mgr.c +++ b/src/udev-mgr.c @@ -277,6 +277,24 @@ static void udev_mgr_handle_scsi_device (UdevMgr* self, GUdevDevice* device, UdevMgrDeviceAction action) { + const gchar* type = NULL; + type = g_udev_device_get_property (device, "TYPE"); + // apparently anything thats type 3 and SCSI is a Scanner + if (g_strcmp0 (type, "6") == 0){ + gchar* random_scanner_name = g_strdup_printf("%p--scanner", self); + g_hash_table_insert (self->scanners_present, + g_strdup(random_scanner_name), + g_strdup("Scanner")); + g_free (random_scanner_name); + udev_mgr_update_menuitems (self); + return; + } + + // We only care about type 3 for the special cases below + if (g_strcmp0 (type, "3") != 0){ + return; + } + const gchar* vendor = NULL; vendor = g_udev_device_get_property (device, "VENDOR"); -- cgit v1.2.3 From 014e2b2a3582f3e823e61e23d391c68b474e16b4 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 9 Aug 2011 11:32:05 +0100 Subject: fixed memory leaks --- src/udev-mgr.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/src/udev-mgr.c b/src/udev-mgr.c index cbb7dcb..5ac286e 100644 --- a/src/udev-mgr.c +++ b/src/udev-mgr.c @@ -45,9 +45,14 @@ static void udev_mgr_handle_scsi_device (UdevMgr* self, GUdevDevice* device, UdevMgrDeviceAction action); +static void udev_mgr_cleanup_lists(gpointer data, gpointer self); +static void udev_mgr_cleanup_entries(gpointer data, gpointer self); + + static void debug_device (UdevMgr* self, GUdevDevice* device, UdevMgrDeviceAction action); + struct _UdevMgr { @@ -80,11 +85,11 @@ udev_mgr_init (UdevMgr* self) self->supported_usb_scanners = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, - (GDestroyNotify)g_list_free); + (GDestroyNotify)udev_mgr_cleanup_lists); self->supported_scsi_scanners = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, - (GDestroyNotify)g_list_free); + (GDestroyNotify)udev_mgr_cleanup_lists); self->scanners_present = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, @@ -103,6 +108,21 @@ udev_mgr_init (UdevMgr* self) self); } +static void +udev_mgr_cleanup_lists(gpointer data, gpointer self) +{ + GList* scanners = (GList*)data; + g_list_foreach (scanners, udev_mgr_cleanup_entries, NULL); + g_list_free(scanners); +} + +static void +udev_mgr_cleanup_entries(gpointer data, gpointer self) +{ + gchar* entry = (gchar*)data; + g_free(entry); +} + static void udev_mgr_finalize (GObject *object) { @@ -283,9 +303,8 @@ static void udev_mgr_handle_scsi_device (UdevMgr* self, if (g_strcmp0 (type, "6") == 0){ gchar* random_scanner_name = g_strdup_printf("%p--scanner", self); g_hash_table_insert (self->scanners_present, - g_strdup(random_scanner_name), + random_scanner_name, g_strdup("Scanner")); - g_free (random_scanner_name); udev_mgr_update_menuitems (self); return; } -- cgit v1.2.3 From ddd4474c7cf18706f5ea43e0319488f4d0358226 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Tue, 9 Aug 2011 12:35:18 +0100 Subject: segfault found and fixed --- src/udev-mgr.c | 55 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/src/udev-mgr.c b/src/udev-mgr.c index 5ac286e..e3328ec 100644 --- a/src/udev-mgr.c +++ b/src/udev-mgr.c @@ -151,7 +151,7 @@ udevice_mgr_device_list_iterator (gpointer data, gpointer userdata) GUdevDevice* device = G_UDEV_DEVICE (data); - const gchar* subsystem = NULL; + const gchar* subsystem = NULL; subsystem = g_udev_device_get_subsystem (device); if (g_strcmp0 (subsystem, "usb") == 0){ @@ -421,31 +421,36 @@ UdevMgr* udev_mgr_new (DbusmenuMenuitem* scanner, mgr->webcam_item = webcam; // Check for USB devices - GList* usb_devices_available = g_udev_client_query_by_subsystem (mgr->client, - usb_subsystem); - g_list_foreach (usb_devices_available, - udevice_mgr_device_list_iterator, - mgr); - - g_list_free (usb_devices_available); - + GList* usb_devices_available = NULL; + usb_devices_available = g_udev_client_query_by_subsystem (mgr->client, + usb_subsystem); + if (usb_devices_available != NULL){ + g_list_foreach (usb_devices_available, + udevice_mgr_device_list_iterator, + mgr); + + g_list_free (usb_devices_available); + } // Check for webcams - GList* video_devices_available = g_udev_client_query_by_subsystem (mgr->client, - video4linux_subsystem); - g_list_foreach (video_devices_available, - udevice_mgr_device_list_iterator, - mgr); - - g_list_free (video_devices_available); - + GList* video_devices_available = NULL; + video_devices_available = g_udev_client_query_by_subsystem (mgr->client, + video4linux_subsystem); + if (video_devices_available != NULL){ + g_list_foreach (video_devices_available, + udevice_mgr_device_list_iterator, + mgr); + + g_list_free (video_devices_available); + } // Check for SCSI devices - GList* scsi_devices_available = g_udev_client_query_by_subsystem (mgr->client, - scsi_subsystem); - g_list_foreach (scsi_devices_available, - udevice_mgr_device_list_iterator, - mgr); - - g_list_free (usb_devices_available); - + GList* scsi_devices_available = NULL; + scsi_devices_available = g_udev_client_query_by_subsystem (mgr->client, + scsi_subsystem); + if (scsi_devices_available != NULL){ + g_list_foreach (scsi_devices_available, + udevice_mgr_device_list_iterator, + mgr); + g_list_free (scsi_devices_available); + } return mgr; } -- cgit v1.2.3