info-xnee
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Info-xnee] Help to adapt cnee for logging more events !!


From: sridhar
Subject: [Info-xnee] Help to adapt cnee for logging more events !!
Date: Thu, 24 Apr 2008 14:47:48 +0530


 


Hello  ,
i got struck in middle of my work,
i need the log format for the events in the following way ,
i hope you will help me in this,

i need the log format should be in the following way ,

windowid, time, event type(key/mouse/....etc) , event value(key typevalue/left or right or middle mouse button) , requestid, responseid  ...

so where should i need to change the cnee to meet my need,
exactly iam not aware of
GPLv3 license.





On Tue, Apr 15, 2008 at 11:13 AM, Henrik Sandklef <address@hidden> wrote:
sridhar skrev:
> *you are very helpful thanks alot , now iam clear about cnee...very very
> thanks
> *
> one more thing, so cnee does not store any window ids,

well, actually Xnee does. But only in one case. If a window is placed in
a different position when replaying than when recording Xnee uses the
window id to move the window to the correct position (which is the
position as when recorded). Xnee treats reparent-notifications in a
special way and stores window id to achieve the above.

> actually my requirement is to log  what are the events from a particular
> window to xserver, can you tell any tools to work out in this way , or cnee
> can do this..???

You can modify Xnee. Look at the file:

 libxnee/src/xnee_record.c

and the function:

 xnee_record_handle_event_printer

and the switch/case:

   case ReparentNotify:
     new_window_pos = xnee_get_new_window_pos(xd);

     if (new_window_pos!=0)
       {
         fprintf (out,"0,%u,0,0,0,0,0,%lu\n",
                  event_type,
                  xrecintd->server_time );
       }
     XGetWindowAttributes(xd->grab,
                          xrec_data->event.u.reparent.window,
                          &window_attributes_return);

     XTranslateCoordinates (xd->grab,
                            xrec_data->event.u.reparent.window,
                            window_attributes_return.root,
                            -window_attributes_return.border_width,
                            -window_attributes_return.border_width,
                            &rx,
                            &ry,
                            &dummy_window);

     /*
      * Prevent the same window pos to be printed more than once
      */
     if ( (last_record_window_pos_win !=
           xrec_data->event.u.reparent.window) ||
          (last_record_window_pos_par !=
           xrec_data->event.u.reparent.parent) )
       {

         XFlush(xd->grab);
         if (!XFetchName(xd->grab, xrec_data->event.u.reparent.window,
&win_name))
           { /* Get window name if any */
             xnee_verbose((xd," window has has no name\n"));
             win_name=NULL;
           }
         else if (win_name)
           {
             xnee_verbose((xd," window has has name '%s'\n", win_name));
           }
         fprintf (out,
                  "%s:%d,%d:%d,%d,%d,%d,%d,%d:%dx%d+%d+%d:%d,%d:%s\n",
                  XNEE_NEW_WINDOW_MARK,
                  rx,
                  ry,
                  xrec_data->event.u.reparent.event,
                  xrec_data->event.u.reparent.window,
                  xrec_data->event.u.reparent.parent,
                  xrec_data->event.u.reparent.x,
                  xrec_data->event.u.reparent.y,
                  xrec_data->event.u.reparent.override,
                  window_attributes_return.x,
                  window_attributes_return.y,
                  window_attributes_return.width,
                  window_attributes_return.height,
                  window_attributes_return.border_width,
                  window_attributes_return.border_width,
                  win_name?win_name:""
                  );
         if (win_name)
           {
             xnee_verbose((xd," freeing window name\n"));
             XFree(win_name);
           }
         last_record_window_pos_win =
           xrec_data->event.u.reparent.window;
         last_record_window_pos_par =
           xrec_data->event.u.reparent.parent;
       }


you can probably use this code and modify it to get the win id for every
event. Will it consume a lot of CPU? You are aware the GPLv3 license
aren't you?


>
>
>
> On Mon, Apr 14, 2008 at 10:43 PM, Henrik Sandklef <address@hidden> wrote:
>
>> sridhar skrev:
>>> hi..friend,
>>> im sorry to ask repeatedly the silly things about cnee,
>>> iam a novice, just please help me,
>>> my requirement is to analyze the events to and from xserver,
>>> * as cnee is recording events, in the output till now iam not
>>> exactly knowing what each value represent,  does it stores about the
>> window
>>> id, on which a particular event has occurred, or is there any other tool
>> to
>>> analyze.
>>> ----------------------
>>> the following is the output fragment of  cnee
>>> using the following options
>>>
>>> cnee -o output1.xnr --record --device-event-range 2-6
>>> --delivered-event-range 7-31 --request-range 1-119 --verbose
>>> ##### my question what each value represents
>>> there are seven values in each line, what 1 stands for, 54 stands
>> for...and
>>> the others too..
>>> does it stores window ids too....
>> uh oh, it's clearly me who's not reading the manual. Sorry!!!!
>>
>> Looking at the sources at:
>>   libxnee/src/print.c
>> at the function:
>>   xnee_record_print_request
>> you can see what's printed
>>
>>> ****************
>>> 1,54,54,2,54540671,1304748143
>> so, let's do this together:
>>
>> 1   is type, in this case: request
>> 54  what request, in this case: 54
>> 54  the length (think size)
>> 54540671   request id
>> 1304748143  server time
>>
>>
>>> 1,59,59,5,54540651,1304748143
>>> 1,53,53,4,54540674,1304748143
>>> 1,55,55,5,54540675,1304748143
>>> 1,72,72,19,54540674,1304748143
>> and so forth
>>
>>
>>
>> Thanks for requesting an answer, instead of my rtfm. You found a bug.
>> It's now fixed in CVS (HEAD).
>>
>>> ******************
>>>
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Info-xnee mailing list
>>> address@hidden
>>> http://lists.gnu.org/mailman/listinfo/info-xnee
>>
>
>




 


--
SrIDhAr M.tech(AI)
Univ of Hyderabad
------------------------------------------------
Life is pleasant. Death is peaceful. It's the transition that's troublesome.
---------------------------------
reply via email to

[Prev in Thread] Current Thread [Next in Thread]