#include extern double sin(), cos(); int contrl[12], intin[256], ptsin[256], intout[256], ptsout[256]; int evwhich,dummy,rand,handle; int xstart,ystart,xwidth,ywidth,xcen,ycen; main() { int l_intin[20], l_ptsin[20], l_out[100], pxy[2], ptemp[1]; int i, j, k, l; int gr_1,gr_2,gr_3,gr_4; int wi_1,wi_2,wi_3,wi_4; int w_handle; int clip[4]; int mgbuf[8]; int wind_type; int dflag,xt; /* Set the system up to do GEM calls*/ appl_init(); /* Get the handle of the desktop */ handle=graf_handle(&gr_1,&gr_2,&gr_3,&gr_4); /* Open the workstation. */ l_intin[0] = 1; l_intin[1] = 1; l_intin[2] = 1; l_intin[3] = 1; l_intin[4] = 1; l_intin[5] = 1; l_intin[6] = 1; l_intin[7] = 1; l_intin[8] = 1; l_intin[9] = 1; l_intin[10] = 2; v_opnvwk(l_intin, &handle, l_out); graf_mouse(0,i); wind_type=0x002b; wind_get(0,4,&wi_1,&wi_2,&wi_3,&wi_4); /* request size of desktop window */ wind_calc(1,wind_type,wi_1,wi_2,wi_3,wi_4, &i,&j,&k,&l); /* calculate size of work area */ w_handle=wind_create(wind_type, wi_1,wi_2,wi_3,wi_4);/* make window of the max size */ wind_set(w_handle,2,"Cosine Color Show",0,0); wind_open(w_handle,wi_1,wi_2,wi_3,wi_4); xstart=i; ystart=j; xwidth=k; ywidth=l; mgbuf[0]=0; do { if (!((mgbuf[0]==20)&&(evwhich==0x0010))) /* ignore redraw */ { v_hide_c(handle); wind_update(1); draw_sample(); wind_update(0); v_show_c(handle); } evwhich= evnt_multi(0x0030, 0,0,0, 0,0,0,0,0, 0,0,0,0,0, &mgbuf, 10000,0, &dummy,&dummy,&dummy, &dummy,&dummy,&dummy); if (evwhich&0x10) if (mgbuf[0]==28||mgbuf[0]==27) { wind_calc(1,wind_type,mgbuf[4],mgbuf[5], mgbuf[6],mgbuf[7], &xstart,&ystart, &xwidth,&ywidth); if ((xt=xwidth)