Annotation of OpenXM/src/ox_toolkit/ox_X.asir, Revision 1.2
1.2 ! takayama 1: /*$OpenXM: OpenXM/src/ox_toolkit/ox_X.asir,v 1.1 1999/12/16 09:38:09 takayama Exp $*/
1.1 takayama 2: print("Type in xsample_demo(); to see a demonstration.")$
3: Xsample_proc = -1$
4:
5: #define Xsample_FIND_PROC(P) P = getopt(proc);\
6: if (type(P) == -1) {\
7: P = xsample_find_proc();\
8: }\
9:
10:
11: def xsample_find_proc() {
12: extern Xsample_proc;
13: if (Xsample_proc == -1) {
14: Xsample_proc = xsample_start();
15: }
16: return(Xsample_proc);
17: }
18:
19: def xsample_start() {
20: extern Xsample_proc;
21:
22: P = ox_launch(0,getenv("OpenXM_HOME")+"/src/ox_toolkit/ox_Xsample");
23: /*
24: P = ox_launch_nox(0,getenv("OpenXM_HOME")+"/src/ox_toolkit/ox_Xsample");
25: */
26: Xsample_proc = P;
27: return(P);
28: }
29:
30: def xsample_setpixel(X,Y) {
31: Xsample_FIND_PROC(P);
32: ox_cmo_rpc(P,"setpixel",X,Y);
33: }
34:
35: def xsample_moveto(X,Y) {
36: Xsample_FIND_PROC(P);
37: ox_cmo_rpc(P,"moveto",X,Y);
38: }
39:
40: def xsample_lineto(X,Y) {
41: Xsample_FIND_PROC(P);
42: ox_cmo_rpc(P,"lineto",X,Y);
43: }
44:
45: def xsample_clear(X,Y) {
46: Xsample_FIND_PROC(P);
47: ox_cmo_rpc(P,"clear",X,Y);
48: }
49:
50: def xsample_demo() {
51: xsample_moveto(10,10);
52: xsample_lineto(400,10);
53: xsample_moveto(10,10);
54: xsample_lineto(10,400);
55: for (I=0; I<300 ; I++) {
56: xsample_setpixel(I,I);
57: }
58: }
59:
60: end$
61:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>