modify detail option (to print supplementary log)
authorHeebum Kwak <heebum0.kwak@samsung.com>
Wed, 5 Jun 2013 01:00:22 +0000 (10:00 +0900)
committerBoram Park <boram1288.park@samsung.com>
Mon, 24 Jun 2013 03:37:36 +0000 (12:37 +0900)
Change-Id: I96d0e6b350594c3d641fdcb8555f3b15994f50dc

25 files changed:
bin/xevlog_analyze/xevlog_analyze.c
common/xdbg_evlog.c
common/xdbg_evlog.h
common/xdbg_evlog_composite.c
common/xdbg_evlog_core.c
common/xdbg_evlog_core.h
common/xdbg_evlog_damage.c
common/xdbg_evlog_dri2.c
common/xdbg_evlog_event.c
common/xdbg_evlog_event.h
common/xdbg_evlog_gesture.c
common/xdbg_evlog_randr.c
common/xdbg_evlog_reply.c
common/xdbg_evlog_reply.h
common/xdbg_evlog_request.c
common/xdbg_evlog_request.h
common/xdbg_evlog_xext.c
common/xdbg_evlog_xinput.c
common/xdbg_evlog_xv.c
common/xdbg_types.h
lib/xdbg_log.c
lib/xdbg_log.h
module/xdbg_module_command.c
module/xdbg_module_evlog.c
module/xdbg_module_evlog.h

index f52998d..d089b23 100644 (file)
@@ -58,7 +58,7 @@ typedef struct _EvlogOption
     char   command_name[PATH_MAX+1];
     char   path_name[PATH_MAX+1];
     Bool   isRule;
-    Bool   detail;
+    int    detail_level;
 } EvlogOption;
 
 
@@ -79,7 +79,7 @@ _printUsage(char* name)
     printf("                ------------------------\n");
     printf("           * It is possible to write multiple policies.\n");
     printf("\n");
-    printf("       -a [Add Rule]       Setting Rule of 'Add' policy to find information you want\n");
+    printf("       -a [ALLOW Rule]       Setting Rule of 'ALLOW' policy to find information you want\n");
     printf("\n");
     printf("       -n [Deny Rule]      Setting Rule of 'Deny' policy to find information you want\n");
     printf("\n");
@@ -94,7 +94,11 @@ _printUsage(char* name)
     printf("\n");
     printf("           * WARNING : If you set both -a and -n option, must set -a option first. Otherwise Logs you DO NOT want can be printed.\n");
     printf("\n");
-    printf("       -d [OFF:0/ON:1]     To Print detail log of extensions\n");
+    printf("       -d [0-2]            To Set printing detail log level\n");
+    printf("\n");
+    printf("               0: To Print Primary Logs (XID, Root, Atom, Region ...)\n");
+    printf("               1: To Print More Detail Logs (Time, State, Mask ...\n");
+    printf("               2: To Print Supplementary Reply Logs (Information Including Each Item)\n");
     printf("\n");
     printf("       -h                  Usage of xevlog_anlayze\n");
     printf("\n");
@@ -312,8 +316,8 @@ static void _xEvlogAnalyzePrint (EvlogOption *eo, char* reply, int* len)
 
         if (xDbgEvlogRuleValidate (&evinfo))
         {
-            xDbgEvlogFillLog(&evinfo, eo->detail, log, &size);
-            printf ("%s", log);
+            if (xDbgEvlogFillLog(&evinfo, eo->detail_level, log, &size))
+                printf ("%s", log);
         }
 
         if (evinfo.req.ptr)
@@ -363,7 +367,7 @@ _checkOption(int argc, char** argv)
 
     eo.pid = atoi (argv[0]);
     eo.isRule = FALSE;
-    eo.detail = TRUE;
+    eo.detail_level = 0;
     strncpy(eo.command_name, argv[1], PATH_MAX);
 
     if (argc < 3)
@@ -528,8 +532,8 @@ _checkOption(int argc, char** argv)
 
                     if(opt_str_len > 0)
                     {
-                        eo.detail = (atoi(optarg))?TRUE:FALSE;
-                        printf ("detail %s\n", (eo.detail)?"ON":"OFF");
+                        eo.detail_level = (atoi(optarg));
+                        printf ("Detail Level: %d\n", eo.detail_level);
                     }
                     break;
                 }
index e65be54..af595f8 100644 (file)
@@ -118,8 +118,9 @@ xDbgEvlogRuleSet (const int argc, const char **argv, char *reply, int *len)
         POLICY_TYPE policy_type;
         RC_RESULT_TYPE result;
         const char * policy = argv[1];
-        char rule[8192];
-        int i;
+        char merge[8192], rule[8192]={0,};
+        int i, index = 0;
+        int apply = 0;
 
         if (argc < 3)
         {
@@ -137,20 +138,32 @@ xDbgEvlogRuleSet (const int argc, const char **argv, char *reply, int *len)
             return FALSE;
         }
 
-        _mergeArgs (rule, argc - 2, &(argv[2]));
+        _mergeArgs (merge, argc - 2, &(argv[2]));
 
-        for (i = 0 ; i < strlen(rule) ; i++)
+        for (i = 0 ; i < strlen(merge) ; i++)
         {
-            static int apply = 0;
-            if(rule[i] == '\"' || rule[i] == '\'')
-                rule[i] = ' ';
-            if(rule[i] == '+')
+            if(merge[i] == '\"' || merge[i] == '\'')
+            {
+                rule[index++] = ' ';
+                continue;
+            }
+
+            if(merge[i] == '+')
             {
-                rule[i] = ' ';
+                rule[index++] = ' ';
+
                 if (apply == 0)
-                   strcat(rule, "|| type=reply || type=error");
-                apply = 1;
+                {
+                    const char* plus = "|| type=reply || type=error";
+
+                    strcat(rule, plus);
+                    index += strlen(plus);
+
+                    apply = 1;
+                }
+                continue;
             }
+            rule[index++] = merge[i];
         }
 
         result = rulechecker_add_rule (rc, policy_type, rule);
@@ -335,20 +348,20 @@ xDbgEvlogGetExtensionEntry ()
 }
 
 
-void
-xDbgEvlogFillLog (EvlogInfo *evinfo, Bool on, char *reply, int *len)
+Bool
+xDbgEvlogFillLog (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
     static CARD32 prev;
 
-    RETURN_IF_FAIL (evinfo->type >= 0 && (sizeof (evt_dir) / sizeof (char*)));
-    RETURN_IF_FAIL (evinfo->type >= 0 && (sizeof (evt_type) / sizeof (char*)));
+    RETURN_VAL_IF_FAIL (evinfo->type >= 0 && (sizeof (evt_dir) / sizeof (char*)), FALSE);
+    RETURN_VAL_IF_FAIL (evinfo->type >= 0 && (sizeof (evt_type) / sizeof (char*)), FALSE);
 
     if (evinfo->type == REPLY && !evinfo->rep.isStart)
     {
-        if (on) // detail option is on
+        if (detail_level >= EVLOG_PRINT_REPLY_DETAIL)
             REPLY ("%67s"," ");
         else
-            return;
+            return FALSE;
     }
     else
         REPLY ("[%10.3f][%5ld] %22s(%2d:%5d) %s %7s ",
@@ -363,20 +376,20 @@ xDbgEvlogFillLog (EvlogInfo *evinfo, Bool on, char *reply, int *len)
     if (evinfo->type == REQUEST)
     {
         REPLY ("(");
-        reply = xDbgEvlogReqeust (evinfo, on, reply, len);
+        reply = xDbgEvlogReqeust (evinfo, detail_level, reply, len);
         REPLY (")");
     }
     else if (evinfo->type == EVENT)
     {
         evinfo->evt.size = sizeof (xEvent);
         REPLY ("(");
-        reply = xDbgEvlogEvent (evinfo, on, reply, len);
+        reply = xDbgEvlogEvent (evinfo, detail_level, reply, len);
         REPLY (")");
     }
     else if (evinfo->type == REPLY)
     {
         REPLY ("(");
-        reply = xDbgEvlogReply (evinfo, on, reply, len);
+        reply = xDbgEvlogReply (evinfo, detail_level, reply, len);
         REPLY (")");
     }
     else if (evinfo->type == ERROR)
@@ -402,6 +415,8 @@ xDbgEvlogFillLog (EvlogInfo *evinfo, Bool on, char *reply, int *len)
     REPLY ("\n");
 
     prev = evinfo->time;
+
+    return TRUE;
 }
 
 
index 83cd8ad..1d0d714 100644 (file)
@@ -53,7 +53,7 @@ char*  xDbgEvlogGetCmd         (char *path);
 Bool   xDbgEvlogRuleSet        (const int argc, const char **argv, char *reply, int *len);
 Bool   xDbgEvlogRuleValidate   (EvlogInfo *evinfo);
 Bool   xDbgEvlogGetExtensionEntry ();
-void   xDbgEvlogFillLog        (EvlogInfo *evinfo, Bool on, char *reply, int *len);
+Bool   xDbgEvlogFillLog        (EvlogInfo *evinfo, int detail_level, char *reply, int *len);
 
 void   xDbgDistroyAtomList  (EvlogInfo *evinfo);
 void   xDbgDistroyRegionList (EvlogInfo *evinfo);
index dda4a9f..0f887d3 100644 (file)
@@ -59,7 +59,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "xdbg_evlog.h"
 
 static char *
-_EvlogRequestComposite(EvlogInfo *evinfo, char *reply, int *len)
+_EvlogRequestComposite(EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
     xReq *req = evinfo->req.ptr;
 
@@ -68,9 +68,14 @@ _EvlogRequestComposite(EvlogInfo *evinfo, char *reply, int *len)
     case X_CompositeRedirectWindow:
         {
             xCompositeRedirectWindowReq *stuff = (xCompositeRedirectWindowReq *)req;
-            REPLY (": XID(0x%lx) Update(%d)",
-                stuff->window,
-                stuff->update);
+            REPLY (": XID(0x%lx)",
+                stuff->window);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" update(%d)",
+                    stuff->update);
+            }
 
             return reply;
         }
@@ -78,9 +83,14 @@ _EvlogRequestComposite(EvlogInfo *evinfo, char *reply, int *len)
     case X_CompositeRedirectSubwindows:
         {
             xCompositeRedirectSubwindowsReq *stuff = (xCompositeRedirectSubwindowsReq *)req;
-            REPLY (": XID(0x%lx) Update(%d)",
-                stuff->window,
-                stuff->update);
+            REPLY (": XID(0x%lx)",
+                stuff->window);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" update(%d)",
+                    stuff->update);
+            }
 
             return reply;
         }
@@ -88,9 +98,14 @@ _EvlogRequestComposite(EvlogInfo *evinfo, char *reply, int *len)
     case X_CompositeUnredirectWindow:
         {
             xCompositeUnredirectWindowReq *stuff = (xCompositeUnredirectWindowReq *)req;
-            REPLY (": XID(0x%lx) Update(%d)",
-                stuff->window,
-                stuff->update);
+            REPLY (": XID(0x%lx)",
+                stuff->window);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" update(%d)",
+                    stuff->update);
+            }
 
             return reply;
         }
@@ -98,9 +113,14 @@ _EvlogRequestComposite(EvlogInfo *evinfo, char *reply, int *len)
     case X_CompositeUnredirectSubwindows:
         {
             xCompositeUnredirectSubwindowsReq *stuff = (xCompositeUnredirectSubwindowsReq *)req;
-            REPLY (": XID(0x%lx) Update(%d)",
-                stuff->window,
-                stuff->update);
+            REPLY (": XID(0x%lx)",
+                stuff->window);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" update(%d)",
+                    stuff->update);
+            }
 
             return reply;
         }
@@ -123,7 +143,7 @@ _EvlogRequestComposite(EvlogInfo *evinfo, char *reply, int *len)
 }
 
 static char *
-_EvlogEventComposite (EvlogInfo *evinfo, int first_base, char *reply, int *len)
+_EvlogEventComposite (EvlogInfo *evinfo, int first_base, int detail_level, char *reply, int *len)
 {
     xEvent *evt = evinfo->evt.ptr;
 
@@ -138,7 +158,7 @@ _EvlogEventComposite (EvlogInfo *evinfo, int first_base, char *reply, int *len)
 }
 
 static char *
-_EvlogReplyComposite (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogReplyComposite (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
 #if 0
     xGenericReply *rep = evinfo->rep.ptr;
index 685438a..a388ebd 100644 (file)
@@ -51,13 +51,173 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include <X11/Xatom.h>
 #include <X11/Xlib.h>
 #include <windowstr.h>
+#include <X11/Xproto.h>
 #include <X11/extensions/XI2proto.h>
 
 #include "xdbg_types.h"
 #include "xdbg_evlog_core.h"
 #include "xdbg_evlog.h"
 
-char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len)
+
+static char*
+_getWindowAttributeMask (CARD32 mask, char *reply, int *len)
+{
+    int i;
+    int init = 0;
+
+    for (i = 0 ; i < sizeof(mask) * 4 ; i++)
+    {
+        if(mask & (1 << i))
+        {
+            if (init)
+                REPLY(" ");
+            else
+                init = 1;
+
+            switch (1 << i)
+            {
+                case CWBackPixmap: REPLY("CWBackPixmap"); break;
+                case CWBackPixel: REPLY("CWBackPixel"); break;
+                case CWBorderPixmap: REPLY("CWBorderPixmap"); break;
+                case CWBorderPixel: REPLY("CWBorderPixel"); break;
+                case CWBitGravity: REPLY("CWBitGravity"); break;
+                case CWWinGravity: REPLY("CWWinGravity"); break;
+                case CWBackingStore: REPLY("CWBackingStore"); break;
+                case CWBackingPlanes: REPLY("CWBackingPlanes"); break;
+                case CWBackingPixel: REPLY("CWBackingPixel"); break;
+                case CWOverrideRedirect: REPLY("CWOverrideRedirect"); break;
+                case CWSaveUnder: REPLY("CWSaveUnder"); break;
+                case CWEventMask: REPLY("CWEventMask"); break;
+                case CWDontPropagate: REPLY("CWDontPropagate"); break;
+                case CWColormap: REPLY("CWColormap"); break;
+                case CWCursor: REPLY("CWCursor"); break;
+            }
+        }
+    }
+
+    return reply;
+}
+
+static char*
+_getConfigureWindowMask (CARD16 mask, char *reply, int *len)
+{
+    int i;
+    int init = 0;
+
+    for (i = 0 ; i < sizeof(mask) * 4 ; i++)
+    {
+        if(mask & (1 << i))
+        {
+            if (init)
+                REPLY(" ");
+            else
+                init = 1;
+
+            switch (1 << i)
+            {
+                case CWX: REPLY("CWX"); break;
+                case CWY: REPLY("CWY"); break;
+                case CWWidth: REPLY("CWWidth"); break;
+                case CWHeight: REPLY("CWHeight"); break;
+                case CWBorderWidth: REPLY("CWBorderWidth"); break;
+                case CWSibling: REPLY("CWSibling"); break;
+                case CWStackMode: REPLY("CWStackMode"); break;
+            }
+        }
+    }
+
+    return reply;
+}
+
+static char*
+_getKeyMask (CARD16 mask, char *reply, int *len)
+{
+    int i;
+    int init = 0;
+
+    for (i = 0 ; i < sizeof(mask) * 4 ; i++)
+    {
+        if(mask & (1 << i))
+        {
+            if (init)
+                REPLY(" ");
+            else
+                init = 1;
+
+            switch (1 << i)
+            {
+                case ShiftMask: REPLY("ShiftMask"); break;
+                case LockMask: REPLY("LockMask"); break;
+                case ControlMask: REPLY("ControlMask"); break;
+                case Mod1Mask: REPLY("Mod1Mask"); break;
+                case Mod2Mask: REPLY("Mod2Mask"); break;
+                case Mod3Mask: REPLY("Mod3Mask"); break;
+                case Mod4Mask: REPLY("Mod4Mask"); break;
+                case Mod5Mask: REPLY("Mod5Mask"); break;
+                case Button1Mask: REPLY("Button1Mask"); break;
+                case Button2Mask: REPLY("Button2Mask"); break;
+                case Button3Mask: REPLY("Button3Mask"); break;
+                case Button4Mask: REPLY("Button4Mask"); break;
+                case Button5Mask: REPLY("Button5Mask"); break;
+                case AnyModifier: REPLY("AnyModifier"); break;
+            }
+        }
+    }
+
+    return reply;
+}
+
+static char*
+_getEventMask (CARD32 mask, char *reply, int *len)
+{
+    int i;
+    int init = 0;
+
+    for (i = 0 ; i < sizeof(mask) * 4 ; i++)
+    {
+        if(mask & (1 << i))
+        {
+            if (init)
+                REPLY(" ");
+            else
+                init = 1;
+
+            switch (1 << i)
+            {
+                case NoEventMask: REPLY("NoEventMask"); break;
+                case KeyPressMask: REPLY("KeyPressMask"); break;
+                case KeyReleaseMask: REPLY("KeyReleaseMask"); break;
+                case ButtonPressMask: REPLY("ButtonPressMask"); break;
+                case ButtonReleaseMask: REPLY("ButtonReleaseMask"); break;
+                case EnterWindowMask: REPLY("EnterWindowMask"); break;
+                case LeaveWindowMask: REPLY("LeaveWindowMask"); break;
+                case PointerMotionMask: REPLY("PointerMotionMask"); break;
+                case PointerMotionHintMask: REPLY("PointerMotionHintMask"); break;
+                case Button1MotionMask: REPLY("Button1MotionMask"); break;
+                case Button2MotionMask: REPLY("Button2MotionMask"); break;
+                case Button3MotionMask: REPLY("Button3MotionMask"); break;
+                case Button4MotionMask: REPLY("Button4MotionMask"); break;
+                case Button5MotionMask: REPLY("Button5MotionMask"); break;
+                case ButtonMotionMask: REPLY("ButtonMotionMask"); break;
+                case KeymapStateMask: REPLY("KeymapStateMask"); break;
+                case ExposureMask: REPLY("ExposureMask"); break;
+                case VisibilityChangeMask: REPLY("VisibilityChangeMask"); break;
+                case StructureNotifyMask: REPLY("StructureNotifyMask"); break;
+                case ResizeRedirectMask: REPLY("ResizeRedirectMask"); break;
+                case SubstructureNotifyMask: REPLY("SubstructureNotifyMask"); break;
+                case SubstructureRedirectMask: REPLY("SubstructureRedirectMask"); break;
+                case FocusChangeMask: REPLY("FocusChangeMask"); break;
+                case PropertyChangeMask: REPLY("PropertyChangeMask"); break;
+                case ColormapChangeMask: REPLY("ColormapChangeMask"); break;
+                case OwnerGrabButtonMask: REPLY("OwnerGrabButtonMask"); break;
+            }
+        }
+    }
+
+    return reply;
+}
+
+char * xDbgEvlogRequestCore (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
     xReq *req = evinfo->req.ptr;
 
@@ -76,6 +236,38 @@ char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len)
                 stuff->x,
                 stuff->y);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *visual, *class;
+                char dvisual[10], dclass[10];
+
+                switch (stuff->visual)
+                {
+                    case CopyFromParent:  visual = "CopyFromParent"; break;
+                    default:  visual = dvisual; sprintf (dvisual, "0x%lx", stuff->visual); break;
+                }
+
+                switch (stuff->class)
+                {
+                    case CopyFromParent:  class = "CopyFromParent"; break;
+                    case InputOutput:  class = "InputOutput"; break;
+                    case InputOnly:  class = "InputOnly"; break;
+                    default:  class = dclass; sprintf (dclass, "0x%x", stuff->class); break;
+                }
+
+                REPLY ("\n");
+                REPLY ("%67s depth(%d) visual_ID(%s) class(%s)\n",
+                    " ",
+                    stuff->depth,
+                    visual,
+                    class);
+
+    \r           REPLY ("%67s mask", " ");
+    \r           REPLY ("(");
+                reply = _getWindowAttributeMask(stuff->mask, reply, len);
+    \r           REPLY (")");
+            }
+
             return reply;
         }
 
