/* A simple ploting program to show mouse motion tracking function in IWL and WM Hans Chen */ #include "IWInclude.h" #include "WMInclude.h" static char sMessage[30]; static char sMessage1[30]; static float gfPt[2000]; static int giNPt = 0 ; static int giZero=0, giOne=1, giTwo=2, giThree=3; static int giGID = 0; quit() { unsigned long mask; mask = EnterWindowMask|LeaveWindowMask| PointerMotionMask; WMCancelEventHandler(IW_ALL_WINDOWS, mask); WMCancelDisplayChange(IW_ALL_WINDOWS); exit(0); } int EventHandler(itype, event) int itype; XEvent *event; { static int iwid=0; char sWid[3]; float xyz[3]; float dmin, dmax, dmean; int mode,id,itime; static int nxyz[3], mxyz[3], icircle; static float rad = 1; if( itype == EnterWindowMask ) { iwid = iwxevttowid_(event); sprintf( sWid, "%d", iwid ); ialprt_( &giZero ); imopen_( &giOne, sWid, "ro", &giOne, &giTwo ); irdhdr_( &giOne, nxyz, mxyz, &mode, &dmin, &dmax, &dmean ); giNPt = 0; giGID = 0; } else if( itype == LeaveWindowMask ) { if( WMConfirm(" Remove graphices ?") ) iwgrrmproc_( &giOne ); iwendfastgr_( &giOne ); iwdisplay_( &giOne ); imclose_( &giOne ); } else if( itype == PointerMotionMask ) { iwxevttodata_( &giOne, &giZero, event, xyz, &itime ); if(xyz[0]>=0&&xyz[1]>=0&&xyz[1]