[BACK]Return to ox_X.asir CVS log [TXT][DIR] Up to [local] / OpenXM / src / ox_toolkit

Annotation of OpenXM/src/ox_toolkit/ox_X.asir, Revision 1.1

1.1     ! takayama    1: /*$OpenXM$*/
        !             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:
        !            62: /*
        !            63: #
        !            64: # Copyright (c) 1999 Nobuki Takayama <takayama@math.sci.kobe-u.ac.jp>. Kobe.
        !            65: # All rights reserved.
        !            66: #
        !            67: # Redistribution and use in source and binary forms, with or without
        !            68: # modification, are permitted provided that the following conditions
        !            69: # are met:
        !            70: # 1. Redistributions of source code must retain the above copyright
        !            71: #    notice, this list of conditions and the following disclaimer.
        !            72: # 2. Redistributions in binary form must reproduce the above copyright
        !            73: #    notice, this list of conditions and the following disclaimer in the
        !            74: #    documentation and/or other materials provided with the distribution.
        !            75: #
        !            76: # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
        !            77: # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        !            78: # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
        !            79: # ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
        !            80: # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        !            81: # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
        !            82: # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
        !            83: # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
        !            84: # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
        !            85: # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
        !            86: # SUCH DAMAGE.
        !            87: #
        !            88: */
        !            89:
        !            90:
        !            91:
        !            92:
        !            93:

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>