@@ -85,15 +277,40 @@ char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len)
             REPLY (": XID(0x%lx)",
                 stuff->window);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+    \r           REPLY (" value_mask");
+    \r           REPLY ("(");
+                reply = _getWindowAttributeMask(stuff->valueMask, reply, len);
+    \r           REPLY (")");
+            }
+
             return reply;
         }
 
     case X_ChangeSaveSet:
         {
             xChangeSaveSetReq *stuff = (xChangeSaveSetReq *)req;
+
             REPLY (": XID(0x%lx)",
                 stuff->window);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *mode;
+                char dmode[10];
+
+                switch (stuff->mode)
+                {
+                    case SetModeInsert:  mode = "SetModeInsert"; break;
+                    case SetModeDelete:  mode = "SetModeDelete"; break;
+                    default:  mode = dmode; sprintf (dmode, "%d", stuff->mode); break;
+                }
+
+                REPLY (" mode(%s)",
+                    mode);
+            }
+
             return reply;
         }
 
@@ -115,21 +332,47 @@ char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len)
             REPLY (": XID(0x%lx)",
                 stuff->window);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" mask");
+                REPLY ("(");
+                reply = _getConfigureWindowMask(stuff->mask, reply, len);
+                REPLY (")");
+            }
+
             return reply;
         }
 
     case X_CirculateWindow:
         {
             xCirculateWindowReq *stuff = (xCirculateWindowReq *)req;
+
             REPLY (": XID(0x%lx)",
                 stuff->window);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *direction;
+                char ddirection[10];
+
+                switch (stuff->direction)
+                {
+                    case RaiseLowest:  direction = "RaiseLowest"; break;
+                    case LowerHighest:  direction = "LowerHighest"; break;
+                    default:  direction = ddirection; sprintf (ddirection, "%d", stuff->direction); break;
+                }
+
+                REPLY (" direction(%s)",
+                    direction);
+            }
+
             return reply;
         }
 
     case X_ChangeProperty:
         {
             xChangePropertyReq *stuff = (xChangePropertyReq *)req;
+
             REPLY (": XID(0x%lx)",
                 stuff->window);
 
@@ -139,6 +382,27 @@ char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len)
             REPLY (" Type");
             reply = xDbgGetAtom(stuff->type, evinfo, reply, len);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *mode;
+                char dmode[10];
+
+                switch (stuff->mode)
+                {
+                    case PropModeReplace:  mode = "PropModeReplace"; break;
+                    case PropModePrepend:  mode = "PropModePrepend"; break;
+                    case PropModeAppend:  mode = "PropModeAppend"; break;
+                    default:  mode = dmode; sprintf (dmode, "%d", stuff->mode); break;
+                }
+
+                REPLY ("\n");
+                REPLY ("%67s mode(%s) format(%d) nUnits(%ld)",
+                    " ",
+                    mode,
+                    stuff->format,
+                    stuff->nUnits);
+            }
+
             return reply;
         }
 
@@ -166,6 +430,16 @@ char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len)
             REPLY (" Type");
             reply = xDbgGetAtom(stuff->type, evinfo, reply, len);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY ("\n");
+                REPLY ("%67s delete(%s) longOffset(%ld) longLength(%ld)",
+                    " ",
+                    stuff->delete ? "YES" : "NO",
+                    stuff->longOffset,
+                    stuff->longLength);
+            }
+
             return reply;
         }
 
@@ -178,6 +452,12 @@ char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len)
             REPLY (" Selection");
             reply = xDbgGetAtom(stuff->selection, evinfo, reply, len);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" time(%lums)",
+                    stuff->time);
+            }
+
             return reply;
         }
 
@@ -194,6 +474,12 @@ char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len)
             REPLY (" Property");
             reply = xDbgGetAtom(stuff->property, evinfo, reply, len);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" time(%lums)",
+                    stuff->time);
+            }
+
             return reply;
         }
 
@@ -203,28 +489,114 @@ char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len)
             REPLY (": XID(0x%lx)",
                 stuff->destination);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" propagate(%s)",
+                    stuff->propagate ? "YES" : "NO");
+
+                REPLY (" event_mask");
+                REPLY ("(");
+                reply = _getEventMask(stuff->eventMask, reply, len);
+                REPLY (")");
+            }
+
             return reply;
         }
 
     case X_GrabPointer:
         {
             xGrabPointerReq *stuff = (xGrabPointerReq *)req;
+
             REPLY (": XID(0x%lx) ConfineTo(0x%lx) Cursor(0x%lx)",
                 stuff->grabWindow,
                 stuff->confineTo,
                 stuff->cursor);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *pointer_mode, *keyboard_mode;
+                char dpointer_mode[10], dkeyboard_mode[10];
+
+                switch (stuff->pointerMode)
+                {
+                    case GrabModeSync:  pointer_mode = "GrabModeSync"; break;
+                    case GrabModeAsync:  pointer_mode = "GrabModeAsync"; break;
+                    default:  pointer_mode = dpointer_mode; sprintf (dpointer_mode, "%d", stuff->pointerMode); break;
+                }
+
+                switch (stuff->keyboardMode)
+                {
+                    case GrabModeSync:  keyboard_mode = "GrabModeSync"; break;
+                    case GrabModeAsync:  keyboard_mode = "GrabModeAsync"; break;
+                    default:  keyboard_mode = dkeyboard_mode; sprintf (dkeyboard_mode, "%d", stuff->keyboardMode); break;
+                }
+
+                REPLY (" pointer_mode(%s) keyboard_mode(%s) time(%lums)\n",
+                    pointer_mode,
+                    keyboard_mode,
+                    stuff->time);
+
+                REPLY (" event_mask");
+                REPLY ("(");
+                reply = _getEventMask(stuff->eventMask, reply, len);
+                REPLY (")");
+            }
+
             return reply;
         }
 
     case X_GrabButton:
         {
             xGrabButtonReq *stuff = (xGrabButtonReq *)req;
+
             REPLY (": XID(0x%lx) ConfineTo(0x%lx) Cursor(0x%lx)",
                 stuff->grabWindow,
                 stuff->confineTo,
                 stuff->cursor);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *pointer_mode, *keyboard_mode, *button;
+                char dpointer_mode[10], dkeyboard_mode[10], dbutton[10];
+
+                switch (stuff->pointerMode)
+                {
+                    case GrabModeSync:  pointer_mode = "GrabModeSync"; break;
+                    case GrabModeAsync:  pointer_mode = "GrabModeAsync"; break;
+                    default:  pointer_mode = dpointer_mode; sprintf (dpointer_mode, "%d", stuff->pointerMode); break;
+                }
+
+                switch (stuff->keyboardMode)
+                {
+                    case GrabModeSync:  keyboard_mode = "GrabModeSync"; break;
+                    case GrabModeAsync:  keyboard_mode = "GrabModeAsync"; break;
+                    default:  keyboard_mode = dkeyboard_mode; sprintf (dkeyboard_mode, "%d", stuff->keyboardMode); break;
+                }
+
+                switch (stuff->button)
+                {
+                    case Button1:  button = "Button1"; break;
+                    case Button2:  button = "Button2"; break;
+                    case Button3:  button = "Button3"; break;
+                    case Button4:  button = "Button4"; break;
+                    case Button5:  button = "Button5"; break;
+                    default:  button = dbutton; sprintf (dbutton, "%d", stuff->button); break;
+                }
+
+                REPLY ("\n");
+                REPLY ("%67s event_mask(0x%x) pointer_mode(%s) keyboard_mode(%s) button(%s)",
+                    " ",
+                    stuff->eventMask,
+                    pointer_mode,
+                    keyboard_mode,
+                    button);
+
+                REPLY (" modifiers");
+                REPLY ("(");
+                reply = _getKeyMask(stuff->modifiers, reply, len);
+                REPLY (")");
+            }
+
             return reply;
         }
 
@@ -234,6 +606,14 @@ char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len)
             REPLY (": XID(0x%lx)",
                 stuff->grabWindow);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" modifiers");
+                REPLY ("(");
+                reply = _getKeyMask(stuff->modifiers, reply, len);
+                REPLY (")");
+            }
+
             return reply;
         }
 
@@ -243,24 +623,92 @@ char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len)
             REPLY (": Cursor(0x%lx)",
                 stuff->cursor);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" time(%lums)",
+                    stuff->time);
+
+                REPLY (" event_mask");
+                REPLY ("(");
+                reply = _getEventMask(stuff->eventMask, reply, len);
+                REPLY (")");
+            }
+
             return reply;
         }
 
     case X_GrabKeyboard:
         {
             xGrabKeyboardReq *stuff = (xGrabKeyboardReq *)req;
+
             REPLY (": XID(0x%lx)",
                 stuff->grabWindow);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *pointer_mode, *keyboard_mode;
+                char dpointer_mode[10], dkeyboard_mode[10];
+
+                switch (stuff->pointerMode)
+                {
+                    case GrabModeSync:  pointer_mode = "GrabModeSync"; break;
+                    case GrabModeAsync:  pointer_mode = "GrabModeAsync"; break;
+                    default:  pointer_mode = dpointer_mode; sprintf (dpointer_mode, "%d", stuff->pointerMode); break;
+                }
+
+                switch (stuff->keyboardMode)
+                {
+                    case GrabModeSync:  keyboard_mode = "GrabModeSync"; break;
+                    case GrabModeAsync:  keyboard_mode = "GrabModeAsync"; break;
+                    default:  keyboard_mode = dkeyboard_mode; sprintf (dkeyboard_mode, "%d", stuff->keyboardMode); break;
+                }
+
+                REPLY (" owner_events(%s) pointer_mode(%s) keyboard_mode(%s)",
+                    stuff->ownerEvents ? "YES" : "NO",
+                    pointer_mode,
+                    keyboard_mode);
+            }
+
             return reply;
         }
 
     case X_GrabKey:
         {
             xGrabKeyReq *stuff = (xGrabKeyReq *)req;
+
             REPLY (": XID(0x%lx)",
                 stuff->grabWindow);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *pointer_mode, *keyboard_mode;
+                char dpointer_mode[10], dkeyboard_mode[10];
+
+                switch (stuff->pointerMode)
+                {
+                    case GrabModeSync:  pointer_mode = "GrabModeSync"; break;
+                    case GrabModeAsync:  pointer_mode = "GrabModeAsync"; break;
+                    default:  pointer_mode = dpointer_mode; sprintf (dpointer_mode, "%d", stuff->pointerMode); break;
+                }
+
+                switch (stuff->keyboardMode)
+                {
+                    case GrabModeSync:  keyboard_mode = "GrabModeSync"; break;
+                    case GrabModeAsync:  keyboard_mode = "GrabModeAsync"; break;
+                    default:  keyboard_mode = dkeyboard_mode; sprintf (dkeyboard_mode, "%d", stuff->keyboardMode); break;
+                }
+
+                REPLY (" key(%d) pointer_mode(%s) keyboard_mode(%s)\n",
+                    stuff->key,
+                    pointer_mode,
+                    keyboard_mode);
+
+                REPLY (" modifiers");
+                REPLY ("(");
+                reply = _getKeyMask(stuff->modifiers, reply, len);
+                REPLY (")");
+            }
+
             return reply;
         }
 
@@ -270,6 +718,17 @@ char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len)
             REPLY (": XID(0x%lx)",
                 stuff->grabWindow);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" key(%d)",
+                    stuff->key);
+
+                REPLY (" modifiers");
+                REPLY ("(");
+                reply = _getKeyMask(stuff->modifiers, reply, len);
+                REPLY (")");
+            }
+
             return reply;
         }
 
@@ -279,6 +738,13 @@ char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len)
             REPLY (": XID(0x%lx)",
                 stuff->focus);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" reverTo(%d) time(%lums)",
+                    stuff->revertTo,
+                    stuff->time);
+            }
+
             return reply;
         }
 
@@ -291,6 +757,12 @@ char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len)
                 stuff->width,
                 stuff->height);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" depth(%d)",
+                    stuff->depth);
+            }
+
             return reply;
         }
 
@@ -304,6 +776,12 @@ char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len)
                 stuff->width,
                 stuff->height);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" exposures(%s)",
+                    stuff->exposures ? "YES" : "NO");
+            }
+
         \r   return reply;
         }
 
@@ -338,6 +816,12 @@ char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len)
                 stuff->dstX,
                 stuff->dstY);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" bit_plane(0x%lx)",
+                    stuff->bitPlane);
+            }
+
             return reply;
         }
 
@@ -348,6 +832,22 @@ char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len)
                 stuff->drawable,
                 stuff->gc);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *coord_mode;
+                char dcoord_mode[10];
+
+                switch (stuff->coordMode)
+                {
+                    case CoordModeOrigin:  coord_mode = "CoordModeOrigin"; break;
+                    case CoordModePrevious:  coord_mode = "CoordModePrevious"; break;
+                    default:  coord_mode = dcoord_mode; sprintf (dcoord_mode, "%d", stuff->coordMode); break;
+                }
+
+                REPLY (" coord_mode(%s)",
+                    coord_mode);
+            }
+
             return reply;
         }
 
@@ -358,6 +858,22 @@ char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len)
                 stuff->drawable,
                 stuff->gc);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *coord_mode;
+                char dcoord_mode[10];
+
+                switch (stuff->coordMode)
+                {
+                    case CoordModeOrigin:  coord_mode = "CoordModeOrigin"; break;
+                    case CoordModePrevious:  coord_mode = "CoordModePrevious"; break;
+                    default:  coord_mode = dcoord_mode; sprintf (dcoord_mode, "%d", stuff->coordMode); break;
+                }
+
+                REPLY (" coord_mode(%s)",
+                    coord_mode);
+            }
+
             return reply;
         }
 
@@ -398,6 +914,31 @@ char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len)
                 stuff->drawable,
                 stuff->gc);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *shape, *coord_mode;
+                char dshape[10], dcoord_mode[10];
+
+                switch (stuff->shape)
+                {
+                    case Complex:  shape = "Complex"; break;
+                    case Nonconvex:  shape = "Nonconvex"; break;
+                    case Convex:  shape = "Convex"; break;
+                    default:  shape = dshape; sprintf (dshape, "%d", stuff->shape); break;
+                }
+
+                switch (stuff->coordMode)
+                {
+                    case CoordModeOrigin:  coord_mode = "CoordModeOrigin"; break;
+                    case CoordModePrevious:  coord_mode = "CoordModePrevious"; break;
+                    default:  coord_mode = dcoord_mode; sprintf (dcoord_mode, "%d", stuff->coordMode); break;
+                }
+
+                REPLY (" shape(%s) coord_mode(%s)",
+                    shape,
+                    coord_mode);
+            }
+
             return reply;
         }
 
@@ -431,6 +972,25 @@ char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len)
                 stuff->height,
                 stuff->dstX,
                 stuff->dstY);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *format;
+                char dformat[10];
+
+                switch (stuff->format)
+                {
+                    case XYBitmap:  format = "XYBitmap"; break;
+                    case XYPixmap:  format = "XYPixmap"; break;
+                    case ZPixmap:  format = "ZPixmap"; break;
+                    default:  format = dformat; sprintf (dformat, "%d", stuff->format); break;
+                }
+
+                REPLY (" format(%s) depth(%d)",
+                    format,
+                    stuff->depth);
+            }
+
             return reply;
         }
 
@@ -444,6 +1004,24 @@ char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len)
                 stuff->x,
                 stuff->y);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *format;
+                char dformat[10];
+
+                switch (stuff->format)
+                {
+                    case XYBitmap:  format = "XYBitmap"; break;
+                    case XYPixmap:  format = "XYPixmap"; break;
+                    case ZPixmap:  format = "ZPixmap"; break;
+                    default:  format = dformat; sprintf (dformat, "%d", stuff->format); break;
+                }
+
+                REPLY (" format(%s) plane_mask(0x%lx)",
+                    format,
+                    stuff->planeMask);
+            }
+
             return reply;
         }
 
@@ -480,6 +1058,12 @@ char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len)
                 stuff->x,
                 stuff->y);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" nchars(%d)",
+                    stuff->nChars);
+            }
+
             return reply;
         }
 
@@ -492,26 +1076,42 @@ char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len)
                 stuff->x,
                 stuff->y);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" nchars(%d)",
+                    stuff->nChars);
+            }
+
             return reply;
         }
 
     case X_ChangeKeyboardMapping:
         {
             xChangeKeyboardMappingReq *stuff = (xChangeKeyboardMappingReq *)req;
-            REPLY (": Key(%d) FstKey(%d) KeySyms(%d)",
+            REPLY (": first_key_code(%d) key_syms_per_key_code(%d)",
                 stuff->firstKeyCode,
-                stuff->keyCodes,
                 stuff->keySymsPerKeyCode);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" key_codes(%d)",
+                    stuff->keyCodes);
+            }
+
             return reply;
         }
 
     case X_GetKeyboardMapping:
         {
             xGetKeyboardMappingReq *stuff = (xGetKeyboardMappingReq *)req;
-            REPLY (": FstKey(%d) Count(%d)",
-                stuff->firstKeyCode,
-                stuff->count);
+            REPLY (": first_key_code(%d)",
+                stuff->firstKeyCode);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" count(%d)",
+                    stuff->count);
+            }
 
             return reply;
         }
@@ -524,14 +1124,25 @@ char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len)
                 stuff->accelDenum,
                 stuff->threshold);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" do_accel(%s) do_thresh(%s)",
+                    stuff->doAccel ? "YES" : "NO",
+                    stuff->doThresh ? "YES" : "NO");
+            }
+
             return reply;
         }
 
     case X_SetPointerMapping:
         {
             xSetPointerMappingReq *stuff = (xSetPointerMappingReq *)req;
-            REPLY (": Elts(%d)",
-                stuff->nElts);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (": Elts(%d)",
+                    stuff->nElts);
+            }
 
             return reply;
         }
@@ -539,7 +1150,7 @@ char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len)
     case X_SetModifierMapping:
         {
             xSetModifierMappingReq *stuff =(xSetModifierMappingReq *)req;
-            REPLY (": NumkeyPerModifier(%d)",
+            REPLY (": num_key_per_modifier(%d)",
                 stuff->numKeyPerModifier);
 
             return reply;
@@ -573,7 +1184,7 @@ char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len)
     return reply;
 }
 
-char * xDbgEvlogEventCore (EvlogInfo *evinfo, char *reply, int *len)
+char * xDbgEvlogEventCore (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
     xEvent *evt = evinfo->evt.ptr;
 
@@ -594,8 +1205,17 @@ char * xDbgEvlogEventCore (EvlogInfo *evinfo, char *reply, int *len)
                 evt->u.keyButtonPointer.eventY,
                 evt->u.keyButtonPointer.child);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY ("\n");
+                REPLY ("%67s state(0x%x) same_screen(%s)",
+                    " ",
+                    evt->u.keyButtonPointer.state,
+                    evt->u.keyButtonPointer.sameScreen ? "YES" : "NO");
+            }
+
             return reply;
-               }
+        }
 
     case EnterNotify:
     case LeaveNotify:
@@ -609,8 +1229,19 @@ char * xDbgEvlogEventCore (EvlogInfo *evinfo, char *reply, int *len)
                 evt->u.enterLeave.eventY,
                 evt->u.enterLeave.child);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY ("\n");
