[BACK]Return to ifplot.h CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000 / plot

Annotation of OpenXM_contrib2/asir2000/plot/ifplot.h, Revision 1.4

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.4     ! noro       48:  * $OpenXM: OpenXM_contrib2/asir2000/plot/ifplot.h,v 1.3 2000/08/22 05:04:31 noro Exp $
1.2       noro       49: */
1.1       noro       50: #if defined(THINK_C)
                     51: #include        <QuickDraw.h>
                     52: #include        <Windows.h>
                     53: #include        <Events.h>
                     54: #include        <OSUtils.h>
                     55: #include        <ToolUtils.h>
                     56: #include        <Fonts.h>
                     57: /* #include        <Strings.h> */
1.4     ! noro       58: #elif defined(VISUAL)
        !            59: /* for Visual C++ */
        !            60: #include <windows.h>
1.1       noro       61: #else
                     62: #include <sys/types.h>
                     63: #include <X11/Xlib.h>
                     64: #include <X11/Xutil.h>
                     65: #include <X11/Xatom.h>
                     66: #include <X11/Intrinsic.h>
                     67: #include <X11/StringDefs.h>
                     68: #include <X11/Shell.h>
                     69: #include <X11/Xaw/Form.h>
                     70: #include <X11/Xaw/Command.h>
                     71: #include <X11/Xaw/Label.h>
                     72: #include <X11/Xaw/Simple.h>
                     73: #include <X11/Xaw/Dialog.h>
                     74: #include <X11/Xaw/Box.h>
                     75: #ifndef OLDX11
                     76: #include <X11/Xaw/Toggle.h>
                     77: #include <X11/Xaw/Scrollbar.h>
                     78: #else
                     79: #include <X11/Xaw/Scroll.h>
                     80: #define toggleWidgetClass commandWidgetClass
                     81: #define XtPointer pointer
                     82: #define XawDialogAddButton XtDialogAddButton
                     83: #define XawScrollbarSetThumb XtScrollBarSetThumb
                     84: #endif
                     85: #endif
                     86:
                     87: #define C_IFPLOT C_PRIV
                     88: #define C_BMPLOT C_PRIV+1
                     89: #define C_CLEAR C_PRIV+2
                     90: #define C_PMFLUSH C_PRIV+3
                     91: #define C_CONPLOT C_PRIV+4
                     92: #define C_PLOTOVER C_PRIV+5
                     93: #define C_PLOT C_PRIV+6
                     94: #define C_APLOT C_PRIV+7
                     95: #define C_DRAWCIRCLE C_PRIV+8
                     96:
                     97: #define MAXCANVAS 16
                     98: #define MAXGC 16
                     99: #if defined(THINK_C)
                    100: #define DEFAULTWIDTH 200
                    101: #define DEFAULTHEIGHT 200
                    102: #else
                    103: #define DEFAULTWIDTH 400
                    104: #define DEFAULTHEIGHT 400
                    105: #endif
                    106:
                    107: #define MODE_IFPLOT 0
                    108: #define MODE_CONPLOT 1
                    109: #define MODE_PLOT 2
1.4     ! noro      110: #define MODE_INTERACTIVE 3
1.1       noro      111:
                    112: #define DIR_X 0
                    113: #define DIR_Y 1
                    114: #define DIR_Z 2
                    115:
                    116: #if defined(THINK_C)
                    117: #define COPYBITS
                    118:
                    119: #define POINT Point
                    120: #define XC(a) ((a).h)
                    121: #define YC(a) ((a).v)
                    122: #define DRAWPOINT(d,p,g,x,y) MoveTo(x,y); Line(0,0)
                    123: #define DRAWLINE(d,p,g,x,y,u,v) MoveTo(x,y); LineTo(u,v)
                    124: #define DRAWSTRING(d,p,g,x,y,s,l) MoveTo(x,y); DrawText(s,0,l)
                    125: #define TEXTWIDTH(f,s,l) TextWidth(s,0,l)
                    126: #define DISPLAY int
                    127: #define WINDOW WindowPtr
                    128: #define CURSOR CursHandle
                    129: #ifndef COPYBITS
                    130: #define DRAWABLE PicHandle
                    131: #else
                    132: #define DRAWABLE BitMap
                    133: #endif
