Commit 8e4d5d21 authored by Dan Kegel's avatar Dan Kegel Committed by Alexandre Julliard

wintab: Expand whitelist of tablets.

parent 8746e387
...@@ -388,23 +388,27 @@ BOOL match_token(const char *haystack, const char *needle) ...@@ -388,23 +388,27 @@ BOOL match_token(const char *haystack, const char *needle)
** by Wacom tablets. This code will likely need to be expanded for alternate tablet types ** by Wacom tablets. This code will likely need to be expanded for alternate tablet types
*/ */
#define IS_TABLET_CURSOR(n, t) (is_wacom((n), (t)) || is_cursor((n), (t)) || is_stylus((n), (t)) || is_eraser((n), (t)) || is_pad((n), (t))) static BOOL is_tablet_cursor(const char *name, const char *type)
static BOOL is_wacom(const char *name, const char *type)
{
if (name && match_token(name, "wacom"))
return TRUE;
if (type && match_token(type, "wacom"))
return TRUE;
return FALSE;
}
static BOOL is_cursor(const char *name, const char *type)
{ {
if (name && match_token(name, "cursor")) int i;
return TRUE; static const char *tablet_cursor_whitelist[] = {
if (type && match_token(type, "cursor")) "wacom",
return TRUE; "wizardpen",
"acecad",
"tablet",
"cursor",
"stylus",
"eraser",
"pad",
NULL
};
for (i=0; tablet_cursor_whitelist[i] != NULL; i++) {
if (name && match_token(name, tablet_cursor_whitelist[i]))
return TRUE;
if (type && match_token(type, tablet_cursor_whitelist[i]))
return TRUE;
}
return FALSE; return FALSE;
} }
...@@ -426,15 +430,6 @@ static BOOL is_eraser(const char *name, const char *type) ...@@ -426,15 +430,6 @@ static BOOL is_eraser(const char *name, const char *type)
return FALSE; return FALSE;
} }
static BOOL is_pad(const char *name, const char *type)
{
if (name && match_token(name, "pad"))
return TRUE;
if (type && match_token(type, "pad"))
return TRUE;
return FALSE;
}
/*********************************************************************** /***********************************************************************
* X11DRV_LoadTabletInfo (X11DRV.@) * X11DRV_LoadTabletInfo (X11DRV.@)
...@@ -580,9 +575,9 @@ void X11DRV_LoadTabletInfo(HWND hwnddefault) ...@@ -580,9 +575,9 @@ void X11DRV_LoadTabletInfo(HWND hwnddefault)
} }
MultiByteToWideChar(CP_UNIXCP, 0, target->name, -1, cursor->NAME, WT_MAX_NAME_LEN); MultiByteToWideChar(CP_UNIXCP, 0, target->name, -1, cursor->NAME, WT_MAX_NAME_LEN);
if (! IS_TABLET_CURSOR(target->name, device_type)) if (! is_tablet_cursor(target->name, device_type))
{ {
WARN("Skipping device %d [name %s|type %s]; not apparently a tablet cursor type device\n", WARN("Skipping device %d [name %s|type %s]; not apparently a tablet cursor type device. If this is wrong, please report to http://forums.winehq.org\n",
loop, devices[loop].name, device_type ? device_type : ""); loop, devices[loop].name, device_type ? device_type : "");
XFree(device_type); XFree(device_type);
cursor_target --; cursor_target --;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment