From lechner@cs.uml.edu Fri Mar 3 18:44:07 2006 From: Bob Lechner Subject: X11-specific event-related symbols in bde/src/nodeops.cc To: lechner@cs.uml.edu (Bob Lechner) Cc: sfrye@cs.uml.edu (Scot Frye), ralmonte@cs.uml.edu (Almonte) RJLRef: PH/06s524/bdeEventWrappers060303.txt In nodeops.cc (and quite probably other *ops.cc files, state actions depend on switch(button_op) which is an X11 button event. Inside these actions the only X-related symbol is the Xevent pointer. This cold easily be replaced by a generic event ptr if the Xevent was mapped to that one. The place for this would be inside the callback function buttonevent for XtDispatchEvent inside the X11 main loop: init.cc:901: PASS = XtDispatchEvent(&event); // process one event The callback for this inside canvas is dobuttonevent(): init.cc:69*: XtAddEventHandler(canvas, Button*Mask, FALSE, dobuttonevent, buttonevent.cc:188:void dobuttonevent(Widget w, XtPointer c, XEvent *xevent, Boolean *) buttonevent.cc:451:LP;} // end dobuttonevent ----------------------- What event type SHOULD be passed to *ops.cc actions? One candidate is the fox set of mouse event types (whatever that is). Another candidate is suggested by the bdeEvent logging project, ohich logs X11 mouse events and possibly others. That project did not alter the event ptyr arg to *ops.cc. However, it did copy event info to an LCP EventInstance object, which would be logged automatically since EI is a table in the LCP StateModel.sch schema. i This EI structure is exactly what an LCP/SM-driven control flow model expects in ops.cc, so it would be convenient to use or adapt this model in *ops.cc state actions as one a priori refactoring step toward LCP control in bde editing operations. ------------------ References to Event Logging project: THis points to it (but is focused on Hominid replay and bdeState logging not X11 events) $PH/05s523/05s523bdeStateX11EventLogProjectInfo.050502 -------------------------- NOTE: Adding EventInstance and bdeState class tables to 94sbde_schema.sch will automatically log each new EI-row and each change to bdeState table field values. (Logfile format is a superset of database format.) The $CASE/01f522/bde1_bdeEventlog_pk project and $CASE/01f522/bde2_bdeState projects have done most of the coding. Do NOT re-invent this wheel! You will have enough trouble making pr_util with genv13 and getting bde to compile with it and these new classes in bde/src. ... -------------------------- The 01f522 project by Paul Kingston was very good, but could not build BDEdue to its problems at the time (genv11-->genv12 migration): It is browsable at $PH/01f522/01f522bdeEventProject.htm Paul already modified dobuttonevent and init functions in his (non-repository) code. ------------------------------ mercury.cs.uml.edu(8)> lg $CASE/01f522/bde1_bdeEventlog_pk total 224 drwxr-xr-x 4 lechner 10032 4096 May 8 2005 . drwxr-xr-x 9 lechner fac 4096 Feb 10 23:30 .. -rw-r--r-- 1 lechner fac 65536 Jan 18 2003 01f522bdeEventProject.doc -rwxrwxr-x 1 lechner 10032 70656 Dec 19 2001 01f522bdeEventProject.doc.bak -rwxr-xr-x 1 lechner fac 27029 May 8 2005 01f522bdeEventProject.htm lrwxrwxrwx 1 root bin 65 Aug 9 2005 01f522bdeEventProject.htm.link -> /usr/cs/fac1/lechner/public_html/01f522/01f522bdeEventProject.htm -rw-r--r-- 1 lechner 10032 731 Apr 2 2003 aareadme drwxrwxr-x 15 lechner 10032 4096 Apr 2 2003 bde drwxr-xr-x 3 lechner 10032 4096 Apr 2 2003 cvscheckouta -------------------------- NOTE: Paul overlooked another event type: BUTTON_MOVE in bde/src. (probably because we know it would log too many fine-grained moves and has to be coarsened first). All 3 butten event types are about equally represented in bde/src/*.cc: ------------ mercury.cs.uml.edu(12)> grep BUTTON_MOVE *.cc|wc 73 433 5143 mercury.cs.uml.edu(13)> grep BUTTON_DOWN *.cc | wc 73 424 5067 mercury.cs.uml.edu(14)> grep BUTTON_UP *.cc | wc 96 607 6589 ----------------- All but 6 of these refs are in the 6 *ops.cc files: ------------- mercury.cs.uml.edu(17)> ls *ops.cc bendptops.cc captionops.cc graphops.cc linkops.cc nodeops.cc textops.cc mercury.cs.uml.edu(15)> grep BUTTON_ *ops.cc | wc 190 1047 12225 mercury.cs.uml.edu(21)> grep BUTTON_ *.cc | wc 195 1071 12554 Mysgtery: Why is the diff between the last 2 counts not (73+73+96 - 190 = 52) instead of 5??????