+                REPLY ("%67s time(%lums) state(0x%x) same_screen(%s) focus(%s)",
+                    " ",
+                    evt->u.enterLeave.time,
+                    evt->u.enterLeave.state,
+                    evt->u.enterLeave.flags & ELFlagSameScreen ? "YES" : "NO",
+                    evt->u.enterLeave.flags & ELFlagFocus ? "YES" : "NO");
+            }
+
             return reply;
-               }
+        }
 
     case FocusIn:
     case FocusOut:
@@ -619,8 +1250,26 @@ char * xDbgEvlogEventCore (EvlogInfo *evinfo, char *reply, int *len)
             REPLY (": XID(0x%lx)",
                 evt->u.focus.window);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char* mode;
+                char dmode[10];
+
+                switch (evt->u.focus.mode)
+                {
+                    case NotifyNormal:  mode = "NotifyNormal"; break;
+                    case NotifyGrab:  mode = "NotifyGrab"; break;
+                    case NotifyUngrab:  mode = "NotifyUngrab"; break;
+                    case NotifyWhileGrabbed:  mode = "NotifyWhileGrabbed"; break;
+                    default:  mode = dmode, sprintf (dmode, "%u", evt->u.focus.mode); break;
+                }
+
+                REPLY (" mode(%s)",
+                    mode);
+            }
+
             return reply;
-               }
+        }
 
     case Expose:
         {
@@ -631,8 +1280,14 @@ char * xDbgEvlogEventCore (EvlogInfo *evinfo, char *reply, int *len)
                 evt->u.expose.x,
                 evt->u.expose.y);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" count(%d)",
+                    evt->u.expose.count);
+            }
+
             return reply;
-               }
+        }
 
     case GraphicsExpose:
         {
@@ -643,25 +1298,76 @@ char * xDbgEvlogEventCore (EvlogInfo *evinfo, char *reply, int *len)
                 evt->u.graphicsExposure.x,
                 evt->u.graphicsExposure.y);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *major;
+                char dmajor[10];
+
+                switch (evt->u.graphicsExposure.majorEvent)
+                {
+                    case X_CopyArea:  major = "CopyArea";  break;
+                    case X_CopyPlane:  major = "CopyPlane";  break;
+                    default: major = dmajor; sprintf(dmajor, "%d", evt->u.graphicsExposure.majorEvent); break;
+                }
+
+                REPLY (" major_event(%s) minor_event(%d) count(%d)",
+                    major,
+                    evt->u.graphicsExposure.minorEvent,
+                    evt->u.graphicsExposure.count);
+            }
+
             return reply;
-               }
+        }
 
     case NoExpose:
         {
             REPLY (": XID(0x%lx)",
                 evt->u.noExposure.drawable);
 
-            return reply;
-               }
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *major;
+                char dmajor[10];
+
+                switch (evt->u.noExposure.majorEvent)
+                {
+                    case X_CopyArea:  major = "CopyArea";  break;
+                    case X_CopyPlane:  major = "CopyPlane";  break;
+                    default:  major = dmajor; sprintf (dmajor, "%d", evt->u.noExposure.majorEvent); break;
+                }
 
+                REPLY (" major_event(%s) minor_event(%d)",
+                    major,
+                    evt->u.noExposure.minorEvent);
+            }
+
+            return reply;
+        }
 
     case VisibilityNotify:
         {
             REPLY (": XID(0x%lx)",
                 evt->u.visibility.window);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *state;
+                char dstate[10];
+
+                switch (evt->u.visibility.state)
+                {
+                    case VisibilityUnobscured:  state = "VisibilityUnobscured"; break;
+                    case VisibilityPartiallyObscured:  state = "VisibilityPartiallyObscured"; break;
+                    case VisibilityFullyObscured:  state = "VisibilityFullyObscured"; break;
+                    default:  state = dstate; sprintf (dstate, "%d", evt->u.visibility.state); break;
+                }
+
+                REPLY (" state(%s)",
+                    state);
+            }
+
             return reply;
-               }
+        }
 
     case CreateNotify:
         {
@@ -674,8 +1380,14 @@ char * xDbgEvlogEventCore (EvlogInfo *evinfo, char *reply, int *len)
                 evt->u.createNotify.y,
                 evt->u.createNotify.borderWidth);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" override(%s)",
+                    evt->u.createNotify.override ? "YES" : "NO");
+            }
+
             return reply;
-               }
+        }
 
     case DestroyNotify:
         {
@@ -692,8 +1404,14 @@ char * xDbgEvlogEventCore (EvlogInfo *evinfo, char *reply, int *len)
                 evt->u.unmapNotify.window,
                 evt->u.unmapNotify.event);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" from_Configure(%s)",
+                    evt->u.unmapNotify.fromConfigure ? "YES" : "NO");
+            }
+
             return reply;
-               }
+        }
 
     case MapNotify:
         {
@@ -701,8 +1419,14 @@ char * xDbgEvlogEventCore (EvlogInfo *evinfo, char *reply, int *len)
                 evt->u.mapNotify.window,
                 evt->u.mapNotify.event);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" override(%s)",
+                    evt->u.mapNotify.override ? "YES" : "NO");
+            }
+
             return reply;
-               }
+        }
 
     case MapRequest:
         {
@@ -711,23 +1435,29 @@ char * xDbgEvlogEventCore (EvlogInfo *evinfo, char *reply, int *len)
                 evt->u.mapRequest.parent);
 
             return reply;
-               }
+        }
 
     case ReparentNotify:
         {
-            REPLY (": Window(0x%lx) Event(0x%lx) parent(0x%lx) coord(%d,%d)",
+            REPLY (": Window(0x%lx) Event(0x%lx) Parent(0x%lx) coord(%d,%d)",
                 evt->u.reparent.window,
                 evt->u.reparent.event,
                 evt->u.reparent.parent,
                 evt->u.reparent.x,
                 evt->u.reparent.y);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" override(%s)",
+                    evt->u.reparent.override ? "YES" : "NO");
+            }
+
             return reply;
-               }
+        }
 
     case ConfigureNotify:
         {
-            REPLY (": Window(0x%lx) Event(0x%lx) aboveSibling(0x%lx) size(%dx%d) coord(%d,%d) borderWidth(%d)",
+            REPLY (": Window(0x%lx) Event(0x%lx) AboveSibling(0x%lx) size(%dx%d) coord(%d,%d) borderWidth(%d)",
                 evt->u.configureNotify.window,
                 evt->u.configureNotify.event,
                 evt->u.configureNotify.aboveSibling,
@@ -737,8 +1467,14 @@ char * xDbgEvlogEventCore (EvlogInfo *evinfo, char *reply, int *len)
                 evt->u.configureNotify.y,
                 evt->u.configureNotify.borderWidth);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" override(%s)",
+                    evt->u.configureNotify.override ? "YES" : "NO");
+            }
+
             return reply;
-               }
+        }
 
     case ConfigureRequest:
         {
@@ -752,8 +1488,18 @@ char * xDbgEvlogEventCore (EvlogInfo *evinfo, char *reply, int *len)
                 evt->u.configureRequest.y,
                 evt->u.configureRequest.borderWidth);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY ("\n");
+                REPLY ("%67s value_mask",
+                    " ");
+                REPLY ("(");
+                reply = _getConfigureWindowMask(evt->u.configureRequest.valueMask, reply, len);
+                REPLY (")");
+            }
+
             return reply;
-               }
+        }
 
     case GravityNotify:
         {
@@ -764,7 +1510,7 @@ char * xDbgEvlogEventCore (EvlogInfo *evinfo, char *reply, int *len)
                 evt->u.gravity.y);
 
             return reply;
-               }
+        }
 
     case ResizeRequest:
         {
@@ -774,7 +1520,7 @@ char * xDbgEvlogEventCore (EvlogInfo *evinfo, char *reply, int *len)
                 evt->u.resizeRequest.height);
 
             return reply;
-               }
+        }
 
     case CirculateNotify:
     case CirculateRequest:
@@ -784,19 +1530,54 @@ char * xDbgEvlogEventCore (EvlogInfo *evinfo, char *reply, int *len)
                 evt->u.circulate.event,
                 evt->u.circulate.parent);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *place;
+                char dplace[10];
+
+                switch (evt->u.circulate.place)
+                {
+                    case PlaceOnTop:  place = "PlaceOnTop"; break;
+                    case PlaceOnBottom:  place = "PlaceOnBottom"; break;
+                    default:  place = dplace; sprintf (dplace, "%d", evt->u.circulate.place); break;
+                }
+
+                REPLY (" place(%s)",
+                    place);
+            }
+
             return reply;
-               }
+        }
 
     case PropertyNotify:
         {
             REPLY (": Window(0x%lx)",
                 evt->u.property.window);
 
-            REPLY (" Atom");
+            REPLY (" Property");
             reply = xDbgGetAtom(evt->u.property.atom, evinfo, reply, len);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *state;
+                char dstate[10];
+
+                switch (evt->u.property.state)
+                {
+                    case PropertyNewValue:  state = "PropertyNewValue"; break;
+                    case PropertyDelete:  state = "PropertyDelete"; break;
+                    default:  state = dstate; sprintf (dstate, "%d", evt->u.property.state); break;
+                }
+
+                REPLY ("\n");
+                REPLY ("%67s time(%lums) state(%s)",
+                    " ",
+                    evt->u.property.time,
+                    state);
+            }
+
             return reply;
-               }
+        }
 
     case SelectionClear:
         {
@@ -806,6 +1587,12 @@ char * xDbgEvlogEventCore (EvlogInfo *evinfo, char *reply, int *len)
             REPLY (" Atom");
             reply = xDbgGetAtom(evt->u.selectionClear.atom, evinfo, reply, len);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" time(%lums)",
+                    evt->u.selectionClear.time);
+            }
+
             return reply;
                }
 
@@ -822,8 +1609,14 @@ char * xDbgEvlogEventCore (EvlogInfo *evinfo, char *reply, int *len)
             REPLY (" Property");
             reply = xDbgGetAtom(evt->u.selectionRequest.property, evinfo, reply, len);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" time(%lums)",
+                    evt->u.selectionRequest.time);
+            }
+
             return reply;
-               }
+        }
 
     case SelectionNotify:
         {
@@ -837,8 +1630,14 @@ char * xDbgEvlogEventCore (EvlogInfo *evinfo, char *reply, int *len)
             REPLY (" Property");
             reply = xDbgGetAtom(evt->u.selectionNotify.property, evinfo, reply, len);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" time(%lums)",
+                    evt->u.selectionNotify.time);
+            }
+
             return reply;
-               }
+        }
 
     case ColormapNotify:
         {
@@ -846,8 +1645,25 @@ char * xDbgEvlogEventCore (EvlogInfo *evinfo, char *reply, int *len)
                 evt->u.colormap.window,
                 evt->u.colormap.colormap);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *state;
+                char dstate[10];
+
+                switch (evt->u.colormap.state)
+                {
+                    case ColormapInstalled:  state = "ColormapInstalled"; break;
+                    case ColormapUninstalled:  state = "ColormapUninstalled"; break;
+                    default:  state = dstate; sprintf (dstate, "%d", evt->u.colormap.state); break;
+                }
+
+                REPLY (" new(%s) state(%s)",
+                   evt->u.colormap.new ? "YES" : "NO",
+                    state);
+            }
+
             return reply;
-               }
+        }
 
     case ClientMessage:
         {
@@ -869,7 +1685,7 @@ char * xDbgEvlogEventCore (EvlogInfo *evinfo, char *reply, int *len)
     return reply;
 }
 
-char * xDbgEvlogReplyCore (EvlogInfo *evinfo, char *reply, int *len)
+char * xDbgEvlogReplyCore (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
     xGenericReply *rep = evinfo->rep.ptr;
 
@@ -936,8 +1752,9 @@ char * xDbgEvlogReplyCore (EvlogInfo *evinfo, char *reply, int *len)
                 REPLY (": PropertyType");
                 reply = xDbgGetAtom(stuff->propertyType, evinfo, reply, len);
 
-                REPLY (" bytesAfter(0x%lx) ItemNum(%ld)",
+                REPLY (" bytesAfter(0x%lx) format(%d) ItemNum(%ld)",
                     stuff->bytesAfter,
+                    stuff->format,
                     stuff->nItems);
             }
             else
@@ -945,7 +1762,6 @@ char * xDbgEvlogReplyCore (EvlogInfo *evinfo, char *reply, int *len)
                 return reply;
             }
 
-
             return reply;
         }
 
@@ -974,8 +1790,6 @@ char * xDbgEvlogReplyCore (EvlogInfo *evinfo, char *reply, int *len)
                 REPLY (")");
             }
 
-
-
             return reply;
         }
 
index c828235..3df2e58 100644 (file)
@@ -34,8 +34,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #include "xdbg_types.h"
 
-char * xDbgEvlogRequestCore (EvlogInfo *evinfo, char *reply, int *len);
-char * xDbgEvlogReplyCore      (EvlogInfo *evinfo, char *reply, int *len);
-char * xDbgEvlogEventCore     (EvlogInfo *evinfo, char *reply, int *len);
+char * xDbgEvlogRequestCore (EvlogInfo *evinfo, int detail_level, char *reply, int *len);
+char * xDbgEvlogReplyCore      (EvlogInfo *evinfo, int detail_level, char *reply, int *len);
+char * xDbgEvlogEventCore     (EvlogInfo *evinfo, int detail_level, char *reply, int *len);
 
 #endif
index 517fcf3..6d255ad 100644 (file)
@@ -60,7 +60,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "xdbg_evlog.h"
 
 static char *
-_EvlogRequestDamage(EvlogInfo *evinfo, char *reply, int *len)
+_EvlogRequestDamage(EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
     xReq *req = evinfo->req.ptr;
 
@@ -69,10 +69,27 @@ _EvlogRequestDamage(EvlogInfo *evinfo, char *reply, int *len)
     case X_DamageCreate:
         {
             xDamageCreateReq *stuff = (xDamageCreateReq *)req;
-            REPLY (": XID(0x%lx) Drawable(0x%lx) level(%d)",
+            REPLY (": XID(0x%lx) Drawable(0x%lx)",
                 stuff->damage,
-                stuff->drawable,
-                stuff->level);
+                stuff->drawable);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *level;
+                char dlevel[10];
+
+                switch (stuff->level)
+                {
+                    case XDamageReportRawRectangles:  level = "DamageReportRawRegion"; break;
+                    case XDamageReportDeltaRectangles:  level = "DamageReportDeltaRegion"; break;
+                    case XDamageReportBoundingBox:  level = "DamageReportBoundingBox"; break;
+                    case XDamageReportNonEmpty:  level = "DamageReportNonEmpty"; break;
+                    default:  level = dlevel; sprintf (dlevel, "%d", stuff->level); break;
+                }
+
+                REPLY (" level(%s)",
+                    level);
+            }
 
             return reply;
         }
@@ -94,7 +111,7 @@ _EvlogRequestDamage(EvlogInfo *evinfo, char *reply, int *len)
 }
 
 static char*
-_EvlogEventDamage (EvlogInfo *evinfo, int first_base, char *reply, int *len)
+_EvlogEventDamage (EvlogInfo *evinfo, int first_base, int detail_level, char *reply, int *len)
 {
     xEvent *evt = evinfo->evt.ptr;
 
@@ -115,6 +132,16 @@ _EvlogEventDamage (EvlogInfo *evinfo, int first_base, char *reply, int *len)
                 stuff->geometry.width,
                 stuff->geometry.height);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY ("\n");
+                REPLY ("%67s time(%lums) level(%d) sequence_num(%d)",
+                    " ",
+                    stuff->timestamp,
+                    stuff->level,
+                    stuff->sequenceNumber);
+            }
+
             return reply;
         }
 
@@ -126,7 +153,7 @@ _EvlogEventDamage (EvlogInfo *evinfo, int first_base, char *reply, int *len)
 }
 
 static char *
-_EvlogReplyDamage (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogReplyDamage (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
 #if 0
     xGenericReply *rep = evinfo->rep.ptr;
index 535e970..68e5c96 100644 (file)
@@ -60,7 +60,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "xdbg_evlog.h"
 
 static char *
-_EvlogRequestDri2 (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogRequestDri2 (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
     xReq *req = evinfo->req.ptr;
 
@@ -87,9 +87,14 @@ _EvlogRequestDri2 (EvlogInfo *evinfo, char *reply, int *len)
     case X_DRI2GetBuffers:
         {
             xDRI2GetBuffersReq *stuff = (xDRI2GetBuffersReq *)req;
-            REPLY (": XID(0x%lx) Count(%ld)",
-                stuff->drawable,
-                stuff->count);
+            REPLY (": XID(0x%lx)",
+                stuff->drawable);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" count(%ld)",
+                    stuff->count);
+            }
 
             return reply;
         }
@@ -102,8 +107,11 @@ _EvlogRequestDri2 (EvlogInfo *evinfo, char *reply, int *len)
                 stuff->src,
                 stuff->dest);
 
-            REPLY (" Region");
-            reply = xDbgGetRegion(stuff->region, evinfo, reply, len);
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" Region");
+                reply = xDbgGetRegion(stuff->region, evinfo, reply, len);
+            }
 
             return reply;
         }
@@ -111,9 +119,14 @@ _EvlogRequestDri2 (EvlogInfo *evinfo, char *reply, int *len)
     case X_DRI2GetBuffersWithFormat:
         {
             xDRI2GetBuffersReq *stuff = (xDRI2GetBuffersReq *)req;
-            REPLY (": XID(0x%lx) count(%ld)",
-                stuff->drawable,
-                stuff->count);
+            REPLY (": XID(0x%lx)",
+                stuff->drawable);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" count(%ld)",
+                    stuff->count);
+            }
 
             return reply;
         }
@@ -137,9 +150,14 @@ _EvlogRequestDri2 (EvlogInfo *evinfo, char *reply, int *len)
     case X_DRI2SwapInterval:
         {
             xDRI2SwapIntervalReq *stuff = (xDRI2SwapIntervalReq *)req;
-            REPLY (": XID(0x%lx) Interval(%ld)",
-                stuff->drawable,
-                stuff->interval);
+            REPLY (": XID(0x%lx)",
+                stuff->drawable);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" interval(%ld)",
+                    stuff->interval);
+            }
 
             return reply;
         }
@@ -150,8 +168,11 @@ _EvlogRequestDri2 (EvlogInfo *evinfo, char *reply, int *len)
             REPLY (": XID(0x%lx)",
                 stuff->drawable);
 
-            REPLY (" Region");
-            reply = xDbgGetRegion(stuff->region, evinfo, reply, len);
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" Region");
+                reply = xDbgGetRegion(stuff->region, evinfo, reply, len);
+            }
 
             return reply;
         }
@@ -165,7 +186,7 @@ _EvlogRequestDri2 (EvlogInfo *evinfo, char *reply, int *len)
 
 
 static char *
-_EvlogEventDri2 (EvlogInfo *evinfo, int first_base, char *reply, int *len)
+_EvlogEventDri2 (EvlogInfo *evinfo, int first_base, int detail_level, char *reply, int *len)
 {
     xEvent *evt = evinfo->evt.ptr;
 
@@ -185,6 +206,15 @@ _EvlogEventDri2 (EvlogInfo *evinfo, int first_base, char *reply, int *len)
 
             evinfo->evt.size = sizeof (xDRI2BufferSwapComplete);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY ("\n");
+                REPLY ("%67s sequence_num(%d) event_type(%d)",
+                    " ",
+                    stuff->sequenceNumber,
+                    stuff->event_type);
+            }
+
             return reply;
         }
 
@@ -194,6 +224,12 @@ _EvlogEventDri2 (EvlogInfo *evinfo, int first_base, char *reply, int *len)
             REPLY (": XID(0x%lx)",
                 stuff->drawable);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" sequence_num(%d)",
