]> git.lizzy.rs Git - plan9front.git/blob - sys/src/cmd/plot/libplot/mplot.h
- use the double-buffer buffer to allow redrawing on resize events.
[plan9front.git] / sys / src / cmd / plot / libplot / mplot.h
1 #include <u.h>
2 #include <libc.h>
3 //#include <stdio.h>
4 #include <draw.h>
5 #include <event.h>
6 #define SCX(A) ((((A) - e1->xmin)*e1->scalex  + e1->left)+.5)
7 #define SCY(A) ((((A) - e1->ymin)*e1->scaley + e1->bottom)+.5)
8 #define SCR(A) ((A)*e1->scalex+.5)
9 #define unorm(y)        (double)(e1->sidey - y)
10 #define BIGINT  0x3FFFFFFF      /* a large, but valid, int */
11 extern struct penvir {
12         double left, bottom;
13         double xmin, ymin;
14         double scalex, scaley;
15         double sidex, sidey;
16         double copyx, copyy;
17         double quantum;
18         double grade;
19         int pgap;
20         double pslant;
21         int pmode, foregr, backgr;
22 } *e0, *e1, *esave;
23 #define RADIAN 57.3     /* radians per degree */
24 struct seg {
25         int x, y, X, Y;
26         char stat;
27 };
28
29 /*
30  * display parameters
31  */
32 int clipminx, clipminy, clipmaxx, clipmaxy;     /* clipping rectangle */
33 int mapminx, mapminy, mapmaxx, mapmaxy;         /* centered square */
34 /*
35  * Prototypes
36  */
37 #include "../plot.h"
38 void m_clrwin(int, int, int, int, int);
39 void m_finish(void);
40 void m_initialize(char *);
41 int m_text(int, int, char *, char *, int, int, int);
42 void m_dpt(double, double);
43 void m_vector(int, int, int, int, int);
44 void m_swapbuf(void);
45 void m_dblbuf(void);
46 int bcolor(char *);
47 void sscpy(struct penvir *, struct penvir *);
48 Image *getcolor(int);