Annotation of OpenXM_contrib2/asir2000/plot/if.c, Revision 1.35
1.2 noro 1: /*
2: * Copyright (c) 1994-2000 FUJITSU LABORATORIES LIMITED
3: * All rights reserved.
4: *
5: * FUJITSU LABORATORIES LIMITED ("FLL") hereby grants you a limited,
6: * non-exclusive and royalty-free license to use, copy, modify and
7: * redistribute, solely for non-commercial and non-profit purposes, the
8: * computer program, "Risa/Asir" ("SOFTWARE"), subject to the terms and
9: * conditions of this Agreement. For the avoidance of doubt, you acquire
10: * only a limited right to use the SOFTWARE hereunder, and FLL or any
11: * third party developer retains all rights, including but not limited to
12: * copyrights, in and to the SOFTWARE.
13: *
14: * (1) FLL does not grant you a license in any way for commercial
15: * purposes. You may use the SOFTWARE only for non-commercial and
16: * non-profit purposes only, such as academic, research and internal
17: * business use.
18: * (2) The SOFTWARE is protected by the Copyright Law of Japan and
19: * international copyright treaties. If you make copies of the SOFTWARE,
20: * with or without modification, as permitted hereunder, you shall affix
21: * to all such copies of the SOFTWARE the above copyright notice.
22: * (3) An explicit reference to this SOFTWARE and its copyright owner
23: * shall be made on your publication or presentation in any form of the
24: * results obtained by use of the SOFTWARE.
25: * (4) In the event that you modify the SOFTWARE, you shall notify FLL by
1.3 noro 26: * e-mail at risa-admin@sec.flab.fujitsu.co.jp of the detailed specification
1.2 noro 27: * for such modification or the source code of the modified part of the
28: * SOFTWARE.
29: *
30: * THE SOFTWARE IS PROVIDED AS IS WITHOUT ANY WARRANTY OF ANY KIND. FLL
31: * MAKES ABSOLUTELY NO WARRANTIES, EXPRESSED, IMPLIED OR STATUTORY, AND
32: * EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS
33: * FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT OF THIRD PARTIES'
34: * RIGHTS. NO FLL DEALER, AGENT, EMPLOYEES IS AUTHORIZED TO MAKE ANY
35: * MODIFICATIONS, EXTENSIONS, OR ADDITIONS TO THIS WARRANTY.
36: * UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, TORT, CONTRACT,
37: * OR OTHERWISE, SHALL FLL BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY
38: * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL
39: * DAMAGES OF ANY CHARACTER, INCLUDING, WITHOUT LIMITATION, DAMAGES
40: * ARISING OUT OF OR RELATING TO THE SOFTWARE OR THIS AGREEMENT, DAMAGES
41: * FOR LOSS OF GOODWILL, WORK STOPPAGE, OR LOSS OF DATA, OR FOR ANY
42: * DAMAGES, EVEN IF FLL SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF
43: * SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY. EVEN IF A PART
44: * OF THE SOFTWARE HAS BEEN DEVELOPED BY A THIRD PARTY, THE THIRD PARTY
45: * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,
46: * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.
47: *
1.35 ! noro 48: * $OpenXM: OpenXM_contrib2/asir2000/plot/if.c,v 1.34 2015/08/14 13:51:56 fujimoto Exp $
1.2 noro 49: */
1.1 noro 50: #include "ca.h"
51: #include "parse.h"
52: #include "ox.h"
53: #include "ifplot.h"
54:
1.22 saito 55: #if defined(INTERVAL)
1.24 saito 56: // Time message and func
1.22 saito 57: #include <sys/types.h>
58: #include <sys/resource.h>
59: #include <sys/time.h>
60:
61: static struct oEGT ltime;
62: static double r0;
63: double get_rtime();
1.30 saito 64: void MSGdraw(char *);
65: char msg[128];
1.22 saito 66: #if defined(ITV_TIME_CHECK)
67: void tstart()
68: {
69: get_eg(<ime);
1.24 saito 70: r0=get_rtime();
1.22 saito 71: }
72:
73: void tstop(struct canvas *can)
74: {
75: struct oEGT egt1;
76: double e, g, r;
77: char ts[100];
78: void popdown_warning();
79: Widget warnshell,warndialog;
80:
81: get_eg(&egt1);
1.24 saito 82: e=egt1.exectime - ltime.exectime;
83: g=egt1.gctime - ltime.gctime;
84: r=get_rtime() - r0;
1.22 saito 85: sprintf(ts,"(%8.6f + gc %8.6f) total %8.6f \n",e,g,r);
86: create_popup(can->shell,"Message",&ts,&warnshell,&warndialog);
87: XawDialogAddButton(warndialog,"OK",popdown_warning,warnshell);
88: XtPopup(warnshell,XtGrabNone);
89: SetWM_Proto(warnshell);
90: }
91: #else
92: #define tstart()
93: #define tstop(a)
94: #endif
95: #endif
96:
1.8 noro 97: extern JMP_BUF ox_env;
1.1 noro 98:
1.24 saito 99: int open_canvas(NODE arg){
1.4 noro 100: int id;
101: struct canvas *can;
102: LIST wsize;
103: STRING wname;
104:
1.24 saito 105: wsize=(LIST)ARG0(arg);
106: wname=(STRING)ARG1(arg);
1.27 saito 107: id=search_canvas();
108: can=canvas[id];
109: can->mode=modeNO(INTERACTIVE);
1.24 saito 110: if(!wsize){
111: can->width=DEFAULTWIDTH;
112: can->height=DEFAULTHEIGHT;
1.4 noro 113: } else {
1.24 saito 114: can->width=QTOS((Q)BDY(BDY(wsize)));
115: can->height=QTOS((Q)BDY(NEXT(BDY(wsize))));
1.4 noro 116: }
1.24 saito 117: if(wname)can->wname=BDY(wname);
118: else can->wname="";
1.4 noro 119: create_canvas(can);
120: return id;
121: }
122:
1.30 saito 123: int plot(NODE arg,int fn){
1.1 noro 124: int id;
125: NODE n;
126: struct canvas *can;
127: P formula;
128: LIST xrange,yrange,zrange,wsize;
129: STRING wname;
1.12 noro 130: V v;
1.35 ! noro 131: Real r;
! 132: double rr;
1.1 noro 133:
1.24 saito 134: formula=(P)ARG0(arg);
135: xrange=(LIST)ARG1(arg);
136: yrange=(LIST)ARG2(arg);
137: zrange=(LIST)ARG3(arg);
138: wsize=(LIST)ARG4(arg);
139: wname=(STRING)ARG5(arg);
140: can=canvas[id=search_canvas()];
141: if(xrange){
142: n=BDY(xrange);can->vx=VR((P)BDY(n));n=NEXT(n);
143: can->qxmin=(Q)BDY(n);n=NEXT(n);can->qxmax=(Q)BDY(n);
144: can->xmin=ToReal(can->qxmin);can->xmax=ToReal(can->qxmax);
145: }
146: if(yrange){
147: n=BDY(yrange);can->vy=VR((P)BDY(n));n=NEXT(n);
148: can->qymin=(Q)BDY(n);n=NEXT(n);can->qymax=(Q)BDY(n);
149: can->ymin=ToReal(can->qymin);can->ymax=ToReal(can->qymax);
1.35 ! noro 150: } else if ( !formula || NUM(formula) ) {
! 151: devalr(CO,(Obj)formula,(Obj *)&r); rr = ToReal(r);
! 152: can->ymin=rr-1; can->ymax=rr+1;
! 153: }
1.30 saito 154: can->mode=fn;
1.24 saito 155: if(zrange){
1.30 saito 156: n=NEXT(BDY(zrange));
157: can->zmin=ToReal(BDY(n));
1.24 saito 158: n=NEXT(n);can->zmax=ToReal(BDY(n));
159: n=NEXT(n);
1.30 saito 160: if(can->mode==modeNO(CONPLOT))can->nzstep=n?QTOS((Q)BDY(n)):MAXGC;
1.12 noro 161: else {
1.24 saito 162: can->vx=VR((P)BDY(BDY(zrange)));
1.30 saito 163: can->nzstep=n?QTOS((Q)BDY(n)):DEFAULTPOLARSTEP;
1.12 noro 164: }
165: }
1.24 saito 166: if(!wsize){
167: can->width=DEFAULTWIDTH;
168: can->height=DEFAULTHEIGHT;
1.1 noro 169: } else {
1.24 saito 170: can->width=QTOS((Q)BDY(BDY(wsize)));
171: can->height=QTOS((Q)BDY(NEXT(BDY(wsize))));
1.1 noro 172: }
1.30 saito 173: if(wname) can->wname=BDY(wname);
1.24 saito 174: else can->wname="";
175: can->formula=formula;
1.27 saito 176: if(can->mode==modeNO(PLOT)){
1.24 saito 177: //plot
1.1 noro 178: plotcalc(can);
1.14 noro 179: create_canvas(can);
1.1 noro 180: plot_print(display,can);
1.30 saito 181: } else if(can->mode==modeNO(POLARPLOT)){
182: polarcalc(can);
183: create_canvas(can);
184: plot_print(display,can);
1.14 noro 185: } else {
186: create_canvas(can);
1.30 saito 187: ifplotmain(can);
1.12 noro 188: }
1.1 noro 189: copy_to_canvas(can);
190: return id;
191: }
192:
1.30 saito 193: void ifplotmain(struct canvas *can){
1.24 saito 194: int i,width,height;
195: double ** tabe;
196:
197: width=can->width;height=can->height;
198: tabe=(double **)ALLOCA((width+1)*sizeof(double *));
199: for(i=0;i<width;i++)tabe[i]=(double *)ALLOCA((height+1)*sizeof(double));
200: define_cursor(can->window,runningcur);
201: set_busy(can); set_selection();
202: calc(tabe,can,0);
1.30 saito 203: if_print(display,tabe,can);
1.24 saito 204: reset_selection(); reset_busy(can);
205: define_cursor(can->window,normalcur);
206: }
207:
208: int memory_plot(NODE arg,LIST *bytes){
1.6 noro 209: NODE n;
210: struct canvas tmp_can;
211: struct canvas *can;
212: P formula;
213: LIST xrange,yrange,zrange,wsize;
214: int width,height;
215: double **tabe;
216: int i;
217: BYTEARRAY barray;
218: Q qw,qh;
219:
1.24 saito 220: formula=(P)ARG0(arg);
221: xrange=(LIST)ARG1(arg);
222: yrange=(LIST)ARG2(arg);
223: zrange=(LIST)ARG3(arg);
224: wsize=(LIST)ARG4(arg);
1.6 noro 225:
1.19 noro 226: bzero((char *)&tmp_can,sizeof(tmp_can));
1.24 saito 227: can=&tmp_can;
228: n=BDY(xrange); can->vx=VR((P)BDY(n)); n=NEXT(n);
229: can->qxmin=(Q)BDY(n); n=NEXT(n); can->qxmax=(Q)BDY(n);
230: can->xmin=ToReal(can->qxmin); can->xmax=ToReal(can->qxmax);
231: if( yrange ){
232: n=BDY(yrange); can->vy=VR((P)BDY(n)); n=NEXT(n);
233: can->qymin=(Q)BDY(n); n=NEXT(n); can->qymax=(Q)BDY(n);
234: can->ymin=ToReal(can->qymin); can->ymax=ToReal(can->qymax);
235: if( zrange ){
236: n=NEXT(BDY(zrange));
237: can->zmin=ToReal(BDY(n)); n=NEXT(n); can->zmax=ToReal(BDY(n));
1.27 saito 238: n=NEXT(n);
239: if(n) can->nzstep=QTOS((Q)BDY(n));
1.24 saito 240: else can->nzstep=MAXGC;
1.27 saito 241: can->mode=modeNO(CONPLOT);
1.6 noro 242: } else
1.27 saito 243: can->mode=modeNO(IFPLOT);
1.6 noro 244: } else
1.27 saito 245: can->mode=modeNO(PLOT);
1.24 saito 246: if( !wsize ){
247: can->width=DEFAULTWIDTH; can->height=DEFAULTHEIGHT;
1.6 noro 248: } else {
1.24 saito 249: can->width=QTOS((Q)BDY(BDY(wsize)));
250: can->height=QTOS((Q)BDY(NEXT(BDY(wsize))));
1.6 noro 251: }
1.24 saito 252: can->wname="";
253: can->formula=formula;
1.27 saito 254: if( can->mode==modeNO(PLOT)){
1.6 noro 255: plotcalc(can);
1.19 noro 256: memory_print(can,&barray);
257: STOQ(can->width,qw); STOQ(can->height,qh);
1.24 saito 258: n=mknode(3,qw,qh,barray);
1.19 noro 259: MKLIST(*bytes,n);
260: } else {
1.24 saito 261: width=can->width; height=can->height;
262: tabe=(double **)ALLOCA(width*sizeof(double *));
263: for( i=0; i<width; i++ )
264: tabe[i]=(double *)ALLOCA(height*sizeof(double));
1.6 noro 265: calc(tabe,can,1);
266: memory_if_print(tabe,can,&barray);
267: STOQ(width,qw); STOQ(height,qh);
1.24 saito 268: n=mknode(3,qw,qh,barray);
1.6 noro 269: MKLIST(*bytes,n);
270: }
1.27 saito 271: return 0;
1.6 noro 272: }
273:
1.24 saito 274: int plotover(NODE arg){
1.30 saito 275: int id;
276: unsigned int orgcolor;
1.1 noro 277: P formula;
278: struct canvas *can;
279: VL vl,vl0;
280:
1.24 saito 281: id=QTOS((Q)ARG0(arg));
282: formula=(P)ARG1(arg);
283: can=canvas[id];
284: orgcolor=can->color;
1.27 saito 285: if(argc(arg)==3) can->color=QTOS((Q)ARG2(arg));
286: else can->color=0;
1.7 noro 287: get_vars_recursive((Obj)formula,&vl);
1.24 saito 288: for(vl0=vl;vl0;vl0=NEXT(vl0))
289: if(vl0->v->attr==(pointer)V_IND)
290: if(vl->v!=can->vx && vl->v!=can->vy)return -1;
1.34 fujimoto 291: #if !defined(VISUAL) && !defined(__MINGW32__)
1.17 noro 292: set_drawcolor(can->color);
1.18 noro 293: #endif
1.24 saito 294: current_can=can;
295: can->formula=formula;
1.27 saito 296: if(can->mode==modeNO(PLOT)){
1.21 saito 297: plotcalc(can);
298: plot_print(display,can);
1.30 saito 299: } else ifplotmain(can);
1.21 saito 300: copy_to_canvas(can);
1.30 saito 301: can->color=orgcolor;
1.34 fujimoto 302: #if !defined(VISUAL) && !defined(__MINGW32__)
1.21 saito 303: set_drawcolor(can->color);
304: #endif
1.26 ohara 305: return id;
1.1 noro 306: }
307:
1.24 saito 308: int drawcircle(NODE arg){
1.34 fujimoto 309: #if !defined(VISUAL) && !defined(__MINGW32__)
1.30 saito 310: int id,index,wx,wy,wr;
311: unsigned int c;
1.1 noro 312: pointer ptr;
313: Q ret;
314: LIST xyr;
315: Obj x,y,r;
316: struct canvas *can;
317:
1.24 saito 318: index=QTOS((Q)ARG0(arg));
319: xyr=(LIST)ARG1(arg);
320: x=(Obj)ARG0(BDY(xyr)); y=(Obj)ARG1(BDY(xyr)); r=(Obj)ARG2(BDY(xyr));
321: c=QTOS((Q)ARG2(arg));
322: can=canvas[index];
323: if(!can->window)return -1;
1.1 noro 324: else {
1.24 saito 325: current_can=can;
1.21 saito 326: set_drawcolor(c);
1.24 saito 327: wx=(ToReal(x)-can->xmin)*can->width/(can->xmax-can->xmin);
328: wy=(can->ymax-ToReal(y))*can->height/(can->ymax-can->ymin);
329: wr=ToReal(r);
1.21 saito 330: XFillArc(display,can->pix,cdrawGC,wx-wr/2,wy-wr/2,wr,wr,0,360*64);
1.1 noro 331: copy_to_canvas(can);
1.21 saito 332: set_drawcolor(can->color);
1.1 noro 333: return index;
334: }
1.4 noro 335: #endif
336: }
337:
1.24 saito 338: int draw_obj(NODE arg){
1.30 saito 339: int index,x,y,u,v,len,r;
340: unsigned int color;
1.4 noro 341: NODE obj,n;
342: RealVect *vect;
343: struct canvas *can;
344:
1.24 saito 345: index=QTOS((Q)ARG0(arg));
346: can=canvas[index];
347: if(!can && closed_canvas[index]){
348: canvas[index]=closed_canvas[index];
349: closed_canvas[index]=0;
350: can=canvas[index];
1.10 noro 351: popup_canvas(index);
1.24 saito 352: current_can=can;
353: } else if(!can||(can && !can->window)){
1.5 noro 354: set_lasterror("draw_obj : canvas does not exist");
1.4 noro 355: return -1;
1.5 noro 356: }
1.4 noro 357:
1.24 saito 358: obj=BDY((LIST)ARG1(arg));
359: if(argc(arg)== 3) color=QTOS((Q)ARG2(arg));
360: else color=0; // black
361: switch(len=length(obj)){
362: case 2: // point
363: x=(int)ToReal((Q)ARG0(obj)); y=(int)ToReal((Q)ARG1(obj));
1.5 noro 364: draw_point(display,can,x,y,color);
1.16 noro 365: MKRVECT3(vect,x,y,color); MKNODE(n,vect,can->history);
1.24 saito 366: can->history=n;
1.5 noro 367: break;
1.24 saito 368: case 3: // circle
369: x=(int)ToReal((Q)ARG0(obj)); y=(int)ToReal((Q)ARG1(obj));
370: r=(int)ToReal((Q)ARG2(obj));
1.16 noro 371: MKRVECT4(vect,x,y,r,color); MKNODE(n,vect,can->history);
1.24 saito 372: can->history=n;
1.4 noro 373: break;
1.24 saito 374: case 4: // line
375: x=(int)ToReal((Q)ARG0(obj)); y=(int)ToReal((Q)ARG1(obj));
376: u=(int)ToReal((Q)ARG2(obj)); v=(int)ToReal((Q)ARG3(obj));
1.5 noro 377: draw_line(display,can,x,y,u,v,color);
1.16 noro 378: MKRVECT5(vect,x,y,u,v,color); MKNODE(n,vect,can->history);
1.24 saito 379: can->history=n;
1.4 noro 380: break;
381: default:
1.5 noro 382: set_lasterror("draw_obj : invalid request");
1.4 noro 383: return -1;
384: }
1.34 fujimoto 385: #if !defined(VISUAL) && !defined(__MINGW32__)
1.21 saito 386: set_drawcolor(can->color);
387: #endif
1.9 noro 388: return 0;
389: }
390:
1.24 saito 391: int draw_string(NODE arg){
1.30 saito 392: int index,x,y;
393: unsigned int color;
1.9 noro 394: char *str;
395: NODE pos;
396: struct canvas *can;
397:
1.24 saito 398: index=QTOS((Q)ARG0(arg));
399: can=canvas[index];
400: if(!can && closed_canvas[index]){
401: canvas[index]=closed_canvas[index];
402: closed_canvas[index]=0;
403: can=canvas[index];
1.11 noro 404: popup_canvas(index);
1.24 saito 405: current_can=can;
406: } else if(!can||(can && !can->window)){
1.11 noro 407: set_lasterror("draw_obj : canvas does not exist");
1.9 noro 408: return -1;
409: }
410:
1.24 saito 411: pos=BDY((LIST)ARG1(arg));
412: str=BDY((STRING)ARG2(arg));
413: if(argc(arg)==4)color=QTOS((Q)ARG3(arg));
414: else color=0; // black
415: x=(int)ToReal((Q)ARG0(pos));
416: y=(int)ToReal((Q)ARG1(pos));
1.9 noro 417: draw_character_string(display,can,x,y,str,color);
1.34 fujimoto 418: #if !defined(VISUAL) && !defined(__MINGW32__)
1.21 saito 419: set_drawcolor(can->color);
420: #endif
1.4 noro 421: return 0;
422: }
423:
1.24 saito 424: int clear_canvas(NODE arg){
1.4 noro 425: int index;
426: struct canvas *can;
427:
1.24 saito 428: index=QTOS((Q)ARG0(arg));
429: can=canvas[index];
430: if(!can||!can->window) return -1;
1.4 noro 431: clear_pixmap(can);
432: copy_to_canvas(can);
1.24 saito 433: // clear the history
434: can->history=0;
1.27 saito 435: return 0;
1.1 noro 436: }
437:
438: #define RealtoDbl(r) ((r)?BDY(r):0.0)
439:
1.24 saito 440: int arrayplot(NODE arg){
1.1 noro 441: int id,ix,w,h;
442: VECT array;
443: LIST xrange,wsize;
444: char *wname;
445: NODE n;
446: double ymax,ymin,dy,xstep;
447: Real *tab;
448: struct canvas *can;
449: POINT *pa;
450:
1.24 saito 451: array=(VECT)ARG0(arg);
452: xrange=(LIST)ARG1(arg);
453: can=canvas[id=search_canvas()];
454: n=BDY(xrange); can->vx=VR((P)BDY(n)); n=NEXT(n);
455: can->qxmin=(Q)BDY(n); n=NEXT(n); can->qxmax=(Q)BDY(n);
456: can->xmin=ToReal(can->qxmin); can->xmax=ToReal(can->qxmax);
457: if(!wsize){
458: can->width=DEFAULTWIDTH;
459: can->height=DEFAULTHEIGHT;
1.1 noro 460: } else {
1.24 saito 461: can->width=QTOS((Q)BDY(BDY(wsize)));
462: can->height=QTOS((Q)BDY(NEXT(BDY(wsize))));
1.1 noro 463: }
1.27 saito 464: can->wname=wname; can->formula=0; can->mode=modeNO(PLOT);
1.1 noro 465: create_canvas(can);
1.24 saito 466: w=array->len;
467: h=can->height;
468: tab=(Real *)BDY(array);
469: if(can->ymax==can->ymin){
470: for(ymax=ymin=RealtoDbl(tab[0]),ix=1; ix<w; ix++){
471: if(RealtoDbl(tab[ix])>ymax)ymax=RealtoDbl(tab[ix]);
472: if(RealtoDbl(tab[ix])<ymin)ymin=RealtoDbl(tab[ix]);
1.1 noro 473: }
1.24 saito 474: can->ymax=ymax;
475: can->ymin=ymin;
1.1 noro 476: } else {
1.24 saito 477: ymax=can->ymax;
478: ymin=can->ymin;
1.1 noro 479: }
1.24 saito 480: dy=ymax-ymin;
481: can->pa=(struct pa *)MALLOC(sizeof(struct pa));
482: can->pa[0].length=w;
483: can->pa[0].pos=pa=(POINT *)MALLOC(w*sizeof(POINT));
484: xstep=(double)can->width/(double)(w-1);
485: for(ix=0;ix<w;ix++){
1.1 noro 486: #ifndef MAXSHORT
487: #define MAXSHORT ((short)0x7fff)
488: #endif
489: double t;
490:
1.24 saito 491: pa[ix].x=(int)(ix*xstep);
492: t=(h - 1)*(ymax - RealtoDbl(tab[ix]))/dy;
493: if(t>MAXSHORT)pa[ix].y=MAXSHORT;
494: else if(t<-MAXSHORT)pa[ix].y=-MAXSHORT;
495: else pa[ix].y=(long)t;
1.1 noro 496: }
497: plot_print(display,can);
498: copy_to_canvas(can);
499: return id;
500: }
1.30 saito 501: /*
1.24 saito 502: void ifplot_resize(struct canvas *can,POINT spos,POINT epos){
1.1 noro 503: struct canvas *ncan;
504: struct canvas fakecan;
505: Q dx,dy,dx2,dy2,xmin,xmax,ymin,ymax,xmid,ymid;
506: Q sx,sy,ex,ey,cw,ch,ten,two;
507: Q s,t;
508: int new;
509: int w,h,m;
1.24 saito 510: if(XC(spos)<XC(epos) && YC(spos)<YC(epos)){
511: if(can->precise && !can->wide){
512: fakecan=*can;
513: ncan=&fakecan;
1.1 noro 514: } else {
1.24 saito 515: new=search_canvas();
516: ncan=canvas[new];
1.1 noro 517: }
1.24 saito 518: ncan->mode=can->mode;
519: ncan->zmin=can->zmin; ncan->zmax=can->zmax;
520: ncan->nzstep=can->nzstep;
521: ncan->wname=can->wname;
522: ncan->vx=can->vx; ncan->vy=can->vy;
523: ncan->formula=can->formula;
524: w=XC(epos)-XC(spos);
525: h=YC(epos)-YC(spos);
526: m=MAX(can->width,can->height);
527: if(can->precise){
528: ncan->width=w;
529: ncan->height=h;
530: } else if(w>h){
531: ncan->width=m;
532: ncan->height=m*h/w;
1.1 noro 533: } else {
1.24 saito 534: ncan->width=m*w/h;
535: ncan->height=m;
1.1 noro 536: }
1.24 saito 537: if(can->wide){
538: STOQ(10,ten);
539: STOQ(2,two);
540: subq(can->qxmax,can->qxmin,&t);
541: mulq(t,ten,&dx);
542: subq(can->qymax,can->qymin,&t);
543: mulq(t,ten,&dy);
544: addq(can->qxmax,can->qxmin,&t);
545: divq(t,two,&xmid);
546: addq(can->qymax,can->qymin,&t);
547: divq(t,two,&ymid);
548: divq(dx,two,&dx2);
549: divq(dy,two,&dy2);
550: subq(xmid,dx2,&xmin);
551: addq(xmid,dx2,&xmax);
552: subq(ymid,dy2,&ymin);
553: addq(ymid,dy2,&ymax);
1.1 noro 554: } else {
1.24 saito 555: subq(can->qxmax,can->qxmin,&dx);
556: subq(can->qymax,can->qymin,&dy);
557: xmin=can->qxmin;
558: xmax=can->qxmax;
559: ymin=can->qymin;
560: ymax=can->qymax;
1.1 noro 561: }
562: STOQ(XC(spos),sx); STOQ(YC(spos),sy); STOQ(XC(epos),ex); STOQ(YC(epos),ey);
563: STOQ(can->width,cw); STOQ(can->height,ch);
564: mulq(sx,dx,&t); divq(t,cw,&s); addq(xmin,s,&ncan->qxmin);
565: mulq(ex,dx,&t); divq(t,cw,&s); addq(xmin,s,&ncan->qxmax);
566: mulq(ey,dy,&t); divq(t,ch,&s); subq(ymax,s,&ncan->qymin);
567: mulq(sy,dy,&t); divq(t,ch,&s); subq(ymax,s,&ncan->qymax);
1.24 saito 568: ncan->xmin=ToReal(ncan->qxmin); ncan->xmax=ToReal(ncan->qxmax);
569: ncan->ymin=ToReal(ncan->qymin); ncan->ymax=ToReal(ncan->qymax);
570: if(can->precise && !can->wide){
571: current_can=can;
1.1 noro 572: alloc_pixmap(ncan);
1.34 fujimoto 573: #if defined(VISUAL) || defined(__MINGW32__)
1.24 saito 574: ncan->real_can=can;
1.4 noro 575: #endif
1.1 noro 576: qifplotmain(ncan);
577: copy_subimage(ncan,can,spos);
578: copy_to_canvas(can);
579: } else {
580: create_canvas(ncan);
1.24 saito 581: if( can->precise ) qifplotmain(ncan);
1.32 ohara 582: else ifplotmain(ncan);
1.1 noro 583: copy_to_canvas(ncan);
584: }
585: }
586: }
1.30 saito 587: */
1.1 noro 588:
1.24 saito 589: void plot_resize(struct canvas *can,POINT spos,POINT epos){
1.1 noro 590: struct canvas *ncan;
1.30 saito 591: Q dx,dx2,xmin,xmax,xmid,sx,ex,cw,ten,two,s,t;
1.7 noro 592: double dy,ymin,ymax,ymid;
1.30 saito 593: int new,w,h,m;
1.1 noro 594:
1.24 saito 595: if( XC(spos)<XC(epos) && YC(spos)<YC(epos) ){
596: new=search_canvas(); ncan=canvas[new];
597: ncan->mode=can->mode;
598: ncan->zmin=can->zmin; ncan->zmax=can->zmax;
599: ncan->nzstep=can->nzstep;
600: ncan->wname=can->wname;
601: ncan->vx=can->vx; ncan->vy=can->vy;
602: ncan->formula=can->formula;
1.30 saito 603: ncan->color=can->color;
1.24 saito 604: w=XC(epos)-XC(spos);
605: h=YC(epos)-YC(spos);
606: m=MAX(can->width,can->height);
607: if( w>h ){
1.30 saito 608: ncan->width=m;
609: ncan->height=m * h/w;
1.1 noro 610: } else {
1.30 saito 611: ncan->width=m * w/h;
612: ncan->height=m;
1.1 noro 613: }
1.24 saito 614: if( can->wide ){
1.1 noro 615: STOQ(10,ten); STOQ(2,two);
616: subq(can->qxmax,can->qxmin,&t); mulq(t,ten,&dx);
617: addq(can->qxmax,can->qxmin,&t); divq(t,two,&xmid);
618: divq(dx,two,&dx2); subq(xmid,dx2,&xmin); addq(xmid,dx2,&xmax);
1.24 saito 619: dy=(can->ymax-can->ymin)*10;
620: ymid=(can->ymax+can->ymin)/2;
621: ymin=ymid-dy/2; ymax=ymid+dy/2;
1.1 noro 622: } else {
623: subq(can->qxmax,can->qxmin,&dx);
1.30 saito 624: xmin=can->qxmin;
625: xmax=can->qxmax;
1.24 saito 626: dy=can->ymax-can->ymin;
1.30 saito 627: ymin=can->ymin;
628: ymax=can->ymax;
1.1 noro 629: }
630: STOQ(XC(spos),sx); STOQ(XC(epos),ex); STOQ(can->width,cw);
631: mulq(sx,dx,&t); divq(t,cw,&s); addq(xmin,s,&ncan->qxmin);
632: mulq(ex,dx,&t); divq(t,cw,&s); addq(xmin,s,&ncan->qxmax);
1.24 saito 633: ncan->xmin=ToReal(ncan->qxmin); ncan->xmax=ToReal(ncan->qxmax);
634: ncan->ymin=ymax-YC(epos)*dy/can->height;
635: ncan->ymax=ymax-YC(spos)*dy/can->height;
1.30 saito 636: create_canvas(ncan);
1.1 noro 637:
1.30 saito 638: switch (ncan->mode){
639: case 0://IFPLOT
640: case 1://CONPLOT
641: ifplotmain(ncan);
642: break;
643: case 2://PLOT
644: plotcalc(ncan);
645: plot_print(display,ncan);
646: break;
647: case 4://POLARPLOT
648: polarcalc(ncan);
649: plot_print(display,ncan);
650: break;
651: case 30://MEMORY_PLOT
652: break;
653: case 31://ARRAYPLOT
654: break;
655: case 33://DRAWCIRCLE
656: break;
657: case 34://DRAW_OBJ
658: break;
659: case 35://DRAW_STRING
660: break;
661: case 36://OBJ_CP
662: break;
663: case 6://IFPLOTD
664: case 7://IFPLOTQ
665: case 8://IFPLOTB
666: case 9://INEQND
667: case 10://INEQNQ
668: case 11://INEQNB
669: case 21://CONPLOTD
670: case 22://CONPLOTQ
671: case 23://CONPLOTB
672: case 24://ITVIFPLOT
673: //ifplotNG
674: ifplotmainNG(ncan);
675: break;
676: case 12://INEQNDAND
677: case 13://INEQNQAND
678: case 14://INEQNBAND
679: case 15://INEQNDOR
680: case 16://INEQNQOR
681: case 17://INEQNBOR
682: case 18://INEQNDXOR
683: case 19://INEQNQXOR
684: case 20://INEQNBXOR
685: case 25://PLOTOVERD
686: case 26://PLOTOVERQ
687: case 27://PLOTOVERB
688: //ifplotOP
689: ifplotmainNG(ncan);
690: break;
691: case 38://POLARPLOTD
692: //polarplotNG
693: polarcalcNG(ncan);
694: polar_print(display,ncan);
695: break;
696: }
1.1 noro 697: copy_to_canvas(ncan);
698: }
699: }
700:
1.24 saito 701: void qifplotmain(struct canvas *can)
1.1 noro 702: {
703: int width,height;
1.24 saito 704: char **tabe,*tabeb;
1.1 noro 705: int i;
706:
1.24 saito 707: width=can->width; height=can->height;
708: tabe=(char **)ALLOCA(width*sizeof(char *)+width*height*sizeof(char));
709: bzero((void *)tabe,width*sizeof(char *)+width*height*sizeof(char));
710: for( i=0, tabeb=(char *)(tabe+width); i<width; i++ )
711: tabe[i]=tabeb + height*i;
1.1 noro 712: define_cursor(can->window,runningcur);
713: set_busy(can); set_selection();
1.24 saito 714: qcalc(tabe,can); qif_print(display,tabe,can);
1.1 noro 715: reset_selection(); reset_busy(can);
716: define_cursor(can->window,normalcur);
717: }
718:
1.24 saito 719: //*******************ifplotNG
1.27 saito 720: int ifplotNG(NODE arg,int func){
1.30 saito 721: int id,op_code;
722: unsigned int color;
1.24 saito 723: NODE n;
724: struct canvas *can;
725: P formula;
726: LIST xrange,yrange,zrange,wsize;
727: STRING wname;
728:
1.30 saito 729: can=canvas[id=search_canvas()];
1.24 saito 730: formula=(P)ARG0(arg);
1.30 saito 731: can->color=QTOS((Q)ARG1(arg));
1.24 saito 732: xrange=(LIST)ARG2(arg);
733: yrange=(LIST)ARG3(arg);
734: zrange=(LIST)ARG4(arg);
735: wsize=(LIST)ARG5(arg);
736: wname=(STRING)ARG6(arg);
737: can->division=0;
738: // set canvas data
739: if(xrange){
740: n=BDY(xrange); can->vx=VR((P)BDY(n)); n=NEXT(n);
741: can->qxmin=(Q)BDY(n); n=NEXT(n); can->qxmax=(Q)BDY(n);
742: can->xmin=ToReal(can->qxmin); can->xmax=ToReal(can->qxmax);
743: }
744: if(yrange){
745: n=BDY(yrange); can->vy=VR((P)BDY(n)); n=NEXT(n);
746: can->qymin=(Q)BDY(n); n=NEXT(n); can->qymax=(Q)BDY(n);
747: can->ymin=ToReal(can->qymin); can->ymax=ToReal(can->qymax);
748: }
749: if(zrange){
750: n=BDY(zrange); can->zmin=ToReal(BDY(n));
751: n=NEXT(n); can->zmax=ToReal(BDY(n));
752: n=NEXT(n); can->nzstep=QTOS((Q)BDY(n));
753: }
754: if(!wsize){
755: can->width=DEFAULTWIDTH;
756: can->height=DEFAULTHEIGHT;
757: } else {
758: can->width=QTOS((Q)BDY(BDY(wsize)));
759: can->height=QTOS((Q)BDY(NEXT(BDY(wsize))));
760: }
761: if(wname) can->wname=BDY(wname);
762: else can->wname="";
763: can->formula=formula;
1.30 saito 764: set_drawcolor(can->color);
1.27 saito 765: can->mode=func;
1.24 saito 766: create_canvas(can);
1.30 saito 767: ifplotmainNG(can);
1.24 saito 768: copy_to_canvas(can);
769: return id;
770: }
771:
1.27 saito 772: int ifplotOP(NODE arg,int func){
773: //ineqnor[D,Q,B],ineqnand[D,Q,B],ineqnxor[D,Q,b],plotover[D,Q,B]
1.30 saito 774: int index,op_code;
775: unsigned int orgcolor,color;
1.27 saito 776: P formula;
777: struct canvas *can;
778: VL vl,vl0;
1.24 saito 779: NODE n;
1.27 saito 780:
1.24 saito 781: index=QTOS((Q)ARG0(arg));
782: formula=(P)ARG1(arg);
783: color=QTOS((Q)ARG2(arg));
1.27 saito 784: // set canvas data
1.24 saito 785: can=canvas[index];
786: orgcolor=can->color;
787: can->color=color;
788: can->formula=formula;
1.27 saito 789: current_can=can;
790: get_vars_recursive((Obj)formula,&vl);
791: for(vl0=vl;vl0;vl0=NEXT(vl0))
792: if(vl0->v->attr==(pointer)V_IND)
793: if(vl->v!=can->vx && vl->v!=can->vy)return -1;
1.34 fujimoto 794: #if !defined(VISUAL) && !defined(__MINGW32__)
1.27 saito 795: set_drawcolor(can->color);
796: #endif
797: can->mode=func;
1.24 saito 798: set_drawcolor(color);
1.30 saito 799: ifplotmainNG(can);
1.24 saito 800: set_drawcolor(orgcolor);
801: copy_to_canvas(can);
802: can->color=orgcolor;
1.34 fujimoto 803: #if !defined(VISUAL) && !defined(__MINGW32__)
1.27 saito 804: set_drawcolor(can->color);
805: #endif
1.24 saito 806: return index;
807: }
808:
1.30 saito 809: void ifplotmainNG(struct canvas *can){
1.24 saito 810: int width,height,i,j,ix,iy,**mask;
811: double **tabe;
1.1 noro 812:
1.24 saito 813: width=can->width; height=can->height;
814: tabe=(double **)ALLOCA((width+1)*sizeof(double *));
815: for(i=0;i<width;i++)tabe[i]=(double *)ALLOCA((height+1)*sizeof(double));
1.1 noro 816: define_cursor(can->window,runningcur);
817: set_busy(can); set_selection();
1.24 saito 818: set_drawcolor(can->color);
819: switch(can->mode){
1.27 saito 820: case 6://IFPLOTD
1.24 saito 821: calc(tabe,can,0);
1.30 saito 822: if_printNG(display,tabe,can,1);
1.24 saito 823: break;
1.27 saito 824: case 7://IFPLOTQ
1.24 saito 825: calcq(tabe,can,0);
1.30 saito 826: if_printNG(display,tabe,can,1);
1.24 saito 827: break;
1.27 saito 828: case 8://IFPLOTB
1.24 saito 829: calcb(tabe,can,0);
1.30 saito 830: if_printNG(display,tabe,can,0);
1.24 saito 831: break;
1.27 saito 832: case 9://INEQND
1.24 saito 833: calc(tabe,can,0);
834: area_print(display,tabe,can,0);
835: break;
1.27 saito 836: case 10://INEQNQ
1.24 saito 837: calcq(tabe,can,0);
838: area_print(display,tabe,can,0);
839: break;
1.27 saito 840: case 11://INEQNB
1.24 saito 841: calcb(tabe,can,0);
842: area_print(display,tabe,can,0);
843: break;
1.27 saito 844: case 12://INEQNFAND
1.24 saito 845: calc(tabe,can,0);
1.27 saito 846: area_print(display,tabe,can,2);
1.24 saito 847: break;
1.27 saito 848: case 13://INEQNQAND
1.24 saito 849: calcq(tabe,can,0);
850: area_print(display,tabe,can,2);
851: break;
1.27 saito 852: case 14://INEQNBAND
1.24 saito 853: calcb(tabe,can,0);
854: area_print(display,tabe,can,2);
855: break;
1.27 saito 856: case 15://INEQNDOR
1.24 saito 857: calc(tabe,can,0);
858: area_print(display,tabe,can,3);
859: break;
1.27 saito 860: case 16://INEQNQOR
1.24 saito 861: calcq(tabe,can,0);
862: area_print(display,tabe,can,3);
863: break;
1.27 saito 864: case 17://INEQNBOR
1.24 saito 865: calcb(tabe,can,0);
866: area_print(display,tabe,can,3);
867: break;
1.27 saito 868: case 18://INEQNDXOR
1.24 saito 869: calc(tabe,can,0);
870: area_print(display,tabe,can,4);
871: break;
1.27 saito 872: case 19://INEQNQXOR
1.24 saito 873: calcq(tabe,can,0);
874: area_print(display,tabe,can,4);
875: break;
1.27 saito 876: case 20://INEQNBXOR
1.24 saito 877: calcb(tabe,can,0);
878: area_print(display,tabe,can,4);
879: break;
1.27 saito 880: case 21://CONPLOTD
1.24 saito 881: calc(tabe,can,0);
882: con_print(display,tabe,can);
883: break;
1.27 saito 884: case 22://CONPLOTQ
885: calcq(tabe,can,0);
886: con_print(display,tabe,can);
887: break;
888: case 23://CONPLOTB
1.24 saito 889: calcb(tabe,can,0);
890: con_print(display,tabe,can);
891: break;
1.30 saito 892: #if defined(INTERVAL)
1.27 saito 893: case 24://ITVIFPLOT:
894: itvcalc(tabe,can,1);
1.30 saito 895: if_printNG(display,tabe,can,1);
1.24 saito 896: break;
1.30 saito 897: #endif
1.27 saito 898: case 25://PLOTOVERD
1.24 saito 899: calc(tabe,can,0);
900: over_print(display,tabe,can,0);
901: break;
1.27 saito 902: case 26://PLOTOVERQ:
1.24 saito 903: calcq(tabe,can,0);
904: over_print(display,tabe,can,0);
905: break;
1.27 saito 906: case 27://PLOTOVERB:
1.24 saito 907: calcb(tabe,can,0);
908: over_print(display,tabe,can,0);
909: break;
910: }
911: set_drawcolor(can->color);
1.1 noro 912: reset_selection(); reset_busy(can);
913: define_cursor(can->window,normalcur);
914: }
1.22 saito 915:
1.34 fujimoto 916: #if !defined(VISUAL) && !defined(__MINGW32__)
1.24 saito 917: int objcp(NODE arg){
1.22 saito 918: int idsrc, idtrg, op_code;
919: struct canvas *cansrc, *cantrg;
920:
1.24 saito 921: idsrc=QTOS((Q)ARG0(arg));
922: idtrg=QTOS((Q)ARG1(arg));
923: op_code=QTOS((Q)ARG2(arg));
924: cansrc=canvas[idsrc];
925: cantrg=canvas[idtrg];
1.22 saito 926: obj_op(cansrc, cantrg, op_code);
927: return idsrc;
928: }
929:
1.24 saito 930: void obj_op(struct canvas *cansrc, struct canvas *cantrg, int op){
1.22 saito 931: XImage *imgsrc, *imgtrg;
932: int width, height, i, j;
933: unsigned long src, trg, black, white;
934:
1.24 saito 935: width=cansrc->width; height=cansrc->height;
936: imgsrc=XGetImage(display, cansrc->pix, 0, 0, width, height, -1, ZPixmap);
937: imgtrg=XGetImage(display, cantrg->pix, 0, 0, width, height, -1, ZPixmap);
1.22 saito 938: black=GetColor(display, "black");
939: white=GetColor(display, "white");
940: flush();
941: define_cursor(cantrg->window,runningcur);
942: set_busy(cantrg); set_selection();
1.24 saito 943: cantrg->precise=cansrc->precise;
944: cantrg->noaxis=cansrc->noaxis;
945: cantrg->noaxisb=cansrc->noaxisb;
946: cantrg->vx=cansrc->vx;
947: cantrg->vy=cansrc->vy;
948: cantrg->formula=cansrc->formula;
949: cantrg->width=cansrc->width;
950: cantrg->height=cansrc->height;
951: cantrg->xmin=cansrc->xmin;
952: cantrg->xmax=cansrc->xmax;
953: cantrg->ymin=cansrc->ymin;
954: cantrg->ymax=cansrc->ymax;
955: cantrg->zmin=cansrc->zmin;
956: cantrg->zmax=cansrc->zmax;
957: cantrg->nzstep=cansrc->nzstep;
958: cantrg->qxmin=cansrc->qxmin;
959: cantrg->qxmax=cansrc->qxmax;
960: cantrg->qymin=cansrc->qymin;
961: cantrg->qymax=cansrc->qymax;
962: cantrg->pa=cansrc->pa;
963: switch(op){
1.22 saito 964: case 1:/* and case */
965: for(i=0;i<width;i++)for(j=0;j<height;j++){
1.24 saito 966: src=XGetPixel(imgsrc,i,j);
967: trg=XGetPixel(imgtrg,i,j);
968: if( (src == black) || (trg == black) )
1.22 saito 969: XPutPixel(imgtrg,i,j,black);
1.24 saito 970: else if( (src == white) || (trg == white) )
1.22 saito 971: XPutPixel(imgtrg,i,j,white);
972: else XPutPixel(imgtrg,i,j,(src & trg));
973: }
974: break;
975: case 3:/* copy case */
1.24 saito 976: imgtrg->data=imgsrc->data;
1.22 saito 977: break;
978: case 6:/* xor case */
979: for(i=0;i<width;i++)for(j=0;j<height;j++){
1.24 saito 980: src=XGetPixel(imgsrc,i,j);
981: trg=XGetPixel(imgtrg,i,j);
982: if( (src == black) || (trg == black) )
1.22 saito 983: XPutPixel(imgtrg,i,j,black);
1.24 saito 984: else if( (src == white) && (trg == white) )
1.22 saito 985: XPutPixel(imgtrg,i,j,trg|src);
1.24 saito 986: else if( (src != white) && (trg != white) )
1.22 saito 987: XPutPixel(imgtrg,i,j,white);
1.24 saito 988: else if( src == white )
1.22 saito 989: XPutPixel(imgtrg,i,j,src);
990: }
991: break;
992: case 7:/* or case */
993: for(i=0;i<width;i++)for(j=0;j<height;j++){
1.24 saito 994: src=XGetPixel(imgsrc,i,j);
995: trg=XGetPixel(imgtrg,i,j);
996: if( (src == black) || (trg == black) )
1.22 saito 997: XPutPixel(imgtrg,i,j,black);
1.24 saito 998: else if(src == white)
1.22 saito 999: XPutPixel(imgtrg,i,j,trg);
1.24 saito 1000: else if(trg == white)
1.22 saito 1001: XPutPixel(imgtrg,i,j,src);
1002: }
1003: break;
1004: default:
1005: break;
1006: }
1007: XPutImage(display, cantrg->pix, drawGC, imgtrg, 0, 0, 0, 0, width, height);
1008: reset_selection(); reset_busy(cantrg);
1009: define_cursor(cantrg->window,normalcur);
1010: copy_to_canvas(cantrg);
1011: count_and_flush();
1012: flush();
1013: }
1.32 ohara 1014: #endif
1.30 saito 1015:
1.24 saito 1016: int polarplotNG(NODE arg){
1.30 saito 1017: int i,id,width,height;
1.22 saito 1018: NODE n;
1019: struct canvas *can;
1.27 saito 1020: LIST range,geom;
1.22 saito 1021: STRING wname;
1.24 saito 1022: V v;
1.22 saito 1023:
1.30 saito 1024: id=search_canvas();
1025: can=canvas[id];
1026: can->mode=modeNO(POLARPLOTD);
1027: can->formula=(P)ARG0(arg);
1028: can->color=QTOS((Q)ARG1(arg));
1.27 saito 1029: range=(LIST)ARG2(arg);
1030: geom=(LIST)ARG3(arg);
1.24 saito 1031: wname=(STRING)ARG4(arg);
1032:
1.27 saito 1033: if(range){
1034: n=NEXT(BDY(range));
1035: can->zmin=ToReal(BDY(n));
1036: n=NEXT(n);can->zmax=ToReal(BDY(n));
1037: n=NEXT(n);
1038: can->vx=VR((P)BDY(BDY(range)));
1039: can->nzstep=n?QTOS((Q)BDY(n)):DEFAULTPOLARSTEP;
1.24 saito 1040: }
1.27 saito 1041: if(geom){
1042: can->width=width=QTOS((Q)BDY(BDY(geom)));
1043: can->height=height=QTOS((Q)BDY(NEXT(BDY(geom))));
1.22 saito 1044: }
1.24 saito 1045: if(wname)can->wname=BDY(wname);
1046: else can->wname="";
1.30 saito 1047: polarcalcNG(can);
1.22 saito 1048: create_canvas(can);
1.30 saito 1049: set_drawcolor(can->color);
1.27 saito 1050: polar_print(display,can);
1.30 saito 1051: reset_selection();
1052: reset_busy(can);
1.27 saito 1053: define_cursor(can->window,normalcur);
1.22 saito 1054: return id;
1055: }
1.30 saito 1056:
1057: void MSGdraw(char *str){
1058: int id,x,y;
1059: struct canvas *can;
1060:
1061: id=search_canvas();
1062: can=canvas[id];
1063: can->mode=modeNO(INTERACTIVE);
1064: can->width=300;
1065: can->height=300;
1066: can->wname="MSG";
1067: x=100;
1068: y=100;
1069: create_canvas(can);
1070: draw_character_string(display,can,x,y,str,0xff0000);
1071: }
1072:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>