1 #if !defined(__N_YGRAPH_H_)
16 #define Y_WIN YDrawInPixmap_(yd)
17 #define ZY_WIN YDrawInPixmap_(YPoints.yd)
18 typedef Drawable (*PixmapAndWindow)();
19 extern PixmapAndWindow YDrawInPixmap_;
21 #define G_MAXPOINTS 192
23 #define G_MAXLINE (G_MAXPOINTS*G_MAXCOLOR)
24 #define FILL_MODE 0x0100
25 #define POINT_MODE 0x0200
34 short *line_x, *line_y;
74 typedef int (*UserPoint)();
77 #define _X_DRAW 0x2000
78 #define _Y_DRAW 0x4000
79 #define _XY_DRAW 0x6000
80 #define _YX_DRAW 0x6000
85 #define _XBOX_JOB 0x1000
89 short cx1,cy1,cx2,cy2;
90 int colorBox,colorBar;
99 typedef int (*DrawFunction)();
119 typedef int (*LineCB)();
122 short c_point,xo,yo,x1,y1,x2,y2;
123 short n_points, width, xor_width;
124 char XorFlag,NoBox,NoLine,DrawAny;
125 int color,colorB,xcolor;
131 #define Int_(x) (int)(x+0.5)
134 #define YFlashAllPixmap YFlushAllPixmap
135 #define YFlashPixmap YFlushPixmap
136 #define YAllPixmapToWindow YFlushAllPixmap
137 #define YAllWindowToPixmap YLockAllPixmap
141 Drawable YDrawToDrawable();
142 Drawable YDrawInPixmap();
143 XGCValues* YmGetGCValues();
144 void YSetDrawInPixmapAndWindow();
146 int YClearPixmapXY();
147 int YClearDataPixmap();
148 int YClearAllPixmap();
149 void YClearDrawWindow();
150 int YPixmapToWindow();
151 int YWindowToPixmap();
153 int YFlushAllPixmap();
155 int YLockAllPixmap();
156 int YSetDrawInPixmap();
167 void YDrawRectangle();
168 void YFillRectangle();
173 int YSetClipOrigin();
178 void YSetLineWidth();
179 void YSetLineWidthStyle();
181 void YSetForeground();
182 void YSetBackground();
184 int YBufferSegment();
187 int YFlushSegments();
195 int AccelerateTopo();
203 int YDraw4DRectangle();
207 void YDrawImageString();
211 void WClearMiddleLine();
213 void WDeleteLastLine();
216 int WXorDeleteLine();
221 int WXorInsertLine();
224 int WNearestPoint2();
225 int WNearestPoint1();
230 Drawable YDrawToDrawable(
YDraw*);
231 Drawable YDrawInPixmap(
YDraw*);
232 XGCValues* YmGetGCValues(GC);
233 void YSetDrawInPixmapAndWindow(
int flag);
234 void YPutImage(
YDraw*,XImage*,
int sx,
int sy,
int dx,
int dy,
int w,
int h);
235 int YClearPixmapXY(
YDraw*,
int x,
int y,
int w,
int h);
236 int YClearDataPixmap(
YDraw*);
237 int YClearAllPixmap(
YDraw*);
238 void YClearDrawWindow(
YDraw*);
239 int YPixmapToWindow(
YDraw*,
int x,
int y,
int w,
int h,
int x0,
int y0);
240 int YWindowToPixmap(
YDraw*,
int x,
int y,
int w,
int h,
int x0,
int y0);
241 void YSetOldClip(
YDraw*);
242 int YFlushAllPixmap(
YDraw*);
243 int YFlushPixmap(
YDraw*);
244 int YLockAllPixmap(
YDraw*);
245 int YSetDrawInPixmap(
YDraw*,
int b);
246 void YClearArea(
YDraw*,
int x,
int y,
int w,
int h,Bool exposures);
247 void YClearWindow(
YDraw*);
248 void YCopyArea(
YDraw*,
int sx,
int sy,
int w,
int h,
int dx,
int dy);
249 void YDrawPoint(
YDraw*,
int x,
int y);
250 int YGetPixel(
YDraw*,
int x,
int y);
251 void YDrawLine(
YDraw*,
int x1,
int y1,
int x2,
int y2);
252 void YDrawLines(
YDraw*,XPoint* points,
int n,
int mode );
253 void YFillPolygon(
YDraw*,XPoint* points,
int n,
int shape,
int mode);
254 void YFillArcs(
YDraw*,XArc* arcs,
int n);
255 void YDrawArcs(
YDraw*,XArc* arcs,
int n);
256 void YDrawRectangle(
YDraw*,
int x,
int y,
int w,
int h);
257 void YFillRectangle(
YDraw*,
int x,
int y,
int w,
int h);
258 void YCopyLines(
YDraw*,
int dx,
int dy);
259 int YFlushLines(
YDraw*);
260 int YBufferLine(
YDraw*,
int x,
int y);
261 int YSetClip(
YDraw*,
int x1,
int y1,
int x2,
int y2);
262 int YSetClipOrigin(
YDraw*,
int x,
int y);
264 int YSetFunction(
YDraw*,
int func);
265 void YSetXor(
YDraw*);
266 void YDelXor(
YDraw*);
267 void YSetLineWidth(
YDraw*,
int w);
268 void YSetLineWidthStyle(
YDraw*,
int w,
int style);
269 void BoxBar(
YDraw*,
int x1,
int y1,
int x2,
int y2,
int c1,
int c2);
270 void YSetForeground(
YDraw*,
unsigned long foreground);
271 void YSetBackground(
YDraw*,
unsigned long background);
272 int YBufferPoint(
int ind,
int x,
int y);
273 int YBufferSegment(
int ind,
int x1,
int y1,
int x2,
int y2);
274 int YBufferBar(
int ind,
int x,
int y,
int w,
int h);
275 int YFlushPoints(
void);
276 int YFlushSegments(
void);
277 int YFlushBars(
void);
278 void YCopyPoints(
YDraw*,
int dx,
int dy);
279 int YInitPoints(
YDraw*,
int mc,
short* num);
280 int YInitBuffer(
YDraw*,
int mc,
short* num);
281 int MoveToXYZ(
int x,
int y,
int z);
282 int TopoWidth(
int width);
283 int InitView(
YDraw*,
int vw,
int mc,
short* num,
short* alt);
284 int AccelerateTopo(Drawable,
int widthH,
int heightH,
int widthV,
int heightV);
285 int YTopo(
YDraw*,
short* z_b,
int mc,
short* alt,
short* num,
int n_y,
int n_x,
286 short* line_y,
short* line_x,
int vw,
int d_x,
int d_y);
288 int SetColorArray(
char* NamePal,
int* ind);
290 int SetAltitude(
int n1,
short* alt1,
int n2,
short* alt2,
int zmin,
int zmax);
291 int LineToXYZ(
int x2,
int y2,
int z2);
292 int LineFromToXYZ(
int x1,
int y1,
int z1,
int x2,
int y2,
int z2);
293 void YDrawText(
YDraw* yd,
int x,
int y, XTextItem* items,
int nitems);
294 void YDrawText16(
YDraw* yd,
int x,
int y, XTextItem16* items,
int nitems);
295 void YDrawString(
YDraw *yd,
int x,
int y,
char *
string,
int length);
296 void YDrawImageString(
YDraw *yd,
int x,
int y,
char *
string,
int length);
297 void ClearText(
YDraw* yd,
int x1,
int y,
int x2);
307 int WNewLine(
YDraw* dw,
POINTS* ps,
int x,
int y,
int i);
308 int WXorNewLine(
YDraw* dw,
POINTS* ps,
int x,
int y,
int i);
309 int WInsertLine(
YDraw* dw,
POINTS* ps,
int x,
int y,
int i);
310 int WXorInsertLine(
YDraw* dw,
POINTS* ps,
int x,
int y,
int i);
313 int WNearestPoint2(
short *x_,
short *y_,
int x,
int y,
int n);
314 int WNearestPoint1(
short* x_,
int x,
int n);
315 int WNearestLine(
short *xx,
short *yy,
int x,
int y,
int i,
int n);
319 #define MapWidth TopoWidth
320 #define AccelerateMap AccelerateTopo
325 #define clrarea(yd,x,y,w,h,exposures) YClearArea(yd,x,y,w,h,exposures)
326 #define clrwin(yd) YClearWindow(yd)
327 #define cpyarea(yd, sx,sy, w,h, dx,dy) YCopyArea(yd, sx,sy, w,h, dx,dy)
328 #define fillpol(yd,points,n,shape,mode) YFillPolygon(yd,points,n,shape,mode)
329 #define set_clip(yd,x1,y1, x2,y2) YSetClip(yd,x1,y1, x2,y2)
330 #define un_clip(yd) YUnClip(yd)
331 #define Set_xor(yd) YSetXor(yd)
332 #define Del_xor(yd) YDelXor(yd)
333 #define Set_line_width(yd, w) YSetLineWidth(yd, w)
334 #define SetLineWidthStyle(yd, w, style) YSetLineWidthStyle(yd, w, style)
335 #define setforeground(yd, foreground) YSetForeground(yd, foreground)
336 #define setbackground(yd, background) YSetBackground(yd, background)
337 #define buffer_line(yd,x,y) YBufferLine(yd,x,y)
338 #define BufferPoint(ind, x,y) YBufferPoint(ind, x,y)
339 #define BufferSegment(ind,x1,y1, x2,y2) YBufferSegment(ind,x1,y1, x2,y2)
340 #define BufferBar(ind,x,y,w,h) YBufferBar(ind,x,y,w,h)
341 #define flush_lines(yd) YFlushLines(yd)
342 #define FlushPoints() YFlushPoints()
343 #define FlushSegments() YFlushSegments()
344 #define FlushBars() YFlushBars()
345 #define YInitSegments(yd, mc, num) YInitBuffer(yd, mc, num)
347 #define init_lines WInitLines
349 #define clear_line WClearLine
350 #define insert_line WInsertLine
352 #define delete_line WDeleteLine
353 #define clear_taile WDeleteLastLine
354 #define Xor_new_line WXorNewLine
355 #define Xor_Clear_line WXorDeleteLine
356 #define Xor_insert_line WXorInsertLine
357 #define refresh_lines WRefreshLines
358 #define NearestPoint WNearestPoint2
359 #define NearestLine WNearestLine
361 #define gprintf YPrintf
362 #define ClearText YClearText
365 typedef int (*YCgmF)();
367 #define YcgmSetForeground 1
368 #define YcgmSetBackground 2
369 #define YcgmSetFunction 3
370 #define YcgmSetLineAttributes 4
371 #define YcgmSetLineWidth 5
372 #define YcgmSetLineStyle 6
373 #define YcgmDrawLine 7
374 #define YcgmDrawLines 8
375 #define YcgmDrawSegments 9
376 #define YcgmDrawPoint 10
377 #define YcgmDrawPoints 11
378 #define YcgmCopyArea 12
379 #define YcgmSetTSOrigin 13
380 #define YcgmSetFillStyle 14
381 #define YcgmDrawRectangle 15
382 #define YcgmDrawRectangles 16
383 #define YcgmFillRectangle 17
384 #define YcgmFillPolygon 18
385 #define YcgmDrawCircle 19
386 #define YCgmSetClipRectangles 20
387 #define YcgmUnsetClip 21
391 extern Window Draw_win;
Definition: ymprog.h:1019