+                    stuff->sequenceNumber);
+            }
+
             return reply;
         }
 
@@ -205,7 +241,7 @@ _EvlogEventDri2 (EvlogInfo *evinfo, int first_base, char *reply, int *len)
 }
 
 static char *
-_EvlogReplyDri2 (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogReplyDri2 (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
     xGenericReply *rep = evinfo->rep.ptr;
 
@@ -216,20 +252,27 @@ _EvlogReplyDri2 (EvlogInfo *evinfo, char *reply, int *len)
             if (evinfo->rep.isStart)
             {
                 xDRI2GetBuffersReply *stuff = (xDRI2GetBuffersReply *)rep;
-                REPLY (": size(%ldx%ld) Count(%ld)",
+                REPLY (": size(%ldx%ld) count(%ld)",
                     stuff->width,
                     stuff->height,
                     stuff->count);
+
+                if (detail_level >= EVLOG_PRINT_DETAIL)
+                {
+                    REPLY (" sequence_num(%d)",
+                        stuff->sequenceNumber);
+                }
             }
             else
             {
                 xDRI2Buffer *stuff = (xDRI2Buffer *)rep;
 
-                REPLY ("attachment(0x%lx) Name(0x%lx) pitch(0x%lx) cpp(0x%lx)",
+                REPLY ("attachment(0x%lx) Name(0x%lx) pitch(0x%lx) cpp(0x%lx) flags(0x%lx)",
                     stuff->attachment,
                     stuff->name,
                     stuff->pitch,
-                    stuff->cpp);
+                    stuff->cpp,
+                    stuff->flags);
             }
 
             return reply;
@@ -243,6 +286,12 @@ _EvlogReplyDri2 (EvlogInfo *evinfo, char *reply, int *len)
                 REPLY (": swap(%ld/%ld)",
                     stuff->swap_hi,
                     stuff->swap_lo);
+
+                if (detail_level >= EVLOG_PRINT_DETAIL)
+                {
+                    REPLY (" sequence_num(%d)",
+                        stuff->sequenceNumber);
+                }
             }
             else
             {
index d01a11a..c7f3284 100644 (file)
@@ -61,7 +61,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 
 char *
-xDbgEvlogEvent (EvlogInfo *evinfo, Bool on, char *reply, int *len)
+xDbgEvlogEvent (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
     extern ExtensionInfo* Sorted_Evlog_extensions;
     extern int Extensions_size;
@@ -85,12 +85,9 @@ xDbgEvlogEvent (EvlogInfo *evinfo, Bool on, char *reply, int *len)
 
     type &= 0x7F;
 
-    if(!on)
-        return reply;
-
     if (type < EXTENSION_EVENT_BASE)
     {
-        return xDbgEvlogEventCore (evinfo, reply, len);
+        return xDbgEvlogEventCore (evinfo, detail_level, reply, len);
     }
     else
     {
@@ -106,12 +103,12 @@ xDbgEvlogEvent (EvlogInfo *evinfo, Bool on, char *reply, int *len)
                 if (type >= Sorted_Evlog_extensions[i].evt_base &&
                      type < Sorted_Evlog_extensions[i+1].evt_base)
                 {
-                    return Sorted_Evlog_extensions[i].evt_func (evinfo, Sorted_Evlog_extensions[i].evt_base, reply, len);
+                    return Sorted_Evlog_extensions[i].evt_func (evinfo, Sorted_Evlog_extensions[i].evt_base, detail_level, reply, len);
                 }
                 continue;
             }
 
-            return Sorted_Evlog_extensions[i].evt_func (evinfo, Sorted_Evlog_extensions[i].evt_base, reply, len);
+            return Sorted_Evlog_extensions[i].evt_func (evinfo, Sorted_Evlog_extensions[i].evt_base, detail_level, reply, len);
         }
 
     }
index eff291d..360649a 100644 (file)
@@ -34,6 +34,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #include "xdbg_types.h"
 
-char *  xDbgEvlogEvent (EvlogInfo *evinfo, Bool on, char *reply, int *len);
+char *  xDbgEvlogEvent (EvlogInfo *evinfo, int detail_level, char *reply, int *len);
 
 #endif
index 2552f29..79ddf63 100644 (file)
@@ -60,7 +60,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "xdbg_evlog.h"
 
 static char *
-_EvlogRequestGesture(EvlogInfo *evinfo, char *reply, int *len)
+_EvlogRequestGesture(EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
     xReq *req = evinfo->req.ptr;
 
@@ -72,6 +72,12 @@ _EvlogRequestGesture(EvlogInfo *evinfo, char *reply, int *len)
             REPLY (": XID(0x%lx)",
                 stuff->window);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" mask(0x%lx)",
+                    stuff->mask);
+            }
+
             return reply;
         }
 
@@ -87,10 +93,31 @@ _EvlogRequestGesture(EvlogInfo *evinfo, char *reply, int *len)
     case X_GestureGrabEvent:
         {
             xGestureGrabEventReq *stuff = (xGestureGrabEventReq *)req;
-            REPLY (": XID(0x%lx) EventType(0x%lx), Num_finger(%d)",
-                stuff->window,
-                stuff->eventType,
-                stuff->num_finger);
+            REPLY (": XID(0x%lx)",
+                stuff->window);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *event_type;
+                char devent_type[10];
+
+                switch (stuff->eventType)
+                {
+                    case GestureNotifyFlick:  event_type = "GestureNotifyFlick"; break;
+                    case GestureNotifyPan:  event_type = "GestureNotifyPan"; break;
+                    case GestureNotifyPinchRotation:  event_type = "GestureNotifyPinchRotation"; break;
+                    case GestureNotifyTap:  event_type = "GestureNotifyTap"; break;
+                    case GestureNotifyTapNHold:  event_type = "GestureNotifyTapNHold"; break;
+                    case GestureNotifyHold:  event_type = "GestureNotifyHold"; break;
+                    case GestureNotifyGroup:  event_type = "GestureNotifyGroup"; break;
+                    default:  event_type = devent_type; sprintf (devent_type, "%ld", stuff->eventType); break;
+                }
+
+                REPLY (" event_type(%s) num_finger(%d) time(%lums)",
+                    event_type,
+                    stuff->num_finger,
+                    stuff->time);
+            }
 
             return reply;
         }
@@ -98,10 +125,31 @@ _EvlogRequestGesture(EvlogInfo *evinfo, char *reply, int *len)
     case X_GestureUngrabEvent:
         {
             xGestureUngrabEventReq *stuff = (xGestureUngrabEventReq *)req;
-            REPLY (": XID(0x%lx) EventType(0x%lx), Num_finger(%d)",
-                stuff->window,
-                stuff->eventType,
-                stuff->num_finger);
+            REPLY (": XID(0x%lx)",
+                stuff->window);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *event_type;
+                char devent_type[10];
+
+                switch (stuff->eventType)
+                {
+                    case GestureNotifyFlick:  event_type = "GestureNotifyFlick"; break;
+                    case GestureNotifyPan:  event_type = "GestureNotifyPan"; break;
+                    case GestureNotifyPinchRotation:  event_type = "GestureNotifyPinchRotation"; break;
+                    case GestureNotifyTap:  event_type = "GestureNotifyTap"; break;
+                    case GestureNotifyTapNHold:  event_type = "GestureNotifyTapNHold"; break;
+                    case GestureNotifyHold:  event_type = "GestureNotifyHold"; break;
+                    case GestureNotifyGroup:  event_type = "GestureNotifyGroup"; break;
+                    default:  event_type = devent_type; sprintf (devent_type, "%ld", stuff->eventType); break;
+                }
+
+                REPLY (" event_type(%s) num_finger(%d) time(%lums)",
+                    event_type,
+                    stuff->num_finger,
+                    stuff->time);
+            }
 
             return reply;
         }
@@ -114,7 +162,7 @@ _EvlogRequestGesture(EvlogInfo *evinfo, char *reply, int *len)
 }
 
 static char *
-_EvlogEventGesture (EvlogInfo *evinfo, int first_base, char *reply, int *len)
+_EvlogEventGesture (EvlogInfo *evinfo, int first_base, int detail_level, char *reply, int *len)
 {
     xEvent *evt = evinfo->evt.ptr;
 
@@ -123,12 +171,36 @@ _EvlogEventGesture (EvlogInfo *evinfo, int first_base, char *reply, int *len)
     case GestureNotifyFlick:
         {
             xGestureNotifyFlickEvent *stuff = (xGestureNotifyFlickEvent *) evt;
-            REPLY (": XID(0x%lx) Direction(%d) Distance(%d) Duration(%ldms) Angle(0x%lx)",
-                stuff->window,
-                stuff->direction,
-                stuff->distance,
-                stuff->duration,
-                stuff->angle);
+            REPLY (": XID(0x%lx)",
+                stuff->window);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *kind;
+                char dkind[10];
+
+                switch (stuff->kind)
+                {
+                    case GestureEnd:  kind = "GestureEnd"; break;
+                    case GestureBegin:  kind = "GestureBegin"; break;
+                    case GestureUpdate:  kind = "GestureUpdate"; break;
+                    case GestureDone:  kind = "GestureDone"; break;
+                    default:  kind = dkind; sprintf (dkind, "%d", stuff->kind); break;
+                }
+
+                REPLY (" kind(%s) time(%lums) num_finger(%d) direction(%d) distance(%d)",
+                    kind,
+                    stuff->time,
+                    stuff->num_finger,
+                    stuff->direction,
+                    stuff->distance);
+
+                REPLY ("\n");
+                REPLY ("%67s duration(%lums) angle(%ld)",
+                    " ",
+                    stuff->duration,
+                    stuff->angle);
+            }
 
             return reply;
         }
@@ -136,13 +208,38 @@ _EvlogEventGesture (EvlogInfo *evinfo, int first_base, char *reply, int *len)
     case GestureNotifyPan:
         {
             xGestureNotifyPanEvent *stuff = (xGestureNotifyPanEvent *) evt;
-            REPLY (": XID(0x%lx) Direction(%d) Distance(%d) Duration(%ldms) coord(%d,%d)",
-                stuff->window,
-                stuff->direction,
-                stuff->distance,
-                stuff->duration,
-                stuff->dx,
-                stuff->dy);
+            REPLY (": XID(0x%lx)",
+                stuff->window);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *kind;
+                char dkind[10];
+
+                switch (stuff->kind)
+                {
+                    case GestureEnd:  kind = "GestureEnd"; break;
+                    case GestureBegin:  kind = "GestureBegin"; break;
+                    case GestureUpdate:  kind = "GestureUpdate"; break;
+                    case GestureDone:  kind = "GestureDone"; break;
+                    default:  kind = dkind; sprintf (dkind, "%d", stuff->kind); break;
+                }
+
+                REPLY (" kind(%s) sequence_num(%d) time(%lums) num_finger(%d) direction(%d) ",
+                    kind,
+                    stuff->sequenceNumber,
+                    stuff->time,
+                    stuff->num_finger,
+                    stuff->direction);
+
+                REPLY ("\n");
+                REPLY ("%67s distance(%d) duration(%ldms) coord(%d,%d)",
+                    " ",
+                    stuff->distance,
+                    stuff->duration,
+                    stuff->dx,
+                    stuff->dy);
+            }
 
             return reply;
         }
@@ -150,13 +247,38 @@ _EvlogEventGesture (EvlogInfo *evinfo, int first_base, char *reply, int *len)
     case GestureNotifyPinchRotation:
         {
             xGestureNotifyPinchRotationEvent *stuff = (xGestureNotifyPinchRotationEvent *) evt;
-            REPLY (": XID(0x%lx) Distance(%d) Coord(%d,%d) Zoom(0x%lx) Angle(0x%lx)",
-                stuff->window,
-                stuff->distance,
-                stuff->cx,
-                stuff->cy,
-                stuff->zoom,
-                stuff->angle);
+            REPLY (": XID(0x%lx)",
+                stuff->window);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *kind;
+                char dkind[10];
+
+                switch (stuff->kind)
+                {
+                    case GestureEnd:  kind = "GestureEnd"; break;
+                    case GestureBegin:  kind = "GestureBegin"; break;
+                    case GestureUpdate:  kind = "GestureUpdate"; break;
+                    case GestureDone:  kind = "GestureDone"; break;
+                    default:  kind = dkind; sprintf (dkind, "%d", stuff->kind); break;
+                }
+
+                REPLY (" kind(%s) sequence_num(%d) time(%lums) num_finger(%d) distance(%d)",
+                    kind,
+                    stuff->sequenceNumber,
+                    stuff->time,
+                    stuff->num_finger,
+                    stuff->distance);
+
+                REPLY ("\n");
+                REPLY ("%67s coord(%d,%d) zoom(%ld) angle(%ld)",
+                    " ",
+                    stuff->cx,
+                    stuff->cy,
+                    stuff->zoom,
+                    stuff->angle);
+            }
 
             return reply;
         }
@@ -164,12 +286,37 @@ _EvlogEventGesture (EvlogInfo *evinfo, int first_base, char *reply, int *len)
     case GestureNotifyTap:
         {
             xGestureNotifyTapEvent *stuff = (xGestureNotifyTapEvent *) evt;
-            REPLY (": XID(0x%lx) Coord(%d,%d) tapRepeat(%d) Interval(%ldms)",
-                stuff->window,
-                stuff->cx,
-                stuff->cy,
-                stuff->tap_repeat,
-                stuff->interval);
+            REPLY (": XID(0x%lx)",
+                stuff->window);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *kind;
+                char dkind[10];
+
+                switch (stuff->kind)
+                {
+                    case GestureEnd:  kind = "GestureEnd"; break;
+                    case GestureBegin:  kind = "GestureBegin"; break;
+                    case GestureUpdate:  kind = "GestureUpdate"; break;
+                    case GestureDone:  kind = "GestureDone"; break;
+                    default:  kind = dkind; sprintf (dkind, "%d", stuff->kind); break;
+                }
+
+                REPLY (" kind(%s) sequence_num(%d) time(%lums) num_finger(%d) coord(%d,%d)",
+                    kind,
+                    stuff->sequenceNumber,
+                    stuff->time,
+                    stuff->num_finger,
+                    stuff->cx,
+                    stuff->cy);
+
+                REPLY ("\n");
+                REPLY ("%67s tap_repeat(%d) interval(%lums)",
+                    " ",
+                    stuff->tap_repeat,
+                    stuff->interval);
+            }
 
             return reply;
         }
@@ -177,12 +324,37 @@ _EvlogEventGesture (EvlogInfo *evinfo, int first_base, char *reply, int *len)
     case GestureNotifyTapNHold:
         {
             xGestureNotifyTapNHoldEvent *stuff = (xGestureNotifyTapNHoldEvent *) evt;
-            REPLY (": XID(0x%lx) Coord(%d,%d) Interval(%ldms) Holdtime(%ldms)",
-                stuff->window,
-                stuff->cx,
-                stuff->cy,
-                stuff->interval,
-                stuff->holdtime);
+            REPLY (": XID(0x%lx)",
+                stuff->window);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *kind;
+                char dkind[10];
+
+                switch (stuff->kind)
+                {
+                    case GestureEnd:  kind = "GestureEnd"; break;
+                    case GestureBegin:  kind = "GestureBegin"; break;
+                    case GestureUpdate:  kind = "GestureUpdate"; break;
+                    case GestureDone:  kind = "GestureDone"; break;
+                    default:  kind = dkind; sprintf (dkind, "%d", stuff->kind); break;
+                }
+
+                REPLY (" kind(%s) sequence_num(%d) time(%lums) num_finger(%d) coord(%d,%d)",
+                    kind,
+                    stuff->sequenceNumber,
+                    stuff->time,
+                    stuff->num_finger,
+                    stuff->cx,
+                    stuff->cy);
+
+                REPLY ("\n");
+                REPLY ("%67s interval(%lums) hold_time(%lums)",
+                    " ",
+                    stuff->interval,
+                    stuff->holdtime);
+            }
 
             return reply;
         }
@@ -190,11 +362,36 @@ _EvlogEventGesture (EvlogInfo *evinfo, int first_base, char *reply, int *len)
     case GestureNotifyHold:
         {
             xGestureNotifyHoldEvent *stuff = (xGestureNotifyHoldEvent *) evt;
-            REPLY (": XID(0x%lx) Coord(%d,%d) Holdtime(%ldms)",
-                stuff->window,
-                stuff->cx,
-                stuff->cy,
-                stuff->holdtime);
+            REPLY (": XID(0x%lx)",
+                stuff->window);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *kind;
+                char dkind[10];
+
+                switch (stuff->kind)
+                {
+                    case GestureEnd:  kind = "GestureEnd"; break;
+                    case GestureBegin:  kind = "GestureBegin"; break;
+                    case GestureUpdate:  kind = "GestureUpdate"; break;
+                    case GestureDone:  kind = "GestureDone"; break;
+                    default:  kind = dkind; sprintf (dkind, "%d", stuff->kind); break;
+                }
+
+                REPLY (" kind(%s) sequence_num(%d) time(%lums) num_finger(%d) coord(%d,%d) ",
+                    kind,
+                    stuff->sequenceNumber,
+                    stuff->time,
+                    stuff->num_finger,
+                    stuff->cx,
+                    stuff->cy);
+
+                REPLY ("\n");
+                REPLY ("%67s hold_time(%lums)",
+                    " ",
+                    stuff->holdtime);
+            }
 
             return reply;
         }
@@ -207,6 +404,29 @@ _EvlogEventGesture (EvlogInfo *evinfo, int first_base, char *reply, int *len)
                 stuff->groupid,
                 stuff->num_group);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *kind;
+                char dkind[10];
+
+                switch (stuff->kind)
+                {
+                    case GestureGroupRemoved:  kind = "GestureGroupRemoved"; break;
+                    case GestureGroupAdded:  kind = "GestureGroupAdded"; break;
+                    case GestureGroupCurrent:  kind = "GestureGroupCurrent"; break;
+                    default:  kind = dkind; sprintf (dkind, "%d", stuff->kind); break;
+                }
+
+                REPLY ("\n");
+                REPLY ("%67s kind(%s) sequence_num(%d) time(%lums) group_id(%d) num_group(%d)",
+                    " ",
+                    kind,
+                    stuff->sequenceNumber,
+                    stuff->time,
+                    stuff->groupid,
+                    stuff->num_group);
+            }
+
             return reply;
         }
 
@@ -218,7 +438,7 @@ _EvlogEventGesture (EvlogInfo *evinfo, int first_base, char *reply, int *len)
 }
 
 static char *
-_EvlogReplyGesture (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogReplyGesture (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
 #if 0
     xGenericReply *rep = evinfo->rep.ptr;
index d62ed7c..d2088fa 100644 (file)
@@ -61,7 +61,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "xdbg_evlog.h"
 
 static char *
-_EvlogRequestRandr (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogRequestRandr (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
     xReq *req = evinfo->req.ptr;
 
@@ -79,12 +79,17 @@ _EvlogRequestRandr (EvlogInfo *evinfo, char *reply, int *len)
     case X_RRSetScreenSize:
         {
             xRRSetScreenSizeReq *stuff = (xRRSetScreenSizeReq *)req;
-            REPLY (": XID(0x%lx) size(%dx%d) milliSize(%ldx%ld)",
+            REPLY (": XID(0x%lx) size(%dx%d)",
                 stuff->window,
                 stuff->width,
-                stuff->height,
-                stuff->widthInMillimeters,
-                stuff->heightInMillimeters);
+                stuff->height);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" milliSize(%ldx%ld)",
+                    stuff->widthInMillimeters,
+                    stuff->heightInMillimeters);
+            }
 
             return reply;
         }
@@ -104,6 +109,12 @@ _EvlogRequestRandr (EvlogInfo *evinfo, char *reply, int *len)
             REPLY (": XID(0x%lx)",
                 stuff->output);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" config_timestamp(%lums)",
+                    stuff->configTimestamp);
+            }
+
             return reply;
         }
 
