initial commit
Showing the changes to sys/src/cmd/plot/libplot/mplot.h (1 of 14470 files). Show all
Unified · Split
| @@ -0,0 +1,56 @@ | ||
| 1 | +/* | |
| 2 | + * This file is part of the UCB release of Plan 9. It is subject to the license | |
| 3 | + * terms in the LICENSE file found in the top-level directory of this | |
| 4 | + * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No | |
| 5 | + * part of the UCB release of Plan 9, including this file, may be copied, | |
| 6 | + * modified, propagated, or distributed except according to the terms contained | |
| 7 | + * in the LICENSE file. | |
| 8 | + */ | |
| 9 | + | |
| 10 | +#include <u.h> | |
| 11 | +#include <libc.h> | |
| 12 | +#include <stdio.h> | |
| 13 | +#include <draw.h> | |
| 14 | +#include <event.h> | |
| 15 | +#define SCX(A) ((((A) - e1->xmin)*e1->scalex + e1->left)+.5) | |
| 16 | +#define SCY(A) ((((A) - e1->ymin)*e1->scaley + e1->bottom)+.5) | |
| 17 | +#define SCR(A) ((A)*e1->scalex+.5) | |
| 18 | +#define unorm(y) (double)(e1->sidey - y) | |
| 19 | +#define BIGINT 0x3FFFFFFF /* a large, but valid, int */ | |
| 20 | +extern struct penvir { | |
| 21 | + double left, bottom; | |
| 22 | + double xmin, ymin; | |
| 23 | + double scalex, scaley; | |
| 24 | + double sidex, sidey; | |
| 25 | + double copyx, copyy; | |
| 26 | + double quantum; | |
| 27 | + double grade; | |
| 28 | + int pgap; | |
| 29 | + double pslant; | |
| 30 | + int pmode, foregr, backgr; | |
| 31 | +} *e0, *e1, *esave; | |
| 32 | +#define RADIAN 57.3 /* radians per degree */ | |
| 33 | +struct seg { | |
| 34 | + int x, y, X, Y; | |
| 35 | + char stat; | |
| 36 | +}; | |
| 37 | + | |
| 38 | +/* | |
| 39 | + * display parameters | |
| 40 | + */ | |
| 41 | +int clipminx, clipminy, clipmaxx, clipmaxy; /* clipping rectangle */ | |
| 42 | +int mapminx, mapminy, mapmaxx, mapmaxy; /* centered square */ | |
| 43 | +/* | |
| 44 | + * Prototypes | |
| 45 | + */ | |
| 46 | +#include "../plot.h" | |
| 47 | +void m_clrwin(int, int, int, int, int); | |
| 48 | +void m_finish(void); | |
| 49 | +void m_initialize(char *); | |
| 50 | +int m_text(int, int, char *, char *, int, int, int); | |
| 51 | +void m_vector(int, int, int, int, int); | |
| 52 | +void m_swapbuf(void); | |
| 53 | +void m_dblbuf(void); | |
| 54 | +int bcolor(char *); | |
| 55 | +void sscpy(struct penvir *, struct penvir *); | |
| 56 | +Image *getcolor(int); | |