Annotation of OpenXM_contrib2/asir2000/plot/ifplot.h, Revision 1.6
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.6 ! noro 48: * $OpenXM: OpenXM_contrib2/asir2000/plot/ifplot.h,v 1.5 2000/11/09 01:51:12 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:
1.5 noro 97: #define MAXCANVAS 64
1.1 noro 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)
1.5 noro 148: #define DRAWSTRING(d,p,g,x,y,s,l) TextOut(p,x,y,s,l)
149: /* #define TEXTWIDTH(f,s,l) */
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))
1.5 noro 178: #define MKRVECT3(v,x,y,z)\
179: ((v)=(RealVect *)MALLOC_ATOMIC(sizeof(RealVect)+2*sizeof(int)),\
180: (v)->len=3,(v)->body[0]=(x),(v)->body[1]=(y),(v)->body[2]=(z))
181: #define MKRVECT4(v,x,y,z,u)\
1.4 noro 182: ((v)=(RealVect *)MALLOC_ATOMIC(sizeof(RealVect)+3*sizeof(int)),\
1.5 noro 183: (v)->len=4,(v)->body[0]=(x),(v)->body[1]=(y),(v)->body[2]=(z),(v)->body[3]=(u))
184:
185: #define RV_POINT 1
186: #define RV_LINE 2
187: #define RV_ARC 3
1.4 noro 188:
1.1 noro 189: struct canvas {
190: int index;
191: #if defined(THINK_C)
192: Rect rect;
193: WindowRecord record;
194: WindowPtr window;
195: #ifndef COPYBITS
196: PicHandle pix;
197: #else
198: BitMap pix,wbits;
199: RgnHandle rgnsav;
200: #endif
1.4 noro 201: #elif defined(VISUAL)
202: /* for Visual C++ */
203: void *window; /* pointer to CMainFrame */
204: HWND hwnd; /* handle to the canvas window */
205: HDC pix; /* shadow DC on memory */
206: char *prefix;
207: int percentage;
208: struct canvas *real_can;
1.1 noro 209: #else
210: Widget shell,xcoord,ycoord,xdone,ydone,level,wideb,preciseb,noaxisb;
211: Window window;
212: Pixmap pix;
213: #endif
214: char *wname;
215: char mode;
216: char wide;
217: char precise;
218: char noaxis;
219: V vx,vy;
220: P formula;
221: int width,height;
222: double xmin,xmax;
223: double ymin,ymax;
224: double zmin,zmax;
225: int nzstep;
226: Q qxmin,qxmax;
227: Q qymin,qymax;
228: struct pa *pa;
1.4 noro 229: /* to register the history in the interactive mode */
230: NODE history;
1.1 noro 231: };
232:
233: extern struct canvas *canvas[];
234: extern struct canvas *current_can;
235:
236: #ifdef INET
237: extern VL CO;
238: extern int stream;
239: #endif
240:
241: extern DISPLAY *display;
242: extern CURSOR normalcur,runningcur,errorcur;
243:
1.4 noro 244: #if defined(VISUAL)
245: extern POINT start_point,end_point;
246: extern SIZE cansize;
247: #else
1.1 noro 248: extern Window rootwin;
1.6 ! noro 249: extern GC drawGC,dashGC,hlGC,scaleGC,clearGC,xorGC,colorGC,cdrawGC;
1.1 noro 250: extern XFontStruct *sffs;
251: #endif
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>