@@ -137,22 +148,48 @@ _EvlogRequestRandr (EvlogInfo *evinfo, char *reply, int *len)
             REPLY (" Property");
             reply = xDbgGetAtom(stuff->property, evinfo, reply, len);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" pending(%s) range(%s)",
+                    stuff->pending ? "YES" : "NO",
+                    stuff->range ? "YES" : "NO");
+            }
+
             return reply;
         }
 
     case X_RRChangeOutputProperty:
         {
             xRRChangeOutputPropertyReq *stuff = (xRRChangeOutputPropertyReq *)req;
-            REPLY (": XID(0x%lx) Format(%d) nUnits(%ld)",
-                stuff->output,
-                stuff->format,
-                stuff->nUnits);
+            REPLY (": XID(0x%lx)",
+                stuff->output);
 
             REPLY (" Property");
             reply = xDbgGetAtom(stuff->property, evinfo, reply, len);
             REPLY (" Type");
             reply = xDbgGetAtom(stuff->type, evinfo, reply, len);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *mode;
+                char dmode[10];
+
+                switch (stuff->mode)
+                {
+                    case PropModeReplace:  mode = "PropModeReplace"; break;
+                    case PropModePrepend:  mode = "PropModePrepend"; break;
+                    case PropModeAppend:  mode = "PropModeAppend"; break;
+                    default:  mode = dmode; sprintf (dmode, "%d", stuff->mode); break;
+                }
+
+                REPLY ("\n");
+                REPLY ("%67s mode(%s) format(%d) nUnits(%ld)",
+                    " ",
+                    mode,
+                    stuff->format,
+                    stuff->nUnits);
+            }
+
             return reply;
         }
 
@@ -171,16 +208,21 @@ _EvlogRequestRandr (EvlogInfo *evinfo, char *reply, int *len)
     case X_RRGetOutputProperty:
         {
             xRRGetOutputPropertyReq *stuff = (xRRGetOutputPropertyReq *)req;
-            REPLY (": XID(0x%lx) longOffset(%ld) longLength(%ld)",
-                stuff->output,
-                stuff->longOffset,
-                stuff->longLength);
+            REPLY (": XID(0x%lx)",
+                stuff->output);
 
             REPLY (" Property");
             reply = xDbgGetAtom(stuff->property, evinfo, reply, len);
             REPLY (" Type");
             reply = xDbgGetAtom(stuff->type, evinfo, reply, len);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" longOffset(%ld) longLength(%ld)",
+                    stuff->longOffset,
+                    stuff->longLength);
+            }
+
             return reply;
         }
 
@@ -190,17 +232,44 @@ _EvlogRequestRandr (EvlogInfo *evinfo, char *reply, int *len)
             REPLY (": XID(0x%lx)",
                 stuff->crtc);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" config_timestamp(%lums)",
+                    stuff->configTimestamp);
+            }
+
             return reply;
         }
 
     case X_RRSetCrtcConfig:
         {
             xRRSetCrtcConfigReq *stuff = (xRRSetCrtcConfigReq *)req;
-            REPLY (": XID(0x%lx) Coordinate(%d,%d) Rotation(%d)",
+            REPLY (": XID(0x%lx) coord(%d,%d) ",
                 stuff->crtc,
                 stuff->x,
-                stuff->y,
-                stuff->rotation);
+                stuff->y);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *rotation;
+
+                switch (stuff->rotation & 0xf)
+                {
+                    case RR_Rotate_0:  rotation = "RR_Rotate_0"; break;
+                    case RR_Rotate_90:  rotation = "RR_Rotate_90"; break;
+                    case RR_Rotate_180:  rotation = "RR_Rotate_180"; break;
+                    case RR_Rotate_270:  rotation = "RR_Rotate_270"; break;
+                    default:  rotation = "Invaild Rotation"; break;
+                }
+
+                REPLY ("\n");
+                REPLY ("%67s timestamp(%lums) config_timestamp(%lums) RRmode(0x%lx) rotation(%s)",
+                    " ",
+                    stuff->timestamp,
+                    stuff->configTimestamp,
+                    stuff->mode,
+                    rotation);
+            }
 
             return reply;
         }
@@ -223,7 +292,7 @@ _EvlogRequestRandr (EvlogInfo *evinfo, char *reply, int *len)
 
 
 static char *
-_EvlogEventRandr (EvlogInfo *evinfo, int first_base, char *reply, int *len)
+_EvlogEventRandr (EvlogInfo *evinfo, int first_base, int detail_level, char *reply, int *len)
 {
     xEvent *evt = evinfo->evt.ptr;
 
@@ -232,15 +301,39 @@ _EvlogEventRandr (EvlogInfo *evinfo, int first_base, char *reply, int *len)
     case RRScreenChangeNotify:
         {
             xRRScreenChangeNotifyEvent *stuff = (xRRScreenChangeNotifyEvent *) evt;
-            REPLY (": Root(0x%lx) Window(0x%lx) sizeID(%d) subPixel(%d) Pixel(%d,%d) Milli(%d,%d)",
+            REPLY (": Root(0x%lx) Window(0x%lx)",
                 stuff->root,
-                stuff->window,
-                stuff->sizeID,
-                stuff->subpixelOrder,
-                stuff->widthInPixels,
-                stuff->heightInPixels,
-                stuff->widthInMillimeters,
-                stuff->heightInMillimeters);
+                stuff->window);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *rotation;
+
+                switch (stuff->rotation & 0xf)
+                {
+                    case RR_Rotate_0:  rotation = "RR_Rotate_0"; break;
+                    case RR_Rotate_90:  rotation = "RR_Rotate_90"; break;
+                    case RR_Rotate_180:  rotation = "RR_Rotate_180"; break;
+                    case RR_Rotate_270:  rotation = "RR_Rotate_270"; break;
+                    default:  rotation = "Invaild Rotation"; break;
+                }
+
+                REPLY (" sizeID(%d) subPixel(%d) Pixel(%d,%d) Milli(%d,%d)",
+                    stuff->sizeID,
+                    stuff->subpixelOrder,
+                    stuff->widthInPixels,
+                    stuff->heightInPixels,
+                    stuff->widthInMillimeters,
+                    stuff->heightInMillimeters);
+
+                REPLY ("\n");
+                REPLY ("%67s rotation(%s) sequence_num(%d) timestamp(%lums) config_timestamp(%lums)",
+                    " ",
+                    rotation,
+                    stuff->sequenceNumber,
+                    stuff->timestamp,
+                    stuff->configTimestamp);
+            }
 
             return reply;
         }
@@ -252,7 +345,7 @@ _EvlogEventRandr (EvlogInfo *evinfo, int first_base, char *reply, int *len)
             case RRNotify_CrtcChange:
                 {
                     xRRCrtcChangeNotifyEvent *stuff = (xRRCrtcChangeNotifyEvent *) evt;
-                    REPLY (": XID(0x%lx) Crtc(0x%lx) Mode(0x%lx) size(%udx%ud) coord(%d,%d)",
+                    REPLY (": XID(0x%lx) Crtc(0x%lx) RRmode(0x%lx) new_size(%udx%ud) new_coord(%d,%d)",
                         stuff->window,
                         stuff->crtc,
                         stuff->mode,
@@ -261,18 +354,85 @@ _EvlogEventRandr (EvlogInfo *evinfo, int first_base, char *reply, int *len)
                         stuff->x,
                         stuff->y);
 
+                    if (detail_level >= EVLOG_PRINT_DETAIL)
+                    {
+                        const char *rotation;
+
+                        switch (stuff->rotation & 0xf)
+                        {
+                            case RR_Rotate_0:  rotation = "RR_Rotate_0"; break;
+                            case RR_Rotate_90:  rotation = "RR_Rotate_90"; break;
+                            case RR_Rotate_180:  rotation = "RR_Rotate_180"; break;
+                            case RR_Rotate_270:  rotation = "RR_Rotate_270"; break;
+                            default:  rotation = "Invaild Rotation"; break;
+                        }
+
+                        REPLY ("\n");
+                        REPLY ("%67s rotation(%s) sequence_num(%d) timestamp(%lums)",
+                            " ",
+                            rotation,
+                            stuff->sequenceNumber,
+                            stuff->timestamp);
+                    }
+
                     return reply;
                 }
 
             case RRNotify_OutputChange:
                 {
                     xRROutputChangeNotifyEvent *stuff = (xRROutputChangeNotifyEvent *) evt;
-                    REPLY (": XID(0x%lx) Output(0x%lx) Crtc(0x%lx) Mode(0x%lx)",
+                    REPLY (": XID(0x%lx) Output(0x%lx) Crtc(0x%lx) RRmode(0x%lx)",
                         stuff->window,
                         stuff->output,
                         stuff->crtc,
                         stuff->mode);
 
+                    if (detail_level >= EVLOG_PRINT_DETAIL)
+                    {
+                        const char *rotation, *connection, *subpixelOrder;
+                        char dconnection[10], dsubpixelOrder[10];
+
+                        switch (stuff->rotation & 0xf)
+                        {
+                            case RR_Rotate_0:    rotation = "RR_Rotate_0"; break;
+                            case RR_Rotate_90:   rotation = "RR_Rotate_90"; break;
+                            case RR_Rotate_180:  rotation = "RR_Rotate_180"; break;
+                            case RR_Rotate_270:  rotation = "RR_Rotate_270"; break;
+                            default:  rotation = "Invaild Rotation"; break;
+                        }
+
+                        switch (stuff->connection)
+                        {
+                            case RR_Connected:          connection = "RR_Connected"; break;
+                            case RR_Disconnected:       connection = "RR_Disconnected"; break;
+                            case RR_UnknownConnection:  connection = "RR_UnknownConnection"; break;
+                            default:  connection = dconnection; sprintf (dconnection, "%d", stuff->connection); break;
+                        }
+
+                        switch (stuff->subpixelOrder)
+                        {
+                            case SubPixelUnknown:        subpixelOrder = "SubPixelUnknown"; break;
+                            case SubPixelHorizontalRGB:  subpixelOrder = "SubPixelHorizontalRGB"; break;
+                            case SubPixelHorizontalBGR:  subpixelOrder = "SubPixelHorizontalBGR"; break;
+                            case SubPixelVerticalRGB:    subpixelOrder = "SubPixelVerticalRGB"; break;
+                            case SubPixelVerticalBGR:    subpixelOrder = "SubPixelVerticalBGR"; break;
+                            case SubPixelNone:           subpixelOrder = "SubPixelNone"; break;
+                            default:  subpixelOrder = dsubpixelOrder; sprintf (dsubpixelOrder, "%d", stuff->connection); break;
+                        }
+
+                        REPLY (" sequence_num(%d)",
+                            stuff->sequenceNumber);
+
+                        REPLY ("\n");
+                        REPLY ("%67s timestamp(%lums) config_timestamp(%lums) rotation(%s) connection(%s) subpixel_order(%s)",
+                            " ",
+                            stuff->timestamp,
+                            stuff->configTimestamp,
+                            rotation,
+                            connection,
+                            subpixelOrder);
+                    }
+
                     return reply;
                 }
 
@@ -283,9 +443,29 @@ _EvlogEventRandr (EvlogInfo *evinfo, int first_base, char *reply, int *len)
                         stuff->window,
                         stuff->output);
 
-                    REPLY (" Atom");
+                    REPLY (" Property");
                     reply = xDbgGetAtom(stuff->atom, evinfo, reply, len);
 
+                    if (detail_level >= EVLOG_PRINT_DETAIL)
+                    {
+                        const char *state;
+                        char dstate[10];
+
+                        switch (stuff->state)
+                        {
+                            case PropertyNewValue:    state = "PropertyNewValue"; break;
+                            case PropertyDelete:   state = "PropertyDelete"; break;
+                            default:  state = dstate; sprintf (dstate, "%d", stuff->state); break;
+                        }
+
+                        REPLY ("\n");
+                        REPLY ("%67s sequence_num(%d) timestamp(%lums) state(%s)",
+                            " ",
+                            stuff->sequenceNumber,
+                            stuff->timestamp,
+                            state);
+                    }
+
                     return reply;
                 }
 
@@ -296,6 +476,13 @@ _EvlogEventRandr (EvlogInfo *evinfo, int first_base, char *reply, int *len)
                         stuff->window,
                         stuff->provider);
 
+                    if (detail_level >= EVLOG_PRINT_DETAIL)
+                    {
+                        REPLY (" sequence_num(%d) timestamp(%lums)",
+                            stuff->sequenceNumber,
+                            stuff->timestamp);
+                    }
+
                     return reply;
                 }
 
@@ -309,6 +496,24 @@ _EvlogEventRandr (EvlogInfo *evinfo, int first_base, char *reply, int *len)
                     REPLY (" Atom");
                     reply = xDbgGetAtom(stuff->atom, evinfo, reply, len);
 
+                    if (detail_level >= EVLOG_PRINT_DETAIL)
+                    {
+                        const char *state;
+                        char dstate[10];
+
+                        switch (stuff->state)
+                        {
+                            case PropertyNewValue:    state = "PropertyNewValue"; break;
+                            case PropertyDelete:   state = "PropertyDelete"; break;
+                            default:  state = dstate; sprintf (dstate, "%d", stuff->state); break;
+                        }
+
+                        REPLY (" sequence_num(%d) timestamp(%lums) state(%s)",
+                            stuff->sequenceNumber,
+                            stuff->timestamp,
+                            state);
+                    }
+
                     return reply;
                 }
 
@@ -318,6 +523,13 @@ _EvlogEventRandr (EvlogInfo *evinfo, int first_base, char *reply, int *len)
                     REPLY (": XID(0x%lx)",
                         stuff->window);
 
+                    if (detail_level >= EVLOG_PRINT_DETAIL)
+                    {
+                        REPLY (" sequence_num(%d) timestamp(%lums)",
+                            stuff->sequenceNumber,
+                            stuff->timestamp);
+                    }
+
                     return reply;
                 }
 
@@ -334,7 +546,7 @@ _EvlogEventRandr (EvlogInfo *evinfo, int first_base, char *reply, int *len)
 }
 
 static char *
-_EvlogReplyRandr (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogReplyRandr (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
     xGenericReply *rep = evinfo->rep.ptr;
 
@@ -388,6 +600,8 @@ _EvlogReplyRandr (EvlogInfo *evinfo, char *reply, int *len)
                 char temp[64] = {0, };
                 int i;
 
+                names[nbytesNames] = '\0';
+
                 REPLY ("Crtcs");
                 REPLY ("(");
                 for (i = 0 ; i < nCrtcs ; i++)
@@ -433,7 +647,7 @@ _EvlogReplyRandr (EvlogInfo *evinfo, char *reply, int *len)
 
         case X_RRGetOutputInfo:
         {
-            static int nCrtcs, nModes, nPreferred, nClones;
+            static int nCrtcs, nModes, nPreferred, nClones, namelength;
             if (evinfo->rep.isStart)
             {
                 xRRGetOutputInfoReply *stuff = (xRRGetOutputInfoReply *)rep;
@@ -451,6 +665,7 @@ _EvlogReplyRandr (EvlogInfo *evinfo, char *reply, int *len)
                 nModes = stuff->nModes;
                 nPreferred = stuff->nPreferred;
                 nClones = stuff->nClones;
+                namelength = stuff->nameLength;
             }
             else
             {
@@ -460,6 +675,8 @@ _EvlogReplyRandr (EvlogInfo *evinfo, char *reply, int *len)
                 char *name = (char *) (clones + nClones);
                 int i;
 
+                name[namelength] = '\0';
+
                 REPLY ("Crtcs");
                 REPLY ("(");
                 for (i = 0 ; i < nCrtcs ; i++)
index 2934b77..d524e83 100644 (file)
@@ -60,7 +60,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define UNKNOWN_EVENT "<unknown>"
 
 char *
-xDbgEvlogReply (EvlogInfo *evinfo, Bool on, char *reply, int *len)
+xDbgEvlogReply (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
     extern ExtensionInfo Evlog_extensions[];
     extern int Extensions_size;
@@ -77,12 +77,9 @@ xDbgEvlogReply (EvlogInfo *evinfo, Bool on, char *reply, int *len)
     if (rep.isStart)
         REPLY ("%s", evinfo->rep.name);
 
-    if(!on)
-        return reply;
-
     if (rep.reqType < EXTENSION_BASE)
     {
-        return xDbgEvlogReplyCore (evinfo, reply, len);
+        return xDbgEvlogReplyCore (evinfo, detail_level, reply, len);
     }
     else
     {
@@ -90,7 +87,7 @@ xDbgEvlogReply (EvlogInfo *evinfo, Bool on, char *reply, int *len)
         {
             if (rep.reqType == Evlog_extensions[i].opcode)
             {
-                return Evlog_extensions[i].rep_func (evinfo, reply, len);
+                return Evlog_extensions[i].rep_func (evinfo, detail_level, reply, len);
             }
         }
     }
index 7a5e718..773bed3 100644 (file)
@@ -34,6 +34,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #include "xdbg_types.h"
 
-char *  xDbgEvlogReply (EvlogInfo *evinfo, Bool on, char *reply, int *len);
+char *  xDbgEvlogReply (EvlogInfo *evinfo, int detail_level, char *reply, int *len);
 
 #endif
index 97ecc24..a9e1a66 100644 (file)
@@ -62,7 +62,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 char *conn[] = {"Initial Connect", "Establich Connect"};
 
 char *
-xDbgEvlogReqeust (EvlogInfo *evinfo, Bool on, char *reply, int *len)
+xDbgEvlogReqeust (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
     extern ExtensionInfo Evlog_extensions[];
     extern int Extensions_size;
@@ -78,16 +78,13 @@ xDbgEvlogReqeust (EvlogInfo *evinfo, Bool on, char *reply, int *len)
 
     REPLY ("%s", evinfo->req.name);
 
-    if(!on)
-        return reply;
-
     for (i = 0 ; i < sizeof(conn) / sizeof(char *) ; i++)
         if (!strcmp(evinfo->req.name, conn[i]))
             return reply;
 
     if (xReq->reqType < EXTENSION_BASE)
     {
-        return xDbgEvlogRequestCore (evinfo, reply, len);
+        return xDbgEvlogRequestCore (evinfo, detail_level, reply, len);
     }
     else
     {
@@ -95,7 +92,7 @@ xDbgEvlogReqeust (EvlogInfo *evinfo, Bool on, char *reply, int *len)
         {
             if (xReq->reqType == Evlog_extensions[i].opcode)
             {
-                return Evlog_extensions[i].req_func (evinfo, reply, len);
+                return Evlog_extensions[i].req_func (evinfo, detail_level, reply, len);
             }
         }
     }
index 7c82719..c80538d 100644 (file)
@@ -34,6 +34,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #include "xdbg_types.h"
 
-char *  xDbgEvlogReqeust (EvlogInfo *evinfo, Bool on, char *reply, int *len);
+char *  xDbgEvlogReqeust (EvlogInfo *evinfo, int detail_level, char *reply, int *len);
 
 #endif
index da3b38a..f4df1ef 100644 (file)
@@ -70,7 +70,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "xdbg_evlog.h"
 
 static char *
-_EvlogRequestXextDpms(EvlogInfo *evinfo, char *reply, int *len)
+_EvlogRequestXextDpms(EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
     xReq *req = evinfo->req.ptr;
 
@@ -105,7 +105,7 @@ _EvlogRequestXextDpms(EvlogInfo *evinfo, char *reply, int *len)
 
 
 static char *
-_EvlogRequestXextShm (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogRequestXextShm (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
     xReq *req = evinfo->req.ptr;
 
@@ -114,8 +114,9 @@ _EvlogRequestXextShm (EvlogInfo *evinfo, char *reply, int *len)
     case X_ShmPutImage:
         {
             xShmPutImageReq *stuff = (xShmPutImageReq *)req;
-            REPLY (": XID(0x%lx) size(%dx%d) src(%d,%d %dx%d) dst(%d,%d)",
+            REPLY (": XID(0x%lx) gc(0x%lx) size(%dx%d) src(%d,%d %dx%d) dst(%d,%d)",
                 stuff->drawable,
+                stuff->gc,
                 stuff->totalWidth,
                 stuff->totalHeight,
                 stuff->srcX,
@@ -125,6 +126,29 @@ _EvlogRequestXextShm (EvlogInfo *evinfo, char *reply, int *len)
                 stuff->dstX,
                 stuff->dstY);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *format;
+                char dformat[10];
+
+                switch (stuff->format)
+                {
+                    case XYBitmap:  format = "XYBitmap"; break;
+                    case XYPixmap:  format = "XYPixmap"; break;
+                    case ZPixmap:  format = "ZPixmap"; break;
+                    default:  format = dformat; sprintf (dformat, "%d", stuff->format); break;
+                }
+
+                REPLY ("\n");
+                REPLY ("%67s depth(%d) format(%s) send_event(%s) shmseg(0x%lx) offset(%ld)",
+                    " ",
+                    stuff->depth,
+                    format,
+                    stuff->sendEvent ? "YES" : "NO",
+                    stuff->shmseg,
+                    stuff->offset);
+            }
+
             return reply;
         }
 
@@ -138,6 +162,28 @@ _EvlogRequestXextShm (EvlogInfo *evinfo, char *reply, int *len)
                 stuff->x,
                 stuff->y);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *format;
+                char  dformat[10];
+
+                switch (stuff->format)
+                {
+                    case XYBitmap:  format = "XYBitmap"; break;
+                    case XYPixmap:  format = "XYPixmap"; break;
+                    case ZPixmap:  format = "ZPixmap"; break;
+                    default:  format = dformat; sprintf (dformat, "%d", stuff->format); break;
+                }
+
+                REPLY ("\n");
+                REPLY ("%67s format(%s) plain_mask(0x%lx) shmseg(0x%lx) offset(%ld)",
+                    " ",
+                    format,
+                    stuff->planeMask,
+                    stuff->shmseg,
+                    stuff->offset);
+            }
+
             return reply;
         }
 
@@ -150,6 +196,16 @@ _EvlogRequestXextShm (EvlogInfo *evinfo, char *reply, int *len)
                 stuff->width,
                 stuff->height);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY ("\n");
+                REPLY ("%67s depth(%d) shmseg(0x%lx) offset(%ld)",
+                    " ",
+                    stuff->depth,
+                    stuff->shmseg,
+                    stuff->offset);
+            }
+
             return reply;
         }
 
@@ -161,7 +217,7 @@ _EvlogRequestXextShm (EvlogInfo *evinfo, char *reply, int *len)
 }
 
 static char *
-_EvlogRequestXextSync(EvlogInfo *evinfo, char *reply, int *len)
+_EvlogRequestXextSync(EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
     xReq *req = evinfo->req.ptr;
 
@@ -226,7 +282,7 @@ _EvlogRequestXextSync(EvlogInfo *evinfo, char *reply, int *len)
 }
 
 static char *
-_EvlogRequestXextXtestExt1(EvlogInfo *evinfo, char *reply, int *len)
+_EvlogRequestXextXtestExt1(EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
     xReq *req = evinfo->req.ptr;
 
@@ -259,7 +315,7 @@ _EvlogRequestXextXtestExt1(EvlogInfo *evinfo, char *reply, int *len)
 
 
 static char *
-_EvlogRequestXextXtest(EvlogInfo *evinfo, char *reply, int *len)
+_EvlogRequestXextXtest(EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
     xReq *req = evinfo->req.ptr;
 
@@ -293,6 +349,15 @@ _EvlogRequestXextXtest(EvlogInfo *evinfo, char *reply, int *len)
                 stuff->rootX,
                 stuff->rootY);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" type(%d) detail(%d) time(%lums) device_id(%d)",
+                    stuff->type,
+                    stuff->detail,
+                    stuff->time,
+                    stuff->deviceid);
+            }
+
             return reply;
         }
 
