[wintab32 5/7] Add additional device tracing.

Jeremy White jwhite at winehq.org
Sun Dec 23 10:55:50 CST 2007


---
 dlls/winex11.drv/wintab.c |   27 +++++++++++++++++++++++++--
 1 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/dlls/winex11.drv/wintab.c b/dlls/winex11.drv/wintab.c
index c504b3b..112b864 100644
--- a/dlls/winex11.drv/wintab.c
+++ b/dlls/winex11.drv/wintab.c
@@ -335,6 +335,15 @@ static void Tablet_FixupCursors()
         }
 }

+static void trace_axes(XValuatorInfoPtr val)
+{
+    int i;
+    XAxisInfoPtr axis;
+
+    for (i = 0, axis = val->axes ; i < val->num_axes; i++, axis++)
+        TRACE("        Axis %d: [resolution %d|min_value %d|max_value %d]\n", i, axis->resolution, axis->min_value, axis->max_value);
+}
+
 void X11DRV_LoadTabletInfo(HWND hwnddefault)
 {
     const WCHAR SZ_CONTEXT_NAME[] = {'W','i','n','e',' ','T','a','b','l','e','t',' ','C','o','n','t','e','x','t',0};
@@ -413,7 +422,15 @@ void X11DRV_LoadTabletInfo(HWND hwnddefault)
     {
         int class_loop;

-        TRACE("Trying device %i(%s)\n",loop,devices[loop].name);
+        TRACE("Device %i:  [id %d|name %s|type %s|num_classes %d|use %s]\n",
+                loop, (int) devices[loop].id, devices[loop].name,
+                XGetAtomName(data->display, devices[loop].type),
+                devices[loop].num_classes,
+                devices[loop].use == IsXKeyboard ? "IsXKeyboard" :
+                    devices[loop].use == IsXPointer ? "IsXPointer" :
+                    devices[loop].use == IsXExtensionDevice ? "IsXExtensionDevice" :
+                    "Unknown"
+                );
         if (devices[loop].use == IsXExtensionDevice)
         {
             LPWTI_CURSORS_INFO cursor;
@@ -485,10 +502,16 @@ void X11DRV_LoadTabletInfo(HWND hwnddefault)
             {
                 switch (any->class)
                 {
+
                     case ValuatorClass:
+                        Val = (XValuatorInfoPtr) any;
+                        TRACE("    ValidatorInput %d: [class %d|length %d|num_axes %d|mode %d|motion_buffer %ld]\n",
+                                class_loop, (int) Val->class, Val->length, Val->num_axes, Val->mode, Val->motion_buffer);
+                        if (TRACE_ON(wintab32))
+                            trace_axes(Val);
+
                         if (!axis_read_complete)
                         {
-                            Val = (XValuatorInfoPtr) any;
                             Axis = (XAxisInfoPtr) ((char *) Val + sizeof
                                 (XValuatorInfo));

-- 
1.5.3.7





More information about the wine-patches mailing list