1.4     ! noro      134:
        !           135: #elif defined(VISUAL)
        !           136: /* for Visual C++ */
        !           137: #define XC(a) ((a).x)
        !           138: #define YC(a) ((a).y)
        !           139: #define DISPLAY int
        !           140: #define WINDOW int
        !           141: #define CURSOR int
        !           142: #define DRAWABLE HDC
        !           143:
        !           144: /* XXX : use GC argument as the color */
        !           145: #define DRAWPOINT(d,p,g,x,y) SetPixel(p,x,y,0)
        !           146:
        !           147: #define DRAWLINE(d,p,g,x,y,u,v) MoveToEx(p,x,y,&oldpos); LineTo(p,u,v)
        !           148: #define DRAWSTRING(d,p,g,x,y,s,l)
        !           149: #define TEXTWIDTH(f,s,l) 0
1.1       noro      150: #else
1.4     ! noro      151: /* for UNIX */
1.1       noro      152: #define POINT XPoint
                    153: #define XC(a) ((a).x)
                    154: #define YC(a) ((a).y)
                    155: #define DRAWPOINT(d,p,g,x,y) (count_and_flush(),XDrawPoint(d,p,g,x,y))
                    156: #define DRAWLINE(d,p,g,x,y,u,v) XDrawLine(d,p,g,x,y,u,v)
                    157: #define DRAWSTRING(d,p,g,x,y,s,l) XDrawString(d,p,g,x,y,s,l)
                    158: #define TEXTWIDTH(f,s,l) XTextWidth(f,s,l)
                    159: #define DISPLAY Display
                    160: #define WINDOW Window
                    161: #define CURSOR Cursor
                    162: #define DRAWABLE Drawable
                    163: #endif
                    164:
                    165: struct pa {
                    166:        int length;
                    167:        POINT *pos;
                    168: };
                    169:
1.4     ! noro      170: typedef struct RealVect {
        !           171:        int len;
        !           172:        int body[1];
        !           173: } RealVect;
        !           174:
        !           175: #define MKRVECT2(v,x,y)\
        !           176: ((v)=(RealVect *)MALLOC_ATOMIC(sizeof(RealVect)+sizeof(int)),\
        !           177:  (v)->len=2,(v)->body[0]=(x),(v)->body[1]=(y))
        !           178: #define MKRVECT4(v,x,y,a,b)\
        !           179: ((v)=(RealVect *)MALLOC_ATOMIC(sizeof(RealVect)+3*sizeof(int)),\
        !           180:  (v)->len=2,(v)->body[0]=(x),(v)->body[1]=(y),(v)->body[2]=(a),(v)->body[3]=(b))
        !           181:
1.1       noro      182: struct canvas {
                    183:        int index;
                    184: #if defined(THINK_C)
                    185:        Rect rect;
                    186:        WindowRecord record;
                    187:        WindowPtr window;
                    188: #ifndef COPYBITS
                    189:        PicHandle pix;
                    190: #else
                    191:        BitMap pix,wbits;
                    192:        RgnHandle rgnsav;
                    193: #endif
1.4     ! noro      194: #elif defined(VISUAL)
        !           195: /* for Visual C++ */
        !           196:        void *window; /* pointer to CMainFrame */
        !           197:        HWND hwnd; /* handle to the canvas window */
        !           198:        HDC pix; /* shadow DC on memory */
        !           199:        char *prefix;
        !           200:        int percentage;
        !           201:        struct canvas *real_can;
1.1       noro      202: #else
                    203:        Widget shell,xcoord,ycoord,xdone,ydone,level,wideb,preciseb,noaxisb;
                    204:        Window window;
                    205:        Pixmap pix;
                    206: #endif
                    207:        char *wname;
                    208:        char mode;
                    209:        char wide;
                    210:        char precise;
                    211:        char noaxis;
                    212:        V vx,vy;
                    213:        P formula;
                    214:        int width,height;
                    215:        double xmin,xmax;
                    216:        double ymin,ymax;
                    217:        double zmin,zmax;
                    218:        int nzstep;
                    219:        Q qxmin,qxmax;
                    220:        Q qymin,qymax;
                    221:        struct pa *pa;
1.4     ! noro      222:        /* to register the history in the interactive mode */
        !           223:        NODE history;
1.1       noro      224: };
                    225:
                    226: extern struct canvas *canvas[];
                    227: extern struct canvas *current_can;
                    228:
                    229: #ifdef INET
                    230: extern VL CO;
                    231: extern int stream;
                    232: #endif
                    233:
                    234: extern DISPLAY *display;
                    235: extern CURSOR normalcur,runningcur,errorcur;
                    236:
1.4     ! noro      237: #if defined(VISUAL)
        !           238: extern POINT start_point,end_point;
        !           239: extern SIZE cansize;
        !           240: #else
1.1       noro      241: extern Window rootwin;
                    242: extern GC drawGC,dashGC,hlGC,scaleGC,clearGC,xorGC,colorGC;
                    243: extern XFontStruct *sffs;
                    244: #endif

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