@@ -300,7 +365,7 @@ _EvlogRequestXextXtest(EvlogInfo *evinfo, char *reply, int *len)
         {
             xXTestGrabControlReq *stuff = (xXTestGrabControlReq *)req;
             REPLY (": Impervious(%s)" ,
-                (stuff->impervious)? "TRUE" : "FALSE");
+                (stuff->impervious)? "YES" : "NO");
 
             return reply;
         }
@@ -314,8 +379,9 @@ _EvlogRequestXextXtest(EvlogInfo *evinfo, char *reply, int *len)
 
 
 static char *
-_EvlogEventXextDpms (EvlogInfo *evinfo, int first_base, char *reply, int *len)
+_EvlogEventXextDpms (EvlogInfo *evinfo, int first_base, int detail_level, char *reply, int *len)
 {
+#if 0
     xEvent *evt = evinfo->evt.ptr;
 
     switch ((evt->u.u.type & 0x7F) - first_base)
@@ -324,13 +390,13 @@ _EvlogEventXextDpms (EvlogInfo *evinfo, int first_base, char *reply, int *len)
     default:
             break;
     }
-
+#endif
     return reply;
 }
 
 
 static char *
-_EvlogEventXextShm (EvlogInfo *evinfo, int first_base, char *reply, int *len)
+_EvlogEventXextShm (EvlogInfo *evinfo, int first_base, int detail_level, char *reply, int *len)
 {
     xEvent *evt = evinfo->evt.ptr;
 
@@ -342,6 +408,15 @@ _EvlogEventXextShm (EvlogInfo *evinfo, int first_base, char *reply, int *len)
             REPLY (": XID(0x%lx)",
                 stuff->drawable);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" sequence_num(%d) major_event(%d) minor_event(%d) shmseg(0x%lx) offset(%ld)",
+                    stuff->sequenceNumber,
+                    stuff->majorEvent,
+                    stuff->minorEvent,
+                    stuff->shmseg,
+                    stuff->offset);
+            }
             return reply;
         }
 
@@ -354,7 +429,7 @@ _EvlogEventXextShm (EvlogInfo *evinfo, int first_base, char *reply, int *len)
 
 
 static char *
-_EvlogEventXextSync (EvlogInfo *evinfo, int first_base, char *reply, int *len)
+_EvlogEventXextSync (EvlogInfo *evinfo, int first_base, int detail_level, char *reply, int *len)
 {
     xEvent *evt = evinfo->evt.ptr;
 
@@ -370,6 +445,17 @@ _EvlogEventXextSync (EvlogInfo *evinfo, int first_base, char *reply, int *len)
                 stuff->counter_value_hi,
                 stuff->counter_value_lo);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY ("\n");
+                REPLY ("%67s sequence_num(%d) time(%lums) count(%d) destroyed(%s)",
+                    " ",
+                    stuff->sequenceNumber,
+                    stuff->time,
+                    stuff->count,
+                    stuff->destroyed ? "YES" : "NO");
+            }
+
             return reply;
         }
 
@@ -383,6 +469,16 @@ _EvlogEventXextSync (EvlogInfo *evinfo, int first_base, char *reply, int *len)
                 stuff->alarm_value_hi,
                 stuff->alarm_value_lo);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY ("\n");
+                REPLY ("%67s sequence_num(%d) time(%lums) state(%d)",
+                    " ",
+                    stuff->sequenceNumber,
+                    stuff->time,
+                    stuff->state);
+            }
+
             return reply;
         }
 
@@ -395,7 +491,7 @@ _EvlogEventXextSync (EvlogInfo *evinfo, int first_base, char *reply, int *len)
 
 
 static char *
-_EvlogEventXextXtestExt1 (EvlogInfo *evinfo, int first_base, char *reply, int *len)
+_EvlogEventXextXtestExt1 (EvlogInfo *evinfo, int first_base, int detail_level, char *reply, int *len)
 {
     xEvent *evt = evinfo->evt.ptr;
 
@@ -410,7 +506,7 @@ _EvlogEventXextXtestExt1 (EvlogInfo *evinfo, int first_base, char *reply, int *l
 }
 
 static char *
-_EvlogEventXextXtest (EvlogInfo *evinfo, int first_base, char *reply, int *len)
+_EvlogEventXextXtest (EvlogInfo *evinfo, int first_base, int detail_level, char *reply, int *len)
 {
     xEvent *evt = evinfo->evt.ptr;
 
@@ -426,7 +522,7 @@ _EvlogEventXextXtest (EvlogInfo *evinfo, int first_base, char *reply, int *len)
 
 
 static char *
-_EvlogReplyXextDpms (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogReplyXextDpms (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
     xGenericReply *rep = evinfo->rep.ptr;
 
@@ -437,10 +533,11 @@ _EvlogReplyXextDpms (EvlogInfo *evinfo, char *reply, int *len)
             if (evinfo->rep.isStart)
             {
                 xDPMSGetTimeoutsReply *stuff = (xDPMSGetTimeoutsReply *)rep;
-                REPLY (": Standby(%d) Suspend(%d) off(%d)",
+                REPLY (": Standby(%usec) Suspend(%usec) off(%usec) sequence_num(%d)",
                     stuff->standby,
                     stuff->suspend,
-                    stuff->off);
+                    stuff->off,
+                    stuff->sequenceNumber);
             }
             else
             {
@@ -458,7 +555,7 @@ _EvlogReplyXextDpms (EvlogInfo *evinfo, char *reply, int *len)
 }
 
 static char *
-_EvlogReplyXextShm (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogReplyXextShm (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
     xGenericReply *rep = evinfo->rep.ptr;
 
@@ -469,9 +566,10 @@ _EvlogReplyXextShm (EvlogInfo *evinfo, char *reply, int *len)
             if (evinfo->rep.isStart)
             {
                 xShmGetImageReply *stuff = (xShmGetImageReply *)rep;
-                REPLY (": Visual(0x%lx) size(%ld)",
+                REPLY (": Visual(0x%lx) size(%ld) sequence_num(%d)",
                     stuff->visual,
-                    stuff->size);
+                    stuff->size,
+                    stuff->sequenceNumber);
             }
             else
             {
@@ -489,7 +587,7 @@ _EvlogReplyXextShm (EvlogInfo *evinfo, char *reply, int *len)
 }
 
 static char *
-_EvlogReplyXextSync (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogReplyXextSync (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
     xGenericReply *rep = evinfo->rep.ptr;
 
@@ -500,9 +598,10 @@ _EvlogReplyXextSync (EvlogInfo *evinfo, char *reply, int *len)
             if (evinfo->rep.isStart)
             {
                 xSyncQueryCounterReply *stuff = (xSyncQueryCounterReply *)rep;
-                REPLY (": Value(0x%lx/0x%lx)",
+                REPLY (": Value(0x%lx/0x%lx) sequence_num(%d)",
                     stuff->value_hi,
-                    stuff->value_lo);
+                    stuff->value_lo,
+                    stuff->sequenceNumber);
             }
             else
             {
@@ -520,7 +619,7 @@ _EvlogReplyXextSync (EvlogInfo *evinfo, char *reply, int *len)
 }
 
 static char *
-_EvlogReplyXextXtestExt1 (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogReplyXextXtestExt1 (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
     xGenericReply *rep = evinfo->rep.ptr;
 
@@ -531,8 +630,9 @@ _EvlogReplyXextXtestExt1 (EvlogInfo *evinfo, char *reply, int *len)
             if (evinfo->rep.isStart)
             {
                 xTestQueryInputSizeReply *stuff = (xTestQueryInputSizeReply *)rep;
-                REPLY (": sizeReturn(0x%lx)",
-                    stuff->size_return);
+                REPLY (": sizeReturn(0x%lx) sequence_num(%d)",
+                    stuff->size_return,
+                    stuff->sequenceNumber);
             }
             else
             {
@@ -550,7 +650,7 @@ _EvlogReplyXextXtestExt1 (EvlogInfo *evinfo, char *reply, int *len)
 }
 
 static char *
-_EvlogReplyXextXtest (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogReplyXextXtest (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
     xGenericReply *rep = evinfo->rep.ptr;
 
@@ -561,8 +661,9 @@ _EvlogReplyXextXtest (EvlogInfo *evinfo, char *reply, int *len)
             if (evinfo->rep.isStart)
             {
                 xXTestGetVersionReply *stuff = (xXTestGetVersionReply *)rep;
-                REPLY (": MinorVersion(%d)",
-                    stuff->minorVersion);
+                REPLY (": MinorVersion(%d) sequence_num(%d)",
+                    stuff->minorVersion,
+                    stuff->sequenceNumber);
             }
             else
             {
index 4f59a89..df0313c 100644 (file)
@@ -63,7 +63,26 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "xdbg_evlog.h"
 
 static char *
-_EvlogRequestXinput (EvlogInfo *evinfo, char *reply, int *len)
+_getMode(CARD8 mode, char *reply, int *len)
+{
+    const char* buf;
+    char dbuf[10];
+
+    switch (mode)
+    {
+        case XIGrabModeSync:  buf = "XIGrabModeSync"; break;
+        case XIGrabModeAsync:  buf = "XIGrabModeAsync"; break;
+        case XIGrabModeTouch:  buf = "XIGrabModeTouch"; break;
+        default:  buf = dbuf; sprintf (dbuf, "%d", mode); break;
+    }
+
+    REPLY ("%s", buf);
+
+    return reply;
+}
+
+static char *
+_EvlogRequestXinput (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
     xReq *req = evinfo->req.ptr;
 
@@ -72,37 +91,77 @@ _EvlogRequestXinput (EvlogInfo *evinfo, char *reply, int *len)
     case X_GrabDevice:
         {
             xGrabDeviceReq *stuff = (xGrabDeviceReq *)req;
-            REPLY (": XID(0x%lx) Time(0x%lx) evtCnt(%d) thisMode(%d) otherMode(%d) devID(%d)",
+            REPLY (": XID(0x%lx) device_ID(%d)",
                 stuff->grabWindow,
-                stuff->time,
-                stuff->event_count,
-                stuff->this_device_mode,
-                stuff->other_devices_mode,
                 stuff->deviceid);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" this_dev_mode");
+                REPLY ("(");
+                reply = _getMode(stuff->this_device_mode, reply, len);
+                REPLY (")");
+
+                REPLY (" other_dev_mode");
+                REPLY ("(");
+                reply = _getMode(stuff->other_devices_mode, reply, len);
+                REPLY (")");
+
+                REPLY (" time(%lums) evt_cnt(%d)  owner_events(%s)",
+                    stuff->time,
+                    stuff->event_count,
+                    stuff->ownerEvents ? "YES" : "NO");
+            }
+
             return reply;
         }
 
     case X_UngrabDevice:
         {
             xUngrabDeviceReq *stuff = (xUngrabDeviceReq *)req;
-            REPLY (": Time(0x%lx) devID(%d)",
-                stuff->time,
+            REPLY (": device_ID(%d)",
                 stuff->deviceid);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" time(%lums)",
+                    stuff->time);
+            }
+
             return reply;
         }
 
     case X_GrabDeviceKey:
         {
             xGrabDeviceKeyReq *stuff = (xGrabDeviceKeyReq *)req;
-            REPLY (": XID(0x%lx) evtCnt(%d) modifiers(%d) modDev(%d) grabDev(%d) key(%d)",
-                stuff->grabWindow,
-                stuff->event_count,
-                stuff->modifiers,
-                stuff->modifier_device,
-                stuff->grabbed_device,
-                stuff->key);
+            REPLY (": XID(0x%lx)",
+                stuff->grabWindow);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" evt_cnt(%d) modifiers(%d) mod_dev(%d) grab_dev(%d) key(%d)",
+                    stuff->event_count,
+                    stuff->modifiers,
+                    stuff->modifier_device,
+                    stuff->grabbed_device,
+                    stuff->key);
+
+                REPLY ("\n");
+                REPLY ("%67s this_dev_mode",
+                    " ");
+
+                REPLY ("(");
+                reply = _getMode(stuff->this_device_mode, reply, len);
+                REPLY (")");
+
+                REPLY (" other_dev_mode");
+                REPLY ("(");
+                reply = _getMode(stuff->other_devices_mode, reply, len);
+                REPLY (")");
+
+                REPLY (" owner_events(%s)",
+                    stuff->ownerEvents ? "YES" : "NO");
+            }
 
             return reply;
         }
@@ -110,12 +169,17 @@ _EvlogRequestXinput (EvlogInfo *evinfo, char *reply, int *len)
     case X_UngrabDeviceKey:
         {
             xUngrabDeviceKeyReq *stuff = (xUngrabDeviceKeyReq *)req;
-            REPLY (": XID(0x%lx) modifiers(%d) modDev(%d) key(%d) grabDev(%d)",
-                stuff->grabWindow,
-                stuff->modifiers,
-                stuff->modifier_device,
-                stuff->key,
-                stuff->grabbed_device);
+            REPLY (": XID(0x%lx)",
+                stuff->grabWindow);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" modifiers(%d) mod_dev(%d) grab_dev(%d) key(%d)",
+                    stuff->modifiers,
+                    stuff->modifier_device,
+                    stuff->grabbed_device,
+                    stuff->key);
+            }
 
             return reply;
         }
@@ -123,13 +187,33 @@ _EvlogRequestXinput (EvlogInfo *evinfo, char *reply, int *len)
     case X_GrabDeviceButton:
         {
             xGrabDeviceButtonReq *stuff = (xGrabDeviceButtonReq *)req;
-            REPLY (": XID(0x%lx) evtCnt(%d) modifiers(%d) modDev(%d) grabDev(%d) button(%d)",
-                stuff->grabWindow,
-                stuff->event_count,
-                stuff->modifiers,
-                stuff->modifier_device,
-                stuff->grabbed_device,
-                stuff->button);
+            REPLY (": XID(0x%lx))",
+                stuff->grabWindow);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" grab_dev(%d) mod_dev(%d) evt_cnt(%d) modifiers(%d) button(%d)",
+                    stuff->grabbed_device,
+                    stuff->modifier_device,
+                    stuff->event_count,
+                    stuff->modifiers,
+                    stuff->button);
+
+                REPLY ("\n");
+                REPLY ("%67s this_dev_mode",
+                    " ");
+                REPLY ("(");
+                reply = _getMode(stuff->this_device_mode, reply, len);
+                REPLY (")");
+
+                REPLY (" other_dev_mode");
+                REPLY ("(");
+                reply = _getMode(stuff->other_devices_mode, reply, len);
+                REPLY (")");
+
+                REPLY (" owner_events(%s)",
+                    stuff->ownerEvents ? "YES" : "NO");
+            }
 
             return reply;
         }
@@ -137,12 +221,17 @@ _EvlogRequestXinput (EvlogInfo *evinfo, char *reply, int *len)
     case X_UngrabDeviceButton:
         {
             xUngrabDeviceButtonReq *stuff = (xUngrabDeviceButtonReq *)req;
-            REPLY (": XID(0x%lx) modifiers(%d) modDev(%d) grabDev(%d) button(%d)",
-                stuff->grabWindow,
-                stuff->modifiers,
-                stuff->modifier_device,
-                stuff->grabbed_device,
-                stuff->button);
+            REPLY (": XID(0x%lx)",
+                stuff->grabWindow);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" modifiers(%d) modDev(%d) grabDev(%d) button(%d)",
+                    stuff->modifiers,
+                    stuff->modifier_device,
+                    stuff->grabbed_device,
+                    stuff->button);
+            }
 
             return reply;
         }
@@ -150,10 +239,15 @@ _EvlogRequestXinput (EvlogInfo *evinfo, char *reply, int *len)
     case X_AllowDeviceEvents:
         {
             xAllowDeviceEventsReq *stuff = (xAllowDeviceEventsReq *)req;
-            REPLY (": Time(0x%lx) devID(%d) mode(%d)",
+            REPLY (": device_ID(%d)",
+                stuff->deviceid);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" time(%lums) mode(%d)",
                 stuff->time,
-                stuff->deviceid,
                 stuff->mode);
+            }
 
             return reply;
         }
@@ -170,12 +264,17 @@ _EvlogRequestXinput (EvlogInfo *evinfo, char *reply, int *len)
     case X_SetDeviceFocus:
         {
             xSetDeviceFocusReq *stuff = (xSetDeviceFocusReq *)req;
-            REPLY (": XID(0x%lx) Time(0x%lx) revertTo(%d) devID(%d)",
+            REPLY (": XID(0x%lx) dev_ID(%d)",
                 stuff->focus,
-                stuff->time,
-                stuff->revertTo,
                 stuff->device);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" time(%lums) revertTo(%d)",
+                stuff->time,
+                stuff->revertTo);
+            }
+
             return reply;
         }
 
@@ -192,7 +291,7 @@ _EvlogRequestXinput (EvlogInfo *evinfo, char *reply, int *len)
     case X_XIWarpPointer:
         {
             xXIWarpPointerReq *stuff = (xXIWarpPointerReq *)req;
-            REPLY (": srcWIN(0x%x) dstWin(0x%x) src(%d,%d %dx%d) dst(%d,%d) devID(%d)",
+            REPLY (": srcWIN(0x%x) dstWin(0x%x) src(%d,%d %dx%d) dst(%d,%d) device_ID(%d)",
                 stuff->src_win,
                 stuff->dst_win,
                 stuff->src_x,
@@ -229,7 +328,7 @@ _EvlogRequestXinput (EvlogInfo *evinfo, char *reply, int *len)
     case X_XISetClientPointer:
         {
             xXISetClientPointerReq *stuff = (xXISetClientPointerReq *)req;
-            REPLY (": XID(0x%x) devID(%d)",
+            REPLY (": XID(0x%x) device_ID(%d)",
                 stuff->win,
                 stuff->deviceid);
 
@@ -251,13 +350,19 @@ _EvlogRequestXinput (EvlogInfo *evinfo, char *reply, int *len)
             REPLY (": XID(0x%x)",
                 stuff->win);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" num_masks(%d)",
+                stuff->num_masks);
+            }
+
             return reply;
         }
 
     case X_XIQueryVersion:
         {
             xXIQueryVersionReq *stuff = (xXIQueryVersionReq *)req;
-            REPLY (": majorVesion(%d) minorVesion(%d)",
+            REPLY (": major_vesion(%d) minor_vesion(%d)",
                 stuff->major_version,
                 stuff->minor_version);
 
@@ -267,7 +372,7 @@ _EvlogRequestXinput (EvlogInfo *evinfo, char *reply, int *len)
     case X_XIQueryDevice:
         {
             xXIQueryDeviceReq *stuff = (xXIQueryDeviceReq *)req;
-            REPLY (": devID(%d)",
+            REPLY (": device_ID(%d)",
                 stuff->deviceid);
 
             return reply;
@@ -276,11 +381,16 @@ _EvlogRequestXinput (EvlogInfo *evinfo, char *reply, int *len)
     case X_XISetFocus:
         {
             xXISetFocusReq *stuff = (xXISetFocusReq *)req;
-            REPLY (": XID(0x%x) Time(0x%x) devID(%d)",
+            REPLY (": XID(0x%x) device_ID(%d)",
                 stuff->focus,
-                stuff->time,
                 stuff->deviceid);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" time(%ums)",
+                    stuff->time);
+            }
+
             return reply;
         }
 
@@ -296,34 +406,60 @@ _EvlogRequestXinput (EvlogInfo *evinfo, char *reply, int *len)
     case X_XIGrabDevice:
         {
             xXIGrabDeviceReq *stuff = (xXIGrabDeviceReq *)req;
-            REPLY (": XID(0x%x) Time(0x%x) Cursor(0x%x) grabMode(%d) pairDevMode(%d) devID(%d)",
+            REPLY (": XID(0x%x) Cursor(0x%x) device_ID(%d)",
                 stuff->grab_window,
-                stuff->time,
                 stuff->cursor,
-                stuff->grab_mode,
-                stuff->paired_device_mode,
                 stuff->deviceid);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY ("\n");
+                REPLY ("%67s grab_mode",
+                    " ");
+                REPLY ("(");
+                reply = _getMode(stuff->grab_mode, reply, len);
+                REPLY (")");
+
+                REPLY (" paired_device_mode");
+                REPLY ("(");
+                reply = _getMode(stuff->paired_device_mode, reply, len);
+                REPLY (")");
+
+                REPLY (" time(%ums) owner_events(%s)",
+                stuff->time,
+                stuff->owner_events ? "YES" : "NO");
+            }
+
             return reply;
         }
 
     case X_XIUngrabDevice:
         {
             xXIUngrabDeviceReq *stuff = (xXIUngrabDeviceReq *)req;
-            REPLY (": Time(0x%x) devID(%d)",
-                stuff->time,
+            REPLY (": devID(%d)",
                 stuff->deviceid);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" time(%ums)",
+                stuff->time);
+            }
+
             return reply;
         }
 
     case X_XIAllowEvents:
         {
             xXIAllowEventsReq *stuff = (xXIAllowEventsReq *)req;
-            REPLY (": Time(0x%x) devID(%d) mode(%d)",
+            REPLY (": devID(%d)",
+                stuff->deviceid);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" time(%ums) mode(%d)",
                 stuff->time,
-                stuff->deviceid,
                 stuff->mode);
+            }
 
             return reply;
         }
@@ -331,14 +467,49 @@ _EvlogRequestXinput (EvlogInfo *evinfo, char *reply, int *len)
     case X_XIPassiveGrabDevice:
         {
             xXIPassiveGrabDeviceReq *stuff = (xXIPassiveGrabDeviceReq *)req;
-            REPLY (": XID(0x%x) Time(0x%x) Cursor(0x%x) detail(0x%x) grabType(%d) grabMode(%d) pairDevMode(%d)",
+            REPLY (": XID(0x%x) Cursor(0x%x) device_ID(%d)",
                 stuff->grab_window,
-                stuff->time,
                 stuff->cursor,
+                stuff->deviceid);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char * type;
+                char dtype[10];
+
+                switch(stuff->grab_type)
+                {
+                    case XIGrabtypeButton:  type = "XIGrabtypeButton"; break;
+                    case XIGrabtypeKeycode:  type = "XIGrabtypeKeycode"; break;
+                    case XIGrabtypeEnter:  type = "XIGrabtypeEnter"; break;
+                    case XIGrabtypeFocusIn:  type = "XIGrabtypeFocusIn"; break;
+                    case XIGrabtypeTouchBegin:  type = "XIGrabtypeTouchBegin"; break;
+                    default:  type = dtype; sprintf (dtype, "%d", stuff->grab_type); break;
+                }
+
+                REPLY (" time(%ums) detail(%d) grab_type(%s)",
+                stuff->time,
                 stuff->detail,
-                stuff->grab_type,
-                stuff->grab_mode,
-                stuff->paired_device_mode);
+                type);
+
+                REPLY ("\n");
+                REPLY ("%67s", " ");
+
+                REPLY (" grab_mode");
+                REPLY ("(");
+                reply = _getMode(stuff->grab_mode, reply, len);
+                REPLY (")");
+
+                REPLY (" paired_device_mode");
+                REPLY ("(");
+                reply = _getMode(stuff->paired_device_mode, reply, len);
+                REPLY (")");
+
+                REPLY (" num_modifier(%d) owner_events(%s)",
+                    stuff->num_modifiers,
+                    stuff->owner_events ? "YES" : "NO");
+
+            }
 
             return reply;
         }
@@ -346,12 +517,31 @@ _EvlogRequestXinput (EvlogInfo *evinfo, char *reply, int *len)
     case X_XIPassiveUngrabDevice:
         {
             xXIPassiveUngrabDeviceReq *stuff = (xXIPassiveUngrabDeviceReq *)req;
-            REPLY (": XID(0x%x) detail(0x%x) grabType(%d) devID(%d)",
+            REPLY (": XID(0x%x) device_ID(%d)",
                 stuff->grab_window,
-                stuff->detail,
-                stuff->grab_type,
                 stuff->deviceid);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char * type;
+                char dtype[10];
+
+                switch(stuff->grab_type)
+                {
+                    case XIGrabtypeButton:  type = "XIGrabtypeButton"; break;
+                    case XIGrabtypeKeycode:  type = "XIGrabtypeKeycode"; break;
+                    case XIGrabtypeEnter:  type = "XIGrabtypeEnter"; break;
+                    case XIGrabtypeFocusIn:  type = "XIGrabtypeFocusIn"; break;
+                    case XIGrabtypeTouchBegin:  type = "XIGrabtypeTouchBegin"; break;
+                    default:  type = dtype; sprintf (dtype, "%d", stuff->grab_type); break;
+                }
+
+                REPLY (" detail(%d) grab_type(%s) num_modifiers(%d)",
+                stuff->detail,
+                type,
+                stuff->num_modifiers);
+            }
+
             return reply;
         }
 
@@ -367,17 +557,33 @@ _EvlogRequestXinput (EvlogInfo *evinfo, char *reply, int *len)
     case X_XIChangeProperty:
         {
             xXIChangePropertyReq *stuff = (xXIChangePropertyReq *)req;
-            REPLY (": devID(%d) mode(%d) format(%d) numItems(%d)",
-                stuff->deviceid,
-                stuff->mode,
-                stuff->format,
-                stuff->num_items);
+            REPLY (": devID(%d)",
+                stuff->deviceid);
 
             REPLY (" Property");
             reply = xDbgGetAtom(stuff->property, evinfo, reply, len);
             REPLY (" Type");
             reply = xDbgGetAtom(stuff->type, evinfo, reply, len);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char * mode;
+                char dmode[10];
+
+                switch(stuff->mode)
+                {
+                    case XIPropModeReplace:  mode = "XIPropModeReplace"; break;
+                    case XIPropModePrepend:  mode = "XIPropModePrepend"; break;
+                    case XIPropModeAppend:  mode = "XIPropModeAppend"; break;
+                    default:  mode = dmode; sprintf (dmode, "%d", stuff->mode); break;
+                }
+
+                REPLY (" mode(%s) format(%d) num_items(%d)",
+                mode,
+                stuff->format,
+                stuff->num_items);
+            }
+
             return reply;
         }
 
@@ -404,6 +610,14 @@ _EvlogRequestXinput (EvlogInfo *evinfo, char *reply, int *len)
             REPLY (" Type");
             reply = xDbgGetAtom(stuff->type, evinfo, reply, len);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" delete(%s) offset(%u) length(%u)",
+                stuff->delete ? "YES" : "NO",
+                stuff->offset,
+                stuff->len);
+            }
+
             return reply;
         }
 
