Blob


1 #undef pipe
3 typedef struct Document Document;
5 struct Document {
6 char *docname;
7 int npage;
8 int fwdonly;
9 char* (*pagename)(Document*, int);
10 Image* (*drawpage)(Document*, int);
11 int (*addpage)(Document*, char*);
12 int (*rmpage)(Document*, int);
13 Biobuf *b;
14 void *extra;
15 };
17 typedef struct Graphic Graphic;
19 struct Graphic {
20 int type;
21 int fd;
22 char *name;
23 };
25 enum {
26 Ipic,
27 Itiff,
28 Ijpeg,
29 Igif,
30 Iinferno,
31 Ifax,
32 Icvt2pic,
33 Iplan9bm,
34 Iccittg4,
35 Ippm,
36 Ipng,
37 Iyuv,
38 Ibmp,
39 };
42 void *emalloc(int);
43 void *erealloc(void*, int);
44 char *estrdup(char*);
45 int spawncmd(char*, char **, int, int, int);
47 int spooltodisk(uchar*, int, char**);
48 int stdinpipe(uchar*, int);
49 Document *initps(Biobuf*, int, char**, uchar*, int);
50 Document *initpdf(Biobuf*, int, char**, uchar*, int);
51 Document *initgfx(Biobuf*, int, char**, uchar*, int);
52 Document *inittroff(Biobuf*, int, char**, uchar*, int);
53 Document *initdvi(Biobuf*, int, char**, uchar*, int);
54 Document *initmsdoc(Biobuf*, int, char**, uchar*, int);
56 void viewer(Document*);
57 extern Cursor reading;
58 extern int chatty;
59 extern int goodps;
60 extern int textbits, gfxbits;
61 extern int reverse;
62 extern int clean;
63 extern int ppi;
64 extern int teegs;
65 extern int truetoboundingbox;
66 extern int wctlfd;
67 extern int resizing;
68 extern int mknewwindow;
70 void rot180(Image*);
71 Image *rot90(Image*);
72 Image *rot270(Image*);
73 Image *resample(Image*, Image*);
75 /* ghostscript interface shared by ps, pdf */
76 typedef struct GSInfo GSInfo;
77 struct GSInfo {
78 Graphic g;
79 int gsfd;
80 Biobuf gsrd;
81 int gspid;
82 int ppi;
83 };
84 void waitgs(GSInfo*);
85 int gscmd(GSInfo*, char*, ...);
86 int spawngs(GSInfo*, char*);
87 void setdim(GSInfo*, Rectangle, int, int);
88 int spawnwriter(GSInfo*, Biobuf*);
89 Rectangle screenrect(void);
90 void newwin(void);
91 void zerox(void);
92 Rectangle winrect(void);
93 void resize(int, int);
94 int max(int, int);
95 int min(int, int);
96 void wexits(char*);
97 Image* xallocimage(Display*, Rectangle, ulong, int, ulong);
98 int bell(void*, char*);
99 int opentemp(char *template);
100 Image* convert(Graphic *g);
102 extern int stdinfd;
103 extern int truecolor;
105 /* BUG BUG BUG BUG BUG: cannot use new draw operations in drawterm,
106 * or in vncs, and there is a bug in the kernel for copying images
107 * from cpu memory -> video memory (memmove is not being used).
108 * until all that is settled, ignore the draw operators.
109 */
110 #define drawop(a,b,c,d,e,f) draw(a,b,c,d,e)
111 #define gendrawop(a,b,c,d,e,f,g) gendraw(a,b,c,d,e,f)