@@ -424,7 +638,7 @@ _EvlogRequestXinput (EvlogInfo *evinfo, char *reply, int *len)
 }
 
 static char *
-_EvlogEventXinput (EvlogInfo *evinfo, int first_base, char *reply, int *len)
+_EvlogEventXinput (EvlogInfo *evinfo, int first_base, int detail_level, char *reply, int *len)
 {
     xEvent *evt = evinfo->evt.ptr;
 
@@ -433,70 +647,173 @@ _EvlogEventXinput (EvlogInfo *evinfo, int first_base, char *reply, int *len)
     case XI_DeviceValuator:
         {
             deviceValuator *stuff = (deviceValuator *) evt;
-            REPLY (": numValuator(%d) fstnumValuator(%d)",
+            REPLY (": device_ID(%d) numValuator(%d) fstnumValuator(%d)",
+                stuff->deviceid,
                 stuff->num_valuators,
                 stuff->first_valuator);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                int i;
+
+                REPLY (" sequence_num(%d) device_state(0x%x)\n",
+                    stuff->sequenceNumber,
+                    stuff->device_state);
+
+                REPLY ("%67s", " ");
+                for (i = 0 ; i < stuff->num_valuators ; i++)
+                {
+                    REPLY (" valuator%d(%ld)",
+                        i,
+                        *(&stuff->valuator0 + i));
+                }
+            }
+
             return reply;
         }
 
     case XI_DeviceKeyPress:
         {
             XDeviceKeyPressedEvent *stuff = (XDeviceKeyPressedEvent *) evt;
-            REPLY (": XID(0x%lx) Window(0x%lx) Root(0x%lx) subWindow(0x%lx)",
+            REPLY (": XID(0x%lx) Window(0x%lx %d,%d) Root(0x%lx %d,%d) subWindow(0x%lx)",
                 stuff->deviceid,
                 stuff->window,
+                stuff->x,
+                stuff->y,
                 stuff->root,
+                stuff->x_root,
+                stuff->y_root,
                 stuff->subwindow);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY ("\n");
+                REPLY ("%67s time(%lums) state(%d) key_code(%d) same_screen(%s) device_state(%d) first_axis(%d)",
+                    " ",
+                    stuff->time,
+                    stuff->state,
+                    stuff->keycode,
+                    stuff->same_screen ? "YES" : "NO",
+                    stuff->device_state,
+                    stuff->first_axis);
+            }
+
             return reply;
         }
 
     case XI_DeviceKeyRelease:
         {
             XDeviceKeyReleasedEvent *stuff = (XDeviceKeyReleasedEvent *) evt;
-            REPLY (": XID(0x%lx) Window(0x%lx) Root(0x%lx) subWindow(0x%lx)",
+            REPLY (": XID(0x%lx) Window(0x%lx %d,%d) Root(0x%lx %d,%d) subWindow(0x%lx)",
                 stuff->deviceid,
                 stuff->window,
+                stuff->x,
+                stuff->y,
                 stuff->root,
+                stuff->x_root,
+                stuff->y_root,
                 stuff->subwindow);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY ("\n");
+                REPLY ("%67s time(%lums) state(%d) key_code(%d) same_screen(%s) device_state(%d) first_axis(%d)",
+                    " ",
+                    stuff->time,
+                    stuff->state,
+                    stuff->keycode,
+                    stuff->same_screen ? "YES" : "NO",
+                    stuff->device_state,
+                    stuff->first_axis);
+            }
+
             return reply;
         }
 
     case XI_DeviceButtonPress:
         {
             XDeviceButtonPressedEvent *stuff = (XDeviceButtonPressedEvent *) evt;
-            REPLY (": XID(0x%lx) Window(0x%lx) Root(0x%lx) subWindow(0x%lx)",
+            REPLY (": XID(0x%lx) Window(0x%lx %d,%d) Root(0x%lx %d,%d) subWindow(0x%lx)",
                 stuff->deviceid,
                 stuff->window,
+                stuff->x,
+                stuff->y,
                 stuff->root,
+                stuff->x_root,
+                stuff->y_root,
                 stuff->subwindow);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY ("\n");
+                REPLY ("%67s time(%lums) state(%d) button(%d) same_screen(%s) device_state(%d) first_axis(%d)",
+                    " ",
+                    stuff->time,
+                    stuff->state,
+                    stuff->button,
+                    stuff->same_screen ? "YES" : "NO",
+                    stuff->device_state,
+                    stuff->first_axis);
+            }
+
             return reply;
         }
 
     case XI_DeviceButtonRelease:
         {
             XDeviceButtonReleasedEvent *stuff = (XDeviceButtonReleasedEvent *) evt;
-            REPLY (": XID(0x%lx) Window(0x%lx) Root(0x%lx) subWindow(0x%lx)",
+            REPLY (": XID(0x%lx) Window(0x%lx %d,%d) Root(0x%lx %d,%d) subWindow(0x%lx)",
                 stuff->deviceid,
                 stuff->window,
+                stuff->x,
+                stuff->y,
                 stuff->root,
+                stuff->x_root,
+                stuff->y_root,
                 stuff->subwindow);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY ("\n");
+                REPLY ("%67s time(%lums) state(%d) button(%d) same_screen(%s) device_state(%d) first_axis(%d)",
+                    " ",
+                    stuff->time,
+                    stuff->state,
+                    stuff->button,
+                    stuff->same_screen ? "YES" : "NO",
+                    stuff->device_state,
+                    stuff->first_axis);
+            }
+
             return reply;
         }
 
     case XI_DeviceMotionNotify:
         {
             XDeviceMotionEvent *stuff = (XDeviceMotionEvent *) evt;
-            REPLY (": XID(0x%lx) Window(0x%lx) Root(0x%lx) subWindow(0x%lx)",
+            REPLY (": XID(0x%lx) Window(0x%lx %d,%d) Root(0x%lx %d,%d) subWindow(0x%lx)",
                 stuff->deviceid,
                 stuff->window,
+                stuff->x,
+                stuff->y,
                 stuff->root,
+                stuff->x_root,
+                stuff->y_root,
                 stuff->subwindow);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY ("\n");
+                REPLY ("%67s time(%lums) state(%d) is_hint(%d) same_screen(%s) device_state(%d) first_axis(%d)",
+                    " ",
+                    stuff->time,
+                    stuff->state,
+                    stuff->is_hint,
+                    stuff->same_screen ? "YES" : "NO",
+                    stuff->device_state,
+                    stuff->first_axis);
+            }
+
             return reply;
         }
 
@@ -507,6 +824,39 @@ _EvlogEventXinput (EvlogInfo *evinfo, int first_base, char *reply, int *len)
                 stuff->deviceid,
                 stuff->window);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *mode, *detail;
+                char dmode[10], ddetail[10];
+
+                switch(stuff->mode)
+                {
+                    case NotifyNormal:  mode = "NotifyNormal"; break;
+                    case NotifyGrab:  mode = "NotifyGrab"; break;
+                    case NotifyUngrab:  mode = "NotifyUngrab"; break;
+                    case NotifyWhileGrabbed:  mode = "NotifyWhileGrabbed"; break;
+                    default:  mode = dmode; sprintf (dmode, "%d", stuff->mode); break;
+                }
+
+                switch(stuff->detail)
+                {
+                    case NotifyAncestor:  detail = "NotifyAncestor"; break;
+                    case NotifyVirtual:  detail = "NotifyVirtual"; break;
+                    case NotifyInferior:  detail = "NotifyInferior"; break;
+                    case NotifyNonlinear:  detail = "NotifyNonlinear"; break;
+                    case NotifyNonlinearVirtual:  detail = "NotifyNonlinearVirtual"; break;
+                    case NotifyPointer:  detail = "NotifyPointer"; break;
+                    case NotifyPointerRoot:  detail = "NotifyPointerRoot"; break;
+                    case NotifyDetailNone:  detail = "NotifyDetailNone"; break;
+                    default:  detail = ddetail; sprintf (ddetail, "%d", stuff->detail); break;
+                }
+
+                REPLY (" mode(%s) detail(%s) time(%lums)",
+                    mode,
+                    detail,
+                    stuff->time);
+            }
+
             return reply;
         }
 
@@ -517,30 +867,95 @@ _EvlogEventXinput (EvlogInfo *evinfo, int first_base, char *reply, int *len)
                 stuff->deviceid,
                 stuff->window);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *mode, *detail;
+                char dmode[10], ddetail[10];
+
+                switch(stuff->mode)
+                {
+                    case NotifyNormal:  mode = "NotifyNormal"; break;
+                    case NotifyGrab:  mode = "NotifyGrab"; break;
+                    case NotifyUngrab:  mode = "NotifyUngrab"; break;
+                    case NotifyWhileGrabbed:  mode = "NotifyWhileGrabbed"; break;
+                    default:  mode = dmode; sprintf (dmode, "%d", stuff->mode); break;
+                }
+
+                switch(stuff->detail)
+                {
+                    case NotifyAncestor:  detail = "NotifyAncestor"; break;
+                    case NotifyVirtual:  detail = "NotifyVirtual"; break;
+                    case NotifyInferior:  detail = "NotifyInferior"; break;
+                    case NotifyNonlinear:  detail = "NotifyNonlinear"; break;
+                    case NotifyNonlinearVirtual:  detail = "NotifyNonlinearVirtual"; break;
+                    case NotifyPointer:  detail = "NotifyPointer"; break;
+                    case NotifyPointerRoot:  detail = "NotifyPointerRoot"; break;
+                    case NotifyDetailNone:  detail = "NotifyDetailNone"; break;
+                    default:  detail = ddetail; sprintf (ddetail, "%d", stuff->detail); break;
+                }
+
+                REPLY (" mode(%s) detail(%s) time(%lums)",
+                    mode,
+                    detail,
+                    stuff->time);
+            }
+
             return reply;
         }
 
     case XI_ProximityIn:
         {
             XProximityInEvent *stuff = (XProximityInEvent *) evt;
-            REPLY (": XID(0x%lx) Window(0x%lx) Root(0x%lx) subWindow(0x%lx)",
+            REPLY (": XID(0x%lx) Window(0x%lx %d,%d) Root(0x%lx %d,%d) subWindow(0x%lx)",
                 stuff->deviceid,
                 stuff->window,
+                stuff->x,
+                stuff->y,
                 stuff->root,
+                stuff->x_root,
+                stuff->y_root,
                 stuff->subwindow);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY ("\n");
+                REPLY ("%67s time(%lums) state(%d) same_screen(%s) device_state(%d) first_axis(%d)",
+                    " ",
+                    stuff->time,
+                    stuff->state,
+                    stuff->same_screen ? "YES" : "NO",
+                    stuff->device_state,
+                    stuff->first_axis);
+            }
+
             return reply;
         }
 
     case XI_ProximityOut:
         {
             XProximityOutEvent *stuff = (XProximityOutEvent *) evt;
-            REPLY (": XID(0x%lx) Window(0x%lx) Root(0x%lx) subWindow(0x%lx)",
+            REPLY (": XID(0x%lx) Window(0x%lx %d,%d) Root(0x%lx %d,%d) subWindow(0x%lx)",
                 stuff->deviceid,
                 stuff->window,
+                stuff->x,
+                stuff->y,
                 stuff->root,
+                stuff->x_root,
+                stuff->y_root,
                 stuff->subwindow);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY ("\n");
+                REPLY ("%67s time(%lums) state(%d) same_screen(%s) device_state(%d) first_axis(%d)",
+                    " ",
+                    stuff->time,
+                    stuff->state,
+                    stuff->same_screen ? "YES" : "NO",
+                    stuff->device_state,
+                    stuff->first_axis);
+            }
+
             return reply;
         }
 
@@ -551,6 +966,13 @@ _EvlogEventXinput (EvlogInfo *evinfo, int first_base, char *reply, int *len)
                 stuff->deviceid,
                 stuff->window);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" time(%lums) num_classes(%d)",
+                    stuff->time,
+                    stuff->num_classes);
+            }
+
             return reply;
         }
 
@@ -561,6 +983,26 @@ _EvlogEventXinput (EvlogInfo *evinfo, int first_base, char *reply, int *len)
                 stuff->deviceid,
                 stuff->window);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *request;
+                char drequest[10];
+
+                switch(stuff->request)
+                {
+                    case MappingModifier:  request = "MappingModifier"; break;
+                    case MappingKeyboard:  request = "MappingKeyboard"; break;
+                    case MappingPointer:  request = "MappingPointer"; break;
+                    default:  request = drequest; sprintf (drequest, "%d", stuff->request); break;
+                }
+
+                REPLY (" time(%lums) request(%s) first_keycode(%d) count(%d)",
+                    stuff->time,
+                    request,
+                    stuff->first_keycode,
+                    stuff->count);
+            }
+
             return reply;
         }
 
@@ -571,6 +1013,23 @@ _EvlogEventXinput (EvlogInfo *evinfo, int first_base, char *reply, int *len)
                 stuff->deviceid,
                 stuff->window);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                const char *request;
+                char drequest[10];
+
+                switch(stuff->request)
+                {
+                    case NewPointer:  request = "NewPointer"; break;
+                    case NewKeyboard:  request = "NewKeyboard"; break;
+                    default:  request = drequest; sprintf (drequest, "%d", stuff->request); break;
+                }
+
+                REPLY (" time(%lums) request(%s)",
+                    stuff->time,
+                    request);
+            }
+
             return reply;
         }
 
@@ -580,6 +1039,12 @@ _EvlogEventXinput (EvlogInfo *evinfo, int first_base, char *reply, int *len)
             REPLY (": deviceid(%d)",
                 stuff->deviceid);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" sequence_num(%d)",
+                    stuff->sequenceNumber);
+            }
+
             return reply;
         }
 
@@ -589,6 +1054,12 @@ _EvlogEventXinput (EvlogInfo *evinfo, int first_base, char *reply, int *len)
             REPLY (": deviceid(%d)",
                 stuff->deviceid);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" sequence_num(%d)",
+                    stuff->sequenceNumber);
+            }
+
             return reply;
         }
 
@@ -598,6 +1069,15 @@ _EvlogEventXinput (EvlogInfo *evinfo, int first_base, char *reply, int *len)
             REPLY (": deviceid(%d)",
                 stuff->deviceid);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" time(%lums) device_change(%d) control(%d) sequence_num(%d)",
+                    stuff->time,
+                    stuff->devchange,
+                    stuff->control,
+                    stuff->sequenceNumber);
+            }
+
             return reply;
         }
 
@@ -610,6 +1090,14 @@ _EvlogEventXinput (EvlogInfo *evinfo, int first_base, char *reply, int *len)
             REPLY (" Atom");
             reply = xDbgGetAtom(stuff->atom, evinfo, reply, len);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" time(%lums) state(%d) sequence_num(%d)",
+                    stuff->time,
+                    stuff->state,
+                    stuff->sequenceNumber);
+            }
+
             return reply;
         }
 
@@ -621,7 +1109,7 @@ _EvlogEventXinput (EvlogInfo *evinfo, int first_base, char *reply, int *len)
 }
 
 static char *
-_EvlogReplyXinput (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogReplyXinput (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
     xGenericReply *rep = evinfo->rep.ptr;
 
index 44332a6..d68b7d4 100644 (file)
@@ -61,7 +61,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "xdbg_evlog.h"
 
 static char *
-_EvlogRequestXv(EvlogInfo *evinfo, char *reply, int *len)
+_EvlogRequestXv(EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
     xReq *req = evinfo->req.ptr;
 
@@ -73,6 +73,12 @@ _EvlogRequestXv(EvlogInfo *evinfo, char *reply, int *len)
             REPLY (": XID(0x%lx)",
                 stuff->port);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" time(%lums)",
+                    stuff->time);
+            }
+
             return reply;
         }
 
@@ -82,6 +88,12 @@ _EvlogRequestXv(EvlogInfo *evinfo, char *reply, int *len)
             REPLY (": XID(0x%lx)",
                 stuff->port);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" time(%lums)",
+                    stuff->time);
+            }
+
             return reply;
         }
 
@@ -174,9 +186,14 @@ _EvlogRequestXv(EvlogInfo *evinfo, char *reply, int *len)
     case xv_SelectVideoNotify:
         {
             xvSelectVideoNotifyReq *stuff = (xvSelectVideoNotifyReq *)req;
-            REPLY (": XID(0x%lx) On/Off(%d)",
-                stuff->drawable,
-                stuff->onoff);
+            REPLY (": XID(0x%lx)",
+                stuff->drawable);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY ("  On/Off(%s)",
+                    stuff->onoff ? "ON" : "OFF");
+            }
 
             return reply;
         }
@@ -184,9 +201,14 @@ _EvlogRequestXv(EvlogInfo *evinfo, char *reply, int *len)
     case xv_SelectPortNotify:
         {
             xvSelectPortNotifyReq *stuff = (xvSelectPortNotifyReq *)req;
-            REPLY (": XID(0x%lx) On/Off(%d)",
-                stuff->port,
-                stuff->onoff);
+            REPLY (": XID(0x%lx)",
+                stuff->port);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY ("  On/Off(%s)",
+                    stuff->onoff ? "ON" : "OFF");
+            }
 
             return reply;
         }
@@ -201,19 +223,30 @@ _EvlogRequestXv(EvlogInfo *evinfo, char *reply, int *len)
                 stuff->drw_w,
                 stuff->drw_h);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY ("  motion(%d)",
+                    stuff->motion);
+            }
+
             return reply;
         }
 
     case xv_SetPortAttribute:
         {
             xvSetPortAttributeReq *stuff = (xvSetPortAttributeReq *)req;
-            REPLY (": XID(0x%lx) value(%ld)",
-                stuff->port,
-                stuff->value);
+            REPLY (": XID(0x%lx) ",
+                stuff->port);
 
             REPLY (" Attribute");
             reply = xDbgGetAtom(stuff->attribute, evinfo, reply, len);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY ("  value(%ld)",
+                    stuff->value);
+            }
+
             return reply;
         }
 
@@ -254,7 +287,7 @@ _EvlogRequestXv(EvlogInfo *evinfo, char *reply, int *len)
     case xv_ShmPutImage:
         {
             xvShmPutImageReq *stuff = (xvShmPutImageReq *)req;
-            REPLY (": XID(0x%lx) Drawable(0x%lx) GC(0x%lx) ID(%lx) buf(%dx%d) src(%d,%d %dx%d) drw(%d,%d %dx%d) sendevent(%d)",
+            REPLY (": XID(0x%lx) Drawable(0x%lx) GC(0x%lx) ID(%lx) buf(%dx%d) src(%d,%d %dx%d) drw(%d,%d %dx%d)",
                 stuff->port,
                 stuff->drawable,
                 stuff->gc,
@@ -268,8 +301,17 @@ _EvlogRequestXv(EvlogInfo *evinfo, char *reply, int *len)
                 stuff->drw_x,
                 stuff->drw_y,
                 stuff->drw_w,
-                stuff->drw_h,
-                stuff->send_event);
+                stuff->drw_h);
+
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY ("\n");
+                REPLY ("%67s shmseg(0x%lx) offset(%ld) send_event(%s)",
+                    " ",
+                    stuff->shmseg,
+                    stuff->offset,
+                    stuff->send_event ? "YES" : "NO");
+            }
 
             return reply;
         }
@@ -282,7 +324,7 @@ _EvlogRequestXv(EvlogInfo *evinfo, char *reply, int *len)
 }
 
 static char *
-_EvlogEventXv (EvlogInfo *evinfo, int first_base, char *reply, int *len)
+_EvlogEventXv (EvlogInfo *evinfo, int first_base, int detail_level, char *reply, int *len)
 {
     xEvent *evt = evinfo->evt.ptr;
 
@@ -291,11 +333,18 @@ _EvlogEventXv (EvlogInfo *evinfo, int first_base, char *reply, int *len)
     case XvVideoNotify:
         {
             XvVideoNotifyEvent *stuff = (XvVideoNotifyEvent *) evt;
-            REPLY (": XID(0x%lx) reason(%ld) portID(0x%lx)",
+            REPLY (": XID(0x%lx) portID(0x%lx)",
                 stuff->drawable,
-                stuff->reason,
                 stuff->port_id);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" serial(%lu) reason(%lu) time(%lums)",
+                    stuff->serial,
+                    stuff->reason,
+                    stuff->time);
+            }
+
             return reply;
         }
 
@@ -309,6 +358,14 @@ _EvlogEventXv (EvlogInfo *evinfo, int first_base, char *reply, int *len)
             REPLY (" Attribute");
             reply = xDbgGetAtom(stuff->attribute, evinfo, reply, len);
 
+            if (detail_level >= EVLOG_PRINT_DETAIL)
+            {
+                REPLY (" serial(%lu) value(%ld) time(%lums)",
+                    stuff->serial,
+                    stuff->value,
+                    stuff->time);
+            }
+
             return reply;
         }
 
@@ -320,7 +377,7 @@ _EvlogEventXv (EvlogInfo *evinfo, int first_base, char *reply, int *len)
 }
 
 static char *
-_EvlogReplyXv (EvlogInfo *evinfo, char *reply, int *len)
+_EvlogReplyXv (EvlogInfo *evinfo, int detail_level, char *reply, int *len)
 {
     xGenericReply *rep = evinfo->rep.ptr;
 
index 3caa4da..6c6749f 100644 (file)
@@ -90,6 +90,10 @@ typedef enum
 #define EVLOG_MASK_ATOM      (1<<5)
 #define EVLOG_MASK_REGION    (1<<6)
 
+#define EVLOG_PRINT_DEFAULT           0
+#define EVLOG_PRINT_DETAIL            1
+#define EVLOG_PRINT_REPLY_DETAIL      2
+
 
 typedef struct _EvlogTable
 {
@@ -173,9 +177,9 @@ struct _ExtensionInfo
     int     opcode;
     int     evt_base;
     int     err_base;
-    char* (*req_func) (EvlogInfo *evinfo, char *reply, int *len);
-    char* (*evt_func) (EvlogInfo *evinfo, int first_base, char *reply, int *len);
-    char* (*rep_func) (EvlogInfo *evinfo, char *reply, int *len);
+    char* (*req_func) (EvlogInfo *evinfo, int detail_level, char *reply, int *len);
+    char* (*evt_func) (EvlogInfo *evinfo, int first_base, int detail_level, char *reply, int *len);
+    char* (*rep_func) (EvlogInfo *evinfo, int detail_level, char *reply, int *len);
 };
 
 #endif
index 355d7f3..5589eab 100644 (file)
@@ -178,6 +178,12 @@ xDbgLogEnableDlog (Bool enable)
     dlog_enable = (enable > 0) ? TRUE:FALSE;
 }
 
+API Bool
+xDbgGetLogEnableDlog ()
+{
+    return dlog_enable;
+}
+
 API void*
 xDbgLog (unsigned int module, int logoption, const char * file, int line, const char * f, ...)
 {
index 869ba7a..5cf4668 100644 (file)
@@ -41,7 +41,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include <os.h>
 #include <dlog.h>
 
+
 unsigned int xDbgLogGetModule (char *name);
+Bool         xDbgGetLogEnableDlog ();
 
 #define _C(b,s)             (((b) >> (s)) & 0xFF)
 #define _B(c,s)             ((((unsigned int)(c)) & 0xff) << (s))
index c915b36..7dece09 100644 (file)
@@ -59,7 +59,7 @@ _CommandDLog (int pid, int argc, char **argv, char *reply, int *len, XDbgModule
 
     if (argc != 3)
     {
-        XDBG_REPLY ("Error : too few arguments\n");
+        XDBG_REPLY ("DLog level: %d\n", xDbgGetLogEnableDlog() ? 1 : 0);
         return;
     }
 
@@ -196,10 +196,11 @@ static void
 _CommandEvlog (int pid, int argc, char **argv, char *reply, int *len, XDbgModule *pMod)
 {
     int on;
+    extern Bool xev_trace_on;
 
     if (argc != 3)
     {
-        XDBG_REPLY ("Error : too few arguments\n");
+        XDBG_REPLY ("Evlog level: %d\n", xev_trace_on ? 1 : 0);
         return;
     }
 
@@ -211,6 +212,24 @@ _CommandEvlog (int pid, int argc, char **argv, char *reply, int *len, XDbgModule
 }
 
 static void
+_CommandEvlogDetail (int pid, int argc, char **argv, char *reply, int *len, XDbgModule *pMod)
+{
+    int level;
+    extern int xev_trace_detail_level;
+
+    if (argc != 3)
+    {
+        XDBG_REPLY ("Detail Level: %d\n", xev_trace_detail_level);
+        return;
+    }
+
+    level = atoi(argv[2]);
+
+    xDbgModuleEvlogDetail (pMod, level, reply, len);
+    XDBG_REPLY ("Success\n");
+}
+
+static void
 _CommandSetEvlogRule (int pid, int argc, char **argv, char *reply, int *len, XDbgModule *pMod)
 {
     if (argc < 2)
@@ -338,6 +357,12 @@ static struct
     },
 
     {
+        "evlog_detail", "to set printing detail log level", "[0-2]",
+        NULL, "[Primary logs:0/ More detail logs:1/ Supplementary Reply logs:2]",
+        _CommandEvlogDetail
+    },
+
+    {
         "evlog_rule", "to set evlog rules", "[add/remove/print]",
         NULL, "[add allow/deny rules / remove (index) / print]",
         _CommandSetEvlogRule
index 987da82..2558391 100644 (file)
@@ -69,7 +69,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #define FP1616toDBL(x) ((x) * 1.0 / (1 << 16))
 
-static Bool    xev_trace_on = FALSE;
+Bool       xev_trace_on = FALSE;
+int         xev_trace_detail_level = EVLOG_PRINT_DEFAULT;
 static int  xev_trace_fd = -1;
 static int  xev_trace_record_fd = -1;
 static Atom atom_rotate = None;
@@ -384,16 +385,16 @@ static void evtPrint (EvlogType type, ClientPtr client, xEvent *ev, ReplyInfoRec
 
     if (xev_trace_record_fd >= 0)
     {
-        xDbgEvlogFillLog (&evinfo, TRUE, NULL, NULL);
-        evtRecord (xev_trace_record_fd, &evinfo);
+        if (xDbgEvlogFillLog (&evinfo, EVLOG_PRINT_REPLY_DETAIL, NULL, NULL))
+            evtRecord (xev_trace_record_fd, &evinfo);
     }
     else
     {
         char log[1024];
         int size = sizeof (log);
 
-        xDbgEvlogFillLog (&evinfo, TRUE, log, &size);
-        evtPrintF (xev_trace_fd, &evinfo, log);
+        if (xDbgEvlogFillLog (&evinfo, xev_trace_detail_level, log, &size))
+            evtPrintF (xev_trace_fd, &evinfo, log);
     }
 
     /* evatom initialize */
@@ -734,6 +735,12 @@ xDbgModuleEvlogPrintEvents (XDbgModule *pMod, Bool on, const char * client_name,
     return;
 }
 
+void
+xDbgModuleEvlogDetail (XDbgModule *pMod, int level, char *reply, int *len)
+{
+    xev_trace_detail_level = level;
+}
+
 int
 xDbgModuleEvlogInfoSetRule (XDbgModule *pMod, const int argc, const char ** argv, char *reply, int *len)
 {
index 7e19f60..8e94aca 100644 (file)
@@ -38,6 +38,7 @@ Bool    xDbgModuleEvlogInstallHooks   (XDbgModule *pMod);
 void    xDbgModuleEvlogUninstallHooks (XDbgModule *pMod);
 
 void    xDbgModuleEvlogPrintEvents (XDbgModule *pMod, Bool on, const char * client_name, char *reply, int *len);
+void    xDbgModuleEvlogDetail (XDbgModule *pMod, int level, char *reply, int *len);
 int     xDbgModuleEvlogInfoSetRule (XDbgModule *pMod, const int argc, const char ** argv, char *reply, int *len);
 
 Bool    xDbgModuleEvlogSetEvlogPath  (XDbgModule *pMod, int pid, char *path, char *reply, int *len);